github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/apigatewayv2/getApis.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  // Provides details about multiple Amazon API Gateway Version 2 APIs.
    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.GetApis(ctx, &apigatewayv2.GetApisArgs{
    32  //				ProtocolType: pulumi.StringRef("HTTP"),
    33  //			}, nil)
    34  //			if err != nil {
    35  //				return err
    36  //			}
    37  //			return nil
    38  //		})
    39  //	}
    40  //
    41  // ```
    42  // <!--End PulumiCodeChooser -->
    43  func GetApis(ctx *pulumi.Context, args *GetApisArgs, opts ...pulumi.InvokeOption) (*GetApisResult, error) {
    44  	opts = internal.PkgInvokeDefaultOpts(opts)
    45  	var rv GetApisResult
    46  	err := ctx.Invoke("aws:apigatewayv2/getApis:getApis", 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 getApis.
    54  type GetApisArgs struct {
    55  	// API name.
    56  	Name *string `pulumi:"name"`
    57  	// API protocol.
    58  	ProtocolType *string `pulumi:"protocolType"`
    59  	// Map of tags, each pair of which must exactly match
    60  	// a pair on the desired APIs.
    61  	Tags map[string]string `pulumi:"tags"`
    62  }
    63  
    64  // A collection of values returned by getApis.
    65  type GetApisResult struct {
    66  	// The provider-assigned unique ID for this managed resource.
    67  	Id string `pulumi:"id"`
    68  	// Set of API identifiers.
    69  	Ids          []string          `pulumi:"ids"`
    70  	Name         *string           `pulumi:"name"`
    71  	ProtocolType *string           `pulumi:"protocolType"`
    72  	Tags         map[string]string `pulumi:"tags"`
    73  }
    74  
    75  func GetApisOutput(ctx *pulumi.Context, args GetApisOutputArgs, opts ...pulumi.InvokeOption) GetApisResultOutput {
    76  	return pulumi.ToOutputWithContext(context.Background(), args).
    77  		ApplyT(func(v interface{}) (GetApisResult, error) {
    78  			args := v.(GetApisArgs)
    79  			r, err := GetApis(ctx, &args, opts...)
    80  			var s GetApisResult
    81  			if r != nil {
    82  				s = *r
    83  			}
    84  			return s, err
    85  		}).(GetApisResultOutput)
    86  }
    87  
    88  // A collection of arguments for invoking getApis.
    89  type GetApisOutputArgs struct {
    90  	// API name.
    91  	Name pulumi.StringPtrInput `pulumi:"name"`
    92  	// API protocol.
    93  	ProtocolType pulumi.StringPtrInput `pulumi:"protocolType"`
    94  	// Map of tags, each pair of which must exactly match
    95  	// a pair on the desired APIs.
    96  	Tags pulumi.StringMapInput `pulumi:"tags"`
    97  }
    98  
    99  func (GetApisOutputArgs) ElementType() reflect.Type {
   100  	return reflect.TypeOf((*GetApisArgs)(nil)).Elem()
   101  }
   102  
   103  // A collection of values returned by getApis.
   104  type GetApisResultOutput struct{ *pulumi.OutputState }
   105  
   106  func (GetApisResultOutput) ElementType() reflect.Type {
   107  	return reflect.TypeOf((*GetApisResult)(nil)).Elem()
   108  }
   109  
   110  func (o GetApisResultOutput) ToGetApisResultOutput() GetApisResultOutput {
   111  	return o
   112  }
   113  
   114  func (o GetApisResultOutput) ToGetApisResultOutputWithContext(ctx context.Context) GetApisResultOutput {
   115  	return o
   116  }
   117  
   118  // The provider-assigned unique ID for this managed resource.
   119  func (o GetApisResultOutput) Id() pulumi.StringOutput {
   120  	return o.ApplyT(func(v GetApisResult) string { return v.Id }).(pulumi.StringOutput)
   121  }
   122  
   123  // Set of API identifiers.
   124  func (o GetApisResultOutput) Ids() pulumi.StringArrayOutput {
   125  	return o.ApplyT(func(v GetApisResult) []string { return v.Ids }).(pulumi.StringArrayOutput)
   126  }
   127  
   128  func (o GetApisResultOutput) Name() pulumi.StringPtrOutput {
   129  	return o.ApplyT(func(v GetApisResult) *string { return v.Name }).(pulumi.StringPtrOutput)
   130  }
   131  
   132  func (o GetApisResultOutput) ProtocolType() pulumi.StringPtrOutput {
   133  	return o.ApplyT(func(v GetApisResult) *string { return v.ProtocolType }).(pulumi.StringPtrOutput)
   134  }
   135  
   136  func (o GetApisResultOutput) Tags() pulumi.StringMapOutput {
   137  	return o.ApplyT(func(v GetApisResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput)
   138  }
   139  
   140  func init() {
   141  	pulumi.RegisterOutputType(GetApisResultOutput{})
   142  }