MCPcopy Index your code
hub / github.com/googleapis/google-api-python-client / build

Function build

googleapiclient/discovery.py:193–343  ·  view source on GitHub ↗

Construct a Resource for interacting with an API. Construct a Resource object for interacting with an API. The serviceName and version are the names from the Discovery service. Args: serviceName: string, name of the service. version: string, the version of the service.

(
    serviceName,
    version,
    http=None,
    discoveryServiceUrl=None,
    developerKey=None,
    model=None,
    requestBuilder=HttpRequest,
    credentials=None,
    cache_discovery=True,
    cache=None,
    client_options=None,
    adc_cert_path=None,
    adc_key_path=None,
    num_retries=1,
    static_discovery=None,
    always_use_jwt_access=False,
)

Source from the content-addressed store, hash-verified

191
192@positional(2)
193def build(
194 serviceName,
195 version,
196 http=None,
197 discoveryServiceUrl=None,
198 developerKey=None,
199 model=None,
200 requestBuilder=HttpRequest,
201 credentials=None,
202 cache_discovery=True,
203 cache=None,
204 client_options=None,
205 adc_cert_path=None,
206 adc_key_path=None,
207 num_retries=1,
208 static_discovery=None,
209 always_use_jwt_access=False,
210):
211 """Construct a Resource for interacting with an API.
212
213 Construct a Resource object for interacting with an API. The serviceName and
214 version are the names from the Discovery service.
215
216 Args:
217 serviceName: string, name of the service.
218 version: string, the version of the service.
219 http: httplib2.Http, An instance of httplib2.Http or something that acts
220 like it that HTTP requests will be made through.
221 discoveryServiceUrl: string, a URI Template that points to the location of
222 the discovery service. It should have two parameters {api} and
223 {apiVersion} that when filled in produce an absolute URI to the discovery
224 document for that service.
225 developerKey: string, key obtained from
226 https://code.google.com/apis/console.
227 model: googleapiclient.Model, converts to and from the wire format.
228 requestBuilder: googleapiclient.http.HttpRequest, encapsulator for an HTTP
229 request.
230 credentials: oauth2client.Credentials or
231 google.auth.credentials.Credentials, credentials to be used for
232 authentication.
233 cache_discovery: Boolean, whether or not to cache the discovery doc.
234 cache: googleapiclient.discovery_cache.base.CacheBase, an optional
235 cache object for the discovery documents.
236 client_options: Mapping object or google.api_core.client_options, client
237 options to set user options on the client.
238 (1) The API endpoint should be set through client_options. If API endpoint
239 is not set, `GOOGLE_API_USE_MTLS_ENDPOINT` environment variable can be used
240 to control which endpoint to use.
241 (2) client_cert_source is not supported, client cert should be provided using
242 client_encrypted_cert_source instead. In order to use the provided client
243 cert, `GOOGLE_API_USE_CLIENT_CERTIFICATE` environment variable must be
244 set to `true`.
245 More details on the environment variables are here:
246 https://google.aip.dev/auth/4114
247 adc_cert_path: str, client certificate file path to save the application
248 default client certificate for mTLS. This field is required if you want to
249 use the default client certificate. `GOOGLE_API_USE_CLIENT_CERTIFICATE`
250 environment variable must be set to `true` in order to use this field,

Callers 15

mainFunction · 0.90
mainFunction · 0.90
mainFunction · 0.90
main.pyFile · 0.90
mainFunction · 0.90
mainFunction · 0.90
mainFunction · 0.90
mainFunction · 0.90
mainFunction · 0.90
mainFunction · 0.90
mainFunction · 0.90
mainFunction · 0.90

Calls 6

build_httpFunction · 0.90
_retrieve_discovery_docFunction · 0.85
build_from_documentFunction · 0.85
closeMethod · 0.45

Used in the wild real call sites across dependent graphs

searching dependent graphs…