Requires any of the roles: | SystemAdministrator, Manager, Customer |
GET | /flows/parameters |
---|
import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum
class ValueTypes(str, Enum):
NOT_SPECIFIED = 'NotSpecified'
STRING = 'String'
BOOLEAN = 'Boolean'
NUMBER = 'Number'
LIST = 'List'
STRUCT = 'Struct'
TRANSITION = 'Transition'
CUSTOM = 'Custom'
DATE = 'Date'
AUDIO_FILE = 'AudioFile'
TIME_ZONE_ID = 'TimeZoneId'
PHONE_NUMBER = 'PhoneNumber'
USER = 'User'
ENDPOINT = 'Endpoint'
TIME = 'Time'
FILE = 'File'
FAX_NUMBER = 'FaxNumber'
EMAIL_ACCOUNT = 'EmailAccount'
CUSTOMER = 'Customer'
FLOW = 'Flow'
TEAM = 'Team'
FLOW_REFERENCE = 'FlowReference'
INTEGRATION = 'Integration'
ASSISTANT = 'Assistant'
class UIHints(str, Enum):
NONE = 'None'
LARGE_TEXT = 'LargeText'
INLINE_FORM = 'InlineForm'
PASSWORD = 'Password'
INLINE_STRUCT = 'InlineStruct'
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class DataType:
type_name: Optional[str] = None
fields: Optional[List[DataField]] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class Struct(Dict[str,Value]):
pass
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class Value:
bool_value: Optional[bool] = None
string_value: Optional[str] = None
number_value: Optional[float] = None
list_value: Optional[List[Struct]] = None
struct_value: Optional[Struct] = None
class DataFieldUniqueness(str, Enum):
NOT_UNIQUE = 'NotUnique'
UNIQUE = 'Unique'
UNIQUE_TO_CUSTOMER = 'UniqueToCustomer'
class UserDataFieldModes(str, Enum):
HIDDEN = 'Hidden'
READ_ONLY = 'ReadOnly'
READ_WRITE = 'ReadWrite'
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class DataField:
id: Optional[str] = None
name: Optional[str] = None
type: Optional[ValueTypes] = None
ui_hint: Optional[UIHints] = None
ui_tab: Optional[str] = None
is_async: bool = False
disable_binding: bool = False
struct_type: Optional[DataType] = None
list_type: Optional[DataType] = None
description: Optional[str] = None
possible_values: Optional[List[str]] = None
is_output: bool = False
custom_field_values_url: Optional[str] = None
default_value: Optional[Value] = None
transition_name_format: Optional[str] = None
uniqueness: Optional[DataFieldUniqueness] = None
voice_only: bool = False
conditional_visibility_field: Optional[str] = None
conditional_visibility_value: Optional[str] = None
no_eval_template: bool = False
user_mode: Optional[UserDataFieldModes] = None
any_value_type: bool = False
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GetParameterField:
field_name: Optional[str] = None
value_type: Optional[ValueTypes] = None
field: Optional[DataField] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GetParameterFieldNamesResponse:
customer: Optional[List[GetParameterField]] = None
system: Optional[List[GetParameterField]] = None
session: Optional[List[GetParameterField]] = None
endpoint: Optional[List[GetParameterField]] = None
user: Optional[List[GetParameterField]] = None
# @Api(Description="Gets the possible field names for a specified value source")
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GetParameterFieldNames(IGet):
"""
Gets the possible field names for a specified value source
"""
# @ApiMember(Description="The account ID associated with the flow")
account_id: Optional[str] = None
"""
The account ID associated with the flow
"""
# @ApiMember(Description="Exclude built in fields like customer name")
exclude_built_in_fields: bool = False
"""
Exclude built in fields like customer name
"""
Python GetParameterFieldNames DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /flows/parameters HTTP/1.1 Host: team.evovoice.io Accept: text/jsonl
HTTP/1.1 200 OK Content-Type: text/jsonl Content-Length: length {"customer":[{"fieldName":"String","valueType":"NotSpecified"}],"system":[{"fieldName":"String","valueType":"NotSpecified"}],"session":[{"fieldName":"String","valueType":"NotSpecified"}],"endpoint":[{"fieldName":"String","valueType":"NotSpecified"}],"user":[{"fieldName":"String","valueType":"NotSpecified"}]}