Skip to content

Commit 5a396b0

Browse files
Sync monorepo state at "add new attributes to Column and Accessor" (#120)
Syncing from userclouds/userclouds@d5b9763ffcb46470100e26e445d514478d8162f9
1 parent 8e48fac commit 5a396b0

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

CHANGELOG.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
# Changelog
22

3-
## 1.10.0 - TBD
3+
## 1.10.0 - 12-09-2024
44

55
- Add version to Transformer model, add client methods GetTransformer and UpdateTransformer, and fix a bug in GetAccessPolicy and GetAccessPolicyTemplate
6+
- Add optional search_indexed field to Column model and optional use_search_index field to Accessor model
67

7-
## 1.9.2 - 06-05-2024
8+
## 1.9.2 - 06-08-2024
89

9-
- Fix missing parameter in \_post_async for AsyncClient
10+
- Fix missing parameter in _post_async for AsyncClient
1011

1112
## 1.9.1 - 05-08-2024
1213

src/usercloudssdk/models.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,7 @@ class Column:
402402
type: DataType
403403
is_array: bool
404404
default_value: str
405+
search_indexed: bool
405406
index_type: ColumnIndexType
406407
constraints: ColumnConstraints
407408

@@ -413,6 +414,7 @@ def __init__(
413414
is_array: bool,
414415
default_value: str,
415416
index_type: str | ColumnIndexType,
417+
search_indexed: bool = False,
416418
data_type: ResourceID | None = None,
417419
constraints: ColumnConstraints | None = None,
418420
) -> None:
@@ -422,6 +424,7 @@ def __init__(
422424
self.type = DataType(type)
423425
self.is_array = is_array
424426
self.default_value = default_value
427+
self.search_indexed = search_indexed
425428
self.index_type = ColumnIndexType(index_type)
426429
if constraints is None:
427430
self.constraints = ColumnConstraints(
@@ -443,6 +446,7 @@ def to_json(self) -> str:
443446
"type": self.type.value,
444447
"is_array": self.is_array,
445448
"default_value": self.default_value,
449+
"search_indexed": self.search_indexed,
446450
"index_type": self.index_type.value,
447451
"constraints": self.constraints,
448452
}
@@ -457,6 +461,7 @@ def from_json(cls, json_data: dict) -> Column:
457461
type=DataType(json_data["type"]),
458462
is_array=json_data["is_array"],
459463
default_value=json_data["default_value"],
464+
search_indexed=json_data["search_indexed"],
460465
index_type=ColumnIndexType(json_data["index_type"]),
461466
constraints=json_data["constraints"],
462467
)
@@ -530,6 +535,7 @@ class Accessor:
530535
selector_config: UserSelectorConfig
531536
purposes: list[ResourceID]
532537
data_life_cycle_state: DataLifeCycleState
538+
use_search_index: bool
533539
version: int
534540

535541
def __init__(
@@ -543,6 +549,7 @@ def __init__(
543549
purposes: list[ResourceID],
544550
token_access_policy: ResourceID | None = None,
545551
data_life_cycle_state: str | DataLifeCycleState = DataLifeCycleState.LIVE,
552+
use_search_index: bool = False,
546553
version: int = 0,
547554
) -> None:
548555
self.id = id
@@ -554,6 +561,7 @@ def __init__(
554561
self.purposes = purposes
555562
self.token_access_policy = token_access_policy
556563
self.data_life_cycle_state = DataLifeCycleState(data_life_cycle_state)
564+
self.use_search_index = use_search_index
557565
self.version = version
558566

559567
def to_json(self) -> str:
@@ -569,6 +577,7 @@ def to_json(self) -> str:
569577
"purposes": self.purposes,
570578
"token_access_policy": self.token_access_policy,
571579
"data_life_cycle_state": self.data_life_cycle_state.value,
580+
"use_search_index": self.use_search_index,
572581
}
573582
)
574583

@@ -586,6 +595,7 @@ def from_json(cls, json_data: dict) -> Accessor:
586595
data_life_cycle_state=DataLifeCycleState(
587596
json_data["data_life_cycle_state"]
588597
),
598+
use_search_index=json_data["use_search_index"],
589599
version=json_data["version"],
590600
)
591601

0 commit comments

Comments
 (0)