Skip to content

Resolve VCSWP-23775 #59

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Feb 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ docs/SetTalk.md
docs/Sms.md
docs/StartRecordCall.md
docs/TFN.md
docs/TFNCampaign.md
docs/TerminateConference.md
docs/TranscribeReason.md
docs/TranscribeTermReason.md
Expand Down Expand Up @@ -275,6 +276,7 @@ freeclimb/models/sms_toll_free_campaigns_list_result.py
freeclimb/models/start_record_call.py
freeclimb/models/terminate_conference.py
freeclimb/models/tfn.py
freeclimb/models/tfn_campaign.py
freeclimb/models/transcribe_reason.py
freeclimb/models/transcribe_term_reason.py
freeclimb/models/transcribe_utterance.py
Expand Down Expand Up @@ -422,6 +424,7 @@ test/test_sms_toll_free_campaigns_list_result.py
test/test_start_record_call.py
test/test_terminate_conference.py
test/test_tfn.py
test/test_tfn_campaign.py
test/test_transcribe_reason.py
test/test_transcribe_term_reason.py
test/test_transcribe_utterance.py
Expand Down
13 changes: 12 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,30 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

None

<a name="5.1.0"></a>

## [5.1.0] - 2025-02-05

### Added

- CampaignTFN and MessageResultsAllOfTfn models

<a name="5.0.0"></a>

## [5.0.0] - 2025-01-08

### Added

- Webhook classes
- More idiomated Enum management

### Changed

- Use upgraded openapi generator

### Removed
- *AllOf model files

- \*AllOf model files

<a name="4.9.0"></a>

Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ FreeClimb is a cloud-based application programming interface (API) that puts the
This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:

- API version: 1.0.0
- Package version: 5.0.0
- Package version: 5.1.0
- Generator version: 7.9.0
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
For more information, please visit [https://www.freeclimb.com/support/](https://www.freeclimb.com/support/)
Expand Down Expand Up @@ -303,6 +303,7 @@ Class | Method | HTTP request | Description
- [Sms](docs/Sms.md)
- [StartRecordCall](docs/StartRecordCall.md)
- [TFN](docs/TFN.md)
- [TFNCampaign](docs/TFNCampaign.md)
- [TerminateConference](docs/TerminateConference.md)
- [TranscribeReason](docs/TranscribeReason.md)
- [TranscribeTermReason](docs/TranscribeTermReason.md)
Expand Down
3 changes: 3 additions & 0 deletions docs/MessageResult.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ Name | Type | Description | Notes
**campaign_id** | **str** | The unique identifier for the campaign associated with the message | [optional]
**segment_count** | **float** | The number of segments into which the message was split | [optional]
**media_urls** | **List[str]** | an array of HTTP URLs which were attached this this message | [optional]
**tfn** | [**TFN**](TFN.md) | | [optional]
**phone_number_id** | **str** | String that uniquely identifies the phoneNumber resource used to send this Message | [optional]
**application_id** | **str** | String that uniquely identifies the Application resource used to send this Message | [optional]

## Example

Expand Down
37 changes: 37 additions & 0 deletions docs/TFNCampaign.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# TFNCampaign


## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**account_id** | **str** | ID of the account that created this participant. |
**campaign_id** | **str** | TFNCampaignId |
**use_case** | **str** | |
**registration_status** | [**SMSTollFreeCampaignRegistrationStatus**](SMSTollFreeCampaignRegistrationStatus.md) | |
**date_created** | **str** | |
**date_updated** | **str** | |
**date_created_iso** | **str** | |
**date_updated_iso** | **str** | |
**revision** | **int** | |

## Example

```python
from freeclimb.models.tfn_campaign import TFNCampaign

# TODO update the JSON string below
json = "{}"
# create an instance of TFNCampaign from a JSON string
tfn_campaign_instance = TFNCampaign.from_json(json)
# print the JSON string representation of the object
print(TFNCampaign.to_json())

# convert the object into a dict
tfn_campaign_dict = tfn_campaign_instance.to_dict()
# create an instance of TFNCampaign from a dict
tfn_campaign_from_dict = TFNCampaign.from_dict(tfn_campaign_dict)
```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


3 changes: 2 additions & 1 deletion freeclimb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
""" # noqa: E501


__version__ = "5.0.0"
__version__ = "5.1.0"

# import apis into sdk package
from freeclimb.api.default_api import DefaultApi as DefaultApi
Expand Down Expand Up @@ -248,6 +248,7 @@
from freeclimb.models.sms import Sms as Sms
from freeclimb.models.start_record_call import StartRecordCall as StartRecordCall
from freeclimb.models.tfn import TFN as TFN
from freeclimb.models.tfn_campaign import TFNCampaign as TFNCampaign
from freeclimb.models.terminate_conference import (
TerminateConference as TerminateConference,
)
Expand Down
2 changes: 1 addition & 1 deletion freeclimb/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def __init__(
self.default_headers[header_name] = header_value
self.cookie = cookie
# Set default User-Agent.
self.user_agent = "OpenAPI-Generator/5.0.0/python"
self.user_agent = "OpenAPI-Generator/5.1.0/python"
self.client_side_validation = configuration.client_side_validation

def __enter__(self):
Expand Down
2 changes: 1 addition & 1 deletion freeclimb/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ def to_debug_report(self):
"OS: {env}\n"
"Python Version: {pyversion}\n"
"Version of the API: 1.0.0\n"
"SDK Package Version: 5.0.0".format(env=sys.platform, pyversion=sys.version)
"SDK Package Version: 5.1.0".format(env=sys.platform, pyversion=sys.version)
)

def get_host_settings(self):
Expand Down
10 changes: 5 additions & 5 deletions freeclimb/model_utils.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
"""
FreeClimb API
FreeClimb API

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
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

The version of the OpenAPI document: 1.0.0
Contact: [email protected]
Generated by: https://openapi-generator.tech
The version of the OpenAPI document: 1.0.0
Contact: [email protected]
Generated by: https://openapi-generator.tech
"""

from datetime import date, datetime # noqa: F401
Expand Down
1 change: 1 addition & 0 deletions freeclimb/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@
from freeclimb.models.sms import Sms as Sms
from freeclimb.models.start_record_call import StartRecordCall as StartRecordCall
from freeclimb.models.tfn import TFN as TFN
from freeclimb.models.tfn_campaign import TFNCampaign as TFNCampaign
from freeclimb.models.terminate_conference import (
TerminateConference as TerminateConference,
)
Expand Down
33 changes: 33 additions & 0 deletions freeclimb/models/message_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr
from typing import Any, ClassVar, Dict, List, Optional, Union
from freeclimb.models.message_status import MessageStatus
from freeclimb.models.tfn import TFN
from pydantic import StrictStr
from typing import Optional, Set
from typing_extensions import Self
Expand Down Expand Up @@ -99,6 +100,17 @@ class MessageResult(
description="an array of HTTP URLs which were attached this this message",
alias="mediaUrls",
)
tfn: Optional[TFN] = None
phone_number_id: Optional[StrictStr] = Field(
default=None,
description="String that uniquely identifies the phoneNumber resource used to send this Message",
alias="phoneNumberId",
)
application_id: Optional[StrictStr] = Field(
default=None,
description="String that uniquely identifies the Application resource used to send this Message",
alias="applicationId",
)

__properties: ClassVar[List[str]] = [
"uri",
Expand All @@ -117,6 +129,9 @@ class MessageResult(
"campaignId",
"segmentCount",
"mediaUrls",
"tfn",
"phoneNumberId",
"applicationId",
]

def to_str(self) -> str:
Expand Down Expand Up @@ -150,6 +165,9 @@ def to_dict(self) -> Dict[str, Any]:
exclude=excluded_fields,
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of tfn
if self.tfn:
_dict["tfn"] = self.tfn.to_dict()
# set to None if account_id (nullable) is None
# and model_fields_set contains the field
if self.account_id is None and "account_id" in self.model_fields_set:
Expand Down Expand Up @@ -213,6 +231,16 @@ def to_dict(self) -> Dict[str, Any]:
if self.media_urls is None and "media_urls" in self.model_fields_set:
_dict["mediaUrls"] = None

# set to None if phone_number_id (nullable) is None
# and model_fields_set contains the field
if self.phone_number_id is None and "phone_number_id" in self.model_fields_set:
_dict["phoneNumberId"] = None

# set to None if application_id (nullable) is None
# and model_fields_set contains the field
if self.application_id is None and "application_id" in self.model_fields_set:
_dict["applicationId"] = None

return _dict

@classmethod
Expand Down Expand Up @@ -242,6 +270,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"campaignId": obj.get("campaignId"),
"segmentCount": obj.get("segmentCount"),
"mediaUrls": obj.get("mediaUrls"),
"tfn": (
TFN.from_dict(obj["tfn"]) if obj.get("tfn") is not None else None
),
"phoneNumberId": obj.get("phoneNumberId"),
"applicationId": obj.get("applicationId"),
}
)
return _obj
137 changes: 137 additions & 0 deletions freeclimb/models/tfn_campaign.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
# coding: utf-8

"""
FreeClimb API

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.

The version of the OpenAPI document: 1.0.0
Contact: [email protected]
Generated by OpenAPI Generator (https://openapi-generator.tech)

Do not edit the class manually.
""" # noqa: E501


from __future__ import annotations
import pprint
import re # noqa: F401
import json

from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator
from typing import Any, ClassVar, Dict, List, Optional
from typing_extensions import Annotated
from freeclimb.models.sms_toll_free_campaign_registration_status import (
SMSTollFreeCampaignRegistrationStatus,
)
from pydantic import StrictStr
from typing import Optional, Set
from typing_extensions import Self


class TFNCampaign(
BaseModel, populate_by_name=True, validate_assignment=True, protected_namespaces=()
):
"""
TFNCampaign
""" # noqa: E501

account_id: Optional[StrictStr] = Field(
description="ID of the account that created this participant.",
alias="accountId",
)
campaign_id: Annotated[str, Field(strict=True)] = Field(
description="TFNCampaignId", alias="campaignId"
)
use_case: StrictStr = Field(alias="useCase")
registration_status: SMSTollFreeCampaignRegistrationStatus = Field(
alias="registrationStatus"
)
date_created: StrictStr = Field(alias="dateCreated")
date_updated: StrictStr = Field(alias="dateUpdated")
date_created_iso: StrictStr = Field(alias="dateCreatedISO")
date_updated_iso: StrictStr = Field(alias="dateUpdatedISO")
revision: StrictInt

__properties: ClassVar[List[str]] = [
"accountId",
"campaignId",
"useCase",
"registrationStatus",
"dateCreated",
"dateUpdated",
"dateCreatedISO",
"dateUpdatedISO",
"revision",
]

@field_validator("campaign_id")
def campaign_id_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if not re.match(r"cmptfn_[a-fA-F0-9]{40}", value):
raise ValueError(
r"must validate the regular expression /cmptfn_[a-fA-F0-9]{40}/"
)
return value

def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))

def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())

@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of TFNCampaign from a JSON string"""
return cls.from_dict(json.loads(json_str))

def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.

This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:

* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([])

_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
# set to None if account_id (nullable) is None
# and model_fields_set contains the field
if self.account_id is None and "account_id" in self.model_fields_set:
_dict["accountId"] = None

return _dict

@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of TFNCampaign from a dict"""
if obj is None:
return None

if not isinstance(obj, dict):
return cls.model_validate(obj)

_obj = cls.model_validate(
{
"accountId": obj.get("accountId"),
"campaignId": obj.get("campaignId"),
"useCase": obj.get("useCase"),
"registrationStatus": obj.get("registrationStatus"),
"dateCreated": obj.get("dateCreated"),
"dateUpdated": obj.get("dateUpdated"),
"dateCreatedISO": obj.get("dateCreatedISO"),
"dateUpdatedISO": obj.get("dateUpdatedISO"),
"revision": obj.get("revision"),
}
)
return _obj
Loading