Class: Hook0::Generated::EventTypesApi
- Inherits:
-
Object
- Object
- Hook0::Generated::EventTypesApi
- Defined in:
- lib/hook0/generated/api.rb
Overview
What the API declares under eventTypes, issued through the transport it is handed.
Instance Method Summary collapse
-
#create(body) ⇒ EventType
Create a new event type.
-
#delete(event_type_name, application_id) ⇒ void
Delete an event type.
-
#get(event_type_name, application_id) ⇒ EventType
Get an event type by its name.
-
#initialize(transport) ⇒ EventTypesApi
constructor
A new instance of EventTypesApi.
-
#list(application_id) ⇒ Array<EventType>
List event types.
Constructor Details
#initialize(transport) ⇒ EventTypesApi
Returns a new instance of EventTypesApi.
288 289 290 |
# File 'lib/hook0/generated/api.rb', line 288 def initialize(transport) @transport = transport end |
Instance Method Details
#create(body) ⇒ EventType
Create a new event type
296 297 298 299 300 301 302 303 304 305 306 |
# File 'lib/hook0/generated/api.rb', line 296 def create(body) read_answer( @transport.request( "POST", "/api/v1/event_types/", [], body.to_h ), EventType.method(:from_json) ) end |
#delete(event_type_name, application_id) ⇒ void
This method returns an undefined value.
Delete an event type
313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 |
# File 'lib/hook0/generated/api.rb', line 313 def delete(event_type_name, application_id) check_answer( @transport.request( "DELETE", Runtime.path( "/api/v1/event_types/{event_type_name}", "event_type_name" => event_type_name ), Runtime.query( [ ["application_id", application_id] ], [] ), nil ) ) end |
#get(event_type_name, application_id) ⇒ EventType
Get an event type by its name
337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 |
# File 'lib/hook0/generated/api.rb', line 337 def get(event_type_name, application_id) read_answer( @transport.request( "GET", Runtime.path( "/api/v1/event_types/{event_type_name}", "event_type_name" => event_type_name ), Runtime.query( [ ["application_id", application_id] ], [] ), nil ), EventType.method(:from_json) ) end |
#list(application_id) ⇒ Array<EventType>
List event types
361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 |
# File 'lib/hook0/generated/api.rb', line 361 def list(application_id) read_answer( @transport.request( "GET", "/api/v1/event_types/", Runtime.query( [ ["application_id", application_id] ], [] ), nil ), Runtime.list(EventType.method(:from_json)) ) end |