Skip to content

Commit 37e2cc8

Browse files
committed
Update SDK with latest spec changes
1 parent b45ef57 commit 37e2cc8

File tree

96 files changed

+834
-86
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+834
-86
lines changed

.openapi-generator/FILES

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ docs/SetTalk.md
127127
docs/Sms.md
128128
docs/StartRecordCall.md
129129
docs/TFN.md
130+
docs/TFNCampaign.md
130131
docs/TerminateConference.md
131132
docs/TranscribeReason.md
132133
docs/TranscribeTermReason.md
@@ -275,6 +276,7 @@ freeclimb/models/sms_toll_free_campaigns_list_result.py
275276
freeclimb/models/start_record_call.py
276277
freeclimb/models/terminate_conference.py
277278
freeclimb/models/tfn.py
279+
freeclimb/models/tfn_campaign.py
278280
freeclimb/models/transcribe_reason.py
279281
freeclimb/models/transcribe_term_reason.py
280282
freeclimb/models/transcribe_utterance.py
@@ -422,6 +424,7 @@ test/test_sms_toll_free_campaigns_list_result.py
422424
test/test_start_record_call.py
423425
test/test_terminate_conference.py
424426
test/test_tfn.py
427+
test/test_tfn_campaign.py
425428
test/test_transcribe_reason.py
426429
test/test_transcribe_term_reason.py
427430
test/test_transcribe_utterance.py

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,7 @@ Class | Method | HTTP request | Description
303303
- [Sms](docs/Sms.md)
304304
- [StartRecordCall](docs/StartRecordCall.md)
305305
- [TFN](docs/TFN.md)
306+
- [TFNCampaign](docs/TFNCampaign.md)
306307
- [TerminateConference](docs/TerminateConference.md)
307308
- [TranscribeReason](docs/TranscribeReason.md)
308309
- [TranscribeTermReason](docs/TranscribeTermReason.md)

docs/MessageResult.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ Name | Type | Description | Notes
2121
**campaign_id** | **str** | The unique identifier for the campaign associated with the message | [optional]
2222
**segment_count** | **float** | The number of segments into which the message was split | [optional]
2323
**media_urls** | **List[str]** | an array of HTTP URLs which were attached this this message | [optional]
24+
**tfn** | [**TFN**](TFN.md) | | [optional]
25+
**phone_number_id** | **str** | String that uniquely identifies the phoneNumber resource used to send this Message | [optional]
26+
**application_id** | **str** | String that uniquely identifies the Application resource used to send this Message | [optional]
2427

2528
## Example
2629

docs/TFNCampaign.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# TFNCampaign
2+
3+
4+
## Properties
5+
6+
Name | Type | Description | Notes
7+
------------ | ------------- | ------------- | -------------
8+
**account_id** | **str** | ID of the account that created this participant. |
9+
**campaign_id** | **str** | TFNCampaignId |
10+
**use_case** | **str** | |
11+
**registration_status** | [**SMSTollFreeCampaignRegistrationStatus**](SMSTollFreeCampaignRegistrationStatus.md) | |
12+
**date_created** | **str** | |
13+
**date_updated** | **str** | |
14+
**date_created_iso** | **str** | |
15+
**date_updated_iso** | **str** | |
16+
**revision** | **int** | |
17+
18+
## Example
19+
20+
```python
21+
from freeclimb.models.tfn_campaign import TFNCampaign
22+
23+
# TODO update the JSON string below
24+
json = "{}"
25+
# create an instance of TFNCampaign from a JSON string
26+
tfn_campaign_instance = TFNCampaign.from_json(json)
27+
# print the JSON string representation of the object
28+
print(TFNCampaign.to_json())
29+
30+
# convert the object into a dict
31+
tfn_campaign_dict = tfn_campaign_instance.to_dict()
32+
# create an instance of TFNCampaign from a dict
33+
tfn_campaign_from_dict = TFNCampaign.from_dict(tfn_campaign_dict)
34+
```
35+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
36+
37+

freeclimb/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@
248248
from freeclimb.models.sms import Sms as Sms
249249
from freeclimb.models.start_record_call import StartRecordCall as StartRecordCall
250250
from freeclimb.models.tfn import TFN as TFN
251+
from freeclimb.models.tfn_campaign import TFNCampaign as TFNCampaign
251252
from freeclimb.models.terminate_conference import (
252253
TerminateConference as TerminateConference,
253254
)

freeclimb/model_utils.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
"""
2-
FreeClimb API
2+
FreeClimb API
33
4-
FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. # noqa: E501
4+
FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. # noqa: E501
55
6-
The version of the OpenAPI document: 1.0.0
7-
Contact: support@freeclimb.com
8-
Generated by: https://openapi-generator.tech
6+
The version of the OpenAPI document: 1.0.0
7+
Contact: support@freeclimb.com
8+
Generated by: https://openapi-generator.tech
99
"""
1010

1111
from datetime import date, datetime # noqa: F401

freeclimb/models/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@
231231
from freeclimb.models.sms import Sms as Sms
232232
from freeclimb.models.start_record_call import StartRecordCall as StartRecordCall
233233
from freeclimb.models.tfn import TFN as TFN
234+
from freeclimb.models.tfn_campaign import TFNCampaign as TFNCampaign
234235
from freeclimb.models.terminate_conference import (
235236
TerminateConference as TerminateConference,
236237
)

freeclimb/models/message_result.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr
2222
from typing import Any, ClassVar, Dict, List, Optional, Union
2323
from freeclimb.models.message_status import MessageStatus
24+
from freeclimb.models.tfn import TFN
2425
from pydantic import StrictStr
2526
from typing import Optional, Set
2627
from typing_extensions import Self
@@ -99,6 +100,17 @@ class MessageResult(
99100
description="an array of HTTP URLs which were attached this this message",
100101
alias="mediaUrls",
101102
)
103+
tfn: Optional[TFN] = None
104+
phone_number_id: Optional[StrictStr] = Field(
105+
default=None,
106+
description="String that uniquely identifies the phoneNumber resource used to send this Message",
107+
alias="phoneNumberId",
108+
)
109+
application_id: Optional[StrictStr] = Field(
110+
default=None,
111+
description="String that uniquely identifies the Application resource used to send this Message",
112+
alias="applicationId",
113+
)
102114

103115
__properties: ClassVar[List[str]] = [
104116
"uri",
@@ -117,6 +129,9 @@ class MessageResult(
117129
"campaignId",
118130
"segmentCount",
119131
"mediaUrls",
132+
"tfn",
133+
"phoneNumberId",
134+
"applicationId",
120135
]
121136

122137
def to_str(self) -> str:
@@ -150,6 +165,9 @@ def to_dict(self) -> Dict[str, Any]:
150165
exclude=excluded_fields,
151166
exclude_none=True,
152167
)
168+
# override the default output from pydantic by calling `to_dict()` of tfn
169+
if self.tfn:
170+
_dict["tfn"] = self.tfn.to_dict()
153171
# set to None if account_id (nullable) is None
154172
# and model_fields_set contains the field
155173
if self.account_id is None and "account_id" in self.model_fields_set:
@@ -213,6 +231,16 @@ def to_dict(self) -> Dict[str, Any]:
213231
if self.media_urls is None and "media_urls" in self.model_fields_set:
214232
_dict["mediaUrls"] = None
215233

234+
# set to None if phone_number_id (nullable) is None
235+
# and model_fields_set contains the field
236+
if self.phone_number_id is None and "phone_number_id" in self.model_fields_set:
237+
_dict["phoneNumberId"] = None
238+
239+
# set to None if application_id (nullable) is None
240+
# and model_fields_set contains the field
241+
if self.application_id is None and "application_id" in self.model_fields_set:
242+
_dict["applicationId"] = None
243+
216244
return _dict
217245

218246
@classmethod
@@ -242,6 +270,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
242270
"campaignId": obj.get("campaignId"),
243271
"segmentCount": obj.get("segmentCount"),
244272
"mediaUrls": obj.get("mediaUrls"),
273+
"tfn": (
274+
TFN.from_dict(obj["tfn"]) if obj.get("tfn") is not None else None
275+
),
276+
"phoneNumberId": obj.get("phoneNumberId"),
277+
"applicationId": obj.get("applicationId"),
245278
}
246279
)
247280
return _obj

freeclimb/models/tfn_campaign.py

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
# coding: utf-8
2+
3+
"""
4+
FreeClimb API
5+
6+
FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request.
7+
8+
The version of the OpenAPI document: 1.0.0
9+
Contact: support@freeclimb.com
10+
Generated by OpenAPI Generator (https://openapi-generator.tech)
11+
12+
Do not edit the class manually.
13+
""" # noqa: E501
14+
15+
16+
from __future__ import annotations
17+
import pprint
18+
import re # noqa: F401
19+
import json
20+
21+
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator
22+
from typing import Any, ClassVar, Dict, List, Optional
23+
from typing_extensions import Annotated
24+
from freeclimb.models.sms_toll_free_campaign_registration_status import (
25+
SMSTollFreeCampaignRegistrationStatus,
26+
)
27+
from pydantic import StrictStr
28+
from typing import Optional, Set
29+
from typing_extensions import Self
30+
31+
32+
class TFNCampaign(
33+
BaseModel, populate_by_name=True, validate_assignment=True, protected_namespaces=()
34+
):
35+
"""
36+
TFNCampaign
37+
""" # noqa: E501
38+
39+
account_id: Optional[StrictStr] = Field(
40+
description="ID of the account that created this participant.",
41+
alias="accountId",
42+
)
43+
campaign_id: Annotated[str, Field(strict=True)] = Field(
44+
description="TFNCampaignId", alias="campaignId"
45+
)
46+
use_case: StrictStr = Field(alias="useCase")
47+
registration_status: SMSTollFreeCampaignRegistrationStatus = Field(
48+
alias="registrationStatus"
49+
)
50+
date_created: StrictStr = Field(alias="dateCreated")
51+
date_updated: StrictStr = Field(alias="dateUpdated")
52+
date_created_iso: StrictStr = Field(alias="dateCreatedISO")
53+
date_updated_iso: StrictStr = Field(alias="dateUpdatedISO")
54+
revision: StrictInt
55+
56+
__properties: ClassVar[List[str]] = [
57+
"accountId",
58+
"campaignId",
59+
"useCase",
60+
"registrationStatus",
61+
"dateCreated",
62+
"dateUpdated",
63+
"dateCreatedISO",
64+
"dateUpdatedISO",
65+
"revision",
66+
]
67+
68+
@field_validator("campaign_id")
69+
def campaign_id_validate_regular_expression(cls, value):
70+
"""Validates the regular expression"""
71+
if not re.match(r"cmptfn_[a-fA-F0-9]{40}", value):
72+
raise ValueError(
73+
r"must validate the regular expression /cmptfn_[a-fA-F0-9]{40}/"
74+
)
75+
return value
76+
77+
def to_str(self) -> str:
78+
"""Returns the string representation of the model using alias"""
79+
return pprint.pformat(self.model_dump(by_alias=True))
80+
81+
def to_json(self) -> str:
82+
"""Returns the JSON representation of the model using alias"""
83+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
84+
return json.dumps(self.to_dict())
85+
86+
@classmethod
87+
def from_json(cls, json_str: str) -> Optional[Self]:
88+
"""Create an instance of TFNCampaign from a JSON string"""
89+
return cls.from_dict(json.loads(json_str))
90+
91+
def to_dict(self) -> Dict[str, Any]:
92+
"""Return the dictionary representation of the model using alias.
93+
94+
This has the following differences from calling pydantic's
95+
`self.model_dump(by_alias=True)`:
96+
97+
* `None` is only added to the output dict for nullable fields that
98+
were set at model initialization. Other fields with value `None`
99+
are ignored.
100+
"""
101+
excluded_fields: Set[str] = set([])
102+
103+
_dict = self.model_dump(
104+
by_alias=True,
105+
exclude=excluded_fields,
106+
exclude_none=True,
107+
)
108+
# set to None if account_id (nullable) is None
109+
# and model_fields_set contains the field
110+
if self.account_id is None and "account_id" in self.model_fields_set:
111+
_dict["accountId"] = None
112+
113+
return _dict
114+
115+
@classmethod
116+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
117+
"""Create an instance of TFNCampaign from a dict"""
118+
if obj is None:
119+
return None
120+
121+
if not isinstance(obj, dict):
122+
return cls.model_validate(obj)
123+
124+
_obj = cls.model_validate(
125+
{
126+
"accountId": obj.get("accountId"),
127+
"campaignId": obj.get("campaignId"),
128+
"useCase": obj.get("useCase"),
129+
"registrationStatus": obj.get("registrationStatus"),
130+
"dateCreated": obj.get("dateCreated"),
131+
"dateUpdated": obj.get("dateUpdated"),
132+
"dateCreatedISO": obj.get("dateCreatedISO"),
133+
"dateUpdatedISO": obj.get("dateUpdatedISO"),
134+
"revision": obj.get("revision"),
135+
}
136+
)
137+
return _obj

0 commit comments

Comments
 (0)