code: def profile_settings_args_layout_json(self, required):
          
  
          profile_args = {}
          self.db_create_table(self.input_table, self.install_json_params().keys())
          self.db_insert_record(self.input_table, self.install_json_params().keys())
          self.gen_permutations()
          try:
              for pn in self._input_permutations[self.args.permutation_id]:
                  p = self.install_json_params().get(pn.get('name'))
                  if p.get('required', False) != required:
                      continue
                  if p.get('type').lower() == 'boolean':
                      # use the value generated in the permutation
                      profile_args[p.get('name')] = pn.get('value')
                  elif p.get('type').lower() == 'choice':
                      # use the value generated in the permutation
                      profile_args[p.get('name')] = pn.get('value')
                  elif p.get('name') in ['api_access_id', 'api_secret_key']:
                      # leave these parameters set to the value defined in defaults
                      pass
                  else:
                      # add type stub for values
                      types = '|'.join(p.get('playbookDataType', []))
                      if types:
                          profile_args[p.get('name')] = p.get('default', '<{}>'.format(types))
                      else:
                          profile_args[p.get('name')] = p.get('default', '')
          except IndexError:
              self.handle_error('Invalid permutation index provided.')
          return profile_args
docs: Return args based on layout.json and conditional rendering.
  
          Args:
              required (bool): If True only required args will be returned.
  
          Returns:
              dict: Dictionary of required or optional App args.