googleapismodule

package module
v0.1.50 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 11, 2026 License: MIT Imports: 0 Imported by: 0

README

Tiny Systems Googleapis module

Example module for the Tiny Systems platform.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	Kind              string               `json:"kind"`
	ID                string               `json:"id"`
	Name              string               `json:"name"`
	Version           string               `json:"version"`
	Title             string               `json:"title"`
	Description       string               `json:"description,omitempty"`
	CanonicalName     string               `json:"canonicalName,omitempty"`
	DiscoveryVersion  string               `json:"discoveryVersion,omitempty"`
	DocumentationLink string               `json:"documentationLink,omitempty"`
	RootUrl           string               `json:"rootUrl,omitempty"`
	BasePath          string               `json:"basePath,omitempty"`
	BaseUrl           string               `json:"baseUrl,omitempty"`
	ServicePath       string               `json:"servicePath,omitempty"`
	Revision          string               `json:"revision,omitempty"`
	Protocol          string               `json:"protocol,omitempty"`
	BatchPath         string               `json:"batchPath,omitempty"`
	Parameters        map[string]Parameter `json:"parameters,omitempty"`
	Auth              *Auth                `json:"auth,omitempty"`
	Schemas           map[string]Schema    `json:"schemas,omitempty"`
	Resources         map[string]Resource  `json:"resources,omitempty"`
	Methods           map[string]Method    `json:"methods,omitempty"` // Top-level methods (rare)
}

API represents a full Google API specification from a discovery document

func (*API) GetAllMethods

func (api *API) GetAllMethods() []MethodInfo

GetAllMethods returns all methods from an API flattened with their full names

type Annotations

type Annotations struct {
	Required []string `json:"required,omitempty"`
}

Annotations contains documentation annotations

type Auth

type Auth struct {
	OAuth2 *OAuth2Config `json:"oauth2,omitempty"`
}

Auth represents authentication configuration

type Discovery

type Discovery struct {
	Kind             string          `json:"kind"`
	DiscoveryVersion string          `json:"discoveryVersion"`
	Items            []DiscoveryItem `json:"items"`
}

Discovery represents the Google API Discovery directory list

type DiscoveryItem

type DiscoveryItem struct {
	Kind             string `json:"kind"`
	ID               string `json:"id"`
	Name             string `json:"name"`
	Version          string `json:"version"`
	Title            string `json:"title"`
	Description      string `json:"description"`
	DiscoveryRestUrl string `json:"discoveryRestUrl"`
	Icons            struct {
		X16 string `json:"x16"`
		X32 string `json:"x32"`
	} `json:"icons"`
	DocumentationLink string `json:"documentationLink"`
	Preferred         bool   `json:"preferred"`
}

DiscoveryItem represents a single API in the discovery directory

type MediaUpload

type MediaUpload struct {
	Accept    []string            `json:"accept,omitempty"`
	MaxSize   string              `json:"maxSize,omitempty"`
	Protocols map[string]Protocol `json:"protocols,omitempty"`
}

MediaUpload represents media upload configuration

type Method

type Method struct {
	ID                      string               `json:"id"`
	Path                    string               `json:"path"`
	FlatPath                string               `json:"flatPath,omitempty"`
	HttpMethod              string               `json:"httpMethod"`
	Description             string               `json:"description,omitempty"`
	Parameters              map[string]Parameter `json:"parameters,omitempty"`
	ParameterOrder          []string             `json:"parameterOrder,omitempty"`
	Request                 *SchemaRef           `json:"request,omitempty"`
	Response                *SchemaRef           `json:"response,omitempty"`
	Scopes                  []string             `json:"scopes,omitempty"`
	SupportsMediaDownload   bool                 `json:"supportsMediaDownload,omitempty"`
	SupportsMediaUpload     bool                 `json:"supportsMediaUpload,omitempty"`
	MediaUpload             *MediaUpload         `json:"mediaUpload,omitempty"`
	UseMediaDownloadService bool                 `json:"useMediaDownloadService,omitempty"`
}

Method represents an API method/operation

type MethodInfo

type MethodInfo struct {
	FullName string // e.g., "spreadsheets.values.get"
	Method   Method
	Resource string // e.g., "spreadsheets.values"
}

MethodInfo is a flattened representation of a method with its full path

type OAuth2Config

type OAuth2Config struct {
	Scopes map[string]ScopeInfo `json:"scopes,omitempty"`
}

OAuth2Config represents OAuth2 scopes

type Parameter

type Parameter struct {
	Type             string   `json:"type,omitempty"`
	Description      string   `json:"description,omitempty"`
	Location         string   `json:"location,omitempty"` // "path", "query"
	Required         bool     `json:"required,omitempty"`
	Repeated         bool     `json:"repeated,omitempty"`
	Default          string   `json:"default,omitempty"`
	Minimum          string   `json:"minimum,omitempty"`
	Maximum          string   `json:"maximum,omitempty"`
	Enum             []string `json:"enum,omitempty"`
	EnumDescriptions []string `json:"enumDescriptions,omitempty"`
	Format           string   `json:"format,omitempty"` // "int32", "int64", "uint32", "uint64", "double", "float", "byte", "date", "date-time", "google-datetime", "google-duration", "google-fieldmask"
	Pattern          string   `json:"pattern,omitempty"`
	// For array/repeated parameters
	Items *Parameter `json:"items,omitempty"`
}

Parameter represents a method parameter

type Protocol

type Protocol struct {
	Multipart bool   `json:"multipart,omitempty"`
	Path      string `json:"path,omitempty"`
}

Protocol represents an upload protocol

type Resource

type Resource struct {
	Methods   map[string]Method   `json:"methods,omitempty"`
	Resources map[string]Resource `json:"resources,omitempty"`
}

Resource represents a REST resource with methods and nested resources

type Schema

type Schema struct {
	ID               string   `json:"id,omitempty"`
	Type             string   `json:"type,omitempty"` // "object", "array", "string", "integer", "number", "boolean", "any"
	Ref              string   `json:"$ref,omitempty"`
	Description      string   `json:"description,omitempty"`
	Default          any      `json:"default,omitempty"`
	Required         bool     `json:"required,omitempty"`
	Format           string   `json:"format,omitempty"`
	Enum             []string `json:"enum,omitempty"`
	EnumDescriptions []string `json:"enumDescriptions,omitempty"`
	Minimum          string   `json:"minimum,omitempty"`
	Maximum          string   `json:"maximum,omitempty"`
	Pattern          string   `json:"pattern,omitempty"`
	ReadOnly         bool     `json:"readOnly,omitempty"`
	// Object properties
	Properties           map[string]Schema `json:"properties,omitempty"`
	AdditionalProperties *Schema           `json:"additionalProperties,omitempty"`
	// Array items
	Items *Schema `json:"items,omitempty"`
	// Annotations for documentation
	Annotations *Annotations `json:"annotations,omitempty"`
}

Schema represents a data type schema in Google's discovery format

type SchemaRef

type SchemaRef struct {
	Ref           string `json:"$ref,omitempty"`
	ParameterName string `json:"parameterName,omitempty"`
}

SchemaRef represents a reference to a schema

type ScopeInfo

type ScopeInfo struct {
	Description string `json:"description"`
}

ScopeInfo represents information about an OAuth2 scope

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL