airflow.providers.microsoft.azure.hooks.msgraph

Module Contents

Classes

DefaultResponseHandler

DefaultResponseHandler returns JSON payload or content in bytes or response headers.

KiotaRequestAdapterHook

A Microsoft Graph API interaction hook, a Wrapper around KiotaRequestAdapter.

class airflow.providers.microsoft.azure.hooks.msgraph.DefaultResponseHandler[source]

Bases: kiota_abstractions.response_handler.ResponseHandler

DefaultResponseHandler returns JSON payload or content in bytes or response headers.

static get_value(response)[source]
async handle_response_async(response, error_map=None)[source]

Invoke this callback method when a response is received.

param response: The type of the native response object. param error_map: The error dict to use in case of a failed request.

class airflow.providers.microsoft.azure.hooks.msgraph.KiotaRequestAdapterHook(conn_id=default_conn_name, timeout=None, proxies=None, api_version=None)[source]

Bases: airflow.hooks.base.BaseHook

A Microsoft Graph API interaction hook, a Wrapper around KiotaRequestAdapter.

https://github.com/microsoftgraph/msgraph-sdk-python-core

Parameters
  • conn_id (str) – The HTTP Connection ID to run the trigger against.

  • timeout (float | None) – The HTTP timeout being used by the KiotaRequestAdapter (default is None). When no timeout is specified or set to None then no HTTP timeout is applied on each request.

  • proxies (dict | None) – A Dict defining the HTTP proxies to be used (default is None).

  • api_version (msgraph_core.APIVersion | str | None) – The API version of the Microsoft Graph API to be used (default is v1). You can pass an enum named APIVersion which has 2 possible members v1 and beta, or you can pass a string as “v1.0” or “beta”.

property api_version: msgraph_core.APIVersion[source]
DEFAULT_HEADERS[source]
cached_request_adapters: dict[str, tuple[msgraph_core.APIVersion, kiota_abstractions.request_adapter.RequestAdapter]][source]
default_conn_name: str = 'msgraph_default'[source]
static resolve_api_version_from_value(api_version, default=None)[source]
get_api_version(config)[source]
static get_host(connection)[source]
static format_no_proxy_url(url)[source]
classmethod to_httpx_proxies(proxies)[source]
to_msal_proxies(authority, proxies)[source]
get_conn()[source]

Return connection for the hook.

test_connection()[source]

Test HTTP Connection.

async run(url='', response_type=None, path_parameters=None, method='GET', query_parameters=None, headers=None, data=None)[source]
request_information(url, response_type=None, path_parameters=None, method='GET', query_parameters=None, headers=None, data=None)[source]
static normalize_url(url)[source]
static encoded_query_parameters(query_parameters)[source]
static error_mapping()[source]

Was this entry helpful?