class SemaphoreClient::Api::ConfigFile
Public Class Methods
new(http_client)
click to toggle source
# File lib/semaphore_client/api/config_file.rb, line 4 def initialize(http_client) @http_client = http_client end
Public Instance Methods
create_for_secret(secret_id, params = nil, options = {})
click to toggle source
# File lib/semaphore_client/api/config_file.rb, line 35 def create_for_secret(secret_id, params = nil, options = {}) create_for_secret!(secret_id, params, options) rescue SemaphoreClient::Exceptions::ResponseError end
create_for_secret!(secret_id, params = nil, options = {})
click to toggle source
# File lib/semaphore_client/api/config_file.rb, line 40 def create_for_secret!(secret_id, params = nil, options = {}) path = "/secrets/#{secret_id}/config_files" response = @http_client.post(path, params, options) SemaphoreClient::Model::ConfigFile.load(response.body) end
delete(id, params = nil, options = {})
click to toggle source
# File lib/semaphore_client/api/config_file.rb, line 63 def delete(id, params = nil, options = {}) delete!(id, params, options) rescue SemaphoreClient::Exceptions::ResponseError end
delete!(id, params = nil, options = {})
click to toggle source
# File lib/semaphore_client/api/config_file.rb, line 68 def delete!(id, params = nil, options = {}) path = "/config_files/#{id}" @http_client.delete(path, params) end
get(id, params = nil, options = {})
click to toggle source
# File lib/semaphore_client/api/config_file.rb, line 49 def get(id, params = nil, options = {}) get!(id, params, options) rescue SemaphoreClient::Exceptions::ResponseError end
get!(id, params = nil, options = {})
click to toggle source
# File lib/semaphore_client/api/config_file.rb, line 54 def get!(id, params = nil, options = {}) path = "/config_files/#{id}" response = @http_client.get(path, params = {}) SemaphoreClient::Model::ConfigFile.load(response.body) end
list_for_project(project_id, params = nil, options = {})
click to toggle source
# File lib/semaphore_client/api/config_file.rb, line 9 def list_for_project(project_id, params = nil, options = {}) list_for_project!(project_id, params, options) rescue SemaphoreClient::Exceptions::ResponseError end
list_for_project!(project_id, params = nil, options = {})
click to toggle source
# File lib/semaphore_client/api/config_file.rb, line 14 def list_for_project!(project_id, params = nil, options = {}) path = "/projects/#{project_id}/config_files" @http_client.get(path, params, options = {}).body.map { |e| SemaphoreClient::Model::ConfigFile.load(e) } end
list_for_secret(secret_id, params = nil, options = {})
click to toggle source
# File lib/semaphore_client/api/config_file.rb, line 22 def list_for_secret(secret_id, params = nil, options = {}) list_for_secret!(secret_id, params, options) rescue SemaphoreClient::Exceptions::ResponseError end
list_for_secret!(secret_id, params = nil, options = {})
click to toggle source
# File lib/semaphore_client/api/config_file.rb, line 27 def list_for_secret!(secret_id, params = nil, options = {}) path = "/secrets/#{secret_id}/config_files" @http_client.get(path, params, options = {}).body.map { |e| SemaphoreClient::Model::ConfigFile.load(e) } end
update(id, params = nil, options = {})
click to toggle source
# File lib/semaphore_client/api/config_file.rb, line 76 def update(id, params = nil, options = {}) update!(id, params, options) rescue SemaphoreClient::Exceptions::ResponseError end
update!(id, params = nil, options = {})
click to toggle source
# File lib/semaphore_client/api/config_file.rb, line 81 def update!(id, params = nil, options = {}) path = "/config_files/#{id}" response = @http_client.patch(path, params) SemaphoreClient::Model::ConfigFile.load(response.body) end