class Dependabot::Clients::Azure

def patch(url, json)

def patch(url, json)
  response = T.let(nil, T.nilable(Excon::Response))
  retry_connection_failures do
    response = Excon.patch(
      url,
      body: json,
      user: credentials&.fetch("username", nil),
      password: credentials&.fetch("password", nil),
      idempotent: true,
      **SharedHelpers.excon_defaults(
        headers: auth_header.merge(
          {
            "Content-Type" => "application/json"
          }
        )
      )
    )
    raise InternalServerError if response&.status == 500
    raise BadGateway if response&.status == 502
    raise ServiceNotAvailable if response&.status == 503
  end
  raise Unauthorized if response&.status == 401
  raise Forbidden if response&.status == 403
  raise NotFound if response&.status == 404
  T.must(response)
end