class Google::Apis::Core::BaseService

Overview

Base class for all Google API services. Handles HTTP communication, authentication, retries, and file upload/download.

Direct Known Subclasses

Defined in:

google/apis/core/base_service.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(root_url : String, base_path : String) #

[View source]

Instance Method Detail

def access_token : String | Nil #

OAuth2 access token for authenticated requests.


[View source]
def access_token=(access_token : String | Nil) #

OAuth2 access token for authenticated requests.


[View source]
def base_path : String #

The API base path (e.g. "youtube/v3/")


[View source]
def base_path=(base_path : String) #

The API base path (e.g. "youtube/v3/")


[View source]
def execute(method : String, path : String, query : Hash(String, String | Nil) = {} of String => String | ::Nil, body : String | Nil = nil, headers : HTTP::Headers | Nil = nil) : HTTP::Client::Response #

Execute an HTTP request with automatic retry on transient errors.


[View source]
def key : String | Nil #

API key for unauthenticated requests. Read from ENV["API_KEY"] by default.


[View source]
def key=(key : String | Nil) #

API key for unauthenticated requests. Read from ENV["API_KEY"] by default.


[View source]
def max_retries : Int32 #

Maximum number of retries on 429/5xx errors (default: 3).


[View source]
def max_retries=(max_retries : Int32) #

Maximum number of retries on 429/5xx errors (default: 3).


[View source]
def root_url : String #

The API host (e.g. "www.googleapis.com")


[View source]
def root_url=(root_url : String) #

The API host (e.g. "www.googleapis.com")


[View source]