github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/verifiedpermissions/schema.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 verifiedpermissions 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 // ## Example Usage 16 type Schema struct { 17 pulumi.CustomResourceState 18 19 // The definition of the schema. 20 Definition SchemaDefinitionPtrOutput `pulumi:"definition"` 21 // (Optional) Identifies the namespaces of the entities referenced by this schema. 22 Namespaces pulumi.StringArrayOutput `pulumi:"namespaces"` 23 // The ID of the Policy Store. 24 PolicyStoreId pulumi.StringOutput `pulumi:"policyStoreId"` 25 } 26 27 // NewSchema registers a new resource with the given unique name, arguments, and options. 28 func NewSchema(ctx *pulumi.Context, 29 name string, args *SchemaArgs, opts ...pulumi.ResourceOption) (*Schema, error) { 30 if args == nil { 31 return nil, errors.New("missing one or more required arguments") 32 } 33 34 if args.PolicyStoreId == nil { 35 return nil, errors.New("invalid value for required argument 'PolicyStoreId'") 36 } 37 opts = internal.PkgResourceDefaultOpts(opts) 38 var resource Schema 39 err := ctx.RegisterResource("aws:verifiedpermissions/schema:Schema", name, args, &resource, opts...) 40 if err != nil { 41 return nil, err 42 } 43 return &resource, nil 44 } 45 46 // GetSchema gets an existing Schema resource's state with the given name, ID, and optional 47 // state properties that are used to uniquely qualify the lookup (nil if not required). 48 func GetSchema(ctx *pulumi.Context, 49 name string, id pulumi.IDInput, state *SchemaState, opts ...pulumi.ResourceOption) (*Schema, error) { 50 var resource Schema 51 err := ctx.ReadResource("aws:verifiedpermissions/schema:Schema", name, id, state, &resource, opts...) 52 if err != nil { 53 return nil, err 54 } 55 return &resource, nil 56 } 57 58 // Input properties used for looking up and filtering Schema resources. 59 type schemaState struct { 60 // The definition of the schema. 61 Definition *SchemaDefinition `pulumi:"definition"` 62 // (Optional) Identifies the namespaces of the entities referenced by this schema. 63 Namespaces []string `pulumi:"namespaces"` 64 // The ID of the Policy Store. 65 PolicyStoreId *string `pulumi:"policyStoreId"` 66 } 67 68 type SchemaState struct { 69 // The definition of the schema. 70 Definition SchemaDefinitionPtrInput 71 // (Optional) Identifies the namespaces of the entities referenced by this schema. 72 Namespaces pulumi.StringArrayInput 73 // The ID of the Policy Store. 74 PolicyStoreId pulumi.StringPtrInput 75 } 76 77 func (SchemaState) ElementType() reflect.Type { 78 return reflect.TypeOf((*schemaState)(nil)).Elem() 79 } 80 81 type schemaArgs struct { 82 // The definition of the schema. 83 Definition *SchemaDefinition `pulumi:"definition"` 84 // The ID of the Policy Store. 85 PolicyStoreId string `pulumi:"policyStoreId"` 86 } 87 88 // The set of arguments for constructing a Schema resource. 89 type SchemaArgs struct { 90 // The definition of the schema. 91 Definition SchemaDefinitionPtrInput 92 // The ID of the Policy Store. 93 PolicyStoreId pulumi.StringInput 94 } 95 96 func (SchemaArgs) ElementType() reflect.Type { 97 return reflect.TypeOf((*schemaArgs)(nil)).Elem() 98 } 99 100 type SchemaInput interface { 101 pulumi.Input 102 103 ToSchemaOutput() SchemaOutput 104 ToSchemaOutputWithContext(ctx context.Context) SchemaOutput 105 } 106 107 func (*Schema) ElementType() reflect.Type { 108 return reflect.TypeOf((**Schema)(nil)).Elem() 109 } 110 111 func (i *Schema) ToSchemaOutput() SchemaOutput { 112 return i.ToSchemaOutputWithContext(context.Background()) 113 } 114 115 func (i *Schema) ToSchemaOutputWithContext(ctx context.Context) SchemaOutput { 116 return pulumi.ToOutputWithContext(ctx, i).(SchemaOutput) 117 } 118 119 // SchemaArrayInput is an input type that accepts SchemaArray and SchemaArrayOutput values. 120 // You can construct a concrete instance of `SchemaArrayInput` via: 121 // 122 // SchemaArray{ SchemaArgs{...} } 123 type SchemaArrayInput interface { 124 pulumi.Input 125 126 ToSchemaArrayOutput() SchemaArrayOutput 127 ToSchemaArrayOutputWithContext(context.Context) SchemaArrayOutput 128 } 129 130 type SchemaArray []SchemaInput 131 132 func (SchemaArray) ElementType() reflect.Type { 133 return reflect.TypeOf((*[]*Schema)(nil)).Elem() 134 } 135 136 func (i SchemaArray) ToSchemaArrayOutput() SchemaArrayOutput { 137 return i.ToSchemaArrayOutputWithContext(context.Background()) 138 } 139 140 func (i SchemaArray) ToSchemaArrayOutputWithContext(ctx context.Context) SchemaArrayOutput { 141 return pulumi.ToOutputWithContext(ctx, i).(SchemaArrayOutput) 142 } 143 144 // SchemaMapInput is an input type that accepts SchemaMap and SchemaMapOutput values. 145 // You can construct a concrete instance of `SchemaMapInput` via: 146 // 147 // SchemaMap{ "key": SchemaArgs{...} } 148 type SchemaMapInput interface { 149 pulumi.Input 150 151 ToSchemaMapOutput() SchemaMapOutput 152 ToSchemaMapOutputWithContext(context.Context) SchemaMapOutput 153 } 154 155 type SchemaMap map[string]SchemaInput 156 157 func (SchemaMap) ElementType() reflect.Type { 158 return reflect.TypeOf((*map[string]*Schema)(nil)).Elem() 159 } 160 161 func (i SchemaMap) ToSchemaMapOutput() SchemaMapOutput { 162 return i.ToSchemaMapOutputWithContext(context.Background()) 163 } 164 165 func (i SchemaMap) ToSchemaMapOutputWithContext(ctx context.Context) SchemaMapOutput { 166 return pulumi.ToOutputWithContext(ctx, i).(SchemaMapOutput) 167 } 168 169 type SchemaOutput struct{ *pulumi.OutputState } 170 171 func (SchemaOutput) ElementType() reflect.Type { 172 return reflect.TypeOf((**Schema)(nil)).Elem() 173 } 174 175 func (o SchemaOutput) ToSchemaOutput() SchemaOutput { 176 return o 177 } 178 179 func (o SchemaOutput) ToSchemaOutputWithContext(ctx context.Context) SchemaOutput { 180 return o 181 } 182 183 // The definition of the schema. 184 func (o SchemaOutput) Definition() SchemaDefinitionPtrOutput { 185 return o.ApplyT(func(v *Schema) SchemaDefinitionPtrOutput { return v.Definition }).(SchemaDefinitionPtrOutput) 186 } 187 188 // (Optional) Identifies the namespaces of the entities referenced by this schema. 189 func (o SchemaOutput) Namespaces() pulumi.StringArrayOutput { 190 return o.ApplyT(func(v *Schema) pulumi.StringArrayOutput { return v.Namespaces }).(pulumi.StringArrayOutput) 191 } 192 193 // The ID of the Policy Store. 194 func (o SchemaOutput) PolicyStoreId() pulumi.StringOutput { 195 return o.ApplyT(func(v *Schema) pulumi.StringOutput { return v.PolicyStoreId }).(pulumi.StringOutput) 196 } 197 198 type SchemaArrayOutput struct{ *pulumi.OutputState } 199 200 func (SchemaArrayOutput) ElementType() reflect.Type { 201 return reflect.TypeOf((*[]*Schema)(nil)).Elem() 202 } 203 204 func (o SchemaArrayOutput) ToSchemaArrayOutput() SchemaArrayOutput { 205 return o 206 } 207 208 func (o SchemaArrayOutput) ToSchemaArrayOutputWithContext(ctx context.Context) SchemaArrayOutput { 209 return o 210 } 211 212 func (o SchemaArrayOutput) Index(i pulumi.IntInput) SchemaOutput { 213 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Schema { 214 return vs[0].([]*Schema)[vs[1].(int)] 215 }).(SchemaOutput) 216 } 217 218 type SchemaMapOutput struct{ *pulumi.OutputState } 219 220 func (SchemaMapOutput) ElementType() reflect.Type { 221 return reflect.TypeOf((*map[string]*Schema)(nil)).Elem() 222 } 223 224 func (o SchemaMapOutput) ToSchemaMapOutput() SchemaMapOutput { 225 return o 226 } 227 228 func (o SchemaMapOutput) ToSchemaMapOutputWithContext(ctx context.Context) SchemaMapOutput { 229 return o 230 } 231 232 func (o SchemaMapOutput) MapIndex(k pulumi.StringInput) SchemaOutput { 233 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Schema { 234 return vs[0].(map[string]*Schema)[vs[1].(string)] 235 }).(SchemaOutput) 236 } 237 238 func init() { 239 pulumi.RegisterInputType(reflect.TypeOf((*SchemaInput)(nil)).Elem(), &Schema{}) 240 pulumi.RegisterInputType(reflect.TypeOf((*SchemaArrayInput)(nil)).Elem(), SchemaArray{}) 241 pulumi.RegisterInputType(reflect.TypeOf((*SchemaMapInput)(nil)).Elem(), SchemaMap{}) 242 pulumi.RegisterOutputType(SchemaOutput{}) 243 pulumi.RegisterOutputType(SchemaArrayOutput{}) 244 pulumi.RegisterOutputType(SchemaMapOutput{}) 245 }