def save
      validate!

      body = { box: to_hash }

      # versions are saved seperately
      body[:box].delete(:versions)

      # update or create the box
      begin
        response = Atlas.client.put(url_builder.box_url, body: body)
      rescue Atlas::Errors::NotFoundError
        body[:box].replace_key!(:private, :is_private)

        response = Atlas.client.post("/boxes", body: body)
      end

      # trigger the same on versions
      versions.each(&:save) if versions

      update_with_response(response, [:versions])
    end
def save
      validate!

      body = { box: to_hash }

      # versions are saved seperately
      body[:box].delete(:versions)

      # update or create the box
      begin
        response = Atlas.client.put(url_builder.box_url, body: body)
      rescue Atlas::Errors::NotFoundError
        body[:box].replace_key!(:private, :is_private)

        response = Atlas.client.post("/boxes", body: body)
      end

      # trigger the same on versions
      versions.each(&:save) if versions

      update_with_response(response, [:versions])
    end
Save the box.

 @return [Hash] Atlas response object.