Method: MicrosoftGraph::BaseEntity#save!

Defined in:
lib/microsoft_graph/base_entity.rb

#save!Object

Raises:



75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/microsoft_graph/base_entity.rb', line 75

def save!
  raise NoAssociationError unless parent
  raise_no_graph_error! unless graph
  if persisted?
    graph.service.patch(path, to_json(only: @dirty_properties.keys, convert_to_camel_case: true))
  else
    initialize_serialized_properties(
      graph.service.post(parent.path, to_json(convert_to_camel_case: true))
    )
    @persisted = true
  end
  mark_clean
  true
end