Giter VIP home page Giter VIP logo

google-api-php-client-services's Introduction

Google PHP API Client Services

NOTE: please check to see if the package you'd like to install is available in our list of Google cloud packages first, as these are the recommended libraries.

Requirements

Google API PHP Client

Usage

This library is automatically updated daily with new API changes, and tagged weekly. It is installed as part of the Google API PHP Client library via Composer, which will pull down the most recent tag.

google-api-php-client-services's People

Contributors

ajupazhamayil avatar bshaffer avatar carusogabriel avatar chingor13 avatar chrisguitarguy avatar demotascha avatar dwsupplee avatar google-cloud-policy-bot[bot] avatar googleapis-publisher avatar jacekkarczmarczyk avatar justinbeckwith avatar renovate-bot avatar saicheems avatar simonschaufi avatar slaffik avatar theacodes avatar touhonoob avatar valbeat avatar vchudnov-g avatar yash30201 avatar yoshi-automation avatar yoshi-code-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

google-api-php-client-services's Issues

get all items / id from the warning list

Hi,

I've read through the code especially the part for datafeeds. I'm just wondering if if is possible to get the items in the warning list? Perhaps like the code, the message and id of the product?

Google Speech API Key

Hi

I want know where I must put the API key?

I have this error:
Could not load the default credentials. Browse to https://developers.google.com/accounts/docs/application-default-credentials for more information

I share my code. Thanks

        $speech = new SpeechClient([
            'projectId' => 'PROJECT_ID'
        ]);

        $recognizeOptions = [
            'encoding' => 'LINEAR16',
            'languageCode' => 'fr-FR',
            'sampleRate' => 16000,
        ];

       // Recognize the speech in an audio file.
        $results = $speech->recognize(
            fopen(__DIR__ . $pathUploads.'/'.$fileAudio, 'r'),
            $recognizeOptions
        );

Override the rootUrl when constructing a Google_Service_Pubsub for Pubsub Emulator

Our team has hit a roadblock with using the pubsub emulator project alongside this API. It looks like we're unable to override the rootUrl and, as a result, we can't really use them together in our development environment.

I'd be open to submitting code to correct this issue but I'd like some advice on the best approach. Our team thinks that being able to provide it to the Google_Client constructor would let each Service to inherit the rootUrl, if defined, and not wind up being a ton of changes.

Is there any path forward for fixing this?

Not Found Google_Service_BatchAnnotateImagesResponse classes

Please excuse my poor English.

I use Vision API.
But my IDE have some warning.

$service = new \Google_Service_Vision($client);
$result = $service->images->annotate($body);
// Method 'getResponses' not found in \Google_Service_BatchAnnotateImagesResponse
$response = $result->getResponses();

ImageResource.php
annotete function

  /**
   * Run image detection and annotation for a batch of images. (images.annotate)
   *
   * @param Google_BatchAnnotateImagesRequest $postBody
   * @param array $optParams Optional parameters.
   * @return Google_Service_BatchAnnotateImagesResponse
   */
  public function annotate(Google_Service_Vision_BatchAnnotateImagesRequest $postBody, $optParams = array())
  {
    $params = array('postBody' => $postBody);
    $params = array_merge($params, $optParams);
    return $this->call('annotate', array($params), "Google_Service_Vision_BatchAnnotateImagesResponse");
  }

param and return use Google_BatchAnnotateImagesRequest.
But Google_BatchAnnotateImagesRequest can not be found anywhere.
I think, this comment is Google_Service_Vision_BatchAnnotateImagesRequest and Google_Service_Vision_BatchAnnotateImagesResponse.
Or do i mistake how to use the api?

Google_Service_Gmail - Updates

Guys.

Google documentation has been updated and added new classes, one of them is UserSettings.sendas, using the php this service'm having the following result:

Message: Undefined property: Google_Service_Gmail :: $ users_settings_sendAs
Message: Undefined property: Google_Service_Gmail :: $ users_settings_forwardingAddresses

Can anyone help me?Thanks..
Gmail API

Google_Model::mapTypes fails in Google_Service_Safebrowsing_ThreatMatch

When a threat is found in Google_Service_Safebrowsing_ThreatMatch, an exception is thrown when it tries to process "threat" because the API also returns a property named "threatType".

If the API responds with:

{
    "threatType": "SOCIAL_ENGINEERING",                                                                                                                                                                                                                          
     "platformType": "WINDOWS",
     "threat": [
         "url": "http://example.com/index.html"
     ],
     "cacheDuration": "300s",
     "threatEntryType": "URL"                                                                                                                                                                                                                                      
};

then I get an error like:

Fatal error: Class 'SOCIAL_ENGINEERING' not found in /path/to/lib/vendor/google/apiclient/src/Google/Model.php on line 116

Missing Resumable Upload

Currently the Gmail client uses multipart upload, which is capped at 5MB.
Is there a way to use it to do resumable uploads for larger files?

PHP Notice iterating over Google_Service_Webmasters_SitesListResponse::$siteEntry

Since the last vendor update I now see this error/notice running some of my tests:

Symfony\Component\Debug\Exception\ContextErrorException: Notice: Indirect modification of overloaded property Google_Service_Webmasters_SitesListResponse::$siteEntry has no effect
.../vendor/google/apiclient/src/Google/Collection.php:20

The code looks something like this (notice thrown on the foreach):

        $siteListResponse = $googleWebmasterService->sites->listSites();

        $count = 0;
        foreach ($siteListResponse as $item) {
            ++$count;
        }

Environment:

$ php -v
PHP 7.1.7 (cli) (built: Jul  6 2017 13:31:15) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
    with Zend OPcache v7.1.7, Copyright (c) 1999-2017, by Zend Technologies
    with Xdebug v2.5.5, Copyright (c) 2002-2017, by Derick Rethans
$ composer show |grep google
google/apiclient                         v2.2.0             Client library for Google APIs
google/apiclient-services                v0.15              Client library for Google APIs
google/auth                              v1.0               Google Auth Library for PHP

Finer control over dependencies

As long as I use composer, I have to include ALL services if I only want to access a single service.
This is a MASSIVE overkill.
Why don't you create composer deps/packages for each service and maybe a target to include all services for backward compat?

It really sucks to add thousands (5097 !!) of files for a super simple API query.

Support versioned APIs

It would be good to support multiple versions of APIs. For this, we need the client libraries to include the API versions.

Incorrect/missing Type hinting for Drive API

I experience some issues for type hinting in Drive API service.
For example:

  • PermissionList.php, methods setPermissions and getPermissions should have Google_Service_Drive_Permission[] as type.
  • The same is the case for FileList and setFiles, getFiles methods

Also lots of public methods in Files.php do not have a @return statement which makes it unconvenient to use with linting tools.

I see that the sdk is autogenerated. Is there a way how we could fix this problem?

Adsense batch requests not working if use multiple metrics

The batch works great if I insert only one metric, but adding more than one, I always get no rows from the api.

    $this->client->setUseBatch(true);

    $service = new Google_Service_AdSense($this->client);
    $batch = $service->createBatch();

    $metrics= ['EARNINGS','CLICKS'];
    $dimensions = ['DATE'];
    $accountId = 'myaccount';

    $optParams = array(
      'metric' => $metrics,
      'dimension' => $dimensions
    );

    $req1 = $service->accounts_reports->generate( $accountId, 
                                                  '2017-04-01',
                                                  '2017-04-20',
                                                  $optParams);

    $req2 = $service->accounts_reports->generate( $accountId, 
                                                  '2017-03-01',
                                                  '2017-03-20',
                                                  $optParams);

    $batch->add($req1, "thoreau");
    $batch->add($req2, "shaw");

    $results = $batch->execute();

parameter 'include-historical-channel-data' missing in reports methods defintion

The new parameter 'include-historical-channel-data' (added Feb 8, '17) in the YT Analytics API is not yet defined in the YouTubeAnalytics.php
Adding

'include-historical-channel-data' => array(
                  'location' => 'query',
                  'type' => 'boolean',
                ),

to the reports methods array fixed the problem (https://github.com/google/google-api-php-client-services/blob/master/src/Google/Service/YouTubeAnalytics.php#L214). Else, the client returns no data when using the new parameter.

Duplicate file from autogeneration - with different cases

google-api-php-client-services/src/Google/Service/Compute/HTTPSHealthCheck.php should be deleted

as google-api-php-client-services/src/Google/Service/Compute/HttpsHealthCheck.php this what we need

Note the "case" of file names, especially in windows based system this will lead to issue where the one with CAPS will most likely overwrite the other !

Is there a way to get Android APKs testing mode?

I am currently getting the list of published Android APK versions through the Google_Service_AndroidPublisher service but there's no way, at least I haven't found it, to know if each of those APKs in the list is in alpha or beta testing mode or filter only production APKs.

Is it possible somehow? If not, can be added somehow? I've seen there is an optional params argument in the method but there's no documentation at all about them :)

GTM API v2

Hello,

How can I use the GTM API v2?

I have a module using the v1 and is working well, but I wanted to use the workspace, and this functionality is available in the v2 only.

Thank you,
Alcindo

Duplicate files for service BigQueryDataTransfer

/src/Google/Service/BIGQUERYDATATRANSFER.php
/src/Google/Service/BigQueryDataTransfer.php

One of them (possibly the second one) must be more up-to-date.
If we use the first one, PSR-0 autoloader would fail
(in an OS with case-sensitive file system)
to load some classes (e.g. class Google_Service_BIGQUERYDATATRANSFER_Resource_Projects)
as there is no folder called:

/src/Google/Service/BIGQUERYDATATRANSFER/

Two identical files BigQueryDataTransfer.php / BIGQUERYDATATRANSFER.php

My composer complains about two identical files it can't create - composer 1.4.2 / HPFS+ / macOS sierra / case insensitive :/

composer require google/apiclient-services v0.14
  - Installing google/apiclient-services (v0.14): Loading from cache
    Failed to execute unzip -qq  '/Users/x/dev/playground/google-apiclient/vendor/google/apiclient-services/031c183dc14ccce7d7407e0e574c41a0' -d '/Users/x/dev/playground/google-apiclient/vendor/composer/340ef576'

replace /Users/x/dev/playground/google-apiclient/vendor/composer/340ef576/google-google-api-php-client-services-b8c3ee8/src/Google/Service/BigQueryDataTransfer.php? [y]es, [n]o, [A]ll, [N]one, [r]ename:  NULL
(EOF or read error, treating as "[N]one" ...)

    The archive may contain identical file names with different capitalization (which fails on case insensitive filesystems)
    Unzip with unzip command failed, falling back to ZipArchive class

In particular, these:

src/Google/Service
src/Google/Service/BIGQUERYDATATRANSFER.php 10.1 kb
src/Google/Service/BigQueryDataTransfer.php 19.1 kb

image

Add PHPDoc to (generated?) models to increase usability

Currently the PHP Documentation of the model classes is lacking, which makes it harder to use them / understand them. Since the model classes are probably generated, a change to the generator should be able to facilitate this. Not sure where to post this issue though, is the generator also on GitHub?

For example Google_Service_Calendar_Event::setStart() has a type-hint that a Google_Service_Calendar_EventDateTime object should be used, but getStart() does not have a PHPDoc @return hint:

class Google_Service_Calendar_Event
{
  public function setStart(Google_Service_Calendar_EventDateTime $start)
  {
    $this->start = $start;
  }

  //Current approach, no PHPDoc
  public function getStart()
  {
    return $this->start;
  }

  /**
   * Preferred approach
   * @return Google_Service_Calendar_EventDateTime
   */
  public function getStart()
  {
    return $this->start;
  }

  /**
   * as of PHP7
   * @return Google_Service_Calendar_EventDateTime
   */
  public function getStart() : Google_Service_Calendar_EventDateTime
  {
    return $this->start;
  }
}

Currently using the API Client and specific services is quite an 'adventure' / puzzle of finding out how everything works and by trial and error find out the proper way. Does Google use the PHP API Services themselves as well? I would say out of frustration one would add such type hints quite quickly ;)

Google Custom Search: Google_Service_Customsearch_Context->getFacets() returns Null

We are implementing the "Google Customsearch API" in TYPO3 at the moment and had some problems with the getFacets methode of the Google_Service_Customsearch_Context Class.

We get back a Object, but all Fields have the Value Null. With a print_r of the Object I can see the correct values, but they are stored in modelData. (See print_r and code below).

We have the same problem with:
getQueries and
getPromotions and
getSearchInformation

Print_R:

Array
(
    [0] => Google_Service_Customsearch_ContextFacets Object
        (
            [internal_gapi_mappings:protected] => Array
                (
                    [labelWithOp] => label_with_op
                )

            [anchor] => 
            [label] => 
            [labelWithOp] => 
            [modelData:protected] => Array
                (
                    [0] => Array
                        (
                            [label] => kompetenzen
                            [anchor] => Kompetenzen
                            [label_with_op] => more:kompetenzen
                        )

                )

            [processed:protected] => Array
                (
                )

        )

    [1] => Google_Service_Customsearch_ContextFacets Object
        (
            [internal_gapi_mappings:protected] => Array
                (
                    [labelWithOp] => label_with_op
                )

            [anchor] => 
            [label] => 
            [labelWithOp] => 
            [modelData:protected] => Array
                (
                    [0] => Array
                        (
                            [label] => projekte
                            [anchor] => Projekte
                            [label_with_op] => more:projekte
                        )

                )

            [processed:protected] => Array
                (
                )

        )

    [2] => Google_Service_Customsearch_ContextFacets Object
        (
            [internal_gapi_mappings:protected] => Array
                (
                    [labelWithOp] => label_with_op
                )

            [anchor] => 
            [label] => 
            [labelWithOp] => 
            [modelData:protected] => Array
                (
                    [0] => Array
                        (
                            [label] => arbeiten_bei_uns
                            [anchor] => Arbeiten bei uns
                            [label_with_op] => more:arbeiten_bei_uns
                        )

                )

            [processed:protected] => Array
                (
                )

        )

    [3] => Google_Service_Customsearch_ContextFacets Object
        (
            [internal_gapi_mappings:protected] => Array
                (
                    [labelWithOp] => label_with_op
                )

            [anchor] => 
            [label] => 
            [labelWithOp] => 
            [modelData:protected] => Array
                (
                    [0] => Array
                        (
                            [label] => über_uns
                            [anchor] => Über uns
                            [label_with_op] => more:über_uns
                        )

                )

            [processed:protected] => Array
                (
                )

        )

    [4] => Google_Service_Customsearch_ContextFacets Object
        (
            [internal_gapi_mappings:protected] => Array
                (
                    [labelWithOp] => label_with_op
                )

            [anchor] => 
            [label] => 
            [labelWithOp] => 
            [modelData:protected] => Array
                (
                    [0] => Array
                        (
                            [label] => aktuelles
                            [anchor] => Aktuelles
                            [label_with_op] => more:aktuelles
                        )

                )

            [processed:protected] => Array
                (
                )

        )

    [5] => Google_Service_Customsearch_ContextFacets Object
        (
            [internal_gapi_mappings:protected] => Array
                (
                    [labelWithOp] => label_with_op
                )

            [anchor] => 
            [label] => 
            [labelWithOp] => 
            [modelData:protected] => Array
                (
                    [0] => Array
                        (
                            [label] => offene_stellen
                            [anchor] => Offene Stellen
                            [label_with_op] => more:offene_stellen
                        )

                )

            [processed:protected] => Array
                (
                )

        )

    [6] => Google_Service_Customsearch_ContextFacets Object
        (
            [internal_gapi_mappings:protected] => Array
                (
                    [labelWithOp] => label_with_op
                )

            [anchor] => 
            [label] => 
            [labelWithOp] => 
            [modelData:protected] => Array
                (
                    [0] => Array
                        (
                            [label] => ansprechpartner
                            [anchor] => Ansprechpartner
                            [label_with_op] => more:ansprechpartner
                        )

                )

            [processed:protected] => Array
                (
                )

        )

)

Code:

$client = new \Google_Client;

// set the application name
$client->setApplicationName('cabag_googlesearch');

// get developer key
$apiKey = $this->apiKeyRepository->findBestMatchingApiKey();
    
$client->setDeveloperKey($apiKey['googleapikey']);

$this->service = new \Google_Service_Customsearch($client);

optParams = array_merge(['cx' => $apiKey['googlesearchengineid']], $optParams);
optParams = array_merge(['lr' => 'de'], $optParams);
optParams = array_merge(['hl' => 'de'], $optParams);

$resultRequest = $this->service->cse->listCse($searchTerm, optParams);

$result = $resultRequest->getItems();
$context = $resultRequest->getContext();
$facets = $context->getFacets();

print_r($facets);

Fatal error: Cannot redeclare Google_Service_Safebrowsing_ThreatMatch::$threatType

Looks like the $threatType property has been declared 2 times.

# vendor/google/apiclient-services/Google/Service/Safebrowsing/ThreatMatch.php

class Google_Service_Safebrowsing_ThreatMatch extends Google_Model
{
  public $cacheDuration;
  public $platformType;
  protected $threatType = 'Google_Service_Safebrowsing_ThreatEntry'; //here
  protected $threatDataType = '';
  protected $threatEntryMetadataType = 'Google_Service_Safebrowsing_ThreatEntryMetadata';
  protected $threatEntryMetadataDataType = '';
  public $threatEntryType;
  public $threatType; // and there
}

Thanks,
Ben

Support for sites

I can't find any services about Google Sites support.
May I forgot something ?

Customsearch needs an update to v2

Customsearch needs an update to API v2.

I just got the following email from Google as a warning:
"The Custom Search Element API 1.0, which was deprecated in 2012 in favor of API 2.0, is now no longer maintained. API 1.0 may experience outages and failures, and possibly stop working entirely."

Google Drive API V3 - Getting id impossible during the creation

Hi !
Thanks a lot for your work !

Due to migration to API v3, i am not able to get the id of a file to set permission.
On API v2 i used $createdFile->getId() and it worked great
Now if try it

[..]
$request = $service->files->create($file,array('fields' => 'id'));
$permission = new Google_Service_Drive_Permission();
$permission->setRole( 'writer' );
$permission->setType( 'anyone' );
$service->permissions->create( $request->getId(), $permission );
[..]

I have got an error : Uncaught Error: Call to undefined method GuzzleHttp\Psr7\Request::getId()
Have you got any ideas for this type of issue ?

Cheers

Laurent

new firebasedynamiclinks-ipv6 endpoint causing `cURL error 7` from official php Docker

After an upgrade from v0.18 to >=v0.19 I'm unable to make API calls.
The underlying cURL obvs. doesn't like something.

[2017-09-14 09:12:46] local.ERROR: GuzzleHttp\Exception\ConnectException: cURL error 7:  (see http://curl.haxx.se/libcurl/c/libcurl-errors.html) in /var/www/html/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:186
Stack trace:
#0 /var/www/html/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php(150): GuzzleHttp\Handler\CurlFactory::createRejection(Object(GuzzleHttp\Handler\EasyHandle), Array)
#1 /var/www/html/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php(103): GuzzleHttp\Handler\CurlFactory::finishError(Object(GuzzleHttp\Handler\CurlHandler), Object(GuzzleHttp\Handler\EasyHandle), Object(GuzzleHttp\Handler\CurlFactory))
#2 ...

Curl Error 7 means Failed to connect() to host or proxy.
I figured that the cause of the problem is the new endpoint: 'url' => 'https://firebasedynamiclinks-ipv6.googleapis.com/v1/shortLinks?key=xxx

The endpoints have been updated here from https://firebasedynamiclinks.googleapis.com/ => https://firebasedynamiclinks-ipv6.googleapis.com/

I'm using the official php docker image 7.1.9-fpm without any modifications to curl or curl libs

I know this is not an actual issue of google-api-php-client-services, but maybe we can find a solution here.

Cheers

New endpoint for BATCH requests (translation api)

Need to fix endpoint for translation API. I have received this message to my email:

Our records indicate that your team haas occasionally used the the HTTP batch mode to request Translation API service by making a POST request to https://www.googleapis.com/batch (details here). We have a pending change in February that will discard batch requests to translation service using the above method. We have an alternative way for you to continue to use the batch functionality: instead of using the https://www.googleapis.com/batch endpoint to make batch requests, please use the endpoint https://translation.googleapis.com/batch/translate to get the same functionality. We request you to make this change as soon as you can. Please reach out to use in case you have any questions.

Google Cloud Support

'return' is used as a function name and cannot pass syntax check in php 5.5.30.

I'm using google-api-php-client on my project, and composer installs dev-master of this repository.

I check all codes from composer to assert everything works by using php -l, however it raised a sytnax error which indicates return is used as a funciton name:
PHP Parse error: syntax error, unexpected 'return' (T_RETURN), expecting identifier (T_STRING) in ./vendor/google/apiclient-services/Google/Service/Classroom/Resource/CoursesCourseWorkStudentSubmissions.php on line 205

public function return($courseId, $courseWorkId, $id, Google_Service_Classroom_ReturnStudentSubmissionRequest $postBody, $optParams = array())

I'm using php 5.5.30 and it satisfies the minimum-required php version of google-api-php-client.

Calling get() on null in PurchasesProduct

Hi, I'm trying to make a product purchase validation using a service account, here's my PHP code:

    require_once "../path/to/vendor/autoload.php";
putenv('GOOGLE_APPLICATION_CREDENTIALS=../path/to/ServiceAccountJSONkey');

$packageName = ""; //PackageName
$productId= "";  //ProductID
$token = ""; // purchase token

$client = new Google_Client();
$client->setScopes(['https://www.googleapis.com/auth/androidpublisher']);
$client->useApplicationDefaultCredentials();

if($client->isAccessTokenExpired()) {
	$client->refreshTokenWithAssertion();
}

$service = new Google_Service_AndroidPublisher($client);
$results = $service->products->get($packageName, $productId, $token, array());

exit; 

But I'm getting this error:

Fatal error: Call to a member function get() on null in ../purchaseValidation.php on line X

Where X is this line: $results = $service->products->get($packageName, $productId, $token, array());

I don't know what I'm doing wrong, I tried to look for examples on the net but no luck.
Any help would be appreciated, thank you!

Storage: Add ability to generate signed URLs for download and resumable uploads

Currently I don't see any way to easily use the API to generate a signed URL for a given object in a bucket, and have to write my own code to do so. This wasn't a problem and I have a working solution now.

It would be preferable to have a simple method to supply the bucket and file name, along with the expiry time and other signature info and receive a signed URL using the json cert.

A bigger roadblock now is being able to generate a resumable upload signed URL using the library. Because the prefix for the initial POST request is /upload/storage/... there's no support that I've been able to see in the current PHP sdk.

I apologize in advance if I've just missed something but I've searched the documentation and repo for the last couple of days trying to find a solution without any luck. Thanks in advance!

how to paginate product or product statuses result?

What I want is to get the product statuses. My problem now is how to paginate the results. Basically, I want create pagination of the results. For now, I can get a 25-result page that comes with a token for a next page. Is it possible to create pagination on this? Or do I have to get all product statuses first before working on pagination?

$statuses = $service->productstatuses->listProductstatuses('id', $parameters);

enforce coding standards

According to the contributor's guide:

  1. Ensure that your code adheres to standard PHP conventions, as used in the rest of the library.

We should use phpcs to enforce the coding standards that are used throughout the library.

Google_Service_Translate_TranslationsListResponse->getTranslations() returns empty

$client = new \Google_Client();
$client->setApplicationName(APP_NAME);
$client->setDeveloperKey(API_KEY);

$service = new \Google_Service_Translate($client);
$translations = $service->translations->listTranslations("hello", "it", ["source" => "en", "format" => "html"])->getTranslations();
var_dump($translations);

This code returns empty, instead of the translations.
I edited my own code (see #37) and it works correctly. If this is not a bug but a desired behaviour, I may suggest considering a better way to document this API.

generator: Support a resources protocols parameter

The Google Fusion Tables API describes the methods importTable, importRows and replaceRows with two different endpoints. One endpoint is to change metadata only, the other can be used to upload a file (e.g. a CSV) to import a table or update data in a table.

E.g. for importTable:

  • Upload URI, for media upload requests:
    POST https://www.googleapis.com/upload/fusiontables/v2/tables/import
  • Metadata URI, for metadata-only requests:
    POST https://www.googleapis.com/fusiontables/v2/tables/import

Currently this library only supports the "Metadata URI" and can therefore not be used to upload a CSV to Google Fusion Tables.

Please consider to add support for uploads for these methods, as this is their intended use. Without this, you force users to change data using SQL statements, which are bound to rate limits or write HTTP calls to the Fusion Tables API directly without using this library.

Non-conformant response from Google CSE API

Hi guys,

I've been trying to make use of the Google CSE resources and I think I've encountered I bug related with one of your server responses.
The JSON response being returned from a call to the resource Google_Service_Customsearch_Resource_Cse::listCse does not comply with the specification mentioned in the documentation.
Each named key per query is supposedly meant to hold an array and not an array with a single element (see index 0 below). This breaks your decoding approach for the JSON data that should get mapped to the Google_Service_Customsearch_Query class.

The easiest way I found to reproduce this response was to remove the final modifier from Google_Model::__construct followed by the creation of a Google_Service_Customsearch_Search::__construct in which I dump the contents of the value that is passed to this constructor.

Without access to these instances of Google_Service_Customsearch_Query I would have to keep track of the last query parameters/results and also run my own math to proceed with next page requests.

Below is a partial output of the received JSON response:

Array
(
    [kind] => customsearch#search
    [url] => Array
        (
            [type] => application/json
            [template] => '...'
        )
    [queries] => Array (
            [request] => Array  (
                    [0] => Array  (
                            [title] => Google Custom Search -
                            [totalResults] => 2030000000
                            [searchTerms] => '...'
                            [count] => 10
                            [startIndex] => 1
                            [inputEncoding] => utf8
                            [outputEncoding] => utf8
                            [safe] => off
                            [cx] => '...'
                        )
                )
            [nextPage] => Array (
                    [0] => Array  (
                            [title] => Google Custom Search 
                            [totalResults] => 2030000000
                            [searchTerms] => '...'
                            [count] => 10
                            [startIndex] => 11
                            [inputEncoding] => utf8
                            [outputEncoding] => utf8
                            [safe] => off
                            [cx] => '...'
                        )
                )
        )
...
)

Keep up the good work.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.