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;
19
20use Google\Client;
21
22/**
23 * Service definition for FirebaseCloudMessaging (v1).
24 *
25 * <p>
26 * FCM send API that provides a cross-platform messaging solution to reliably
27 * deliver messages at no cost.</p>
28 *
29 * <p>
30 * For more information about this service, see the API
31 * <a href="https://firebase.google.com/docs/cloud-messaging" target="_blank">Documentation</a>
32 * </p>
33 *
34 * @author Google, Inc.
35 */
36class FirebaseCloudMessaging extends \Google\Service
37{
38  /** See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.. */
39  const CLOUD_PLATFORM =
40      "https://www.googleapis.com/auth/cloud-platform";
41  /** Send messages and manage messaging subscriptions for your Firebase applications. */
42  const FIREBASE_MESSAGING =
43      "https://www.googleapis.com/auth/firebase.messaging";
44
45  public $projects_messages;
46
47  /**
48   * Constructs the internal representation of the FirebaseCloudMessaging
49   * service.
50   *
51   * @param Client|array $clientOrConfig The client used to deliver requests, or a
52   *                                     config array to pass to a new Client instance.
53   * @param string $rootUrl The root URL used for requests to the service.
54   */
55  public function __construct($clientOrConfig = [], $rootUrl = null)
56  {
57    parent::__construct($clientOrConfig);
58    $this->rootUrl = $rootUrl ?: 'https://fcm.googleapis.com/';
59    $this->servicePath = '';
60    $this->batchPath = 'batch';
61    $this->version = 'v1';
62    $this->serviceName = 'fcm';
63
64    $this->projects_messages = new FirebaseCloudMessaging\Resource\ProjectsMessages(
65        $this,
66        $this->serviceName,
67        'messages',
68        [
69          'methods' => [
70            'send' => [
71              'path' => 'v1/{+parent}/messages:send',
72              'httpMethod' => 'POST',
73              'parameters' => [
74                'parent' => [
75                  'location' => 'path',
76                  'type' => 'string',
77                  'required' => true,
78                ],
79              ],
80            ],
81          ]
82        ]
83    );
84  }
85}
86
87// Adding a class alias for backwards compatibility with the previous class name.
88class_alias(FirebaseCloudMessaging::class, 'Google_Service_FirebaseCloudMessaging');
89