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
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
7
8
9
10
11
12
13
|
# File 'lib/killbill_client/models/tag_definition.rb', line 7
def all(audit = 'NONE', options = {})
get KILLBILL_API_TAG_DEFINITIONS_PREFIX,
{
:audit => audit
},
options
end
|
.find_by_id(id, audit = 'NONE', options = {}) ⇒ Object
15
16
17
18
19
20
21
|
# File 'lib/killbill_client/models/tag_definition.rb', line 15
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
23
24
25
|
# File 'lib/killbill_client/models/tag_definition.rb', line 23
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
28
29
30
31
32
33
34
35
36
37
38
|
# File 'lib/killbill_client/models/tag_definition.rb', line 28
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
40
41
42
43
44
45
46
47
48
49
|
# File 'lib/killbill_client/models/tag_definition.rb', line 40
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
|