github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/pinpoint/baiduChannel.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 pinpoint 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 Pinpoint Baidu Channel resource. 16 // 17 // > **Note:** All arguments including the Api Key and Secret Key will be stored in the raw state as plain-text. 18 // ## Example Usage 19 // 20 // <!--Start PulumiCodeChooser --> 21 // ```go 22 // package main 23 // 24 // import ( 25 // 26 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/pinpoint" 27 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 28 // 29 // ) 30 // 31 // func main() { 32 // pulumi.Run(func(ctx *pulumi.Context) error { 33 // app, err := pinpoint.NewApp(ctx, "app", nil) 34 // if err != nil { 35 // return err 36 // } 37 // _, err = pinpoint.NewBaiduChannel(ctx, "channel", &pinpoint.BaiduChannelArgs{ 38 // ApplicationId: app.ApplicationId, 39 // ApiKey: pulumi.String(""), 40 // SecretKey: pulumi.String(""), 41 // }) 42 // if err != nil { 43 // return err 44 // } 45 // return nil 46 // }) 47 // } 48 // 49 // ``` 50 // <!--End PulumiCodeChooser --> 51 // 52 // ## Import 53 // 54 // Using `pulumi import`, import Pinpoint Baidu Channel using the `application-id`. For example: 55 // 56 // ```sh 57 // $ pulumi import aws:pinpoint/baiduChannel:BaiduChannel channel application-id 58 // ``` 59 type BaiduChannel struct { 60 pulumi.CustomResourceState 61 62 // Platform credential API key from Baidu. 63 ApiKey pulumi.StringOutput `pulumi:"apiKey"` 64 // The application ID. 65 ApplicationId pulumi.StringOutput `pulumi:"applicationId"` 66 // Specifies whether to enable the channel. Defaults to `true`. 67 Enabled pulumi.BoolPtrOutput `pulumi:"enabled"` 68 // Platform credential Secret key from Baidu. 69 SecretKey pulumi.StringOutput `pulumi:"secretKey"` 70 } 71 72 // NewBaiduChannel registers a new resource with the given unique name, arguments, and options. 73 func NewBaiduChannel(ctx *pulumi.Context, 74 name string, args *BaiduChannelArgs, opts ...pulumi.ResourceOption) (*BaiduChannel, error) { 75 if args == nil { 76 return nil, errors.New("missing one or more required arguments") 77 } 78 79 if args.ApiKey == nil { 80 return nil, errors.New("invalid value for required argument 'ApiKey'") 81 } 82 if args.ApplicationId == nil { 83 return nil, errors.New("invalid value for required argument 'ApplicationId'") 84 } 85 if args.SecretKey == nil { 86 return nil, errors.New("invalid value for required argument 'SecretKey'") 87 } 88 if args.ApiKey != nil { 89 args.ApiKey = pulumi.ToSecret(args.ApiKey).(pulumi.StringInput) 90 } 91 if args.SecretKey != nil { 92 args.SecretKey = pulumi.ToSecret(args.SecretKey).(pulumi.StringInput) 93 } 94 secrets := pulumi.AdditionalSecretOutputs([]string{ 95 "apiKey", 96 "secretKey", 97 }) 98 opts = append(opts, secrets) 99 opts = internal.PkgResourceDefaultOpts(opts) 100 var resource BaiduChannel 101 err := ctx.RegisterResource("aws:pinpoint/baiduChannel:BaiduChannel", name, args, &resource, opts...) 102 if err != nil { 103 return nil, err 104 } 105 return &resource, nil 106 } 107 108 // GetBaiduChannel gets an existing BaiduChannel resource's state with the given name, ID, and optional 109 // state properties that are used to uniquely qualify the lookup (nil if not required). 110 func GetBaiduChannel(ctx *pulumi.Context, 111 name string, id pulumi.IDInput, state *BaiduChannelState, opts ...pulumi.ResourceOption) (*BaiduChannel, error) { 112 var resource BaiduChannel 113 err := ctx.ReadResource("aws:pinpoint/baiduChannel:BaiduChannel", name, id, state, &resource, opts...) 114 if err != nil { 115 return nil, err 116 } 117 return &resource, nil 118 } 119 120 // Input properties used for looking up and filtering BaiduChannel resources. 121 type baiduChannelState struct { 122 // Platform credential API key from Baidu. 123 ApiKey *string `pulumi:"apiKey"` 124 // The application ID. 125 ApplicationId *string `pulumi:"applicationId"` 126 // Specifies whether to enable the channel. Defaults to `true`. 127 Enabled *bool `pulumi:"enabled"` 128 // Platform credential Secret key from Baidu. 129 SecretKey *string `pulumi:"secretKey"` 130 } 131 132 type BaiduChannelState struct { 133 // Platform credential API key from Baidu. 134 ApiKey pulumi.StringPtrInput 135 // The application ID. 136 ApplicationId pulumi.StringPtrInput 137 // Specifies whether to enable the channel. Defaults to `true`. 138 Enabled pulumi.BoolPtrInput 139 // Platform credential Secret key from Baidu. 140 SecretKey pulumi.StringPtrInput 141 } 142 143 func (BaiduChannelState) ElementType() reflect.Type { 144 return reflect.TypeOf((*baiduChannelState)(nil)).Elem() 145 } 146 147 type baiduChannelArgs struct { 148 // Platform credential API key from Baidu. 149 ApiKey string `pulumi:"apiKey"` 150 // The application ID. 151 ApplicationId string `pulumi:"applicationId"` 152 // Specifies whether to enable the channel. Defaults to `true`. 153 Enabled *bool `pulumi:"enabled"` 154 // Platform credential Secret key from Baidu. 155 SecretKey string `pulumi:"secretKey"` 156 } 157 158 // The set of arguments for constructing a BaiduChannel resource. 159 type BaiduChannelArgs struct { 160 // Platform credential API key from Baidu. 161 ApiKey pulumi.StringInput 162 // The application ID. 163 ApplicationId pulumi.StringInput 164 // Specifies whether to enable the channel. Defaults to `true`. 165 Enabled pulumi.BoolPtrInput 166 // Platform credential Secret key from Baidu. 167 SecretKey pulumi.StringInput 168 } 169 170 func (BaiduChannelArgs) ElementType() reflect.Type { 171 return reflect.TypeOf((*baiduChannelArgs)(nil)).Elem() 172 } 173 174 type BaiduChannelInput interface { 175 pulumi.Input 176 177 ToBaiduChannelOutput() BaiduChannelOutput 178 ToBaiduChannelOutputWithContext(ctx context.Context) BaiduChannelOutput 179 } 180 181 func (*BaiduChannel) ElementType() reflect.Type { 182 return reflect.TypeOf((**BaiduChannel)(nil)).Elem() 183 } 184 185 func (i *BaiduChannel) ToBaiduChannelOutput() BaiduChannelOutput { 186 return i.ToBaiduChannelOutputWithContext(context.Background()) 187 } 188 189 func (i *BaiduChannel) ToBaiduChannelOutputWithContext(ctx context.Context) BaiduChannelOutput { 190 return pulumi.ToOutputWithContext(ctx, i).(BaiduChannelOutput) 191 } 192 193 // BaiduChannelArrayInput is an input type that accepts BaiduChannelArray and BaiduChannelArrayOutput values. 194 // You can construct a concrete instance of `BaiduChannelArrayInput` via: 195 // 196 // BaiduChannelArray{ BaiduChannelArgs{...} } 197 type BaiduChannelArrayInput interface { 198 pulumi.Input 199 200 ToBaiduChannelArrayOutput() BaiduChannelArrayOutput 201 ToBaiduChannelArrayOutputWithContext(context.Context) BaiduChannelArrayOutput 202 } 203 204 type BaiduChannelArray []BaiduChannelInput 205 206 func (BaiduChannelArray) ElementType() reflect.Type { 207 return reflect.TypeOf((*[]*BaiduChannel)(nil)).Elem() 208 } 209 210 func (i BaiduChannelArray) ToBaiduChannelArrayOutput() BaiduChannelArrayOutput { 211 return i.ToBaiduChannelArrayOutputWithContext(context.Background()) 212 } 213 214 func (i BaiduChannelArray) ToBaiduChannelArrayOutputWithContext(ctx context.Context) BaiduChannelArrayOutput { 215 return pulumi.ToOutputWithContext(ctx, i).(BaiduChannelArrayOutput) 216 } 217 218 // BaiduChannelMapInput is an input type that accepts BaiduChannelMap and BaiduChannelMapOutput values. 219 // You can construct a concrete instance of `BaiduChannelMapInput` via: 220 // 221 // BaiduChannelMap{ "key": BaiduChannelArgs{...} } 222 type BaiduChannelMapInput interface { 223 pulumi.Input 224 225 ToBaiduChannelMapOutput() BaiduChannelMapOutput 226 ToBaiduChannelMapOutputWithContext(context.Context) BaiduChannelMapOutput 227 } 228 229 type BaiduChannelMap map[string]BaiduChannelInput 230 231 func (BaiduChannelMap) ElementType() reflect.Type { 232 return reflect.TypeOf((*map[string]*BaiduChannel)(nil)).Elem() 233 } 234 235 func (i BaiduChannelMap) ToBaiduChannelMapOutput() BaiduChannelMapOutput { 236 return i.ToBaiduChannelMapOutputWithContext(context.Background()) 237 } 238 239 func (i BaiduChannelMap) ToBaiduChannelMapOutputWithContext(ctx context.Context) BaiduChannelMapOutput { 240 return pulumi.ToOutputWithContext(ctx, i).(BaiduChannelMapOutput) 241 } 242 243 type BaiduChannelOutput struct{ *pulumi.OutputState } 244 245 func (BaiduChannelOutput) ElementType() reflect.Type { 246 return reflect.TypeOf((**BaiduChannel)(nil)).Elem() 247 } 248 249 func (o BaiduChannelOutput) ToBaiduChannelOutput() BaiduChannelOutput { 250 return o 251 } 252 253 func (o BaiduChannelOutput) ToBaiduChannelOutputWithContext(ctx context.Context) BaiduChannelOutput { 254 return o 255 } 256 257 // Platform credential API key from Baidu. 258 func (o BaiduChannelOutput) ApiKey() pulumi.StringOutput { 259 return o.ApplyT(func(v *BaiduChannel) pulumi.StringOutput { return v.ApiKey }).(pulumi.StringOutput) 260 } 261 262 // The application ID. 263 func (o BaiduChannelOutput) ApplicationId() pulumi.StringOutput { 264 return o.ApplyT(func(v *BaiduChannel) pulumi.StringOutput { return v.ApplicationId }).(pulumi.StringOutput) 265 } 266 267 // Specifies whether to enable the channel. Defaults to `true`. 268 func (o BaiduChannelOutput) Enabled() pulumi.BoolPtrOutput { 269 return o.ApplyT(func(v *BaiduChannel) pulumi.BoolPtrOutput { return v.Enabled }).(pulumi.BoolPtrOutput) 270 } 271 272 // Platform credential Secret key from Baidu. 273 func (o BaiduChannelOutput) SecretKey() pulumi.StringOutput { 274 return o.ApplyT(func(v *BaiduChannel) pulumi.StringOutput { return v.SecretKey }).(pulumi.StringOutput) 275 } 276 277 type BaiduChannelArrayOutput struct{ *pulumi.OutputState } 278 279 func (BaiduChannelArrayOutput) ElementType() reflect.Type { 280 return reflect.TypeOf((*[]*BaiduChannel)(nil)).Elem() 281 } 282 283 func (o BaiduChannelArrayOutput) ToBaiduChannelArrayOutput() BaiduChannelArrayOutput { 284 return o 285 } 286 287 func (o BaiduChannelArrayOutput) ToBaiduChannelArrayOutputWithContext(ctx context.Context) BaiduChannelArrayOutput { 288 return o 289 } 290 291 func (o BaiduChannelArrayOutput) Index(i pulumi.IntInput) BaiduChannelOutput { 292 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *BaiduChannel { 293 return vs[0].([]*BaiduChannel)[vs[1].(int)] 294 }).(BaiduChannelOutput) 295 } 296 297 type BaiduChannelMapOutput struct{ *pulumi.OutputState } 298 299 func (BaiduChannelMapOutput) ElementType() reflect.Type { 300 return reflect.TypeOf((*map[string]*BaiduChannel)(nil)).Elem() 301 } 302 303 func (o BaiduChannelMapOutput) ToBaiduChannelMapOutput() BaiduChannelMapOutput { 304 return o 305 } 306 307 func (o BaiduChannelMapOutput) ToBaiduChannelMapOutputWithContext(ctx context.Context) BaiduChannelMapOutput { 308 return o 309 } 310 311 func (o BaiduChannelMapOutput) MapIndex(k pulumi.StringInput) BaiduChannelOutput { 312 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *BaiduChannel { 313 return vs[0].(map[string]*BaiduChannel)[vs[1].(string)] 314 }).(BaiduChannelOutput) 315 } 316 317 func init() { 318 pulumi.RegisterInputType(reflect.TypeOf((*BaiduChannelInput)(nil)).Elem(), &BaiduChannel{}) 319 pulumi.RegisterInputType(reflect.TypeOf((*BaiduChannelArrayInput)(nil)).Elem(), BaiduChannelArray{}) 320 pulumi.RegisterInputType(reflect.TypeOf((*BaiduChannelMapInput)(nil)).Elem(), BaiduChannelMap{}) 321 pulumi.RegisterOutputType(BaiduChannelOutput{}) 322 pulumi.RegisterOutputType(BaiduChannelArrayOutput{}) 323 pulumi.RegisterOutputType(BaiduChannelMapOutput{}) 324 }