api/http/definitions/Endpoint.js
/**
		 * Throws an {@link Error} if the instance is invalid.
		 *
		 * @public
		 */
Throws an  Error if the instance is invalid.
@public
Throws an Error if the instance is invalid . @public
validate() {
			if (!(this.protocol instanceof ProtocolType)) {
				throw new Error('Endpoint protocol must be an instance of ProtocolType.');
			}
			if (!is.string(this._host) || this._host.length === 0) {
				throw new Error('Endpoint host is invalid.');
			}
			if (!is.integer(this._port) || this._port < 0 || this._port > 65535) {
				throw new Error('Endpoint port range is invalid.');
			}
			if (!(this.path instanceof Parameters)) {
				throw new Error('The path must be a Parameters collection.');
			}
			this.path.validate();
			if (!(this.query instanceof Parameters)) {
				throw new Error('The query must be a Parameters collection.');
			}
			this.query.validate();
			if (!(this.headers instanceof Parameters)) {
				throw new Error('The headers must be a Parameters collection.');
			}
			this.headers.validate();
			if (!(this.body instanceof Parameters)) {
				throw new Error('The body must be a Parameters collection.');
			}
			this.body.validate();
			if (this.credentials) {
				this.credentials.validate();
			}
			if (this.requestInterceptor && !(this.requestInterceptor instanceof RequestInterceptor)) {
				throw new Error('Endpoint request interceptor must be an instance of RequestInterceptor.');
			}
			if (this.responseInterceptor && !(this.responseInterceptor instanceof ResponseInterceptor)) {
				throw new Error('Endpoint response interceptor must be an instance of ResponseInterceptor.');
			}
			if (this.errorInterceptor && !(this.errorInterceptor instanceof ErrorInterceptor)) {
				throw new Error('Endpoint error interceptor must be an instance of ErrorInterceptor.');
			}
		}
validate ( ) { if ( ! ( this . protocol instanceof ProtocolType ) ) { throw new Error ( 'Endpoint protocol must be an instance of ProtocolType.' ) ; } if ( ! is . string ( this . _host ) || this . _host . length === 0 ) { throw new Error ( 'Endpoint host is invalid.' ) ; } if ( ! is . integer ( this . _port ) || this . _port < 0 || this . _port > 65535 ) { throw new Error ( 'Endpoint port range is invalid.' ) ; } if ( ! ( this . path instanceof Parameters ) ) { throw new Error ( 'The path must be a Parameters collection.' ) ; } this . path . validate ( ) ; if ( ! ( this . query instanceof Parameters ) ) { throw new Error ( 'The query must be a Parameters collection.' ) ; } this . query . validate ( ) ; if ( ! ( this . headers instanceof Parameters ) ) { throw new Error ( 'The headers must be a Parameters collection.' ) ; } this . headers . validate ( ) ; if ( ! ( this . body instanceof Parameters ) ) { throw new Error ( 'The body must be a Parameters collection.' ) ; } this . body . validate ( ) ; if ( this . credentials ) { this . credentials . validate ( ) ; } if ( this . requestInterceptor && ! ( this . requestInterceptor instanceof RequestInterceptor ) ) { throw new Error ( 'Endpoint request interceptor must be an instance of RequestInterceptor.' ) ; } if ( this . responseInterceptor && ! ( this . responseInterceptor instanceof ResponseInterceptor ) ) { throw new Error ( 'Endpoint response interceptor must be an instance of ResponseInterceptor.' ) ; } if ( this . errorInterceptor && ! ( this . errorInterceptor instanceof ErrorInterceptor ) ) { throw new Error ( 'Endpoint error interceptor must be an instance of ErrorInterceptor.' ) ; } }
Throws an {@link Error} if the instance is invalid.
Throws an { @link Error } if the instance is invalid .