def create(session_id, options = {})
      raise ArgumentError, "session_id not provided" if session_id.to_s.empty?
      raise ArgumentError,
        "Resolution cannot be supplied for individual output mode" if options.key?(:resolution) and options[:output_mode] == :individual

      # normalize opts so all keys are symbols and only include valid_opts
      valid_opts = [ :name, :has_audio, :has_video, :output_mode, :resolution ]
      opts = options.inject({}) do |m,(k,v)|
        if valid_opts.include? k.to_sym
          m[k.to_sym] = v
        end
        m
      end

      archive_json = @client.start_archive(session_id, opts)
      Archive.new self, archive_json
    end
def create(session_id, options = {})
      raise ArgumentError, "session_id not provided" if session_id.to_s.empty?
      raise ArgumentError,
        "Resolution cannot be supplied for individual output mode" if options.key?(:resolution) and options[:output_mode] == :individual

      # normalize opts so all keys are symbols and only include valid_opts
      valid_opts = [ :name, :has_audio, :has_video, :output_mode, :resolution ]
      opts = options.inject({}) do |m,(k,v)|
        if valid_opts.include? k.to_sym
          m[k.to_sym] = v
        end
        m
      end

      archive_json = @client.start_archive(session_id, opts)
      Archive.new self, archive_json
    end
@private
 Starts archiving an OpenTok session.

 Clients must be actively connected to the OpenTok session for you to successfully start
 recording an archive.

 You can only record one archive at a time for a given session. You can only record archives
 of sessions that use the OpenTok Media Router (sessions with the media mode set to routed);
 you cannot archive sessions with the media mode set to relayed.

 For more information on archiving, see the
 {https://tokbox.com/opentok/tutorials/archiving OpenTok archiving} programming guide.

 @param [String] session_id The session ID of the OpenTok session to archive.
 @param [Hash] options  A hash with the keys 'name', 'has_audio', 'has_video',
   and 'output_mode'.
 @option options [String] :name This is the name of the archive. You can use this name
   to identify the archive. It is a property of the Archive object, and it is a property
   of archive-related events in the OpenTok client SDKs.
 @option options [true, false] :has_audio Whether the archive will include an audio track
   (<code>true</code>) or not <code>false</code>). The default value is <code>true</code>
   (an audio track is included). If you set both  <code>has_audio</code> and
   <code>has_video</code> to <code>false</code>, the call to the <code>create()</code>
   method results in an error.
 @option options [true, false] :has_video Whether the archive will include a video track
   (<code>true</code>) or not <code>false</code>). The default value is <code>true</code>
   (a video track is included). If you set both  <code>has_audio</code> and
   <code>has_video</code> to <code>false</code>, the call to the <code>create()</code>
   method results in an error.
 @option options [String] :output_mode Whether all streams in the archive are recorded
     to a single file (<code>:composed</code>, the default) or to individual files
     (<code>:individual</code>). For more information on archiving and the archive file
     formats, see the {https://tokbox.com/opentok/tutorials/archiving OpenTok archiving}
     programming guide.
 @option options [String] :resolution The resolution of the archive, either "640x480" (SD, the
   default) or "1280x720" (HD). This property only applies to composed archives. If you set
   this property and set the outputMode property to "individual", the call the method
   results in an error.

 @return [Archive] The Archive object, which includes properties defining the archive,
   including the archive ID.

 @raise [OpenTokArchiveError] The archive could not be started. The request was invalid or
   the session has no connected clients.
 @raise [OpenTokAuthenticationError] Authentication failed while starting an archive.
   Invalid API key.
 @raise [OpenTokArchiveError] The archive could not be started. The session ID does not exist.
 @raise [OpenTokArchiveError] The archive could not be started. The session could be
   peer-to-peer or the session is already being recorded.
 @raise [OpenTokArchiveError] The archive could not be started.