Skip to main content

Class: Contact

protoc_gen_openapiv2.options.Contact

Contact is a representation of OpenAPI v2 specification's Contact object.

See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#contactObject

Example:

option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { info: { ... contact: { name: "gRPC-Gateway project"; url: "https://github.com/grpc-ecosystem/grpc-gateway"; email: "none@example.com"; }; ... }; ... };

Implements

Constructors

constructor

new Contact(properties?): Contact

Constructs a new Contact.

Parameters

NameTypeDescription
properties?IContactProperties to set

Returns

Contact

Properties

email

email: string

The email address of the contact person/organization. MUST be in the format of an email address.

Implementation of

IContact.email


name

name: string

The identifying name of the contact person/organization.

Implementation of

IContact.name


url

url: string

The URL pointing to the contact information. MUST be in the format of a URL.

Implementation of

IContact.url

Methods

toJSON

toJSON(): Object

Converts this Contact to JSON.

Returns

Object

JSON object


create

create(properties?): Contact

Creates a new Contact instance using the specified properties.

Parameters

NameTypeDescription
properties?IContactProperties to set

Returns

Contact

Contact instance


decode

decode(reader, length?): Contact

Decodes a Contact message from the specified reader or buffer.

Parameters

NameTypeDescription
readerUint8Array | ReaderReader or buffer to decode from
length?numberMessage length if known beforehand

Returns

Contact

Contact

Throws

If the payload is not a reader or valid buffer

Throws

If required fields are missing


decodeDelimited

decodeDelimited(reader): Contact

Decodes a Contact message from the specified reader or buffer, length delimited.

Parameters

NameTypeDescription
readerUint8Array | ReaderReader or buffer to decode from

Returns

Contact

Contact

Throws

If the payload is not a reader or valid buffer

Throws

If required fields are missing


encode

encode(message, writer?): Writer

Encodes the specified Contact message. Does not implicitly grpc.gateway.protoc_gen_openapiv2.options.Contact.verify|verify messages.

Parameters

NameTypeDescription
messageIContactContact message or plain object to encode
writer?WriterWriter to encode to

Returns

Writer

Writer


encodeDelimited

encodeDelimited(message, writer?): Writer

Encodes the specified Contact message, length delimited. Does not implicitly grpc.gateway.protoc_gen_openapiv2.options.Contact.verify|verify messages.

Parameters

NameTypeDescription
messageIContactContact message or plain object to encode
writer?WriterWriter to encode to

Returns

Writer

Writer


fromObject

fromObject(object): Contact

Creates a Contact message from a plain object. Also converts values to their respective internal types.

Parameters

NameTypeDescription
objectObjectPlain object

Returns

Contact

Contact


getTypeUrl

getTypeUrl(typeUrlPrefix?): string

Gets the default type url for Contact

Parameters

NameTypeDescription
typeUrlPrefix?stringyour custom typeUrlPrefix(default "type.googleapis.com")

Returns

string

The default type url


toObject

toObject(message, options?): Object

Creates a plain object from a Contact message. Also converts values to other types if specified.

Parameters

NameTypeDescription
messageContactContact
options?IConversionOptionsConversion options

Returns

Object

Plain object