Skip to content

Commit dfd35c4

Browse files
feat(api): Export additional models
1 parent 415dc8c commit dfd35c4

18 files changed

Lines changed: 221 additions & 545 deletions

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 21
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/unify%2Funify-ebac54fcc7f9310ca978e40329e4ad0280d12e6002caa30d33c0d21854d0e078.yml
3-
openapi_spec_hash: ed7be17146f8578360792a4e48168a83
4-
config_hash: 1e8599dd7a694cfdcbb688ad39f40415
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/unify%2Funify-3bc5202f7ff01d8fedb9a011a2ededd5894f8000238cbc6c1a35a4c29298eb33.yml
3+
openapi_spec_hash: e26bc9deba26de1eefa2ce4a421043f6
4+
config_hash: f882234204d29df1d5df8a78dadff746

api.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ Types:
8080
from unify.types.data import (
8181
UAddress,
8282
UBoolean,
83+
UCompanyAttributes,
8384
UCountry,
8485
UCurrency,
8586
UDate,
@@ -88,14 +89,19 @@ from unify.types.data import (
8889
UEmail,
8990
UInteger,
9091
UMultiselect,
92+
UOpportunityAttributes,
93+
UPersonAttributes,
9194
UPhoneNumber,
95+
URecord,
96+
URecordAttributes,
9297
UReferenceByID,
9398
UReferenceByMatch,
9499
UReferenceByUpsert,
95100
USelect,
96101
UText,
97102
UURL,
98103
UUuid,
104+
UValue,
99105
ValidationMode,
100106
RecordCreateResponse,
101107
RecordRetrieveResponse,

src/unify/resources/data/records.py

Lines changed: 37 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
from __future__ import annotations
44

5-
from typing import Dict, Optional
6-
75
import httpx
86

97
from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
@@ -30,6 +28,7 @@
3028
from ...types.data.record_update_response import RecordUpdateResponse
3129
from ...types.data.record_upsert_response import RecordUpsertResponse
3230
from ...types.data.record_retrieve_response import RecordRetrieveResponse
31+
from ...types.data.u_record_attributes_param import URecordAttributesParam
3332
from ...types.data.record_find_unique_response import RecordFindUniqueResponse
3433

3534
__all__ = ["RecordsResource", "AsyncRecordsResource"]
@@ -59,7 +58,7 @@ def create(
5958
self,
6059
object_name: str,
6160
*,
62-
data: Dict[str, record_create_params.Data],
61+
data: URecordAttributesParam,
6362
validation_mode: ValidationMode | Omit = omit,
6463
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
6564
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -70,9 +69,7 @@ def create(
7069
) -> RecordCreateResponse:
7170
"""
7271
Args:
73-
data: The attribute values for the new record.
74-
75-
All required attributes on the object must be included.
72+
data: Attribute key-value pairs associated with an object record.
7673
7774
validation_mode: Validation mode to use when validating request data.
7875
@@ -148,7 +145,7 @@ def update(
148145
record_id: str,
149146
*,
150147
object_name: str,
151-
data: Dict[str, record_update_params.Data],
148+
data: URecordAttributesParam,
152149
validation_mode: ValidationMode | Omit = omit,
153150
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
154151
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -159,7 +156,7 @@ def update(
159156
) -> RecordUpdateResponse:
160157
"""
161158
Args:
162-
data: The attribute values to update in the record.
159+
data: Attribute key-value pairs associated with an object record.
163160
164161
validation_mode: Validation mode to use when validating request data.
165162
@@ -238,7 +235,7 @@ def find_unique(
238235
self,
239236
object_name: str,
240237
*,
241-
match: Dict[str, Optional[record_find_unique_params.Match]],
238+
match: URecordAttributesParam,
242239
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
243240
# The extra values given here take precedence over values defined on the client or passed to this method.
244241
extra_headers: Headers | None = None,
@@ -248,11 +245,7 @@ def find_unique(
248245
) -> RecordFindUniqueResponse:
249246
"""
250247
Args:
251-
match: The attribute values to match against to find an existing record.
252-
253-
At least one unique attribute must be included to ensure that at most one record
254-
is matched. Additional unique or non-unique attributes may also be included to
255-
refine the matching criteria.
248+
match: Attribute key-value pairs associated with an object record.
256249
257250
extra_headers: Send extra headers
258251
@@ -277,13 +270,13 @@ def upsert(
277270
self,
278271
object_name: str,
279272
*,
280-
match: Dict[str, Optional[record_upsert_params.Match]],
273+
match: URecordAttributesParam,
281274
validation_mode: ValidationMode | Omit = omit,
282-
create: Dict[str, record_upsert_params.Create] | Omit = omit,
283-
create_or_update: Dict[str, record_upsert_params.CreateOrUpdate] | Omit = omit,
284-
create_or_update_if_empty: Dict[str, record_upsert_params.CreateOrUpdateIfEmpty] | Omit = omit,
285-
update: Dict[str, record_upsert_params.Update] | Omit = omit,
286-
update_if_empty: Dict[str, record_upsert_params.UpdateIfEmpty] | Omit = omit,
275+
create: URecordAttributesParam | Omit = omit,
276+
create_or_update: URecordAttributesParam | Omit = omit,
277+
create_or_update_if_empty: URecordAttributesParam | Omit = omit,
278+
update: URecordAttributesParam | Omit = omit,
279+
update_if_empty: URecordAttributesParam | Omit = omit,
287280
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
288281
# The extra values given here take precedence over values defined on the client or passed to this method.
289282
extra_headers: Headers | None = None,
@@ -293,11 +286,7 @@ def upsert(
293286
) -> RecordUpsertResponse:
294287
"""
295288
Args:
296-
match: The attribute values to match against to find an existing record.
297-
298-
At least one unique attribute must be included to ensure that at most one record
299-
is matched. Additional unique or non-unique attributes may also be included to
300-
refine the matching criteria.
289+
match: Attribute key-value pairs associated with an object record.
301290
302291
validation_mode: Validation mode to use when validating request data.
303292
@@ -309,18 +298,15 @@ def upsert(
309298
will still fail if the request body does not contain the proper structure or if
310299
any required attributes fail validation.
311300
312-
create: The attribute values to use when creating a new record if no match is found.
301+
create: Attribute key-value pairs associated with an object record.
313302
314-
create_or_update: The attribute values to apply during both creation and update operations.
303+
create_or_update: Attribute key-value pairs associated with an object record.
315304
316-
create_or_update_if_empty: The attribute values to apply during both creation and update-if-empty
317-
operations.
305+
create_or_update_if_empty: Attribute key-value pairs associated with an object record.
318306
319-
update: The attribute values to use when updating an existing record if a match is
320-
found.
307+
update: Attribute key-value pairs associated with an object record.
321308
322-
update_if_empty: The attribute values to update when a matching record is found and the existing
323-
attribute value on the record is `null`.
309+
update_if_empty: Attribute key-value pairs associated with an object record.
324310
325311
extra_headers: Send extra headers
326312
@@ -380,7 +366,7 @@ async def create(
380366
self,
381367
object_name: str,
382368
*,
383-
data: Dict[str, record_create_params.Data],
369+
data: URecordAttributesParam,
384370
validation_mode: ValidationMode | Omit = omit,
385371
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
386372
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -391,9 +377,7 @@ async def create(
391377
) -> RecordCreateResponse:
392378
"""
393379
Args:
394-
data: The attribute values for the new record.
395-
396-
All required attributes on the object must be included.
380+
data: Attribute key-value pairs associated with an object record.
397381
398382
validation_mode: Validation mode to use when validating request data.
399383
@@ -471,7 +455,7 @@ async def update(
471455
record_id: str,
472456
*,
473457
object_name: str,
474-
data: Dict[str, record_update_params.Data],
458+
data: URecordAttributesParam,
475459
validation_mode: ValidationMode | Omit = omit,
476460
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
477461
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -482,7 +466,7 @@ async def update(
482466
) -> RecordUpdateResponse:
483467
"""
484468
Args:
485-
data: The attribute values to update in the record.
469+
data: Attribute key-value pairs associated with an object record.
486470
487471
validation_mode: Validation mode to use when validating request data.
488472
@@ -563,7 +547,7 @@ async def find_unique(
563547
self,
564548
object_name: str,
565549
*,
566-
match: Dict[str, Optional[record_find_unique_params.Match]],
550+
match: URecordAttributesParam,
567551
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
568552
# The extra values given here take precedence over values defined on the client or passed to this method.
569553
extra_headers: Headers | None = None,
@@ -573,11 +557,7 @@ async def find_unique(
573557
) -> RecordFindUniqueResponse:
574558
"""
575559
Args:
576-
match: The attribute values to match against to find an existing record.
577-
578-
At least one unique attribute must be included to ensure that at most one record
579-
is matched. Additional unique or non-unique attributes may also be included to
580-
refine the matching criteria.
560+
match: Attribute key-value pairs associated with an object record.
581561
582562
extra_headers: Send extra headers
583563
@@ -602,13 +582,13 @@ async def upsert(
602582
self,
603583
object_name: str,
604584
*,
605-
match: Dict[str, Optional[record_upsert_params.Match]],
585+
match: URecordAttributesParam,
606586
validation_mode: ValidationMode | Omit = omit,
607-
create: Dict[str, record_upsert_params.Create] | Omit = omit,
608-
create_or_update: Dict[str, record_upsert_params.CreateOrUpdate] | Omit = omit,
609-
create_or_update_if_empty: Dict[str, record_upsert_params.CreateOrUpdateIfEmpty] | Omit = omit,
610-
update: Dict[str, record_upsert_params.Update] | Omit = omit,
611-
update_if_empty: Dict[str, record_upsert_params.UpdateIfEmpty] | Omit = omit,
587+
create: URecordAttributesParam | Omit = omit,
588+
create_or_update: URecordAttributesParam | Omit = omit,
589+
create_or_update_if_empty: URecordAttributesParam | Omit = omit,
590+
update: URecordAttributesParam | Omit = omit,
591+
update_if_empty: URecordAttributesParam | Omit = omit,
612592
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
613593
# The extra values given here take precedence over values defined on the client or passed to this method.
614594
extra_headers: Headers | None = None,
@@ -618,11 +598,7 @@ async def upsert(
618598
) -> RecordUpsertResponse:
619599
"""
620600
Args:
621-
match: The attribute values to match against to find an existing record.
622-
623-
At least one unique attribute must be included to ensure that at most one record
624-
is matched. Additional unique or non-unique attributes may also be included to
625-
refine the matching criteria.
601+
match: Attribute key-value pairs associated with an object record.
626602
627603
validation_mode: Validation mode to use when validating request data.
628604
@@ -634,18 +610,15 @@ async def upsert(
634610
will still fail if the request body does not contain the proper structure or if
635611
any required attributes fail validation.
636612
637-
create: The attribute values to use when creating a new record if no match is found.
613+
create: Attribute key-value pairs associated with an object record.
638614
639-
create_or_update: The attribute values to apply during both creation and update operations.
615+
create_or_update: Attribute key-value pairs associated with an object record.
640616
641-
create_or_update_if_empty: The attribute values to apply during both creation and update-if-empty
642-
operations.
617+
create_or_update_if_empty: Attribute key-value pairs associated with an object record.
643618
644-
update: The attribute values to use when updating an existing record if a match is
645-
found.
619+
update: Attribute key-value pairs associated with an object record.
646620
647-
update_if_empty: The attribute values to update when a matching record is found and the existing
648-
attribute value on the record is `null`.
621+
update_if_empty: Attribute key-value pairs associated with an object record.
649622
650623
extra_headers: Send extra headers
651624

src/unify/types/data/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
from .u_text import UText as UText
88
from .u_uuid import UUuid as UUuid
99
from .u_email import UEmail as UEmail
10+
from .u_value import UValue as UValue
1011
from .u_object import UObject as UObject
12+
from .u_record import URecord as URecord
1113
from .u_select import USelect as USelect
1214
from .u_address import UAddress as UAddress
1315
from .u_boolean import UBoolean as UBoolean
@@ -18,6 +20,7 @@
1820
from .u_datetime import UDatetime as UDatetime
1921
from .u_attribute import UAttribute as UAttribute
2022
from .u_multiselect import UMultiselect as UMultiselect
23+
from .u_value_param import UValueParam as UValueParam
2124
from .u_phone_number import UPhoneNumber as UPhoneNumber
2225
from .u_address_param import UAddressParam as UAddressParam
2326
from .u_country_param import UCountryParam as UCountryParam
@@ -26,6 +29,7 @@
2629
from .u_attribute_param import UAttributeParam as UAttributeParam
2730
from .u_reference_by_id import UReferenceByID as UReferenceByID
2831
from .u_multiselect_param import UMultiselectParam as UMultiselectParam
32+
from .u_record_attributes import URecordAttributes as URecordAttributes
2933
from .object_create_params import ObjectCreateParams as ObjectCreateParams
3034
from .object_list_response import ObjectListResponse as ObjectListResponse
3135
from .object_update_params import ObjectUpdateParams as ObjectUpdateParams
@@ -52,6 +56,7 @@
5256
from .attribute_delete_response import AttributeDeleteResponse as AttributeDeleteResponse
5357
from .attribute_update_response import AttributeUpdateResponse as AttributeUpdateResponse
5458
from .record_find_unique_params import RecordFindUniqueParams as RecordFindUniqueParams
59+
from .u_record_attributes_param import URecordAttributesParam as URecordAttributesParam
5560
from .u_reference_by_match_param import UReferenceByMatchParam as UReferenceByMatchParam
5661
from .attribute_retrieve_response import AttributeRetrieveResponse as AttributeRetrieveResponse
5762
from .record_find_unique_response import RecordFindUniqueResponse as RecordFindUniqueResponse

src/unify/types/data/record_create_params.py

Lines changed: 6 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,17 @@
22

33
from __future__ import annotations
44

5-
from typing import Dict, Union
6-
from typing_extensions import Required, TypeAlias, TypedDict
7-
8-
from .u_date import UDate
9-
from .u_boolean import UBoolean
10-
from .u_decimal import UDecimal
11-
from .u_address_param import UAddressParam
12-
from .u_country_param import UCountryParam
5+
from typing_extensions import Required, TypedDict
6+
137
from .validation_mode import ValidationMode
14-
from .u_currency_param import UCurrencyParam
15-
from .u_multiselect_param import UMultiselectParam
16-
from .u_reference_by_id_param import UReferenceByIDParam
17-
from .u_reference_by_match_param import UReferenceByMatchParam
18-
from .u_reference_by_upsert_param import UReferenceByUpsertParam
8+
from .u_record_attributes_param import URecordAttributesParam
199

20-
__all__ = ["RecordCreateParams", "Data"]
10+
__all__ = ["RecordCreateParams"]
2111

2212

2313
class RecordCreateParams(TypedDict, total=False):
24-
data: Required[Dict[str, Data]]
25-
"""The attribute values for the new record.
26-
27-
All required attributes on the object must be included.
28-
"""
14+
data: Required[URecordAttributesParam]
15+
"""Attribute key-value pairs associated with an object record."""
2916

3017
validation_mode: ValidationMode
3118
"""Validation mode to use when validating request data.
@@ -38,17 +25,3 @@ class RecordCreateParams(TypedDict, total=False):
3825
will still fail if the request body does not contain the proper structure or if
3926
any required attributes fail validation.
4027
"""
41-
42-
43-
Data: TypeAlias = Union[
44-
UAddressParam,
45-
UBoolean,
46-
UCountryParam,
47-
UCurrencyParam,
48-
UDate,
49-
UDecimal,
50-
UMultiselectParam,
51-
UReferenceByIDParam,
52-
UReferenceByMatchParam,
53-
UReferenceByUpsertParam,
54-
]

0 commit comments

Comments
 (0)