-
Notifications
You must be signed in to change notification settings - Fork 2
/
mapping.go
122 lines (109 loc) · 4.57 KB
/
mapping.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
// *** 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 profile
import (
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
type Mapping struct {
pulumi.CustomResourceState
// When turned on this flag will trigger the provider to delete mapping properties that are not defined in config. By
// default, we do not delete missing properties.
DeleteWhenAbsent pulumi.BoolPtrOutput `pulumi:"deleteWhenAbsent"`
Mappings MappingMappingArrayOutput `pulumi:"mappings"`
// The source id of the mapping to manage.
SourceId pulumi.StringOutput `pulumi:"sourceId"`
SourceName pulumi.StringOutput `pulumi:"sourceName"`
SourceType pulumi.StringOutput `pulumi:"sourceType"`
// The target id of the mapping to manage.
TargetId pulumi.StringOutput `pulumi:"targetId"`
TargetName pulumi.StringOutput `pulumi:"targetName"`
TargetType pulumi.StringOutput `pulumi:"targetType"`
}
// NewMapping registers a new resource with the given unique name, arguments, and options.
func NewMapping(ctx *pulumi.Context,
name string, args *MappingArgs, opts ...pulumi.ResourceOption) (*Mapping, error) {
if args == nil || args.SourceId == nil {
return nil, errors.New("missing required argument 'SourceId'")
}
if args == nil || args.TargetId == nil {
return nil, errors.New("missing required argument 'TargetId'")
}
if args == nil {
args = &MappingArgs{}
}
var resource Mapping
err := ctx.RegisterResource("okta:profile/mapping:Mapping", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetMapping gets an existing Mapping 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 GetMapping(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *MappingState, opts ...pulumi.ResourceOption) (*Mapping, error) {
var resource Mapping
err := ctx.ReadResource("okta:profile/mapping:Mapping", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Mapping resources.
type mappingState struct {
// When turned on this flag will trigger the provider to delete mapping properties that are not defined in config. By
// default, we do not delete missing properties.
DeleteWhenAbsent *bool `pulumi:"deleteWhenAbsent"`
Mappings []MappingMapping `pulumi:"mappings"`
// The source id of the mapping to manage.
SourceId *string `pulumi:"sourceId"`
SourceName *string `pulumi:"sourceName"`
SourceType *string `pulumi:"sourceType"`
// The target id of the mapping to manage.
TargetId *string `pulumi:"targetId"`
TargetName *string `pulumi:"targetName"`
TargetType *string `pulumi:"targetType"`
}
type MappingState struct {
// When turned on this flag will trigger the provider to delete mapping properties that are not defined in config. By
// default, we do not delete missing properties.
DeleteWhenAbsent pulumi.BoolPtrInput
Mappings MappingMappingArrayInput
// The source id of the mapping to manage.
SourceId pulumi.StringPtrInput
SourceName pulumi.StringPtrInput
SourceType pulumi.StringPtrInput
// The target id of the mapping to manage.
TargetId pulumi.StringPtrInput
TargetName pulumi.StringPtrInput
TargetType pulumi.StringPtrInput
}
func (MappingState) ElementType() reflect.Type {
return reflect.TypeOf((*mappingState)(nil)).Elem()
}
type mappingArgs struct {
// When turned on this flag will trigger the provider to delete mapping properties that are not defined in config. By
// default, we do not delete missing properties.
DeleteWhenAbsent *bool `pulumi:"deleteWhenAbsent"`
Mappings []MappingMapping `pulumi:"mappings"`
// The source id of the mapping to manage.
SourceId string `pulumi:"sourceId"`
// The target id of the mapping to manage.
TargetId string `pulumi:"targetId"`
}
// The set of arguments for constructing a Mapping resource.
type MappingArgs struct {
// When turned on this flag will trigger the provider to delete mapping properties that are not defined in config. By
// default, we do not delete missing properties.
DeleteWhenAbsent pulumi.BoolPtrInput
Mappings MappingMappingArrayInput
// The source id of the mapping to manage.
SourceId pulumi.StringInput
// The target id of the mapping to manage.
TargetId pulumi.StringInput
}
func (MappingArgs) ElementType() reflect.Type {
return reflect.TypeOf((*mappingArgs)(nil)).Elem()
}