code: public function setMaxRetries($retries)
      {
          switch (gettype($retries)) {
              case 'integer':
                  $this->maxRetries = new Retries($retries);
                  break;
              case 'object':
                  $this->maxRetries = $retries;
                  break;
              default:
                  throw new InvalidArgumentException('Invalid type for max retries given.');
                  break;
          }
      }
docs: Sets the max allowed retries.
  
  @param int|Retries $retries
  
  @return $this