diff --git a/AdsMarketingPlatformAdmin/metadata/V1Alpha/MarketingplatformAdmin.php b/AdsMarketingPlatformAdmin/metadata/V1Alpha/MarketingplatformAdmin.php index c61a0aa0312e..61ac1830f80f 100644 Binary files a/AdsMarketingPlatformAdmin/metadata/V1Alpha/MarketingplatformAdmin.php and b/AdsMarketingPlatformAdmin/metadata/V1Alpha/MarketingplatformAdmin.php differ diff --git a/AdsMarketingPlatformAdmin/metadata/V1Alpha/Resources.php b/AdsMarketingPlatformAdmin/metadata/V1Alpha/Resources.php index 70c3cd04ece1..e04334ee8e5b 100644 Binary files a/AdsMarketingPlatformAdmin/metadata/V1Alpha/Resources.php and b/AdsMarketingPlatformAdmin/metadata/V1Alpha/Resources.php differ diff --git a/AdsMarketingPlatformAdmin/samples/V1alpha/MarketingplatformAdminServiceClient/find_sales_partner_managed_clients.php b/AdsMarketingPlatformAdmin/samples/V1alpha/MarketingplatformAdminServiceClient/find_sales_partner_managed_clients.php new file mode 100644 index 000000000000..89e57230a8e8 --- /dev/null +++ b/AdsMarketingPlatformAdmin/samples/V1alpha/MarketingplatformAdminServiceClient/find_sales_partner_managed_clients.php @@ -0,0 +1,75 @@ +setOrganization($formattedOrganization); + + // Call the API and handle any network failures. + try { + /** @var FindSalesPartnerManagedClientsResponse $response */ + $response = $marketingplatformAdminServiceClient->findSalesPartnerManagedClients($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedOrganization = MarketingplatformAdminServiceClient::organizationName('[ORGANIZATION]'); + + find_sales_partner_managed_clients_sample($formattedOrganization); +} +// [END marketingplatformadmin_v1alpha_generated_MarketingplatformAdminService_FindSalesPartnerManagedClients_sync] diff --git a/AdsMarketingPlatformAdmin/samples/V1alpha/MarketingplatformAdminServiceClient/list_organizations.php b/AdsMarketingPlatformAdmin/samples/V1alpha/MarketingplatformAdminServiceClient/list_organizations.php new file mode 100644 index 000000000000..89ea3ac3a5e2 --- /dev/null +++ b/AdsMarketingPlatformAdmin/samples/V1alpha/MarketingplatformAdminServiceClient/list_organizations.php @@ -0,0 +1,62 @@ +listOrganizations($request); + + /** @var Organization $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END marketingplatformadmin_v1alpha_generated_MarketingplatformAdminService_ListOrganizations_sync] diff --git a/AdsMarketingPlatformAdmin/samples/V1alpha/MarketingplatformAdminServiceClient/report_property_usage.php b/AdsMarketingPlatformAdmin/samples/V1alpha/MarketingplatformAdminServiceClient/report_property_usage.php new file mode 100644 index 000000000000..bf30ae63a7bf --- /dev/null +++ b/AdsMarketingPlatformAdmin/samples/V1alpha/MarketingplatformAdminServiceClient/report_property_usage.php @@ -0,0 +1,86 @@ +setOrganization($organization) + ->setMonth($month); + + // Call the API and handle any network failures. + try { + /** @var ReportPropertyUsageResponse $response */ + $response = $marketingplatformAdminServiceClient->reportPropertyUsage($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $organization = '[ORGANIZATION]'; + $month = '[MONTH]'; + + report_property_usage_sample($organization, $month); +} +// [END marketingplatformadmin_v1alpha_generated_MarketingplatformAdminService_ReportPropertyUsage_sync] diff --git a/AdsMarketingPlatformAdmin/src/V1alpha/AnalyticsPropertyType.php b/AdsMarketingPlatformAdmin/src/V1alpha/AnalyticsPropertyType.php new file mode 100644 index 000000000000..9c068e36b59b --- /dev/null +++ b/AdsMarketingPlatformAdmin/src/V1alpha/AnalyticsPropertyType.php @@ -0,0 +1,68 @@ +google.marketingplatform.admin.v1alpha.AnalyticsPropertyType + */ +class AnalyticsPropertyType +{ + /** + * Unknown or unspecified property type + * + * Generated from protobuf enum ANALYTICS_PROPERTY_TYPE_UNSPECIFIED = 0; + */ + const ANALYTICS_PROPERTY_TYPE_UNSPECIFIED = 0; + /** + * Ordinary Google Analytics property + * + * Generated from protobuf enum ANALYTICS_PROPERTY_TYPE_ORDINARY = 1; + */ + const ANALYTICS_PROPERTY_TYPE_ORDINARY = 1; + /** + * Google Analytics subproperty + * + * Generated from protobuf enum ANALYTICS_PROPERTY_TYPE_SUBPROPERTY = 2; + */ + const ANALYTICS_PROPERTY_TYPE_SUBPROPERTY = 2; + /** + * Google Analytics rollup property + * + * Generated from protobuf enum ANALYTICS_PROPERTY_TYPE_ROLLUP = 3; + */ + const ANALYTICS_PROPERTY_TYPE_ROLLUP = 3; + + private static $valueToName = [ + self::ANALYTICS_PROPERTY_TYPE_UNSPECIFIED => 'ANALYTICS_PROPERTY_TYPE_UNSPECIFIED', + self::ANALYTICS_PROPERTY_TYPE_ORDINARY => 'ANALYTICS_PROPERTY_TYPE_ORDINARY', + self::ANALYTICS_PROPERTY_TYPE_SUBPROPERTY => 'ANALYTICS_PROPERTY_TYPE_SUBPROPERTY', + self::ANALYTICS_PROPERTY_TYPE_ROLLUP => 'ANALYTICS_PROPERTY_TYPE_ROLLUP', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/AdsMarketingPlatformAdmin/src/V1alpha/AnalyticsServiceLevel.php b/AdsMarketingPlatformAdmin/src/V1alpha/AnalyticsServiceLevel.php index e42cc8fe0f91..d7f4fce38ecf 100644 --- a/AdsMarketingPlatformAdmin/src/V1alpha/AnalyticsServiceLevel.php +++ b/AdsMarketingPlatformAdmin/src/V1alpha/AnalyticsServiceLevel.php @@ -1,6 +1,6 @@ createAnalyticsAccountLinkAsync(CreateAnalyticsAccountLinkRequest $request, array $optionalArgs = []) * @method PromiseInterface deleteAnalyticsAccountLinkAsync(DeleteAnalyticsAccountLinkRequest $request, array $optionalArgs = []) + * @method PromiseInterface findSalesPartnerManagedClientsAsync(FindSalesPartnerManagedClientsRequest $request, array $optionalArgs = []) * @method PromiseInterface getOrganizationAsync(GetOrganizationRequest $request, array $optionalArgs = []) * @method PromiseInterface listAnalyticsAccountLinksAsync(ListAnalyticsAccountLinksRequest $request, array $optionalArgs = []) + * @method PromiseInterface listOrganizationsAsync(ListOrganizationsRequest $request, array $optionalArgs = []) + * @method PromiseInterface reportPropertyUsageAsync(ReportPropertyUsageRequest $request, array $optionalArgs = []) * @method PromiseInterface setPropertyServiceLevelAsync(SetPropertyServiceLevelRequest $request, array $optionalArgs = []) */ final class MarketingplatformAdminServiceClient @@ -109,7 +117,8 @@ private static function getClientDefaults() ], 'transportConfig' => [ 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/marketingplatform_admin_service_rest_client_config.php', + 'restClientConfigPath' => + __DIR__ . '/../resources/marketingplatform_admin_service_rest_client_config.php', ], ], ]; @@ -331,8 +340,10 @@ public function __call($method, $args) * * @experimental */ - public function createAnalyticsAccountLink(CreateAnalyticsAccountLinkRequest $request, array $callOptions = []): AnalyticsAccountLink - { + public function createAnalyticsAccountLink( + CreateAnalyticsAccountLinkRequest $request, + array $callOptions = [] + ): AnalyticsAccountLink { return $this->startApiCall('CreateAnalyticsAccountLink', $request, $callOptions)->wait(); } @@ -362,11 +373,48 @@ public function createAnalyticsAccountLink(CreateAnalyticsAccountLinkRequest $re * * @experimental */ - public function deleteAnalyticsAccountLink(DeleteAnalyticsAccountLinkRequest $request, array $callOptions = []): void - { + public function deleteAnalyticsAccountLink( + DeleteAnalyticsAccountLinkRequest $request, + array $callOptions = [] + ): void { $this->startApiCall('DeleteAnalyticsAccountLink', $request, $callOptions)->wait(); } + /** + * Returns a list of clients managed by the sales partner organization. + * + * User needs to be an OrgAdmin/BillingAdmin on the sales partner organization + * in order to view the end clients. + * + * The async variant is + * {@see MarketingplatformAdminServiceClient::findSalesPartnerManagedClientsAsync()} + * . + * + * @example samples/V1alpha/MarketingplatformAdminServiceClient/find_sales_partner_managed_clients.php + * + * @param FindSalesPartnerManagedClientsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return FindSalesPartnerManagedClientsResponse + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function findSalesPartnerManagedClients( + FindSalesPartnerManagedClientsRequest $request, + array $callOptions = [] + ): FindSalesPartnerManagedClientsResponse { + return $this->startApiCall('FindSalesPartnerManagedClients', $request, $callOptions)->wait(); + } + /** * Lookup for a single organization. * @@ -421,11 +469,82 @@ public function getOrganization(GetOrganizationRequest $request, array $callOpti * * @experimental */ - public function listAnalyticsAccountLinks(ListAnalyticsAccountLinksRequest $request, array $callOptions = []): PagedListResponse - { + public function listAnalyticsAccountLinks( + ListAnalyticsAccountLinksRequest $request, + array $callOptions = [] + ): PagedListResponse { return $this->startApiCall('ListAnalyticsAccountLinks', $request, $callOptions); } + /** + * Returns a list of organizations that the user has access to. + * + * The async variant is + * {@see MarketingplatformAdminServiceClient::listOrganizationsAsync()} . + * + * @example samples/V1alpha/MarketingplatformAdminServiceClient/list_organizations.php + * + * @param ListOrganizationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function listOrganizations(ListOrganizationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListOrganizations', $request, $callOptions); + } + + /** + * Get the usage and billing data for properties within the organization for + * the specified month. + * + * Per direct client org, user needs to be OrgAdmin/BillingAdmin on the + * organization in order to view the billing and usage data. + * + * Per sales partner client org, user needs to be OrgAdmin/BillingAdmin on + * the sales partner org in order to view the billing and usage data, or + * OrgAdmin/BillingAdmin on the sales partner client org in order to view the + * usage data only. + * + * The async variant is + * {@see MarketingplatformAdminServiceClient::reportPropertyUsageAsync()} . + * + * @example samples/V1alpha/MarketingplatformAdminServiceClient/report_property_usage.php + * + * @param ReportPropertyUsageRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return ReportPropertyUsageResponse + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function reportPropertyUsage( + ReportPropertyUsageRequest $request, + array $callOptions = [] + ): ReportPropertyUsageResponse { + return $this->startApiCall('ReportPropertyUsage', $request, $callOptions)->wait(); + } + /** * Updates the service level for an Analytics property. * @@ -450,8 +569,10 @@ public function listAnalyticsAccountLinks(ListAnalyticsAccountLinksRequest $requ * * @experimental */ - public function setPropertyServiceLevel(SetPropertyServiceLevelRequest $request, array $callOptions = []): SetPropertyServiceLevelResponse - { + public function setPropertyServiceLevel( + SetPropertyServiceLevelRequest $request, + array $callOptions = [] + ): SetPropertyServiceLevelResponse { return $this->startApiCall('SetPropertyServiceLevel', $request, $callOptions)->wait(); } } diff --git a/AdsMarketingPlatformAdmin/src/V1alpha/FindSalesPartnerManagedClientsRequest.php b/AdsMarketingPlatformAdmin/src/V1alpha/FindSalesPartnerManagedClientsRequest.php new file mode 100644 index 000000000000..bbe0c5e44302 --- /dev/null +++ b/AdsMarketingPlatformAdmin/src/V1alpha/FindSalesPartnerManagedClientsRequest.php @@ -0,0 +1,105 @@ +google.marketingplatform.admin.v1alpha.FindSalesPartnerManagedClientsRequest + */ +class FindSalesPartnerManagedClientsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the sales partner organization. + * Format: organizations/{org_id} + * + * Generated from protobuf field string organization = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $organization = ''; + /** + * Optional. If set, only active and just ended clients will be returned. + * + * Generated from protobuf field bool is_active = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $is_active = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $organization + * Required. The name of the sales partner organization. + * Format: organizations/{org_id} + * @type bool $is_active + * Optional. If set, only active and just ended clients will be returned. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Marketingplatform\Admin\V1Alpha\MarketingplatformAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the sales partner organization. + * Format: organizations/{org_id} + * + * Generated from protobuf field string organization = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getOrganization() + { + return $this->organization; + } + + /** + * Required. The name of the sales partner organization. + * Format: organizations/{org_id} + * + * Generated from protobuf field string organization = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setOrganization($var) + { + GPBUtil::checkString($var, True); + $this->organization = $var; + + return $this; + } + + /** + * Optional. If set, only active and just ended clients will be returned. + * + * Generated from protobuf field bool is_active = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getIsActive() + { + return $this->is_active; + } + + /** + * Optional. If set, only active and just ended clients will be returned. + * + * Generated from protobuf field bool is_active = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setIsActive($var) + { + GPBUtil::checkBool($var); + $this->is_active = $var; + + return $this; + } + +} + diff --git a/AdsMarketingPlatformAdmin/src/V1alpha/FindSalesPartnerManagedClientsResponse.php b/AdsMarketingPlatformAdmin/src/V1alpha/FindSalesPartnerManagedClientsResponse.php new file mode 100644 index 000000000000..f838d4e7ccbe --- /dev/null +++ b/AdsMarketingPlatformAdmin/src/V1alpha/FindSalesPartnerManagedClientsResponse.php @@ -0,0 +1,67 @@ +google.marketingplatform.admin.v1alpha.FindSalesPartnerManagedClientsResponse + */ +class FindSalesPartnerManagedClientsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The clients managed by the sales org. + * + * Generated from protobuf field repeated .google.marketingplatform.admin.v1alpha.FindSalesPartnerManagedClientsResponse.ClientData client_data = 1; + */ + private $client_data; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Ads\MarketingPlatform\Admin\V1alpha\FindSalesPartnerManagedClientsResponse\ClientData>|\Google\Protobuf\Internal\RepeatedField $client_data + * The clients managed by the sales org. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Marketingplatform\Admin\V1Alpha\MarketingplatformAdmin::initOnce(); + parent::__construct($data); + } + + /** + * The clients managed by the sales org. + * + * Generated from protobuf field repeated .google.marketingplatform.admin.v1alpha.FindSalesPartnerManagedClientsResponse.ClientData client_data = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getClientData() + { + return $this->client_data; + } + + /** + * The clients managed by the sales org. + * + * Generated from protobuf field repeated .google.marketingplatform.admin.v1alpha.FindSalesPartnerManagedClientsResponse.ClientData client_data = 1; + * @param array<\Google\Ads\MarketingPlatform\Admin\V1alpha\FindSalesPartnerManagedClientsResponse\ClientData>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setClientData($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Ads\MarketingPlatform\Admin\V1alpha\FindSalesPartnerManagedClientsResponse\ClientData::class); + $this->client_data = $arr; + + return $this; + } + +} + diff --git a/AdsMarketingPlatformAdmin/src/V1alpha/FindSalesPartnerManagedClientsResponse/ClientData.php b/AdsMarketingPlatformAdmin/src/V1alpha/FindSalesPartnerManagedClientsResponse/ClientData.php new file mode 100644 index 000000000000..9535c4c39bd9 --- /dev/null +++ b/AdsMarketingPlatformAdmin/src/V1alpha/FindSalesPartnerManagedClientsResponse/ClientData.php @@ -0,0 +1,168 @@ +google.marketingplatform.admin.v1alpha.FindSalesPartnerManagedClientsResponse.ClientData + */ +class ClientData extends \Google\Protobuf\Internal\Message +{ + /** + * The end client that has/had contract with the requested sales org. + * + * Generated from protobuf field .google.marketingplatform.admin.v1alpha.Organization organization = 1; + */ + protected $organization = null; + /** + * The start date of the contract between the sales org and the end client. + * + * Generated from protobuf field .google.type.Date start_date = 2; + */ + protected $start_date = null; + /** + * The end date of the contract between the sales org and the end client. + * + * Generated from protobuf field .google.type.Date end_date = 3; + */ + protected $end_date = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Ads\MarketingPlatform\Admin\V1alpha\Organization $organization + * The end client that has/had contract with the requested sales org. + * @type \Google\Type\Date $start_date + * The start date of the contract between the sales org and the end client. + * @type \Google\Type\Date $end_date + * The end date of the contract between the sales org and the end client. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Marketingplatform\Admin\V1Alpha\MarketingplatformAdmin::initOnce(); + parent::__construct($data); + } + + /** + * The end client that has/had contract with the requested sales org. + * + * Generated from protobuf field .google.marketingplatform.admin.v1alpha.Organization organization = 1; + * @return \Google\Ads\MarketingPlatform\Admin\V1alpha\Organization|null + */ + public function getOrganization() + { + return $this->organization; + } + + public function hasOrganization() + { + return isset($this->organization); + } + + public function clearOrganization() + { + unset($this->organization); + } + + /** + * The end client that has/had contract with the requested sales org. + * + * Generated from protobuf field .google.marketingplatform.admin.v1alpha.Organization organization = 1; + * @param \Google\Ads\MarketingPlatform\Admin\V1alpha\Organization $var + * @return $this + */ + public function setOrganization($var) + { + GPBUtil::checkMessage($var, \Google\Ads\MarketingPlatform\Admin\V1alpha\Organization::class); + $this->organization = $var; + + return $this; + } + + /** + * The start date of the contract between the sales org and the end client. + * + * Generated from protobuf field .google.type.Date start_date = 2; + * @return \Google\Type\Date|null + */ + public function getStartDate() + { + return $this->start_date; + } + + public function hasStartDate() + { + return isset($this->start_date); + } + + public function clearStartDate() + { + unset($this->start_date); + } + + /** + * The start date of the contract between the sales org and the end client. + * + * Generated from protobuf field .google.type.Date start_date = 2; + * @param \Google\Type\Date $var + * @return $this + */ + public function setStartDate($var) + { + GPBUtil::checkMessage($var, \Google\Type\Date::class); + $this->start_date = $var; + + return $this; + } + + /** + * The end date of the contract between the sales org and the end client. + * + * Generated from protobuf field .google.type.Date end_date = 3; + * @return \Google\Type\Date|null + */ + public function getEndDate() + { + return $this->end_date; + } + + public function hasEndDate() + { + return isset($this->end_date); + } + + public function clearEndDate() + { + unset($this->end_date); + } + + /** + * The end date of the contract between the sales org and the end client. + * + * Generated from protobuf field .google.type.Date end_date = 3; + * @param \Google\Type\Date $var + * @return $this + */ + public function setEndDate($var) + { + GPBUtil::checkMessage($var, \Google\Type\Date::class); + $this->end_date = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ClientData::class, \Google\Ads\MarketingPlatform\Admin\V1alpha\FindSalesPartnerManagedClientsResponse_ClientData::class); + diff --git a/AdsMarketingPlatformAdmin/src/V1alpha/ListOrganizationsRequest.php b/AdsMarketingPlatformAdmin/src/V1alpha/ListOrganizationsRequest.php new file mode 100644 index 000000000000..7fac02605425 --- /dev/null +++ b/AdsMarketingPlatformAdmin/src/V1alpha/ListOrganizationsRequest.php @@ -0,0 +1,129 @@ +google.marketingplatform.admin.v1alpha.ListOrganizationsRequest + */ +class ListOrganizationsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The maximum number of organizations to return in one call. The + * service may return fewer than this value. + * If unspecified, at most 50 organizations will be returned. The + * maximum value is 1000; values above 1000 will be coerced to 1000. + * + * Generated from protobuf field int32 page_size = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A page token, received from a previous ListOrganizations call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to + * `ListOrganizations` must match the call that provided the page + * token. + * + * Generated from protobuf field string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $page_size + * Optional. The maximum number of organizations to return in one call. The + * service may return fewer than this value. + * If unspecified, at most 50 organizations will be returned. The + * maximum value is 1000; values above 1000 will be coerced to 1000. + * @type string $page_token + * Optional. A page token, received from a previous ListOrganizations call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to + * `ListOrganizations` must match the call that provided the page + * token. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Marketingplatform\Admin\V1Alpha\MarketingplatformAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The maximum number of organizations to return in one call. The + * service may return fewer than this value. + * If unspecified, at most 50 organizations will be returned. The + * maximum value is 1000; values above 1000 will be coerced to 1000. + * + * Generated from protobuf field int32 page_size = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of organizations to return in one call. The + * service may return fewer than this value. + * If unspecified, at most 50 organizations will be returned. The + * maximum value is 1000; values above 1000 will be coerced to 1000. + * + * Generated from protobuf field int32 page_size = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. A page token, received from a previous ListOrganizations call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to + * `ListOrganizations` must match the call that provided the page + * token. + * + * Generated from protobuf field string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A page token, received from a previous ListOrganizations call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to + * `ListOrganizations` must match the call that provided the page + * token. + * + * Generated from protobuf field string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/AdsMarketingPlatformAdmin/src/V1alpha/ListOrganizationsResponse.php b/AdsMarketingPlatformAdmin/src/V1alpha/ListOrganizationsResponse.php new file mode 100644 index 000000000000..cdfa5470f4f1 --- /dev/null +++ b/AdsMarketingPlatformAdmin/src/V1alpha/ListOrganizationsResponse.php @@ -0,0 +1,109 @@ +google.marketingplatform.admin.v1alpha.ListOrganizationsResponse + */ +class ListOrganizationsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The Organization resource that the user has access to, which includes the + * org id and display name. + * + * Generated from protobuf field repeated .google.marketingplatform.admin.v1alpha.Organization organizations = 1; + */ + private $organizations; + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Ads\MarketingPlatform\Admin\V1alpha\Organization>|\Google\Protobuf\Internal\RepeatedField $organizations + * The Organization resource that the user has access to, which includes the + * org id and display name. + * @type string $next_page_token + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Marketingplatform\Admin\V1Alpha\MarketingplatformAdmin::initOnce(); + parent::__construct($data); + } + + /** + * The Organization resource that the user has access to, which includes the + * org id and display name. + * + * Generated from protobuf field repeated .google.marketingplatform.admin.v1alpha.Organization organizations = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getOrganizations() + { + return $this->organizations; + } + + /** + * The Organization resource that the user has access to, which includes the + * org id and display name. + * + * Generated from protobuf field repeated .google.marketingplatform.admin.v1alpha.Organization organizations = 1; + * @param array<\Google\Ads\MarketingPlatform\Admin\V1alpha\Organization>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setOrganizations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Ads\MarketingPlatform\Admin\V1alpha\Organization::class); + $this->organizations = $arr; + + return $this; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/AdsMarketingPlatformAdmin/src/V1alpha/ReportPropertyUsageRequest.php b/AdsMarketingPlatformAdmin/src/V1alpha/ReportPropertyUsageRequest.php new file mode 100644 index 000000000000..78f752a541b2 --- /dev/null +++ b/AdsMarketingPlatformAdmin/src/V1alpha/ReportPropertyUsageRequest.php @@ -0,0 +1,124 @@ +google.marketingplatform.admin.v1alpha.ReportPropertyUsageRequest + */ +class ReportPropertyUsageRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Specifies the organization whose property usage will be listed. + * Format: organizations/{org_id} + * + * Generated from protobuf field string organization = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $organization = ''; + /** + * Required. The target month to list property usages. + * Format: YYYY-MM. For example, "2025-05" + * + * Generated from protobuf field string month = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $month = ''; + + /** + * @param string $organization Required. Specifies the organization whose property usage will be listed. + * + * Format: organizations/{org_id} + * + * @return \Google\Ads\MarketingPlatform\Admin\V1alpha\ReportPropertyUsageRequest + * + * @experimental + */ + public static function build(string $organization): self + { + return (new self()) + ->setOrganization($organization); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $organization + * Required. Specifies the organization whose property usage will be listed. + * Format: organizations/{org_id} + * @type string $month + * Required. The target month to list property usages. + * Format: YYYY-MM. For example, "2025-05" + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Marketingplatform\Admin\V1Alpha\MarketingplatformAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Required. Specifies the organization whose property usage will be listed. + * Format: organizations/{org_id} + * + * Generated from protobuf field string organization = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getOrganization() + { + return $this->organization; + } + + /** + * Required. Specifies the organization whose property usage will be listed. + * Format: organizations/{org_id} + * + * Generated from protobuf field string organization = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setOrganization($var) + { + GPBUtil::checkString($var, True); + $this->organization = $var; + + return $this; + } + + /** + * Required. The target month to list property usages. + * Format: YYYY-MM. For example, "2025-05" + * + * Generated from protobuf field string month = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getMonth() + { + return $this->month; + } + + /** + * Required. The target month to list property usages. + * Format: YYYY-MM. For example, "2025-05" + * + * Generated from protobuf field string month = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setMonth($var) + { + GPBUtil::checkString($var, True); + $this->month = $var; + + return $this; + } + +} + diff --git a/AdsMarketingPlatformAdmin/src/V1alpha/ReportPropertyUsageResponse.php b/AdsMarketingPlatformAdmin/src/V1alpha/ReportPropertyUsageResponse.php new file mode 100644 index 000000000000..d3168fffdfef --- /dev/null +++ b/AdsMarketingPlatformAdmin/src/V1alpha/ReportPropertyUsageResponse.php @@ -0,0 +1,115 @@ +google.marketingplatform.admin.v1alpha.ReportPropertyUsageResponse + */ +class ReportPropertyUsageResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Usage data for all properties in the specified organization and month. + * + * Generated from protobuf field repeated .google.marketingplatform.admin.v1alpha.ReportPropertyUsageResponse.PropertyUsage property_usages = 1; + */ + private $property_usages; + /** + * Bill amount in the specified organization and month. + * Will be empty if user only has access to usage data. + * + * Generated from protobuf field .google.marketingplatform.admin.v1alpha.ReportPropertyUsageResponse.BillInfo bill_info = 2; + */ + protected $bill_info = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Ads\MarketingPlatform\Admin\V1alpha\ReportPropertyUsageResponse\PropertyUsage>|\Google\Protobuf\Internal\RepeatedField $property_usages + * Usage data for all properties in the specified organization and month. + * @type \Google\Ads\MarketingPlatform\Admin\V1alpha\ReportPropertyUsageResponse\BillInfo $bill_info + * Bill amount in the specified organization and month. + * Will be empty if user only has access to usage data. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Marketingplatform\Admin\V1Alpha\MarketingplatformAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Usage data for all properties in the specified organization and month. + * + * Generated from protobuf field repeated .google.marketingplatform.admin.v1alpha.ReportPropertyUsageResponse.PropertyUsage property_usages = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPropertyUsages() + { + return $this->property_usages; + } + + /** + * Usage data for all properties in the specified organization and month. + * + * Generated from protobuf field repeated .google.marketingplatform.admin.v1alpha.ReportPropertyUsageResponse.PropertyUsage property_usages = 1; + * @param array<\Google\Ads\MarketingPlatform\Admin\V1alpha\ReportPropertyUsageResponse\PropertyUsage>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPropertyUsages($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Ads\MarketingPlatform\Admin\V1alpha\ReportPropertyUsageResponse\PropertyUsage::class); + $this->property_usages = $arr; + + return $this; + } + + /** + * Bill amount in the specified organization and month. + * Will be empty if user only has access to usage data. + * + * Generated from protobuf field .google.marketingplatform.admin.v1alpha.ReportPropertyUsageResponse.BillInfo bill_info = 2; + * @return \Google\Ads\MarketingPlatform\Admin\V1alpha\ReportPropertyUsageResponse\BillInfo|null + */ + public function getBillInfo() + { + return $this->bill_info; + } + + public function hasBillInfo() + { + return isset($this->bill_info); + } + + public function clearBillInfo() + { + unset($this->bill_info); + } + + /** + * Bill amount in the specified organization and month. + * Will be empty if user only has access to usage data. + * + * Generated from protobuf field .google.marketingplatform.admin.v1alpha.ReportPropertyUsageResponse.BillInfo bill_info = 2; + * @param \Google\Ads\MarketingPlatform\Admin\V1alpha\ReportPropertyUsageResponse\BillInfo $var + * @return $this + */ + public function setBillInfo($var) + { + GPBUtil::checkMessage($var, \Google\Ads\MarketingPlatform\Admin\V1alpha\ReportPropertyUsageResponse\BillInfo::class); + $this->bill_info = $var; + + return $this; + } + +} + diff --git a/AdsMarketingPlatformAdmin/src/V1alpha/ReportPropertyUsageResponse/BillInfo.php b/AdsMarketingPlatformAdmin/src/V1alpha/ReportPropertyUsageResponse/BillInfo.php new file mode 100644 index 000000000000..9af6e26b9fb2 --- /dev/null +++ b/AdsMarketingPlatformAdmin/src/V1alpha/ReportPropertyUsageResponse/BillInfo.php @@ -0,0 +1,216 @@ +google.marketingplatform.admin.v1alpha.ReportPropertyUsageResponse.BillInfo + */ +class BillInfo extends \Google\Protobuf\Internal\Message +{ + /** + * The amount of the monthly base fee. + * + * Generated from protobuf field .google.type.Money base_fee = 1; + */ + protected $base_fee = null; + /** + * The amount of the event fee. + * + * Generated from protobuf field .google.type.Money event_fee = 2; + */ + protected $event_fee = null; + /** + * The amount of the price protection credit, this is only available for + * eligible customers. + * + * Generated from protobuf field .google.type.Money price_protection_credit = 3; + */ + protected $price_protection_credit = null; + /** + * The total amount of the bill. + * + * Generated from protobuf field .google.type.Money total = 4; + */ + protected $total = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Type\Money $base_fee + * The amount of the monthly base fee. + * @type \Google\Type\Money $event_fee + * The amount of the event fee. + * @type \Google\Type\Money $price_protection_credit + * The amount of the price protection credit, this is only available for + * eligible customers. + * @type \Google\Type\Money $total + * The total amount of the bill. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Marketingplatform\Admin\V1Alpha\MarketingplatformAdmin::initOnce(); + parent::__construct($data); + } + + /** + * The amount of the monthly base fee. + * + * Generated from protobuf field .google.type.Money base_fee = 1; + * @return \Google\Type\Money|null + */ + public function getBaseFee() + { + return $this->base_fee; + } + + public function hasBaseFee() + { + return isset($this->base_fee); + } + + public function clearBaseFee() + { + unset($this->base_fee); + } + + /** + * The amount of the monthly base fee. + * + * Generated from protobuf field .google.type.Money base_fee = 1; + * @param \Google\Type\Money $var + * @return $this + */ + public function setBaseFee($var) + { + GPBUtil::checkMessage($var, \Google\Type\Money::class); + $this->base_fee = $var; + + return $this; + } + + /** + * The amount of the event fee. + * + * Generated from protobuf field .google.type.Money event_fee = 2; + * @return \Google\Type\Money|null + */ + public function getEventFee() + { + return $this->event_fee; + } + + public function hasEventFee() + { + return isset($this->event_fee); + } + + public function clearEventFee() + { + unset($this->event_fee); + } + + /** + * The amount of the event fee. + * + * Generated from protobuf field .google.type.Money event_fee = 2; + * @param \Google\Type\Money $var + * @return $this + */ + public function setEventFee($var) + { + GPBUtil::checkMessage($var, \Google\Type\Money::class); + $this->event_fee = $var; + + return $this; + } + + /** + * The amount of the price protection credit, this is only available for + * eligible customers. + * + * Generated from protobuf field .google.type.Money price_protection_credit = 3; + * @return \Google\Type\Money|null + */ + public function getPriceProtectionCredit() + { + return $this->price_protection_credit; + } + + public function hasPriceProtectionCredit() + { + return isset($this->price_protection_credit); + } + + public function clearPriceProtectionCredit() + { + unset($this->price_protection_credit); + } + + /** + * The amount of the price protection credit, this is only available for + * eligible customers. + * + * Generated from protobuf field .google.type.Money price_protection_credit = 3; + * @param \Google\Type\Money $var + * @return $this + */ + public function setPriceProtectionCredit($var) + { + GPBUtil::checkMessage($var, \Google\Type\Money::class); + $this->price_protection_credit = $var; + + return $this; + } + + /** + * The total amount of the bill. + * + * Generated from protobuf field .google.type.Money total = 4; + * @return \Google\Type\Money|null + */ + public function getTotal() + { + return $this->total; + } + + public function hasTotal() + { + return isset($this->total); + } + + public function clearTotal() + { + unset($this->total); + } + + /** + * The total amount of the bill. + * + * Generated from protobuf field .google.type.Money total = 4; + * @param \Google\Type\Money $var + * @return $this + */ + public function setTotal($var) + { + GPBUtil::checkMessage($var, \Google\Type\Money::class); + $this->total = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(BillInfo::class, \Google\Ads\MarketingPlatform\Admin\V1alpha\ReportPropertyUsageResponse_BillInfo::class); + diff --git a/AdsMarketingPlatformAdmin/src/V1alpha/ReportPropertyUsageResponse/PropertyUsage.php b/AdsMarketingPlatformAdmin/src/V1alpha/ReportPropertyUsageResponse/PropertyUsage.php new file mode 100644 index 000000000000..6e3e8e8d7119 --- /dev/null +++ b/AdsMarketingPlatformAdmin/src/V1alpha/ReportPropertyUsageResponse/PropertyUsage.php @@ -0,0 +1,287 @@ +google.marketingplatform.admin.v1alpha.ReportPropertyUsageResponse.PropertyUsage + */ +class PropertyUsage extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the Google Analytics Admin API property resource. + * Format: analyticsadmin.googleapis.com/properties/{property_id} + * + * Generated from protobuf field string property = 1; + */ + protected $property = ''; + /** + * The display name of the property. + * + * Generated from protobuf field string display_name = 2; + */ + protected $display_name = ''; + /** + * The ID of the property's parent account. + * + * Generated from protobuf field int64 account_id = 3; + */ + protected $account_id = 0; + /** + * The service level of the property. + * + * Generated from protobuf field .google.marketingplatform.admin.v1alpha.AnalyticsServiceLevel service_level = 4; + */ + protected $service_level = 0; + /** + * The subtype of the analytics property. This affects the billable event + * count. + * + * Generated from protobuf field .google.marketingplatform.admin.v1alpha.AnalyticsPropertyType property_type = 5; + */ + protected $property_type = 0; + /** + * Total event count that the property received during the requested month. + * + * Generated from protobuf field int64 total_event_count = 6; + */ + protected $total_event_count = 0; + /** + * The number of events for which the property is billed in the requested + * month. + * + * Generated from protobuf field int64 billable_event_count = 7; + */ + protected $billable_event_count = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $property + * The name of the Google Analytics Admin API property resource. + * Format: analyticsadmin.googleapis.com/properties/{property_id} + * @type string $display_name + * The display name of the property. + * @type int|string $account_id + * The ID of the property's parent account. + * @type int $service_level + * The service level of the property. + * @type int $property_type + * The subtype of the analytics property. This affects the billable event + * count. + * @type int|string $total_event_count + * Total event count that the property received during the requested month. + * @type int|string $billable_event_count + * The number of events for which the property is billed in the requested + * month. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Marketingplatform\Admin\V1Alpha\MarketingplatformAdmin::initOnce(); + parent::__construct($data); + } + + /** + * The name of the Google Analytics Admin API property resource. + * Format: analyticsadmin.googleapis.com/properties/{property_id} + * + * Generated from protobuf field string property = 1; + * @return string + */ + public function getProperty() + { + return $this->property; + } + + /** + * The name of the Google Analytics Admin API property resource. + * Format: analyticsadmin.googleapis.com/properties/{property_id} + * + * Generated from protobuf field string property = 1; + * @param string $var + * @return $this + */ + public function setProperty($var) + { + GPBUtil::checkString($var, True); + $this->property = $var; + + return $this; + } + + /** + * The display name of the property. + * + * Generated from protobuf field string display_name = 2; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * The display name of the property. + * + * Generated from protobuf field string display_name = 2; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * The ID of the property's parent account. + * + * Generated from protobuf field int64 account_id = 3; + * @return int|string + */ + public function getAccountId() + { + return $this->account_id; + } + + /** + * The ID of the property's parent account. + * + * Generated from protobuf field int64 account_id = 3; + * @param int|string $var + * @return $this + */ + public function setAccountId($var) + { + GPBUtil::checkInt64($var); + $this->account_id = $var; + + return $this; + } + + /** + * The service level of the property. + * + * Generated from protobuf field .google.marketingplatform.admin.v1alpha.AnalyticsServiceLevel service_level = 4; + * @return int + */ + public function getServiceLevel() + { + return $this->service_level; + } + + /** + * The service level of the property. + * + * Generated from protobuf field .google.marketingplatform.admin.v1alpha.AnalyticsServiceLevel service_level = 4; + * @param int $var + * @return $this + */ + public function setServiceLevel($var) + { + GPBUtil::checkEnum($var, \Google\Ads\MarketingPlatform\Admin\V1alpha\AnalyticsServiceLevel::class); + $this->service_level = $var; + + return $this; + } + + /** + * The subtype of the analytics property. This affects the billable event + * count. + * + * Generated from protobuf field .google.marketingplatform.admin.v1alpha.AnalyticsPropertyType property_type = 5; + * @return int + */ + public function getPropertyType() + { + return $this->property_type; + } + + /** + * The subtype of the analytics property. This affects the billable event + * count. + * + * Generated from protobuf field .google.marketingplatform.admin.v1alpha.AnalyticsPropertyType property_type = 5; + * @param int $var + * @return $this + */ + public function setPropertyType($var) + { + GPBUtil::checkEnum($var, \Google\Ads\MarketingPlatform\Admin\V1alpha\AnalyticsPropertyType::class); + $this->property_type = $var; + + return $this; + } + + /** + * Total event count that the property received during the requested month. + * + * Generated from protobuf field int64 total_event_count = 6; + * @return int|string + */ + public function getTotalEventCount() + { + return $this->total_event_count; + } + + /** + * Total event count that the property received during the requested month. + * + * Generated from protobuf field int64 total_event_count = 6; + * @param int|string $var + * @return $this + */ + public function setTotalEventCount($var) + { + GPBUtil::checkInt64($var); + $this->total_event_count = $var; + + return $this; + } + + /** + * The number of events for which the property is billed in the requested + * month. + * + * Generated from protobuf field int64 billable_event_count = 7; + * @return int|string + */ + public function getBillableEventCount() + { + return $this->billable_event_count; + } + + /** + * The number of events for which the property is billed in the requested + * month. + * + * Generated from protobuf field int64 billable_event_count = 7; + * @param int|string $var + * @return $this + */ + public function setBillableEventCount($var) + { + GPBUtil::checkInt64($var); + $this->billable_event_count = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(PropertyUsage::class, \Google\Ads\MarketingPlatform\Admin\V1alpha\ReportPropertyUsageResponse_PropertyUsage::class); + diff --git a/AdsMarketingPlatformAdmin/src/V1alpha/gapic_metadata.json b/AdsMarketingPlatformAdmin/src/V1alpha/gapic_metadata.json index 4066f7b204b7..ff2104782c8e 100644 --- a/AdsMarketingPlatformAdmin/src/V1alpha/gapic_metadata.json +++ b/AdsMarketingPlatformAdmin/src/V1alpha/gapic_metadata.json @@ -20,6 +20,11 @@ "deleteAnalyticsAccountLink" ] }, + "FindSalesPartnerManagedClients": { + "methods": [ + "findSalesPartnerManagedClients" + ] + }, "GetOrganization": { "methods": [ "getOrganization" @@ -30,6 +35,16 @@ "listAnalyticsAccountLinks" ] }, + "ListOrganizations": { + "methods": [ + "listOrganizations" + ] + }, + "ReportPropertyUsage": { + "methods": [ + "reportPropertyUsage" + ] + }, "SetPropertyServiceLevel": { "methods": [ "setPropertyServiceLevel" diff --git a/AdsMarketingPlatformAdmin/src/V1alpha/resources/marketingplatform_admin_service_client_config.json b/AdsMarketingPlatformAdmin/src/V1alpha/resources/marketingplatform_admin_service_client_config.json index 4ffda61291aa..21a2f2499a87 100644 --- a/AdsMarketingPlatformAdmin/src/V1alpha/resources/marketingplatform_admin_service_client_config.json +++ b/AdsMarketingPlatformAdmin/src/V1alpha/resources/marketingplatform_admin_service_client_config.json @@ -39,6 +39,11 @@ "retry_codes_name": "retry_policy_1_codes", "retry_params_name": "retry_policy_1_params" }, + "FindSalesPartnerManagedClients": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, "GetOrganization": { "timeout_millis": 60000, "retry_codes_name": "retry_policy_1_codes", @@ -49,6 +54,16 @@ "retry_codes_name": "retry_policy_1_codes", "retry_params_name": "retry_policy_1_params" }, + "ListOrganizations": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ReportPropertyUsage": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, "SetPropertyServiceLevel": { "timeout_millis": 60000, "retry_codes_name": "retry_policy_1_codes", diff --git a/AdsMarketingPlatformAdmin/src/V1alpha/resources/marketingplatform_admin_service_descriptor_config.php b/AdsMarketingPlatformAdmin/src/V1alpha/resources/marketingplatform_admin_service_descriptor_config.php index 279e5fb82782..bbaeb7f1388a 100644 --- a/AdsMarketingPlatformAdmin/src/V1alpha/resources/marketingplatform_admin_service_descriptor_config.php +++ b/AdsMarketingPlatformAdmin/src/V1alpha/resources/marketingplatform_admin_service_descriptor_config.php @@ -47,6 +47,18 @@ ], ], ], + 'FindSalesPartnerManagedClients' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Ads\MarketingPlatform\Admin\V1alpha\FindSalesPartnerManagedClientsResponse', + 'headerParams' => [ + [ + 'keyName' => 'organization', + 'fieldAccessors' => [ + 'getOrganization', + ], + ], + ], + ], 'GetOrganization' => [ 'callType' => \Google\ApiCore\Call::UNARY_CALL, 'responseType' => 'Google\Ads\MarketingPlatform\Admin\V1alpha\Organization', @@ -79,6 +91,30 @@ ], ], ], + 'ListOrganizations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getOrganizations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Ads\MarketingPlatform\Admin\V1alpha\ListOrganizationsResponse', + ], + 'ReportPropertyUsage' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Ads\MarketingPlatform\Admin\V1alpha\ReportPropertyUsageResponse', + 'headerParams' => [ + [ + 'keyName' => 'organization', + 'fieldAccessors' => [ + 'getOrganization', + ], + ], + ], + ], 'SetPropertyServiceLevel' => [ 'callType' => \Google\ApiCore\Call::UNARY_CALL, 'responseType' => 'Google\Ads\MarketingPlatform\Admin\V1alpha\SetPropertyServiceLevelResponse', diff --git a/AdsMarketingPlatformAdmin/src/V1alpha/resources/marketingplatform_admin_service_rest_client_config.php b/AdsMarketingPlatformAdmin/src/V1alpha/resources/marketingplatform_admin_service_rest_client_config.php index 268599714999..8dcd724827e3 100644 --- a/AdsMarketingPlatformAdmin/src/V1alpha/resources/marketingplatform_admin_service_rest_client_config.php +++ b/AdsMarketingPlatformAdmin/src/V1alpha/resources/marketingplatform_admin_service_rest_client_config.php @@ -46,6 +46,18 @@ ], ], ], + 'FindSalesPartnerManagedClients' => [ + 'method' => 'post', + 'uriTemplate' => '/v1alpha/{organization=organizations/*}:findSalesPartnerManagedClients', + 'body' => '*', + 'placeholders' => [ + 'organization' => [ + 'getters' => [ + 'getOrganization', + ], + ], + ], + ], 'GetOrganization' => [ 'method' => 'get', 'uriTemplate' => '/v1alpha/{name=organizations/*}', @@ -68,6 +80,22 @@ ], ], ], + 'ListOrganizations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1alpha/organizations', + ], + 'ReportPropertyUsage' => [ + 'method' => 'post', + 'uriTemplate' => '/v1alpha/{organization=organizations/*}:reportPropertyUsage', + 'body' => '*', + 'placeholders' => [ + 'organization' => [ + 'getters' => [ + 'getOrganization', + ], + ], + ], + ], 'SetPropertyServiceLevel' => [ 'method' => 'post', 'uriTemplate' => '/v1alpha/{analytics_account_link=organizations/*/analyticsAccountLinks/*}:setPropertyServiceLevel', diff --git a/AdsMarketingPlatformAdmin/tests/Unit/V1alpha/Client/MarketingplatformAdminServiceClientTest.php b/AdsMarketingPlatformAdmin/tests/Unit/V1alpha/Client/MarketingplatformAdminServiceClientTest.php index bafdf669b1ca..247cefeac659 100644 --- a/AdsMarketingPlatformAdmin/tests/Unit/V1alpha/Client/MarketingplatformAdminServiceClientTest.php +++ b/AdsMarketingPlatformAdmin/tests/Unit/V1alpha/Client/MarketingplatformAdminServiceClientTest.php @@ -27,10 +27,16 @@ use Google\Ads\MarketingPlatform\Admin\V1alpha\Client\MarketingplatformAdminServiceClient; use Google\Ads\MarketingPlatform\Admin\V1alpha\CreateAnalyticsAccountLinkRequest; use Google\Ads\MarketingPlatform\Admin\V1alpha\DeleteAnalyticsAccountLinkRequest; +use Google\Ads\MarketingPlatform\Admin\V1alpha\FindSalesPartnerManagedClientsRequest; +use Google\Ads\MarketingPlatform\Admin\V1alpha\FindSalesPartnerManagedClientsResponse; use Google\Ads\MarketingPlatform\Admin\V1alpha\GetOrganizationRequest; use Google\Ads\MarketingPlatform\Admin\V1alpha\ListAnalyticsAccountLinksRequest; use Google\Ads\MarketingPlatform\Admin\V1alpha\ListAnalyticsAccountLinksResponse; +use Google\Ads\MarketingPlatform\Admin\V1alpha\ListOrganizationsRequest; +use Google\Ads\MarketingPlatform\Admin\V1alpha\ListOrganizationsResponse; use Google\Ads\MarketingPlatform\Admin\V1alpha\Organization; +use Google\Ads\MarketingPlatform\Admin\V1alpha\ReportPropertyUsageRequest; +use Google\Ads\MarketingPlatform\Admin\V1alpha\ReportPropertyUsageResponse; use Google\Ads\MarketingPlatform\Admin\V1alpha\SetPropertyServiceLevelRequest; use Google\Ads\MarketingPlatform\Admin\V1alpha\SetPropertyServiceLevelResponse; use Google\ApiCore\ApiException; @@ -220,6 +226,72 @@ public function deleteAnalyticsAccountLinkExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** @test */ + public function findSalesPartnerManagedClientsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new FindSalesPartnerManagedClientsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedOrganization = $gapicClient->organizationName('[ORGANIZATION]'); + $request = (new FindSalesPartnerManagedClientsRequest())->setOrganization($formattedOrganization); + $response = $gapicClient->findSalesPartnerManagedClients($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.marketingplatform.admin.v1alpha.MarketingplatformAdminService/FindSalesPartnerManagedClients', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getOrganization(); + $this->assertProtobufEquals($formattedOrganization, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function findSalesPartnerManagedClientsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedOrganization = $gapicClient->organizationName('[ORGANIZATION]'); + $request = (new FindSalesPartnerManagedClientsRequest())->setOrganization($formattedOrganization); + try { + $gapicClient->findSalesPartnerManagedClients($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + /** @test */ public function getOrganizationTest() { @@ -364,6 +436,144 @@ public function listAnalyticsAccountLinksExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** @test */ + public function listOrganizationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $organizationsElement = new Organization(); + $organizations = [$organizationsElement]; + $expectedResponse = new ListOrganizationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setOrganizations($organizations); + $transport->addResponse($expectedResponse); + $request = new ListOrganizationsRequest(); + $response = $gapicClient->listOrganizations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getOrganizations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.marketingplatform.admin.v1alpha.MarketingplatformAdminService/ListOrganizations', + $actualFuncCall + ); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listOrganizationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + $request = new ListOrganizationsRequest(); + try { + $gapicClient->listOrganizations($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function reportPropertyUsageTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new ReportPropertyUsageResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $organization = 'organization1178922291'; + $month = 'month104080000'; + $request = (new ReportPropertyUsageRequest())->setOrganization($organization)->setMonth($month); + $response = $gapicClient->reportPropertyUsage($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.marketingplatform.admin.v1alpha.MarketingplatformAdminService/ReportPropertyUsage', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getOrganization(); + $this->assertProtobufEquals($organization, $actualValue); + $actualValue = $actualRequestObject->getMonth(); + $this->assertProtobufEquals($month, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function reportPropertyUsageExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $organization = 'organization1178922291'; + $month = 'month104080000'; + $request = (new ReportPropertyUsageRequest())->setOrganization($organization)->setMonth($month); + try { + $gapicClient->reportPropertyUsage($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + /** @test */ public function setPropertyServiceLevelTest() {