def __init__()

in source/forecast-shared/shared/quicksight_custom_resources/util/quicksight_application.py [0:0]


    def __init__(self, resource_properties):
        # TODO: use the config data / file to figure out the supported_data_set_types
        supported_data_set_types = ["forecast"]

        self.resource_properties = resource_properties
        self.global_state = get_global_state()

        # use config data file if provided
        config_file = resource_properties.get("ConfigDataFile", None)
        if config_file:
            data = read_config(config_file)
            self.global_state.update(data)

        # TODO:RENAME: 'StackName' key name as this could be used out of stack. ApplicationName?
        # TODO: create/use a uuid if no attack provided
        self.prefix = resource_properties.get("StackName", "Sample_Sol")

        # TODO:RENAME: quicksight_template_arn -> quicksight_source_template_arn
        self.quicksight_template_arn = resource_properties.get(
            "QuickSightSourceTemplateArn", "Uninitialized QuickSightSourceTemplateArn"
        )
        logger.debug(
            f"Using QuickSightSourceTemplateArn: {self.quicksight_template_arn }"
        )

        self.quicksight_principal_arn = resource_properties.get(
            "QuickSightPrincipalArn", "Uninitialized QuickSightPrincipalArn"
        )
        logger.debug(f"Using QuickSightPrincipalArn: {self.quicksight_principal_arn }")

        self.data_source = DataSource(
            quicksight_application=self, props=self.global_state
        )

        self.data_set_sub_types = supported_data_set_types
        self.data_sets = dict()
        for data_set_sub_type in self.data_set_sub_types:
            data_set = DataSet(
                quicksight_application=self,
                data_source=self.data_source,
                data_set_sub_type=data_set_sub_type,
                data_set_name=f"_{data_set_sub_type}_dataset",
                props=self.global_state,
            )
            self.data_sets[data_set_sub_type] = data_set

        self.analysis = Analysis(
            quicksight_application=self,
            data_sets=self.data_sets,
            quicksight_template_arn=self.quicksight_template_arn,
            data_source=self.data_source,
            props=self.global_state,
        )

        self.dashboard = Dashboard(
            quicksight_application=self,
            data_sets=self.data_sets,
            quicksight_template_arn=self.quicksight_template_arn,
            props=self.global_state,
        )

        self.template = Template(
            quicksight_application=self,
            data_sets=self.data_sets,
            props=self.global_state,
        )

        global_state_json = json.dumps(self.global_state, indent=2, sort_keys=True)
        logger.debug(
            f"QuicksightApi: after init, global data json: {global_state_json}"
        )