diff --git a/azureiai/managed_apps/confs/reseller_configuration.py b/azureiai/managed_apps/confs/reseller_configuration.py index 40d886e5..3c730c91 100644 --- a/azureiai/managed_apps/confs/reseller_configuration.py +++ b/azureiai/managed_apps/confs/reseller_configuration.py @@ -7,6 +7,8 @@ from azureiai.managed_apps.confs.offer_configurations import OfferConfigurations from swagger_client import ResellerConfigurationApi +DEFAULT_STATE = "Enabled" + class ResellerConfiguration(OfferConfigurations): """Managed Application Offer - Reseller Configuration Configuration""" @@ -21,7 +23,7 @@ def get(self): product_id=self.product_id, authorization=self.authorization ) - def set(self, reseller_channel_state="Enabled"): + def set(self, reseller_channel_state=DEFAULT_STATE): """ Set Availability for Application diff --git a/azureiai/partner_center/submission.py b/azureiai/partner_center/submission.py index 5e3a28e5..c7b362d7 100644 --- a/azureiai/partner_center/submission.py +++ b/azureiai/partner_center/submission.py @@ -6,7 +6,8 @@ import os from pathlib import Path -from azureiai.managed_apps.confs import Properties, ProductAvailability, Listing, ListingImage +from azureiai.managed_apps.confs import Properties, ProductAvailability, Listing, ListingImage, ResellerConfiguration +from azureiai.managed_apps.confs.reseller_configuration import DEFAULT_STATE from azureiai.partner_center.offer import Offer from swagger_client.rest import ApiException @@ -151,6 +152,14 @@ def _update_properties(self): leveled_categories=leveled_categories, ) + def _set_resell_through_csps(self): + with open(Path(self.app_path).joinpath(self.json_listing_config), "r", encoding="utf8") as read_file: + json_config = json.load(read_file) + reseller_channel_state = json_config["offer_listing"].get("reseller_channel", DEFAULT_STATE) + + reseller = ResellerConfiguration(product_id=self.get_product_id(), authorization=self.get_auth()) + reseller.set(reseller_channel_state=reseller_channel_state) + def _update_preview_audience(self): with open(Path(self.app_path).joinpath(self.json_listing_config), "r", encoding="utf8") as read_file: json_config = json.load(read_file) diff --git a/setup.py b/setup.py index cf145013..4fd02eaa 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ generate_swagger(SWAGGER_JSON) NAME = "az-partner-center-cli" -VERSION = "0.0.42" +VERSION = "0.0.43" REQUIRES = [ "azure-mgmt-deploymentmanager",