import uuid

from pprint import pprint
from datetime import date

from ovation.session import connect_lab

"""
Explanation: Samples and Results
Setup
End of explanation
"""


s = connect_lab(input("Email: "), api='https://lab-services-staging.ovation.io')

"""
Explanation: Connection
s is a Session object representing a connection to the Ovation API
End of explanation
"""


organization_id = input('Organization id: ')

"""
Explanation: Organization id required for all calls.
End of explanation
"""


workflow_id = input('Workflow ID: ')

samples = s.get(s.path('samples'),
                params={'workflow_id': workflow_id, 'organization_id': organization_id})

sample_ids = [s.id for s in samples.samples]

"""
Explanation: Workflow samples
Collect all samples from a Workflow by ID (this would, for example give all samples in a sequencing workflow after batch creation).
End of explanation
"""


for sample_id in sample_ids:
    sample_results = s.get(s.path('workflow_sample_results'),
                            params={'sample_id': sample_id, 'result_type': 'library-dilution'})

sample_results

sample_ids

"""
Explanation: Sample results
Collect all WorkflowSampleResults for samples in the batch of type library-dilution
End of explanation
"""


