1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571
|
# coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from twilio.base import deserialize
from twilio.base import values
from twilio.base.instance_context import InstanceContext
from twilio.base.instance_resource import InstanceResource
from twilio.base.list_resource import ListResource
from twilio.base.page import Page
class ConfigurationList(ListResource):
def __init__(self, version):
"""
Initialize the ConfigurationList
:param Version version: Version that contains the resource
:returns: twilio.rest.flex_api.v1.configuration.ConfigurationList
:rtype: twilio.rest.flex_api.v1.configuration.ConfigurationList
"""
super(ConfigurationList, self).__init__(version)
# Path Solution
self._solution = {}
def get(self):
"""
Constructs a ConfigurationContext
:returns: twilio.rest.flex_api.v1.configuration.ConfigurationContext
:rtype: twilio.rest.flex_api.v1.configuration.ConfigurationContext
"""
return ConfigurationContext(self._version, )
def __call__(self):
"""
Constructs a ConfigurationContext
:returns: twilio.rest.flex_api.v1.configuration.ConfigurationContext
:rtype: twilio.rest.flex_api.v1.configuration.ConfigurationContext
"""
return ConfigurationContext(self._version, )
def __repr__(self):
"""
Provide a friendly representation
:returns: Machine friendly representation
:rtype: str
"""
return '<Twilio.FlexApi.V1.ConfigurationList>'
class ConfigurationPage(Page):
def __init__(self, version, response, solution):
"""
Initialize the ConfigurationPage
:param Version version: Version that contains the resource
:param Response response: Response from the API
:returns: twilio.rest.flex_api.v1.configuration.ConfigurationPage
:rtype: twilio.rest.flex_api.v1.configuration.ConfigurationPage
"""
super(ConfigurationPage, self).__init__(version, response)
# Path Solution
self._solution = solution
def get_instance(self, payload):
"""
Build an instance of ConfigurationInstance
:param dict payload: Payload response from the API
:returns: twilio.rest.flex_api.v1.configuration.ConfigurationInstance
:rtype: twilio.rest.flex_api.v1.configuration.ConfigurationInstance
"""
return ConfigurationInstance(self._version, payload, )
def __repr__(self):
"""
Provide a friendly representation
:returns: Machine friendly representation
:rtype: str
"""
return '<Twilio.FlexApi.V1.ConfigurationPage>'
class ConfigurationContext(InstanceContext):
def __init__(self, version):
"""
Initialize the ConfigurationContext
:param Version version: Version that contains the resource
:returns: twilio.rest.flex_api.v1.configuration.ConfigurationContext
:rtype: twilio.rest.flex_api.v1.configuration.ConfigurationContext
"""
super(ConfigurationContext, self).__init__(version)
# Path Solution
self._solution = {}
self._uri = '/Configuration'.format(**self._solution)
def fetch(self, ui_version=values.unset):
"""
Fetch the ConfigurationInstance
:param unicode ui_version: The Pinned UI version of the Configuration resource to fetch
:returns: The fetched ConfigurationInstance
:rtype: twilio.rest.flex_api.v1.configuration.ConfigurationInstance
"""
data = values.of({'UiVersion': ui_version, })
payload = self._version.fetch(method='GET', uri=self._uri, params=data, )
return ConfigurationInstance(self._version, payload, )
def create(self):
"""
Create the ConfigurationInstance
:returns: The created ConfigurationInstance
:rtype: twilio.rest.flex_api.v1.configuration.ConfigurationInstance
"""
payload = self._version.create(method='POST', uri=self._uri, )
return ConfigurationInstance(self._version, payload, )
def update(self):
"""
Update the ConfigurationInstance
:returns: The updated ConfigurationInstance
:rtype: twilio.rest.flex_api.v1.configuration.ConfigurationInstance
"""
payload = self._version.update(method='POST', uri=self._uri, )
return ConfigurationInstance(self._version, payload, )
def __repr__(self):
"""
Provide a friendly representation
:returns: Machine friendly representation
:rtype: str
"""
context = ' '.join('{}={}'.format(k, v) for k, v in self._solution.items())
return '<Twilio.FlexApi.V1.ConfigurationContext {}>'.format(context)
class ConfigurationInstance(InstanceResource):
class Status(object):
OK = "ok"
INPROGRESS = "inprogress"
NOTSTARTED = "notstarted"
def __init__(self, version, payload):
"""
Initialize the ConfigurationInstance
:returns: twilio.rest.flex_api.v1.configuration.ConfigurationInstance
:rtype: twilio.rest.flex_api.v1.configuration.ConfigurationInstance
"""
super(ConfigurationInstance, self).__init__(version)
# Marshaled Properties
self._properties = {
'account_sid': payload.get('account_sid'),
'date_created': deserialize.iso8601_datetime(payload.get('date_created')),
'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')),
'attributes': payload.get('attributes'),
'status': payload.get('status'),
'taskrouter_workspace_sid': payload.get('taskrouter_workspace_sid'),
'taskrouter_target_workflow_sid': payload.get('taskrouter_target_workflow_sid'),
'taskrouter_target_taskqueue_sid': payload.get('taskrouter_target_taskqueue_sid'),
'taskrouter_taskqueues': payload.get('taskrouter_taskqueues'),
'taskrouter_skills': payload.get('taskrouter_skills'),
'taskrouter_worker_channels': payload.get('taskrouter_worker_channels'),
'taskrouter_worker_attributes': payload.get('taskrouter_worker_attributes'),
'taskrouter_offline_activity_sid': payload.get('taskrouter_offline_activity_sid'),
'runtime_domain': payload.get('runtime_domain'),
'messaging_service_instance_sid': payload.get('messaging_service_instance_sid'),
'chat_service_instance_sid': payload.get('chat_service_instance_sid'),
'flex_service_instance_sid': payload.get('flex_service_instance_sid'),
'ui_language': payload.get('ui_language'),
'ui_attributes': payload.get('ui_attributes'),
'ui_dependencies': payload.get('ui_dependencies'),
'ui_version': payload.get('ui_version'),
'service_version': payload.get('service_version'),
'call_recording_enabled': payload.get('call_recording_enabled'),
'call_recording_webhook_url': payload.get('call_recording_webhook_url'),
'crm_enabled': payload.get('crm_enabled'),
'crm_type': payload.get('crm_type'),
'crm_callback_url': payload.get('crm_callback_url'),
'crm_fallback_url': payload.get('crm_fallback_url'),
'crm_attributes': payload.get('crm_attributes'),
'public_attributes': payload.get('public_attributes'),
'plugin_service_enabled': payload.get('plugin_service_enabled'),
'plugin_service_attributes': payload.get('plugin_service_attributes'),
'integrations': payload.get('integrations'),
'outbound_call_flows': payload.get('outbound_call_flows'),
'serverless_service_sids': payload.get('serverless_service_sids'),
'queue_stats_configuration': payload.get('queue_stats_configuration'),
'url': payload.get('url'),
}
# Context
self._context = None
self._solution = {}
@property
def _proxy(self):
"""
Generate an instance context for the instance, the context is capable of
performing various actions. All instance actions are proxied to the context
:returns: ConfigurationContext for this ConfigurationInstance
:rtype: twilio.rest.flex_api.v1.configuration.ConfigurationContext
"""
if self._context is None:
self._context = ConfigurationContext(self._version, )
return self._context
@property
def account_sid(self):
"""
:returns: The SID of the Account that created the resource
:rtype: unicode
"""
return self._properties['account_sid']
@property
def date_created(self):
"""
:returns: The ISO 8601 date and time in GMT when the Configuration resource was created
:rtype: datetime
"""
return self._properties['date_created']
@property
def date_updated(self):
"""
:returns: The ISO 8601 date and time in GMT when the Configuration resource was last updated
:rtype: datetime
"""
return self._properties['date_updated']
@property
def attributes(self):
"""
:returns: An object that contains application-specific data
:rtype: dict
"""
return self._properties['attributes']
@property
def status(self):
"""
:returns: The status of the Flex onboarding
:rtype: ConfigurationInstance.Status
"""
return self._properties['status']
@property
def taskrouter_workspace_sid(self):
"""
:returns: The SID of the TaskRouter Workspace
:rtype: unicode
"""
return self._properties['taskrouter_workspace_sid']
@property
def taskrouter_target_workflow_sid(self):
"""
:returns: The SID of the TaskRouter target Workflow
:rtype: unicode
"""
return self._properties['taskrouter_target_workflow_sid']
@property
def taskrouter_target_taskqueue_sid(self):
"""
:returns: The SID of the TaskRouter Target TaskQueue
:rtype: unicode
"""
return self._properties['taskrouter_target_taskqueue_sid']
@property
def taskrouter_taskqueues(self):
"""
:returns: The list of TaskRouter TaskQueues
:rtype: list[dict]
"""
return self._properties['taskrouter_taskqueues']
@property
def taskrouter_skills(self):
"""
:returns: The Skill description for TaskRouter workers
:rtype: list[dict]
"""
return self._properties['taskrouter_skills']
@property
def taskrouter_worker_channels(self):
"""
:returns: The TaskRouter default channel capacities and availability for workers
:rtype: dict
"""
return self._properties['taskrouter_worker_channels']
@property
def taskrouter_worker_attributes(self):
"""
:returns: The TaskRouter Worker attributes
:rtype: dict
"""
return self._properties['taskrouter_worker_attributes']
@property
def taskrouter_offline_activity_sid(self):
"""
:returns: The TaskRouter SID of the offline activity
:rtype: unicode
"""
return self._properties['taskrouter_offline_activity_sid']
@property
def runtime_domain(self):
"""
:returns: The URL where the Flex instance is hosted
:rtype: unicode
"""
return self._properties['runtime_domain']
@property
def messaging_service_instance_sid(self):
"""
:returns: The SID of the Messaging service instance
:rtype: unicode
"""
return self._properties['messaging_service_instance_sid']
@property
def chat_service_instance_sid(self):
"""
:returns: The SID of the chat service this user belongs to
:rtype: unicode
"""
return self._properties['chat_service_instance_sid']
@property
def flex_service_instance_sid(self):
"""
:returns: The SID of the Flex service instance
:rtype: unicode
"""
return self._properties['flex_service_instance_sid']
@property
def ui_language(self):
"""
:returns: The primary language of the Flex UI
:rtype: unicode
"""
return self._properties['ui_language']
@property
def ui_attributes(self):
"""
:returns: The object that describes Flex UI characteristics and settings
:rtype: dict
"""
return self._properties['ui_attributes']
@property
def ui_dependencies(self):
"""
:returns: The object that defines the NPM packages and versions to be used in Hosted Flex
:rtype: dict
"""
return self._properties['ui_dependencies']
@property
def ui_version(self):
"""
:returns: The Pinned UI version
:rtype: unicode
"""
return self._properties['ui_version']
@property
def service_version(self):
"""
:returns: The Flex Service version
:rtype: unicode
"""
return self._properties['service_version']
@property
def call_recording_enabled(self):
"""
:returns: Whether call recording is enabled
:rtype: bool
"""
return self._properties['call_recording_enabled']
@property
def call_recording_webhook_url(self):
"""
:returns: The call recording webhook URL
:rtype: unicode
"""
return self._properties['call_recording_webhook_url']
@property
def crm_enabled(self):
"""
:returns: Whether CRM is present for Flex
:rtype: bool
"""
return self._properties['crm_enabled']
@property
def crm_type(self):
"""
:returns: The CRM Type
:rtype: unicode
"""
return self._properties['crm_type']
@property
def crm_callback_url(self):
"""
:returns: The CRM Callback URL
:rtype: unicode
"""
return self._properties['crm_callback_url']
@property
def crm_fallback_url(self):
"""
:returns: The CRM Fallback URL
:rtype: unicode
"""
return self._properties['crm_fallback_url']
@property
def crm_attributes(self):
"""
:returns: An object that contains the CRM attributes
:rtype: dict
"""
return self._properties['crm_attributes']
@property
def public_attributes(self):
"""
:returns: The list of public attributes
:rtype: dict
"""
return self._properties['public_attributes']
@property
def plugin_service_enabled(self):
"""
:returns: Whether the plugin service enabled
:rtype: bool
"""
return self._properties['plugin_service_enabled']
@property
def plugin_service_attributes(self):
"""
:returns: The plugin service attributes
:rtype: dict
"""
return self._properties['plugin_service_attributes']
@property
def integrations(self):
"""
:returns: A list of objects that contain the configurations for the Integrations supported in this configuration
:rtype: list[dict]
"""
return self._properties['integrations']
@property
def outbound_call_flows(self):
"""
:returns: The list of outbound call flows
:rtype: dict
"""
return self._properties['outbound_call_flows']
@property
def serverless_service_sids(self):
"""
:returns: The list of serverless service SIDs
:rtype: list[unicode]
"""
return self._properties['serverless_service_sids']
@property
def queue_stats_configuration(self):
"""
:returns: Configurable parameters for Queues Statistics
:rtype: dict
"""
return self._properties['queue_stats_configuration']
@property
def url(self):
"""
:returns: The absolute URL of the Configuration resource
:rtype: unicode
"""
return self._properties['url']
def fetch(self, ui_version=values.unset):
"""
Fetch the ConfigurationInstance
:param unicode ui_version: The Pinned UI version of the Configuration resource to fetch
:returns: The fetched ConfigurationInstance
:rtype: twilio.rest.flex_api.v1.configuration.ConfigurationInstance
"""
return self._proxy.fetch(ui_version=ui_version, )
def create(self):
"""
Create the ConfigurationInstance
:returns: The created ConfigurationInstance
:rtype: twilio.rest.flex_api.v1.configuration.ConfigurationInstance
"""
return self._proxy.create()
def update(self):
"""
Update the ConfigurationInstance
:returns: The updated ConfigurationInstance
:rtype: twilio.rest.flex_api.v1.configuration.ConfigurationInstance
"""
return self._proxy.update()
def __repr__(self):
"""
Provide a friendly representation
:returns: Machine friendly representation
:rtype: str
"""
context = ' '.join('{}={}'.format(k, v) for k, v in self._solution.items())
return '<Twilio.FlexApi.V1.ConfigurationInstance {}>'.format(context)
|