Skip to main content

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

NameTypeDescription
properties?IScopesProperties to set

Returns

Scopes

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

IScopes.scope

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

NameTypeDescription
properties?IScopesProperties to set

Returns

Scopes

Scopes instance


decode

decode(reader, length?): Scopes

Decodes a Scopes message from the specified reader or buffer.

Parameters

NameTypeDescription
readerUint8Array | ReaderReader or buffer to decode from
length?numberMessage length if known beforehand

Returns

Scopes

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

NameTypeDescription
readerUint8Array | ReaderReader or buffer to decode from

Returns

Scopes

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

NameTypeDescription
messageIScopesScopes message or plain object to encode
writer?WriterWriter 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

NameTypeDescription
messageIScopesScopes message or plain object to encode
writer?WriterWriter 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

NameTypeDescription
objectObjectPlain object

Returns

Scopes

Scopes


getTypeUrl

getTypeUrl(typeUrlPrefix?): string

Gets the default type url for Scopes

Parameters

NameTypeDescription
typeUrlPrefix?stringyour 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

NameTypeDescription
messageScopesScopes
options?IConversionOptionsConversion options

Returns

Object

Plain object