Class: License
protoc_gen_openapiv2.options.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"; }; ... }; ... };
Implements
Constructors
constructor
• new License(properties?): License
Constructs a new License.
Parameters
| Name | Type | Description |
|---|---|---|
properties? | ILicense | Properties to set |
Returns
Properties
name
• name: string
The license name used for the API.
Implementation of
url
• url: string
A URL to the license used for the API. MUST be in the format of a URL.
Implementation of
Methods
toJSON
▸ toJSON(): Object
Converts this License to JSON.
Returns
Object
JSON object
create
▸ create(properties?): License
Creates a new License instance using the specified properties.
Parameters
| Name | Type | Description |
|---|---|---|
properties? | ILicense | Properties to set |
Returns
License instance
decode
▸ decode(reader, length?): License
Decodes a License message from the specified reader or buffer.
Parameters
| Name | Type | Description |
|---|---|---|
reader | Uint8Array | Reader | Reader or buffer to decode from |
length? | number | Message length if known beforehand |
Returns
License
Throws
If the payload is not a reader or valid buffer
Throws
If required fields are missing
decodeDelimited
▸ decodeDelimited(reader): License
Decodes a License message from the specified reader or buffer, length delimited.
Parameters
| Name | Type | Description |
|---|---|---|
reader | Uint8Array | Reader | Reader or buffer to decode from |
Returns
License
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 License message. Does not implicitly grpc.gateway.protoc_gen_openapiv2.options.License.verify|verify messages.
Parameters
| Name | Type | Description |
|---|---|---|
message | ILicense | License message or plain object to encode |
writer? | Writer | Writer to encode to |
Returns
Writer
Writer
encodeDelimited
▸ 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
| Name | Type | Description |
|---|---|---|
message | ILicense | License message or plain object to encode |
writer? | Writer | Writer to encode to |
Returns
Writer
Writer
fromObject
▸ fromObject(object): License
Creates a License message from a plain object. Also converts values to their respective internal types.
Parameters
| Name | Type | Description |
|---|---|---|
object | Object | Plain object |
Returns
License
getTypeUrl
▸ getTypeUrl(typeUrlPrefix?): string
Gets the default type url for License
Parameters
| Name | Type | Description |
|---|---|---|
typeUrlPrefix? | string | your custom typeUrlPrefix(default "type.googleapis.com") |
Returns
string
The default type url
toObject
▸ toObject(message, options?): Object
Creates a plain object from a License message. Also converts values to other types if specified.
Parameters
| Name | Type | Description |
|---|---|---|
message | License | License |
options? | IConversionOptions | Conversion options |
Returns
Object
Plain object