Class ServiceMetadata (4.8.0)

public sealed class ServiceMetadata

Provides metadata about a single service within an API. Often most of these aspects will be the same across multiple services, but they can be specified with different values in the original proto, so they are specified individually here. This class is expected to be constructed with a single instance per service; equality is by simple identity.

Inheritance

object > ServiceMetadata

Namespace

Google.Api.Gax.Grpc

Assembly

Google.Api.Gax.Grpc.dll

Constructors

ServiceMetadata(ServiceDescriptor, string, IEnumerable<string>, bool, ApiTransports, ApiMetadata)

public ServiceMetadata(ServiceDescriptor serviceDescriptor, string defaultEndpoint, IEnumerable<string> defaultScopes, bool supportsScopedJwts, ApiTransports transports, ApiMetadata apiMetadata)

Constructs a new instance for a given service.

Parameters
Name Description
serviceDescriptor ServiceDescriptor

The protobuf descriptor for the service.

defaultEndpoint string

The default endpoint to connect to.

defaultScopes IEnumerablestring

The default scopes for the service. Must not be null, and must not contain any null elements. May be empty.

supportsScopedJwts bool

Whether the service supports scoped JWTs as credentials.

transports ApiTransports

The transports supported by this service.

apiMetadata ApiMetadata

The metadata for this API, including all of the services expected to be available at the same endpoint, and all associated protos.

Properties

ApiMetadata

public ApiMetadata ApiMetadata { get; }

The metadata for the API this is part of. This is never null.

Property Value
Type Description
ApiMetadata

DefaultEndpoint

public string DefaultEndpoint { get; }

The default endpoint for the service. This may be null, if a service has no default endpoint.

Property Value
Type Description
string
Remarks

The default endpoint is an endpoint in the default universe domain.

DefaultScopes

public IReadOnlyList<string> DefaultScopes { get; }

The default scopes for the service. This will never be null, but may be empty. This will never contain any null references. This will never change after construction.

Property Value
Type Description
IReadOnlyListstring

EndpointTemplate

public string EndpointTemplate { get; }

The template to build and endpoint for the service taking into account a custom universe domain, for instance "storage.{0}". May be null, in which case no universe domain dependent endpoint may be built for the service.

Property Value
Type Description
string

Name

public string Name { get; }

The name of the service within the API, e.g. "Subscriber". This is never null or empty.

Property Value
Type Description
string

ServiceDescriptor

public ServiceDescriptor ServiceDescriptor { get; }

The protobuf service descriptor for this service. This is never null.

Property Value
Type Description
ServiceDescriptor

SupportsScopedJwts

public bool SupportsScopedJwts { get; }

Whether this service supports scoped JWT access (in which case this is preferred by default over OAuth tokens).

Property Value
Type Description
bool

Transports

public ApiTransports Transports { get; }

The transports supported by this service.

Property Value
Type Description
ApiTransports