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

Function build_from_document

googleapiclient/discovery.py:464–739  ·  view source on GitHub ↗

Create a Resource for interacting with an API. Same as `build()`, but constructs the Resource object from a discovery document that is it given, as opposed to retrieving one over HTTP. Args: service: string or object, the JSON discovery document describing the API. The va

(
    service,
    base=None,
    future=None,
    http=None,
    developerKey=None,
    model=None,
    requestBuilder=HttpRequest,
    credentials=None,
    client_options=None,
    adc_cert_path=None,
    adc_key_path=None,
    always_use_jwt_access=False,
)

Source from the content-addressed store, hash-verified

462
463@positional(1)
464def build_from_document(
465 service,
466 base=None,
467 future=None,
468 http=None,
469 developerKey=None,
470 model=None,
471 requestBuilder=HttpRequest,
472 credentials=None,
473 client_options=None,
474 adc_cert_path=None,
475 adc_key_path=None,
476 always_use_jwt_access=False,
477):
478 """Create a Resource for interacting with an API.
479
480 Same as `build()`, but constructs the Resource object from a discovery
481 document that is it given, as opposed to retrieving one over HTTP.
482
483 Args:
484 service: string or object, the JSON discovery document describing the API.
485 The value passed in may either be the JSON string or the deserialized
486 JSON.
487 base: string, base URI for all HTTP requests, usually the discovery URI.
488 This parameter is no longer used as rootUrl and servicePath are included
489 within the discovery document. (deprecated)
490 future: string, discovery document with future capabilities (deprecated).
491 http: httplib2.Http, An instance of httplib2.Http or something that acts
492 like it that HTTP requests will be made through.
493 developerKey: string, Key for controlling API usage, generated
494 from the API Console.
495 model: Model class instance that serializes and de-serializes requests and
496 responses.
497 requestBuilder: Takes an http request and packages it up to be executed.
498 credentials: oauth2client.Credentials or
499 google.auth.credentials.Credentials, credentials to be used for
500 authentication.
501 client_options: Mapping object or google.api_core.client_options, client
502 options to set user options on the client.
503 (1) The API endpoint should be set through client_options. If API endpoint
504 is not set, `GOOGLE_API_USE_MTLS_ENDPOINT` environment variable can be used
505 to control which endpoint to use.
506 (2) client_cert_source is not supported, client cert should be provided using
507 client_encrypted_cert_source instead. In order to use the provided client
508 cert, `GOOGLE_API_USE_CLIENT_CERTIFICATE` environment variable must be
509 set to `true`.
510 More details on the environment variables are here:
511 https://google.aip.dev/auth/4114
512 adc_cert_path: str, client certificate file path to save the application
513 default client certificate for mTLS. This field is required if you want to
514 use the default client certificate. `GOOGLE_API_USE_CLIENT_CERTIFICATE`
515 environment variable must be set to `true` in order to use this field,
516 otherwise this field doesn't nothing.
517 More details on the environment variables are here:
518 https://google.aip.dev/auth/4114
519 adc_key_path: str, client encrypted private key file path to save the
520 application default client encrypted private key for mTLS. This field is
521 required if you want to use the default client certificate.

Calls 7

InvalidJsonErrorClass · 0.90
SchemasClass · 0.90
build_httpFunction · 0.90
JsonModelClass · 0.90
ResourceClass · 0.85
getMethod · 0.45

Used in the wild real call sites across dependent graphs

searching dependent graphs…