io.trosa/argoj

3.4.5-0.3.5


Data-Oriented, pure Clojure API wrapper for Argo Workflow

dependencies

org.clojure/clojure
1.11.1
clj-http
3.12.3
cheshire
5.11.0
prismatic/schema
1.4.1



(this space intentionally left almost blank)
 
(ns argoj.specs
  (:require [schema.core :refer [defschema Str Bool
                                 Keyword] :as s]))

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Specs %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Kubernetes

(defschema KubeVCTemplate
  {:metadata {:name Str}
   :spec {:accessModes [Str]
          :resources {(s/optional-key :request) {:storage Str}}}})
(defschema KubeVolumeMount
  {:name Str
   :mountPath Str})
(defschema KubeContainerEnv
  {:name Str
   (s/optional-key :value) Str
   (s/optional-key :valueFrom) {:configMapKeyRef {:name Str
                                                  (s/optional-key :value) Str}}})
(defschema KubeContainerResourcesUnit
  {(s/optional-key :memory) Str
   (s/optional-key :cpu) Str})
(defschema KubeContainerResources
  {(s/optional-key :limits)  KubeContainerResourcesUnit
   (s/optional-key :request) KubeContainerResourcesUnit})

Context

Context Schema

(defschema ArgoContext
  {:base-url Str
   :date-format Str
   :datetime-format Str
   :debug Bool
   :auths {Str Str}})

Workflow

(defschema ArgoWorkflowMetadata
  {Keyword Str})
(defschema ArgoWorkflowParameter
  {:name Str
   (s/optional-key :value) Str})
(defschema ArgoWorkflowArguments
  {:parameters [ArgoWorkflowParameter]})
(defschema ArgoWorkflowInput
  {:parameters [ArgoWorkflowParameter]})
(defschema ArgoWorkflowOuput
  {:parameters [ArgoWorkflowParameter]})
(defschema ArgoContainerSpec
  {:name Str
   :image Str
   (s/optional-key :command) [Str]
   (s/optional-key :args) [Str]
   (s/optional-key :resources) KubeContainerResources
   (s/optional-key :volumeMounts) KubeVolumeMount
   (s/optional-key :env) [KubeContainerEnv]})

Workflow Schema

(defschema ArgoWorkflow
  {:namespace Str
   :serverDryRun Bool
   :workflow
   {:metadata {:generateName Str
               :namespace Str
               :labels {Keyword Str}}
    :spec {:templates
           [{:name Str
             (s/optional-key :arguments) ArgoWorkflowArguments
             (s/optional-key :inputs) ArgoWorkflowInput
             (s/optional-key :outputs) ArgoWorkflowOuput
             (s/optional-key :metadata) ArgoWorkflowMetadata
             :container ArgoContainerSpec}]
           :entrypoint Str
           (s/optional-key :arguments) ArgoWorkflowArguments
           (s/optional-key :volumeClaimTemplates) [KubeVCTemplate]}}})

Contracts

(defschema ArgoWorkflowResubmit
  {:memoized Bool
   :name Str
   :namespace Str
   :parameters [Str]})
(defschema ArgoWorkflowLifecycle
  {:name Str
   :namespace Str})
(defschema ArgoWorkflowSetter
  {:message Str
   :name Str
   :namespace Str
   :nodeFieldSelector Str
   :outputParameters Str
   :phase Str})

TODO: Implemenation

(defschema ArgoWorkflowTemplate
  {})

TODO: Implemenation

(defschema ArgoCronjob
  {})
 
(ns argoj.api
  (:require [argo-workflows-api.core :refer [with-api-context]]
            [argo-workflows-api.api.workflow-service :as workflow]
            [argo-workflows-api.api.cluster-workflow-template-service :as wt]
            [argo-workflows-api.api.event-service :as ev]
            [argo-workflows-api.api.event-source-service :as esv]
            [argo-workflows-api.api.cron-workflow-service :as cron]
            [argo-workflows-api.api.info-service :as ai]
            [schema.core :as s]
            [argoj.specs :refer :all]))

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% API %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Helpers

(defn- coerce-ns [ns]
  (if (empty? ns) :all ns))
(defn- mk-query-params
  [m]
  (for [[k v] m] (str (name k) "=" v)))

===============================

Client

(defn mk-client
  [{:keys [token endpoint]}]
  (cond-> {}
    token (assoc :auths {"BearerToken" (str "Bearer " token)})
    endpoint (assoc :base-url endpoint)))

===============================

Workflows

Return a list of all the running workflows and their definitions

(defn list-workflows
  {:added "0.1.0"}
  ([spec] (list-workflows spec (str)))
  ([spec ns]
   (with-api-context spec
     (let [{:keys [items] :as results}
           (workflow/workflow-service-list-workflows ns)]
       (assoc results
              :total (count items)
              :namespace (coerce-ns ns))))))

Search running workflows with labels filters

(defn search-workflows
  {:added "0.3.3"}
  ([spec] (search-workflows spec {}))
  ([spec filters] (search-workflows spec (str) filters))
  ([spec ns filters]
   (with-api-context spec
     (let [{:keys [items] :as results}
           (workflow/workflow-service-list-workflows ns {:list-optionslabel-selector (mk-query-params filters)})]
       (assoc results
              :total (count items)
              :namespace (coerce-ns ns))))))

Return a quick overview of running workflows

(defn workflows-overview
  {:added "0.1.0"}
  ([spec] (workflows-overview spec (str)))
  ([spec ns]
   (let [{:keys [items]} (list-workflows spec ns)]
     {:workflows (->> items
                      (map (fn [{:keys [metadata status]}]
                             (-> (select-keys metadata [:name])
                                 (merge (select-keys status [:startedAt :phase]))))))
      :namespace (coerce-ns ns)
      :total (count items)})))

Create a new workflow.

(defn create-workflow
  {:added "0.1.0"}
  [spec ns workflow-spec]
  (with-api-context spec
    (s/validate ArgoWorkflow workflow-spec)
    (workflow/workflow-service-create-workflow ns workflow-spec)))

Create a new workflow, without spec validation

(defn create-workflow!
  {:added "0.3.5"}
  [spec ns workflow-spec]
  (with-api-context spec
    (workflow/workflow-service-create-workflow ns workflow-spec)))

Delete an existing Workflow

(defn delete-workflow
  {:added "0.1.0"}
  ([spec workflow-name]
   (delete-workflow spec (str) workflow-name))
  ([spec ns workflow-name]
   (with-api-context spec
     (workflow/workflow-service-delete-workflow ns workflow-name)
     {:status :deleted
      :name workflow-name})))

Delete all workflows in current namespace

(defn purge-workflow
  {:added "0.1.0"}
  [spec ns]
  (with-api-context spec
    (when-let [workflow-to-delete (some->> (workflows-overview spec ns)
                                           :workflows
                                           (map :name))]
      (let [total-ack (->> workflow-to-delete
                           (map (fn [wname]
                                  (delete-workflow spec ns wname)))
                           doall)]
        {:total (count total-ack)
         :deleted total-ack}))))

Retrieve an existing Workflow

(defn get-workflow
  {:added "0.1.0"}
  ([spec workflow-name]
   (get-workflow spec (str) workflow-name))
  ([spec ns workflow-name]
   (with-api-context spec
     (let [{:keys [items] :as results}
           (workflow/workflow-service-get-workflow ns workflow-name)]
       (assoc results :total (count items))))))

Lint an existing Workflow

(defn lint-workflow
  {:added "0.1.0"}
  ([spec workflow-spec]
   (lint-workflow spec (str) workflow-spec))
  ([spec ns workflow-spec]
   (with-api-context spec
     (workflow/workflow-service-lint-workflow ns workflow-spec))))

Submit a new workflow from spec

(defn submit-workflow
  {:added "0.1.0"}
  [spec ns workflow-spec]
  (with-api-context spec
    (s/validate ArgoWorkflow workflow-spec)
    (workflow/workflow-service-submit-workflow ns workflow-spec)))

Stop a running workflow

(defn stop-workflow
  {:added "0.1.0"}
  ([spec workflow-name]
   (stop-workflow spec (str) workflow-name))
  ([spec ns workflow-name]
   (with-api-context spec
     (workflow/workflow-service-stop-workflow spec ns workflow-name))))

Retrieve pod logs

(defn get-pod-log
  {:added "0.1.1"}
  [spec ns workflow-name pod-name]
  (with-api-context spec
    (workflow/workflow-service-pod-logs ns workflow-name pod-name)))

Resubmit workflow

(defn resubmit-workflow
  {:added "0.1.1"}
  [spec ns workflow-name workflow-spec]
  (with-api-context spec
    (s/validate ArgoWorkflowResubmit workflow-spec)
    (workflow/workflow-service-resubmit-workflow ns workflow-name workflow-spec)))

Suspend a workflow

(defn suspend-workflow
  {:added "0.1.1"}
  ([spec ns name] (suspend-workflow spec ns name {}))
  ([spec ns name body]
   (with-api-context spec
     (workflow/workflow-service-suspend-workflow ns name body))))

Resume a workflow

(defn resume-workflow
  {:added "0.1.1"}
  ([spec ns name] (resume-workflow spec ns name {}))
  ([spec ns name body]
   (with-api-context spec
     (workflow/workflow-service-resume-workflow ns name body))))

Retry a workflow

(defn retry-workflow
  {:added "0.1.1"}
  ([spec ns name] (retry-workflow spec ns name {}))
  ([spec ns name body]
   (with-api-context spec
     (workflow/workflow-service-retry-workflow ns name body))))

Set workflows properties & metadata

(defn set-workflow
  {:added "0.1.1"}
  [spec ns name body]
  (with-api-context spec
    (s/validate ArgoWorkflowSetter body)
    (workflow/workflow-service-set-workflow ns name body)))

Terminate a workflow

(defn terminate-workflow
  {:added "0.1.1"}
  ([spec ns name] (terminate-workflow spec ns name {}))
  ([spec ns name body]
   (with-api-context spec
     (workflow/workflow-service-terminate-workflow ns name body))))

Watch namespace events

Create a persistent connection

(defn watch-events
  {:added "0.1.1"}
  [spec ns]
  (with-api-context spec
    (workflow/workflow-service-watch-events ns)))

Watch nampasce workflows events

(defn watch-workflows
  {:added "0.1.1"}
  [spec ns]
  (with-api-context spec
    (workflow/workflow-service-watch-workflows ns)))

Retrieve Workflows logs

(defn workflows-logs
  {:added "0.1.1"}
  ([spec ns workflow-name] (workflows-logs spec ns workflow-name {}))
  ([spec ns workflow-name params]
   (with-api-context spec
     (workflow/workflow-service-workflow-logs ns workflow-name ;params))))

===============================

Templates

Retrieve Workflow Templates

(defn list-templates
  {:added "0.1.1"}
  [spec]
  (with-api-context spec
    (wt/cluster-workflow-template-service-list-cluster-workflow-templates)))

Retrieve Workflow Template by Name metadata

(defn get-template
  {:added "0.1.1"}
  [spec template-name]
  (with-api-context spec
    (wt/cluster-workflow-template-service-get-cluster-workflow-template template-name)))

Delete Workflow Template by name

(defn delete-template
  {:added "0.1.1"}
  [spec template-name]
  (with-api-context spec
    (wt/cluster-workflow-template-service-delete-cluster-workflow-template template-name)))

Create a new Workflow template

(defn create-template
  {:added "0.1.1"}
  [spec body]
  (with-api-context spec
    ;; TODO: Implement Template Spec
    ;;(s/validate ArgoWorkflowTemplate body)
    (wt/cluster-workflow-template-service-create-cluster-workflow-template body)))

Update a Workflow template

(defn create-template
  {:added "0.1.1"}
  [spec template-name body]
  (with-api-context spec
    ;; TODO: Implement Template Spec
    ;;(s/validate ArgoWorkflowTemplate body)
    (wt/cluster-workflow-template-service-update-cluster-workflow-template template-name body)))

===============================

Admininistration

Retrieve Cluster Info

(defn cluster-info
  {:added "0.1.1"}
  [spec]
  (with-api-context spec
    (ai/info-service-get-info)))

Retrieve User Info

(defn user-info
  {:added "0.1.1"}
  [spec]
  (with-api-context spec
    (ai/info-service-get-user-info)))

Retrieve Cluster Version & Build informations

(defn cluster-version
  {:added "0.1.1"}
  [spec]
  (with-api-context spec
    (ai/info-service-get-version)))

===============================

Events & Events Sources

Retrieve Workflow events binding for the target namespace

(defn get-events-bindings
  {:added "0.1.1"}
  [spec ns]
  (with-api-context spec
    (ev/event-service-list-workflow-event-bindings ns)))

Create Workflow events binding.

Optional discriminator for the io.argoproj.workflow.v1alpha1. This should almost always be empty. Used for edge-cases where the event payload alone is not provide enough information to discriminate the event. This MUST NOT be used as security mechanism, e.g. to allow two clients to use the same access token, or to support webhooks on unsecured server. Instead, use access tokens.

The event itself can be any data.

(defn create-events-binding
  {:added "0.1.1"}
  [spec ns discriminator data]
  (with-api-context spec
    (ev/event-service-receive-event ns discriminator data)))
(defn list-event-sources
  {:added "0.1.1"}
  ([spec ns] (list-event-sources spec ns {}))
  ([spec ns options]
   (with-api-context spec
     (esv/event-source-service-list-event-sources ns options))))
(defn get-event-sources
  {:added "0.1.1"}
  ([spec ns name] (get-event-sources spec ns name {}))
  ([spec ns name options]
   (with-api-context spec
     (esv/event-source-service-get-event-source ns name options))))

===============================

CronJobs

List cronjobs for the current namespace

(defn list-cronjobs
  {:added "0.1.1"}
  ([spec ns] (list-cronjobs spec ns {}))
  ([spec ns options]
   (with-api-context spec
     (cron/cron-workflow-service-list-cron-workflows ns options))))

Get cronjob by name

(defn get-cronjob
  {:added "0.1.1"}
  ([spec ns name] (get-cronjob spec ns name {}))
  ([spec ns name options]
   (with-api-context spec
     (cron/cron-workflow-service-get-cron-workflow ns name options))))

Create cronjob

(defn create-cronjob
  {:added "0.1.1"}
  [spec ns body]
  (with-api-context spec
    ;; TODO: Create Workflow Spec
    ;; (s/validate Fixme body)
    (cron/cron-workflow-service-create-cron-workflow ns body)))

Suspend Cronjob

(defn suspend-cronjob
  {:added "0.1.1"}
  ([spec ns name] (suspend-cronjob spec ns name {}))
  ([spec ns name options]
   (with-api-context spec
     (cron/cron-workflow-service-suspend-cron-workflow ns name options))))

Resume Cronjob

(defn resume-cronjob
  {:added "0.1.1"}
  ([spec ns name] (resume-cronjob spec ns name {}))
  ([spec ns name options]
   (with-api-context spec
     (cron/cron-workflow-service-resume-cron-workflow ns name options))))
 
(ns argo-workflows-api.api.event-service
  (:require [argo-workflows-api.core :refer [call-api check-required-params with-collection-format]])
  (:import (java.io File)))
(defn event-service-list-workflow-event-bindings-with-http-info
  ([namespace ] (event-service-list-workflow-event-bindings-with-http-info namespace nil))
  ([namespace {:keys [list-optionslabel-selector list-optionsfield-selector list-optionswatch list-optionsallow-watch-bookmarks list-optionsresource-version list-optionsresource-version-match list-optionstimeout-seconds list-optionslimit list-optionscontinue ]}]
   (call-api "/api/v1/workflow-event-bindings/{namespace}" :get
             {:path-params   {"namespace" namespace }
              :header-params {}
              :query-params  {"listOptions.labelSelector" list-optionslabel-selector "listOptions.fieldSelector" list-optionsfield-selector "listOptions.watch" list-optionswatch "listOptions.allowWatchBookmarks" list-optionsallow-watch-bookmarks "listOptions.resourceVersion" list-optionsresource-version "listOptions.resourceVersionMatch" list-optionsresource-version-match "listOptions.timeoutSeconds" list-optionstimeout-seconds "listOptions.limit" list-optionslimit "listOptions.continue" list-optionscontinue }
              :form-params   {}
              :content-types ["application/json"]
              :accepts       ["application/json"]
              :auth-names    ["BearerToken"]})))
(defn event-service-list-workflow-event-bindings
  ([namespace ] (event-service-list-workflow-event-bindings namespace nil))
  ([namespace optional-params]
   (:data (event-service-list-workflow-event-bindings-with-http-info namespace optional-params))))
(defn event-service-receive-event-with-http-info
  [namespace discriminator body ]
  (call-api "/api/v1/events/{namespace}/{discriminator}" :post
            {:path-params   {"namespace" namespace "discriminator" discriminator }
             :header-params {}
             :query-params  {}
             :form-params   {}
             :body-param    body
             :content-types ["application/json"]
             :accepts       ["application/json"]
             :auth-names    ["BearerToken"]}))
(defn event-service-receive-event
  [namespace discriminator body ]
  (:data (event-service-receive-event-with-http-info namespace discriminator body)))
 
(ns argo-workflows-api.api.cluster-workflow-template-service
  (:require [argo-workflows-api.core :refer [call-api check-required-params with-collection-format]])
  (:import (java.io File)))
(defn cluster-workflow-template-service-create-cluster-workflow-template-with-http-info
  [body ]
  (call-api "/api/v1/cluster-workflow-templates" :post
            {:path-params   {}
             :header-params {}
             :query-params  {}
             :form-params   {}
             :body-param    body
             :content-types ["application/json"]
             :accepts       ["application/json"]
             :auth-names    ["BearerToken"]}))
(defn cluster-workflow-template-service-create-cluster-workflow-template
  [body ]
  (:data (cluster-workflow-template-service-create-cluster-workflow-template-with-http-info body)))
(defn cluster-workflow-template-service-delete-cluster-workflow-template-with-http-info
  ([name ] (cluster-workflow-template-service-delete-cluster-workflow-template-with-http-info name nil))
  ([name {:keys [delete-optionsgrace-period-seconds delete-optionspreconditionsuid delete-optionspreconditionsresource-version delete-optionsorphan-dependents delete-optionspropagation-policy delete-optionsdry-run ]}]
   (call-api "/api/v1/cluster-workflow-templates/{name}" :delete
             {:path-params   {"name" name }
              :header-params {}
              :query-params  {"deleteOptions.gracePeriodSeconds" delete-optionsgrace-period-seconds "deleteOptions.preconditions.uid" delete-optionspreconditionsuid "deleteOptions.preconditions.resourceVersion" delete-optionspreconditionsresource-version "deleteOptions.orphanDependents" delete-optionsorphan-dependents "deleteOptions.propagationPolicy" delete-optionspropagation-policy "deleteOptions.dryRun" (with-collection-format delete-optionsdry-run :multi) }
              :form-params   {}
              :content-types ["application/json"]
              :accepts       ["application/json"]
              :auth-names    ["BearerToken"]})))
(defn cluster-workflow-template-service-delete-cluster-workflow-template
  ([name ] (cluster-workflow-template-service-delete-cluster-workflow-template name nil))
  ([name optional-params]
   (:data (cluster-workflow-template-service-delete-cluster-workflow-template-with-http-info name optional-params))))
(defn cluster-workflow-template-service-get-cluster-workflow-template-with-http-info
  ([name ] (cluster-workflow-template-service-get-cluster-workflow-template-with-http-info name nil))
  ([name {:keys [get-optionsresource-version ]}]
   (call-api "/api/v1/cluster-workflow-templates/{name}" :get
             {:path-params   {"name" name }
              :header-params {}
              :query-params  {"getOptions.resourceVersion" get-optionsresource-version }
              :form-params   {}
              :content-types ["application/json"]
              :accepts       ["application/json"]
              :auth-names    ["BearerToken"]})))
(defn cluster-workflow-template-service-get-cluster-workflow-template
  ([name ] (cluster-workflow-template-service-get-cluster-workflow-template name nil))
  ([name optional-params]
   (:data (cluster-workflow-template-service-get-cluster-workflow-template-with-http-info name optional-params))))
(defn cluster-workflow-template-service-lint-cluster-workflow-template-with-http-info
  [body ]
  (call-api "/api/v1/cluster-workflow-templates/lint" :post
            {:path-params   {}
             :header-params {}
             :query-params  {}
             :form-params   {}
             :body-param    body
             :content-types ["application/json"]
             :accepts       ["application/json"]
             :auth-names    ["BearerToken"]}))
(defn cluster-workflow-template-service-lint-cluster-workflow-template
  [body ]
  (:data (cluster-workflow-template-service-lint-cluster-workflow-template-with-http-info body)))
(defn cluster-workflow-template-service-list-cluster-workflow-templates-with-http-info
  ([] (cluster-workflow-template-service-list-cluster-workflow-templates-with-http-info nil))
  ([{:keys [list-optionslabel-selector list-optionsfield-selector list-optionswatch list-optionsallow-watch-bookmarks list-optionsresource-version list-optionsresource-version-match list-optionstimeout-seconds list-optionslimit list-optionscontinue ]}]
   (call-api "/api/v1/cluster-workflow-templates" :get
             {:path-params   {}
              :header-params {}
              :query-params  {"listOptions.labelSelector" list-optionslabel-selector "listOptions.fieldSelector" list-optionsfield-selector "listOptions.watch" list-optionswatch "listOptions.allowWatchBookmarks" list-optionsallow-watch-bookmarks "listOptions.resourceVersion" list-optionsresource-version "listOptions.resourceVersionMatch" list-optionsresource-version-match "listOptions.timeoutSeconds" list-optionstimeout-seconds "listOptions.limit" list-optionslimit "listOptions.continue" list-optionscontinue }
              :form-params   {}
              :content-types ["application/json"]
              :accepts       ["application/json"]
              :auth-names    ["BearerToken"]})))
(defn cluster-workflow-template-service-list-cluster-workflow-templates
  ([] (cluster-workflow-template-service-list-cluster-workflow-templates nil))
  ([optional-params]
   (:data (cluster-workflow-template-service-list-cluster-workflow-templates-with-http-info optional-params))))
(defn cluster-workflow-template-service-update-cluster-workflow-template-with-http-info
  [name body ]
  (call-api "/api/v1/cluster-workflow-templates/{name}" :put
            {:path-params   {"name" name }
             :header-params {}
             :query-params  {}
             :form-params   {}
             :body-param    body
             :content-types ["application/json"]
             :accepts       ["application/json"]
             :auth-names    ["BearerToken"]}))
(defn cluster-workflow-template-service-update-cluster-workflow-template
  [name body ]
  (:data (cluster-workflow-template-service-update-cluster-workflow-template-with-http-info name body)))
 
(ns argo-workflows-api.api.archived-workflow-service
  (:require [argo-workflows-api.core :refer [call-api check-required-params with-collection-format]])
  (:import (java.io File)))
(defn archived-workflow-service-delete-archived-workflow-with-http-info
  ([uid ] (archived-workflow-service-delete-archived-workflow-with-http-info uid nil))
  ([uid {:keys [namespace ]}]
   (call-api "/api/v1/archived-workflows/{uid}" :delete
             {:path-params   {"uid" uid }
              :header-params {}
              :query-params  {"namespace" namespace }
              :form-params   {}
              :content-types ["application/json"]
              :accepts       ["application/json"]
              :auth-names    ["BearerToken"]})))
(defn archived-workflow-service-delete-archived-workflow
  ([uid ] (archived-workflow-service-delete-archived-workflow uid nil))
  ([uid optional-params]
   (:data (archived-workflow-service-delete-archived-workflow-with-http-info uid optional-params))))
(defn archived-workflow-service-get-archived-workflow-with-http-info
  ([uid ] (archived-workflow-service-get-archived-workflow-with-http-info uid nil))
  ([uid {:keys [namespace ]}]
   (call-api "/api/v1/archived-workflows/{uid}" :get
             {:path-params   {"uid" uid }
              :header-params {}
              :query-params  {"namespace" namespace }
              :form-params   {}
              :content-types ["application/json"]
              :accepts       ["application/json"]
              :auth-names    ["BearerToken"]})))
(defn archived-workflow-service-get-archived-workflow
  ([uid ] (archived-workflow-service-get-archived-workflow uid nil))
  ([uid optional-params]
   (:data (archived-workflow-service-get-archived-workflow-with-http-info uid optional-params))))
(defn archived-workflow-service-list-archived-workflow-label-keys-with-http-info
  ([] (archived-workflow-service-list-archived-workflow-label-keys-with-http-info nil))
  ([{:keys [namespace ]}]
   (call-api "/api/v1/archived-workflows-label-keys" :get
             {:path-params   {}
              :header-params {}
              :query-params  {"namespace" namespace }
              :form-params   {}
              :content-types ["application/json"]
              :accepts       ["application/json"]
              :auth-names    ["BearerToken"]})))
(defn archived-workflow-service-list-archived-workflow-label-keys
  ([] (archived-workflow-service-list-archived-workflow-label-keys nil))
  ([optional-params]
   (:data (archived-workflow-service-list-archived-workflow-label-keys-with-http-info optional-params))))
(defn archived-workflow-service-list-archived-workflow-label-values-with-http-info
  ([] (archived-workflow-service-list-archived-workflow-label-values-with-http-info nil))
  ([{:keys [list-optionslabel-selector list-optionsfield-selector list-optionswatch list-optionsallow-watch-bookmarks list-optionsresource-version list-optionsresource-version-match list-optionstimeout-seconds list-optionslimit list-optionscontinue namespace ]}]
   (call-api "/api/v1/archived-workflows-label-values" :get
             {:path-params   {}
              :header-params {}
              :query-params  {"listOptions.labelSelector" list-optionslabel-selector "listOptions.fieldSelector" list-optionsfield-selector "listOptions.watch" list-optionswatch "listOptions.allowWatchBookmarks" list-optionsallow-watch-bookmarks "listOptions.resourceVersion" list-optionsresource-version "listOptions.resourceVersionMatch" list-optionsresource-version-match "listOptions.timeoutSeconds" list-optionstimeout-seconds "listOptions.limit" list-optionslimit "listOptions.continue" list-optionscontinue "namespace" namespace }
              :form-params   {}
              :content-types ["application/json"]
              :accepts       ["application/json"]
              :auth-names    ["BearerToken"]})))
(defn archived-workflow-service-list-archived-workflow-label-values
  ([] (archived-workflow-service-list-archived-workflow-label-values nil))
  ([optional-params]
   (:data (archived-workflow-service-list-archived-workflow-label-values-with-http-info optional-params))))
(defn archived-workflow-service-list-archived-workflows-with-http-info
  ([] (archived-workflow-service-list-archived-workflows-with-http-info nil))
  ([{:keys [list-optionslabel-selector list-optionsfield-selector list-optionswatch list-optionsallow-watch-bookmarks list-optionsresource-version list-optionsresource-version-match list-optionstimeout-seconds list-optionslimit list-optionscontinue name-prefix namespace ]}]
   (call-api "/api/v1/archived-workflows" :get
             {:path-params   {}
              :header-params {}
              :query-params  {"listOptions.labelSelector" list-optionslabel-selector "listOptions.fieldSelector" list-optionsfield-selector "listOptions.watch" list-optionswatch "listOptions.allowWatchBookmarks" list-optionsallow-watch-bookmarks "listOptions.resourceVersion" list-optionsresource-version "listOptions.resourceVersionMatch" list-optionsresource-version-match "listOptions.timeoutSeconds" list-optionstimeout-seconds "listOptions.limit" list-optionslimit "listOptions.continue" list-optionscontinue "namePrefix" name-prefix "namespace" namespace }
              :form-params   {}
              :content-types ["application/json"]
              :accepts       ["application/json"]
              :auth-names    ["BearerToken"]})))
(defn archived-workflow-service-list-archived-workflows
  ([] (archived-workflow-service-list-archived-workflows nil))
  ([optional-params]
   (:data (archived-workflow-service-list-archived-workflows-with-http-info optional-params))))
(defn archived-workflow-service-resubmit-archived-workflow-with-http-info
  [uid body ]
  (call-api "/api/v1/archived-workflows/{uid}/resubmit" :put
            {:path-params   {"uid" uid }
             :header-params {}
             :query-params  {}
             :form-params   {}
             :body-param    body
             :content-types ["application/json"]
             :accepts       ["application/json"]
             :auth-names    ["BearerToken"]}))
(defn archived-workflow-service-resubmit-archived-workflow
  [uid body ]
  (:data (archived-workflow-service-resubmit-archived-workflow-with-http-info uid body)))
(defn archived-workflow-service-retry-archived-workflow-with-http-info
  [uid body ]
  (call-api "/api/v1/archived-workflows/{uid}/retry" :put
            {:path-params   {"uid" uid }
             :header-params {}
             :query-params  {}
             :form-params   {}
             :body-param    body
             :content-types ["application/json"]
             :accepts       ["application/json"]
             :auth-names    ["BearerToken"]}))
(defn archived-workflow-service-retry-archived-workflow
  [uid body ]
  (:data (archived-workflow-service-retry-archived-workflow-with-http-info uid body)))
 
(ns argo-workflows-api.api.artifact-service
  (:require [argo-workflows-api.core :refer [call-api check-required-params with-collection-format]])
  (:import (java.io File)))

Get an artifact.

(defn artifact-service-get-artifact-file-with-http-info
  [namespace id-discriminator id node-id artifact-name artifact-discriminator ]
  (call-api "/artifact-files/{namespace}/{idDiscriminator}/{id}/{nodeId}/{artifactDiscriminator}/{artifactName}" :get
            {:path-params   {"namespace" namespace "idDiscriminator" id-discriminator "id" id "nodeId" node-id "artifactName" artifact-name "artifactDiscriminator" artifact-discriminator }
             :header-params {}
             :query-params  {}
             :form-params   {}
             :content-types ["application/json"]
             :accepts       ["application/json"]
             :auth-names    ["BearerToken"]}))

Get an artifact.

(defn artifact-service-get-artifact-file
  [namespace id-discriminator id node-id artifact-name artifact-discriminator ]
  (:data (artifact-service-get-artifact-file-with-http-info namespace id-discriminator id node-id artifact-name artifact-discriminator)))

Get an input artifact.

(defn artifact-service-get-input-artifact-with-http-info
  [namespace name node-id artifact-name ]
  (call-api "/input-artifacts/{namespace}/{name}/{nodeId}/{artifactName}" :get
            {:path-params   {"namespace" namespace "name" name "nodeId" node-id "artifactName" artifact-name }
             :header-params {}
             :query-params  {}
             :form-params   {}
             :content-types ["application/json"]
             :accepts       ["application/json"]
             :auth-names    ["BearerToken"]}))

Get an input artifact.

(defn artifact-service-get-input-artifact
  [namespace name node-id artifact-name ]
  (:data (artifact-service-get-input-artifact-with-http-info namespace name node-id artifact-name)))

Get an input artifact by UID.

(defn artifact-service-get-input-artifact-by-uid-with-http-info
  [uid node-id artifact-name ]
  (call-api "/input-artifacts-by-uid/{uid}/{nodeId}/{artifactName}" :get
            {:path-params   {"uid" uid "nodeId" node-id "artifactName" artifact-name }
             :header-params {}
             :query-params  {}
             :form-params   {}
             :content-types ["application/json"]
             :accepts       ["application/json"]
             :auth-names    ["BearerToken"]}))

Get an input artifact by UID.

(defn artifact-service-get-input-artifact-by-uid
  [uid node-id artifact-name ]
  (:data (artifact-service-get-input-artifact-by-uid-with-http-info uid node-id artifact-name)))

Get an output artifact.

(defn artifact-service-get-output-artifact-with-http-info
  [namespace name node-id artifact-name ]
  (call-api "/artifacts/{namespace}/{name}/{nodeId}/{artifactName}" :get
            {:path-params   {"namespace" namespace "name" name "nodeId" node-id "artifactName" artifact-name }
             :header-params {}
             :query-params  {}
             :form-params   {}
             :content-types ["application/json"]
             :accepts       ["application/json"]
             :auth-names    ["BearerToken"]}))

Get an output artifact.

(defn artifact-service-get-output-artifact
  [namespace name node-id artifact-name ]
  (:data (artifact-service-get-output-artifact-with-http-info namespace name node-id artifact-name)))

Get an output artifact by UID.

(defn artifact-service-get-output-artifact-by-uid-with-http-info
  [uid node-id artifact-name ]
  (call-api "/artifacts-by-uid/{uid}/{nodeId}/{artifactName}" :get
            {:path-params   {"uid" uid "nodeId" node-id "artifactName" artifact-name }
             :header-params {}
             :query-params  {}
             :form-params   {}
             :content-types ["application/json"]
             :accepts       ["application/json"]
             :auth-names    ["BearerToken"]}))

Get an output artifact by UID.

(defn artifact-service-get-output-artifact-by-uid
  [uid node-id artifact-name ]
  (:data (artifact-service-get-output-artifact-by-uid-with-http-info uid node-id artifact-name)))
 
(ns argo-workflows-api.api.sensor-service
  (:require [argo-workflows-api.core :refer [call-api check-required-params with-collection-format]])
  (:import (java.io File)))
(defn sensor-service-create-sensor-with-http-info
  [namespace body ]
  (call-api "/api/v1/sensors/{namespace}" :post
            {:path-params   {"namespace" namespace }
             :header-params {}
             :query-params  {}
             :form-params   {}
             :body-param    body
             :content-types ["application/json"]
             :accepts       ["application/json"]
             :auth-names    ["BearerToken"]}))
(defn sensor-service-create-sensor
  [namespace body ]
  (:data (sensor-service-create-sensor-with-http-info namespace body)))
(defn sensor-service-delete-sensor-with-http-info
  ([namespace name ] (sensor-service-delete-sensor-with-http-info namespace name nil))
  ([namespace name {:keys [delete-optionsgrace-period-seconds delete-optionspreconditionsuid delete-optionspreconditionsresource-version delete-optionsorphan-dependents delete-optionspropagation-policy delete-optionsdry-run ]}]
   (call-api "/api/v1/sensors/{namespace}/{name}" :delete
             {:path-params   {"namespace" namespace "name" name }
              :header-params {}
              :query-params  {"deleteOptions.gracePeriodSeconds" delete-optionsgrace-period-seconds "deleteOptions.preconditions.uid" delete-optionspreconditionsuid "deleteOptions.preconditions.resourceVersion" delete-optionspreconditionsresource-version "deleteOptions.orphanDependents" delete-optionsorphan-dependents "deleteOptions.propagationPolicy" delete-optionspropagation-policy "deleteOptions.dryRun" (with-collection-format delete-optionsdry-run :multi) }
              :form-params   {}
              :content-types ["application/json"]
              :accepts       ["application/json"]
              :auth-names    ["BearerToken"]})))
(defn sensor-service-delete-sensor
  ([namespace name ] (sensor-service-delete-sensor namespace name nil))
  ([namespace name optional-params]
   (:data (sensor-service-delete-sensor-with-http-info namespace name optional-params))))
(defn sensor-service-get-sensor-with-http-info
  ([namespace name ] (sensor-service-get-sensor-with-http-info namespace name nil))
  ([namespace name {:keys [get-optionsresource-version ]}]
   (call-api "/api/v1/sensors/{namespace}/{name}" :get
             {:path-params   {"namespace" namespace "name" name }
              :header-params {}
              :query-params  {"getOptions.resourceVersion" get-optionsresource-version }
              :form-params   {}
              :content-types ["application/json"]
              :accepts       ["application/json"]
              :auth-names    ["BearerToken"]})))
(defn sensor-service-get-sensor
  ([namespace name ] (sensor-service-get-sensor namespace name nil))
  ([namespace name optional-params]
   (:data (sensor-service-get-sensor-with-http-info namespace name optional-params))))
(defn sensor-service-list-sensors-with-http-info
  ([namespace ] (sensor-service-list-sensors-with-http-info namespace nil))
  ([namespace {:keys [list-optionslabel-selector list-optionsfield-selector list-optionswatch list-optionsallow-watch-bookmarks list-optionsresource-version list-optionsresource-version-match list-optionstimeout-seconds list-optionslimit list-optionscontinue ]}]
   (call-api "/api/v1/sensors/{namespace}" :get
             {:path-params   {"namespace" namespace }
              :header-params {}
              :query-params  {"listOptions.labelSelector" list-optionslabel-selector "listOptions.fieldSelector" list-optionsfield-selector "listOptions.watch" list-optionswatch "listOptions.allowWatchBookmarks" list-optionsallow-watch-bookmarks "listOptions.resourceVersion" list-optionsresource-version "listOptions.resourceVersionMatch" list-optionsresource-version-match "listOptions.timeoutSeconds" list-optionstimeout-seconds "listOptions.limit" list-optionslimit "listOptions.continue" list-optionscontinue }
              :form-params   {}
              :content-types ["application/json"]
              :accepts       ["application/json"]
              :auth-names    ["BearerToken"]})))
(defn sensor-service-list-sensors
  ([namespace ] (sensor-service-list-sensors namespace nil))
  ([namespace optional-params]
   (:data (sensor-service-list-sensors-with-http-info namespace optional-params))))
(defn sensor-service-sensors-logs-with-http-info
  ([namespace ] (sensor-service-sensors-logs-with-http-info namespace nil))
  ([namespace {:keys [name trigger-name grep pod-log-optionscontainer pod-log-optionsfollow pod-log-optionsprevious pod-log-optionssince-seconds pod-log-optionssince-timeseconds pod-log-optionssince-timenanos pod-log-optionstimestamps pod-log-optionstail-lines pod-log-optionslimit-bytes pod-log-optionsinsecure-skip-tls-verify-backend ]}]
   (call-api "/api/v1/stream/sensors/{namespace}/logs" :get
             {:path-params   {"namespace" namespace }
              :header-params {}
              :query-params  {"name" name "triggerName" trigger-name "grep" grep "podLogOptions.container" pod-log-optionscontainer "podLogOptions.follow" pod-log-optionsfollow "podLogOptions.previous" pod-log-optionsprevious "podLogOptions.sinceSeconds" pod-log-optionssince-seconds "podLogOptions.sinceTime.seconds" pod-log-optionssince-timeseconds "podLogOptions.sinceTime.nanos" pod-log-optionssince-timenanos "podLogOptions.timestamps" pod-log-optionstimestamps "podLogOptions.tailLines" pod-log-optionstail-lines "podLogOptions.limitBytes" pod-log-optionslimit-bytes "podLogOptions.insecureSkipTLSVerifyBackend" pod-log-optionsinsecure-skip-tls-verify-backend }
              :form-params   {}
              :content-types ["application/json"]
              :accepts       ["application/json"]
              :auth-names    ["BearerToken"]})))
(defn sensor-service-sensors-logs
  ([namespace ] (sensor-service-sensors-logs namespace nil))
  ([namespace optional-params]
   (:data (sensor-service-sensors-logs-with-http-info namespace optional-params))))
(defn sensor-service-update-sensor-with-http-info
  [namespace name body ]
  (call-api "/api/v1/sensors/{namespace}/{name}" :put
            {:path-params   {"namespace" namespace "name" name }
             :header-params {}
             :query-params  {}
             :form-params   {}
             :body-param    body
             :content-types ["application/json"]
             :accepts       ["application/json"]
             :auth-names    ["BearerToken"]}))
(defn sensor-service-update-sensor
  [namespace name body ]
  (:data (sensor-service-update-sensor-with-http-info namespace name body)))
(defn sensor-service-watch-sensors-with-http-info
  ([namespace ] (sensor-service-watch-sensors-with-http-info namespace nil))
  ([namespace {:keys [list-optionslabel-selector list-optionsfield-selector list-optionswatch list-optionsallow-watch-bookmarks list-optionsresource-version list-optionsresource-version-match list-optionstimeout-seconds list-optionslimit list-optionscontinue ]}]
   (call-api "/api/v1/stream/sensors/{namespace}" :get
             {:path-params   {"namespace" namespace }
              :header-params {}
              :query-params  {"listOptions.labelSelector" list-optionslabel-selector "listOptions.fieldSelector" list-optionsfield-selector "listOptions.watch" list-optionswatch "listOptions.allowWatchBookmarks" list-optionsallow-watch-bookmarks "listOptions.resourceVersion" list-optionsresource-version "listOptions.resourceVersionMatch" list-optionsresource-version-match "listOptions.timeoutSeconds" list-optionstimeout-seconds "listOptions.limit" list-optionslimit "listOptions.continue" list-optionscontinue }
              :form-params   {}
              :content-types ["application/json"]
              :accepts       ["application/json"]
              :auth-names    ["BearerToken"]})))
(defn sensor-service-watch-sensors
  ([namespace ] (sensor-service-watch-sensors namespace nil))
  ([namespace optional-params]
   (:data (sensor-service-watch-sensors-with-http-info namespace optional-params))))
 
(ns argo-workflows-api.api.info-service
  (:require [argo-workflows-api.core :refer [call-api check-required-params with-collection-format]])
  (:import (java.io File)))
(defn info-service-collect-event-with-http-info
  [body ]
  (call-api "/api/v1/tracking/event" :post
            {:path-params   {}
             :header-params {}
             :query-params  {}
             :form-params   {}
             :body-param    body
             :content-types ["application/json"]
             :accepts       ["application/json"]
             :auth-names    ["BearerToken"]}))
(defn info-service-collect-event
  [body ]
  (:data (info-service-collect-event-with-http-info body)))
(defn info-service-get-info-with-http-info
  []
  (call-api "/api/v1/info" :get
            {:path-params   {}
             :header-params {}
             :query-params  {}
             :form-params   {}
             :content-types ["application/json"]
             :accepts       ["application/json"]
             :auth-names    ["BearerToken"]}))
(defn info-service-get-info
  []
  (:data (info-service-get-info-with-http-info)))
(defn info-service-get-user-info-with-http-info
  []
  (call-api "/api/v1/userinfo" :get
            {:path-params   {}
             :header-params {}
             :query-params  {}
             :form-params   {}
             :content-types ["application/json"]
             :accepts       ["application/json"]
             :auth-names    ["BearerToken"]}))
(defn info-service-get-user-info
  []
  (:data (info-service-get-user-info-with-http-info)))
(defn info-service-get-version-with-http-info
  []
  (call-api "/api/v1/version" :get
            {:path-params   {}
             :header-params {}
             :query-params  {}
             :form-params   {}
             :content-types ["application/json"]
             :accepts       ["application/json"]
             :auth-names    ["BearerToken"]}))
(defn info-service-get-version
  []
  (:data (info-service-get-version-with-http-info)))
 
(ns argo-workflows-api.api.workflow-service
  (:require [argo-workflows-api.core :refer [call-api check-required-params with-collection-format]])
  (:import (java.io File)))
(defn workflow-service-create-workflow-with-http-info
  [namespace body ]
  (call-api "/api/v1/workflows/{namespace}" :post
            {:path-params   {"namespace" namespace }
             :header-params {}
             :query-params  {}
             :form-params   {}
             :body-param    body
             :content-types ["application/json"]
             :accepts       ["application/json"]
             :auth-names    ["BearerToken"]}))
(defn workflow-service-create-workflow
  [namespace body ]
  (:data (workflow-service-create-workflow-with-http-info namespace body)))
(defn workflow-service-delete-workflow-with-http-info
  ([namespace name ] (workflow-service-delete-workflow-with-http-info namespace name nil))
  ([namespace name {:keys [delete-optionsgrace-period-seconds delete-optionspreconditionsuid delete-optionspreconditionsresource-version delete-optionsorphan-dependents delete-optionspropagation-policy delete-optionsdry-run force ]}]
   (call-api "/api/v1/workflows/{namespace}/{name}" :delete
             {:path-params   {"namespace" namespace "name" name }
              :header-params {}
              :query-params  {"deleteOptions.gracePeriodSeconds" delete-optionsgrace-period-seconds "deleteOptions.preconditions.uid" delete-optionspreconditionsuid "deleteOptions.preconditions.resourceVersion" delete-optionspreconditionsresource-version "deleteOptions.orphanDependents" delete-optionsorphan-dependents "deleteOptions.propagationPolicy" delete-optionspropagation-policy "deleteOptions.dryRun" (with-collection-format delete-optionsdry-run :multi) "force" force }
              :form-params   {}
              :content-types ["application/json"]
              :accepts       ["application/json"]
              :auth-names    ["BearerToken"]})))
(defn workflow-service-delete-workflow
  ([namespace name ] (workflow-service-delete-workflow namespace name nil))
  ([namespace name optional-params]
   (:data (workflow-service-delete-workflow-with-http-info namespace name optional-params))))
(defn workflow-service-get-workflow-with-http-info
  ([namespace name ] (workflow-service-get-workflow-with-http-info namespace name nil))
  ([namespace name {:keys [get-optionsresource-version fields ]}]
   (call-api "/api/v1/workflows/{namespace}/{name}" :get
             {:path-params   {"namespace" namespace "name" name }
              :header-params {}
              :query-params  {"getOptions.resourceVersion" get-optionsresource-version "fields" fields }
              :form-params   {}
              :content-types ["application/json"]
              :accepts       ["application/json"]
              :auth-names    ["BearerToken"]})))
(defn workflow-service-get-workflow
  ([namespace name ] (workflow-service-get-workflow namespace name nil))
  ([namespace name optional-params]
   (:data (workflow-service-get-workflow-with-http-info namespace name optional-params))))
(defn workflow-service-lint-workflow-with-http-info
  [namespace body ]
  (call-api "/api/v1/workflows/{namespace}/lint" :post
            {:path-params   {"namespace" namespace }
             :header-params {}
             :query-params  {}
             :form-params   {}
             :body-param    body
             :content-types ["application/json"]
             :accepts       ["application/json"]
             :auth-names    ["BearerToken"]}))
(defn workflow-service-lint-workflow
  [namespace body ]
  (:data (workflow-service-lint-workflow-with-http-info namespace body)))
(defn workflow-service-list-workflows-with-http-info
  ([namespace ] (workflow-service-list-workflows-with-http-info namespace nil))
  ([namespace {:keys [list-optionslabel-selector list-optionsfield-selector list-optionswatch list-optionsallow-watch-bookmarks list-optionsresource-version list-optionsresource-version-match list-optionstimeout-seconds list-optionslimit list-optionscontinue fields ]}]
   (call-api "/api/v1/workflows/{namespace}" :get
             {:path-params   {"namespace" namespace }
              :header-params {}
              :query-params  {"listOptions.labelSelector" list-optionslabel-selector "listOptions.fieldSelector" list-optionsfield-selector "listOptions.watch" list-optionswatch "listOptions.allowWatchBookmarks" list-optionsallow-watch-bookmarks "listOptions.resourceVersion" list-optionsresource-version "listOptions.resourceVersionMatch" list-optionsresource-version-match "listOptions.timeoutSeconds" list-optionstimeout-seconds "listOptions.limit" list-optionslimit "listOptions.continue" list-optionscontinue "fields" fields }
              :form-params   {}
              :content-types ["application/json"]
              :accepts       ["application/json"]
              :auth-names    ["BearerToken"]})))
(defn workflow-service-list-workflows
  ([namespace ] (workflow-service-list-workflows namespace nil))
  ([namespace optional-params]
   (:data (workflow-service-list-workflows-with-http-info namespace optional-params))))

DEPRECATED: Cannot work via HTTP if podName is an empty string. Use WorkflowLogs.

(defn workflow-service-pod-logs-with-http-info
  ([namespace name pod-name ] (workflow-service-pod-logs-with-http-info namespace name pod-name nil))
  ([namespace name pod-name {:keys [log-optionscontainer log-optionsfollow log-optionsprevious log-optionssince-seconds log-optionssince-timeseconds log-optionssince-timenanos log-optionstimestamps log-optionstail-lines log-optionslimit-bytes log-optionsinsecure-skip-tls-verify-backend grep selector ]}]
   (call-api "/api/v1/workflows/{namespace}/{name}/{podName}/log" :get
             {:path-params   {"namespace" namespace "name" name "podName" pod-name }
              :header-params {}
              :query-params  {"logOptions.container" log-optionscontainer "logOptions.follow" log-optionsfollow "logOptions.previous" log-optionsprevious "logOptions.sinceSeconds" log-optionssince-seconds "logOptions.sinceTime.seconds" log-optionssince-timeseconds "logOptions.sinceTime.nanos" log-optionssince-timenanos "logOptions.timestamps" log-optionstimestamps "logOptions.tailLines" log-optionstail-lines "logOptions.limitBytes" log-optionslimit-bytes "logOptions.insecureSkipTLSVerifyBackend" log-optionsinsecure-skip-tls-verify-backend "grep" grep "selector" selector }
              :form-params   {}
              :content-types ["application/json"]
              :accepts       ["application/json"]
              :auth-names    ["BearerToken"]})))

DEPRECATED: Cannot work via HTTP if podName is an empty string. Use WorkflowLogs.

(defn workflow-service-pod-logs
  ([namespace name pod-name ] (workflow-service-pod-logs namespace name pod-name nil))
  ([namespace name pod-name optional-params]
   (:data (workflow-service-pod-logs-with-http-info namespace name pod-name optional-params))))
(defn workflow-service-resubmit-workflow-with-http-info
  [namespace name body ]
  (call-api "/api/v1/workflows/{namespace}/{name}/resubmit" :put
            {:path-params   {"namespace" namespace "name" name }
             :header-params {}
             :query-params  {}
             :form-params   {}
             :body-param    body
             :content-types ["application/json"]
             :accepts       ["application/json"]
             :auth-names    ["BearerToken"]}))
(defn workflow-service-resubmit-workflow
  [namespace name body ]
  (:data (workflow-service-resubmit-workflow-with-http-info namespace name body)))
(defn workflow-service-resume-workflow-with-http-info
  [namespace name body ]
  (call-api "/api/v1/workflows/{namespace}/{name}/resume" :put
            {:path-params   {"namespace" namespace "name" name }
             :header-params {}
             :query-params  {}
             :form-params   {}
             :body-param    body
             :content-types ["application/json"]
             :accepts       ["application/json"]
             :auth-names    ["BearerToken"]}))
(defn workflow-service-resume-workflow
  [namespace name body ]
  (:data (workflow-service-resume-workflow-with-http-info namespace name body)))
(defn workflow-service-retry-workflow-with-http-info
  [namespace name body ]
  (call-api "/api/v1/workflows/{namespace}/{name}/retry" :put
            {:path-params   {"namespace" namespace "name" name }
             :header-params {}
             :query-params  {}
             :form-params   {}
             :body-param    body
             :content-types ["application/json"]
             :accepts       ["application/json"]
             :auth-names    ["BearerToken"]}))
(defn workflow-service-retry-workflow
  [namespace name body ]
  (:data (workflow-service-retry-workflow-with-http-info namespace name body)))
(defn workflow-service-set-workflow-with-http-info
  [namespace name body ]
  (call-api "/api/v1/workflows/{namespace}/{name}/set" :put
            {:path-params   {"namespace" namespace "name" name }
             :header-params {}
             :query-params  {}
             :form-params   {}
             :body-param    body
             :content-types ["application/json"]
             :accepts       ["application/json"]
             :auth-names    ["BearerToken"]}))
(defn workflow-service-set-workflow
  [namespace name body ]
  (:data (workflow-service-set-workflow-with-http-info namespace name body)))
(defn workflow-service-stop-workflow-with-http-info
  [namespace name body ]
  (call-api "/api/v1/workflows/{namespace}/{name}/stop" :put
            {:path-params   {"namespace" namespace "name" name }
             :header-params {}
             :query-params  {}
             :form-params   {}
             :body-param    body
             :content-types ["application/json"]
             :accepts       ["application/json"]
             :auth-names    ["BearerToken"]}))
(defn workflow-service-stop-workflow
  [namespace name body ]
  (:data (workflow-service-stop-workflow-with-http-info namespace name body)))
(defn workflow-service-submit-workflow-with-http-info
  [namespace body ]
  (call-api "/api/v1/workflows/{namespace}/submit" :post
            {:path-params   {"namespace" namespace }
             :header-params {}
             :query-params  {}
             :form-params   {}
             :body-param    body
             :content-types ["application/json"]
             :accepts       ["application/json"]
             :auth-names    ["BearerToken"]}))
(defn workflow-service-submit-workflow
  [namespace body ]
  (:data (workflow-service-submit-workflow-with-http-info namespace body)))
(defn workflow-service-suspend-workflow-with-http-info
  [namespace name body ]
  (call-api "/api/v1/workflows/{namespace}/{name}/suspend" :put
            {:path-params   {"namespace" namespace "name" name }
             :header-params {}
             :query-params  {}
             :form-params   {}
             :body-param    body
             :content-types ["application/json"]
             :accepts       ["application/json"]
             :auth-names    ["BearerToken"]}))
(defn workflow-service-suspend-workflow
  [namespace name body ]
  (:data (workflow-service-suspend-workflow-with-http-info namespace name body)))
(defn workflow-service-terminate-workflow-with-http-info
  [namespace name body ]
  (call-api "/api/v1/workflows/{namespace}/{name}/terminate" :put
            {:path-params   {"namespace" namespace "name" name }
             :header-params {}
             :query-params  {}
             :form-params   {}
             :body-param    body
             :content-types ["application/json"]
             :accepts       ["application/json"]
             :auth-names    ["BearerToken"]}))
(defn workflow-service-terminate-workflow
  [namespace name body ]
  (:data (workflow-service-terminate-workflow-with-http-info namespace name body)))
(defn workflow-service-watch-events-with-http-info
  ([namespace ] (workflow-service-watch-events-with-http-info namespace nil))
  ([namespace {:keys [list-optionslabel-selector list-optionsfield-selector list-optionswatch list-optionsallow-watch-bookmarks list-optionsresource-version list-optionsresource-version-match list-optionstimeout-seconds list-optionslimit list-optionscontinue ]}]
   (call-api "/api/v1/stream/events/{namespace}" :get
             {:path-params   {"namespace" namespace }
              :header-params {}
              :query-params  {"listOptions.labelSelector" list-optionslabel-selector "listOptions.fieldSelector" list-optionsfield-selector "listOptions.watch" list-optionswatch "listOptions.allowWatchBookmarks" list-optionsallow-watch-bookmarks "listOptions.resourceVersion" list-optionsresource-version "listOptions.resourceVersionMatch" list-optionsresource-version-match "listOptions.timeoutSeconds" list-optionstimeout-seconds "listOptions.limit" list-optionslimit "listOptions.continue" list-optionscontinue }
              :form-params   {}
              :content-types ["application/json"]
              :accepts       ["application/json"]
              :auth-names    ["BearerToken"]})))
(defn workflow-service-watch-events
  ([namespace ] (workflow-service-watch-events namespace nil))
  ([namespace optional-params]
   (:data (workflow-service-watch-events-with-http-info namespace optional-params))))
(defn workflow-service-watch-workflows-with-http-info
  ([namespace ] (workflow-service-watch-workflows-with-http-info namespace nil))
  ([namespace {:keys [list-optionslabel-selector list-optionsfield-selector list-optionswatch list-optionsallow-watch-bookmarks list-optionsresource-version list-optionsresource-version-match list-optionstimeout-seconds list-optionslimit list-optionscontinue fields ]}]
   (call-api "/api/v1/workflow-events/{namespace}" :get
             {:path-params   {"namespace" namespace }
              :header-params {}
              :query-params  {"listOptions.labelSelector" list-optionslabel-selector "listOptions.fieldSelector" list-optionsfield-selector "listOptions.watch" list-optionswatch "listOptions.allowWatchBookmarks" list-optionsallow-watch-bookmarks "listOptions.resourceVersion" list-optionsresource-version "listOptions.resourceVersionMatch" list-optionsresource-version-match "listOptions.timeoutSeconds" list-optionstimeout-seconds "listOptions.limit" list-optionslimit "listOptions.continue" list-optionscontinue "fields" fields }
              :form-params   {}
              :content-types ["application/json"]
              :accepts       ["application/json"]
              :auth-names    ["BearerToken"]})))
(defn workflow-service-watch-workflows
  ([namespace ] (workflow-service-watch-workflows namespace nil))
  ([namespace optional-params]
   (:data (workflow-service-watch-workflows-with-http-info namespace optional-params))))
(defn workflow-service-workflow-logs-with-http-info
  ([namespace name ] (workflow-service-workflow-logs-with-http-info namespace name nil))
  ([namespace name {:keys [pod-name log-optionscontainer log-optionsfollow log-optionsprevious log-optionssince-seconds log-optionssince-timeseconds log-optionssince-timenanos log-optionstimestamps log-optionstail-lines log-optionslimit-bytes log-optionsinsecure-skip-tls-verify-backend grep selector ]}]
   (call-api "/api/v1/workflows/{namespace}/{name}/log" :get
             {:path-params   {"namespace" namespace "name" name }
              :header-params {}
              :query-params  {"podName" pod-name "logOptions.container" log-optionscontainer "logOptions.follow" log-optionsfollow "logOptions.previous" log-optionsprevious "logOptions.sinceSeconds" log-optionssince-seconds "logOptions.sinceTime.seconds" log-optionssince-timeseconds "logOptions.sinceTime.nanos" log-optionssince-timenanos "logOptions.timestamps" log-optionstimestamps "logOptions.tailLines" log-optionstail-lines "logOptions.limitBytes" log-optionslimit-bytes "logOptions.insecureSkipTLSVerifyBackend" log-optionsinsecure-skip-tls-verify-backend "grep" grep "selector" selector }
              :form-params   {}
              :content-types ["application/json"]
              :accepts       ["application/json"]
              :auth-names    ["BearerToken"]})))
(defn workflow-service-workflow-logs
  ([namespace name ] (workflow-service-workflow-logs namespace name nil))
  ([namespace name optional-params]
   (:data (workflow-service-workflow-logs-with-http-info namespace name optional-params))))
 
(ns argo-workflows-api.api.event-source-service
  (:require [argo-workflows-api.core :refer [call-api check-required-params with-collection-format]])
  (:import (java.io File)))
(defn event-source-service-create-event-source-with-http-info
  [namespace body ]
  (call-api "/api/v1/event-sources/{namespace}" :post
            {:path-params   {"namespace" namespace }
             :header-params {}
             :query-params  {}
             :form-params   {}
             :body-param    body
             :content-types ["application/json"]
             :accepts       ["application/json"]
             :auth-names    ["BearerToken"]}))
(defn event-source-service-create-event-source
  [namespace body ]
  (:data (event-source-service-create-event-source-with-http-info namespace body)))
(defn event-source-service-delete-event-source-with-http-info
  ([namespace name ] (event-source-service-delete-event-source-with-http-info namespace name nil))
  ([namespace name {:keys [delete-optionsgrace-period-seconds delete-optionspreconditionsuid delete-optionspreconditionsresource-version delete-optionsorphan-dependents delete-optionspropagation-policy delete-optionsdry-run ]}]
   (call-api "/api/v1/event-sources/{namespace}/{name}" :delete
             {:path-params   {"namespace" namespace "name" name }
              :header-params {}
              :query-params  {"deleteOptions.gracePeriodSeconds" delete-optionsgrace-period-seconds "deleteOptions.preconditions.uid" delete-optionspreconditionsuid "deleteOptions.preconditions.resourceVersion" delete-optionspreconditionsresource-version "deleteOptions.orphanDependents" delete-optionsorphan-dependents "deleteOptions.propagationPolicy" delete-optionspropagation-policy "deleteOptions.dryRun" (with-collection-format delete-optionsdry-run :multi) }
              :form-params   {}
              :content-types ["application/json"]
              :accepts       ["application/json"]
              :auth-names    ["BearerToken"]})))
(defn event-source-service-delete-event-source
  ([namespace name ] (event-source-service-delete-event-source namespace name nil))
  ([namespace name optional-params]
   (:data (event-source-service-delete-event-source-with-http-info namespace name optional-params))))
(defn event-source-service-event-sources-logs-with-http-info
  ([namespace ] (event-source-service-event-sources-logs-with-http-info namespace nil))
  ([namespace {:keys [name event-source-type event-name grep pod-log-optionscontainer pod-log-optionsfollow pod-log-optionsprevious pod-log-optionssince-seconds pod-log-optionssince-timeseconds pod-log-optionssince-timenanos pod-log-optionstimestamps pod-log-optionstail-lines pod-log-optionslimit-bytes pod-log-optionsinsecure-skip-tls-verify-backend ]}]
   (call-api "/api/v1/stream/event-sources/{namespace}/logs" :get
             {:path-params   {"namespace" namespace }
              :header-params {}
              :query-params  {"name" name "eventSourceType" event-source-type "eventName" event-name "grep" grep "podLogOptions.container" pod-log-optionscontainer "podLogOptions.follow" pod-log-optionsfollow "podLogOptions.previous" pod-log-optionsprevious "podLogOptions.sinceSeconds" pod-log-optionssince-seconds "podLogOptions.sinceTime.seconds" pod-log-optionssince-timeseconds "podLogOptions.sinceTime.nanos" pod-log-optionssince-timenanos "podLogOptions.timestamps" pod-log-optionstimestamps "podLogOptions.tailLines" pod-log-optionstail-lines "podLogOptions.limitBytes" pod-log-optionslimit-bytes "podLogOptions.insecureSkipTLSVerifyBackend" pod-log-optionsinsecure-skip-tls-verify-backend }
              :form-params   {}
              :content-types ["application/json"]
              :accepts       ["application/json"]
              :auth-names    ["BearerToken"]})))
(defn event-source-service-event-sources-logs
  ([namespace ] (event-source-service-event-sources-logs namespace nil))
  ([namespace optional-params]
   (:data (event-source-service-event-sources-logs-with-http-info namespace optional-params))))
(defn event-source-service-get-event-source-with-http-info
  [namespace name ]
  (call-api "/api/v1/event-sources/{namespace}/{name}" :get
            {:path-params   {"namespace" namespace "name" name }
             :header-params {}
             :query-params  {}
             :form-params   {}
             :content-types ["application/json"]
             :accepts       ["application/json"]
             :auth-names    ["BearerToken"]}))
(defn event-source-service-get-event-source
  [namespace name ]
  (:data (event-source-service-get-event-source-with-http-info namespace name)))
(defn event-source-service-list-event-sources-with-http-info
  ([namespace ] (event-source-service-list-event-sources-with-http-info namespace nil))
  ([namespace {:keys [list-optionslabel-selector list-optionsfield-selector list-optionswatch list-optionsallow-watch-bookmarks list-optionsresource-version list-optionsresource-version-match list-optionstimeout-seconds list-optionslimit list-optionscontinue ]}]
   (call-api "/api/v1/event-sources/{namespace}" :get
             {:path-params   {"namespace" namespace }
              :header-params {}
              :query-params  {"listOptions.labelSelector" list-optionslabel-selector "listOptions.fieldSelector" list-optionsfield-selector "listOptions.watch" list-optionswatch "listOptions.allowWatchBookmarks" list-optionsallow-watch-bookmarks "listOptions.resourceVersion" list-optionsresource-version "listOptions.resourceVersionMatch" list-optionsresource-version-match "listOptions.timeoutSeconds" list-optionstimeout-seconds "listOptions.limit" list-optionslimit "listOptions.continue" list-optionscontinue }
              :form-params   {}
              :content-types ["application/json"]
              :accepts       ["application/json"]
              :auth-names    ["BearerToken"]})))
(defn event-source-service-list-event-sources
  ([namespace ] (event-source-service-list-event-sources namespace nil))
  ([namespace optional-params]
   (:data (event-source-service-list-event-sources-with-http-info namespace optional-params))))
(defn event-source-service-update-event-source-with-http-info
  [namespace name body ]
  (call-api "/api/v1/event-sources/{namespace}/{name}" :put
            {:path-params   {"namespace" namespace "name" name }
             :header-params {}
             :query-params  {}
             :form-params   {}
             :body-param    body
             :content-types ["application/json"]
             :accepts       ["application/json"]
             :auth-names    ["BearerToken"]}))
(defn event-source-service-update-event-source
  [namespace name body ]
  (:data (event-source-service-update-event-source-with-http-info namespace name body)))
(defn event-source-service-watch-event-sources-with-http-info
  ([namespace ] (event-source-service-watch-event-sources-with-http-info namespace nil))
  ([namespace {:keys [list-optionslabel-selector list-optionsfield-selector list-optionswatch list-optionsallow-watch-bookmarks list-optionsresource-version list-optionsresource-version-match list-optionstimeout-seconds list-optionslimit list-optionscontinue ]}]
   (call-api "/api/v1/stream/event-sources/{namespace}" :get
             {:path-params   {"namespace" namespace }
              :header-params {}
              :query-params  {"listOptions.labelSelector" list-optionslabel-selector "listOptions.fieldSelector" list-optionsfield-selector "listOptions.watch" list-optionswatch "listOptions.allowWatchBookmarks" list-optionsallow-watch-bookmarks "listOptions.resourceVersion" list-optionsresource-version "listOptions.resourceVersionMatch" list-optionsresource-version-match "listOptions.timeoutSeconds" list-optionstimeout-seconds "listOptions.limit" list-optionslimit "listOptions.continue" list-optionscontinue }
              :form-params   {}
              :content-types ["application/json"]
              :accepts       ["application/json"]
              :auth-names    ["BearerToken"]})))
(defn event-source-service-watch-event-sources
  ([namespace ] (event-source-service-watch-event-sources namespace nil))
  ([namespace optional-params]
   (:data (event-source-service-watch-event-sources-with-http-info namespace optional-params))))
 
(ns argo-workflows-api.api.cron-workflow-service
  (:require [argo-workflows-api.core :refer [call-api check-required-params with-collection-format]])
  (:import (java.io File)))
(defn cron-workflow-service-create-cron-workflow-with-http-info
  [namespace body ]
  (call-api "/api/v1/cron-workflows/{namespace}" :post
            {:path-params   {"namespace" namespace }
             :header-params {}
             :query-params  {}
             :form-params   {}
             :body-param    body
             :content-types ["application/json"]
             :accepts       ["application/json"]
             :auth-names    ["BearerToken"]}))
(defn cron-workflow-service-create-cron-workflow
  [namespace body ]
  (:data (cron-workflow-service-create-cron-workflow-with-http-info namespace body)))
(defn cron-workflow-service-delete-cron-workflow-with-http-info
  ([namespace name ] (cron-workflow-service-delete-cron-workflow-with-http-info namespace name nil))
  ([namespace name {:keys [delete-optionsgrace-period-seconds delete-optionspreconditionsuid delete-optionspreconditionsresource-version delete-optionsorphan-dependents delete-optionspropagation-policy delete-optionsdry-run ]}]
   (call-api "/api/v1/cron-workflows/{namespace}/{name}" :delete
             {:path-params   {"namespace" namespace "name" name }
              :header-params {}
              :query-params  {"deleteOptions.gracePeriodSeconds" delete-optionsgrace-period-seconds "deleteOptions.preconditions.uid" delete-optionspreconditionsuid "deleteOptions.preconditions.resourceVersion" delete-optionspreconditionsresource-version "deleteOptions.orphanDependents" delete-optionsorphan-dependents "deleteOptions.propagationPolicy" delete-optionspropagation-policy "deleteOptions.dryRun" (with-collection-format delete-optionsdry-run :multi) }
              :form-params   {}
              :content-types ["application/json"]
              :accepts       ["application/json"]
              :auth-names    ["BearerToken"]})))
(defn cron-workflow-service-delete-cron-workflow
  ([namespace name ] (cron-workflow-service-delete-cron-workflow namespace name nil))
  ([namespace name optional-params]
   (:data (cron-workflow-service-delete-cron-workflow-with-http-info namespace name optional-params))))
(defn cron-workflow-service-get-cron-workflow-with-http-info
  ([namespace name ] (cron-workflow-service-get-cron-workflow-with-http-info namespace name nil))
  ([namespace name {:keys [get-optionsresource-version ]}]
   (call-api "/api/v1/cron-workflows/{namespace}/{name}" :get
             {:path-params   {"namespace" namespace "name" name }
              :header-params {}
              :query-params  {"getOptions.resourceVersion" get-optionsresource-version }
              :form-params   {}
              :content-types ["application/json"]
              :accepts       ["application/json"]
              :auth-names    ["BearerToken"]})))
(defn cron-workflow-service-get-cron-workflow
  ([namespace name ] (cron-workflow-service-get-cron-workflow namespace name nil))
  ([namespace name optional-params]
   (:data (cron-workflow-service-get-cron-workflow-with-http-info namespace name optional-params))))
(defn cron-workflow-service-lint-cron-workflow-with-http-info
  [namespace body ]
  (call-api "/api/v1/cron-workflows/{namespace}/lint" :post
            {:path-params   {"namespace" namespace }
             :header-params {}
             :query-params  {}
             :form-params   {}
             :body-param    body
             :content-types ["application/json"]
             :accepts       ["application/json"]
             :auth-names    ["BearerToken"]}))
(defn cron-workflow-service-lint-cron-workflow
  [namespace body ]
  (:data (cron-workflow-service-lint-cron-workflow-with-http-info namespace body)))
(defn cron-workflow-service-list-cron-workflows-with-http-info
  ([namespace ] (cron-workflow-service-list-cron-workflows-with-http-info namespace nil))
  ([namespace {:keys [list-optionslabel-selector list-optionsfield-selector list-optionswatch list-optionsallow-watch-bookmarks list-optionsresource-version list-optionsresource-version-match list-optionstimeout-seconds list-optionslimit list-optionscontinue ]}]
   (call-api "/api/v1/cron-workflows/{namespace}" :get
             {:path-params   {"namespace" namespace }
              :header-params {}
              :query-params  {"listOptions.labelSelector" list-optionslabel-selector "listOptions.fieldSelector" list-optionsfield-selector "listOptions.watch" list-optionswatch "listOptions.allowWatchBookmarks" list-optionsallow-watch-bookmarks "listOptions.resourceVersion" list-optionsresource-version "listOptions.resourceVersionMatch" list-optionsresource-version-match "listOptions.timeoutSeconds" list-optionstimeout-seconds "listOptions.limit" list-optionslimit "listOptions.continue" list-optionscontinue }
              :form-params   {}
              :content-types ["application/json"]
              :accepts       ["application/json"]
              :auth-names    ["BearerToken"]})))
(defn cron-workflow-service-list-cron-workflows
  ([namespace ] (cron-workflow-service-list-cron-workflows namespace nil))
  ([namespace optional-params]
   (:data (cron-workflow-service-list-cron-workflows-with-http-info namespace optional-params))))
(defn cron-workflow-service-resume-cron-workflow-with-http-info
  [namespace name body ]
  (call-api "/api/v1/cron-workflows/{namespace}/{name}/resume" :put
            {:path-params   {"namespace" namespace "name" name }
             :header-params {}
             :query-params  {}
             :form-params   {}
             :body-param    body
             :content-types ["application/json"]
             :accepts       ["application/json"]
             :auth-names    ["BearerToken"]}))
(defn cron-workflow-service-resume-cron-workflow
  [namespace name body ]
  (:data (cron-workflow-service-resume-cron-workflow-with-http-info namespace name body)))
(defn cron-workflow-service-suspend-cron-workflow-with-http-info
  [namespace name body ]
  (call-api "/api/v1/cron-workflows/{namespace}/{name}/suspend" :put
            {:path-params   {"namespace" namespace "name" name }
             :header-params {}
             :query-params  {}
             :form-params   {}
             :body-param    body
             :content-types ["application/json"]
             :accepts       ["application/json"]
             :auth-names    ["BearerToken"]}))
(defn cron-workflow-service-suspend-cron-workflow
  [namespace name body ]
  (:data (cron-workflow-service-suspend-cron-workflow-with-http-info namespace name body)))
(defn cron-workflow-service-update-cron-workflow-with-http-info
  [namespace name body ]
  (call-api "/api/v1/cron-workflows/{namespace}/{name}" :put
            {:path-params   {"namespace" namespace "name" name }
             :header-params {}
             :query-params  {}
             :form-params   {}
             :body-param    body
             :content-types ["application/json"]
             :accepts       ["application/json"]
             :auth-names    ["BearerToken"]}))
(defn cron-workflow-service-update-cron-workflow
  [namespace name body ]
  (:data (cron-workflow-service-update-cron-workflow-with-http-info namespace name body)))
 
(ns argo-workflows-api.api.workflow-template-service
  (:require [argo-workflows-api.core :refer [call-api check-required-params with-collection-format]])
  (:import (java.io File)))
(defn workflow-template-service-create-workflow-template-with-http-info
  [namespace body ]
  (call-api "/api/v1/workflow-templates/{namespace}" :post
            {:path-params   {"namespace" namespace }
             :header-params {}
             :query-params  {}
             :form-params   {}
             :body-param    body
             :content-types ["application/json"]
             :accepts       ["application/json"]
             :auth-names    ["BearerToken"]}))
(defn workflow-template-service-create-workflow-template
  [namespace body ]
  (:data (workflow-template-service-create-workflow-template-with-http-info namespace body)))
(defn workflow-template-service-delete-workflow-template-with-http-info
  ([namespace name ] (workflow-template-service-delete-workflow-template-with-http-info namespace name nil))
  ([namespace name {:keys [delete-optionsgrace-period-seconds delete-optionspreconditionsuid delete-optionspreconditionsresource-version delete-optionsorphan-dependents delete-optionspropagation-policy delete-optionsdry-run ]}]
   (call-api "/api/v1/workflow-templates/{namespace}/{name}" :delete
             {:path-params   {"namespace" namespace "name" name }
              :header-params {}
              :query-params  {"deleteOptions.gracePeriodSeconds" delete-optionsgrace-period-seconds "deleteOptions.preconditions.uid" delete-optionspreconditionsuid "deleteOptions.preconditions.resourceVersion" delete-optionspreconditionsresource-version "deleteOptions.orphanDependents" delete-optionsorphan-dependents "deleteOptions.propagationPolicy" delete-optionspropagation-policy "deleteOptions.dryRun" (with-collection-format delete-optionsdry-run :multi) }
              :form-params   {}
              :content-types ["application/json"]
              :accepts       ["application/json"]
              :auth-names    ["BearerToken"]})))
(defn workflow-template-service-delete-workflow-template
  ([namespace name ] (workflow-template-service-delete-workflow-template namespace name nil))
  ([namespace name optional-params]
   (:data (workflow-template-service-delete-workflow-template-with-http-info namespace name optional-params))))
(defn workflow-template-service-get-workflow-template-with-http-info
  ([namespace name ] (workflow-template-service-get-workflow-template-with-http-info namespace name nil))
  ([namespace name {:keys [get-optionsresource-version ]}]
   (call-api "/api/v1/workflow-templates/{namespace}/{name}" :get
             {:path-params   {"namespace" namespace "name" name }
              :header-params {}
              :query-params  {"getOptions.resourceVersion" get-optionsresource-version }
              :form-params   {}
              :content-types ["application/json"]
              :accepts       ["application/json"]
              :auth-names    ["BearerToken"]})))
(defn workflow-template-service-get-workflow-template
  ([namespace name ] (workflow-template-service-get-workflow-template namespace name nil))
  ([namespace name optional-params]
   (:data (workflow-template-service-get-workflow-template-with-http-info namespace name optional-params))))
(defn workflow-template-service-lint-workflow-template-with-http-info
  [namespace body ]
  (call-api "/api/v1/workflow-templates/{namespace}/lint" :post
            {:path-params   {"namespace" namespace }
             :header-params {}
             :query-params  {}
             :form-params   {}
             :body-param    body
             :content-types ["application/json"]
             :accepts       ["application/json"]
             :auth-names    ["BearerToken"]}))
(defn workflow-template-service-lint-workflow-template
  [namespace body ]
  (:data (workflow-template-service-lint-workflow-template-with-http-info namespace body)))
(defn workflow-template-service-list-workflow-templates-with-http-info
  ([namespace ] (workflow-template-service-list-workflow-templates-with-http-info namespace nil))
  ([namespace {:keys [list-optionslabel-selector list-optionsfield-selector list-optionswatch list-optionsallow-watch-bookmarks list-optionsresource-version list-optionsresource-version-match list-optionstimeout-seconds list-optionslimit list-optionscontinue ]}]
   (call-api "/api/v1/workflow-templates/{namespace}" :get
             {:path-params   {"namespace" namespace }
              :header-params {}
              :query-params  {"listOptions.labelSelector" list-optionslabel-selector "listOptions.fieldSelector" list-optionsfield-selector "listOptions.watch" list-optionswatch "listOptions.allowWatchBookmarks" list-optionsallow-watch-bookmarks "listOptions.resourceVersion" list-optionsresource-version "listOptions.resourceVersionMatch" list-optionsresource-version-match "listOptions.timeoutSeconds" list-optionstimeout-seconds "listOptions.limit" list-optionslimit "listOptions.continue" list-optionscontinue }
              :form-params   {}
              :content-types ["application/json"]
              :accepts       ["application/json"]
              :auth-names    ["BearerToken"]})))
(defn workflow-template-service-list-workflow-templates
  ([namespace ] (workflow-template-service-list-workflow-templates namespace nil))
  ([namespace optional-params]
   (:data (workflow-template-service-list-workflow-templates-with-http-info namespace optional-params))))
(defn workflow-template-service-update-workflow-template-with-http-info
  [namespace name body ]
  (call-api "/api/v1/workflow-templates/{namespace}/{name}" :put
            {:path-params   {"namespace" namespace "name" name }
             :header-params {}
             :query-params  {}
             :form-params   {}
             :body-param    body
             :content-types ["application/json"]
             :accepts       ["application/json"]
             :auth-names    ["BearerToken"]}))
(defn workflow-template-service-update-workflow-template
  [namespace name body ]
  (:data (workflow-template-service-update-workflow-template-with-http-info namespace name body)))
 
(ns argo-workflows-api.core
  (:require [cheshire.core :refer [generate-string parse-string]]
            [clojure.string :as str]
            [clj-http.client :as client]
            [argoj.specs :as as]
            [schema.core :as s])
  (:import (com.fasterxml.jackson.core JsonParseException)
           (java.io File)
           (java.util Date TimeZone)
           (java.text SimpleDateFormat)))
(def auth-definitions
  {"BearerToken" {:type :api-key :in :header :param-name "Authorization"}})

Default API context.

(def default-api-context
  {:base-url        "http://localhost:2746"
   :date-format     "yyyy-MM-dd"
   :datetime-format "yyyy-MM-dd'T'HH:mm:ss.SSSXXX"
   :debug           false
   :auths           {"BearerToken" nil}})

Dynamic API context to be applied in API calls.

(def ^:dynamic *api-context*
  default-api-context)

A helper macro to wrap api-context with default values.

(defmacro with-api-context
  [api-context & body]
  `(let [api-context# ~api-context
         api-context# (-> *api-context*
                          (merge api-context#)
                          (assoc :auths (merge (:auths *api-context*) (:auths api-context#))))]
     (s/validate as/ArgoContext api-context#)
     (binding [*api-context* api-context#]
       ~@body)))

Throw exception if any of the given parameters is nil.

(defmacro check-required-params
  [& params]
  (->> params
       (map (fn [p]
              `(if (nil? ~p)
                 (throw (IllegalArgumentException. ~(str "The parameter \"" p "\" is required"))))))
       (list* 'do)))

Attach collection-format to meta data of the given parameter.

(defn with-collection-format
  [param collection-format]
  (and param (with-meta param {:collection-format collection-format})))
(defn- ^SimpleDateFormat make-date-format
  ([^String format-str] (make-date-format format-str nil))
  ([^String format-str ^String time-zone]
   (let [date-format (SimpleDateFormat. format-str)]
     (when time-zone
       (.setTimeZone date-format (TimeZone/getTimeZone time-zone)))
     date-format)))

Format the given Date object with the :date-format defined in api-options. NOTE: The UTC time zone is used.

(defn format-date
  [^Date date]
  (let [{:keys [date-format]} *api-context*]
    (-> (make-date-format date-format "UTC")
        (.format date))))

Parse the given string to a Date object with the :date-format defined in api-options. NOTE: The UTC time zone is used.

(defn parse-date
  [^String s]
  (let [{:keys [date-format]} *api-context*]
    (-> (make-date-format date-format "UTC")
        (.parse s))))

Format the given Date object with the :datetime-format defined in api-options. NOTE: The system's default time zone is used when not provided.

(defn format-datetime
  ([^Date date] (format-datetime date nil))
  ([^Date date ^String time-zone]
   (let [{:keys [datetime-format]} *api-context*]
     (-> (make-date-format datetime-format time-zone)
         (.format date)))))

Parse the given string to a Date object with the :datetime-format defined in api-options. NOTE: The system's default time zone is used when not provided.

(defn parse-datetime
  ([^String s] (parse-datetime s nil))
  ([^String s ^String time-zone]
   (let [{:keys [datetime-format]} *api-context*]
     (-> (make-date-format datetime-format time-zone)
         (.parse s)))))

Format the given parameter value to string.

(defn param->str
  [param]
  (cond
    (instance? Date param) (format-datetime param)
    (sequential? param) (str/join "," param)
    :else (str param)))

Process the given auth to an option map that might conatin request options and parameters.

(defn auth->opts
  [{:keys [type in param-name]} value]
  (case type
    :basic {:req-opts {:basic-auth value}}
    :oauth2 {:req-opts {:oauth-token value}}
    :api-key (case in
               :header {:header-params {param-name value}}
               :query {:query-params {param-name value}}
               (throw (IllegalArgumentException. (str "Invalid `in` for api-key auth: " in))))
    (throw (IllegalArgumentException. (str "Invalid auth `type`: " type)))))

Process the given auth name into options, which is merged into the given opts.

(defn process-auth
  [opts auth-name]
  (if-let [value (get-in *api-context* [:auths auth-name])]
    (merge-with merge
                opts
                (auth->opts (get auth-definitions auth-name) value))
    opts))

Process the given auth names to an option map that might conatin request options and parameters.

(defn auths->opts
  [auth-names]
  (reduce process-auth {} auth-names))
(declare normalize-param)

Make full URL by adding base URL and filling path parameters.

(defn make-url
  [path path-params]
  (let [path (reduce (fn [p [k v]]
                       (str/replace p (re-pattern (str "\\{" k "\\}")) (normalize-param v)))
                     path
                     path-params)]
    (str (:base-url *api-context*) path)))

Normalize array paramater according to :collection-format specified in the parameter's meta data. When the parameter contains File, a seq is returned so as to keep File parameters. For :multi collection format, a seq is returned which will be handled properly by clj-http. For other cases, a string is returned.

(defn normalize-array-param
  [xs]
  (if (some (partial instance? File) xs)
    (map normalize-param xs)
    (case (-> (meta xs) :collection-format (or :csv))
      :csv (str/join "," (map normalize-param xs))
      :ssv (str/join " " (map normalize-param xs))
      :tsv (str/join "\t" (map normalize-param xs))
      :pipes (str/join "|" (map normalize-param xs))
      :multi (map normalize-param xs))))

Normalize parameter value, handling three cases: for sequential value, apply normalize-array-param which handles collection format; for File value, use current value; otherwise, apply param->str.

(defn normalize-param
  [param]
  (cond
    (sequential? param) (normalize-array-param param)
    (instance? File param) param
    :else (param->str param)))

Normalize parameters values: remove nils, format to string with param->str.

(defn normalize-params
  [params]
  (->> params
       (remove (comp nil? second))
       (map (fn [[k v]] [k (normalize-param v)]))
       (into {})))

Check if the given MIME is a standard JSON MIME or :json.

(defn json-mime?
  [mime]
  (if mime
    (or (= :json mime)
        (re-matches #"(?i)application/json(;.*)?" (name mime)))))

Choose a MIME from the given MIMEs with JSON preferred, i.e. return JSON if included, otherwise return the first one.

(defn json-preferred-mime
  [mimes]
  (-> (filter json-mime? mimes)
      first
      (or (first mimes))))

Serialize the given data according to content-type. Only JSON is supported for now.

(defn serialize
  [data content-type]
  (if (json-mime? content-type)
    (generate-string data {:date-format (:datetime-format *api-context*)})
    (throw (IllegalArgumentException. (str "Content type \"" content-type "\" is not support for serialization")))))

Deserialize the given HTTP response according to the Content-Type header.

(defn deserialize
  [{:keys [body] {:keys [content-type]} :headers}]
  (cond
    (json-mime? content-type)
    (try
      (parse-string body true)
      (catch JsonParseException e
        ;; Return the body string directly on JSON parsing error.
        body))
    ;; For other cases, return the body string directly.
    :else body))

Convert the given form parameters map into a vector as clj-http's :multipart option.

(defn form-params->multipart
  [form-params]
  (->> form-params
       (map (fn [[k v]] (array-map :name k :content v)))
       vec))

Call an API by making HTTP request and return its response.

(defn- call-api*
  [path method {:keys [path-params body-param content-types accepts auth-names] :as opts}]
  (let [{:keys [debug]} *api-context*
        {:keys [req-opts query-params header-params form-params]} (auths->opts auth-names)
        query-params (merge query-params (:query-params opts))
        header-params (merge header-params (:header-params opts))
        form-params (merge form-params (:form-params opts))
        url (make-url path path-params)
        content-type (or (json-preferred-mime content-types) (and body-param :json))
        accept (or (json-preferred-mime accepts) :json)
        multipart? (= "multipart/form-data" content-type)
        req-opts (cond-> req-opts
                   true (assoc :url url :method method)
                   accept (assoc :accept accept)
                   (seq query-params) (assoc :query-params (normalize-params query-params))
                   (seq header-params) (assoc :headers (normalize-params header-params))
                   (and content-type (not multipart?)) (assoc :content-type content-type)
                   multipart? (assoc :multipart (-> form-params normalize-params form-params->multipart))
                   (and (not multipart?) (seq form-params)) (assoc :form-params (normalize-params form-params))
                   body-param (assoc :body (serialize body-param content-type))
                   debug (assoc :debug true :debug-body true))
        resp (client/request req-opts)]
    (when debug
      (println "Response:")
      (println resp))
    (assoc resp :data (deserialize resp))))

Catch HTTP error code and rewrap them into proper Argo Exception

(defn call-api
  [path method opts]
  (try
    (call-api* path method opts)
    (catch Exception e
      (let [{:keys [body]} (some-> e ex-data)
            data (if body (parse-string body keyword)
                     {:error (.getMessage e)})]
        (throw (ex-info "Argo Workflow Error" data))))))