CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/maven-com-google-api-grpc--proto-google-common-protos

Java Protocol Buffer classes for Google's common protos, providing type-safe access to core Google Cloud API structures and gRPC service definitions

Pending
Overview
Eval results
Files

api-infrastructure.mddocs/

API Infrastructure and Configuration

This module provides core service configuration classes for defining gRPC services with REST endpoints, authentication, quota management, and API annotations.

Service Configuration

Service

The main service definition containing APIs, types, documentation, and configuration.

class Service {
  String getName();
  String getTitle();
  String getProducerProjectId();
  String getId();
  repeated Api getApisList();
  repeated Type getTypesList();
  repeated Enum getEnumsList();
  Documentation getDocumentation();
  Backend getBackend();
  Http getHttp();
  Quota getQuota();
  Authentication getAuthentication();
  Context getContext();
  Usage getUsage();
  repeated Endpoint getEndpointsList();
  Control getControl();
  repeated LogDescriptor getLogsList();
  repeated MetricDescriptor getMetricsList();
  repeated MonitoredResourceDescriptor getMonitoredResourcesList();
  Billing getBilling();
  Logging getLogging();
  Monitoring getMonitoring();
  SystemParameters getSystemParameters();
  SourceInfo getSourceInfo();
  UInt32Value getConfigVersion();
  
  static Service.Builder newBuilder();
  Service.Builder toBuilder();
}

Api

Defines an API interface.

class Api {
  String getName();
  repeated Method getMethodsList();
  repeated Option getOptionsList();
  String getVersion();
  SourceContext getSourceContext();
  repeated Mixin getMixinsList();
  Syntax getSyntax();
  
  static Api.Builder newBuilder();
}

class Method {
  String getName();
  String getRequestTypeUrl();
  boolean getRequestStreaming();
  String getResponseTypeUrl();
  boolean getResponseStreaming();
  repeated Option getOptionsList();
  Syntax getSyntax();
  
  static Method.Builder newBuilder();
}

HTTP Configuration

Http

Configuration for HTTP/REST API mappings.

class Http {
  repeated HttpRule getRulesList();
  boolean getFullyDecodeReservedExpansion();
  
  static Http.Builder newBuilder();
}

HttpRule

Individual HTTP mapping rule for gRPC methods.

class HttpRule {
  String getSelector();
  String getGet();
  String getPost();
  String getPut();
  String getDelete();
  String getPatch();
  CustomHttpPattern getCustom();
  String getBody();
  String getResponseBody();
  repeated HttpRule getAdditionalBindingsList();
  
  static HttpRule.Builder newBuilder();
}

class CustomHttpPattern {
  String getKind();
  String getPath();
  
  static CustomHttpPattern.Builder newBuilder();
}

Authentication Configuration

Authentication

Authentication configuration for the service.

class Authentication {
  repeated AuthenticationRule getRulesList();
  repeated AuthProvider getProvidersList();
  
  static Authentication.Builder newBuilder();
}

class AuthenticationRule {
  String getSelector();
  AuthRequirement getOauth();
  boolean getAllowWithoutCredential();
  repeated AuthRequirement getRequirementsList();
  
  static AuthenticationRule.Builder newBuilder();
}

class AuthProvider {
  String getId();
  String getIssuer();
  String getJwksUri();
  String getAudiences();
  String getAuthorizationUrl();
  repeated JwtLocation getJwtLocationsList();
  
  static AuthProvider.Builder newBuilder();
}

class AuthRequirement {
  String getProviderId();
  String getAudiences();
  
  static AuthRequirement.Builder newBuilder();
}

Quota Management

Quota

API quota configuration and limits.

class Quota {
  repeated QuotaLimit getLimitsList();
  repeated MetricRule getMetricRulesList();
  
  static Quota.Builder newBuilder();
}

class QuotaLimit {
  String getName();
  String getDescription();
  long getDefaultLimit();
  long getMaxLimit();
  String getFreeTier();
  String getDuration();
  String getMetric();
  String getUnit();
  Struct getValues();
  String getDisplayName();
  
  static QuotaLimit.Builder newBuilder();
}

class MetricRule {
  String getSelector();
  Struct getMetricCosts();
  
  static MetricRule.Builder newBuilder();
}

Field Behavior Annotations

FieldBehavior

Annotations for field behavior in API definitions.

enum FieldBehavior {
  FIELD_BEHAVIOR_UNSPECIFIED(0),
  OPTIONAL(1),
  REQUIRED(2),
  OUTPUT_ONLY(3),
  INPUT_ONLY(4),
  IMMUTABLE(5);
  
  int getNumber();
  static FieldBehavior forNumber(int value);
}

Resource Annotations

class ResourceDescriptor {
  String getType();
  repeated String getPatternList();
  String getNameField();
  History getHistory();
  String getPlural();
  String getSingular();
  repeated Style getStyleList();
  
  static ResourceDescriptor.Builder newBuilder();
}

class ResourceReference {
  String getType();
  String getChildType();
  
  static ResourceReference.Builder newBuilder();
}

Usage Examples

Basic Service Configuration

// Create HTTP rule for REST endpoint
HttpRule getUserRule = HttpRule.newBuilder()
    .setSelector("myservice.MyService.GetUser")
    .setGet("/v1/users/{user_id}")
    .build();

HttpRule listUsersRule = HttpRule.newBuilder()
    .setSelector("myservice.MyService.ListUsers")
    .setGet("/v1/users")
    .build();

// Configure HTTP mappings
Http httpConfig = Http.newBuilder()
    .addRules(getUserRule)
    .addRules(listUsersRule)
    .setFullyDecodeReservedExpansion(true)
    .build();

// Create service configuration
Service service = Service.newBuilder()
    .setName("myservice.googleapis.com")
    .setTitle("My Service")
    .setHttp(httpConfig)
    .build();

Authentication Setup

// Configure OAuth provider
AuthProvider authProvider = AuthProvider.newBuilder()
    .setId("google_service_account")
    .setIssuer("https://accounts.google.com")
    .setJwksUri("https://www.googleapis.com/oauth2/v3/certs")
    .build();

// Create authentication rule
AuthenticationRule authRule = AuthenticationRule.newBuilder()
    .setSelector("myservice.MyService.*")
    .setOauth(AuthRequirement.newBuilder()
        .setProviderId("google_service_account")
        .build())
    .build();

// Configure authentication
Authentication authentication = Authentication.newBuilder()
    .addProviders(authProvider)
    .addRules(authRule)
    .build();

Quota Configuration

// Set up quota limits
QuotaLimit requestLimit = QuotaLimit.newBuilder()
    .setName("requests_per_minute")
    .setDescription("Requests per minute per project")
    .setDefaultLimit(1000)
    .setMaxLimit(10000)
    .setDuration("1m")
    .setMetric("myservice.googleapis.com/requests")
    .build();

Quota quota = Quota.newBuilder()
    .addLimits(requestLimit)
    .build();

Service Lifecycle and Maturity

LaunchStage

Defines the maturity level of an API or feature.

enum LaunchStage {
  LAUNCH_STAGE_UNSPECIFIED(0),
  UNIMPLEMENTED(6),
  PRELAUNCH(7),
  EARLY_ACCESS(1),
  ALPHA(2),
  BETA(3),
  GA(4),
  DEPRECATED(5);
  
  int getNumber();
  static LaunchStage forNumber(int value);
}

Publishing

Configuration for client library publishing and generation.

class Publishing {
  repeated MethodSettings getMethodSettingsList();
  String getNewIssueUri();
  String getDocumentationUri();
  String getApiShortName();
  String getGithubLabel();
  repeated String getCodeownerGithubTeamsList();
  String getDocTagPrefix();
  ClientLibraryOrganization getOrganization();
  repeated ClientLibrarySettings getLibrarySettingsList();
  
  static Publishing.Builder newBuilder();
}

class MethodSettings {
  String getSelector();
  LongRunning getLongRunning();
  repeated String getAutoPopulatedFieldsList();
  
  static MethodSettings.Builder newBuilder();
}

Monitoring and Observability

Monitoring

Service monitoring configuration.

class Monitoring {
  repeated MonitoringDestination getProducerDestinationsList();
  repeated MonitoringDestination getConsumerDestinationsList();
  
  static Monitoring.Builder newBuilder();
}

class MonitoringDestination {
  String getMonitoredResource();
  repeated String getMetricsList();
  
  static MonitoringDestination.Builder newBuilder();
}

Logging

Service logging configuration.

class Logging {
  repeated LoggingDestination getProducerDestinationsList();
  repeated LoggingDestination getConsumerDestinationsList();
  
  static Logging.Builder newBuilder();
}

class LoggingDestination {
  String getMonitoredResource();
  repeated String getLogsList();
  
  static LoggingDestination.Builder newBuilder();
}

Visibility

API visibility controls and access restrictions.

class Visibility {
  repeated VisibilityRule getRulesList();
  
  static Visibility.Builder newBuilder();
}

class VisibilityRule {
  String getSelector();
  String getRestriction();
  
  static VisibilityRule.Builder newBuilder();
}

Extensions and Annotations

The com.google.api package defines several Protocol Buffer extensions for method and field annotations:

// HTTP extension for method options
public static final GeneratedExtension<MethodOptions, HttpRule> http;

// Field behavior extension  
public static final GeneratedExtension<FieldOptions, FieldBehavior> fieldBehavior;

// Resource reference extension
public static final GeneratedExtension<FieldOptions, ResourceReference> resourceReference;

// Resource definition extension
public static final GeneratedExtension<MessageOptions, ResourceDescriptor> resource;

These extensions are used in .proto files to annotate methods and fields with HTTP mappings, field behaviors, and resource relationships.

Install with Tessl CLI

npx tessl i tessl/maven-com-google-api-grpc--proto-google-common-protos

docs

api-infrastructure.md

apps-cards.md

cloud-platform.md

common-types.md

index.md

longrunning-operations.md

rpc-status.md

tile.json