Module: RockRMS::Client::AttributeValue

Included in:
RockRMS::Client
Defined in:
lib/rock_rms/resources/attribute_value.rb

Instance Method Summary collapse

Instance Method Details

#create_attribute_value(attribute_id:, entity_id:, value:) ⇒ Object



10
11
12
13
14
15
16
17
18
19
# File 'lib/rock_rms/resources/attribute_value.rb', line 10

def create_attribute_value(attribute_id:, entity_id:, value:)
  options = {
    'AttributeId' => attribute_id,
    'EntityId'    => entity_id,
    'Value'       => value,
    'IsSystem'    => false
  }

  post(attribute_values_path, options)
end

#list_attribute_values(options = {}) ⇒ Object



4
5
6
7
8
# File 'lib/rock_rms/resources/attribute_value.rb', line 4

def list_attribute_values(options = {})
  Response::AttributeValue.format(
    get(attribute_values_path, options)
  )
end

#update_attribute_value(id, attribute_id:, entity_id:, value:) ⇒ Object



21
22
23
24
25
26
27
28
29
# File 'lib/rock_rms/resources/attribute_value.rb', line 21

def update_attribute_value(id, attribute_id:, entity_id:, value:)
  options = {
    'AttributeId' => attribute_id,
    'EntityId'    => entity_id,
    'Value'       => value,
  }

  patch("#{attribute_values_path}/#{id}", options)
end