Class: SecurityRequirement
protoc_gen_openapiv2.options.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.
Implements
Constructors
constructor
• new SecurityRequirement(properties?): SecurityRequirement
Constructs a new SecurityRequirement.
Parameters
| Name | Type | Description |
|---|---|---|
properties? | ISecurityRequirement | Properties to set |
Returns
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]: ISecurityRequirementValue
Implementation of
ISecurityRequirement.securityRequirement
Methods
toJSON
▸ toJSON(): Object
Converts this SecurityRequirement to JSON.
Returns
Object
JSON object
create
▸ create(properties?): SecurityRequirement
Creates a new SecurityRequirement instance using the specified properties.
Parameters
| Name | Type | Description |
|---|---|---|
properties? | ISecurityRequirement | Properties to set |
Returns
SecurityRequirement instance
decode
▸ decode(reader, length?): SecurityRequirement
Decodes a SecurityRequirement 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
SecurityRequirement
Throws
If the payload is not a reader or valid buffer
Throws
If required fields are missing
decodeDelimited
▸ decodeDelimited(reader): SecurityRequirement
Decodes a SecurityRequirement message from the specified reader or buffer, length delimited.
Parameters
| Name | Type | Description |
|---|---|---|
reader | Uint8Array | Reader | Reader or buffer to decode from |
Returns
SecurityRequirement
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 SecurityRequirement message. Does not implicitly grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement.verify|verify messages.
Parameters
| Name | Type | Description |
|---|---|---|
message | ISecurityRequirement | SecurityRequirement message or plain object to encode |
writer? | Writer | Writer to encode to |
Returns
Writer
Writer
encodeDelimited
▸ 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
| Name | Type | Description |
|---|---|---|
message | ISecurityRequirement | SecurityRequirement message or plain object to encode |
writer? | Writer | Writer to encode to |
Returns
Writer
Writer
fromObject
▸ fromObject(object): SecurityRequirement
Creates a SecurityRequirement message from a plain object. Also converts values to their respective internal types.
Parameters
| Name | Type | Description |
|---|---|---|
object | Object | Plain object |
Returns
SecurityRequirement
getTypeUrl
▸ getTypeUrl(typeUrlPrefix?): string
Gets the default type url for SecurityRequirement
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 SecurityRequirement message. Also converts values to other types if specified.
Parameters
| Name | Type | Description |
|---|---|---|
message | SecurityRequirement | SecurityRequirement |
options? | IConversionOptions | Conversion options |
Returns
Object
Plain object