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