def _no_mpl_attrs_post_init()

in src/aws_encryption_sdk/streaming_client.py [0:0]


    def _no_mpl_attrs_post_init(self):
        """If the MPL is NOT present in the runtime, perform post-init logic
        to validate the new object has a valid state.
        """
        both_cmm_and_mkp_defined = self.materials_manager is not None and self.key_provider is not None
        neither_cmm_nor_mkp_defined = self.materials_manager is None and self.key_provider is None

        if both_cmm_and_mkp_defined or neither_cmm_nor_mkp_defined:
            raise TypeError("Exactly one of materials_manager or key_provider must be provided")
        if self.materials_manager is None:
            self.materials_manager = DefaultCryptoMaterialsManager(master_key_provider=self.key_provider)