1<?php
2/*
3 * Copyright 2014 Google Inc.
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6 * use this file except in compliance with the License. You may obtain a copy of
7 * the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14 * License for the specific language governing permissions and limitations under
15 * the License.
16 */
17
18namespace Google\Service\FirebaseDynamicLinks\Resource;
19
20use Google\Service\FirebaseDynamicLinks\DynamicLinkStats;
21use Google\Service\FirebaseDynamicLinks\GetIosPostInstallAttributionRequest;
22use Google\Service\FirebaseDynamicLinks\GetIosPostInstallAttributionResponse;
23use Google\Service\FirebaseDynamicLinks\GetIosReopenAttributionRequest;
24use Google\Service\FirebaseDynamicLinks\GetIosReopenAttributionResponse;
25
26/**
27 * The "v1" collection of methods.
28 * Typical usage is:
29 *  <code>
30 *   $firebasedynamiclinksService = new Google\Service\FirebaseDynamicLinks(...);
31 *   $v1 = $firebasedynamiclinksService->v1;
32 *  </code>
33 */
34class V1 extends \Google\Service\Resource
35{
36  /**
37   * Fetches analytics stats of a short Dynamic Link for a given duration. Metrics
38   * include number of clicks, redirects, installs, app first opens, and app
39   * reopens. (v1.getLinkStats)
40   *
41   * @param string $dynamicLink Dynamic Link URL. e.g.
42   * https://abcd.app.goo.gl/wxyz
43   * @param array $optParams Optional parameters.
44   *
45   * @opt_param string durationDays The span of time requested in days.
46   * @opt_param string sdkVersion Google SDK version. Version takes the form
47   * "$major.$minor.$patch"
48   * @return DynamicLinkStats
49   */
50  public function getLinkStats($dynamicLink, $optParams = [])
51  {
52    $params = ['dynamicLink' => $dynamicLink];
53    $params = array_merge($params, $optParams);
54    return $this->call('getLinkStats', [$params], DynamicLinkStats::class);
55  }
56  /**
57   * Get iOS strong/weak-match info for post-install attribution.
58   * (v1.installAttribution)
59   *
60   * @param GetIosPostInstallAttributionRequest $postBody
61   * @param array $optParams Optional parameters.
62   * @return GetIosPostInstallAttributionResponse
63   */
64  public function installAttribution(GetIosPostInstallAttributionRequest $postBody, $optParams = [])
65  {
66    $params = ['postBody' => $postBody];
67    $params = array_merge($params, $optParams);
68    return $this->call('installAttribution', [$params], GetIosPostInstallAttributionResponse::class);
69  }
70  /**
71   * Get iOS reopen attribution for app universal link open deeplinking.
72   * (v1.reopenAttribution)
73   *
74   * @param GetIosReopenAttributionRequest $postBody
75   * @param array $optParams Optional parameters.
76   * @return GetIosReopenAttributionResponse
77   */
78  public function reopenAttribution(GetIosReopenAttributionRequest $postBody, $optParams = [])
79  {
80    $params = ['postBody' => $postBody];
81    $params = array_merge($params, $optParams);
82    return $this->call('reopenAttribution', [$params], GetIosReopenAttributionResponse::class);
83  }
84}
85
86// Adding a class alias for backwards compatibility with the previous class name.
87class_alias(V1::class, 'Google_Service_FirebaseDynamicLinks_Resource_V1');
88