github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/apigateway/method.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 "errors" 11 "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal" 12 "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 13 ) 14 15 // Provides a HTTP Method for an API Gateway Resource. 16 // 17 // ## Example Usage 18 // 19 // <!--Start PulumiCodeChooser --> 20 // ```go 21 // package main 22 // 23 // import ( 24 // 25 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/apigateway" 26 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 27 // 28 // ) 29 // 30 // func main() { 31 // pulumi.Run(func(ctx *pulumi.Context) error { 32 // myDemoAPI, err := apigateway.NewRestApi(ctx, "MyDemoAPI", &apigateway.RestApiArgs{ 33 // Name: pulumi.String("MyDemoAPI"), 34 // Description: pulumi.String("This is my API for demonstration purposes"), 35 // }) 36 // if err != nil { 37 // return err 38 // } 39 // myDemoResource, err := apigateway.NewResource(ctx, "MyDemoResource", &apigateway.ResourceArgs{ 40 // RestApi: myDemoAPI.ID(), 41 // ParentId: myDemoAPI.RootResourceId, 42 // PathPart: pulumi.String("mydemoresource"), 43 // }) 44 // if err != nil { 45 // return err 46 // } 47 // _, err = apigateway.NewMethod(ctx, "MyDemoMethod", &apigateway.MethodArgs{ 48 // RestApi: myDemoAPI.ID(), 49 // ResourceId: myDemoResource.ID(), 50 // HttpMethod: pulumi.String("GET"), 51 // Authorization: pulumi.String("NONE"), 52 // }) 53 // if err != nil { 54 // return err 55 // } 56 // return nil 57 // }) 58 // } 59 // 60 // ``` 61 // <!--End PulumiCodeChooser --> 62 // 63 // ## Usage with Cognito User Pool Authorizer 64 // 65 // <!--Start PulumiCodeChooser --> 66 // ```go 67 // package main 68 // 69 // import ( 70 // 71 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/apigateway" 72 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/cognito" 73 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 74 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi/config" 75 // 76 // ) 77 // 78 // func main() { 79 // pulumi.Run(func(ctx *pulumi.Context) error { 80 // cfg := config.New(ctx, "") 81 // cognitoUserPoolName := cfg.RequireObject("cognitoUserPoolName") 82 // this, err := cognito.GetUserPools(ctx, &cognito.GetUserPoolsArgs{ 83 // Name: cognitoUserPoolName, 84 // }, nil) 85 // if err != nil { 86 // return err 87 // } 88 // thisRestApi, err := apigateway.NewRestApi(ctx, "this", &apigateway.RestApiArgs{ 89 // Name: pulumi.String("with-authorizer"), 90 // }) 91 // if err != nil { 92 // return err 93 // } 94 // thisResource, err := apigateway.NewResource(ctx, "this", &apigateway.ResourceArgs{ 95 // RestApi: thisRestApi.ID(), 96 // ParentId: thisRestApi.RootResourceId, 97 // PathPart: pulumi.String("{proxy+}"), 98 // }) 99 // if err != nil { 100 // return err 101 // } 102 // thisAuthorizer, err := apigateway.NewAuthorizer(ctx, "this", &apigateway.AuthorizerArgs{ 103 // Name: pulumi.String("CognitoUserPoolAuthorizer"), 104 // Type: pulumi.String("COGNITO_USER_POOLS"), 105 // RestApi: thisRestApi.ID(), 106 // ProviderArns: interface{}(this.Arns), 107 // }) 108 // if err != nil { 109 // return err 110 // } 111 // _, err = apigateway.NewMethod(ctx, "any", &apigateway.MethodArgs{ 112 // RestApi: thisRestApi.ID(), 113 // ResourceId: thisResource.ID(), 114 // HttpMethod: pulumi.String("ANY"), 115 // Authorization: pulumi.String("COGNITO_USER_POOLS"), 116 // AuthorizerId: thisAuthorizer.ID(), 117 // RequestParameters: pulumi.BoolMap{ 118 // "method.request.path.proxy": pulumi.Bool(true), 119 // }, 120 // }) 121 // if err != nil { 122 // return err 123 // } 124 // return nil 125 // }) 126 // } 127 // 128 // ``` 129 // <!--End PulumiCodeChooser --> 130 // 131 // ## Import 132 // 133 // Using `pulumi import`, import `aws_api_gateway_method` using `REST-API-ID/RESOURCE-ID/HTTP-METHOD`. For example: 134 // 135 // ```sh 136 // $ pulumi import aws:apigateway/method:Method example 12345abcde/67890fghij/GET 137 // ``` 138 type Method struct { 139 pulumi.CustomResourceState 140 141 // Specify if the method requires an API key 142 ApiKeyRequired pulumi.BoolPtrOutput `pulumi:"apiKeyRequired"` 143 // Type of authorization used for the method (`NONE`, `CUSTOM`, `AWS_IAM`, `COGNITO_USER_POOLS`) 144 Authorization pulumi.StringOutput `pulumi:"authorization"` 145 // Authorization scopes used when the authorization is `COGNITO_USER_POOLS` 146 AuthorizationScopes pulumi.StringArrayOutput `pulumi:"authorizationScopes"` 147 // Authorizer id to be used when the authorization is `CUSTOM` or `COGNITO_USER_POOLS` 148 AuthorizerId pulumi.StringPtrOutput `pulumi:"authorizerId"` 149 // HTTP Method (`GET`, `POST`, `PUT`, `DELETE`, `HEAD`, `OPTIONS`, `ANY`) 150 HttpMethod pulumi.StringOutput `pulumi:"httpMethod"` 151 // Function name that will be given to the method when generating an SDK through API Gateway. If omitted, API Gateway will generate a function name based on the resource path and HTTP verb. 152 OperationName pulumi.StringPtrOutput `pulumi:"operationName"` 153 // Map of the API models used for the request's content type 154 // where key is the content type (e.g., `application/json`) 155 // and value is either `Error`, `Empty` (built-in models) or `apigateway.Model`'s `name`. 156 RequestModels pulumi.StringMapOutput `pulumi:"requestModels"` 157 // Map of request parameters (from the path, query string and headers) that should be passed to the integration. The boolean value indicates whether the parameter is required (`true`) or optional (`false`). 158 // For example: `requestParameters = {"method.request.header.X-Some-Header" = true "method.request.querystring.some-query-param" = true}` would define that the header `X-Some-Header` and the query string `some-query-param` must be provided in the request. 159 RequestParameters pulumi.BoolMapOutput `pulumi:"requestParameters"` 160 // ID of a `apigateway.RequestValidator` 161 RequestValidatorId pulumi.StringPtrOutput `pulumi:"requestValidatorId"` 162 // API resource ID 163 ResourceId pulumi.StringOutput `pulumi:"resourceId"` 164 // ID of the associated REST API 165 RestApi pulumi.StringOutput `pulumi:"restApi"` 166 } 167 168 // NewMethod registers a new resource with the given unique name, arguments, and options. 169 func NewMethod(ctx *pulumi.Context, 170 name string, args *MethodArgs, opts ...pulumi.ResourceOption) (*Method, error) { 171 if args == nil { 172 return nil, errors.New("missing one or more required arguments") 173 } 174 175 if args.Authorization == nil { 176 return nil, errors.New("invalid value for required argument 'Authorization'") 177 } 178 if args.HttpMethod == nil { 179 return nil, errors.New("invalid value for required argument 'HttpMethod'") 180 } 181 if args.ResourceId == nil { 182 return nil, errors.New("invalid value for required argument 'ResourceId'") 183 } 184 if args.RestApi == nil { 185 return nil, errors.New("invalid value for required argument 'RestApi'") 186 } 187 opts = internal.PkgResourceDefaultOpts(opts) 188 var resource Method 189 err := ctx.RegisterResource("aws:apigateway/method:Method", name, args, &resource, opts...) 190 if err != nil { 191 return nil, err 192 } 193 return &resource, nil 194 } 195 196 // GetMethod gets an existing Method resource's state with the given name, ID, and optional 197 // state properties that are used to uniquely qualify the lookup (nil if not required). 198 func GetMethod(ctx *pulumi.Context, 199 name string, id pulumi.IDInput, state *MethodState, opts ...pulumi.ResourceOption) (*Method, error) { 200 var resource Method 201 err := ctx.ReadResource("aws:apigateway/method:Method", name, id, state, &resource, opts...) 202 if err != nil { 203 return nil, err 204 } 205 return &resource, nil 206 } 207 208 // Input properties used for looking up and filtering Method resources. 209 type methodState struct { 210 // Specify if the method requires an API key 211 ApiKeyRequired *bool `pulumi:"apiKeyRequired"` 212 // Type of authorization used for the method (`NONE`, `CUSTOM`, `AWS_IAM`, `COGNITO_USER_POOLS`) 213 Authorization *string `pulumi:"authorization"` 214 // Authorization scopes used when the authorization is `COGNITO_USER_POOLS` 215 AuthorizationScopes []string `pulumi:"authorizationScopes"` 216 // Authorizer id to be used when the authorization is `CUSTOM` or `COGNITO_USER_POOLS` 217 AuthorizerId *string `pulumi:"authorizerId"` 218 // HTTP Method (`GET`, `POST`, `PUT`, `DELETE`, `HEAD`, `OPTIONS`, `ANY`) 219 HttpMethod *string `pulumi:"httpMethod"` 220 // Function name that will be given to the method when generating an SDK through API Gateway. If omitted, API Gateway will generate a function name based on the resource path and HTTP verb. 221 OperationName *string `pulumi:"operationName"` 222 // Map of the API models used for the request's content type 223 // where key is the content type (e.g., `application/json`) 224 // and value is either `Error`, `Empty` (built-in models) or `apigateway.Model`'s `name`. 225 RequestModels map[string]string `pulumi:"requestModels"` 226 // Map of request parameters (from the path, query string and headers) that should be passed to the integration. The boolean value indicates whether the parameter is required (`true`) or optional (`false`). 227 // For example: `requestParameters = {"method.request.header.X-Some-Header" = true "method.request.querystring.some-query-param" = true}` would define that the header `X-Some-Header` and the query string `some-query-param` must be provided in the request. 228 RequestParameters map[string]bool `pulumi:"requestParameters"` 229 // ID of a `apigateway.RequestValidator` 230 RequestValidatorId *string `pulumi:"requestValidatorId"` 231 // API resource ID 232 ResourceId *string `pulumi:"resourceId"` 233 // ID of the associated REST API 234 RestApi interface{} `pulumi:"restApi"` 235 } 236 237 type MethodState struct { 238 // Specify if the method requires an API key 239 ApiKeyRequired pulumi.BoolPtrInput 240 // Type of authorization used for the method (`NONE`, `CUSTOM`, `AWS_IAM`, `COGNITO_USER_POOLS`) 241 Authorization pulumi.StringPtrInput 242 // Authorization scopes used when the authorization is `COGNITO_USER_POOLS` 243 AuthorizationScopes pulumi.StringArrayInput 244 // Authorizer id to be used when the authorization is `CUSTOM` or `COGNITO_USER_POOLS` 245 AuthorizerId pulumi.StringPtrInput 246 // HTTP Method (`GET`, `POST`, `PUT`, `DELETE`, `HEAD`, `OPTIONS`, `ANY`) 247 HttpMethod pulumi.StringPtrInput 248 // Function name that will be given to the method when generating an SDK through API Gateway. If omitted, API Gateway will generate a function name based on the resource path and HTTP verb. 249 OperationName pulumi.StringPtrInput 250 // Map of the API models used for the request's content type 251 // where key is the content type (e.g., `application/json`) 252 // and value is either `Error`, `Empty` (built-in models) or `apigateway.Model`'s `name`. 253 RequestModels pulumi.StringMapInput 254 // Map of request parameters (from the path, query string and headers) that should be passed to the integration. The boolean value indicates whether the parameter is required (`true`) or optional (`false`). 255 // For example: `requestParameters = {"method.request.header.X-Some-Header" = true "method.request.querystring.some-query-param" = true}` would define that the header `X-Some-Header` and the query string `some-query-param` must be provided in the request. 256 RequestParameters pulumi.BoolMapInput 257 // ID of a `apigateway.RequestValidator` 258 RequestValidatorId pulumi.StringPtrInput 259 // API resource ID 260 ResourceId pulumi.StringPtrInput 261 // ID of the associated REST API 262 RestApi pulumi.Input 263 } 264 265 func (MethodState) ElementType() reflect.Type { 266 return reflect.TypeOf((*methodState)(nil)).Elem() 267 } 268 269 type methodArgs struct { 270 // Specify if the method requires an API key 271 ApiKeyRequired *bool `pulumi:"apiKeyRequired"` 272 // Type of authorization used for the method (`NONE`, `CUSTOM`, `AWS_IAM`, `COGNITO_USER_POOLS`) 273 Authorization string `pulumi:"authorization"` 274 // Authorization scopes used when the authorization is `COGNITO_USER_POOLS` 275 AuthorizationScopes []string `pulumi:"authorizationScopes"` 276 // Authorizer id to be used when the authorization is `CUSTOM` or `COGNITO_USER_POOLS` 277 AuthorizerId *string `pulumi:"authorizerId"` 278 // HTTP Method (`GET`, `POST`, `PUT`, `DELETE`, `HEAD`, `OPTIONS`, `ANY`) 279 HttpMethod string `pulumi:"httpMethod"` 280 // Function name that will be given to the method when generating an SDK through API Gateway. If omitted, API Gateway will generate a function name based on the resource path and HTTP verb. 281 OperationName *string `pulumi:"operationName"` 282 // Map of the API models used for the request's content type 283 // where key is the content type (e.g., `application/json`) 284 // and value is either `Error`, `Empty` (built-in models) or `apigateway.Model`'s `name`. 285 RequestModels map[string]string `pulumi:"requestModels"` 286 // Map of request parameters (from the path, query string and headers) that should be passed to the integration. The boolean value indicates whether the parameter is required (`true`) or optional (`false`). 287 // For example: `requestParameters = {"method.request.header.X-Some-Header" = true "method.request.querystring.some-query-param" = true}` would define that the header `X-Some-Header` and the query string `some-query-param` must be provided in the request. 288 RequestParameters map[string]bool `pulumi:"requestParameters"` 289 // ID of a `apigateway.RequestValidator` 290 RequestValidatorId *string `pulumi:"requestValidatorId"` 291 // API resource ID 292 ResourceId string `pulumi:"resourceId"` 293 // ID of the associated REST API 294 RestApi interface{} `pulumi:"restApi"` 295 } 296 297 // The set of arguments for constructing a Method resource. 298 type MethodArgs struct { 299 // Specify if the method requires an API key 300 ApiKeyRequired pulumi.BoolPtrInput 301 // Type of authorization used for the method (`NONE`, `CUSTOM`, `AWS_IAM`, `COGNITO_USER_POOLS`) 302 Authorization pulumi.StringInput 303 // Authorization scopes used when the authorization is `COGNITO_USER_POOLS` 304 AuthorizationScopes pulumi.StringArrayInput 305 // Authorizer id to be used when the authorization is `CUSTOM` or `COGNITO_USER_POOLS` 306 AuthorizerId pulumi.StringPtrInput 307 // HTTP Method (`GET`, `POST`, `PUT`, `DELETE`, `HEAD`, `OPTIONS`, `ANY`) 308 HttpMethod pulumi.StringInput 309 // Function name that will be given to the method when generating an SDK through API Gateway. If omitted, API Gateway will generate a function name based on the resource path and HTTP verb. 310 OperationName pulumi.StringPtrInput 311 // Map of the API models used for the request's content type 312 // where key is the content type (e.g., `application/json`) 313 // and value is either `Error`, `Empty` (built-in models) or `apigateway.Model`'s `name`. 314 RequestModels pulumi.StringMapInput 315 // Map of request parameters (from the path, query string and headers) that should be passed to the integration. The boolean value indicates whether the parameter is required (`true`) or optional (`false`). 316 // For example: `requestParameters = {"method.request.header.X-Some-Header" = true "method.request.querystring.some-query-param" = true}` would define that the header `X-Some-Header` and the query string `some-query-param` must be provided in the request. 317 RequestParameters pulumi.BoolMapInput 318 // ID of a `apigateway.RequestValidator` 319 RequestValidatorId pulumi.StringPtrInput 320 // API resource ID 321 ResourceId pulumi.StringInput 322 // ID of the associated REST API 323 RestApi pulumi.Input 324 } 325 326 func (MethodArgs) ElementType() reflect.Type { 327 return reflect.TypeOf((*methodArgs)(nil)).Elem() 328 } 329 330 type MethodInput interface { 331 pulumi.Input 332 333 ToMethodOutput() MethodOutput 334 ToMethodOutputWithContext(ctx context.Context) MethodOutput 335 } 336 337 func (*Method) ElementType() reflect.Type { 338 return reflect.TypeOf((**Method)(nil)).Elem() 339 } 340 341 func (i *Method) ToMethodOutput() MethodOutput { 342 return i.ToMethodOutputWithContext(context.Background()) 343 } 344 345 func (i *Method) ToMethodOutputWithContext(ctx context.Context) MethodOutput { 346 return pulumi.ToOutputWithContext(ctx, i).(MethodOutput) 347 } 348 349 // MethodArrayInput is an input type that accepts MethodArray and MethodArrayOutput values. 350 // You can construct a concrete instance of `MethodArrayInput` via: 351 // 352 // MethodArray{ MethodArgs{...} } 353 type MethodArrayInput interface { 354 pulumi.Input 355 356 ToMethodArrayOutput() MethodArrayOutput 357 ToMethodArrayOutputWithContext(context.Context) MethodArrayOutput 358 } 359 360 type MethodArray []MethodInput 361 362 func (MethodArray) ElementType() reflect.Type { 363 return reflect.TypeOf((*[]*Method)(nil)).Elem() 364 } 365 366 func (i MethodArray) ToMethodArrayOutput() MethodArrayOutput { 367 return i.ToMethodArrayOutputWithContext(context.Background()) 368 } 369 370 func (i MethodArray) ToMethodArrayOutputWithContext(ctx context.Context) MethodArrayOutput { 371 return pulumi.ToOutputWithContext(ctx, i).(MethodArrayOutput) 372 } 373 374 // MethodMapInput is an input type that accepts MethodMap and MethodMapOutput values. 375 // You can construct a concrete instance of `MethodMapInput` via: 376 // 377 // MethodMap{ "key": MethodArgs{...} } 378 type MethodMapInput interface { 379 pulumi.Input 380 381 ToMethodMapOutput() MethodMapOutput 382 ToMethodMapOutputWithContext(context.Context) MethodMapOutput 383 } 384 385 type MethodMap map[string]MethodInput 386 387 func (MethodMap) ElementType() reflect.Type { 388 return reflect.TypeOf((*map[string]*Method)(nil)).Elem() 389 } 390 391 func (i MethodMap) ToMethodMapOutput() MethodMapOutput { 392 return i.ToMethodMapOutputWithContext(context.Background()) 393 } 394 395 func (i MethodMap) ToMethodMapOutputWithContext(ctx context.Context) MethodMapOutput { 396 return pulumi.ToOutputWithContext(ctx, i).(MethodMapOutput) 397 } 398 399 type MethodOutput struct{ *pulumi.OutputState } 400 401 func (MethodOutput) ElementType() reflect.Type { 402 return reflect.TypeOf((**Method)(nil)).Elem() 403 } 404 405 func (o MethodOutput) ToMethodOutput() MethodOutput { 406 return o 407 } 408 409 func (o MethodOutput) ToMethodOutputWithContext(ctx context.Context) MethodOutput { 410 return o 411 } 412 413 // Specify if the method requires an API key 414 func (o MethodOutput) ApiKeyRequired() pulumi.BoolPtrOutput { 415 return o.ApplyT(func(v *Method) pulumi.BoolPtrOutput { return v.ApiKeyRequired }).(pulumi.BoolPtrOutput) 416 } 417 418 // Type of authorization used for the method (`NONE`, `CUSTOM`, `AWS_IAM`, `COGNITO_USER_POOLS`) 419 func (o MethodOutput) Authorization() pulumi.StringOutput { 420 return o.ApplyT(func(v *Method) pulumi.StringOutput { return v.Authorization }).(pulumi.StringOutput) 421 } 422 423 // Authorization scopes used when the authorization is `COGNITO_USER_POOLS` 424 func (o MethodOutput) AuthorizationScopes() pulumi.StringArrayOutput { 425 return o.ApplyT(func(v *Method) pulumi.StringArrayOutput { return v.AuthorizationScopes }).(pulumi.StringArrayOutput) 426 } 427 428 // Authorizer id to be used when the authorization is `CUSTOM` or `COGNITO_USER_POOLS` 429 func (o MethodOutput) AuthorizerId() pulumi.StringPtrOutput { 430 return o.ApplyT(func(v *Method) pulumi.StringPtrOutput { return v.AuthorizerId }).(pulumi.StringPtrOutput) 431 } 432 433 // HTTP Method (`GET`, `POST`, `PUT`, `DELETE`, `HEAD`, `OPTIONS`, `ANY`) 434 func (o MethodOutput) HttpMethod() pulumi.StringOutput { 435 return o.ApplyT(func(v *Method) pulumi.StringOutput { return v.HttpMethod }).(pulumi.StringOutput) 436 } 437 438 // Function name that will be given to the method when generating an SDK through API Gateway. If omitted, API Gateway will generate a function name based on the resource path and HTTP verb. 439 func (o MethodOutput) OperationName() pulumi.StringPtrOutput { 440 return o.ApplyT(func(v *Method) pulumi.StringPtrOutput { return v.OperationName }).(pulumi.StringPtrOutput) 441 } 442 443 // Map of the API models used for the request's content type 444 // where key is the content type (e.g., `application/json`) 445 // and value is either `Error`, `Empty` (built-in models) or `apigateway.Model`'s `name`. 446 func (o MethodOutput) RequestModels() pulumi.StringMapOutput { 447 return o.ApplyT(func(v *Method) pulumi.StringMapOutput { return v.RequestModels }).(pulumi.StringMapOutput) 448 } 449 450 // Map of request parameters (from the path, query string and headers) that should be passed to the integration. The boolean value indicates whether the parameter is required (`true`) or optional (`false`). 451 // For example: `requestParameters = {"method.request.header.X-Some-Header" = true "method.request.querystring.some-query-param" = true}` would define that the header `X-Some-Header` and the query string `some-query-param` must be provided in the request. 452 func (o MethodOutput) RequestParameters() pulumi.BoolMapOutput { 453 return o.ApplyT(func(v *Method) pulumi.BoolMapOutput { return v.RequestParameters }).(pulumi.BoolMapOutput) 454 } 455 456 // ID of a `apigateway.RequestValidator` 457 func (o MethodOutput) RequestValidatorId() pulumi.StringPtrOutput { 458 return o.ApplyT(func(v *Method) pulumi.StringPtrOutput { return v.RequestValidatorId }).(pulumi.StringPtrOutput) 459 } 460 461 // API resource ID 462 func (o MethodOutput) ResourceId() pulumi.StringOutput { 463 return o.ApplyT(func(v *Method) pulumi.StringOutput { return v.ResourceId }).(pulumi.StringOutput) 464 } 465 466 // ID of the associated REST API 467 func (o MethodOutput) RestApi() pulumi.StringOutput { 468 return o.ApplyT(func(v *Method) pulumi.StringOutput { return v.RestApi }).(pulumi.StringOutput) 469 } 470 471 type MethodArrayOutput struct{ *pulumi.OutputState } 472 473 func (MethodArrayOutput) ElementType() reflect.Type { 474 return reflect.TypeOf((*[]*Method)(nil)).Elem() 475 } 476 477 func (o MethodArrayOutput) ToMethodArrayOutput() MethodArrayOutput { 478 return o 479 } 480 481 func (o MethodArrayOutput) ToMethodArrayOutputWithContext(ctx context.Context) MethodArrayOutput { 482 return o 483 } 484 485 func (o MethodArrayOutput) Index(i pulumi.IntInput) MethodOutput { 486 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Method { 487 return vs[0].([]*Method)[vs[1].(int)] 488 }).(MethodOutput) 489 } 490 491 type MethodMapOutput struct{ *pulumi.OutputState } 492 493 func (MethodMapOutput) ElementType() reflect.Type { 494 return reflect.TypeOf((*map[string]*Method)(nil)).Elem() 495 } 496 497 func (o MethodMapOutput) ToMethodMapOutput() MethodMapOutput { 498 return o 499 } 500 501 func (o MethodMapOutput) ToMethodMapOutputWithContext(ctx context.Context) MethodMapOutput { 502 return o 503 } 504 505 func (o MethodMapOutput) MapIndex(k pulumi.StringInput) MethodOutput { 506 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Method { 507 return vs[0].(map[string]*Method)[vs[1].(string)] 508 }).(MethodOutput) 509 } 510 511 func init() { 512 pulumi.RegisterInputType(reflect.TypeOf((*MethodInput)(nil)).Elem(), &Method{}) 513 pulumi.RegisterInputType(reflect.TypeOf((*MethodArrayInput)(nil)).Elem(), MethodArray{}) 514 pulumi.RegisterInputType(reflect.TypeOf((*MethodMapInput)(nil)).Elem(), MethodMap{}) 515 pulumi.RegisterOutputType(MethodOutput{}) 516 pulumi.RegisterOutputType(MethodArrayOutput{}) 517 pulumi.RegisterOutputType(MethodMapOutput{}) 518 }