github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/pinpoint/smsChannel.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  // Use the `pinpoint.SmsChannel` resource to manage Pinpoint SMS Channels.
    16  //
    17  // ## Example Usage
    18  //
    19  // <!--Start PulumiCodeChooser -->
    20  // ```go
    21  // package main
    22  //
    23  // import (
    24  //
    25  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/pinpoint"
    26  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    27  //
    28  // )
    29  //
    30  //	func main() {
    31  //		pulumi.Run(func(ctx *pulumi.Context) error {
    32  //			app, err := pinpoint.NewApp(ctx, "app", nil)
    33  //			if err != nil {
    34  //				return err
    35  //			}
    36  //			_, err = pinpoint.NewSmsChannel(ctx, "sms", &pinpoint.SmsChannelArgs{
    37  //				ApplicationId: app.ApplicationId,
    38  //			})
    39  //			if err != nil {
    40  //				return err
    41  //			}
    42  //			return nil
    43  //		})
    44  //	}
    45  //
    46  // ```
    47  // <!--End PulumiCodeChooser -->
    48  //
    49  // ## Import
    50  //
    51  // Using `pulumi import`, import the Pinpoint SMS Channel using the `application_id`. For example:
    52  //
    53  // ```sh
    54  // $ pulumi import aws:pinpoint/smsChannel:SmsChannel sms application-id
    55  // ```
    56  type SmsChannel struct {
    57  	pulumi.CustomResourceState
    58  
    59  	// ID of the application.
    60  	ApplicationId pulumi.StringOutput `pulumi:"applicationId"`
    61  	// Whether the channel is enabled or disabled. By default, it is set to `true`.
    62  	Enabled pulumi.BoolPtrOutput `pulumi:"enabled"`
    63  	// Maximum number of promotional messages that can be sent per second.
    64  	PromotionalMessagesPerSecond pulumi.IntOutput `pulumi:"promotionalMessagesPerSecond"`
    65  	// Identifier of the sender for your messages.
    66  	SenderId pulumi.StringPtrOutput `pulumi:"senderId"`
    67  	// Short Code registered with the phone provider.
    68  	ShortCode pulumi.StringPtrOutput `pulumi:"shortCode"`
    69  	// Maximum number of transactional messages per second that can be sent.
    70  	TransactionalMessagesPerSecond pulumi.IntOutput `pulumi:"transactionalMessagesPerSecond"`
    71  }
    72  
    73  // NewSmsChannel registers a new resource with the given unique name, arguments, and options.
    74  func NewSmsChannel(ctx *pulumi.Context,
    75  	name string, args *SmsChannelArgs, opts ...pulumi.ResourceOption) (*SmsChannel, 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  	opts = internal.PkgResourceDefaultOpts(opts)
    84  	var resource SmsChannel
    85  	err := ctx.RegisterResource("aws:pinpoint/smsChannel:SmsChannel", name, args, &resource, opts...)
    86  	if err != nil {
    87  		return nil, err
    88  	}
    89  	return &resource, nil
    90  }
    91  
    92  // GetSmsChannel gets an existing SmsChannel resource's state with the given name, ID, and optional
    93  // state properties that are used to uniquely qualify the lookup (nil if not required).
    94  func GetSmsChannel(ctx *pulumi.Context,
    95  	name string, id pulumi.IDInput, state *SmsChannelState, opts ...pulumi.ResourceOption) (*SmsChannel, error) {
    96  	var resource SmsChannel
    97  	err := ctx.ReadResource("aws:pinpoint/smsChannel:SmsChannel", name, id, state, &resource, opts...)
    98  	if err != nil {
    99  		return nil, err
   100  	}
   101  	return &resource, nil
   102  }
   103  
   104  // Input properties used for looking up and filtering SmsChannel resources.
   105  type smsChannelState struct {
   106  	// ID of the application.
   107  	ApplicationId *string `pulumi:"applicationId"`
   108  	// Whether the channel is enabled or disabled. By default, it is set to `true`.
   109  	Enabled *bool `pulumi:"enabled"`
   110  	// Maximum number of promotional messages that can be sent per second.
   111  	PromotionalMessagesPerSecond *int `pulumi:"promotionalMessagesPerSecond"`
   112  	// Identifier of the sender for your messages.
   113  	SenderId *string `pulumi:"senderId"`
   114  	// Short Code registered with the phone provider.
   115  	ShortCode *string `pulumi:"shortCode"`
   116  	// Maximum number of transactional messages per second that can be sent.
   117  	TransactionalMessagesPerSecond *int `pulumi:"transactionalMessagesPerSecond"`
   118  }
   119  
   120  type SmsChannelState struct {
   121  	// ID of the application.
   122  	ApplicationId pulumi.StringPtrInput
   123  	// Whether the channel is enabled or disabled. By default, it is set to `true`.
   124  	Enabled pulumi.BoolPtrInput
   125  	// Maximum number of promotional messages that can be sent per second.
   126  	PromotionalMessagesPerSecond pulumi.IntPtrInput
   127  	// Identifier of the sender for your messages.
   128  	SenderId pulumi.StringPtrInput
   129  	// Short Code registered with the phone provider.
   130  	ShortCode pulumi.StringPtrInput
   131  	// Maximum number of transactional messages per second that can be sent.
   132  	TransactionalMessagesPerSecond pulumi.IntPtrInput
   133  }
   134  
   135  func (SmsChannelState) ElementType() reflect.Type {
   136  	return reflect.TypeOf((*smsChannelState)(nil)).Elem()
   137  }
   138  
   139  type smsChannelArgs struct {
   140  	// ID of the application.
   141  	ApplicationId string `pulumi:"applicationId"`
   142  	// Whether the channel is enabled or disabled. By default, it is set to `true`.
   143  	Enabled *bool `pulumi:"enabled"`
   144  	// Identifier of the sender for your messages.
   145  	SenderId *string `pulumi:"senderId"`
   146  	// Short Code registered with the phone provider.
   147  	ShortCode *string `pulumi:"shortCode"`
   148  }
   149  
   150  // The set of arguments for constructing a SmsChannel resource.
   151  type SmsChannelArgs struct {
   152  	// ID of the application.
   153  	ApplicationId pulumi.StringInput
   154  	// Whether the channel is enabled or disabled. By default, it is set to `true`.
   155  	Enabled pulumi.BoolPtrInput
   156  	// Identifier of the sender for your messages.
   157  	SenderId pulumi.StringPtrInput
   158  	// Short Code registered with the phone provider.
   159  	ShortCode pulumi.StringPtrInput
   160  }
   161  
   162  func (SmsChannelArgs) ElementType() reflect.Type {
   163  	return reflect.TypeOf((*smsChannelArgs)(nil)).Elem()
   164  }
   165  
   166  type SmsChannelInput interface {
   167  	pulumi.Input
   168  
   169  	ToSmsChannelOutput() SmsChannelOutput
   170  	ToSmsChannelOutputWithContext(ctx context.Context) SmsChannelOutput
   171  }
   172  
   173  func (*SmsChannel) ElementType() reflect.Type {
   174  	return reflect.TypeOf((**SmsChannel)(nil)).Elem()
   175  }
   176  
   177  func (i *SmsChannel) ToSmsChannelOutput() SmsChannelOutput {
   178  	return i.ToSmsChannelOutputWithContext(context.Background())
   179  }
   180  
   181  func (i *SmsChannel) ToSmsChannelOutputWithContext(ctx context.Context) SmsChannelOutput {
   182  	return pulumi.ToOutputWithContext(ctx, i).(SmsChannelOutput)
   183  }
   184  
   185  // SmsChannelArrayInput is an input type that accepts SmsChannelArray and SmsChannelArrayOutput values.
   186  // You can construct a concrete instance of `SmsChannelArrayInput` via:
   187  //
   188  //	SmsChannelArray{ SmsChannelArgs{...} }
   189  type SmsChannelArrayInput interface {
   190  	pulumi.Input
   191  
   192  	ToSmsChannelArrayOutput() SmsChannelArrayOutput
   193  	ToSmsChannelArrayOutputWithContext(context.Context) SmsChannelArrayOutput
   194  }
   195  
   196  type SmsChannelArray []SmsChannelInput
   197  
   198  func (SmsChannelArray) ElementType() reflect.Type {
   199  	return reflect.TypeOf((*[]*SmsChannel)(nil)).Elem()
   200  }
   201  
   202  func (i SmsChannelArray) ToSmsChannelArrayOutput() SmsChannelArrayOutput {
   203  	return i.ToSmsChannelArrayOutputWithContext(context.Background())
   204  }
   205  
   206  func (i SmsChannelArray) ToSmsChannelArrayOutputWithContext(ctx context.Context) SmsChannelArrayOutput {
   207  	return pulumi.ToOutputWithContext(ctx, i).(SmsChannelArrayOutput)
   208  }
   209  
   210  // SmsChannelMapInput is an input type that accepts SmsChannelMap and SmsChannelMapOutput values.
   211  // You can construct a concrete instance of `SmsChannelMapInput` via:
   212  //
   213  //	SmsChannelMap{ "key": SmsChannelArgs{...} }
   214  type SmsChannelMapInput interface {
   215  	pulumi.Input
   216  
   217  	ToSmsChannelMapOutput() SmsChannelMapOutput
   218  	ToSmsChannelMapOutputWithContext(context.Context) SmsChannelMapOutput
   219  }
   220  
   221  type SmsChannelMap map[string]SmsChannelInput
   222  
   223  func (SmsChannelMap) ElementType() reflect.Type {
   224  	return reflect.TypeOf((*map[string]*SmsChannel)(nil)).Elem()
   225  }
   226  
   227  func (i SmsChannelMap) ToSmsChannelMapOutput() SmsChannelMapOutput {
   228  	return i.ToSmsChannelMapOutputWithContext(context.Background())
   229  }
   230  
   231  func (i SmsChannelMap) ToSmsChannelMapOutputWithContext(ctx context.Context) SmsChannelMapOutput {
   232  	return pulumi.ToOutputWithContext(ctx, i).(SmsChannelMapOutput)
   233  }
   234  
   235  type SmsChannelOutput struct{ *pulumi.OutputState }
   236  
   237  func (SmsChannelOutput) ElementType() reflect.Type {
   238  	return reflect.TypeOf((**SmsChannel)(nil)).Elem()
   239  }
   240  
   241  func (o SmsChannelOutput) ToSmsChannelOutput() SmsChannelOutput {
   242  	return o
   243  }
   244  
   245  func (o SmsChannelOutput) ToSmsChannelOutputWithContext(ctx context.Context) SmsChannelOutput {
   246  	return o
   247  }
   248  
   249  // ID of the application.
   250  func (o SmsChannelOutput) ApplicationId() pulumi.StringOutput {
   251  	return o.ApplyT(func(v *SmsChannel) pulumi.StringOutput { return v.ApplicationId }).(pulumi.StringOutput)
   252  }
   253  
   254  // Whether the channel is enabled or disabled. By default, it is set to `true`.
   255  func (o SmsChannelOutput) Enabled() pulumi.BoolPtrOutput {
   256  	return o.ApplyT(func(v *SmsChannel) pulumi.BoolPtrOutput { return v.Enabled }).(pulumi.BoolPtrOutput)
   257  }
   258  
   259  // Maximum number of promotional messages that can be sent per second.
   260  func (o SmsChannelOutput) PromotionalMessagesPerSecond() pulumi.IntOutput {
   261  	return o.ApplyT(func(v *SmsChannel) pulumi.IntOutput { return v.PromotionalMessagesPerSecond }).(pulumi.IntOutput)
   262  }
   263  
   264  // Identifier of the sender for your messages.
   265  func (o SmsChannelOutput) SenderId() pulumi.StringPtrOutput {
   266  	return o.ApplyT(func(v *SmsChannel) pulumi.StringPtrOutput { return v.SenderId }).(pulumi.StringPtrOutput)
   267  }
   268  
   269  // Short Code registered with the phone provider.
   270  func (o SmsChannelOutput) ShortCode() pulumi.StringPtrOutput {
   271  	return o.ApplyT(func(v *SmsChannel) pulumi.StringPtrOutput { return v.ShortCode }).(pulumi.StringPtrOutput)
   272  }
   273  
   274  // Maximum number of transactional messages per second that can be sent.
   275  func (o SmsChannelOutput) TransactionalMessagesPerSecond() pulumi.IntOutput {
   276  	return o.ApplyT(func(v *SmsChannel) pulumi.IntOutput { return v.TransactionalMessagesPerSecond }).(pulumi.IntOutput)
   277  }
   278  
   279  type SmsChannelArrayOutput struct{ *pulumi.OutputState }
   280  
   281  func (SmsChannelArrayOutput) ElementType() reflect.Type {
   282  	return reflect.TypeOf((*[]*SmsChannel)(nil)).Elem()
   283  }
   284  
   285  func (o SmsChannelArrayOutput) ToSmsChannelArrayOutput() SmsChannelArrayOutput {
   286  	return o
   287  }
   288  
   289  func (o SmsChannelArrayOutput) ToSmsChannelArrayOutputWithContext(ctx context.Context) SmsChannelArrayOutput {
   290  	return o
   291  }
   292  
   293  func (o SmsChannelArrayOutput) Index(i pulumi.IntInput) SmsChannelOutput {
   294  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *SmsChannel {
   295  		return vs[0].([]*SmsChannel)[vs[1].(int)]
   296  	}).(SmsChannelOutput)
   297  }
   298  
   299  type SmsChannelMapOutput struct{ *pulumi.OutputState }
   300  
   301  func (SmsChannelMapOutput) ElementType() reflect.Type {
   302  	return reflect.TypeOf((*map[string]*SmsChannel)(nil)).Elem()
   303  }
   304  
   305  func (o SmsChannelMapOutput) ToSmsChannelMapOutput() SmsChannelMapOutput {
   306  	return o
   307  }
   308  
   309  func (o SmsChannelMapOutput) ToSmsChannelMapOutputWithContext(ctx context.Context) SmsChannelMapOutput {
   310  	return o
   311  }
   312  
   313  func (o SmsChannelMapOutput) MapIndex(k pulumi.StringInput) SmsChannelOutput {
   314  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *SmsChannel {
   315  		return vs[0].(map[string]*SmsChannel)[vs[1].(string)]
   316  	}).(SmsChannelOutput)
   317  }
   318  
   319  func init() {
   320  	pulumi.RegisterInputType(reflect.TypeOf((*SmsChannelInput)(nil)).Elem(), &SmsChannel{})
   321  	pulumi.RegisterInputType(reflect.TypeOf((*SmsChannelArrayInput)(nil)).Elem(), SmsChannelArray{})
   322  	pulumi.RegisterInputType(reflect.TypeOf((*SmsChannelMapInput)(nil)).Elem(), SmsChannelMap{})
   323  	pulumi.RegisterOutputType(SmsChannelOutput{})
   324  	pulumi.RegisterOutputType(SmsChannelArrayOutput{})
   325  	pulumi.RegisterOutputType(SmsChannelMapOutput{})
   326  }