function Method(name, type, requestType, responseType, requestStream, responseStream, options) {

    /* istanbul ignore next */
    if (util.isObject(requestStream)) {
        options = requestStream;
        requestStream = responseStream = undefined;
    /* istanbul ignore next */
    } else if (util.isObject(responseStream)) {
        options = responseStream;
        responseStream = undefined;
    }

    /* istanbul ignore next */
    if (!(type === undefined || util.isString(type)))
        throw TypeError("type must be a string");
    /* istanbul ignore next */
    if (!util.isString(requestType))
        throw TypeError("requestType must be a string");
    /* istanbul ignore next */
    if (!util.isString(responseType))
        throw TypeError("responseType must be a string");

    ReflectionObject.call(this, name, options);

    /**
     * Method type.
     * @type {string}
     */
    this.type = type || "rpc"; // toJSON

    /**
     * Request type.
     * @type {string}
     */
    this.requestType = requestType; // toJSON, marker

    /**
     * Whether requests are streamed or not.
     * @type {boolean|undefined}
     */
    this.requestStream = requestStream ? true : undefined; // toJSON

    /**
     * Response type.
     * @type {string}
     */
    this.responseType = responseType; // toJSON

    /**
     * Whether responses are streamed or not.
     * @type {boolean|undefined}
     */
    this.responseStream = responseStream ? true : undefined; // toJSON

    /**
     * Resolved request type.
     * @type {?Type}
     */
    this.resolvedRequestType = null;

    /**
     * Resolved response type.
     * @type {?Type}
     */
    this.resolvedResponseType = null;
}
Constructs a new service method instance.
@classdesc Reflected service method.
@extends ReflectionObject
@constructor
@param {string} name Method name
@param {string|undefined} type Method type, usually `"rpc"`
@param {string} requestType Request message type
@param {string} responseType Response message type
@param {boolean|Object.<string,*>} [requestStream] Whether the request is streamed
@param {boolean|Object.<string,*>} [responseStream] Whether the response is streamed
@param {Object.<string,*>} [options] Declared options