google api client

 @return [Google::APIClient]
426946
def client
      @client ||= begin
        client = Google::APIClient.new
        client.authorization = Signet::OAuth2::Client.new(
          token_credential_uri: 'https://accounts.google.com/o/oauth2/token',
          audience: 'https://accounts.google.com/o/oauth2/token',
          scope: 'https://www.googleapis.com/auth/analytics.readonly',
          issuer: Gxapi.config.google.email,
          signing_key: self.get_key
        )
        client.authorization.fetch_access_token!
        client
      end
    end
256295
def connection
      if ::Fog::const_defined? @account[:service]
        service_mod = ::Fog::const_get @account[:service]
        provider_class = service_mod.send(:const_get, @account[:provider])
        @fog_service ||= provider_class.new(@account[:credentials])
      else
        provider_mod = ::Fog::const_get @account[:provider]
        service_class = provider_mod.send(:const_get, @account[:service])
        @fog_service ||= service_class.new(@account[:credentials])
      end
    end
132708
def request(http_method, path, body = '', headers = {})
      puts "#{http_method}: #{path} - [#{body}]" if @http_debug
      @request_client.request(http_method, path, body, headers)
    end
1295258
def header
      header = client.header
      param[:header].each do |h|
        k, v = h.split(": ")
        header[k] = v
      end
      header
    end
895440
def client
      @client ||= (client = Clients.with_name(client_name)
                    client = client.use(database_name) if database_name_option
                    client.with(client_options))
    end
100614
def client_call(method, *args)
      key = cache_key(method, args)
      cached = dalli.get(key)
      return cached if cached
      response = client.send(method, *args)
      dalli.set(key, response)
      response
    end
1194694
def services
      if @services.nil?
        @services = []
        info[:services].each do |uri|
          @services.push(client.services.get_from_uri(uri))
        end
      end
      @services
    end
560942
def client
      @client ||= TapClutch::Client.new(
        api_key: config['api_key'],
        api_secret: config['api_secret'],
        api_base: config['api_base'],
        brand: config['brand'],
        location: config['location'],
        terminal: config['terminal'],
        username: config['username'],
        password: config['password'],
        verbose: verbose,
        state: Concurrent::Hash.new.merge!(state),
        stream: stream
      )
    end
824480
function initClient() {

    var scope = "https://www.googleapis.com/auth/cloud-platform https://www.googleapis.com/auth/genomics https://www.googleapis.com/auth/devstorage.read_only https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/drive.readonly";

    let browser;

    igv.google.loadGoogleProperties("https://s3.amazonaws.com/igv.org.app/web_client_google")

        .then(function (properties) {

            return gapi.client.init({
                'clientId': properties["client_id"],
                'scope': scope
            });
        })
        
        .then(function (ignore) {
            gapi.auth2.getAuthInstance().isSignedIn.listen(updateSigninStatus);
        })

        .then(function () {

            var div, options;

            div = $("#myDiv")[0];
            options = {
                genome: "hg19",
                apiKey: igv.google.properties["api_key"],
                queryParametersSupported: true
            };

            igv.createBrowser(div, options)
                .then(function (b) {
                    igv.browser = b;
                })

            
        })

    //
    // function handleSignInClick(event) {
    //     // Nothing to do
    // }

    function updateSigninStatus(isSignedIn) {

        if (isSignedIn) {
            //$("#signInButton").hide();

            var user = gapi.auth2.getAuthInstance().currentUser.get();
            var profile = user.getBasicProfile();
            var username = profile.getName();
            $("#switchUserLink").html("Logged in as: " + username);

        }

    }

}
1351401
def api_client
      # => Configure a Chef API Client
      ChefAPI.endpoint = Config.chef_api_endpoint
      ChefAPI.client = Config.chef_api_client
      ChefAPI.key = Config.chef_api_client_key
    end
888137
static function getGoogleClient($logger_name = null) {
        if (is_null($logger_name)) {
            $logger_name = "Google_Client at " . Util::getModuleId();
        }
        $client = new \Google_Client();
        $client->useApplicationDefaultCredentials();
        $client->setApplicationName(Util::getModuleId() . "@" . Util::getApplicationId());
        $client->setLogger(Logger::create($logger_name));
        if (Util::isDevServer()) {
            $http = self::getWindowsCompliantHttpClient();
            $client->setHttpClient($http);
        }
        return $client;
    }
1073770
def login(code = nil)
      @client = Google::APIClient.new
      @client.authorization.client_id     = c('client_id')
      @client.authorization.client_secret = c('client_secret')
      @client.authorization.scope         = @scope
      @client.authorization.redirect_uri  = c('redirect_uri')

      @api = @client.discovered_api(@name_api, @version_api)

      unless code
        return @client.authorization.authorization_uri.to_s
      end

      begin
        @client.authorization.code = code
        @client.authorization.fetch_access_token!
      rescue
        return false
      end

      return true
    end
851379
protected function getClient()
	{
		if (!static::$client) {
			static::$client = new \AlgoliaSearch\Client(
				Config::get('search.connections.algolia.config.application_id'),
				Config::get('search.connections.algolia.config.admin_api_key')
			);
		}
		
		return static::$client;
	}
1128640
def get_client_data(self, client):
        
        data = self._request('GET', '/clients/{}'.format(client))
        return data.json()
287285
def get_new_client(self, public=True):
        
        return self._get_client(public=public, cached=False)
231827
def client
      return @client if @client

      @client = Chef::Client.new
      @client.ohai.data = Mash.from_hash(Fauxhai.mock(options).data)
      @client.load_node
      @client.build_node
      @client.save_updated_node
      @client
    end
174704
def connection
      @options[:path] =API_VERSION1+ @options[:path]
      @options[:headers] = HEADERS.merge(@options[:headers])

      Megam::Log.debug("HTTP Request Data:")
      Megam::Log.debug("> HTTP #{@options[:scheme]}://#{@options[:host]}")
      @options.each do |key, value|
        Megam::Log.debug("> #{key}: #{value}")
      end
      Megam::Log.debug("End HTTP Request Data.")
      @connection = Excon.new("#{@options[:scheme]}://#{@options[:host]}",@options)
    end