This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//// First, Implement an interface to intercept the HTTP Request before it goes out. | |
package com.google.java_scratch; | |
import com.google.api.client.auth.oauth2.Credential; | |
import com.google.api.client.http.HttpBackOffIOExceptionHandler; | |
import com.google.api.client.http.HttpBackOffUnsuccessfulResponseHandler; | |
import com.google.api.client.http.HttpBackOffUnsuccessfulResponseHandler.BackOffRequired; | |
import com.google.api.client.http.HttpRequest; | |
import com.google.api.client.http.HttpRequestInitializer; | |
import com.google.api.client.http.HttpResponse; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv | |
import httplib2 | |
from argparse import ArgumentParser | |
from oauth2client.client import SignedJwtAssertionCredentials | |
from apiclient.discovery import build | |
SCOPES = [ | |
'https://www.googleapis.com/auth/apps.order' | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>JS Client Test Bench</title> | |
</head> | |
<body> | |
<script type="text/javascript"> | |
var SETTINGS = { | |
CLIENT_ID: '801883730557-sm0htkeqruc79vm569f20gk8ponn62sv.apps.googleusercontent.com', | |
API_KEY: 'AIzaSyDobgkbnTo75Vb7XmgNBemxvbT_YKFTAPE', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import httplib2 | |
from apiclient.discovery import build | |
from oauth2client.client import SignedJwtAssertionCredentials | |
http = httplib2.Http() | |
SCOPES = [ | |
'https://www.googleapis.com/auth/calendar' | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* A spreadsheet reading library that assumes that the first row is headers | |
* and provides a simple way to access, modify and append rows. | |
*/ | |
var UberSheet = function(sheet) { | |
// Constants | |
this.HEADER_ROW_INDEX = 1; | |
this.HEADER_ROW_OFFSET = 1; | |
this.START_COLUMN = 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'google/api_client' | |
client = Google::APIClient.new( | |
:application_name => 'Reseller Example!', | |
:application_version => '1.0.0' | |
) | |
RESELLER_ADMIN = '...' | |
PRIVATE_KEY_FILE = 'privatekey.p12' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# | |
# Copyright 2013 Google Inc. All Rights Reserved. | |
""" | |
DISCLAIMER: | |
(i) GOOGLE INC. ("GOOGLE") PROVIDES YOU ALL CODE HEREIN "AS IS" WITHOUT ANY | |
WARRANTIES OF ANY KIND, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, | |
WITHOUT LIMITATION, ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$service = new Google_Service_Directory($googleClient); | |
// A tracing token can be utilizing with the PHP 1.0 library by passing an associative array to | |
// the '$optParams' value of the method call. The order of this parameter varies for each method call, | |
// but is typically immediately after the required arguments. | |
// | |
// The tracing token parameter will need to be added to EACH AND EVERY call where a tracing token is required. | |
$makeAdmin = new Google_Service_Directory_UserMakeAdmin(); | |
$makeAdmin->setStatus(true); | |
$service->users->makeAdmin('[email protected]', $makeAdmin, array( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
service = build(serviceName="admin", | |
version="directory_v1", | |
http=httplib2.Http()) | |
# A tracing token can be attached by utilizing the 'trace' kwarg on a method call. | |
# Switching the request to utilize all 'kwargs' is recommended. | |
# | |
# Importantly, when a request (such as the one below) includes a body parameter, | |
# the tracing token should NOT be included in the body. | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//// First, Implement an interface to intercept the HTTP Request before it goes out. | |
import java.io.IOException; | |
import com.google.api.client.googleapis.services.AbstractGoogleClientRequest; | |
import com.google.api.client.googleapis.services.GoogleClientRequestInitializer; | |
public class TracingTokenInitializer implements GoogleClientRequestInitializer { | |
@Override | |
public void initialize(AbstractGoogleClientRequest<?> req) throws IOException { | |
System.out.println("Attaching tracing token..."); | |
req.put("trace", "token:<<TOKEN GOES HERE>>"); |
NewerOlder