github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/transcribe/vocabulary.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 transcribe 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 // Resource for managing an AWS Transcribe Vocabulary. 16 // 17 // ## Example Usage 18 // 19 // ### Basic Usage 20 // 21 // <!--Start PulumiCodeChooser --> 22 // ```go 23 // package main 24 // 25 // import ( 26 // 27 // "fmt" 28 // 29 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/s3" 30 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/transcribe" 31 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 32 // 33 // ) 34 // 35 // func main() { 36 // pulumi.Run(func(ctx *pulumi.Context) error { 37 // example, err := s3.NewBucketV2(ctx, "example", &s3.BucketV2Args{ 38 // Bucket: pulumi.String("example-vocab-123"), 39 // ForceDestroy: pulumi.Bool(true), 40 // }) 41 // if err != nil { 42 // return err 43 // } 44 // object, err := s3.NewBucketObjectv2(ctx, "object", &s3.BucketObjectv2Args{ 45 // Bucket: example.ID(), 46 // Key: pulumi.String("transcribe/test1.txt"), 47 // Source: pulumi.NewFileAsset("test.txt"), 48 // }) 49 // if err != nil { 50 // return err 51 // } 52 // _, err = transcribe.NewVocabulary(ctx, "example", &transcribe.VocabularyArgs{ 53 // VocabularyName: pulumi.String("example"), 54 // LanguageCode: pulumi.String("en-US"), 55 // VocabularyFileUri: pulumi.All(example.ID(), object.Key).ApplyT(func(_args []interface{}) (string, error) { 56 // id := _args[0].(string) 57 // key := _args[1].(string) 58 // return fmt.Sprintf("s3://%v/%v", id, key), nil 59 // }).(pulumi.StringOutput), 60 // Tags: pulumi.StringMap{ 61 // "tag1": pulumi.String("value1"), 62 // "tag2": pulumi.String("value3"), 63 // }, 64 // }, pulumi.DependsOn([]pulumi.Resource{ 65 // object, 66 // })) 67 // if err != nil { 68 // return err 69 // } 70 // return nil 71 // }) 72 // } 73 // 74 // ``` 75 // <!--End PulumiCodeChooser --> 76 // 77 // ## Import 78 // 79 // Using `pulumi import`, import Transcribe Vocabulary using the `vocabulary_name`. For example: 80 // 81 // ```sh 82 // $ pulumi import aws:transcribe/vocabulary:Vocabulary example example-name 83 // ``` 84 type Vocabulary struct { 85 pulumi.CustomResourceState 86 87 // ARN of the Vocabulary. 88 Arn pulumi.StringOutput `pulumi:"arn"` 89 // Generated download URI. 90 DownloadUri pulumi.StringOutput `pulumi:"downloadUri"` 91 // The language code you selected for your vocabulary. 92 LanguageCode pulumi.StringOutput `pulumi:"languageCode"` 93 // A list of terms to include in the vocabulary. Conflicts with `vocabularyFileUri` 94 Phrases pulumi.StringArrayOutput `pulumi:"phrases"` 95 // A map of tags to assign to the Vocabulary. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 96 Tags pulumi.StringMapOutput `pulumi:"tags"` 97 // Deprecated: Please use `tags` instead. 98 TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"` 99 // The Amazon S3 location (URI) of the text file that contains your custom vocabulary. Conflicts wth `phrases`. 100 VocabularyFileUri pulumi.StringOutput `pulumi:"vocabularyFileUri"` 101 // The name of the Vocabulary. 102 // 103 // The following arguments are optional: 104 VocabularyName pulumi.StringOutput `pulumi:"vocabularyName"` 105 } 106 107 // NewVocabulary registers a new resource with the given unique name, arguments, and options. 108 func NewVocabulary(ctx *pulumi.Context, 109 name string, args *VocabularyArgs, opts ...pulumi.ResourceOption) (*Vocabulary, error) { 110 if args == nil { 111 return nil, errors.New("missing one or more required arguments") 112 } 113 114 if args.LanguageCode == nil { 115 return nil, errors.New("invalid value for required argument 'LanguageCode'") 116 } 117 if args.VocabularyName == nil { 118 return nil, errors.New("invalid value for required argument 'VocabularyName'") 119 } 120 opts = internal.PkgResourceDefaultOpts(opts) 121 var resource Vocabulary 122 err := ctx.RegisterResource("aws:transcribe/vocabulary:Vocabulary", name, args, &resource, opts...) 123 if err != nil { 124 return nil, err 125 } 126 return &resource, nil 127 } 128 129 // GetVocabulary gets an existing Vocabulary resource's state with the given name, ID, and optional 130 // state properties that are used to uniquely qualify the lookup (nil if not required). 131 func GetVocabulary(ctx *pulumi.Context, 132 name string, id pulumi.IDInput, state *VocabularyState, opts ...pulumi.ResourceOption) (*Vocabulary, error) { 133 var resource Vocabulary 134 err := ctx.ReadResource("aws:transcribe/vocabulary:Vocabulary", name, id, state, &resource, opts...) 135 if err != nil { 136 return nil, err 137 } 138 return &resource, nil 139 } 140 141 // Input properties used for looking up and filtering Vocabulary resources. 142 type vocabularyState struct { 143 // ARN of the Vocabulary. 144 Arn *string `pulumi:"arn"` 145 // Generated download URI. 146 DownloadUri *string `pulumi:"downloadUri"` 147 // The language code you selected for your vocabulary. 148 LanguageCode *string `pulumi:"languageCode"` 149 // A list of terms to include in the vocabulary. Conflicts with `vocabularyFileUri` 150 Phrases []string `pulumi:"phrases"` 151 // A map of tags to assign to the Vocabulary. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 152 Tags map[string]string `pulumi:"tags"` 153 // Deprecated: Please use `tags` instead. 154 TagsAll map[string]string `pulumi:"tagsAll"` 155 // The Amazon S3 location (URI) of the text file that contains your custom vocabulary. Conflicts wth `phrases`. 156 VocabularyFileUri *string `pulumi:"vocabularyFileUri"` 157 // The name of the Vocabulary. 158 // 159 // The following arguments are optional: 160 VocabularyName *string `pulumi:"vocabularyName"` 161 } 162 163 type VocabularyState struct { 164 // ARN of the Vocabulary. 165 Arn pulumi.StringPtrInput 166 // Generated download URI. 167 DownloadUri pulumi.StringPtrInput 168 // The language code you selected for your vocabulary. 169 LanguageCode pulumi.StringPtrInput 170 // A list of terms to include in the vocabulary. Conflicts with `vocabularyFileUri` 171 Phrases pulumi.StringArrayInput 172 // A map of tags to assign to the Vocabulary. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 173 Tags pulumi.StringMapInput 174 // Deprecated: Please use `tags` instead. 175 TagsAll pulumi.StringMapInput 176 // The Amazon S3 location (URI) of the text file that contains your custom vocabulary. Conflicts wth `phrases`. 177 VocabularyFileUri pulumi.StringPtrInput 178 // The name of the Vocabulary. 179 // 180 // The following arguments are optional: 181 VocabularyName pulumi.StringPtrInput 182 } 183 184 func (VocabularyState) ElementType() reflect.Type { 185 return reflect.TypeOf((*vocabularyState)(nil)).Elem() 186 } 187 188 type vocabularyArgs struct { 189 // The language code you selected for your vocabulary. 190 LanguageCode string `pulumi:"languageCode"` 191 // A list of terms to include in the vocabulary. Conflicts with `vocabularyFileUri` 192 Phrases []string `pulumi:"phrases"` 193 // A map of tags to assign to the Vocabulary. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 194 Tags map[string]string `pulumi:"tags"` 195 // The Amazon S3 location (URI) of the text file that contains your custom vocabulary. Conflicts wth `phrases`. 196 VocabularyFileUri *string `pulumi:"vocabularyFileUri"` 197 // The name of the Vocabulary. 198 // 199 // The following arguments are optional: 200 VocabularyName string `pulumi:"vocabularyName"` 201 } 202 203 // The set of arguments for constructing a Vocabulary resource. 204 type VocabularyArgs struct { 205 // The language code you selected for your vocabulary. 206 LanguageCode pulumi.StringInput 207 // A list of terms to include in the vocabulary. Conflicts with `vocabularyFileUri` 208 Phrases pulumi.StringArrayInput 209 // A map of tags to assign to the Vocabulary. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 210 Tags pulumi.StringMapInput 211 // The Amazon S3 location (URI) of the text file that contains your custom vocabulary. Conflicts wth `phrases`. 212 VocabularyFileUri pulumi.StringPtrInput 213 // The name of the Vocabulary. 214 // 215 // The following arguments are optional: 216 VocabularyName pulumi.StringInput 217 } 218 219 func (VocabularyArgs) ElementType() reflect.Type { 220 return reflect.TypeOf((*vocabularyArgs)(nil)).Elem() 221 } 222 223 type VocabularyInput interface { 224 pulumi.Input 225 226 ToVocabularyOutput() VocabularyOutput 227 ToVocabularyOutputWithContext(ctx context.Context) VocabularyOutput 228 } 229 230 func (*Vocabulary) ElementType() reflect.Type { 231 return reflect.TypeOf((**Vocabulary)(nil)).Elem() 232 } 233 234 func (i *Vocabulary) ToVocabularyOutput() VocabularyOutput { 235 return i.ToVocabularyOutputWithContext(context.Background()) 236 } 237 238 func (i *Vocabulary) ToVocabularyOutputWithContext(ctx context.Context) VocabularyOutput { 239 return pulumi.ToOutputWithContext(ctx, i).(VocabularyOutput) 240 } 241 242 // VocabularyArrayInput is an input type that accepts VocabularyArray and VocabularyArrayOutput values. 243 // You can construct a concrete instance of `VocabularyArrayInput` via: 244 // 245 // VocabularyArray{ VocabularyArgs{...} } 246 type VocabularyArrayInput interface { 247 pulumi.Input 248 249 ToVocabularyArrayOutput() VocabularyArrayOutput 250 ToVocabularyArrayOutputWithContext(context.Context) VocabularyArrayOutput 251 } 252 253 type VocabularyArray []VocabularyInput 254 255 func (VocabularyArray) ElementType() reflect.Type { 256 return reflect.TypeOf((*[]*Vocabulary)(nil)).Elem() 257 } 258 259 func (i VocabularyArray) ToVocabularyArrayOutput() VocabularyArrayOutput { 260 return i.ToVocabularyArrayOutputWithContext(context.Background()) 261 } 262 263 func (i VocabularyArray) ToVocabularyArrayOutputWithContext(ctx context.Context) VocabularyArrayOutput { 264 return pulumi.ToOutputWithContext(ctx, i).(VocabularyArrayOutput) 265 } 266 267 // VocabularyMapInput is an input type that accepts VocabularyMap and VocabularyMapOutput values. 268 // You can construct a concrete instance of `VocabularyMapInput` via: 269 // 270 // VocabularyMap{ "key": VocabularyArgs{...} } 271 type VocabularyMapInput interface { 272 pulumi.Input 273 274 ToVocabularyMapOutput() VocabularyMapOutput 275 ToVocabularyMapOutputWithContext(context.Context) VocabularyMapOutput 276 } 277 278 type VocabularyMap map[string]VocabularyInput 279 280 func (VocabularyMap) ElementType() reflect.Type { 281 return reflect.TypeOf((*map[string]*Vocabulary)(nil)).Elem() 282 } 283 284 func (i VocabularyMap) ToVocabularyMapOutput() VocabularyMapOutput { 285 return i.ToVocabularyMapOutputWithContext(context.Background()) 286 } 287 288 func (i VocabularyMap) ToVocabularyMapOutputWithContext(ctx context.Context) VocabularyMapOutput { 289 return pulumi.ToOutputWithContext(ctx, i).(VocabularyMapOutput) 290 } 291 292 type VocabularyOutput struct{ *pulumi.OutputState } 293 294 func (VocabularyOutput) ElementType() reflect.Type { 295 return reflect.TypeOf((**Vocabulary)(nil)).Elem() 296 } 297 298 func (o VocabularyOutput) ToVocabularyOutput() VocabularyOutput { 299 return o 300 } 301 302 func (o VocabularyOutput) ToVocabularyOutputWithContext(ctx context.Context) VocabularyOutput { 303 return o 304 } 305 306 // ARN of the Vocabulary. 307 func (o VocabularyOutput) Arn() pulumi.StringOutput { 308 return o.ApplyT(func(v *Vocabulary) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput) 309 } 310 311 // Generated download URI. 312 func (o VocabularyOutput) DownloadUri() pulumi.StringOutput { 313 return o.ApplyT(func(v *Vocabulary) pulumi.StringOutput { return v.DownloadUri }).(pulumi.StringOutput) 314 } 315 316 // The language code you selected for your vocabulary. 317 func (o VocabularyOutput) LanguageCode() pulumi.StringOutput { 318 return o.ApplyT(func(v *Vocabulary) pulumi.StringOutput { return v.LanguageCode }).(pulumi.StringOutput) 319 } 320 321 // A list of terms to include in the vocabulary. Conflicts with `vocabularyFileUri` 322 func (o VocabularyOutput) Phrases() pulumi.StringArrayOutput { 323 return o.ApplyT(func(v *Vocabulary) pulumi.StringArrayOutput { return v.Phrases }).(pulumi.StringArrayOutput) 324 } 325 326 // A map of tags to assign to the Vocabulary. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 327 func (o VocabularyOutput) Tags() pulumi.StringMapOutput { 328 return o.ApplyT(func(v *Vocabulary) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput) 329 } 330 331 // Deprecated: Please use `tags` instead. 332 func (o VocabularyOutput) TagsAll() pulumi.StringMapOutput { 333 return o.ApplyT(func(v *Vocabulary) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput) 334 } 335 336 // The Amazon S3 location (URI) of the text file that contains your custom vocabulary. Conflicts wth `phrases`. 337 func (o VocabularyOutput) VocabularyFileUri() pulumi.StringOutput { 338 return o.ApplyT(func(v *Vocabulary) pulumi.StringOutput { return v.VocabularyFileUri }).(pulumi.StringOutput) 339 } 340 341 // The name of the Vocabulary. 342 // 343 // The following arguments are optional: 344 func (o VocabularyOutput) VocabularyName() pulumi.StringOutput { 345 return o.ApplyT(func(v *Vocabulary) pulumi.StringOutput { return v.VocabularyName }).(pulumi.StringOutput) 346 } 347 348 type VocabularyArrayOutput struct{ *pulumi.OutputState } 349 350 func (VocabularyArrayOutput) ElementType() reflect.Type { 351 return reflect.TypeOf((*[]*Vocabulary)(nil)).Elem() 352 } 353 354 func (o VocabularyArrayOutput) ToVocabularyArrayOutput() VocabularyArrayOutput { 355 return o 356 } 357 358 func (o VocabularyArrayOutput) ToVocabularyArrayOutputWithContext(ctx context.Context) VocabularyArrayOutput { 359 return o 360 } 361 362 func (o VocabularyArrayOutput) Index(i pulumi.IntInput) VocabularyOutput { 363 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Vocabulary { 364 return vs[0].([]*Vocabulary)[vs[1].(int)] 365 }).(VocabularyOutput) 366 } 367 368 type VocabularyMapOutput struct{ *pulumi.OutputState } 369 370 func (VocabularyMapOutput) ElementType() reflect.Type { 371 return reflect.TypeOf((*map[string]*Vocabulary)(nil)).Elem() 372 } 373 374 func (o VocabularyMapOutput) ToVocabularyMapOutput() VocabularyMapOutput { 375 return o 376 } 377 378 func (o VocabularyMapOutput) ToVocabularyMapOutputWithContext(ctx context.Context) VocabularyMapOutput { 379 return o 380 } 381 382 func (o VocabularyMapOutput) MapIndex(k pulumi.StringInput) VocabularyOutput { 383 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Vocabulary { 384 return vs[0].(map[string]*Vocabulary)[vs[1].(string)] 385 }).(VocabularyOutput) 386 } 387 388 func init() { 389 pulumi.RegisterInputType(reflect.TypeOf((*VocabularyInput)(nil)).Elem(), &Vocabulary{}) 390 pulumi.RegisterInputType(reflect.TypeOf((*VocabularyArrayInput)(nil)).Elem(), VocabularyArray{}) 391 pulumi.RegisterInputType(reflect.TypeOf((*VocabularyMapInput)(nil)).Elem(), VocabularyMap{}) 392 pulumi.RegisterOutputType(VocabularyOutput{}) 393 pulumi.RegisterOutputType(VocabularyArrayOutput{}) 394 pulumi.RegisterOutputType(VocabularyMapOutput{}) 395 }