Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for universe domain #4675

Merged
merged 2 commits into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion generator/src/googleapis/codegen/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,8 +331,11 @@ def _NormalizeUrlComponents(self):
scheme = url_parts.scheme or 'https'
service_host = url_parts.netloc or _DEFAULT_SERVICE_HOST
base_path = url_parts.path
if not root_url:
if root_url:
self._api.SetTemplateValue('rootUrlTemplate', root_url.replace('googleapis.com', 'UNIVERSE_DOMAIN'))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might break though, if users have a rooturl like:
usergoogleapis.com, it would be changed to userUNIVERSE_DOMAIN.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure though how big of a usecase this is... a client using TPC and their domain name has googleapis.com

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could replace .googleapis.com with .UNIVERSE_DOMAIN if you think that would be safer.

else:
self._api.SetTemplateValue('rootUrl', '%s://%s/' % (scheme, service_host))
self._api.SetTemplateValue('rootUrlTemplate', '%s://%s/' % (scheme, service_host.replace('googleapis.com', 'UNIVERSE_DOMAIN')))
if service_path is None:
self._api.SetTemplateValue('servicePath', base_path[1:])

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const {{ authscope.name }} =
{% endfor %}{% endindent %}{% endfilter %}{% endif %}

{% call_template _resource_var resource=api %}
public $rootUrlTemplate;
{% if api.methods %} private $base_methods;{% endif %}
/**{% filter block_comment %}
* Constructs the internal representation of the {{ api.className }} service.
Expand All @@ -45,6 +46,7 @@ const {{ authscope.name }} =
{% indent 2 %}
parent::__construct($clientOrConfig);
$this->rootUrl = $rootUrl ?: {% literal api.rootUrl %};
$this->rootUrlTemplate = $rootUrl ?: {% literal api.rootUrlTemplate %};
$this->servicePath = {% literal api.servicePath %};
{% if api.batchPath %}$this->batchPath = {% literal api.batchPath %};{% endif %}
$this->version = {% literal api.version %};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class EccoDomaniIeri extends \Google\Service
"https://www.googleapis.com/auth/userinfo.email";

public $greetings;
public $rootUrlTemplate;

/**
* Constructs the internal representation of the EccoDomaniIeri service.
Expand All @@ -52,6 +53,7 @@ class EccoDomaniIeri extends \Google\Service
{
parent::__construct($clientOrConfig);
$this->rootUrl = $rootUrl ?: 'https://peer-pontus.appspot.com/_ah/api/';
vishwarajanand marked this conversation as resolved.
Show resolved Hide resolved
$this->rootUrlTemplate = $rootUrl ?: 'https://peer-pontus.appspot.com/_ah/api/';
$this->servicePath = 'helloworld/v1/';
$this->batchPath = 'batch';
$this->version = 'v1';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class EccoDomaniIeri extends \Google\Service
"https://www.googleapis.com/auth/userinfo.email";

public $greetings;
public $rootUrlTemplate;

/**
* Constructs the internal representation of the EccoDomaniIeri service.
Expand All @@ -52,6 +53,7 @@ class EccoDomaniIeri extends \Google\Service
{
parent::__construct($clientOrConfig);
$this->rootUrl = $rootUrl ?: 'https://peer-pontus.appspot.com/_ah/api/';
$this->rootUrlTemplate = $rootUrl ?: 'https://peer-pontus.appspot.com/_ah/api/';
$this->servicePath = 'helloworld/v1/';
$this->batchPath = 'batch';
$this->version = 'v1';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ class KitchSink extends \Google\Service
public $topics;
public $topics_submissions;
public $votes;
public $rootUrlTemplate;
private $base_methods;
/**
* Constructs the internal representation of the KitchSink service.
Expand All @@ -72,6 +73,7 @@ class KitchSink extends \Google\Service
{
parent::__construct($clientOrConfig);
$this->rootUrl = $rootUrl ?: 'https://www.googleapis.com/';
$this->rootUrlTemplate = $rootUrl ?: 'https://www.UNIVERSE_DOMAIN/';
$this->servicePath = 'sink/v1/';
$this->version = 'v1';
$this->serviceName = 'kitch_sink';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ class PhpArrayScalars extends \Google\Service
"https://www.googleapis.com/auth/userinfo.email";

public $getwitharrays;
public $rootUrlTemplate;

/**
* Constructs the internal representation of the PhpArrayScalars service.
Expand All @@ -58,6 +59,7 @@ class PhpArrayScalars extends \Google\Service
{
parent::__construct($clientOrConfig);
$this->rootUrl = $rootUrl ?: 'https://www.googleapis.com/';
$this->rootUrlTemplate = $rootUrl ?: 'https://www.UNIVERSE_DOMAIN/';
$this->servicePath = 'php_float_type/v1/';
$this->version = 'v1';
$this->serviceName = 'php_array_scalars';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ class PhpFloatType extends \Google\Service
"https://www.googleapis.com/auth/userinfo.email";

public $getwithfloat;
public $rootUrlTemplate;

/**
* Constructs the internal representation of the PhpFloatType service.
Expand All @@ -58,6 +59,7 @@ class PhpFloatType extends \Google\Service
{
parent::__construct($clientOrConfig);
$this->rootUrl = $rootUrl ?: 'https://www.googleapis.com/';
$this->rootUrlTemplate = $rootUrl ?: 'https://www.UNIVERSE_DOMAIN/';
$this->servicePath = 'php_float_type/v1/';
$this->version = 'v1';
$this->serviceName = 'php_float_type';
Expand Down
2 changes: 2 additions & 0 deletions src/AIPlatformNotebooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class AIPlatformNotebooks extends \Google\Service
public $projects_locations;
public $projects_locations_instances;
public $projects_locations_operations;
public $rootUrlTemplate;

/**
* Constructs the internal representation of the AIPlatformNotebooks service.
Expand All @@ -53,6 +54,7 @@ public function __construct($clientOrConfig = [], $rootUrl = null)
{
parent::__construct($clientOrConfig);
$this->rootUrl = $rootUrl ?: 'https://notebooks.googleapis.com/';
$this->rootUrlTemplate = $rootUrl ?: 'https://notebooks.UNIVERSE_DOMAIN/';
$this->servicePath = '';
$this->batchPath = 'batch';
$this->version = 'v2';
Expand Down
2 changes: 2 additions & 0 deletions src/AbusiveExperienceReport.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class AbusiveExperienceReport extends \Google\Service

public $sites;
public $violatingSites;
public $rootUrlTemplate;

/**
* Constructs the internal representation of the AbusiveExperienceReport
Expand All @@ -52,6 +53,7 @@ public function __construct($clientOrConfig = [], $rootUrl = null)
{
parent::__construct($clientOrConfig);
$this->rootUrl = $rootUrl ?: 'https://abusiveexperiencereport.googleapis.com/';
$this->rootUrlTemplate = $rootUrl ?: 'https://abusiveexperiencereport.UNIVERSE_DOMAIN/';
$this->servicePath = '';
$this->batchPath = 'batch';
$this->version = 'v1';
Expand Down
2 changes: 2 additions & 0 deletions src/Acceleratedmobilepageurl.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class Acceleratedmobilepageurl extends \Google\Service


public $ampUrls;
public $rootUrlTemplate;

/**
* Constructs the internal representation of the Acceleratedmobilepageurl
Expand All @@ -51,6 +52,7 @@ public function __construct($clientOrConfig = [], $rootUrl = null)
{
parent::__construct($clientOrConfig);
$this->rootUrl = $rootUrl ?: 'https://acceleratedmobilepageurl.googleapis.com/';
$this->rootUrlTemplate = $rootUrl ?: 'https://acceleratedmobilepageurl.UNIVERSE_DOMAIN/';
$this->servicePath = '';
$this->batchPath = 'batch';
$this->version = 'v1';
Expand Down
2 changes: 2 additions & 0 deletions src/AccessApproval.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class AccessApproval extends \Google\Service
public $organizations_approvalRequests;
public $projects;
public $projects_approvalRequests;
public $rootUrlTemplate;

/**
* Constructs the internal representation of the AccessApproval service.
Expand All @@ -56,6 +57,7 @@ public function __construct($clientOrConfig = [], $rootUrl = null)
{
parent::__construct($clientOrConfig);
$this->rootUrl = $rootUrl ?: 'https://accessapproval.googleapis.com/';
$this->rootUrlTemplate = $rootUrl ?: 'https://accessapproval.UNIVERSE_DOMAIN/';
$this->servicePath = '';
$this->batchPath = 'batch';
$this->version = 'v1';
Expand Down
2 changes: 2 additions & 0 deletions src/AccessContextManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ class AccessContextManager extends \Google\Service
public $operations;
public $organizations_gcpUserAccessBindings;
public $services;
public $rootUrlTemplate;

/**
* Constructs the internal representation of the AccessContextManager service.
Expand All @@ -66,6 +67,7 @@ public function __construct($clientOrConfig = [], $rootUrl = null)
{
parent::__construct($clientOrConfig);
$this->rootUrl = $rootUrl ?: 'https://accesscontextmanager.googleapis.com/';
$this->rootUrlTemplate = $rootUrl ?: 'https://accesscontextmanager.UNIVERSE_DOMAIN/';
$this->servicePath = '';
$this->batchPath = 'batch';
$this->version = 'v1';
Expand Down
2 changes: 2 additions & 0 deletions src/AdExchangeBuyerII.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ class AdExchangeBuyerII extends \Google\Service
public $buyers_filterSets_impressionMetrics;
public $buyers_filterSets_losingBids;
public $buyers_filterSets_nonBillableWinningBids;
public $rootUrlTemplate;

/**
* Constructs the internal representation of the AdExchangeBuyerII service.
Expand All @@ -94,6 +95,7 @@ public function __construct($clientOrConfig = [], $rootUrl = null)
{
parent::__construct($clientOrConfig);
$this->rootUrl = $rootUrl ?: 'https://adexchangebuyer.googleapis.com/';
$this->rootUrlTemplate = $rootUrl ?: 'https://adexchangebuyer.UNIVERSE_DOMAIN/';
$this->servicePath = '';
$this->batchPath = 'batch';
$this->version = 'v2beta1';
Expand Down
2 changes: 2 additions & 0 deletions src/AdExperienceReport.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class AdExperienceReport extends \Google\Service

public $sites;
public $violatingSites;
public $rootUrlTemplate;

/**
* Constructs the internal representation of the AdExperienceReport service.
Expand All @@ -51,6 +52,7 @@ public function __construct($clientOrConfig = [], $rootUrl = null)
{
parent::__construct($clientOrConfig);
$this->rootUrl = $rootUrl ?: 'https://adexperiencereport.googleapis.com/';
$this->rootUrlTemplate = $rootUrl ?: 'https://adexperiencereport.UNIVERSE_DOMAIN/';
$this->servicePath = '';
$this->batchPath = 'batch';
$this->version = 'v1';
Expand Down
2 changes: 2 additions & 0 deletions src/AdMob.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class AdMob extends \Google\Service
public $accounts_apps;
public $accounts_mediationReport;
public $accounts_networkReport;
public $rootUrlTemplate;

/**
* Constructs the internal representation of the AdMob service.
Expand All @@ -59,6 +60,7 @@ public function __construct($clientOrConfig = [], $rootUrl = null)
{
parent::__construct($clientOrConfig);
$this->rootUrl = $rootUrl ?: 'https://admob.googleapis.com/';
$this->rootUrlTemplate = $rootUrl ?: 'https://admob.UNIVERSE_DOMAIN/';
$this->servicePath = '';
$this->batchPath = 'batch';
$this->version = 'v1';
Expand Down
2 changes: 2 additions & 0 deletions src/AdSenseHost.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ class AdSenseHost extends \Google\Service
public $customchannels;
public $reports;
public $urlchannels;
public $rootUrlTemplate;

/**
* Constructs the internal representation of the AdSenseHost service.
Expand All @@ -60,6 +61,7 @@ public function __construct($clientOrConfig = [], $rootUrl = null)
{
parent::__construct($clientOrConfig);
$this->rootUrl = $rootUrl ?: 'https://www.googleapis.com/';
$this->rootUrlTemplate = $rootUrl ?: 'https://www.UNIVERSE_DOMAIN/';
$this->servicePath = 'adsensehost/v4.1/';
$this->batchPath = 'batch/adsensehost/v4.1';
$this->version = 'v4.1';
Expand Down
2 changes: 2 additions & 0 deletions src/Adsense.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ class Adsense extends \Google\Service
public $accounts_reports;
public $accounts_reports_saved;
public $accounts_sites;
public $rootUrlTemplate;

/**
* Constructs the internal representation of the Adsense service.
Expand All @@ -65,6 +66,7 @@ public function __construct($clientOrConfig = [], $rootUrl = null)
{
parent::__construct($clientOrConfig);
$this->rootUrl = $rootUrl ?: 'https://adsense.googleapis.com/';
$this->rootUrlTemplate = $rootUrl ?: 'https://adsense.UNIVERSE_DOMAIN/';
$this->servicePath = '';
$this->batchPath = 'batch';
$this->version = 'v2';
Expand Down
2 changes: 2 additions & 0 deletions src/AlertCenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class AlertCenter extends \Google\Service
public $alerts;
public $alerts_feedback;
public $v1beta1;
public $rootUrlTemplate;

/**
* Constructs the internal representation of the AlertCenter service.
Expand All @@ -54,6 +55,7 @@ public function __construct($clientOrConfig = [], $rootUrl = null)
{
parent::__construct($clientOrConfig);
$this->rootUrl = $rootUrl ?: 'https://alertcenter.googleapis.com/';
$this->rootUrlTemplate = $rootUrl ?: 'https://alertcenter.UNIVERSE_DOMAIN/';
$this->servicePath = '';
$this->batchPath = 'batch';
$this->version = 'v1beta1';
Expand Down
2 changes: 2 additions & 0 deletions src/Analytics.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ class Analytics extends \Google\Service
public $metadata_columns;
public $provisioning;
public $userDeletion_userDeletionRequest;
public $rootUrlTemplate;

/**
* Constructs the internal representation of the Analytics service.
Expand All @@ -94,6 +95,7 @@ public function __construct($clientOrConfig = [], $rootUrl = null)
{
parent::__construct($clientOrConfig);
$this->rootUrl = $rootUrl ?: 'https://analytics.googleapis.com/';
$this->rootUrlTemplate = $rootUrl ?: 'https://analytics.UNIVERSE_DOMAIN/';
$this->servicePath = 'analytics/v3/';
$this->batchPath = 'batch/analytics/v3';
$this->version = 'v3';
Expand Down
2 changes: 2 additions & 0 deletions src/AnalyticsData.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class AnalyticsData extends \Google\Service

public $properties;
public $properties_audienceExports;
public $rootUrlTemplate;

/**
* Constructs the internal representation of the AnalyticsData service.
Expand All @@ -61,6 +62,7 @@ public function __construct($clientOrConfig = [], $rootUrl = null)
{
parent::__construct($clientOrConfig);
$this->rootUrl = $rootUrl ?: 'https://analyticsdata.googleapis.com/';
$this->rootUrlTemplate = $rootUrl ?: 'https://analyticsdata.UNIVERSE_DOMAIN/';
$this->servicePath = '';
$this->batchPath = 'batch';
$this->version = 'v1beta';
Expand Down
2 changes: 2 additions & 0 deletions src/AnalyticsHub.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class AnalyticsHub extends \Google\Service
public $projects_locations_dataExchanges;
public $projects_locations_dataExchanges_listings;
public $projects_locations_subscriptions;
public $rootUrlTemplate;

/**
* Constructs the internal representation of the AnalyticsHub service.
Expand All @@ -57,6 +58,7 @@ public function __construct($clientOrConfig = [], $rootUrl = null)
{
parent::__construct($clientOrConfig);
$this->rootUrl = $rootUrl ?: 'https://analyticshub.googleapis.com/';
$this->rootUrlTemplate = $rootUrl ?: 'https://analyticshub.UNIVERSE_DOMAIN/';
$this->servicePath = '';
$this->batchPath = 'batch';
$this->version = 'v1';
Expand Down
2 changes: 2 additions & 0 deletions src/AnalyticsReporting.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class AnalyticsReporting extends \Google\Service

public $reports;
public $userActivity;
public $rootUrlTemplate;

/**
* Constructs the internal representation of the AnalyticsReporting service.
Expand All @@ -55,6 +56,7 @@ public function __construct($clientOrConfig = [], $rootUrl = null)
{
parent::__construct($clientOrConfig);
$this->rootUrl = $rootUrl ?: 'https://analyticsreporting.googleapis.com/';
$this->rootUrlTemplate = $rootUrl ?: 'https://analyticsreporting.UNIVERSE_DOMAIN/';
$this->servicePath = '';
$this->batchPath = 'batch';
$this->version = 'v4';
Expand Down
2 changes: 2 additions & 0 deletions src/AndroidEnterprise.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ class AndroidEnterprise extends \Google\Service
public $storelayoutpages;
public $users;
public $webapps;
public $rootUrlTemplate;

/**
* Constructs the internal representation of the AndroidEnterprise service.
Expand All @@ -66,6 +67,7 @@ public function __construct($clientOrConfig = [], $rootUrl = null)
{
parent::__construct($clientOrConfig);
$this->rootUrl = $rootUrl ?: 'https://androidenterprise.googleapis.com/';
$this->rootUrlTemplate = $rootUrl ?: 'https://androidenterprise.UNIVERSE_DOMAIN/';
$this->servicePath = '';
$this->batchPath = 'batch';
$this->version = 'v1';
Expand Down
2 changes: 2 additions & 0 deletions src/AndroidManagement.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class AndroidManagement extends \Google\Service
public $enterprises_webTokens;
public $provisioningInfo;
public $signupUrls;
public $rootUrlTemplate;

/**
* Constructs the internal representation of the AndroidManagement service.
Expand All @@ -62,6 +63,7 @@ public function __construct($clientOrConfig = [], $rootUrl = null)
{
parent::__construct($clientOrConfig);
$this->rootUrl = $rootUrl ?: 'https://androidmanagement.googleapis.com/';
$this->rootUrlTemplate = $rootUrl ?: 'https://androidmanagement.UNIVERSE_DOMAIN/';
$this->servicePath = '';
$this->batchPath = 'batch';
$this->version = 'v1';
Expand Down
2 changes: 2 additions & 0 deletions src/AndroidProvisioningPartner.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ class AndroidProvisioningPartner extends \Google\Service
public $partners_devices;
public $partners_vendors;
public $partners_vendors_customers;
public $rootUrlTemplate;

/**
* Constructs the internal representation of the AndroidProvisioningPartner
Expand All @@ -59,6 +60,7 @@ public function __construct($clientOrConfig = [], $rootUrl = null)
{
parent::__construct($clientOrConfig);
$this->rootUrl = $rootUrl ?: 'https://androiddeviceprovisioning.googleapis.com/';
$this->rootUrlTemplate = $rootUrl ?: 'https://androiddeviceprovisioning.UNIVERSE_DOMAIN/';
$this->servicePath = '';
$this->batchPath = 'batch';
$this->version = 'v1';
Expand Down
Loading