#  Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#  SPDX-License-Identifier: Apache-2.0

from servicecatalog_puppet import constants
from servicecatalog_puppet.workflow.stack import stack_for_task


class StackTask(stack_for_task.StackForTask):
    def params_for_results_display(self):
        return {
            "puppet_account_id": self.puppet_account_id,
            "stack_name": self.stack_name,
            "cache_invalidator": self.cache_invalidator,
        }

    def requires(self):
        requirements = list()

        klass = self.get_klass_for_provisioning()
        for (
            account_id,
            regions,
        ) in self.manifest.get_account_ids_and_regions_used_for_section_item(
            self.puppet_account_id, constants.STACKS, self.stack_name
        ).items():
            for region in regions:
                for task in self.manifest.get_tasks_for_launch_and_account_and_region(
                    self.puppet_account_id,
                    self.section_name,
                    self.stack_name,
                    account_id,
                    region,
                    single_account=self.single_account,
                ):
                    requirements.append(
                        klass(**task, manifest_file_path=self.manifest_file_path)
                    )

        return requirements

    def run(self):
        self.write_output(self.params_for_results_display())

739622466fe39055f9a9f0141bb303dc0510ab9f
<mask token>


class StackTask(stack_for_task.StackForTask):
    <mask token>

    def requires(self):
        requirements = list()
        klass = self.get_klass_for_provisioning()
        for account_id, regions in self.manifest.get_account_ids_and_regions_used_for_section_item(
            self.puppet_account_id, constants.STACKS, self.stack_name).items():
            for region in regions:
                for task in self.manifest.get_tasks_for_launch_and_account_and_region(
                    self.puppet_account_id, self.section_name, self.
                    stack_name, account_id, region, single_account=self.
                    single_account):
                    requirements.append(klass(**task, manifest_file_path=
                        self.manifest_file_path))
        return requirements
    <mask token>

<mask token>


class StackTask(stack_for_task.StackForTask):

    def params_for_results_display(self):
        return {'puppet_account_id': self.puppet_account_id, 'stack_name':
            self.stack_name, 'cache_invalidator': self.cache_invalidator}

    def requires(self):
        requirements = list()
        klass = self.get_klass_for_provisioning()
        for account_id, regions in self.manifest.get_account_ids_and_regions_used_for_section_item(
            self.puppet_account_id, constants.STACKS, self.stack_name).items():
            for region in regions:
                for task in self.manifest.get_tasks_for_launch_and_account_and_region(
                    self.puppet_account_id, self.section_name, self.
                    stack_name, account_id, region, single_account=self.
                    single_account):
                    requirements.append(klass(**task, manifest_file_path=
                        self.manifest_file_path))
        return requirements
    <mask token>

<mask token>


class StackTask(stack_for_task.StackForTask):

    def params_for_results_display(self):
        return {'puppet_account_id': self.puppet_account_id, 'stack_name':
            self.stack_name, 'cache_invalidator': self.cache_invalidator}

    def requires(self):
        requirements = list()
        klass = self.get_klass_for_provisioning()
        for account_id, regions in self.manifest.get_account_ids_and_regions_used_for_section_item(
            self.puppet_account_id, constants.STACKS, self.stack_name).items():
            for region in regions:
                for task in self.manifest.get_tasks_for_launch_and_account_and_region(
                    self.puppet_account_id, self.section_name, self.
                    stack_name, account_id, region, single_account=self.
                    single_account):
                    requirements.append(klass(**task, manifest_file_path=
                        self.manifest_file_path))
        return requirements

    def run(self):
        self.write_output(self.params_for_results_display())

from servicecatalog_puppet import constants
from servicecatalog_puppet.workflow.stack import stack_for_task


class StackTask(stack_for_task.StackForTask):

    def params_for_results_display(self):
        return {'puppet_account_id': self.puppet_account_id, 'stack_name':
            self.stack_name, 'cache_invalidator': self.cache_invalidator}

    def requires(self):
        requirements = list()
        klass = self.get_klass_for_provisioning()
        for account_id, regions in self.manifest.get_account_ids_and_regions_used_for_section_item(
            self.puppet_account_id, constants.STACKS, self.stack_name).items():
            for region in regions:
                for task in self.manifest.get_tasks_for_launch_and_account_and_region(
                    self.puppet_account_id, self.section_name, self.
                    stack_name, account_id, region, single_account=self.
                    single_account):
                    requirements.append(klass(**task, manifest_file_path=
                        self.manifest_file_path))
        return requirements

    def run(self):
        self.write_output(self.params_for_results_display())

#  Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#  SPDX-License-Identifier: Apache-2.0

from servicecatalog_puppet import constants
from servicecatalog_puppet.workflow.stack import stack_for_task


class StackTask(stack_for_task.StackForTask):
    def params_for_results_display(self):
        return {
            "puppet_account_id": self.puppet_account_id,
            "stack_name": self.stack_name,
            "cache_invalidator": self.cache_invalidator,
        }

    def requires(self):
        requirements = list()

        klass = self.get_klass_for_provisioning()
        for (
            account_id,
            regions,
        ) in self.manifest.get_account_ids_and_regions_used_for_section_item(
            self.puppet_account_id, constants.STACKS, self.stack_name
        ).items():
            for region in regions:
                for task in self.manifest.get_tasks_for_launch_and_account_and_region(
                    self.puppet_account_id,
                    self.section_name,
                    self.stack_name,
                    account_id,
                    region,
                    single_account=self.single_account,
                ):
                    requirements.append(
                        klass(**task, manifest_file_path=self.manifest_file_path)
                    )

        return requirements

    def run(self):
        self.write_output(self.params_for_results_display())
