Skip to content

circuitid/circuitid-python

Repository files navigation

circuitid_python

Introduction

Circuit ID® is an innovative cloud communications platform that redefines your connectivity experience. Our cutting-edge AI-powered solution seamlessly integrates calling, meetings, messaging, voicemail, fax, SIP Trunking, mobile broadband, and mobile phone services, accessible wherever you and your devices go.

Whether you are a beginner getting started with our API or an experienced developer looking for advanced features, this documentation site will serve as your comprehensive guide.

We are excited to have you on board and are confident that this documentation site will empower you to leverage the full potential of our REST API. If you have any questions or require further assistance, please don't hesitate to reach out to our support team.

Happy coding!

  • API version: 0.47.22
  • Package version: 1.0.0
  • Build package: org.openapitools.codegen.languages.PythonClientCodegen For more information, please visit https://www.circuitid.com/

Requirements.

Python >=3.7

Migration from other generators like python and python-legacy

Changes

  1. This generator uses spec case for all (object) property names and parameter names.
    • So if the spec has a property name like camelCase, it will use camelCase rather than camel_case
    • So you will need to update how you input and read properties to use spec case
  2. Endpoint parameters are stored in dictionaries to prevent collisions (explanation below)
    • So you will need to update how you pass data in to endpoints
  3. Endpoint responses now include the original response, the deserialized response body, and (todo)the deserialized headers
    • So you will need to update your code to use response.body to access deserialized data
  4. All validated data is instantiated in an instance that subclasses all validated Schema classes and Decimal/str/list/tuple/frozendict/NoneClass/BoolClass/bytes/io.FileIO
    • This means that you can use isinstance to check if a payload validated against a schema class
    • This means that no data will be of type None/True/False
      • ingested None will subclass NoneClass
      • ingested True will subclass BoolClass
      • ingested False will subclass BoolClass
      • So if you need to check is True/False/None, instead use instance.is_true_oapg()/.is_false_oapg()/.is_none_oapg()
  5. All validated class instances are immutable except for ones based on io.File
    • This is because if properties were changed after validation, that validation would no longer apply
    • So no changing values or property values after a class has been instantiated
  6. String + Number types with formats
    • String type data is stored as a string and if you need to access types based on its format like date, date-time, uuid, number etc then you will need to use accessor functions on the instance
    • type string + format: See .as_date_oapg, .as_datetime_oapg, .as_decimal_oapg, .as_uuid_oapg
    • type number + format: See .as_float_oapg, .as_int_oapg
    • this was done because openapi/json-schema defines constraints. string data may be type string with no format keyword in one schema, and include a format constraint in another schema
    • So if you need to access a string format based type, use as_date_oapg/as_datetime_oapg/as_decimal_oapg/as_uuid_oapg
    • So if you need to access a number format based type, use as_int_oapg/as_float_oapg
  7. Property access on AnyType(type unset) or object(dict) schemas
    • Only required keys with valid python names are properties like .someProp and have type hints
    • All optional keys may not exist, so properties are not defined for them
    • One can access optional values with dict_instance['optionalProp'] and KeyError will be raised if it does not exist
    • Use get_item_oapg if you need a way to always get a value whether or not the key exists
      • If the key does not exist, schemas.unset is returned from calling dict_instance.get_item_oapg('optionalProp')
      • All required and optional keys have type hints for this method, and @typing.overload is used
      • A type hint is also generated for additionalProperties accessed using this method
    • So you will need to update you code to use some_instance['optionalProp'] to access optional property and additionalProperty values
  8. The location of the api classes has changed
    • Api classes are located in your_package.apis.tags.some_api
    • This change was made to eliminate redundant code generation
    • Legacy generators generated the same endpoint twice if it had > 1 tag on it
    • This generator defines an endpoint in one class, then inherits that class to generate apis by tags and by paths
    • This change reduces code and allows quicker run time if you use the path apis
      • path apis are at your_package.apis.paths.some_path
    • Those apis will only load their needed models, which is less to load than all of the resources needed in a tag api
    • So you will need to update your import paths to the api classes

Why are Oapg and _oapg used in class and method names?

Classes can have arbitrarily named properties set on them Endpoints can have arbitrary operationId method names set For those reasons, I use the prefix Oapg and _oapg to greatly reduce the likelihood of collisions on protected + public classes/methods. oapg stands for OpenApi Python Generator.

Object property spec case

This was done because when payloads are ingested, they can be validated against N number of schemas. If the input signature used a different property name then that has mutated the payload. So SchemaA and SchemaB must both see the camelCase spec named variable. Also it is possible to send in two properties, named camelCase and camel_case in the same payload. That use case should be support so spec case is used.

Parameter spec case

Parameters can be included in different locations including:

  • query
  • path
  • header
  • cookie

Any of those parameters could use the same parameter names, so if every parameter was included as an endpoint parameter in a function signature, they would collide. For that reason, each of those inputs have been separated out into separate typed dictionaries:

  • query_params
  • path_params
  • header_params
  • cookie_params

So when updating your code, you will need to pass endpoint parameters in using those dictionaries.

Endpoint responses

Endpoint responses have been enriched to now include more information. Any response reom an endpoint will now include the following properties: response: urllib3.HTTPResponse body: typing.Union[Unset, Schema] headers: typing.Union[Unset, TODO] Note: response header deserialization has not yet been added

Installation & Usage

pip install

If the python package is hosted on a repository, you can install directly using:

pip install git+https://github.com/circuitid/circuitid-python.git

(you may need to run pip with root permission: sudo pip install git+https://github.com/circuitid/circuitid-python.git)

Then import the package:

import circuitid_python

Setuptools

Install via Setuptools.

python setup.py install --user

(or sudo python setup.py install to install the package for all users)

Then import the package:

import circuitid_python

Getting Started

Please follow the installation procedure and then run the following:

import time
import circuitid_python
from pprint import pprint
from circuitid_python.api.tags import accepted_senders_api
from circuitid_python.models.acceptedsenders import Acceptedsenders
from circuitid_python.models.acceptedsenders_create_or_patch import AcceptedsendersCreateOrPatch
from circuitid_python.models.id import Id
from circuitid_python.models.response_date import ResponseDate
from circuitid_python.models.response_error import ResponseError
from circuitid_python.models.response_users import ResponseUsers
# Defining the host is optional and defaults to https://cloud9.circuitid.com
# See configuration.py for a list of all supported configuration parameters.
configuration = circuitid_python.Configuration(
    host = "https://cloud9.circuitid.com"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: jwt
configuration.api_key['jwt'] = 'YOUR_API_KEY'

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['jwt'] = 'Bearer'

# Enter a context with an instance of the API client
with circuitid_python.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = accepted_senders_api.AcceptedSendersApi(api_client)
    acceptedsenders_create_or_patch = AcceptedsendersCreateOrPatch(
        object="object_example",
        service="service_example",
        service_ref="service_ref_example",
        ref="users",
    ) # AcceptedsendersCreateOrPatch | The JSON object that will be posted to the REST API endpoint.

    try:
        # Create a new object
        api_response = api_instance.create_accepted_sender(acceptedsenders_create_or_patch)
        pprint(api_response)
    except circuitid_python.ApiException as e:
        print("Exception when calling AcceptedSendersApi->create_accepted_sender: %s\n" % e)

Documentation for API Endpoints

All URIs are relative to https://cloud9.circuitid.com

Class Method HTTP request Description
AcceptedSendersApi create_accepted_sender post /acceptedsenders Create a new object
AcceptedSendersApi find_accepted_senders get /acceptedsenders Find multiple objects
AcceptedSendersApi get_accepted_sender get /acceptedsenders/{id} Get object by id
AcceptedSendersApi patch_accepted_sender patch /acceptedsenders/{id} Patch object's data
AcceptedSendersApi remove_accepted_sender delete /acceptedsenders/{id} Delete object by id
AnnouncementsApi create_announcement post /announcements Create a new object
AnnouncementsApi find_announcements get /announcements Find multiple objects
AnnouncementsApi get_announcement get /announcements/{id} Get object by id
AnnouncementsApi patch_announcement patch /announcements/{id} Patch object's data
AnnouncementsApi remove_announcement delete /announcements/{id} Delete object by id
AppMarketplaceApi find_app_marketplace get /appmarketplace Find multiple objects
AuthenticationApi create_authentication post /authentication Create a new object
CallQueueAgentsApi create_call_queue_agent post /callqueueagents Create a new object
CallQueueAgentsApi find_call_queue_agents get /callqueueagents Find multiple objects
CallQueueAgentsApi get_call_queue_agent get /callqueueagents/{id} Get object by id
CallQueueAgentsApi patch_call_queue_agent patch /callqueueagents/{id} Patch object's data
CallQueueAgentsApi remove_call_queue_agent delete /callqueueagents/{id} Delete object by id
CallQueuesApi create_call_queue post /callqueues Create a new object
CallQueuesApi find_call_queues get /callqueues Find multiple objects
CallQueuesApi get_call_queue get /callqueues/{id} Get object by id
CallQueuesApi patch_call_queue patch /callqueues/{id} Patch object's data
CallQueuesApi remove_call_queue delete /callqueues/{id} Delete object by id
ChatRoomsApi create_chat_room post /chatrooms Create a new object
ChatRoomsApi find_chat_rooms get /chatrooms Find multiple objects
ChatRoomsApi get_chat_room get /chatrooms/{id} Get object by id
ChatRoomsApi patch_chat_room patch /chatrooms/{id} Patch object's data
ChatRoomsApi remove_chat_room delete /chatrooms/{id} Delete object by id
ClientsApi create_client post /clients Create a new object
ClientsApi find_clients get /clients Find multiple objects
ClientsApi get_client get /clients/{id} Get object by id
ClientsApi patch_client patch /clients/{id} Patch object's data
ClientsApi remove_client delete /clients/{id} Delete object by id
ConferenceNumbersApi find_conference_numbers get /conferencenumbers Find multiple objects
ConferenceRoomsApi create_conference_room post /conferencerooms Create a new object
ConferenceRoomsApi find_conference_rooms get /conferencerooms Find multiple objects
ConferenceRoomsApi get_conference_room get /conferencerooms/{id} Get object by id
ConferenceRoomsApi patch_conference_room patch /conferencerooms/{id} Patch object's data
ConferenceRoomsApi remove_conference_room delete /conferencerooms/{id} Delete object by id
ContactsApi create_contact post /contacts Create a new object
ContactsApi find_contacts get /contacts Find multiple objects
ContactsApi get_contact get /contacts/{id} Get object by id
ContactsApi patch_contact patch /contacts/{id} Patch object's data
ContactsApi remove_contact delete /contacts/{id} Delete object by id
ConversationMessagesApi create_conversation_message post /conversationmessages Create a new object
ConversationMessagesApi find_conversation_messages get /conversationmessages Find multiple objects
ConversationMessagesApi get_conversation_message get /conversationmessages/{id} Get object by id
ConversationMessagesApi patch_conversation_message patch /conversationmessages/{id} Patch object's data
ConversationMessagesApi remove_conversation_message delete /conversationmessages/{id} Delete object by id
ConversationsApi create_conversation post /conversations Create a new object
ConversationsApi find_conversations get /conversations Find multiple objects
ConversationsApi get_conversation get /conversations/{id} Get object by id
ConversationsApi patch_conversation patch /conversations/{id} Patch object's data
ConversationsApi remove_conversation delete /conversations/{id} Delete object by id
CustomersApi create_customer post /customers Create a new object
CustomersApi find_customers get /customers Find multiple objects
CustomersApi get_customer get /customers/{id} Get object by id
CustomersApi patch_customer patch /customers/{id} Patch object's data
CustomersApi remove_customer delete /customers/{id} Delete object by id
DNSRecordsApi find_dns_records get /dnsrecords Find multiple objects
DeveloperAppSubscriptionsApi create_developer_app_subscription post /developerappsubscriptions Create a new object
DeveloperAppSubscriptionsApi find_developer_app_subscriptions get /developerappsubscriptions Find multiple objects
DeveloperAppSubscriptionsApi get_developer_app_subscription get /developerappsubscriptions/{id} Get object by id
DeveloperAppSubscriptionsApi patch_developer_app_subscription patch /developerappsubscriptions/{id} Patch object's data
DeveloperAppSubscriptionsApi remove_developer_app_subscription delete /developerappsubscriptions/{id} Delete object by id
DeveloperAppsApi create_developer_app post /developerapps Create a new object
DeveloperAppsApi find_developer_apps get /developerapps Find multiple objects
DeveloperAppsApi get_developer_app get /developerapps/{id} Get object by id
DeveloperAppsApi patch_developer_app patch /developerapps/{id} Patch object's data
DeveloperAppsApi remove_developer_app delete /developerapps/{id} Delete object by id
DirectoriesApi createdirectory post /directories Create a new object
DirectoriesApi find_directories get /directories Find multiple objects
DirectoriesApi getdirectory get /directories/{id} Get object by id
DirectoriesApi patchdirectory patch /directories/{id} Patch object's data
DirectoriesApi removedirectory delete /directories/{id} Delete object by id
DomainsApi create_domain post /domains Create a new object
DomainsApi find_domains get /domains Find multiple objects
DomainsApi get_domain get /domains/{id} Get object by id
DomainsApi patch_domain patch /domains/{id} Patch object's data
DomainsApi remove_domain delete /domains/{id} Delete object by id
FaxAccountsApi create_fax_account post /faxaccounts Create a new object
FaxAccountsApi find_fax_accounts get /faxaccounts Find multiple objects
FaxAccountsApi get_fax_account get /faxaccounts/{id} Get object by id
FaxAccountsApi patch_fax_account patch /faxaccounts/{id} Patch object's data
FaxAccountsApi remove_fax_account delete /faxaccounts/{id} Delete object by id
FaxesApi create_fax post /faxes Create a new object
FaxesApi find_faxes get /faxes Find multiple objects
FaxesApi get_fax get /faxes/{id} Get object by id
FaxesApi remove_fax delete /faxes/{id} Delete object by id
FindNumbersApi find_find_numbers get /findnumbers Find multiple objects
FirewallApi create_firewall post /firewall Create a new object
FirewallApi find_firewall get /firewall Find multiple objects
FirewallApi get_firewall get /firewall/{id} Get object by id
FirewallApi patch_firewall patch /firewall/{id} Patch object's data
FirewallApi remove_firewall delete /firewall/{id} Delete object by id
GroupMembersApi create_group_member post /groupmembers Create a new object
GroupMembersApi find_group_members get /groupmembers Find multiple objects
GroupMembersApi get_group_member get /groupmembers/{id} Get object by id
GroupMembersApi patch_group_member patch /groupmembers/{id} Patch object's data
GroupMembersApi remove_group_member delete /groupmembers/{id} Delete object by id
GroupsApi create_group post /groups Create a new object
GroupsApi find_groups get /groups Find multiple objects
GroupsApi get_group get /groups/{id} Get object by id
GroupsApi patch_group patch /groups/{id} Patch object's data
GroupsApi remove_group delete /groups/{id} Delete object by id
HolidaysApi create_holiday post /holidays Create a new object
HolidaysApi find_holidays get /holidays Find multiple objects
HolidaysApi get_holiday get /holidays/{id} Get object by id
HolidaysApi patch_holiday patch /holidays/{id} Patch object's data
HolidaysApi remove_holiday delete /holidays/{id} Delete object by id
InfoApi get_info get /info Get object
InvoiceItemsApi find_invoice_items get /invoiceitems Find multiple objects
InvoiceItemsApi get_invoice_item get /invoiceitems/{id} Get object by id
InvoicesApi find_invoices get /invoices Find multiple objects
InvoicesApi get_invoice get /invoices/{id} Get object by id
LicensesApi create_license post /licenses Create a new object
LicensesApi find_licenses get /licenses Find multiple objects
LicensesApi get_license get /licenses/{id} Get object by id
LicensesApi patch_license patch /licenses/{id} Patch object's data
LicensesApi remove_license delete /licenses/{id} Delete object by id
MenuOptionsApi create_menu_option post /menuoptions Create a new object
MenuOptionsApi find_menu_options get /menuoptions Find multiple objects
MenuOptionsApi get_menu_option get /menuoptions/{id} Get object by id
MenuOptionsApi patch_menu_option patch /menuoptions/{id} Patch object's data
MenuOptionsApi remove_menu_option delete /menuoptions/{id} Delete object by id
MenusApi create_menu post /menus Create a new object
MenusApi find_menus get /menus Find multiple objects
MenusApi get_menu get /menus/{id} Get object by id
MenusApi patch_menu patch /menus/{id} Patch object's data
MenusApi remove_menu delete /menus/{id} Delete object by id
MessageBrandsApi create_message_brand post /messagebrands Create a new object
MessageBrandsApi find_message_brands get /messagebrands Find multiple objects
MessageBrandsApi get_message_brand get /messagebrands/{id} Get object by id
MessageCampaignsApi create_message_campaign post /messagecampaigns Create a new object
MessageCampaignsApi find_message_campaigns get /messagecampaigns Find multiple objects
MessageCampaignsApi get_message_campaign get /messagecampaigns/{id} Get object by id
MessageCampaignsApi patch_message_campaign patch /messagecampaigns/{id} Patch object's data
MessageCampaignsApi remove_message_campaign delete /messagecampaigns/{id} Delete object by id
NumberPortsApi create_number_port post /numberports Create a new object
NumberPortsApi find_number_ports get /numberports Find multiple objects
NumberPortsApi get_number_port get /numberports/{id} Get object by id
NumbersApi find_numbers get /numbers Find multiple objects
NumbersApi get_number get /numbers/{id} Get object by id
NumbersApi patch_number patch /numbers/{id} Patch object's data
OfficesApi create_office post /offices Create a new object
OfficesApi find_offices get /offices Find multiple objects
OfficesApi get_office get /offices/{id} Get object by id
OfficesApi patch_office patch /offices/{id} Patch object's data
OfficesApi remove_office delete /offices/{id} Delete object by id
PhoneInboundRuleActionsApi create_phone_inbound_rule_action post /phoneinboundruleactions Create a new object
PhoneInboundRuleActionsApi find_phone_inbound_rule_actions get /phoneinboundruleactions Find multiple objects
PhoneInboundRuleActionsApi get_phone_inbound_rule_action get /phoneinboundruleactions/{id} Get object by id
PhoneInboundRuleActionsApi patch_phone_inbound_rule_action patch /phoneinboundruleactions/{id} Patch object's data
PhoneInboundRuleActionsApi remove_phone_inbound_rule_action delete /phoneinboundruleactions/{id} Delete object by id
PhoneInboundRulesApi create_phone_inbound_rule post /phoneinboundrules Create a new object
PhoneInboundRulesApi find_phone_inbound_rules get /phoneinboundrules Find multiple objects
PhoneInboundRulesApi get_phone_inbound_rule get /phoneinboundrules/{id} Get object by id
PhoneInboundRulesApi patch_phone_inbound_rule patch /phoneinboundrules/{id} Patch object's data
PhoneInboundRulesApi remove_phone_inbound_rule delete /phoneinboundrules/{id} Delete object by id
PhoneOutboundRuleActionsApi create_phone_outbound_rule_action post /phoneoutboundruleactions Create a new object
PhoneOutboundRuleActionsApi find_phone_outbound_rule_actions get /phoneoutboundruleactions Find multiple objects
PhoneOutboundRuleActionsApi get_phone_outbound_rule_action get /phoneoutboundruleactions/{id} Get object by id
PhoneOutboundRuleActionsApi patch_phone_outbound_rule_action patch /phoneoutboundruleactions/{id} Patch object's data
PhoneOutboundRuleActionsApi remove_phone_outbound_rule_action delete /phoneoutboundruleactions/{id} Delete object by id
PhoneOutboundRulesApi create_phone_outbound_rule post /phoneoutboundrules Create a new object
PhoneOutboundRulesApi find_phone_outbound_rules get /phoneoutboundrules Find multiple objects
PhoneOutboundRulesApi get_phone_outbound_rule get /phoneoutboundrules/{id} Get object by id
PhoneOutboundRulesApi patch_phone_outbound_rule patch /phoneoutboundrules/{id} Patch object's data
PhoneOutboundRulesApi remove_phone_outbound_rule delete /phoneoutboundrules/{id} Delete object by id
RateCentersApi find_rate_centers get /ratecenters Find multiple objects
RateCentersApi get_rate_center get /ratecenters/{id} Get object by id
ServersApi create_server post /servers Create a new object
ServersApi find_servers get /servers Find multiple objects
ServersApi get_server get /servers/{id} Get object by id
ServersApi patch_server patch /servers/{id} Patch object's data
ServersApi remove_server delete /servers/{id} Delete object by id
TimeSchedulesApi create_time_schedule post /timeschedules Create a new object
TimeSchedulesApi find_time_schedules get /timeschedules Find multiple objects
TimeSchedulesApi get_time_schedule get /timeschedules/{id} Get object by id
TimeSchedulesApi patch_time_schedule patch /timeschedules/{id} Patch object's data
TimeSchedulesApi remove_time_schedule delete /timeschedules/{id} Delete object by id
UserTokensApi create_user_token post /usertokens Create a new object
UserTokensApi find_user_tokens get /usertokens Find multiple objects
UserTokensApi get_user_token get /usertokens/{id} Get object by id
UserTokensApi patch_user_token patch /usertokens/{id} Patch object's data
UserTokensApi remove_user_token delete /usertokens/{id} Delete object by id
UsersApi create_user post /users Create a new object
UsersApi find_users get /users Find multiple objects
UsersApi get_user get /users/{id} Get object by id
UsersApi patch_user patch /users/{id} Patch object's data
UsersApi remove_user delete /users/{id} Delete object by id
VirtualExtensionsApi create_virtual_extension post /virtualextensions Create a new object
VirtualExtensionsApi find_virtual_extensions get /virtualextensions Find multiple objects
VirtualExtensionsApi get_virtual_extension get /virtualextensions/{id} Get object by id
VirtualExtensionsApi patch_virtual_extension patch /virtualextensions/{id} Patch object's data
VirtualExtensionsApi remove_virtual_extension delete /virtualextensions/{id} Delete object by id
VoicemailApi find_voicemail get /voicemail Find multiple objects
VoicemailApi get_voicemail get /voicemail/{id} Get object by id

Documentation For Models

Documentation For Authorization

Authentication schemes defined for the API:

jwt

  • Type: API key
  • API key parameter name: Authorization
  • Location: HTTP header

Notes for Large OpenAPI documents

If the OpenAPI document is large, imports in circuitid_python.apis and circuitid_python.models may fail with a RecursionError indicating the maximum recursion limit has been exceeded. In that case, there are a couple of solutions:

Solution 1: Use specific imports for apis and models like:

  • from circuitid_python.api.default_api import DefaultApi
  • from circuitid_python.models.pet import Pet

Solution 1: Before importing the package, adjust the maximum recursion limit as shown below:

import sys
sys.setrecursionlimit(1500)
import circuitid_python
from circuitid_python.apis import *
from circuitid_python.models import *

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages