github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/connect/hoursOfOperation.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 connect
     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 an Amazon Connect Hours of Operation resource. For more information see
    16  // [Amazon Connect: Getting Started](https://docs.aws.amazon.com/connect/latest/adminguide/amazon-connect-get-started.html)
    17  //
    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/connect"
    27  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    28  //
    29  // )
    30  //
    31  //	func main() {
    32  //		pulumi.Run(func(ctx *pulumi.Context) error {
    33  //			_, err := connect.NewHoursOfOperation(ctx, "test", &connect.HoursOfOperationArgs{
    34  //				InstanceId:  pulumi.String("aaaaaaaa-bbbb-cccc-dddd-111111111111"),
    35  //				Name:        pulumi.String("Office Hours"),
    36  //				Description: pulumi.String("Monday office hours"),
    37  //				TimeZone:    pulumi.String("EST"),
    38  //				Configs: connect.HoursOfOperationConfigArray{
    39  //					&connect.HoursOfOperationConfigArgs{
    40  //						Day: pulumi.String("MONDAY"),
    41  //						EndTime: &connect.HoursOfOperationConfigEndTimeArgs{
    42  //							Hours:   pulumi.Int(23),
    43  //							Minutes: pulumi.Int(8),
    44  //						},
    45  //						StartTime: &connect.HoursOfOperationConfigStartTimeArgs{
    46  //							Hours:   pulumi.Int(8),
    47  //							Minutes: pulumi.Int(0),
    48  //						},
    49  //					},
    50  //					&connect.HoursOfOperationConfigArgs{
    51  //						Day: pulumi.String("TUESDAY"),
    52  //						EndTime: &connect.HoursOfOperationConfigEndTimeArgs{
    53  //							Hours:   pulumi.Int(21),
    54  //							Minutes: pulumi.Int(0),
    55  //						},
    56  //						StartTime: &connect.HoursOfOperationConfigStartTimeArgs{
    57  //							Hours:   pulumi.Int(9),
    58  //							Minutes: pulumi.Int(0),
    59  //						},
    60  //					},
    61  //				},
    62  //				Tags: pulumi.StringMap{
    63  //					"Name": pulumi.String("Example Hours of Operation"),
    64  //				},
    65  //			})
    66  //			if err != nil {
    67  //				return err
    68  //			}
    69  //			return nil
    70  //		})
    71  //	}
    72  //
    73  // ```
    74  // <!--End PulumiCodeChooser -->
    75  //
    76  // ## Import
    77  //
    78  // Using `pulumi import`, import Amazon Connect Hours of Operations using the `instance_id` and `hours_of_operation_id` separated by a colon (`:`). For example:
    79  //
    80  // ```sh
    81  // $ pulumi import aws:connect/hoursOfOperation:HoursOfOperation example f1288a1f-6193-445a-b47e-af739b2:c1d4e5f6-1b3c-1b3c-1b3c-c1d4e5f6c1d4e5
    82  // ```
    83  type HoursOfOperation struct {
    84  	pulumi.CustomResourceState
    85  
    86  	// The Amazon Resource Name (ARN) of the Hours of Operation.
    87  	Arn pulumi.StringOutput `pulumi:"arn"`
    88  	// One or more config blocks which define the configuration information for the hours of operation: day, start time, and end time . Config blocks are documented below.
    89  	Configs HoursOfOperationConfigArrayOutput `pulumi:"configs"`
    90  	// Specifies the description of the Hours of Operation.
    91  	Description pulumi.StringPtrOutput `pulumi:"description"`
    92  	// The identifier for the hours of operation.
    93  	HoursOfOperationId pulumi.StringOutput `pulumi:"hoursOfOperationId"`
    94  	// Specifies the identifier of the hosting Amazon Connect Instance.
    95  	InstanceId pulumi.StringOutput `pulumi:"instanceId"`
    96  	// Specifies the name of the Hours of Operation.
    97  	Name pulumi.StringOutput `pulumi:"name"`
    98  	// Tags to apply to the Hours of Operation. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    99  	Tags pulumi.StringMapOutput `pulumi:"tags"`
   100  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   101  	//
   102  	// Deprecated: Please use `tags` instead.
   103  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
   104  	// Specifies the time zone of the Hours of Operation.
   105  	TimeZone pulumi.StringOutput `pulumi:"timeZone"`
   106  }
   107  
   108  // NewHoursOfOperation registers a new resource with the given unique name, arguments, and options.
   109  func NewHoursOfOperation(ctx *pulumi.Context,
   110  	name string, args *HoursOfOperationArgs, opts ...pulumi.ResourceOption) (*HoursOfOperation, error) {
   111  	if args == nil {
   112  		return nil, errors.New("missing one or more required arguments")
   113  	}
   114  
   115  	if args.Configs == nil {
   116  		return nil, errors.New("invalid value for required argument 'Configs'")
   117  	}
   118  	if args.InstanceId == nil {
   119  		return nil, errors.New("invalid value for required argument 'InstanceId'")
   120  	}
   121  	if args.TimeZone == nil {
   122  		return nil, errors.New("invalid value for required argument 'TimeZone'")
   123  	}
   124  	opts = internal.PkgResourceDefaultOpts(opts)
   125  	var resource HoursOfOperation
   126  	err := ctx.RegisterResource("aws:connect/hoursOfOperation:HoursOfOperation", name, args, &resource, opts...)
   127  	if err != nil {
   128  		return nil, err
   129  	}
   130  	return &resource, nil
   131  }
   132  
   133  // GetHoursOfOperation gets an existing HoursOfOperation resource's state with the given name, ID, and optional
   134  // state properties that are used to uniquely qualify the lookup (nil if not required).
   135  func GetHoursOfOperation(ctx *pulumi.Context,
   136  	name string, id pulumi.IDInput, state *HoursOfOperationState, opts ...pulumi.ResourceOption) (*HoursOfOperation, error) {
   137  	var resource HoursOfOperation
   138  	err := ctx.ReadResource("aws:connect/hoursOfOperation:HoursOfOperation", name, id, state, &resource, opts...)
   139  	if err != nil {
   140  		return nil, err
   141  	}
   142  	return &resource, nil
   143  }
   144  
   145  // Input properties used for looking up and filtering HoursOfOperation resources.
   146  type hoursOfOperationState struct {
   147  	// The Amazon Resource Name (ARN) of the Hours of Operation.
   148  	Arn *string `pulumi:"arn"`
   149  	// One or more config blocks which define the configuration information for the hours of operation: day, start time, and end time . Config blocks are documented below.
   150  	Configs []HoursOfOperationConfig `pulumi:"configs"`
   151  	// Specifies the description of the Hours of Operation.
   152  	Description *string `pulumi:"description"`
   153  	// The identifier for the hours of operation.
   154  	HoursOfOperationId *string `pulumi:"hoursOfOperationId"`
   155  	// Specifies the identifier of the hosting Amazon Connect Instance.
   156  	InstanceId *string `pulumi:"instanceId"`
   157  	// Specifies the name of the Hours of Operation.
   158  	Name *string `pulumi:"name"`
   159  	// Tags to apply to the Hours of Operation. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   160  	Tags map[string]string `pulumi:"tags"`
   161  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   162  	//
   163  	// Deprecated: Please use `tags` instead.
   164  	TagsAll map[string]string `pulumi:"tagsAll"`
   165  	// Specifies the time zone of the Hours of Operation.
   166  	TimeZone *string `pulumi:"timeZone"`
   167  }
   168  
   169  type HoursOfOperationState struct {
   170  	// The Amazon Resource Name (ARN) of the Hours of Operation.
   171  	Arn pulumi.StringPtrInput
   172  	// One or more config blocks which define the configuration information for the hours of operation: day, start time, and end time . Config blocks are documented below.
   173  	Configs HoursOfOperationConfigArrayInput
   174  	// Specifies the description of the Hours of Operation.
   175  	Description pulumi.StringPtrInput
   176  	// The identifier for the hours of operation.
   177  	HoursOfOperationId pulumi.StringPtrInput
   178  	// Specifies the identifier of the hosting Amazon Connect Instance.
   179  	InstanceId pulumi.StringPtrInput
   180  	// Specifies the name of the Hours of Operation.
   181  	Name pulumi.StringPtrInput
   182  	// Tags to apply to the Hours of Operation. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   183  	Tags pulumi.StringMapInput
   184  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   185  	//
   186  	// Deprecated: Please use `tags` instead.
   187  	TagsAll pulumi.StringMapInput
   188  	// Specifies the time zone of the Hours of Operation.
   189  	TimeZone pulumi.StringPtrInput
   190  }
   191  
   192  func (HoursOfOperationState) ElementType() reflect.Type {
   193  	return reflect.TypeOf((*hoursOfOperationState)(nil)).Elem()
   194  }
   195  
   196  type hoursOfOperationArgs struct {
   197  	// One or more config blocks which define the configuration information for the hours of operation: day, start time, and end time . Config blocks are documented below.
   198  	Configs []HoursOfOperationConfig `pulumi:"configs"`
   199  	// Specifies the description of the Hours of Operation.
   200  	Description *string `pulumi:"description"`
   201  	// Specifies the identifier of the hosting Amazon Connect Instance.
   202  	InstanceId string `pulumi:"instanceId"`
   203  	// Specifies the name of the Hours of Operation.
   204  	Name *string `pulumi:"name"`
   205  	// Tags to apply to the Hours of Operation. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   206  	Tags map[string]string `pulumi:"tags"`
   207  	// Specifies the time zone of the Hours of Operation.
   208  	TimeZone string `pulumi:"timeZone"`
   209  }
   210  
   211  // The set of arguments for constructing a HoursOfOperation resource.
   212  type HoursOfOperationArgs struct {
   213  	// One or more config blocks which define the configuration information for the hours of operation: day, start time, and end time . Config blocks are documented below.
   214  	Configs HoursOfOperationConfigArrayInput
   215  	// Specifies the description of the Hours of Operation.
   216  	Description pulumi.StringPtrInput
   217  	// Specifies the identifier of the hosting Amazon Connect Instance.
   218  	InstanceId pulumi.StringInput
   219  	// Specifies the name of the Hours of Operation.
   220  	Name pulumi.StringPtrInput
   221  	// Tags to apply to the Hours of Operation. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   222  	Tags pulumi.StringMapInput
   223  	// Specifies the time zone of the Hours of Operation.
   224  	TimeZone pulumi.StringInput
   225  }
   226  
   227  func (HoursOfOperationArgs) ElementType() reflect.Type {
   228  	return reflect.TypeOf((*hoursOfOperationArgs)(nil)).Elem()
   229  }
   230  
   231  type HoursOfOperationInput interface {
   232  	pulumi.Input
   233  
   234  	ToHoursOfOperationOutput() HoursOfOperationOutput
   235  	ToHoursOfOperationOutputWithContext(ctx context.Context) HoursOfOperationOutput
   236  }
   237  
   238  func (*HoursOfOperation) ElementType() reflect.Type {
   239  	return reflect.TypeOf((**HoursOfOperation)(nil)).Elem()
   240  }
   241  
   242  func (i *HoursOfOperation) ToHoursOfOperationOutput() HoursOfOperationOutput {
   243  	return i.ToHoursOfOperationOutputWithContext(context.Background())
   244  }
   245  
   246  func (i *HoursOfOperation) ToHoursOfOperationOutputWithContext(ctx context.Context) HoursOfOperationOutput {
   247  	return pulumi.ToOutputWithContext(ctx, i).(HoursOfOperationOutput)
   248  }
   249  
   250  // HoursOfOperationArrayInput is an input type that accepts HoursOfOperationArray and HoursOfOperationArrayOutput values.
   251  // You can construct a concrete instance of `HoursOfOperationArrayInput` via:
   252  //
   253  //	HoursOfOperationArray{ HoursOfOperationArgs{...} }
   254  type HoursOfOperationArrayInput interface {
   255  	pulumi.Input
   256  
   257  	ToHoursOfOperationArrayOutput() HoursOfOperationArrayOutput
   258  	ToHoursOfOperationArrayOutputWithContext(context.Context) HoursOfOperationArrayOutput
   259  }
   260  
   261  type HoursOfOperationArray []HoursOfOperationInput
   262  
   263  func (HoursOfOperationArray) ElementType() reflect.Type {
   264  	return reflect.TypeOf((*[]*HoursOfOperation)(nil)).Elem()
   265  }
   266  
   267  func (i HoursOfOperationArray) ToHoursOfOperationArrayOutput() HoursOfOperationArrayOutput {
   268  	return i.ToHoursOfOperationArrayOutputWithContext(context.Background())
   269  }
   270  
   271  func (i HoursOfOperationArray) ToHoursOfOperationArrayOutputWithContext(ctx context.Context) HoursOfOperationArrayOutput {
   272  	return pulumi.ToOutputWithContext(ctx, i).(HoursOfOperationArrayOutput)
   273  }
   274  
   275  // HoursOfOperationMapInput is an input type that accepts HoursOfOperationMap and HoursOfOperationMapOutput values.
   276  // You can construct a concrete instance of `HoursOfOperationMapInput` via:
   277  //
   278  //	HoursOfOperationMap{ "key": HoursOfOperationArgs{...} }
   279  type HoursOfOperationMapInput interface {
   280  	pulumi.Input
   281  
   282  	ToHoursOfOperationMapOutput() HoursOfOperationMapOutput
   283  	ToHoursOfOperationMapOutputWithContext(context.Context) HoursOfOperationMapOutput
   284  }
   285  
   286  type HoursOfOperationMap map[string]HoursOfOperationInput
   287  
   288  func (HoursOfOperationMap) ElementType() reflect.Type {
   289  	return reflect.TypeOf((*map[string]*HoursOfOperation)(nil)).Elem()
   290  }
   291  
   292  func (i HoursOfOperationMap) ToHoursOfOperationMapOutput() HoursOfOperationMapOutput {
   293  	return i.ToHoursOfOperationMapOutputWithContext(context.Background())
   294  }
   295  
   296  func (i HoursOfOperationMap) ToHoursOfOperationMapOutputWithContext(ctx context.Context) HoursOfOperationMapOutput {
   297  	return pulumi.ToOutputWithContext(ctx, i).(HoursOfOperationMapOutput)
   298  }
   299  
   300  type HoursOfOperationOutput struct{ *pulumi.OutputState }
   301  
   302  func (HoursOfOperationOutput) ElementType() reflect.Type {
   303  	return reflect.TypeOf((**HoursOfOperation)(nil)).Elem()
   304  }
   305  
   306  func (o HoursOfOperationOutput) ToHoursOfOperationOutput() HoursOfOperationOutput {
   307  	return o
   308  }
   309  
   310  func (o HoursOfOperationOutput) ToHoursOfOperationOutputWithContext(ctx context.Context) HoursOfOperationOutput {
   311  	return o
   312  }
   313  
   314  // The Amazon Resource Name (ARN) of the Hours of Operation.
   315  func (o HoursOfOperationOutput) Arn() pulumi.StringOutput {
   316  	return o.ApplyT(func(v *HoursOfOperation) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   317  }
   318  
   319  // One or more config blocks which define the configuration information for the hours of operation: day, start time, and end time . Config blocks are documented below.
   320  func (o HoursOfOperationOutput) Configs() HoursOfOperationConfigArrayOutput {
   321  	return o.ApplyT(func(v *HoursOfOperation) HoursOfOperationConfigArrayOutput { return v.Configs }).(HoursOfOperationConfigArrayOutput)
   322  }
   323  
   324  // Specifies the description of the Hours of Operation.
   325  func (o HoursOfOperationOutput) Description() pulumi.StringPtrOutput {
   326  	return o.ApplyT(func(v *HoursOfOperation) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput)
   327  }
   328  
   329  // The identifier for the hours of operation.
   330  func (o HoursOfOperationOutput) HoursOfOperationId() pulumi.StringOutput {
   331  	return o.ApplyT(func(v *HoursOfOperation) pulumi.StringOutput { return v.HoursOfOperationId }).(pulumi.StringOutput)
   332  }
   333  
   334  // Specifies the identifier of the hosting Amazon Connect Instance.
   335  func (o HoursOfOperationOutput) InstanceId() pulumi.StringOutput {
   336  	return o.ApplyT(func(v *HoursOfOperation) pulumi.StringOutput { return v.InstanceId }).(pulumi.StringOutput)
   337  }
   338  
   339  // Specifies the name of the Hours of Operation.
   340  func (o HoursOfOperationOutput) Name() pulumi.StringOutput {
   341  	return o.ApplyT(func(v *HoursOfOperation) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
   342  }
   343  
   344  // Tags to apply to the Hours of Operation. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   345  func (o HoursOfOperationOutput) Tags() pulumi.StringMapOutput {
   346  	return o.ApplyT(func(v *HoursOfOperation) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   347  }
   348  
   349  // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   350  //
   351  // Deprecated: Please use `tags` instead.
   352  func (o HoursOfOperationOutput) TagsAll() pulumi.StringMapOutput {
   353  	return o.ApplyT(func(v *HoursOfOperation) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   354  }
   355  
   356  // Specifies the time zone of the Hours of Operation.
   357  func (o HoursOfOperationOutput) TimeZone() pulumi.StringOutput {
   358  	return o.ApplyT(func(v *HoursOfOperation) pulumi.StringOutput { return v.TimeZone }).(pulumi.StringOutput)
   359  }
   360  
   361  type HoursOfOperationArrayOutput struct{ *pulumi.OutputState }
   362  
   363  func (HoursOfOperationArrayOutput) ElementType() reflect.Type {
   364  	return reflect.TypeOf((*[]*HoursOfOperation)(nil)).Elem()
   365  }
   366  
   367  func (o HoursOfOperationArrayOutput) ToHoursOfOperationArrayOutput() HoursOfOperationArrayOutput {
   368  	return o
   369  }
   370  
   371  func (o HoursOfOperationArrayOutput) ToHoursOfOperationArrayOutputWithContext(ctx context.Context) HoursOfOperationArrayOutput {
   372  	return o
   373  }
   374  
   375  func (o HoursOfOperationArrayOutput) Index(i pulumi.IntInput) HoursOfOperationOutput {
   376  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *HoursOfOperation {
   377  		return vs[0].([]*HoursOfOperation)[vs[1].(int)]
   378  	}).(HoursOfOperationOutput)
   379  }
   380  
   381  type HoursOfOperationMapOutput struct{ *pulumi.OutputState }
   382  
   383  func (HoursOfOperationMapOutput) ElementType() reflect.Type {
   384  	return reflect.TypeOf((*map[string]*HoursOfOperation)(nil)).Elem()
   385  }
   386  
   387  func (o HoursOfOperationMapOutput) ToHoursOfOperationMapOutput() HoursOfOperationMapOutput {
   388  	return o
   389  }
   390  
   391  func (o HoursOfOperationMapOutput) ToHoursOfOperationMapOutputWithContext(ctx context.Context) HoursOfOperationMapOutput {
   392  	return o
   393  }
   394  
   395  func (o HoursOfOperationMapOutput) MapIndex(k pulumi.StringInput) HoursOfOperationOutput {
   396  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *HoursOfOperation {
   397  		return vs[0].(map[string]*HoursOfOperation)[vs[1].(string)]
   398  	}).(HoursOfOperationOutput)
   399  }
   400  
   401  func init() {
   402  	pulumi.RegisterInputType(reflect.TypeOf((*HoursOfOperationInput)(nil)).Elem(), &HoursOfOperation{})
   403  	pulumi.RegisterInputType(reflect.TypeOf((*HoursOfOperationArrayInput)(nil)).Elem(), HoursOfOperationArray{})
   404  	pulumi.RegisterInputType(reflect.TypeOf((*HoursOfOperationMapInput)(nil)).Elem(), HoursOfOperationMap{})
   405  	pulumi.RegisterOutputType(HoursOfOperationOutput{})
   406  	pulumi.RegisterOutputType(HoursOfOperationArrayOutput{})
   407  	pulumi.RegisterOutputType(HoursOfOperationMapOutput{})
   408  }