function getBadgeExampleCall(serviceClass) {
  if (!(serviceClass.prototype instanceof BaseService)) {
    throw new TypeError(
      'Invalid serviceClass: Must be an instance of BaseService.',
    )
  }

  if (!serviceClass.openApi) {
    throw new TypeError(
      `Missing OpenAPI in service class ${serviceClass.name}.`,
    )
  }

  const firstOpenapiPath = Object.keys(serviceClass.openApi)[0]

  const firstOpenapiExampleParams =
    serviceClass.openApi[firstOpenapiPath].get.parameters
  if (!Array.isArray(firstOpenapiExampleParams)) {
    throw new TypeError(
      `Missing or invalid OpenAPI examples in ${serviceClass.name}.`,
    )
  }

  // reformat structure for serviceClass.invoke
  const exampleInvokeParams = firstOpenapiExampleParams.reduce((acc, obj) => {
    acc[obj.name] = obj.example
    return acc
  }, {})

  return exampleInvokeParams
}
Retrieves an example set of parameters for invoking a service class using OpenAPI example of that class.

@param {BaseService} serviceClass The service class containing OpenAPI specifications.
@returns {object} An object with call params to use with a service invoke of the first OpenAPI example.
@throws {TypeError} - Throws a TypeError if the input `serviceClass` is not an instance of BaseService,
  or if it lacks the expected structure.

@example
// Example usage:
const example = getBadgeExampleCall(StackExchangeReputation)
console.log(example)
// Output: { stackexchangesite: 'stackoverflow', query: '123' }
StackExchangeReputation.invoke(defaultContext, config, example)