# coding: utf-8

"""
    BSUB.IO API

    REST API for batch processing compute-intensive workloads.  Submit jobs, upload data, and retrieve results through a simple API. Perfect for PDF processing, video transcoding, audio transcription, and more.  ## Authentication  All endpoints require Bearer token authentication using your API key:  ``` Authorization: Bearer <your-api-key> ```  Get your API key from the [Dashboard](/).  ## Job Lifecycle  1. **Create** a job with `POST /v1/jobs` - Returns job ID and upload token 2. **Upload** data with `POST /v1/upload/{jobId}` - Uses upload token 3. **Submit** for processing with `POST /v1/jobs/{jobId}/submit` 4. **Monitor** status with `GET /v1/jobs/{jobId}` 5. **Retrieve** output with `GET /v1/jobs/{jobId}/output`  ## Job States  - `created` - Job created, awaiting data upload - `loaded` - Data uploaded successfully - `pending` - Waiting in queue for a worker - `claimed` - Worker claimed the job - `preparing` - Worker preparing to process - `processing` - Processing started - `finished` - Processing completed successfully - `failed` - Processing failed with error 

    The version of the OpenAPI document: 1.0.0
    Generated by OpenAPI Generator (https://openapi-generator.tech)

    Do not edit the class manually.
"""  # noqa: E501


import json

from bsubio.models.create_job_request import CreateJobRequest


def test_create_job_request_round_trips_to_json() -> None:
    request = CreateJobRequest(type="passthru")

    serialized = request.to_json()
    parsed = CreateJobRequest.from_json(serialized)

    assert parsed is not None
    assert parsed.type == "passthru"
    assert json.loads(serialized) == {"type": "passthru"}


def test_create_job_request_dict_excludes_none() -> None:
    request = CreateJobRequest(type="passthru")
    assert request.to_dict() == {"type": "passthru"}
