github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/rekognition/project.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 rekognition 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 // Resource for managing an AWS Rekognition Project. 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/rekognition" 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 := rekognition.NewProject(ctx, "example", &rekognition.ProjectArgs{ 32 // Name: pulumi.String("example-project"), 33 // AutoUpdate: pulumi.String("ENABLED"), 34 // Feature: pulumi.String("CONTENT_MODERATION"), 35 // }) 36 // if err != nil { 37 // return err 38 // } 39 // return nil 40 // }) 41 // } 42 // 43 // ``` 44 // <!--End PulumiCodeChooser --> 45 // 46 // ## Import 47 // 48 // Using `pulumi import`, import Rekognition Project using the `name`. For example: 49 // 50 // ```sh 51 // $ pulumi import aws:rekognition/project:Project example project-id-12345678 52 // ``` 53 type Project struct { 54 pulumi.CustomResourceState 55 56 // ARN of the Project. 57 Arn pulumi.StringOutput `pulumi:"arn"` 58 // Specify if automatic retraining should occur. Valid values are `ENABLED` or `DISABLED`. Defaults to `DISABLED` 59 AutoUpdate pulumi.StringOutput `pulumi:"autoUpdate"` 60 // Specify the feature being customized. Valid values are `CONTENT_MODERATION` or `CUSTOM_LABELS`. Defaults to `CUSTOM_LABELS` 61 Feature pulumi.StringPtrOutput `pulumi:"feature"` 62 // Desired name of the project 63 // 64 // The following arguments are optional: 65 Name pulumi.StringOutput `pulumi:"name"` 66 Timeouts ProjectTimeoutsPtrOutput `pulumi:"timeouts"` 67 } 68 69 // NewProject registers a new resource with the given unique name, arguments, and options. 70 func NewProject(ctx *pulumi.Context, 71 name string, args *ProjectArgs, opts ...pulumi.ResourceOption) (*Project, error) { 72 if args == nil { 73 args = &ProjectArgs{} 74 } 75 76 opts = internal.PkgResourceDefaultOpts(opts) 77 var resource Project 78 err := ctx.RegisterResource("aws:rekognition/project:Project", name, args, &resource, opts...) 79 if err != nil { 80 return nil, err 81 } 82 return &resource, nil 83 } 84 85 // GetProject gets an existing Project resource's state with the given name, ID, and optional 86 // state properties that are used to uniquely qualify the lookup (nil if not required). 87 func GetProject(ctx *pulumi.Context, 88 name string, id pulumi.IDInput, state *ProjectState, opts ...pulumi.ResourceOption) (*Project, error) { 89 var resource Project 90 err := ctx.ReadResource("aws:rekognition/project:Project", name, id, state, &resource, opts...) 91 if err != nil { 92 return nil, err 93 } 94 return &resource, nil 95 } 96 97 // Input properties used for looking up and filtering Project resources. 98 type projectState struct { 99 // ARN of the Project. 100 Arn *string `pulumi:"arn"` 101 // Specify if automatic retraining should occur. Valid values are `ENABLED` or `DISABLED`. Defaults to `DISABLED` 102 AutoUpdate *string `pulumi:"autoUpdate"` 103 // Specify the feature being customized. Valid values are `CONTENT_MODERATION` or `CUSTOM_LABELS`. Defaults to `CUSTOM_LABELS` 104 Feature *string `pulumi:"feature"` 105 // Desired name of the project 106 // 107 // The following arguments are optional: 108 Name *string `pulumi:"name"` 109 Timeouts *ProjectTimeouts `pulumi:"timeouts"` 110 } 111 112 type ProjectState struct { 113 // ARN of the Project. 114 Arn pulumi.StringPtrInput 115 // Specify if automatic retraining should occur. Valid values are `ENABLED` or `DISABLED`. Defaults to `DISABLED` 116 AutoUpdate pulumi.StringPtrInput 117 // Specify the feature being customized. Valid values are `CONTENT_MODERATION` or `CUSTOM_LABELS`. Defaults to `CUSTOM_LABELS` 118 Feature pulumi.StringPtrInput 119 // Desired name of the project 120 // 121 // The following arguments are optional: 122 Name pulumi.StringPtrInput 123 Timeouts ProjectTimeoutsPtrInput 124 } 125 126 func (ProjectState) ElementType() reflect.Type { 127 return reflect.TypeOf((*projectState)(nil)).Elem() 128 } 129 130 type projectArgs struct { 131 // Specify if automatic retraining should occur. Valid values are `ENABLED` or `DISABLED`. Defaults to `DISABLED` 132 AutoUpdate *string `pulumi:"autoUpdate"` 133 // Specify the feature being customized. Valid values are `CONTENT_MODERATION` or `CUSTOM_LABELS`. Defaults to `CUSTOM_LABELS` 134 Feature *string `pulumi:"feature"` 135 // Desired name of the project 136 // 137 // The following arguments are optional: 138 Name *string `pulumi:"name"` 139 Timeouts *ProjectTimeouts `pulumi:"timeouts"` 140 } 141 142 // The set of arguments for constructing a Project resource. 143 type ProjectArgs struct { 144 // Specify if automatic retraining should occur. Valid values are `ENABLED` or `DISABLED`. Defaults to `DISABLED` 145 AutoUpdate pulumi.StringPtrInput 146 // Specify the feature being customized. Valid values are `CONTENT_MODERATION` or `CUSTOM_LABELS`. Defaults to `CUSTOM_LABELS` 147 Feature pulumi.StringPtrInput 148 // Desired name of the project 149 // 150 // The following arguments are optional: 151 Name pulumi.StringPtrInput 152 Timeouts ProjectTimeoutsPtrInput 153 } 154 155 func (ProjectArgs) ElementType() reflect.Type { 156 return reflect.TypeOf((*projectArgs)(nil)).Elem() 157 } 158 159 type ProjectInput interface { 160 pulumi.Input 161 162 ToProjectOutput() ProjectOutput 163 ToProjectOutputWithContext(ctx context.Context) ProjectOutput 164 } 165 166 func (*Project) ElementType() reflect.Type { 167 return reflect.TypeOf((**Project)(nil)).Elem() 168 } 169 170 func (i *Project) ToProjectOutput() ProjectOutput { 171 return i.ToProjectOutputWithContext(context.Background()) 172 } 173 174 func (i *Project) ToProjectOutputWithContext(ctx context.Context) ProjectOutput { 175 return pulumi.ToOutputWithContext(ctx, i).(ProjectOutput) 176 } 177 178 // ProjectArrayInput is an input type that accepts ProjectArray and ProjectArrayOutput values. 179 // You can construct a concrete instance of `ProjectArrayInput` via: 180 // 181 // ProjectArray{ ProjectArgs{...} } 182 type ProjectArrayInput interface { 183 pulumi.Input 184 185 ToProjectArrayOutput() ProjectArrayOutput 186 ToProjectArrayOutputWithContext(context.Context) ProjectArrayOutput 187 } 188 189 type ProjectArray []ProjectInput 190 191 func (ProjectArray) ElementType() reflect.Type { 192 return reflect.TypeOf((*[]*Project)(nil)).Elem() 193 } 194 195 func (i ProjectArray) ToProjectArrayOutput() ProjectArrayOutput { 196 return i.ToProjectArrayOutputWithContext(context.Background()) 197 } 198 199 func (i ProjectArray) ToProjectArrayOutputWithContext(ctx context.Context) ProjectArrayOutput { 200 return pulumi.ToOutputWithContext(ctx, i).(ProjectArrayOutput) 201 } 202 203 // ProjectMapInput is an input type that accepts ProjectMap and ProjectMapOutput values. 204 // You can construct a concrete instance of `ProjectMapInput` via: 205 // 206 // ProjectMap{ "key": ProjectArgs{...} } 207 type ProjectMapInput interface { 208 pulumi.Input 209 210 ToProjectMapOutput() ProjectMapOutput 211 ToProjectMapOutputWithContext(context.Context) ProjectMapOutput 212 } 213 214 type ProjectMap map[string]ProjectInput 215 216 func (ProjectMap) ElementType() reflect.Type { 217 return reflect.TypeOf((*map[string]*Project)(nil)).Elem() 218 } 219 220 func (i ProjectMap) ToProjectMapOutput() ProjectMapOutput { 221 return i.ToProjectMapOutputWithContext(context.Background()) 222 } 223 224 func (i ProjectMap) ToProjectMapOutputWithContext(ctx context.Context) ProjectMapOutput { 225 return pulumi.ToOutputWithContext(ctx, i).(ProjectMapOutput) 226 } 227 228 type ProjectOutput struct{ *pulumi.OutputState } 229 230 func (ProjectOutput) ElementType() reflect.Type { 231 return reflect.TypeOf((**Project)(nil)).Elem() 232 } 233 234 func (o ProjectOutput) ToProjectOutput() ProjectOutput { 235 return o 236 } 237 238 func (o ProjectOutput) ToProjectOutputWithContext(ctx context.Context) ProjectOutput { 239 return o 240 } 241 242 // ARN of the Project. 243 func (o ProjectOutput) Arn() pulumi.StringOutput { 244 return o.ApplyT(func(v *Project) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput) 245 } 246 247 // Specify if automatic retraining should occur. Valid values are `ENABLED` or `DISABLED`. Defaults to `DISABLED` 248 func (o ProjectOutput) AutoUpdate() pulumi.StringOutput { 249 return o.ApplyT(func(v *Project) pulumi.StringOutput { return v.AutoUpdate }).(pulumi.StringOutput) 250 } 251 252 // Specify the feature being customized. Valid values are `CONTENT_MODERATION` or `CUSTOM_LABELS`. Defaults to `CUSTOM_LABELS` 253 func (o ProjectOutput) Feature() pulumi.StringPtrOutput { 254 return o.ApplyT(func(v *Project) pulumi.StringPtrOutput { return v.Feature }).(pulumi.StringPtrOutput) 255 } 256 257 // Desired name of the project 258 // 259 // The following arguments are optional: 260 func (o ProjectOutput) Name() pulumi.StringOutput { 261 return o.ApplyT(func(v *Project) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput) 262 } 263 264 func (o ProjectOutput) Timeouts() ProjectTimeoutsPtrOutput { 265 return o.ApplyT(func(v *Project) ProjectTimeoutsPtrOutput { return v.Timeouts }).(ProjectTimeoutsPtrOutput) 266 } 267 268 type ProjectArrayOutput struct{ *pulumi.OutputState } 269 270 func (ProjectArrayOutput) ElementType() reflect.Type { 271 return reflect.TypeOf((*[]*Project)(nil)).Elem() 272 } 273 274 func (o ProjectArrayOutput) ToProjectArrayOutput() ProjectArrayOutput { 275 return o 276 } 277 278 func (o ProjectArrayOutput) ToProjectArrayOutputWithContext(ctx context.Context) ProjectArrayOutput { 279 return o 280 } 281 282 func (o ProjectArrayOutput) Index(i pulumi.IntInput) ProjectOutput { 283 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Project { 284 return vs[0].([]*Project)[vs[1].(int)] 285 }).(ProjectOutput) 286 } 287 288 type ProjectMapOutput struct{ *pulumi.OutputState } 289 290 func (ProjectMapOutput) ElementType() reflect.Type { 291 return reflect.TypeOf((*map[string]*Project)(nil)).Elem() 292 } 293 294 func (o ProjectMapOutput) ToProjectMapOutput() ProjectMapOutput { 295 return o 296 } 297 298 func (o ProjectMapOutput) ToProjectMapOutputWithContext(ctx context.Context) ProjectMapOutput { 299 return o 300 } 301 302 func (o ProjectMapOutput) MapIndex(k pulumi.StringInput) ProjectOutput { 303 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Project { 304 return vs[0].(map[string]*Project)[vs[1].(string)] 305 }).(ProjectOutput) 306 } 307 308 func init() { 309 pulumi.RegisterInputType(reflect.TypeOf((*ProjectInput)(nil)).Elem(), &Project{}) 310 pulumi.RegisterInputType(reflect.TypeOf((*ProjectArrayInput)(nil)).Elem(), ProjectArray{}) 311 pulumi.RegisterInputType(reflect.TypeOf((*ProjectMapInput)(nil)).Elem(), ProjectMap{}) 312 pulumi.RegisterOutputType(ProjectOutput{}) 313 pulumi.RegisterOutputType(ProjectArrayOutput{}) 314 pulumi.RegisterOutputType(ProjectMapOutput{}) 315 }