def validate()

in client/python/cli/command/catalogs.py [0:0]


    def validate(self):
        if self.catalogs_subcommand == Subcommands.CREATE:
            if not self.storage_type:
                raise Exception(f'Missing required argument:'
                                f' {Argument.to_flag_name(Arguments.STORAGE_TYPE)}')
            if not self.default_base_location:
                raise Exception(f'Missing required argument:'
                                f' {Argument.to_flag_name(Arguments.DEFAULT_BASE_LOCATION)}')

        if self.storage_type == StorageType.S3.value:
            if not self.role_arn:
                raise Exception(f"Missing required argument for storage type 's3':"
                                f" {Argument.to_flag_name(Arguments.ROLE_ARN)}")
            if self._has_azure_storage_info() or self._has_gcs_storage_info():
                raise Exception(f"Storage type 's3' supports the storage credentials"
                                f" {Argument.to_flag_name(Arguments.ROLE_ARN)},"
                                f" {Argument.to_flag_name(Arguments.REGION)},"
                                f" {Argument.to_flag_name(Arguments.EXTERNAL_ID)}, and"
                                f" {Argument.to_flag_name(Arguments.USER_ARN)}")
        elif self.storage_type == StorageType.AZURE.value:
            if not self.tenant_id:
                raise Exception("Missing required argument for storage type 'azure': "
                                f" {Argument.to_flag_name(Arguments.TENANT_ID)}")
            if self._has_aws_storage_info() or self._has_gcs_storage_info():
                raise Exception("Storage type 'azure' supports the storage credentials"
                                f" {Argument.to_flag_name(Arguments.TENANT_ID)},"
                                f" {Argument.to_flag_name(Arguments.MULTI_TENANT_APP_NAME)}, and"
                                f" {Argument.to_flag_name(Arguments.CONSENT_URL)}")
        elif self.storage_type == StorageType.GCS.value:
            if self._has_aws_storage_info() or self._has_azure_storage_info():
                raise Exception("Storage type 'gcs' supports the storage credential"
                                f" {Argument.to_flag_name(Arguments.SERVICE_ACCOUNT)}")
        elif self.storage_type == StorageType.FILE.value:
            if self._has_aws_storage_info() or self._has_azure_storage_info() or self._has_gcs_storage_info():
                raise Exception("Storage type 'file' does not support any storage credentials")