Skip to main content

Class: 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"; }; ... }; ... };

Properties​

email​

email: string

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


name​

name: string

The identifying name of the contact person/organization.


url​

url: string

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

Methods​

toJSON()​

toJSON(): object

Converts this Contact to JSON.

Returns​

object

JSON object


create()​

Call Signature​

static create(properties?): Contact & $Properties

Creates a new Contact instance using the specified properties.

Parameters​
properties?​

$Properties

Properties to set

Returns​

Contact & $Properties

Contact instance

Call Signature​

static create(properties?): Contact

Creates a new Contact instance using the specified properties.

Parameters​
properties?​

$Properties

Properties to set

Returns​

Contact

Contact instance


decode()​

static decode(reader, length?): Contact & $Properties

Decodes a Contact message from the specified reader or buffer.

Parameters​

reader​

Uint8Array<ArrayBufferLike> | Reader

Reader or buffer to decode from

length?​

number

Message length if known beforehand

Returns​

Contact & $Properties

Contact

Throws​

If the payload is not a reader or valid buffer

Throws​

If required fields are missing


decodeDelimited()​

static decodeDelimited(reader): Contact & $Properties

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

Parameters​

reader​

Uint8Array<ArrayBufferLike> | Reader

Reader or buffer to decode from

Returns​

Contact & $Properties

Contact

Throws​

If the payload is not a reader or valid buffer

Throws​

If required fields are missing


encode()​

static encode(message, writer?): Writer

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

Parameters​

message​

$Properties

Contact message or plain object to encode

writer?​

Writer

Writer to encode to

Returns​

Writer

Writer


encodeDelimited()​

static 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​

message​

$Properties

Contact message or plain object to encode

writer?​

Writer

Writer to encode to

Returns​

Writer

Writer


fromObject()​

static fromObject(object): Contact

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

Parameters​

object​

{[k: string]: any; }

Plain object

Returns​

Contact

Contact


toObject()​

static toObject(message, options?): object

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

Parameters​

message​

Contact

Contact

options?​

IConversionOptions

Conversion options

Returns​

object

Plain object