github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/apigateway/getAuthorizers.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 // Provides details about multiple API Gateway Authorizers. 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/apigateway" 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 := apigateway.GetAuthorizers(ctx, &apigateway.GetAuthorizersArgs{ 32 // RestApiId: exampleAwsApiGatewayRestApi.Id, 33 // }, nil) 34 // if err != nil { 35 // return err 36 // } 37 // return nil 38 // }) 39 // } 40 // 41 // ``` 42 // <!--End PulumiCodeChooser --> 43 func GetAuthorizers(ctx *pulumi.Context, args *GetAuthorizersArgs, opts ...pulumi.InvokeOption) (*GetAuthorizersResult, error) { 44 opts = internal.PkgInvokeDefaultOpts(opts) 45 var rv GetAuthorizersResult 46 err := ctx.Invoke("aws:apigateway/getAuthorizers:getAuthorizers", 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 getAuthorizers. 54 type GetAuthorizersArgs struct { 55 // ID of the associated REST API. 56 RestApiId string `pulumi:"restApiId"` 57 } 58 59 // A collection of values returned by getAuthorizers. 60 type GetAuthorizersResult struct { 61 // The provider-assigned unique ID for this managed resource. 62 Id string `pulumi:"id"` 63 // List of Authorizer identifiers. 64 Ids []string `pulumi:"ids"` 65 RestApiId string `pulumi:"restApiId"` 66 } 67 68 func GetAuthorizersOutput(ctx *pulumi.Context, args GetAuthorizersOutputArgs, opts ...pulumi.InvokeOption) GetAuthorizersResultOutput { 69 return pulumi.ToOutputWithContext(context.Background(), args). 70 ApplyT(func(v interface{}) (GetAuthorizersResult, error) { 71 args := v.(GetAuthorizersArgs) 72 r, err := GetAuthorizers(ctx, &args, opts...) 73 var s GetAuthorizersResult 74 if r != nil { 75 s = *r 76 } 77 return s, err 78 }).(GetAuthorizersResultOutput) 79 } 80 81 // A collection of arguments for invoking getAuthorizers. 82 type GetAuthorizersOutputArgs struct { 83 // ID of the associated REST API. 84 RestApiId pulumi.StringInput `pulumi:"restApiId"` 85 } 86 87 func (GetAuthorizersOutputArgs) ElementType() reflect.Type { 88 return reflect.TypeOf((*GetAuthorizersArgs)(nil)).Elem() 89 } 90 91 // A collection of values returned by getAuthorizers. 92 type GetAuthorizersResultOutput struct{ *pulumi.OutputState } 93 94 func (GetAuthorizersResultOutput) ElementType() reflect.Type { 95 return reflect.TypeOf((*GetAuthorizersResult)(nil)).Elem() 96 } 97 98 func (o GetAuthorizersResultOutput) ToGetAuthorizersResultOutput() GetAuthorizersResultOutput { 99 return o 100 } 101 102 func (o GetAuthorizersResultOutput) ToGetAuthorizersResultOutputWithContext(ctx context.Context) GetAuthorizersResultOutput { 103 return o 104 } 105 106 // The provider-assigned unique ID for this managed resource. 107 func (o GetAuthorizersResultOutput) Id() pulumi.StringOutput { 108 return o.ApplyT(func(v GetAuthorizersResult) string { return v.Id }).(pulumi.StringOutput) 109 } 110 111 // List of Authorizer identifiers. 112 func (o GetAuthorizersResultOutput) Ids() pulumi.StringArrayOutput { 113 return o.ApplyT(func(v GetAuthorizersResult) []string { return v.Ids }).(pulumi.StringArrayOutput) 114 } 115 116 func (o GetAuthorizersResultOutput) RestApiId() pulumi.StringOutput { 117 return o.ApplyT(func(v GetAuthorizersResult) string { return v.RestApiId }).(pulumi.StringOutput) 118 } 119 120 func init() { 121 pulumi.RegisterOutputType(GetAuthorizersResultOutput{}) 122 }