# coding: utf-8

"""
    Carrier API

    **Seaplane Global Messaging Service**  For information about authentication see [authentication](/docs/authentication)   # noqa: E501

    The version of the OpenAPI document: 1.1.0-beta
    Contact: support@seaplane.io
    Generated by OpenAPI Generator (https://openapi-generator.tech)

    Do not edit the class manually.
"""


import unittest
import datetime

import seaplane.gen.carrier
from seaplane.gen.carrier.models.flow import Flow  # noqa: E501
from seaplane.gen.carrier.rest import ApiException


class TestFlow(unittest.TestCase):
    """Flow unit test stubs"""

    def setUp(self):
        pass

    def tearDown(self):
        pass

    def make_instance(self, include_optional):
        """Test Flow
        include_option is a boolean, when False only required
        params are included, when True both required and
        optional params are included"""
        # uncomment below to create an instance of `Flow`
        """
        model = seaplane.gen.carrier.models.flow.Flow()  # noqa: E501
        if include_optional :
            return Flow(
                input = seaplane.gen.carrier.models.input.Input(
                    carrier = seaplane.gen.carrier.models.carrier_input_config.CarrierInputConfig(
                        stream = 'example-stream', 
                        subject = 'example-stream.subject1 example-stream.subject2', 
                        queue = 'example-queue-group', 
                        durable = 'example-consumer', 
                        bind = False, 
                        deliver = 'all', 
                        ack_wait = '30s', 
                        max_ack_pending = 1024, ), 
                    http_server = seaplane.gen.carrier.models.http_server_config.HTTPServerConfig(
                        address = '', 
                        path = '/', 
                        ws_path = '/post/ws', 
                        ws_welcome_message = '', 
                        ws_rate_limit_message = '', 
                        allowed_verbs = ["POST"], 
                        timeout = '5s', 
                        rate_limit = '', 
                        cert_file = '', 
                        key_file = '', 
                        cors = seaplane.gen.carrier.models.cors.Cors(
                            enabled = False, 
                            allowed_origins = [
                                'example.com'
                                ], ), ), 
                    broker = [
                        seaplane.gen.carrier.models.broker_item.BrokerItem()
                        ], ), 
                processor = None, 
                output = seaplane.gen.carrier.models.output.Output(
                    carrier = seaplane.gen.carrier.models.carrier_output.CarrierOutput(
                        subject = 'foo', 
                        max_in_flight = 1, ), 
                    switch = seaplane.gen.carrier.models.switch.Switch(
                        cases = [
                            {"check":"this.foo < 5","output":{"carrier":{"subject":"foo.not_enough_foo","max_in_flight":1}}}
                            ], ), 
                    sync_response = seaplane.gen.carrier.models.sync_response.SyncResponse(
                        status = '200', 
                        headers = {"Content-Type":"application/octet-stream"}, 
                        metadata_headers = seaplane.gen.carrier.models.metadata_headers.MetadataHeaders(
                            include_prefixes = [
                                'foo_'
                                ], 
                            include_patterns = [
                                '.*'
                                ], ), ), 
                    drop = seaplane.gen.carrier.models.drop.Drop(), 
                    http_client = seaplane.gen.carrier.models.http_client_output.HttpClientOutput(
                        url = 'www.example.com', 
                        method = 'POST', ), 
                    azure_blob_storage = seaplane.gen.carrier.models.azure_blob_storage_output.AzureBlobStorageOutput(
                        storage_account = '', 
                        storage_access_key = '', 
                        storage_sas_token = '', 
                        storage_connection_string = '', 
                        container = 'foo', 
                        path = '${!count("files")}-${!timestamp_unix_nano()}.txt', 
                        blob_type = 'BLOCK', 
                        public_access_level = 'PRIVATE', 
                        max_in_flight = 64, ), 
                    sql_raw = seaplane.gen.carrier.models.sql_raw.SqlRaw(
                        driver = 'postgres', 
                        dsn = 'postgres://foouser:foopass@localhost:5432/foodb?sslmode=disable', 
                        query = 'INSERT INTO footable (foo, bar, baz) VALUES (?, ?, ?);', 
                        args_mapping = 'root = [ this.cat.meow, this.doc.woofs[0] ]', 
                        init_statement = 'CREATE TABLE IF NOT EXISTS some_table (
  foo varchar(50) not null,
  bar integer,
  baz varchar(50),
  primary key (foo)
) WITHOUT ROWID;
', ), ), 
                replicas = 3
            )
        else :
            return Flow(
        )
        """

    def testFlow(self):
        """Test Flow"""
        # inst_req_only = self.make_instance(include_optional=False)
        # inst_req_and_optional = self.make_instance(include_optional=True)


if __name__ == "__main__":
    unittest.main()
