Class: Foil::Server::GateServicesResource
- Inherits:
-
BaseResource
- Object
- BaseResource
- Foil::Server::GateServicesResource
- Defined in:
- lib/foil/server/client.rb
Instance Method Summary collapse
- #create(id:, name:, description:, website:, webhook_endpoint_id:, discoverable: nil, dashboard_login_url: nil, env_vars: nil, docs_url: nil, sdks: nil, branding: nil, consent: nil) ⇒ Object
- #disable(service_id) ⇒ Object
- #get(service_id) ⇒ Object
- #list ⇒ Object
- #update(service_id, discoverable: nil, name: nil, description: nil, website: nil, dashboard_login_url: nil, webhook_endpoint_id: nil, env_vars: nil, docs_url: nil, sdks: nil, branding: nil, consent: nil) ⇒ Object
Methods inherited from BaseResource
Constructor Details
This class inherits a constructor from Foil::Server::BaseResource
Instance Method Details
#create(id:, name:, description:, website:, webhook_endpoint_id:, discoverable: nil, dashboard_login_url: nil, env_vars: nil, docs_url: nil, sdks: nil, branding: nil, consent: nil) ⇒ Object
335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 |
# File 'lib/foil/server/client.rb', line 335 def create(id:, name:, description:, website:, webhook_endpoint_id:, discoverable: nil, dashboard_login_url: nil, env_vars: nil, docs_url: nil, sdks: nil, branding: nil, consent: nil) @client.request_json("POST", "/v1/gate/services", body: compact({ id: id, discoverable: discoverable, name: name, description: description, website: website, dashboard_login_url: dashboard_login_url, webhook_endpoint_id: webhook_endpoint_id, env_vars: env_vars, docs_url: docs_url, sdks: sdks, branding: branding, consent: }))[:data] end |
#disable(service_id) ⇒ Object
368 369 370 |
# File 'lib/foil/server/client.rb', line 368 def disable(service_id) @client.request_json("DELETE", "/v1/gate/services/#{CGI.escape(service_id)}")[:data] end |
#get(service_id) ⇒ Object
331 332 333 |
# File 'lib/foil/server/client.rb', line 331 def get(service_id) @client.request_json("GET", "/v1/gate/services/#{CGI.escape(service_id)}")[:data] end |
#list ⇒ Object
327 328 329 |
# File 'lib/foil/server/client.rb', line 327 def list @client.request_json("GET", "/v1/gate/services")[:data] end |
#update(service_id, discoverable: nil, name: nil, description: nil, website: nil, dashboard_login_url: nil, webhook_endpoint_id: nil, env_vars: nil, docs_url: nil, sdks: nil, branding: nil, consent: nil) ⇒ Object
352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 |
# File 'lib/foil/server/client.rb', line 352 def update(service_id, discoverable: nil, name: nil, description: nil, website: nil, dashboard_login_url: nil, webhook_endpoint_id: nil, env_vars: nil, docs_url: nil, sdks: nil, branding: nil, consent: nil) @client.request_json("PATCH", "/v1/gate/services/#{CGI.escape(service_id)}", body: compact({ discoverable: discoverable, name: name, description: description, website: website, dashboard_login_url: dashboard_login_url, webhook_endpoint_id: webhook_endpoint_id, env_vars: env_vars, docs_url: docs_url, sdks: sdks, branding: branding, consent: }))[:data] end |