NAME

WebService::GoogleAPI::Client::UserAgent - User Agent wrapper for working with Google APIs

VERSION

version 0.27

header_with_bearer_auth_token

returns a hashref describing gzip encoding and auth bearer token

build_http_transaction

Example of usage:

    $gapi->build_http_transaction({
      method => 'post',  ## case insensitive [ GET|PATH|PUT|POST|PATCH|DELETE ] 
      path => 'https://www.googleapis.com/calendar/users/me/calendarList', ## NB - no interpolation
      options => { key => value } ## form variables for POST etc otherwise - GET params treated properly
    })

validated_api_query

Google API HTTP 'method' request to API End Point at 'path' with optional parameters described by 'options'

By 'validated' I mean that no checks are performed against discovery data structures and no interpolation is performed. The pre-processing functionality for the library is expected to be completed by the 'Client' class before passing the cleaner, sanitised and validated request to the agent here for submitting.

NB - handles auth headers injection and token refresh if required and possible

Required params: method, route

$self->get_access_token must return a valid token

Examples of usage:

$self->validated_api_query({
    method => 'get',
    path => 'https://www.googleapis.com/calendar/users/me/calendarList',
  });

$self->validated_api_query({
    method => 'post',
    path => 'https://www.googleapis.com/calendar/v3/calendars/'.$calendar_id.'/events',
    options => { key => value }
}

See Also: Client->api_query that augments the parameters with some Google API Specific fucntionality before calling here.

Returns Mojo::Message::Response object

AUTHOR

Veesh Goldman <veesh@cpan.org>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2017-2023 by Veesh Goldman and Others.

This is free software, licensed under:

The Apache License, Version 2.0, January 2004