# coding: utf-8

"""
    Agilicus API

    Agilicus API endpoints  # noqa: E501

    The version of the OpenAPI document: 2021.04.01
    Contact: dev@agilicus.com
    Generated by: https://openapi-generator.tech
"""


from __future__ import absolute_import

import unittest
import datetime

import agilicus_api
from agilicus_api.models.create_session_and_token_request import CreateSessionAndTokenRequest  # noqa: E501
from agilicus_api.rest import ApiException

class TestCreateSessionAndTokenRequest(unittest.TestCase):
    """CreateSessionAndTokenRequest unit test stubs"""

    def setUp(self):
        pass

    def tearDown(self):
        pass

    def make_instance(self, include_optional):
        """Test CreateSessionAndTokenRequest
            include_option is a boolean, when False only required
            params are included, when True both required and
            optional params are included """
        # model = agilicus_api.models.create_session_and_token_request.CreateSessionAndTokenRequest()  # noqa: E501
        if include_optional :
            return CreateSessionAndTokenRequest(
                create_token_request = agilicus_api.models.create_token_request.CreateTokenRequest(
                    sub = '123', 
                    org = '123', 
                    roles = {
                        'key' : '0'
                        }, 
                    audiences = [
                        '0'
                        ], 
                    time_validity = agilicus_api.models.time_validity.TimeValidity(
                        duration = 56, ), 
                    hosts = [
                        agilicus_api.models.host_permissions.HostPermissions(
                            upstream_host = '0', 
                            app_id = '123', 
                            admin_org_id = '123', 
                            allowed_list = [
                                agilicus_api.models.rendered_rule.RenderedRule(
                                    methods = [
                                        'get'
                                        ], 
                                    paths = [
                                        '0'
                                        ], 
                                    query_parameters = [
                                        agilicus_api.models.rendered_query_parameter.RenderedQueryParameter(
                                            name = '0', 
                                            exact_match = '0', )
                                        ], 
                                    body = agilicus_api.models.rendered_rule_body.RenderedRuleBody(
                                        json = [
                                            agilicus_api.models.json_body_constraint.JSONBodyConstraint(
                                                name = '0', 
                                                exact_match = '0', 
                                                match_type = 'string', 
                                                pointer = '/foo/0/a~1b/2', )
                                            ], ), )
                                ], )
                        ], 
                    token_validity = agilicus_api.models.token_validity.TokenValidity(
                        start = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), 
                        duration = 56, 
                        end = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), 
                        does_not_expire = False, ), 
                    session = '123', 
                    scopes = [
                        'urn:agilicus:users:owner'
                        ], ), 
                session = agilicus_api.models.session.Session(
                    metadata = {"id":"ac233asaksjfF","created":"2017-07-07T15:49:51.230+00:00","updated":"2020-01-27T12:19:46.430+00:00"}, 
                    spec = agilicus_api.models.sessions_spec.SessionsSpec(
                        user_id = 'asdfghjklmn123', 
                        org_id = 'asdfghjklmn123', 
                        revoked = False, 
                        number_of_logins = 3, 
                        number_of_failed_multi_factor_challenges = 3, ), )
            )
        else :
            return CreateSessionAndTokenRequest(
                create_token_request = agilicus_api.models.create_token_request.CreateTokenRequest(
                    sub = '123', 
                    org = '123', 
                    roles = {
                        'key' : '0'
                        }, 
                    audiences = [
                        '0'
                        ], 
                    time_validity = agilicus_api.models.time_validity.TimeValidity(
                        duration = 56, ), 
                    hosts = [
                        agilicus_api.models.host_permissions.HostPermissions(
                            upstream_host = '0', 
                            app_id = '123', 
                            admin_org_id = '123', 
                            allowed_list = [
                                agilicus_api.models.rendered_rule.RenderedRule(
                                    methods = [
                                        'get'
                                        ], 
                                    paths = [
                                        '0'
                                        ], 
                                    query_parameters = [
                                        agilicus_api.models.rendered_query_parameter.RenderedQueryParameter(
                                            name = '0', 
                                            exact_match = '0', )
                                        ], 
                                    body = agilicus_api.models.rendered_rule_body.RenderedRuleBody(
                                        json = [
                                            agilicus_api.models.json_body_constraint.JSONBodyConstraint(
                                                name = '0', 
                                                exact_match = '0', 
                                                match_type = 'string', 
                                                pointer = '/foo/0/a~1b/2', )
                                            ], ), )
                                ], )
                        ], 
                    token_validity = agilicus_api.models.token_validity.TokenValidity(
                        start = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), 
                        duration = 56, 
                        end = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), 
                        does_not_expire = False, ), 
                    session = '123', 
                    scopes = [
                        'urn:agilicus:users:owner'
                        ], ),
                session = agilicus_api.models.session.Session(
                    metadata = {"id":"ac233asaksjfF","created":"2017-07-07T15:49:51.230+00:00","updated":"2020-01-27T12:19:46.430+00:00"}, 
                    spec = agilicus_api.models.sessions_spec.SessionsSpec(
                        user_id = 'asdfghjklmn123', 
                        org_id = 'asdfghjklmn123', 
                        revoked = False, 
                        number_of_logins = 3, 
                        number_of_failed_multi_factor_challenges = 3, ), ),
        )

    def testCreateSessionAndTokenRequest(self):
        """Test CreateSessionAndTokenRequest"""
        inst_req_only = self.make_instance(include_optional=False)
        inst_req_and_optional = self.make_instance(include_optional=True)


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