Class: Convoy::EventType

Inherits:
ApiResource show all
Includes:
ApiOperations::Create, ApiOperations::Get, ApiOperations::List, ApiOperations::Save
Defined in:
lib/convoy/resources/event_type.rb

Instance Attribute Summary

Attributes inherited from ApiResource

#response

Instance Method Summary collapse

Methods included from ApiOperations::Create

#create

Methods included from ApiOperations::Save

included, #save, #update

Methods included from ApiOperations::List

included, #list

Methods included from ApiOperations::Get

#get, included

Methods inherited from ApiResource

#project_base_uri

Methods included from ApiOperations::Request

#send_request

Constructor Details

#initialize(id = nil, config = Convoy.config, **kwargs) ⇒ EventType

Returns a new instance of EventType.



8
9
10
11
12
13
# File 'lib/convoy/resources/event_type.rb', line 8

def initialize(id = nil, config = Convoy.config, **kwargs)
  @id = id 
  @config = config

  super(**kwargs)
end

Instance Method Details

#deprecateObject



23
24
25
26
# File 'lib/convoy/resources/event_type.rb', line 23

def deprecate
  deprecate_url = "#{resource_uri}/deprecate"
  send_request(deprecate_url, :post, data: @data, params: @params)
end

#resource_uriObject



15
16
17
18
19
20
21
# File 'lib/convoy/resources/event_type.rb', line 15

def resource_uri
  if @id.nil?
    return "#{project_base_uri}/event-types"
  end

  "#{project_base_uri}/event-types/#{@id}"
end