Class: Openpix::RubySdk::Resources::Customer
- Inherits:
-
Resource
- Object
- Resource
- Openpix::RubySdk::Resources::Customer
show all
- Defined in:
- lib/openpix/ruby_sdk/resources/customer.rb
Overview
Make API operations on Customer resource
Constant Summary
collapse
- ATTRS =
%w[
name
email
phone
taxID
correlationID
address
].freeze
Instance Method Summary
collapse
Methods inherited from Resource
#fetch, #fetch!, #fetch_next_page!, #fetch_previous_page!, #find, #find!, #initialize, #save, #save!, #to_collection_resource, #to_single_resource
Instance Method Details
#create_attributes ⇒ Object
28
29
30
|
# File 'lib/openpix/ruby_sdk/resources/customer.rb', line 28
def create_attributes
ATTRS
end
|
#destroy(id:) ⇒ Object
rubocop:disable Lint/UnusedMethodArgument
47
48
49
50
51
52
|
# File 'lib/openpix/ruby_sdk/resources/customer.rb', line 47
def destroy(id:)
raise(
ActionNotImplementedError,
'customer does not implement DELETE action'
)
end
|
#destroy!(id:) ⇒ Object
54
55
56
57
58
59
|
# File 'lib/openpix/ruby_sdk/resources/customer.rb', line 54
def destroy!(id:)
raise(
ActionNotImplementedError,
'customer does not implement DELETE action'
)
end
|
#init_body(params: {}, rest: {}) ⇒ Object
24
25
26
|
# File 'lib/openpix/ruby_sdk/resources/customer.rb', line 24
def init_body(params: {}, rest: {})
super(base_attrs: ATTRS, params: params, rest: rest)
end
|
#to_body ⇒ Object
36
37
38
39
40
41
42
43
44
|
# File 'lib/openpix/ruby_sdk/resources/customer.rb', line 36
def to_body
body = super
return body if body['address'].nil? || body['address'].empty?
body['address'] = Openpix::RubySdk::ApiBodyFormatter.remove_empty_values(body['address'])
body
end
|
#to_url ⇒ Object
32
33
34
|
# File 'lib/openpix/ruby_sdk/resources/customer.rb', line 32
def to_url
'customer'
end
|