Class: KillBillClient::Model::TagDefinition
Constant Summary
collapse
- KILLBILL_API_TAG_DEFINITIONS_PREFIX =
"#{KILLBILL_API_PREFIX}/tagDefinitions"
Constants inherited
from Resource
Resource::KILLBILL_API_PAGINATION_PREFIX, Resource::KILLBILL_API_PREFIX
Instance Attribute Summary
Attributes inherited from Resource
#clazz, #etag, #response, #session_id, #uri
Class Method Summary
collapse
Instance Method Summary
collapse
included
Methods inherited from Resource
#==, #_to_hash, attribute, create_alias, delete, extract_session_id, from_json, from_response, get, has_many, has_one, #hash, head, #initialize, instantiate_record_from_json, post, put, #refresh, require_multi_tenant_options!, #to_hash, #to_json
Class Method Details
.all(audit = 'NONE', options = {}) ⇒ Object
12
13
14
15
16
17
18
|
# File 'lib/killbill_client/models/tag_definition.rb', line 12
def all(audit = 'NONE', options = {})
get KILLBILL_API_TAG_DEFINITIONS_PREFIX,
{
:audit => audit
},
options
end
|
.find_by_id(id, audit = 'NONE', options = {}) ⇒ Object
20
21
22
23
24
25
26
|
# File 'lib/killbill_client/models/tag_definition.rb', line 20
def find_by_id(id, audit = 'NONE', options = {})
get "#{KILLBILL_API_TAG_DEFINITIONS_PREFIX}/#{id}",
{
:audit => audit
},
options
end
|
.find_by_name(name, audit = 'NONE', options = {}) ⇒ Object
28
29
30
|
# File 'lib/killbill_client/models/tag_definition.rb', line 28
def find_by_name(name, audit = 'NONE', options = {})
self.all(audit, options).select { |tag_definition| tag_definition.name == name }.first
end
|
Instance Method Details
#create(user = nil, reason = nil, comment = nil, options = {}) ⇒ Object
33
34
35
36
37
38
39
40
41
42
43
|
# File 'lib/killbill_client/models/tag_definition.rb', line 33
def create(user = nil, reason = nil, = nil, options = {})
created_tag_definition = self.class.post KILLBILL_API_TAG_DEFINITIONS_PREFIX,
to_json,
{},
{
:user => user,
:reason => reason,
:comment => ,
}.merge(options)
created_tag_definition.refresh(options)
end
|
#delete(user = nil, reason = nil, comment = nil, options = {}) ⇒ Object
45
46
47
48
49
50
51
52
53
54
|
# File 'lib/killbill_client/models/tag_definition.rb', line 45
def delete(user = nil, reason = nil, = nil, options = {})
self.class.delete "#{KILLBILL_API_TAG_DEFINITIONS_PREFIX}/#{id}",
to_json,
{},
{
:user => user,
:reason => reason,
:comment => ,
}.merge(options)
end
|