UNPKG

plivo

Version:

A Node.js SDK to make voice calls and send SMS using Plivo and to generate Plivo XML

2,806 lines 152 kB
'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.Request = Request;

var _querystring = require('querystring');

var _querystring2 = _interopRequireDefault(_querystring);

var _request = require('request');

var _request2 = _interopRequireDefault(_request);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function Request(config) {
  var auth = 'Basic ' + new Buffer(config.authId + ':' + config.authToken).toString('base64');

  var headers = {
    Authorization: auth,
    'User-Agent': config.userAgent,
    'Content-Type': 'application/json'
  };

  return function (method, action, params) {
    params = params || {};
    var options = {
      url: config.url + '/' + action,
      method: method,
      formData: params || '',
      headers: headers,
      json: true
    };

    if (method == 'GET' && options.formData !== '') {
      var query = '?' + _querystring2.default.stringify(params);
      options.url += query;
    }

    if (typeof config.proxy !== 'undefined') {
      options.proxy = config.proxy;
    }

    if (typeof config.timeout !== 'undefined') {
      options.timeout = config.timeout;
    }

    return new Promise(function (resolve, reject) {
      // LiveCall - needs to be at top
      if (method === 'GET' && action === 'Call/6653422-91b6-4716-9fad-9463daaeeec2' && params['status'] === 'live') {
        resolve({
          response: {},
          body: {
            "direction": "inbound",
            "from": "15856338537",
            "call_status": "in-progress",
            "api_id": "45223222-74f8-11e1-8ea7-12313806be9a",
            "to": "14154290945",
            "caller_name": "+15856338537",
            "call_uuid": "6653422-91b6-4716-9fad-9463daaeeec2",
            "session_start": "2014-03-23 14:49:39.722551",
            "request_uuid": "d0a87a1a-b0e9-4ab2-ac07-c22ee87cd04a",
            "stir_verification": "Verified",
            "stir_attestation": "A"

          }
        });
      } else if (method === 'GET' && action === 'Call/' && params['status'] === 'live') {
        resolve({
          response: {},
          body: {
            "api_id": "c9527676-5839-11e1-86da-6ff39efcb949",
            "calls": ["eac94337-b1cd-499b-82d1-b39bca50dc31", "0a70a7fb-168e-4944-a846-4f3f4d2f96f1"]
          }
        });
      } else if (method === 'DELETE' && action === 'Request/aaa-deeiei3-dfddd/') {
        resolve({
          response: {},
          body: {}
        });
      }

      // get all calls
      else if (action == 'Call/' && method == 'GET') {
          resolve({
            response: {},
            body: {
              "api_id": "8299d094-dc72-11e5-b56c-22000ae90795",
              "meta": {
                "limit": 20,
                "next": null,
                "offset": 0,
                "previous": null,
                "total_count": 4
              },
              objects: [{
                "answer_time": "2015-07-26 15:45:02+05:30",
                "api_id": "06ae0f8f-dc72-11e5-b56c-22000ae90795",
                "bill_duration": 924,
                "billed_duration": 960,
                "call_direction": "outbound",
                "call_duration": 924,
                "call_uuid": "eba53b9e-8fbd-45c1-9444-696d2172fbc8",
                "end_time": "2015-07-26 15:45:14+05:30",
                "from_number": "+14158572518",
                "initiation_time": "2015-07-26 15:44:49+05:30",
                "parent_call_uuid": null,
                "resource_uri": "/v1/Account/MANWVLYTK4ZWU1YTY4ZT/Call/eba53b9e-8fbd-45c1-9444-696d2172fbc8/",
                "to_number": "14153268174",
                "total_amount": "0.13600",
                "total_rate": "0.00850",
                "stir_verification": "Not Verified",
                "voice_network_group": "USA All Networks",
                "stir_attestation": "",
                "cnam_lookup": ""
              }, {
                "answer_time": "2015-07-26 16:45:02+05:30",
                "api_id": "06ae0f8f-dc72-11e5-b56c-22000ae90795",
                "bill_duration": 924,
                "billed_duration": 960,
                "call_direction": "outbound",
                "call_duration": 924,
                "call_uuid": "eba53b9e-8fbd-45c1-9444-696d2172fbc8",
                "end_time": "2015-07-26 16:45:14+05:30",
                "from_number": "+14158572518",
                "initiation_time": "2015-07-26 16:44:49+05:30",
                "parent_call_uuid": null,
                "resource_uri": "/v1/Account/MANWVLYTK4ZWU1YTY4ZT/Call/eba53b9e-8fbd-45c1-9444-696d2172fbc8/",
                "to_number": "14153268174",
                "total_amount": "0.13600",
                "total_rate": "0.00850",
                "stir_verification": "Verified",
                "voice_network_group": "USA All Networks",
                "stir_attestation": "A",
                "cnam_lookup": ""
              }]
            }
          });
        } else if (action == 'Call/' && method == 'POST') {
          resolve({
            response: {},
            body: {
              message: 'call fired',
              request_uuid: '9834029e-58b6-11e1-b8b7-a5bd0e4e126f',
              api_id: '97ceeb52-58b6-11e1-86da-77300b68f8bb'
            }
          });
        }
        //Get CDR (Retrieve a call)
        else if (action == 'Call/aaa-deeiei3-dfddd/' && method == 'GET') {
            resolve({
              response: {},
              body: {
                "id": '1',
                "call_uuid": 'aaa-deeiei3-dfddd',
                "answer_time": null,
                "api_id": "95727cf4-3eeb-11e7-8edf-02ed609bd62b",
                "bill_duration": 0,
                "billed_duration": 0,
                "call_direction": "outbound",
                "call_duration": 0,
                "end_time": "2017-05-22 17:49:40+05:30",
                "from_number": "+919879879876",
                "initiation_time": "2017-05-22 17:49:30+05:30",
                "parent_call_uuid": null,
                "resource_uri": "/v1/Account/MAJHUDTEYWLSIUYTDBCZ/Call/4d04c52e-cea3-4458-bbdb-0bfc314ee7cd/",
                "to_number": "919999999999",
                "total_amount": "0.00000",
                "total_rate": "0.03570",
                "stir_verification": "Not Applicable",
                "voice_network_group": "India All Networks",
                "stir_attestation": "",
                "cnam_lookup": ""
              }
            });
          } else if (action == 'Call/aaa-deeiei3-dfddd/' && method == 'POST') {
            resolve({
              response: {},
              body: {
                "message": "call transferred",
                "api_id": "08c94608-58bd-11e1-86da-adf28403fe48"
              }
            });
          } else if (action == 'Call/aaa-deeiei3-dfddd/' && method == 'DELETE') {
            resolve({
              response: {},
              body: {}
            });
          } else if (action == 'Call/aaa-deeiei3-dfddd/Record/' && method == 'POST') {
            resolve({
              response: {},
              body: {
                url: 'http://s3.amazonaws.com/recordings_2013/48dfaf60-3b2a-11e3.mp3',
                message: 'call recording started',
                recording_id: '48dfaf60-3b2a-11e3',
                api_id: 'c7b69074-58be-11e1-86da-adf28403fe48'
              }
            });
          } else if (action == 'Call/aaa-deeiei3-dfddd/Stream/' && method == 'POST') {
            resolve({
              response: {},
              body: {
                message: 'stream started',
                stream_id: 'db1d8121-1a75-4b75-bb69-35339bb26240',
                api_id: 'c7b69074-58be-11e1-86da-adf28403fe48'
              }
            });
          } else if (method === 'POST' && action === 'Masking/Session/') {
            resolve({
              response: {},
              body: {
                "api_id": "b70bb955-0c85-4b12-9ec4-9640b46c4f61",
                "session_uuid": "197aa6e0-1abe-4d1c-b887-2b2406764360",
                "virtual_number": "+916361728680",
                "message": "Session created",
                "session": {
                  "first_party": "917708772011",
                  "second_party": "918220568648",
                  "virtual_number": "916361728680",
                  "status": "active",
                  "initiate_call_to_first_party": true,
                  "session_uuid": "197aa6e0-1abe-4d1c-b887-2b2406764360",
                  "callback_url": "http://plivobin.non-prod.plivops.com/1jvpmrs1",
                  "callback_method": "GET",
                  "created_time": "2023-07-17 14:26:02.806041 +0000 UTC",
                  "modified_time": "2023-07-17 14:26:02.806041 +0000 UTC",
                  "expiry_time": "2023-07-17 16:06:02.806041 +0000 UTC",
                  "duration": 6000,
                  "amount": 0,
                  "call_time_limit": 14400,
                  "ring_timeout": 120,
                  "first_party_play_url": "https://s3.amazonaws.com/plivosamplexml/play_url.xml",
                  "second_party_play_url": "https://plivobin-prod-usw.plivops.com/api/v1/speak.xml",
                  "record": false,
                  "record_file_format": "mp3",
                  "recording_callback_url": "https://plivobin-prod-usw.plivops.com/api/v1/speak.xml",
                  "recording_callback_method": "GET",
                  "interaction": null,
                  "total_call_amount": 0,
                  "total_call_count": 0,
                  "total_call_billed_duration": 0,
                  "total_session_amount": 0,
                  "last_interaction_time": ""
                }
              }
            });
          } else if (method === 'GET' && action === 'Masking/Session/197aa6e0-1abe-4d1c-b887-2b2406764360') {
            resolve({
              response: {},
              body: {
                "api_id": "2d0c2ca6-01d5-43c0-bb72-038e7d84e3b4",
                "response": {
                  "first_party": "917708772011",
                  "second_party": "918220568648",
                  "virtual_number": "916361728680",
                  "status": "active",
                  "initiate_call_to_first_party": true,
                  "session_uuid": "197aa6e0-1abe-4d1c-b887-2b2406764360",
                  "callback_url": "http://plivobin.non-prod.plivops.com/1jvpmrs1",
                  "callback_method": "GET",
                  "created_time": "2023-07-17 14:26:02.806041 +0000 UTC",
                  "modified_time": "2023-07-17 14:26:02.806041 +0000 UTC",
                  "expiry_time": "2023-07-17 16:06:02.806041 +0000 UTC",
                  "duration": 6000,
                  "amount": 0,
                  "call_time_limit": 14400,
                  "ring_timeout": 120,
                  "first_party_play_url": "https://s3.amazonaws.com/plivosamplexml/play_url.xml",
                  "second_party_play_url": "https://plivobin-prod-usw.plivops.com/api/v1/speak.xml",
                  "record": false,
                  "record_file_format": "mp3",
                  "recording_callback_url": "https://plivobin-prod-usw.plivops.com/api/v1/speak.xml",
                  "recording_callback_method": "GET",
                  "interaction": [{
                    "start_time": "2023-07-17 14:26:03 +0000 UTC",
                    "end_time": "2023-07-17 14:26:03 +0000 UTC",
                    "first_party_resource_url": "https://api-qa.voice.plivodev.com/v1/Account/MAZTQXZDYWNZBMMJAZZJ/Call/46bca3f0-e9de-4fa9-a0fc-fff28171527c",
                    "type": "call",
                    "total_call_count": 1,
                    "duration": 0
                  }],
                  "total_call_amount": 0,
                  "total_call_count": 1,
                  "total_call_billed_duration": 0,
                  "total_session_amount": 0,
                  "last_interaction_time": "2023-07-17 14:26:03 +0000 UTC"
                }
              }
            });
          } else if (method === 'DELETE' && action === 'Masking/Session/197aa6e0-1abe-4d1c-b887-2b2406764360') {
            resolve({
              response: {},
              body: {
                "api_id": "758bf153-a37e-446b-9163-97094bcc0390",
                "message": "Session expired"
              }
            });
          } else if (method === 'POST' && action === 'Masking/Session/63690013-52bb-43fa-9b0b-bf81c9f4d766') {
            resolve({
              response: {},
              body: {
                "api_id": "2b95070e-5e67-46d0-ba79-2903d423c5b2",
                "message": "Session updated",
                "session": {
                  "first_party": "917708772011",
                  "second_party": "919976106830",
                  "virtual_number": "916361728680",
                  "status": "active",
                  "initiate_call_to_first_party": false,
                  "session_uuid": "63690013-52bb-43fa-9b0b-bf81c9f4d766",
                  "callback_url": "http://plivobin.non-prod.plivops.com/1jvpmrs1",
                  "callback_method": "GET",
                  "created_time": "2023-07-11 04:02:13.820698 +0000 +0000",
                  "modified_time": "2023-07-11 04:02:32.594296 +0000 UTC",
                  "expiry_time": "2023-07-11 04:03:32.59429 +0000 UTC",
                  "duration": 78,
                  "amount": 0,
                  "call_time_limit": 14400,
                  "ring_timeout": 120,
                  "first_party_play_url": "https://s3.amazonaws.com/plivosamplexml/play_url.xml",
                  "second_party_play_url": "https://plivobin-prod-usw.plivops.com/api/v1/speak.xml",
                  "record": false,
                  "record_file_format": "mp3",
                  "recording_callback_url": "https://plivobin-prod-usw.plivops.com/api/v1/speak.xml",
                  "recording_callback_method": "GET",
                  "interaction": null,
                  "total_call_amount": 0,
                  "total_call_count": 0,
                  "total_call_billed_duration": 0,
                  "total_session_amount": 0,
                  "last_interaction_time": ""
                }
              }
            });
          } else if (method === 'GET' && action === 'Masking/Session/') {
            resolve({
              response: {},
              body: {
                "api_id": "e7da96fd-755c-44b7-9557-d267abae5ab0",
                "response": {
                  "meta": {
                    "limit": 20,
                    "next": null,
                    "offset": 0,
                    "previous": null,
                    "total_count": 2
                  },
                  "objects": [{
                    "amount": 0,
                    "call_time_limit": 14400,
                    "callback_method": "GET",
                    "callback_url": "http://plivobin.non-prod.plivops.com/1jvpmrs1",
                    "created_time": "2023-07-11 04:02:13.820698 +0000 UTC",
                    "duration": 78,
                    "expiry_time": "2023-07-11 04:03:32.59429 +0000 UTC",
                    "first_party": "917708772011",
                    "first_party_play_url": "https://s3.amazonaws.com/plivosamplexml/play_url.xml",
                    "initiate_call_to_first_party": false,
                    "interaction": null,
                    "last_interaction_time": "",
                    "modified_time": "2023-07-11 04:02:32.594296 +0000 UTC",
                    "record": false,
                    "record_file_format": "mp3",
                    "recording_callback_method": "GET",
                    "recording_callback_url": "https://plivobin-prod-usw.plivops.com/api/v1/speak.xml",
                    "resource_uri": "/v1/Account/MAZTQXZDYWNZBMMJAZZJ/Masking/Session/63690013-52bb-43fa-9b0b-bf81c9f4d766/",
                    "ring_timeout": 120,
                    "second_party": "919976106830",
                    "second_party_play_url": "https://plivobin-prod-usw.plivops.com/api/v1/speak.xml",
                    "session_uuid": "63690013-52bb-43fa-9b0b-bf81c9f4d766",
                    "status": "expired",
                    "total_call_amount": 0,
                    "total_call_billed_duration": 0,
                    "total_call_count": 0,
                    "total_session_amount": 0,
                    "virtual_number": "916361728680"
                  }, {
                    "amount": 0,
                    "call_time_limit": 14400,
                    "callback_method": "GET",
                    "callback_url": "http://plivobin.non-prod.plivops.com/1jvpmrs1",
                    "created_time": "2023-07-11 03:38:42.885428 +0000 UTC",
                    "duration": 109,
                    "expiry_time": "2023-07-11 03:40:32.408859 +0000 UTC",
                    "first_party": "917708772011",
                    "first_party_play_url": "https://s3.amazonaws.com/plivosamplexml/play_url.xml",
                    "initiate_call_to_first_party": false,
                    "interaction": null,
                    "last_interaction_time": "",
                    "modified_time": "2023-07-11 03:39:32.408908 +0000 UTC",
                    "record": false,
                    "record_file_format": "mp3",
                    "recording_callback_method": "GET",
                    "recording_callback_url": "https://plivobin-prod-usw.plivops.com/api/v1/speak.xml",
                    "resource_uri": "/v1/Account/MAZTQXZDYWNZBMMJAZZJ/Masking/Session/cc69df7e-eeb0-4fc5-93e9-f01d35ced9e8/",
                    "ring_timeout": 120,
                    "second_party": "919976106830",
                    "second_party_play_url": "https://plivobin-prod-usw.plivops.com/api/v1/speak.xml",
                    "session_uuid": "cc69df7e-eeb0-4fc5-93e9-f01d35ced9e8",
                    "status": "expired",
                    "total_call_amount": 0,
                    "total_call_billed_duration": 0,
                    "total_call_count": 0,
                    "total_session_amount": 0,
                    "virtual_number": "916361728680"
                  }]
                }
              }
            });
          } else if (method === 'POST' && action === 'VerifiedCallerId/') {
            resolve({
              response: {},
              body: {
                "api_id": "2a5e81d7-deb3-46cd-ac34-c05ca9139b6f",
                "message": "Verification code is sent to number +919768368717 which is valid for 15 minutes",
                "verification_uuid": "407796a6-1f3e-4607-a9d9-5a5376b59a7b"
              }
            });
          } else if (method === 'POST' && action === 'VerifiedCallerId/Verification/2e68eb73-4d54-4391-bc98-71cd380911a4/') {
            resolve({
              response: {},
              body: {
                "alias": "abhishek",
                "api_id": "584a97aa-ca1d-44f2-9dd3-e58fbacd6649",
                "channel": "call",
                "country": "IN",
                "created_at": "2023-09-25T13:10:39.968133341Z",
                "phone_number": "+919768368717",
                "verification_uuid": "2e68eb73-4d54-4391-bc98-71cd380911a4"
              }
            });
          } else if (method === 'POST' && action === 'VerifiedCallerId/+919768368718/') {
            resolve({
              response: {},
              body: {
                "alias": "testAbhishek",
                "api_id": "6b143cb3-9c8a-42ad-b6b7-412ebd5c60a9",
                "country": "IN",
                "created_at": "2023-09-22T14:11:03.091534Z",
                "modified_at": "2023-09-22T14:11:03.091534Z",
                "phone_number": "+919768368718",
                "subaccount": "SAMTU0Y2FKNGETYZDKNI",
                "verification_uuid": "0f978b20-9e2b-4cfe-99fe-f7087c03b8e1"
              }
            });
          } else if (method === 'DELETE' && action === 'VerifiedCallerId/+919768368718/') {
            resolve({
              response: {},
              body: {}
            });
          } else if (method === 'GET' && action === 'VerifiedCallerId/+919768368718/') {
            resolve({
              response: {},
              body: {
                "alias": "test",
                "api_id": "ee7c3cb1-c921-42c9-832b-950fb8344b9b",
                "country": "IN",
                "created_at": "2023-09-22T14:11:03.091534Z",
                "modified_at": "2023-09-22T14:11:03.091534Z",
                "phone_number": "+919768368718",
                "subaccount": "",
                "verification_uuid": "0f978b20-9e2b-4cfe-99fe-f7087c03b8e1"
              }
            });
          } else if (method === 'GET' && action === 'VerifiedCallerId/') {
            resolve({
              response: {},
              body: {
                "api_id": "3b21c7d7-09f7-489b-b753-659814a676bf",
                "meta": {
                  "limit": 20,
                  "next": null,
                  "offset": 0,
                  "previous": null,
                  "total_count": 4
                },
                "objects": [{
                  "alias": "abhishek",
                  "country": "IN",
                  "created_at": "2023-09-25T14:40:38.68729Z",
                  "modified_at": "2023-09-25T14:40:38.68729Z",
                  "phone_number": "+919653244280",
                  "resource_uri": "/v1/Account/MADCHANDRESH02TANK06/VerifiedCallerId/919653244280",
                  "subaccount": "",
                  "verification_uuid": "01be6b07-b106-46e2-8dfc-096d8e22cc0e"
                }, {
                  "alias": "abhishek",
                  "country": "IN",
                  "created_at": "2023-09-25T13:10:39.968133Z",
                  "modified_at": "2023-09-25T13:10:39.968133Z",
                  "phone_number": "+919768368717",
                  "resource_uri": "/v1/Account/MADCHANDRESH02TANK06/VerifiedCallerId/919768368717",
                  "subaccount": "",
                  "verification_uuid": "2e68eb73-4d54-4391-bc98-71cd380911a4"
                }, {
                  "alias": "test",
                  "country": "IN",
                  "created_at": "2023-09-22T14:11:03.091534Z",
                  "modified_at": "2023-09-22T14:11:03.091534Z",
                  "phone_number": "+919768368718",
                  "resource_uri": "/v1/Account/MADCHANDRESH02TANK06/VerifiedCallerId/919768368718",
                  "subaccount": "",
                  "verification_uuid": "0f978b20-9e2b-4cfe-99fe-f7087c03b8e1"
                }, {
                  "alias": "Test2",
                  "country": "",
                  "created_at": "2023-08-30T07:47:43.87171Z",
                  "modified_at": "2023-08-30T07:47:43.87171Z",
                  "phone_number": "+917691021365",
                  "resource_uri": "/v1/Account/MADCHANDRESH02TANK06/VerifiedCallerId/917691021365",
                  "subaccount": "SAMTU0Y2FKNGETYZDKNI",
                  "verification_uuid": "20265c57-2d8e-46fe-8fa8-e8ab4ee58a8c"
                }]
              }
            });
          } else if (action == 'Call/aaa-deeiei3-dfddd/Record/' && method == 'DELETE') {
            resolve({
              response: {},
              body: {}
            });
          } else if (action == 'Call/aaa-deeiei3-dfddd/Play/' && method == 'POST') {
            resolve({
              response: {},
              body: {
                message: 'play started',
                api_id: '07abfd94-58c0-11e1-86da-adf28403fe48'
              }
            });
          } else if (action == 'Call/aaa-deeiei3-dfddd/Play/' && method == 'DELETE') {
            resolve({
              response: {},
              body: {}
            });
          } else if (action == 'Call/aaa-deeiei3-dfddd/Speak/' && method == 'DELETE') {
            resolve({
              response: {},
              body: {
                message: 'speak stopped',
                api_id: 'cf2359c8-f4d6-11e6-b886-067c5485c240'
              }
            });
          } else if (action == 'Call/aaa-deeiei3-dfddd/Speak/' && method == 'POST') {
            resolve({
              response: {},
              body: {
                message: 'speak started',
                api_id: '07abfd94-58c0-11e1-86da-adf28403fe48'
              }
            });
          } else if (action == 'Call/aaa-deeiei3-dfddd/DTMF/' && method == 'POST') {
            resolve({
              response: {},
              body: {
                message: 'digits sent',
                api_id: '07abfd94-58c0-11e1-86da-adf28403fe48'
              }
            });
          }
          // if(action == 'Call/1/' && method == 'DELETE') {
          //   resolve({
          //     response: {},
          //     body: {}
          //   })
          // }
          //
          //
          // Accounts
          else if (action == '/' && method == 'GET') {
              resolve({
                response: {},
                body: {
                  account_type: 'standard',
                  address: '340 Pine St, San Francisco, CA - 94104',
                  api_id: 'c31b36be-0da2-11e4-bd8a-12313f016a39',
                  auth_id: 'MANWVLYTK4ZWU1YTY4ZT',
                  auto_recharge: true,
                  billing_mode: 'prepaid',
                  cash_credits: '23.79822',
                  city: 'San Francisco',
                  name: 'Han Solo',
                  resource_uri: '/v1/Account/MANWVLYTK4ZWU1YTY4ZT/',
                  state: 'California',
                  timezone: 'America/Los_Angeles'
                }
              });
            } else if (action == '/' && method == 'POST') {
              resolve({
                response: {},
                body: {
                  api_id: 'ea43d134-0db0-11e4-a2d1-22000ac5040c',
                  message: 'changed'
                }
              });
            } else if (action === 'Subaccount/' && method === 'POST') {
              resolve({
                response: {},
                body: {
                  "api_id": "97c8d1de-3f08-11e7-b6f4-061564b78b75",
                  "auth_id": "SANDLHYZBIZMU4ZDEXNM",
                  "auth_token": "MTMzZTZjNzdiNDVmY2VhZDQyNTUwYWVjNzI2OThk",
                  "message": "created"
                }
              });
            } else if (action == 'Subaccount/1/' && method == 'GET') {
              resolve({
                response: {},
                body: {
                  account: '/v1/Account/MANWVLYTK4ZWU1YTY4ZT/',
                  api_id: '323972b2-0db3-11e4-a2d1-22000ac5040c',
                  auth_id: '1',
                  auth_token: 'MTZjYWM0YzVjNjMwZmVmODFiNWJjNWJmOGJjZjgw',
                  created: '2014-07-17',
                  enabled: false,
                  modified: null,
                  name: 'Chewbacca',
                  resource_uri: '/v1/Account/MANWVLYTK4ZWU1YTY4ZT/Subaccount/SAMTVIYJDIYWYYMZHLYZ/'
                }
              });
            } else if (action == 'Subaccount/1/' && method == 'POST') {
              resolve({
                response: {},
                body: {
                  message: 'changed',
                  api_id: '5a9fcb68-523d-11e1-86da-6ff39efcb949'
                }
              });
            } else if (action == 'Subaccount/' && method == 'GET') {
              resolve({
                response: {},
                body: {
                  api_id: 'b38bf42e-0db4-11e4-8a4a-123140008edf',
                  meta: {
                    limit: 20,
                    next: null,
                    offset: 0,
                    previous: null,
                    total_count: 2
                  },
                  objects: [{
                    account: '/v1/Account/MANWVLYTK4ZWU1YTY4ZT/',
                    auth_id: '1',
                    auth_token: 'MTZjYWM0YzVjNjMwZmVmODFiNWJjNWJmOGJjZjgw',
                    created: '2014-07-17',
                    enabled: false,
                    modified: null,
                    name: 'Chewbacca',
                    resource_uri: '/v1/Account/MANWVLYTK4ZWU1YTY4ZT/Subaccount/SAMTVIYJDIYWYYMZHLYZ/'
                  }, {
                    account: '/v1/Account/MANWVLYTK4ZWU1YTY4ZT/',
                    auth_id: '1',
                    auth_token: 'OTdhMjYwMWYxOGMyNpFjNzUwYWM3YWI3NjY4Y2Ey',
                    created: '2012-09-23',
                    enabled: true,
                    modified: '2012-09-23',
                    name: 'new',
                    resource_uri: '/v1/Account/MANWVLYTK4ZWU1YTY4ZT/Subaccount/SANJQ5NWEYNWZJNZE2MZ/'
                  }]
                }
              });
            } else if (action == 'Subaccount/1/' && method == 'DELETE') {
              resolve({
                response: {},
                body: {}
              });
            }

            // =============  Application ===================

            else if (action == 'Application/1/' && method == 'GET') {
                resolve({
                  response: {},
                  body: {
                    answer_method: 'GET',
                    answer_url: 'http://webapp.com/dial.xml',
                    app_id: '1',
                    app_name: 'Dial Office',
                    default_app: false,
                    enabled: true,
                    fallback_answer_url: '',
                    fallback_method: 'POST',
                    hangup_method: 'POST',
                    hangup_url: 'http://webapp.com/dial.xml',
                    message_method: 'POST',
                    message_url: '',
                    public_uri: false,
                    resource_uri: '/v1/Account/MANWVLYTK4ZWU1YTY4ZT/Application/20372631212782780/',
                    sip_uri: 'sip:20372631212782780@app.plivo.com',
                    sub_account: null
                  }
                });
              } else if (action == 'Application/' && method == 'GET') {
                resolve({
                  response: {},
                  body: {
                    api_id: 'e5b05b26-10c4-11e4-a2d1-22000ac5040c',
                    meta: {
                      limit: 20,
                      next: null,
                      offset: 0,
                      previous: null,
                      total_count: 19
                    },
                    objects: [{
                      answer_url: 'http://webapp.com/dial.xml',
                      answer_method: 'GET',
                      app_id: '20372631212782780',
                      app_name: 'Dial Office',
                      default_app: false,
                      enabled: true,
                      fallback_answer_url: '',
                      fallback_method: 'POST',
                      hangup_method: 'POST',
                      hangup_url: 'http://webapp.com/dial.xml',
                      message_method: 'POST',
                      message_url: '',
                      public_uri: false,
                      resource_uri: '/v1/Account/MANWVLYTK4ZWU1YTY4ZT/Application/20372631212782780/',
                      sip_uri: 'sip:20372631212782780@app.plivo.com',
                      sub_account: null
                    }, {
                      answer_url: 'https://webapp.com/conference_court.xml',
                      answer_method: 'GET',
                      app_id: '14260623927192078',
                      app_name: 'Conference_Court',
                      default_app: false,
                      enabled: true,
                      fallback_answer_url: '',
                      fallback_method: 'POST',
                      hangup_method: 'POST',
                      hangup_url: 'https://webapp.com/conference_court.xml',
                      message_method: 'POST',
                      message_url: '',
                      public_uri: false,
                      resource_uri: '/v1/Account/MANWVLYTK4ZWU1YTY4ZT/Application/14260623927192078/',
                      sip_uri: 'sip:142606239271920703@app.plivo.com',
                      sub_account: null
                    }]
                  }
                });
              } else if (action == 'Application/1/' && method == 'POST') {
                resolve({
                  response: {},
                  body: {
                    message: 'changed',
                    api_id: '5a9fcb68-582d-11e1-86da-6ff39efcb949'
                  }
                });
              } else if (action == 'Application/' && method == 'POST') {
                resolve({
                  response: {},
                  body: {
                    message: 'created',
                    app_id: '15784735442685051',
                    api_id: '5a9fcb68-582d-11e1-86da-6ff39efcb949'
                  }
                });
              } else if (action == 'Application/1/' && method == 'DELETE') {
                resolve({
                  response: {},
                  body: {}
                });
              }
              // =============  conferences ===================

              else if (action == 'Conference/MyConf/' && method == 'GET') {
                  resolve({
                    response: {},
                    body: {
                      conference_name: 'MyConf',
                      conference_run_time: '590',
                      conference_member_count: '1',
                      members: [{
                        muted: false,
                        member_id: '17',
                        deaf: false,
                        from: '1456789903',
                        to: '1677889900',
                        caller_name: 'John',
                        direction: 'inbound',
                        call_uuid: 'acfbf0b5-12e0-4d74-85f7-fce15f8f07ec',
                        join_time: '590'
                      }],
                      api_id: '816e903e-58c4-11e1-86da-adf28403fe48'
                    }
                  });
                } else if (action == 'Conference/' && method == 'GET') {
                  resolve({
                    response: {},
                    body: {
                      api_id: '2867b6e2-58c3-11e1-86da-adf28403fe48',
                      conferences: ['My Conf Room']
                    }
                  });
                } else if (action == 'Conference/' && method == 'DELETE') {
                  resolve({
                    response: {},
                    body: {
                      message: 'all conferences hung up',
                      api_id: '2867b6e2-58c3-11e1-86da-adf28403fe48'
                    }
                  });
                } else if (action == 'Conference/MyConf/' && method == 'DELETE') {
                  resolve({
                    response: {},
                    body: {
                      message: 'conference hung up',
                      api_id: '2867b6e2-58c3-11e1-86da-adf28403fe48'
                    }
                  });
                } else if (action == 'Conference/MyConf/Member/1/' && method == 'DELETE') {
                  resolve({
                    response: {},
                    body: {
                      message: 'hangup',
                      member_id: '10',
                      api_id: '2867b6e2-58c3-11e1-86da-adf28403fe48'
                    }
                  });
                } else if (method == 'POST' && action == 'Conference/MyConf/Member/1/Kick/') {
                  resolve({
                    response: {},
                    body: {
                      message: 'kicked',
                      member_id: '10',
                      api_id: '2867b6e2-58c3-11e1-86da-adf28403fe48'
                    }
                  });
                } else if (method == 'POST' && action == 'Conference/MyConf/Member/1/Mute/') {
                  resolve({
                    response: {},
                    body: {
                      message: 'muted',
                      member_id: '10',
                      api_id: '2867b6e2-58c3-11e1-86da-adf28403fe48'
                    }
                  });
                } else if (method == 'DELETE' && action == 'Conference/MyConf/Member/1/Mute/') {
                  resolve({
                    response: {},
                    body: {}
                  });
                } else if (method == 'POST' && action == 'Conference/MyConf/Member/1/Deaf/') {
                  resolve({
                    response: {},
                    body: {
                      message: 'deaf',
                      member_id: '10',
                      api_id: '2867b6e2-58c3-11e1-86da-adf28403fe48'
                    }
                  });
                } else if (method == 'DELETE' && action == 'Conference/MyConf/Member/1/Deaf/') {
                  resolve({
                    response: {},
                    body: {}
                  });
                } else if (method == 'POST' && action == 'Conference/MyConf/Member/1/Play/') {
                  resolve({
                    response: {},
                    body: {
                      message: 'play queued into conference',
                      api_id: '4e44bd4e-f830-11e6-b886-067c5485c240',
                      member_id: '[u\'160005\', u\'160004\', u\'160003\', u\'160002\']'
                    }
                  });
                } else if (method == 'DELETE' && action == 'Conference/MyConf/Member/1/Play/') {
                  resolve({
                    response: {},
                    body: {
                      message: 'playing in conference stopped',
                      member_id: '10',
                      api_id: '2867b6e2-58c3-11e1-86da-adf28403fe48'
                    }
                  });
                } else if (method == 'POST' && action == 'Conference/MyConf/Member/1/Speak/') {
                  resolve({
                    response: {},
                    body: {
                      message: 'speak queued into conference',
                      api_id: '8dd6820e-fe83-11e6-b6f4-061564b78b75',
                      member_id: '[u\'all\']'
                    }
                  });
                } else if (method == 'DELETE' && action == 'Conference/MyConf/Member/1/Speak/') {
                  resolve({
                    response: {},
                    body: {
                      message: 'speak stopped',
                      member_id: '10',
                      api_id: '2867b6e2-58c3-11e1-86da-adf28403fe48'
                    }
                  });
                } else if (method == 'DELETE' && action == 'Conference/MyConf/Record/') {
                  resolve({
                    response: {},
                    body: {}
                  });
                } else if (method == 'POST' && action == 'Conference/MyConf/Record/') {
                  resolve({
                    response: {},
                    body: {
                      api_id: '2867b6e2-58c3-11e1-86da-adf28403fe48',
                      message: 'conference recording started',
                      recording_id: '93bc7c6a-3b2b-11e3',
                      url: 'http://s3.amazonaws.com/recordings_2013/93bc7c6a-3b2b-11e3.mp3'
                    }
                  });
                }

                // ============= MultiPartyCalls ===============
                else if (method === 'GET' && action === 'MultiPartyCall/') {
                    resolve({
                      response: {},
                      body: {
                        "api_id": "d53ab14c-eddb-11ea-b02e-0242ac110003",
                        "meta": {
                          "count": 6,
                          "limit": 20,
                          "next": null,
                          "offset": 0,
                          "previous": null
                        },
                        "objects": [{
                          "billed_amount": "0.00500",
                          "billed_duration": 60,
                          "creation_time": "2020-08-31 15:12:03+00:00",
                          "duration": 3,
                          "end_time": "2020-08-31 15:12:06+00:00",
                          "friendly_name": "TestMPC",
                          "mpc_uuid": "ca8e8a44-48e1-445d-afd5-1fcccdbccd9d",
                          "participants": "/v1/Account/MAMDJMMTEZOWY0ZMQWM2/MultiPartyCall/uuid_ca8e8a44-48e1-445d-afd5-1fcccdbccd9d/Participant/",
                          "recording": null,
                          "resource_uri": "/v1/Account/MAMDJMMTEZOWY0ZMQWM2/MultiPartyCall/uuid_ca8e8a44-48e1-445d-afd5-1fcccdbccd9d/",
                          "start_time": null,
                          "status": "Ended",
                          "stay_alone": false,
                          "sub_account": null,
                          "termination_cause": "No Active Participants",
                          "termination_cause_code": 1000
                        }, {
                          "billed_amount": "0.00500",
                          "billed_duration": 60,
                          "creation_time": "2020-08-31 14:32:40+00:00",
                          "duration": 5,
                          "end_time": "2020-08-31 14:32:45+00:00",
                          "friendly_name": "TestMPC",
                          "mpc_uuid": "9b531a1f-1692-4802-a7d6-3ef25bcfe3fc",
                          "participants": "/v1/Account/MAMDJMMTEZOWY0ZMQWM2/MultiPartyCall/uuid_9b531a1f-1692-4802-a7d6-3ef25bcfe3fc/Participant/",
                          "recording": null,
                          "resource_uri": "/v1/Account/MAMDJMMTEZOWY0ZMQWM2/MultiPartyCall/uuid_9b531a1f-1692-4802-a7d6-3ef25bcfe3fc/",
                          "start_time": null,
                          "status": "Ended",
                          "stay_alone": false,
                          "sub_account": null,
                          "termination_cause": "No Active Participants",
                          "termination_cause_code": 1000
                        }, {
                          "billed_amount": "0.01000",
                          "billed_duration": 120,
                          "creation_time": "2020-08-31 14:32:11+00:00",
                          "duration": 11,
                          "end_time": "2020-08-31 14:32:22+00:00",
                          "friendly_name": "TestMPC",
                          "mpc_uuid": "6f84d47c-ee82-4172-a155-c6e22f87d874",
                          "participants": "/v1/Account/MAMDJMMTEZOWY0ZMQWM2/MultiPartyCall/uuid_6f84d47c-ee82-4172-a155-c6e22f87d874/Participant/",
                          "recording": null,
                          "resource_uri": "/v1/Account/MAMDJMMTEZOWY0ZMQWM2/MultiPartyCall/uuid_6f84d47c-ee82-4172-a155-c6e22f87d874/",
                          "start_time": null,
                          "status": "Ended",
                          "stay_alone": false,
                          "sub_account": null,
                          "termination_cause": "Stay Alone Not Permitted",
                          "termination_cause_code": 1010
                        }, {
                          "billed_amount": "0.00500",
                          "billed_duration": 60,
                          "creation_time": "2020-08-31 14:31:20+00:00",
                          "duration": 3,
                          "end_time": "2020-08-31 14:31:23+00:00",
                          "friendly_name": "TestMPC",
                          "mpc_uuid": "0746f6c6-7447-4e0a-9013-186e4220aaf4",
                          "participants": "/v1/Account/MAMDJMMTEZOWY0ZMQWM2/MultiPartyCall/uuid_0746f6c6-7447-4e0a-9013-186e4220aaf4/Participant/",
                          "recording": null,
                          "resource_uri": "/v1/Account/MAMDJMMTEZOWY0ZMQWM2/MultiPartyCall/uuid_0746f6c6-7447-4e0a-9013-186e4220aaf4/",
                          "start_time": "2020-08-31 14:31:20+00:00",
                          "status": "Ended",
                          "stay_alone": false,
                          "sub_account": null,
                          "termination_cause": "No Active Participants",
                          "termination_cause_code": 1000
                        }, {
                          "billed_amount": "0.00500",
                          "billed_duration": 60,
                          "creation_time": "2020-08-31 06:42:50+00:00",
                          "duration": 36,
                          "end_time": "2020-08-31 06:43:26+00:00",
                          "friendly_name": "TestMPC",
                          "mpc_uuid": "b89150fd-0387-4bf8-bde7-a4fed39601ce",
                          "participants": "/v1/Account/MAMDJMMTEZOWY0ZMQWM2/MultiPartyCall/uuid_b89150fd-0387-4bf8-bde7-a4fed39601ce/Participant/",
                          "recording": null,
                          "resource_uri": "/v1/Account/MAMDJMMTEZOWY0ZMQWM2/MultiPartyCall/uuid_b89150fd-0387-4bf8-bde7-a4fed39601ce/",
                          "start_time": "2020-08-31 06:42:50+00:00",
                          "status": "Ended",
                          "stay_alone": false,
                          "sub_account": null,
                          "termination_cause": "No Active Participants",
                          "termination_cause_code": 1000
                        }, {
                          "billed_amount": "0.00500",
                          "billed_duration": 60,
                          "creation_time": "2020-08-28 17:30:10+00:00",
                          "duration": 2,
                          "end_time": "2020-08-28 17:30:12+00:00",
                          "friendly_name": "tank",
                          "mpc_uuid": "2999c70d-b635-420f-b6f2-2fd4421f0381",
                          "participants": "/v1/Account/MAMDJMMTEZOWY0ZMQWM2/MultiPartyCall/uuid_2999c70d-b635-420f-b6f2-2fd4421f0381/Participant/",
                          "recording": null,
                          "resource_uri": "/v1/Account/MAMDJMMTEZOWY0ZMQWM2/MultiPartyCall/uuid_2999c70d-b635-420f-b6f2-2fd4421f0381/",
                          "start_time": "2020-08-28 17:30:10+00:00",
                          "status": "Ended",
                          "stay_alone": true,
                          "sub_account": null,
                          "termination_cause": "No Active Participants",
                          "termination_cause_code": 1000
                        }]
                      }
                    });
                  } else if (method === 'GET' && action === 'MultiPartyCall/uuid_ca8e8a44-48e1-445d-afd5-1fcccdbccd9d') {
                    resolve({
                      response: {},
                      body: {
                        "api_id": "8970c2b3-edfb-11ea-b02e-0242ac110003",
                        "billed_amount": "0.00500",
                        "billed_duration": 60,
                        "creation_time": "2020-08-31 15:12:03+00:00",
                        "duration": 3,
                        "end_time": "2020-08-31 15:12:06+00:00",
                        "friendly_name": "TestMPC",
                        "mpc_uuid": "ca8e8a44-48e1-445d-afd5-1fcccdbccd9d",
                        "participants": "/v1/Account/MAMDJMMTEZOWY0ZMQWM2/MultiPartyCall/uuid_ca8e8a44-48e1-445d-afd5-1fcccdbccd9d/Participant/",
                        "recording": null,
                        "resource_uri": "/v1/Account/MAMDJMMTEZOWY0ZMQWM2/MultiPartyCall/uuid_ca8e8a44-48e1-445d-afd5-1fcccdbccd9d/",
                        "start_time": null,
                        "status": "Ended",
                        "stay_alone": false,
                        "sub_account": null,
                        "termination_cause": "No Active Participants",
                        "termination_cause_code": 1000
                      }
                    });
                  } else if (method === 'POST' && action === 'MultiPartyCall/name_Voice/Participant/' && params.role === 'Agent' && params.from === '+919090909090' && params.to === '+918309866821') {
                    resolve({
                      response: {},
                      body: {
                        "api_id": "1cebd713-ee00-11ea-b02e-0242ac110003",
                        "calls": [{
                          "to": "sip:koushikqa119062465586783372208@phone-qa.voice.plivodev.com",
                          "from": "918888888888",
                          "call_uuid": "c0267574-5c12-4861-8990-da9404c8cdf6"
                        }],
                        "message": "add participant action initiated",
                        "request_uuid": "c0267574-5c12-4861-8990-da9404c8cdf6"
                      }
                    });
                  } else if (method === 'POST' && action === 'MultiPartyCall/name_Voice/' && params.status === 'active') {
                    resolve({
                      response: {},
                      body: {}
                    });
                  } else if (method === 'DELETE' && action === 'MultiPartyCall/name_Voice/') {
                    resolve({
                      response: {},
                      body: {}
                    });
                  } else if (method === 'POST' && action === 'MultiPartyCall/name_TestMPC/Record/') {
                    resolve({
                      response: {},
                      body: {
                        "api_id": "e9b9b0cf-ee0a-11ea-b02e-0242ac110003",
                        "message": "MPC: TestMPC record started",
                        "recording_id": "e9bd7634-ee0a-11ea-9ddf-06feebbe3347",
                        "recording_url": "https://media-qa.voice.plivodev.com/v1/Account/MAMDJMMTEZOWY0ZMQWM2/Recording/e9bd7634-ee0a-11ea-9ddf-06feebbe3347.mp3"
                      }
                    });
                  } else if (method === 'DELETE' && action === 'MultiPartyCall/name_TestMPC/Record/') {
                    resolve({
                      response: {},
                      body: {}
                    });
                  } else if (method === 'POST' && action === 'MultiPartyCall/name_TestMPC/Record/Pause/') {
                    resolve({
                      response: {},
                      body: {}
                    });
                  } else if (method === 'POST' && action === 'MultiPartyCall/name_TestMPC/Record/Resume/') {
                    resolve({
                      response: {},
                      body: {}
                    });
                  } else if (method === 'GET' && action === 'MultiPartyCall/uuid_12345678-90123456/Participant/') {
                    resolve({
                      response: {},
                      body: {
                        "api_id": "d53e6c49-ee0e-11ea-b02e-0242ac110003",
                        "meta": {
                          "count": 1,
                          "limit": 20,
                          "next": null,
                          "offset": 0,
                          "previous": null
                        },
                        "objects": [{
                          "billed_amount": null,
                          "billed_duration": null,
                          "call_uuid": "426c1fb3-8f47-46e5-a916-51faa85ca90e",
                          "coach_mode": false,
                          "duration": null,
                          "end_mpc_on_exit": false,
                          "exit_cause": null,
                          "exit_time": null,
                          "hold": false,
                          "join_time": "2020-09-03 17:24:12+00:00",
                          "member_id": "2132",
                          "mpc_uuid": "7503f05f-2d6e-4ab3-b9e6-3b0d81ae9087",
                          "mute": false,
                          "resource_uri": "/v1/Account/MAMDJMMTEZOWY0ZMQWM2/MultiPartyCall/uuid_7503f05f-2d6e-4ab3-b9e6-3b0d81ae9087/Participant/2132/",
                          "role": "agent",
                          "start_mpc_on_enter": true
                        }]
                      }
                    });
                  } else if (method === 'POST' && action === 'MultiPartyCall/uuid_12345678-90123456/Participant/10/') {
                    resolve({
                      response: {},
                      body: {
                        "api_id": "be5a333a-ee0f-11ea-b02e-0242ac110003",
                        "hold": "MPC: TestMPC hold/unhold member(s) succeded",
                        "mute": "MPC: TestMPC mute/unmute member(s) succeded"
                      }
                    });
                  } else if (method === 'DELETE' && action === 'MultiPartyCall/uuid_12345678-90123456/Participant/10/') {
                    resolve({
                      response: {},
                      body: {}
                    });
                  } else if (method === 'GET' && action === 'MultiPartyCall/uuid_7503f05f-2d6e-4ab3-b9e6-3b0d81ae9087/Participant/2132/') {
                    resolve({
                      response: {},
                      body: {
                        "api_id": "7ca274bb-ee11-11ea-b02e-0242ac110003",
                        "billed_amount": null,
                        "billed_duration": null,
                        "call_uuid": "426c1fb3-8f47-46e5-a916-51faa85ca90e",
                        "coach_mode": false,
                        "duration": null,
                        "end_mpc_on_exit": false,
                        "exit_cause": null,
                        "exit_time": null,
                        "hold": false,
                        "join_time": "2020-09-03 17:24:12+00:00",
                        "member_id": "2132",
                        "mpc_uuid": "7503f05f-2d6e-4ab3-b9e6-3b0d81ae9087",
                        "mute": false,
                        "resource_uri": "/v1/Account/MAMDJMMTEZOWY0ZMQWM2/MultiPartyCall/uuid_7503f05f-2d6e-4ab3-b9e6-3b0d81ae9087/Participant/2132/",
                        "role": "agent",
                        "start_mpc_on_enter": true
                      }
                    });
                  } else if (method === 'POST' && action === 'MultiPartyCall/name_TestMPC/Participant/10/Record/') {
                    resolve({
                      response: {},
                      body: {
                        "api_id": "036c80f3-3721-11ec-a678-0242ac110002",
                        "message": "MPC: TestMPC participant record started",
                        "recording_id": "24670db8-c723-4ba2-8521-f10ec41ddf8b",
                        "recording_url": "https://media-qa.voice.plivodev.com/v1/Account/MAXXXXXXXXXXXX/Recording/XXXXX-XXXX-XXXX-XXXXX.mp3"
                      }
                    });
                  } else if (method === 'DELETE' && action === 'MultiPartyCall/name_TestMPC/Participant/10/Record/') {
                    resolve({
                      response: {},
                      body: {}
                    });
                  } else if (method === 'POST' && action === 'MultiPartyCall/name_TestMPC/Participant/10/Record/Pause/') {
                    resolve({
                      response: {},
                      body: {}
                    });
                  } else if (method === 'POST' && action === 'MultiPartyCall/name_TestMPC/Participant/10/Record/Resume/') {
                    resolve({
                      response: {},
                      body: {}
                    });
                  } else if (method === 'POST' && action === 'MultiPartyCall/name_TestMPC/Member/10/Play/') {
                    resolve({
                      response: {},
                      body: {
                        "api_id": "c07db813-3721-11ec-8bcd-0242ac110008",
                        "message": "play queued into MPC",
                        "mpcMemberId": ["1003"],
                        "mpcName": "TestMPC"
                      }
                    });
                  } else if (method === 'DELETE' && action === 'MultiPartyCall/name_TestMPC/Member/10/Play/') {
                    resolve({
                      response: {},
                      body: {}
                    });
                  }

                  // =============  Numbers ===================
                  else if (method == 'GET' && action == 'Number/+919999999990/') {
                      resolve({
                        response: {},
                        body: {
                          added_on: '2014-02-14',
                          alias: null,
                          api_id: '88625e5e-1c92-11e4-80aa-12313f048015',
                          application: '/v1/Account/MANWVLYTK4ZWU1YTY4ZT/Application/29986316244302815/',
                          carrier: 'Plivo',
                          monthly_rental_rate: '0.80000',
                          number: '+919999999990',
                          number_type: 'local',
                          region: 'California, UNITED STATES',
                          resource_uri: '/v1/Account/MANWVLYTK4ZWU1YTY4ZT/Number/17609915566/',
                          sms_enabled: true,
                          sms_rate: '0.00000',
                          sub_account: null,
                          voice_enabled: true,
                          voice_rate: '0.00850'
                        }
                      });
                    } else if (method == 'GET' && action == 'Number/') {
                      resolve({
                        response: {},
                        body: {
                          api_id: '114de006-1c95-11e4-8a4a-123140008edf',
                          meta: {
                            limit: 3,
                            next: '/v1/Account/MANWVLYTK4ZWU1YTY4ZT/Number/?limit=3&offset=3',
                            offset: 0,
                            previous: null,
                            total_count: 20
                          },
                          objects: [{
                            added_on: '2014-08-05',
                            alias: null,
                            application: '/v1/Account/MANWVLYTK4ZWU1YTY4ZT/Application/29986316244302815/',
                            carrier: 'Plivo',
                            monthly_rental_rate: '0.80000',
                            number: '18135401302',
                            number_type: 'local',
                            region: 'Florida, UNITED STATES',
                            resource_uri: '/v1/Account/MANWVLYTK4ZWU1YTY4ZT/Number/18135401302/',
                            sms_enabled: true,
                            sms_rate: '0.00000',
                            sub_account: null,
                            voice_enabled: true,
                            voice_rate: '0.00850'
                          }]
                        }
                      });
                    } else if (method == 'POST' && action == 'Number/') {
                      resolve({
                        response: {},
                        body: {
                          message: 'changed',
                          api_id: '5a9fcb68-582d-11e1-86da-6ff39efcb949'
                        }
                      });
                    } else if (method == 'POST' && action == 'Number/+919999999990/') {
                      resolve({
                        response: {},
                        body: {
                          message: 'changed',
                          api_id: '5a9fcb68-582d-11e1-86da-6ff39efcb949'
                        }
                      });
                    } else if (method == 'DELETE' && action == 'Number/+919999999990/') {
                      resolve({
                        response: {},
                        body: {}
                      });
                    } else if (method == 'GET' && action == 'PhoneNumber/') {
                      resolve({
                        response: {},
                        body: {
                          api_id: '859428b0-1c88-11e4-a2d1-22000ac5040c',
                          meta: {
                            limit: 20,
                            next: null,
                            offset: 0,
                            previous: null,
                            total_count: 9
                          },
                          objects: [{
                            country: 'UNITED STATES',
                            lata: 722,
                            monthly_rental_rate: '0.80000',
                            number: '14154009186',
                            type: 'fixed',
                            prefix: '415',
                            rate_center: 'SNFC CNTRL',
                            region: 'United States',
                            resource_uri: '/v1/Account/MANWVLYTK4ZWU1YTY4ZT/PhoneNumber/14154009186/',
                            restriction: null,
                            restriction_text: null,
                            setup_rate: '0.00000',
                            sms_enabled: true,
                            sms_rate: '0.00800',
                            voice_enabled: true,
                            voice_rate: '0.00500'
                          }, {
                            country: 'UNITED STATES',
                            lata: 722,
                            monthly_rental_rate: '0.80000',
                            number: '14154009187',
                            type: 'fixed',
                            prefix: '415',
                            rate_center: 'SNFC CNTRL',
                            region: 'United States',
                            resource_uri: '/v1/Account/MANWVLYTK4ZWU1YTY4ZT/PhoneNumber/14154009187/',
                            restriction: null,
                            restriction_text: null,
                            setup_rate: '0.00000',
                            sms_enabled: true,
                            sms_rate: '0.00800',
                            voice_enabled: true,
                            voice_rate: '0.00500'
                          }]
                        }
                      });
                    } else if (method == 'POST' && action == 'PhoneNumber/+919999999990/') {
                      resolve({
                        response: {},
                        body: {
                          api_id: 'aa52882c-1c88-11e4-bd8a-12313f016a39',
                          message: 'created',
                          numbers: [{
                            number: '14154009186',
                            status: 'Success'
                          }],
                          status: 'fulfilled'
                        }
                      });
                    }
                    // =============  Endpoint ===================

                    else if (action == 'Endpoint/1/' && method == 'GET') {
                        resolve({
                          response: {},
                          body: {
                            alias: 'zumba',
                            api_id: '39015de8-4fb3-11e4-a2d1-22000ac5040c',
                            application: '/v1/Account/MANWVLYTK4ZWU1YTY4ZT/Application/379619814477342321/',
                            endpoint_id: '1',
                            password: '8bc0002a467b8276aaaf47e92bc46b9f',
                            resource_uri: '/v1/Account/MANWVLYTK4ZWU1YTY4ZT/Endpoint/39452475478853/',
                            sip_registered: 'false',
                            sip_uri: 'sip:zumba141009125224@phone.plivo.com',
                            sub_account: null,
                            username: 'zumba141009125224'
                          }
                        });
                      } else if (action == 'Endpoint/' && method == 'GET') {
                        resolve({
                          response: {},
                          body: {
                            api_id: '30a0c8c2-110c-11e4-bd8a-12313f016a39',
                            meta: {
                              limit: 20,
                              next: null,
                              offset: 0,
                              previous: null,
                              total_count: 11
                            },
                            objects: [{
                              alias: 'callme',
                              application: '/v1/Account/MANWVLYTK4ZWU1YTY4ZT/Application/33406267401237901/',
                              endpoint_id: '32866729519064',
                              resource_uri: '/v1/Account/MANWVLYTK4ZWU1YTY4ZT/Endpoint/32866729519064/',
                              sip_contact: 'sip:callme140703093224@122.172.71.207:57563;ob',
                              sip_expires: '2014-07-21 19:26:08',
                              sip_registered: 'true',
                              sip_uri: 'sip:callme140703093944@phone.plivo.com',
                              sip_user_agent: 'Telephone 1.1.4',
                              sub_account: null,
                              username: 'callme140703093944'
                            }, {
                              alias: 'polycom',
                              application: '/v1/Account/MANWVLYTK4ZWU1YTY4ZT/Application/37961981447734951/',
                              endpoint_id: '17551316589618',
                              resource_uri: '/v1/Account/MANWVLYTK4ZWU1YTY4ZT/Endpoint/17551316589618/',
                              sip_registered: 'false',
                              sip_uri: 'sip:polycom140506175228@phone.plivo.com',
                              sub_account: null,
                              username: 'polycom140506175448'
                            }]
                          }
                        });
                      } else if (action == 'Endpoint/1/' && method == 'POST') {
                        resolve({
                          response: {},
                          body: {
                            message: 'changed',
                            api_id: 'd8f9ea6c-58cc-11e1-86da-adf28403fe48'
                          }
                        });
                      } else if (action == 'Endpoint/' && method == 'POST') {
                        resolve({
                          response: {},
                          body: {
                            username: 'zumba131031145958',
                            alias: 'zumba',
                            message: 'created',
                            endpoint_id: '37371860103666',
                            api_id: '1c13de4c-423d-11e3-9899-22000abfa5d5'
                          }
                        });
                      } else if (action == 'Endpoint/1/' && method == 'DELETE') {
                        resolve({
                          response: {},
                          body: {
                            message: 'changed',
                            api_id: 'd8f9ea6c-58cc-11e1-86da-adf28403fe48'
                          }
                        });
                      }

                      // =============  Message ===================
                      else if (action == 'Media/0178eb8a-461a-4fd1-bc37-13eebfdc0676/' && method == 'GET') {
                          resolve({
                            response: {},
                            body: {
                              content_type: 'application/pdf',
                              media_id: '0178eb8a-461a-4fd1-bc37-13eebfdc0676',
                              media_url: 'https://xxxxxxx/Account/{auth_id}/Message/24d742b9-9b12-4397-93a7-da496bc874d9/Media/0178eb8a-461a-4fd1-bc37-13eebfdc0676',
                              message_uuid: '24d742b9-9b12-4397-93a7-da496bc874d9',
                              size: '433994'
                            }
                          });
                        } else if (action == 'Media/' && method == 'GET') {
                          resolve({
                            response: {},
                            body: {
                              api_id: '035eeada-6df1-11e6-b608-06a72a185e87',
                              message_uuid: 'message_uuid',
                              objects: [{
                                content_type: 'application/pdf',
                                media_id: '0178eb8a-461a-4fd1-bc37-13eebfdc0676',
                                media_url: 'https://xxxxxxx/Account/{auth_id}/Message/24d742b9-9b12-4397-93a7-da496bc874d9/Media/0178eb8a-461a-4fd1-bc37-13eebfdc0676',
                                message_uuid: '24d742b9-9b12-4397-93a7-da496bc874d9',
                                size: '433994'
                              }]
                            }
                          });
                        } else if (action == '10dlc/Brand/BRPXS6E/' && method == 'GET') {
                          resolve({
                            response: {},
                            body: {
                              api_id: "4bac497c-b963-11ec-b7ca-0242ac110002",
                              brand: {
                                address: {
                                  city: "New York",
                                  country: "IN",
                                  postal_code: "10001",
                                  state: "NY",
                                  street: "123"
                                },
                                authorized_contact: {
                                  email: "vishnu@plivo.com",
                                  first_nam: "vishnu",
                                  last_name: "Doe",
                                  phone: "919742763781",
                                  seniority: "admin",
                                  title: "Doe"
                                },
                                brand_id: "B1QSGGS",
                                ein_issuing_country: "IN",
                                entity_type: "SOLE_PROPRIETOR",
                                profile_uuid: "3cf3e991-2f94-4910-9712-61442987a2d0",
                                registration_status: "COMPLETED",
                                vertical: "ENTERTAINMENT"
                              }
                            }
                          });
                        } else if (action == '10dlc/Brand/BRPXS6E/' && method == 'DELETE') {
                          resolve({
                            response: {},
                            body: {
                              api_id: "4bac497c-b963-11ec-b7ca-0242ac110002",
                              brand_id: "BRPXS6E"
                            }
                          });
                        } else if (action == '10dlc/Brand/BRPXS6E/usecases/' && method == 'GET') {
                          resolve({
                            response: {},
                            body: {
                              "api_id": "dbc70630-3296-11ed-9b52-0242ac110004",
                              "use_cases": [{
                                "name": "Starter",
                                "code": "STARTER",
                                "details": "Low cost campaign type designed for individuals and small businesses"
                              }],
                              "brand_id": "BRPXS6E"
                            }
                          });
                        } else if (action == '10dlc/Brand/BRPXS6E/OTP/' && method == 'POST') {
                          resolve({
                            response: {},
                            body: {
                              "api_id": "dbc70630-3296-11ed-9b52-0242ac110004",
                              "brand_id": "BRPXS6E",
                              "message": "Message sent to XXXXXXXX1234, reply YES to confirm registration."
                            }
                          });
                        } else if (action == 'Profile/' && method == 'GET') {
                          resolve({
                            response: {},
                            body: {
                              api_id: "97a1c5ee-b019-11ec-88b1-0242ac110002",
                              count: 10,
                              limit: 2,
                              offset: 0,
                              profiles: [{
                                alt_business_id_type: "NONE",
                                authorized_contact: {
                                  email: "johndoe.com",
                                  name: "John Doe",
                                  seniority: "admin",
                                  title: "Doe"
                                },
                                company_name: "ABC Inc.",
                                customer_type: "RESELLER",
                                ein_issuing_country: "US",
                                entity_type: "PUBLIC_PROFIT",
                                profile_alias: "vishnu1",
                                profile_type: "SECONDARY",
                                profile_uuid: "1c41faed-a38e-42a3-a966-fe7df34b51b9",
                                stock_symbol: "ABC",
                                vertical: "ENERGY"
                              }, {
                                alt_business_id_type: "NONE",
                                authorized_contact: {
                                  email: "johndoe.com",
                                  name: "John Doe",
                                  seniority: "admin",
                                  title: "Doe"
                                },
                                company_name: "ABC Inc.",
                                customer_type: "RESELLER",
                                ein_issuing_country: "US",
                                entity_type: "SOLE_PROPRIETOR",
                                profile_alias: "vishnu1",
                                profile_type: "SECONDARY",
                                profile_uuid: "1d77a5fe-bca4-4a6d-a7c4-58b70e8cd7a2",
                                stock_symbol: "ABC",
                                vertical: "ENERGY"
                              }]
                            }
                          });
                        } else if (action == 'Profile/06ecae31-4bf8-40b9-ac62-e902418e9935/' && method == 'GET') {
                          resolve({
                            response: {},
                            body: {
                              api_id: "63287a98-b018-11ec-bc21-0242ac110002",
                              profile: {
                                alt_business_id_type: "NONE",
                                authorized_contact: {
                                  name: " "
                                },
                                company_name: "ABC Inc.",
                                customer_type: "RESELLER",
                                ein: "111111111",
                                ein_issuing_country: "US",
                                entity_type: "PUBLIC_PROFIT",
                                profile_alias: "vishnu1",
                                profile_type: "SECONDARY",
                                profile_uuid: "06ecae31-4bf8-40b9-ac62-e902418e9935",
                                stock_symbol: "ABC",
                                vertical: "ENERGY"
                              }
                            }
                          });
                        } else if (action == 'Profile/06ecae31-4bf8-40b9-ac62-e902418e9935/' && method == 'DELETE') {
                          resolve({
                            response: {},
                            body: {
                              api_id: "eb1e71ae-b01e-11ec-88b1-0242ac110002"
                            }
                          });
                        } else if (action == 'Profile/06ecae31-4bf8-40b9-ac62-e902418e9935/' && method == 'POST') {
                          resolve({
                            response: {},
                            body: {
                              api_id: "15783daa-b01e-11ec-88b1-0242ac110002",
                              profile: {
                                address: "123 New York NY 10001 IN",
                                alt_business_id_type: "NONE",
                                authorized_contact: {
                                  email: "Doe",
                                  name: "Joh11n Doe",
                                  seniority: "admin",
                                  title: "Doe"
                                },
                                company_name: "ABC Inc.",
                                customer_type: "RESELLER",
                                ein_issuing_country: "US",
                                entity_type: "PRIVATE_PROFIT",
                                primary_profile: "303edff6-8525-43e5-87e6-48c571ddca25",
                                profile_alias: "vishnu1",
                                profile_type: "SECONDARY",
                                profile_uuid: "1c41faed-a38e-42a3-a966-fe7df34b51b9",
                                stock_symbol: "ABC",
                                vertical: "PROFESSIONAL",
                                website: "google.com"
                              }
                            }
                          });
                        } else if (action == 'Profile/' && method == 'POST') {
                          resolve({
                            response: {},
                            body: {
                              api_id: "99ab47ae-b01c-11ec-bc21-0242ac110002",
                              profile_uuid: "43d0616e-d50a-445a-a84e-310a089f0618"
                            }
                          });
                        } else if (action == '10dlc/Campaign/CMPT4EP/' && method == 'GET') {
                          resolve({
                            response: {},
                            body: {
                              api_id: "12ae5a32-3751-11ec-8e4c-0242ac110002",
                              campaign: {
                                brand_id: "BHYYNCK",
                                campaign_id: "CMPT4EP",
                                mno_metadata: {
                                  AT_T: {
                                    tpm: 4500
                                  },
                                  T_Mobile: {
                                    brand_tier: "TOP"
                                  },
                                  Verizon_Wireless: {}
                                },
                                reseller_id: "RPDPPUM",
                                usecase: "ACCOUNT_NOTIFICATION",
                                sub_usecase: "2FA,ACCOUNT_NOTIFICATION"
                              }
                            }
                          });
                        } else if (action == '10dlc/Campaign/CMPT4EP/' && method == 'DELETE') {
                          resolve({
                            response: {},
                            body: {
                              api_id: "12ae5a32-3751-11ec-8e4c-0242ac110002",
                              campaign_id: "CMPT4EP",
                              message: "Campaign Deactivated"
                            }
                          });
                        } else if (action == '10dlc/Campaign/CMPT4EP/' && method == 'POST') {
                          resolve({
                            response: {},
                            body: {
                              api_id: "12ae5a32-3751-11ec-8e4c-0242ac110002",
                              campaign: {
                                brand_id: "BHYYNCK",
                                campaign_id: "CMPT4EP",
                                mno_metadata: {
                                  AT_T: {
                                    tpm: 4500
                                  },
                                  T_Mobile: {
                                    brand_tier: "TOP"
                                  },
                                  Verizon_Wireless: {}
                                },
                                reseller_id: "RPDPPUM",
                                usecase: "ACCOUNT_NOTIFICATION",
                                sub_usecase: "2FA,ACCOUNT_NOTIFICATION"
                              }
                            }
                          });
                        } else if (action == '10dlc/Brand/' && method == 'GET') {
                          resolve({
                            response: {},
                            body: {
                              api_id: "b9df43c0-374c-11ec-97b3-0242ac110002",
                              brands: [{
                                address: {
                                  city: "",
                                  country: "",
                                  postal_code: "",
                                  state: "",
                                  street: ""
                                },
                                authorized_contact: {},
                                brand_alias: "Ren_With_Vetting",
                                brand_id: "BXZRASW",
                                company_name: "Ren_With_Vetting",
                                ein: "2342334534231",
                                ein_issuing_country: "IN",
                                entity_type: "NON_PROFIT",
                                registration_status: "COMPLETED",
                                vertical: "COMMUNICATION",
                                vetting_score: 80,
                                vetting_status: "ACTIVE",
                                website: "www.renold.com"
                              }, {
                                address: {
                                  city: "",
                                  country: "",
                                  postal_code: "",
                                  state: "",
                                  street: ""
                                },
                                authorized_contact: {},
                                brand_alias: "CSP Testing 003",
                                brand_id: "BMIORKY",
                                company_name: "CSP Testing 003",
                                ein: "234234234",
                                ein_issuing_country: "IN",
                                entity_type: "PUBLIC_PROFIT",
                                registration_status: "COMPLETED",
                                vertical: "COMMUNICATION",
                                vetting_score: 80,
                                vetting_status: "ACTIVE",
                                website: "www.standard1.com"
                              }]
                            }
                          });
                        } else if (action == '10dlc/Campaign/' && method == 'GET') {
                          resolve({
                            response: {},
                            body: {
                              api_id: "5e639fd0-374e-11ec-8e4c-0242ac110002",
                              campaigns: [{
                                brand_id: "BHYYNCK",
                                campaign_id: "CMPT4EP",
                                mno_metadata: {
                                  AT_T: {
                                    tpm: 4500
                                  },
                                  T_Mobile: {
                                    brand_tier: "TOP"
                                  },
                                  Verizon_Wireless: {}
                                },
                                reseller_id: "RPDPPUM",
                                usecase: "ACCOUNT_NOTIFICATION",
                                sub_usecase: "2FA,ACCOUNT_NOTIFICATION"
                              }, {
                                brand_id: "B8OD95Z",
                                campaign_id: "CAIKXXT",
                                mno_metadata: {
                                  AT_T: {
                                    tpm: 4500
                                  },
                                  T_Mobile: {
                                    brand_tier: "TOP"
                                  },
                                  US_Cellular: {},
                                  Verizon_Wireless: {}
                                },
                                reseller_id: "",
                                usecase: "MIXED",
                                sub_usecase: "2FA,ACCOUNT_NOTIFICATION"
                              }]
                            }
                          });
                        } else if (action == '10dlc/Brand/' && method == 'POST') {
                          resolve({
                            response: {},
                            body: {
                              api_id: "ab2e4754-b951-11ec-b7ca-0242ac110002",
                              brand_id: "B1QSGGS",
                              message: "Request to create brand was received and is being processed."
                            }
                          });
                        } else if (action == '10dlc/Campaign/' && method == 'POST') {
                          resolve({
                            response: {},
                            body: {
                              apiId: '5b058374-bba8-11ec-ab4d-0242ac110002',
                              campaignId: 'CFSOBZQ',
                              message: 'Request to create campaign was received and is being processed.'
                            }
                          });
                        } else if (action == '10dlc/Campaign/Import/' && method == 'POST') {
                          resolve({
                            response: {},
                            body: {
                              apiId: "2c6c5e16-090a-11ed-bb48-0242ac110004",
                              campaignId: "CNTQ0OD",
                              message: "Request to import campaign was received and is being processed."
                            }
                          });
                        } else if (action == 'Powerpack/5ec4c8c9-cd74-42b5-9e41-0d7670d6bb46/' && method == 'GET') {
                          resolve({
                            response: {},
                            body: {
                              applicationId: '33660394121755210',
                              applicationType: 'XML',
                              createdOn: '2019-09-03T08:50:09.510692Z',
                              localConnect: false,
                              name: 'vishnu_sep_01',
                              numberPool: '/v1/Account/xxxx/NumberPool/659c7f88-c819-46e2-8af4-2d8a84249099/',
                              stickySender: true,
                              uuid: '5ec4c8c9-cd74-42b5-9e41-0d7670d6bb46'
                            }
                          });
                        } else if (action == 'Powerpack/' && method == 'POST') {
                          resolve({
                            response: {},
                            body: {
                              applicationId: '33660394121755210',
                              applicationType: 'XML',
                              createdOn: '2019-09-03T08:50:09.510692Z',
                              localConnect: false,
                              name: 'node sdk test',
                              numberPool: '/v1/Account/xxxx/NumberPool/659c7f88-c819-46e2-8af4-2d8a84249099/',
                              stickySender: true,
                              uuid: '5ec4c8c9-cd74-42b5-9e41-0d7670d6bb46'
                            }
                          });
                        } else if (action == 'Message/xyz/Media/' && method == 'Get') {
                          resolve({
                            response: {},
                            body: {
                              api_id: '035eeada-6df1-11e6-b608-06a72a185e87',
                              message_uuid: 'message_uuid',
                              objects: [{
                                content_type: 'application/pdf',
                                media_id: '0178eb8a-461a-4fd1-bc37-13eebfdc0676',
                                media_url: 'https://xxxxxxx/Account/{auth_id}/Message/24d742b9-9b12-4397-93a7-da496bc874d9/Media/0178eb8a-461a-4fd1-bc37-13eebfdc0676',
                                message_uuid: '24d742b9-9b12-4397-93a7-da496bc874d9',
                                size: '433994'
                              }]
                            }
                          });
                        } else if (action == 'Message/xyz/' && method == 'GET') {
                          resolve({
                            response: {},
                            body: {
                              api_id: '035eeada-6df1-11e6-b608-06a72a185e87',
                              error_code: '200',
                              from_number: '18552828641',
                              message_direction: 'outbound',
                              message_state: 'failed',
                              message_time: '2016-08-17 21:22:36+05:30',
                              message_type: 'sms',
                              message_uuid: '1',
                              resource_uri: '/v1/Account/{auth_id}/Message/2a340179-e8a9-4b1d-ae2c-9f346e7b6d7d/',
                              to_number: '19352326448',
                              total_amount: '0.00000',
                              total_rate: '0.00350',
                              units: 1,
                              requester_ip: "192.168.1.1",
                              is_domestic: false,
                              message_sent_time: "2024-08-21 18:28:49.244057+05:30",
                              message_updated_time: "2024-08-21 18:28:51.94772+05:30",
                              error_message: ""
                            }
                          });
                        } else if (action == 'NumberPool/659c7f88-c819-46e2-8af4-2d8a84249099/Number/' && method == 'GET') {
                          resolve({
                            response: {},
                            body: {
                              api_id: '0dacbefa-0a87-11ea-b072-0242ac110007',
                              uuid: 'd35f2e82-d387-427f-8594-6fa07613c43a',
                              number_pool: '/v1/Account/{auth_id}/NumberPool/d35f2e82-d387-427f-8594-6fa07613c43a/',
                              meta: {
                                limit: 20,
                                next: '',
                                offset: 0,
                                previous: '',
                                total_count: 3
                              },
                              objects: [{
                                account_phone_number_resource: '/v1/Account/{auth_id}/Number/{your_number}/',
                                added_on: '2019-10-09T11:24:35.085797Z',
                                country_iso2: 'US',
                                number: '{your_number}',
                                number_pool_uuid: 'd35f2e82-d387-427f-8594-6fa07613c43a',
                                type: 'fixed'
                              }, {
                                account_phone_number_resource: '/v1/Account/{auth_id}/Number/{your_number}/',
                                added_on: '2019-10-09T11:24:35.085797Z',
                                country_iso2: 'US',
                                number: '{your_number}',
                                number_pool_uuid: 'd35f2e82-d387-427f-8594-6fa07613c43a',
                                type: 'fixed'
                              }, {
                                account_phone_number_resource: '/v1/Account/{auth_id}/Number/{your_number}/',
                                added_on: '2019-10-09T11:24:35.085797Z',
                                country_iso2: 'CA',
                                number: '{your_number}',
                                number_pool_uuid: 'd35f2e82-d387-427f-8594-6fa07613c43a',
                                type: 'fixed'
                              }]
                            }
                          });
                        } else if (action == 'Powerpack/5ec4c8c9-cd74-42b5-9e41-0d7670d6bb46/' && method == 'DELETE') {
                          resolve({
                            response: {},
                            body: {
                              api_id: '964edb6e-3f08-11e7-920b-0600a1193e9b',
                              response: 'success'
                            }
                          });
                        } else if (action == 'NumberPool/659c7f88-c819-46e2-8af4-2d8a84249099/Number/14845733595/' && method == 'POST') {
                          resolve({
                            response: {},
                            body: {
                              account_phone_number_resource: '/v1/Account/<auth_id>/Number/<your_number>/',
                              added_on: '2019-10-09T11:24:35.085797Z',
                              api_id: '612982e8-0a87-11ea-b072-0242ac110007',
                              country_iso2: 'CA',
                              number: '14845733595',
                              uuid: 'ca5fd1f2-26c0-43e9-a7e4-0dc426e9dd2f',
                              number_pool_uuid: '659c7f88-c819-46e2-8af4-2d8a84249099',
                              number_pool: '/v1/Account/xxxxx/NumberPool/659c7f88-c819-46e2-8af4-2d8a84249099/',
                              type: 'fixed'
                            }
                          });
                        } else if (action == 'NumberPool/659c7f88-c819-46e2-8af4-2d8a84249099/Number/14845733595/' && method == 'GET') {
                          resolve({
                            response: {},
                            body: {
                              account_phone_number_resource: '/v1/Account/<auth_id>/Number/<your_number>/',
                              added_on: '2019-10-09T11:24:35.085797Z',
                              api_id: '612982e8-0a87-11ea-b072-0242ac110007',
                              country_iso2: 'CA',
                              number: '14845733595',
                              uuid: 'ca5fd1f2-26c0-43e9-a7e4-0dc426e9dd2f',
                              number_pool_uuid: '659c7f88-c819-46e2-8af4-2d8a84249099',
                              number_pool: '/v1/Account/xxxxx/NumberPool/659c7f88-c819-46e2-8af4-2d8a84249099/',
                              type: 'fixed'
                            }
                          });
                        } else if (action == 'NumberPool/659c7f88-c819-46e2-8af4-2d8a84249099/Shortcode/444444/' && method == 'GET') {
                          resolve({
                            response: {},
                            body: {
                              added_on: '2019-09-03T08:50:09.578928Z',
                              country_iso2: 'CA',
                              number_pool_uuid: '659c7f88-c819-46e2-8af4-2d8a84249099',
                              shortCode: '444444'
                            }
                          });
                        } else if (action == 'NumberPool/659c7f88-c819-46e2-8af4-2d8a84249099/Shortcode/' && method == 'GET') {
                          resolve({
                            response: {},
                            body: {
                              api_id: '614b2776-0a88-11ea-b072-0242ac110007',
                              uuid: 'ca5fd1f2-26c0-43e9-a7e4-0dc426e9dd2f',
                              number_pool: '/v1/Account/xxxxxxxxx/NumberPool/ca5fd1f2-26c0-43e9-a7e4-0dc426e9dd2f/',
                              meta: {
                                limit: 20,
                                offset: 0,
                                next: '',
                                previous: '',
                                total_count: 1
                              },
                              objects: [{
                                added_on: '2019-10-09T11:10:59.741978Z',
                                country_iso2: 'US',
                                number_pool_uuid: 'ca5fd1f2-26c0-43e9-a7e4-0dc426e9dd2f',
                                shortcode: '444444'
                              }]
                            }
                          });
                        } else if (action == 'NumberPool/659c7f88-c819-46e2-8af4-2d8a84249099/Tollfree/' && method == 'GET') {
                          resolve({
                            response: {},
                            body: {
                              api_id: 'ff25223a-1c9f-11e4-80aa-12313f048015',
                              meta: {
                                limit: 20,
                                next: null,
                                offset: 0,
                                previous: null,
                                total_count: 0
                              },
                              objects: [{
                                added_on: '2019-10-09T11:10:59.741978Z',
                                country_iso2: 'US',
                                number_pool_uuid: '659c7f88-c819-46e2-8af4-2d8a84249099',
                                tollfree: '{your_tollfree}'
                              }]
                            }
                          });
                        } else if (action == 'NumberPool/659c7f88-c819-46e2-8af4-2d8a84249099/Tollfree/18772209942/' && method == 'GET') {
                          resolve({
                            response: {},
                            body: {
                              added_on: '2019-09-03T08:50:09.578928Z',
                              country_iso2: 'CA',
                              number_pool_uuid: '659c7f88-c819-46e2-8af4-2d8a84249099',
                              number: '18772209942'
                            }
                          });
                        } else if (action == 'NumberPool/659c7f88-c819-46e2-8af4-2d8a84249099/Tollfree/18772209942/' && method == 'POST') {
                          resolve({
                            response: {},
                            body: {
                              added_on: '2019-09-03T08:50:09.578928Z',
                              country_iso2: 'CA',
                              number_pool_uuid: '659c7f88-c819-46e2-8af4-2d8a84249099',
                              number: '18772209942'
                            }
                          });
                        } else if (action == 'NumberPool/659c7f88-c819-46e2-8af4-2d8a84249099/Tollfree/18772209942/' && method == 'DELETE') {
                          resolve({
                            response: {},
                            body: {
                              api_id: '964edb6e-3f08-11e7-920b-0600a1193e9b',
                              response: 'success'
                            }
                          });
                        } else if (action == 'NumberPool/659c7f88-c819-46e2-8af4-2d8a84249099/Shortcode/444444/' && method == 'DELETE') {
                          resolve({
                            response: {},
                            body: {
                              api_id: '964edb6e-3f08-11e7-920b-0600a1193e9b',
                              response: 'success'
                            }
                          });
                        } else if (action == 'Powerpack/' && method == 'GET') {
                          resolve({
                            response: {},
                            body: {
                              api_id: 'ff25223a-1c9f-11e4-80aa-12313f048015',
                              meta: {
                                limit: 20,
                                next: null,
                                offset: 0,
                                previous: null,
                                total_count: 0
                              },
                              objects: [{
                                applicationId: '33660394121755210',
                                applicationType: 'XML',
                                createdOn: '2019-09-03T08:50:09.510692Z',
                                localConnect: false,
                                name: 'vishnu_sep_01',
                                numberPool: '/v1/Account/xxxx/NumberPool/659c7f88-c819-46e2-8af4-2d8a84249099/',
                                stickySender: true,
                                uuid: '86bbb125-97bb-4d72-89fd-81d5c515b015'
                              }, {
                                applicationId: '33660394121755210',
                                applicationType: 'XML',
                                createdOn: '2019-09-03T08:50:09.510692Z',
                                localConnect: false,
                                name: 'Neel_sep_01',
                                numberPool: '/v1/Account/xxxx/NumberPool/659c7f88-c819-46e2-8af4-2d8a84249099/',
                                stickySender: true,
                                uuid: '86bbb125-97bb-4d72-89fd-81d5c515b015'
                              }]
                            }
                          });
                        } else if (action == 'Message/1/' && method == 'GET') {
                          resolve({
                            response: {},
                            body: {
                              api_id: '035eeada-6df1-11e6-b608-06a72a185e87',
                              error_code: '200',
                              from_number: '18552828641',
                              message_direction: 'outbound',
                              message_state: 'failed',
                              message_time: '2016-08-17 21:22:36+05:30',
                              message_type: 'sms',
                              message_uuid: '1',
                              resource_uri: '/v1/Account/{auth_id}/Message/2a340179-e8a9-4b1d-ae2c-9f346e7b6d7d/',
                              to_number: '19352326448',
                              total_amount: '0.00000',
                              total_rate: '0.00350',
                              units: 1,
                              requester_ip: '192.168.1.2',
                              is_domestic: false,
                              dlt_entity_id: "9876",
                              dlt_template_id: "5432",
                              dlt_template_category: "transactional",
                              conversation_id: "1234",
                              conversation_origin: "service",
                              conversation_expiration_timestamp: "2023-08-03 23:02:00+05:30",
                              destination_network: "Verizon",
                              carrier_fees_rate: "0.420",
                              carrier_fees: "0.001",
                              message_sent_time: "2024-08-21 18:28:49.244057+05:30",
                              message_updated_time: "2024-08-21 18:28:51.94772+05:30",
                              error_message: ""
                            }
                          });
                        } else if (action == 'Message/' && method == 'GET') {
                          resolve({
                            response: {},
                            body: {
                              api_id: '88415194-6df0-11e6-b608-06a72a185e87',
                              meta: {
                                limit: 20,
                                next: '/v1/Account/{auth_id}/Message/?limit=20&error_code=200&offset=20',
                                offset: 0,
                                previous: null
                              },
                              objects: [{
                                error_code: '200',
                                from_number: '18552828641',
                                message_direction: 'outbound',
                                message_state: 'failed',
                                message_time: '2016-08-17 21:26:44+05:30',
                                message_type: 'sms',
                                message_uuid: '85ce8068-6fab-4f0a-9dc7-d6c852cdde91',
                                resource_uri: '/v1/Account/{auth_id}/Message/85ce8068-6fab-4f0a-9dc7-d6c852cdde91/',
                                to_number: '19352326448',
                                total_amount: '0.00000',
                                total_rate: '0.00350',
                                units: 1,
                                requester_ip: "192.168.1.1",
                                is_domestic: false,
                                dlt_entity_id: "2233",
                                dlt_template_id: "4455",
                                dlt_template_category: "service_implicit",
                                conversation_id: "9876",
                                conversation_origin: "marketing",
                                conversation_expiration_timestamp: "2023-08-03 23:02:00+05:30",
                                destination_network: "Verizon",
                                carrier_fees_rate: "0.420",
                                carrier_fees: "0.001",
                                message_sent_time: "2024-08-21 18:28:49.244057+05:30",
                                message_updated_time: "2024-08-21 18:28:51.94772+05:30",
                                error_message: ""

                              }, {
                                error_code: '200',
                                from_number: '18552828641',
                                message_direction: 'outbound',
                                message_state: 'failed',
                                message_time: '2016-08-17 21:22:36+05:30',
                                message_type: 'sms',
                                message_uuid: '2a340179-e8a9-4b1d-ae2c-9f346e7b6d7d',
                                resource_uri: '/v1/Account/{auth_id}/Message/2a340179-e8a9-4b1d-ae2c-9f346e7b6d7d/',
                                to_number: '19352326448',
                                total_amount: '0.00000',
                                total_rate: '0.00350',
                                units: 1,
                                requester_ip: "192.168.1.2",
                                is_domestic: false,
                                dlt_entity_id: null,
                                dlt_template_id: null,
                                dlt_template_category: null,
                                conversation_id: null,
                                conversation_origin: null,
                                conversation_expiration_timestamp: null,
                                destination_network: "Verizon",
                                carrier_fees_rate: "0.420",
                                carrier_fees: "0.001",
                                message_sent_time: "2024-08-21 18:28:49.244057+05:30",
                                message_updated_time: "2024-08-21 18:28:51.94772+05:30",
                                error_message: ""
                              }]
                            }
                          });
                        } else if (action == 'Message/' && method == 'POST') {
                          resolve({
                            response: {},
                            body: {
                              message: 'message(s) queued',
                              message_uuid: ['db3ce55a-7f1d-11e1-8ea7-1231380bc196'],
                              api_id: 'db342550-7f1d-11e1-8ea7-1231380bc196'
                            }
                          });
                        }

                        // ============= Lookup ===================
                        else if (action == 'Number//' && method == 'GET') {
                            resolve({
                              response: {},
                              body: {
                                api_id: "930692a3-6f09-45b5-80f5-5585565fb30e",
                                phone_number: "+14154305555",
                                country: {
                                  iso2: "US",
                                  iso3: "USA",
                                  name: "United States"
                                },
                                format: {
                                  e164: "+14154305555",
                                  international: "+1 415-430-5555",
                                  national: "(415) 430-5555",
                                  rfc3966: "tel:+1-415-430-5555"
                                },
                                carrier: {
                                  mobile_country_code: "310",
                                  mobile_network_code: "160",
                                  name: "Cingular Wireless",
                                  ported: "yes",
                                  type: "mobile"
                                },
                                resource_uri: "/v1/Number/+14154305555?type=carrier"
                              }
                            });
                          }

                          // =============  Pricings ===================
                          else if (method == 'GET' && action == 'Pricing/') {
                              resolve({
                                response: {},
                                body: {
                                  api_id: '25b3d816-1c9f-11e4-bd8a-12313f016a39',
                                  country: 'United States',
                                  country_code: 1,
                                  country_iso: 'US',
                                  message: {
                                    inbound: {
                                      rate: '0.00000'
                                    },
                                    outbound: {
                                      rate: '0.00650'
                                    },
                                    outbound_networks_list: [{
                                      group_name: 'US',
                                      rate: '0.00650'
                                    }, {
                                      group_name: 'US',
                                      rate: '0.00650'
                                    }]
                                  },
                                  phone_numbers: {
                                    local: {
                                      rate: '0.80000'
                                    },
                                    tollfree: {
                                      rate: '1.00000'
                                    }
                                  },
                                  voice: {
                                    inbound: {
                                      ip: {
                                        rate: '0.00300'
                                      },
                                      local: {
                                        rate: '0.00850'
                                      },
                                      tollfree: {
                                        rate: '0.02100'
                                      }
                                    },
                                    outbound: {
                                      ip: {
                                        rate: '0.00300'
                                      },
                                      local: {
                                        rate: '0.01200'
                                      },
                                      rates: [{
                                        prefix: ['1'],
                                        rate: '0.01200'
                                      }, {
                                        prefix: ['1340'],
                                        rate: '0.02400'
                                      }, {
                                        prefix: ['1808'],
                                        rate: '0.03400'
                                      }, {
                                        prefix: ['1907'],
                                        rate: '0.17900'
                                      }, {
                                        prefix: ['1900'],
                                        rate: '0.60300'
                                      }],
                                      tollfree: {
                                        rate: '0.00300'
                                      }
                                    }
                                  }
                                }
                              });
                            }
                            // =============  Recordings ===================
                            else if (method == 'GET' && action == 'Recording/1/') {
                                resolve({
                                  response: {},
                                  body: {
                                    add_time: '2014-08-05 16:15:15.852059+05:30',
                                    api_id: '7abf0744-1ca0-11e4-a2d1-22000ac5040c',
                                    call_uuid: 'c2c128e2-1c8c-11e4-9bff-1db8a9db0432',
                                    conference_name: 'noname',
                                    recording_duration_ms: '345100.00000',
                                    recording_end_ms: '1407235509007.00000',
                                    recording_format: 'mp3',
                                    recording_id: '1',
                                    recording_start_ms: '1407235163907.00000',
                                    recording_type: 'conference',
                                    recording_url: 'http://s3.amazonaws.com/recordings_2013/c2186400-1c8c-11e4-a664-0026b945b52x.mp3',
                                    resource_uri: '/v1/Account/MANWVLYTK4ZWU1YTY4ZT/Recording/c2186400-1c8c-11e4-a664-0026b945b52x/',
                                    from_number: '+919999323467',
                                    to_number: '+919891865130'
                                  }
                                });
                              } else if (method == 'GET' && action == 'Recording/') {
                                resolve({
                                  response: {},
                                  body: {
                                    api_id: 'ff25223a-1c9f-11e4-80aa-12313f048015',
                                    meta: {
                                      limit: 3,
                                      next: '/v1/Account/MANWVLYTK4ZWU1YTY4ZT/Recording/?limit=3&offset=3',
                                      offset: 0,
                                      previous: null,
                                      total_count: 948
                                    },
                                    objects: [{
                                      add_time: '2014-08-05 16:15:15.852059+05:30',
                                      call_uuid: 'c2c128e2-1c8c-11e4-9bff-1db8a9db0432',
                                      conference_name: 'noname',
                                      recording_duration_ms: '345100.00000',
                                      recording_end_ms: '1407235509007.00000',
                                      recording_format: 'mp3',
                                      recording_id: 'c2186400-1c8c-1124-a664-0026b945b522',
                                      recording_start_ms: '1407235163907.00000',
                                      recording_type: 'conference',
                                      recording_url: 'http://s3.amazonaws.com/recordings_2013/c2186400-1c8c-1124-a664-0026b945b522.mp3',
                                      resource_uri: '/v1/Account/MANWVLYTK4ZWU1YTY4ZT/Recording/c2186400-1c8c-1124-a664-0026b945b522/',
                                      from_number: '+919999323467',
                                      to_number: '+919891865130'
                                    }, {
                                      add_time: '2014-08-05 16:05:21.993853+05:30',
                                      call_uuid: 'fc773e88-1c8b-11e4-b25a-0fe7bcc54670',
                                      conference_name: 'noname',
                                      recording_duration_ms: '90700.00000',
                                      recording_end_ms: '1407234920253.00000',
                                      recording_format: 'mp3',
                                      recording_id: 'fc2716b0-1c8b-11e4-bwad-842b2b17453e',
                                      recording_start_ms: '1407234829553.00000',
                                      recording_type: 'conference',
                                      recording_url: 'http://s3.amazonaws.com/recordings_2013/fc2716b0-1c8b-11e4-bwad-842b2b17453e.mp3',
                                      resource_uri: '/v1/Account/MANWVLYTK4ZWU1YTY4ZT/Recording/fc2716b0-1c8b-11e4-bwad-842b2b17453e/',
                                      from_number: '+919999323467',
                                      to_number: '+919891865130'
                                    }]
                                  }
                                });
                              } else if (method == 'DELETE' && action == 'Recording/1/') {
                                resolve({
                                  response: {},
                                  body: {}
                                });
                              }

                              // =========== PHLO ============================
                              // Get phlo details
                              else if (method == 'GET' && action == 'phlo/sample-phlo-id/') {
                                  resolve({
                                    response: {},
                                    body: {
                                      api_id: '719d8763-f62c-4322-98e2-eed26b85ea8a',
                                      phlo_id: 'sample-phlo-id',
                                      name: 'mpc_test',
                                      created_on: '2018-11-14 04:41:31.827796+00:00'
                                    }
                                  });
                                }
                                // Run Phlo
                                else if (method == 'POST' && action.endsWith('phlo/sample-phlo-id')) {
                                    resolve({
                                      response: {},
                                      body: {
                                        phlo_id: 'sample-phlo-id',
                                        api_id: '275c24f5-7d64-4130-9a4e-148438154549',
                                        message: 'stopped. next node uuid not found for b\'Start\' - b\'Start\' with output state: http - phlo_run_id 275c24f5-7d64-4130-9a4e-148438154549'
                                      }
                                    });
                                  }

                                  // =========== PHLO MULTI PARTY CALL ============================
                                  else if (method == 'GET' && action == 'phlo/sample-phlo-id/multi_party_call/sample-mpc-id/') {
                                      resolve({
                                        response: {},
                                        body: {
                                          api_id: 'ea4811e0-b949-489b-8e4a-9dee03fada6e',
                                          node_id: 'sample-mpc-id',
                                          phlo_id: 'sample-phlo-id',
                                          name: 'Multi-Party Call_2',
                                          node_type: 'multi_party_call',
                                          created_on: '2018-12-04 03:22:20.763091+00:00'
                                        }
                                      });
                                    } else if (method == 'POST' && action == 'phlo/sample-phlo-id/multi_party_call/sample-mpc-id') {
                                      resolve({
                                        response: {},
                                        body: { api_id: '0c449a01-f34f-4e6e-940e-caea79ce58b2', error: '' }
                                      });
                                    }

                                    // =========== PHLO MULTI PARTY CALL Member Methods ============================
                                    else if (method == 'POST' && action == 'phlo/sample-phlo-id/multi_party_call/sample-mpc-id/members/919920700964') {
                                        resolve({
                                          response: {},
                                          body: {
                                            api_id: '1304225e-294e-465f-af50-abf71a5903de',
                                            error: ''
                                          }
                                        });
                                      } else if (method == 'POST' && action == 'Verify/Session/') {
                                        resolve({
                                          response: {},
                                          body: {
                                            message: 'Session initiated',
                                            session_uuid: 'db3ce55a-7f1d-11e1-8ea7-1231380bc196',
                                            api_id: 'db342550-7f1d-11e1-8ea7-1231380bc196'
                                          }
                                        });
                                      } else if (method == 'GET' && action == 'Verify/Session/1/') {
                                        resolve({
                                          response: {},
                                          body: {
                                            api_id: 'c3f2f101-ff46-44dd-808a-00408deba5d1',
                                            session_uuid: 'd8f1b187-ddcb-438a-a298-eb17fb2b31f5',
                                            app_uuid: '3cdec449-a367-435e-b4f9-40d777a7cfcc',
                                            alias: 'new_voice45',
                                            recipient: '918707046406',
                                            channel: 'sms',
                                            status: 'verified',
                                            count: 1,
                                            requestor_ip: '',
                                            destination_country_iso2: 'IN',
                                            destination_network: 'Jio',
                                            attempt_details: [{
                                              channel: 'sms',
                                              attempt_uuid: 'e2f66aeb-6b98-42a9-ba81-0aba74a7eb7c',
                                              status: 'delivered',
                                              time: '2023-07-24T22:47:21.279363+05:30'
                                            }],
                                            charges: {
                                              total_charge: '0.07100',
                                              validation_charge: '0.05',
                                              attempt_charges: [{
                                                attempt_uuid: 'e2f66aeb-6b98-42a9-ba81-0aba74a7eb7c',
                                                channel: 'sms',
                                                charge: '0.02100'
                                              }]
                                            },
                                            created_at: '2023-07-24T22:47:19.243437+05:30',
                                            updated_at: '2023-07-24T22:47:21.279363+05:30'
                                          }
                                        });
                                      } else if (method == 'GET' && action == 'Verify/Session/') {
                                        resolve({
                                          response: {},
                                          body: {
                                            api_id: 'c3f2f101-ff46-44dd-808a-00408deba5d1',
                                            meta: {
                                              limit: 20,
                                              offset: 0,
                                              next: null,
                                              previous: null
                                            },
                                            sessions: [{ session_uuid: 'd8f1b187-ddcb-438a-a298-eb17fb2b31f5',
                                              app_uuid: '3cdec449-a367-435e-b4f9-40d777a7cfcc',
                                              alias: 'new_voice45',
                                              recipient: '918707046406',
                                              channel: 'sms',
                                              status: 'verified',
                                              count: 1,
                                              requestor_ip: '',
                                              destination_country_iso2: 'IN',
                                              destination_network: 'Jio',
                                              attempt_details: [{
                                                channel: 'sms',
                                                attempt_uuid: 'e2f66aeb-6b98-42a9-ba81-0aba74a7eb7c',
                                                status: 'delivered',
                                                time: '2023-07-24T22:47:21.279363+05:30'
                                              }],
                                              charges: {
                                                total_charge: '0.07100',
                                                validation_charge: '0.05',
                                                attempt_charges: [{
                                                  attempt_uuid: 'e2f66aeb-6b98-42a9-ba81-0aba74a7eb7c',
                                                  channel: 'sms',
                                                  charge: '0.02100'
                                                }]
                                              },
                                              created_at: '2023-07-24T22:47:19.243437+05:30',
                                              updated_at: '2023-07-24T22:47:21.279363+05:30' }]
                                          }
                                        });
                                      } else if (method == 'POST' && action == 'Verify/Session/1/') {
                                        resolve({
                                          response: {},
                                          body: {
                                            message: 'session validated successfully.',
                                            session_uuid: 'db3ce55a-7f1d-11e1-8ea7-1231380bc196',
                                            api_id: 'db342550-7f1d-11e1-8ea7-1231380bc196'
                                          }
                                        });
                                      }

                                      // =========== TollfreeVerification Methods ============================
                                      else if (method == 'POST' && action == 'TollfreeVerification/') {
                                          resolve({
                                            response: {},
                                            body: {
                                              message: 'created',
                                              uuid: 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX',
                                              api_id: 'db342550-7f1d-11e1-8ea7-1231380bc196'
                                            }
                                          });
                                        } else if (method == 'GET' && action == 'TollfreeVerification/') {
                                          resolve({
                                            response: {},
                                            body: {
                                              "api_id": "4e15f360-72fe-11ee-8538-e20bbbfb283e",
                                              "meta": {
                                                "total_count": 10,
                                                "limit": 3,
                                                "next": "/v1/Account/MAXXXXXXXXXXXXXXXXXX/TollfreeVerification/?limit=3&offset=3",
                                                "offset": 0,
                                                "previous": null
                                              },
                                              "objects": [{
                                                "additional_information": "",
                                                "callback_method": "POST",
                                                "callback_url": "http://callback_url",
                                                "created": "2023-10-12T15:28:10.216507Z",
                                                "extra_data": "",
                                                "message_sample": "1.Your Plivo verification code is xxxx. 2.Dear <customer name>, you have signed up on Plivo successfully.",
                                                "number": "18449605287",
                                                "optin_image_url": "https://www.plivo.com",
                                                "optin_type": "MOBILE_QR_CODE",
                                                "profile_uuid": "0ead82e0-fc80-4dc3-888b-XXXXXXXXXXXX",
                                                "error_message": "Demo Testing",
                                                "status": "REJECTED",
                                                "last_modified": "2023-10-13T08:24:26.619565Z",
                                                "usecase": "2FA",
                                                "usecase_summary": "1.We send 2FA codes to customers when they signup. 2.Dear <customer name>, you have signed up on Plivo successfully.",
                                                "uuid": "312b3119-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
                                                "volume": "100"
                                              }, {
                                                "additional_information": "",
                                                "callback_method": "POST",
                                                "callback_url": "http://callback_url",
                                                "created": "2023-10-12T12:06:46.527653Z",
                                                "extra_data": "",
                                                "message_sample": "1.Your Plivo verification code is xxxx. 2.Dear <customer name>, you have signed up on Plivo successfully.",
                                                "number": "18449605287",
                                                "optin_image_url": "https://www.plivo.com",
                                                "optin_type": "MOBILE_QR_CODE",
                                                "profile_uuid": "0ead82e0-fc80-4dc3-888b-XXXXXXXXXXXX",
                                                "error_message": "Demo Testing",
                                                "status": "REJECTED",
                                                "last_modified": "2023-10-12T15:27:56.052433Z",
                                                "usecase": "2FA",
                                                "usecase_summary": "1.We send 2FA codes to customers when they signup. 2.Dear <customer name>, you have signed up on Plivo successfully.",
                                                "uuid": "96ec880d-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
                                                "volume": "100"
                                              }]
                                            }
                                          });
                                        } else if (method == 'GET' && action == 'TollfreeVerification/1/') {
                                          resolve({
                                            response: {},
                                            body: {
                                              additionalInformation: '',
                                              api_id: 'cb715662-7d74-11ee-acc0-0242ac110007',
                                              callbackMethod: 'POST',
                                              callbackUrl: 'http://callback_url',
                                              created: '2023-11-07T08:10:57.43719Z',
                                              errorMessage: 'Unknown error. Please contact support.',
                                              extraData: '',
                                              lastModified: '2023-11-07T08:11:01.398865Z',
                                              messageSample: '1.Your Plivo verification code is xxxx. 2.Dear <customer name>, you have signed up on Plivo successfully.',
                                              number: '18339431490',
                                              optinImageUrl: 'https://www.plivo.com',
                                              optinType: 'MOBILE_QR_CODE',
                                              profileUuid: '42f92135-6ec2-4110-8da4-XXXXXXXXXXXX',
                                              status: 'REJECTED',
                                              usecase: '2FA',
                                              usecaseSummary: '1.We send 2FA codes to customers when they signup. 2.Dear <customer name>, you have signed up on Plivo successfully.',
                                              uuid: 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX',
                                              volume: '100'
                                            }
                                          });
                                        } else if (method == 'POST' && action == 'TollfreeVerification/1/') {
                                          resolve({
                                            response: {},
                                            body: {
                                              message: 'Tollfree verification request for 18XXXXXXXXX updated succesfully',
                                              api_id: 'db342550-7f1d-11e1-8ea7-1231380bc196'
                                            }
                                          });
                                        } else if (method == 'DELETE' && action == 'TollfreeVerification/1/') {
                                          resolve({
                                            response: {},
                                            body: {
                                              response: {},
                                              body: {}
                                            }
                                          });
                                        }
                                        // =========== COMPLIANCE DOCUMENTS ============================
                                        else if (method == 'POST' && action == 'ComplianceDocument/') {
                                            resolve({
                                              response: {},
                                              body: {
                                                api_id: 'db342550-7f1d-11e1-8ea7-1231380bc196',
                                                document_type_id: 'doc-type-123',
                                                document_id: 'doc-456',
                                                end_user_id: 'end-user-789',
                                                alias: params.alias || 'test-doc',
                                                message: 'Document uploaded successfully',
                                                meta_information: {},
                                                file_name: 'dummy.pdf',
                                                created_at: '2024-01-01 00:00:00'
                                              }
                                            });
                                          }

                                          // =========== PHONE NUMBER COMPLIANCE REQUIREMENTS ============================
                                          else if (method == 'GET' && action == 'PhoneNumber/Compliance/Requirements/') {
                                              resolve({
                                                response: {},
                                                body: {
                                                  api_id: 'test-api-id',
                                                  requirement_id: 'req-uuid-123',
                                                  country_iso: params.country_iso || 'IN',
                                                  number_type: params.number_type || 'local',
                                                  user_type: params.user_type || 'business',
                                                  document_types: [{
                                                    document_type_id: 'dt-uuid-123',
                                                    name: 'Registration Certificate',
                                                    description: 'Certificate Registration',
                                                    proof_required: true,
                                                    required_fields: [{ field_name: 'business_name', friendly_name: 'Legal Name', field_type: 'string', required: true, min_length: 1, max_length: 50 }]
                                                  }]
                                                }
                                              });
                                            }

                                            // =========== PHONE NUMBER COMPLIANCE - CREATE ============================
                                            else if (method == 'POST' && action == 'PhoneNumber/Compliance/') {
                                                resolve({
                                                  response: {},
                                                  body: {
                                                    api_id: 'test-api-id',
                                                    compliance_id: 'comp-uuid-123',
                                                    message: 'Compliance application created and submitted for review.'
                                                  }
                                                });
                                              }

                                              // =========== PHONE NUMBER COMPLIANCE - LIST ============================
                                              else if (method == 'GET' && action == 'PhoneNumber/Compliance/') {
                                                  resolve({
                                                    response: {},
                                                    body: {
                                                      api_id: 'pnc-api-list-001',
                                                      meta: {
                                                        limit: params.limit || 20,
                                                        offset: params.offset || 0,
                                                        next: '/v1/Account/MANWVLYTK4ZWU1YTY4ZT/PhoneNumber/Compliance/?limit=20&offset=20',
                                                        previous: null,
                                                        total_count: 2
                                                      },
                                                      compliances: [{
                                                        compliance_id: 'pnc-456',
                                                        alias: 'compliance-us-local',
                                                        status: 'approved',
                                                        user_type: 'business',
                                                        country_iso: 'US',
                                                        number_type: 'local',
                                                        callback_url: null,
                                                        callback_method: null,
                                                        rejection_reason: null,
                                                        created_at: '2025-01-15 10:30:00+00:00',
                                                        updated_at: '2025-01-15 10:30:00+00:00'
                                                      }, {
                                                        compliance_id: 'pnc-789',
                                                        alias: 'compliance-de-mobile',
                                                        status: 'draft',
                                                        user_type: 'individual',
                                                        country_iso: 'DE',
                                                        number_type: 'mobile',
                                                        callback_url: null,
                                                        callback_method: null,
                                                        rejection_reason: null,
                                                        created_at: '2025-01-16 11:00:00+00:00',
                                                        updated_at: '2025-01-16 11:00:00+00:00'
                                                      }]
                                                    }
                                                  });
                                                }

                                                // =========== PHONE NUMBER COMPLIANCE - GET SINGLE ============================
                                                // The real API wraps the compliance data inside a "compliance" key.
                                                else if (method == 'GET' && action == 'PhoneNumber/Compliance/pnc-456/') {
                                                    resolve({
                                                      response: {},
                                                      body: {
                                                        api_id: 'pnc-api-get-001',
                                                        compliance: {
                                                          compliance_id: 'pnc-456',
                                                          alias: 'compliance-us-local',
                                                          status: 'approved',
                                                          user_type: 'business',
                                                          country_iso: 'US',
                                                          number_type: 'local',
                                                          callback_url: null,
                                                          callback_method: null,
                                                          documents: [{
                                                            document_id: 'doc-111',
                                                            document_name: 'Address Proof',
                                                            document_type_id: 'dt-001'
                                                          }],
                                                          end_user: { end_user_id: 'eu-789', end_user_type: 'business' },
                                                          rejection_reason: null,
                                                          created_at: '2025-01-15 10:30:00+00:00',
                                                          updated_at: '2025-01-15 10:30:00+00:00',
                                                          linked_numbers: []
                                                        }
                                                      }
                                                    });
                                                  } else if (method == 'GET' && action == 'PhoneNumber/Compliance/pnc-rejected/') {
                                                    resolve({
                                                      response: {},
                                                      body: {
                                                        api_id: 'pnc-api-get-002',
                                                        compliance: {
                                                          compliance_id: 'pnc-rejected',
                                                          alias: 'compliance-rejected',
                                                          status: 'rejected',
                                                          user_type: 'business',
                                                          country_iso: 'US',
                                                          number_type: 'local',
                                                          callback_url: null,
                                                          callback_method: null,
                                                          documents: [{
                                                            document_id: 'doc-222',
                                                            document_name: 'Identity Proof',
                                                            document_type_id: 'dt-002'
                                                          }],
                                                          end_user: { end_user_id: 'eu-789', end_user_type: 'business' },
                                                          rejection_reason: 'Document expired',
                                                          linked_numbers: ['+14155551234', '+14155555678'],
                                                          created_at: '2025-01-14 09:00:00+00:00',
                                                          updated_at: '2025-01-14 09:00:00+00:00'
                                                        }
                                                      }
                                                    });
                                                  } else if (method == 'GET' && action == 'PhoneNumber/Compliance/pnc-not-found/') {
                                                    reject(new Error('not found'));
                                                  }

                                                  // =========== PHONE NUMBER COMPLIANCE - UPDATE ============================
                                                  else if (method == 'PATCH' && action == 'PhoneNumber/Compliance/pnc-456/') {
                                                      resolve({
                                                        response: {},
                                                        body: {
                                                          api_id: 'pnc-api-update-001',
                                                          message: 'Compliance application updated successfully',
                                                          compliance: {
                                                            compliance_id: 'pnc-456',
                                                            alias: params.alias || 'compliance-us-local',
                                                            status: 'draft'
                                                          }
                                                        }
                                                      });
                                                    } else if (method == 'PATCH' && action == 'PhoneNumber/Compliance/pnc-submitted/') {
                                                      reject(new Error('Cannot update compliance application in submitted status'));
                                                    }

                                                    // =========== PHONE NUMBER COMPLIANCE - DELETE ============================
                                                    else if (method == 'DELETE' && action == 'PhoneNumber/Compliance/pnc-456/') {
                                                        resolve({
                                                          response: {},
                                                          body: {}
                                                        });
                                                      } else if (method == 'DELETE' && action == 'PhoneNumber/Compliance/pnc-not-found/') {
                                                        reject(new Error('not found'));
                                                      }

                                                      // =========== PHONE NUMBER COMPLIANCE - LINK ============================
                                                      else if (method == 'POST' && action == 'PhoneNumber/Compliance/Link/') {
                                                          resolve({
                                                            response: {},
                                                            body: {
                                                              api_id: 'pnc-api-link-001',
                                                              total_count: 1,
                                                              updated_count: 1,
                                                              report: [{
                                                                number: params.phone_number || '+14155551234',
                                                                status: 'success',
                                                                remarks: 'Linked successfully'
                                                              }]
                                                            }
                                                          });
                                                        }

                                                        // =========== If no combination found, raise issue ============================
                                                        else {
                                                            console.log('===>--->', method, action, '=>', params);
                                                            reject(new Error('not found'));
                                                          }
    });
  };
}