def create_bulk_objects(self, table_list): swagger_types = {'table_metadata': 'list[TableMetadata]'} swagger_map = {'table_metadata': 'tableMetadata'} obj = GenericModel({x: None for x in self.swagger_map.values()}, swagger_types, swagger_map) obj.table_metadata = table_list return obj
def DxUserNonAdmin(role_id, environment_ids): swagger_map = {'role_id': 'roleId', 'environment_ids': 'environmentIds'} swagger_types = {'role_id': 'int', 'environment_ids': 'list'} obj = GenericModel({x: None for x in swagger_map.values()}, swagger_types, swagger_map) obj.role_id = role_id obj.environment_ids = environment_ids return obj
def DxMaskingScriptJob(name, contents): swagger_types = {'name': 'str', 'contents': 'str'} swagger_map = {'name': 'name', 'contents': 'contents'} obj = GenericModel({x: None for x in swagger_map.values()}, swagger_types, swagger_map) obj.name = name obj.contents = contents return obj
def DxDatabaseMaskingOptions(): swagger_types = { 'batch_update': 'bool', 'commit_size': 'int', 'disable_constraints': 'bool', 'drop_indexes': 'bool', 'disable_triggers': 'bool', 'num_output_threads_per_stream': 'int', 'truncate_tables': 'bool', 'prescript': 'dict', 'postscript': 'dict' } swagger_map = { 'batch_update': 'batchUpdate', 'commit_size': 'commitSize', 'disable_constraints': 'disableConstraints', 'drop_indexes': 'dropIndexes', 'disable_triggers': 'disableTriggers', 'num_output_threads_per_stream': 'numOutputThreadsPerStream', 'truncate_tables': 'truncateTables', 'prescript': 'prescript', 'postscript': 'postscript' } return GenericModel({x: None for x in swagger_map.values()}, swagger_types, swagger_map)
def __init__(self): """ Constructor :param engine: DxMaskingEngine object """ self.__obj = GenericModel({x: None for x in self.swagger_map.values()}, self.swagger_types, self.swagger_map)
def create_application(self, application_name): """ Copy properties from application object into DxApplication :param app: Application object """ self.__obj = GenericModel({x: None for x in self.swagger_map.values()}, self.swagger_types, self.swagger_map) self.application_name = application_name
def create_profile(self, profile_set_name, profile_expression_ids, created_by, description): self.__obj = GenericModel({x: None for x in self.swagger_map.values()}, self.swagger_types, self.swagger_map) self.obj.profile_set_name = profile_set_name self.obj.profile_expression_ids = profile_expression_ids self.obj.created_by = created_by self.obj.description = description
def create_profile_expression(self, domain_name, expression_name, regular_expression, data_level_profiling): self.__obj = GenericModel({x: None for x in self.swagger_map.values()}, self.swagger_types, self.swagger_map) self.obj.domain_name = domain_name self.obj.expression_name = expression_name self.obj.regular_expression = regular_expression self.obj.data_level_profiling = data_level_profiling
def create_job(self, job_name, ruleset_id): """ Create an connector object :param connector_name :param database_type :param environment_id """ self.__obj = GenericModel({ x:None for x in self.swagger_map.values()}, self.swagger_types, self.swagger_map) self.obj.job_name = job_name self.obj.ruleset_id = ruleset_id
def create_fileformat(self, file_format_name, file_format_type): """ Create an connector object :param connector_name :param database_type :param environment_id """ self.__obj = GenericModel({ x:None for x in self.swagger_map.values()}, self.swagger_types, self.swagger_map) self.obj.file_format_name = file_format_name self.obj.file_format_type = file_format_type
def create_driver(self, driver_name, driver_class_name, file_reference_id): """ Create an JDBC driver object """ self.__obj = GenericModel({x: None for x in self.swagger_map.values()}, self.swagger_types, self.swagger_map) self.obj.driver_name = driver_name self.obj.driver_class_name = driver_class_name self.obj.file_reference_id = file_reference_id
def DxOnTheFlyJob(): swagger_types = {'connector_id': 'int', 'connector_type': 'str'} swagger_map = { 'connector_id': 'connectorId', 'connector_type': 'connectorType' } return GenericModel({x: None for x in swagger_map.values()}, swagger_types, swagger_map)
def create_connector(self, connector_name, database_type, environment_id): """ Create an connector object :param connector_name :param database_type :param environment_id """ self.__obj = GenericModel({x: None for x in self.swagger_map.values()}, self.swagger_types, self.swagger_map) self.connector_name = connector_name self.database_type = database_type self.environment_id = environment_id
def create_database_ruleset(self, ruleset_name, database_connector_id, refresh_drops_tables): """ Create an connector object :param connector_name :param database_type :param environment_id """ self.__obj = GenericModel({x: None for x in self.swagger_map.values()}, self.swagger_types, self.swagger_map) self.obj.ruleset_name = ruleset_name self.obj.database_connector_id = database_connector_id self.obj.refresh_drops_tables = refresh_drops_tables
def create_user(self, user_name, password, first_name, last_name, email, is_admin, non_admin_properties): # self.__obj = self.__model(user_name=user_name, password=password, first_name=first_name, last_name=last_name, # email=email, is_admin=is_admin, non_admin_properties=non_admin_properties, is_locked=False) self.__obj = GenericModel({x: None for x in self.swagger_map.values()}, self.swagger_types, self.swagger_map) self.user_name = user_name self.password = password self.first_name = first_name self.last_name = last_name self.email = email self.is_admin = is_admin self.is_locked = False self.non_admin_properties = non_admin_properties
def __deserialize_model(self, data, klass): """Deserializes list or dict to model. :param data: dict, list. :param klass: class literal. :return: object based on REST response to support different versions """ if isinstance(data, self.PRIMITIVE_TYPES): return data elif klass == datetime.date: return self.__deserialize_date(data) elif klass == datetime.datetime: return self.__deserialize_datatime(data) else: return GenericModel(data)
def create_table(self, table_name, ruleset_id, custom_sql, where_clause, having_clause, key_column): """ Create an connector object :param connector_name :param database_type :param environment_id """ self.__obj = GenericModel({x: None for x in self.swagger_map.values()}, self.swagger_types, self.swagger_map) self.obj.table_name = table_name self.obj.ruleset_id = ruleset_id self.obj.custom_sql = custom_sql self.obj.where_clause = where_clause self.obj.having_clause = having_clause self.obj.key_column = key_column
def create_environment(self, environment_name, application_name, purpose): """ Create an environment object :param app: Application object """ self.__obj = GenericModel({ x:None for x in self.swagger_map.values()}, self.swagger_types, self.swagger_map) if self.__engine.version_ge("6.0.0.0"): appList = DxApplicationList() appList.LoadApplications() application_id = appList.get_applicationId_by_name(application_name) self.environment_name=environment_name self.purpose=purpose self.application_id = application_id[0] else: self.environment_name=environment_name self.purpose=purpose self.application_name = application_name
def create_connector(self, connector_name, file_type, environment_id, host, port, login_name, password, path, connection_mode): """ Create an connector object :param connector_name :param database_type :param environment_id """ ci = DxConnectionInfo() ci.connection_mode = connection_mode ci.path = path ci.host = host ci.login_name = login_name ci.password = password ci.port = port self.__obj = GenericModel({x: None for x in self.swagger_map.values()}, self.swagger_types, self.swagger_map) self.connector_name = connector_name self.file_type = file_type self.environment_id = environment_id self.connection_info = ci
def create_file(self, file_name, ruleset_id, file_format_id, file_type, delimiter, enclosure, end_of_record, name_is_regular_expression): """ Create an connector object :param connector_name :param database_type :param environment_id """ fileformatList = DxFileFormatList() fileformat_id = fileformatList.get_file_format_id_by_name( file_format_id) eor_string = None if end_of_record is None: eor_string = None else: if end_of_record == 'linux': eor_string = '\n' elif end_of_record == 'windows': eor_string = '\r\n' elif len(end_of_record) > 0: eor_string = end_of_record self.__obj = GenericModel({x: None for x in self.swagger_map.values()}, self.swagger_types, self.swagger_map) self.obj.file_name = file_name self.obj.ruleset_id = ruleset_id self.obj.file_format_id = fileformat_id self.obj.file_type = file_type self.obj.delimiter = delimiter self.obj.enclosure = enclosure self.obj.end_of_record = eor_string self.obj.name_is_regular_expression = name_is_regular_expression
def create_domain(self, domain_name, domain_classification, default_algorithm_code): self.__obj = GenericModel({ x:None for x in self.swagger_map.values()}, self.swagger_types, self.swagger_map) self.obj.domain_name = domain_name self.obj.domain_classification = domain_classification self.obj.default_algorithm_code = default_algorithm_code
def __init__(self): self.__obj = GenericModel({x: None for x in self.swagger_map.values()}, self.swagger_types, self.swagger_map)