Class: Openpix::RubySdk::Resources::Subscription
- Inherits:
-
Resource
- Object
- Resource
- Openpix::RubySdk::Resources::Subscription
show all
- Defined in:
- lib/openpix/ruby_sdk/resources/subscription.rb
Overview
Make API operations on Subscription resource
Constant Summary
collapse
- ATTRS =
%w[
value
dayGenerateCharge
customer
chargeType
].freeze
Instance Method Summary
collapse
Methods inherited from Resource
#find, #find!, #initialize, #save, #save!, #to_collection_resource
Instance Method Details
#create_attributes ⇒ Object
26
27
28
|
# File 'lib/openpix/ruby_sdk/resources/subscription.rb', line 26
def create_attributes
ATTRS
end
|
#destroy(id:) ⇒ Object
77
78
79
80
81
82
|
# File 'lib/openpix/ruby_sdk/resources/subscription.rb', line 77
def destroy(id:)
raise(
ActionNotImplementedError,
'subscription does not implement DELETE action'
)
end
|
#destroy!(id:) ⇒ Object
84
85
86
87
88
89
|
# File 'lib/openpix/ruby_sdk/resources/subscription.rb', line 84
def destroy!(id:)
raise(
ActionNotImplementedError,
'subscription does not implement DELETE action'
)
end
|
#fetch(skip: nil, limit: nil, extra_headers: {}) ⇒ Object
rubocop:disable Lint/UnusedMethodArgument
49
50
51
52
53
54
|
# File 'lib/openpix/ruby_sdk/resources/subscription.rb', line 49
def fetch(skip: nil, limit: nil, extra_headers: {})
raise(
ActionNotImplementedError,
'subscription does not implement GET index action'
)
end
|
#fetch!(skip: nil, limit: nil, extra_headers: {}) ⇒ Object
56
57
58
59
60
61
|
# File 'lib/openpix/ruby_sdk/resources/subscription.rb', line 56
def fetch!(skip: nil, limit: nil, extra_headers: {})
raise(
ActionNotImplementedError,
'subscription does not implement GET index action'
)
end
|
#fetch_next_page!(extra_headers: {}) ⇒ Object
63
64
65
66
67
68
|
# File 'lib/openpix/ruby_sdk/resources/subscription.rb', line 63
def fetch_next_page!(extra_headers: {})
raise(
ActionNotImplementedError,
'subscription does not implement GET index action'
)
end
|
#fetch_previous_page!(extra_headers: {}) ⇒ Object
70
71
72
73
74
75
|
# File 'lib/openpix/ruby_sdk/resources/subscription.rb', line 70
def fetch_previous_page!(extra_headers: {})
raise(
ActionNotImplementedError,
'subscription does not implement GET index action'
)
end
|
#init_body(params: {}, rest: {}) ⇒ Object
22
23
24
|
# File 'lib/openpix/ruby_sdk/resources/subscription.rb', line 22
def init_body(params: {}, rest: {})
super(base_attrs: ATTRS, params: params, rest: rest)
end
|
#to_body ⇒ Object
38
39
40
41
42
43
44
45
46
|
# File 'lib/openpix/ruby_sdk/resources/subscription.rb', line 38
def to_body
body = super
return body if body['customer'].nil? || body['customer'].empty?
body['customer'] = Openpix::RubySdk::ApiBodyFormatter.remove_empty_values(body['customer'])
body
end
|
#to_single_resource ⇒ Object
34
35
36
|
# File 'lib/openpix/ruby_sdk/resources/subscription.rb', line 34
def to_single_resource
'subscription'
end
|
#to_url ⇒ Object
30
31
32
|
# File 'lib/openpix/ruby_sdk/resources/subscription.rb', line 30
def to_url
'subscriptions'
end
|