{
  "name": "QuietPass — recover Sheets receipt only (OFF)",
  "flow": [
    {
      "id": 1,
      "module": "app#quietpass-kkwpuh:recoverAutomation",
      "version": 1,
      "parameters": {
        "__IMTCONN__": null
      },
      "mapper": {
        "operationId": "REPLACE_ORIGINAL_OPERATION_ID"
      },
      "metadata": {
        "designer": {
          "x": 0,
          "y": 0,
          "name": "Get a saved phone check"
        },
        "expect": [
          {
            "name": "operationId",
            "type": "text",
            "label": "Saved operation ID",
            "required": true
          }
        ],
        "interface": [
          {
            "name": "id",
            "label": "Saved operation ID",
            "type": "text"
          },
          {
            "name": "state",
            "label": "Operation state",
            "type": "text"
          },
          {
            "name": "quoteId",
            "label": "Original quote ID",
            "type": "text"
          },
          {
            "name": "maxSpend",
            "label": "Maximum amount",
            "type": "text"
          },
          {
            "name": "heldAmount",
            "label": "Amount reserved",
            "type": "text"
          },
          {
            "name": "chargedAmount",
            "label": "Charged amount",
            "type": "text"
          },
          {
            "name": "resultState",
            "label": "Saved result state",
            "type": "text"
          },
          {
            "name": "result",
            "label": "Phone check result",
            "type": "collection",
            "spec": [
              {
                "name": "requestId",
                "label": "Request ID",
                "type": "text"
              },
              {
                "name": "mode",
                "label": "Mode",
                "type": "text"
              },
              {
                "name": "simulated",
                "label": "Simulated",
                "type": "boolean"
              },
              {
                "name": "preparedAt",
                "label": "Prepared at",
                "type": "date"
              },
              {
                "name": "number",
                "label": "Phone number",
                "type": "collection",
                "spec": [
                  {
                    "name": "e164",
                    "label": "International number",
                    "type": "text"
                  },
                  {
                    "name": "national",
                    "label": "National number",
                    "type": "text"
                  },
                  {
                    "name": "international",
                    "label": "Formatted international number",
                    "type": "text"
                  },
                  {
                    "name": "country",
                    "label": "Country",
                    "type": "text"
                  },
                  {
                    "name": "valid",
                    "label": "Numbering plan valid",
                    "type": "boolean"
                  },
                  {
                    "name": "validationReason",
                    "label": "Validation reason",
                    "type": "text"
                  },
                  {
                    "name": "type",
                    "label": "Line type",
                    "type": "text"
                  },
                  {
                    "name": "typeReason",
                    "label": "Line type unavailable reason",
                    "type": "text"
                  },
                  {
                    "name": "carrier",
                    "label": "Current carrier",
                    "type": "text"
                  },
                  {
                    "name": "carrierReason",
                    "label": "Carrier unavailable reason",
                    "type": "text"
                  },
                  {
                    "name": "ported",
                    "label": "Ported",
                    "type": "boolean"
                  },
                  {
                    "name": "portedReason",
                    "label": "Porting unavailable reason",
                    "type": "text"
                  }
                ]
              },
              {
                "name": "contact",
                "label": "Contact options",
                "type": "collection",
                "spec": [
                  {
                    "name": "sms",
                    "label": "SMS support",
                    "type": "collection",
                    "spec": [
                      {
                        "name": "supported",
                        "label": "Supported",
                        "type": "boolean"
                      },
                      {
                        "name": "assumed",
                        "label": "Assumed from line type",
                        "type": "boolean"
                      },
                      {
                        "name": "basis",
                        "label": "Evidence basis",
                        "type": "text"
                      },
                      {
                        "name": "reason",
                        "label": "Unavailable reason",
                        "type": "text"
                      }
                    ]
                  },
                  {
                    "name": "whatsapp",
                    "label": "WhatsApp registration",
                    "type": "collection",
                    "spec": [
                      {
                        "name": "registered",
                        "label": "Registered",
                        "type": "boolean"
                      },
                      {
                        "name": "reason",
                        "label": "Unavailable reason",
                        "type": "text"
                      }
                    ]
                  },
                  {
                    "name": "telegram",
                    "label": "Telegram registration",
                    "type": "collection",
                    "spec": [
                      {
                        "name": "registered",
                        "label": "Registered",
                        "type": "boolean"
                      },
                      {
                        "name": "reason",
                        "label": "Unavailable reason",
                        "type": "text"
                      }
                    ]
                  }
                ]
              },
              {
                "name": "network",
                "label": "Network status",
                "type": "collection",
                "spec": [
                  {
                    "name": "reachable",
                    "label": "Reachable",
                    "type": "boolean"
                  },
                  {
                    "name": "reason",
                    "label": "Unavailable reason",
                    "type": "text"
                  }
                ]
              },
              {
                "name": "billing",
                "label": "Charge receipt",
                "type": "collection",
                "spec": [
                  {
                    "name": "currency",
                    "label": "Currency",
                    "type": "text"
                  },
                  {
                    "name": "amount",
                    "label": "Billed amount",
                    "type": "text"
                  }
                ]
              }
            ]
          }
        ]
      }
    },
    {
      "id": 2,
      "module": "google-sheets:makeAPICall",
      "version": 2,
      "parameters": {
        "__IMTCONN__": null
      },
      "mapper": {
        "headers": [
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "url": "spreadsheets/REPLACE_SPREADSHEET_ID/values/QuietPassResults!A:Q:append",
        "method": "POST",
        "qs": [
          {
            "key": "valueInputOption",
            "value": "RAW"
          },
          {
            "key": "insertDataOption",
            "value": "INSERT_ROWS"
          }
        ],
        "body": "{\"majorDimension\":\"ROWS\",\"values\":[[\"REPLACE_ORIGINAL_RECORD_ID\",\"REPLACE_ORIGINAL_REVISION\",\"{{escapeJSON(if(1.id = null; emptystring; 1.id))}}\",\"{{escapeJSON(if(1.result.requestId = null; emptystring; 1.result.requestId))}}\",\"{{escapeJSON(if(1.result.number.e164 = null; emptystring; 1.result.number.e164))}}\",\"{{escapeJSON(if(1.result.number.country = null; emptystring; 1.result.number.country))}}\",\"{{escapeJSON(if(1.result.number.type = null; emptystring; 1.result.number.type))}}\",\"{{escapeJSON(if(1.result.number.carrier = null; emptystring; 1.result.number.carrier))}}\",\"{{if(1.result.contact.sms.supported = null; emptystring; 1.result.contact.sms.supported)}}\",\"{{escapeJSON(if(1.result.contact.sms.basis = null; emptystring; 1.result.contact.sms.basis))}}\",\"{{if(1.result.contact.whatsapp.registered = null; emptystring; 1.result.contact.whatsapp.registered)}}\",\"{{if(1.result.contact.telegram.registered = null; emptystring; 1.result.contact.telegram.registered)}}\",\"{{if(1.result.network.reachable = null; emptystring; 1.result.network.reachable)}}\",\"{{escapeJSON(if(1.result.preparedAt = null; emptystring; 1.result.preparedAt))}}\",\"{{escapeJSON(if(1.state = null; emptystring; 1.state))}}\",\"{{escapeJSON(if(1.chargedAmount = null; emptystring; 1.chargedAmount))}}\",\"{{escapeJSON(if(1.result.billing.currency = null; emptystring; 1.result.billing.currency))}}\"]]}"
      },
      "metadata": {
        "designer": {
          "x": 300,
          "y": 0,
          "name": "Append a receipt by immutable record ID and source revision"
        }
      },
      "filter": {
        "name": "Only a settled retained result may be written",
        "conditions": [
          [
            {
              "a": "{{1.state}}",
              "o": "text:equal",
              "b": "settled"
            },
            {
              "a": "{{1.resultState}}",
              "o": "text:equal",
              "b": "settled"
            },
            {
              "a": "{{1.result.requestId}}",
              "o": "exist"
            }
          ]
        ]
      }
    }
  ],
  "metadata": {
    "instant": false,
    "version": 1,
    "scenario": {
      "roundtrips": 1,
      "maxErrors": 3,
      "autoCommit": true,
      "autoCommitTriggerLast": true,
      "sequential": true,
      "slots": null,
      "confidential": false,
      "dataloss": false,
      "dlq": true,
      "freshVariables": false
    },
    "designer": {
      "orphans": []
    },
    "zone": "eu1.make.com",
    "notes": []
  }
}
