# 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
    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')])

    # Build a Stream Request
    stream_request = CreateStreamRequest(dsr, UpdateMethod.APPEND)

    # Create a Stream w/DataSet
    stream = streams.create(stream_request)
    domo.logger.info("Created Stream {} containing the new DataSet {}"
                     .format(stream['id'], stream['dataSet']['id']))

    # Get a Stream's metadata
    retrieved_stream = streams.get(stream['id'])
    domo.logger.info("Retrieved Stream {} containing DataSet {}".format(
                retrieved_stream['id'], retrieved_stream['dataSet']['id']))

    # List Streams
    limit = 1000
    offset = 0
    stream_list = streams.list(limit, offset)
    domo.logger.info("Retrieved a list containing {} Stream(s)".format(
                                                         len(stream_list)))

    # Update a Stream's metadata

# 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

    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')])

    # Build a Stream Request
    stream_request = CreateStreamRequest(dsr, UpdateMethod.APPEND)

    # Create a Stream w/DataSet
    stream = streams.create(stream_request)
    domo.logger.info("Created Stream {} containing the new DataSet {}"
                     .format(stream['id'], stream['dataSet']['id']))

    # Get a Stream's metadata
    retrieved_stream = streams.get(stream['id'])
    domo.logger.info("Retrieved Stream {} containing DataSet {}".format(
                retrieved_stream['id'], retrieved_stream['dataSet']['id']))

    # List Streams
    limit = 1000
    offset = 0
    stream_list = streams.list(limit, offset)
    domo.logger.info("Retrieved a list containing {} Stream(s)".format(
                                                         len(stream_list)))

    # Update a Stream's metadata

    stream_update = CreateStreamRequest(dsr, UpdateMethod.REPLACE)