def __init__(self, access_id, secret_key, region_name, owner_id, user_name, verbose=True, usage_client=None):

        '''
            a method for initializing the connection to AWS Polly
            
        :param access_id: string with access_key_id from aws IAM user setup
        :param secret_key: string with secret_access_key from aws IAM user setup
        :param region_name: string with name of aws region
        :param owner_id: string with aws account id
        :param user_name: string with name of user access keys are assigned to
        :param verbose: boolean to enable process messages
        :param usage_client: callable object to track resource usage
        '''
        
        title = '%s.__init__' % self.__class__.__name__

    # initialize model
        from labpack import __module__
        from jsonmodel.loader import jsonLoader
        from jsonmodel.validators import jsonModel
        class_fields = jsonLoader(__module__, 'speech/aws/polly-rules.json')
        self.fields = jsonModel(class_fields)

    # construct iam connection
        from labpack.authentication.aws.iam import iamClient
        self.iam = iamClient(access_id, secret_key, region_name, owner_id, user_name, verbose)

    # construct polly client connection
        client_kwargs = {
            'service_name': 'polly',
            'region_name': self.iam.region_name,
            'aws_access_key_id': self.iam.access_id,
            'aws_secret_access_key': self.iam.secret_key
        }
        self.connection = boto3.client(**client_kwargs)
        self.verbose = verbose
        self.usage_client = usage_client
    
    # construct range of polly options
        self.voice_ids = self.fields.components['.voice_id']['discrete_values']
        self.output_formats = self.fields.components['.output_format']['discrete_values']
        
    # construct pythonic conversion method
        from labpack.parsing.conversion import camelcase_to_lowercase
        self.ingest = camelcase_to_lowercase
def __init__ ( self , access_id , secret_key , region_name , owner_id , user_name , verbose = True , usage_client = None ) : title = '%s.__init__' % self . __class__ . __name__ from labpack import __module__ from jsonmodel . loader import jsonLoader from jsonmodel . validators import jsonModel class_fields = jsonLoader ( __module__ , 'speech/aws/polly-rules.json' ) self . fields = jsonModel ( class_fields ) from labpack . authentication . aws . iam import iamClient self . iam = iamClient ( access_id , secret_key , region_name , owner_id , user_name , verbose ) client_kwargs = { 'service_name' : 'polly' , 'region_name' : self . iam . region_name , 'aws_access_key_id' : self . iam . access_id , 'aws_secret_access_key' : self . iam . secret_key } self . connection = boto3 . client ( ** client_kwargs ) self . verbose = verbose self . usage_client = usage_client self . voice_ids = self . fields . components [ '.voice_id' ] [ 'discrete_values' ] self . output_formats = self . fields . components [ '.output_format' ] [ 'discrete_values' ] from labpack . parsing . conversion import camelcase_to_lowercase self . ingest = camelcase_to_lowercase
a method for initializing the connection to AWS Polly
            
        :param access_id: string with access_key_id from aws IAM user setup
        :param secret_key: string with secret_access_key from aws IAM user setup
        :param region_name: string with name of aws region
        :param owner_id: string with aws account id
        :param user_name: string with name of user access keys are assigned to
        :param verbose: boolean to enable process messages
        :param usage_client: callable object to track resource usage