# Path: pydomo/datasets/DataSetModel.py
# class Column(DomoObject):
#     accepted_attrs = [
#         'type',
#         'name'
#     ]
# 
#     def __init__(self, column_type, name):
#         super().__init__()
#         self.type = column_type
#         self.name = name
# 
# class ColumnType:
#     STRING = 'STRING'
#     DECIMAL = 'DECIMAL'
#     LONG = 'LONG'
#     DOUBLE = 'DOUBLE'
#     DATE = 'DATE'
#     DATETIME = 'DATETIME'
# 
# class DataSetRequest(DomoObject):
#     accepted_attrs = [
#         'name',
#         'description',
#         'schema'
#     ]
# 
# class Schema(DomoObject):
#     accepted_attrs = [
#         'columns'
#     ]
#     def __init__(self, columns):
#         self.columns = columns
# 
# Path: pydomo/streams/StreamsModel.py
# class CreateStreamRequest(DomoObject):
#     accepted_attrs = [
#         'dataSet',
#         'updateMethod'
#     ]
#     def __init__(self, data_set_request, update_method):
#         super().__init__()
#         self.dataSet = data_set_request
#         self.updateMethod = update_method
# 
# class UpdateMethod:
#     APPEND = 'APPEND'
#     REPLACE = 'REPLACE'


from pydomo.datasets import DataSetRequest, Schema, Column, ColumnType
from pydomo.streams import UpdateMethod, CreateStreamRequest


def streams(domo):
    '''Streams are useful for uploading massive data sources in
    chunks, in parallel. They are also useful with data sources that
    are constantly changing/growing.
    Streams Docs: https://developer.domo.com/docs/data-apis/data
    '''
    domo.logger.info("\n**** Domo API - Stream Examples ****\n")
    streams = domo.streams

    # Define a DataSet Schema to populate the Stream Request
    dsr = DataSetRequest()
    dsr.name = 'Leonhard Euler Party'
    dsr.description = 'Mathematician Guest List'
    dsr.schema = Schema([Column(ColumnType.STRING, 'Friend'),

# Path: pydomo/datasets/DataSetModel.py
# class Column(DomoObject):
#     accepted_attrs = [
#         'type',
#         'name'
#     ]
# 
#     def __init__(self, column_type, name):
#         super().__init__()
#         self.type = column_type
#         self.name = name
# 
# class ColumnType:
#     STRING = 'STRING'
#     DECIMAL = 'DECIMAL'
#     LONG = 'LONG'
#     DOUBLE = 'DOUBLE'
#     DATE = 'DATE'
#     DATETIME = 'DATETIME'
# 
# class DataSetRequest(DomoObject):
#     accepted_attrs = [
#         'name',
#         'description',
#         'schema'
#     ]
# 
# class Schema(DomoObject):
#     accepted_attrs = [
#         'columns'
#     ]
#     def __init__(self, columns):
#         self.columns = columns
# 
# Path: pydomo/streams/StreamsModel.py
# class CreateStreamRequest(DomoObject):
#     accepted_attrs = [
#         'dataSet',
#         'updateMethod'
#     ]
#     def __init__(self, data_set_request, update_method):
#         super().__init__()
#         self.dataSet = data_set_request
#         self.updateMethod = update_method
# 
# class UpdateMethod:
#     APPEND = 'APPEND'
#     REPLACE = 'REPLACE'


# Path: examples/stream.py
from pydomo.datasets import DataSetRequest, Schema, Column, ColumnType
from pydomo.streams import UpdateMethod, CreateStreamRequest



def streams(domo):
    '''Streams are useful for uploading massive data sources in
    chunks, in parallel. They are also useful with data sources that
    are constantly changing/growing.
    Streams Docs: https://developer.domo.com/docs/data-apis/data
    '''
    domo.logger.info("\n**** Domo API - Stream Examples ****\n")
    streams = domo.streams

    # Define a DataSet Schema to populate the Stream Request
    dsr = DataSetRequest()
    dsr.name = 'Leonhard Euler Party'
    dsr.description = 'Mathematician Guest List'
    dsr.schema = Schema([Column(ColumnType.STRING, 'Friend'),

                         Column(ColumnType.STRING, 'Attending')])