You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: update.rb
    path of file: ./repos/spree/core/app/services/spree/addresses
    
    the code of the file until where you have to start completion: module Spree
  module Addresses
    class Update
      prepend Spree::ServiceModule::Base
      inclu
    
      def call(address:, address_params:)
        address_params[:country_id] ||= address.country_id
        address_params = fill_country_and_state_ids(address_params)
        address_params[:user_id] = address.user_id if address.user_id.present?

        if address&.editable?
          address.update(address_params) ? success(address) : failure(address)
        else
          if new_address(address_params).valid?
            address.destroy
            success(new_address)
          else
            failure(new_address)
          end