Class: SchwarmCli::Client
- Inherits:
-
Object
- Object
- SchwarmCli::Client
- Defined in:
- lib/schwarm_cli/client.rb,
lib/schwarm_cli/client/tasks.rb,
lib/schwarm_cli/client/skills.rb,
lib/schwarm_cli/client/resource.rb,
lib/schwarm_cli/client/skill_files.rb,
lib/schwarm_cli/client/repositories.rb,
lib/schwarm_cli/client/secret_files.rb,
lib/schwarm_cli/client/shared_agents.rb,
lib/schwarm_cli/client/user_messages.rb,
lib/schwarm_cli/client/agent_sessions.rb,
lib/schwarm_cli/client/task_templates.rb,
lib/schwarm_cli/client/recurring_tasks.rb,
lib/schwarm_cli/client/repository_agents.rb,
lib/schwarm_cli/client/repository_skills.rb
Defined Under Namespace
Classes: AgentSessions, RecurringTasks, Repositories, RepositoryAgents, RepositorySkills, Resource, SecretFiles, SharedAgents, SkillFiles, Skills, TaskTemplates, Tasks, UserMessages
Instance Attribute Summary collapse
-
#agents ⇒ Object
readonly
Returns the value of attribute agents.
-
#messages ⇒ Object
readonly
Returns the value of attribute messages.
-
#recurring ⇒ Object
readonly
Returns the value of attribute recurring.
-
#repo_skills ⇒ Object
readonly
Returns the value of attribute repo_skills.
-
#repositories ⇒ Object
readonly
Returns the value of attribute repositories.
-
#secrets ⇒ Object
readonly
Returns the value of attribute secrets.
-
#sessions ⇒ Object
readonly
Returns the value of attribute sessions.
-
#shared_agents ⇒ Object
readonly
Returns the value of attribute shared_agents.
-
#skill_files ⇒ Object
readonly
Returns the value of attribute skill_files.
-
#skills ⇒ Object
readonly
Returns the value of attribute skills.
-
#tasks ⇒ Object
readonly
Returns the value of attribute tasks.
-
#templates ⇒ Object
readonly
Returns the value of attribute templates.
Instance Method Summary collapse
- #delete ⇒ Object
- #get ⇒ Object
-
#initialize(url: nil, api_key: nil, config_path: Config::DEFAULT_PATH) ⇒ Client
constructor
A new instance of Client.
- #patch ⇒ Object
- #post ⇒ Object
Constructor Details
#initialize(url: nil, api_key: nil, config_path: Config::DEFAULT_PATH) ⇒ Client
Returns a new instance of Client.
32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/schwarm_cli/client.rb', line 32 def initialize(url: nil, api_key: nil, config_path: Config::DEFAULT_PATH) config = Config.new(url:, api_key:, config_path:) unless config.valid? raise Error, "Schwarm CLI not configured. Run `schwarm configure` or set SCHWARM_URL and SCHWARM_TOKEN." end @url = config.url @api_key = config.api_key init_resources end |
Instance Attribute Details
#agents ⇒ Object (readonly)
Returns the value of attribute agents.
23 24 25 |
# File 'lib/schwarm_cli/client.rb', line 23 def agents @agents end |
#messages ⇒ Object (readonly)
Returns the value of attribute messages.
23 24 25 |
# File 'lib/schwarm_cli/client.rb', line 23 def @messages end |
#recurring ⇒ Object (readonly)
Returns the value of attribute recurring.
23 24 25 |
# File 'lib/schwarm_cli/client.rb', line 23 def recurring @recurring end |
#repo_skills ⇒ Object (readonly)
Returns the value of attribute repo_skills.
23 24 25 |
# File 'lib/schwarm_cli/client.rb', line 23 def repo_skills @repo_skills end |
#repositories ⇒ Object (readonly)
Returns the value of attribute repositories.
23 24 25 |
# File 'lib/schwarm_cli/client.rb', line 23 def repositories @repositories end |
#secrets ⇒ Object (readonly)
Returns the value of attribute secrets.
23 24 25 |
# File 'lib/schwarm_cli/client.rb', line 23 def secrets @secrets end |
#sessions ⇒ Object (readonly)
Returns the value of attribute sessions.
23 24 25 |
# File 'lib/schwarm_cli/client.rb', line 23 def sessions @sessions end |
#shared_agents ⇒ Object (readonly)
Returns the value of attribute shared_agents.
23 24 25 |
# File 'lib/schwarm_cli/client.rb', line 23 def shared_agents @shared_agents end |
#skill_files ⇒ Object (readonly)
Returns the value of attribute skill_files.
23 24 25 |
# File 'lib/schwarm_cli/client.rb', line 23 def skill_files @skill_files end |
#skills ⇒ Object (readonly)
Returns the value of attribute skills.
23 24 25 |
# File 'lib/schwarm_cli/client.rb', line 23 def skills @skills end |
#tasks ⇒ Object (readonly)
Returns the value of attribute tasks.
23 24 25 |
# File 'lib/schwarm_cli/client.rb', line 23 def tasks @tasks end |
#templates ⇒ Object (readonly)
Returns the value of attribute templates.
23 24 25 |
# File 'lib/schwarm_cli/client.rb', line 23 def templates @templates end |
Instance Method Details
#delete ⇒ Object
30 |
# File 'lib/schwarm_cli/client.rb', line 30 def delete(...) = conn.delete(...) |
#get ⇒ Object
27 |
# File 'lib/schwarm_cli/client.rb', line 27 def get(...) = conn.get(...) |
#patch ⇒ Object
29 |
# File 'lib/schwarm_cli/client.rb', line 29 def patch(...) = conn.patch(...) |
#post ⇒ Object
28 |
# File 'lib/schwarm_cli/client.rb', line 28 def post(...) = conn.post(...) |