Service class
Service
is the root object of Google service configuration schema. It
describes basic information about a service, such as the name and the
title, and delegates other aspects to sub-sections. Each sub-section is
either a proto message or a repeated proto message that configures a
specific aspect, such as auth. See each proto message definition for details.
Example:
type: google.api.Service
config_version: 3
name: calendar.googleapis.com
title: Google Calendar API
apis:
- name: google.calendar.v3.Calendar
authentication:
providers:
- id: google_calendar_auth
jwks_uri: https://www.googleapis.com/oauth2/v1/certs
issuer: https://securetoken.google.com
rules:
- selector: "*"
requirements:
provider_id: google_calendar_auth
- Inheritance
-
- Object
- GeneratedMessage
- Service
- Available extensions
Constructors
-
Service.new({String? name, String? title, Iterable<
Api> ? apis, Iterable<Type> ? types, Iterable<Enum> ? enums, Documentation? documentation, Backend? backend, Http? http, Quota? quota, Authentication? authentication, Context? context, Usage? usage, Iterable<Endpoint> ? endpoints, UInt32Value? configVersion, Control? control, String? producerProjectId, Iterable<LogDescriptor> ? logs, Iterable<MetricDescriptor> ? metrics, Iterable<MonitoredResourceDescriptor> ? monitoredResources, Billing? billing, Logging? logging, Monitoring? monitoring, SystemParameters? systemParameters, String? id, SourceInfo? sourceInfo}) -
factory
-
Service.fromBuffer(List<
int> i, [ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) -
factory
- Service.fromJson(String i, [ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY])
-
factory
Properties
-
apis
→ PbList<
Api> -
A list of API interfaces exported by this service. Only the
name
field of thegoogle.protobuf.Api
needs to be provided by the configuration author, as the remaining fields will be derived from the IDL during the normalization process. It is an error to specify an API interface here which cannot be resolved against the associated IDL files.no setter - authentication ↔ Authentication
-
Auth configuration.
getter/setter pair
- backend ↔ Backend
-
API backend configuration.
getter/setter pair
- billing ↔ Billing
-
Billing configuration.
getter/setter pair
- configVersion ↔ UInt32Value
-
The semantic version of the service configuration. The config version
affects the interpretation of the service configuration. For example,
certain features are enabled by default for certain config versions.
The latest config version is
3
.getter/setter pair - context ↔ Context
-
Context configuration.
getter/setter pair
- control ↔ Control
-
Configuration for the service control plane.
getter/setter pair
- documentation ↔ Documentation
-
Additional API documentation.
getter/setter pair
-
endpoints
→ PbList<
Endpoint> -
Configuration for network endpoints. If this is empty, then an endpoint
with the same name as the service is automatically generated to service all
defined APIs.
no setter
-
enums
→ PbList<
Enum> -
A list of all enum types included in this API service. Enums
referenced directly or indirectly by the
apis
are automatically included. Enums which are not referenced but shall be included should be listed here by name. Example:no setter - hashCode → int
-
Calculates a hash code based on the contents of the protobuf.
no setterinherited
- http ↔ Http
-
HTTP configuration.
getter/setter pair
- id ↔ String
-
A unique ID for a specific instance of this message, typically assigned
by the client for tracking purpose. If empty, the server may choose to
generate one instead.
getter/setter pair
- info_ → BuilderInfo
-
no setteroverride
- isFrozen → bool
-
Returns
true
if this message is marked read-only. Otherwisefalse
.no setterinherited - logging ↔ Logging
-
Logging configuration.
getter/setter pair
-
logs
→ PbList<
LogDescriptor> -
Defines the logs used by this service.
no setter
-
metrics
→ PbList<
MetricDescriptor> -
Defines the metrics used by this service.
no setter
-
monitoredResources
→ PbList<
MonitoredResourceDescriptor> -
Defines the monitored resources used by this service. This is required
by the
google.api.Service.monitoring
andgoogle.api.Service.logging
configurations.no setter - monitoring ↔ Monitoring
-
Monitoring configuration.
getter/setter pair
- name ↔ String
-
The DNS address at which this service is available,
e.g.
calendar.googleapis.com
.getter/setter pair - producerProjectId ↔ String
-
The Google project that owns this service.
getter/setter pair
- quota ↔ Quota
-
Quota configuration.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sourceInfo ↔ SourceInfo
-
Output only. The source information for this configuration if available.
getter/setter pair
- systemParameters ↔ SystemParameters
-
System parameter configuration.
getter/setter pair
- title ↔ String
-
The product title for this service.
getter/setter pair
-
types
→ PbList<
Type> -
A list of all proto message types included in this API service.
Types referenced directly or indirectly by the
apis
are automatically included. Messages which are not referenced but shall be included, such as types used by thegoogle.protobuf.Any
type, should be listed here by name. Example:no setter - unknownFields → UnknownFieldSet
-
no setterinherited
- usage ↔ Usage
-
Configuration controlling usage of this service.
getter/setter pair
Methods
-
addExtension(
Extension extension, Object? value) → void -
Adds an extension field value to a repeated field.
inherited
-
check(
) → void -
Throws a StateError if the message has required fields without a value.
inherited
-
clear(
) → void -
Clears all data that was set in this message.
inherited
-
clearAuthentication(
) → void -
clearBackend(
) → void -
clearBilling(
) → void -
clearConfigVersion(
) → void -
clearContext(
) → void -
clearControl(
) → void -
clearDocumentation(
) → void -
clearExtension(
Extension extension) → void -
Clears an extension field and also removes the extension.
inherited
-
clearField(
int tagNumber) → void -
Clears the contents of a given field.
inherited
-
clearHttp(
) → void -
clearId(
) → void -
clearLogging(
) → void -
clearMonitoring(
) → void -
clearName(
) → void -
clearProducerProjectId(
) → void -
clearQuota(
) → void -
clearSourceInfo(
) → void -
clearSystemParameters(
) → void -
clearTitle(
) → void -
clearUsage(
) → void -
clone(
) → Service -
Creates a deep copy of the fields in this message.
(The generated code uses mergeFromMessage.)
override
-
copyWith(
void updates(Service)) → Service -
Apply
updates
to a copy of this message.override -
createEmptyInstance(
) → Service -
Creates an empty instance of the same message type as this.
override
-
deepCopy(
) → T -
Available on T, provided by the GeneratedMessageGenericExtensions extension
Returns a writable deep copy of this message. -
ensureAuthentication(
) → Authentication -
ensureBackend(
) → Backend -
ensureBilling(
) → Billing -
ensureConfigVersion(
) → UInt32Value -
ensureContext(
) → Context -
ensureControl(
) → Control -
ensureDocumentation(
) → Documentation -
ensureHttp(
) → Http -
ensureLogging(
) → Logging -
ensureMonitoring(
) → Monitoring -
ensureQuota(
) → Quota -
ensureSourceInfo(
) → SourceInfo -
ensureSystemParameters(
) → SystemParameters -
ensureUsage(
) → Usage -
extensionsAreInitialized(
) → bool -
inherited
-
freeze(
) → GeneratedMessage -
Make this message read-only.
inherited
-
getDefaultForField(
int tagNumber) → dynamic -
Returns the default value for the given field.
inherited
-
getExtension(
Extension extension) → dynamic -
Returns the value of
extension
.inherited -
getField(
int tagNumber) → dynamic -
Returns the value of the field associated with
tagNumber
, or the default value if it is not set.inherited -
getFieldOrNull(
int tagNumber) → dynamic -
Returns the value of a field, ignoring any defaults.
inherited
-
getTagNumber(
String fieldName) → int? -
inherited
-
hasAuthentication(
) → bool -
hasBackend(
) → bool -
hasBilling(
) → bool -
hasConfigVersion(
) → bool -
hasContext(
) → bool -
hasControl(
) → bool -
hasDocumentation(
) → bool -
hasExtension(
Extension extension) → bool -
Returns
true
if a value ofextension
is present.inherited -
hasField(
int tagNumber) → bool -
Whether this message has a field associated with
tagNumber
.inherited -
hasHttp(
) → bool -
hasId(
) → bool -
hasLogging(
) → bool -
hasMonitoring(
) → bool -
hasName(
) → bool -
hasProducerProjectId(
) → bool -
hasQuota(
) → bool -
hasRequiredFields(
) → bool -
Whether the message has required fields.
inherited
-
hasSourceInfo(
) → bool -
hasSystemParameters(
) → bool -
hasTitle(
) → bool -
hasUsage(
) → bool -
isInitialized(
) → bool -
Whether all required fields in the message and embedded messages are set.
inherited
-
mergeFromBuffer(
List< int> input, [ExtensionRegistry extensionRegistry = ExtensionRegistry.EMPTY]) → void -
Merges serialized protocol buffer data into this message.
inherited
-
mergeFromCodedBufferReader(
CodedBufferReader input, [ExtensionRegistry extensionRegistry = ExtensionRegistry.EMPTY]) → void -
Same as
mergeFromBuffer
, but takes aCodedBufferReader
input.inherited -
mergeFromJson(
String data, [ExtensionRegistry extensionRegistry = ExtensionRegistry.EMPTY]) → void -
Merges field values from
data
, a JSON object, encoded as described byGeneratedMessage.writeToJson
.inherited -
mergeFromJsonMap(
Map< String, dynamic> json, [ExtensionRegistry extensionRegistry = ExtensionRegistry.EMPTY]) → void -
Merges field values from a JSON object represented as a Dart map.
inherited
-
mergeFromMessage(
GeneratedMessage other) → void -
Merges the contents of the
other
into this message.inherited -
mergeFromProto3Json(
Object? json, {TypeRegistry typeRegistry = const TypeRegistry.empty(), bool ignoreUnknownFields = false, bool supportNamesWithUnderscores = true, bool permissiveEnums = false}) → void -
Merges field values from
json
, a JSON object using proto3 encoding.inherited -
mergeUnknownFields(
UnknownFieldSet unknownFieldSet) → void -
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
rebuild(
void updates(T)) → T -
Available on T, provided by the GeneratedMessageGenericExtensions extension
Applyupdates
to a copy of this message. -
setExtension(
Extension extension, Object value) → void -
Sets the value of a non-repeated extension field to
value
.inherited -
setField(
int tagNumber, Object value) → void -
Sets the value of a field by its
tagNumber
.inherited -
toBuilder(
) → GeneratedMessage -
Creates a writable, shallow copy of this message.
inherited
-
toDebugString(
) → String -
Returns a String representation of this message.
inherited
-
toProto3Json(
{TypeRegistry typeRegistry = const TypeRegistry.empty()}) → Object? -
Returns an Object representing Proto3 JSON serialization of
this
.inherited -
toString(
) → String -
Returns a String representation of this message.
inherited
-
writeToBuffer(
) → Uint8List -
Serialize the message as the protobuf binary format.
inherited
-
writeToCodedBufferWriter(
CodedBufferWriter output) → void -
Same as
writeToBuffer
, but serializes to the givenCodedBufferWriter
.inherited -
writeToJson(
) → String -
Returns a JSON string that encodes this message.
inherited
-
writeToJsonMap(
) → Map< String, dynamic> -
Returns the JSON encoding of this message as a Dart Map.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
create(
) → Service -
createRepeated(
) → PbList< Service> -
getDefault(
) → Service