Class: Scopes
protoc_gen_openapiv2.options.Scopes
Scopes is a representation of OpenAPI v2 specification's Scopes object.
See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#scopesObject
Lists the available scopes for an OAuth2 security scheme.
Implements
Constructors
constructor
• new Scopes(properties?): Scopes
Constructs a new Scopes.
Parameters
| Name | Type | Description |
|---|---|---|
properties? | IScopes | Properties to set |
Returns
Properties
scope
• scope: Object
Maps between a name of a scope to a short description of it (as the value of the property).
Index signature
▪ [k: string]: string
Implementation of
Methods
toJSON
▸ toJSON(): Object
Converts this Scopes to JSON.
Returns
Object
JSON object
create
▸ create(properties?): Scopes
Creates a new Scopes instance using the specified properties.
Parameters
| Name | Type | Description |
|---|---|---|
properties? | IScopes | Properties to set |
Returns
Scopes instance
decode
▸ decode(reader, length?): Scopes
Decodes a Scopes 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
Scopes
Throws
If the payload is not a reader or valid buffer
Throws
If required fields are missing
decodeDelimited
▸ decodeDelimited(reader): Scopes
Decodes a Scopes message from the specified reader or buffer, length delimited.
Parameters
| Name | Type | Description |
|---|---|---|
reader | Uint8Array | Reader | Reader or buffer to decode from |
Returns
Scopes
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 Scopes message. Does not implicitly grpc.gateway.protoc_gen_openapiv2.options.Scopes.verify|verify messages.
Parameters
| Name | Type | Description |
|---|---|---|
message | IScopes | Scopes message or plain object to encode |
writer? | Writer | Writer to encode to |
Returns
Writer
Writer
encodeDelimited
▸ encodeDelimited(message, writer?): Writer
Encodes the specified Scopes message, length delimited. Does not implicitly grpc.gateway.protoc_gen_openapiv2.options.Scopes.verify|verify messages.
Parameters
| Name | Type | Description |
|---|---|---|
message | IScopes | Scopes message or plain object to encode |
writer? | Writer | Writer to encode to |
Returns
Writer
Writer
fromObject
▸ fromObject(object): Scopes
Creates a Scopes message from a plain object. Also converts values to their respective internal types.
Parameters
| Name | Type | Description |
|---|---|---|
object | Object | Plain object |
Returns
Scopes
getTypeUrl
▸ getTypeUrl(typeUrlPrefix?): string
Gets the default type url for Scopes
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 Scopes message. Also converts values to other types if specified.
Parameters
| Name | Type | Description |
|---|---|---|
message | Scopes | Scopes |
options? | IConversionOptions | Conversion options |
Returns
Object
Plain object