{"version":3,"sources":["node_modules/country-list/data.json","node_modules/country-list/country-list.js","node_modules/@vendasta/marketplace-apps/fesm2020/vendasta-marketplace-apps-v1.mjs","libs/marketplace-apps/src/v1/vendor.service.ts","libs/marketplace-apps/src/v1/marketplace-app.service.ts","libs/marketplace-apps/src/v1/editions.service.ts","libs/marketplace-apps/src/v1/file.model.ts","libs/billing/src/lib/applied_discount/applied_discount.ts","libs/billing/src/lib/pricing/billing-strategy.ts","libs/billing/src/lib/pricing/product-pricing-rules.ts","libs/billing/src/lib/pricing/commitment.ts","libs/billing/src/lib/pricing/fee.ts","libs/billing/src/lib/pricing/pricing-plan-product.ts","libs/billing/src/lib/pricing/product-pricing.ts","libs/billing/src/lib/pricing/status.ts","libs/billing/src/lib/pricing/source.ts","libs/billing/src/lib/billable-item/billable-item.ts","libs/billing/src/lib/revenue/revenue.service.ts","libs/billing/src/lib/merchant-report/merchant-report.service.ts","libs/billing/src/lib/purchase/purchase_status.ts","libs/billing/src/lib/purchase/purchase.ts","libs/billing/src/lib/customer_summary/customer-summary.ts","libs/billing/src/lib/contract/dimension.ts","libs/billing/src/lib/contract/contract.ts","libs/billing/src/lib/product/product.ts","libs/billing/src/lib/product/list-products.ts","libs/billing/src/lib/billing.service.ts","libs/marketplace-apps/src/v1/addon.model.ts","libs/store/src/lib/order-form/dropdown-form-section/dropdown-form-section-data.ts","libs/store/src/lib/order-form/order-form-section/order-form-section-data.ts","libs/store/src/lib/order-form/order-form/interface.ts","libs/store/src/lib/order-form/fields/field-base.ts","libs/store/src/lib/order-form/fields/field-checkbox.ts","libs/store/src/lib/order-form/fields/field-dropdown.ts","libs/store/src/lib/order-form/fields/field-fileuploadgroup.ts","libs/store/src/lib/order-form/fields/field-textarea.ts","libs/store/src/lib/order-form/fields/field-textbox.ts","libs/store/src/lib/order-form/fields/field-vbcuser.ts","libs/store/src/lib/order-form/order-form/order-form.service.ts","libs/store/src/lib/order-form/dropdown-form-section/temporary-storage.service.ts","libs/image-transformation/src/lib/image-transformation.service.ts","libs/image-transformation/src/lib/image-transformation.module.ts","libs/store/src/lib/order-form/fields/field.component.ts","libs/store/src/lib/order-form/fields/field.component.html","libs/store/src/lib/order-form/dropdown-form-section/dropdown-form-section.component.ts","libs/store/src/lib/shared/build-temporary-storage-key.pipe.ts","libs/store/src/lib/order-form/order-form-section/order-form-section.component.ts","libs/store/src/lib/order-form/order-form-section/order-form-section.component.html","libs/store/src/lib/order-form/order-form/order-form.component.ts","libs/store/src/lib/order-form/order-form/order-form.component.html","libs/store/src/lib/assets/i18n/en_devel.json","libs/store/src/lib/shared/constants.ts","libs/store/src/lib/pricing/base-pricing.component.ts","libs/store/src/lib/pricing/highlight-pricing/highlight-pricing.component.ts","libs/store/src/lib/pricing/highlight-pricing/highlight-pricing.component.html","libs/store/src/lib/shared/format-date.pipe.ts","libs/store/src/lib/shared/format-discount.pipe.ts","libs/store/src/lib/pricing/table-pricing/table-pricing.component.ts","libs/store/src/lib/pricing/table-pricing/table-pricing.component.html","libs/store/src/lib/pricing/pricing.component.ts","libs/store/src/lib/pricing/pricing.component.html","libs/store/src/lib/pricing/pricing.module.ts","libs/store/src/lib/header-container/header-container.module.ts","libs/store/src/lib/store-card.module.ts","libs/store/src/lib/order-form/fields/field-builder/field-builder.component.ts","libs/store/src/lib/order-form/fields/field-builder/field-builder.component.html","libs/store/src/lib/order-form/fields/field.service.ts","node_modules/@vendasta/marketplace-packages/fesm2020/vendasta-marketplace-packages.mjs","libs/store/src/lib/order-form/order-form.module.ts","libs/store/src/lib/stencils/details-stencil.component.ts","libs/store/src/lib/stencils/stencils.module.ts","libs/store/src/lib/addon-list/addon-list.component.ts","libs/store/src/lib/addon-list/addon-list.component.html","libs/store/src/lib/addon-list/addon-list.module.ts","libs/store/src/lib/store.service.ts","libs/store/src/lib/store.module.ts","libs/store/src/lib/faqs/faqs.component.ts","libs/store/src/lib/faqs/faqs.module.ts","libs/store/src/lib/files/files.module.ts","libs/store/src/lib/restrictions/country-v2/supported-countries-v2.component.ts","libs/store/src/lib/restrictions/country-v2/supported-countries-v2.component.html","libs/store/src/lib/restrictions/restrictions.module.ts","libs/store/src/lib/selling-info/selling-info.component.ts","libs/store/src/lib/selling-info/selling-info.module.ts","libs/store/src/lib/product-details-v2/addon-list/addon-list.component.ts","libs/store/src/lib/product-details-v2/addon-list/addon-list.component.html","libs/store/src/lib/product-details-v2/product-details-v2.interface.ts","libs/store/src/lib/product-details-v2/editions-marketing/editions-marketing.component.ts","libs/store/src/lib/product-details-v2/editions-marketing/editions-marketing.component.html","libs/store/src/lib/product-details-v2/need-help/need-help.component.ts","libs/store/src/lib/files/shared/file.model.ts","libs/store/src/lib/shared/sellable.ts","libs/store/src/lib/shared/case-transform.ts","libs/store/src/lib/shared/product.ts","libs/store/src/lib/store-item.ts","libs/store/src/lib/product-details-v2/screenshots-files/screenshots-files.component.ts","libs/store/src/lib/product-details-v2/screenshots-files/screenshots-files.component.html","libs/store/src/lib/product-details-v2/form-preview/form-preview.component.ts","libs/store/src/lib/product-details-v2/form-preview/form-preview.component.html","libs/store/src/lib/product-details-v2/videos/video-parser.ts","libs/store/src/lib/product-details-v2/videos/videos.component.ts","libs/store/src/lib/product-details-v2/videos/videos.component.html","libs/store/src/lib/product-details-v2/product-info/required-products-list/required-products-list.component.ts","libs/store/src/lib/product-details-v2/product-info/required-products-list/required-products-list.component.html","libs/store/src/lib/product-details-v2/product-info/product-requirements/app-product-requirements.component.ts","libs/store/src/lib/product-details-v2/product-info/product-requirements/app-product-requirements.component.html","libs/store/src/lib/product-details-v2/product-info/product-info.component.ts","libs/store/src/lib/product-details-v2/product-info/product-info.component.html","libs/store/src/lib/product-details-v2/product-details-v2.component.ts","libs/store/src/lib/product-details-v2/product-details-v2.component.html","libs/store/src/lib/product-details-v2/product-details-v2.module.ts","libs/store/src/lib/utils/billing-utils.ts","apps/vendor-center-client/src/app/features/omni-search/partner-switcher/partner-switcher.service.ts","apps/vendor-center-client/src/app/core/auth/auth.api.service.ts","apps/vendor-center-client/src/app/core/auth/auth.service.ts"],"sourcesContent":["[\n { \"code\": \"AD\", \"name\": \"Andorra\" },\n { \"code\": \"AE\", \"name\": \"United Arab Emirates\" },\n { \"code\": \"AF\", \"name\": \"Afghanistan\" },\n { \"code\": \"AG\", \"name\": \"Antigua and Barbuda\" },\n { \"code\": \"AI\", \"name\": \"Anguilla\" },\n { \"code\": \"AL\", \"name\": \"Albania\" },\n { \"code\": \"AM\", \"name\": \"Armenia\" },\n { \"code\": \"AO\", \"name\": \"Angola\" },\n { \"code\": \"AQ\", \"name\": \"Antarctica\" },\n { \"code\": \"AR\", \"name\": \"Argentina\" },\n { \"code\": \"AS\", \"name\": \"American Samoa\" },\n { \"code\": \"AT\", \"name\": \"Austria\" },\n { \"code\": \"AU\", \"name\": \"Australia\" },\n { \"code\": \"AW\", \"name\": \"Aruba\" },\n { \"code\": \"AX\", \"name\": \"Åland Islands\" },\n { \"code\": \"AZ\", \"name\": \"Azerbaijan\" },\n { \"code\": \"BA\", \"name\": \"Bosnia and Herzegovina\" },\n { \"code\": \"BB\", \"name\": \"Barbados\" },\n { \"code\": \"BD\", \"name\": \"Bangladesh\" },\n { \"code\": \"BE\", \"name\": \"Belgium\" },\n { \"code\": \"BF\", \"name\": \"Burkina Faso\" },\n { \"code\": \"BG\", \"name\": \"Bulgaria\" },\n { \"code\": \"BH\", \"name\": \"Bahrain\" },\n { \"code\": \"BI\", \"name\": \"Burundi\" },\n { \"code\": \"BJ\", \"name\": \"Benin\" },\n { \"code\": \"BL\", \"name\": \"Saint Barthélemy\" },\n { \"code\": \"BM\", \"name\": \"Bermuda\" },\n { \"code\": \"BN\", \"name\": \"Brunei Darussalam\" },\n { \"code\": \"BO\", \"name\": \"Bolivia, Plurinational State of\" },\n { \"code\": \"BQ\", \"name\": \"Bonaire, Sint Eustatius and Saba\" },\n { \"code\": \"BR\", \"name\": \"Brazil\" },\n { \"code\": \"BS\", \"name\": \"Bahamas\" },\n { \"code\": \"BT\", \"name\": \"Bhutan\" },\n { \"code\": \"BV\", \"name\": \"Bouvet Island\" },\n { \"code\": \"BW\", \"name\": \"Botswana\" },\n { \"code\": \"BY\", \"name\": \"Belarus\" },\n { \"code\": \"BZ\", \"name\": \"Belize\" },\n { \"code\": \"CA\", \"name\": \"Canada\" },\n { \"code\": \"CC\", \"name\": \"Cocos (Keeling) Islands\" },\n { \"code\": \"CD\", \"name\": \"Congo, Democratic Republic of the\" },\n { \"code\": \"CF\", \"name\": \"Central African Republic\" },\n { \"code\": \"CG\", \"name\": \"Congo\" },\n { \"code\": \"CH\", \"name\": \"Switzerland\" },\n { \"code\": \"CI\", \"name\": \"Côte d'Ivoire\" },\n { \"code\": \"CK\", \"name\": \"Cook Islands\" },\n { \"code\": \"CL\", \"name\": \"Chile\" },\n { \"code\": \"CM\", \"name\": \"Cameroon\" },\n { \"code\": \"CN\", \"name\": \"China\" },\n { \"code\": \"CO\", \"name\": \"Colombia\" },\n { \"code\": \"CR\", \"name\": \"Costa Rica\" },\n { \"code\": \"CU\", \"name\": \"Cuba\" },\n { \"code\": \"CV\", \"name\": \"Cabo Verde\" },\n { \"code\": \"CW\", \"name\": \"Curaçao\" },\n { \"code\": \"CX\", \"name\": \"Christmas Island\" },\n { \"code\": \"CY\", \"name\": \"Cyprus\" },\n { \"code\": \"CZ\", \"name\": \"Czechia\" },\n { \"code\": \"DE\", \"name\": \"Germany\" },\n { \"code\": \"DJ\", \"name\": \"Djibouti\" },\n { \"code\": \"DK\", \"name\": \"Denmark\" },\n { \"code\": \"DM\", \"name\": \"Dominica\" },\n { \"code\": \"DO\", \"name\": \"Dominican Republic\" },\n { \"code\": \"DZ\", \"name\": \"Algeria\" },\n { \"code\": \"EC\", \"name\": \"Ecuador\" },\n { \"code\": \"EE\", \"name\": \"Estonia\" },\n { \"code\": \"EG\", \"name\": \"Egypt\" },\n { \"code\": \"EH\", \"name\": \"Western Sahara\" },\n { \"code\": \"ER\", \"name\": \"Eritrea\" },\n { \"code\": \"ES\", \"name\": \"Spain\" },\n { \"code\": \"ET\", \"name\": \"Ethiopia\" },\n { \"code\": \"FI\", \"name\": \"Finland\" },\n { \"code\": \"FJ\", \"name\": \"Fiji\" },\n { \"code\": \"FK\", \"name\": \"Falkland Islands (Malvinas)\" },\n { \"code\": \"FM\", \"name\": \"Micronesia, Federated States of\" },\n { \"code\": \"FO\", \"name\": \"Faroe Islands\" },\n { \"code\": \"FR\", \"name\": \"France\" },\n { \"code\": \"GA\", \"name\": \"Gabon\" },\n { \"code\": \"GB\", \"name\": \"United Kingdom of Great Britain and Northern Ireland\" },\n { \"code\": \"GD\", \"name\": \"Grenada\" },\n { \"code\": \"GE\", \"name\": \"Georgia\" },\n { \"code\": \"GF\", \"name\": \"French Guiana\" },\n { \"code\": \"GG\", \"name\": \"Guernsey\" },\n { \"code\": \"GH\", \"name\": \"Ghana\" },\n { \"code\": \"GI\", \"name\": \"Gibraltar\" },\n { \"code\": \"GL\", \"name\": \"Greenland\" },\n { \"code\": \"GM\", \"name\": \"Gambia\" },\n { \"code\": \"GN\", \"name\": \"Guinea\" },\n { \"code\": \"GP\", \"name\": \"Guadeloupe\" },\n { \"code\": \"GQ\", \"name\": \"Equatorial Guinea\" },\n { \"code\": \"GR\", \"name\": \"Greece\" },\n { \"code\": \"GS\", \"name\": \"South Georgia and the South Sandwich Islands\" },\n { \"code\": \"GT\", \"name\": \"Guatemala\" },\n { \"code\": \"GU\", \"name\": \"Guam\" },\n { \"code\": \"GW\", \"name\": \"Guinea-Bissau\" },\n { \"code\": \"GY\", \"name\": \"Guyana\" },\n { \"code\": \"HK\", \"name\": \"Hong Kong\" },\n { \"code\": \"HM\", \"name\": \"Heard Island and McDonald Islands\" },\n { \"code\": \"HN\", \"name\": \"Honduras\" },\n { \"code\": \"HR\", \"name\": \"Croatia\" },\n { \"code\": \"HT\", \"name\": \"Haiti\" },\n { \"code\": \"HU\", \"name\": \"Hungary\" },\n { \"code\": \"ID\", \"name\": \"Indonesia\" },\n { \"code\": \"IE\", \"name\": \"Ireland\" },\n { \"code\": \"IL\", \"name\": \"Israel\" },\n { \"code\": \"IM\", \"name\": \"Isle of Man\" },\n { \"code\": \"IN\", \"name\": \"India\" },\n { \"code\": \"IO\", \"name\": \"British Indian Ocean Territory\" },\n { \"code\": \"IQ\", \"name\": \"Iraq\" },\n { \"code\": \"IR\", \"name\": \"Iran, Islamic Republic of\" },\n { \"code\": \"IS\", \"name\": \"Iceland\" },\n { \"code\": \"IT\", \"name\": \"Italy\" },\n { \"code\": \"JE\", \"name\": \"Jersey\" },\n { \"code\": \"JM\", \"name\": \"Jamaica\" },\n { \"code\": \"JO\", \"name\": \"Jordan\" },\n { \"code\": \"JP\", \"name\": \"Japan\" },\n { \"code\": \"KE\", \"name\": \"Kenya\" },\n { \"code\": \"KG\", \"name\": \"Kyrgyzstan\" },\n { \"code\": \"KH\", \"name\": \"Cambodia\" },\n { \"code\": \"KI\", \"name\": \"Kiribati\" },\n { \"code\": \"KM\", \"name\": \"Comoros\" },\n { \"code\": \"KN\", \"name\": \"Saint Kitts and Nevis\" },\n { \"code\": \"KP\", \"name\": \"Korea, Democratic People's Republic of\" },\n { \"code\": \"KR\", \"name\": \"Korea, Republic of\" },\n { \"code\": \"KW\", \"name\": \"Kuwait\" },\n { \"code\": \"KY\", \"name\": \"Cayman Islands\" },\n { \"code\": \"KZ\", \"name\": \"Kazakhstan\" },\n { \"code\": \"LA\", \"name\": \"Lao People's Democratic Republic\" },\n { \"code\": \"LB\", \"name\": \"Lebanon\" },\n { \"code\": \"LC\", \"name\": \"Saint Lucia\" },\n { \"code\": \"LI\", \"name\": \"Liechtenstein\" },\n { \"code\": \"LK\", \"name\": \"Sri Lanka\" },\n { \"code\": \"LR\", \"name\": \"Liberia\" },\n { \"code\": \"LS\", \"name\": \"Lesotho\" },\n { \"code\": \"LT\", \"name\": \"Lithuania\" },\n { \"code\": \"LU\", \"name\": \"Luxembourg\" },\n { \"code\": \"LV\", \"name\": \"Latvia\" },\n { \"code\": \"LY\", \"name\": \"Libya\" },\n { \"code\": \"MA\", \"name\": \"Morocco\" },\n { \"code\": \"MC\", \"name\": \"Monaco\" },\n { \"code\": \"MD\", \"name\": \"Moldova, Republic of\" },\n { \"code\": \"ME\", \"name\": \"Montenegro\" },\n { \"code\": \"MF\", \"name\": \"Saint Martin, (French part)\" },\n { \"code\": \"MG\", \"name\": \"Madagascar\" },\n { \"code\": \"MH\", \"name\": \"Marshall Islands\" },\n { \"code\": \"MK\", \"name\": \"North Macedonia\" },\n { \"code\": \"ML\", \"name\": \"Mali\" },\n { \"code\": \"MM\", \"name\": \"Myanmar\" },\n { \"code\": \"MN\", \"name\": \"Mongolia\" },\n { \"code\": \"MO\", \"name\": \"Macao\" },\n { \"code\": \"MP\", \"name\": \"Northern Mariana Islands\" },\n { \"code\": \"MQ\", \"name\": \"Martinique\" },\n { \"code\": \"MR\", \"name\": \"Mauritania\" },\n { \"code\": \"MS\", \"name\": \"Montserrat\" },\n { \"code\": \"MT\", \"name\": \"Malta\" },\n { \"code\": \"MU\", \"name\": \"Mauritius\" },\n { \"code\": \"MV\", \"name\": \"Maldives\" },\n { \"code\": \"MW\", \"name\": \"Malawi\" },\n { \"code\": \"MX\", \"name\": \"Mexico\" },\n { \"code\": \"MY\", \"name\": \"Malaysia\" },\n { \"code\": \"MZ\", \"name\": \"Mozambique\" },\n { \"code\": \"NA\", \"name\": \"Namibia\" },\n { \"code\": \"NC\", \"name\": \"New Caledonia\" },\n { \"code\": \"NE\", \"name\": \"Niger\" },\n { \"code\": \"NF\", \"name\": \"Norfolk Island\" },\n { \"code\": \"NG\", \"name\": \"Nigeria\" },\n { \"code\": \"NI\", \"name\": \"Nicaragua\" },\n { \"code\": \"NL\", \"name\": \"Netherlands\" },\n { \"code\": \"NO\", \"name\": \"Norway\" },\n { \"code\": \"NP\", \"name\": \"Nepal\" },\n { \"code\": \"NR\", \"name\": \"Nauru\" },\n { \"code\": \"NU\", \"name\": \"Niue\" },\n { \"code\": \"NZ\", \"name\": \"New Zealand\" },\n { \"code\": \"OM\", \"name\": \"Oman\" },\n { \"code\": \"PA\", \"name\": \"Panama\" },\n { \"code\": \"PE\", \"name\": \"Peru\" },\n { \"code\": \"PF\", \"name\": \"French Polynesia\" },\n { \"code\": \"PG\", \"name\": \"Papua New Guinea\" },\n { \"code\": \"PH\", \"name\": \"Philippines\" },\n { \"code\": \"PK\", \"name\": \"Pakistan\" },\n { \"code\": \"PL\", \"name\": \"Poland\" },\n { \"code\": \"PM\", \"name\": \"Saint Pierre and Miquelon\" },\n { \"code\": \"PN\", \"name\": \"Pitcairn\" },\n { \"code\": \"PR\", \"name\": \"Puerto Rico\" },\n { \"code\": \"PS\", \"name\": \"Palestine, State of\" },\n { \"code\": \"PT\", \"name\": \"Portugal\" },\n { \"code\": \"PW\", \"name\": \"Palau\" },\n { \"code\": \"PY\", \"name\": \"Paraguay\" },\n { \"code\": \"QA\", \"name\": \"Qatar\" },\n { \"code\": \"RE\", \"name\": \"Réunion\" },\n { \"code\": \"RO\", \"name\": \"Romania\" },\n { \"code\": \"RS\", \"name\": \"Serbia\" },\n { \"code\": \"RU\", \"name\": \"Russian Federation\" },\n { \"code\": \"RW\", \"name\": \"Rwanda\" },\n { \"code\": \"SA\", \"name\": \"Saudi Arabia\" },\n { \"code\": \"SB\", \"name\": \"Solomon Islands\" },\n { \"code\": \"SC\", \"name\": \"Seychelles\" },\n { \"code\": \"SD\", \"name\": \"Sudan\" },\n { \"code\": \"SE\", \"name\": \"Sweden\" },\n { \"code\": \"SG\", \"name\": \"Singapore\" },\n { \"code\": \"SH\", \"name\": \"Saint Helena, Ascension and Tristan da Cunha\" },\n { \"code\": \"SI\", \"name\": \"Slovenia\" },\n { \"code\": \"SJ\", \"name\": \"Svalbard and Jan Mayen\" },\n { \"code\": \"SK\", \"name\": \"Slovakia\" },\n { \"code\": \"SL\", \"name\": \"Sierra Leone\" },\n { \"code\": \"SM\", \"name\": \"San Marino\" },\n { \"code\": \"SN\", \"name\": \"Senegal\" },\n { \"code\": \"SO\", \"name\": \"Somalia\" },\n { \"code\": \"SR\", \"name\": \"Suriname\" },\n { \"code\": \"SS\", \"name\": \"South Sudan\" },\n { \"code\": \"ST\", \"name\": \"Sao Tome and Principe\" },\n { \"code\": \"SV\", \"name\": \"El Salvador\" },\n { \"code\": \"SX\", \"name\": \"Sint Maarten, (Dutch part)\" },\n { \"code\": \"SY\", \"name\": \"Syrian Arab Republic\" },\n { \"code\": \"SZ\", \"name\": \"Eswatini\" },\n { \"code\": \"TC\", \"name\": \"Turks and Caicos Islands\" },\n { \"code\": \"TD\", \"name\": \"Chad\" },\n { \"code\": \"TF\", \"name\": \"French Southern Territories\" },\n { \"code\": \"TG\", \"name\": \"Togo\" },\n { \"code\": \"TH\", \"name\": \"Thailand\" },\n { \"code\": \"TJ\", \"name\": \"Tajikistan\" },\n { \"code\": \"TK\", \"name\": \"Tokelau\" },\n { \"code\": \"TL\", \"name\": \"Timor-Leste\" },\n { \"code\": \"TM\", \"name\": \"Turkmenistan\" },\n { \"code\": \"TN\", \"name\": \"Tunisia\" },\n { \"code\": \"TO\", \"name\": \"Tonga\" },\n { \"code\": \"TR\", \"name\": \"Türkiye\" },\n { \"code\": \"TT\", \"name\": \"Trinidad and Tobago\" },\n { \"code\": \"TV\", \"name\": \"Tuvalu\" },\n { \"code\": \"TW\", \"name\": \"Taiwan, Province of China\" },\n { \"code\": \"TZ\", \"name\": \"Tanzania, United Republic of\" },\n { \"code\": \"UA\", \"name\": \"Ukraine\" },\n { \"code\": \"UG\", \"name\": \"Uganda\" },\n { \"code\": \"UM\", \"name\": \"United States Minor Outlying Islands\" },\n { \"code\": \"US\", \"name\": \"United States of America\" },\n { \"code\": \"UY\", \"name\": \"Uruguay\" },\n { \"code\": \"UZ\", \"name\": \"Uzbekistan\" },\n { \"code\": \"VA\", \"name\": \"Holy See\" },\n { \"code\": \"VC\", \"name\": \"Saint Vincent and the Grenadines\" },\n { \"code\": \"VE\", \"name\": \"Venezuela, Bolivarian Republic of\" },\n { \"code\": \"VG\", \"name\": \"Virgin Islands, British\" },\n { \"code\": \"VI\", \"name\": \"Virgin Islands, U.S.\" },\n { \"code\": \"VN\", \"name\": \"Viet Nam\" },\n { \"code\": \"VU\", \"name\": \"Vanuatu\" },\n { \"code\": \"WF\", \"name\": \"Wallis and Futuna\" },\n { \"code\": \"WS\", \"name\": \"Samoa\" },\n { \"code\": \"YE\", \"name\": \"Yemen\" },\n { \"code\": \"YT\", \"name\": \"Mayotte\" },\n { \"code\": \"ZA\", \"name\": \"South Africa\" },\n { \"code\": \"ZM\", \"name\": \"Zambia\" },\n { \"code\": \"ZW\", \"name\": \"Zimbabwe\" }\n]\n","'use strict';\n\nvar data = require('./data.json');\n\n/** Precompute name and code lookups. */\nvar nameMap = {};\nvar codeMap = {};\ndata.forEach(mapCodeAndName);\nfunction mapCodeAndName(country) {\n nameMap[country.name.toLowerCase()] = country.code;\n codeMap[country.code.toLowerCase()] = country.name;\n}\nexports.overwrite = function overwrite(countries) {\n if (!countries || !countries.length) return;\n countries.forEach(function (country) {\n var foundIndex = data.findIndex(function (item) {\n return item.code === country.code;\n });\n data[foundIndex] = country;\n mapCodeAndName(country);\n });\n};\nexports.getCode = function getCode(name) {\n return nameMap[name.toLowerCase()];\n};\nexports.getName = function getName(code) {\n return codeMap[code.toLowerCase()];\n};\nexports.getNames = function getNames() {\n return data.map(function (country) {\n return country.name;\n });\n};\nexports.getCodes = function getCodes() {\n return data.map(function (country) {\n return country.code;\n });\n};\nexports.getCodeList = function getCodeList() {\n return codeMap;\n};\nexports.getNameList = function getNameList() {\n return nameMap;\n};\nexports.getData = function getData() {\n return data;\n};","import * as i0 from '@angular/core';\nimport { Injectable } from '@angular/core';\nimport * as i1 from '@angular/common/http';\nimport { HttpHeaders } from '@angular/common/http';\nimport { map } from 'rxjs/operators';\n\n// *********************************\n// Code generated by sdkgen\n// DO NOT EDIT!.\n//\n// Enums.\n// *********************************\nvar FeeAmountType = /*#__PURE__*/function (FeeAmountType) {\n FeeAmountType[FeeAmountType[\"FEE_AMOUNT_TYPE_INVALID\"] = 0] = \"FEE_AMOUNT_TYPE_INVALID\";\n FeeAmountType[FeeAmountType[\"FEE_AMOUNT_TYPE_FIXED\"] = 1] = \"FEE_AMOUNT_TYPE_FIXED\";\n FeeAmountType[FeeAmountType[\"FEE_AMOUNT_TYPE_PERCENTAGE\"] = 2] = \"FEE_AMOUNT_TYPE_PERCENTAGE\";\n return FeeAmountType;\n}(FeeAmountType || {});\nvar FeeType = /*#__PURE__*/function (FeeType) {\n FeeType[FeeType[\"FEE_TYPE_INVALID\"] = 0] = \"FEE_TYPE_INVALID\";\n FeeType[FeeType[\"FEE_TYPE_MANAGEMENT\"] = 1] = \"FEE_TYPE_MANAGEMENT\";\n return FeeType;\n}(FeeType || {});\n// *********************************\n// Code generated by sdkgen\n// DO NOT EDIT!.\n//\n// Enums.\n// *********************************\nvar AppType = /*#__PURE__*/function (AppType) {\n AppType[AppType[\"APP_TYPE_APP\"] = 0] = \"APP_TYPE_APP\";\n AppType[AppType[\"APP_TYPE_ADDON\"] = 1] = \"APP_TYPE_ADDON\";\n AppType[AppType[\"APP_TYPE_UNSPECIFIED\"] = 2] = \"APP_TYPE_UNSPECIFIED\";\n return AppType;\n}(AppType || {});\nvar ApprovalProcess = /*#__PURE__*/function (ApprovalProcess) {\n ApprovalProcess[ApprovalProcess[\"APPROVAL_PROCESS_INVALID\"] = 0] = \"APPROVAL_PROCESS_INVALID\";\n ApprovalProcess[ApprovalProcess[\"APPROVAL_PROCESS_VENDASTA\"] = 1] = \"APPROVAL_PROCESS_VENDASTA\";\n ApprovalProcess[ApprovalProcess[\"APPROVAL_PROCESS_VENDOR\"] = 2] = \"APPROVAL_PROCESS_VENDOR\";\n return ApprovalProcess;\n}(ApprovalProcess || {});\nvar BillingProcess = /*#__PURE__*/function (BillingProcess) {\n BillingProcess[BillingProcess[\"BILLING_PROCESS_INVALID\"] = 0] = \"BILLING_PROCESS_INVALID\";\n BillingProcess[BillingProcess[\"BILLING_PROCESS_NO_BILLING\"] = 1] = \"BILLING_PROCESS_NO_BILLING\";\n BillingProcess[BillingProcess[\"BILLING_PROCESS_VENDASTA_BILLING\"] = 2] = \"BILLING_PROCESS_VENDASTA_BILLING\";\n return BillingProcess;\n}(BillingProcess || {});\nvar DeliveryMethod = /*#__PURE__*/function (DeliveryMethod) {\n DeliveryMethod[DeliveryMethod[\"DELIVERY_METHOD_INVALID\"] = 0] = \"DELIVERY_METHOD_INVALID\";\n DeliveryMethod[DeliveryMethod[\"DELIVERY_METHOD_PRODUCT\"] = 1] = \"DELIVERY_METHOD_PRODUCT\";\n DeliveryMethod[DeliveryMethod[\"DELIVERY_METHOD_SERVICE\"] = 2] = \"DELIVERY_METHOD_SERVICE\";\n return DeliveryMethod;\n}(DeliveryMethod || {});\nvar DistributionSetting = /*#__PURE__*/function (DistributionSetting) {\n DistributionSetting[DistributionSetting[\"DISTRIBUTION_SETTING_INVALID\"] = 0] = \"DISTRIBUTION_SETTING_INVALID\";\n DistributionSetting[DistributionSetting[\"DISTRIBUTION_SETTING_ALL\"] = 1] = \"DISTRIBUTION_SETTING_ALL\";\n DistributionSetting[DistributionSetting[\"DISTRIBUTION_SETTING_SELF\"] = 2] = \"DISTRIBUTION_SETTING_SELF\";\n return DistributionSetting;\n}(DistributionSetting || {});\nvar EndOfTrialActions = /*#__PURE__*/function (EndOfTrialActions) {\n EndOfTrialActions[EndOfTrialActions[\"DO_NOTHING\"] = 0] = \"DO_NOTHING\";\n return EndOfTrialActions;\n}(EndOfTrialActions || {});\nvar MarketplaceAppLmiLmiCategories = /*#__PURE__*/function (MarketplaceAppLmiLmiCategories) {\n MarketplaceAppLmiLmiCategories[MarketplaceAppLmiLmiCategories[\"NOT_SET\"] = 0] = \"NOT_SET\";\n MarketplaceAppLmiLmiCategories[MarketplaceAppLmiLmiCategories[\"WEBSITE\"] = 1] = \"WEBSITE\";\n MarketplaceAppLmiLmiCategories[MarketplaceAppLmiLmiCategories[\"CONTENT_AND_EXPERIENCE\"] = 2] = \"CONTENT_AND_EXPERIENCE\";\n MarketplaceAppLmiLmiCategories[MarketplaceAppLmiLmiCategories[\"LISTINGS\"] = 3] = \"LISTINGS\";\n MarketplaceAppLmiLmiCategories[MarketplaceAppLmiLmiCategories[\"REPUTATION\"] = 4] = \"REPUTATION\";\n MarketplaceAppLmiLmiCategories[MarketplaceAppLmiLmiCategories[\"SEO\"] = 5] = \"SEO\";\n MarketplaceAppLmiLmiCategories[MarketplaceAppLmiLmiCategories[\"SOCIAL\"] = 6] = \"SOCIAL\";\n MarketplaceAppLmiLmiCategories[MarketplaceAppLmiLmiCategories[\"ADVERTISING\"] = 7] = \"ADVERTISING\";\n return MarketplaceAppLmiLmiCategories;\n}(MarketplaceAppLmiLmiCategories || {});\nvar MarketplaceAppProductProductCategories = /*#__PURE__*/function (MarketplaceAppProductProductCategories) {\n MarketplaceAppProductProductCategories[MarketplaceAppProductProductCategories[\"NOT_SET\"] = 0] = \"NOT_SET\";\n MarketplaceAppProductProductCategories[MarketplaceAppProductProductCategories[\"DIGITAL\"] = 1] = \"DIGITAL\";\n MarketplaceAppProductProductCategories[MarketplaceAppProductProductCategories[\"WEBSITE\"] = 2] = \"WEBSITE\";\n MarketplaceAppProductProductCategories[MarketplaceAppProductProductCategories[\"PRINT\"] = 3] = \"PRINT\";\n MarketplaceAppProductProductCategories[MarketplaceAppProductProductCategories[\"YELLOW_PAGES\"] = 4] = \"YELLOW_PAGES\";\n MarketplaceAppProductProductCategories[MarketplaceAppProductProductCategories[\"RADIO\"] = 5] = \"RADIO\";\n MarketplaceAppProductProductCategories[MarketplaceAppProductProductCategories[\"TELEVISION\"] = 6] = \"TELEVISION\";\n MarketplaceAppProductProductCategories[MarketplaceAppProductProductCategories[\"SEM\"] = 7] = \"SEM\";\n MarketplaceAppProductProductCategories[MarketplaceAppProductProductCategories[\"SEO\"] = 8] = \"SEO\";\n MarketplaceAppProductProductCategories[MarketplaceAppProductProductCategories[\"COMBINATION\"] = 9] = \"COMBINATION\";\n MarketplaceAppProductProductCategories[MarketplaceAppProductProductCategories[\"SOCIAL\"] = 10] = \"SOCIAL\";\n MarketplaceAppProductProductCategories[MarketplaceAppProductProductCategories[\"VENDASTA_APP\"] = 11] = \"VENDASTA_APP\";\n MarketplaceAppProductProductCategories[MarketplaceAppProductProductCategories[\"OTHER\"] = 12] = \"OTHER\";\n MarketplaceAppProductProductCategories[MarketplaceAppProductProductCategories[\"VENDOR_APP\"] = 13] = \"VENDOR_APP\";\n return MarketplaceAppProductProductCategories;\n}(MarketplaceAppProductProductCategories || {});\nvar ReleaseType = /*#__PURE__*/function (ReleaseType) {\n ReleaseType[ReleaseType[\"RELEASE_TYPE_PUBLISH\"] = 0] = \"RELEASE_TYPE_PUBLISH\";\n ReleaseType[ReleaseType[\"RELEASE_TYPE_DRAFT\"] = 1] = \"RELEASE_TYPE_DRAFT\";\n return ReleaseType;\n}(ReleaseType || {});\nvar State = /*#__PURE__*/function (State) {\n State[State[\"STATE_INVALID\"] = 0] = \"STATE_INVALID\";\n State[State[\"STATE_DRAFT\"] = 1] = \"STATE_DRAFT\";\n State[State[\"STATE_PUBLISHED\"] = 2] = \"STATE_PUBLISHED\";\n return State;\n}(State || {});\n// *********************************\n// Code generated by sdkgen\n// DO NOT EDIT!.\n//\n// Enums.\n// *********************************\nvar StateFilterOptions = /*#__PURE__*/function (StateFilterOptions) {\n StateFilterOptions[StateFilterOptions[\"STATE_FILTER_OPTIONS_PUBLISHED\"] = 0] = \"STATE_FILTER_OPTIONS_PUBLISHED\";\n StateFilterOptions[StateFilterOptions[\"STATE_FILTER_OPTIONS_STATE_DRAFT\"] = 1] = \"STATE_FILTER_OPTIONS_STATE_DRAFT\";\n StateFilterOptions[StateFilterOptions[\"STATE_FILTER_OPTIONS_STATE_ALL\"] = 2] = \"STATE_FILTER_OPTIONS_STATE_ALL\";\n return StateFilterOptions;\n}(StateFilterOptions || {});\n// *********************************\n// Code generated by sdkgen\n// DO NOT EDIT!.\n//\n// Enums.\n// *********************************\nvar EditionBillingFrequency = /*#__PURE__*/function (EditionBillingFrequency) {\n EditionBillingFrequency[EditionBillingFrequency[\"EDITION_BILLING_FREQUENCY_INVALID\"] = 0] = \"EDITION_BILLING_FREQUENCY_INVALID\";\n EditionBillingFrequency[EditionBillingFrequency[\"EDITION_BILLING_FREQUENCY_MONTHLY\"] = 1] = \"EDITION_BILLING_FREQUENCY_MONTHLY\";\n EditionBillingFrequency[EditionBillingFrequency[\"EDITION_BILLING_FREQUENCY_YEARLY\"] = 2] = \"EDITION_BILLING_FREQUENCY_YEARLY\";\n EditionBillingFrequency[EditionBillingFrequency[\"EDITION_BILLING_FREQUENCY_ONETIME\"] = 3] = \"EDITION_BILLING_FREQUENCY_ONETIME\";\n return EditionBillingFrequency;\n}(EditionBillingFrequency || {});\nvar Release = /*#__PURE__*/function (Release) {\n Release[Release[\"RELEASE_PUBLISH\"] = 0] = \"RELEASE_PUBLISH\";\n Release[Release[\"RELEASE_DRAFT\"] = 1] = \"RELEASE_DRAFT\";\n return Release;\n}(Release || {});\n// *********************************\n// Code generated by sdkgen\n// DO NOT EDIT!.\n//\n// Enums Index.\n// *********************************\n\nfunction enumStringToValue$c(enumRef, value) {\n if (typeof value === 'number') {\n return value;\n }\n return enumRef[value];\n}\nclass Fee {\n static fromProto(proto) {\n let m = new Fee();\n m = Object.assign(m, proto);\n if (proto.amountType) {\n m.amountType = enumStringToValue$c(FeeAmountType, proto.amountType);\n }\n if (proto.feeType) {\n m.feeType = enumStringToValue$c(FeeType, proto.feeType);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.amount !== 'undefined') {\n toReturn['amount'] = this.amount;\n }\n if (typeof this.amountType !== 'undefined') {\n toReturn['amountType'] = this.amountType;\n }\n if (typeof this.feeType !== 'undefined') {\n toReturn['feeType'] = this.feeType;\n }\n return toReturn;\n }\n}\nfunction enumStringToValue$b(enumRef, value) {\n if (typeof value === 'number') {\n return value;\n }\n return enumRef[value];\n}\nclass Commitment {\n static fromProto(proto) {\n let m = new Commitment();\n m = Object.assign(m, proto);\n if (proto.initial) {\n m.initial = parseInt(proto.initial, 10);\n }\n if (proto.recurring) {\n m.recurring = parseInt(proto.recurring, 10);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.initial !== 'undefined') {\n toReturn['initial'] = this.initial;\n }\n if (typeof this.recurring !== 'undefined') {\n toReturn['recurring'] = this.recurring;\n }\n return toReturn;\n }\n}\nfunction enumStringToValue$a(enumRef, value) {\n if (typeof value === 'number') {\n return value;\n }\n return enumRef[value];\n}\nclass IncludedCommonFormFields {\n static fromProto(proto) {\n let m = new IncludedCommonFormFields();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.businessName !== 'undefined') {\n toReturn['businessName'] = this.businessName;\n }\n if (typeof this.businessAddress !== 'undefined') {\n toReturn['businessAddress'] = this.businessAddress;\n }\n if (typeof this.businessPhoneNumber !== 'undefined') {\n toReturn['businessPhoneNumber'] = this.businessPhoneNumber;\n }\n if (typeof this.businessAccountGroupId !== 'undefined') {\n toReturn['businessAccountGroupId'] = this.businessAccountGroupId;\n }\n if (typeof this.salespersonName !== 'undefined') {\n toReturn['salespersonName'] = this.salespersonName;\n }\n if (typeof this.salespersonPhoneNumber !== 'undefined') {\n toReturn['salespersonPhoneNumber'] = this.salespersonPhoneNumber;\n }\n if (typeof this.salespersonEmail !== 'undefined') {\n toReturn['salespersonEmail'] = this.salespersonEmail;\n }\n if (typeof this.contactName !== 'undefined') {\n toReturn['contactName'] = this.contactName;\n }\n if (typeof this.contactPhoneNumber !== 'undefined') {\n toReturn['contactPhoneNumber'] = this.contactPhoneNumber;\n }\n if (typeof this.contactEmail !== 'undefined') {\n toReturn['contactEmail'] = this.contactEmail;\n }\n if (typeof this.businessWebsite !== 'undefined') {\n toReturn['businessWebsite'] = this.businessWebsite;\n }\n return toReturn;\n }\n}\nclass OrderFormFieldOption {\n static fromProto(proto) {\n let m = new OrderFormFieldOption();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.label !== 'undefined') {\n toReturn['label'] = this.label;\n }\n if (typeof this.value !== 'undefined') {\n toReturn['value'] = this.value;\n }\n return toReturn;\n }\n}\nclass OrderForm {\n static fromProto(proto) {\n let m = new OrderForm();\n m = Object.assign(m, proto);\n if (proto.orderForm) {\n m.orderForm = proto.orderForm.map(OrderFormField.fromProto);\n }\n if (proto.commonForm) {\n m.commonForm = IncludedCommonFormFields.fromProto(proto.commonForm);\n }\n if (proto.commonFormRequiredFields) {\n m.commonFormRequiredFields = IncludedCommonFormFields.fromProto(proto.commonFormRequiredFields);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.orderForm !== 'undefined' && this.orderForm !== null) {\n toReturn['orderForm'] = 'toApiJson' in this.orderForm ? this.orderForm.toApiJson() : this.orderForm;\n }\n if (typeof this.commonForm !== 'undefined' && this.commonForm !== null) {\n toReturn['commonForm'] = 'toApiJson' in this.commonForm ? this.commonForm.toApiJson() : this.commonForm;\n }\n if (typeof this.activationMessage !== 'undefined') {\n toReturn['activationMessage'] = this.activationMessage;\n }\n if (typeof this.separateOrderForms !== 'undefined') {\n toReturn['separateOrderForms'] = this.separateOrderForms;\n }\n if (typeof this.commonFormRequiredFields !== 'undefined' && this.commonFormRequiredFields !== null) {\n toReturn['commonFormRequiredFields'] = 'toApiJson' in this.commonFormRequiredFields ? this.commonFormRequiredFields.toApiJson() : this.commonFormRequiredFields;\n }\n if (typeof this.usesPostBillingOrderForm !== 'undefined') {\n toReturn['usesPostBillingOrderForm'] = this.usesPostBillingOrderForm;\n }\n if (typeof this.footerText !== 'undefined') {\n toReturn['footerText'] = this.footerText;\n }\n return toReturn;\n }\n}\nclass OrderFormField {\n static fromProto(proto) {\n let m = new OrderFormField();\n m = Object.assign(m, proto);\n if (proto.maxChoices) {\n m.maxChoices = parseInt(proto.maxChoices, 10);\n }\n if (proto.optionsWithLabels) {\n m.optionsWithLabels = proto.optionsWithLabels.map(OrderFormFieldOption.fromProto);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.label !== 'undefined') {\n toReturn['label'] = this.label;\n }\n if (typeof this.id !== 'undefined') {\n toReturn['id'] = this.id;\n }\n if (typeof this.type !== 'undefined') {\n toReturn['type'] = this.type;\n }\n if (typeof this.options !== 'undefined') {\n toReturn['options'] = this.options;\n }\n if (typeof this.description !== 'undefined') {\n toReturn['description'] = this.description;\n }\n if (typeof this.required !== 'undefined') {\n toReturn['required'] = this.required;\n }\n if (typeof this.uploadUrl !== 'undefined') {\n toReturn['uploadUrl'] = this.uploadUrl;\n }\n if (typeof this.prefix !== 'undefined') {\n toReturn['prefix'] = this.prefix;\n }\n if (typeof this.suffix !== 'undefined') {\n toReturn['suffix'] = this.suffix;\n }\n if (typeof this.regexValidator !== 'undefined') {\n toReturn['regexValidator'] = this.regexValidator;\n }\n if (typeof this.regexErrorMessage !== 'undefined') {\n toReturn['regexErrorMessage'] = this.regexErrorMessage;\n }\n if (typeof this.useWebhookValidator !== 'undefined') {\n toReturn['useWebhookValidator'] = this.useWebhookValidator;\n }\n if (typeof this.allowMultiples !== 'undefined') {\n toReturn['allowMultiples'] = this.allowMultiples;\n }\n if (typeof this.allowDuplicates !== 'undefined') {\n toReturn['allowDuplicates'] = this.allowDuplicates;\n }\n if (typeof this.maxChoices !== 'undefined') {\n toReturn['maxChoices'] = this.maxChoices;\n }\n if (typeof this.forOfficeUseOnly !== 'undefined') {\n toReturn['forOfficeUseOnly'] = this.forOfficeUseOnly;\n }\n if (typeof this.optionsWithLabels !== 'undefined' && this.optionsWithLabels !== null) {\n toReturn['optionsWithLabels'] = 'toApiJson' in this.optionsWithLabels ? this.optionsWithLabels.toApiJson() : this.optionsWithLabels;\n }\n if (typeof this.officeEditableOnly !== 'undefined') {\n toReturn['officeEditableOnly'] = this.officeEditableOnly;\n }\n return toReturn;\n }\n}\nfunction enumStringToValue$9(enumRef, value) {\n if (typeof value === 'number') {\n return value;\n }\n return enumRef[value];\n}\nclass AppRequirement {\n static fromProto(proto) {\n let m = new AppRequirement();\n m = Object.assign(m, proto);\n if (proto.rules) {\n m.rules = proto.rules.map(Rule.fromProto);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.rules !== 'undefined' && this.rules !== null) {\n toReturn['rules'] = 'toApiJson' in this.rules ? this.rules.toApiJson() : this.rules;\n }\n if (typeof this.childrenAppIds !== 'undefined') {\n toReturn['childrenAppIds'] = this.childrenAppIds;\n }\n return toReturn;\n }\n}\nclass EditionIdentifier {\n static fromProto(proto) {\n let m = new EditionIdentifier();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.appId !== 'undefined') {\n toReturn['appId'] = this.appId;\n }\n if (typeof this.editionId !== 'undefined') {\n toReturn['editionId'] = this.editionId;\n }\n return toReturn;\n }\n}\nclass PermissionLists {\n static fromProto(proto) {\n let m = new PermissionLists();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.whitelist !== 'undefined') {\n toReturn['whitelist'] = this.whitelist;\n }\n if (typeof this.blacklist !== 'undefined') {\n toReturn['blacklist'] = this.blacklist;\n }\n return toReturn;\n }\n}\nclass RequiredBusinessData {\n static fromProto(proto) {\n let m = new RequiredBusinessData();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.hours !== 'undefined') {\n toReturn['hours'] = this.hours;\n }\n if (typeof this.descriptionLong !== 'undefined') {\n toReturn['descriptionLong'] = this.descriptionLong;\n }\n if (typeof this.descriptionShort !== 'undefined') {\n toReturn['descriptionShort'] = this.descriptionShort;\n }\n if (typeof this.services !== 'undefined') {\n toReturn['services'] = this.services;\n }\n if (typeof this.brands !== 'undefined') {\n toReturn['brands'] = this.brands;\n }\n return toReturn;\n }\n}\nclass RequiredFeatures {\n static fromProto(proto) {\n let m = new RequiredFeatures();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.whitelist !== 'undefined') {\n toReturn['whitelist'] = this.whitelist;\n }\n return toReturn;\n }\n}\nclass Restrictions {\n static fromProto(proto) {\n let m = new Restrictions();\n m = Object.assign(m, proto);\n if (proto.country) {\n m.country = PermissionLists.fromProto(proto.country);\n }\n if (proto.appRequirement) {\n m.appRequirement = AppRequirement.fromProto(proto.appRequirement);\n }\n if (proto.requiredFeatures) {\n m.requiredFeatures = RequiredFeatures.fromProto(proto.requiredFeatures);\n }\n if (proto.requiredBusinessData) {\n m.requiredBusinessData = RequiredBusinessData.fromProto(proto.requiredBusinessData);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.country !== 'undefined' && this.country !== null) {\n toReturn['country'] = 'toApiJson' in this.country ? this.country.toApiJson() : this.country;\n }\n if (typeof this.appRequirement !== 'undefined' && this.appRequirement !== null) {\n toReturn['appRequirement'] = 'toApiJson' in this.appRequirement ? this.appRequirement.toApiJson() : this.appRequirement;\n }\n if (typeof this.requiredFeatures !== 'undefined' && this.requiredFeatures !== null) {\n toReturn['requiredFeatures'] = 'toApiJson' in this.requiredFeatures ? this.requiredFeatures.toApiJson() : this.requiredFeatures;\n }\n if (typeof this.requiredBusinessData !== 'undefined' && this.requiredBusinessData !== null) {\n toReturn['requiredBusinessData'] = 'toApiJson' in this.requiredBusinessData ? this.requiredBusinessData.toApiJson() : this.requiredBusinessData;\n }\n return toReturn;\n }\n}\nclass Rule {\n static fromProto(proto) {\n let m = new Rule();\n m = Object.assign(m, proto);\n if (proto.requiredEditions) {\n m.requiredEditions = proto.requiredEditions.map(EditionIdentifier.fromProto);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.appIds !== 'undefined') {\n toReturn['appIds'] = this.appIds;\n }\n if (typeof this.requiredEditions !== 'undefined' && this.requiredEditions !== null) {\n toReturn['requiredEditions'] = 'toApiJson' in this.requiredEditions ? this.requiredEditions.toApiJson() : this.requiredEditions;\n }\n return toReturn;\n }\n}\nfunction enumStringToValue$8(enumRef, value) {\n if (typeof value === 'number') {\n return value;\n }\n return enumRef[value];\n}\nclass Contact {\n static fromProto(proto) {\n let m = new Contact();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.email !== 'undefined') {\n toReturn['email'] = this.email;\n }\n return toReturn;\n }\n}\nclass Cost {\n static fromProto(proto) {\n let m = new Cost();\n m = Object.assign(m, proto);\n if (proto.price) {\n m.price = parseInt(proto.price, 10);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.billingFrequency !== 'undefined') {\n toReturn['billingFrequency'] = this.billingFrequency;\n }\n if (typeof this.currency !== 'undefined') {\n toReturn['currency'] = this.currency;\n }\n if (typeof this.price !== 'undefined') {\n toReturn['price'] = this.price;\n }\n return toReturn;\n }\n}\nclass FrequentlyAskedQuestions {\n static fromProto(proto) {\n let m = new FrequentlyAskedQuestions();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.question !== 'undefined') {\n toReturn['question'] = this.question;\n }\n if (typeof this.answer !== 'undefined') {\n toReturn['answer'] = this.answer;\n }\n return toReturn;\n }\n}\nclass IdentifiedPublicKey {\n static fromProto(proto) {\n let m = new IdentifiedPublicKey();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.publicKeyId !== 'undefined') {\n toReturn['publicKeyId'] = this.publicKeyId;\n }\n if (typeof this.publicKey !== 'undefined') {\n toReturn['publicKey'] = this.publicKey;\n }\n return toReturn;\n }\n}\nclass Integration {\n static fromProto(proto) {\n let m = new Integration();\n m = Object.assign(m, proto);\n if (proto.identifiedPublicKeys) {\n m.identifiedPublicKeys = proto.identifiedPublicKeys.map(IdentifiedPublicKey.fromProto);\n }\n if (proto.partnerContactRecipients) {\n m.partnerContactRecipients = proto.partnerContactRecipients.map(Contact.fromProto);\n }\n if (proto.appApprovalProcess) {\n m.appApprovalProcess = enumStringToValue$8(ApprovalProcess, proto.appApprovalProcess);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.publicKey !== 'undefined') {\n toReturn['publicKey'] = this.publicKey;\n }\n if (typeof this.identifiedPublicKeys !== 'undefined' && this.identifiedPublicKeys !== null) {\n toReturn['identifiedPublicKeys'] = 'toApiJson' in this.identifiedPublicKeys ? this.identifiedPublicKeys.toApiJson() : this.identifiedPublicKeys;\n }\n if (typeof this.contactEmail !== 'undefined') {\n toReturn['contactEmail'] = this.contactEmail;\n }\n if (typeof this.approved !== 'undefined') {\n toReturn['approved'] = this.approved;\n }\n if (typeof this.vendor !== 'undefined') {\n toReturn['vendor'] = this.vendor;\n }\n if (typeof this.userIds !== 'undefined') {\n toReturn['userIds'] = this.userIds;\n }\n if (typeof this.purchaseWebhookUrl !== 'undefined') {\n toReturn['purchaseWebhookUrl'] = this.purchaseWebhookUrl;\n }\n if (typeof this.addonPurchaseWebhookUrl !== 'undefined') {\n toReturn['addonPurchaseWebhookUrl'] = this.addonPurchaseWebhookUrl;\n }\n if (typeof this.userModWebhookUrl !== 'undefined') {\n toReturn['userModWebhookUrl'] = this.userModWebhookUrl;\n }\n if (typeof this.salestoolWebhookUrl !== 'undefined') {\n toReturn['salestoolWebhookUrl'] = this.salestoolWebhookUrl;\n }\n if (typeof this.accountModWebhookUrl !== 'undefined') {\n toReturn['accountModWebhookUrl'] = this.accountModWebhookUrl;\n }\n if (typeof this.logoutWebhookUrl !== 'undefined') {\n toReturn['logoutWebhookUrl'] = this.logoutWebhookUrl;\n }\n if (typeof this.fulfillmentEmail !== 'undefined') {\n toReturn['fulfillmentEmail'] = this.fulfillmentEmail;\n }\n if (typeof this.entryUrl !== 'undefined') {\n toReturn['entryUrl'] = this.entryUrl;\n }\n if (typeof this.sessionUrl !== 'undefined') {\n toReturn['sessionUrl'] = this.sessionUrl;\n }\n if (typeof this.settingsUrl !== 'undefined') {\n toReturn['settingsUrl'] = this.settingsUrl;\n }\n if (typeof this.reserveIdUrl !== 'undefined') {\n toReturn['reserveIdUrl'] = this.reserveIdUrl;\n }\n if (typeof this.contactWebhookUrl !== 'undefined') {\n toReturn['contactWebhookUrl'] = this.contactWebhookUrl;\n }\n if (typeof this.activationRequiresApproval !== 'undefined') {\n toReturn['activationRequiresApproval'] = this.activationRequiresApproval;\n }\n if (typeof this.partnerSettingsWebhookUrl !== 'undefined') {\n toReturn['partnerSettingsWebhookUrl'] = this.partnerSettingsWebhookUrl;\n }\n if (typeof this.partnerContactRecipients !== 'undefined' && this.partnerContactRecipients !== null) {\n toReturn['partnerContactRecipients'] = 'toApiJson' in this.partnerContactRecipients ? this.partnerContactRecipients.toApiJson() : this.partnerContactRecipients;\n }\n if (typeof this.appApprovalProcess !== 'undefined') {\n toReturn['appApprovalProcess'] = this.appApprovalProcess;\n }\n if (typeof this.orderFormValidatorWebhookUrl !== 'undefined') {\n toReturn['orderFormValidatorWebhookUrl'] = this.orderFormValidatorWebhookUrl;\n }\n if (typeof this.allowWhiteLabeling !== 'undefined') {\n toReturn['allowWhiteLabeling'] = this.allowWhiteLabeling;\n }\n if (typeof this.customerWebhookUrl !== 'undefined') {\n toReturn['customerWebhookUrl'] = this.customerWebhookUrl;\n }\n if (typeof this.sendCancelationNotifications !== 'undefined') {\n toReturn['sendCancelationNotifications'] = this.sendCancelationNotifications;\n }\n if (typeof this.cancellationWehookUrl !== 'undefined') {\n toReturn['cancellationWehookUrl'] = this.cancellationWehookUrl;\n }\n if (typeof this.serviceChangeWebhookUrl !== 'undefined') {\n toReturn['serviceChangeWebhookUrl'] = this.serviceChangeWebhookUrl;\n }\n if (typeof this.appLevelHasAdminDashboard !== 'undefined') {\n toReturn['appLevelHasAdminDashboard'] = this.appLevelHasAdminDashboard;\n }\n return toReturn;\n }\n}\nclass MarketplaceAppLmi {\n static fromProto(proto) {\n let m = new MarketplaceAppLmi();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n return toReturn;\n }\n}\nclass MarketingInformation {\n static fromProto(proto) {\n let m = new MarketingInformation();\n m = Object.assign(m, proto);\n if (proto.faqs) {\n m.faqs = proto.faqs.map(FrequentlyAskedQuestions.fromProto);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.description !== 'undefined') {\n toReturn['description'] = this.description;\n }\n if (typeof this.keySellingPoints !== 'undefined') {\n toReturn['keySellingPoints'] = this.keySellingPoints;\n }\n if (typeof this.faqs !== 'undefined' && this.faqs !== null) {\n toReturn['faqs'] = 'toApiJson' in this.faqs ? this.faqs.toApiJson() : this.faqs;\n }\n if (typeof this.files !== 'undefined') {\n toReturn['files'] = this.files;\n }\n if (typeof this.needHelp !== 'undefined') {\n toReturn['needHelp'] = this.needHelp;\n }\n if (typeof this.videos !== 'undefined') {\n toReturn['videos'] = this.videos;\n }\n return toReturn;\n }\n}\nclass MarketplaceApp {\n static fromProto(proto) {\n let m = new MarketplaceApp();\n m = Object.assign(m, proto);\n if (proto.version) {\n m.version = parseInt(proto.version, 10);\n }\n if (proto.price) {\n m.price = parseInt(proto.price, 10);\n }\n if (proto.productCategory) {\n m.productCategory = enumStringToValue$8(MarketplaceAppProductProductCategories, proto.productCategory);\n }\n if (proto.lmiCategories) {\n m.lmiCategories = proto.lmiCategories.map(v => enumStringToValue$8(MarketplaceAppLmiLmiCategories, v));\n }\n if (proto.integration) {\n m.integration = Integration.fromProto(proto.integration);\n }\n if (proto.orderForm) {\n m.orderForm = OrderForm.fromProto(proto.orderForm);\n }\n if (proto.resellerMarketing) {\n m.resellerMarketing = MarketingInformation.fromProto(proto.resellerMarketing);\n }\n if (proto.endUserMarketing) {\n m.endUserMarketing = MarketingInformation.fromProto(proto.endUserMarketing);\n }\n if (proto.created) {\n m.created = new Date(proto.created);\n }\n if (proto.updated) {\n m.updated = new Date(proto.updated);\n }\n if (proto.restrictions) {\n m.restrictions = Restrictions.fromProto(proto.restrictions);\n }\n if (proto.suggestedRetailPrice) {\n m.suggestedRetailPrice = parseInt(proto.suggestedRetailPrice, 10);\n }\n if (proto.commitment) {\n m.commitment = Commitment.fromProto(proto.commitment);\n }\n if (proto.trialConfiguration) {\n m.trialConfiguration = TrialConfiguration.fromProto(proto.trialConfiguration);\n }\n if (proto.state) {\n m.state = enumStringToValue$8(State, proto.state);\n }\n if (proto.type) {\n m.type = enumStringToValue$8(AppType, proto.type);\n }\n if (proto.cost) {\n m.cost = Cost.fromProto(proto.cost);\n }\n if (proto.billingProcess) {\n m.billingProcess = enumStringToValue$8(BillingProcess, proto.billingProcess);\n }\n if (proto.setupFee) {\n m.setupFee = parseInt(proto.setupFee, 10);\n }\n if (proto.suspended) {\n m.suspended = new Date(proto.suspended);\n }\n if (proto.deliveryMethod) {\n m.deliveryMethod = enumStringToValue$8(DeliveryMethod, proto.deliveryMethod);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.appId !== 'undefined') {\n toReturn['appId'] = this.appId;\n }\n if (typeof this.version !== 'undefined') {\n toReturn['version'] = this.version;\n }\n if (typeof this.name !== 'undefined') {\n toReturn['name'] = this.name;\n }\n if (typeof this.icon !== 'undefined') {\n toReturn['icon'] = this.icon;\n }\n if (typeof this.allowWhitelabel !== 'undefined') {\n toReturn['allowWhitelabel'] = this.allowWhitelabel;\n }\n if (typeof this.inDevelopment !== 'undefined') {\n toReturn['inDevelopment'] = this.inDevelopment;\n }\n if (typeof this.trialSupport !== 'undefined') {\n toReturn['trialSupport'] = this.trialSupport;\n }\n if (typeof this.usesOrderForm !== 'undefined') {\n toReturn['usesOrderForm'] = this.usesOrderForm;\n }\n if (typeof this.tagline !== 'undefined') {\n toReturn['tagline'] = this.tagline;\n }\n if (typeof this.signInUrl !== 'undefined') {\n toReturn['signInUrl'] = this.signInUrl;\n }\n if (typeof this.currency !== 'undefined') {\n toReturn['currency'] = this.currency;\n }\n if (typeof this.price !== 'undefined') {\n toReturn['price'] = this.price;\n }\n if (typeof this.billingFrequency !== 'undefined') {\n toReturn['billingFrequency'] = this.billingFrequency;\n }\n if (typeof this.serviceModel !== 'undefined') {\n toReturn['serviceModel'] = this.serviceModel;\n }\n if (typeof this.screenshot !== 'undefined') {\n toReturn['screenshot'] = this.screenshot;\n }\n if (typeof this.websiteUrl !== 'undefined') {\n toReturn['websiteUrl'] = this.websiteUrl;\n }\n if (typeof this.headerImage !== 'undefined') {\n toReturn['headerImage'] = this.headerImage;\n }\n if (typeof this.productCategory !== 'undefined') {\n toReturn['productCategory'] = this.productCategory;\n }\n if (typeof this.lmiCategories !== 'undefined') {\n toReturn['lmiCategories'] = this.lmiCategories;\n }\n if (typeof this.integration !== 'undefined' && this.integration !== null) {\n toReturn['integration'] = 'toApiJson' in this.integration ? this.integration.toApiJson() : this.integration;\n }\n if (typeof this.orderForm !== 'undefined' && this.orderForm !== null) {\n toReturn['orderForm'] = 'toApiJson' in this.orderForm ? this.orderForm.toApiJson() : this.orderForm;\n }\n if (typeof this.resellerMarketing !== 'undefined' && this.resellerMarketing !== null) {\n toReturn['resellerMarketing'] = 'toApiJson' in this.resellerMarketing ? this.resellerMarketing.toApiJson() : this.resellerMarketing;\n }\n if (typeof this.endUserMarketing !== 'undefined' && this.endUserMarketing !== null) {\n toReturn['endUserMarketing'] = 'toApiJson' in this.endUserMarketing ? this.endUserMarketing.toApiJson() : this.endUserMarketing;\n }\n if (typeof this.created !== 'undefined' && this.created !== null) {\n toReturn['created'] = 'toApiJson' in this.created ? this.created.toApiJson() : this.created;\n }\n if (typeof this.updated !== 'undefined' && this.updated !== null) {\n toReturn['updated'] = 'toApiJson' in this.updated ? this.updated.toApiJson() : this.updated;\n }\n if (typeof this.allowPriceNegotiation !== 'undefined') {\n toReturn['allowPriceNegotiation'] = this.allowPriceNegotiation;\n }\n if (typeof this.restrictions !== 'undefined' && this.restrictions !== null) {\n toReturn['restrictions'] = 'toApiJson' in this.restrictions ? this.restrictions.toApiJson() : this.restrictions;\n }\n if (typeof this.billingId !== 'undefined') {\n toReturn['billingId'] = this.billingId;\n }\n if (typeof this.gdprCompliant !== 'undefined') {\n toReturn['gdprCompliant'] = this.gdprCompliant;\n }\n if (typeof this.preventPriceConversionBetweenCurrencies !== 'undefined') {\n toReturn['preventPriceConversionBetweenCurrencies'] = this.preventPriceConversionBetweenCurrencies;\n }\n if (typeof this.suggestedRetailPrice !== 'undefined') {\n toReturn['suggestedRetailPrice'] = this.suggestedRetailPrice;\n }\n if (typeof this.commitment !== 'undefined' && this.commitment !== null) {\n toReturn['commitment'] = 'toApiJson' in this.commitment ? this.commitment.toApiJson() : this.commitment;\n }\n if (typeof this.vendorId !== 'undefined') {\n toReturn['vendorId'] = this.vendorId;\n }\n if (typeof this.multipleActivations !== 'undefined') {\n toReturn['multipleActivations'] = this.multipleActivations;\n }\n if (typeof this.usesActivationSpecificEntryUrl !== 'undefined') {\n toReturn['usesActivationSpecificEntryUrl'] = this.usesActivationSpecificEntryUrl;\n }\n if (typeof this.usesResellerMarketing !== 'undefined') {\n toReturn['usesResellerMarketing'] = this.usesResellerMarketing;\n }\n if (typeof this.usesIntegration !== 'undefined') {\n toReturn['usesIntegration'] = this.usesIntegration;\n }\n if (typeof this.usesEditions !== 'undefined') {\n toReturn['usesEditions'] = this.usesEditions;\n }\n if (typeof this.usesSsoIntegration !== 'undefined') {\n toReturn['usesSsoIntegration'] = this.usesSsoIntegration;\n }\n if (typeof this.editionIds !== 'undefined') {\n toReturn['editionIds'] = this.editionIds;\n }\n if (typeof this.discoverable !== 'undefined') {\n toReturn['discoverable'] = this.discoverable;\n }\n if (typeof this.trialConfiguration !== 'undefined' && this.trialConfiguration !== null) {\n toReturn['trialConfiguration'] = 'toApiJson' in this.trialConfiguration ? this.trialConfiguration.toApiJson() : this.trialConfiguration;\n }\n if (typeof this.applicationUrl !== 'undefined') {\n toReturn['applicationUrl'] = this.applicationUrl;\n }\n if (typeof this.state !== 'undefined') {\n toReturn['state'] = this.state;\n }\n if (typeof this.type !== 'undefined') {\n toReturn['type'] = this.type;\n }\n if (typeof this.cost !== 'undefined' && this.cost !== null) {\n toReturn['cost'] = 'toApiJson' in this.cost ? this.cost.toApiJson() : this.cost;\n }\n if (typeof this.billingProcess !== 'undefined') {\n toReturn['billingProcess'] = this.billingProcess;\n }\n if (typeof this.setupFee !== 'undefined') {\n toReturn['setupFee'] = this.setupFee;\n }\n if (typeof this.suspended !== 'undefined' && this.suspended !== null) {\n toReturn['suspended'] = 'toApiJson' in this.suspended ? this.suspended.toApiJson() : this.suspended;\n }\n if (typeof this.usesCustomPricing !== 'undefined') {\n toReturn['usesCustomPricing'] = this.usesCustomPricing;\n }\n if (typeof this.usesFulfillmentIntegration !== 'undefined') {\n toReturn['usesFulfillmentIntegration'] = this.usesFulfillmentIntegration;\n }\n if (typeof this.deliveryMethod !== 'undefined') {\n toReturn['deliveryMethod'] = this.deliveryMethod;\n }\n if (typeof this.categories !== 'undefined') {\n toReturn['categories'] = this.categories;\n }\n return toReturn;\n }\n}\nclass MarketplaceAppProduct {\n static fromProto(proto) {\n let m = new MarketplaceAppProduct();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n return toReturn;\n }\n}\nclass TrialConfiguration {\n static fromProto(proto) {\n let m = new TrialConfiguration();\n m = Object.assign(m, proto);\n if (proto.endOfTrialAction) {\n m.endOfTrialAction = enumStringToValue$8(EndOfTrialActions, proto.endOfTrialAction);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.trialEnabled !== 'undefined') {\n toReturn['trialEnabled'] = this.trialEnabled;\n }\n if (typeof this.trialDuration !== 'undefined') {\n toReturn['trialDuration'] = this.trialDuration;\n }\n if (typeof this.endOfTrialAction !== 'undefined') {\n toReturn['endOfTrialAction'] = this.endOfTrialAction;\n }\n return toReturn;\n }\n}\nfunction enumStringToValue$7(enumRef, value) {\n if (typeof value === 'number') {\n return value;\n }\n return enumRef[value];\n}\nclass Addon {\n static fromProto(proto) {\n let m = new Addon();\n m = Object.assign(m, proto);\n if (proto.price) {\n m.price = parseInt(proto.price, 10);\n }\n if (proto.created) {\n m.created = new Date(proto.created);\n }\n if (proto.updated) {\n m.updated = new Date(proto.updated);\n }\n if (proto.orderForm) {\n m.orderForm = OrderForm.fromProto(proto.orderForm);\n }\n if (proto.resellerMarketing) {\n m.resellerMarketing = MarketingInformation.fromProto(proto.resellerMarketing);\n }\n if (proto.endUserMarketing) {\n m.endUserMarketing = MarketingInformation.fromProto(proto.endUserMarketing);\n }\n if (proto.restrictions) {\n m.restrictions = Restrictions.fromProto(proto.restrictions);\n }\n if (proto.suggestedRetailPrice) {\n m.suggestedRetailPrice = parseInt(proto.suggestedRetailPrice, 10);\n }\n if (proto.commitment) {\n m.commitment = Commitment.fromProto(proto.commitment);\n }\n if (proto.setupFee) {\n m.setupFee = parseInt(proto.setupFee, 10);\n }\n if (proto.suspended) {\n m.suspended = new Date(proto.suspended);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.addonId !== 'undefined') {\n toReturn['addonId'] = this.addonId;\n }\n if (typeof this.appId !== 'undefined') {\n toReturn['appId'] = this.appId;\n }\n if (typeof this.tagline !== 'undefined') {\n toReturn['tagline'] = this.tagline;\n }\n if (typeof this.price !== 'undefined') {\n toReturn['price'] = this.price;\n }\n if (typeof this.title !== 'undefined') {\n toReturn['title'] = this.title;\n }\n if (typeof this.description !== 'undefined') {\n toReturn['description'] = this.description;\n }\n if (typeof this.created !== 'undefined' && this.created !== null) {\n toReturn['created'] = 'toApiJson' in this.created ? this.created.toApiJson() : this.created;\n }\n if (typeof this.updated !== 'undefined' && this.updated !== null) {\n toReturn['updated'] = 'toApiJson' in this.updated ? this.updated.toApiJson() : this.updated;\n }\n if (typeof this.orderForm !== 'undefined' && this.orderForm !== null) {\n toReturn['orderForm'] = 'toApiJson' in this.orderForm ? this.orderForm.toApiJson() : this.orderForm;\n }\n if (typeof this.usesOrderForm !== 'undefined') {\n toReturn['usesOrderForm'] = this.usesOrderForm;\n }\n if (typeof this.approved !== 'undefined') {\n toReturn['approved'] = this.approved;\n }\n if (typeof this.icon !== 'undefined') {\n toReturn['icon'] = this.icon;\n }\n if (typeof this.bannerImage !== 'undefined') {\n toReturn['bannerImage'] = this.bannerImage;\n }\n if (typeof this.resellerMarketing !== 'undefined' && this.resellerMarketing !== null) {\n toReturn['resellerMarketing'] = 'toApiJson' in this.resellerMarketing ? this.resellerMarketing.toApiJson() : this.resellerMarketing;\n }\n if (typeof this.endUserMarketing !== 'undefined' && this.endUserMarketing !== null) {\n toReturn['endUserMarketing'] = 'toApiJson' in this.endUserMarketing ? this.endUserMarketing.toApiJson() : this.endUserMarketing;\n }\n if (typeof this.billingFrequency !== 'undefined') {\n toReturn['billingFrequency'] = this.billingFrequency;\n }\n if (typeof this.serviceModel !== 'undefined') {\n toReturn['serviceModel'] = this.serviceModel;\n }\n if (typeof this.discoverable !== 'undefined') {\n toReturn['discoverable'] = this.discoverable;\n }\n if (typeof this.screenshots !== 'undefined') {\n toReturn['screenshots'] = this.screenshots;\n }\n if (typeof this.multipleActivations !== 'undefined') {\n toReturn['multipleActivations'] = this.multipleActivations;\n }\n if (typeof this.restrictions !== 'undefined' && this.restrictions !== null) {\n toReturn['restrictions'] = 'toApiJson' in this.restrictions ? this.restrictions.toApiJson() : this.restrictions;\n }\n if (typeof this.activationRequiresApproval !== 'undefined') {\n toReturn['activationRequiresApproval'] = this.activationRequiresApproval;\n }\n if (typeof this.billingId !== 'undefined') {\n toReturn['billingId'] = this.billingId;\n }\n if (typeof this.preventPriceConversionBetweenCurrencies !== 'undefined') {\n toReturn['preventPriceConversionBetweenCurrencies'] = this.preventPriceConversionBetweenCurrencies;\n }\n if (typeof this.suggestedRetailPrice !== 'undefined') {\n toReturn['suggestedRetailPrice'] = this.suggestedRetailPrice;\n }\n if (typeof this.commitment !== 'undefined' && this.commitment !== null) {\n toReturn['commitment'] = 'toApiJson' in this.commitment ? this.commitment.toApiJson() : this.commitment;\n }\n if (typeof this.currency !== 'undefined') {\n toReturn['currency'] = this.currency;\n }\n if (typeof this.setupFee !== 'undefined') {\n toReturn['setupFee'] = this.setupFee;\n }\n if (typeof this.suspended !== 'undefined' && this.suspended !== null) {\n toReturn['suspended'] = 'toApiJson' in this.suspended ? this.suspended.toApiJson() : this.suspended;\n }\n if (typeof this.usesCustomPricing !== 'undefined') {\n toReturn['usesCustomPricing'] = this.usesCustomPricing;\n }\n return toReturn;\n }\n}\nfunction enumStringToValue$6(enumRef, value) {\n if (typeof value === 'number') {\n return value;\n }\n return enumRef[value];\n}\nclass Access {\n static fromProto(proto) {\n let m = new Access();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.scope !== 'undefined') {\n toReturn['scope'] = this.scope;\n }\n if (typeof this.public !== 'undefined') {\n toReturn['public'] = this.public;\n }\n return toReturn;\n }\n}\nfunction enumStringToValue$5(enumRef, value) {\n if (typeof value === 'number') {\n return value;\n }\n return enumRef[value];\n}\nclass FieldMask {\n static fromProto(proto) {\n let m = new FieldMask();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.paths !== 'undefined') {\n toReturn['paths'] = this.paths;\n }\n return toReturn;\n }\n}\nfunction enumStringToValue$4(enumRef, value) {\n if (typeof value === 'number') {\n return value;\n }\n return enumRef[value];\n}\nclass AppVendor {\n static fromProto(proto) {\n let m = new AppVendor();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.id !== 'undefined') {\n toReturn['id'] = this.id;\n }\n if (typeof this.name !== 'undefined') {\n toReturn['name'] = this.name;\n }\n if (typeof this.appIds !== 'undefined') {\n toReturn['appIds'] = this.appIds;\n }\n if (typeof this.partnerId !== 'undefined') {\n toReturn['partnerId'] = this.partnerId;\n }\n if (typeof this.reportingCode !== 'undefined') {\n toReturn['reportingCode'] = this.reportingCode;\n }\n return toReturn;\n }\n}\nfunction enumStringToValue$3(enumRef, value) {\n if (typeof value === 'number') {\n return value;\n }\n return enumRef[value];\n}\nclass ProductCostEditionCostEntry {\n static fromProto(proto) {\n let m = new ProductCostEditionCostEntry();\n m = Object.assign(m, proto);\n if (proto.value) {\n m.value = ProductCost.fromProto(proto.value);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.key !== 'undefined') {\n toReturn['key'] = this.key;\n }\n if (typeof this.value !== 'undefined' && this.value !== null) {\n toReturn['value'] = 'toApiJson' in this.value ? this.value.toApiJson() : this.value;\n }\n return toReturn;\n }\n}\nclass ProductCost {\n static fromProto(proto) {\n let m = new ProductCost();\n m = Object.assign(m, proto);\n if (proto.cost) {\n m.cost = parseInt(proto.cost, 10);\n }\n if (proto.commitment) {\n m.commitment = Commitment.fromProto(proto.commitment);\n }\n if (proto.editionCost) {\n m.editionCost = Object.keys(proto.editionCost).reduce((obj, k) => {\n obj[k] = ProductCost.fromProto(proto.editionCost[k]);\n return obj;\n }, {});\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.currency !== 'undefined') {\n toReturn['currency'] = this.currency;\n }\n if (typeof this.frequency !== 'undefined') {\n toReturn['frequency'] = this.frequency;\n }\n if (typeof this.cost !== 'undefined') {\n toReturn['cost'] = this.cost;\n }\n if (typeof this.commitment !== 'undefined' && this.commitment !== null) {\n toReturn['commitment'] = 'toApiJson' in this.commitment ? this.commitment.toApiJson() : this.commitment;\n }\n if (typeof this.isWholesale !== 'undefined') {\n toReturn['isWholesale'] = this.isWholesale;\n }\n if (typeof this.editionCost !== 'undefined' && this.editionCost !== null) {\n toReturn['editionCost'] = 'toApiJson' in this.editionCost ? this.editionCost.toApiJson() : this.editionCost;\n }\n return toReturn;\n }\n}\nfunction enumStringToValue$2(enumRef, value) {\n if (typeof value === 'number') {\n return value;\n }\n return enumRef[value];\n}\nclass ActiveAppEditionIdentifier {\n static fromProto(proto) {\n let m = new ActiveAppEditionIdentifier();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.appId !== 'undefined') {\n toReturn['appId'] = this.appId;\n }\n if (typeof this.editionId !== 'undefined') {\n toReturn['editionId'] = this.editionId;\n }\n return toReturn;\n }\n}\nclass AddAppIDRequest {\n static fromProto(proto) {\n let m = new AddAppIDRequest();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.id !== 'undefined') {\n toReturn['id'] = this.id;\n }\n if (typeof this.appId !== 'undefined') {\n toReturn['appId'] = this.appId;\n }\n return toReturn;\n }\n}\nclass AddAppIDResponse {\n static fromProto(proto) {\n let m = new AddAppIDResponse();\n m = Object.assign(m, proto);\n if (proto.vendor) {\n m.vendor = AppVendor.fromProto(proto.vendor);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.vendor !== 'undefined' && this.vendor !== null) {\n toReturn['vendor'] = 'toApiJson' in this.vendor ? this.vendor.toApiJson() : this.vendor;\n }\n return toReturn;\n }\n}\nclass AddonResponse {\n static fromProto(proto) {\n let m = new AddonResponse();\n m = Object.assign(m, proto);\n if (proto.addon) {\n m.addon = Addon.fromProto(proto.addon);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.addon !== 'undefined' && this.addon !== null) {\n toReturn['addon'] = 'toApiJson' in this.addon ? this.addon.toApiJson() : this.addon;\n }\n return toReturn;\n }\n}\nclass AddonsListResponse {\n static fromProto(proto) {\n let m = new AddonsListResponse();\n m = Object.assign(m, proto);\n if (proto.addons) {\n m.addons = proto.addons.map(Addon.fromProto);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.addons !== 'undefined' && this.addons !== null) {\n toReturn['addons'] = 'toApiJson' in this.addons ? this.addons.toApiJson() : this.addons;\n }\n if (typeof this.nextCursor !== 'undefined') {\n toReturn['nextCursor'] = this.nextCursor;\n }\n if (typeof this.hasMore !== 'undefined') {\n toReturn['hasMore'] = this.hasMore;\n }\n return toReturn;\n }\n}\nclass AppResponse {\n static fromProto(proto) {\n let m = new AppResponse();\n m = Object.assign(m, proto);\n if (proto.app) {\n m.app = MarketplaceApp.fromProto(proto.app);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.app !== 'undefined' && this.app !== null) {\n toReturn['app'] = 'toApiJson' in this.app ? this.app.toApiJson() : this.app;\n }\n return toReturn;\n }\n}\nclass ApproveAddonRequest {\n static fromProto(proto) {\n let m = new ApproveAddonRequest();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.appId !== 'undefined') {\n toReturn['appId'] = this.appId;\n }\n if (typeof this.addonId !== 'undefined') {\n toReturn['addonId'] = this.addonId;\n }\n return toReturn;\n }\n}\nclass ApproveAppRequest {\n static fromProto(proto) {\n let m = new ApproveAppRequest();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.appId !== 'undefined') {\n toReturn['appId'] = this.appId;\n }\n return toReturn;\n }\n}\nclass CanActivateRequest {\n static fromProto(proto) {\n let m = new CanActivateRequest();\n m = Object.assign(m, proto);\n if (proto.activeAppEditionIds) {\n m.activeAppEditionIds = proto.activeAppEditionIds.map(ActiveAppEditionIdentifier.fromProto);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.appIds !== 'undefined') {\n toReturn['appIds'] = this.appIds;\n }\n if (typeof this.activeAppIds !== 'undefined') {\n toReturn['activeAppIds'] = this.activeAppIds;\n }\n if (typeof this.activeAppEditionIds !== 'undefined' && this.activeAppEditionIds !== null) {\n toReturn['activeAppEditionIds'] = 'toApiJson' in this.activeAppEditionIds ? this.activeAppEditionIds.toApiJson() : this.activeAppEditionIds;\n }\n return toReturn;\n }\n}\nclass CanActivateResponse {\n static fromProto(proto) {\n let m = new CanActivateResponse();\n m = Object.assign(m, proto);\n if (proto.invalidResponse) {\n m.invalidResponse = CanActivateResponseInvalidResponse.fromProto(proto.invalidResponse);\n }\n if (proto.successResponse) {\n m.successResponse = CanActivateResponseSuccessResponse.fromProto(proto.successResponse);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.invalidResponse !== 'undefined' && this.invalidResponse !== null) {\n toReturn['invalidResponse'] = 'toApiJson' in this.invalidResponse ? this.invalidResponse.toApiJson() : this.invalidResponse;\n }\n if (typeof this.successResponse !== 'undefined' && this.successResponse !== null) {\n toReturn['successResponse'] = 'toApiJson' in this.successResponse ? this.successResponse.toApiJson() : this.successResponse;\n }\n return toReturn;\n }\n}\nclass CreateAppRequest {\n static fromProto(proto) {\n let m = new CreateAppRequest();\n m = Object.assign(m, proto);\n if (proto.lmiCategories) {\n m.lmiCategories = proto.lmiCategories.map(v => enumStringToValue$2(MarketplaceAppLmiLmiCategories, v));\n }\n if (proto.price) {\n m.price = parseInt(proto.price, 10);\n }\n if (proto.restrictions) {\n m.restrictions = Restrictions.fromProto(proto.restrictions);\n }\n if (proto.orderForm) {\n m.orderForm = OrderForm.fromProto(proto.orderForm);\n }\n if (proto.resellerMarketing) {\n m.resellerMarketing = MarketingInformation.fromProto(proto.resellerMarketing);\n }\n if (proto.endUserMarketing) {\n m.endUserMarketing = MarketingInformation.fromProto(proto.endUserMarketing);\n }\n if (proto.suggestedRetailPrice) {\n m.suggestedRetailPrice = parseInt(proto.suggestedRetailPrice, 10);\n }\n if (proto.country) {\n m.country = PermissionLists.fromProto(proto.country);\n }\n if (proto.commitment) {\n m.commitment = Commitment.fromProto(proto.commitment);\n }\n if (proto.distributionSetting) {\n m.distributionSetting = enumStringToValue$2(DistributionSetting, proto.distributionSetting);\n }\n if (proto.state) {\n m.state = enumStringToValue$2(State, proto.state);\n }\n if (proto.cost) {\n m.cost = Cost.fromProto(proto.cost);\n }\n if (proto.setupFee) {\n m.setupFee = parseInt(proto.setupFee, 10);\n }\n if (proto.deliveryMethod) {\n m.deliveryMethod = enumStringToValue$2(DeliveryMethod, proto.deliveryMethod);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.name !== 'undefined') {\n toReturn['name'] = this.name;\n }\n if (typeof this.vendor !== 'undefined') {\n toReturn['vendor'] = this.vendor;\n }\n if (typeof this.tagline !== 'undefined') {\n toReturn['tagline'] = this.tagline;\n }\n if (typeof this.serviceModel !== 'undefined') {\n toReturn['serviceModel'] = this.serviceModel;\n }\n if (typeof this.lmiCategories !== 'undefined') {\n toReturn['lmiCategories'] = this.lmiCategories;\n }\n if (typeof this.icon !== 'undefined') {\n toReturn['icon'] = this.icon;\n }\n if (typeof this.headerImage !== 'undefined') {\n toReturn['headerImage'] = this.headerImage;\n }\n if (typeof this.screenshot !== 'undefined') {\n toReturn['screenshot'] = this.screenshot;\n }\n if (typeof this.price !== 'undefined') {\n toReturn['price'] = this.price;\n }\n if (typeof this.currency !== 'undefined') {\n toReturn['currency'] = this.currency;\n }\n if (typeof this.billingFrequency !== 'undefined') {\n toReturn['billingFrequency'] = this.billingFrequency;\n }\n if (typeof this.restrictions !== 'undefined' && this.restrictions !== null) {\n toReturn['restrictions'] = 'toApiJson' in this.restrictions ? this.restrictions.toApiJson() : this.restrictions;\n }\n if (typeof this.allowPriceNegotiation !== 'undefined') {\n toReturn['allowPriceNegotiation'] = this.allowPriceNegotiation;\n }\n if (typeof this.publicKey !== 'undefined') {\n toReturn['publicKey'] = this.publicKey;\n }\n if (typeof this.reserveIdUrl !== 'undefined') {\n toReturn['reserveIdUrl'] = this.reserveIdUrl;\n }\n if (typeof this.purchaseWebhookUrl !== 'undefined') {\n toReturn['purchaseWebhookUrl'] = this.purchaseWebhookUrl;\n }\n if (typeof this.activationRequiresApproval !== 'undefined') {\n toReturn['activationRequiresApproval'] = this.activationRequiresApproval;\n }\n if (typeof this.addonPurchaseWebhookUrl !== 'undefined') {\n toReturn['addonPurchaseWebhookUrl'] = this.addonPurchaseWebhookUrl;\n }\n if (typeof this.userModWebhookUrl !== 'undefined') {\n toReturn['userModWebhookUrl'] = this.userModWebhookUrl;\n }\n if (typeof this.accountModWebhookUrl !== 'undefined') {\n toReturn['accountModWebhookUrl'] = this.accountModWebhookUrl;\n }\n if (typeof this.contactWebhookUrl !== 'undefined') {\n toReturn['contactWebhookUrl'] = this.contactWebhookUrl;\n }\n if (typeof this.fulfillmentEmail !== 'undefined') {\n toReturn['fulfillmentEmail'] = this.fulfillmentEmail;\n }\n if (typeof this.entryUrl !== 'undefined') {\n toReturn['entryUrl'] = this.entryUrl;\n }\n if (typeof this.sessionUrl !== 'undefined') {\n toReturn['sessionUrl'] = this.sessionUrl;\n }\n if (typeof this.logoutUrl !== 'undefined') {\n toReturn['logoutUrl'] = this.logoutUrl;\n }\n if (typeof this.usesOrderForm !== 'undefined') {\n toReturn['usesOrderForm'] = this.usesOrderForm;\n }\n if (typeof this.orderForm !== 'undefined' && this.orderForm !== null) {\n toReturn['orderForm'] = 'toApiJson' in this.orderForm ? this.orderForm.toApiJson() : this.orderForm;\n }\n if (typeof this.resellerMarketing !== 'undefined' && this.resellerMarketing !== null) {\n toReturn['resellerMarketing'] = 'toApiJson' in this.resellerMarketing ? this.resellerMarketing.toApiJson() : this.resellerMarketing;\n }\n if (typeof this.endUserMarketing !== 'undefined' && this.endUserMarketing !== null) {\n toReturn['endUserMarketing'] = 'toApiJson' in this.endUserMarketing ? this.endUserMarketing.toApiJson() : this.endUserMarketing;\n }\n if (typeof this.preventPriceConversionBetweenCurrencies !== 'undefined') {\n toReturn['preventPriceConversionBetweenCurrencies'] = this.preventPriceConversionBetweenCurrencies;\n }\n if (typeof this.partnerSettingsWebhookUrl !== 'undefined') {\n toReturn['partnerSettingsWebhookUrl'] = this.partnerSettingsWebhookUrl;\n }\n if (typeof this.suggestedRetailPrice !== 'undefined') {\n toReturn['suggestedRetailPrice'] = this.suggestedRetailPrice;\n }\n if (typeof this.country !== 'undefined' && this.country !== null) {\n toReturn['country'] = 'toApiJson' in this.country ? this.country.toApiJson() : this.country;\n }\n if (typeof this.commitment !== 'undefined' && this.commitment !== null) {\n toReturn['commitment'] = 'toApiJson' in this.commitment ? this.commitment.toApiJson() : this.commitment;\n }\n if (typeof this.partnerId !== 'undefined') {\n toReturn['partnerId'] = this.partnerId;\n }\n if (typeof this.vendorId !== 'undefined') {\n toReturn['vendorId'] = this.vendorId;\n }\n if (typeof this.customAppId !== 'undefined') {\n toReturn['customAppId'] = this.customAppId;\n }\n if (typeof this.multipleActivations !== 'undefined') {\n toReturn['multipleActivations'] = this.multipleActivations;\n }\n if (typeof this.usesActivationSpecificEntryUrl !== 'undefined') {\n toReturn['usesActivationSpecificEntryUrl'] = this.usesActivationSpecificEntryUrl;\n }\n if (typeof this.usesResellerMarketing !== 'undefined') {\n toReturn['usesResellerMarketing'] = this.usesResellerMarketing;\n }\n if (typeof this.usesIntegration !== 'undefined') {\n toReturn['usesIntegration'] = this.usesIntegration;\n }\n if (typeof this.usesEditions !== 'undefined') {\n toReturn['usesEditions'] = this.usesEditions;\n }\n if (typeof this.usesSsoIntegration !== 'undefined') {\n toReturn['usesSsoIntegration'] = this.usesSsoIntegration;\n }\n if (typeof this.discoverable !== 'undefined') {\n toReturn['discoverable'] = this.discoverable;\n }\n if (typeof this.distributionSetting !== 'undefined') {\n toReturn['distributionSetting'] = this.distributionSetting;\n }\n if (typeof this.orderFormValidatorWebhookUrl !== 'undefined') {\n toReturn['orderFormValidatorWebhookUrl'] = this.orderFormValidatorWebhookUrl;\n }\n if (typeof this.applicationUrl !== 'undefined') {\n toReturn['applicationUrl'] = this.applicationUrl;\n }\n if (typeof this.allowWhiteLabeling !== 'undefined') {\n toReturn['allowWhiteLabeling'] = this.allowWhiteLabeling;\n }\n if (typeof this.state !== 'undefined') {\n toReturn['state'] = this.state;\n }\n if (typeof this.cost !== 'undefined' && this.cost !== null) {\n toReturn['cost'] = 'toApiJson' in this.cost ? this.cost.toApiJson() : this.cost;\n }\n if (typeof this.setupFee !== 'undefined') {\n toReturn['setupFee'] = this.setupFee;\n }\n if (typeof this.usesCustomPricing !== 'undefined') {\n toReturn['usesCustomPricing'] = this.usesCustomPricing;\n }\n if (typeof this.customerWebhookUrl !== 'undefined') {\n toReturn['customerWebhookUrl'] = this.customerWebhookUrl;\n }\n if (typeof this.sendCancelationNotifications !== 'undefined') {\n toReturn['sendCancelationNotifications'] = this.sendCancelationNotifications;\n }\n if (typeof this.cancellationWebhookUrl !== 'undefined') {\n toReturn['cancellationWebhookUrl'] = this.cancellationWebhookUrl;\n }\n if (typeof this.deliveryMethod !== 'undefined') {\n toReturn['deliveryMethod'] = this.deliveryMethod;\n }\n if (typeof this.serviceChangeWebhookUrl !== 'undefined') {\n toReturn['serviceChangeWebhookUrl'] = this.serviceChangeWebhookUrl;\n }\n if (typeof this.appLevelHasAdminDashboard !== 'undefined') {\n toReturn['appLevelHasAdminDashboard'] = this.appLevelHasAdminDashboard;\n }\n return toReturn;\n }\n}\nclass CreateVendorRequest {\n static fromProto(proto) {\n let m = new CreateVendorRequest();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.name !== 'undefined') {\n toReturn['name'] = this.name;\n }\n if (typeof this.partnerId !== 'undefined') {\n toReturn['partnerId'] = this.partnerId;\n }\n return toReturn;\n }\n}\nclass CreateVendorResponse {\n static fromProto(proto) {\n let m = new CreateVendorResponse();\n m = Object.assign(m, proto);\n if (proto.vendor) {\n m.vendor = AppVendor.fromProto(proto.vendor);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.vendor !== 'undefined' && this.vendor !== null) {\n toReturn['vendor'] = 'toApiJson' in this.vendor ? this.vendor.toApiJson() : this.vendor;\n }\n return toReturn;\n }\n}\nclass DeleteAppRequest {\n static fromProto(proto) {\n let m = new DeleteAppRequest();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.appId !== 'undefined') {\n toReturn['appId'] = this.appId;\n }\n return toReturn;\n }\n}\nclass DuplicateAppRequest {\n static fromProto(proto) {\n let m = new DuplicateAppRequest();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.appId !== 'undefined') {\n toReturn['appId'] = this.appId;\n }\n return toReturn;\n }\n}\nclass DuplicateAppResponse {\n static fromProto(proto) {\n let m = new DuplicateAppResponse();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.appId !== 'undefined') {\n toReturn['appId'] = this.appId;\n }\n return toReturn;\n }\n}\nclass GetAddonRequest {\n static fromProto(proto) {\n let m = new GetAddonRequest();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.appId !== 'undefined') {\n toReturn['appId'] = this.appId;\n }\n if (typeof this.addonId !== 'undefined') {\n toReturn['addonId'] = this.addonId;\n }\n return toReturn;\n }\n}\nclass GetAppIDFromSkuRequest {\n static fromProto(proto) {\n let m = new GetAppIDFromSkuRequest();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.sku !== 'undefined') {\n toReturn['sku'] = this.sku;\n }\n return toReturn;\n }\n}\nclass GetAppIDFromSkuResponse {\n static fromProto(proto) {\n let m = new GetAppIDFromSkuResponse();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.appId !== 'undefined') {\n toReturn['appId'] = this.appId;\n }\n if (typeof this.addonId !== 'undefined') {\n toReturn['addonId'] = this.addonId;\n }\n if (typeof this.editionId !== 'undefined') {\n toReturn['editionId'] = this.editionId;\n }\n return toReturn;\n }\n}\nclass GetAppRequest {\n static fromProto(proto) {\n let m = new GetAppRequest();\n m = Object.assign(m, proto);\n if (proto.fieldMask) {\n m.fieldMask = FieldMask.fromProto(proto.fieldMask);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.appId !== 'undefined') {\n toReturn['appId'] = this.appId;\n }\n if (typeof this.fieldMask !== 'undefined' && this.fieldMask !== null) {\n toReturn['fieldMask'] = 'toApiJson' in this.fieldMask ? this.fieldMask.toApiJson() : this.fieldMask;\n }\n if (typeof this.bypassCache !== 'undefined') {\n toReturn['bypassCache'] = this.bypassCache;\n }\n return toReturn;\n }\n}\nclass GetAppResponse {\n static fromProto(proto) {\n let m = new GetAppResponse();\n m = Object.assign(m, proto);\n if (proto.app) {\n m.app = MarketplaceApp.fromProto(proto.app);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.app !== 'undefined' && this.app !== null) {\n toReturn['app'] = 'toApiJson' in this.app ? this.app.toApiJson() : this.app;\n }\n return toReturn;\n }\n}\nclass GetAppsToDeactivateUponDeactivationRequest {\n static fromProto(proto) {\n let m = new GetAppsToDeactivateUponDeactivationRequest();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.appIdsToDeactivate !== 'undefined') {\n toReturn['appIdsToDeactivate'] = this.appIdsToDeactivate;\n }\n if (typeof this.activeAppIds !== 'undefined') {\n toReturn['activeAppIds'] = this.activeAppIds;\n }\n return toReturn;\n }\n}\nclass GetAppsToDeactivateUponDeactivationResponse {\n static fromProto(proto) {\n let m = new GetAppsToDeactivateUponDeactivationResponse();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.appIdsToBeDeactivated !== 'undefined') {\n toReturn['appIdsToBeDeactivated'] = this.appIdsToBeDeactivated;\n }\n return toReturn;\n }\n}\nclass GetAppsWithUnpublishedChangesRequest {\n static fromProto(proto) {\n let m = new GetAppsWithUnpublishedChangesRequest();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n return toReturn;\n }\n}\nclass GetAppsWithUnpublishedChangesResponse {\n static fromProto(proto) {\n let m = new GetAppsWithUnpublishedChangesResponse();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.appIds !== 'undefined') {\n toReturn['appIds'] = this.appIds;\n }\n return toReturn;\n }\n}\nclass GetByPartnerIDRequest {\n static fromProto(proto) {\n let m = new GetByPartnerIDRequest();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.partnerId !== 'undefined') {\n toReturn['partnerId'] = this.partnerId;\n }\n return toReturn;\n }\n}\nclass GetByPartnerIDResponse {\n static fromProto(proto) {\n let m = new GetByPartnerIDResponse();\n m = Object.assign(m, proto);\n if (proto.vendor) {\n m.vendor = AppVendor.fromProto(proto.vendor);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.vendor !== 'undefined' && this.vendor !== null) {\n toReturn['vendor'] = 'toApiJson' in this.vendor ? this.vendor.toApiJson() : this.vendor;\n }\n return toReturn;\n }\n}\nclass GetMultiAppRequest {\n static fromProto(proto) {\n let m = new GetMultiAppRequest();\n m = Object.assign(m, proto);\n if (proto.fieldMask) {\n m.fieldMask = FieldMask.fromProto(proto.fieldMask);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.appId !== 'undefined') {\n toReturn['appId'] = this.appId;\n }\n if (typeof this.fieldMask !== 'undefined' && this.fieldMask !== null) {\n toReturn['fieldMask'] = 'toApiJson' in this.fieldMask ? this.fieldMask.toApiJson() : this.fieldMask;\n }\n return toReturn;\n }\n}\nclass GetMultiAppResponse {\n static fromProto(proto) {\n let m = new GetMultiAppResponse();\n m = Object.assign(m, proto);\n if (proto.apps) {\n m.apps = proto.apps.map(MarketplaceApp.fromProto);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.apps !== 'undefined' && this.apps !== null) {\n toReturn['apps'] = 'toApiJson' in this.apps ? this.apps.toApiJson() : this.apps;\n }\n return toReturn;\n }\n}\nclass GetMultiOrderFormsRequest {\n static fromProto(proto) {\n let m = new GetMultiOrderFormsRequest();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.partnerId !== 'undefined') {\n toReturn['partnerId'] = this.partnerId;\n }\n if (typeof this.appIds !== 'undefined') {\n toReturn['appIds'] = this.appIds;\n }\n return toReturn;\n }\n}\nclass GetMultiOrderFormsResponse {\n static fromProto(proto) {\n let m = new GetMultiOrderFormsResponse();\n m = Object.assign(m, proto);\n if (proto.orderFormContainer) {\n m.orderFormContainer = proto.orderFormContainer.map(GetMultiOrderFormsResponseOrderFormContainer.fromProto);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.orderFormContainer !== 'undefined' && this.orderFormContainer !== null) {\n toReturn['orderFormContainer'] = 'toApiJson' in this.orderFormContainer ? this.orderFormContainer.toApiJson() : this.orderFormContainer;\n }\n return toReturn;\n }\n}\nclass GetMultiProductCostRequest {\n static fromProto(proto) {\n let m = new GetMultiProductCostRequest();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.partnerId !== 'undefined') {\n toReturn['partnerId'] = this.partnerId;\n }\n if (typeof this.appIds !== 'undefined') {\n toReturn['appIds'] = this.appIds;\n }\n return toReturn;\n }\n}\nclass GetMultiProductCostResponse {\n static fromProto(proto) {\n let m = new GetMultiProductCostResponse();\n m = Object.assign(m, proto);\n if (proto.productCost) {\n m.productCost = Object.keys(proto.productCost).reduce((obj, k) => {\n obj[k] = ProductCost.fromProto(proto.productCost[k]);\n return obj;\n }, {});\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.productCost !== 'undefined' && this.productCost !== null) {\n toReturn['productCost'] = 'toApiJson' in this.productCost ? this.productCost.toApiJson() : this.productCost;\n }\n return toReturn;\n }\n}\nclass GetMultiVendorRequest {\n static fromProto(proto) {\n let m = new GetMultiVendorRequest();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.ids !== 'undefined') {\n toReturn['ids'] = this.ids;\n }\n return toReturn;\n }\n}\nclass GetMultiVendorResponse {\n static fromProto(proto) {\n let m = new GetMultiVendorResponse();\n m = Object.assign(m, proto);\n if (proto.vendors) {\n m.vendors = proto.vendors.map(AppVendor.fromProto);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.vendors !== 'undefined' && this.vendors !== null) {\n toReturn['vendors'] = 'toApiJson' in this.vendors ? this.vendors.toApiJson() : this.vendors;\n }\n return toReturn;\n }\n}\nclass GetOwnedAppIDsByPartnerIDRequest {\n static fromProto(proto) {\n let m = new GetOwnedAppIDsByPartnerIDRequest();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.partnerId !== 'undefined') {\n toReturn['partnerId'] = this.partnerId;\n }\n return toReturn;\n }\n}\nclass GetOwnedAppIDsByPartnerIDResponse {\n static fromProto(proto) {\n let m = new GetOwnedAppIDsByPartnerIDResponse();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.appIds !== 'undefined') {\n toReturn['appIds'] = this.appIds;\n }\n return toReturn;\n }\n}\nclass GetPublicKeysRequest {\n static fromProto(proto) {\n let m = new GetPublicKeysRequest();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.appId !== 'undefined') {\n toReturn['appId'] = this.appId;\n }\n return toReturn;\n }\n}\nclass GetPublicKeysResponse {\n static fromProto(proto) {\n let m = new GetPublicKeysResponse();\n m = Object.assign(m, proto);\n if (proto.identifiedPublicKeys) {\n m.identifiedPublicKeys = proto.identifiedPublicKeys.map(IdentifiedPublicKey.fromProto);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.publicKey !== 'undefined') {\n toReturn['publicKey'] = this.publicKey;\n }\n if (typeof this.identifiedPublicKeys !== 'undefined' && this.identifiedPublicKeys !== null) {\n toReturn['identifiedPublicKeys'] = 'toApiJson' in this.identifiedPublicKeys ? this.identifiedPublicKeys.toApiJson() : this.identifiedPublicKeys;\n }\n return toReturn;\n }\n}\nclass GetSSOUrlsRequest {\n static fromProto(proto) {\n let m = new GetSSOUrlsRequest();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.appId !== 'undefined') {\n toReturn['appId'] = this.appId;\n }\n return toReturn;\n }\n}\nclass GetSSOUrlsResponse {\n static fromProto(proto) {\n let m = new GetSSOUrlsResponse();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.entryUrl !== 'undefined') {\n toReturn['entryUrl'] = this.entryUrl;\n }\n if (typeof this.sessionUrl !== 'undefined') {\n toReturn['sessionUrl'] = this.sessionUrl;\n }\n return toReturn;\n }\n}\nclass CanActivateResponseInvalidResponse {\n static fromProto(proto) {\n let m = new CanActivateResponseInvalidResponse();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.invalidAppIds !== 'undefined') {\n toReturn['invalidAppIds'] = this.invalidAppIds;\n }\n return toReturn;\n }\n}\nclass IsVendorDistributedByPartnerIDRequest {\n static fromProto(proto) {\n let m = new IsVendorDistributedByPartnerIDRequest();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.partnerId !== 'undefined') {\n toReturn['partnerId'] = this.partnerId;\n }\n return toReturn;\n }\n}\nclass IsVendorDistributedByPartnerIDResponse {\n static fromProto(proto) {\n let m = new IsVendorDistributedByPartnerIDResponse();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.isDistributed !== 'undefined') {\n toReturn['isDistributed'] = this.isDistributed;\n }\n return toReturn;\n }\n}\nclass ListAddonsRequest {\n static fromProto(proto) {\n let m = new ListAddonsRequest();\n m = Object.assign(m, proto);\n if (proto.pageSize) {\n m.pageSize = parseInt(proto.pageSize, 10);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.appId !== 'undefined') {\n toReturn['appId'] = this.appId;\n }\n if (typeof this.cursor !== 'undefined') {\n toReturn['cursor'] = this.cursor;\n }\n if (typeof this.pageSize !== 'undefined') {\n toReturn['pageSize'] = this.pageSize;\n }\n return toReturn;\n }\n}\nclass ListApprovedAddonsRequest {\n static fromProto(proto) {\n let m = new ListApprovedAddonsRequest();\n m = Object.assign(m, proto);\n if (proto.pageSize) {\n m.pageSize = parseInt(proto.pageSize, 10);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.appId !== 'undefined') {\n toReturn['appId'] = this.appId;\n }\n if (typeof this.cursor !== 'undefined') {\n toReturn['cursor'] = this.cursor;\n }\n if (typeof this.pageSize !== 'undefined') {\n toReturn['pageSize'] = this.pageSize;\n }\n if (typeof this.appIds !== 'undefined') {\n toReturn['appIds'] = this.appIds;\n }\n return toReturn;\n }\n}\nclass ListAppsRequestListAppsFilter {\n static fromProto(proto) {\n let m = new ListAppsRequestListAppsFilter();\n m = Object.assign(m, proto);\n if (proto.appType) {\n m.appType = enumStringToValue$2(AppType, proto.appType);\n }\n if (proto.releaseType) {\n m.releaseType = enumStringToValue$2(ReleaseType, proto.releaseType);\n }\n if (proto.state) {\n m.state = enumStringToValue$2(StateFilterOptions, proto.state);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.appType !== 'undefined') {\n toReturn['appType'] = this.appType;\n }\n if (typeof this.releaseType !== 'undefined') {\n toReturn['releaseType'] = this.releaseType;\n }\n if (typeof this.partnerId !== 'undefined') {\n toReturn['partnerId'] = this.partnerId;\n }\n if (typeof this.filterTerm !== 'undefined') {\n toReturn['filterTerm'] = this.filterTerm;\n }\n if (typeof this.state !== 'undefined') {\n toReturn['state'] = this.state;\n }\n return toReturn;\n }\n}\nclass ListAppsForVendorIDsRequest {\n static fromProto(proto) {\n let m = new ListAppsForVendorIDsRequest();\n m = Object.assign(m, proto);\n if (proto.pageSize) {\n m.pageSize = parseInt(proto.pageSize, 10);\n }\n if (proto.fieldMask) {\n m.fieldMask = FieldMask.fromProto(proto.fieldMask);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.vendorIds !== 'undefined') {\n toReturn['vendorIds'] = this.vendorIds;\n }\n if (typeof this.includeAddons !== 'undefined') {\n toReturn['includeAddons'] = this.includeAddons;\n }\n if (typeof this.cursor !== 'undefined') {\n toReturn['cursor'] = this.cursor;\n }\n if (typeof this.pageSize !== 'undefined') {\n toReturn['pageSize'] = this.pageSize;\n }\n if (typeof this.fieldMask !== 'undefined' && this.fieldMask !== null) {\n toReturn['fieldMask'] = 'toApiJson' in this.fieldMask ? this.fieldMask.toApiJson() : this.fieldMask;\n }\n return toReturn;\n }\n}\nclass ListAppsForVendorIDsResponse {\n static fromProto(proto) {\n let m = new ListAppsForVendorIDsResponse();\n m = Object.assign(m, proto);\n if (proto.apps) {\n m.apps = proto.apps.map(MarketplaceApp.fromProto);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.apps !== 'undefined' && this.apps !== null) {\n toReturn['apps'] = 'toApiJson' in this.apps ? this.apps.toApiJson() : this.apps;\n }\n if (typeof this.cursor !== 'undefined') {\n toReturn['cursor'] = this.cursor;\n }\n if (typeof this.hasMore !== 'undefined') {\n toReturn['hasMore'] = this.hasMore;\n }\n return toReturn;\n }\n}\nclass ListAppsRequest {\n static fromProto(proto) {\n let m = new ListAppsRequest();\n m = Object.assign(m, proto);\n if (proto.pageSize) {\n m.pageSize = parseInt(proto.pageSize, 10);\n }\n if (proto.fieldMask) {\n m.fieldMask = FieldMask.fromProto(proto.fieldMask);\n }\n if (proto.filter) {\n m.filter = ListAppsRequestListAppsFilter.fromProto(proto.filter);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.cursor !== 'undefined') {\n toReturn['cursor'] = this.cursor;\n }\n if (typeof this.pageSize !== 'undefined') {\n toReturn['pageSize'] = this.pageSize;\n }\n if (typeof this.fieldMask !== 'undefined' && this.fieldMask !== null) {\n toReturn['fieldMask'] = 'toApiJson' in this.fieldMask ? this.fieldMask.toApiJson() : this.fieldMask;\n }\n if (typeof this.filter !== 'undefined' && this.filter !== null) {\n toReturn['filter'] = 'toApiJson' in this.filter ? this.filter.toApiJson() : this.filter;\n }\n return toReturn;\n }\n}\nclass ListRequiredAppSummariesFilters {\n static fromProto(proto) {\n let m = new ListRequiredAppSummariesFilters();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.searchTerm !== 'undefined') {\n toReturn['searchTerm'] = this.searchTerm;\n }\n return toReturn;\n }\n}\nclass ListRequiredAppSummariesRequest {\n static fromProto(proto) {\n let m = new ListRequiredAppSummariesRequest();\n m = Object.assign(m, proto);\n if (proto.filters) {\n m.filters = ListRequiredAppSummariesFilters.fromProto(proto.filters);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.vendorId !== 'undefined') {\n toReturn['vendorId'] = this.vendorId;\n }\n if (typeof this.pageSize !== 'undefined') {\n toReturn['pageSize'] = this.pageSize;\n }\n if (typeof this.cursor !== 'undefined') {\n toReturn['cursor'] = this.cursor;\n }\n if (typeof this.filters !== 'undefined' && this.filters !== null) {\n toReturn['filters'] = 'toApiJson' in this.filters ? this.filters.toApiJson() : this.filters;\n }\n return toReturn;\n }\n}\nclass ListRequiredAppSummariesResponse {\n static fromProto(proto) {\n let m = new ListRequiredAppSummariesResponse();\n m = Object.assign(m, proto);\n if (proto.requiredAppSummaries) {\n m.requiredAppSummaries = proto.requiredAppSummaries.map(RequiredAppSummary.fromProto);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.requiredAppSummaries !== 'undefined' && this.requiredAppSummaries !== null) {\n toReturn['requiredAppSummaries'] = 'toApiJson' in this.requiredAppSummaries ? this.requiredAppSummaries.toApiJson() : this.requiredAppSummaries;\n }\n if (typeof this.nextCursor !== 'undefined') {\n toReturn['nextCursor'] = this.nextCursor;\n }\n if (typeof this.hasMore !== 'undefined') {\n toReturn['hasMore'] = this.hasMore;\n }\n return toReturn;\n }\n}\nclass ListVendorRequest {\n static fromProto(proto) {\n let m = new ListVendorRequest();\n m = Object.assign(m, proto);\n if (proto.pageSize) {\n m.pageSize = parseInt(proto.pageSize, 10);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.cursor !== 'undefined') {\n toReturn['cursor'] = this.cursor;\n }\n if (typeof this.pageSize !== 'undefined') {\n toReturn['pageSize'] = this.pageSize;\n }\n return toReturn;\n }\n}\nclass ListVendorResponse {\n static fromProto(proto) {\n let m = new ListVendorResponse();\n m = Object.assign(m, proto);\n if (proto.vendors) {\n m.vendors = proto.vendors.map(AppVendor.fromProto);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.vendors !== 'undefined' && this.vendors !== null) {\n toReturn['vendors'] = 'toApiJson' in this.vendors ? this.vendors.toApiJson() : this.vendors;\n }\n if (typeof this.cursor !== 'undefined') {\n toReturn['cursor'] = this.cursor;\n }\n if (typeof this.hasMore !== 'undefined') {\n toReturn['hasMore'] = this.hasMore;\n }\n return toReturn;\n }\n}\nclass GetMultiOrderFormsResponseOrderFormContainer {\n static fromProto(proto) {\n let m = new GetMultiOrderFormsResponseOrderFormContainer();\n m = Object.assign(m, proto);\n if (proto.orderForm) {\n m.orderForm = OrderForm.fromProto(proto.orderForm);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.appId !== 'undefined') {\n toReturn['appId'] = this.appId;\n }\n if (typeof this.orderForm !== 'undefined' && this.orderForm !== null) {\n toReturn['orderForm'] = 'toApiJson' in this.orderForm ? this.orderForm.toApiJson() : this.orderForm;\n }\n return toReturn;\n }\n}\nclass PagedAppResponse {\n static fromProto(proto) {\n let m = new PagedAppResponse();\n m = Object.assign(m, proto);\n if (proto.apps) {\n m.apps = proto.apps.map(MarketplaceApp.fromProto);\n }\n if (proto.pageSize) {\n m.pageSize = parseInt(proto.pageSize, 10);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.apps !== 'undefined' && this.apps !== null) {\n toReturn['apps'] = 'toApiJson' in this.apps ? this.apps.toApiJson() : this.apps;\n }\n if (typeof this.cursor !== 'undefined') {\n toReturn['cursor'] = this.cursor;\n }\n if (typeof this.pageSize !== 'undefined') {\n toReturn['pageSize'] = this.pageSize;\n }\n if (typeof this.hasMore !== 'undefined') {\n toReturn['hasMore'] = this.hasMore;\n }\n return toReturn;\n }\n}\nclass GetMultiProductCostResponseProductCostEntry {\n static fromProto(proto) {\n let m = new GetMultiProductCostResponseProductCostEntry();\n m = Object.assign(m, proto);\n if (proto.value) {\n m.value = ProductCost.fromProto(proto.value);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.key !== 'undefined') {\n toReturn['key'] = this.key;\n }\n if (typeof this.value !== 'undefined' && this.value !== null) {\n toReturn['value'] = 'toApiJson' in this.value ? this.value.toApiJson() : this.value;\n }\n return toReturn;\n }\n}\nclass PublishAppRequest {\n static fromProto(proto) {\n let m = new PublishAppRequest();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.appId !== 'undefined') {\n toReturn['appId'] = this.appId;\n }\n return toReturn;\n }\n}\nclass RemoveAppIDRequest {\n static fromProto(proto) {\n let m = new RemoveAppIDRequest();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.id !== 'undefined') {\n toReturn['id'] = this.id;\n }\n if (typeof this.appId !== 'undefined') {\n toReturn['appId'] = this.appId;\n }\n return toReturn;\n }\n}\nclass RemoveAppIDResponse {\n static fromProto(proto) {\n let m = new RemoveAppIDResponse();\n m = Object.assign(m, proto);\n if (proto.vendor) {\n m.vendor = AppVendor.fromProto(proto.vendor);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.vendor !== 'undefined' && this.vendor !== null) {\n toReturn['vendor'] = 'toApiJson' in this.vendor ? this.vendor.toApiJson() : this.vendor;\n }\n return toReturn;\n }\n}\nclass RequestAppReviewRequest {\n static fromProto(proto) {\n let m = new RequestAppReviewRequest();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.appId !== 'undefined') {\n toReturn['appId'] = this.appId;\n }\n return toReturn;\n }\n}\nclass RequiredAppSummary {\n static fromProto(proto) {\n let m = new RequiredAppSummary();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.appId !== 'undefined') {\n toReturn['appId'] = this.appId;\n }\n if (typeof this.name !== 'undefined') {\n toReturn['name'] = this.name;\n }\n if (typeof this.iconUrl !== 'undefined') {\n toReturn['iconUrl'] = this.iconUrl;\n }\n return toReturn;\n }\n}\nclass RestoreAppRequest {\n static fromProto(proto) {\n let m = new RestoreAppRequest();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.appId !== 'undefined') {\n toReturn['appId'] = this.appId;\n }\n return toReturn;\n }\n}\nclass CanActivateResponseSuccessResponse {\n static fromProto(proto) {\n let m = new CanActivateResponseSuccessResponse();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n return toReturn;\n }\n}\nclass SuspendAppRequest {\n static fromProto(proto) {\n let m = new SuspendAppRequest();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.appId !== 'undefined') {\n toReturn['appId'] = this.appId;\n }\n return toReturn;\n }\n}\nclass UnapproveAddonRequest {\n static fromProto(proto) {\n let m = new UnapproveAddonRequest();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.appId !== 'undefined') {\n toReturn['appId'] = this.appId;\n }\n if (typeof this.addonId !== 'undefined') {\n toReturn['addonId'] = this.addonId;\n }\n return toReturn;\n }\n}\nclass UnapproveAppRequest {\n static fromProto(proto) {\n let m = new UnapproveAppRequest();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.appId !== 'undefined') {\n toReturn['appId'] = this.appId;\n }\n return toReturn;\n }\n}\nclass UnsuspendAppRequest {\n static fromProto(proto) {\n let m = new UnsuspendAppRequest();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.appId !== 'undefined') {\n toReturn['appId'] = this.appId;\n }\n return toReturn;\n }\n}\nclass UpdateAppApprovalAndBillingSettingsRequest {\n static fromProto(proto) {\n let m = new UpdateAppApprovalAndBillingSettingsRequest();\n m = Object.assign(m, proto);\n if (proto.approvalProcess) {\n m.approvalProcess = enumStringToValue$2(ApprovalProcess, proto.approvalProcess);\n }\n if (proto.billingProcess) {\n m.billingProcess = enumStringToValue$2(BillingProcess, proto.billingProcess);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.appId !== 'undefined') {\n toReturn['appId'] = this.appId;\n }\n if (typeof this.approvalProcess !== 'undefined') {\n toReturn['approvalProcess'] = this.approvalProcess;\n }\n if (typeof this.billingProcess !== 'undefined') {\n toReturn['billingProcess'] = this.billingProcess;\n }\n return toReturn;\n }\n}\nclass UpdateAppCategoriesRequest {\n static fromProto(proto) {\n let m = new UpdateAppCategoriesRequest();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.appId !== 'undefined') {\n toReturn['appId'] = this.appId;\n }\n if (typeof this.categoryIds !== 'undefined') {\n toReturn['categoryIds'] = this.categoryIds;\n }\n return toReturn;\n }\n}\nclass UpdateAppFulfillmentIntegrationRequest {\n static fromProto(proto) {\n let m = new UpdateAppFulfillmentIntegrationRequest();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.appId !== 'undefined') {\n toReturn['appId'] = this.appId;\n }\n if (typeof this.usesFulfillmentIntegration !== 'undefined') {\n toReturn['usesFulfillmentIntegration'] = this.usesFulfillmentIntegration;\n }\n return toReturn;\n }\n}\nclass UpdateAppGeneralInformationRequest {\n static fromProto(proto) {\n let m = new UpdateAppGeneralInformationRequest();\n m = Object.assign(m, proto);\n if (proto.lmiCategories) {\n m.lmiCategories = proto.lmiCategories.map(v => enumStringToValue$2(MarketplaceAppLmiLmiCategories, v));\n }\n if (proto.price) {\n m.price = parseInt(proto.price, 10);\n }\n if (proto.restrictions) {\n m.restrictions = Restrictions.fromProto(proto.restrictions);\n }\n if (proto.fieldMask) {\n m.fieldMask = FieldMask.fromProto(proto.fieldMask);\n }\n if (proto.suggestedRetailPrice) {\n m.suggestedRetailPrice = parseInt(proto.suggestedRetailPrice, 10);\n }\n if (proto.country) {\n m.country = PermissionLists.fromProto(proto.country);\n }\n if (proto.commitment) {\n m.commitment = Commitment.fromProto(proto.commitment);\n }\n if (proto.state) {\n m.state = enumStringToValue$2(State, proto.state);\n }\n if (proto.cost) {\n m.cost = Cost.fromProto(proto.cost);\n }\n if (proto.setupFee) {\n m.setupFee = parseInt(proto.setupFee, 10);\n }\n if (proto.suggestedRetailSetupFee) {\n m.suggestedRetailSetupFee = parseInt(proto.suggestedRetailSetupFee, 10);\n }\n if (proto.deliveryMethod) {\n m.deliveryMethod = enumStringToValue$2(DeliveryMethod, proto.deliveryMethod);\n }\n if (proto.fees) {\n m.fees = proto.fees.map(Fee.fromProto);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.appId !== 'undefined') {\n toReturn['appId'] = this.appId;\n }\n if (typeof this.name !== 'undefined') {\n toReturn['name'] = this.name;\n }\n if (typeof this.vendor !== 'undefined') {\n toReturn['vendor'] = this.vendor;\n }\n if (typeof this.tagline !== 'undefined') {\n toReturn['tagline'] = this.tagline;\n }\n if (typeof this.serviceModel !== 'undefined') {\n toReturn['serviceModel'] = this.serviceModel;\n }\n if (typeof this.lmiCategories !== 'undefined') {\n toReturn['lmiCategories'] = this.lmiCategories;\n }\n if (typeof this.icon !== 'undefined') {\n toReturn['icon'] = this.icon;\n }\n if (typeof this.headerImage !== 'undefined') {\n toReturn['headerImage'] = this.headerImage;\n }\n if (typeof this.screenshot !== 'undefined') {\n toReturn['screenshot'] = this.screenshot;\n }\n if (typeof this.price !== 'undefined') {\n toReturn['price'] = this.price;\n }\n if (typeof this.currency !== 'undefined') {\n toReturn['currency'] = this.currency;\n }\n if (typeof this.billingFrequency !== 'undefined') {\n toReturn['billingFrequency'] = this.billingFrequency;\n }\n if (typeof this.restrictions !== 'undefined' && this.restrictions !== null) {\n toReturn['restrictions'] = 'toApiJson' in this.restrictions ? this.restrictions.toApiJson() : this.restrictions;\n }\n if (typeof this.allowPriceNegotiation !== 'undefined') {\n toReturn['allowPriceNegotiation'] = this.allowPriceNegotiation;\n }\n if (typeof this.gdprCompliant !== 'undefined') {\n toReturn['gdprCompliant'] = this.gdprCompliant;\n }\n if (typeof this.fieldMask !== 'undefined' && this.fieldMask !== null) {\n toReturn['fieldMask'] = 'toApiJson' in this.fieldMask ? this.fieldMask.toApiJson() : this.fieldMask;\n }\n if (typeof this.preventPriceConversionBetweenCurrencies !== 'undefined') {\n toReturn['preventPriceConversionBetweenCurrencies'] = this.preventPriceConversionBetweenCurrencies;\n }\n if (typeof this.suggestedRetailPrice !== 'undefined') {\n toReturn['suggestedRetailPrice'] = this.suggestedRetailPrice;\n }\n if (typeof this.country !== 'undefined' && this.country !== null) {\n toReturn['country'] = 'toApiJson' in this.country ? this.country.toApiJson() : this.country;\n }\n if (typeof this.commitment !== 'undefined' && this.commitment !== null) {\n toReturn['commitment'] = 'toApiJson' in this.commitment ? this.commitment.toApiJson() : this.commitment;\n }\n if (typeof this.multipleActivations !== 'undefined') {\n toReturn['multipleActivations'] = this.multipleActivations;\n }\n if (typeof this.usesEditions !== 'undefined') {\n toReturn['usesEditions'] = this.usesEditions;\n }\n if (typeof this.discoverable !== 'undefined') {\n toReturn['discoverable'] = this.discoverable;\n }\n if (typeof this.editionIds !== 'undefined') {\n toReturn['editionIds'] = this.editionIds;\n }\n if (typeof this.state !== 'undefined') {\n toReturn['state'] = this.state;\n }\n if (typeof this.cost !== 'undefined' && this.cost !== null) {\n toReturn['cost'] = 'toApiJson' in this.cost ? this.cost.toApiJson() : this.cost;\n }\n if (typeof this.setupFee !== 'undefined') {\n toReturn['setupFee'] = this.setupFee;\n }\n if (typeof this.suggestedRetailSetupFee !== 'undefined') {\n toReturn['suggestedRetailSetupFee'] = this.suggestedRetailSetupFee;\n }\n if (typeof this.usesCustomPricing !== 'undefined') {\n toReturn['usesCustomPricing'] = this.usesCustomPricing;\n }\n if (typeof this.deliveryMethod !== 'undefined') {\n toReturn['deliveryMethod'] = this.deliveryMethod;\n }\n if (typeof this.categories !== 'undefined') {\n toReturn['categories'] = this.categories;\n }\n if (typeof this.fees !== 'undefined' && this.fees !== null) {\n toReturn['fees'] = 'toApiJson' in this.fees ? this.fees.toApiJson() : this.fees;\n }\n return toReturn;\n }\n}\nclass UpdateAppIntegrationRequest {\n static fromProto(proto) {\n let m = new UpdateAppIntegrationRequest();\n m = Object.assign(m, proto);\n if (proto.partnerContactRecipients) {\n m.partnerContactRecipients = proto.partnerContactRecipients.map(Contact.fromProto);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.appId !== 'undefined') {\n toReturn['appId'] = this.appId;\n }\n if (typeof this.publicKey !== 'undefined') {\n toReturn['publicKey'] = this.publicKey;\n }\n if (typeof this.reserveIdUrl !== 'undefined') {\n toReturn['reserveIdUrl'] = this.reserveIdUrl;\n }\n if (typeof this.purchaseWebhookUrl !== 'undefined') {\n toReturn['purchaseWebhookUrl'] = this.purchaseWebhookUrl;\n }\n if (typeof this.activationRequiresApproval !== 'undefined') {\n toReturn['activationRequiresApproval'] = this.activationRequiresApproval;\n }\n if (typeof this.addonPurchaseWebhookUrl !== 'undefined') {\n toReturn['addonPurchaseWebhookUrl'] = this.addonPurchaseWebhookUrl;\n }\n if (typeof this.userModWebhookUrl !== 'undefined') {\n toReturn['userModWebhookUrl'] = this.userModWebhookUrl;\n }\n if (typeof this.accountModWebhookUrl !== 'undefined') {\n toReturn['accountModWebhookUrl'] = this.accountModWebhookUrl;\n }\n if (typeof this.contactWebhookUrl !== 'undefined') {\n toReturn['contactWebhookUrl'] = this.contactWebhookUrl;\n }\n if (typeof this.fulfillmentEmail !== 'undefined') {\n toReturn['fulfillmentEmail'] = this.fulfillmentEmail;\n }\n if (typeof this.partnerSettingsWebhookUrl !== 'undefined') {\n toReturn['partnerSettingsWebhookUrl'] = this.partnerSettingsWebhookUrl;\n }\n if (typeof this.partnerContactRecipients !== 'undefined' && this.partnerContactRecipients !== null) {\n toReturn['partnerContactRecipients'] = 'toApiJson' in this.partnerContactRecipients ? this.partnerContactRecipients.toApiJson() : this.partnerContactRecipients;\n }\n if (typeof this.usesIntegration !== 'undefined') {\n toReturn['usesIntegration'] = this.usesIntegration;\n }\n if (typeof this.orderFormValidatorWebhookUrl !== 'undefined') {\n toReturn['orderFormValidatorWebhookUrl'] = this.orderFormValidatorWebhookUrl;\n }\n if (typeof this.allowWhiteLabeling !== 'undefined') {\n toReturn['allowWhiteLabeling'] = this.allowWhiteLabeling;\n }\n if (typeof this.customerWebhookUrl !== 'undefined') {\n toReturn['customerWebhookUrl'] = this.customerWebhookUrl;\n }\n if (typeof this.sendCancelationNotifications !== 'undefined') {\n toReturn['sendCancelationNotifications'] = this.sendCancelationNotifications;\n }\n if (typeof this.cancellationWebhookUrl !== 'undefined') {\n toReturn['cancellationWebhookUrl'] = this.cancellationWebhookUrl;\n }\n if (typeof this.serviceChangeWebhookUrl !== 'undefined') {\n toReturn['serviceChangeWebhookUrl'] = this.serviceChangeWebhookUrl;\n }\n if (typeof this.appLevelHasAdminDashboard !== 'undefined') {\n toReturn['appLevelHasAdminDashboard'] = this.appLevelHasAdminDashboard;\n }\n return toReturn;\n }\n}\nclass UpdateAppMarketingInformationRequest {\n static fromProto(proto) {\n let m = new UpdateAppMarketingInformationRequest();\n m = Object.assign(m, proto);\n if (proto.marketingInfo) {\n m.marketingInfo = MarketingInformation.fromProto(proto.marketingInfo);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.appId !== 'undefined') {\n toReturn['appId'] = this.appId;\n }\n if (typeof this.marketingInfo !== 'undefined' && this.marketingInfo !== null) {\n toReturn['marketingInfo'] = 'toApiJson' in this.marketingInfo ? this.marketingInfo.toApiJson() : this.marketingInfo;\n }\n if (typeof this.usesMarketingInformation !== 'undefined') {\n toReturn['usesMarketingInformation'] = this.usesMarketingInformation;\n }\n return toReturn;\n }\n}\nclass UpdateAppOrderFormRequest {\n static fromProto(proto) {\n let m = new UpdateAppOrderFormRequest();\n m = Object.assign(m, proto);\n if (proto.orderForm) {\n m.orderForm = OrderForm.fromProto(proto.orderForm);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.appId !== 'undefined') {\n toReturn['appId'] = this.appId;\n }\n if (typeof this.usesOrderForm !== 'undefined') {\n toReturn['usesOrderForm'] = this.usesOrderForm;\n }\n if (typeof this.orderForm !== 'undefined' && this.orderForm !== null) {\n toReturn['orderForm'] = 'toApiJson' in this.orderForm ? this.orderForm.toApiJson() : this.orderForm;\n }\n if (typeof this.usesActivationSpecificEntryUrl !== 'undefined') {\n toReturn['usesActivationSpecificEntryUrl'] = this.usesActivationSpecificEntryUrl;\n }\n if (typeof this.applicationUrl !== 'undefined') {\n toReturn['applicationUrl'] = this.applicationUrl;\n }\n return toReturn;\n }\n}\nclass UpdateAppSSOIntegrationRequest {\n static fromProto(proto) {\n let m = new UpdateAppSSOIntegrationRequest();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.appId !== 'undefined') {\n toReturn['appId'] = this.appId;\n }\n if (typeof this.entryUrl !== 'undefined') {\n toReturn['entryUrl'] = this.entryUrl;\n }\n if (typeof this.sessionUrl !== 'undefined') {\n toReturn['sessionUrl'] = this.sessionUrl;\n }\n if (typeof this.logoutUrl !== 'undefined') {\n toReturn['logoutUrl'] = this.logoutUrl;\n }\n if (typeof this.usesSsoIntegration !== 'undefined') {\n toReturn['usesSsoIntegration'] = this.usesSsoIntegration;\n }\n return toReturn;\n }\n}\nclass UpdateAppTrialConfigurationRequest {\n static fromProto(proto) {\n let m = new UpdateAppTrialConfigurationRequest();\n m = Object.assign(m, proto);\n if (proto.endOfTrialAction) {\n m.endOfTrialAction = enumStringToValue$2(EndOfTrialActions, proto.endOfTrialAction);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.appId !== 'undefined') {\n toReturn['appId'] = this.appId;\n }\n if (typeof this.trialsEnabled !== 'undefined') {\n toReturn['trialsEnabled'] = this.trialsEnabled;\n }\n if (typeof this.duration !== 'undefined') {\n toReturn['duration'] = this.duration;\n }\n if (typeof this.endOfTrialAction !== 'undefined') {\n toReturn['endOfTrialAction'] = this.endOfTrialAction;\n }\n return toReturn;\n }\n}\nclass UpdateVendorRequest {\n static fromProto(proto) {\n let m = new UpdateVendorRequest();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.id !== 'undefined') {\n toReturn['id'] = this.id;\n }\n if (typeof this.name !== 'undefined') {\n toReturn['name'] = this.name;\n }\n if (typeof this.partnerId !== 'undefined') {\n toReturn['partnerId'] = this.partnerId;\n }\n if (typeof this.reportingCode !== 'undefined') {\n toReturn['reportingCode'] = this.reportingCode;\n }\n return toReturn;\n }\n}\nclass UpdateVendorResponse {\n static fromProto(proto) {\n let m = new UpdateVendorResponse();\n m = Object.assign(m, proto);\n if (proto.vendor) {\n m.vendor = AppVendor.fromProto(proto.vendor);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.vendor !== 'undefined' && this.vendor !== null) {\n toReturn['vendor'] = 'toApiJson' in this.vendor ? this.vendor.toApiJson() : this.vendor;\n }\n return toReturn;\n }\n}\nfunction enumStringToValue$1(enumRef, value) {\n if (typeof value === 'number') {\n return value;\n }\n return enumRef[value];\n}\nclass AppEditionsMarketing {\n static fromProto(proto) {\n let m = new AppEditionsMarketing();\n m = Object.assign(m, proto);\n if (proto.resellerMarketing) {\n m.resellerMarketing = EditionMarketingInformation.fromProto(proto.resellerMarketing);\n }\n if (proto.endUserMarketing) {\n m.endUserMarketing = EditionMarketingInformation.fromProto(proto.endUserMarketing);\n }\n if (proto.releaseType) {\n m.releaseType = enumStringToValue$1(Release, proto.releaseType);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.appId !== 'undefined') {\n toReturn['appId'] = this.appId;\n }\n if (typeof this.editionId !== 'undefined') {\n toReturn['editionId'] = this.editionId;\n }\n if (typeof this.name !== 'undefined') {\n toReturn['name'] = this.name;\n }\n if (typeof this.billingId !== 'undefined') {\n toReturn['billingId'] = this.billingId;\n }\n if (typeof this.usesResellerMarketing !== 'undefined') {\n toReturn['usesResellerMarketing'] = this.usesResellerMarketing;\n }\n if (typeof this.resellerMarketing !== 'undefined' && this.resellerMarketing !== null) {\n toReturn['resellerMarketing'] = 'toApiJson' in this.resellerMarketing ? this.resellerMarketing.toApiJson() : this.resellerMarketing;\n }\n if (typeof this.endUserMarketing !== 'undefined' && this.endUserMarketing !== null) {\n toReturn['endUserMarketing'] = 'toApiJson' in this.endUserMarketing ? this.endUserMarketing.toApiJson() : this.endUserMarketing;\n }\n if (typeof this.releaseType !== 'undefined') {\n toReturn['releaseType'] = this.releaseType;\n }\n return toReturn;\n }\n}\nclass Edition {\n static fromProto(proto) {\n let m = new Edition();\n m = Object.assign(m, proto);\n if (proto.created) {\n m.created = new Date(proto.created);\n }\n if (proto.updated) {\n m.updated = new Date(proto.updated);\n }\n if (proto.pricing) {\n m.pricing = EditionPricing.fromProto(proto.pricing);\n }\n if (proto.release) {\n m.release = enumStringToValue$1(Release, proto.release);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.appId !== 'undefined') {\n toReturn['appId'] = this.appId;\n }\n if (typeof this.editionId !== 'undefined') {\n toReturn['editionId'] = this.editionId;\n }\n if (typeof this.name !== 'undefined') {\n toReturn['name'] = this.name;\n }\n if (typeof this.created !== 'undefined' && this.created !== null) {\n toReturn['created'] = 'toApiJson' in this.created ? this.created.toApiJson() : this.created;\n }\n if (typeof this.updated !== 'undefined' && this.updated !== null) {\n toReturn['updated'] = 'toApiJson' in this.updated ? this.updated.toApiJson() : this.updated;\n }\n if (typeof this.billingId !== 'undefined') {\n toReturn['billingId'] = this.billingId;\n }\n if (typeof this.pricing !== 'undefined' && this.pricing !== null) {\n toReturn['pricing'] = 'toApiJson' in this.pricing ? this.pricing.toApiJson() : this.pricing;\n }\n if (typeof this.currency !== 'undefined') {\n toReturn['currency'] = this.currency;\n }\n if (typeof this.billingFrequency !== 'undefined') {\n toReturn['billingFrequency'] = this.billingFrequency;\n }\n if (typeof this.release !== 'undefined') {\n toReturn['release'] = this.release;\n }\n return toReturn;\n }\n}\nclass EditionMarketingInformation {\n static fromProto(proto) {\n let m = new EditionMarketingInformation();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.description !== 'undefined') {\n toReturn['description'] = this.description;\n }\n if (typeof this.keySellingPoints !== 'undefined') {\n toReturn['keySellingPoints'] = this.keySellingPoints;\n }\n return toReturn;\n }\n}\nclass EditionPricing {\n static fromProto(proto) {\n let m = new EditionPricing();\n m = Object.assign(m, proto);\n if (proto.wholesalePrice) {\n m.wholesalePrice = parseInt(proto.wholesalePrice, 10);\n }\n if (proto.suggestedRetailPrice) {\n m.suggestedRetailPrice = parseInt(proto.suggestedRetailPrice, 10);\n }\n if (proto.billingFrequency) {\n m.billingFrequency = enumStringToValue$1(EditionBillingFrequency, proto.billingFrequency);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.wholesalePrice !== 'undefined') {\n toReturn['wholesalePrice'] = this.wholesalePrice;\n }\n if (typeof this.suggestedRetailPrice !== 'undefined') {\n toReturn['suggestedRetailPrice'] = this.suggestedRetailPrice;\n }\n if (typeof this.billingFrequency !== 'undefined') {\n toReturn['billingFrequency'] = this.billingFrequency;\n }\n return toReturn;\n }\n}\nfunction enumStringToValue(enumRef, value) {\n if (typeof value === 'number') {\n return value;\n }\n return enumRef[value];\n}\nclass ListByMultiAppResponseAppEditions {\n static fromProto(proto) {\n let m = new ListByMultiAppResponseAppEditions();\n m = Object.assign(m, proto);\n if (proto.editions) {\n m.editions = proto.editions.map(Edition.fromProto);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.appId !== 'undefined') {\n toReturn['appId'] = this.appId;\n }\n if (typeof this.editions !== 'undefined' && this.editions !== null) {\n toReturn['editions'] = 'toApiJson' in this.editions ? this.editions.toApiJson() : this.editions;\n }\n return toReturn;\n }\n}\nclass CreateEditionRequest {\n static fromProto(proto) {\n let m = new CreateEditionRequest();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.appId !== 'undefined') {\n toReturn['appId'] = this.appId;\n }\n if (typeof this.name !== 'undefined') {\n toReturn['name'] = this.name;\n }\n return toReturn;\n }\n}\nclass CreateEditionResponse {\n static fromProto(proto) {\n let m = new CreateEditionResponse();\n m = Object.assign(m, proto);\n if (proto.edition) {\n m.edition = Edition.fromProto(proto.edition);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.edition !== 'undefined' && this.edition !== null) {\n toReturn['edition'] = 'toApiJson' in this.edition ? this.edition.toApiJson() : this.edition;\n }\n return toReturn;\n }\n}\nclass DeleteEditionRequest {\n static fromProto(proto) {\n let m = new DeleteEditionRequest();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.appId !== 'undefined') {\n toReturn['appId'] = this.appId;\n }\n if (typeof this.editionId !== 'undefined') {\n toReturn['editionId'] = this.editionId;\n }\n return toReturn;\n }\n}\nclass UpdateMultiEditionRequestEditionData {\n static fromProto(proto) {\n let m = new UpdateMultiEditionRequestEditionData();\n m = Object.assign(m, proto);\n if (proto.pricing) {\n m.pricing = EditionPricing.fromProto(proto.pricing);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.editionId !== 'undefined') {\n toReturn['editionId'] = this.editionId;\n }\n if (typeof this.name !== 'undefined') {\n toReturn['name'] = this.name;\n }\n if (typeof this.pricing !== 'undefined' && this.pricing !== null) {\n toReturn['pricing'] = 'toApiJson' in this.pricing ? this.pricing.toApiJson() : this.pricing;\n }\n return toReturn;\n }\n}\nclass GetBillingIDRequest {\n static fromProto(proto) {\n let m = new GetBillingIDRequest();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.appId !== 'undefined') {\n toReturn['appId'] = this.appId;\n }\n if (typeof this.editionId !== 'undefined') {\n toReturn['editionId'] = this.editionId;\n }\n return toReturn;\n }\n}\nclass GetBillingIDResponse {\n static fromProto(proto) {\n let m = new GetBillingIDResponse();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.appId !== 'undefined') {\n toReturn['appId'] = this.appId;\n }\n if (typeof this.editionId !== 'undefined') {\n toReturn['editionId'] = this.editionId;\n }\n if (typeof this.billingId !== 'undefined') {\n toReturn['billingId'] = this.billingId;\n }\n return toReturn;\n }\n}\nclass GetEditionRequest {\n static fromProto(proto) {\n let m = new GetEditionRequest();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.appId !== 'undefined') {\n toReturn['appId'] = this.appId;\n }\n if (typeof this.editionId !== 'undefined') {\n toReturn['editionId'] = this.editionId;\n }\n return toReturn;\n }\n}\nclass GetEditionResponse {\n static fromProto(proto) {\n let m = new GetEditionResponse();\n m = Object.assign(m, proto);\n if (proto.edition) {\n m.edition = Edition.fromProto(proto.edition);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.edition !== 'undefined' && this.edition !== null) {\n toReturn['edition'] = 'toApiJson' in this.edition ? this.edition.toApiJson() : this.edition;\n }\n return toReturn;\n }\n}\nclass GetMultiDraftEditionRequest {\n static fromProto(proto) {\n let m = new GetMultiDraftEditionRequest();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.appId !== 'undefined') {\n toReturn['appId'] = this.appId;\n }\n if (typeof this.editionIds !== 'undefined') {\n toReturn['editionIds'] = this.editionIds;\n }\n return toReturn;\n }\n}\nclass GetMultiDraftEditionResponse {\n static fromProto(proto) {\n let m = new GetMultiDraftEditionResponse();\n m = Object.assign(m, proto);\n if (proto.editions) {\n m.editions = proto.editions.map(Edition.fromProto);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.editions !== 'undefined' && this.editions !== null) {\n toReturn['editions'] = 'toApiJson' in this.editions ? this.editions.toApiJson() : this.editions;\n }\n return toReturn;\n }\n}\nclass GetMultiEditionForMultiAppRequest {\n static fromProto(proto) {\n let m = new GetMultiEditionForMultiAppRequest();\n m = Object.assign(m, proto);\n if (proto.appEditionIdPairs) {\n m.appEditionIdPairs = proto.appEditionIdPairs.map(GetEditionRequest.fromProto);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.appEditionIdPairs !== 'undefined' && this.appEditionIdPairs !== null) {\n toReturn['appEditionIdPairs'] = 'toApiJson' in this.appEditionIdPairs ? this.appEditionIdPairs.toApiJson() : this.appEditionIdPairs;\n }\n return toReturn;\n }\n}\nclass GetMultiEditionRequest {\n static fromProto(proto) {\n let m = new GetMultiEditionRequest();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.appId !== 'undefined') {\n toReturn['appId'] = this.appId;\n }\n if (typeof this.editionIds !== 'undefined') {\n toReturn['editionIds'] = this.editionIds;\n }\n return toReturn;\n }\n}\nclass GetMultiEditionResponse {\n static fromProto(proto) {\n let m = new GetMultiEditionResponse();\n m = Object.assign(m, proto);\n if (proto.editions) {\n m.editions = proto.editions.map(Edition.fromProto);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.editions !== 'undefined' && this.editions !== null) {\n toReturn['editions'] = 'toApiJson' in this.editions ? this.editions.toApiJson() : this.editions;\n }\n return toReturn;\n }\n}\nclass ListByMultiAppRequest {\n static fromProto(proto) {\n let m = new ListByMultiAppRequest();\n m = Object.assign(m, proto);\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.appIds !== 'undefined') {\n toReturn['appIds'] = this.appIds;\n }\n return toReturn;\n }\n}\nclass ListByMultiAppResponse {\n static fromProto(proto) {\n let m = new ListByMultiAppResponse();\n m = Object.assign(m, proto);\n if (proto.appEditions) {\n m.appEditions = proto.appEditions.map(ListByMultiAppResponseAppEditions.fromProto);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.appEditions !== 'undefined' && this.appEditions !== null) {\n toReturn['appEditions'] = 'toApiJson' in this.appEditions ? this.appEditions.toApiJson() : this.appEditions;\n }\n return toReturn;\n }\n}\nclass ListDraftEditionsForAppRequest {\n static fromProto(proto) {\n let m = new ListDraftEditionsForAppRequest();\n m = Object.assign(m, proto);\n if (proto.pageSize) {\n m.pageSize = parseInt(proto.pageSize, 10);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.appId !== 'undefined') {\n toReturn['appId'] = this.appId;\n }\n if (typeof this.cursor !== 'undefined') {\n toReturn['cursor'] = this.cursor;\n }\n if (typeof this.pageSize !== 'undefined') {\n toReturn['pageSize'] = this.pageSize;\n }\n return toReturn;\n }\n}\nclass ListDraftEditionsForAppResponse {\n static fromProto(proto) {\n let m = new ListDraftEditionsForAppResponse();\n m = Object.assign(m, proto);\n if (proto.editions) {\n m.editions = proto.editions.map(Edition.fromProto);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.editions !== 'undefined' && this.editions !== null) {\n toReturn['editions'] = 'toApiJson' in this.editions ? this.editions.toApiJson() : this.editions;\n }\n if (typeof this.cursor !== 'undefined') {\n toReturn['cursor'] = this.cursor;\n }\n if (typeof this.hasMore !== 'undefined') {\n toReturn['hasMore'] = this.hasMore;\n }\n return toReturn;\n }\n}\nclass ListEditionsForAppRequest {\n static fromProto(proto) {\n let m = new ListEditionsForAppRequest();\n m = Object.assign(m, proto);\n if (proto.pageSize) {\n m.pageSize = parseInt(proto.pageSize, 10);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.appId !== 'undefined') {\n toReturn['appId'] = this.appId;\n }\n if (typeof this.cursor !== 'undefined') {\n toReturn['cursor'] = this.cursor;\n }\n if (typeof this.pageSize !== 'undefined') {\n toReturn['pageSize'] = this.pageSize;\n }\n return toReturn;\n }\n}\nclass ListEditionsForAppResponse {\n static fromProto(proto) {\n let m = new ListEditionsForAppResponse();\n m = Object.assign(m, proto);\n if (proto.editions) {\n m.editions = proto.editions.map(Edition.fromProto);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.editions !== 'undefined' && this.editions !== null) {\n toReturn['editions'] = 'toApiJson' in this.editions ? this.editions.toApiJson() : this.editions;\n }\n if (typeof this.cursor !== 'undefined') {\n toReturn['cursor'] = this.cursor;\n }\n if (typeof this.hasMore !== 'undefined') {\n toReturn['hasMore'] = this.hasMore;\n }\n return toReturn;\n }\n}\nclass ListEditionsMarketingForAppRequest {\n static fromProto(proto) {\n let m = new ListEditionsMarketingForAppRequest();\n m = Object.assign(m, proto);\n if (proto.pageSize) {\n m.pageSize = parseInt(proto.pageSize, 10);\n }\n if (proto.releaseType) {\n m.releaseType = enumStringToValue(Release, proto.releaseType);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.appId !== 'undefined') {\n toReturn['appId'] = this.appId;\n }\n if (typeof this.cursor !== 'undefined') {\n toReturn['cursor'] = this.cursor;\n }\n if (typeof this.pageSize !== 'undefined') {\n toReturn['pageSize'] = this.pageSize;\n }\n if (typeof this.releaseType !== 'undefined') {\n toReturn['releaseType'] = this.releaseType;\n }\n return toReturn;\n }\n}\nclass ListEditionsMarketingForAppResponse {\n static fromProto(proto) {\n let m = new ListEditionsMarketingForAppResponse();\n m = Object.assign(m, proto);\n if (proto.appEditionsMarketing) {\n m.appEditionsMarketing = proto.appEditionsMarketing.map(AppEditionsMarketing.fromProto);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.appEditionsMarketing !== 'undefined' && this.appEditionsMarketing !== null) {\n toReturn['appEditionsMarketing'] = 'toApiJson' in this.appEditionsMarketing ? this.appEditionsMarketing.toApiJson() : this.appEditionsMarketing;\n }\n if (typeof this.cursor !== 'undefined') {\n toReturn['cursor'] = this.cursor;\n }\n if (typeof this.hasMore !== 'undefined') {\n toReturn['hasMore'] = this.hasMore;\n }\n return toReturn;\n }\n}\nclass UpdateEditionRequest {\n static fromProto(proto) {\n let m = new UpdateEditionRequest();\n m = Object.assign(m, proto);\n if (proto.pricing) {\n m.pricing = EditionPricing.fromProto(proto.pricing);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.appId !== 'undefined') {\n toReturn['appId'] = this.appId;\n }\n if (typeof this.editionId !== 'undefined') {\n toReturn['editionId'] = this.editionId;\n }\n if (typeof this.name !== 'undefined') {\n toReturn['name'] = this.name;\n }\n if (typeof this.pricing !== 'undefined' && this.pricing !== null) {\n toReturn['pricing'] = 'toApiJson' in this.pricing ? this.pricing.toApiJson() : this.pricing;\n }\n return toReturn;\n }\n}\nclass UpdateMultiEditionRequest {\n static fromProto(proto) {\n let m = new UpdateMultiEditionRequest();\n m = Object.assign(m, proto);\n if (proto.editions) {\n m.editions = proto.editions.map(UpdateMultiEditionRequestEditionData.fromProto);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.appId !== 'undefined') {\n toReturn['appId'] = this.appId;\n }\n if (typeof this.editions !== 'undefined' && this.editions !== null) {\n toReturn['editions'] = 'toApiJson' in this.editions ? this.editions.toApiJson() : this.editions;\n }\n return toReturn;\n }\n}\nclass UpsertEditionsMarketingRequest {\n static fromProto(proto) {\n let m = new UpsertEditionsMarketingRequest();\n m = Object.assign(m, proto);\n if (proto.resellerMarketing) {\n m.resellerMarketing = EditionMarketingInformation.fromProto(proto.resellerMarketing);\n }\n if (proto.endUserMarketing) {\n m.endUserMarketing = EditionMarketingInformation.fromProto(proto.endUserMarketing);\n }\n return m;\n }\n constructor(kwargs) {\n if (!kwargs) {\n return;\n }\n Object.assign(this, kwargs);\n }\n toApiJson() {\n const toReturn = {};\n if (typeof this.appId !== 'undefined') {\n toReturn['appId'] = this.appId;\n }\n if (typeof this.editionId !== 'undefined') {\n toReturn['editionId'] = this.editionId;\n }\n if (typeof this.usesResellerMarketing !== 'undefined') {\n toReturn['usesResellerMarketing'] = this.usesResellerMarketing;\n }\n if (typeof this.resellerMarketing !== 'undefined' && this.resellerMarketing !== null) {\n toReturn['resellerMarketing'] = 'toApiJson' in this.resellerMarketing ? this.resellerMarketing.toApiJson() : this.resellerMarketing;\n }\n if (typeof this.endUserMarketing !== 'undefined' && this.endUserMarketing !== null) {\n toReturn['endUserMarketing'] = 'toApiJson' in this.endUserMarketing ? this.endUserMarketing.toApiJson() : this.endUserMarketing;\n }\n return toReturn;\n }\n}\n\n// *********************************\n// Code generated by sdkgen\n// DO NOT EDIT!.\n//\n// Objects Index.\n// *********************************\n\nconst environment = (window ? window['environment'] : 'prod') ?? 'prod';\nconst hostMap = {\n 'local': '',\n 'test': '',\n 'demo': 'marketplace-apps-api-demo.apigateway.co',\n 'prod': 'marketplace-apps-api-prod.apigateway.co',\n 'production': 'marketplace-apps-api-prod.apigateway.co'\n};\nlet HostService = /*#__PURE__*/(() => {\n class HostService {\n get host() {\n return hostMap[environment.toLowerCase()];\n }\n get hostWithScheme() {\n return 'https://' + this.host;\n }\n }\n HostService.ɵfac = function HostService_Factory(t) {\n return new (t || HostService)();\n };\n HostService.ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({\n token: HostService,\n factory: HostService.ɵfac,\n providedIn: 'root'\n });\n return HostService;\n})();\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\n\n// *********************************\n// Code generated by sdkgen\n// DO NOT EDIT!.\n//\n// API Service.\n// *********************************\nlet EditionsApiService = /*#__PURE__*/(() => {\n class EditionsApiService {\n constructor(http, hostService) {\n this.http = http;\n this.hostService = hostService;\n this._host = this.hostService.hostWithScheme;\n }\n apiOptions() {\n return {\n headers: new HttpHeaders({\n 'Content-Type': 'application/json'\n }),\n withCredentials: true\n };\n }\n create(r) {\n const request = r.toApiJson ? r : new CreateEditionRequest(r);\n return this.http.post(this._host + \"/marketplaceapps.v1.Editions/Create\", request.toApiJson(), this.apiOptions()).pipe(map(resp => CreateEditionResponse.fromProto(resp)));\n }\n update(r) {\n const request = r.toApiJson ? r : new UpdateEditionRequest(r);\n return this.http.post(this._host + \"/marketplaceapps.v1.Editions/Update\", request.toApiJson(), {\n ...this.apiOptions(),\n observe: 'response'\n });\n }\n updateMulti(r) {\n const request = r.toApiJson ? r : new UpdateMultiEditionRequest(r);\n return this.http.post(this._host + \"/marketplaceapps.v1.Editions/UpdateMulti\", request.toApiJson(), {\n ...this.apiOptions(),\n observe: 'response'\n });\n }\n delete(r) {\n const request = r.toApiJson ? r : new DeleteEditionRequest(r);\n return this.http.post(this._host + \"/marketplaceapps.v1.Editions/Delete\", request.toApiJson(), {\n ...this.apiOptions(),\n observe: 'response'\n });\n }\n get(r) {\n const request = r.toApiJson ? r : new GetEditionRequest(r);\n return this.http.post(this._host + \"/marketplaceapps.v1.Editions/Get\", request.toApiJson(), this.apiOptions()).pipe(map(resp => GetEditionResponse.fromProto(resp)));\n }\n getMulti(r) {\n const request = r.toApiJson ? r : new GetMultiEditionRequest(r);\n return this.http.post(this._host + \"/marketplaceapps.v1.Editions/GetMulti\", request.toApiJson(), this.apiOptions()).pipe(map(resp => GetMultiEditionResponse.fromProto(resp)));\n }\n getMultiDraft(r) {\n const request = r.toApiJson ? r : new GetMultiDraftEditionRequest(r);\n return this.http.post(this._host + \"/marketplaceapps.v1.Editions/GetMultiDraft\", request.toApiJson(), this.apiOptions()).pipe(map(resp => GetMultiDraftEditionResponse.fromProto(resp)));\n }\n getBillingId(r) {\n const request = r.toApiJson ? r : new GetBillingIDRequest(r);\n return this.http.post(this._host + \"/marketplaceapps.v1.Editions/GetBillingID\", request.toApiJson(), this.apiOptions()).pipe(map(resp => GetBillingIDResponse.fromProto(resp)));\n }\n listEditionsForApp(r) {\n const request = r.toApiJson ? r : new ListEditionsForAppRequest(r);\n return this.http.post(this._host + \"/marketplaceapps.v1.Editions/ListEditionsForApp\", request.toApiJson(), this.apiOptions()).pipe(map(resp => ListEditionsForAppResponse.fromProto(resp)));\n }\n listDraftEditionsForApp(r) {\n const request = r.toApiJson ? r : new ListDraftEditionsForAppRequest(r);\n return this.http.post(this._host + \"/marketplaceapps.v1.Editions/ListDraftEditionsForApp\", request.toApiJson(), this.apiOptions()).pipe(map(resp => ListDraftEditionsForAppResponse.fromProto(resp)));\n }\n getMultiEditionForMultiApp(r) {\n const request = r.toApiJson ? r : new GetMultiEditionForMultiAppRequest(r);\n return this.http.post(this._host + \"/marketplaceapps.v1.Editions/GetMultiEditionForMultiApp\", request.toApiJson(), this.apiOptions()).pipe(map(resp => GetMultiEditionResponse.fromProto(resp)));\n }\n listByMultiApp(r) {\n const request = r.toApiJson ? r : new ListByMultiAppRequest(r);\n return this.http.post(this._host + \"/marketplaceapps.v1.Editions/ListByMultiApp\", request.toApiJson(), this.apiOptions()).pipe(map(resp => ListByMultiAppResponse.fromProto(resp)));\n }\n upsertEditionsMarketing(r) {\n const request = r.toApiJson ? r : new UpsertEditionsMarketingRequest(r);\n return this.http.post(this._host + \"/marketplaceapps.v1.Editions/UpsertEditionsMarketing\", request.toApiJson(), {\n ...this.apiOptions(),\n observe: 'response'\n });\n }\n listEditionsMarketingForApp(r) {\n const request = r.toApiJson ? r : new ListEditionsMarketingForAppRequest(r);\n return this.http.post(this._host + \"/marketplaceapps.v1.Editions/ListEditionsMarketingForApp\", request.toApiJson(), this.apiOptions()).pipe(map(resp => ListEditionsMarketingForAppResponse.fromProto(resp)));\n }\n }\n EditionsApiService.ɵfac = function EditionsApiService_Factory(t) {\n return new (t || EditionsApiService)(i0.ɵɵinject(i1.HttpClient), i0.ɵɵinject(HostService));\n };\n EditionsApiService.ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({\n token: EditionsApiService,\n factory: EditionsApiService.ɵfac,\n providedIn: 'root'\n });\n return EditionsApiService;\n})();\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\n\n// *********************************\n// Code generated by sdkgen\n// DO NOT EDIT!.\n//\n// API Service.\n// *********************************\nlet MarketplaceAppsApiService = /*#__PURE__*/(() => {\n class MarketplaceAppsApiService {\n constructor(http, hostService) {\n this.http = http;\n this.hostService = hostService;\n this._host = this.hostService.hostWithScheme;\n }\n apiOptions() {\n return {\n headers: new HttpHeaders({\n 'Content-Type': 'application/json'\n }),\n withCredentials: true\n };\n }\n listAddons(r) {\n const request = r.toApiJson ? r : new ListAddonsRequest(r);\n return this.http.post(this._host + \"/marketplaceapps.v1.MarketplaceApps/ListAddons\", request.toApiJson(), this.apiOptions()).pipe(map(resp => AddonsListResponse.fromProto(resp)));\n }\n getAddon(r) {\n const request = r.toApiJson ? r : new GetAddonRequest(r);\n return this.http.post(this._host + \"/marketplaceapps.v1.MarketplaceApps/GetAddon\", request.toApiJson(), this.apiOptions()).pipe(map(resp => AddonResponse.fromProto(resp)));\n }\n getPublicKeys(r) {\n const request = r.toApiJson ? r : new GetPublicKeysRequest(r);\n return this.http.post(this._host + \"/marketplaceapps.v1.MarketplaceApps/GetPublicKeys\", request.toApiJson(), this.apiOptions()).pipe(map(resp => GetPublicKeysResponse.fromProto(resp)));\n }\n getSsoUrls(r) {\n const request = r.toApiJson ? r : new GetSSOUrlsRequest(r);\n return this.http.post(this._host + \"/marketplaceapps.v1.MarketplaceApps/GetSSOUrls\", request.toApiJson(), this.apiOptions()).pipe(map(resp => GetSSOUrlsResponse.fromProto(resp)));\n }\n getApp(r) {\n const request = r.toApiJson ? r : new GetAppRequest(r);\n return this.http.post(this._host + \"/marketplaceapps.v1.MarketplaceApps/GetApp\", request.toApiJson(), this.apiOptions()).pipe(map(resp => GetAppResponse.fromProto(resp)));\n }\n getMultiApp(r) {\n const request = r.toApiJson ? r : new GetMultiAppRequest(r);\n return this.http.post(this._host + \"/marketplaceapps.v1.MarketplaceApps/GetMultiApp\", request.toApiJson(), this.apiOptions()).pipe(map(resp => GetMultiAppResponse.fromProto(resp)));\n }\n listApps(r) {\n const request = r.toApiJson ? r : new ListAppsRequest(r);\n return this.http.post(this._host + \"/marketplaceapps.v1.MarketplaceApps/ListApps\", request.toApiJson(), this.apiOptions()).pipe(map(resp => PagedAppResponse.fromProto(resp)));\n }\n listAppsForVendorIDs(r) {\n const request = r.toApiJson ? r : new ListAppsForVendorIDsRequest(r);\n return this.http.post(this._host + \"/marketplaceapps.v1.MarketplaceApps/ListAppsForVendorIDs\", request.toApiJson(), this.apiOptions()).pipe(map(resp => ListAppsForVendorIDsResponse.fromProto(resp)));\n }\n getAppDraft(r) {\n const request = r.toApiJson ? r : new GetAppRequest(r);\n return this.http.post(this._host + \"/marketplaceapps.v1.MarketplaceApps/GetAppDraft\", request.toApiJson(), this.apiOptions()).pipe(map(resp => GetAppResponse.fromProto(resp)));\n }\n getMultiAppDraft(r) {\n const request = r.toApiJson ? r : new GetMultiAppRequest(r);\n return this.http.post(this._host + \"/marketplaceapps.v1.MarketplaceApps/GetMultiAppDraft\", request.toApiJson(), this.apiOptions()).pipe(map(resp => GetMultiAppResponse.fromProto(resp)));\n }\n approveAddon(r) {\n const request = r.toApiJson ? r : new ApproveAddonRequest(r);\n return this.http.post(this._host + \"/marketplaceapps.v1.MarketplaceApps/ApproveAddon\", request.toApiJson(), {\n ...this.apiOptions(),\n observe: 'response'\n });\n }\n unapproveAddon(r) {\n const request = r.toApiJson ? r : new UnapproveAddonRequest(r);\n return this.http.post(this._host + \"/marketplaceapps.v1.MarketplaceApps/UnapproveAddon\", request.toApiJson(), {\n ...this.apiOptions(),\n observe: 'response'\n });\n }\n listApprovedAddons(r) {\n const request = r.toApiJson ? r : new ListApprovedAddonsRequest(r);\n return this.http.post(this._host + \"/marketplaceapps.v1.MarketplaceApps/ListApprovedAddons\", request.toApiJson(), this.apiOptions()).pipe(map(resp => AddonsListResponse.fromProto(resp)));\n }\n getMultiOrderForms(r) {\n const request = r.toApiJson ? r : new GetMultiOrderFormsRequest(r);\n return this.http.post(this._host + \"/marketplaceapps.v1.MarketplaceApps/GetMultiOrderForms\", request.toApiJson(), this.apiOptions()).pipe(map(resp => GetMultiOrderFormsResponse.fromProto(resp)));\n }\n createApp(r) {\n const request = r.toApiJson ? r : new CreateAppRequest(r);\n return this.http.post(this._host + \"/marketplaceapps.v1.MarketplaceApps/CreateApp\", request.toApiJson(), this.apiOptions()).pipe(map(resp => AppResponse.fromProto(resp)));\n }\n deleteApp(r) {\n const request = r.toApiJson ? r : new DeleteAppRequest(r);\n return this.http.post(this._host + \"/marketplaceapps.v1.MarketplaceApps/DeleteApp\", request.toApiJson(), {\n ...this.apiOptions(),\n observe: 'response'\n });\n }\n restoreApp(r) {\n const request = r.toApiJson ? r : new RestoreAppRequest(r);\n return this.http.post(this._host + \"/marketplaceapps.v1.MarketplaceApps/RestoreApp\", request.toApiJson(), {\n ...this.apiOptions(),\n observe: 'response'\n });\n }\n duplicateApp(r) {\n const request = r.toApiJson ? r : new DuplicateAppRequest(r);\n return this.http.post(this._host + \"/marketplaceapps.v1.MarketplaceApps/DuplicateApp\", request.toApiJson(), this.apiOptions()).pipe(map(resp => DuplicateAppResponse.fromProto(resp)));\n }\n updateAppGeneralSettings(r) {\n const request = r.toApiJson ? r : new UpdateAppGeneralInformationRequest(r);\n return this.http.post(this._host + \"/marketplaceapps.v1.MarketplaceApps/UpdateAppGeneralSettings\", request.toApiJson(), this.apiOptions()).pipe(map(resp => AppResponse.fromProto(resp)));\n }\n updateAppIntegration(r) {\n const request = r.toApiJson ? r : new UpdateAppIntegrationRequest(r);\n return this.http.post(this._host + \"/marketplaceapps.v1.MarketplaceApps/UpdateAppIntegration\", request.toApiJson(), this.apiOptions()).pipe(map(resp => AppResponse.fromProto(resp)));\n }\n updateAppOrderForm(r) {\n const request = r.toApiJson ? r : new UpdateAppOrderFormRequest(r);\n return this.http.post(this._host + \"/marketplaceapps.v1.MarketplaceApps/UpdateAppOrderForm\", request.toApiJson(), this.apiOptions()).pipe(map(resp => AppResponse.fromProto(resp)));\n }\n updateAppEndUserMarketingInformation(r) {\n const request = r.toApiJson ? r : new UpdateAppMarketingInformationRequest(r);\n return this.http.post(this._host + \"/marketplaceapps.v1.MarketplaceApps/UpdateAppEndUserMarketingInformation\", request.toApiJson(), this.apiOptions()).pipe(map(resp => AppResponse.fromProto(resp)));\n }\n updateAppResellerMarketingInformation(r) {\n const request = r.toApiJson ? r : new UpdateAppMarketingInformationRequest(r);\n return this.http.post(this._host + \"/marketplaceapps.v1.MarketplaceApps/UpdateAppResellerMarketingInformation\", request.toApiJson(), this.apiOptions()).pipe(map(resp => AppResponse.fromProto(resp)));\n }\n updateAppSsoIntegration(r) {\n const request = r.toApiJson ? r : new UpdateAppSSOIntegrationRequest(r);\n return this.http.post(this._host + \"/marketplaceapps.v1.MarketplaceApps/UpdateAppSSOIntegration\", request.toApiJson(), this.apiOptions()).pipe(map(resp => AppResponse.fromProto(resp)));\n }\n updateAppFulfillmentIntegration(r) {\n const request = r.toApiJson ? r : new UpdateAppFulfillmentIntegrationRequest(r);\n return this.http.post(this._host + \"/marketplaceapps.v1.MarketplaceApps/UpdateAppFulfillmentIntegration\", request.toApiJson(), this.apiOptions()).pipe(map(resp => AppResponse.fromProto(resp)));\n }\n updateAppTrialConfiguration(r) {\n const request = r.toApiJson ? r : new UpdateAppTrialConfigurationRequest(r);\n return this.http.post(this._host + \"/marketplaceapps.v1.MarketplaceApps/UpdateAppTrialConfiguration\", request.toApiJson(), this.apiOptions()).pipe(map(resp => AppResponse.fromProto(resp)));\n }\n approveApp(r) {\n const request = r.toApiJson ? r : new ApproveAppRequest(r);\n return this.http.post(this._host + \"/marketplaceapps.v1.MarketplaceApps/ApproveApp\", request.toApiJson(), this.apiOptions()).pipe(map(resp => AppResponse.fromProto(resp)));\n }\n unapproveApp(r) {\n const request = r.toApiJson ? r : new UnapproveAppRequest(r);\n return this.http.post(this._host + \"/marketplaceapps.v1.MarketplaceApps/UnapproveApp\", request.toApiJson(), this.apiOptions()).pipe(map(resp => AppResponse.fromProto(resp)));\n }\n updateAppApprovalAndBillingSettings(r) {\n const request = r.toApiJson ? r : new UpdateAppApprovalAndBillingSettingsRequest(r);\n return this.http.post(this._host + \"/marketplaceapps.v1.MarketplaceApps/UpdateAppApprovalAndBillingSettings\", request.toApiJson(), this.apiOptions()).pipe(map(resp => AppResponse.fromProto(resp)));\n }\n publishApp(r) {\n const request = r.toApiJson ? r : new PublishAppRequest(r);\n return this.http.post(this._host + \"/marketplaceapps.v1.MarketplaceApps/PublishApp\", request.toApiJson(), this.apiOptions()).pipe(map(resp => AppResponse.fromProto(resp)));\n }\n getAppsWithUnpublishedChanges(r) {\n const request = r.toApiJson ? r : new GetAppsWithUnpublishedChangesRequest(r);\n return this.http.post(this._host + \"/marketplaceapps.v1.MarketplaceApps/GetAppsWithUnpublishedChanges\", request.toApiJson(), this.apiOptions()).pipe(map(resp => GetAppsWithUnpublishedChangesResponse.fromProto(resp)));\n }\n canActivate(r) {\n const request = r.toApiJson ? r : new CanActivateRequest(r);\n return this.http.post(this._host + \"/marketplaceapps.v1.MarketplaceApps/CanActivate\", request.toApiJson(), this.apiOptions()).pipe(map(resp => CanActivateResponse.fromProto(resp)));\n }\n getAppsToDeactivateUponDeactivation(r) {\n const request = r.toApiJson ? r : new GetAppsToDeactivateUponDeactivationRequest(r);\n return this.http.post(this._host + \"/marketplaceapps.v1.MarketplaceApps/GetAppsToDeactivateUponDeactivation\", request.toApiJson(), this.apiOptions()).pipe(map(resp => GetAppsToDeactivateUponDeactivationResponse.fromProto(resp)));\n }\n getAppIdFromSku(r) {\n const request = r.toApiJson ? r : new GetAppIDFromSkuRequest(r);\n return this.http.post(this._host + \"/marketplaceapps.v1.MarketplaceApps/GetAppIDFromSku\", request.toApiJson(), this.apiOptions()).pipe(map(resp => GetAppIDFromSkuResponse.fromProto(resp)));\n }\n getMultiProductCost(r) {\n const request = r.toApiJson ? r : new GetMultiProductCostRequest(r);\n return this.http.post(this._host + \"/marketplaceapps.v1.MarketplaceApps/GetMultiProductCost\", request.toApiJson(), this.apiOptions()).pipe(map(resp => GetMultiProductCostResponse.fromProto(resp)));\n }\n updateCategories(r) {\n const request = r.toApiJson ? r : new UpdateAppCategoriesRequest(r);\n return this.http.post(this._host + \"/marketplaceapps.v1.MarketplaceApps/UpdateCategories\", request.toApiJson(), {\n ...this.apiOptions(),\n observe: 'response'\n });\n }\n suspendApp(r) {\n const request = r.toApiJson ? r : new SuspendAppRequest(r);\n return this.http.post(this._host + \"/marketplaceapps.v1.MarketplaceApps/SuspendApp\", request.toApiJson(), {\n ...this.apiOptions(),\n observe: 'response'\n });\n }\n unsuspendApp(r) {\n const request = r.toApiJson ? r : new UnsuspendAppRequest(r);\n return this.http.post(this._host + \"/marketplaceapps.v1.MarketplaceApps/UnsuspendApp\", request.toApiJson(), {\n ...this.apiOptions(),\n observe: 'response'\n });\n }\n requestAppReview(r) {\n const request = r.toApiJson ? r : new RequestAppReviewRequest(r);\n return this.http.post(this._host + \"/marketplaceapps.v1.MarketplaceApps/RequestAppReview\", request.toApiJson(), {\n ...this.apiOptions(),\n observe: 'response'\n });\n }\n listRequiredAppSummaries(r) {\n const request = r.toApiJson ? r : new ListRequiredAppSummariesRequest(r);\n return this.http.post(this._host + \"/marketplaceapps.v1.MarketplaceApps/ListRequiredAppSummaries\", request.toApiJson(), this.apiOptions()).pipe(map(resp => ListRequiredAppSummariesResponse.fromProto(resp)));\n }\n }\n MarketplaceAppsApiService.ɵfac = function MarketplaceAppsApiService_Factory(t) {\n return new (t || MarketplaceAppsApiService)(i0.ɵɵinject(i1.HttpClient), i0.ɵɵinject(HostService));\n };\n MarketplaceAppsApiService.ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({\n token: MarketplaceAppsApiService,\n factory: MarketplaceAppsApiService.ɵfac,\n providedIn: 'root'\n });\n return MarketplaceAppsApiService;\n})();\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\n\n// *********************************\n// Code generated by sdkgen\n// DO NOT EDIT!.\n//\n// API Service.\n// *********************************\nlet VendorApiService = /*#__PURE__*/(() => {\n class VendorApiService {\n constructor(http, hostService) {\n this.http = http;\n this.hostService = hostService;\n this._host = this.hostService.hostWithScheme;\n }\n apiOptions() {\n return {\n headers: new HttpHeaders({\n 'Content-Type': 'application/json'\n }),\n withCredentials: true\n };\n }\n create(r) {\n const request = r.toApiJson ? r : new CreateVendorRequest(r);\n return this.http.post(this._host + \"/marketplaceapps.v1.Vendor/Create\", request.toApiJson(), this.apiOptions()).pipe(map(resp => CreateVendorResponse.fromProto(resp)));\n }\n list(r) {\n const request = r.toApiJson ? r : new ListVendorRequest(r);\n return this.http.post(this._host + \"/marketplaceapps.v1.Vendor/List\", request.toApiJson(), this.apiOptions()).pipe(map(resp => ListVendorResponse.fromProto(resp)));\n }\n getMulti(r) {\n const request = r.toApiJson ? r : new GetMultiVendorRequest(r);\n return this.http.post(this._host + \"/marketplaceapps.v1.Vendor/GetMulti\", request.toApiJson(), this.apiOptions()).pipe(map(resp => GetMultiVendorResponse.fromProto(resp)));\n }\n addAppId(r) {\n const request = r.toApiJson ? r : new AddAppIDRequest(r);\n return this.http.post(this._host + \"/marketplaceapps.v1.Vendor/AddAppID\", request.toApiJson(), this.apiOptions()).pipe(map(resp => AddAppIDResponse.fromProto(resp)));\n }\n removeAppId(r) {\n const request = r.toApiJson ? r : new RemoveAppIDRequest(r);\n return this.http.post(this._host + \"/marketplaceapps.v1.Vendor/RemoveAppID\", request.toApiJson(), this.apiOptions()).pipe(map(resp => RemoveAppIDResponse.fromProto(resp)));\n }\n update(r) {\n const request = r.toApiJson ? r : new UpdateVendorRequest(r);\n return this.http.post(this._host + \"/marketplaceapps.v1.Vendor/Update\", request.toApiJson(), this.apiOptions()).pipe(map(resp => UpdateVendorResponse.fromProto(resp)));\n }\n getOwnedAppIDsByPartnerId(r) {\n const request = r.toApiJson ? r : new GetOwnedAppIDsByPartnerIDRequest(r);\n return this.http.post(this._host + \"/marketplaceapps.v1.Vendor/GetOwnedAppIDsByPartnerID\", request.toApiJson(), this.apiOptions()).pipe(map(resp => GetOwnedAppIDsByPartnerIDResponse.fromProto(resp)));\n }\n getByPartnerId(r) {\n const request = r.toApiJson ? r : new GetByPartnerIDRequest(r);\n return this.http.post(this._host + \"/marketplaceapps.v1.Vendor/GetByPartnerID\", request.toApiJson(), this.apiOptions()).pipe(map(resp => GetByPartnerIDResponse.fromProto(resp)));\n }\n isVendorDistributed(r) {\n const request = r.toApiJson ? r : new IsVendorDistributedByPartnerIDRequest(r);\n return this.http.post(this._host + \"/marketplaceapps.v1.Vendor/IsVendorDistributed\", request.toApiJson(), this.apiOptions()).pipe(map(resp => IsVendorDistributedByPartnerIDResponse.fromProto(resp)));\n }\n }\n VendorApiService.ɵfac = function VendorApiService_Factory(t) {\n return new (t || VendorApiService)(i0.ɵɵinject(i1.HttpClient), i0.ɵɵinject(HostService));\n };\n VendorApiService.ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({\n token: VendorApiService,\n factory: VendorApiService.ɵfac,\n providedIn: 'root'\n });\n return VendorApiService;\n})();\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\n\n// *********************************\n// Code generated by sdkgen\n// DO NOT EDIT!.\n//\n// Index.\n// *********************************\n\n/**\n * Generated bundle index. Do not edit.\n */\n\nexport { Access, ActiveAppEditionIdentifier, AddAppIDRequest, AddAppIDResponse, Addon, AddonResponse, AddonsListResponse, AppEditionsMarketing, AppRequirement, AppResponse, AppType, AppVendor, ApprovalProcess, ApproveAddonRequest, ApproveAppRequest, BillingProcess, CanActivateRequest, CanActivateResponse, CanActivateResponseInvalidResponse, CanActivateResponseSuccessResponse, Commitment, Contact, Cost, CreateAppRequest, CreateEditionRequest, CreateEditionResponse, CreateVendorRequest, CreateVendorResponse, DeleteAppRequest, DeleteEditionRequest, DeliveryMethod, DistributionSetting, DuplicateAppRequest, DuplicateAppResponse, Edition, EditionBillingFrequency, EditionIdentifier, EditionMarketingInformation, EditionPricing, EditionsApiService, EndOfTrialActions, Fee, FeeAmountType, FeeType, FieldMask, FrequentlyAskedQuestions, GetAddonRequest, GetAppIDFromSkuRequest, GetAppIDFromSkuResponse, GetAppRequest, GetAppResponse, GetAppsToDeactivateUponDeactivationRequest, GetAppsToDeactivateUponDeactivationResponse, GetAppsWithUnpublishedChangesRequest, GetAppsWithUnpublishedChangesResponse, GetBillingIDRequest, GetBillingIDResponse, GetByPartnerIDRequest, GetByPartnerIDResponse, GetEditionRequest, GetEditionResponse, GetMultiAppRequest, GetMultiAppResponse, GetMultiDraftEditionRequest, GetMultiDraftEditionResponse, GetMultiEditionForMultiAppRequest, GetMultiEditionRequest, GetMultiEditionResponse, GetMultiOrderFormsRequest, GetMultiOrderFormsResponse, GetMultiOrderFormsResponseOrderFormContainer, GetMultiProductCostRequest, GetMultiProductCostResponse, GetMultiProductCostResponseProductCostEntry, GetMultiVendorRequest, GetMultiVendorResponse, GetOwnedAppIDsByPartnerIDRequest, GetOwnedAppIDsByPartnerIDResponse, GetPublicKeysRequest, GetPublicKeysResponse, GetSSOUrlsRequest, GetSSOUrlsResponse, HostService, IdentifiedPublicKey, IncludedCommonFormFields, Integration, IsVendorDistributedByPartnerIDRequest, IsVendorDistributedByPartnerIDResponse, ListAddonsRequest, ListApprovedAddonsRequest, ListAppsForVendorIDsRequest, ListAppsForVendorIDsResponse, ListAppsRequest, ListAppsRequestListAppsFilter, ListByMultiAppRequest, ListByMultiAppResponse, ListByMultiAppResponseAppEditions, ListDraftEditionsForAppRequest, ListDraftEditionsForAppResponse, ListEditionsForAppRequest, ListEditionsForAppResponse, ListEditionsMarketingForAppRequest, ListEditionsMarketingForAppResponse, ListRequiredAppSummariesFilters, ListRequiredAppSummariesRequest, ListRequiredAppSummariesResponse, ListVendorRequest, ListVendorResponse, MarketingInformation, MarketplaceApp, MarketplaceAppLmi, MarketplaceAppLmiLmiCategories, MarketplaceAppProduct, MarketplaceAppProductProductCategories, MarketplaceAppsApiService, OrderForm, OrderFormField, OrderFormFieldOption, PagedAppResponse, PermissionLists, ProductCost, ProductCostEditionCostEntry, PublishAppRequest, Release, ReleaseType, RemoveAppIDRequest, RemoveAppIDResponse, RequestAppReviewRequest, RequiredAppSummary, RequiredBusinessData, RequiredFeatures, RestoreAppRequest, Restrictions, Rule, State, StateFilterOptions, SuspendAppRequest, TrialConfiguration, UnapproveAddonRequest, UnapproveAppRequest, UnsuspendAppRequest, UpdateAppApprovalAndBillingSettingsRequest, UpdateAppCategoriesRequest, UpdateAppFulfillmentIntegrationRequest, UpdateAppGeneralInformationRequest, UpdateAppIntegrationRequest, UpdateAppMarketingInformationRequest, UpdateAppOrderFormRequest, UpdateAppSSOIntegrationRequest, UpdateAppTrialConfigurationRequest, UpdateEditionRequest, UpdateMultiEditionRequest, UpdateMultiEditionRequestEditionData, UpdateVendorRequest, UpdateVendorResponse, UpsertEditionsMarketingRequest, VendorApiService };\n","import { HttpErrorResponse } from '@angular/common/http';\nimport { Injectable, NgModule } from '@angular/core';\nimport {\n AddAppIDRequest,\n AppVendor,\n CreateVendorRequest,\n GetByPartnerIDRequest,\n GetMultiVendorRequest,\n GetOwnedAppIDsByPartnerIDRequest,\n IsVendorDistributedByPartnerIDRequest,\n IsVendorDistributedByPartnerIDResponse,\n ListVendorRequest,\n RemoveAppIDRequest,\n UpdateVendorRequest,\n VendorApiService,\n} from '@vendasta/marketplace-apps/v1';\nimport { Observable, throwError } from 'rxjs';\nimport { map } from 'rxjs/operators';\n\n@Injectable({ providedIn: 'root' })\nexport class VendorService {\n constructor(private apiService: VendorApiService) {}\n\n create(name: string): Observable {\n const request = new CreateVendorRequest({ name: name });\n const response = this.apiService.create(request);\n return response.pipe(\n map((resp) => {\n return resp ? resp.vendor : null;\n }),\n );\n }\n list(\n cursor: string,\n pageSize: number,\n ): Observable<{\n vendors: AppVendor[];\n cursor: string;\n hasMore: boolean;\n }> {\n const request = new ListVendorRequest({ cursor: cursor, pageSize: pageSize });\n const response = this.apiService.list(request);\n return response.pipe(\n map((resp) => {\n if (!resp) {\n return { vendors: [], cursor: '', hasMore: false };\n }\n return { vendors: resp.vendors, cursor: resp.cursor, hasMore: resp.hasMore };\n }),\n );\n }\n getMulti(vendorIds: string[]): Observable {\n const request = new GetMultiVendorRequest({ ids: vendorIds });\n const response = this.apiService.getMulti(request);\n return response.pipe(\n map((resp) => {\n if (resp && resp.vendors && resp.vendors.length > 0) {\n return resp.vendors;\n }\n return [];\n }),\n );\n }\n addAppId(vendorId: string, appId: string): Observable {\n const request = new AddAppIDRequest({ id: vendorId, appId: appId });\n const response = this.apiService.addAppId(request);\n return response.pipe(\n map((resp) => {\n return resp ? resp.vendor : null;\n }),\n );\n }\n removeAppId(vendorId: string, appId: string): Observable {\n const request = new RemoveAppIDRequest({ id: vendorId, appId: appId });\n const response = this.apiService.removeAppId(request);\n return response.pipe(\n map((resp) => {\n return resp ? resp.vendor : null;\n }),\n );\n }\n update(vendorId: string, name: string): Observable {\n const request = new UpdateVendorRequest({ id: vendorId, name: name });\n const response = this.apiService.update(request);\n return response.pipe(\n map((resp) => {\n return resp ? resp.vendor : null;\n }),\n );\n }\n\n /*\n @params:\n - partnerId: represents the id of a partner to get the owned app ids for.\n @returns:\n - an observable of the string type\n - HttpErrorResponse with status 404 if partnerId is not present\n - HttpErrorResponse with status 500 if the api failed\n - HttpErrorResponse with 409 if the requester does not have access to the partner id\n */\n getOwnedAppIdsByPartnerId(partnerId: string | null): Observable {\n if (!partnerId) {\n const e = new HttpErrorResponse({\n status: 404,\n statusText: 'partner id is required',\n });\n return throwError(e);\n }\n const request = new GetOwnedAppIDsByPartnerIDRequest({\n partnerId: partnerId,\n });\n return this.apiService.getOwnedAppIDsByPartnerId(request).pipe(map((resp) => (resp || { appIds: [] }).appIds));\n }\n\n /*\n @params:\n - appId: represents the id of an app to determine it's ownership of.\n - partnerId: represents the id of a partner to determine if it owns appId.\n @returns:\n - an observable of the string type\n - HttpErrorResponse with status 404 if partnerId is not present\n - HttpErrorResponse with status 500 if the api failed\n - HttpErrorResponse with 409 if the requester does not have access to the partner id\n */\n isAppOwnedByPartner(appID: string | null, partnerId: string | null): Observable {\n if (!partnerId || !appID) {\n const e = new HttpErrorResponse({\n status: 404,\n statusText: 'partner id and app id is required',\n });\n return throwError(e);\n }\n\n return this.getOwnedAppIdsByPartnerId(partnerId).pipe(\n map((appIds) => {\n return appIds ? appIds.findIndex((i) => i === appID) > -1 : false;\n }),\n );\n }\n\n isVendorDistributed(partnerId: string): Observable {\n const request = new IsVendorDistributedByPartnerIDRequest({ partnerId: partnerId });\n const response = this.apiService.isVendorDistributed(request);\n return response.pipe(\n map((resp: IsVendorDistributedByPartnerIDResponse) => {\n return resp ? resp.isDistributed : null;\n }),\n );\n }\n\n getByPartnerId(partnerId: string): Observable {\n const request = new GetByPartnerIDRequest({ partnerId: partnerId });\n const response = this.apiService.getByPartnerId(request);\n return response.pipe(map((resp) => resp.vendor));\n }\n\n getVendorIdByPartnerId(partnerId: string): Observable {\n return this.getByPartnerId(partnerId).pipe(map((vendor) => vendor.id));\n }\n}\n\n@NgModule({\n providers: [VendorApiService],\n})\nexport class VendorServiceModule {}\n","import { HttpClient, HttpHeaders } from '@angular/common/http';\nimport { Injectable } from '@angular/core';\nimport {\n Addon,\n AppType,\n CreateAppRequest,\n CreateAppRequestInterface,\n FieldMask,\n GetAddonRequest,\n GetAppIDFromSkuRequest,\n GetAppIDFromSkuResponse,\n GetAppRequest,\n GetMultiAppRequest,\n GetMultiProductCostRequest,\n ListAppsForVendorIDsRequest,\n ListAppsForVendorIDsResponse,\n ListAppsRequest,\n ListAppsRequestListAppsFilter,\n ListRequiredAppSummariesFilters,\n ListRequiredAppSummariesRequest,\n ListRequiredAppSummariesResponse,\n MarketplaceApp,\n MarketplaceAppsApiService,\n ProductCost,\n ReleaseType,\n RequestAppReviewRequest,\n StateFilterOptions,\n SuspendAppRequest,\n UnsuspendAppRequest,\n UpdateAppFulfillmentIntegrationRequest,\n} from '@vendasta/marketplace-apps/v1';\nimport { HostService } from '@vendasta/marketplace-apps/v1';\nimport { Observable, forkJoin } from 'rxjs';\nimport { map } from 'rxjs/operators';\n\ninterface UploadFileResponseInterface {\n fileUrl?: string;\n}\n\ninterface SkuIds {\n appId?: string;\n addonId?: string;\n editionId?: string;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class MarketplaceAppService {\n constructor(\n private apiService: MarketplaceAppsApiService,\n private http: HttpClient,\n private hostService: HostService,\n ) {}\n\n // getApp gets the app with the given id\n getApp(appId: string, fieldMask?: FieldMask): Observable {\n const request = new GetAppRequest({ appId: appId, fieldMask: fieldMask });\n const response = this.apiService.getApp(request);\n return response.pipe(\n map((resp) => {\n return resp ? resp.app : null;\n }),\n );\n }\n\n // getMultiApp gets the aps with the id. If a given id was not found, that entry in the returned list will be null\n getMultiApps(appIds: string[], fieldMask?: FieldMask): Observable<(MarketplaceApp | null)[]> {\n // Split appIds into chunks to prevent timeouts when there are hundreds of apps to load\n // https://vendasta.jira.com/browse/QOF-1293\n const chunkSize = 250;\n const chunks: string[][] = [];\n\n for (let i = 0; i < appIds.length; i += chunkSize) {\n chunks.push(appIds.slice(i, i + chunkSize));\n }\n\n const chunks$ = chunks.map((appIds) => {\n const request = new GetMultiAppRequest({ appId: appIds, fieldMask: fieldMask });\n return this.apiService.getMultiApp(request).pipe(\n map((resp) => {\n if (resp && resp.apps && resp.apps.length > 0) {\n return resp.apps;\n }\n return [];\n }),\n );\n });\n\n return forkJoin(chunks$).pipe(\n // flatten the chunks into a single array of apps\n map((chunks) => {\n return chunks.flat();\n }),\n );\n }\n\n // getAppDraft returns the current unpublished version of an app\n getAppDraft(appId: string, fieldMask?: FieldMask): Observable {\n const request = new GetAppRequest({ appId: appId, fieldMask: fieldMask });\n const response = this.apiService.getAppDraft(request);\n return response.pipe(\n map((resp) => {\n return resp ? resp.app : undefined;\n }),\n );\n }\n\n getAddon(appId: string, addonId: string): Observable {\n const request = new GetAddonRequest({ appId: appId, addonId: addonId });\n const response$ = this.apiService.getAddon(request);\n return response$.pipe(\n map((resp) => {\n return resp ? resp.addon : undefined;\n }),\n );\n }\n\n listApps(\n pageSize = 0,\n cursor = '',\n fieldMask?: FieldMask,\n partnerId?: string,\n filterTerm?: string,\n releaseType?: ReleaseType,\n appType?: AppType,\n stateFilter?: StateFilterOptions,\n ): Observable<{\n apps: MarketplaceApp[];\n cursor: string;\n hasMore: boolean;\n }> {\n const filter = new ListAppsRequestListAppsFilter({\n partnerId: partnerId,\n filterTerm: filterTerm,\n releaseType: releaseType,\n appType: appType,\n state: stateFilter,\n });\n const request = new ListAppsRequest({\n pageSize: pageSize,\n cursor: cursor,\n fieldMask: fieldMask,\n filter: filter,\n });\n const response = this.apiService.listApps(request);\n return response.pipe(\n map((resp) => {\n if (!resp) {\n return { apps: [], cursor: '', pageSize: 0, hasMore: false };\n }\n return { apps: resp.apps, cursor: resp.cursor, pageSize: resp.pageSize, hasMore: resp.hasMore };\n }),\n );\n }\n\n listAppsForVendorIDs(\n vendorIds: string[],\n includeAddons: boolean,\n cursor = '',\n pageSize = 10,\n fieldMask?: FieldMask,\n ): Observable<{\n apps: MarketplaceApp[];\n cursor: string;\n hasMore: boolean;\n }> {\n const request = new ListAppsForVendorIDsRequest({\n vendorIds: vendorIds,\n includeAddons: includeAddons,\n cursor: cursor,\n pageSize: pageSize,\n fieldMask: fieldMask,\n });\n const response = this.apiService.listAppsForVendorIDs(request);\n return response.pipe(\n map((resp: ListAppsForVendorIDsResponse) => {\n if (!resp) {\n return { apps: [], cursor: '', hasMore: false };\n }\n return { apps: resp.apps, cursor: resp.cursor, hasMore: resp.hasMore };\n }),\n );\n }\n\n // This method will give you back the first parent of the app corresponding to the sku provided\n /**\n * @deprecated use the `appId` field on the response of the getIdsFromSku() method.\n */\n getAppIdFromSku(sku: string): Observable {\n const request = new GetAppIDFromSkuRequest({ sku: sku });\n return this.apiService.getAppIdFromSku(request).pipe(map((resp: GetAppIDFromSkuResponse) => resp.appId));\n }\n\n getIdsFromSku(sku: string): Observable {\n const request = new GetAppIDFromSkuRequest({ sku: sku });\n return this.apiService\n .getAppIdFromSku(request)\n .pipe(map((resp: GetAppIDFromSkuResponse) => (resp ? { ...resp } : null)));\n }\n\n // createApp sends an app creation request and returns the app\n createApp(kwargs: CreateAppRequestInterface): Observable {\n const request = new CreateAppRequest(kwargs);\n const response = this.apiService.createApp(request);\n return response.pipe(\n map((resp) => {\n return resp ? resp.app : null;\n }),\n );\n }\n\n // duplicateApp will duplicate the provided App and return the new App's ID\n duplicateApp(appId: string): Observable {\n return this.apiService.duplicateApp({ appId: appId }).pipe(map((resp) => (resp ? resp.appId : null)));\n }\n\n // uploadMarketingFile uploads a file to be used for an apps marketing material\n // returns the url to view that file\n uploadMarketingFile(file: File): Observable {\n const url = this.hostService.hostWithScheme + '/upload-file';\n return this.http\n .post(url, file, {\n headers: new HttpHeaders({\n 'Content-Type': file.type,\n 'Content-Disposition': `attachment; filename=\"${file.name}\"`,\n }),\n withCredentials: true,\n })\n .pipe(\n map((resp) => {\n return resp ? resp.fileUrl : undefined;\n }),\n );\n }\n\n // getMultiProductCost gets the cost of products for a partner.\n getMultiProductCost(partnerId: string, appIds: string[]): Observable<{ [key: string]: ProductCost } | null> {\n const request = new GetMultiProductCostRequest({ partnerId: partnerId, appIds: appIds });\n const response = this.apiService.getMultiProductCost(request);\n return response.pipe(\n map((resp) => {\n if (resp) {\n return resp.productCost;\n }\n\n return null;\n }),\n );\n }\n\n suspendApp(appId: string): Observable {\n const req = new SuspendAppRequest({\n appId: appId,\n });\n return this.apiService.suspendApp(req).pipe(map(() => true));\n }\n\n unsuspendApp(appId: string): Observable {\n const req = new UnsuspendAppRequest({\n appId: appId,\n });\n return this.apiService.unsuspendApp(req).pipe(map(() => true));\n }\n\n requestAppReview(appId: string): Observable {\n const req = new RequestAppReviewRequest({\n appId: appId,\n });\n return this.apiService.requestAppReview(req).pipe(map(() => true));\n }\n\n updateAppFulfillmentIntegration(\n appId: string,\n usesFulfillmentIntegration: boolean,\n ): Observable {\n const request = new UpdateAppFulfillmentIntegrationRequest({\n appId: appId,\n usesFulfillmentIntegration: usesFulfillmentIntegration,\n });\n return this.apiService.updateAppFulfillmentIntegration(request).pipe(\n map((resp) => {\n return resp ? resp.app : null;\n }),\n );\n }\n\n listRequiredAppSummaries(\n vendorId: string,\n cursor: string,\n pageSize: number,\n filters: ListRequiredAppSummariesFilters,\n ): Observable {\n return this.apiService.listRequiredAppSummaries(\n new ListRequiredAppSummariesRequest({\n vendorId,\n cursor,\n pageSize,\n filters,\n }),\n );\n }\n}\n","import { Injectable } from '@angular/core';\nimport {\n AppEditionsMarketing,\n CreateEditionRequest,\n DeleteEditionRequest,\n Edition,\n EditionBillingFrequency,\n EditionMarketingInformationInterface,\n EditionsApiService,\n GetEditionRequest,\n GetMultiDraftEditionRequest,\n GetMultiEditionForMultiAppRequest,\n GetMultiEditionRequest,\n ListDraftEditionsForAppRequest,\n ListEditionsForAppRequest,\n ListEditionsMarketingForAppRequest,\n Release,\n UpdateMultiEditionRequest,\n UpsertEditionsMarketingRequest,\n} from '@vendasta/marketplace-apps/v1';\nimport { Observable } from 'rxjs';\nimport { map } from 'rxjs/operators';\n\nexport interface EditionIdentifiers {\n appId: string;\n editionId: string;\n}\n\nexport interface EditionPricingData {\n wholesalePrice: number;\n suggestedRetailPrice: number;\n billingFrequency: EditionBillingFrequency;\n}\n\nexport interface EditionData {\n editionId: string;\n name: string;\n pricing: EditionPricingData;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class EditionsService {\n constructor(private apiService: EditionsApiService) {}\n\n get(appId: string, editionId: string): Observable {\n const req = new GetEditionRequest({\n appId: appId,\n editionId: editionId,\n });\n return this.apiService.get(req).pipe(map((resp) => resp.edition));\n }\n\n getMulti(appId: string, editionIds: string[]): Observable {\n const req = new GetMultiEditionRequest({\n appId: appId,\n editionIds: editionIds,\n });\n return this.apiService.getMulti(req).pipe(map((resp) => resp.editions));\n }\n\n getMultiDraft(appId: string, editionIds: string[]): Observable {\n const req = new GetMultiDraftEditionRequest({\n appId: appId,\n editionIds: editionIds,\n });\n return this.apiService.getMultiDraft(req).pipe(map((resp) => resp.editions));\n }\n\n listEditionsForApp(appId: string, cursor: string, pageSize: number): Observable {\n const req = new ListEditionsForAppRequest({\n appId: appId,\n cursor: cursor,\n pageSize: pageSize,\n });\n return this.apiService.listEditionsForApp(req).pipe(map((resp) => resp.editions));\n }\n\n listDraftEditionsForApp(appId: string, cursor: string, pageSize: number): Observable {\n const req = new ListDraftEditionsForAppRequest({\n appId: appId,\n cursor: cursor,\n pageSize: pageSize,\n });\n return this.apiService.listDraftEditionsForApp(req).pipe(map((resp) => resp.editions));\n }\n\n getMultiEditionForMultiApp(editionIdentifiersList: EditionIdentifiers[]): Observable {\n const req = new GetMultiEditionForMultiAppRequest({\n appEditionIdPairs: editionIdentifiersList,\n });\n return this.apiService.getMultiEditionForMultiApp(req).pipe(map((resp) => resp.editions));\n }\n\n updateMulti(appId: string, editionData: EditionData[]): Observable {\n const req = new UpdateMultiEditionRequest({\n appId: appId,\n editions: editionData,\n });\n return this.apiService.updateMulti(req).pipe(map(() => true));\n }\n\n create(appId: string, editionName: string): Observable {\n const req = new CreateEditionRequest({\n appId,\n name: editionName,\n });\n return this.apiService.create(req).pipe(map((resp) => resp.edition));\n }\n\n deleteEdition(appId: string, editionId: string): Observable {\n const req = new DeleteEditionRequest({\n appId: appId,\n editionId: editionId,\n });\n return this.apiService.delete(req).pipe(map(() => true));\n }\n\n upsertEditionsMarketing(\n appId: string,\n editionId: string,\n endUserMarketing: EditionMarketingInformationInterface,\n usesResellerMarketing: boolean,\n resellerMarketing: EditionMarketingInformationInterface,\n ): Observable {\n const req = new UpsertEditionsMarketingRequest({\n appId: appId,\n editionId: editionId,\n endUserMarketing: endUserMarketing,\n usesResellerMarketing: usesResellerMarketing,\n resellerMarketing: resellerMarketing,\n });\n return this.apiService.upsertEditionsMarketing(req).pipe(map(() => true));\n }\n\n listEditionsMarketingForApp(appId: string, release: Release): Observable {\n const req = new ListEditionsMarketingForAppRequest({\n appId: appId,\n releaseType: release,\n });\n return this.apiService.listEditionsMarketingForApp(req).pipe(\n map((aem) => {\n return aem.appEditionsMarketing;\n }),\n );\n }\n}\n","export class File {\n constructor(public url: string) {\n this.url = url;\n }\n\n get name(): string | null {\n return this.url ? this.url.substring(this.url.lastIndexOf('/') + 1, this.url.lastIndexOf('.')) : null;\n }\n\n get icon(): string {\n const ext = this.url ? this.url.substring(this.url.lastIndexOf('.') + 1) : null;\n switch (ext) {\n case 'pdf':\n return 'icon-pdf';\n case 'ppt':\n return 'icon-ppt';\n default:\n return 'icon-docs';\n }\n }\n}\n","import { AppliedDiscountInterface, DiscountType as APIDiscountType } from '@vendasta/billing';\nimport { DiscountType } from '../discount';\n\nexport function appliedDiscountTypeFromAPI(adt: APIDiscountType | undefined): DiscountType {\n switch (adt) {\n case APIDiscountType.DISCOUNT_TYPE_FIXED_AMOUNT_PER_UNIT:\n return DiscountType.FIXED_AMOUNT_PER_UNIT;\n case APIDiscountType.DISCOUNT_TYPE_FIXED_NUMBER_OF_UNITS:\n return DiscountType.FIXED_NUMBER_OF_UNITS;\n case APIDiscountType.DISCOUNT_TYPE_PERCENT_AMOUNT:\n return DiscountType.PERCENT_AMOUNT;\n }\n return DiscountType.FIXED_AMOUNT;\n}\n\nexport function appliedDiscountTypeToApi(adt: DiscountType): APIDiscountType {\n switch (adt) {\n case DiscountType.FIXED_AMOUNT_PER_UNIT:\n return APIDiscountType.DISCOUNT_TYPE_FIXED_AMOUNT_PER_UNIT;\n case DiscountType.FIXED_NUMBER_OF_UNITS:\n return APIDiscountType.DISCOUNT_TYPE_FIXED_NUMBER_OF_UNITS;\n case DiscountType.PERCENT_AMOUNT:\n return APIDiscountType.DISCOUNT_TYPE_PERCENT_AMOUNT;\n }\n return APIDiscountType.DISCOUNT_TYPE_FIXED_AMOUNT;\n}\n\nexport interface AppliedDiscount {\n type: DiscountType;\n value: number;\n totalAmount: number;\n description: string;\n referenceId: string;\n}\n\nexport function appliedDiscountFromApi(ad: AppliedDiscountInterface): AppliedDiscount {\n return {\n type: appliedDiscountTypeFromAPI(ad.type),\n value: ad.value || 0,\n totalAmount: ad.totalAmount || 0,\n description: ad.description || '',\n referenceId: ad.referenceId || '',\n };\n}\n\nexport function appliedDiscountToApi(ad: AppliedDiscount): AppliedDiscountInterface {\n return {\n type: appliedDiscountTypeToApi(ad.type),\n value: ad.value || 0,\n totalAmount: ad.totalAmount || 0,\n description: ad.description || '',\n referenceId: ad.referenceId || '',\n };\n}\n\n/** @deprecated use Discount interface from billing/discount */\nexport interface Discount {\n value: number;\n type: string;\n startDate: Date;\n id?: number;\n endDate?: Date;\n total?: number;\n}\n","import { BillingStrategy as PricingPlanBillingStrategy } from '@vendasta/billing';\n\nexport enum BillingStrategy {\n Invalid = 'INVALID',\n EndOfPeriod = 'END_OF_PERIOD',\n StartOfPeriod = 'START_OF_PERIOD',\n Instantly = 'INSTANTLY',\n EndOfDay = 'END_OF_DAY',\n}\n\nexport function isBillingStrategyInstant(strategy: BillingStrategy): boolean {\n return strategy === BillingStrategy.Instantly || strategy === BillingStrategy.EndOfDay;\n}\n\nexport function billingStrategyFromAPI(bsAPI: PricingPlanBillingStrategy | undefined): BillingStrategy {\n switch (bsAPI) {\n case PricingPlanBillingStrategy.BILLING_STRATEGY_END_OF_PERIOD:\n return BillingStrategy.EndOfPeriod;\n case PricingPlanBillingStrategy.BILLING_STRATEGY_START_OF_PERIOD:\n return BillingStrategy.StartOfPeriod;\n case PricingPlanBillingStrategy.BILLING_STRATEGY_INSTANTLY:\n return BillingStrategy.Instantly;\n case PricingPlanBillingStrategy.BILLING_STRATEGY_END_OF_DAY:\n return BillingStrategy.EndOfDay;\n }\n return BillingStrategy.Invalid;\n}\n\nexport function billingStrategyToAPI(strategy: BillingStrategy | undefined): PricingPlanBillingStrategy {\n switch (strategy) {\n case BillingStrategy.EndOfPeriod:\n return PricingPlanBillingStrategy.BILLING_STRATEGY_END_OF_PERIOD;\n case BillingStrategy.StartOfPeriod:\n return PricingPlanBillingStrategy.BILLING_STRATEGY_START_OF_PERIOD;\n case BillingStrategy.Instantly:\n return PricingPlanBillingStrategy.BILLING_STRATEGY_INSTANTLY;\n case BillingStrategy.EndOfDay:\n return PricingPlanBillingStrategy.BILLING_STRATEGY_END_OF_DAY;\n }\n return PricingPlanBillingStrategy.BILLING_STRATEGY_NONE;\n}\n","import { ProductPricingRuleInterface } from '@vendasta/billing';\n\nexport interface ProductPricingRules {\n price: number;\n minUnits: number;\n maxUnits: number;\n}\n\nexport function productPricingRulesFromApi(pprApi: ProductPricingRuleInterface[] | undefined): ProductPricingRules[] {\n return (pprApi || []).map((r) => {\n return {\n price: r.price || 0,\n minUnits: r.minUnits,\n maxUnits: r.maxUnits,\n } as ProductPricingRules;\n });\n}\n","import { CommitmentInterface } from '@vendasta/billing';\n\nexport interface Commitment {\n initial: number;\n recurring: number;\n}\n\nexport function commitmentFromAPI(comAPI: CommitmentInterface | undefined): Commitment {\n return {\n initial: comAPI?.initial || 0,\n recurring: comAPI?.recurring || 0,\n };\n}\n","import { FeeInterface as FeeProto } from '@vendasta/billing';\n\nexport interface Fee {\n amount?: number;\n amountType?: FeeAmountType;\n feeType?: FeeType;\n}\n\nexport enum FeeAmountType {\n FEE_AMOUNT_TYPE_INVALID = 0,\n FEE_AMOUNT_TYPE_FIXED = 1,\n FEE_AMOUNT_TYPE_PERCENTAGE = 2,\n}\n\nexport enum FeeType {\n FEE_TYPE_INVALID = 0,\n FEE_TYPE_MANAGEMENT = 1,\n}\n\nexport function feesFromApi(protos: FeeProto[]): Fee[] {\n if (!protos || protos.length < 1) {\n return [];\n }\n return protos.map((proto) => {\n return {\n amount: proto.amount || 0,\n amountType: proto.amountType,\n feeType: proto.feeType,\n };\n });\n}\n\nexport function feesToApi(fees: Fee[]): FeeProto[] {\n if (!fees || fees.length < 1) {\n return [];\n }\n return fees.map((fee) => {\n return {\n amount: fee.amount || 0,\n amountType: fee.amountType,\n feeType: fee.feeType,\n };\n });\n}\n","import {\n PricingPlanProduct as ApiPricingPlanProduct,\n PricingPlanProductPricing as ApiPricing,\n ProductPricingRule as ApiRule,\n} from '@vendasta/billing';\nimport { BillingStrategy, billingStrategyFromAPI } from './billing-strategy';\nimport { Commitment, commitmentFromAPI } from './commitment';\nimport { Currency } from './currency';\nimport { Frequency, frequencyFromApi, frequencyToApi } from './frequency';\nimport { ProductPricingRules, productPricingRulesFromApi } from './product-pricing-rules';\nimport { ProductPricingType, productPricingTypeFromApi, productPricingTypeToApi } from './product-pricing-type';\nimport { Fee, feesFromApi, feesToApi } from './fee';\n\nexport interface CurrencyPricingMap {\n [key: string]: PricingPlanProductPricing;\n}\n\nexport interface PricingPlanProductPricing {\n type: ProductPricingType;\n rules: ProductPricingRules[];\n setupFee: number;\n fees: Fee[];\n frequency?: Frequency;\n currencyCode?: string;\n}\n\nexport interface PricingPlanProduct {\n pricingPlanId: string;\n sku: string;\n frequency?: Frequency;\n pricing: CurrencyPricingMap;\n commitment: Commitment;\n created: Date;\n modified: Date;\n strategy: BillingStrategy;\n volumeCommitment: number;\n volumeCommitmentStartsAt?: Date;\n volumeCommitmentEndsAt?: Date;\n defaultStrategy?: BillingStrategy;\n}\n\nexport function pricingPlanProductFromApi(apiProduct: ApiPricingPlanProduct): PricingPlanProduct {\n const pricingMap: CurrencyPricingMap = {};\n for (const apiCurrency in apiProduct.pricing) {\n if (!Object.prototype.hasOwnProperty.call(apiProduct.pricing, apiCurrency)) {\n continue;\n }\n\n const pricingApi = apiProduct.pricing[apiCurrency];\n pricingMap[apiCurrency] = {\n type: productPricingTypeFromApi(pricingApi.type),\n rules: productPricingRulesFromApi(pricingApi.rules),\n setupFee: pricingApi.setupFee || 0,\n fees: feesFromApi(pricingApi.fees),\n frequency: frequencyFromApi(pricingApi.frequency),\n };\n }\n\n return {\n pricingPlanId: apiProduct.pricingPlanId,\n sku: apiProduct.sku,\n frequency: frequencyFromApi(apiProduct.frequency),\n pricing: pricingMap,\n commitment: commitmentFromAPI(apiProduct.commitment),\n created: apiProduct.created,\n modified: apiProduct.modified,\n strategy: billingStrategyFromAPI(apiProduct.strategy),\n volumeCommitment: apiProduct.volumeCommitment,\n volumeCommitmentStartsAt:\n apiProduct.volumeCommitmentStartsAt?.getTime() !== 0 ? apiProduct.volumeCommitmentStartsAt : undefined,\n volumeCommitmentEndsAt:\n apiProduct.volumeCommitmentEndsAt?.getTime() !== 0 ? apiProduct.volumeCommitmentEndsAt : undefined,\n };\n}\n\nexport function currencyPricingMapToApi(currencyPricingMap: CurrencyPricingMap | undefined): {\n [key: string]: ApiPricing;\n} {\n if (!currencyPricingMap) {\n return {};\n }\n return Object.keys(currencyPricingMap)\n .filter((c) => c in Currency)\n .reduce((apiPricingMap: { [key: string]: ApiPricing }, c: string) => {\n apiPricingMap[c] = pricingPlanProductPricingToApi(currencyPricingMap[c]);\n return apiPricingMap;\n }, {});\n}\n\nexport function productPricingRulesToApi(rules: ProductPricingRules[]): ApiRule[] {\n return rules.map((rule) => new ApiRule(rule));\n}\n\nexport function pricingPlanProductPricingToApi(pricing: PricingPlanProductPricing): ApiPricing {\n return new ApiPricing({\n type: productPricingTypeToApi(pricing.type),\n rules: productPricingRulesToApi(pricing.rules),\n setupFee: pricing.setupFee,\n fees: feesToApi(pricing.fees),\n frequency: frequencyToApi(pricing.frequency),\n currencyCode: pricing.currencyCode,\n });\n}\n","import {\n GetPurchaseCostResponse,\n ProductPricesInterface,\n ProductPricingInterface,\n PricingPlanProductPricing as ApiPricingPlanProductPricing,\n} from '@vendasta/billing';\nimport { BillingStrategy, billingStrategyFromAPI } from './billing-strategy';\nimport { Commitment, commitmentFromAPI } from './commitment';\nimport { Currency, currencyFromApi } from './currency';\nimport { Frequency, frequencyFromApi, frequencyFromLegacyApi, frequencyToApi } from './frequency';\nimport { ProductPricingRules, productPricingRulesFromApi } from './product-pricing-rules';\nimport { ProductPricingType, productPricingTypeFromApi, productPricingTypeToApi } from './product-pricing-type';\nimport { Fee, feesFromApi, feesToApi } from './fee';\nimport { productPricingRulesToApi } from './pricing-plan-product';\n\nexport interface PurchaseCost {\n billingFrequency: Frequency;\n total: number;\n subtotal: number;\n currency: Currency;\n strategy: BillingStrategy;\n commitment: Commitment;\n isStartingPrice: boolean;\n discountTotal: number;\n setupFee: number;\n}\n\nexport interface ProductPricing {\n strategy: BillingStrategy;\n pricingType: ProductPricingType;\n currency: Currency;\n frequency: Frequency;\n pricingRules: ProductPricingRules[];\n commitment: Commitment;\n volumeCommitment: number;\n isStartingPrice: boolean;\n resolvedFrom?: string;\n setupFee: number;\n fees: Fee[];\n}\n\nexport interface ProductPrices {\n sku: string;\n prices: ProductPricing[];\n}\n\nexport function purchaseCostFromAPI(pcApi: GetPurchaseCostResponse): PurchaseCost {\n const subtotal = pcApi.subtotalCost || 0;\n const discountTotal = pcApi.discountAmount || 0;\n const total = pcApi.totalCost || 0;\n const setupFee = pcApi.setupFee || 0;\n\n return {\n subtotal: subtotal,\n discountTotal: discountTotal,\n total: total,\n billingFrequency: frequencyFromLegacyApi(pcApi.billingFrequency),\n currency: currencyFromApi(pcApi.currency),\n strategy: billingStrategyFromAPI(pcApi.strategy),\n commitment: commitmentFromAPI(pcApi.commitment),\n isStartingPrice: pcApi.isStartingPrice,\n setupFee: setupFee,\n };\n}\n\nexport function productPricingFromApi(pApi: ProductPricingInterface): ProductPricing {\n return {\n strategy: billingStrategyFromAPI(pApi.strategy),\n pricingType: productPricingTypeFromApi(pApi.pricingType),\n currency: currencyFromApi(pApi.currency),\n frequency: frequencyFromApi(pApi.frequency),\n pricingRules: productPricingRulesFromApi(pApi.pricingRules),\n commitment: commitmentFromAPI(pApi.commitment),\n volumeCommitment: pApi.volumeCommitment || 0,\n isStartingPrice: pApi.isStartingPrice || false,\n resolvedFrom: pApi.resolvedFrom,\n setupFee: pApi.setupFee || 0,\n fees: feesFromApi(pApi.fees || []),\n };\n}\n\nexport function pricesFromApi(pApi: ProductPricesInterface[]): ProductPrices[] {\n return pApi?.map(\n (p) =>\n p &&\n ({\n sku: p.sku,\n prices: (p.prices || []).map((price) => price && productPricingFromApi(price)),\n } as ProductPrices),\n );\n}\n\nexport function productPricingToApiCurrencyMap(productPricing: ProductPricing): {\n [currencyCode: string]: ApiPricingPlanProductPricing;\n} {\n if (!productPricing) {\n return {};\n }\n const apiPricing = productPricingToApi(productPricing);\n return { [apiPricing.currencyCode]: apiPricing };\n}\n\nexport function productPricingToApi(productPricing: ProductPricing): ApiPricingPlanProductPricing {\n return new ApiPricingPlanProductPricing({\n type: productPricingTypeToApi(productPricing.pricingType),\n rules: productPricingRulesToApi(productPricing.pricingRules),\n setupFee: productPricing.setupFee,\n fees: feesToApi(productPricing.fees),\n frequency: frequencyToApi(productPricing.frequency),\n currencyCode: productPricing.currency,\n });\n}\n","import { SubscriptionStatus as SubscriptionStatusApi } from '@vendasta/billing';\n\nexport enum SubscriptionStatus {\n Unset = 'Unset',\n Active = 'Active',\n Inactive = 'Inactive',\n}\n\nexport function subscriptionStatusFromApi(sApi: SubscriptionStatusApi | undefined): SubscriptionStatus {\n switch (sApi) {\n case SubscriptionStatusApi.SUBSCRIPTION_STATUS_ACTIVE:\n return SubscriptionStatus.Active;\n case SubscriptionStatusApi.SUBSCRIPTION_STATUS_EXPIRED:\n return SubscriptionStatus.Inactive;\n default:\n return SubscriptionStatus.Unset;\n }\n}\n\nexport function subscriptionStatusToApi(subscriptionStatus: SubscriptionStatus): SubscriptionStatusApi {\n switch (subscriptionStatus) {\n case SubscriptionStatus.Active:\n return SubscriptionStatusApi.SUBSCRIPTION_STATUS_ACTIVE;\n case SubscriptionStatus.Inactive:\n return SubscriptionStatusApi.SUBSCRIPTION_STATUS_EXPIRED;\n default:\n return SubscriptionStatusApi.SUBSCRIPTION_STATUS_UNSET;\n }\n}\n\nexport function isSubscriptionStatus(str: string): str is SubscriptionStatus {\n return Object.values(SubscriptionStatus).includes(str as SubscriptionStatus);\n}\n","import { Source as SubscriptionSourceApi } from '@vendasta/billing';\n\nexport enum SubscriptionSource {\n Unset = '',\n System = 'System',\n User = 'User',\n}\n\nexport function subscriptionSourceFromApi(sApi: SubscriptionSourceApi | undefined): SubscriptionSource {\n switch (sApi) {\n case SubscriptionSourceApi.SOURCE_SYSTEM:\n return SubscriptionSource.System;\n case SubscriptionSourceApi.SOURCE_USER:\n return SubscriptionSource.User;\n default:\n return SubscriptionSource.Unset;\n }\n}\n\nexport function subscriptionSourceToApi(source: SubscriptionSource): SubscriptionSourceApi {\n switch (source) {\n case SubscriptionSource.System:\n return SubscriptionSourceApi.SOURCE_SYSTEM;\n case SubscriptionSource.User:\n return SubscriptionSourceApi.SOURCE_USER;\n default:\n return SubscriptionSourceApi.SOURCE_UNSET;\n }\n}\n","import {\n BillableItem as BillableItemApi,\n BillableItemCustomerAddressInterface,\n Frequency as FrequencyApi,\n SubscriptionStatus as SubscriptionStatusApi,\n RenewalState as RenewalStateApi,\n} from '@vendasta/billing';\nimport {\n Frequency,\n frequencyFromApi,\n ProductPricing,\n productPricingFromApi,\n SubscriptionStatus,\n subscriptionStatusFromApi,\n} from '../pricing';\nimport { SubscriptionSource, subscriptionSourceFromApi } from '../pricing/source';\n\nexport interface ListBillableItemsFilter {\n skus?: string[];\n merchantId?: string;\n customerId?: string;\n}\n\nexport interface ListSubscriptionsFilter {\n skus?: string[];\n merchantId?: string;\n customerId?: string;\n searchTerm?: string;\n status?: SubscriptionStatusApi;\n expiredDateGte?: Date;\n expiredDateLte?: Date;\n frequencies?: FrequencyApi[];\n}\n\nexport interface SubscriptionsProjectionFilter {\n price?: boolean;\n}\n\nexport interface ListSubscriptionsFilterHttp {\n skus?: string[];\n merchantId?: string;\n customerId?: string;\n}\n\nexport interface CustomerAddress {\n address?: string;\n city?: string;\n state?: string;\n zip?: string;\n country?: string;\n}\n\nexport interface BillableItem {\n subscriptionId: string;\n merchantId: string;\n sku: string;\n productName: string;\n customerId: string;\n customerName: string;\n orderId: string;\n expiry?: Date;\n billingStart?: Date;\n created?: Date;\n updated?: Date;\n frequency: Frequency;\n retailFrequency: Frequency;\n nextRenewal?: Date;\n nextRetailRenewal?: Date;\n customerAddress: CustomerAddress;\n customUnitPrice: number;\n retailUnitPrice: number;\n status?: SubscriptionStatus;\n price?: ProductPricing;\n source?: SubscriptionSource;\n autoBillable: boolean;\n description?: string;\n}\n\nexport enum RenewalState {\n Immediate = 'IMMEDIATE',\n Delayed = 'DELAYED',\n}\n\nfunction customerAddressFromApi(apiAddress: BillableItemCustomerAddressInterface | undefined): CustomerAddress {\n return {\n address: apiAddress?.address || '',\n city: apiAddress?.city || '',\n state: apiAddress?.state || '',\n zip: apiAddress?.zip || '',\n country: apiAddress?.country || '',\n };\n}\n\nexport function billableItemFromApi(apiItem: BillableItemApi): BillableItem {\n const zeroDate = new Date('0001-01-01T00:00:00Z').valueOf();\n\n return {\n subscriptionId: apiItem.subscriptionId || '',\n merchantId: apiItem.merchantId || '',\n sku: apiItem.sku || '',\n productName: apiItem.productName || '',\n customerId: apiItem.customerId || '',\n customerName: apiItem.customerName || '',\n orderId: apiItem.orderId || '',\n expiry: apiItem.expiry.valueOf() !== zeroDate ? new Date(apiItem.expiry) : undefined,\n billingStart: apiItem.billingStart.valueOf() !== zeroDate ? new Date(apiItem.billingStart) : undefined,\n created: apiItem.created.valueOf() !== zeroDate ? new Date(apiItem.created) : undefined,\n updated: apiItem.updated.valueOf() !== zeroDate ? new Date(apiItem.updated) : undefined,\n frequency: frequencyFromApi(apiItem.frequency),\n retailFrequency: frequencyFromApi(apiItem.retailFrequency),\n nextRenewal: apiItem.nextRenewal.valueOf() !== zeroDate ? new Date(apiItem.nextRenewal) : undefined,\n nextRetailRenewal:\n apiItem.nextRetailRenewal.valueOf() !== zeroDate ? new Date(apiItem.nextRetailRenewal) : undefined,\n customerAddress: customerAddressFromApi(apiItem.customerAddress),\n customUnitPrice: apiItem.customUnitPrice || 0,\n retailUnitPrice: apiItem.retailUnitPrice || 0,\n status: subscriptionStatusFromApi(apiItem.status),\n price: apiItem.price ? productPricingFromApi(apiItem.price) : undefined,\n source: subscriptionSourceFromApi(apiItem.source),\n autoBillable: apiItem.autoBillable,\n description: apiItem.description || '',\n };\n}\n\nexport function listSubscriptionsFiltersToHTTPJson(filters: ListBillableItemsFilter): ListSubscriptionsFilterHttp {\n return {\n merchantId: filters.merchantId,\n customerId: filters.customerId,\n skus: filters.skus,\n };\n}\n\nexport function renewalStateToApi(state: RenewalState): RenewalStateApi {\n if (state === RenewalState.Delayed) {\n return RenewalStateApi.RENEWAL_STATE_DELAYED;\n }\n return RenewalStateApi.RENEWAL_STATE_IMMEDIATE;\n}\n","/* Api service for billing's http endpoints */\n\nimport { Injectable } from '@angular/core';\nimport { HttpClient } from '@angular/common/http';\nimport { Observable } from 'rxjs';\nimport { share, catchError } from 'rxjs/operators';\nimport { DownloadCsvRequestInterface } from './revenue.interfaces';\nimport { handleCsvError } from '../http-shared/error-handlers';\nimport { HostService } from '@vendasta/billing';\n\n@Injectable({ providedIn: 'root' })\nexport class RevenueApiService {\n constructor(private hostService: HostService, private http: HttpClient) {}\n\n downloadCsv(r: DownloadCsvRequestInterface): Observable {\n const queryParams = `?filename=${r.filename}`;\n return this.http\n .get(this.hostService.hostWithScheme + '/revenue-csv' + queryParams, this.apiOptions())\n .pipe(share(), catchError(handleCsvError));\n }\n\n private apiOptions(): { responseType: 'blob'; withCredentials: boolean } {\n return {\n responseType: 'blob',\n withCredentials: true,\n };\n }\n}\n","/* Api service for billing's http endpoints */\n\nimport { HttpClient } from '@angular/common/http';\nimport { Injectable } from '@angular/core';\nimport { HostService } from '@vendasta/billing';\nimport { Observable } from 'rxjs';\nimport { catchError, share } from 'rxjs/operators';\nimport { handleCsvError } from '../http-shared/error-handlers';\nimport { DownloadMerchantReportCsvRequest } from './merchant-report.interfaces';\n\n@Injectable({ providedIn: 'root' })\nexport class MerchantReportApiService {\n constructor(private hostService: HostService, private http: HttpClient) {}\n\n downloadCsv(r: DownloadMerchantReportCsvRequest): Observable {\n const queryParams = `?merchantID=${r.merchantId}&year=${r.year}&month=${r.month}`;\n return this.http\n .get(this.hostService.hostWithScheme + '/billing-report/get' + queryParams, this.apiOptions())\n .pipe(share(), catchError(handleCsvError));\n }\n\n generateCsv(r: DownloadMerchantReportCsvRequest): Observable {\n const queryParams = `?merchantID=${r.merchantId}&year=${r.year}&month=${r.month}`;\n return this.http\n .get(this.hostService.hostWithScheme + '/billing-report/generate' + queryParams, this.apiOptions())\n .pipe(share(), catchError(handleCsvError));\n }\n\n private apiOptions(): { responseType: 'blob'; withCredentials: boolean } {\n return {\n responseType: 'blob',\n withCredentials: true,\n };\n }\n}\n","import { PurchaseStatus as PurchaseStatusApi } from '@vendasta/billing';\n\nexport enum PurchaseStatus {\n Unset = 'UNSET',\n Pending = 'PENDING',\n Due = 'DUE',\n Success = 'SUCCESS',\n Dunning = 'DUNNING',\n Failed = 'FAILED',\n}\n\nexport function purchaseStatusFromApi(psApi: PurchaseStatusApi | undefined): PurchaseStatus {\n switch (psApi) {\n case PurchaseStatusApi.PURCHASE_STATUS_PENDING:\n return PurchaseStatus.Pending;\n case PurchaseStatusApi.PURCHASE_STATUS_DUE:\n return PurchaseStatus.Due;\n case PurchaseStatusApi.PURCHASE_STATUS_SUCCESS:\n return PurchaseStatus.Success;\n case PurchaseStatusApi.PURCHASE_STATUS_DUNNING:\n return PurchaseStatus.Dunning;\n case PurchaseStatusApi.PURCHASE_STATUS_FAILED:\n return PurchaseStatus.Failed;\n }\n return PurchaseStatus.Unset;\n}\n","import { AppliedDiscount, appliedDiscountFromApi } from '../applied_discount';\nimport { AppliedTaxRate } from '../invoice/invoice';\nimport { BillingStrategy, billingStrategyFromAPI, Currency, currencyFromApi } from '../pricing';\nimport {\n AppliedCreditInterface,\n AppliedTaxRateInterface,\n CreditType,\n Currency as CurrencyApi,\n PurchaseInterface,\n PurchaseItemInterface,\n} from '@vendasta/billing';\nimport { PurchaseStatus, purchaseStatusFromApi } from './purchase_status';\n\nexport interface Purchase {\n merchantId: string;\n timestamp?: Date;\n purchaseId: string;\n total: number;\n currency: Currency;\n renewal: boolean;\n items: PurchaseItem[];\n billingStrategy: BillingStrategy;\n isDunning: boolean;\n dunningAttempt: number;\n pauseDunningUntil?: Date;\n voided?: Date;\n paid: boolean;\n status: PurchaseStatus;\n creditAmount: number;\n appliedCredits: AppliedCredit[];\n taxAmount: number;\n appliedTaxRates: AppliedTaxRate[];\n}\n\nexport enum AppliedCreditType {\n CREDIT_TYPE_CREDIT_NOTE = 'Credit note',\n CREDIT_TYPE_PROMOTIONAL = 'Promotional',\n CREDIT_TYPE_UNSET = '',\n}\n\nexport interface AppliedCredit {\n appliedAmount: number;\n referenceId: string;\n referenceType: AppliedCreditType;\n}\n\nexport interface PurchaseItem {\n sku: string;\n description: string;\n amount: number;\n orderId: string;\n customerId: string;\n discountAmount: number;\n total: number;\n currency?: Currency;\n appliedDiscounts: AppliedDiscount[];\n taxAmount: number;\n appliedTaxRates: AppliedTaxRate[];\n setupFee?: number;\n feeAmount?: number;\n\n merchantId: string;\n purchaseDay: string;\n purchaseId: string;\n}\n\nexport function purchaseFromApi(pApi: PurchaseInterface): Purchase {\n return {\n merchantId: pApi.merchantId || '',\n timestamp: pApi.timestamp ? new Date(pApi.timestamp) : undefined,\n purchaseId: pApi.purchaseId || '',\n total: pApi.total || 0,\n currency: pApi.currency ? currencyFromApi(pApi.currency) : Currency.USD,\n renewal: pApi.renewal || false,\n items: pApi.items ? pApi.items.map((p) => purchaseItemFromApi(p)) : [],\n billingStrategy: billingStrategyFromAPI(pApi.billingStrategy),\n isDunning: pApi.isDunning || false,\n dunningAttempt: pApi.dunningAttempt || 0,\n pauseDunningUntil: pApi.pauseDunningUntil ? new Date(pApi.pauseDunningUntil) : undefined,\n voided: pApi.voided ? new Date(pApi.voided) : undefined,\n paid: pApi.paid || false,\n status: purchaseStatusFromApi(pApi.status),\n creditAmount: pApi.creditAmount || 0,\n appliedCredits: pApi.appliedCredits ? pApi.appliedCredits.map((ac) => appliedCreditFromAPI(ac)) : [],\n taxAmount: pApi.taxAmount || 0,\n appliedTaxRates: (pApi.appliedTaxRates || []).map((at) => appliedTaxRateFromAPI(at)),\n };\n}\n\nexport function purchaseItemFromApi(pApi: PurchaseItemInterface, currencyApi?: CurrencyApi): PurchaseItem {\n let currency;\n if (currencyApi !== undefined) {\n currency = currencyFromApi(currencyApi);\n }\n return {\n sku: pApi.sku || '',\n description: pApi.description || '',\n amount: pApi.amount || 0,\n orderId: pApi.orderId || '',\n customerId: pApi.customerId || '',\n discountAmount: pApi.discountAmount || 0,\n total: pApi.total || 0,\n currency: currency || Currency.USD,\n appliedDiscounts: pApi.appliedDiscounts ? pApi.appliedDiscounts.map((p) => appliedDiscountFromApi(p)) : [],\n merchantId: pApi.merchantId || '',\n purchaseDay: pApi.day || '',\n purchaseId: pApi.purchaseId || '',\n taxAmount: pApi.taxAmount || 0,\n appliedTaxRates: (pApi.appliedTaxRates || []).map((at) => appliedTaxRateFromAPI(at)),\n setupFee: pApi.setupFee || 0,\n feeAmount: pApi.feeAmount || 0,\n };\n}\n\nexport function appliedCreditFromAPI(ac: AppliedCreditInterface): AppliedCredit {\n return {\n appliedAmount: ac.appliedAmount || 0,\n referenceId: ac.referenceId || '',\n referenceType: appliedCreditTypeFromAPI(ac.referenceType),\n };\n}\n\nexport function appliedCreditTypeFromAPI(adt: CreditType | undefined): AppliedCreditType {\n switch (adt) {\n case CreditType.CREDIT_TYPE_CREDIT_NOTE:\n return AppliedCreditType.CREDIT_TYPE_CREDIT_NOTE;\n case CreditType.CREDIT_TYPE_PROMOTIONAL:\n return AppliedCreditType.CREDIT_TYPE_PROMOTIONAL;\n }\n return AppliedCreditType.CREDIT_TYPE_UNSET;\n}\n\nexport function appliedTaxRateFromAPI(at: AppliedTaxRateInterface): AppliedTaxRate {\n return {\n amount: at.amount || 0,\n name: at.name || '',\n percentage: at.percentage || 0,\n taxRateId: at.taxRateId || '',\n };\n}\n","import { CustomerSummaryInterface } from '@vendasta/billing';\nimport { Currency, currencyFromApi } from '../pricing';\n\nexport interface CustomerSummary {\n customerId: string;\n purchaseItemQuantity: number;\n purchaseItemTotal: number;\n currency: Currency;\n}\n\nexport function customerSummaryFromApi(csApi: CustomerSummaryInterface): CustomerSummary {\n let currency;\n if (csApi.currency !== undefined) {\n currency = currencyFromApi(csApi.currency);\n }\n return {\n customerId: csApi.customerId || '',\n purchaseItemQuantity: csApi.purchaseItemQuantity || 0,\n purchaseItemTotal: csApi.purchaseItemTotal || 0,\n currency: currency || Currency.USD,\n };\n}\n","export class Dimension {\n dimensionId: string;\n name: string;\n\n constructor(id: string) {\n this.dimensionId = id;\n this.name = id;\n }\n}\n\nexport const ChannelPartnersDiamond = new Dimension('Diamond');\nexport const ChannelPartnersPlatinum = new Dimension('Platinum');\nexport const ChannelPartnersGold = new Dimension('Gold');\nexport const ChannelPartnersSilver = new Dimension('Silver');\nexport const ChannelPartnersUnassisted = new Dimension('Unassisted');\nexport const ChannelPartnersChurned = new Dimension('Churned Partners');\nexport const ChannelPartnersPreSales = new Dimension('Pre-Sales');\nexport const ChannelPartnersUnassigned = new Dimension('Unassigned');\nexport const ChannelPartnersMedia = new Dimension('Media');\nexport const ChannelPartnersBroadcast = new Dimension('Broadcast');\nexport const ChannelPartnersISV = new Dimension('ISV');\nexport const ChannelPartnersICT = new Dimension('ICT');\nexport const ChannelPartnersFranchise = new Dimension('Franchise');\nexport const ChannelPartnersBroadly = new Dimension('Broadly');\nexport const ChannelPartnersEMEA = new Dimension('EMEA');\nexport const ChannelPartnersAgency = new Dimension('Agency');\nexport const ChannelPartnersHighVelocityExpansion = new Dimension('High Velocity Expansion');\nexport const ChannelPartnersHighVelocityAcquisition = new Dimension('High Velocity Acquisition');\n\nexport const LEGACY_DIMENSIONS = [\n ChannelPartnersDiamond,\n ChannelPartnersPlatinum,\n ChannelPartnersGold,\n ChannelPartnersSilver,\n ChannelPartnersUnassisted,\n ChannelPartnersChurned,\n ChannelPartnersPreSales,\n ChannelPartnersUnassigned,\n];\n\nexport const SERVICE_TIERS = [\n ChannelPartnersMedia,\n ChannelPartnersBroadcast,\n ChannelPartnersISV,\n ChannelPartnersICT,\n ChannelPartnersFranchise,\n ChannelPartnersBroadly,\n ChannelPartnersEMEA,\n ChannelPartnersAgency,\n ChannelPartnersHighVelocityExpansion,\n ChannelPartnersHighVelocityAcquisition,\n];\n","import { ContractInterface } from '@vendasta/billing';\nimport { Currency, currencyFromApi } from '../pricing';\nimport { Dimension } from './dimension';\n\nexport interface Contract {\n merchantId: string;\n netD: number;\n created?: Date;\n subscriptionId: string;\n dimension: Dimension;\n currency: Currency;\n signed?: Date;\n end?: Date;\n activated?: Date;\n modified?: Date;\n verified?: Date;\n status: string;\n creditLimit: number;\n pricingPlanId: string;\n}\n\nexport function contractFromApi(cApi: ContractInterface): Contract {\n return {\n merchantId: cApi.merchantId || '',\n netD: cApi.netD || 0,\n created: cApi.created || undefined,\n subscriptionId: cApi.subscriptionId || '',\n dimension: new Dimension(cApi.dimension || ''),\n currency: currencyFromApi(cApi.currency),\n signed: cApi.signed || undefined,\n end: cApi.end || undefined,\n activated: cApi.activated || undefined,\n modified: cApi.modified || undefined,\n verified: cApi.verified || undefined,\n status: cApi.status || '',\n creditLimit: cApi.creditLimit || 0,\n pricingPlanId: cApi.pricingPlanId || '',\n };\n}\n","import { ProductInterface } from '@vendasta/billing';\n\nexport interface Product {\n name: string;\n sku: string;\n iconUrl: string;\n hasPricingOverride: boolean;\n hasDiscount: boolean;\n}\n\nexport function productFromApi(apiProduct: ProductInterface): Product {\n return {\n name: apiProduct.name || '',\n sku: apiProduct.sku || '',\n iconUrl: apiProduct.iconUrl || '',\n hasPricingOverride: apiProduct.hasPricingOverride || false,\n hasDiscount: apiProduct.hasDiscount || false,\n };\n}\n","import { ListProductsRequestListProductsFiltersInterface, ProductType as ApiProductType } from '@vendasta/billing';\n\nexport interface ListProductsFilter {\n hasDiscount?: boolean;\n hasPricingOverride?: boolean;\n skus?: string[];\n productType?: ProductType[];\n}\n\nexport enum ProductType {\n Invalid,\n Standard,\n Vendasta,\n Subscription,\n Fee,\n PartnerSupportSales,\n}\n\nexport function listProductsFilterToApi(filter: ListProductsFilter): ListProductsRequestListProductsFiltersInterface {\n return {\n ...filter,\n productType: (filter.productType || []).map((pt) => productTypeToApi(pt)),\n };\n}\n\nfunction productTypeToApi(productType: ProductType): ApiProductType {\n switch (productType) {\n case ProductType.Standard:\n return ApiProductType.PRODUCT_TYPE_STANDARD_PRODUCT;\n case ProductType.Vendasta:\n return ApiProductType.PRODUCT_TYPE_VENDASTA_PRODUCT;\n case ProductType.Subscription:\n return ApiProductType.PRODUCT_TYPE_SUBSCRIPTION;\n case ProductType.Fee:\n return ApiProductType.PRODUCT_TYPE_FEE;\n case ProductType.PartnerSupportSales:\n return ApiProductType.PRODUCT_TYPE_PARTNER_SUPPORT_SALES;\n }\n return ApiProductType.PRODUCT_TYPE_INVALID;\n}\n","import { Injectable } from '@angular/core';\nimport {\n BillingApiService,\n CanCreateSubscriptionsRequest,\n CanCreateSubscriptionsRequestSubscriptionItemInterface,\n CanCreateSubscriptionsResponse,\n ChangeCustomUnitPriceRequest,\n ChangeFrequencyRequest,\n ChangeRenewalDateRequest,\n Commitment as CommitmentApi,\n CreatePricingPlanProductRequest,\n Currency,\n DeletePricingPlanProductRequest,\n FieldMask,\n GenerateVendorReportRequest,\n GetBillableItemRequest,\n GetMultiCustomerSummariesRequest,\n GetMultiProductRequest,\n GetMultiProductResponse,\n GetPricingPlanProductRequest,\n GetPurchaseCostRequest,\n GetPurchaseCostResponse,\n GetRevenueStatsRequest,\n ListBillableItemsRequest,\n ListContractsRequest,\n ListMerchantBillingReportsRequest,\n ListPricingPlanProductsRequest,\n ListProductsRequest,\n ListPurchaseItemsRequestListPurchaseItemsFilters,\n ListPurchaseRequest,\n ListSubscriptionsRequest,\n MerchantReportStatus,\n PagedRequestOptions,\n PauseDunningRequest,\n PricingApiService,\n PurchaseApiService,\n ResumeDunningRequest,\n RetryPurchaseRequest,\n UpdatePricingPlanProductRequest,\n VendorApiService,\n VoidPurchaseRequest,\n ExpireBillableItemRequest,\n CreateSubscriptionRequest,\n SetAutoBillableRequest,\n UpdateSubscriptionRequest,\n UpdateSubscriptionResponse,\n CreateSubscriptionResponse,\n} from '@vendasta/billing';\nimport {\n BillingStrategy,\n billingStrategyFromAPI,\n billingStrategyToAPI,\n ListPricingPlanProductFilter,\n PricingPlanProduct,\n pricingPlanProductFromApi,\n} from './pricing';\n\nimport { Observable } from 'rxjs';\nimport { map, mapTo } from 'rxjs/operators';\nimport { RevenueApiService } from './revenue/revenue.service';\nimport { MerchantReportApiService } from './merchant-report/merchant-report.service';\nimport { MerchantReport } from './merchant-report/merchant-report';\nimport { HttpResponse } from '@angular/common/http';\nimport { ProductPricing, productPricingFromApi } from './pricing/product-pricing';\nimport { PagedResponse } from './core/paged-response';\nimport { Frequency, frequencyToApi } from './pricing/frequency';\nimport { Commitment } from './pricing/commitment';\nimport { CurrencyPricingMap, currencyPricingMapToApi } from './pricing/pricing-plan-product';\nimport { Purchase, purchaseFromApi, PurchaseItem, purchaseItemFromApi } from './purchase/purchase';\nimport { ListPurchaseFilter } from './purchase/list-purchases';\nimport { CustomerSummary, customerSummaryFromApi } from './customer_summary/customer-summary';\nimport { Contract, contractFromApi } from './contract';\nimport { Product, productFromApi } from './product/product';\nimport { ListProductsFilter, listProductsFilterToApi } from './product/list-products';\nimport {\n BillableItem,\n billableItemFromApi,\n ListBillableItemsFilter,\n ListSubscriptionsFilter,\n SubscriptionsProjectionFilter,\n} from './billable-item/billable-item';\nimport { CanCreateSubscriptionsItem } from './subscription';\n\nconst isCanCreateSubscriptionsRequestSubscriptionItem = (\n li: CanCreateSubscriptionsRequestSubscriptionItemInterface | undefined,\n): li is CanCreateSubscriptionsRequestSubscriptionItemInterface => {\n return !!li;\n};\n@Injectable({ providedIn: 'root' })\nexport class BillingService {\n constructor(\n private billingApi: BillingApiService,\n private revenueApi: RevenueApiService,\n private merchantReportApi: MerchantReportApiService,\n private pricingApi: PricingApiService,\n private purchaseApi: PurchaseApiService,\n private vendorApi: VendorApiService,\n ) {}\n\n /** deprecated */\n getPurchaseCost(merchantId: string, sku: string, quantity: number): Observable {\n const req = new GetPurchaseCostRequest({\n merchantId: merchantId,\n sku: sku,\n quantity: quantity,\n });\n return this.billingApi.getPurchaseCost(req).pipe(\n map((response) => {\n if (!response.currency) {\n response.currency = Currency.USD;\n }\n return response;\n }),\n );\n }\n\n /** deprecated: Use canCreateSubscriptionsWithFrequencies instead. */\n canCreateSubscriptions(\n merchantId: string,\n skus: { [sku: string]: number },\n ): Observable {\n const req = new CanCreateSubscriptionsRequest({\n merchantId: merchantId,\n skus: skus,\n });\n return this.billingApi.canCreateSubscriptions(req);\n }\n\n canCreateSubscriptionsWithFrequencies(\n merchantId: string,\n items: CanCreateSubscriptionsItem[],\n ): Observable {\n const req = new CanCreateSubscriptionsRequest({\n merchantId: merchantId,\n items: (items || [])\n .map((item) => {\n if (!item) {\n return undefined;\n }\n return {\n sku: item.sku,\n frequency: frequencyToApi(item.frequency),\n quantity: item.quantity || 0,\n } as CanCreateSubscriptionsRequestSubscriptionItemInterface;\n })\n .filter(isCanCreateSubscriptionsRequestSubscriptionItem),\n });\n return this.billingApi.canCreateSubscriptions(req);\n }\n\n downloadRevenueCsv(filename: string): Observable {\n return this.revenueApi.downloadCsv({ filename });\n }\n\n downloadBillingReportCsv(merchantId: string, year: number, month: number): Observable {\n return this.merchantReportApi.downloadCsv({ merchantId, year, month });\n }\n\n generateBillingReportCsv(merchantId: string, year: number, month: number): Observable {\n return this.merchantReportApi.generateCsv({ merchantId, year, month });\n }\n\n listMerchantBillingReports(\n merchantId: string,\n cursor: string,\n pageSize: number,\n ): Observable> {\n const req = new ListMerchantBillingReportsRequest({\n merchantId: merchantId,\n pagingOptions: new PagedRequestOptions({ cursor, pageSize }),\n });\n return this.billingApi.listMerchantBillingReports(req).pipe(\n map((resp) => {\n const reports = (resp.reports || []).map((r) => {\n return {\n merchantId: r.merchantId,\n year: r.year,\n month: r.month,\n created: r.created,\n status: MerchantReportStatus[r.status || 0],\n } as MerchantReport;\n });\n return new PagedResponse(reports, resp.pagingMetadata.nextCursor, resp.pagingMetadata.hasMore);\n }),\n );\n }\n\n canBillCreateSnapshot(merchantId: string): Observable> {\n return this.billingApi.canBillItem({ merchantId: merchantId, sku: 'ST' });\n }\n\n canBillRefreshSnapshot(merchantId: string): Observable> {\n return this.billingApi.canBillItem({ merchantId: merchantId, sku: 'snapshotreportrefresh' });\n }\n\n canBillItem(merchantId: string, sku: string): Observable {\n return this.billingApi.canBillItem({ merchantId: merchantId, sku: sku }).pipe(map((response) => response.ok));\n }\n\n createPricingPlanProduct(\n pricingPlanId: string,\n sku: string,\n frequency: Frequency,\n pricing: CurrencyPricingMap,\n commitment: Commitment,\n strategy: BillingStrategy,\n volumeCommitment: number,\n volumeCommitmentStartsAt?: Date,\n volumeCommitmentEndsAt?: Date,\n ): Observable {\n const request = new CreatePricingPlanProductRequest({\n pricingPlanId,\n sku,\n volumeCommitment,\n volumeCommitmentStartsAt,\n volumeCommitmentEndsAt,\n });\n request.frequency = frequencyToApi(frequency);\n request.pricing = currencyPricingMapToApi(pricing);\n request.commitment = new CommitmentApi(commitment);\n request.strategy = billingStrategyToAPI(strategy);\n return this.billingApi.createPricingPlanProduct(request).pipe(mapTo(true));\n }\n\n updatePricingPlanProduct(\n pricingPlanId: string,\n sku: string,\n {\n frequency,\n pricing,\n commitment,\n strategy,\n volumeCommitment,\n volumeCommitmentStartsAt,\n volumeCommitmentEndsAt,\n }: {\n frequency?: Frequency;\n pricing?: CurrencyPricingMap;\n commitment?: Commitment;\n strategy?: BillingStrategy;\n volumeCommitment?: number;\n volumeCommitmentStartsAt?: Date;\n volumeCommitmentEndsAt?: Date;\n },\n ): Observable {\n const fieldMask = new FieldMask({ paths: [] });\n const request = new UpdatePricingPlanProductRequest({ pricingPlanId, sku });\n\n if (frequency !== null) {\n request.frequency = frequencyToApi(frequency);\n fieldMask.paths.push('frequency');\n }\n if (pricing !== null) {\n request.pricing = currencyPricingMapToApi(pricing);\n fieldMask.paths.push('pricing');\n }\n if (commitment !== null) {\n request.commitment = new CommitmentApi(commitment);\n fieldMask.paths.push('commitment');\n }\n if (strategy !== null) {\n request.strategy = billingStrategyToAPI(strategy);\n fieldMask.paths.push('strategy');\n }\n if (volumeCommitment !== null) {\n request.volumeCommitment = volumeCommitment || 0;\n fieldMask.paths.push('volumeCommitment');\n }\n if (volumeCommitmentStartsAt) {\n request.volumeCommitmentStartsAt = volumeCommitmentStartsAt;\n fieldMask.paths.push('volumeCommitmentStartsAt');\n }\n if (volumeCommitmentEndsAt) {\n request.volumeCommitmentEndsAt = volumeCommitmentEndsAt;\n fieldMask.paths.push('volumeCommitmentEndsAt');\n }\n return this.billingApi.updatePricingPlanProduct(request).pipe(mapTo(true));\n }\n\n deletePricingPlanProduct(pricingPlanId: string, sku: string): Observable {\n const request = new DeletePricingPlanProductRequest({ pricingPlanId, sku });\n return this.billingApi.deletePricingPlanProduct(request).pipe(mapTo(true));\n }\n\n /** deprecated - Use getMultiWholesalePrices from the WholesalePricingService */\n getMultiProductPricing(\n merchantId: string,\n skus: string[],\n pricingPlanId?: string,\n ): Observable<{ [sku: string]: ProductPricing }> {\n return this.billingApi.getMultiProductPricing({ merchantId, skus, pricingPlanId }).pipe(\n map((r) => {\n const productPricesApi = r.productPrices || {};\n const productPricings: { [key: string]: ProductPricing } = {};\n for (const k of Object.keys(productPricesApi)) {\n const productPricingResponse = productPricesApi[k];\n productPricings[k] = productPricingFromApi(productPricingResponse);\n }\n return productPricings;\n }),\n );\n }\n\n /** deprecated - Use getMultiRetailPrices from the RetailPricingService */\n getMultiRetailPricing(\n merchantId: string,\n currency: Currency,\n skus: string[],\n groupId?: string,\n ): Observable<{ [sku: string]: ProductPricing }> {\n const requestGroupId: string = groupId === undefined ? '' : groupId;\n return this.pricingApi.getMultiRetail({ merchantId, currency, skus, groupId: requestGroupId }).pipe(\n map((r) => {\n const retailPricesApi = r.productPrices || {};\n const retailPricings: { [key: string]: ProductPricing } = {};\n for (const k of Object.keys(retailPricesApi)) {\n const retailPricingResponse = retailPricesApi[k];\n retailPricings[k] = productPricingFromApi(retailPricingResponse);\n }\n return retailPricings;\n }),\n );\n }\n\n listPricingPlanProducts(\n filters: ListPricingPlanProductFilter,\n cursor: string,\n pageSize: number,\n ): Observable> {\n const req = new ListPricingPlanProductsRequest({\n filters: filters,\n pagingOptions: new PagedRequestOptions({ cursor, pageSize }),\n });\n return this.billingApi.listPricingPlanProducts(req).pipe(\n map((response) => {\n const products = (response.products || []).map((p) => pricingPlanProductFromApi(p));\n return new PagedResponse(products, response.pagingMetadata.nextCursor, response.pagingMetadata.hasMore);\n }),\n );\n }\n\n getPricingPlanProduct(pricingPlanId: string, sku: string): Observable {\n const req = new GetPricingPlanProductRequest({ pricingPlanId, sku });\n return this.billingApi.getPricingPlanProduct(req).pipe(\n map((resp) => {\n const ppp: PricingPlanProduct = pricingPlanProductFromApi(resp.pricingPlanProduct);\n ppp.defaultStrategy = billingStrategyFromAPI(resp.pricingPlanDefaultStrategy);\n return ppp;\n }),\n );\n }\n\n listPurchases(filters: ListPurchaseFilter, cursor: string, pageSize: number): Observable> {\n const req = new ListPurchaseRequest({\n filters: filters,\n pagingOptions: new PagedRequestOptions({ cursor, pageSize }),\n });\n return this.purchaseApi.list(req).pipe(\n map((response) => {\n const purchases = (response.purchases || []).map((purchase) => purchaseFromApi(purchase));\n return new PagedResponse(purchases, response.pagingMetadata.nextCursor, response.pagingMetadata.hasMore);\n }),\n );\n }\n\n voidPurchase(merchantId: string, purchaseId: string, day: string): Observable {\n const req = new VoidPurchaseRequest({ purchaseId, merchantId, day });\n return this.purchaseApi.void(req).pipe(mapTo(true));\n }\n\n listPurchaseItems(\n filters: ListPurchaseItemsRequestListPurchaseItemsFilters,\n cursor: string,\n pageSize: number,\n ): Observable> {\n const req = new ListPurchaseRequest({\n filters: filters,\n pagingOptions: new PagedRequestOptions({ cursor, pageSize }),\n });\n return this.purchaseApi.listPurchaseItems(req).pipe(\n map((response) => {\n const purchaseItems = (response.purchaseItems || []).map((purchaseItem) =>\n purchaseItemFromApi(purchaseItem, response.currency),\n );\n return new PagedResponse(purchaseItems, response.pagingMetadata.nextCursor, response.pagingMetadata.hasMore);\n }),\n );\n }\n\n retryPurchase(merchantId: string, day: string, purchaseId: string): Observable {\n const req = new RetryPurchaseRequest({\n merchantId: merchantId,\n day: day,\n purchaseId: purchaseId,\n });\n return this.purchaseApi.retry(req).pipe(map(() => true));\n }\n\n getMultiCustomerSummaries(\n merchantId: string,\n customerIds: string[],\n periodStart: Date,\n periodEnd: Date,\n ): Observable {\n const req = new GetMultiCustomerSummariesRequest({\n customerIds: customerIds,\n merchantId: merchantId,\n periodStart: periodStart,\n periodEnd: periodEnd,\n });\n return this.purchaseApi.getMultiCustomerSummaries(req).pipe(\n map((response) => {\n return (response.customerSummaries || []).map((customerSummary) => customerSummaryFromApi(customerSummary));\n }),\n );\n }\n\n getMultiContract(merchantIds: string[]): Observable<{ [sku: string]: Contract }> {\n return this.billingApi.getMultiContract({ merchantIds: merchantIds }).pipe(\n map((resp) => {\n const contractsAPI = resp.contracts || {};\n const contracts: { [key: string]: Contract } = {};\n for (const k of Object.keys(contractsAPI)) {\n const contractResponse = contractsAPI[k];\n contracts[k] = contractFromApi(contractResponse);\n }\n return contracts;\n }),\n );\n }\n\n getMerchantWholesaleCurrency(merchantId: string): Observable {\n return this.billingApi.getMerchantWholesaleCurrency({ merchantId: merchantId }).pipe(\n map((resp) => {\n return Currency[resp.currency] || 'USD';\n }),\n );\n }\n\n generateVendorReport(\n skus: string[],\n periodStart: Date,\n periodEnd: Date,\n vendorName: string,\n markAsApproved: boolean,\n ): Observable {\n const req = new GenerateVendorReportRequest({\n skus: skus,\n periodStart: periodStart,\n periodEnd: periodEnd,\n vendorName: vendorName,\n markAsApproved: markAsApproved,\n });\n return this.vendorApi.generateReport(req).pipe(map((response) => response.url));\n }\n\n getVendorStats(skus: string[], periodStart: Date, periodEnd: Date): Observable {\n const req = new GetRevenueStatsRequest({\n skus: skus,\n periodStart: periodStart,\n periodEnd: periodEnd,\n });\n return this.vendorApi.getRevenueStats(req).pipe(map((response) => response.totalRevenue || 0));\n }\n\n listContracts(cursor: string, pageSize: number): Observable> {\n const req = new ListContractsRequest({\n pagingOptions: new PagedRequestOptions({ cursor, pageSize }),\n });\n return this.billingApi.listContracts(req).pipe(\n map((response) => {\n const contracts = (response.contracts || []).map((c) => contractFromApi(c));\n return new PagedResponse(contracts, response.pagingMetadata.nextCursor, response.pagingMetadata.hasMore);\n }),\n );\n }\n\n listProducts(\n merchantId: string,\n searchTerm: string,\n filters: ListProductsFilter,\n cursor: string,\n pageSize: number,\n ): Observable> {\n const apiFilters = listProductsFilterToApi(filters);\n const req = new ListProductsRequest({\n merchantId,\n searchTerm,\n filters: apiFilters,\n pagingOptions: new PagedRequestOptions({ cursor, pageSize }),\n });\n return this.billingApi.listProducts(req).pipe(\n map((response) => {\n const products = (response.products || []).map((p) => productFromApi(p));\n return new PagedResponse(products, response.pagingMetadata.nextCursor, response.pagingMetadata.hasMore);\n }),\n );\n }\n\n getMultiProduct(skus: string[]): Observable> {\n const req = new GetMultiProductRequest({\n skus: skus,\n });\n return this.billingApi.getMultiProduct(req).pipe(\n map((response: GetMultiProductResponse) => {\n const productsMap = new Map();\n skus.forEach((sku) => {\n productsMap.set(sku, productFromApi(response.products[sku]));\n });\n return productsMap;\n }),\n );\n }\n\n getBillableItem(\n merchantId: string,\n sku: string,\n customerId: string,\n orderId: string,\n projectionFilter?: SubscriptionsProjectionFilter,\n ): Observable {\n const req = new GetBillableItemRequest({\n merchantId,\n sku,\n customerId,\n orderId,\n projectionFilter,\n });\n\n return this.billingApi.getBillableItem(req).pipe(map((response) => billableItemFromApi(response.item)));\n }\n\n expireSubscription(\n merchantId: string,\n sku: string,\n customerId: string,\n orderId: string,\n expiry: Date,\n ): Observable> {\n const req = new ExpireBillableItemRequest({\n merchantId,\n sku,\n customerId,\n orderId,\n expiry,\n });\n return this.billingApi.expireBillableItem(req);\n }\n\n unexpireSubscription(\n merchantId: string,\n sku: string,\n customerId: string,\n orderId: string,\n ): Observable> {\n const req = new ExpireBillableItemRequest({\n merchantId,\n sku,\n customerId,\n orderId,\n });\n return this.billingApi.unexpireBillableItem(req);\n }\n\n changeBillableItemFrequency(\n merchantId: string,\n sku: string,\n customerId: string,\n orderId: string,\n freq: Frequency,\n ): Observable> {\n const req = new ChangeFrequencyRequest({\n merchantId: merchantId,\n sku: sku,\n customerId: customerId,\n orderId: orderId,\n frequency: frequencyToApi(freq),\n });\n\n return this.billingApi.changeFrequency(req);\n }\n\n changeBillableItemNextRenewalDate(\n merchantId: string,\n sku: string,\n customerId: string,\n orderId: string,\n next: Date,\n ): Observable> {\n const req = new ChangeRenewalDateRequest({\n merchantId: merchantId,\n sku: sku,\n customerId: customerId,\n orderId: orderId,\n nextRenewalDate: next,\n });\n\n return this.billingApi.changeRenewalDate(req);\n }\n\n changeBillableItemCustomUnitPrice(\n merchantId: string,\n sku: string,\n customerId: string,\n orderId: string,\n amount: number,\n ): Observable> {\n const req = new ChangeCustomUnitPriceRequest({\n merchantId: merchantId,\n sku: sku,\n customerId: customerId,\n orderId: orderId,\n customUnitPrice: amount,\n });\n\n return this.billingApi.changeCustomUnitPrice(req);\n }\n\n //deprecated: use listSubscriptions\n listBillableItems(\n searchTerm: string,\n filters: ListBillableItemsFilter,\n cursor: string,\n pageSize: number,\n ): Observable> {\n const req = new ListBillableItemsRequest({\n searchTerm: searchTerm,\n filters: filters,\n pagingOptions: new PagedRequestOptions({ cursor, pageSize }),\n });\n return this.billingApi.listBillableItems(req).pipe(\n map((response) => {\n const items = (response.items || []).map((item) => billableItemFromApi(item));\n return new PagedResponse(items, response.pagingMetadata.nextCursor, response.pagingMetadata.hasMore);\n }),\n );\n }\n\n listSubscriptions(\n filters: ListSubscriptionsFilter,\n cursor: string,\n pageSize: number,\n projectionFilter?: SubscriptionsProjectionFilter,\n ): Observable> {\n const req = new ListSubscriptionsRequest({\n filters: filters,\n pagingOptions: new PagedRequestOptions({ cursor, pageSize }),\n projectionFilter: projectionFilter,\n });\n return this.billingApi.listSubscriptions(req).pipe(\n map((response) => {\n const items = (response.subscriptions || []).map((item) => billableItemFromApi(item));\n return new PagedResponse(items, response.pagingMetadata.nextCursor, response.pagingMetadata.hasMore);\n }),\n );\n }\n\n listRetailSubscriptions(\n filters: ListSubscriptionsFilter,\n cursor: string,\n pageSize: number,\n projectionFilter?: SubscriptionsProjectionFilter,\n ): Observable> {\n const req = new ListSubscriptionsRequest({\n filters: filters,\n pagingOptions: new PagedRequestOptions({ cursor, pageSize }),\n projectionFilter: projectionFilter,\n });\n return this.billingApi.listRetailSubscriptions(req).pipe(\n map((response) => {\n const items = (response.subscriptions || []).map((item) => billableItemFromApi(item));\n return new PagedResponse(items, response.pagingMetadata.nextCursor, response.pagingMetadata.hasMore);\n }),\n );\n }\n\n startRevRecBackfillWorkflow(): Observable> {\n return this.billingApi.startRevRecTemplateBackfill({});\n }\n\n pauseDunning(merchantId: string, purchaseId: string, day: string, pauseDunningUntil: Date): Observable {\n const req = new PauseDunningRequest({ merchantId, purchaseId, day, pauseDunningUntil });\n return this.purchaseApi.pauseDunning(req).pipe(map((response) => response.ok));\n }\n\n resumeDunning(merchantId: string, purchaseId: string, day: string): Observable {\n const req = new ResumeDunningRequest({ merchantId, purchaseId, day });\n return this.purchaseApi.resumeDunning(req).pipe(map((response) => response.ok));\n }\n\n exportSubscriptions(filters: ListSubscriptionsFilter): Observable {\n const req = new ListSubscriptionsRequest({\n filters: filters,\n });\n return this.billingApi.exportSubscriptions(req).pipe(map(() => null));\n }\n\n createSubscription(req: CreateSubscriptionRequest): Observable {\n return this.billingApi.createSubscription(req);\n }\n\n setAutoBillable(subscriptionId: string, autoBillable: boolean): Observable> {\n const req = new SetAutoBillableRequest({\n subscriptionId: subscriptionId,\n autoBillable: autoBillable,\n });\n return this.billingApi.setAutoBillable(req);\n }\n\n updateSubscription(subscription: BillableItem, fieldMask: FieldMask): Observable {\n const req = new UpdateSubscriptionRequest({\n subscription: {\n subscriptionId: subscription.subscriptionId,\n description: subscription.description,\n },\n fieldMask: fieldMask,\n });\n return this.billingApi.updateSubscription(req);\n }\n}\n","import { Addon as GeneratedAddon } from '@vendasta/marketplace-apps/v1';\nimport { File } from './file.model';\nimport { formatDisplayPrice, BillingFrequency } from '@vendasta/shared';\n\nexport class Addon extends GeneratedAddon {\n // These fields are needed to properly\n // display the Addons parent information in the navigation\n productIcon: string;\n productName: string;\n private _endUserMarketingFiles: File[] | undefined;\n private _resellerMarketingFiles: File[] | undefined;\n\n static fromApi(data: any): Addon {\n const addon: any = {};\n data = data || {};\n Object.assign(addon, data);\n if (data.created) {\n addon['created'] = new Date(data.created);\n }\n if (data.updated) {\n addon['updated'] = new Date(data.updated);\n }\n return new Addon(addon);\n }\n\n constructor(data?: any) {\n super();\n data = data || {};\n this.addonId = data.addonId;\n this.appId = data.appId;\n this.tagline = data.tagline;\n this.price = data.price;\n this.title = data.title;\n this.description = data.description;\n this.created = data.created;\n this.updated = data.updated;\n this.orderForm = data.orderForm;\n this.usesOrderForm = data.usesOrderForm;\n this.approved = data.approved;\n this.icon = data.icon;\n this.bannerImage = data.bannerImage;\n this.resellerMarketing = data.resellerMarketing;\n this.endUserMarketing = data.endUserMarketing;\n this.billingFrequency = data.billingFrequency;\n this.serviceModel = data.serviceModel;\n this.discoverable = data.discoverable;\n this.screenshots = data.screenshots;\n this.productName = data.productName;\n this.productIcon = data.productIcon;\n this.multipleActivations = data.multipleActivations;\n this.restrictions = data.restrictions;\n this.activationRequiresApproval = data.activationRequiresApproval;\n this.billingId = data.billingId;\n this.commitment = data.commitment;\n this.currency = data.currency;\n this.usesCustomPricing = data.usesCustomPricing;\n }\n\n get endUserMarketingFiles(): File[] | null {\n if (this._endUserMarketingFiles) {\n return this._endUserMarketingFiles;\n } else {\n if (this.endUserMarketing.files) {\n this._endUserMarketingFiles = this.endUserMarketing.files.map((url) => new File(url));\n return this._endUserMarketingFiles;\n }\n }\n return null;\n }\n\n get resellerMarketingFiles(): File[] | null {\n if (this._resellerMarketingFiles) {\n return this._resellerMarketingFiles;\n } else {\n if (this.resellerMarketing.files) {\n this._resellerMarketingFiles = this.resellerMarketing.files.map((url) => new File(url));\n return this._resellerMarketingFiles;\n }\n }\n return null;\n }\n\n get formattedPrice(): string {\n const billingString = this.billingFrequency ? this.billingFrequency : 'monthly';\n return formatDisplayPrice(this.price, this.currency, billingString as BillingFrequency);\n }\n}\n","import { FieldBase } from '../fields/field-base';\nimport { UntypedFormGroup } from '@angular/forms';\n\nexport class DropDownFormSectionData {\n prepopulatedData: any;\n startOpen: boolean;\n parentForm: UntypedFormGroup;\n displayAutoTitle: boolean;\n titleText: string;\n displayAutoDescription: boolean;\n descriptionText: string;\n fields: FieldBase[];\n editingHint: string;\n /* tslint:disable */\n expandable? = true;\n /* tslint:enable */\n}\n","import { UntypedFormGroup } from '@angular/forms';\nimport { DropDownFormSectionData } from '../dropdown-form-section/dropdown-form-section-data';\nexport class OrderFormSectionData {\n parentForm: UntypedFormGroup;\n titleText: string;\n subtitleText: string;\n descriptionText: string;\n iconUrl: string;\n primarySection: DropDownFormSectionData;\n subsections: DropDownFormSectionData[];\n footerText?: string;\n}\n","import { DropDownFormSectionData } from '../dropdown-form-section/dropdown-form-section-data';\nimport { OrderFormSectionData } from '../order-form-section/order-form-section-data';\nimport { FieldBase, FieldBaseOptions } from '../fields/field-base';\nimport { DropDownFieldOptions } from '../fields/field-dropdown';\nimport { FileUploadGroupFieldOptions } from '../fields/field-fileuploadgroup';\nimport { TextBoxFieldOptions } from '../fields/field-textbox';\nimport { User, VBCUserFieldOptions } from '../fields/field-vbcuser';\n\nexport type OrderFormFieldOptionsType =\n | FieldBaseOptions\n | DropDownFieldOptions\n | FileUploadGroupFieldOptions\n | TextBoxFieldOptions\n | VBCUserFieldOptions;\n\nexport interface OrderFormInterface {\n appId: string;\n addonId?: string;\n commonForm?: IncludedCommonFormFieldsInterface;\n commonFormRequiredFields?: IncludedCommonFormFieldsInterface;\n customFields?: OrderFormFieldOptionsType[];\n footerText?: string;\n}\n\nexport interface IncludedCommonFormFieldsInterface {\n businessName?: boolean;\n businessAddress?: boolean;\n businessPhoneNumber?: boolean;\n businessAccountGroupId?: boolean;\n businessWebsite?: boolean;\n salespersonName?: boolean;\n salespersonPhoneNumber?: boolean;\n salespersonEmail?: boolean;\n contactName?: boolean;\n contactPhoneNumber?: boolean;\n contactEmail?: boolean;\n}\n\nexport interface CommonFormSectionInterface {\n fields: CommonFormFieldInterface[];\n sectionName?: string;\n populatedData?: CommonFormData;\n}\n\nexport interface AddonKeyInterface {\n addonId?: string;\n appId?: string;\n}\n\nexport interface CommonFormFieldInterface extends FieldBase {\n productIds?: string[];\n addonKeys?: AddonKeyInterface[];\n}\n\nexport interface CommonFieldIdsInterface {\n fieldId: string;\n required: boolean;\n}\n\n// Keys are snake cased here because that is the format in which we submit this data to vendors\nexport interface CommonFormData {\n user_options?: User[];\n contact_email?: string;\n contact_name?: string;\n contact_phone_number?: string;\n business_account_group_id?: string;\n business_name?: string;\n business_address?: string;\n business_phone_number?: string;\n business_website?: string;\n salesperson_name?: string;\n salesperson_email?: string;\n salesperson_phone_number?: string;\n}\n\nexport class ProductOrderFormSectionData extends OrderFormSectionData {\n businessId: string;\n productId: string;\n subsections: AddonDropDownFormSectionData[];\n}\n\nexport class AddonDropDownFormSectionData extends DropDownFormSectionData {\n productId: string;\n addonId: string;\n}\n\nexport interface ProductInfoInterface {\n productId: string;\n name?: string;\n tagline?: string;\n icon?: string;\n addonInfo?: AddonInfoInterface[];\n}\n\nexport interface AddonInfoInterface {\n addonId: string;\n name?: string;\n}\n\nexport interface CustomFieldsAnswers {\n productID: string;\n addonKey?: AddonKeyInterface;\n customFieldsAnswers: CustomFieldsAnswer[];\n}\n\nexport interface CustomFieldsAnswer {\n fieldId: string;\n answer?: string;\n displayOnly?: boolean;\n}\n\nexport interface OrderFormOptionsInterface {\n bypassRequiredQuestions?: boolean;\n readOnly?: boolean;\n showOfficeUseQuestions?: boolean;\n}\n","import { ValidatorFn } from '@angular/forms';\n\nexport const FILES = 'file';\nexport const DROP_DOWN = 'dropdown';\nexport const CHECK_BOX = 'checkbox';\nexport const TEXT_AREA = 'textarea';\nexport const TEXT_BOX = 'textbox';\nexport const BUSINESS_USER = 'vbcuser';\n\nexport type ControlType = 'checkbox' | 'dropdown' | 'file' | 'textbox' | 'textarea' | 'vbcuser';\n\nexport interface FieldBaseOptions {\n // TODO This and marketplace-apps OrderFormFieldInterface should share a common base\n id: string;\n label: string;\n required?: boolean;\n description?: string;\n type?: string;\n prefix?: string;\n suffix?: string;\n regexValidator?: string;\n regexErrorMessage?: string;\n disabled?: boolean;\n forOfficeUseOnly?: boolean;\n officeEditableOnly?: boolean;\n hidden?: boolean;\n displayOnly?: boolean;\n}\n\nexport abstract class FieldBase implements FieldBaseOptions {\n value: T;\n id: string;\n label: string;\n required: boolean;\n order: number;\n description: string;\n controlType: ControlType;\n prefix: string;\n suffix: string;\n regexValidator: string;\n regexErrorMessage: string;\n disabled: boolean;\n validator: ValidatorFn;\n forOfficeUseOnly: boolean;\n officeEditableOnly: boolean;\n hidden: boolean;\n displayOnly: boolean;\n\n constructor(options: FieldBaseOptions) {\n this.id = options.id;\n this.label = options.label;\n this.required = !!options.required;\n this.description = options.description || null;\n options.type = options.type === 'text' ? 'textbox' : options.type;\n this.controlType = options.type as ControlType;\n this.prefix = options.prefix;\n this.suffix = options.suffix;\n this.regexValidator = options.regexValidator;\n this.regexErrorMessage = options.regexErrorMessage;\n this.disabled = options.disabled || false;\n this.validator = this.validatorBuilder();\n this.forOfficeUseOnly = !!options.forOfficeUseOnly;\n this.officeEditableOnly = !!options.officeEditableOnly;\n this.hidden = options.hidden;\n this.displayOnly = options.displayOnly;\n }\n\n protected validatorBuilder(): ValidatorFn {\n return (): { [key: string]: any } => {\n return null;\n };\n }\n}\n","import { ControlType, FieldBase } from './field-base';\n\nexport class CheckboxField extends FieldBase {\n readonly controlType: ControlType = 'checkbox';\n}\n","import { ControlType, FieldBase, FieldBaseOptions } from './field-base';\nimport { Option as InputOption } from '@vendasta/forms';\nimport { AbstractControl, ValidatorFn } from '@angular/forms';\n\nexport interface Option {\n value: string;\n label: string;\n disabled?: boolean;\n}\n\nexport interface DropDownFieldOptions extends FieldBaseOptions {\n options: Option[] | InputOption[] | string[];\n allowMultiples?: boolean;\n allowDuplicates?: boolean;\n maxChoices?: number;\n}\n\nexport class DropdownField extends FieldBase {\n readonly controlType: ControlType = 'dropdown';\n options: Option[] | InputOption[];\n allowMultiples: boolean;\n allowDuplicates: boolean;\n maxChoices: number;\n\n constructor(options: DropDownFieldOptions) {\n super(options);\n this.options = [];\n if (!!options.options && options.options.length > 0) {\n if (typeof options.options[0] === 'string') {\n if (options.allowMultiples) {\n this.options = options.options.map((o) => { value: o, name: o });\n } else {\n this.options = options.options.map((o) =>