title: Default values for boto3 method parameters
body: <p>I would like to programmatically write a method that calls a boto3 method and change default parameters inside methods. </p>
  
  <p>For example, I want to use my log bucket if log is set to True. Otherwise, don't log it. Something like this:</p>
  
  <pre><code>def my_run(log=False):
      log_string = "s3://mylogs" if log else None
  
      result = emr.run_job_flow(Name   = 'EMRTest1',
                                LogUri = log_string ,
                                ...
                                )
      return result
  </code></pre>
  
  <p>So, for default value I used None. However, boto3 expects a string. I tried empty string for default and it's not a valid value</p>
  
  <p>I know that if I don't specify logURI, it won't get stored. So I could do it with if statements, like this:</p>
  
  <pre><code>def my_run(log=False):
      if log:
          result = emr.run_job_flow(Name   = 'EMRTest1',
                                    LogUri = "s3://mylogs" ,
                                    ...
                                    )
      else:
          result = emr.run_job_flow(Name   = 'EMRTest1',
                                    ...
                                    )
      return result
  </code></pre>
  
  <p>But that's horrible way. And LogUri was just an example. I want to be able to change other parameters. I just can't make those nested ifs.</p>
  
  <p>Is there a default value for various types like strings in boto3 that I can use? </p>
  
  <hr>
  
  <p>Edit 1</p>
  
  <p>From the first comment below, 
  <a href="http://boto3.readthedocs.org/en/latest/guide/events.html#provide-client-params" rel="nofollow">http://boto3.readthedocs.org/en/latest/guide/events.html#provide-client-params</a></p>
  
  <p>Interesting API. Not well documented though. Their example for s3 clisnt works fine, </p>
  
  <pre><code>s3 = boto3.client('s3')
  
  # Access the event system on the S3 client
  event_system = s3.meta.events
  
  # Create a function
  def add_my_bucket(params, **kwargs):
      print "Hello"
      # Add the name of the bucket you want to default to.
      if 'Bucket' not in params:
          params['Bucket'] = 'mybucket'
  
  # Register the function to an event
  event_system.register('provide-client-params.s3.ListObjects', add_my_bucket)
  
  response = s3.list_objects()
  </code></pre>
  
  <p>then response is good and also I see "Hello" printed.</p>
  
  <p>But now I try to make an example for emr's run_job_flow:</p>
  
  <pre><code>def my_run(name):
      def setName(params, **kwargs):
          print "Hello"
          params['Name'] = name
  
      current_emr  = boto3.client('emr')
      event_system = current_emr.meta.events
  
      event_system.register('provide-client-params.emr.RunJobFlow', setName)
  
      current_emr.run_job_flow(...)
  </code></pre>
  
  <p>When I run this, I get:
  Missing required parameter in input: "Name"</p>
  
  <p>Am I using wrong syntax somehow?
  I did use RunJobFlow which I got from current_emr.meta.method_to_api_mapping
  Maybe it's not provide-client-params for emr?</p>
  
  <p>I also don't see "Hello" printed</p>