defmodule Plaid.Factory do
  @moduledoc false

  def http_response_body(:accounts) do
    %{
      "accounts" => [
        %{
          "account_id" => "vzeNDwK7KQIm4yEog683uElbp9GRLEFXGK98D",
          "balances" => %{
            "available" => 100,
            "current" => 110,
            "limit" => nil,
            "iso_currency_code" => "USD",
            "unofficial_currency_code" => nil
          },
          "mask" => "0000",
          "name" => "Plaid Checking",
          "official_name" => "Plaid Gold Checking",
          "subtype" => "checking",
          "type" => "depository",
          "verification_status" => nil
        },
        %{
          "account_id" => "6Myq63K1KDSe3lBwp7K1fnEbNGLV4nSxalVdW",
          "balances" => %{
            "available" => nil,
            "current" => 410,
            "limit" => 2000,
            "iso_currency_code" => "USD",
            "unofficial_currency_code" => nil
          },
          "mask" => "3333",
          "name" => "Plaid Credit Card",
          "official_name" => "Plaid Diamond Credit Card",
          "subtype" => "credit card",
          "type" => "credit",
          "verification_status" => nil
        },
        %{
          "account_id" => "dhfDuX0N3Yia57IMOGE3m7faUlwvPQLbxs7Oc",
          "balances" => %{
            "available" => 200,
            "current" => 500,
            "limit" => 4000,
            "iso_currency_code" => "USD",
            "unofficial_currency_code" => nil
          },
          "mask" => "9876",
          "name" => "Plaid Platinum Checking",
          "official_name" => "Plaid Platinum Checking",
          "subtype" => "checking",
          "type" => "depository",
          "verification_status" => "automatically_verified"
        }
      ],
      "item" => %{
        "available_products" => ["balance", "auth"],
        "billed_products" => ["identity", "transactions"],
        "error" => nil,
        "institution_id" => "ins_109508",
        "item_id" => "Ed6bjNrDLJfGvZWwnkQlfxwoNz54B5C97ejBr",
        "webhook" => "https://plaid.com/example/hook"
      },
      "request_id" => "45QSn"
    }
  end

  def http_response_body(:auth) do
    account = http_response_body(:accounts)

    %{
      "accounts" => account["accounts"],
      "numbers" => %{
        "ach" => [
          %{
            "account" => "9900009606",
            "account_id" => "vzeNDwK7KQIm4yEog683uElbp9GRLEFXGK98D",
            "routing" => "011401533",
            "wire_routing" => "021000021"
          }
        ],
        "eft" => [
          %{
            "account" => "111122223333",
            "account_id" => "vzeNDwK7KQIm4yEog683uElbp9GRLEFXGK98D",
            "institution" => "021",
            "branch" => "01140"
          }
        ],
        "international" => [
          %{
            "account_id" => "vzeNDwK7KQIm4yEog683uElbp9GRLEFXGK98D",
            "bic" => "NWBKGB21",
            "iban" => "GB29NWBK60161331926819"
          }
        ],
        "bacs" => [
          %{
            "account" => "31926819",
            "account_id" => "vzeNDwK7KQIm4yEog683uElbp9GRLEFXGK98D",
            "sort_code" => "601613"
          }
        ]
      },
      "item" => account["item"],
      "request_id" => "35QSp"
    }
  end

  def http_response_body(:item) do
    %{
      "access_token" => "access-sandbox-e9317406-8413",
      "item" => %{
        "available_products" => ["balance", "auth"],
        "billed_products" => ["identity", "transactions"],
        "error" => nil,
        "institution_id" => "ins_109508",
        "item_id" => "Ed6bjNrDLJfGvZWwnkQlfxwoNz54B5C97ejBr",
        "webhook" => "https://plaid.com/example/hook"
      },
      "request_id" => "qpCtl",
      "status" => %{
        "last_webhook" => %{
          "sent_at" => "2019-02-15T15:53:00Z",
          "code_sent" => "DEFAULT_UPDATE"
        },
        "transactions" => %{
          "last_failed_update" => nil,
          "last_successful_update" => "2020-05-19T23:16:55.038Z"
        },
        "investments" => %{
          "last_successful_update" => "2019-05-23T19:51:00Z",
          "last_failed_update" => "2019-03-15T02:10:00Z"
        }
      }
    }
  end

  def http_response_body(:exchange_public_token) do
    %{
      "access_token" => "access-sandbox-e9317406-8413",
      "item_id" => "Ed6bjNrDLJfGvZWwnkQlfxwoNz54B5C97ejBr",
      "request_id" => "qpCtl"
    }
  end

  def http_response_body(:create_public_token) do
    %{
      "public_token" => "public-sandbox-ae89b269-724d-48fe-af9a-cb31c2d1708a",
      "expiration" => "2017-08-12T21:24:42Z",
      "request_id" => "zxKj9"
    }
  end

  def http_response_body(:webhook) do
    %{
      "access_token" => "access-sandbox-e9317406-8413",
      "item" => %{
        "available_products" => ["balance", "auth"],
        "billed_products" => ["identity", "transactions"],
        "error" => nil,
        "institution_id" => "ins_109508",
        "item_id" => "Ed6bjNrDLJfGvZWwnkQlfxwoNz54B5C97ejBr",
        "webhook" => "https://plaid.com/updated/hook"
      },
      "request_id" => "qpCtl"
    }
  end

  def http_response_body(:rotate_access_token) do
    %{
      "new_access_token" => "access-sandbox-7c69d345-fd46",
      "request_id" => "ou2XQ"
    }
  end

  def http_response_body(:update_version_access_token) do
    %{
      "access_token" => "access-sandbox-x9v2d345-as9c",
      "request_id" => "c92aB"
    }
  end

  def http_response_body(:remove) do
    %{
      "request_id" => "s72lQ"
    }
  end

  def http_response_body(:error) do
    %{
      "error_type" => "INVALID_REQUEST",
      "error_code" => "MISSING_FIELDS",
      "error_message" => "Something went bad wrong.",
      "display_message" => "lol wut",
      "request_id" => "h12lD"
    }
  end

  def http_response_body(:categories) do
    %{
      "categories" => [
        %{
          "group" => "place",
          "hierarchy" => ["Recreation", "Arts & Entertainment", "Circuses and Carnivals"],
          "category_id" => "17001013"
        }
      ],
      "request_id" => "qpCtl"
    }
  end

  def http_response_body(:income) do
    %{
      "item" => %{
        "available_products" => ["balance", "auth"],
        "billed_products" => ["identity", "transactions"],
        "error" => nil,
        "institution_id" => "ins_109508",
        "item_id" => "Ed6bjNrDLJfGvZWwnkQlfxwoNz54B5C97ejBr",
        "webhook" => "https://plaid.com/example/hook"
      },
      "income" => %{
        "income_streams" => [
          %{
            "confidence" => 1,
            "days" => 518,
            "monthly_income" => 1601,
            "name" => "PLAID"
          },
          %{
            "confidence" => 0.95,
            "days" => 415,
            "monthly_income" => 1530,
            "name" => "BAGUETTES INC"
          }
        ],
        "last_year_income" => 28_072,
        "last_year_income_before_tax" => 38_681,
        "projected_yearly_income" => 19_444,
        "projected_yearly_income_before_tax" => 26_291,
        "max_number_of_overlapping_income_streams" => 2,
        "number_of_income_streams" => 3
      },
      "request_id" => "m8MDnv9okwxFNBV"
    }
  end

  def http_response_body(:institutions) do
    %{
      "institutions" => [
        %{
          "country_codes" => ["US"],
          "credentials" => [
            %{"label" => "Username", "name" => "username", "type" => "text"},
            %{"label" => "Password", "name" => "password", "type" => "password"}
          ],
          "has_mfa" => true,
          "input_spec" => "fixed",
          "institution_id" => "ins_112060",
          "logo" =>
            "iVBORw0KGgoAAAANSUhEUgAAAJgAAACYCAMAAAAvHNATAAAA2FBMVEVHcEz////////////////////////////////////////////////////////////////////////QExbQDxHc5OLY2tnl5ub7+/zVP0XZ39719vZQICrq7Oz+/v7v8fHPCgvTBQa5GB3WEBFETFbPBAbWUVbZ0NDbx8kqMTtpcHY3PUciJS+ZnqPUJSkXHSc4JzF5foW6vcDFyMrO0dOts7b4w8pcY2vYZGqpGB3c7OpOVV3609mlqa3ooqi/FRhWXGSLj5ThsrbigIfZvL+QHiVuHif85ek+7ovgAAAAEnRSTlMAlmmfqoE15SESS9TAus/KxqM83ZL5AAAO+klEQVR42syaj1+izBPHs+xQu+4u5McKsZC/EkQN8Eed4SPZXf//f/SdBVRQlkWp5/mOZuSr695+ZnZmdpaLi5JW/9a4vqre/rrhOIw47ubXbfXquvGtfvEfWu2ycsvxseHEK7ngbiuXtf8E6m7HRDfu7t+Fa1S4vTb5hjFXafxLWl1zfFGsyLuYu/5y3eqXP/mz7OflVy6HWgXxZxuqfJVstSvMlzJ89RVo36olsUK06rfPVqvKf4ph/u5TVbtE/KcZuvw8L97wn2o3n+PP+hX/6Xb1CbmjwfFfYFzpanDNf5Fdl1uM3/kvs++1/zc3lnfnNf+1hs90Z4X/cqucw1WlNVhnGYWsenr2ooQ91olp+qFpmZe6ur2glY7vJ2a0+o/sv6NqkrIzURHByIUY/bz9cXsd/hy+SjKN7MdJZHVKEVJFSXoc5Ntj4jW8gstHUZERxZ039dJ6YSRL4lt/3GJaHx7kSS765HKlSLJaXjNKfAGX8tbq9R4eHnrG7tEzwMgLuer1yDtgD70Hgzyj3+613hS6N7+XW4+glyICl9BpZ9pL4vqf5Hsv7X8EIMuJs2qp/KWCH9/7htB5uc+0J9p7T09/2xGZhsrks2ta3Cu/38aG0PzzNLQcxyFf4YtFtwV5L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iiUbsp1io3IxxnPFgp8yUYxjLK2YsVesFNhNKcUW0apMZgthr1gJV/5gJtgQbMZclUKi9V/hHDBpXTDB5pUkXHRV7vaVzZRiWR9n2i1Ykqpsxdr3s5NXJV2xYq6s5rY9ON+VWSWJCTZdFmx7rkvlsRCsQwOju3LAbhQbpcGa6UEUS7FiMdZgb0bYqzI9iSJgFgtswGoUvzG3bwViTDhypWXTwHAxV+I6c8Obr9jhqgRI4zPSBcccERQCEzKDf1pCsVvmUOWkGNuOokiMqaKYeZZYDKzCHkMdg2FdCk0RR+aCFmOOBxsScvuWepZil+zBXQR2cEjb7Q6jQ5tEghWSYBMbfqe7XC6t6VmK1QqMOo8UQ75tk2Nmgkd24kbYiyXa2BUKtkfj5tCDf4CPFRPZo07GcDgLbLJ0ldCZUzGcXcTznsinxniF5PheAndhurqccmcI1mcodscepw+OwDCAWRqKzpk/lNV4dwwRbZeE8QreJ88PrDnmDJp/9VAxBhi+ZB9ADDIVW2ivz/E587h5EGNA1ooOoZ/numP6sF1ST42xGvvI5jFTsYU8H4c35hq9jHMII7Je800PFVNOVAxzRQ65KIpFBxC7QU/oxYP+xxjPj8HiGHssdMjVOA1MjcAE4fgsqSOQ5zbixqFiYpZiuWC4UeQgNSOP7RXLM8FozXWLoliuK7kCR8+/B8dgRDE1nPPvlEoXy+05XGuuETBFOlGx6yKH9dkxZukHiglHazNSjLhSOVKsl69YrcjtDdkxRsAOTlEjusRx796VqXThMV35s9ANIfmKCTupUucQOzDNoqULqdgNIfRbaOiKGXG22Cb9VKAJUYyBYm56VbIV+18zZ9rcJgyE4WnTdDJtph9s",
          "mfa" => ["code", "list", "questions", "selections"],
          "mfa_code_type" => "numeric",
          "name" => "1st Bank (Broadus, MT) - Personal",
          "oauth" => false,
          "primary_color" => "#c02f27",
          "products" => ["assets", "auth", "balance", "transactions", "income", "identity"],
          "routing_numbers" => [],
          "status" => %{
            "auth" => %{
              "breakdown" => %{
                "error_institution" => 0.08,
                "error_plaid" => 0.01,
                "success" => 0.91
              },
              "last_status_change" => "2019-02-15T15:53:00Z",
              "status" => "HEALTHY"
            },
            "balance" => %{
              "breakdown" => %{
                "error_institution" => 0.09,
                "error_plaid" => 0.02,
                "success" => 0.89
              },
              "last_status_change" => "2019-02-15T15:53:00Z",
              "status" => "HEALTHY"
            },
            "identity" => %{
              "breakdown" => %{
                "error_institution" => 0.5,
                "error_plaid" => 0.08,
                "success" => 0.42
              },
              "last_status_change" => "2019-02-15T15:50:00Z",
              "status" => "DEGRADED"
            },
            "item_logins" => %{
              "breakdown" => %{
                "error_institution" => 0.09,
                "error_plaid" => 0.01,
                "success" => 0.9
              },
              "last_status_change" => "2019-02-15T15:53:00Z",
              "status" => "HEALTHY"
            },
            "transactions_updates" => %{
              "breakdown" => %{
                "error_institution" => 0.03,
                "error_plaid" => 0.02,
                "refresh_interval" => "NORMAL",
                "success" => 0.95
              },
              "last_status_change" => "2019-02-12T08:22:00Z",
              "status" => "HEALTHY"
            }
          },
          "url" => "http://www.our1stbank.com/"
        }
      ],
      "request_id" => "jReUm681mVpt1Ck",
      "total" => 11_389
    }
  end

  def http_response_body(:institution) do
    %{
      "institution" => %{
        "country_codes" => ["US"],
        "credentials" => [
          %{"label" => "Username", "name" => "username", "type" => "text"},
          %{"label" => "Password", "name" => "password", "type" => "password"}
        ],
        "has_mfa" => true,
        "input_spec" => "fixed",
        "institution_id" => "ins_114024",
        "logo" =>
          "iVBORw0KGgoAAAANSUhEUgAAAJgAAACYCAMAAAAvHNATAAAAXVBMVEVHcEz///////////////////////////////////////////////////////++ISb////DIyjDNDjIREn029z99/f56uvNVVnqurvvycrbiYvlqqzWdXjhm53RZWg3eOmUAAAAD3RSTlMAqoGWKkLQ5Bi/n29co2cUnNePAAAJ10lEQVR42s1c14KrKhRNj2ZyRgHp6v9/5gVsWIiAOje8nZO2Zpe1q5xOW8/tfXmd0/TxfOb58/lI0/Pr8r6d/s9z+72mCs3yeabX3/8DXvL+58Rkofv3Tv4S1f3qAaoHd73/kQ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z10f8BxwuJuSqIVaAAAAAASUVORK5CYII=",
        "mfa" => ["code", "list", "questions", "selections"],
        "mfa_code_type" => "numeric",
        "name" => "Fortera Credit Union",
        "oauth" => false,
        "primary_color" => "#004966",
        "products" => ["assets", "auth", "balance", "transactions", "income", "identity"],
        "routing_numbers" => [],
        "status" => %{
          "auth" => %{
            "breakdown" => %{
              "error_institution" => 0.08,
              "error_plaid" => 0.01,
              "success" => 0.91
            },
            "last_status_change" => "2019-02-15T15:53:00Z",
            "status" => "HEALTHY"
          },
          "balance" => %{
            "breakdown" => %{
              "error_institution" => 0.09,
              "error_plaid" => 0.02,
              "success" => 0.89
            },
            "last_status_change" => "2019-02-15T15:53:00Z",
            "status" => "HEALTHY"
          },
          "identity" => %{
            "breakdown" => %{
              "error_institution" => 0.5,
              "error_plaid" => 0.08,
              "success" => 0.42
            },
            "last_status_change" => "2019-02-15T15:50:00Z",
            "status" => "DEGRADED"
          },
          "item_logins" => %{
            "breakdown" => %{
              "error_institution" => 0.09,
              "error_plaid" => 0.01,
              "success" => 0.9
            },
            "last_status_change" => "2019-02-15T15:53:00Z",
            "status" => "HEALTHY"
          },
          "transactions_updates" => %{
            "breakdown" => %{
              "error_institution" => 0.03,
              "error_plaid" => 0.02,
              "refresh_interval" => "NORMAL",
              "success" => 0.95
            },
            "last_status_change" => "2019-02-12T08:22:00Z",
            "status" => "HEALTHY"
          }
        },
        "url" => "https://www.forteracu.com/"
      },
      "request_id" => "O9AZsnAaPO23Aiw"
    }
  end

  def http_response_body(:transactions) do
    %{
      "accounts" => [
        %{
          "account_id" => "vzeNDwK7KQIm4yEog683uElbp9GRLEFXGK98D",
          "balances" => %{
            "available" => 100,
            "current" => 110,
            "limit" => nil,
            "iso_currency_code" => "USD",
            "unofficial_currency_code" => "USD"
          },
          "mask" => "0000",
          "name" => "Plaid Checking",
          "official_name" => "Plaid Gold Checking",
          "subtype" => "checking",
          "type" => "depository"
        },
        %{
          "account_id" => "6Myq63K1KDSe3lBwp7K1fnEbNGLV4nSxalVdW",
          "balances" => %{
            "available" => nil,
            "current" => 410,
            "limit" => 2000,
            "iso_currency_code" => "USD",
            "unofficial_currency_code" => "USD"
          },
          "mask" => "3333",
          "name" => "Plaid Credit Card",
          "official_name" => "Plaid Diamond Credit Card",
          "subtype" => "credit card",
          "type" => "credit"
        }
      ],
      "transactions" => [
        %{
          "account_id" => "vokyE5Rn6vHKqDLRXEn5fne7LwbKPLIXGK98d",
          "amount" => 2307.01,
          "iso_currency_code" => "USD",
          "unofficial_currency_code" => "USD",
          "category" => [
            "Shops",
            "Computers and Electronics"
          ],
          "category_id" => "19013000",
          "date" => "2017-01-29",
          "authorized_date" => "2017-01-27",
          "location" => %{
            "address" => "300 Post St",
            "city" => "San Francisco",
            "region" => "CA",
            "postal_code" => "94108",
            "country" => "US",
            "lat" => nil,
            "lon" => nil,
            "store_number" => "1235"
          },
          "merchant_name" => "Apple",
          "name" => "Apple Store",
          "payment_meta" => %{
            "by_order_of" => nil,
            "payee" => nil,
            "payer" => nil,
            "payment_method" => nil,
            "payment_processor" => nil,
            "ppd_id" => nil,
            "reason" => nil,
            "reference_number" => nil
          },
          "payment_channel" => "in store",
          "pending" => false,
          "pending_transaction_id" => nil,
          "personal_finance_category" => %{
            "primary" => "GENERAL_MERCHANDISE",
            "detailed" => "GENERAL_MERCHANDISE_ELECTRONICS"
          },
          "account_owner" => nil,
          "transaction_id" => "lPNjeW1nR6CDn5okmGQ6hEpMo4lLNoSrzqDje",
          "transaction_code" => nil,
          "transaction_type" => "place"
        },
        %{
          "account_id" => "XA96y1wW3xS7wKyEdbRzFkpZov6x1ohxMXwep",
          "amount" => 78.5,
          "iso_currency_code" => "USD",
          "unofficial_currency_code" => "USD",
          "category" => [
            "Food and Drink",
            "Restaurants"
          ],
          "category_id" => "13005000",
          "date" => "2017-01-29",
          "authorized_date" => "2017-01-28",
          "location" => %{
            "address" => "262 W 15th St",
            "city" => "New York",
            "region" => "NY",
            "postal_code" => "10011",
            "country" => "US",
            "lat" => 40.740352,
            "lon" => -74.001761,
            "store_number" => "455"
          },
          "merchant_name" => "Golden Crepes",
          "name" => "Golden Crepes",
          "payment_meta" => %{
            "by_order_of" => nil,
            "payee" => nil,
            "payer" => nil,
            "payment_method" => nil,
            "payment_processor" => nil,
            "ppd_id" => nil,
            "reason" => nil,
            "reference_number" => nil
          },
          "payment_channel" => "in store",
          "pending" => false,
          "pending_transaction_id" => nil,
          "account_owner" => nil,
          "transaction_id" => "4WPD9vV5A1cogJwyQ5kVFB3vPEmpXPS3qvjXQ",
          "transaction_code" => nil,
          "transaction_type" => "place"
        }
      ],
      "item" => %{
        "available_products" => ["balance", "auth"],
        "billed_products" => ["identity", "transactions"],
        "error" => nil,
        "institution_id" => "ins_109508",
        "item_id" => "Ed6bjNrDLJfGvZWwnkQlfxwoNz54B5C97ejBr",
        "webhook" => "https://plaid.com/example/hook"
      },
      "request_id" => "45QSn"
    }
  end

  def http_response_body(:transactions_sync) do
    %{
      "added" => [
        %{
          "account_id" => "BxBXxLj1m4HMXBm9WZZmCWVbPjX16EHwv99vp",
          "account_owner" => nil,
          "amount" => 2307.21,
          "authorized_date" => "2022-02-03",
          "authorized_datetime" => "2022-02-03T10:34:50Z",
          "category" => ["Shops", "Computers and Electronics"],
          "category_id" => "19013000",
          "check_number" => nil,
          "date" => "2022-02-03",
          "datetime" => "2022-02-03T11:00:00Z",
          "iso_currency_code" => "USD",
          "location" => %{
            "address" => "300 Post St",
            "city" => "San Francisco",
            "country" => "US",
            "lat" => 40.740352,
            "lon" => -74.001761,
            "postal_code" => "94108",
            "region" => "CA",
            "store_number" => "1235"
          },
          "merchant_name" => "Apple",
          "name" => "Apple Store",
          "payment_channel" => "in store",
          "payment_meta" => %{
            "by_order_of" => nil,
            "payee" => nil,
            "payer" => nil,
            "payment_method" => nil,
            "payment_processor" => nil,
            "ppd_id" => nil,
            "reason" => nil,
            "reference_number" => nil
          },
          "pending" => false,
          "pending_transaction_id" => nil,
          "personal_finance_category" => %{
            "primary" => "GENERAL_MERCHANDISE",
            "detailed" => "GENERAL_MERCHANDISE_ELECTRONICS"
          },
          "transaction_code" => nil,
          "transaction_id" => "lPNjeW1nR6CDn5okmGQ6hEpMo4lLNoSrzqDje",
          "unofficial_currency_code" => nil
        }
      ],
      "has_more" => false,
      "modified" => [
        %{
          "account_id" => "BxBXxLj1m4HMXBm9WZZmCWVbPjX16EHwv99vp",
          "account_owner" => nil,
          "amount" => 98.05,
          "authorized_date" => "2022-02-28",
          "authorized_datetime" => "2022-02-28T10:34:50Z",
          "category" => ["Service", "Utilities", "Electric"],
          "category_id" => "18068005",
          "check_number" => nil,
          "date" => "2022-02-28",
          "datetime" => "2022-02-28T11:00:00Z",
          "iso_currency_code" => "USD",
          "location" => %{
            "address" => nil,
            "city" => nil,
            "country" => nil,
            "lat" => nil,
            "lon" => nil,
            "postal_code" => nil,
            "region" => nil,
            "store_number" => nil
          },
          "merchant_name" => "ConEd",
          "name" => "ConEd Bill Payment",
          "payment_channel" => "online",
          "payment_meta" => %{
            "by_order_of" => nil,
            "payee" => nil,
            "payer" => nil,
            "payment_method" => nil,
            "payment_processor" => nil,
            "ppd_id" => nil,
            "reason" => nil,
            "reference_number" => nil
          },
          "pending" => false,
          "pending_transaction_id" => nil,
          "personal_finance_category" => %{
            "primary" => "RENT_AND_UTILITIES",
            "detailed" => "RENT_AND_UTILITIES_GAS_AND_ELECTRICITY"
          },
          "transaction_code" => nil,
          "transaction_id" => "yhnUVvtcGGcCKU0bcz8PDQr5ZUxUXebUvbKC0",
          "unofficial_currency_code" => nil
        }
      ],
      "next_cursor" =>
        "tVUUL15lYQN5rBnfDIc1I8xudpGdIlw9nsgeXWvhOfkECvUeR663i3Dt1uf/94S8ASkitgLcIiOSqNwzzp+bh89kirazha5vuZHBb2ZA5NtCDkkV",
      "removed" => [%{"transaction_id" => "CmdQTNgems8BT1B7ibkoUXVPyAeehT3Tmzk0l"}],
      "request_id" => "45QSn"
    }
  end

  def http_response_body(:processor_token) do
    %{
      "processor_token" => "processor-sandbox-asda9-a99c1-ca3g",
      "request_id" => "45QSn"
    }
  end

  def http_response_body(:stripe_bank_account_token) do
    %{
      "stripe_bank_account_token" => "stripe-sandbox-asda9-a99c1-ca3g",
      "request_id" => "45QSn"
    }
  end

  def http_response_body(:"investments/transactions") do
    %{
      "accounts" => [
        %{
          "account_id" => "rxPW5z6P46CqqQm6Jy5ZI4Jdg5PGGBflwKgGg",
          "balances" => %{
            "available" => 100,
            "current" => 110,
            "iso_currency_code" => "USD",
            "limit" => nil,
            "unofficial_currency_code" => nil
          },
          "mask" => "0000",
          "name" => "Plaid Checking",
          "official_name" => "Plaid Gold Standard 0% Interest Checking",
          "subtype" => "checking",
          "type" => "depository"
        },
        %{
          "account_id" => "dLb3JWRbARtppGe9PEMlIKwdP5lEE7tZNgeXy",
          "balances" => %{
            "available" => nil,
            "current" => 320.76,
            "iso_currency_code" => "USD",
            "limit" => nil,
            "unofficial_currency_code" => nil
          },
          "mask" => "5555",
          "name" => "Plaid IRA",
          "official_name" => nil,
          "subtype" => "ira",
          "type" => "investment"
        }
      ],
      "investment_transactions" => [
        %{
          "account_id" => "dLb3JWRbARtppGe9PEMlIKwdP5lEE7tZNgeXy",
          "amount" => 46.32,
          "cancel_transaction_id" => nil,
          "date" => "2019-04-30",
          "fees" => nil,
          "investment_transaction_id" => "mKxX9R6xB6i55NXwjV76hAxG41RkX9FLoEveV",
          "iso_currency_code" => "USD",
          "name" => "BUY NFLX DERIVATIVE",
          "price" => 0.01,
          "quantity" => 4211.152345617756,
          "security_id" => "8E4L9XLl6MudjEpwPAAgivmdZRdBPJuvMPlPb",
          "type" => "buy",
          "unofficial_currency_code" => nil
        },
        %{
          "account_id" => "dLb3JWRbARtppGe9PEMlIKwdP5lEE7tZNgeXy",
          "amount" => -1200,
          "cancel_transaction_id" => nil,
          "date" => "2019-04-30",
          "fees" => nil,
          "investment_transaction_id" => "y71WbN61Z6hZZGqArW5BsgqV8xaGeltyaGqPV",
          "iso_currency_code" => "USD",
          "name" =>
            "INVBANKTRAN DEP CO CONTR CURRENT YR EMPLOYER CU CO CONTR CURRENT YR EMPLOYER CUR YR",
          "price" => 0,
          "quantity" => 0,
          "security_id" => "d6ePmbPxgWCWmMVv66q9iPV94n91vMtov5Are",
          "type" => "cash",
          "unofficial_currency_code" => nil
        }
      ],
      "item" => %{
        "available_products" => ["assets", "balance", "credit_details", "identity", "income"],
        "billed_products" => ["auth", "investments", "transactions"],
        "error" => nil,
        "institution_id" => "ins_3",
        "item_id" => "EQXBrmLXgLsZZbVM4JvGsG5LeLm9bgsXRLv4j",
        "webhook" => ""
      },
      "request_id" => "UfViDIZgENw05Cx",
      "securities" => [
        %{
          "close_price" => 0.011,
          "close_price_as_of" => nil,
          "cusip" => nil,
          "institution_id" => nil,
          "institution_security_id" => nil,
          "is_cash_equivalent" => false,
          "isin" => nil,
          "iso_currency_code" => "USD",
          "name" => "Nflx Feb 01'18 $355 Call",
          "proxy_security_id" => nil,
          "security_id" => "8E4L9XLl6MudjEpwPAAgivmdZRdBPJuvMPlPb",
          "sedol" => nil,
          "ticker_symbol" => "NFLX180201C00355000",
          "type" => "derivative",
          "unofficial_currency_code" => nil
        },
        %{
          "close_price" => 42.15,
          "close_price_as_of" => nil,
          "cusip" => "464286400",
          "institution_id" => nil,
          "institution_security_id" => nil,
          "is_cash_equivalent" => false,
          "isin" => "US4642864007",
          "iso_currency_code" => "USD",
          "name" => "iShares Inc MSCI Brazil",
          "proxy_security_id" => nil,
          "security_id" => "abJamDazkgfvBkVGgnnLUWXoxnomp5up8llg4",
          "sedol" => nil,
          "ticker_symbol" => "EWZ",
          "type" => "etf",
          "unofficial_currency_code" => nil
        },
        %{
          "close_price" => 1,
          "close_price_as_of" => nil,
          "cusip" => nil,
          "institution_id" => nil,
          "institution_security_id" => nil,
          "is_cash_equivalent" => true,
          "isin" => nil,
          "iso_currency_code" => "USD",
          "name" => "U S Dollar",
          "proxy_security_id" => nil,
          "security_id" => "d6ePmbPxgWCWmMVv66q9iPV94n91vMtov5Are",
          "sedol" => nil,
          "ticker_symbol" => "USD",
          "type" => "cash",
          "unofficial_currency_code" => nil
        }
      ],
      "total_investment_transactions" => 326
    }
  end

  def http_response_body(:"investments/holdings") do
    %{
      "accounts" => [
        %{
          "account_id" => "rxPW5z6P46CqqQm6Jy5ZI4Jdg5PGGBflwKgGg",
          "balances" => %{
            "available" => 100,
            "current" => 110,
            "iso_currency_code" => "USD",
            "limit" => nil,
            "unofficial_currency_code" => nil
          },
          "mask" => "0000",
          "name" => "Plaid Checking",
          "official_name" => "Plaid Gold Standard 0% Interest Checking",
          "subtype" => "checking",
          "type" => "depository"
        },
        %{
          "account_id" => "dLb3JWRbARtppGe9PEMlIKwdP5lEE7tZNgeXy",
          "balances" => %{
            "available" => nil,
            "current" => 320.76,
            "iso_currency_code" => "USD",
            "limit" => nil,
            "unofficial_currency_code" => nil
          },
          "mask" => "5555",
          "name" => "Plaid IRA",
          "official_name" => nil,
          "subtype" => "ira",
          "type" => "investment"
        },
        %{
          "account_id" => "aZDr3gRDLRcaaQ4gDlkdsLJKWjAZZgC74dLXJ",
          "balances" => %{
            "available" => nil,
            "current" => 23_631.9805,
            "iso_currency_code" => "USD",
            "limit" => nil,
            "unofficial_currency_code" => nil
          },
          "mask" => "6666",
          "name" => "Plaid 401k",
          "official_name" => nil,
          "subtype" => "401k",
          "type" => "investment"
        }
      ],
      "holdings" => [
        %{
          "account_id" => "dLb3JWRbARtppGe9PEMlIKwdP5lEE7tZNgeXy",
          "cost_basis" => 1,
          "institution_price" => 1,
          "institution_price_as_of" => nil,
          "institution_value" => 0.01,
          "iso_currency_code" => "USD",
          "quantity" => 0.01,
          "security_id" => "d6ePmbPxgWCWmMVv66q9iPV94n91vMtov5Are",
          "unofficial_currency_code" => nil
        },
        %{
          "account_id" => "aZDr3gRDLRcaaQ4gDlkdsLJKWjAZZgC74dLXJ",
          "cost_basis" => 1.5,
          "institution_price" => 2.11,
          "institution_price_as_of" => nil,
          "institution_value" => 2.11,
          "iso_currency_code" => "USD",
          "quantity" => 1,
          "security_id" => "KDwjlXj1Rqt58dVvmzRguxJybmyQL8FgeWWAy",
          "unofficial_currency_code" => nil
        },
        %{
          "account_id" => "aZDr3gRDLRcaaQ4gDlkdsLJKWjAZZgC74dLXJ",
          "cost_basis" => 10,
          "institution_price" => 10.42,
          "institution_price_as_of" => nil,
          "institution_value" => 20.84,
          "iso_currency_code" => "USD",
          "quantity" => 2,
          "security_id" => "NDVQrXQoqzt5v3bAe8qRt4A7mK7wvZCLEBBJk",
          "unofficial_currency_code" => nil
        },
        %{
          "account_id" => "dLb3JWRbARtppGe9PEMlIKwdP5lEE7tZNgeXy",
          "cost_basis" => 0.01,
          "institution_price" => 0.011,
          "institution_price_as_of" => nil,
          "institution_value" => 110,
          "iso_currency_code" => "USD",
          "quantity" => 10_000,
          "security_id" => "8E4L9XLl6MudjEpwPAAgivmdZRdBPJuvMPlPb",
          "unofficial_currency_code" => nil
        }
      ],
      "item" => %{
        "available_products" => ["assets", "balance", "credit_details", "identity", "income"],
        "billed_products" => ["auth", "investments", "transactions"],
        "error" => nil,
        "institution_id" => "ins_3",
        "item_id" => "EQXBrmLXgLsZZbVM4JvGsG5LeLm9bgsXRLv4j",
        "webhook" => ""
      },
      "request_id" => "8lT4oybo5jl3JMp",
      "securities" => [
        %{
          "close_price" => 0.011,
          "close_price_as_of" => nil,
          "cusip" => nil,
          "institution_id" => nil,
          "institution_security_id" => nil,
          "is_cash_equivalent" => false,
          "isin" => nil,
          "iso_currency_code" => "USD",
          "name" => "Nflx Feb 01'18 $355 Call",
          "proxy_security_id" => nil,
          "security_id" => "8E4L9XLl6MudjEpwPAAgivmdZRdBPJuvMPlPb",
          "sedol" => nil,
          "ticker_symbol" => "NFLX180201C00355000",
          "type" => "derivative",
          "unofficial_currency_code" => nil
        },
        %{
          "close_price" => 27,
          "close_price_as_of" => nil,
          "cusip" => "577130834",
          "institution_id" => nil,
          "institution_security_id" => nil,
          "is_cash_equivalent" => false,
          "isin" => "US5771308344",
          "iso_currency_code" => "USD",
          "name" => "Matthews Pacific Tiger Fund Insti Class",
          "proxy_security_id" => nil,
          "security_id" => "JDdP7XPMklt5vwPmDN45t3KAoWAPmjtpaW7DP",
          "sedol" => nil,
          "ticker_symbol" => "MIPTX",
          "type" => "mutual fund",
          "unofficial_currency_code" => nil
        },
        %{
          "close_price" => 2.11,
          "close_price_as_of" => nil,
          "cusip" => "00448Q201",
          "institution_id" => nil,
          "institution_security_id" => nil,
          "is_cash_equivalent" => false,
          "isin" => "US00448Q2012",
          "iso_currency_code" => "USD",
          "name" => "Achillion Pharmaceuticals Inc.",
          "proxy_security_id" => nil,
          "security_id" => "KDwjlXj1Rqt58dVvmzRguxJybmyQL8FgeWWAy",
          "sedol" => nil,
          "ticker_symbol" => "ACHN",
          "type" => "equity",
          "unofficial_currency_code" => nil
        },
        %{
          "close_price" => 24.5,
          "close_price_as_of" => nil,
          "cusip" => "00769G543",
          "institution_id" => nil,
          "institution_security_id" => nil,
          "is_cash_equivalent" => false,
          "isin" => "US00769G5430",
          "iso_currency_code" => "USD",
          "name" => "Cambiar International Equity Institutional",
          "proxy_security_id" => nil,
          "security_id" => "MD9eKXeplrt5yKRlzLqXiavwb6wrdxUb3wdnM",
          "sedol" => nil,
          "ticker_symbol" => "CAMYX",
          "type" => "mutual fund",
          "unofficial_currency_code" => nil
        },
        %{
          "close_price" => 10.42,
          "close_price_as_of" => nil,
          "cusip" => "258620103",
          "institution_id" => nil,
          "institution_security_id" => nil,
          "is_cash_equivalent" => false,
          "isin" => "US2586201038",
          "iso_currency_code" => "USD",
          "name" => "DoubleLine Total Return Bond Fund",
          "proxy_security_id" => nil,
          "security_id" => "NDVQrXQoqzt5v3bAe8qRt4A7mK7wvZCLEBBJk",
          "sedol" => nil,
          "ticker_symbol" => "DBLTX",
          "type" => "mutual fund",
          "unofficial_currency_code" => nil
        },
        %{
          "close_price" => 42.15,
          "close_price_as_of" => nil,
          "cusip" => "464286400",
          "institution_id" => nil,
          "institution_security_id" => nil,
          "is_cash_equivalent" => false,
          "isin" => "US4642864007",
          "iso_currency_code" => "USD",
          "name" => "iShares Inc MSCI Brazil",
          "proxy_security_id" => nil,
          "security_id" => "abJamDazkgfvBkVGgnnLUWXoxnomp5up8llg4",
          "sedol" => nil,
          "ticker_symbol" => "EWZ",
          "type" => "etf",
          "unofficial_currency_code" => nil
        },
        %{
          "close_price" => 1,
          "close_price_as_of" => nil,
          "cusip" => nil,
          "institution_id" => nil,
          "institution_security_id" => nil,
          "is_cash_equivalent" => true,
          "isin" => nil,
          "iso_currency_code" => "USD",
          "name" => "U S Dollar",
          "proxy_security_id" => nil,
          "security_id" => "d6ePmbPxgWCWmMVv66q9iPV94n91vMtov5Are",
          "sedol" => nil,
          "ticker_symbol" => "USD",
          "type" => "cash",
          "unofficial_currency_code" => nil
        },
        %{
          "close_price" => 34.73,
          "close_price_as_of" => nil,
          "cusip" => "84470P109",
          "institution_id" => nil,
          "institution_security_id" => nil,
          "is_cash_equivalent" => false,
          "isin" => "US84470P1093",
          "iso_currency_code" => "USD",
          "name" => "Southside Bancshares Inc.",
          "proxy_security_id" => nil,
          "security_id" => "eW4jmnjd6AtjxXVrjmj6SX1dNEdZp3Cy8RnRQ",
          "sedol" => nil,
          "ticker_symbol" => "SBSI",
          "type" => "equity",
          "unofficial_currency_code" => nil
        },
        %{
          "close_price" => 13.73,
          "close_price_as_of" => nil,
          "cusip" => nil,
          "institution_id" => "ins_115617",
          "institution_security_id" => "NHX105509",
          "is_cash_equivalent" => false,
          "isin" => nil,
          "iso_currency_code" => "USD",
          "name" => "NH PORTFOLIO 1055 (FIDELITY INDEX)",
          "proxy_security_id" => nil,
          "security_id" => "nnmo8doZ4lfKNEDe3mPJipLGkaGw3jfPrpxoN",
          "sedol" => nil,
          "ticker_symbol" => "NHX105509",
          "type" => "etf",
          "unofficial_currency_code" => nil
        }
      ]
    }
  end

  def http_response_body(:identity) do
    %{
      "accounts" => [
        %{
          "account_id" => "BxBXxLj1m4HMXBm9WZZmCWVbPjX16EHwv99vp",
          "balances" => %{
            "available" => 100,
            "current" => 110,
            "iso_currency_code" => "USD",
            "limit" => nil,
            "unofficial_currency_code" => nil
          },
          "mask" => "0000",
          "name" => "Plaid Checking",
          "official_name" => "Plaid Gold Standard 0% Interest Checking",
          "owners" => [
            %{
              "addresses" => [
                %{
                  "data" => %{
                    "city" => "Malakoff",
                    "country" => "US",
                    "postal_code" => "14236",
                    "region" => "NY",
                    "street" => "2992 Cameron Road"
                  },
                  "primary" => true
                },
                %{
                  "data" => %{
                    "city" => "San Matias",
                    "country" => "US",
                    "postal_code" => "93405-2255",
                    "region" => "CA",
                    "street" => "2493 Leisure Lane"
                  },
                  "primary" => false
                }
              ],
              "emails" => [
                %{
                  "data" => "accountholder0@example.com",
                  "primary" => true,
                  "type" => "primary"
                },
                %{
                  "data" => "accountholder1@example.com",
                  "primary" => false,
                  "type" => "secondary"
                },
                %{
                  "data" => "extraordinarily.long.email.username.123456@reallylonghostname.com",
                  "primary" => false,
                  "type" => "other"
                }
              ],
              "names" => [
                "Alberta Bobbeth Charleson"
              ],
              "phone_numbers" => [
                %{
                  "data" => "1112223333",
                  "primary" => false,
                  "type" => "home"
                },
                %{
                  "data" => "1112224444",
                  "primary" => false,
                  "type" => "work"
                },
                %{
                  "data" => "1112225555",
                  "primary" => false,
                  "type" => "mobile"
                }
              ]
            }
          ],
          "subtype" => "checking",
          "type" => "depository"
        },
        %{
          "account_id" => "3gE5gnRzNyfXpBK5wEEKcymJ5albGVUqg77gr",
          "balances" => %{
            "available" => 200,
            "current" => 210,
            "iso_currency_code" => "USD",
            "limit" => nil,
            "unofficial_currency_code" => nil
          },
          "mask" => "1111",
          "name" => "Plaid Saving",
          "official_name" => "Plaid Silver Standard 0.1% Interest Saving",
          "owners" => [
            %{
              "addresses" => [
                %{
                  "data" => %{
                    "city" => "Malakoff",
                    "country" => "US",
                    "postal_code" => "14236",
                    "region" => "NY",
                    "street" => "2992 Cameron Road"
                  },
                  "primary" => true
                },
                %{
                  "data" => %{
                    "city" => "San Matias",
                    "country" => "US",
                    "postal_code" => "93405-2255",
                    "region" => "CA",
                    "street" => "2493 Leisure Lane"
                  },
                  "primary" => false
                }
              ],
              "emails" => [
                %{
                  "data" => "accountholder0@example.com",
                  "primary" => true,
                  "type" => "primary"
                },
                %{
                  "data" => "accountholder1@example.com",
                  "primary" => false,
                  "type" => "secondary"
                },
                %{
                  "data" => "extraordinarily.long.email.username.123456@reallylonghostname.com",
                  "primary" => false,
                  "type" => "other"
                }
              ],
              "names" => [
                "Alberta Bobbeth Charleson"
              ],
              "phone_numbers" => [
                %{
                  "data" => "1112223333",
                  "primary" => false,
                  "type" => "home"
                },
                %{
                  "data" => "1112224444",
                  "primary" => false,
                  "type" => "work"
                },
                %{
                  "data" => "1112225555",
                  "primary" => false,
                  "type" => "mobile"
                }
              ]
            }
          ],
          "subtype" => "savings",
          "type" => "depository"
        }
      ],
      "item" => %{
        "available_products" => [
          "balance",
          "credit_details",
          "investments"
        ],
        "billed_products" => [
          "assets",
          "auth",
          "identity",
          "liabilities",
          "transactions"
        ],
        "consent_expiration_time" => nil,
        "error" => nil,
        "institution_id" => "ins_3",
        "item_id" => "eVBnVMp7zdTJLkRNr33Rs6zr7KNJqBFL9DrE6",
        "update_type" => "background",
        "webhook" => "https://www.genericwebhookurl.com/webhook"
      },
      "request_id" => "3nARps6TOYtbACO"
    }
  end

  def http_response_body(:create_link_token) do
    %{
      "link_token" => "link-production-840204-193734",
      "created_at" => "2020-03-26T12:56:34",
      "expiration" => "2020-03-27T12:56:34",
      "metadata" => %{
        "initial_products" => [
          "auth"
        ],
        "webhook" => "https://example.com/webhook",
        "country_codes" => [
          "US",
          "CA"
        ],
        "language" => "en",
        "account_filters" => %{
          "depository" => [
            "checking"
          ]
        },
        "redirect_uri" => "https://example.com/redirect",
        "client_name" => "Example Client Name"
      }
    }
  end

  def http_response_body(:get_link_token) do
    %{
      "link_token" => "link-production-840204-193734",
      "created_at" => "2020-03-26T12:56:34",
      "expiration" => "2020-03-27T12:56:34",
      "metadata" => %{
        "initial_products" => [
          "auth"
        ],
        "webhook" => "https://example.com/webhook",
        "country_codes" => [
          "US",
          "CA"
        ],
        "language" => "en",
        "account_filters" => %{
          "depository" => [
            "checking"
          ]
        },
        "redirect_uri" => "https://example.com/redirect",
        "client_name" => "Example Client Name"
      }
    }
  end

  def http_response_body(:webhook_verification_key) do
    %{
      "key" => %{
        "alg" => "ES256",
        "created_at" => 1_560_466_150,
        "crv" => "P-256",
        "expired_at" => nil,
        "kid" => "bfbd5111-8e33-4643-8ced-b2e642a72f3c",
        "kty" => "EC",
        "use" => "sig",
        "x" => "hKXLGIjWvCBv-cP5euCTxl8g9GLG9zHo_3pO5NN1DwQ",
        "y" => "shhexqPB7YffGn6fR6h2UhTSuCtPmfzQJ6ENVIoO4Ys"
      },
      "request_id" => "RZ6Omi1bzzwDaLo"
    }
  end

  def http_response_body(:"payment_initiation/payment/create") do
    %{
      "payment_id" => "payment-id-sandbox-feca8a7a-5591-4aef-9297-f3062bb735d3",
      "status" => "PAYMENT_STATUS_INPUT_NEEDED",
      "request_id" => "4ciYVmesrySiUAB"
    }
  end

  def http_response_body(:"payment_initiation/payment/get") do
    %{
      "payment_id" => "payment-id-sandbox-feca8a7a-5591-4aef-9297-f3062bb735d3",
      "payment_token" => "payment-token-sandbox-c6a26505-42b4-46fe-8ecf-bf9edcafbebb",
      "reference" => "Account Funding 99744",
      "amount" => %{
        "currency" => "GBP",
        "value" => 100
      },
      "status" => "PAYMENT_STATUS_INPUT_NEEDED",
      "last_status_update" => "2019-11-06T21:10:52Z",
      "payment_expiration_time" => "2019-11-06T21:25:52Z",
      "recipient_id" => "recipient-id-sandbox-9b6b4679-914b-445b-9450-efbdb80296f6",
      "request_id" => "aEAQmewMzlVa1k6"
    }
  end

  def http_response_body(:"payment_initiation/payment/list") do
    %{
      "payments" => [
        %{
          "payment_id" => "payment-id-sandbox-feca8a7a-5591-4aef-9297-f3062bb735d3",
          "payment_token" => "payment-token-sandbox-c6a26505-42b4-46fe-8ecf-bf9edcafbebb",
          "reference" => "Account Funding 99744",
          "amount" => %{
            "currency" => "GBP",
            "value" => 100
          },
          "status" => "PAYMENT_STATUS_INPUT_NEEDED",
          "last_status_update" => "2019-11-06T21:10:52Z",
          "payment_expiration_time" => "2019-11-06T21:25:52Z",
          "recipient_id" => "recipient-id-sandbox-9b6b4679-914b-445b-9450-efbdb80296f6"
        }
      ],
      "next_cursor" => "2020-01-01T00:00:00Z",
      "request_id" => "aEAQmewMzlVa1k6"
    }
  end

  def http_response_body(:"payment_initiation/recipient/create") do
    %{
      "recipient_id" => "recipient-id-sandbox-9b6b4679-914b-445b-9450-efbdb80296f6",
      "request_id" => "4zlKapIkTm8p5KM"
    }
  end

  def http_response_body(:"payment_initiation/recipient/get") do
    %{
      "recipient_id" => "recipient-id-sandbox-9b6b4679-914b-445b-9450-efbdb80296f6",
      "name" => "Wonder Wallet",
      "iban" => "GB29NWBK60161331926819",
      "address" => %{
        "street" => [
          "96 Guild Street",
          "9th Floor"
        ],
        "city" => "London",
        "postal_code" => "SE14 8JW",
        "country" => "GB"
      },
      "request_id" => "4zlKapIkTm8p5KM"
    }
  end

  def http_response_body(:"payment_initiation/recipient/list") do
    %{
      "recipients" => [
        %{
          "recipient_id" => "recipient-id-sandbox-9b6b4679-914b-445b-9450-efbdb80296f6",
          "name" => "Wonder Wallet",
          "iban" => "GB29NWBK60161331926819",
          "address" => %{
            "street" => [
              "96 Guild Street",
              "9th Floor"
            ],
            "city" => "London",
            "postal_code" => "SE14 8JW",
            "country" => "GB"
          }
        }
      ],
      "request_id" => "4zlKapIkTm8p5KM"
    }
  end

  def http_response_body(:create_asset_report) do
    %{
      "asset_report_token" => "assets-sandbox-6f12f5bb-22dd-4855-b918-f47ec439198a",
      "asset_report_id" => "1f414183-220c-44f5-b0c8-bc0e6d4053bb",
      "request_id" => "Iam3b"
    }
  end

  def http_response_body(:get_asset_report) do
    %{
      "report" => %{
        "asset_report_id" => "bf3a0490-344c-4620-a219-2693162e4b1d",
        "client_report_id" => "123abc",
        "date_generated" => "2020-06-05T22:47:53Z",
        "days_requested" => 3,
        "items" => [
          %{
            "accounts" => [
              %{
                "account_id" => "3gE5gnRzNyfXpBK5wEEKcymJ5albGVUqg77gr",
                "balances" => %{
                  "available" => 200,
                  "current" => 210,
                  "iso_currency_code" => "USD",
                  "limit" => nil,
                  "unofficial_currency_code" => nil
                },
                "days_available" => 3,
                "historical_balances" => [
                  %{
                    "current" => 210,
                    "date" => "2020-06-04",
                    "iso_currency_code" => "USD",
                    "unofficial_currency_code" => nil
                  },
                  %{
                    "current" => 210,
                    "date" => "2020-06-03",
                    "iso_currency_code" => "USD",
                    "unofficial_currency_code" => nil
                  },
                  %{
                    "current" => 210,
                    "date" => "2020-06-02",
                    "iso_currency_code" => "USD",
                    "unofficial_currency_code" => nil
                  }
                ],
                "mask" => "1111",
                "name" => "Plaid Saving",
                "official_name" => "Plaid Silver Standard 0.1% Interest Saving",
                "owners" => [
                  %{
                    "addresses" => [
                      %{
                        "data" => %{
                          "city" => "Malakoff",
                          "country" => "US",
                          "postal_code" => "14236",
                          "region" => "NY",
                          "street" => "2992 Cameron Road"
                        },
                        "primary" => true
                      },
                      %{
                        "data" => %{
                          "city" => "San Matias",
                          "country" => "US",
                          "postal_code" => "93405-2255",
                          "region" => "CA",
                          "street" => "2493 Leisure Lane"
                        },
                        "primary" => false
                      }
                    ],
                    "emails" => [
                      %{
                        "data" => "accountholder0@example.com",
                        "primary" => true,
                        "type" => "primary"
                      },
                      %{
                        "data" => "accountholder1@example.com",
                        "primary" => false,
                        "type" => "secondary"
                      },
                      %{
                        "data" =>
                          "extraordinarily.long.email.username.123456@reallylonghostname.com",
                        "primary" => false,
                        "type" => "other"
                      }
                    ],
                    "names" => [
                      "Alberta Bobbeth Charleson"
                    ],
                    "phone_numbers" => [
                      %{
                        "data" => "1112223333",
                        "primary" => false,
                        "type" => "home"
                      },
                      %{
                        "data" => "1112224444",
                        "primary" => false,
                        "type" => "work"
                      },
                      %{
                        "data" => "1112225555",
                        "primary" => false,
                        "type" => "mobile"
                      }
                    ]
                  }
                ],
                "ownership_type" => nil,
                "subtype" => "savings",
                "transactions" => [],
                "type" => "depository"
              },
              %{
                "account_id" => "BxBXxLj1m4HMXBm9WZJyUg9XLd4rKEhw8Pb1J",
                "balances" => %{
                  "available" => nil,
                  "current" => 56_302.06,
                  "iso_currency_code" => "USD",
                  "limit" => nil,
                  "unofficial_currency_code" => nil
                },
                "days_available" => 3,
                "historical_balances" => [],
                "mask" => "8888",
                "name" => "Plaid Mortgage",
                "official_name" => nil,
                "owners" => [
                  %{
                    "addresses" => [
                      %{
                        "data" => %{
                          "city" => "Malakoff",
                          "country" => "US",
                          "postal_code" => "14236",
                          "region" => "NY",
                          "street" => "2992 Cameron Road"
                        },
                        "primary" => true
                      },
                      %{
                        "data" => %{
                          "city" => "San Matias",
                          "country" => "US",
                          "postal_code" => "93405-2255",
                          "region" => "CA",
                          "street" => "2493 Leisure Lane"
                        },
                        "primary" => false
                      }
                    ],
                    "emails" => [
                      %{
                        "data" => "accountholder0@example.com",
                        "primary" => true,
                        "type" => "primary"
                      },
                      %{
                        "data" => "accountholder1@example.com",
                        "primary" => false,
                        type: "secondary"
                      },
                      %{
                        "data" =>
                          "extraordinarily.long.email.username.123456@reallylonghostname.com",
                        "primary" => false,
                        "type" => "other"
                      }
                    ],
                    "names" => [
                      "Alberta Bobbeth Charleson"
                    ],
                    "phone_numbers" => [
                      %{
                        "data" => "1112223333",
                        "primary" => false,
                        "type" => "home"
                      },
                      %{
                        "data" => "1112224444",
                        "primary" => false,
                        "type" => "work"
                      },
                      %{
                        "data" => "1112225555",
                        "primary" => false,
                        "type" => "mobile"
                      }
                    ]
                  }
                ],
                "ownership_type" => nil,
                "subtype" => "mortgage",
                "transactions" => [],
                "type" => "loan"
              },
              %{
                "account_id" => "dVzbVMLjrxTnLjX4G66XUp5GLklm4oiZy88yK",
                "balances" => %{
                  "available" => nil,
                  "current" => 410,
                  "iso_currency_code" => "USD",
                  "limit" => nil,
                  "unofficial_currency_code" => nil
                },
                "days_available" => 3,
                "historical_balances" => [
                  %{
                    "current" => 410,
                    "date" => "2020-06-04",
                    "iso_currency_code" => "USD",
                    "unofficial_currency_code" => nil
                  },
                  %{
                    "current" => 410,
                    "date" => "2020-06-03",
                    "iso_currency_code" => "USD",
                    "unofficial_currency_code" => nil
                  },
                  %{
                    "current" => 410,
                    "date" => "2020-06-02",
                    "iso_currency_code" => "USD",
                    "unofficial_currency_code" => nil
                  }
                ],
                "mask" => "3333",
                "name" => "Plaid Credit Card",
                "official_name" => "Plaid Diamond 12.5% APR Interest Credit Card",
                "owners" => [
                  %{
                    "addresses" => [
                      %{
                        "data" => %{
                          "city" => "Malakoff",
                          "country" => "US",
                          "postal_code" => "14236",
                          "region" => "NY",
                          "street" => "2992 Cameron Road"
                        },
                        "primary" => true
                      },
                      %{
                        "data" => %{
                          "city" => "San Matias",
                          "country" => "US",
                          "postal_code" => "93405-2255",
                          "region" => "CA",
                          "street" => "2493 Leisure Lane"
                        },
                        "primary" => false
                      }
                    ],
                    "emails" => [
                      %{
                        "data" => "accountholder0@example.com",
                        "primary" => true,
                        "type" => "primary"
                      },
                      %{
                        "data" => "accountholder1@example.com",
                        "primary" => false,
                        "type" => "secondary"
                      },
                      %{
                        "data" =>
                          "extraordinarily.long.email.username.123456@reallylonghostname.com",
                        "primary" => false,
                        "type" => "other"
                      }
                    ],
                    "names" => [
                      "Alberta Bobbeth Charleson"
                    ],
                    "phone_numbers" => [
                      %{
                        "data" => "1112223333",
                        "primary" => false,
                        "type" => "home"
                      },
                      %{
                        "data" => "1112224444",
                        "primary" => false,
                        "type" => "work"
                      },
                      %{
                        "data" => "1112225555",
                        "primary" => false,
                        "type" => "mobile"
                      }
                    ]
                  }
                ],
                "ownership_type" => nil,
                "subtype" => "credit card",
                "transactions" => [],
                "type" => "credit"
              }
            ],
            "date_last_updated" => "2020-06-05T22:47:52Z",
            "institution_id" => "ins_3",
            "institution_name" => "Chase",
            "item_id" => "eVBnVMp7zdTJLkRNr33Rs6zr7KNJqBFL9DrE6"
          }
        ],
        "user" => %{
          "client_user_id" => "123456789",
          "email" => "accountholder0@example.com",
          "first_name" => "Alberta",
          "last_name" => "Charleson",
          "middle_name" => "Bobbeth",
          "phone_number" => "111-222-3333",
          "ssn" => "123-45-6789"
        }
      },
      "request_id" => "eYupqX1mZkEuQRx",
      "warnings" => [%{
          "warning_type" => "ASSET_REPORT_WARNING",
          "warning_code" => "OWNERS_UNAVAILABLE",
          "cause" => %{
            "error_type" => "INVALID_REQUEST",
            "error_code" => "ERR_CODE",
            "error_message" => "Error message",
            "display_message" => "User-friendly error message",
            "request_id" => "Iam3b",
            "causes" => [],
            "status" => 400,
            "documentation_url" => "https://plaid.com/docs/api/products/assets/#asset_reportcreate",
            "suggested_action" => "Please retry request",
            "item_id" => "eYupqX1mZkEuQRx"
          }
      }]
    }
  end

  def http_response_body(:signal_evaluate) do
    %{
      "scores" => %{
        "customer_initiated_return_risk" => %{
          "score" => 9,
          "risk_tier" => 1
        },
        "bank_initiated_return_risk" => %{
          "score" => 72,
          "risk_tier" => 7
        }
      },
      "core_attributes" => %{
        "days_since_first_plaid_connection" => 510,
        "plaid_connections_count_7d" => 6,
        "plaid_connections_count_30d" => 7,
        "total_plaid_connections_count" => 15,
        "is_savings_or_money_market_account" => false
      },
      "warnings" => [%{
        "warning_type" => "mock",
        "warning_code" => "mock",
        "warning_message" => "mock",
      }],
      "ruleset" => %{
        "ruleset_key" => "mock",
        "outcome" => "accept"
      },
      "request_id" => "mdqfuVxeoza6mhu"
    }
  end

  def http_response_body(:signal_report_decision) do
    %{"request_id" => "mdqfuVxeoza6mhu"}
  end

  def http_response_body(:signal_report_return) do
    %{"request_id" => "mdqfuVxeoza6mhu"}
  end

  def http_response_body(:signal_prepare) do
    %{"request_id" => "mdqfuVxeoza6mhu"}
  end
end
