# coding: utf-8

# flake8: noqa

"""
    EmbedOps API

    No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)  # noqa: E501

    OpenAPI spec version: 1.0.0
    Contact: support@embedops.com
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

from __future__ import absolute_import

# import apis into sdk package
from embedops_cli.api.api.default_api import DefaultApi

# import ApiClient
from embedops_cli.api.api_client import ApiClient
from embedops_cli.api.configuration import Configuration

# import models into sdk package
from embedops_cli.api.models.aws_access_key import AwsAccessKey
from embedops_cli.api.models.aws_access_key_access_key import AwsAccessKeyAccessKey
from embedops_cli.api.models.branch_names import BranchNames
from embedops_cli.api.models.ci_provider import CIProvider
from embedops_cli.api.models.ci_run import CIRun
from embedops_cli.api.models.ci_run_artifact import CIRunArtifact
from embedops_cli.api.models.ci_run_artifact_create_props import (
    CIRunArtifactCreateProps,
)
from embedops_cli.api.models.ci_run_create_props import CIRunCreateProps
from embedops_cli.api.models.ci_run_update_props import CIRunUpdateProps
from embedops_cli.api.models.ci_o_auth_token_update_props import CiOAuthTokenUpdateProps
from embedops_cli.api.models.ci_o_auth_tokens import CiOAuthTokens
from embedops_cli.api.models.ci_run_id_artifacts_body import CiRunIdArtifactsBody
from embedops_cli.api.models.created_at import CreatedAt
from embedops_cli.api.models.gitlab_access_token import GitlabAccessToken
from embedops_cli.api.models.gitlab_access_token_token import GitlabAccessTokenToken
from embedops_cli.api.models.group import Group
from embedops_cli.api.models.group_create_props import GroupCreateProps
from embedops_cli.api.models.group_update_props import GroupUpdateProps
from embedops_cli.api.models.inline_response400 import InlineResponse400
from embedops_cli.api.models.inline_response404 import InlineResponse404
from embedops_cli.api.models.job_def import JobDef
from embedops_cli.api.models.job_def_create_props import JobDefCreateProps
from embedops_cli.api.models.job_def_update_props import JobDefUpdateProps
from embedops_cli.api.models.job_template import JobTemplate
from embedops_cli.api.models.job_template_update_props import JobTemplateUpdateProps
from embedops_cli.api.models.metric import Metric
from embedops_cli.api.models.metric_create_props import MetricCreateProps
from embedops_cli.api.models.metric_result import MetricResult
from embedops_cli.api.models.metric_result_ci_run import MetricResultCiRun
from embedops_cli.api.models.metric_result_ci_run_repo import MetricResultCiRunRepo
from embedops_cli.api.models.metric_result_ci_run_repo_project import (
    MetricResultCiRunRepoProject,
)
from embedops_cli.api.models.metric_result_ci_run_repo_project_org import (
    MetricResultCiRunRepoProjectOrg,
)
from embedops_cli.api.models.myself_clitelemetry_body import MyselfClitelemetryBody
from embedops_cli.api.models.org import Org
from embedops_cli.api.models.org_create_props import OrgCreateProps
from embedops_cli.api.models.org_update_props import OrgUpdateProps
from embedops_cli.api.models.project import Project
from embedops_cli.api.models.project_create_props import ProjectCreateProps
from embedops_cli.api.models.project_group_create_props import ProjectGroupCreateProps
from embedops_cli.api.models.project_group_update_props import ProjectGroupUpdateProps
from embedops_cli.api.models.project_update_props import ProjectUpdateProps
from embedops_cli.api.models.repo import Repo
from embedops_cli.api.models.repo_api_key import RepoApiKey
from embedops_cli.api.models.repo_create_props import RepoCreateProps
from embedops_cli.api.models.repo_pipeline_config import RepoPipelineConfig
from embedops_cli.api.models.repo_pipeline_config_create_props import (
    RepoPipelineConfigCreateProps,
)
from embedops_cli.api.models.repo_pipeline_config_update_props import (
    RepoPipelineConfigUpdateProps,
)
from embedops_cli.api.models.repo_pipeline_config_update_props_jobs import (
    RepoPipelineConfigUpdatePropsJobs,
)
from embedops_cli.api.models.repo_update_props import RepoUpdateProps
from embedops_cli.api.models.user import User
from embedops_cli.api.models.user_group_invite_props import UserGroupInviteProps
from embedops_cli.api.models.user_group_props import UserGroupProps
from embedops_cli.api.models.user_group_props_group import UserGroupPropsGroup
from embedops_cli.api.models.user_group_update_props import UserGroupUpdateProps
from embedops_cli.api.models.user_update_props import UserUpdateProps
from embedops_cli.config import settings


def get_client():
    api_host = settings.get("host")
    api_key = settings.get("api_repo_key", None)

    configuration = Configuration()
    configuration.api_key["X-API-Key"] = api_key
    configuration.host = f"{api_host}/api/v1"
    api_client = ApiClient(configuration=configuration)

    return DefaultApi(api_client=api_client)
