Skip to main content

Class: License

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

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

Example:

option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { info: { ... license: { name: "BSD 3-Clause License"; url: "https://github.com/grpc-ecosystem/grpc-gateway/blob/main/LICENSE"; }; ... }; ... };

Properties​

name​

name: string

The license name used for the API.


url​

url: string

A URL to the license used for the API. MUST be in the format of a URL.

Methods​

toJSON()​

toJSON(): object

Converts this License to JSON.

Returns​

object

JSON object


create()​

Call Signature​

static create(properties?): License & $Properties

Creates a new License instance using the specified properties.

Parameters​
properties?​

$Properties

Properties to set

Returns​

License & $Properties

License instance

Call Signature​

static create(properties?): License

Creates a new License instance using the specified properties.

Parameters​
properties?​

$Properties

Properties to set

Returns​

License

License instance


decode()​

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

Decodes a License 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​

License & $Properties

License

Throws​

If the payload is not a reader or valid buffer

Throws​

If required fields are missing


decodeDelimited()​

static decodeDelimited(reader): License & $Properties

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

Parameters​

reader​

Uint8Array<ArrayBufferLike> | Reader

Reader or buffer to decode from

Returns​

License & $Properties

License

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 License message. Does not implicitly grpc.gateway.protoc_gen_openapiv2.options.License.verify|verify messages.

Parameters​

message​

$Properties

License message or plain object to encode

writer?​

Writer

Writer to encode to

Returns​

Writer

Writer


encodeDelimited()​

static encodeDelimited(message, writer?): Writer

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

Parameters​

message​

$Properties

License message or plain object to encode

writer?​

Writer

Writer to encode to

Returns​

Writer

Writer


fromObject()​

static fromObject(object): License

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

Parameters​

object​

{[k: string]: any; }

Plain object

Returns​

License

License


toObject()​

static toObject(message, options?): object

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

Parameters​

message​

License

License

options?​

IConversionOptions

Conversion options

Returns​

object

Plain object