Skip to main content

Class: SecurityRequirement

SecurityRequirement is a representation of OpenAPI v2 specification's Security Requirement object.

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

Lists the required security schemes to execute this operation. The object can have multiple security schemes declared in it which are all required (that is, there is a logical AND between the schemes).

The name used for each property MUST correspond to a security scheme declared in the Security Definitions.

Properties​

securityRequirement​

securityRequirement: object

Each name must correspond to a security scheme which is declared in the Security Definitions. If the security scheme is of type "oauth2", then the value is a list of scope names required for the execution. For other security scheme types, the array MUST be empty.

Index Signature​

[k: string]: $Properties

Methods​

toJSON()​

toJSON(): object

Converts this SecurityRequirement to JSON.

Returns​

object

JSON object


create()​

Call Signature​

static create(properties?): SecurityRequirement & $Properties

Creates a new SecurityRequirement instance using the specified properties.

Parameters​
properties?​

$Properties

Properties to set

Returns​

SecurityRequirement & $Properties

SecurityRequirement instance

Call Signature​

static create(properties?): SecurityRequirement

Creates a new SecurityRequirement instance using the specified properties.

Parameters​
properties?​

$Properties

Properties to set

Returns​

SecurityRequirement

SecurityRequirement instance


decode()​

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

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

SecurityRequirement & $Properties

SecurityRequirement

Throws​

If the payload is not a reader or valid buffer

Throws​

If required fields are missing


decodeDelimited()​

static decodeDelimited(reader): SecurityRequirement & $Properties

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

Parameters​

reader​

Uint8Array<ArrayBufferLike> | Reader

Reader or buffer to decode from

Returns​

SecurityRequirement & $Properties

SecurityRequirement

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

Parameters​

message​

$Properties

SecurityRequirement message or plain object to encode

writer?​

Writer

Writer to encode to

Returns​

Writer

Writer


encodeDelimited()​

static encodeDelimited(message, writer?): Writer

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

Parameters​

message​

$Properties

SecurityRequirement message or plain object to encode

writer?​

Writer

Writer to encode to

Returns​

Writer

Writer


fromObject()​

static fromObject(object): SecurityRequirement

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

Parameters​

object​

{[k: string]: any; }

Plain object

Returns​

SecurityRequirement

SecurityRequirement


toObject()​

static toObject(message, options?): object

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

Parameters​

message​

SecurityRequirement

SecurityRequirement

options?​

IConversionOptions

Conversion options

Returns​

object

Plain object