├── .gitattributes ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── SECURITY.md ├── VERSION ├── composer.json ├── metadata ├── V1Alpha │ ├── AnalyticsDataApi.php │ └── Data.php └── V1Beta │ ├── AnalyticsDataApi.php │ └── Data.php └── src ├── V1alpha ├── AudienceDimension.php ├── AudienceDimensionValue.php ├── AudienceList.php ├── AudienceList │ └── State.php ├── AudienceListMetadata.php ├── AudienceRow.php ├── BetweenFilter.php ├── Client │ └── AlphaAnalyticsDataClient.php ├── Cohort.php ├── CohortReportSettings.php ├── CohortSpec.php ├── CohortsRange.php ├── CohortsRange │ └── Granularity.php ├── CreateAudienceListRequest.php ├── CreateRecurringAudienceListRequest.php ├── CreateReportTaskRequest.php ├── DateRange.php ├── Dimension.php ├── DimensionExpression.php ├── DimensionExpression │ ├── CaseExpression.php │ └── ConcatenateExpression.php ├── DimensionHeader.php ├── DimensionValue.php ├── EmptyFilter.php ├── EventCriteriaScoping.php ├── EventExclusionDuration.php ├── EventSegment.php ├── EventSegmentConditionGroup.php ├── EventSegmentCriteria.php ├── EventSegmentExclusion.php ├── Filter.php ├── FilterExpression.php ├── FilterExpressionList.php ├── Funnel.php ├── FunnelBreakdown.php ├── FunnelEventFilter.php ├── FunnelFieldFilter.php ├── FunnelFilterExpression.php ├── FunnelFilterExpressionList.php ├── FunnelNextAction.php ├── FunnelParameterFilter.php ├── FunnelParameterFilterExpression.php ├── FunnelParameterFilterExpressionList.php ├── FunnelResponseMetadata.php ├── FunnelStep.php ├── FunnelSubReport.php ├── GetAudienceListRequest.php ├── GetPropertyQuotasSnapshotRequest.php ├── GetRecurringAudienceListRequest.php ├── GetReportTaskRequest.php ├── InListFilter.php ├── ListAudienceListsRequest.php ├── ListAudienceListsResponse.php ├── ListRecurringAudienceListsRequest.php ├── ListRecurringAudienceListsResponse.php ├── ListReportTasksRequest.php ├── ListReportTasksResponse.php ├── Metric.php ├── MetricAggregation.php ├── MetricHeader.php ├── MetricType.php ├── MetricValue.php ├── NumericFilter.php ├── NumericFilter │ └── Operation.php ├── NumericValue.php ├── OrderBy.php ├── OrderBy │ ├── DimensionOrderBy.php │ ├── DimensionOrderBy │ │ └── OrderType.php │ └── MetricOrderBy.php ├── PropertyQuota.php ├── PropertyQuotasSnapshot.php ├── QueryAudienceListRequest.php ├── QueryAudienceListResponse.php ├── QueryReportTaskRequest.php ├── QueryReportTaskResponse.php ├── QuotaStatus.php ├── RecurringAudienceList.php ├── ReportTask.php ├── ReportTask │ ├── ReportDefinition.php │ ├── ReportMetadata.php │ └── ReportMetadata │ │ └── State.php ├── ReportTaskMetadata.php ├── ResponseMetaData.php ├── ResponseMetaData │ ├── SchemaRestrictionResponse.php │ └── SchemaRestrictionResponse │ │ └── ActiveMetricRestriction.php ├── RestrictedMetricType.php ├── Row.php ├── RunFunnelReportRequest.php ├── RunFunnelReportRequest │ └── FunnelVisualizationType.php ├── RunFunnelReportResponse.php ├── SamplingLevel.php ├── SamplingMetadata.php ├── Segment.php ├── SegmentEventFilter.php ├── SegmentFilter.php ├── SegmentFilterExpression.php ├── SegmentFilterExpressionList.php ├── SegmentFilterScoping.php ├── SegmentParameterFilter.php ├── SegmentParameterFilterExpression.php ├── SegmentParameterFilterExpressionList.php ├── SegmentParameterFilterScoping.php ├── SessionCriteriaScoping.php ├── SessionExclusionDuration.php ├── SessionSegment.php ├── SessionSegmentConditionGroup.php ├── SessionSegmentCriteria.php ├── SessionSegmentExclusion.php ├── SheetExportAudienceListRequest.php ├── SheetExportAudienceListResponse.php ├── StringFilter.php ├── StringFilter │ └── MatchType.php ├── UserCriteriaScoping.php ├── UserExclusionDuration.php ├── UserSegment.php ├── UserSegmentConditionGroup.php ├── UserSegmentCriteria.php ├── UserSegmentExclusion.php ├── UserSegmentSequenceGroup.php ├── UserSequenceStep.php ├── WebhookNotification.php └── resources │ ├── alpha_analytics_data_client_config.json │ ├── alpha_analytics_data_descriptor_config.php │ └── alpha_analytics_data_rest_client_config.php └── V1beta ├── AudienceDimension.php ├── AudienceDimensionValue.php ├── AudienceExport.php ├── AudienceExport └── State.php ├── AudienceExportMetadata.php ├── AudienceRow.php ├── BatchRunPivotReportsRequest.php ├── BatchRunPivotReportsResponse.php ├── BatchRunReportsRequest.php ├── BatchRunReportsResponse.php ├── CheckCompatibilityRequest.php ├── CheckCompatibilityResponse.php ├── Client └── BetaAnalyticsDataClient.php ├── Cohort.php ├── CohortReportSettings.php ├── CohortSpec.php ├── CohortsRange.php ├── CohortsRange └── Granularity.php ├── Comparison.php ├── ComparisonMetadata.php ├── Compatibility.php ├── CreateAudienceExportRequest.php ├── DateRange.php ├── Dimension.php ├── DimensionCompatibility.php ├── DimensionExpression.php ├── DimensionExpression ├── CaseExpression.php └── ConcatenateExpression.php ├── DimensionHeader.php ├── DimensionMetadata.php ├── DimensionValue.php ├── Filter.php ├── Filter ├── BetweenFilter.php ├── EmptyFilter.php ├── InListFilter.php ├── NumericFilter.php ├── NumericFilter │ └── Operation.php ├── StringFilter.php └── StringFilter │ └── MatchType.php ├── FilterExpression.php ├── FilterExpressionList.php ├── GetAudienceExportRequest.php ├── GetMetadataRequest.php ├── ListAudienceExportsRequest.php ├── ListAudienceExportsResponse.php ├── Metadata.php ├── Metric.php ├── MetricAggregation.php ├── MetricCompatibility.php ├── MetricHeader.php ├── MetricMetadata.php ├── MetricMetadata └── BlockedReason.php ├── MetricType.php ├── MetricValue.php ├── MinuteRange.php ├── NumericValue.php ├── OrderBy.php ├── OrderBy ├── DimensionOrderBy.php ├── DimensionOrderBy │ └── OrderType.php ├── MetricOrderBy.php ├── PivotOrderBy.php └── PivotOrderBy │ └── PivotSelection.php ├── Pivot.php ├── PivotDimensionHeader.php ├── PivotHeader.php ├── PropertyQuota.php ├── QueryAudienceExportRequest.php ├── QueryAudienceExportResponse.php ├── QuotaStatus.php ├── ResponseMetaData.php ├── ResponseMetaData ├── SchemaRestrictionResponse.php └── SchemaRestrictionResponse │ └── ActiveMetricRestriction.php ├── RestrictedMetricType.php ├── Row.php ├── RunPivotReportRequest.php ├── RunPivotReportResponse.php ├── RunRealtimeReportRequest.php ├── RunRealtimeReportResponse.php ├── RunReportRequest.php ├── RunReportResponse.php ├── SamplingMetadata.php └── resources ├── beta_analytics_data_client_config.json ├── beta_analytics_data_descriptor_config.php └── beta_analytics_data_rest_client_config.php /.gitattributes: -------------------------------------------------------------------------------- 1 | /*.xml.dist export-ignore 2 | /tests export-ignore 3 | /.github export-ignore 4 | /samples export-ignore 5 | /.OwlBot.yaml export-ignore 6 | /owlbot.py export-ignore 7 | /src/**/gapic_metadata.json export-ignore 8 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Code of Conduct 2 | 3 | As contributors and maintainers of this project, 4 | and in the interest of fostering an open and welcoming community, 5 | we pledge to respect all people who contribute through reporting issues, 6 | posting feature requests, updating documentation, 7 | submitting pull requests or patches, and other activities. 8 | 9 | We are committed to making participation in this project 10 | a harassment-free experience for everyone, 11 | regardless of level of experience, gender, gender identity and expression, 12 | sexual orientation, disability, personal appearance, 13 | body size, race, ethnicity, age, religion, or nationality. 14 | 15 | Examples of unacceptable behavior by participants include: 16 | 17 | * The use of sexualized language or imagery 18 | * Personal attacks 19 | * Trolling or insulting/derogatory comments 20 | * Public or private harassment 21 | * Publishing other's private information, 22 | such as physical or electronic 23 | addresses, without explicit permission 24 | * Other unethical or unprofessional conduct. 25 | 26 | Project maintainers have the right and responsibility to remove, edit, or reject 27 | comments, commits, code, wiki edits, issues, and other contributions 28 | that are not aligned to this Code of Conduct. 29 | By adopting this Code of Conduct, 30 | project maintainers commit themselves to fairly and consistently 31 | applying these principles to every aspect of managing this project. 32 | Project maintainers who do not follow or enforce the Code of Conduct 33 | may be permanently removed from the project team. 34 | 35 | This code of conduct applies both within project spaces and in public spaces 36 | when an individual is representing the project or its community. 37 | 38 | Instances of abusive, harassing, or otherwise unacceptable behavior 39 | may be reported by opening an issue 40 | or contacting one or more of the project maintainers. 41 | 42 | This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.2.0, 43 | available at [http://contributor-covenant.org/version/1/2/0/](http://contributor-covenant.org/version/1/2/0/) -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # How to Contribute 2 | 3 | We'd love to accept your patches and contributions to this project. We accept 4 | and review pull requests against the main 5 | [Google Cloud PHP](https://github.com/googleapis/google-cloud-php) 6 | repository, which contains all of our client libraries. You will also need to 7 | sign a Contributor License Agreement. For more details about how to contribute, 8 | see the 9 | [CONTRIBUTING.md](https://github.com/googleapis/google-cloud-php/blob/main/CONTRIBUTING.md) 10 | file in the main Google Cloud PHP repository. 11 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Google Analytics Data for PHP 2 | 3 | > Idiomatic PHP client for [Google Analytics Data](https://analytics.google.com/analytics/web/provision/#/provision). 4 | 5 | [![Latest Stable Version](https://poser.pugx.org/google/analytics-data/v/stable)](https://packagist.org/packages/google/analytics-data) [![Packagist](https://img.shields.io/packagist/dm/google/analytics-data.svg)](https://packagist.org/packages/google/analytics-data) 6 | 7 | * [API documentation](https://cloud.google.com/php/docs/reference/analytics-data/latest) 8 | 9 | **NOTE:** This repository is part of [Google Cloud PHP](https://github.com/googleapis/google-cloud-php). Any 10 | support requests, bug reports, or development contributions should be directed to 11 | that project. 12 | 13 | ### Installation 14 | 15 | To begin, install the preferred dependency manager for PHP, [Composer](https://getcomposer.org/). 16 | 17 | Now install this component: 18 | 19 | ```sh 20 | $ composer require google/analytics-data 21 | ``` 22 | 23 | This component supports both REST over HTTP/1.1 and gRPC. In order to take advantage of the benefits offered by gRPC (such as streaming methods) 24 | please see our [gRPC installation guide](https://cloud.google.com/php/grpc). 25 | 26 | ### Authentication 27 | 28 | Please see our [Authentication guide](https://github.com/googleapis/google-cloud-php/blob/main/AUTHENTICATION.md) for more information 29 | on authenticating your client. Once authenticated, you'll be ready to start making requests. 30 | 31 | ### Sample 32 | 33 | ```php 34 | require 'vendor/autoload.php'; 35 | 36 | use Google\Analytics\Data\V1beta\Client\BetaAnalyticsDataClient; 37 | use Google\Analytics\Data\V1beta\RunReportRequest; 38 | 39 | $client = new BetaAnalyticsDataClient(); 40 | 41 | $request = new RunReportRequest([ 42 | 'property' => 'properties/[YOUR_PROPERTY_ID]' 43 | ]); 44 | $response = $client->runReport($request); 45 | 46 | foreach ($response->getRows() as $row) { 47 | foreach ($row->getDimensionValues() as $dimensionValue) { 48 | print 'Dimension Value: ' . $dimensionValue->getValue() . PHP_EOL; 49 | } 50 | } 51 | ``` 52 | 53 | ### Debugging 54 | 55 | Please see our [Debugging guide](https://github.com/googleapis/google-cloud-php/blob/main/DEBUG.md) 56 | for more information about the debugging tools. 57 | 58 | ### Version 59 | 60 | This component is considered beta. As such, it should be expected to be mostly 61 | stable and we're working towards a release candidate. We will address issues 62 | and requests with a higher priority. 63 | 64 | ### Next Steps 65 | 66 | 1. Understand the [official documentation](https://developers.google.com/analytics/devguides/reporting/data/v1). 67 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | To report a security issue, please use [g.co/vulnz](https://g.co/vulnz). 4 | 5 | The Google Security Team will respond within 5 working days of your report on g.co/vulnz. 6 | 7 | We use g.co/vulnz for our intake, and do coordination and disclosure here using GitHub Security Advisory to privately discuss and fix the issue. 8 | -------------------------------------------------------------------------------- /VERSION: -------------------------------------------------------------------------------- 1 | 0.22.2 2 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "google/analytics-data", 3 | "description": "Google Analytics Data Client for PHP", 4 | "license": "Apache-2.0", 5 | "minimum-stability": "stable", 6 | "autoload": { 7 | "psr-4": { 8 | "Google\\Analytics\\Data\\": "src", 9 | "GPBMetadata\\Google\\Analytics\\Data\\": "metadata" 10 | } 11 | }, 12 | "autoload-dev": { 13 | "psr-4": { 14 | "Google\\Analytics\\Data\\Tests\\": "tests" 15 | } 16 | }, 17 | "extra": { 18 | "component": { 19 | "id": "analytics-data", 20 | "path": "AnalyticsData", 21 | "entry": null, 22 | "target": "googleapis/php-analytics-data.git" 23 | } 24 | }, 25 | "require": { 26 | "php": "^8.0", 27 | "google/gax": "^1.36.0" 28 | }, 29 | "require-dev": { 30 | "phpunit/phpunit": "^9.0" 31 | }, 32 | "suggest": { 33 | "ext-grpc": "Enables use of gRPC, a universal high-performance RPC framework created by Google.", 34 | "ext-protobuf": "Provides a significant increase in throughput over the pure PHP protobuf implementation. See https://cloud.google.com/php/grpc for installation instructions." 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /metadata/V1Alpha/AnalyticsDataApi.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googleapis/php-analytics-data/7a86e7c07084055977fefec4aad9c23df5ed2d0d/metadata/V1Alpha/AnalyticsDataApi.php -------------------------------------------------------------------------------- /metadata/V1Alpha/Data.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googleapis/php-analytics-data/7a86e7c07084055977fefec4aad9c23df5ed2d0d/metadata/V1Alpha/Data.php -------------------------------------------------------------------------------- /metadata/V1Beta/AnalyticsDataApi.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googleapis/php-analytics-data/7a86e7c07084055977fefec4aad9c23df5ed2d0d/metadata/V1Beta/AnalyticsDataApi.php -------------------------------------------------------------------------------- /metadata/V1Beta/Data.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googleapis/php-analytics-data/7a86e7c07084055977fefec4aad9c23df5ed2d0d/metadata/V1Beta/Data.php -------------------------------------------------------------------------------- /src/V1alpha/AudienceDimension.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1alpha.AudienceDimension 16 | */ 17 | class AudienceDimension extends \Google\Protobuf\Internal\Message 18 | { 19 | /** 20 | * Optional. The API name of the dimension. See the [API 21 | * Dimensions](https://developers.google.com/analytics/devguides/reporting/data/v1/audience-list-api-schema#dimensions) 22 | * for the list of dimension names. 23 | * 24 | * Generated from protobuf field string dimension_name = 1 [(.google.api.field_behavior) = OPTIONAL]; 25 | */ 26 | protected $dimension_name = ''; 27 | 28 | /** 29 | * Constructor. 30 | * 31 | * @param array $data { 32 | * Optional. Data for populating the Message object. 33 | * 34 | * @type string $dimension_name 35 | * Optional. The API name of the dimension. See the [API 36 | * Dimensions](https://developers.google.com/analytics/devguides/reporting/data/v1/audience-list-api-schema#dimensions) 37 | * for the list of dimension names. 38 | * } 39 | */ 40 | public function __construct($data = NULL) { 41 | \GPBMetadata\Google\Analytics\Data\V1Alpha\AnalyticsDataApi::initOnce(); 42 | parent::__construct($data); 43 | } 44 | 45 | /** 46 | * Optional. The API name of the dimension. See the [API 47 | * Dimensions](https://developers.google.com/analytics/devguides/reporting/data/v1/audience-list-api-schema#dimensions) 48 | * for the list of dimension names. 49 | * 50 | * Generated from protobuf field string dimension_name = 1 [(.google.api.field_behavior) = OPTIONAL]; 51 | * @return string 52 | */ 53 | public function getDimensionName() 54 | { 55 | return $this->dimension_name; 56 | } 57 | 58 | /** 59 | * Optional. The API name of the dimension. See the [API 60 | * Dimensions](https://developers.google.com/analytics/devguides/reporting/data/v1/audience-list-api-schema#dimensions) 61 | * for the list of dimension names. 62 | * 63 | * Generated from protobuf field string dimension_name = 1 [(.google.api.field_behavior) = OPTIONAL]; 64 | * @param string $var 65 | * @return $this 66 | */ 67 | public function setDimensionName($var) 68 | { 69 | GPBUtil::checkString($var, True); 70 | $this->dimension_name = $var; 71 | 72 | return $this; 73 | } 74 | 75 | } 76 | 77 | -------------------------------------------------------------------------------- /src/V1alpha/AudienceDimensionValue.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1alpha.AudienceDimensionValue 15 | */ 16 | class AudienceDimensionValue extends \Google\Protobuf\Internal\Message 17 | { 18 | protected $one_value; 19 | 20 | /** 21 | * Constructor. 22 | * 23 | * @param array $data { 24 | * Optional. Data for populating the Message object. 25 | * 26 | * @type string $value 27 | * Value as a string if the dimension type is a string. 28 | * } 29 | */ 30 | public function __construct($data = NULL) { 31 | \GPBMetadata\Google\Analytics\Data\V1Alpha\AnalyticsDataApi::initOnce(); 32 | parent::__construct($data); 33 | } 34 | 35 | /** 36 | * Value as a string if the dimension type is a string. 37 | * 38 | * Generated from protobuf field string value = 1; 39 | * @return string 40 | */ 41 | public function getValue() 42 | { 43 | return $this->readOneof(1); 44 | } 45 | 46 | public function hasValue() 47 | { 48 | return $this->hasOneof(1); 49 | } 50 | 51 | /** 52 | * Value as a string if the dimension type is a string. 53 | * 54 | * Generated from protobuf field string value = 1; 55 | * @param string $var 56 | * @return $this 57 | */ 58 | public function setValue($var) 59 | { 60 | GPBUtil::checkString($var, True); 61 | $this->writeOneof(1, $var); 62 | 63 | return $this; 64 | } 65 | 66 | /** 67 | * @return string 68 | */ 69 | public function getOneValue() 70 | { 71 | return $this->whichOneof("one_value"); 72 | } 73 | 74 | } 75 | 76 | -------------------------------------------------------------------------------- /src/V1alpha/AudienceList/State.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1alpha.AudienceList.State 13 | */ 14 | class State 15 | { 16 | /** 17 | * Unspecified state will never be used. 18 | * 19 | * Generated from protobuf enum STATE_UNSPECIFIED = 0; 20 | */ 21 | const STATE_UNSPECIFIED = 0; 22 | /** 23 | * The AudienceList is currently creating and will be available in the 24 | * future. Creating occurs immediately after the CreateAudienceList call. 25 | * 26 | * Generated from protobuf enum CREATING = 1; 27 | */ 28 | const CREATING = 1; 29 | /** 30 | * The AudienceList is fully created and ready for querying. An AudienceList 31 | * is updated to active asynchronously from a request; this occurs some 32 | * time (for example 15 minutes) after the initial create call. 33 | * 34 | * Generated from protobuf enum ACTIVE = 2; 35 | */ 36 | const ACTIVE = 2; 37 | /** 38 | * The AudienceList failed to be created. It is possible that re-requesting 39 | * this audience list will succeed. 40 | * 41 | * Generated from protobuf enum FAILED = 3; 42 | */ 43 | const FAILED = 3; 44 | 45 | private static $valueToName = [ 46 | self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', 47 | self::CREATING => 'CREATING', 48 | self::ACTIVE => 'ACTIVE', 49 | self::FAILED => 'FAILED', 50 | ]; 51 | 52 | public static function name($value) 53 | { 54 | if (!isset(self::$valueToName[$value])) { 55 | throw new UnexpectedValueException(sprintf( 56 | 'Enum %s has no name defined for value %s', __CLASS__, $value)); 57 | } 58 | return self::$valueToName[$value]; 59 | } 60 | 61 | 62 | public static function value($name) 63 | { 64 | $const = __CLASS__ . '::' . strtoupper($name); 65 | if (!defined($const)) { 66 | throw new UnexpectedValueException(sprintf( 67 | 'Enum %s has no value defined for name %s', __CLASS__, $name)); 68 | } 69 | return constant($const); 70 | } 71 | } 72 | 73 | 74 | -------------------------------------------------------------------------------- /src/V1alpha/AudienceListMetadata.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1alpha.AudienceListMetadata 15 | */ 16 | class AudienceListMetadata extends \Google\Protobuf\Internal\Message 17 | { 18 | 19 | /** 20 | * Constructor. 21 | * 22 | * @param array $data { 23 | * Optional. Data for populating the Message object. 24 | * 25 | * } 26 | */ 27 | public function __construct($data = NULL) { 28 | \GPBMetadata\Google\Analytics\Data\V1Alpha\AnalyticsDataApi::initOnce(); 29 | parent::__construct($data); 30 | } 31 | 32 | } 33 | 34 | -------------------------------------------------------------------------------- /src/V1alpha/AudienceRow.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1alpha.AudienceRow 15 | */ 16 | class AudienceRow extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * Each dimension value attribute for an audience user. One dimension value 20 | * will be added for each dimension column requested. 21 | * 22 | * Generated from protobuf field repeated .google.analytics.data.v1alpha.AudienceDimensionValue dimension_values = 1; 23 | */ 24 | private $dimension_values; 25 | 26 | /** 27 | * Constructor. 28 | * 29 | * @param array $data { 30 | * Optional. Data for populating the Message object. 31 | * 32 | * @type array<\Google\Analytics\Data\V1alpha\AudienceDimensionValue>|\Google\Protobuf\Internal\RepeatedField $dimension_values 33 | * Each dimension value attribute for an audience user. One dimension value 34 | * will be added for each dimension column requested. 35 | * } 36 | */ 37 | public function __construct($data = NULL) { 38 | \GPBMetadata\Google\Analytics\Data\V1Alpha\AnalyticsDataApi::initOnce(); 39 | parent::__construct($data); 40 | } 41 | 42 | /** 43 | * Each dimension value attribute for an audience user. One dimension value 44 | * will be added for each dimension column requested. 45 | * 46 | * Generated from protobuf field repeated .google.analytics.data.v1alpha.AudienceDimensionValue dimension_values = 1; 47 | * @return \Google\Protobuf\Internal\RepeatedField 48 | */ 49 | public function getDimensionValues() 50 | { 51 | return $this->dimension_values; 52 | } 53 | 54 | /** 55 | * Each dimension value attribute for an audience user. One dimension value 56 | * will be added for each dimension column requested. 57 | * 58 | * Generated from protobuf field repeated .google.analytics.data.v1alpha.AudienceDimensionValue dimension_values = 1; 59 | * @param array<\Google\Analytics\Data\V1alpha\AudienceDimensionValue>|\Google\Protobuf\Internal\RepeatedField $var 60 | * @return $this 61 | */ 62 | public function setDimensionValues($var) 63 | { 64 | $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Analytics\Data\V1alpha\AudienceDimensionValue::class); 65 | $this->dimension_values = $arr; 66 | 67 | return $this; 68 | } 69 | 70 | } 71 | 72 | -------------------------------------------------------------------------------- /src/V1alpha/BetweenFilter.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1alpha.BetweenFilter 15 | */ 16 | class BetweenFilter extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * Begins with this number. 20 | * 21 | * Generated from protobuf field .google.analytics.data.v1alpha.NumericValue from_value = 1; 22 | */ 23 | protected $from_value = null; 24 | /** 25 | * Ends with this number. 26 | * 27 | * Generated from protobuf field .google.analytics.data.v1alpha.NumericValue to_value = 2; 28 | */ 29 | protected $to_value = null; 30 | 31 | /** 32 | * Constructor. 33 | * 34 | * @param array $data { 35 | * Optional. Data for populating the Message object. 36 | * 37 | * @type \Google\Analytics\Data\V1alpha\NumericValue $from_value 38 | * Begins with this number. 39 | * @type \Google\Analytics\Data\V1alpha\NumericValue $to_value 40 | * Ends with this number. 41 | * } 42 | */ 43 | public function __construct($data = NULL) { 44 | \GPBMetadata\Google\Analytics\Data\V1Alpha\Data::initOnce(); 45 | parent::__construct($data); 46 | } 47 | 48 | /** 49 | * Begins with this number. 50 | * 51 | * Generated from protobuf field .google.analytics.data.v1alpha.NumericValue from_value = 1; 52 | * @return \Google\Analytics\Data\V1alpha\NumericValue|null 53 | */ 54 | public function getFromValue() 55 | { 56 | return $this->from_value; 57 | } 58 | 59 | public function hasFromValue() 60 | { 61 | return isset($this->from_value); 62 | } 63 | 64 | public function clearFromValue() 65 | { 66 | unset($this->from_value); 67 | } 68 | 69 | /** 70 | * Begins with this number. 71 | * 72 | * Generated from protobuf field .google.analytics.data.v1alpha.NumericValue from_value = 1; 73 | * @param \Google\Analytics\Data\V1alpha\NumericValue $var 74 | * @return $this 75 | */ 76 | public function setFromValue($var) 77 | { 78 | GPBUtil::checkMessage($var, \Google\Analytics\Data\V1alpha\NumericValue::class); 79 | $this->from_value = $var; 80 | 81 | return $this; 82 | } 83 | 84 | /** 85 | * Ends with this number. 86 | * 87 | * Generated from protobuf field .google.analytics.data.v1alpha.NumericValue to_value = 2; 88 | * @return \Google\Analytics\Data\V1alpha\NumericValue|null 89 | */ 90 | public function getToValue() 91 | { 92 | return $this->to_value; 93 | } 94 | 95 | public function hasToValue() 96 | { 97 | return isset($this->to_value); 98 | } 99 | 100 | public function clearToValue() 101 | { 102 | unset($this->to_value); 103 | } 104 | 105 | /** 106 | * Ends with this number. 107 | * 108 | * Generated from protobuf field .google.analytics.data.v1alpha.NumericValue to_value = 2; 109 | * @param \Google\Analytics\Data\V1alpha\NumericValue $var 110 | * @return $this 111 | */ 112 | public function setToValue($var) 113 | { 114 | GPBUtil::checkMessage($var, \Google\Analytics\Data\V1alpha\NumericValue::class); 115 | $this->to_value = $var; 116 | 117 | return $this; 118 | } 119 | 120 | } 121 | 122 | -------------------------------------------------------------------------------- /src/V1alpha/CohortReportSettings.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1alpha.CohortReportSettings 15 | */ 16 | class CohortReportSettings extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * If true, accumulates the result from first touch day to the end day. Not 20 | * supported in `RunReportRequest`. 21 | * 22 | * Generated from protobuf field bool accumulate = 1; 23 | */ 24 | protected $accumulate = false; 25 | 26 | /** 27 | * Constructor. 28 | * 29 | * @param array $data { 30 | * Optional. Data for populating the Message object. 31 | * 32 | * @type bool $accumulate 33 | * If true, accumulates the result from first touch day to the end day. Not 34 | * supported in `RunReportRequest`. 35 | * } 36 | */ 37 | public function __construct($data = NULL) { 38 | \GPBMetadata\Google\Analytics\Data\V1Alpha\Data::initOnce(); 39 | parent::__construct($data); 40 | } 41 | 42 | /** 43 | * If true, accumulates the result from first touch day to the end day. Not 44 | * supported in `RunReportRequest`. 45 | * 46 | * Generated from protobuf field bool accumulate = 1; 47 | * @return bool 48 | */ 49 | public function getAccumulate() 50 | { 51 | return $this->accumulate; 52 | } 53 | 54 | /** 55 | * If true, accumulates the result from first touch day to the end day. Not 56 | * supported in `RunReportRequest`. 57 | * 58 | * Generated from protobuf field bool accumulate = 1; 59 | * @param bool $var 60 | * @return $this 61 | */ 62 | public function setAccumulate($var) 63 | { 64 | GPBUtil::checkBool($var); 65 | $this->accumulate = $var; 66 | 67 | return $this; 68 | } 69 | 70 | } 71 | 72 | -------------------------------------------------------------------------------- /src/V1alpha/CohortsRange/Granularity.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1alpha.CohortsRange.Granularity 14 | */ 15 | class Granularity 16 | { 17 | /** 18 | * Should never be specified. 19 | * 20 | * Generated from protobuf enum GRANULARITY_UNSPECIFIED = 0; 21 | */ 22 | const GRANULARITY_UNSPECIFIED = 0; 23 | /** 24 | * Daily granularity. Commonly used if the cohort's `dateRange` is a single 25 | * day and the request contains `cohortNthDay`. 26 | * 27 | * Generated from protobuf enum DAILY = 1; 28 | */ 29 | const DAILY = 1; 30 | /** 31 | * Weekly granularity. Commonly used if the cohort's `dateRange` is a week 32 | * in duration (starting on Sunday and ending on Saturday) and the request 33 | * contains `cohortNthWeek`. 34 | * 35 | * Generated from protobuf enum WEEKLY = 2; 36 | */ 37 | const WEEKLY = 2; 38 | /** 39 | * Monthly granularity. Commonly used if the cohort's `dateRange` is a month 40 | * in duration and the request contains `cohortNthMonth`. 41 | * 42 | * Generated from protobuf enum MONTHLY = 3; 43 | */ 44 | const MONTHLY = 3; 45 | 46 | private static $valueToName = [ 47 | self::GRANULARITY_UNSPECIFIED => 'GRANULARITY_UNSPECIFIED', 48 | self::DAILY => 'DAILY', 49 | self::WEEKLY => 'WEEKLY', 50 | self::MONTHLY => 'MONTHLY', 51 | ]; 52 | 53 | public static function name($value) 54 | { 55 | if (!isset(self::$valueToName[$value])) { 56 | throw new UnexpectedValueException(sprintf( 57 | 'Enum %s has no name defined for value %s', __CLASS__, $value)); 58 | } 59 | return self::$valueToName[$value]; 60 | } 61 | 62 | 63 | public static function value($name) 64 | { 65 | $const = __CLASS__ . '::' . strtoupper($name); 66 | if (!defined($const)) { 67 | throw new UnexpectedValueException(sprintf( 68 | 'Enum %s has no value defined for name %s', __CLASS__, $name)); 69 | } 70 | return constant($const); 71 | } 72 | } 73 | 74 | 75 | -------------------------------------------------------------------------------- /src/V1alpha/DimensionExpression/CaseExpression.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1alpha.DimensionExpression.CaseExpression 15 | */ 16 | class CaseExpression extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * Name of a dimension. The name must refer back to a name in dimensions 20 | * field of the request. 21 | * 22 | * Generated from protobuf field string dimension_name = 1; 23 | */ 24 | protected $dimension_name = ''; 25 | 26 | /** 27 | * Constructor. 28 | * 29 | * @param array $data { 30 | * Optional. Data for populating the Message object. 31 | * 32 | * @type string $dimension_name 33 | * Name of a dimension. The name must refer back to a name in dimensions 34 | * field of the request. 35 | * } 36 | */ 37 | public function __construct($data = NULL) { 38 | \GPBMetadata\Google\Analytics\Data\V1Alpha\Data::initOnce(); 39 | parent::__construct($data); 40 | } 41 | 42 | /** 43 | * Name of a dimension. The name must refer back to a name in dimensions 44 | * field of the request. 45 | * 46 | * Generated from protobuf field string dimension_name = 1; 47 | * @return string 48 | */ 49 | public function getDimensionName() 50 | { 51 | return $this->dimension_name; 52 | } 53 | 54 | /** 55 | * Name of a dimension. The name must refer back to a name in dimensions 56 | * field of the request. 57 | * 58 | * Generated from protobuf field string dimension_name = 1; 59 | * @param string $var 60 | * @return $this 61 | */ 62 | public function setDimensionName($var) 63 | { 64 | GPBUtil::checkString($var, True); 65 | $this->dimension_name = $var; 66 | 67 | return $this; 68 | } 69 | 70 | } 71 | 72 | 73 | -------------------------------------------------------------------------------- /src/V1alpha/DimensionHeader.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1alpha.DimensionHeader 18 | */ 19 | class DimensionHeader extends \Google\Protobuf\Internal\Message 20 | { 21 | /** 22 | * The dimension's name. 23 | * 24 | * Generated from protobuf field string name = 1; 25 | */ 26 | protected $name = ''; 27 | 28 | /** 29 | * Constructor. 30 | * 31 | * @param array $data { 32 | * Optional. Data for populating the Message object. 33 | * 34 | * @type string $name 35 | * The dimension's name. 36 | * } 37 | */ 38 | public function __construct($data = NULL) { 39 | \GPBMetadata\Google\Analytics\Data\V1Alpha\Data::initOnce(); 40 | parent::__construct($data); 41 | } 42 | 43 | /** 44 | * The dimension's name. 45 | * 46 | * Generated from protobuf field string name = 1; 47 | * @return string 48 | */ 49 | public function getName() 50 | { 51 | return $this->name; 52 | } 53 | 54 | /** 55 | * The dimension's name. 56 | * 57 | * Generated from protobuf field string name = 1; 58 | * @param string $var 59 | * @return $this 60 | */ 61 | public function setName($var) 62 | { 63 | GPBUtil::checkString($var, True); 64 | $this->name = $var; 65 | 66 | return $this; 67 | } 68 | 69 | } 70 | 71 | -------------------------------------------------------------------------------- /src/V1alpha/DimensionValue.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1alpha.DimensionValue 15 | */ 16 | class DimensionValue extends \Google\Protobuf\Internal\Message 17 | { 18 | protected $one_value; 19 | 20 | /** 21 | * Constructor. 22 | * 23 | * @param array $data { 24 | * Optional. Data for populating the Message object. 25 | * 26 | * @type string $value 27 | * Value as a string if the dimension type is a string. 28 | * } 29 | */ 30 | public function __construct($data = NULL) { 31 | \GPBMetadata\Google\Analytics\Data\V1Alpha\Data::initOnce(); 32 | parent::__construct($data); 33 | } 34 | 35 | /** 36 | * Value as a string if the dimension type is a string. 37 | * 38 | * Generated from protobuf field string value = 1; 39 | * @return string 40 | */ 41 | public function getValue() 42 | { 43 | return $this->readOneof(1); 44 | } 45 | 46 | public function hasValue() 47 | { 48 | return $this->hasOneof(1); 49 | } 50 | 51 | /** 52 | * Value as a string if the dimension type is a string. 53 | * 54 | * Generated from protobuf field string value = 1; 55 | * @param string $var 56 | * @return $this 57 | */ 58 | public function setValue($var) 59 | { 60 | GPBUtil::checkString($var, True); 61 | $this->writeOneof(1, $var); 62 | 63 | return $this; 64 | } 65 | 66 | /** 67 | * @return string 68 | */ 69 | public function getOneValue() 70 | { 71 | return $this->whichOneof("one_value"); 72 | } 73 | 74 | } 75 | 76 | -------------------------------------------------------------------------------- /src/V1alpha/EmptyFilter.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1alpha.EmptyFilter 15 | */ 16 | class EmptyFilter extends \Google\Protobuf\Internal\Message 17 | { 18 | 19 | /** 20 | * Constructor. 21 | * 22 | * @param array $data { 23 | * Optional. Data for populating the Message object. 24 | * 25 | * } 26 | */ 27 | public function __construct($data = NULL) { 28 | \GPBMetadata\Google\Analytics\Data\V1Alpha\Data::initOnce(); 29 | parent::__construct($data); 30 | } 31 | 32 | } 33 | 34 | -------------------------------------------------------------------------------- /src/V1alpha/EventCriteriaScoping.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1alpha.EventCriteriaScoping 14 | */ 15 | class EventCriteriaScoping 16 | { 17 | /** 18 | * Unspecified criteria scoping. Do not specify. 19 | * 20 | * Generated from protobuf enum EVENT_CRITERIA_SCOPING_UNSPECIFIED = 0; 21 | */ 22 | const EVENT_CRITERIA_SCOPING_UNSPECIFIED = 0; 23 | /** 24 | * If the criteria is satisfied within one event, the event matches the 25 | * criteria. 26 | * 27 | * Generated from protobuf enum EVENT_CRITERIA_WITHIN_SAME_EVENT = 1; 28 | */ 29 | const EVENT_CRITERIA_WITHIN_SAME_EVENT = 1; 30 | 31 | private static $valueToName = [ 32 | self::EVENT_CRITERIA_SCOPING_UNSPECIFIED => 'EVENT_CRITERIA_SCOPING_UNSPECIFIED', 33 | self::EVENT_CRITERIA_WITHIN_SAME_EVENT => 'EVENT_CRITERIA_WITHIN_SAME_EVENT', 34 | ]; 35 | 36 | public static function name($value) 37 | { 38 | if (!isset(self::$valueToName[$value])) { 39 | throw new UnexpectedValueException(sprintf( 40 | 'Enum %s has no name defined for value %s', __CLASS__, $value)); 41 | } 42 | return self::$valueToName[$value]; 43 | } 44 | 45 | 46 | public static function value($name) 47 | { 48 | $const = __CLASS__ . '::' . strtoupper($name); 49 | if (!defined($const)) { 50 | throw new UnexpectedValueException(sprintf( 51 | 'Enum %s has no value defined for name %s', __CLASS__, $name)); 52 | } 53 | return constant($const); 54 | } 55 | } 56 | 57 | -------------------------------------------------------------------------------- /src/V1alpha/EventExclusionDuration.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1alpha.EventExclusionDuration 14 | */ 15 | class EventExclusionDuration 16 | { 17 | /** 18 | * Unspecified exclusion duration. Do not specify. 19 | * 20 | * Generated from protobuf enum EVENT_EXCLUSION_DURATION_UNSPECIFIED = 0; 21 | */ 22 | const EVENT_EXCLUSION_DURATION_UNSPECIFIED = 0; 23 | /** 24 | * Permanently exclude events from the segment if the event ever meets 25 | * the `eventExclusionCriteria` condition. 26 | * 27 | * Generated from protobuf enum EVENT_EXCLUSION_PERMANENT = 1; 28 | */ 29 | const EVENT_EXCLUSION_PERMANENT = 1; 30 | 31 | private static $valueToName = [ 32 | self::EVENT_EXCLUSION_DURATION_UNSPECIFIED => 'EVENT_EXCLUSION_DURATION_UNSPECIFIED', 33 | self::EVENT_EXCLUSION_PERMANENT => 'EVENT_EXCLUSION_PERMANENT', 34 | ]; 35 | 36 | public static function name($value) 37 | { 38 | if (!isset(self::$valueToName[$value])) { 39 | throw new UnexpectedValueException(sprintf( 40 | 'Enum %s has no name defined for value %s', __CLASS__, $value)); 41 | } 42 | return self::$valueToName[$value]; 43 | } 44 | 45 | 46 | public static function value($name) 47 | { 48 | $const = __CLASS__ . '::' . strtoupper($name); 49 | if (!defined($const)) { 50 | throw new UnexpectedValueException(sprintf( 51 | 'Enum %s has no value defined for name %s', __CLASS__, $name)); 52 | } 53 | return constant($const); 54 | } 55 | } 56 | 57 | -------------------------------------------------------------------------------- /src/V1alpha/EventSegmentCriteria.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1alpha.EventSegmentCriteria 16 | */ 17 | class EventSegmentCriteria extends \Google\Protobuf\Internal\Message 18 | { 19 | /** 20 | * An event matches this criteria if the event matches each of these 21 | * `andConditionGroups`. 22 | * 23 | * Generated from protobuf field repeated .google.analytics.data.v1alpha.EventSegmentConditionGroup and_condition_groups = 1; 24 | */ 25 | private $and_condition_groups; 26 | 27 | /** 28 | * Constructor. 29 | * 30 | * @param array $data { 31 | * Optional. Data for populating the Message object. 32 | * 33 | * @type array<\Google\Analytics\Data\V1alpha\EventSegmentConditionGroup>|\Google\Protobuf\Internal\RepeatedField $and_condition_groups 34 | * An event matches this criteria if the event matches each of these 35 | * `andConditionGroups`. 36 | * } 37 | */ 38 | public function __construct($data = NULL) { 39 | \GPBMetadata\Google\Analytics\Data\V1Alpha\Data::initOnce(); 40 | parent::__construct($data); 41 | } 42 | 43 | /** 44 | * An event matches this criteria if the event matches each of these 45 | * `andConditionGroups`. 46 | * 47 | * Generated from protobuf field repeated .google.analytics.data.v1alpha.EventSegmentConditionGroup and_condition_groups = 1; 48 | * @return \Google\Protobuf\Internal\RepeatedField 49 | */ 50 | public function getAndConditionGroups() 51 | { 52 | return $this->and_condition_groups; 53 | } 54 | 55 | /** 56 | * An event matches this criteria if the event matches each of these 57 | * `andConditionGroups`. 58 | * 59 | * Generated from protobuf field repeated .google.analytics.data.v1alpha.EventSegmentConditionGroup and_condition_groups = 1; 60 | * @param array<\Google\Analytics\Data\V1alpha\EventSegmentConditionGroup>|\Google\Protobuf\Internal\RepeatedField $var 61 | * @return $this 62 | */ 63 | public function setAndConditionGroups($var) 64 | { 65 | $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Analytics\Data\V1alpha\EventSegmentConditionGroup::class); 66 | $this->and_condition_groups = $arr; 67 | 68 | return $this; 69 | } 70 | 71 | } 72 | 73 | -------------------------------------------------------------------------------- /src/V1alpha/FilterExpressionList.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1alpha.FilterExpressionList 15 | */ 16 | class FilterExpressionList extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * A list of filter expressions. 20 | * 21 | * Generated from protobuf field repeated .google.analytics.data.v1alpha.FilterExpression expressions = 1; 22 | */ 23 | private $expressions; 24 | 25 | /** 26 | * Constructor. 27 | * 28 | * @param array $data { 29 | * Optional. Data for populating the Message object. 30 | * 31 | * @type array<\Google\Analytics\Data\V1alpha\FilterExpression>|\Google\Protobuf\Internal\RepeatedField $expressions 32 | * A list of filter expressions. 33 | * } 34 | */ 35 | public function __construct($data = NULL) { 36 | \GPBMetadata\Google\Analytics\Data\V1Alpha\Data::initOnce(); 37 | parent::__construct($data); 38 | } 39 | 40 | /** 41 | * A list of filter expressions. 42 | * 43 | * Generated from protobuf field repeated .google.analytics.data.v1alpha.FilterExpression expressions = 1; 44 | * @return \Google\Protobuf\Internal\RepeatedField 45 | */ 46 | public function getExpressions() 47 | { 48 | return $this->expressions; 49 | } 50 | 51 | /** 52 | * A list of filter expressions. 53 | * 54 | * Generated from protobuf field repeated .google.analytics.data.v1alpha.FilterExpression expressions = 1; 55 | * @param array<\Google\Analytics\Data\V1alpha\FilterExpression>|\Google\Protobuf\Internal\RepeatedField $var 56 | * @return $this 57 | */ 58 | public function setExpressions($var) 59 | { 60 | $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Analytics\Data\V1alpha\FilterExpression::class); 61 | $this->expressions = $arr; 62 | 63 | return $this; 64 | } 65 | 66 | } 67 | 68 | -------------------------------------------------------------------------------- /src/V1alpha/FunnelFilterExpressionList.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1alpha.FunnelFilterExpressionList 15 | */ 16 | class FunnelFilterExpressionList extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * The list of funnel filter expressions. 20 | * 21 | * Generated from protobuf field repeated .google.analytics.data.v1alpha.FunnelFilterExpression expressions = 1; 22 | */ 23 | private $expressions; 24 | 25 | /** 26 | * Constructor. 27 | * 28 | * @param array $data { 29 | * Optional. Data for populating the Message object. 30 | * 31 | * @type array<\Google\Analytics\Data\V1alpha\FunnelFilterExpression>|\Google\Protobuf\Internal\RepeatedField $expressions 32 | * The list of funnel filter expressions. 33 | * } 34 | */ 35 | public function __construct($data = NULL) { 36 | \GPBMetadata\Google\Analytics\Data\V1Alpha\Data::initOnce(); 37 | parent::__construct($data); 38 | } 39 | 40 | /** 41 | * The list of funnel filter expressions. 42 | * 43 | * Generated from protobuf field repeated .google.analytics.data.v1alpha.FunnelFilterExpression expressions = 1; 44 | * @return \Google\Protobuf\Internal\RepeatedField 45 | */ 46 | public function getExpressions() 47 | { 48 | return $this->expressions; 49 | } 50 | 51 | /** 52 | * The list of funnel filter expressions. 53 | * 54 | * Generated from protobuf field repeated .google.analytics.data.v1alpha.FunnelFilterExpression expressions = 1; 55 | * @param array<\Google\Analytics\Data\V1alpha\FunnelFilterExpression>|\Google\Protobuf\Internal\RepeatedField $var 56 | * @return $this 57 | */ 58 | public function setExpressions($var) 59 | { 60 | $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Analytics\Data\V1alpha\FunnelFilterExpression::class); 61 | $this->expressions = $arr; 62 | 63 | return $this; 64 | } 65 | 66 | } 67 | 68 | -------------------------------------------------------------------------------- /src/V1alpha/FunnelParameterFilterExpressionList.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1alpha.FunnelParameterFilterExpressionList 15 | */ 16 | class FunnelParameterFilterExpressionList extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * The list of funnel parameter filter expressions. 20 | * 21 | * Generated from protobuf field repeated .google.analytics.data.v1alpha.FunnelParameterFilterExpression expressions = 1; 22 | */ 23 | private $expressions; 24 | 25 | /** 26 | * Constructor. 27 | * 28 | * @param array $data { 29 | * Optional. Data for populating the Message object. 30 | * 31 | * @type array<\Google\Analytics\Data\V1alpha\FunnelParameterFilterExpression>|\Google\Protobuf\Internal\RepeatedField $expressions 32 | * The list of funnel parameter filter expressions. 33 | * } 34 | */ 35 | public function __construct($data = NULL) { 36 | \GPBMetadata\Google\Analytics\Data\V1Alpha\Data::initOnce(); 37 | parent::__construct($data); 38 | } 39 | 40 | /** 41 | * The list of funnel parameter filter expressions. 42 | * 43 | * Generated from protobuf field repeated .google.analytics.data.v1alpha.FunnelParameterFilterExpression expressions = 1; 44 | * @return \Google\Protobuf\Internal\RepeatedField 45 | */ 46 | public function getExpressions() 47 | { 48 | return $this->expressions; 49 | } 50 | 51 | /** 52 | * The list of funnel parameter filter expressions. 53 | * 54 | * Generated from protobuf field repeated .google.analytics.data.v1alpha.FunnelParameterFilterExpression expressions = 1; 55 | * @param array<\Google\Analytics\Data\V1alpha\FunnelParameterFilterExpression>|\Google\Protobuf\Internal\RepeatedField $var 56 | * @return $this 57 | */ 58 | public function setExpressions($var) 59 | { 60 | $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Analytics\Data\V1alpha\FunnelParameterFilterExpression::class); 61 | $this->expressions = $arr; 62 | 63 | return $this; 64 | } 65 | 66 | } 67 | 68 | -------------------------------------------------------------------------------- /src/V1alpha/GetAudienceListRequest.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1alpha.GetAudienceListRequest 15 | */ 16 | class GetAudienceListRequest extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * Required. The audience list resource name. 20 | * Format: `properties/{property}/audienceLists/{audience_list}` 21 | * 22 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 23 | */ 24 | protected $name = ''; 25 | 26 | /** 27 | * @param string $name Required. The audience list resource name. 28 | * Format: `properties/{property}/audienceLists/{audience_list}` 29 | * Please see {@see AlphaAnalyticsDataClient::audienceListName()} for help formatting this field. 30 | * 31 | * @return \Google\Analytics\Data\V1alpha\GetAudienceListRequest 32 | * 33 | * @experimental 34 | */ 35 | public static function build(string $name): self 36 | { 37 | return (new self()) 38 | ->setName($name); 39 | } 40 | 41 | /** 42 | * Constructor. 43 | * 44 | * @param array $data { 45 | * Optional. Data for populating the Message object. 46 | * 47 | * @type string $name 48 | * Required. The audience list resource name. 49 | * Format: `properties/{property}/audienceLists/{audience_list}` 50 | * } 51 | */ 52 | public function __construct($data = NULL) { 53 | \GPBMetadata\Google\Analytics\Data\V1Alpha\AnalyticsDataApi::initOnce(); 54 | parent::__construct($data); 55 | } 56 | 57 | /** 58 | * Required. The audience list resource name. 59 | * Format: `properties/{property}/audienceLists/{audience_list}` 60 | * 61 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 62 | * @return string 63 | */ 64 | public function getName() 65 | { 66 | return $this->name; 67 | } 68 | 69 | /** 70 | * Required. The audience list resource name. 71 | * Format: `properties/{property}/audienceLists/{audience_list}` 72 | * 73 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 74 | * @param string $var 75 | * @return $this 76 | */ 77 | public function setName($var) 78 | { 79 | GPBUtil::checkString($var, True); 80 | $this->name = $var; 81 | 82 | return $this; 83 | } 84 | 85 | } 86 | 87 | -------------------------------------------------------------------------------- /src/V1alpha/GetPropertyQuotasSnapshotRequest.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1alpha.GetPropertyQuotasSnapshotRequest 15 | */ 16 | class GetPropertyQuotasSnapshotRequest extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * Required. Quotas from this property will be listed in the response. 20 | * Format: `properties/{property}/propertyQuotasSnapshot` 21 | * 22 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 23 | */ 24 | protected $name = ''; 25 | 26 | /** 27 | * @param string $name Required. Quotas from this property will be listed in the response. 28 | * Format: `properties/{property}/propertyQuotasSnapshot` 29 | * Please see {@see AlphaAnalyticsDataClient::propertyQuotasSnapshotName()} for help formatting this field. 30 | * 31 | * @return \Google\Analytics\Data\V1alpha\GetPropertyQuotasSnapshotRequest 32 | * 33 | * @experimental 34 | */ 35 | public static function build(string $name): self 36 | { 37 | return (new self()) 38 | ->setName($name); 39 | } 40 | 41 | /** 42 | * Constructor. 43 | * 44 | * @param array $data { 45 | * Optional. Data for populating the Message object. 46 | * 47 | * @type string $name 48 | * Required. Quotas from this property will be listed in the response. 49 | * Format: `properties/{property}/propertyQuotasSnapshot` 50 | * } 51 | */ 52 | public function __construct($data = NULL) { 53 | \GPBMetadata\Google\Analytics\Data\V1Alpha\AnalyticsDataApi::initOnce(); 54 | parent::__construct($data); 55 | } 56 | 57 | /** 58 | * Required. Quotas from this property will be listed in the response. 59 | * Format: `properties/{property}/propertyQuotasSnapshot` 60 | * 61 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 62 | * @return string 63 | */ 64 | public function getName() 65 | { 66 | return $this->name; 67 | } 68 | 69 | /** 70 | * Required. Quotas from this property will be listed in the response. 71 | * Format: `properties/{property}/propertyQuotasSnapshot` 72 | * 73 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 74 | * @param string $var 75 | * @return $this 76 | */ 77 | public function setName($var) 78 | { 79 | GPBUtil::checkString($var, True); 80 | $this->name = $var; 81 | 82 | return $this; 83 | } 84 | 85 | } 86 | 87 | -------------------------------------------------------------------------------- /src/V1alpha/GetRecurringAudienceListRequest.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1alpha.GetRecurringAudienceListRequest 16 | */ 17 | class GetRecurringAudienceListRequest extends \Google\Protobuf\Internal\Message 18 | { 19 | /** 20 | * Required. The recurring audience list resource name. 21 | * Format: 22 | * `properties/{property}/recurringAudienceLists/{recurring_audience_list}` 23 | * 24 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 25 | */ 26 | protected $name = ''; 27 | 28 | /** 29 | * @param string $name Required. The recurring audience list resource name. 30 | * Format: 31 | * `properties/{property}/recurringAudienceLists/{recurring_audience_list}` 32 | * Please see {@see AlphaAnalyticsDataClient::recurringAudienceListName()} for help formatting this field. 33 | * 34 | * @return \Google\Analytics\Data\V1alpha\GetRecurringAudienceListRequest 35 | * 36 | * @experimental 37 | */ 38 | public static function build(string $name): self 39 | { 40 | return (new self()) 41 | ->setName($name); 42 | } 43 | 44 | /** 45 | * Constructor. 46 | * 47 | * @param array $data { 48 | * Optional. Data for populating the Message object. 49 | * 50 | * @type string $name 51 | * Required. The recurring audience list resource name. 52 | * Format: 53 | * `properties/{property}/recurringAudienceLists/{recurring_audience_list}` 54 | * } 55 | */ 56 | public function __construct($data = NULL) { 57 | \GPBMetadata\Google\Analytics\Data\V1Alpha\AnalyticsDataApi::initOnce(); 58 | parent::__construct($data); 59 | } 60 | 61 | /** 62 | * Required. The recurring audience list resource name. 63 | * Format: 64 | * `properties/{property}/recurringAudienceLists/{recurring_audience_list}` 65 | * 66 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 67 | * @return string 68 | */ 69 | public function getName() 70 | { 71 | return $this->name; 72 | } 73 | 74 | /** 75 | * Required. The recurring audience list resource name. 76 | * Format: 77 | * `properties/{property}/recurringAudienceLists/{recurring_audience_list}` 78 | * 79 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 80 | * @param string $var 81 | * @return $this 82 | */ 83 | public function setName($var) 84 | { 85 | GPBUtil::checkString($var, True); 86 | $this->name = $var; 87 | 88 | return $this; 89 | } 90 | 91 | } 92 | 93 | -------------------------------------------------------------------------------- /src/V1alpha/GetReportTaskRequest.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1alpha.GetReportTaskRequest 15 | */ 16 | class GetReportTaskRequest extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * Required. The report task resource name. 20 | * Format: `properties/{property}/reportTasks/{report_task}` 21 | * 22 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 23 | */ 24 | protected $name = ''; 25 | 26 | /** 27 | * @param string $name Required. The report task resource name. 28 | * Format: `properties/{property}/reportTasks/{report_task}` 29 | * Please see {@see AlphaAnalyticsDataClient::reportTaskName()} for help formatting this field. 30 | * 31 | * @return \Google\Analytics\Data\V1alpha\GetReportTaskRequest 32 | * 33 | * @experimental 34 | */ 35 | public static function build(string $name): self 36 | { 37 | return (new self()) 38 | ->setName($name); 39 | } 40 | 41 | /** 42 | * Constructor. 43 | * 44 | * @param array $data { 45 | * Optional. Data for populating the Message object. 46 | * 47 | * @type string $name 48 | * Required. The report task resource name. 49 | * Format: `properties/{property}/reportTasks/{report_task}` 50 | * } 51 | */ 52 | public function __construct($data = NULL) { 53 | \GPBMetadata\Google\Analytics\Data\V1Alpha\AnalyticsDataApi::initOnce(); 54 | parent::__construct($data); 55 | } 56 | 57 | /** 58 | * Required. The report task resource name. 59 | * Format: `properties/{property}/reportTasks/{report_task}` 60 | * 61 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 62 | * @return string 63 | */ 64 | public function getName() 65 | { 66 | return $this->name; 67 | } 68 | 69 | /** 70 | * Required. The report task resource name. 71 | * Format: `properties/{property}/reportTasks/{report_task}` 72 | * 73 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 74 | * @param string $var 75 | * @return $this 76 | */ 77 | public function setName($var) 78 | { 79 | GPBUtil::checkString($var, True); 80 | $this->name = $var; 81 | 82 | return $this; 83 | } 84 | 85 | } 86 | 87 | -------------------------------------------------------------------------------- /src/V1alpha/InListFilter.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1alpha.InListFilter 15 | */ 16 | class InListFilter extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * The list of string values. 20 | * Must be non-empty. 21 | * 22 | * Generated from protobuf field repeated string values = 1; 23 | */ 24 | private $values; 25 | /** 26 | * If true, the string value is case sensitive. 27 | * 28 | * Generated from protobuf field bool case_sensitive = 2; 29 | */ 30 | protected $case_sensitive = false; 31 | 32 | /** 33 | * Constructor. 34 | * 35 | * @param array $data { 36 | * Optional. Data for populating the Message object. 37 | * 38 | * @type array|\Google\Protobuf\Internal\RepeatedField $values 39 | * The list of string values. 40 | * Must be non-empty. 41 | * @type bool $case_sensitive 42 | * If true, the string value is case sensitive. 43 | * } 44 | */ 45 | public function __construct($data = NULL) { 46 | \GPBMetadata\Google\Analytics\Data\V1Alpha\Data::initOnce(); 47 | parent::__construct($data); 48 | } 49 | 50 | /** 51 | * The list of string values. 52 | * Must be non-empty. 53 | * 54 | * Generated from protobuf field repeated string values = 1; 55 | * @return \Google\Protobuf\Internal\RepeatedField 56 | */ 57 | public function getValues() 58 | { 59 | return $this->values; 60 | } 61 | 62 | /** 63 | * The list of string values. 64 | * Must be non-empty. 65 | * 66 | * Generated from protobuf field repeated string values = 1; 67 | * @param array|\Google\Protobuf\Internal\RepeatedField $var 68 | * @return $this 69 | */ 70 | public function setValues($var) 71 | { 72 | $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); 73 | $this->values = $arr; 74 | 75 | return $this; 76 | } 77 | 78 | /** 79 | * If true, the string value is case sensitive. 80 | * 81 | * Generated from protobuf field bool case_sensitive = 2; 82 | * @return bool 83 | */ 84 | public function getCaseSensitive() 85 | { 86 | return $this->case_sensitive; 87 | } 88 | 89 | /** 90 | * If true, the string value is case sensitive. 91 | * 92 | * Generated from protobuf field bool case_sensitive = 2; 93 | * @param bool $var 94 | * @return $this 95 | */ 96 | public function setCaseSensitive($var) 97 | { 98 | GPBUtil::checkBool($var); 99 | $this->case_sensitive = $var; 100 | 101 | return $this; 102 | } 103 | 104 | } 105 | 106 | -------------------------------------------------------------------------------- /src/V1alpha/MetricAggregation.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1alpha.MetricAggregation 13 | */ 14 | class MetricAggregation 15 | { 16 | /** 17 | * Unspecified operator. 18 | * 19 | * Generated from protobuf enum METRIC_AGGREGATION_UNSPECIFIED = 0; 20 | */ 21 | const METRIC_AGGREGATION_UNSPECIFIED = 0; 22 | /** 23 | * SUM operator. 24 | * 25 | * Generated from protobuf enum TOTAL = 1; 26 | */ 27 | const TOTAL = 1; 28 | /** 29 | * Minimum operator. 30 | * 31 | * Generated from protobuf enum MINIMUM = 5; 32 | */ 33 | const MINIMUM = 5; 34 | /** 35 | * Maximum operator. 36 | * 37 | * Generated from protobuf enum MAXIMUM = 6; 38 | */ 39 | const MAXIMUM = 6; 40 | /** 41 | * Count operator. 42 | * 43 | * Generated from protobuf enum COUNT = 4; 44 | */ 45 | const COUNT = 4; 46 | 47 | private static $valueToName = [ 48 | self::METRIC_AGGREGATION_UNSPECIFIED => 'METRIC_AGGREGATION_UNSPECIFIED', 49 | self::TOTAL => 'TOTAL', 50 | self::MINIMUM => 'MINIMUM', 51 | self::MAXIMUM => 'MAXIMUM', 52 | self::COUNT => 'COUNT', 53 | ]; 54 | 55 | public static function name($value) 56 | { 57 | if (!isset(self::$valueToName[$value])) { 58 | throw new UnexpectedValueException(sprintf( 59 | 'Enum %s has no name defined for value %s', __CLASS__, $value)); 60 | } 61 | return self::$valueToName[$value]; 62 | } 63 | 64 | 65 | public static function value($name) 66 | { 67 | $const = __CLASS__ . '::' . strtoupper($name); 68 | if (!defined($const)) { 69 | throw new UnexpectedValueException(sprintf( 70 | 'Enum %s has no value defined for name %s', __CLASS__, $name)); 71 | } 72 | return constant($const); 73 | } 74 | } 75 | 76 | -------------------------------------------------------------------------------- /src/V1alpha/MetricHeader.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1alpha.MetricHeader 18 | */ 19 | class MetricHeader extends \Google\Protobuf\Internal\Message 20 | { 21 | /** 22 | * The metric's name. 23 | * 24 | * Generated from protobuf field string name = 1; 25 | */ 26 | protected $name = ''; 27 | /** 28 | * The metric's data type. 29 | * 30 | * Generated from protobuf field .google.analytics.data.v1alpha.MetricType type = 2; 31 | */ 32 | protected $type = 0; 33 | 34 | /** 35 | * Constructor. 36 | * 37 | * @param array $data { 38 | * Optional. Data for populating the Message object. 39 | * 40 | * @type string $name 41 | * The metric's name. 42 | * @type int $type 43 | * The metric's data type. 44 | * } 45 | */ 46 | public function __construct($data = NULL) { 47 | \GPBMetadata\Google\Analytics\Data\V1Alpha\Data::initOnce(); 48 | parent::__construct($data); 49 | } 50 | 51 | /** 52 | * The metric's name. 53 | * 54 | * Generated from protobuf field string name = 1; 55 | * @return string 56 | */ 57 | public function getName() 58 | { 59 | return $this->name; 60 | } 61 | 62 | /** 63 | * The metric's name. 64 | * 65 | * Generated from protobuf field string name = 1; 66 | * @param string $var 67 | * @return $this 68 | */ 69 | public function setName($var) 70 | { 71 | GPBUtil::checkString($var, True); 72 | $this->name = $var; 73 | 74 | return $this; 75 | } 76 | 77 | /** 78 | * The metric's data type. 79 | * 80 | * Generated from protobuf field .google.analytics.data.v1alpha.MetricType type = 2; 81 | * @return int 82 | */ 83 | public function getType() 84 | { 85 | return $this->type; 86 | } 87 | 88 | /** 89 | * The metric's data type. 90 | * 91 | * Generated from protobuf field .google.analytics.data.v1alpha.MetricType type = 2; 92 | * @param int $var 93 | * @return $this 94 | */ 95 | public function setType($var) 96 | { 97 | GPBUtil::checkEnum($var, \Google\Analytics\Data\V1alpha\MetricType::class); 98 | $this->type = $var; 99 | 100 | return $this; 101 | } 102 | 103 | } 104 | 105 | -------------------------------------------------------------------------------- /src/V1alpha/MetricValue.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1alpha.MetricValue 15 | */ 16 | class MetricValue extends \Google\Protobuf\Internal\Message 17 | { 18 | protected $one_value; 19 | 20 | /** 21 | * Constructor. 22 | * 23 | * @param array $data { 24 | * Optional. Data for populating the Message object. 25 | * 26 | * @type string $value 27 | * Measurement value. See MetricHeader for type. 28 | * } 29 | */ 30 | public function __construct($data = NULL) { 31 | \GPBMetadata\Google\Analytics\Data\V1Alpha\Data::initOnce(); 32 | parent::__construct($data); 33 | } 34 | 35 | /** 36 | * Measurement value. See MetricHeader for type. 37 | * 38 | * Generated from protobuf field string value = 4; 39 | * @return string 40 | */ 41 | public function getValue() 42 | { 43 | return $this->readOneof(4); 44 | } 45 | 46 | public function hasValue() 47 | { 48 | return $this->hasOneof(4); 49 | } 50 | 51 | /** 52 | * Measurement value. See MetricHeader for type. 53 | * 54 | * Generated from protobuf field string value = 4; 55 | * @param string $var 56 | * @return $this 57 | */ 58 | public function setValue($var) 59 | { 60 | GPBUtil::checkString($var, True); 61 | $this->writeOneof(4, $var); 62 | 63 | return $this; 64 | } 65 | 66 | /** 67 | * @return string 68 | */ 69 | public function getOneValue() 70 | { 71 | return $this->whichOneof("one_value"); 72 | } 73 | 74 | } 75 | 76 | -------------------------------------------------------------------------------- /src/V1alpha/NumericFilter.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1alpha.NumericFilter 15 | */ 16 | class NumericFilter extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * The operation type for this filter. 20 | * 21 | * Generated from protobuf field .google.analytics.data.v1alpha.NumericFilter.Operation operation = 1; 22 | */ 23 | protected $operation = 0; 24 | /** 25 | * A numeric value or a date value. 26 | * 27 | * Generated from protobuf field .google.analytics.data.v1alpha.NumericValue value = 2; 28 | */ 29 | protected $value = null; 30 | 31 | /** 32 | * Constructor. 33 | * 34 | * @param array $data { 35 | * Optional. Data for populating the Message object. 36 | * 37 | * @type int $operation 38 | * The operation type for this filter. 39 | * @type \Google\Analytics\Data\V1alpha\NumericValue $value 40 | * A numeric value or a date value. 41 | * } 42 | */ 43 | public function __construct($data = NULL) { 44 | \GPBMetadata\Google\Analytics\Data\V1Alpha\Data::initOnce(); 45 | parent::__construct($data); 46 | } 47 | 48 | /** 49 | * The operation type for this filter. 50 | * 51 | * Generated from protobuf field .google.analytics.data.v1alpha.NumericFilter.Operation operation = 1; 52 | * @return int 53 | */ 54 | public function getOperation() 55 | { 56 | return $this->operation; 57 | } 58 | 59 | /** 60 | * The operation type for this filter. 61 | * 62 | * Generated from protobuf field .google.analytics.data.v1alpha.NumericFilter.Operation operation = 1; 63 | * @param int $var 64 | * @return $this 65 | */ 66 | public function setOperation($var) 67 | { 68 | GPBUtil::checkEnum($var, \Google\Analytics\Data\V1alpha\NumericFilter\Operation::class); 69 | $this->operation = $var; 70 | 71 | return $this; 72 | } 73 | 74 | /** 75 | * A numeric value or a date value. 76 | * 77 | * Generated from protobuf field .google.analytics.data.v1alpha.NumericValue value = 2; 78 | * @return \Google\Analytics\Data\V1alpha\NumericValue|null 79 | */ 80 | public function getValue() 81 | { 82 | return $this->value; 83 | } 84 | 85 | public function hasValue() 86 | { 87 | return isset($this->value); 88 | } 89 | 90 | public function clearValue() 91 | { 92 | unset($this->value); 93 | } 94 | 95 | /** 96 | * A numeric value or a date value. 97 | * 98 | * Generated from protobuf field .google.analytics.data.v1alpha.NumericValue value = 2; 99 | * @param \Google\Analytics\Data\V1alpha\NumericValue $var 100 | * @return $this 101 | */ 102 | public function setValue($var) 103 | { 104 | GPBUtil::checkMessage($var, \Google\Analytics\Data\V1alpha\NumericValue::class); 105 | $this->value = $var; 106 | 107 | return $this; 108 | } 109 | 110 | } 111 | 112 | -------------------------------------------------------------------------------- /src/V1alpha/NumericFilter/Operation.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1alpha.NumericFilter.Operation 13 | */ 14 | class Operation 15 | { 16 | /** 17 | * Unspecified. 18 | * 19 | * Generated from protobuf enum OPERATION_UNSPECIFIED = 0; 20 | */ 21 | const OPERATION_UNSPECIFIED = 0; 22 | /** 23 | * Equal 24 | * 25 | * Generated from protobuf enum EQUAL = 1; 26 | */ 27 | const EQUAL = 1; 28 | /** 29 | * Less than 30 | * 31 | * Generated from protobuf enum LESS_THAN = 2; 32 | */ 33 | const LESS_THAN = 2; 34 | /** 35 | * Less than or equal 36 | * 37 | * Generated from protobuf enum LESS_THAN_OR_EQUAL = 3; 38 | */ 39 | const LESS_THAN_OR_EQUAL = 3; 40 | /** 41 | * Greater than 42 | * 43 | * Generated from protobuf enum GREATER_THAN = 4; 44 | */ 45 | const GREATER_THAN = 4; 46 | /** 47 | * Greater than or equal 48 | * 49 | * Generated from protobuf enum GREATER_THAN_OR_EQUAL = 5; 50 | */ 51 | const GREATER_THAN_OR_EQUAL = 5; 52 | 53 | private static $valueToName = [ 54 | self::OPERATION_UNSPECIFIED => 'OPERATION_UNSPECIFIED', 55 | self::EQUAL => 'EQUAL', 56 | self::LESS_THAN => 'LESS_THAN', 57 | self::LESS_THAN_OR_EQUAL => 'LESS_THAN_OR_EQUAL', 58 | self::GREATER_THAN => 'GREATER_THAN', 59 | self::GREATER_THAN_OR_EQUAL => 'GREATER_THAN_OR_EQUAL', 60 | ]; 61 | 62 | public static function name($value) 63 | { 64 | if (!isset(self::$valueToName[$value])) { 65 | throw new UnexpectedValueException(sprintf( 66 | 'Enum %s has no name defined for value %s', __CLASS__, $value)); 67 | } 68 | return self::$valueToName[$value]; 69 | } 70 | 71 | 72 | public static function value($name) 73 | { 74 | $const = __CLASS__ . '::' . strtoupper($name); 75 | if (!defined($const)) { 76 | throw new UnexpectedValueException(sprintf( 77 | 'Enum %s has no value defined for name %s', __CLASS__, $name)); 78 | } 79 | return constant($const); 80 | } 81 | } 82 | 83 | 84 | -------------------------------------------------------------------------------- /src/V1alpha/NumericValue.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1alpha.NumericValue 15 | */ 16 | class NumericValue extends \Google\Protobuf\Internal\Message 17 | { 18 | protected $one_value; 19 | 20 | /** 21 | * Constructor. 22 | * 23 | * @param array $data { 24 | * Optional. Data for populating the Message object. 25 | * 26 | * @type int|string $int64_value 27 | * Integer value 28 | * @type float $double_value 29 | * Double value 30 | * } 31 | */ 32 | public function __construct($data = NULL) { 33 | \GPBMetadata\Google\Analytics\Data\V1Alpha\Data::initOnce(); 34 | parent::__construct($data); 35 | } 36 | 37 | /** 38 | * Integer value 39 | * 40 | * Generated from protobuf field int64 int64_value = 1; 41 | * @return int|string 42 | */ 43 | public function getInt64Value() 44 | { 45 | return $this->readOneof(1); 46 | } 47 | 48 | public function hasInt64Value() 49 | { 50 | return $this->hasOneof(1); 51 | } 52 | 53 | /** 54 | * Integer value 55 | * 56 | * Generated from protobuf field int64 int64_value = 1; 57 | * @param int|string $var 58 | * @return $this 59 | */ 60 | public function setInt64Value($var) 61 | { 62 | GPBUtil::checkInt64($var); 63 | $this->writeOneof(1, $var); 64 | 65 | return $this; 66 | } 67 | 68 | /** 69 | * Double value 70 | * 71 | * Generated from protobuf field double double_value = 2; 72 | * @return float 73 | */ 74 | public function getDoubleValue() 75 | { 76 | return $this->readOneof(2); 77 | } 78 | 79 | public function hasDoubleValue() 80 | { 81 | return $this->hasOneof(2); 82 | } 83 | 84 | /** 85 | * Double value 86 | * 87 | * Generated from protobuf field double double_value = 2; 88 | * @param float $var 89 | * @return $this 90 | */ 91 | public function setDoubleValue($var) 92 | { 93 | GPBUtil::checkDouble($var); 94 | $this->writeOneof(2, $var); 95 | 96 | return $this; 97 | } 98 | 99 | /** 100 | * @return string 101 | */ 102 | public function getOneValue() 103 | { 104 | return $this->whichOneof("one_value"); 105 | } 106 | 107 | } 108 | 109 | -------------------------------------------------------------------------------- /src/V1alpha/OrderBy/DimensionOrderBy.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1alpha.OrderBy.DimensionOrderBy 15 | */ 16 | class DimensionOrderBy extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * A dimension name in the request to order by. 20 | * 21 | * Generated from protobuf field string dimension_name = 1; 22 | */ 23 | protected $dimension_name = ''; 24 | /** 25 | * Controls the rule for dimension value ordering. 26 | * 27 | * Generated from protobuf field .google.analytics.data.v1alpha.OrderBy.DimensionOrderBy.OrderType order_type = 2; 28 | */ 29 | protected $order_type = 0; 30 | 31 | /** 32 | * Constructor. 33 | * 34 | * @param array $data { 35 | * Optional. Data for populating the Message object. 36 | * 37 | * @type string $dimension_name 38 | * A dimension name in the request to order by. 39 | * @type int $order_type 40 | * Controls the rule for dimension value ordering. 41 | * } 42 | */ 43 | public function __construct($data = NULL) { 44 | \GPBMetadata\Google\Analytics\Data\V1Alpha\Data::initOnce(); 45 | parent::__construct($data); 46 | } 47 | 48 | /** 49 | * A dimension name in the request to order by. 50 | * 51 | * Generated from protobuf field string dimension_name = 1; 52 | * @return string 53 | */ 54 | public function getDimensionName() 55 | { 56 | return $this->dimension_name; 57 | } 58 | 59 | /** 60 | * A dimension name in the request to order by. 61 | * 62 | * Generated from protobuf field string dimension_name = 1; 63 | * @param string $var 64 | * @return $this 65 | */ 66 | public function setDimensionName($var) 67 | { 68 | GPBUtil::checkString($var, True); 69 | $this->dimension_name = $var; 70 | 71 | return $this; 72 | } 73 | 74 | /** 75 | * Controls the rule for dimension value ordering. 76 | * 77 | * Generated from protobuf field .google.analytics.data.v1alpha.OrderBy.DimensionOrderBy.OrderType order_type = 2; 78 | * @return int 79 | */ 80 | public function getOrderType() 81 | { 82 | return $this->order_type; 83 | } 84 | 85 | /** 86 | * Controls the rule for dimension value ordering. 87 | * 88 | * Generated from protobuf field .google.analytics.data.v1alpha.OrderBy.DimensionOrderBy.OrderType order_type = 2; 89 | * @param int $var 90 | * @return $this 91 | */ 92 | public function setOrderType($var) 93 | { 94 | GPBUtil::checkEnum($var, \Google\Analytics\Data\V1alpha\OrderBy\DimensionOrderBy\OrderType::class); 95 | $this->order_type = $var; 96 | 97 | return $this; 98 | } 99 | 100 | } 101 | 102 | 103 | -------------------------------------------------------------------------------- /src/V1alpha/OrderBy/DimensionOrderBy/OrderType.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1alpha.OrderBy.DimensionOrderBy.OrderType 13 | */ 14 | class OrderType 15 | { 16 | /** 17 | * Unspecified. 18 | * 19 | * Generated from protobuf enum ORDER_TYPE_UNSPECIFIED = 0; 20 | */ 21 | const ORDER_TYPE_UNSPECIFIED = 0; 22 | /** 23 | * Alphanumeric sort by Unicode code point. For example, "2" < "A" < "X" < 24 | * "b" < "z". 25 | * 26 | * Generated from protobuf enum ALPHANUMERIC = 1; 27 | */ 28 | const ALPHANUMERIC = 1; 29 | /** 30 | * Case insensitive alphanumeric sort by lower case Unicode code point. 31 | * For example, "2" < "A" < "b" < "X" < "z". 32 | * 33 | * Generated from protobuf enum CASE_INSENSITIVE_ALPHANUMERIC = 2; 34 | */ 35 | const CASE_INSENSITIVE_ALPHANUMERIC = 2; 36 | /** 37 | * Dimension values are converted to numbers before sorting. For example 38 | * in NUMERIC sort, "25" < "100", and in `ALPHANUMERIC` sort, "100" < 39 | * "25". Non-numeric dimension values all have equal ordering value below 40 | * all numeric values. 41 | * 42 | * Generated from protobuf enum NUMERIC = 3; 43 | */ 44 | const NUMERIC = 3; 45 | 46 | private static $valueToName = [ 47 | self::ORDER_TYPE_UNSPECIFIED => 'ORDER_TYPE_UNSPECIFIED', 48 | self::ALPHANUMERIC => 'ALPHANUMERIC', 49 | self::CASE_INSENSITIVE_ALPHANUMERIC => 'CASE_INSENSITIVE_ALPHANUMERIC', 50 | self::NUMERIC => 'NUMERIC', 51 | ]; 52 | 53 | public static function name($value) 54 | { 55 | if (!isset(self::$valueToName[$value])) { 56 | throw new UnexpectedValueException(sprintf( 57 | 'Enum %s has no name defined for value %s', __CLASS__, $value)); 58 | } 59 | return self::$valueToName[$value]; 60 | } 61 | 62 | 63 | public static function value($name) 64 | { 65 | $const = __CLASS__ . '::' . strtoupper($name); 66 | if (!defined($const)) { 67 | throw new UnexpectedValueException(sprintf( 68 | 'Enum %s has no value defined for name %s', __CLASS__, $name)); 69 | } 70 | return constant($const); 71 | } 72 | } 73 | 74 | 75 | -------------------------------------------------------------------------------- /src/V1alpha/OrderBy/MetricOrderBy.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1alpha.OrderBy.MetricOrderBy 15 | */ 16 | class MetricOrderBy extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * A metric name in the request to order by. 20 | * 21 | * Generated from protobuf field string metric_name = 1; 22 | */ 23 | protected $metric_name = ''; 24 | 25 | /** 26 | * Constructor. 27 | * 28 | * @param array $data { 29 | * Optional. Data for populating the Message object. 30 | * 31 | * @type string $metric_name 32 | * A metric name in the request to order by. 33 | * } 34 | */ 35 | public function __construct($data = NULL) { 36 | \GPBMetadata\Google\Analytics\Data\V1Alpha\Data::initOnce(); 37 | parent::__construct($data); 38 | } 39 | 40 | /** 41 | * A metric name in the request to order by. 42 | * 43 | * Generated from protobuf field string metric_name = 1; 44 | * @return string 45 | */ 46 | public function getMetricName() 47 | { 48 | return $this->metric_name; 49 | } 50 | 51 | /** 52 | * A metric name in the request to order by. 53 | * 54 | * Generated from protobuf field string metric_name = 1; 55 | * @param string $var 56 | * @return $this 57 | */ 58 | public function setMetricName($var) 59 | { 60 | GPBUtil::checkString($var, True); 61 | $this->metric_name = $var; 62 | 63 | return $this; 64 | } 65 | 66 | } 67 | 68 | 69 | -------------------------------------------------------------------------------- /src/V1alpha/QuotaStatus.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1alpha.QuotaStatus 15 | */ 16 | class QuotaStatus extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * Quota consumed by this request. 20 | * 21 | * Generated from protobuf field int32 consumed = 1; 22 | */ 23 | protected $consumed = 0; 24 | /** 25 | * Quota remaining after this request. 26 | * 27 | * Generated from protobuf field int32 remaining = 2; 28 | */ 29 | protected $remaining = 0; 30 | 31 | /** 32 | * Constructor. 33 | * 34 | * @param array $data { 35 | * Optional. Data for populating the Message object. 36 | * 37 | * @type int $consumed 38 | * Quota consumed by this request. 39 | * @type int $remaining 40 | * Quota remaining after this request. 41 | * } 42 | */ 43 | public function __construct($data = NULL) { 44 | \GPBMetadata\Google\Analytics\Data\V1Alpha\Data::initOnce(); 45 | parent::__construct($data); 46 | } 47 | 48 | /** 49 | * Quota consumed by this request. 50 | * 51 | * Generated from protobuf field int32 consumed = 1; 52 | * @return int 53 | */ 54 | public function getConsumed() 55 | { 56 | return $this->consumed; 57 | } 58 | 59 | /** 60 | * Quota consumed by this request. 61 | * 62 | * Generated from protobuf field int32 consumed = 1; 63 | * @param int $var 64 | * @return $this 65 | */ 66 | public function setConsumed($var) 67 | { 68 | GPBUtil::checkInt32($var); 69 | $this->consumed = $var; 70 | 71 | return $this; 72 | } 73 | 74 | /** 75 | * Quota remaining after this request. 76 | * 77 | * Generated from protobuf field int32 remaining = 2; 78 | * @return int 79 | */ 80 | public function getRemaining() 81 | { 82 | return $this->remaining; 83 | } 84 | 85 | /** 86 | * Quota remaining after this request. 87 | * 88 | * Generated from protobuf field int32 remaining = 2; 89 | * @param int $var 90 | * @return $this 91 | */ 92 | public function setRemaining($var) 93 | { 94 | GPBUtil::checkInt32($var); 95 | $this->remaining = $var; 96 | 97 | return $this; 98 | } 99 | 100 | } 101 | 102 | -------------------------------------------------------------------------------- /src/V1alpha/ReportTask/ReportMetadata/State.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1alpha.ReportTask.ReportMetadata.State 13 | */ 14 | class State 15 | { 16 | /** 17 | * Unspecified state will never be used. 18 | * 19 | * Generated from protobuf enum STATE_UNSPECIFIED = 0; 20 | */ 21 | const STATE_UNSPECIFIED = 0; 22 | /** 23 | * The report is currently creating and will be available in the 24 | * future. Creating occurs immediately after the CreateReport call. 25 | * 26 | * Generated from protobuf enum CREATING = 1; 27 | */ 28 | const CREATING = 1; 29 | /** 30 | * The report is fully created and ready for querying. 31 | * 32 | * Generated from protobuf enum ACTIVE = 2; 33 | */ 34 | const ACTIVE = 2; 35 | /** 36 | * The report failed to be created. 37 | * 38 | * Generated from protobuf enum FAILED = 3; 39 | */ 40 | const FAILED = 3; 41 | 42 | private static $valueToName = [ 43 | self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', 44 | self::CREATING => 'CREATING', 45 | self::ACTIVE => 'ACTIVE', 46 | self::FAILED => 'FAILED', 47 | ]; 48 | 49 | public static function name($value) 50 | { 51 | if (!isset(self::$valueToName[$value])) { 52 | throw new UnexpectedValueException(sprintf( 53 | 'Enum %s has no name defined for value %s', __CLASS__, $value)); 54 | } 55 | return self::$valueToName[$value]; 56 | } 57 | 58 | 59 | public static function value($name) 60 | { 61 | $const = __CLASS__ . '::' . strtoupper($name); 62 | if (!defined($const)) { 63 | throw new UnexpectedValueException(sprintf( 64 | 'Enum %s has no value defined for name %s', __CLASS__, $name)); 65 | } 66 | return constant($const); 67 | } 68 | } 69 | 70 | 71 | -------------------------------------------------------------------------------- /src/V1alpha/ReportTaskMetadata.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1alpha.ReportTaskMetadata 16 | */ 17 | class ReportTaskMetadata extends \Google\Protobuf\Internal\Message 18 | { 19 | 20 | /** 21 | * Constructor. 22 | * 23 | * @param array $data { 24 | * Optional. Data for populating the Message object. 25 | * 26 | * } 27 | */ 28 | public function __construct($data = NULL) { 29 | \GPBMetadata\Google\Analytics\Data\V1Alpha\AnalyticsDataApi::initOnce(); 30 | parent::__construct($data); 31 | } 32 | 33 | } 34 | 35 | -------------------------------------------------------------------------------- /src/V1alpha/ResponseMetaData/SchemaRestrictionResponse.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1alpha.ResponseMetaData.SchemaRestrictionResponse 17 | */ 18 | class SchemaRestrictionResponse extends \Google\Protobuf\Internal\Message 19 | { 20 | /** 21 | * All restrictions actively enforced in creating the report. For example, 22 | * `purchaseRevenue` always has the restriction type `REVENUE_DATA`. 23 | * However, this active response restriction is only populated if the user's 24 | * custom role disallows access to `REVENUE_DATA`. 25 | * 26 | * Generated from protobuf field repeated .google.analytics.data.v1alpha.ResponseMetaData.SchemaRestrictionResponse.ActiveMetricRestriction active_metric_restrictions = 1; 27 | */ 28 | private $active_metric_restrictions; 29 | 30 | /** 31 | * Constructor. 32 | * 33 | * @param array $data { 34 | * Optional. Data for populating the Message object. 35 | * 36 | * @type array<\Google\Analytics\Data\V1alpha\ResponseMetaData\SchemaRestrictionResponse\ActiveMetricRestriction>|\Google\Protobuf\Internal\RepeatedField $active_metric_restrictions 37 | * All restrictions actively enforced in creating the report. For example, 38 | * `purchaseRevenue` always has the restriction type `REVENUE_DATA`. 39 | * However, this active response restriction is only populated if the user's 40 | * custom role disallows access to `REVENUE_DATA`. 41 | * } 42 | */ 43 | public function __construct($data = NULL) { 44 | \GPBMetadata\Google\Analytics\Data\V1Alpha\Data::initOnce(); 45 | parent::__construct($data); 46 | } 47 | 48 | /** 49 | * All restrictions actively enforced in creating the report. For example, 50 | * `purchaseRevenue` always has the restriction type `REVENUE_DATA`. 51 | * However, this active response restriction is only populated if the user's 52 | * custom role disallows access to `REVENUE_DATA`. 53 | * 54 | * Generated from protobuf field repeated .google.analytics.data.v1alpha.ResponseMetaData.SchemaRestrictionResponse.ActiveMetricRestriction active_metric_restrictions = 1; 55 | * @return \Google\Protobuf\Internal\RepeatedField 56 | */ 57 | public function getActiveMetricRestrictions() 58 | { 59 | return $this->active_metric_restrictions; 60 | } 61 | 62 | /** 63 | * All restrictions actively enforced in creating the report. For example, 64 | * `purchaseRevenue` always has the restriction type `REVENUE_DATA`. 65 | * However, this active response restriction is only populated if the user's 66 | * custom role disallows access to `REVENUE_DATA`. 67 | * 68 | * Generated from protobuf field repeated .google.analytics.data.v1alpha.ResponseMetaData.SchemaRestrictionResponse.ActiveMetricRestriction active_metric_restrictions = 1; 69 | * @param array<\Google\Analytics\Data\V1alpha\ResponseMetaData\SchemaRestrictionResponse\ActiveMetricRestriction>|\Google\Protobuf\Internal\RepeatedField $var 70 | * @return $this 71 | */ 72 | public function setActiveMetricRestrictions($var) 73 | { 74 | $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Analytics\Data\V1alpha\ResponseMetaData\SchemaRestrictionResponse\ActiveMetricRestriction::class); 75 | $this->active_metric_restrictions = $arr; 76 | 77 | return $this; 78 | } 79 | 80 | } 81 | 82 | 83 | -------------------------------------------------------------------------------- /src/V1alpha/ResponseMetaData/SchemaRestrictionResponse/ActiveMetricRestriction.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1alpha.ResponseMetaData.SchemaRestrictionResponse.ActiveMetricRestriction 15 | */ 16 | class ActiveMetricRestriction extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * The name of the restricted metric. 20 | * 21 | * Generated from protobuf field optional string metric_name = 1; 22 | */ 23 | protected $metric_name = null; 24 | /** 25 | * The reason for this metric's restriction. 26 | * 27 | * Generated from protobuf field repeated .google.analytics.data.v1alpha.RestrictedMetricType restricted_metric_types = 2; 28 | */ 29 | private $restricted_metric_types; 30 | 31 | /** 32 | * Constructor. 33 | * 34 | * @param array $data { 35 | * Optional. Data for populating the Message object. 36 | * 37 | * @type string $metric_name 38 | * The name of the restricted metric. 39 | * @type array|\Google\Protobuf\Internal\RepeatedField $restricted_metric_types 40 | * The reason for this metric's restriction. 41 | * } 42 | */ 43 | public function __construct($data = NULL) { 44 | \GPBMetadata\Google\Analytics\Data\V1Alpha\Data::initOnce(); 45 | parent::__construct($data); 46 | } 47 | 48 | /** 49 | * The name of the restricted metric. 50 | * 51 | * Generated from protobuf field optional string metric_name = 1; 52 | * @return string 53 | */ 54 | public function getMetricName() 55 | { 56 | return isset($this->metric_name) ? $this->metric_name : ''; 57 | } 58 | 59 | public function hasMetricName() 60 | { 61 | return isset($this->metric_name); 62 | } 63 | 64 | public function clearMetricName() 65 | { 66 | unset($this->metric_name); 67 | } 68 | 69 | /** 70 | * The name of the restricted metric. 71 | * 72 | * Generated from protobuf field optional string metric_name = 1; 73 | * @param string $var 74 | * @return $this 75 | */ 76 | public function setMetricName($var) 77 | { 78 | GPBUtil::checkString($var, True); 79 | $this->metric_name = $var; 80 | 81 | return $this; 82 | } 83 | 84 | /** 85 | * The reason for this metric's restriction. 86 | * 87 | * Generated from protobuf field repeated .google.analytics.data.v1alpha.RestrictedMetricType restricted_metric_types = 2; 88 | * @return \Google\Protobuf\Internal\RepeatedField 89 | */ 90 | public function getRestrictedMetricTypes() 91 | { 92 | return $this->restricted_metric_types; 93 | } 94 | 95 | /** 96 | * The reason for this metric's restriction. 97 | * 98 | * Generated from protobuf field repeated .google.analytics.data.v1alpha.RestrictedMetricType restricted_metric_types = 2; 99 | * @param array|\Google\Protobuf\Internal\RepeatedField $var 100 | * @return $this 101 | */ 102 | public function setRestrictedMetricTypes($var) 103 | { 104 | $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Analytics\Data\V1alpha\RestrictedMetricType::class); 105 | $this->restricted_metric_types = $arr; 106 | 107 | return $this; 108 | } 109 | 110 | } 111 | 112 | 113 | -------------------------------------------------------------------------------- /src/V1alpha/RestrictedMetricType.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1alpha.RestrictedMetricType 14 | */ 15 | class RestrictedMetricType 16 | { 17 | /** 18 | * Unspecified type. 19 | * 20 | * Generated from protobuf enum RESTRICTED_METRIC_TYPE_UNSPECIFIED = 0; 21 | */ 22 | const RESTRICTED_METRIC_TYPE_UNSPECIFIED = 0; 23 | /** 24 | * Cost metrics such as `adCost`. 25 | * 26 | * Generated from protobuf enum COST_DATA = 1; 27 | */ 28 | const COST_DATA = 1; 29 | /** 30 | * Revenue metrics such as `purchaseRevenue`. 31 | * 32 | * Generated from protobuf enum REVENUE_DATA = 2; 33 | */ 34 | const REVENUE_DATA = 2; 35 | 36 | private static $valueToName = [ 37 | self::RESTRICTED_METRIC_TYPE_UNSPECIFIED => 'RESTRICTED_METRIC_TYPE_UNSPECIFIED', 38 | self::COST_DATA => 'COST_DATA', 39 | self::REVENUE_DATA => 'REVENUE_DATA', 40 | ]; 41 | 42 | public static function name($value) 43 | { 44 | if (!isset(self::$valueToName[$value])) { 45 | throw new UnexpectedValueException(sprintf( 46 | 'Enum %s has no name defined for value %s', __CLASS__, $value)); 47 | } 48 | return self::$valueToName[$value]; 49 | } 50 | 51 | 52 | public static function value($name) 53 | { 54 | $const = __CLASS__ . '::' . strtoupper($name); 55 | if (!defined($const)) { 56 | throw new UnexpectedValueException(sprintf( 57 | 'Enum %s has no value defined for name %s', __CLASS__, $name)); 58 | } 59 | return constant($const); 60 | } 61 | } 62 | 63 | -------------------------------------------------------------------------------- /src/V1alpha/RunFunnelReportRequest/FunnelVisualizationType.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1alpha.RunFunnelReportRequest.FunnelVisualizationType 14 | */ 15 | class FunnelVisualizationType 16 | { 17 | /** 18 | * Unspecified type. 19 | * 20 | * Generated from protobuf enum FUNNEL_VISUALIZATION_TYPE_UNSPECIFIED = 0; 21 | */ 22 | const FUNNEL_VISUALIZATION_TYPE_UNSPECIFIED = 0; 23 | /** 24 | * A standard (stepped) funnel. The funnel visualization sub report in the 25 | * response will not contain date. 26 | * 27 | * Generated from protobuf enum STANDARD_FUNNEL = 1; 28 | */ 29 | const STANDARD_FUNNEL = 1; 30 | /** 31 | * A trended (line chart) funnel. The funnel visualization sub report in the 32 | * response will contain the date dimension. 33 | * 34 | * Generated from protobuf enum TRENDED_FUNNEL = 2; 35 | */ 36 | const TRENDED_FUNNEL = 2; 37 | 38 | private static $valueToName = [ 39 | self::FUNNEL_VISUALIZATION_TYPE_UNSPECIFIED => 'FUNNEL_VISUALIZATION_TYPE_UNSPECIFIED', 40 | self::STANDARD_FUNNEL => 'STANDARD_FUNNEL', 41 | self::TRENDED_FUNNEL => 'TRENDED_FUNNEL', 42 | ]; 43 | 44 | public static function name($value) 45 | { 46 | if (!isset(self::$valueToName[$value])) { 47 | throw new UnexpectedValueException(sprintf( 48 | 'Enum %s has no name defined for value %s', __CLASS__, $value)); 49 | } 50 | return self::$valueToName[$value]; 51 | } 52 | 53 | 54 | public static function value($name) 55 | { 56 | $const = __CLASS__ . '::' . strtoupper($name); 57 | if (!defined($const)) { 58 | throw new UnexpectedValueException(sprintf( 59 | 'Enum %s has no value defined for name %s', __CLASS__, $name)); 60 | } 61 | return constant($const); 62 | } 63 | } 64 | 65 | 66 | -------------------------------------------------------------------------------- /src/V1alpha/SamplingLevel.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1alpha.SamplingLevel 13 | */ 14 | class SamplingLevel 15 | { 16 | /** 17 | * Unspecified type. 18 | * 19 | * Generated from protobuf enum SAMPLING_LEVEL_UNSPECIFIED = 0; 20 | */ 21 | const SAMPLING_LEVEL_UNSPECIFIED = 0; 22 | /** 23 | * Applies a sampling level of 10 million to standard properties and 24 | * 100 million to Google Analytics 360 properties. 25 | * 26 | * Generated from protobuf enum LOW = 1; 27 | */ 28 | const LOW = 1; 29 | /** 30 | * Exclusive to Google Analytics 360 properties with a sampling level of 1 31 | * billion. 32 | * 33 | * Generated from protobuf enum MEDIUM = 2; 34 | */ 35 | const MEDIUM = 2; 36 | /** 37 | * Exclusive to Google Analytics 360 properties. Unsampled explorations are 38 | * more accurate and can reveal insights that aren't visible in standard 39 | * explorations. To learn more, see 40 | * https://support.google.com/analytics/answer/10896953. 41 | * 42 | * Generated from protobuf enum UNSAMPLED = 3; 43 | */ 44 | const UNSAMPLED = 3; 45 | 46 | private static $valueToName = [ 47 | self::SAMPLING_LEVEL_UNSPECIFIED => 'SAMPLING_LEVEL_UNSPECIFIED', 48 | self::LOW => 'LOW', 49 | self::MEDIUM => 'MEDIUM', 50 | self::UNSAMPLED => 'UNSAMPLED', 51 | ]; 52 | 53 | public static function name($value) 54 | { 55 | if (!isset(self::$valueToName[$value])) { 56 | throw new UnexpectedValueException(sprintf( 57 | 'Enum %s has no name defined for value %s', __CLASS__, $value)); 58 | } 59 | return self::$valueToName[$value]; 60 | } 61 | 62 | 63 | public static function value($name) 64 | { 65 | $const = __CLASS__ . '::' . strtoupper($name); 66 | if (!defined($const)) { 67 | throw new UnexpectedValueException(sprintf( 68 | 'Enum %s has no value defined for name %s', __CLASS__, $name)); 69 | } 70 | return constant($const); 71 | } 72 | } 73 | 74 | -------------------------------------------------------------------------------- /src/V1alpha/SegmentFilterExpressionList.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1alpha.SegmentFilterExpressionList 15 | */ 16 | class SegmentFilterExpressionList extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * The list of segment filter expressions 20 | * 21 | * Generated from protobuf field repeated .google.analytics.data.v1alpha.SegmentFilterExpression expressions = 1; 22 | */ 23 | private $expressions; 24 | 25 | /** 26 | * Constructor. 27 | * 28 | * @param array $data { 29 | * Optional. Data for populating the Message object. 30 | * 31 | * @type array<\Google\Analytics\Data\V1alpha\SegmentFilterExpression>|\Google\Protobuf\Internal\RepeatedField $expressions 32 | * The list of segment filter expressions 33 | * } 34 | */ 35 | public function __construct($data = NULL) { 36 | \GPBMetadata\Google\Analytics\Data\V1Alpha\Data::initOnce(); 37 | parent::__construct($data); 38 | } 39 | 40 | /** 41 | * The list of segment filter expressions 42 | * 43 | * Generated from protobuf field repeated .google.analytics.data.v1alpha.SegmentFilterExpression expressions = 1; 44 | * @return \Google\Protobuf\Internal\RepeatedField 45 | */ 46 | public function getExpressions() 47 | { 48 | return $this->expressions; 49 | } 50 | 51 | /** 52 | * The list of segment filter expressions 53 | * 54 | * Generated from protobuf field repeated .google.analytics.data.v1alpha.SegmentFilterExpression expressions = 1; 55 | * @param array<\Google\Analytics\Data\V1alpha\SegmentFilterExpression>|\Google\Protobuf\Internal\RepeatedField $var 56 | * @return $this 57 | */ 58 | public function setExpressions($var) 59 | { 60 | $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Analytics\Data\V1alpha\SegmentFilterExpression::class); 61 | $this->expressions = $arr; 62 | 63 | return $this; 64 | } 65 | 66 | } 67 | 68 | -------------------------------------------------------------------------------- /src/V1alpha/SegmentParameterFilterExpressionList.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1alpha.SegmentParameterFilterExpressionList 15 | */ 16 | class SegmentParameterFilterExpressionList extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * The list of segment parameter filter expressions. 20 | * 21 | * Generated from protobuf field repeated .google.analytics.data.v1alpha.SegmentParameterFilterExpression expressions = 1; 22 | */ 23 | private $expressions; 24 | 25 | /** 26 | * Constructor. 27 | * 28 | * @param array $data { 29 | * Optional. Data for populating the Message object. 30 | * 31 | * @type array<\Google\Analytics\Data\V1alpha\SegmentParameterFilterExpression>|\Google\Protobuf\Internal\RepeatedField $expressions 32 | * The list of segment parameter filter expressions. 33 | * } 34 | */ 35 | public function __construct($data = NULL) { 36 | \GPBMetadata\Google\Analytics\Data\V1Alpha\Data::initOnce(); 37 | parent::__construct($data); 38 | } 39 | 40 | /** 41 | * The list of segment parameter filter expressions. 42 | * 43 | * Generated from protobuf field repeated .google.analytics.data.v1alpha.SegmentParameterFilterExpression expressions = 1; 44 | * @return \Google\Protobuf\Internal\RepeatedField 45 | */ 46 | public function getExpressions() 47 | { 48 | return $this->expressions; 49 | } 50 | 51 | /** 52 | * The list of segment parameter filter expressions. 53 | * 54 | * Generated from protobuf field repeated .google.analytics.data.v1alpha.SegmentParameterFilterExpression expressions = 1; 55 | * @param array<\Google\Analytics\Data\V1alpha\SegmentParameterFilterExpression>|\Google\Protobuf\Internal\RepeatedField $var 56 | * @return $this 57 | */ 58 | public function setExpressions($var) 59 | { 60 | $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Analytics\Data\V1alpha\SegmentParameterFilterExpression::class); 61 | $this->expressions = $arr; 62 | 63 | return $this; 64 | } 65 | 66 | } 67 | 68 | -------------------------------------------------------------------------------- /src/V1alpha/SessionCriteriaScoping.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1alpha.SessionCriteriaScoping 14 | */ 15 | class SessionCriteriaScoping 16 | { 17 | /** 18 | * Unspecified criteria scoping. Do not specify. 19 | * 20 | * Generated from protobuf enum SESSION_CRITERIA_SCOPING_UNSPECIFIED = 0; 21 | */ 22 | const SESSION_CRITERIA_SCOPING_UNSPECIFIED = 0; 23 | /** 24 | * If the criteria is satisfied within one event, the session matches the 25 | * criteria. 26 | * 27 | * Generated from protobuf enum SESSION_CRITERIA_WITHIN_SAME_EVENT = 1; 28 | */ 29 | const SESSION_CRITERIA_WITHIN_SAME_EVENT = 1; 30 | /** 31 | * If the criteria is satisfied within one session, the session matches 32 | * the criteria. 33 | * 34 | * Generated from protobuf enum SESSION_CRITERIA_WITHIN_SAME_SESSION = 2; 35 | */ 36 | const SESSION_CRITERIA_WITHIN_SAME_SESSION = 2; 37 | 38 | private static $valueToName = [ 39 | self::SESSION_CRITERIA_SCOPING_UNSPECIFIED => 'SESSION_CRITERIA_SCOPING_UNSPECIFIED', 40 | self::SESSION_CRITERIA_WITHIN_SAME_EVENT => 'SESSION_CRITERIA_WITHIN_SAME_EVENT', 41 | self::SESSION_CRITERIA_WITHIN_SAME_SESSION => 'SESSION_CRITERIA_WITHIN_SAME_SESSION', 42 | ]; 43 | 44 | public static function name($value) 45 | { 46 | if (!isset(self::$valueToName[$value])) { 47 | throw new UnexpectedValueException(sprintf( 48 | 'Enum %s has no name defined for value %s', __CLASS__, $value)); 49 | } 50 | return self::$valueToName[$value]; 51 | } 52 | 53 | 54 | public static function value($name) 55 | { 56 | $const = __CLASS__ . '::' . strtoupper($name); 57 | if (!defined($const)) { 58 | throw new UnexpectedValueException(sprintf( 59 | 'Enum %s has no value defined for name %s', __CLASS__, $name)); 60 | } 61 | return constant($const); 62 | } 63 | } 64 | 65 | -------------------------------------------------------------------------------- /src/V1alpha/SessionExclusionDuration.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1alpha.SessionExclusionDuration 14 | */ 15 | class SessionExclusionDuration 16 | { 17 | /** 18 | * Unspecified exclusion duration. Do not specify. 19 | * 20 | * Generated from protobuf enum SESSION_EXCLUSION_DURATION_UNSPECIFIED = 0; 21 | */ 22 | const SESSION_EXCLUSION_DURATION_UNSPECIFIED = 0; 23 | /** 24 | * Temporarily exclude sessions from the segment during periods when the 25 | * session meets the `sessionExclusionCriteria` condition. 26 | * 27 | * Generated from protobuf enum SESSION_EXCLUSION_TEMPORARY = 1; 28 | */ 29 | const SESSION_EXCLUSION_TEMPORARY = 1; 30 | /** 31 | * Permanently exclude sessions from the segment if the session ever meets 32 | * the `sessionExclusionCriteria` condition. 33 | * 34 | * Generated from protobuf enum SESSION_EXCLUSION_PERMANENT = 2; 35 | */ 36 | const SESSION_EXCLUSION_PERMANENT = 2; 37 | 38 | private static $valueToName = [ 39 | self::SESSION_EXCLUSION_DURATION_UNSPECIFIED => 'SESSION_EXCLUSION_DURATION_UNSPECIFIED', 40 | self::SESSION_EXCLUSION_TEMPORARY => 'SESSION_EXCLUSION_TEMPORARY', 41 | self::SESSION_EXCLUSION_PERMANENT => 'SESSION_EXCLUSION_PERMANENT', 42 | ]; 43 | 44 | public static function name($value) 45 | { 46 | if (!isset(self::$valueToName[$value])) { 47 | throw new UnexpectedValueException(sprintf( 48 | 'Enum %s has no name defined for value %s', __CLASS__, $value)); 49 | } 50 | return self::$valueToName[$value]; 51 | } 52 | 53 | 54 | public static function value($name) 55 | { 56 | $const = __CLASS__ . '::' . strtoupper($name); 57 | if (!defined($const)) { 58 | throw new UnexpectedValueException(sprintf( 59 | 'Enum %s has no value defined for name %s', __CLASS__, $name)); 60 | } 61 | return constant($const); 62 | } 63 | } 64 | 65 | -------------------------------------------------------------------------------- /src/V1alpha/SessionSegmentCriteria.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1alpha.SessionSegmentCriteria 16 | */ 17 | class SessionSegmentCriteria extends \Google\Protobuf\Internal\Message 18 | { 19 | /** 20 | * A session matches this criteria if the session matches each of these 21 | * `andConditionGroups`. 22 | * 23 | * Generated from protobuf field repeated .google.analytics.data.v1alpha.SessionSegmentConditionGroup and_condition_groups = 1; 24 | */ 25 | private $and_condition_groups; 26 | 27 | /** 28 | * Constructor. 29 | * 30 | * @param array $data { 31 | * Optional. Data for populating the Message object. 32 | * 33 | * @type array<\Google\Analytics\Data\V1alpha\SessionSegmentConditionGroup>|\Google\Protobuf\Internal\RepeatedField $and_condition_groups 34 | * A session matches this criteria if the session matches each of these 35 | * `andConditionGroups`. 36 | * } 37 | */ 38 | public function __construct($data = NULL) { 39 | \GPBMetadata\Google\Analytics\Data\V1Alpha\Data::initOnce(); 40 | parent::__construct($data); 41 | } 42 | 43 | /** 44 | * A session matches this criteria if the session matches each of these 45 | * `andConditionGroups`. 46 | * 47 | * Generated from protobuf field repeated .google.analytics.data.v1alpha.SessionSegmentConditionGroup and_condition_groups = 1; 48 | * @return \Google\Protobuf\Internal\RepeatedField 49 | */ 50 | public function getAndConditionGroups() 51 | { 52 | return $this->and_condition_groups; 53 | } 54 | 55 | /** 56 | * A session matches this criteria if the session matches each of these 57 | * `andConditionGroups`. 58 | * 59 | * Generated from protobuf field repeated .google.analytics.data.v1alpha.SessionSegmentConditionGroup and_condition_groups = 1; 60 | * @param array<\Google\Analytics\Data\V1alpha\SessionSegmentConditionGroup>|\Google\Protobuf\Internal\RepeatedField $var 61 | * @return $this 62 | */ 63 | public function setAndConditionGroups($var) 64 | { 65 | $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Analytics\Data\V1alpha\SessionSegmentConditionGroup::class); 66 | $this->and_condition_groups = $arr; 67 | 68 | return $this; 69 | } 70 | 71 | } 72 | 73 | -------------------------------------------------------------------------------- /src/V1alpha/StringFilter.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1alpha.StringFilter 15 | */ 16 | class StringFilter extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * The match type for this filter. 20 | * 21 | * Generated from protobuf field .google.analytics.data.v1alpha.StringFilter.MatchType match_type = 1; 22 | */ 23 | protected $match_type = 0; 24 | /** 25 | * The string value used for the matching. 26 | * 27 | * Generated from protobuf field string value = 2; 28 | */ 29 | protected $value = ''; 30 | /** 31 | * If true, the string value is case sensitive. 32 | * 33 | * Generated from protobuf field bool case_sensitive = 3; 34 | */ 35 | protected $case_sensitive = false; 36 | 37 | /** 38 | * Constructor. 39 | * 40 | * @param array $data { 41 | * Optional. Data for populating the Message object. 42 | * 43 | * @type int $match_type 44 | * The match type for this filter. 45 | * @type string $value 46 | * The string value used for the matching. 47 | * @type bool $case_sensitive 48 | * If true, the string value is case sensitive. 49 | * } 50 | */ 51 | public function __construct($data = NULL) { 52 | \GPBMetadata\Google\Analytics\Data\V1Alpha\Data::initOnce(); 53 | parent::__construct($data); 54 | } 55 | 56 | /** 57 | * The match type for this filter. 58 | * 59 | * Generated from protobuf field .google.analytics.data.v1alpha.StringFilter.MatchType match_type = 1; 60 | * @return int 61 | */ 62 | public function getMatchType() 63 | { 64 | return $this->match_type; 65 | } 66 | 67 | /** 68 | * The match type for this filter. 69 | * 70 | * Generated from protobuf field .google.analytics.data.v1alpha.StringFilter.MatchType match_type = 1; 71 | * @param int $var 72 | * @return $this 73 | */ 74 | public function setMatchType($var) 75 | { 76 | GPBUtil::checkEnum($var, \Google\Analytics\Data\V1alpha\StringFilter\MatchType::class); 77 | $this->match_type = $var; 78 | 79 | return $this; 80 | } 81 | 82 | /** 83 | * The string value used for the matching. 84 | * 85 | * Generated from protobuf field string value = 2; 86 | * @return string 87 | */ 88 | public function getValue() 89 | { 90 | return $this->value; 91 | } 92 | 93 | /** 94 | * The string value used for the matching. 95 | * 96 | * Generated from protobuf field string value = 2; 97 | * @param string $var 98 | * @return $this 99 | */ 100 | public function setValue($var) 101 | { 102 | GPBUtil::checkString($var, True); 103 | $this->value = $var; 104 | 105 | return $this; 106 | } 107 | 108 | /** 109 | * If true, the string value is case sensitive. 110 | * 111 | * Generated from protobuf field bool case_sensitive = 3; 112 | * @return bool 113 | */ 114 | public function getCaseSensitive() 115 | { 116 | return $this->case_sensitive; 117 | } 118 | 119 | /** 120 | * If true, the string value is case sensitive. 121 | * 122 | * Generated from protobuf field bool case_sensitive = 3; 123 | * @param bool $var 124 | * @return $this 125 | */ 126 | public function setCaseSensitive($var) 127 | { 128 | GPBUtil::checkBool($var); 129 | $this->case_sensitive = $var; 130 | 131 | return $this; 132 | } 133 | 134 | } 135 | 136 | -------------------------------------------------------------------------------- /src/V1alpha/StringFilter/MatchType.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1alpha.StringFilter.MatchType 13 | */ 14 | class MatchType 15 | { 16 | /** 17 | * Unspecified 18 | * 19 | * Generated from protobuf enum MATCH_TYPE_UNSPECIFIED = 0; 20 | */ 21 | const MATCH_TYPE_UNSPECIFIED = 0; 22 | /** 23 | * Exact match of the string value. 24 | * 25 | * Generated from protobuf enum EXACT = 1; 26 | */ 27 | const EXACT = 1; 28 | /** 29 | * Begins with the string value. 30 | * 31 | * Generated from protobuf enum BEGINS_WITH = 2; 32 | */ 33 | const BEGINS_WITH = 2; 34 | /** 35 | * Ends with the string value. 36 | * 37 | * Generated from protobuf enum ENDS_WITH = 3; 38 | */ 39 | const ENDS_WITH = 3; 40 | /** 41 | * Contains the string value. 42 | * 43 | * Generated from protobuf enum CONTAINS = 4; 44 | */ 45 | const CONTAINS = 4; 46 | /** 47 | * Full match for the regular expression with the string value. 48 | * 49 | * Generated from protobuf enum FULL_REGEXP = 5; 50 | */ 51 | const FULL_REGEXP = 5; 52 | /** 53 | * Partial match for the regular expression with the string value. 54 | * 55 | * Generated from protobuf enum PARTIAL_REGEXP = 6; 56 | */ 57 | const PARTIAL_REGEXP = 6; 58 | 59 | private static $valueToName = [ 60 | self::MATCH_TYPE_UNSPECIFIED => 'MATCH_TYPE_UNSPECIFIED', 61 | self::EXACT => 'EXACT', 62 | self::BEGINS_WITH => 'BEGINS_WITH', 63 | self::ENDS_WITH => 'ENDS_WITH', 64 | self::CONTAINS => 'CONTAINS', 65 | self::FULL_REGEXP => 'FULL_REGEXP', 66 | self::PARTIAL_REGEXP => 'PARTIAL_REGEXP', 67 | ]; 68 | 69 | public static function name($value) 70 | { 71 | if (!isset(self::$valueToName[$value])) { 72 | throw new UnexpectedValueException(sprintf( 73 | 'Enum %s has no name defined for value %s', __CLASS__, $value)); 74 | } 75 | return self::$valueToName[$value]; 76 | } 77 | 78 | 79 | public static function value($name) 80 | { 81 | $const = __CLASS__ . '::' . strtoupper($name); 82 | if (!defined($const)) { 83 | throw new UnexpectedValueException(sprintf( 84 | 'Enum %s has no value defined for name %s', __CLASS__, $name)); 85 | } 86 | return constant($const); 87 | } 88 | } 89 | 90 | 91 | -------------------------------------------------------------------------------- /src/V1alpha/UserCriteriaScoping.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1alpha.UserCriteriaScoping 14 | */ 15 | class UserCriteriaScoping 16 | { 17 | /** 18 | * Unspecified criteria scoping. Do not specify. 19 | * 20 | * Generated from protobuf enum USER_CRITERIA_SCOPING_UNSPECIFIED = 0; 21 | */ 22 | const USER_CRITERIA_SCOPING_UNSPECIFIED = 0; 23 | /** 24 | * If the criteria is satisfied within one event, the user matches the 25 | * criteria. 26 | * 27 | * Generated from protobuf enum USER_CRITERIA_WITHIN_SAME_EVENT = 1; 28 | */ 29 | const USER_CRITERIA_WITHIN_SAME_EVENT = 1; 30 | /** 31 | * If the criteria is satisfied within one session, the user matches the 32 | * criteria. 33 | * 34 | * Generated from protobuf enum USER_CRITERIA_WITHIN_SAME_SESSION = 2; 35 | */ 36 | const USER_CRITERIA_WITHIN_SAME_SESSION = 2; 37 | /** 38 | * If the criteria is satisfied by any events for the user, the user 39 | * matches the criteria. 40 | * 41 | * Generated from protobuf enum USER_CRITERIA_ACROSS_ALL_SESSIONS = 3; 42 | */ 43 | const USER_CRITERIA_ACROSS_ALL_SESSIONS = 3; 44 | 45 | private static $valueToName = [ 46 | self::USER_CRITERIA_SCOPING_UNSPECIFIED => 'USER_CRITERIA_SCOPING_UNSPECIFIED', 47 | self::USER_CRITERIA_WITHIN_SAME_EVENT => 'USER_CRITERIA_WITHIN_SAME_EVENT', 48 | self::USER_CRITERIA_WITHIN_SAME_SESSION => 'USER_CRITERIA_WITHIN_SAME_SESSION', 49 | self::USER_CRITERIA_ACROSS_ALL_SESSIONS => 'USER_CRITERIA_ACROSS_ALL_SESSIONS', 50 | ]; 51 | 52 | public static function name($value) 53 | { 54 | if (!isset(self::$valueToName[$value])) { 55 | throw new UnexpectedValueException(sprintf( 56 | 'Enum %s has no name defined for value %s', __CLASS__, $value)); 57 | } 58 | return self::$valueToName[$value]; 59 | } 60 | 61 | 62 | public static function value($name) 63 | { 64 | $const = __CLASS__ . '::' . strtoupper($name); 65 | if (!defined($const)) { 66 | throw new UnexpectedValueException(sprintf( 67 | 'Enum %s has no value defined for name %s', __CLASS__, $name)); 68 | } 69 | return constant($const); 70 | } 71 | } 72 | 73 | -------------------------------------------------------------------------------- /src/V1alpha/UserExclusionDuration.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1alpha.UserExclusionDuration 14 | */ 15 | class UserExclusionDuration 16 | { 17 | /** 18 | * Unspecified exclusion duration. Do not specify. 19 | * 20 | * Generated from protobuf enum USER_EXCLUSION_DURATION_UNSPECIFIED = 0; 21 | */ 22 | const USER_EXCLUSION_DURATION_UNSPECIFIED = 0; 23 | /** 24 | * Temporarily exclude users from the segment during periods when the 25 | * user meets the `userExclusionCriteria` condition. 26 | * 27 | * Generated from protobuf enum USER_EXCLUSION_TEMPORARY = 1; 28 | */ 29 | const USER_EXCLUSION_TEMPORARY = 1; 30 | /** 31 | * Permanently exclude users from the segment if the user ever meets the 32 | * `userExclusionCriteria` condition. 33 | * 34 | * Generated from protobuf enum USER_EXCLUSION_PERMANENT = 2; 35 | */ 36 | const USER_EXCLUSION_PERMANENT = 2; 37 | 38 | private static $valueToName = [ 39 | self::USER_EXCLUSION_DURATION_UNSPECIFIED => 'USER_EXCLUSION_DURATION_UNSPECIFIED', 40 | self::USER_EXCLUSION_TEMPORARY => 'USER_EXCLUSION_TEMPORARY', 41 | self::USER_EXCLUSION_PERMANENT => 'USER_EXCLUSION_PERMANENT', 42 | ]; 43 | 44 | public static function name($value) 45 | { 46 | if (!isset(self::$valueToName[$value])) { 47 | throw new UnexpectedValueException(sprintf( 48 | 'Enum %s has no name defined for value %s', __CLASS__, $value)); 49 | } 50 | return self::$valueToName[$value]; 51 | } 52 | 53 | 54 | public static function value($name) 55 | { 56 | $const = __CLASS__ . '::' . strtoupper($name); 57 | if (!defined($const)) { 58 | throw new UnexpectedValueException(sprintf( 59 | 'Enum %s has no value defined for name %s', __CLASS__, $name)); 60 | } 61 | return constant($const); 62 | } 63 | } 64 | 65 | -------------------------------------------------------------------------------- /src/V1beta/AudienceDimension.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1beta.AudienceDimension 16 | */ 17 | class AudienceDimension extends \Google\Protobuf\Internal\Message 18 | { 19 | /** 20 | * Optional. The API name of the dimension. See the [API 21 | * Dimensions](https://developers.google.com/analytics/devguides/reporting/data/v1/audience-list-api-schema#dimensions) 22 | * for the list of dimension names. 23 | * 24 | * Generated from protobuf field string dimension_name = 1 [(.google.api.field_behavior) = OPTIONAL]; 25 | */ 26 | protected $dimension_name = ''; 27 | 28 | /** 29 | * Constructor. 30 | * 31 | * @param array $data { 32 | * Optional. Data for populating the Message object. 33 | * 34 | * @type string $dimension_name 35 | * Optional. The API name of the dimension. See the [API 36 | * Dimensions](https://developers.google.com/analytics/devguides/reporting/data/v1/audience-list-api-schema#dimensions) 37 | * for the list of dimension names. 38 | * } 39 | */ 40 | public function __construct($data = NULL) { 41 | \GPBMetadata\Google\Analytics\Data\V1Beta\AnalyticsDataApi::initOnce(); 42 | parent::__construct($data); 43 | } 44 | 45 | /** 46 | * Optional. The API name of the dimension. See the [API 47 | * Dimensions](https://developers.google.com/analytics/devguides/reporting/data/v1/audience-list-api-schema#dimensions) 48 | * for the list of dimension names. 49 | * 50 | * Generated from protobuf field string dimension_name = 1 [(.google.api.field_behavior) = OPTIONAL]; 51 | * @return string 52 | */ 53 | public function getDimensionName() 54 | { 55 | return $this->dimension_name; 56 | } 57 | 58 | /** 59 | * Optional. The API name of the dimension. See the [API 60 | * Dimensions](https://developers.google.com/analytics/devguides/reporting/data/v1/audience-list-api-schema#dimensions) 61 | * for the list of dimension names. 62 | * 63 | * Generated from protobuf field string dimension_name = 1 [(.google.api.field_behavior) = OPTIONAL]; 64 | * @param string $var 65 | * @return $this 66 | */ 67 | public function setDimensionName($var) 68 | { 69 | GPBUtil::checkString($var, True); 70 | $this->dimension_name = $var; 71 | 72 | return $this; 73 | } 74 | 75 | } 76 | 77 | -------------------------------------------------------------------------------- /src/V1beta/AudienceDimensionValue.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1beta.AudienceDimensionValue 15 | */ 16 | class AudienceDimensionValue extends \Google\Protobuf\Internal\Message 17 | { 18 | protected $one_value; 19 | 20 | /** 21 | * Constructor. 22 | * 23 | * @param array $data { 24 | * Optional. Data for populating the Message object. 25 | * 26 | * @type string $value 27 | * Value as a string if the dimension type is a string. 28 | * } 29 | */ 30 | public function __construct($data = NULL) { 31 | \GPBMetadata\Google\Analytics\Data\V1Beta\AnalyticsDataApi::initOnce(); 32 | parent::__construct($data); 33 | } 34 | 35 | /** 36 | * Value as a string if the dimension type is a string. 37 | * 38 | * Generated from protobuf field string value = 1; 39 | * @return string 40 | */ 41 | public function getValue() 42 | { 43 | return $this->readOneof(1); 44 | } 45 | 46 | public function hasValue() 47 | { 48 | return $this->hasOneof(1); 49 | } 50 | 51 | /** 52 | * Value as a string if the dimension type is a string. 53 | * 54 | * Generated from protobuf field string value = 1; 55 | * @param string $var 56 | * @return $this 57 | */ 58 | public function setValue($var) 59 | { 60 | GPBUtil::checkString($var, True); 61 | $this->writeOneof(1, $var); 62 | 63 | return $this; 64 | } 65 | 66 | /** 67 | * @return string 68 | */ 69 | public function getOneValue() 70 | { 71 | return $this->whichOneof("one_value"); 72 | } 73 | 74 | } 75 | 76 | -------------------------------------------------------------------------------- /src/V1beta/AudienceExport/State.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1beta.AudienceExport.State 13 | */ 14 | class State 15 | { 16 | /** 17 | * Unspecified state will never be used. 18 | * 19 | * Generated from protobuf enum STATE_UNSPECIFIED = 0; 20 | */ 21 | const STATE_UNSPECIFIED = 0; 22 | /** 23 | * The AudienceExport is currently creating and will be available in the 24 | * future. Creating occurs immediately after the CreateAudienceExport call. 25 | * 26 | * Generated from protobuf enum CREATING = 1; 27 | */ 28 | const CREATING = 1; 29 | /** 30 | * The AudienceExport is fully created and ready for querying. An 31 | * AudienceExport is updated to active asynchronously from a request; this 32 | * occurs some time (for example 15 minutes) after the initial create call. 33 | * 34 | * Generated from protobuf enum ACTIVE = 2; 35 | */ 36 | const ACTIVE = 2; 37 | /** 38 | * The AudienceExport failed to be created. It is possible that 39 | * re-requesting this audience export will succeed. 40 | * 41 | * Generated from protobuf enum FAILED = 3; 42 | */ 43 | const FAILED = 3; 44 | 45 | private static $valueToName = [ 46 | self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', 47 | self::CREATING => 'CREATING', 48 | self::ACTIVE => 'ACTIVE', 49 | self::FAILED => 'FAILED', 50 | ]; 51 | 52 | public static function name($value) 53 | { 54 | if (!isset(self::$valueToName[$value])) { 55 | throw new UnexpectedValueException(sprintf( 56 | 'Enum %s has no name defined for value %s', __CLASS__, $value)); 57 | } 58 | return self::$valueToName[$value]; 59 | } 60 | 61 | 62 | public static function value($name) 63 | { 64 | $const = __CLASS__ . '::' . strtoupper($name); 65 | if (!defined($const)) { 66 | throw new UnexpectedValueException(sprintf( 67 | 'Enum %s has no value defined for name %s', __CLASS__, $name)); 68 | } 69 | return constant($const); 70 | } 71 | } 72 | 73 | 74 | -------------------------------------------------------------------------------- /src/V1beta/AudienceExportMetadata.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1beta.AudienceExportMetadata 15 | */ 16 | class AudienceExportMetadata extends \Google\Protobuf\Internal\Message 17 | { 18 | 19 | /** 20 | * Constructor. 21 | * 22 | * @param array $data { 23 | * Optional. Data for populating the Message object. 24 | * 25 | * } 26 | */ 27 | public function __construct($data = NULL) { 28 | \GPBMetadata\Google\Analytics\Data\V1Beta\AnalyticsDataApi::initOnce(); 29 | parent::__construct($data); 30 | } 31 | 32 | } 33 | 34 | -------------------------------------------------------------------------------- /src/V1beta/AudienceRow.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1beta.AudienceRow 15 | */ 16 | class AudienceRow extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * Each dimension value attribute for an audience user. One dimension value 20 | * will be added for each dimension column requested. 21 | * 22 | * Generated from protobuf field repeated .google.analytics.data.v1beta.AudienceDimensionValue dimension_values = 1; 23 | */ 24 | private $dimension_values; 25 | 26 | /** 27 | * Constructor. 28 | * 29 | * @param array $data { 30 | * Optional. Data for populating the Message object. 31 | * 32 | * @type array<\Google\Analytics\Data\V1beta\AudienceDimensionValue>|\Google\Protobuf\Internal\RepeatedField $dimension_values 33 | * Each dimension value attribute for an audience user. One dimension value 34 | * will be added for each dimension column requested. 35 | * } 36 | */ 37 | public function __construct($data = NULL) { 38 | \GPBMetadata\Google\Analytics\Data\V1Beta\AnalyticsDataApi::initOnce(); 39 | parent::__construct($data); 40 | } 41 | 42 | /** 43 | * Each dimension value attribute for an audience user. One dimension value 44 | * will be added for each dimension column requested. 45 | * 46 | * Generated from protobuf field repeated .google.analytics.data.v1beta.AudienceDimensionValue dimension_values = 1; 47 | * @return \Google\Protobuf\Internal\RepeatedField 48 | */ 49 | public function getDimensionValues() 50 | { 51 | return $this->dimension_values; 52 | } 53 | 54 | /** 55 | * Each dimension value attribute for an audience user. One dimension value 56 | * will be added for each dimension column requested. 57 | * 58 | * Generated from protobuf field repeated .google.analytics.data.v1beta.AudienceDimensionValue dimension_values = 1; 59 | * @param array<\Google\Analytics\Data\V1beta\AudienceDimensionValue>|\Google\Protobuf\Internal\RepeatedField $var 60 | * @return $this 61 | */ 62 | public function setDimensionValues($var) 63 | { 64 | $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Analytics\Data\V1beta\AudienceDimensionValue::class); 65 | $this->dimension_values = $arr; 66 | 67 | return $this; 68 | } 69 | 70 | } 71 | 72 | -------------------------------------------------------------------------------- /src/V1beta/CohortReportSettings.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1beta.CohortReportSettings 15 | */ 16 | class CohortReportSettings extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * If true, accumulates the result from first touch day to the end day. Not 20 | * supported in `RunReportRequest`. 21 | * 22 | * Generated from protobuf field bool accumulate = 1; 23 | */ 24 | protected $accumulate = false; 25 | 26 | /** 27 | * Constructor. 28 | * 29 | * @param array $data { 30 | * Optional. Data for populating the Message object. 31 | * 32 | * @type bool $accumulate 33 | * If true, accumulates the result from first touch day to the end day. Not 34 | * supported in `RunReportRequest`. 35 | * } 36 | */ 37 | public function __construct($data = NULL) { 38 | \GPBMetadata\Google\Analytics\Data\V1Beta\Data::initOnce(); 39 | parent::__construct($data); 40 | } 41 | 42 | /** 43 | * If true, accumulates the result from first touch day to the end day. Not 44 | * supported in `RunReportRequest`. 45 | * 46 | * Generated from protobuf field bool accumulate = 1; 47 | * @return bool 48 | */ 49 | public function getAccumulate() 50 | { 51 | return $this->accumulate; 52 | } 53 | 54 | /** 55 | * If true, accumulates the result from first touch day to the end day. Not 56 | * supported in `RunReportRequest`. 57 | * 58 | * Generated from protobuf field bool accumulate = 1; 59 | * @param bool $var 60 | * @return $this 61 | */ 62 | public function setAccumulate($var) 63 | { 64 | GPBUtil::checkBool($var); 65 | $this->accumulate = $var; 66 | 67 | return $this; 68 | } 69 | 70 | } 71 | 72 | -------------------------------------------------------------------------------- /src/V1beta/CohortsRange/Granularity.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1beta.CohortsRange.Granularity 14 | */ 15 | class Granularity 16 | { 17 | /** 18 | * Should never be specified. 19 | * 20 | * Generated from protobuf enum GRANULARITY_UNSPECIFIED = 0; 21 | */ 22 | const GRANULARITY_UNSPECIFIED = 0; 23 | /** 24 | * Daily granularity. Commonly used if the cohort's `dateRange` is a single 25 | * day and the request contains `cohortNthDay`. 26 | * 27 | * Generated from protobuf enum DAILY = 1; 28 | */ 29 | const DAILY = 1; 30 | /** 31 | * Weekly granularity. Commonly used if the cohort's `dateRange` is a week 32 | * in duration (starting on Sunday and ending on Saturday) and the request 33 | * contains `cohortNthWeek`. 34 | * 35 | * Generated from protobuf enum WEEKLY = 2; 36 | */ 37 | const WEEKLY = 2; 38 | /** 39 | * Monthly granularity. Commonly used if the cohort's `dateRange` is a month 40 | * in duration and the request contains `cohortNthMonth`. 41 | * 42 | * Generated from protobuf enum MONTHLY = 3; 43 | */ 44 | const MONTHLY = 3; 45 | 46 | private static $valueToName = [ 47 | self::GRANULARITY_UNSPECIFIED => 'GRANULARITY_UNSPECIFIED', 48 | self::DAILY => 'DAILY', 49 | self::WEEKLY => 'WEEKLY', 50 | self::MONTHLY => 'MONTHLY', 51 | ]; 52 | 53 | public static function name($value) 54 | { 55 | if (!isset(self::$valueToName[$value])) { 56 | throw new UnexpectedValueException(sprintf( 57 | 'Enum %s has no name defined for value %s', __CLASS__, $value)); 58 | } 59 | return self::$valueToName[$value]; 60 | } 61 | 62 | 63 | public static function value($name) 64 | { 65 | $const = __CLASS__ . '::' . strtoupper($name); 66 | if (!defined($const)) { 67 | throw new UnexpectedValueException(sprintf( 68 | 'Enum %s has no value defined for name %s', __CLASS__, $name)); 69 | } 70 | return constant($const); 71 | } 72 | } 73 | 74 | 75 | -------------------------------------------------------------------------------- /src/V1beta/Compatibility.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1beta.Compatibility 13 | */ 14 | class Compatibility 15 | { 16 | /** 17 | * Unspecified compatibility. 18 | * 19 | * Generated from protobuf enum COMPATIBILITY_UNSPECIFIED = 0; 20 | */ 21 | const COMPATIBILITY_UNSPECIFIED = 0; 22 | /** 23 | * The dimension or metric is compatible. This dimension or metric can be 24 | * successfully added to a report. 25 | * 26 | * Generated from protobuf enum COMPATIBLE = 1; 27 | */ 28 | const COMPATIBLE = 1; 29 | /** 30 | * The dimension or metric is incompatible. This dimension or metric cannot be 31 | * successfully added to a report. 32 | * 33 | * Generated from protobuf enum INCOMPATIBLE = 2; 34 | */ 35 | const INCOMPATIBLE = 2; 36 | 37 | private static $valueToName = [ 38 | self::COMPATIBILITY_UNSPECIFIED => 'COMPATIBILITY_UNSPECIFIED', 39 | self::COMPATIBLE => 'COMPATIBLE', 40 | self::INCOMPATIBLE => 'INCOMPATIBLE', 41 | ]; 42 | 43 | public static function name($value) 44 | { 45 | if (!isset(self::$valueToName[$value])) { 46 | throw new UnexpectedValueException(sprintf( 47 | 'Enum %s has no name defined for value %s', __CLASS__, $value)); 48 | } 49 | return self::$valueToName[$value]; 50 | } 51 | 52 | 53 | public static function value($name) 54 | { 55 | $const = __CLASS__ . '::' . strtoupper($name); 56 | if (!defined($const)) { 57 | throw new UnexpectedValueException(sprintf( 58 | 'Enum %s has no value defined for name %s', __CLASS__, $name)); 59 | } 60 | return constant($const); 61 | } 62 | } 63 | 64 | -------------------------------------------------------------------------------- /src/V1beta/DimensionExpression/CaseExpression.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1beta.DimensionExpression.CaseExpression 15 | */ 16 | class CaseExpression extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * Name of a dimension. The name must refer back to a name in dimensions 20 | * field of the request. 21 | * 22 | * Generated from protobuf field string dimension_name = 1; 23 | */ 24 | protected $dimension_name = ''; 25 | 26 | /** 27 | * Constructor. 28 | * 29 | * @param array $data { 30 | * Optional. Data for populating the Message object. 31 | * 32 | * @type string $dimension_name 33 | * Name of a dimension. The name must refer back to a name in dimensions 34 | * field of the request. 35 | * } 36 | */ 37 | public function __construct($data = NULL) { 38 | \GPBMetadata\Google\Analytics\Data\V1Beta\Data::initOnce(); 39 | parent::__construct($data); 40 | } 41 | 42 | /** 43 | * Name of a dimension. The name must refer back to a name in dimensions 44 | * field of the request. 45 | * 46 | * Generated from protobuf field string dimension_name = 1; 47 | * @return string 48 | */ 49 | public function getDimensionName() 50 | { 51 | return $this->dimension_name; 52 | } 53 | 54 | /** 55 | * Name of a dimension. The name must refer back to a name in dimensions 56 | * field of the request. 57 | * 58 | * Generated from protobuf field string dimension_name = 1; 59 | * @param string $var 60 | * @return $this 61 | */ 62 | public function setDimensionName($var) 63 | { 64 | GPBUtil::checkString($var, True); 65 | $this->dimension_name = $var; 66 | 67 | return $this; 68 | } 69 | 70 | } 71 | 72 | 73 | -------------------------------------------------------------------------------- /src/V1beta/DimensionHeader.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1beta.DimensionHeader 18 | */ 19 | class DimensionHeader extends \Google\Protobuf\Internal\Message 20 | { 21 | /** 22 | * The dimension's name. 23 | * 24 | * Generated from protobuf field string name = 1; 25 | */ 26 | protected $name = ''; 27 | 28 | /** 29 | * Constructor. 30 | * 31 | * @param array $data { 32 | * Optional. Data for populating the Message object. 33 | * 34 | * @type string $name 35 | * The dimension's name. 36 | * } 37 | */ 38 | public function __construct($data = NULL) { 39 | \GPBMetadata\Google\Analytics\Data\V1Beta\Data::initOnce(); 40 | parent::__construct($data); 41 | } 42 | 43 | /** 44 | * The dimension's name. 45 | * 46 | * Generated from protobuf field string name = 1; 47 | * @return string 48 | */ 49 | public function getName() 50 | { 51 | return $this->name; 52 | } 53 | 54 | /** 55 | * The dimension's name. 56 | * 57 | * Generated from protobuf field string name = 1; 58 | * @param string $var 59 | * @return $this 60 | */ 61 | public function setName($var) 62 | { 63 | GPBUtil::checkString($var, True); 64 | $this->name = $var; 65 | 66 | return $this; 67 | } 68 | 69 | } 70 | 71 | -------------------------------------------------------------------------------- /src/V1beta/DimensionValue.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1beta.DimensionValue 15 | */ 16 | class DimensionValue extends \Google\Protobuf\Internal\Message 17 | { 18 | protected $one_value; 19 | 20 | /** 21 | * Constructor. 22 | * 23 | * @param array $data { 24 | * Optional. Data for populating the Message object. 25 | * 26 | * @type string $value 27 | * Value as a string if the dimension type is a string. 28 | * } 29 | */ 30 | public function __construct($data = NULL) { 31 | \GPBMetadata\Google\Analytics\Data\V1Beta\Data::initOnce(); 32 | parent::__construct($data); 33 | } 34 | 35 | /** 36 | * Value as a string if the dimension type is a string. 37 | * 38 | * Generated from protobuf field string value = 1; 39 | * @return string 40 | */ 41 | public function getValue() 42 | { 43 | return $this->readOneof(1); 44 | } 45 | 46 | public function hasValue() 47 | { 48 | return $this->hasOneof(1); 49 | } 50 | 51 | /** 52 | * Value as a string if the dimension type is a string. 53 | * 54 | * Generated from protobuf field string value = 1; 55 | * @param string $var 56 | * @return $this 57 | */ 58 | public function setValue($var) 59 | { 60 | GPBUtil::checkString($var, True); 61 | $this->writeOneof(1, $var); 62 | 63 | return $this; 64 | } 65 | 66 | /** 67 | * @return string 68 | */ 69 | public function getOneValue() 70 | { 71 | return $this->whichOneof("one_value"); 72 | } 73 | 74 | } 75 | 76 | -------------------------------------------------------------------------------- /src/V1beta/Filter/BetweenFilter.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1beta.Filter.BetweenFilter 15 | */ 16 | class BetweenFilter extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * Begins with this number. 20 | * 21 | * Generated from protobuf field .google.analytics.data.v1beta.NumericValue from_value = 1; 22 | */ 23 | protected $from_value = null; 24 | /** 25 | * Ends with this number. 26 | * 27 | * Generated from protobuf field .google.analytics.data.v1beta.NumericValue to_value = 2; 28 | */ 29 | protected $to_value = null; 30 | 31 | /** 32 | * Constructor. 33 | * 34 | * @param array $data { 35 | * Optional. Data for populating the Message object. 36 | * 37 | * @type \Google\Analytics\Data\V1beta\NumericValue $from_value 38 | * Begins with this number. 39 | * @type \Google\Analytics\Data\V1beta\NumericValue $to_value 40 | * Ends with this number. 41 | * } 42 | */ 43 | public function __construct($data = NULL) { 44 | \GPBMetadata\Google\Analytics\Data\V1Beta\Data::initOnce(); 45 | parent::__construct($data); 46 | } 47 | 48 | /** 49 | * Begins with this number. 50 | * 51 | * Generated from protobuf field .google.analytics.data.v1beta.NumericValue from_value = 1; 52 | * @return \Google\Analytics\Data\V1beta\NumericValue|null 53 | */ 54 | public function getFromValue() 55 | { 56 | return $this->from_value; 57 | } 58 | 59 | public function hasFromValue() 60 | { 61 | return isset($this->from_value); 62 | } 63 | 64 | public function clearFromValue() 65 | { 66 | unset($this->from_value); 67 | } 68 | 69 | /** 70 | * Begins with this number. 71 | * 72 | * Generated from protobuf field .google.analytics.data.v1beta.NumericValue from_value = 1; 73 | * @param \Google\Analytics\Data\V1beta\NumericValue $var 74 | * @return $this 75 | */ 76 | public function setFromValue($var) 77 | { 78 | GPBUtil::checkMessage($var, \Google\Analytics\Data\V1beta\NumericValue::class); 79 | $this->from_value = $var; 80 | 81 | return $this; 82 | } 83 | 84 | /** 85 | * Ends with this number. 86 | * 87 | * Generated from protobuf field .google.analytics.data.v1beta.NumericValue to_value = 2; 88 | * @return \Google\Analytics\Data\V1beta\NumericValue|null 89 | */ 90 | public function getToValue() 91 | { 92 | return $this->to_value; 93 | } 94 | 95 | public function hasToValue() 96 | { 97 | return isset($this->to_value); 98 | } 99 | 100 | public function clearToValue() 101 | { 102 | unset($this->to_value); 103 | } 104 | 105 | /** 106 | * Ends with this number. 107 | * 108 | * Generated from protobuf field .google.analytics.data.v1beta.NumericValue to_value = 2; 109 | * @param \Google\Analytics\Data\V1beta\NumericValue $var 110 | * @return $this 111 | */ 112 | public function setToValue($var) 113 | { 114 | GPBUtil::checkMessage($var, \Google\Analytics\Data\V1beta\NumericValue::class); 115 | $this->to_value = $var; 116 | 117 | return $this; 118 | } 119 | 120 | } 121 | 122 | 123 | -------------------------------------------------------------------------------- /src/V1beta/Filter/EmptyFilter.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1beta.Filter.EmptyFilter 15 | */ 16 | class EmptyFilter extends \Google\Protobuf\Internal\Message 17 | { 18 | 19 | /** 20 | * Constructor. 21 | * 22 | * @param array $data { 23 | * Optional. Data for populating the Message object. 24 | * 25 | * } 26 | */ 27 | public function __construct($data = NULL) { 28 | \GPBMetadata\Google\Analytics\Data\V1Beta\Data::initOnce(); 29 | parent::__construct($data); 30 | } 31 | 32 | } 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/V1beta/Filter/InListFilter.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1beta.Filter.InListFilter 15 | */ 16 | class InListFilter extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * The list of string values. 20 | * Must be non-empty. 21 | * 22 | * Generated from protobuf field repeated string values = 1; 23 | */ 24 | private $values; 25 | /** 26 | * If true, the string value is case sensitive. 27 | * 28 | * Generated from protobuf field bool case_sensitive = 2; 29 | */ 30 | protected $case_sensitive = false; 31 | 32 | /** 33 | * Constructor. 34 | * 35 | * @param array $data { 36 | * Optional. Data for populating the Message object. 37 | * 38 | * @type array|\Google\Protobuf\Internal\RepeatedField $values 39 | * The list of string values. 40 | * Must be non-empty. 41 | * @type bool $case_sensitive 42 | * If true, the string value is case sensitive. 43 | * } 44 | */ 45 | public function __construct($data = NULL) { 46 | \GPBMetadata\Google\Analytics\Data\V1Beta\Data::initOnce(); 47 | parent::__construct($data); 48 | } 49 | 50 | /** 51 | * The list of string values. 52 | * Must be non-empty. 53 | * 54 | * Generated from protobuf field repeated string values = 1; 55 | * @return \Google\Protobuf\Internal\RepeatedField 56 | */ 57 | public function getValues() 58 | { 59 | return $this->values; 60 | } 61 | 62 | /** 63 | * The list of string values. 64 | * Must be non-empty. 65 | * 66 | * Generated from protobuf field repeated string values = 1; 67 | * @param array|\Google\Protobuf\Internal\RepeatedField $var 68 | * @return $this 69 | */ 70 | public function setValues($var) 71 | { 72 | $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); 73 | $this->values = $arr; 74 | 75 | return $this; 76 | } 77 | 78 | /** 79 | * If true, the string value is case sensitive. 80 | * 81 | * Generated from protobuf field bool case_sensitive = 2; 82 | * @return bool 83 | */ 84 | public function getCaseSensitive() 85 | { 86 | return $this->case_sensitive; 87 | } 88 | 89 | /** 90 | * If true, the string value is case sensitive. 91 | * 92 | * Generated from protobuf field bool case_sensitive = 2; 93 | * @param bool $var 94 | * @return $this 95 | */ 96 | public function setCaseSensitive($var) 97 | { 98 | GPBUtil::checkBool($var); 99 | $this->case_sensitive = $var; 100 | 101 | return $this; 102 | } 103 | 104 | } 105 | 106 | 107 | -------------------------------------------------------------------------------- /src/V1beta/Filter/NumericFilter.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1beta.Filter.NumericFilter 15 | */ 16 | class NumericFilter extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * The operation type for this filter. 20 | * 21 | * Generated from protobuf field .google.analytics.data.v1beta.Filter.NumericFilter.Operation operation = 1; 22 | */ 23 | protected $operation = 0; 24 | /** 25 | * A numeric value or a date value. 26 | * 27 | * Generated from protobuf field .google.analytics.data.v1beta.NumericValue value = 2; 28 | */ 29 | protected $value = null; 30 | 31 | /** 32 | * Constructor. 33 | * 34 | * @param array $data { 35 | * Optional. Data for populating the Message object. 36 | * 37 | * @type int $operation 38 | * The operation type for this filter. 39 | * @type \Google\Analytics\Data\V1beta\NumericValue $value 40 | * A numeric value or a date value. 41 | * } 42 | */ 43 | public function __construct($data = NULL) { 44 | \GPBMetadata\Google\Analytics\Data\V1Beta\Data::initOnce(); 45 | parent::__construct($data); 46 | } 47 | 48 | /** 49 | * The operation type for this filter. 50 | * 51 | * Generated from protobuf field .google.analytics.data.v1beta.Filter.NumericFilter.Operation operation = 1; 52 | * @return int 53 | */ 54 | public function getOperation() 55 | { 56 | return $this->operation; 57 | } 58 | 59 | /** 60 | * The operation type for this filter. 61 | * 62 | * Generated from protobuf field .google.analytics.data.v1beta.Filter.NumericFilter.Operation operation = 1; 63 | * @param int $var 64 | * @return $this 65 | */ 66 | public function setOperation($var) 67 | { 68 | GPBUtil::checkEnum($var, \Google\Analytics\Data\V1beta\Filter\NumericFilter\Operation::class); 69 | $this->operation = $var; 70 | 71 | return $this; 72 | } 73 | 74 | /** 75 | * A numeric value or a date value. 76 | * 77 | * Generated from protobuf field .google.analytics.data.v1beta.NumericValue value = 2; 78 | * @return \Google\Analytics\Data\V1beta\NumericValue|null 79 | */ 80 | public function getValue() 81 | { 82 | return $this->value; 83 | } 84 | 85 | public function hasValue() 86 | { 87 | return isset($this->value); 88 | } 89 | 90 | public function clearValue() 91 | { 92 | unset($this->value); 93 | } 94 | 95 | /** 96 | * A numeric value or a date value. 97 | * 98 | * Generated from protobuf field .google.analytics.data.v1beta.NumericValue value = 2; 99 | * @param \Google\Analytics\Data\V1beta\NumericValue $var 100 | * @return $this 101 | */ 102 | public function setValue($var) 103 | { 104 | GPBUtil::checkMessage($var, \Google\Analytics\Data\V1beta\NumericValue::class); 105 | $this->value = $var; 106 | 107 | return $this; 108 | } 109 | 110 | } 111 | 112 | 113 | -------------------------------------------------------------------------------- /src/V1beta/Filter/NumericFilter/Operation.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1beta.Filter.NumericFilter.Operation 13 | */ 14 | class Operation 15 | { 16 | /** 17 | * Unspecified. 18 | * 19 | * Generated from protobuf enum OPERATION_UNSPECIFIED = 0; 20 | */ 21 | const OPERATION_UNSPECIFIED = 0; 22 | /** 23 | * Equal 24 | * 25 | * Generated from protobuf enum EQUAL = 1; 26 | */ 27 | const EQUAL = 1; 28 | /** 29 | * Less than 30 | * 31 | * Generated from protobuf enum LESS_THAN = 2; 32 | */ 33 | const LESS_THAN = 2; 34 | /** 35 | * Less than or equal 36 | * 37 | * Generated from protobuf enum LESS_THAN_OR_EQUAL = 3; 38 | */ 39 | const LESS_THAN_OR_EQUAL = 3; 40 | /** 41 | * Greater than 42 | * 43 | * Generated from protobuf enum GREATER_THAN = 4; 44 | */ 45 | const GREATER_THAN = 4; 46 | /** 47 | * Greater than or equal 48 | * 49 | * Generated from protobuf enum GREATER_THAN_OR_EQUAL = 5; 50 | */ 51 | const GREATER_THAN_OR_EQUAL = 5; 52 | 53 | private static $valueToName = [ 54 | self::OPERATION_UNSPECIFIED => 'OPERATION_UNSPECIFIED', 55 | self::EQUAL => 'EQUAL', 56 | self::LESS_THAN => 'LESS_THAN', 57 | self::LESS_THAN_OR_EQUAL => 'LESS_THAN_OR_EQUAL', 58 | self::GREATER_THAN => 'GREATER_THAN', 59 | self::GREATER_THAN_OR_EQUAL => 'GREATER_THAN_OR_EQUAL', 60 | ]; 61 | 62 | public static function name($value) 63 | { 64 | if (!isset(self::$valueToName[$value])) { 65 | throw new UnexpectedValueException(sprintf( 66 | 'Enum %s has no name defined for value %s', __CLASS__, $value)); 67 | } 68 | return self::$valueToName[$value]; 69 | } 70 | 71 | 72 | public static function value($name) 73 | { 74 | $const = __CLASS__ . '::' . strtoupper($name); 75 | if (!defined($const)) { 76 | throw new UnexpectedValueException(sprintf( 77 | 'Enum %s has no value defined for name %s', __CLASS__, $name)); 78 | } 79 | return constant($const); 80 | } 81 | } 82 | 83 | 84 | -------------------------------------------------------------------------------- /src/V1beta/Filter/StringFilter/MatchType.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1beta.Filter.StringFilter.MatchType 13 | */ 14 | class MatchType 15 | { 16 | /** 17 | * Unspecified 18 | * 19 | * Generated from protobuf enum MATCH_TYPE_UNSPECIFIED = 0; 20 | */ 21 | const MATCH_TYPE_UNSPECIFIED = 0; 22 | /** 23 | * Exact match of the string value. 24 | * 25 | * Generated from protobuf enum EXACT = 1; 26 | */ 27 | const EXACT = 1; 28 | /** 29 | * Begins with the string value. 30 | * 31 | * Generated from protobuf enum BEGINS_WITH = 2; 32 | */ 33 | const BEGINS_WITH = 2; 34 | /** 35 | * Ends with the string value. 36 | * 37 | * Generated from protobuf enum ENDS_WITH = 3; 38 | */ 39 | const ENDS_WITH = 3; 40 | /** 41 | * Contains the string value. 42 | * 43 | * Generated from protobuf enum CONTAINS = 4; 44 | */ 45 | const CONTAINS = 4; 46 | /** 47 | * Full match for the regular expression with the string value. 48 | * 49 | * Generated from protobuf enum FULL_REGEXP = 5; 50 | */ 51 | const FULL_REGEXP = 5; 52 | /** 53 | * Partial match for the regular expression with the string value. 54 | * 55 | * Generated from protobuf enum PARTIAL_REGEXP = 6; 56 | */ 57 | const PARTIAL_REGEXP = 6; 58 | 59 | private static $valueToName = [ 60 | self::MATCH_TYPE_UNSPECIFIED => 'MATCH_TYPE_UNSPECIFIED', 61 | self::EXACT => 'EXACT', 62 | self::BEGINS_WITH => 'BEGINS_WITH', 63 | self::ENDS_WITH => 'ENDS_WITH', 64 | self::CONTAINS => 'CONTAINS', 65 | self::FULL_REGEXP => 'FULL_REGEXP', 66 | self::PARTIAL_REGEXP => 'PARTIAL_REGEXP', 67 | ]; 68 | 69 | public static function name($value) 70 | { 71 | if (!isset(self::$valueToName[$value])) { 72 | throw new UnexpectedValueException(sprintf( 73 | 'Enum %s has no name defined for value %s', __CLASS__, $value)); 74 | } 75 | return self::$valueToName[$value]; 76 | } 77 | 78 | 79 | public static function value($name) 80 | { 81 | $const = __CLASS__ . '::' . strtoupper($name); 82 | if (!defined($const)) { 83 | throw new UnexpectedValueException(sprintf( 84 | 'Enum %s has no value defined for name %s', __CLASS__, $name)); 85 | } 86 | return constant($const); 87 | } 88 | } 89 | 90 | 91 | -------------------------------------------------------------------------------- /src/V1beta/FilterExpressionList.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1beta.FilterExpressionList 15 | */ 16 | class FilterExpressionList extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * A list of filter expressions. 20 | * 21 | * Generated from protobuf field repeated .google.analytics.data.v1beta.FilterExpression expressions = 1; 22 | */ 23 | private $expressions; 24 | 25 | /** 26 | * Constructor. 27 | * 28 | * @param array $data { 29 | * Optional. Data for populating the Message object. 30 | * 31 | * @type array<\Google\Analytics\Data\V1beta\FilterExpression>|\Google\Protobuf\Internal\RepeatedField $expressions 32 | * A list of filter expressions. 33 | * } 34 | */ 35 | public function __construct($data = NULL) { 36 | \GPBMetadata\Google\Analytics\Data\V1Beta\Data::initOnce(); 37 | parent::__construct($data); 38 | } 39 | 40 | /** 41 | * A list of filter expressions. 42 | * 43 | * Generated from protobuf field repeated .google.analytics.data.v1beta.FilterExpression expressions = 1; 44 | * @return \Google\Protobuf\Internal\RepeatedField 45 | */ 46 | public function getExpressions() 47 | { 48 | return $this->expressions; 49 | } 50 | 51 | /** 52 | * A list of filter expressions. 53 | * 54 | * Generated from protobuf field repeated .google.analytics.data.v1beta.FilterExpression expressions = 1; 55 | * @param array<\Google\Analytics\Data\V1beta\FilterExpression>|\Google\Protobuf\Internal\RepeatedField $var 56 | * @return $this 57 | */ 58 | public function setExpressions($var) 59 | { 60 | $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Analytics\Data\V1beta\FilterExpression::class); 61 | $this->expressions = $arr; 62 | 63 | return $this; 64 | } 65 | 66 | } 67 | 68 | -------------------------------------------------------------------------------- /src/V1beta/GetAudienceExportRequest.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1beta.GetAudienceExportRequest 16 | */ 17 | class GetAudienceExportRequest extends \Google\Protobuf\Internal\Message 18 | { 19 | /** 20 | * Required. The audience export resource name. 21 | * Format: `properties/{property}/audienceExports/{audience_export}` 22 | * 23 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 24 | */ 25 | protected $name = ''; 26 | 27 | /** 28 | * @param string $name Required. The audience export resource name. 29 | * Format: `properties/{property}/audienceExports/{audience_export}` 30 | * Please see {@see BetaAnalyticsDataClient::audienceExportName()} for help formatting this field. 31 | * 32 | * @return \Google\Analytics\Data\V1beta\GetAudienceExportRequest 33 | * 34 | * @experimental 35 | */ 36 | public static function build(string $name): self 37 | { 38 | return (new self()) 39 | ->setName($name); 40 | } 41 | 42 | /** 43 | * Constructor. 44 | * 45 | * @param array $data { 46 | * Optional. Data for populating the Message object. 47 | * 48 | * @type string $name 49 | * Required. The audience export resource name. 50 | * Format: `properties/{property}/audienceExports/{audience_export}` 51 | * } 52 | */ 53 | public function __construct($data = NULL) { 54 | \GPBMetadata\Google\Analytics\Data\V1Beta\AnalyticsDataApi::initOnce(); 55 | parent::__construct($data); 56 | } 57 | 58 | /** 59 | * Required. The audience export resource name. 60 | * Format: `properties/{property}/audienceExports/{audience_export}` 61 | * 62 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 63 | * @return string 64 | */ 65 | public function getName() 66 | { 67 | return $this->name; 68 | } 69 | 70 | /** 71 | * Required. The audience export resource name. 72 | * Format: `properties/{property}/audienceExports/{audience_export}` 73 | * 74 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 75 | * @param string $var 76 | * @return $this 77 | */ 78 | public function setName($var) 79 | { 80 | GPBUtil::checkString($var, True); 81 | $this->name = $var; 82 | 83 | return $this; 84 | } 85 | 86 | } 87 | 88 | -------------------------------------------------------------------------------- /src/V1beta/MetricAggregation.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1beta.MetricAggregation 13 | */ 14 | class MetricAggregation 15 | { 16 | /** 17 | * Unspecified operator. 18 | * 19 | * Generated from protobuf enum METRIC_AGGREGATION_UNSPECIFIED = 0; 20 | */ 21 | const METRIC_AGGREGATION_UNSPECIFIED = 0; 22 | /** 23 | * SUM operator. 24 | * 25 | * Generated from protobuf enum TOTAL = 1; 26 | */ 27 | const TOTAL = 1; 28 | /** 29 | * Minimum operator. 30 | * 31 | * Generated from protobuf enum MINIMUM = 5; 32 | */ 33 | const MINIMUM = 5; 34 | /** 35 | * Maximum operator. 36 | * 37 | * Generated from protobuf enum MAXIMUM = 6; 38 | */ 39 | const MAXIMUM = 6; 40 | /** 41 | * Count operator. 42 | * 43 | * Generated from protobuf enum COUNT = 4; 44 | */ 45 | const COUNT = 4; 46 | 47 | private static $valueToName = [ 48 | self::METRIC_AGGREGATION_UNSPECIFIED => 'METRIC_AGGREGATION_UNSPECIFIED', 49 | self::TOTAL => 'TOTAL', 50 | self::MINIMUM => 'MINIMUM', 51 | self::MAXIMUM => 'MAXIMUM', 52 | self::COUNT => 'COUNT', 53 | ]; 54 | 55 | public static function name($value) 56 | { 57 | if (!isset(self::$valueToName[$value])) { 58 | throw new UnexpectedValueException(sprintf( 59 | 'Enum %s has no name defined for value %s', __CLASS__, $value)); 60 | } 61 | return self::$valueToName[$value]; 62 | } 63 | 64 | 65 | public static function value($name) 66 | { 67 | $const = __CLASS__ . '::' . strtoupper($name); 68 | if (!defined($const)) { 69 | throw new UnexpectedValueException(sprintf( 70 | 'Enum %s has no value defined for name %s', __CLASS__, $name)); 71 | } 72 | return constant($const); 73 | } 74 | } 75 | 76 | -------------------------------------------------------------------------------- /src/V1beta/MetricHeader.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1beta.MetricHeader 18 | */ 19 | class MetricHeader extends \Google\Protobuf\Internal\Message 20 | { 21 | /** 22 | * The metric's name. 23 | * 24 | * Generated from protobuf field string name = 1; 25 | */ 26 | protected $name = ''; 27 | /** 28 | * The metric's data type. 29 | * 30 | * Generated from protobuf field .google.analytics.data.v1beta.MetricType type = 2; 31 | */ 32 | protected $type = 0; 33 | 34 | /** 35 | * Constructor. 36 | * 37 | * @param array $data { 38 | * Optional. Data for populating the Message object. 39 | * 40 | * @type string $name 41 | * The metric's name. 42 | * @type int $type 43 | * The metric's data type. 44 | * } 45 | */ 46 | public function __construct($data = NULL) { 47 | \GPBMetadata\Google\Analytics\Data\V1Beta\Data::initOnce(); 48 | parent::__construct($data); 49 | } 50 | 51 | /** 52 | * The metric's name. 53 | * 54 | * Generated from protobuf field string name = 1; 55 | * @return string 56 | */ 57 | public function getName() 58 | { 59 | return $this->name; 60 | } 61 | 62 | /** 63 | * The metric's name. 64 | * 65 | * Generated from protobuf field string name = 1; 66 | * @param string $var 67 | * @return $this 68 | */ 69 | public function setName($var) 70 | { 71 | GPBUtil::checkString($var, True); 72 | $this->name = $var; 73 | 74 | return $this; 75 | } 76 | 77 | /** 78 | * The metric's data type. 79 | * 80 | * Generated from protobuf field .google.analytics.data.v1beta.MetricType type = 2; 81 | * @return int 82 | */ 83 | public function getType() 84 | { 85 | return $this->type; 86 | } 87 | 88 | /** 89 | * The metric's data type. 90 | * 91 | * Generated from protobuf field .google.analytics.data.v1beta.MetricType type = 2; 92 | * @param int $var 93 | * @return $this 94 | */ 95 | public function setType($var) 96 | { 97 | GPBUtil::checkEnum($var, \Google\Analytics\Data\V1beta\MetricType::class); 98 | $this->type = $var; 99 | 100 | return $this; 101 | } 102 | 103 | } 104 | 105 | -------------------------------------------------------------------------------- /src/V1beta/MetricMetadata/BlockedReason.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1beta.MetricMetadata.BlockedReason 13 | */ 14 | class BlockedReason 15 | { 16 | /** 17 | * Will never be specified in API response. 18 | * 19 | * Generated from protobuf enum BLOCKED_REASON_UNSPECIFIED = 0; 20 | */ 21 | const BLOCKED_REASON_UNSPECIFIED = 0; 22 | /** 23 | * If present, your access is blocked to revenue related metrics for this 24 | * property, and this metric is revenue related. 25 | * 26 | * Generated from protobuf enum NO_REVENUE_METRICS = 1; 27 | */ 28 | const NO_REVENUE_METRICS = 1; 29 | /** 30 | * If present, your access is blocked to cost related metrics for this 31 | * property, and this metric is cost related. 32 | * 33 | * Generated from protobuf enum NO_COST_METRICS = 2; 34 | */ 35 | const NO_COST_METRICS = 2; 36 | 37 | private static $valueToName = [ 38 | self::BLOCKED_REASON_UNSPECIFIED => 'BLOCKED_REASON_UNSPECIFIED', 39 | self::NO_REVENUE_METRICS => 'NO_REVENUE_METRICS', 40 | self::NO_COST_METRICS => 'NO_COST_METRICS', 41 | ]; 42 | 43 | public static function name($value) 44 | { 45 | if (!isset(self::$valueToName[$value])) { 46 | throw new UnexpectedValueException(sprintf( 47 | 'Enum %s has no name defined for value %s', __CLASS__, $value)); 48 | } 49 | return self::$valueToName[$value]; 50 | } 51 | 52 | 53 | public static function value($name) 54 | { 55 | $const = __CLASS__ . '::' . strtoupper($name); 56 | if (!defined($const)) { 57 | throw new UnexpectedValueException(sprintf( 58 | 'Enum %s has no value defined for name %s', __CLASS__, $name)); 59 | } 60 | return constant($const); 61 | } 62 | } 63 | 64 | 65 | -------------------------------------------------------------------------------- /src/V1beta/MetricValue.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1beta.MetricValue 15 | */ 16 | class MetricValue extends \Google\Protobuf\Internal\Message 17 | { 18 | protected $one_value; 19 | 20 | /** 21 | * Constructor. 22 | * 23 | * @param array $data { 24 | * Optional. Data for populating the Message object. 25 | * 26 | * @type string $value 27 | * Measurement value. See MetricHeader for type. 28 | * } 29 | */ 30 | public function __construct($data = NULL) { 31 | \GPBMetadata\Google\Analytics\Data\V1Beta\Data::initOnce(); 32 | parent::__construct($data); 33 | } 34 | 35 | /** 36 | * Measurement value. See MetricHeader for type. 37 | * 38 | * Generated from protobuf field string value = 4; 39 | * @return string 40 | */ 41 | public function getValue() 42 | { 43 | return $this->readOneof(4); 44 | } 45 | 46 | public function hasValue() 47 | { 48 | return $this->hasOneof(4); 49 | } 50 | 51 | /** 52 | * Measurement value. See MetricHeader for type. 53 | * 54 | * Generated from protobuf field string value = 4; 55 | * @param string $var 56 | * @return $this 57 | */ 58 | public function setValue($var) 59 | { 60 | GPBUtil::checkString($var, True); 61 | $this->writeOneof(4, $var); 62 | 63 | return $this; 64 | } 65 | 66 | /** 67 | * @return string 68 | */ 69 | public function getOneValue() 70 | { 71 | return $this->whichOneof("one_value"); 72 | } 73 | 74 | } 75 | 76 | -------------------------------------------------------------------------------- /src/V1beta/NumericValue.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1beta.NumericValue 15 | */ 16 | class NumericValue extends \Google\Protobuf\Internal\Message 17 | { 18 | protected $one_value; 19 | 20 | /** 21 | * Constructor. 22 | * 23 | * @param array $data { 24 | * Optional. Data for populating the Message object. 25 | * 26 | * @type int|string $int64_value 27 | * Integer value 28 | * @type float $double_value 29 | * Double value 30 | * } 31 | */ 32 | public function __construct($data = NULL) { 33 | \GPBMetadata\Google\Analytics\Data\V1Beta\Data::initOnce(); 34 | parent::__construct($data); 35 | } 36 | 37 | /** 38 | * Integer value 39 | * 40 | * Generated from protobuf field int64 int64_value = 1; 41 | * @return int|string 42 | */ 43 | public function getInt64Value() 44 | { 45 | return $this->readOneof(1); 46 | } 47 | 48 | public function hasInt64Value() 49 | { 50 | return $this->hasOneof(1); 51 | } 52 | 53 | /** 54 | * Integer value 55 | * 56 | * Generated from protobuf field int64 int64_value = 1; 57 | * @param int|string $var 58 | * @return $this 59 | */ 60 | public function setInt64Value($var) 61 | { 62 | GPBUtil::checkInt64($var); 63 | $this->writeOneof(1, $var); 64 | 65 | return $this; 66 | } 67 | 68 | /** 69 | * Double value 70 | * 71 | * Generated from protobuf field double double_value = 2; 72 | * @return float 73 | */ 74 | public function getDoubleValue() 75 | { 76 | return $this->readOneof(2); 77 | } 78 | 79 | public function hasDoubleValue() 80 | { 81 | return $this->hasOneof(2); 82 | } 83 | 84 | /** 85 | * Double value 86 | * 87 | * Generated from protobuf field double double_value = 2; 88 | * @param float $var 89 | * @return $this 90 | */ 91 | public function setDoubleValue($var) 92 | { 93 | GPBUtil::checkDouble($var); 94 | $this->writeOneof(2, $var); 95 | 96 | return $this; 97 | } 98 | 99 | /** 100 | * @return string 101 | */ 102 | public function getOneValue() 103 | { 104 | return $this->whichOneof("one_value"); 105 | } 106 | 107 | } 108 | 109 | -------------------------------------------------------------------------------- /src/V1beta/OrderBy/DimensionOrderBy.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1beta.OrderBy.DimensionOrderBy 15 | */ 16 | class DimensionOrderBy extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * A dimension name in the request to order by. 20 | * 21 | * Generated from protobuf field string dimension_name = 1; 22 | */ 23 | protected $dimension_name = ''; 24 | /** 25 | * Controls the rule for dimension value ordering. 26 | * 27 | * Generated from protobuf field .google.analytics.data.v1beta.OrderBy.DimensionOrderBy.OrderType order_type = 2; 28 | */ 29 | protected $order_type = 0; 30 | 31 | /** 32 | * Constructor. 33 | * 34 | * @param array $data { 35 | * Optional. Data for populating the Message object. 36 | * 37 | * @type string $dimension_name 38 | * A dimension name in the request to order by. 39 | * @type int $order_type 40 | * Controls the rule for dimension value ordering. 41 | * } 42 | */ 43 | public function __construct($data = NULL) { 44 | \GPBMetadata\Google\Analytics\Data\V1Beta\Data::initOnce(); 45 | parent::__construct($data); 46 | } 47 | 48 | /** 49 | * A dimension name in the request to order by. 50 | * 51 | * Generated from protobuf field string dimension_name = 1; 52 | * @return string 53 | */ 54 | public function getDimensionName() 55 | { 56 | return $this->dimension_name; 57 | } 58 | 59 | /** 60 | * A dimension name in the request to order by. 61 | * 62 | * Generated from protobuf field string dimension_name = 1; 63 | * @param string $var 64 | * @return $this 65 | */ 66 | public function setDimensionName($var) 67 | { 68 | GPBUtil::checkString($var, True); 69 | $this->dimension_name = $var; 70 | 71 | return $this; 72 | } 73 | 74 | /** 75 | * Controls the rule for dimension value ordering. 76 | * 77 | * Generated from protobuf field .google.analytics.data.v1beta.OrderBy.DimensionOrderBy.OrderType order_type = 2; 78 | * @return int 79 | */ 80 | public function getOrderType() 81 | { 82 | return $this->order_type; 83 | } 84 | 85 | /** 86 | * Controls the rule for dimension value ordering. 87 | * 88 | * Generated from protobuf field .google.analytics.data.v1beta.OrderBy.DimensionOrderBy.OrderType order_type = 2; 89 | * @param int $var 90 | * @return $this 91 | */ 92 | public function setOrderType($var) 93 | { 94 | GPBUtil::checkEnum($var, \Google\Analytics\Data\V1beta\OrderBy\DimensionOrderBy\OrderType::class); 95 | $this->order_type = $var; 96 | 97 | return $this; 98 | } 99 | 100 | } 101 | 102 | 103 | -------------------------------------------------------------------------------- /src/V1beta/OrderBy/DimensionOrderBy/OrderType.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1beta.OrderBy.DimensionOrderBy.OrderType 13 | */ 14 | class OrderType 15 | { 16 | /** 17 | * Unspecified. 18 | * 19 | * Generated from protobuf enum ORDER_TYPE_UNSPECIFIED = 0; 20 | */ 21 | const ORDER_TYPE_UNSPECIFIED = 0; 22 | /** 23 | * Alphanumeric sort by Unicode code point. For example, "2" < "A" < "X" < 24 | * "b" < "z". 25 | * 26 | * Generated from protobuf enum ALPHANUMERIC = 1; 27 | */ 28 | const ALPHANUMERIC = 1; 29 | /** 30 | * Case insensitive alphanumeric sort by lower case Unicode code point. 31 | * For example, "2" < "A" < "b" < "X" < "z". 32 | * 33 | * Generated from protobuf enum CASE_INSENSITIVE_ALPHANUMERIC = 2; 34 | */ 35 | const CASE_INSENSITIVE_ALPHANUMERIC = 2; 36 | /** 37 | * Dimension values are converted to numbers before sorting. For example 38 | * in NUMERIC sort, "25" < "100", and in `ALPHANUMERIC` sort, "100" < 39 | * "25". Non-numeric dimension values all have equal ordering value below 40 | * all numeric values. 41 | * 42 | * Generated from protobuf enum NUMERIC = 3; 43 | */ 44 | const NUMERIC = 3; 45 | 46 | private static $valueToName = [ 47 | self::ORDER_TYPE_UNSPECIFIED => 'ORDER_TYPE_UNSPECIFIED', 48 | self::ALPHANUMERIC => 'ALPHANUMERIC', 49 | self::CASE_INSENSITIVE_ALPHANUMERIC => 'CASE_INSENSITIVE_ALPHANUMERIC', 50 | self::NUMERIC => 'NUMERIC', 51 | ]; 52 | 53 | public static function name($value) 54 | { 55 | if (!isset(self::$valueToName[$value])) { 56 | throw new UnexpectedValueException(sprintf( 57 | 'Enum %s has no name defined for value %s', __CLASS__, $value)); 58 | } 59 | return self::$valueToName[$value]; 60 | } 61 | 62 | 63 | public static function value($name) 64 | { 65 | $const = __CLASS__ . '::' . strtoupper($name); 66 | if (!defined($const)) { 67 | throw new UnexpectedValueException(sprintf( 68 | 'Enum %s has no value defined for name %s', __CLASS__, $name)); 69 | } 70 | return constant($const); 71 | } 72 | } 73 | 74 | 75 | -------------------------------------------------------------------------------- /src/V1beta/OrderBy/MetricOrderBy.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1beta.OrderBy.MetricOrderBy 15 | */ 16 | class MetricOrderBy extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * A metric name in the request to order by. 20 | * 21 | * Generated from protobuf field string metric_name = 1; 22 | */ 23 | protected $metric_name = ''; 24 | 25 | /** 26 | * Constructor. 27 | * 28 | * @param array $data { 29 | * Optional. Data for populating the Message object. 30 | * 31 | * @type string $metric_name 32 | * A metric name in the request to order by. 33 | * } 34 | */ 35 | public function __construct($data = NULL) { 36 | \GPBMetadata\Google\Analytics\Data\V1Beta\Data::initOnce(); 37 | parent::__construct($data); 38 | } 39 | 40 | /** 41 | * A metric name in the request to order by. 42 | * 43 | * Generated from protobuf field string metric_name = 1; 44 | * @return string 45 | */ 46 | public function getMetricName() 47 | { 48 | return $this->metric_name; 49 | } 50 | 51 | /** 52 | * A metric name in the request to order by. 53 | * 54 | * Generated from protobuf field string metric_name = 1; 55 | * @param string $var 56 | * @return $this 57 | */ 58 | public function setMetricName($var) 59 | { 60 | GPBUtil::checkString($var, True); 61 | $this->metric_name = $var; 62 | 63 | return $this; 64 | } 65 | 66 | } 67 | 68 | 69 | -------------------------------------------------------------------------------- /src/V1beta/OrderBy/PivotOrderBy/PivotSelection.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1beta.OrderBy.PivotOrderBy.PivotSelection 28 | */ 29 | class PivotSelection extends \Google\Protobuf\Internal\Message 30 | { 31 | /** 32 | * Must be a dimension name from the request. 33 | * 34 | * Generated from protobuf field string dimension_name = 1; 35 | */ 36 | protected $dimension_name = ''; 37 | /** 38 | * Order by only when the named dimension is this value. 39 | * 40 | * Generated from protobuf field string dimension_value = 2; 41 | */ 42 | protected $dimension_value = ''; 43 | 44 | /** 45 | * Constructor. 46 | * 47 | * @param array $data { 48 | * Optional. Data for populating the Message object. 49 | * 50 | * @type string $dimension_name 51 | * Must be a dimension name from the request. 52 | * @type string $dimension_value 53 | * Order by only when the named dimension is this value. 54 | * } 55 | */ 56 | public function __construct($data = NULL) { 57 | \GPBMetadata\Google\Analytics\Data\V1Beta\Data::initOnce(); 58 | parent::__construct($data); 59 | } 60 | 61 | /** 62 | * Must be a dimension name from the request. 63 | * 64 | * Generated from protobuf field string dimension_name = 1; 65 | * @return string 66 | */ 67 | public function getDimensionName() 68 | { 69 | return $this->dimension_name; 70 | } 71 | 72 | /** 73 | * Must be a dimension name from the request. 74 | * 75 | * Generated from protobuf field string dimension_name = 1; 76 | * @param string $var 77 | * @return $this 78 | */ 79 | public function setDimensionName($var) 80 | { 81 | GPBUtil::checkString($var, True); 82 | $this->dimension_name = $var; 83 | 84 | return $this; 85 | } 86 | 87 | /** 88 | * Order by only when the named dimension is this value. 89 | * 90 | * Generated from protobuf field string dimension_value = 2; 91 | * @return string 92 | */ 93 | public function getDimensionValue() 94 | { 95 | return $this->dimension_value; 96 | } 97 | 98 | /** 99 | * Order by only when the named dimension is this value. 100 | * 101 | * Generated from protobuf field string dimension_value = 2; 102 | * @param string $var 103 | * @return $this 104 | */ 105 | public function setDimensionValue($var) 106 | { 107 | GPBUtil::checkString($var, True); 108 | $this->dimension_value = $var; 109 | 110 | return $this; 111 | } 112 | 113 | } 114 | 115 | 116 | -------------------------------------------------------------------------------- /src/V1beta/PivotDimensionHeader.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1beta.PivotDimensionHeader 15 | */ 16 | class PivotDimensionHeader extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * Values of multiple dimensions in a pivot. 20 | * 21 | * Generated from protobuf field repeated .google.analytics.data.v1beta.DimensionValue dimension_values = 1; 22 | */ 23 | private $dimension_values; 24 | 25 | /** 26 | * Constructor. 27 | * 28 | * @param array $data { 29 | * Optional. Data for populating the Message object. 30 | * 31 | * @type array<\Google\Analytics\Data\V1beta\DimensionValue>|\Google\Protobuf\Internal\RepeatedField $dimension_values 32 | * Values of multiple dimensions in a pivot. 33 | * } 34 | */ 35 | public function __construct($data = NULL) { 36 | \GPBMetadata\Google\Analytics\Data\V1Beta\Data::initOnce(); 37 | parent::__construct($data); 38 | } 39 | 40 | /** 41 | * Values of multiple dimensions in a pivot. 42 | * 43 | * Generated from protobuf field repeated .google.analytics.data.v1beta.DimensionValue dimension_values = 1; 44 | * @return \Google\Protobuf\Internal\RepeatedField 45 | */ 46 | public function getDimensionValues() 47 | { 48 | return $this->dimension_values; 49 | } 50 | 51 | /** 52 | * Values of multiple dimensions in a pivot. 53 | * 54 | * Generated from protobuf field repeated .google.analytics.data.v1beta.DimensionValue dimension_values = 1; 55 | * @param array<\Google\Analytics\Data\V1beta\DimensionValue>|\Google\Protobuf\Internal\RepeatedField $var 56 | * @return $this 57 | */ 58 | public function setDimensionValues($var) 59 | { 60 | $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Analytics\Data\V1beta\DimensionValue::class); 61 | $this->dimension_values = $arr; 62 | 63 | return $this; 64 | } 65 | 66 | } 67 | 68 | -------------------------------------------------------------------------------- /src/V1beta/QuotaStatus.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1beta.QuotaStatus 15 | */ 16 | class QuotaStatus extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * Quota consumed by this request. 20 | * 21 | * Generated from protobuf field optional int32 consumed = 1; 22 | */ 23 | protected $consumed = null; 24 | /** 25 | * Quota remaining after this request. 26 | * 27 | * Generated from protobuf field optional int32 remaining = 2; 28 | */ 29 | protected $remaining = null; 30 | 31 | /** 32 | * Constructor. 33 | * 34 | * @param array $data { 35 | * Optional. Data for populating the Message object. 36 | * 37 | * @type int $consumed 38 | * Quota consumed by this request. 39 | * @type int $remaining 40 | * Quota remaining after this request. 41 | * } 42 | */ 43 | public function __construct($data = NULL) { 44 | \GPBMetadata\Google\Analytics\Data\V1Beta\Data::initOnce(); 45 | parent::__construct($data); 46 | } 47 | 48 | /** 49 | * Quota consumed by this request. 50 | * 51 | * Generated from protobuf field optional int32 consumed = 1; 52 | * @return int 53 | */ 54 | public function getConsumed() 55 | { 56 | return isset($this->consumed) ? $this->consumed : 0; 57 | } 58 | 59 | public function hasConsumed() 60 | { 61 | return isset($this->consumed); 62 | } 63 | 64 | public function clearConsumed() 65 | { 66 | unset($this->consumed); 67 | } 68 | 69 | /** 70 | * Quota consumed by this request. 71 | * 72 | * Generated from protobuf field optional int32 consumed = 1; 73 | * @param int $var 74 | * @return $this 75 | */ 76 | public function setConsumed($var) 77 | { 78 | GPBUtil::checkInt32($var); 79 | $this->consumed = $var; 80 | 81 | return $this; 82 | } 83 | 84 | /** 85 | * Quota remaining after this request. 86 | * 87 | * Generated from protobuf field optional int32 remaining = 2; 88 | * @return int 89 | */ 90 | public function getRemaining() 91 | { 92 | return isset($this->remaining) ? $this->remaining : 0; 93 | } 94 | 95 | public function hasRemaining() 96 | { 97 | return isset($this->remaining); 98 | } 99 | 100 | public function clearRemaining() 101 | { 102 | unset($this->remaining); 103 | } 104 | 105 | /** 106 | * Quota remaining after this request. 107 | * 108 | * Generated from protobuf field optional int32 remaining = 2; 109 | * @param int $var 110 | * @return $this 111 | */ 112 | public function setRemaining($var) 113 | { 114 | GPBUtil::checkInt32($var); 115 | $this->remaining = $var; 116 | 117 | return $this; 118 | } 119 | 120 | } 121 | 122 | -------------------------------------------------------------------------------- /src/V1beta/ResponseMetaData/SchemaRestrictionResponse.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse 17 | */ 18 | class SchemaRestrictionResponse extends \Google\Protobuf\Internal\Message 19 | { 20 | /** 21 | * All restrictions actively enforced in creating the report. For example, 22 | * `purchaseRevenue` always has the restriction type `REVENUE_DATA`. 23 | * However, this active response restriction is only populated if the user's 24 | * custom role disallows access to `REVENUE_DATA`. 25 | * 26 | * Generated from protobuf field repeated .google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse.ActiveMetricRestriction active_metric_restrictions = 1; 27 | */ 28 | private $active_metric_restrictions; 29 | 30 | /** 31 | * Constructor. 32 | * 33 | * @param array $data { 34 | * Optional. Data for populating the Message object. 35 | * 36 | * @type array<\Google\Analytics\Data\V1beta\ResponseMetaData\SchemaRestrictionResponse\ActiveMetricRestriction>|\Google\Protobuf\Internal\RepeatedField $active_metric_restrictions 37 | * All restrictions actively enforced in creating the report. For example, 38 | * `purchaseRevenue` always has the restriction type `REVENUE_DATA`. 39 | * However, this active response restriction is only populated if the user's 40 | * custom role disallows access to `REVENUE_DATA`. 41 | * } 42 | */ 43 | public function __construct($data = NULL) { 44 | \GPBMetadata\Google\Analytics\Data\V1Beta\Data::initOnce(); 45 | parent::__construct($data); 46 | } 47 | 48 | /** 49 | * All restrictions actively enforced in creating the report. For example, 50 | * `purchaseRevenue` always has the restriction type `REVENUE_DATA`. 51 | * However, this active response restriction is only populated if the user's 52 | * custom role disallows access to `REVENUE_DATA`. 53 | * 54 | * Generated from protobuf field repeated .google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse.ActiveMetricRestriction active_metric_restrictions = 1; 55 | * @return \Google\Protobuf\Internal\RepeatedField 56 | */ 57 | public function getActiveMetricRestrictions() 58 | { 59 | return $this->active_metric_restrictions; 60 | } 61 | 62 | /** 63 | * All restrictions actively enforced in creating the report. For example, 64 | * `purchaseRevenue` always has the restriction type `REVENUE_DATA`. 65 | * However, this active response restriction is only populated if the user's 66 | * custom role disallows access to `REVENUE_DATA`. 67 | * 68 | * Generated from protobuf field repeated .google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse.ActiveMetricRestriction active_metric_restrictions = 1; 69 | * @param array<\Google\Analytics\Data\V1beta\ResponseMetaData\SchemaRestrictionResponse\ActiveMetricRestriction>|\Google\Protobuf\Internal\RepeatedField $var 70 | * @return $this 71 | */ 72 | public function setActiveMetricRestrictions($var) 73 | { 74 | $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Analytics\Data\V1beta\ResponseMetaData\SchemaRestrictionResponse\ActiveMetricRestriction::class); 75 | $this->active_metric_restrictions = $arr; 76 | 77 | return $this; 78 | } 79 | 80 | } 81 | 82 | 83 | -------------------------------------------------------------------------------- /src/V1beta/ResponseMetaData/SchemaRestrictionResponse/ActiveMetricRestriction.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1beta.ResponseMetaData.SchemaRestrictionResponse.ActiveMetricRestriction 15 | */ 16 | class ActiveMetricRestriction extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * The name of the restricted metric. 20 | * 21 | * Generated from protobuf field optional string metric_name = 1; 22 | */ 23 | protected $metric_name = null; 24 | /** 25 | * The reason for this metric's restriction. 26 | * 27 | * Generated from protobuf field repeated .google.analytics.data.v1beta.RestrictedMetricType restricted_metric_types = 2; 28 | */ 29 | private $restricted_metric_types; 30 | 31 | /** 32 | * Constructor. 33 | * 34 | * @param array $data { 35 | * Optional. Data for populating the Message object. 36 | * 37 | * @type string $metric_name 38 | * The name of the restricted metric. 39 | * @type array|\Google\Protobuf\Internal\RepeatedField $restricted_metric_types 40 | * The reason for this metric's restriction. 41 | * } 42 | */ 43 | public function __construct($data = NULL) { 44 | \GPBMetadata\Google\Analytics\Data\V1Beta\Data::initOnce(); 45 | parent::__construct($data); 46 | } 47 | 48 | /** 49 | * The name of the restricted metric. 50 | * 51 | * Generated from protobuf field optional string metric_name = 1; 52 | * @return string 53 | */ 54 | public function getMetricName() 55 | { 56 | return isset($this->metric_name) ? $this->metric_name : ''; 57 | } 58 | 59 | public function hasMetricName() 60 | { 61 | return isset($this->metric_name); 62 | } 63 | 64 | public function clearMetricName() 65 | { 66 | unset($this->metric_name); 67 | } 68 | 69 | /** 70 | * The name of the restricted metric. 71 | * 72 | * Generated from protobuf field optional string metric_name = 1; 73 | * @param string $var 74 | * @return $this 75 | */ 76 | public function setMetricName($var) 77 | { 78 | GPBUtil::checkString($var, True); 79 | $this->metric_name = $var; 80 | 81 | return $this; 82 | } 83 | 84 | /** 85 | * The reason for this metric's restriction. 86 | * 87 | * Generated from protobuf field repeated .google.analytics.data.v1beta.RestrictedMetricType restricted_metric_types = 2; 88 | * @return \Google\Protobuf\Internal\RepeatedField 89 | */ 90 | public function getRestrictedMetricTypes() 91 | { 92 | return $this->restricted_metric_types; 93 | } 94 | 95 | /** 96 | * The reason for this metric's restriction. 97 | * 98 | * Generated from protobuf field repeated .google.analytics.data.v1beta.RestrictedMetricType restricted_metric_types = 2; 99 | * @param array|\Google\Protobuf\Internal\RepeatedField $var 100 | * @return $this 101 | */ 102 | public function setRestrictedMetricTypes($var) 103 | { 104 | $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Analytics\Data\V1beta\RestrictedMetricType::class); 105 | $this->restricted_metric_types = $arr; 106 | 107 | return $this; 108 | } 109 | 110 | } 111 | 112 | 113 | -------------------------------------------------------------------------------- /src/V1beta/RestrictedMetricType.php: -------------------------------------------------------------------------------- 1 | google.analytics.data.v1beta.RestrictedMetricType 14 | */ 15 | class RestrictedMetricType 16 | { 17 | /** 18 | * Unspecified type. 19 | * 20 | * Generated from protobuf enum RESTRICTED_METRIC_TYPE_UNSPECIFIED = 0; 21 | */ 22 | const RESTRICTED_METRIC_TYPE_UNSPECIFIED = 0; 23 | /** 24 | * Cost metrics such as `adCost`. 25 | * 26 | * Generated from protobuf enum COST_DATA = 1; 27 | */ 28 | const COST_DATA = 1; 29 | /** 30 | * Revenue metrics such as `purchaseRevenue`. 31 | * 32 | * Generated from protobuf enum REVENUE_DATA = 2; 33 | */ 34 | const REVENUE_DATA = 2; 35 | 36 | private static $valueToName = [ 37 | self::RESTRICTED_METRIC_TYPE_UNSPECIFIED => 'RESTRICTED_METRIC_TYPE_UNSPECIFIED', 38 | self::COST_DATA => 'COST_DATA', 39 | self::REVENUE_DATA => 'REVENUE_DATA', 40 | ]; 41 | 42 | public static function name($value) 43 | { 44 | if (!isset(self::$valueToName[$value])) { 45 | throw new UnexpectedValueException(sprintf( 46 | 'Enum %s has no name defined for value %s', __CLASS__, $value)); 47 | } 48 | return self::$valueToName[$value]; 49 | } 50 | 51 | 52 | public static function value($name) 53 | { 54 | $const = __CLASS__ . '::' . strtoupper($name); 55 | if (!defined($const)) { 56 | throw new UnexpectedValueException(sprintf( 57 | 'Enum %s has no value defined for name %s', __CLASS__, $name)); 58 | } 59 | return constant($const); 60 | } 61 | } 62 | 63 | --------------------------------------------------------------------------------