github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/apigateway/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 apigateway 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 // ## Example Usage 15 // 16 // <!--Start PulumiCodeChooser --> 17 // ```go 18 // package main 19 // 20 // import ( 21 // 22 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/apigateway" 23 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 24 // 25 // ) 26 // 27 // func main() { 28 // pulumi.Run(func(ctx *pulumi.Context) error { 29 // _, err := apigateway.GetExport(ctx, &apigateway.GetExportArgs{ 30 // RestApiId: exampleAwsApiGatewayStage.RestApiId, 31 // StageName: exampleAwsApiGatewayStage.StageName, 32 // ExportType: "oas30", 33 // }, nil) 34 // if err != nil { 35 // return err 36 // } 37 // return nil 38 // }) 39 // } 40 // 41 // ``` 42 // <!--End PulumiCodeChooser --> 43 func GetExport(ctx *pulumi.Context, args *GetExportArgs, opts ...pulumi.InvokeOption) (*GetExportResult, error) { 44 opts = internal.PkgInvokeDefaultOpts(opts) 45 var rv GetExportResult 46 err := ctx.Invoke("aws:apigateway/getExport:getExport", args, &rv, opts...) 47 if err != nil { 48 return nil, err 49 } 50 return &rv, nil 51 } 52 53 // A collection of arguments for invoking getExport. 54 type GetExportArgs struct { 55 // Content-type of the export. Valid values are `application/json` and `application/yaml` are supported for `exportType` `ofoas30` and `swagger`. 56 Accepts *string `pulumi:"accepts"` 57 // Type of export. Acceptable values are `oas30` for OpenAPI 3.0.x and `swagger` for Swagger/OpenAPI 2.0. 58 ExportType string `pulumi:"exportType"` 59 // 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. 60 Parameters map[string]string `pulumi:"parameters"` 61 // Identifier of the associated REST API. 62 RestApiId string `pulumi:"restApiId"` 63 // Name of the Stage that will be exported. 64 StageName string `pulumi:"stageName"` 65 } 66 67 // A collection of values returned by getExport. 68 type GetExportResult struct { 69 Accepts *string `pulumi:"accepts"` 70 // API Spec. 71 Body string `pulumi:"body"` 72 // Content-disposition header value in the HTTP response. 73 ContentDisposition string `pulumi:"contentDisposition"` 74 // Content-type header value in the HTTP response. 75 ContentType string `pulumi:"contentType"` 76 ExportType string `pulumi:"exportType"` 77 // The provider-assigned unique ID for this managed resource. 78 Id string `pulumi:"id"` 79 Parameters map[string]string `pulumi:"parameters"` 80 RestApiId string `pulumi:"restApiId"` 81 StageName string `pulumi:"stageName"` 82 } 83 84 func GetExportOutput(ctx *pulumi.Context, args GetExportOutputArgs, opts ...pulumi.InvokeOption) GetExportResultOutput { 85 return pulumi.ToOutputWithContext(context.Background(), args). 86 ApplyT(func(v interface{}) (GetExportResult, error) { 87 args := v.(GetExportArgs) 88 r, err := GetExport(ctx, &args, opts...) 89 var s GetExportResult 90 if r != nil { 91 s = *r 92 } 93 return s, err 94 }).(GetExportResultOutput) 95 } 96 97 // A collection of arguments for invoking getExport. 98 type GetExportOutputArgs struct { 99 // Content-type of the export. Valid values are `application/json` and `application/yaml` are supported for `exportType` `ofoas30` and `swagger`. 100 Accepts pulumi.StringPtrInput `pulumi:"accepts"` 101 // Type of export. Acceptable values are `oas30` for OpenAPI 3.0.x and `swagger` for Swagger/OpenAPI 2.0. 102 ExportType pulumi.StringInput `pulumi:"exportType"` 103 // 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. 104 Parameters pulumi.StringMapInput `pulumi:"parameters"` 105 // Identifier of the associated REST API. 106 RestApiId pulumi.StringInput `pulumi:"restApiId"` 107 // Name of the Stage that will be exported. 108 StageName pulumi.StringInput `pulumi:"stageName"` 109 } 110 111 func (GetExportOutputArgs) ElementType() reflect.Type { 112 return reflect.TypeOf((*GetExportArgs)(nil)).Elem() 113 } 114 115 // A collection of values returned by getExport. 116 type GetExportResultOutput struct{ *pulumi.OutputState } 117 118 func (GetExportResultOutput) ElementType() reflect.Type { 119 return reflect.TypeOf((*GetExportResult)(nil)).Elem() 120 } 121 122 func (o GetExportResultOutput) ToGetExportResultOutput() GetExportResultOutput { 123 return o 124 } 125 126 func (o GetExportResultOutput) ToGetExportResultOutputWithContext(ctx context.Context) GetExportResultOutput { 127 return o 128 } 129 130 func (o GetExportResultOutput) Accepts() pulumi.StringPtrOutput { 131 return o.ApplyT(func(v GetExportResult) *string { return v.Accepts }).(pulumi.StringPtrOutput) 132 } 133 134 // API Spec. 135 func (o GetExportResultOutput) Body() pulumi.StringOutput { 136 return o.ApplyT(func(v GetExportResult) string { return v.Body }).(pulumi.StringOutput) 137 } 138 139 // Content-disposition header value in the HTTP response. 140 func (o GetExportResultOutput) ContentDisposition() pulumi.StringOutput { 141 return o.ApplyT(func(v GetExportResult) string { return v.ContentDisposition }).(pulumi.StringOutput) 142 } 143 144 // Content-type header value in the HTTP response. 145 func (o GetExportResultOutput) ContentType() pulumi.StringOutput { 146 return o.ApplyT(func(v GetExportResult) string { return v.ContentType }).(pulumi.StringOutput) 147 } 148 149 func (o GetExportResultOutput) ExportType() pulumi.StringOutput { 150 return o.ApplyT(func(v GetExportResult) string { return v.ExportType }).(pulumi.StringOutput) 151 } 152 153 // The provider-assigned unique ID for this managed resource. 154 func (o GetExportResultOutput) Id() pulumi.StringOutput { 155 return o.ApplyT(func(v GetExportResult) string { return v.Id }).(pulumi.StringOutput) 156 } 157 158 func (o GetExportResultOutput) Parameters() pulumi.StringMapOutput { 159 return o.ApplyT(func(v GetExportResult) map[string]string { return v.Parameters }).(pulumi.StringMapOutput) 160 } 161 162 func (o GetExportResultOutput) RestApiId() pulumi.StringOutput { 163 return o.ApplyT(func(v GetExportResult) string { return v.RestApiId }).(pulumi.StringOutput) 164 } 165 166 func (o GetExportResultOutput) StageName() pulumi.StringOutput { 167 return o.ApplyT(func(v GetExportResult) string { return v.StageName }).(pulumi.StringOutput) 168 } 169 170 func init() { 171 pulumi.RegisterOutputType(GetExportResultOutput{}) 172 }