# Conversion mappings
<gh-file:pulumi#proto/pulumi/codegen/mapper.proto>

## Services

(codegen.Mapper)=
### 🔌 Mapper
Mapper provides methods for retrieving mappings that describe how to map names in some source "provider" (e.g. a
Terraform provider, if we are converting from Terraform) to names in appropriate Pulumi packages. So when converting
a Terraform program containing code like `resource "aws_s3_bucket" "b" {}`, for instance, we need to know (among
other things) that the `aws_s3_bucket` Terraform resource type corresponds to the Pulumi type `aws:s3/bucket:Bucket`,
and thus lives in the `aws` package. This is the kind of information that a Mapper provides.


(codegen.Mapper.GetMapping)=
#### 📞 GetMapping

⤵️ [GetMappingRequest](#codegen.GetMappingRequest) ⤴️ [GetMappingResponse](#codegen.GetMappingResponse)

`GetMapping` returns any available mapping data for the given source provider name (so again, this is e.g. the
name of a Terraform provider if converting from Terraform). Callers may pass "hints" that describe a Pulumi
package that is expected to provide the mapping and satisfy the request, which implementations may use to
optimise their efforts to return the best possible mapping. If no matching mapping exists, implementations should
return an empty byte array result.

## Messages
(codegen.GetMappingRequest)=
### 📨 GetMappingRequest
`GetMappingRequest` is the type of requests sent as part of a [](codegen.Mapper.GetMapping) call.


`provider` [string](#string)
:   The name of the source provider (e.g. the Terraform provider name if a Terraform program is being converted) for
  which a mapping into Pulumi should be returned.


`pulumi_provider` [string](#string)
:   The name of the Pulumi plugin that is expected to provide the mapping. If left empty, will be defaulted to the
  source provider name.


`parameterization_hint` [MapperParameterizationHint](#codegen.MapperParameterizationHint)
:   An optional parameterization that should be used on the named plugin before asking it for mappings.

(codegen.GetMappingResponse)=
### 📨 GetMappingResponse
`GetMappingResponse` is the type of responses sent by [](codegen.Mapper.GetMapping) calls.


`data` [bytes](#bytes)
:   Conversion-plugin-specific mapping data. For a Terraform conversion, for instance, this is expected to be a piece
  of data that maps Terraform names (e.g. resource types) to Pulumi names (e.g. Pulumi resource types). In many
  cases this byte array will be a string of encoded JSON, but no specific format is required.

(codegen.MapperParameterizationHint)=
### 📨 MapperParameterizationHint
`MapperPackageParameterizationHint` is the type of hints that may be passed to [](codegen.Mapper.GetMapping) when it
is expected that a parameterized provider plugin is the most likely source of a mapping. E.g. in the case of a
dynamically bridged Terraform provider, callers may wish to express that a mapping is most likely offered by the
"terraform-provider" plugin, but only when it is parameterized with the appropriate Terraform provider information.


`name` [string](#string)
:   The package name expected once parameterization has been applied.


`version` [string](#string)
:   The package version expected once parameterization has been applied.


`value` [bytes](#bytes)
:   The parameter value to send to the provider plugin as part of parameterization.

