Skip to content

Commit d51182a

Browse files
Sync monorepo state at "add support for partial updates" (#82)
Syncing from userclouds/userclouds@748b6470e813b32934ac6bbcc40e171ce1cf8039
1 parent c6e508b commit d51182a

File tree

6 files changed

+65
-0
lines changed

6 files changed

+65
-0
lines changed

docs/resources/transformer.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ Optional:
4545

4646
- `fields` (Attributes List) The set of fields associated with a column of type composite. Fields cannot be specified if the column type is not composite. (see [below for nested schema](#nestedatt--input_type_constraints--fields))
4747
- `immutable_required` (Boolean) Can be enabled when unique_id_required is enabled. If true, values for the associated column cannot be modified, but can be added or removed.
48+
- `partial_updates` (Boolean) Can be enabled for array columns that have UniqueRequired or UniqueIDRequired enabled. When enabled, a mutation request will update the specified subset of values for the associated column.
4849
- `unique_id_required` (Boolean) Can be enabled for column type composite or address. If true, each value for the associated column must have a unique string ID, which can either be provided or generated by backend.
4950
- `unique_required` (Boolean) If true, each value for the associated column must be unique for the user. This is primarily useful for array columns.
5051

@@ -72,6 +73,7 @@ Optional:
7273

7374
- `fields` (Attributes List) The set of fields associated with a column of type composite. Fields cannot be specified if the column type is not composite. (see [below for nested schema](#nestedatt--output_type_constraints--fields))
7475
- `immutable_required` (Boolean) Can be enabled when unique_id_required is enabled. If true, values for the associated column cannot be modified, but can be added or removed.
76+
- `partial_updates` (Boolean) Can be enabled for array columns that have UniqueRequired or UniqueIDRequired enabled. When enabled, a mutation request will update the specified subset of values for the associated column.
7577
- `unique_id_required` (Boolean) Can be enabled for column type composite or address. If true, each value for the associated column must have a unique string ID, which can either be provided or generated by backend.
7678
- `unique_required` (Boolean) If true, each value for the associated column must be unique for the user. This is primarily useful for array columns.
7779

docs/resources/userstore_column.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ Optional:
4848

4949
- `fields` (Attributes List) The set of fields associated with a column of type composite. Fields cannot be specified if the column type is not composite. (see [below for nested schema](#nestedatt--constraints--fields))
5050
- `immutable_required` (Boolean) Can be enabled when unique_id_required is enabled. If true, values for the associated column cannot be modified, but can be added or removed.
51+
- `partial_updates` (Boolean) Can be enabled for array columns that have UniqueRequired or UniqueIDRequired enabled. When enabled, a mutation request will update the specified subset of values for the associated column.
5152
- `unique_id_required` (Boolean) Can be enabled for column type composite or address. If true, each value for the associated column must have a unique string ID, which can either be provided or generated by backend.
5253
- `unique_required` (Boolean) If true, each value for the associated column must be unique for the user. This is primarily useful for array columns.
5354

internal/provider/tokenizer/schemas_generated.go

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3142,6 +3142,7 @@ func TokenizerUpdateAccessPolicyTemplateRequestJSONClientModelToTF(in *Tokenizer
31423142
type UserstoreColumnConstraintsTFModel struct {
31433143
Fields types.List `tfsdk:"fields"`
31443144
ImmutableRequired types.Bool `tfsdk:"immutable_required"`
3145+
PartialUpdates types.Bool `tfsdk:"partial_updates"`
31453146
UniqueIDRequired types.Bool `tfsdk:"unique_id_required"`
31463147
UniqueRequired types.Bool `tfsdk:"unique_required"`
31473148
}
@@ -3150,6 +3151,7 @@ type UserstoreColumnConstraintsTFModel struct {
31503151
type UserstoreColumnConstraintsJSONClientModel struct {
31513152
Fields *[]UserstoreColumnFieldJSONClientModel `json:"fields,omitempty"`
31523153
ImmutableRequired *bool `json:"immutable_required,omitempty"`
3154+
PartialUpdates *bool `json:"partial_updates,omitempty"`
31533155
UniqueIDRequired *bool `json:"unique_id_required,omitempty"`
31543156
UniqueRequired *bool `json:"unique_required,omitempty"`
31553157
}
@@ -3162,6 +3164,7 @@ var UserstoreColumnConstraintsAttrTypes = map[string]attr.Type{
31623164
},
31633165
},
31643166
"immutable_required": types.BoolType,
3167+
"partial_updates": types.BoolType,
31653168
"unique_id_required": types.BoolType,
31663169
"unique_required": types.BoolType,
31673170
}
@@ -3183,6 +3186,12 @@ var UserstoreColumnConstraintsAttributes = map[string]schema.Attribute{
31833186
MarkdownDescription: "Can be enabled when unique_id_required is enabled. If true, values for the associated column cannot be modified, but can be added or removed.",
31843187
Optional: true,
31853188
},
3189+
"partial_updates": schema.BoolAttribute{
3190+
Computed: true,
3191+
Description: "Can be enabled for array columns that have UniqueRequired or UniqueIDRequired enabled. When enabled, a mutation request will update the specified subset of values for the associated column.",
3192+
MarkdownDescription: "Can be enabled for array columns that have UniqueRequired or UniqueIDRequired enabled. When enabled, a mutation request will update the specified subset of values for the associated column.",
3193+
Optional: true,
3194+
},
31863195
"unique_id_required": schema.BoolAttribute{
31873196
Computed: true,
31883197
Description: "Can be enabled for column type composite or address. If true, each value for the associated column must have a unique string ID, which can either be provided or generated by backend.",
@@ -3249,6 +3258,16 @@ func UserstoreColumnConstraintsTFModelToJSONClient(in *UserstoreColumnConstraint
32493258
if err != nil {
32503259
return nil, ucerr.Errorf("failed to convert \"immutable_required\" field: %+v", err)
32513260
}
3261+
out.PartialUpdates, err = func(val *types.Bool) (*bool, error) {
3262+
if val.IsNull() || val.IsUnknown() {
3263+
return nil, nil
3264+
}
3265+
converted := val.ValueBool()
3266+
return &converted, nil
3267+
}(&in.PartialUpdates)
3268+
if err != nil {
3269+
return nil, ucerr.Errorf("failed to convert \"partial_updates\" field: %+v", err)
3270+
}
32523271
out.UniqueIDRequired, err = func(val *types.Bool) (*bool, error) {
32533272
if val.IsNull() || val.IsUnknown() {
32543273
return nil, nil
@@ -3326,6 +3345,12 @@ func UserstoreColumnConstraintsJSONClientModelToTF(in *UserstoreColumnConstraint
33263345
if err != nil {
33273346
return UserstoreColumnConstraintsTFModel{}, ucerr.Errorf("failed to convert \"immutable_required\" field: %+v", err)
33283347
}
3348+
out.PartialUpdates, err = func(val *bool) (types.Bool, error) {
3349+
return types.BoolPointerValue(val), nil
3350+
}(in.PartialUpdates)
3351+
if err != nil {
3352+
return UserstoreColumnConstraintsTFModel{}, ucerr.Errorf("failed to convert \"partial_updates\" field: %+v", err)
3353+
}
33293354
out.UniqueIDRequired, err = func(val *bool) (types.Bool, error) {
33303355
return types.BoolPointerValue(val), nil
33313356
}(in.UniqueIDRequired)

internal/provider/userstore/schemas_generated.go

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2830,6 +2830,7 @@ func UserstoreColumnJSONClientModelToTF(in *UserstoreColumnJSONClientModel) (Use
28302830
type UserstoreColumnConstraintsTFModel struct {
28312831
Fields types.List `tfsdk:"fields"`
28322832
ImmutableRequired types.Bool `tfsdk:"immutable_required"`
2833+
PartialUpdates types.Bool `tfsdk:"partial_updates"`
28332834
UniqueIDRequired types.Bool `tfsdk:"unique_id_required"`
28342835
UniqueRequired types.Bool `tfsdk:"unique_required"`
28352836
}
@@ -2838,6 +2839,7 @@ type UserstoreColumnConstraintsTFModel struct {
28382839
type UserstoreColumnConstraintsJSONClientModel struct {
28392840
Fields *[]UserstoreColumnFieldJSONClientModel `json:"fields,omitempty"`
28402841
ImmutableRequired *bool `json:"immutable_required,omitempty"`
2842+
PartialUpdates *bool `json:"partial_updates,omitempty"`
28412843
UniqueIDRequired *bool `json:"unique_id_required,omitempty"`
28422844
UniqueRequired *bool `json:"unique_required,omitempty"`
28432845
}
@@ -2850,6 +2852,7 @@ var UserstoreColumnConstraintsAttrTypes = map[string]attr.Type{
28502852
},
28512853
},
28522854
"immutable_required": types.BoolType,
2855+
"partial_updates": types.BoolType,
28532856
"unique_id_required": types.BoolType,
28542857
"unique_required": types.BoolType,
28552858
}
@@ -2871,6 +2874,12 @@ var UserstoreColumnConstraintsAttributes = map[string]schema.Attribute{
28712874
MarkdownDescription: "Can be enabled when unique_id_required is enabled. If true, values for the associated column cannot be modified, but can be added or removed.",
28722875
Optional: true,
28732876
},
2877+
"partial_updates": schema.BoolAttribute{
2878+
Computed: true,
2879+
Description: "Can be enabled for array columns that have UniqueRequired or UniqueIDRequired enabled. When enabled, a mutation request will update the specified subset of values for the associated column.",
2880+
MarkdownDescription: "Can be enabled for array columns that have UniqueRequired or UniqueIDRequired enabled. When enabled, a mutation request will update the specified subset of values for the associated column.",
2881+
Optional: true,
2882+
},
28742883
"unique_id_required": schema.BoolAttribute{
28752884
Computed: true,
28762885
Description: "Can be enabled for column type composite or address. If true, each value for the associated column must have a unique string ID, which can either be provided or generated by backend.",
@@ -2937,6 +2946,16 @@ func UserstoreColumnConstraintsTFModelToJSONClient(in *UserstoreColumnConstraint
29372946
if err != nil {
29382947
return nil, ucerr.Errorf("failed to convert \"immutable_required\" field: %+v", err)
29392948
}
2949+
out.PartialUpdates, err = func(val *types.Bool) (*bool, error) {
2950+
if val.IsNull() || val.IsUnknown() {
2951+
return nil, nil
2952+
}
2953+
converted := val.ValueBool()
2954+
return &converted, nil
2955+
}(&in.PartialUpdates)
2956+
if err != nil {
2957+
return nil, ucerr.Errorf("failed to convert \"partial_updates\" field: %+v", err)
2958+
}
29402959
out.UniqueIDRequired, err = func(val *types.Bool) (*bool, error) {
29412960
if val.IsNull() || val.IsUnknown() {
29422961
return nil, nil
@@ -3014,6 +3033,12 @@ func UserstoreColumnConstraintsJSONClientModelToTF(in *UserstoreColumnConstraint
30143033
if err != nil {
30153034
return UserstoreColumnConstraintsTFModel{}, ucerr.Errorf("failed to convert \"immutable_required\" field: %+v", err)
30163035
}
3036+
out.PartialUpdates, err = func(val *bool) (types.Bool, error) {
3037+
return types.BoolPointerValue(val), nil
3038+
}(in.PartialUpdates)
3039+
if err != nil {
3040+
return UserstoreColumnConstraintsTFModel{}, ucerr.Errorf("failed to convert \"partial_updates\" field: %+v", err)
3041+
}
30173042
out.UniqueIDRequired, err = func(val *bool) (types.Bool, error) {
30183043
return types.BoolPointerValue(val), nil
30193044
}(in.UniqueIDRequired)

openapi/tokenizer.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1040,6 +1040,11 @@ components:
10401040
values for the associated column cannot be modified, but can be added
10411041
or removed.
10421042
type: boolean
1043+
partial_updates:
1044+
description: Can be enabled for array columns that have UniqueRequired or
1045+
UniqueIDRequired enabled. When enabled, a mutation request will update
1046+
the specified subset of values for the associated column.
1047+
type: boolean
10431048
unique_id_required:
10441049
description: Can be enabled for column type composite or address. If true,
10451050
each value for the associated column must have a unique string ID, which

openapi/userstore.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2170,6 +2170,8 @@ components:
21702170
nullable: true
21712171
type: array
21722172
value: {}
2173+
value_additions: {}
2174+
value_deletions: {}
21732175
type: object
21742176
PaginationCursor: {}
21752177
PolicyClientContext:
@@ -2259,6 +2261,11 @@ components:
22592261
values for the associated column cannot be modified, but can be added
22602262
or removed.
22612263
type: boolean
2264+
partial_updates:
2265+
description: Can be enabled for array columns that have UniqueRequired or
2266+
UniqueIDRequired enabled. When enabled, a mutation request will update
2267+
the specified subset of values for the associated column.
2268+
type: boolean
22622269
unique_id_required:
22632270
description: Can be enabled for column type composite or address. If true,
22642271
each value for the associated column must have a unique string ID, which

0 commit comments

Comments
 (0)