docs: function automock (httpClient) {
      // require function
      if (typeof httpClient.request !== 'function') {
          throw new Error('automock error: http-client must have request method')
      }
      // return automock function
      return function httpClientAutomockWrapper (options, session) {
          // require options and session to be objects
          options = requireValidOptionalObject(options)
          session = requireValidOptionalObject(session)
          // get stable id for args
          var stableId = httpRequestStableId({
              moduleCallSignature: session.moduleCallSignature,
              options: options,
              requestId: session.requestId,
              stack: session.stack,
          })
          // get mock data for http request
          var httpRequestMock = immutableAutomock.httpRequestMocks[stableId]
          var httpRequestErrorMock = httpRequestMock && immutableAutomock.httpRequestErrorMocks[httpRequestMock.httpRequestId]
          var httpResponseMock = httpRequestMock && immutableAutomock.httpResponseMocks[httpRequestMock.httpRequestId]
          // return mock data for success if it exists - clone objects to prevent mock pollution
          if (httpRequestMock && httpResponseMock) {
              return Promise.resolve({
                  body: httpResponseMock.httpResponseBody,
                  rawHeaders: _.cloneDeep(httpResponseMock.httpResponseHeader),
                  statusCode: httpResponseMock.httpResponseStatusCode,
              })
          }
          // return mock data for error if it exists
          else if (httpRequestMock && httpRequestErrorMock) {
              return Promise.reject(new Error(httpRequestErrorMock.httpRequestError))
          }
          // if requireAutomock flag is set on session throw error
          else if (session.requireAutomock) {
              // create new error object
              var error = new Error('missing automock for http: '+options.method+' '+options.uri)
              // add call data to error
              error.automockCallData = {
                  moduleCallId: session.moduleCallId,
                  options: options,
                  requestId: session.requestId,
              }
              error.automockStableId = stableId
              // throw error
              throw error
          }
          // do original http request
          else {
              // shallow clone session to set automock flag in this scope only
              session = _.clone(session)
              // set automock flag to false so that regular request will be done
              session.automock = false
              // call original method
              return httpClient.request.apply(this, [options, session])
          }
      }
  }