class Account::Webhooks::Outgoing::DeliveryAttemptsController

def create

POST /account/webhooks/outgoing/deliveries/:delivery_id/delivery_attempts.json
POST /account/webhooks/outgoing/deliveries/:delivery_id/delivery_attempts
def create
  respond_to do |format|
    if @delivery_attempt.save
      format.html { redirect_to [:account, @delivery, :delivery_attempts], notice: I18n.t("webhooks/outgoing/delivery_attempts.notifications.created") }
      format.json { render :show, status: :created, location: [:account, @delivery_attempt] }
    else
      format.html { render :new, status: :unprocessable_entity }
      format.json { render json: @delivery_attempt.errors, status: :unprocessable_entity }
    end
  end
end

def delivery_attempt_params

Never trust parameters from the scary internet, only allow the white list through.
def delivery_attempt_params
  strong_params = params.require(:webhooks_outgoing_delivery_attempt).permit(
    :response_code,
    :response_body,
    :response_message,
    :error_message,
    :attempt_number,
    # 🚅 super scaffolding will insert new fields above this line.
    # 🚅 super scaffolding will insert new arrays above this line.
  )
  # 🚅 super scaffolding will insert processing for new fields above this line.
  strong_params
end

def destroy

DELETE /account/webhooks/outgoing/delivery_attempts/:id.json
DELETE /account/webhooks/outgoing/delivery_attempts/:id
def destroy
  @delivery_attempt.destroy
  respond_to do |format|
    format.html { redirect_to [:account, @delivery, :delivery_attempts], notice: I18n.t("webhooks/outgoing/delivery_attempts.notifications.destroyed") }
    format.json { head :no_content }
  end
end

def edit

GET /account/webhooks/outgoing/delivery_attempts/:id/edit
def edit
end

def index

GET /account/webhooks/outgoing/deliveries/:delivery_id/delivery_attempts.json
GET /account/webhooks/outgoing/deliveries/:delivery_id/delivery_attempts
def index
  # if you only want these objects shown on their parent's show page, uncomment this:
  redirect_to [:account, @delivery]
end

def new

GET /account/webhooks/outgoing/deliveries/:delivery_id/delivery_attempts/new
def new
end

def show

GET /account/webhooks/outgoing/delivery_attempts/:id.json
GET /account/webhooks/outgoing/delivery_attempts/:id
def show
end

def update

PATCH/PUT /account/webhooks/outgoing/delivery_attempts/:id.json
PATCH/PUT /account/webhooks/outgoing/delivery_attempts/:id
def update
  respond_to do |format|
    if @delivery_attempt.update(delivery_attempt_params)
      format.html { redirect_to [:account, @delivery_attempt], notice: I18n.t("webhooks/outgoing/delivery_attempts.notifications.updated") }
      format.json { render :show, status: :ok, location: [:account, @delivery_attempt] }
    else
      format.html { render :edit, status: :unprocessable_entity }
      format.json { render json: @delivery_attempt.errors, status: :unprocessable_entity }
    end
  end
end