-
Notifications
You must be signed in to change notification settings - Fork 2
/
schedule.go
131 lines (118 loc) · 7.03 KB
/
schedule.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package pagerduty
import (
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// A [schedule](https://v2.developer.pagerduty.com/v2/page/api-reference#!/Schedules/get_schedules) determines the time periods that users are on call. Only on-call users are eligible to receive notifications from incidents.
type Schedule struct {
pulumi.CustomResourceState
// The description of the schedule
Description pulumi.StringPtrOutput `pulumi:"description"`
// A schedule layer block. Schedule layers documented below.
Layers ScheduleLayerArrayOutput `pulumi:"layers"`
// The name of the schedule.
Name pulumi.StringOutput `pulumi:"name"`
// Any on-call schedule entries that pass the date range bounds will be truncated at the bounds, unless the parameter `overflow` is passed. For instance, if your schedule is a rotation that changes daily at midnight UTC, and your date range is from `2011-06-01T10:00:00Z` to `2011-06-01T14:00:00Z`:
// If you don't pass the overflow=true parameter, you will get one schedule entry returned with a start of `2011-06-01T10:00:00Z` and end of `2011-06-01T14:00:00Z`.
// If you do pass the `overflow` parameter, you will get one schedule entry returned with a start of `2011-06-01T00:00:00Z` and end of `2011-06-02T00:00:00Z`.
Overflow pulumi.BoolPtrOutput `pulumi:"overflow"`
// The time zone of the schedule (e.g Europe/Berlin).
TimeZone pulumi.StringOutput `pulumi:"timeZone"`
}
// NewSchedule registers a new resource with the given unique name, arguments, and options.
func NewSchedule(ctx *pulumi.Context,
name string, args *ScheduleArgs, opts ...pulumi.ResourceOption) (*Schedule, error) {
if args == nil || args.Layers == nil {
return nil, errors.New("missing required argument 'Layers'")
}
if args == nil || args.TimeZone == nil {
return nil, errors.New("missing required argument 'TimeZone'")
}
if args == nil {
args = &ScheduleArgs{}
}
var resource Schedule
err := ctx.RegisterResource("pagerduty:index/schedule:Schedule", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetSchedule gets an existing Schedule resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetSchedule(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *ScheduleState, opts ...pulumi.ResourceOption) (*Schedule, error) {
var resource Schedule
err := ctx.ReadResource("pagerduty:index/schedule:Schedule", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Schedule resources.
type scheduleState struct {
// The description of the schedule
Description *string `pulumi:"description"`
// A schedule layer block. Schedule layers documented below.
Layers []ScheduleLayer `pulumi:"layers"`
// The name of the schedule.
Name *string `pulumi:"name"`
// Any on-call schedule entries that pass the date range bounds will be truncated at the bounds, unless the parameter `overflow` is passed. For instance, if your schedule is a rotation that changes daily at midnight UTC, and your date range is from `2011-06-01T10:00:00Z` to `2011-06-01T14:00:00Z`:
// If you don't pass the overflow=true parameter, you will get one schedule entry returned with a start of `2011-06-01T10:00:00Z` and end of `2011-06-01T14:00:00Z`.
// If you do pass the `overflow` parameter, you will get one schedule entry returned with a start of `2011-06-01T00:00:00Z` and end of `2011-06-02T00:00:00Z`.
Overflow *bool `pulumi:"overflow"`
// The time zone of the schedule (e.g Europe/Berlin).
TimeZone *string `pulumi:"timeZone"`
}
type ScheduleState struct {
// The description of the schedule
Description pulumi.StringPtrInput
// A schedule layer block. Schedule layers documented below.
Layers ScheduleLayerArrayInput
// The name of the schedule.
Name pulumi.StringPtrInput
// Any on-call schedule entries that pass the date range bounds will be truncated at the bounds, unless the parameter `overflow` is passed. For instance, if your schedule is a rotation that changes daily at midnight UTC, and your date range is from `2011-06-01T10:00:00Z` to `2011-06-01T14:00:00Z`:
// If you don't pass the overflow=true parameter, you will get one schedule entry returned with a start of `2011-06-01T10:00:00Z` and end of `2011-06-01T14:00:00Z`.
// If you do pass the `overflow` parameter, you will get one schedule entry returned with a start of `2011-06-01T00:00:00Z` and end of `2011-06-02T00:00:00Z`.
Overflow pulumi.BoolPtrInput
// The time zone of the schedule (e.g Europe/Berlin).
TimeZone pulumi.StringPtrInput
}
func (ScheduleState) ElementType() reflect.Type {
return reflect.TypeOf((*scheduleState)(nil)).Elem()
}
type scheduleArgs struct {
// The description of the schedule
Description *string `pulumi:"description"`
// A schedule layer block. Schedule layers documented below.
Layers []ScheduleLayer `pulumi:"layers"`
// The name of the schedule.
Name *string `pulumi:"name"`
// Any on-call schedule entries that pass the date range bounds will be truncated at the bounds, unless the parameter `overflow` is passed. For instance, if your schedule is a rotation that changes daily at midnight UTC, and your date range is from `2011-06-01T10:00:00Z` to `2011-06-01T14:00:00Z`:
// If you don't pass the overflow=true parameter, you will get one schedule entry returned with a start of `2011-06-01T10:00:00Z` and end of `2011-06-01T14:00:00Z`.
// If you do pass the `overflow` parameter, you will get one schedule entry returned with a start of `2011-06-01T00:00:00Z` and end of `2011-06-02T00:00:00Z`.
Overflow *bool `pulumi:"overflow"`
// The time zone of the schedule (e.g Europe/Berlin).
TimeZone string `pulumi:"timeZone"`
}
// The set of arguments for constructing a Schedule resource.
type ScheduleArgs struct {
// The description of the schedule
Description pulumi.StringPtrInput
// A schedule layer block. Schedule layers documented below.
Layers ScheduleLayerArrayInput
// The name of the schedule.
Name pulumi.StringPtrInput
// Any on-call schedule entries that pass the date range bounds will be truncated at the bounds, unless the parameter `overflow` is passed. For instance, if your schedule is a rotation that changes daily at midnight UTC, and your date range is from `2011-06-01T10:00:00Z` to `2011-06-01T14:00:00Z`:
// If you don't pass the overflow=true parameter, you will get one schedule entry returned with a start of `2011-06-01T10:00:00Z` and end of `2011-06-01T14:00:00Z`.
// If you do pass the `overflow` parameter, you will get one schedule entry returned with a start of `2011-06-01T00:00:00Z` and end of `2011-06-02T00:00:00Z`.
Overflow pulumi.BoolPtrInput
// The time zone of the schedule (e.g Europe/Berlin).
TimeZone pulumi.StringInput
}
func (ScheduleArgs) ElementType() reflect.Type {
return reflect.TypeOf((*scheduleArgs)(nil)).Elem()
}