[e3d4e0a] | 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 |
|
---|
| 18 | namespace Google\Service\Firebaseappcheck\Resource;
|
---|
| 19 |
|
---|
| 20 | use Google\Service\Firebaseappcheck\GoogleFirebaseAppcheckV1AppCheckToken;
|
---|
| 21 | use Google\Service\Firebaseappcheck\GoogleFirebaseAppcheckV1ExchangeAppAttestAssertionRequest;
|
---|
| 22 | use Google\Service\Firebaseappcheck\GoogleFirebaseAppcheckV1ExchangeAppAttestAttestationRequest;
|
---|
| 23 | use Google\Service\Firebaseappcheck\GoogleFirebaseAppcheckV1ExchangeAppAttestAttestationResponse;
|
---|
| 24 | use Google\Service\Firebaseappcheck\GoogleFirebaseAppcheckV1ExchangeCustomTokenRequest;
|
---|
| 25 | use Google\Service\Firebaseappcheck\GoogleFirebaseAppcheckV1ExchangeDebugTokenRequest;
|
---|
| 26 | use Google\Service\Firebaseappcheck\GoogleFirebaseAppcheckV1ExchangeDeviceCheckTokenRequest;
|
---|
| 27 | use Google\Service\Firebaseappcheck\GoogleFirebaseAppcheckV1ExchangePlayIntegrityTokenRequest;
|
---|
| 28 | use Google\Service\Firebaseappcheck\GoogleFirebaseAppcheckV1ExchangeRecaptchaEnterpriseTokenRequest;
|
---|
| 29 | use Google\Service\Firebaseappcheck\GoogleFirebaseAppcheckV1ExchangeRecaptchaV3TokenRequest;
|
---|
| 30 | use Google\Service\Firebaseappcheck\GoogleFirebaseAppcheckV1ExchangeSafetyNetTokenRequest;
|
---|
| 31 | use Google\Service\Firebaseappcheck\GoogleFirebaseAppcheckV1GenerateAppAttestChallengeRequest;
|
---|
| 32 | use Google\Service\Firebaseappcheck\GoogleFirebaseAppcheckV1GenerateAppAttestChallengeResponse;
|
---|
| 33 | use Google\Service\Firebaseappcheck\GoogleFirebaseAppcheckV1GeneratePlayIntegrityChallengeRequest;
|
---|
| 34 | use Google\Service\Firebaseappcheck\GoogleFirebaseAppcheckV1GeneratePlayIntegrityChallengeResponse;
|
---|
| 35 |
|
---|
| 36 | /**
|
---|
| 37 | * The "apps" collection of methods.
|
---|
| 38 | * Typical usage is:
|
---|
| 39 | * <code>
|
---|
| 40 | * $firebaseappcheckService = new Google\Service\Firebaseappcheck(...);
|
---|
| 41 | * $apps = $firebaseappcheckService->projects_apps;
|
---|
| 42 | * </code>
|
---|
| 43 | */
|
---|
| 44 | class ProjectsApps extends \Google\Service\Resource
|
---|
| 45 | {
|
---|
| 46 | /**
|
---|
| 47 | * Accepts an App Attest assertion and an artifact previously obtained from
|
---|
| 48 | * ExchangeAppAttestAttestation and verifies those with Apple. If valid, returns
|
---|
| 49 | * an AppCheckToken. (apps.exchangeAppAttestAssertion)
|
---|
| 50 | *
|
---|
| 51 | * @param string $app Required. The relative resource name of the iOS app, in
|
---|
| 52 | * the format: ``` projects/{project_number}/apps/{app_id} ``` If necessary, the
|
---|
| 53 | * `project_number` element can be replaced with the project ID of the Firebase
|
---|
| 54 | * project. Learn more about using project identifiers in Google's [AIP
|
---|
| 55 | * 2510](https://google.aip.dev/cloud/2510) standard.
|
---|
| 56 | * @param GoogleFirebaseAppcheckV1ExchangeAppAttestAssertionRequest $postBody
|
---|
| 57 | * @param array $optParams Optional parameters.
|
---|
| 58 | * @return GoogleFirebaseAppcheckV1AppCheckToken
|
---|
| 59 | * @throws \Google\Service\Exception
|
---|
| 60 | */
|
---|
| 61 | public function exchangeAppAttestAssertion($app, GoogleFirebaseAppcheckV1ExchangeAppAttestAssertionRequest $postBody, $optParams = [])
|
---|
| 62 | {
|
---|
| 63 | $params = ['app' => $app, 'postBody' => $postBody];
|
---|
| 64 | $params = array_merge($params, $optParams);
|
---|
| 65 | return $this->call('exchangeAppAttestAssertion', [$params], GoogleFirebaseAppcheckV1AppCheckToken::class);
|
---|
| 66 | }
|
---|
| 67 | /**
|
---|
| 68 | * Accepts an App Attest CBOR attestation and verifies it with Apple using your
|
---|
| 69 | * preconfigured team and bundle IDs. If valid, returns an attestation artifact
|
---|
| 70 | * that can later be exchanged for an AppCheckToken using
|
---|
| 71 | * ExchangeAppAttestAssertion. For convenience and performance, this method's
|
---|
| 72 | * response object will also contain an AppCheckToken (if the verification is
|
---|
| 73 | * successful). (apps.exchangeAppAttestAttestation)
|
---|
| 74 | *
|
---|
| 75 | * @param string $app Required. The relative resource name of the iOS app, in
|
---|
| 76 | * the format: ``` projects/{project_number}/apps/{app_id} ``` If necessary, the
|
---|
| 77 | * `project_number` element can be replaced with the project ID of the Firebase
|
---|
| 78 | * project. Learn more about using project identifiers in Google's [AIP
|
---|
| 79 | * 2510](https://google.aip.dev/cloud/2510) standard.
|
---|
| 80 | * @param GoogleFirebaseAppcheckV1ExchangeAppAttestAttestationRequest $postBody
|
---|
| 81 | * @param array $optParams Optional parameters.
|
---|
| 82 | * @return GoogleFirebaseAppcheckV1ExchangeAppAttestAttestationResponse
|
---|
| 83 | * @throws \Google\Service\Exception
|
---|
| 84 | */
|
---|
| 85 | public function exchangeAppAttestAttestation($app, GoogleFirebaseAppcheckV1ExchangeAppAttestAttestationRequest $postBody, $optParams = [])
|
---|
| 86 | {
|
---|
| 87 | $params = ['app' => $app, 'postBody' => $postBody];
|
---|
| 88 | $params = array_merge($params, $optParams);
|
---|
| 89 | return $this->call('exchangeAppAttestAttestation', [$params], GoogleFirebaseAppcheckV1ExchangeAppAttestAttestationResponse::class);
|
---|
| 90 | }
|
---|
| 91 | /**
|
---|
| 92 | * Validates a custom token signed using your project's Admin SDK service
|
---|
| 93 | * account credentials. If valid, returns an AppCheckToken.
|
---|
| 94 | * (apps.exchangeCustomToken)
|
---|
| 95 | *
|
---|
| 96 | * @param string $app Required. The relative resource name of the app, in the
|
---|
| 97 | * format: ``` projects/{project_number}/apps/{app_id} ``` If necessary, the
|
---|
| 98 | * `project_number` element can be replaced with the project ID of the Firebase
|
---|
| 99 | * project. Learn more about using project identifiers in Google's [AIP
|
---|
| 100 | * 2510](https://google.aip.dev/cloud/2510) standard.
|
---|
| 101 | * @param GoogleFirebaseAppcheckV1ExchangeCustomTokenRequest $postBody
|
---|
| 102 | * @param array $optParams Optional parameters.
|
---|
| 103 | * @return GoogleFirebaseAppcheckV1AppCheckToken
|
---|
| 104 | * @throws \Google\Service\Exception
|
---|
| 105 | */
|
---|
| 106 | public function exchangeCustomToken($app, GoogleFirebaseAppcheckV1ExchangeCustomTokenRequest $postBody, $optParams = [])
|
---|
| 107 | {
|
---|
| 108 | $params = ['app' => $app, 'postBody' => $postBody];
|
---|
| 109 | $params = array_merge($params, $optParams);
|
---|
| 110 | return $this->call('exchangeCustomToken', [$params], GoogleFirebaseAppcheckV1AppCheckToken::class);
|
---|
| 111 | }
|
---|
| 112 | /**
|
---|
| 113 | * Validates a debug token secret that you have previously created using
|
---|
| 114 | * CreateDebugToken. If valid, returns an AppCheckToken. Note that a restrictive
|
---|
| 115 | * quota is enforced on this method to prevent accidental exposure of the app to
|
---|
| 116 | * abuse. (apps.exchangeDebugToken)
|
---|
| 117 | *
|
---|
| 118 | * @param string $app Required. The relative resource name of the app, in the
|
---|
| 119 | * format: ``` projects/{project_number}/apps/{app_id} ``` If necessary, the
|
---|
| 120 | * `project_number` element can be replaced with the project ID of the Firebase
|
---|
| 121 | * project. Learn more about using project identifiers in Google's [AIP
|
---|
| 122 | * 2510](https://google.aip.dev/cloud/2510) standard.
|
---|
| 123 | * @param GoogleFirebaseAppcheckV1ExchangeDebugTokenRequest $postBody
|
---|
| 124 | * @param array $optParams Optional parameters.
|
---|
| 125 | * @return GoogleFirebaseAppcheckV1AppCheckToken
|
---|
| 126 | * @throws \Google\Service\Exception
|
---|
| 127 | */
|
---|
| 128 | public function exchangeDebugToken($app, GoogleFirebaseAppcheckV1ExchangeDebugTokenRequest $postBody, $optParams = [])
|
---|
| 129 | {
|
---|
| 130 | $params = ['app' => $app, 'postBody' => $postBody];
|
---|
| 131 | $params = array_merge($params, $optParams);
|
---|
| 132 | return $this->call('exchangeDebugToken', [$params], GoogleFirebaseAppcheckV1AppCheckToken::class);
|
---|
| 133 | }
|
---|
| 134 | /**
|
---|
| 135 | * Accepts a [`device_token`](https://developer.apple.com/documentation/devicech
|
---|
| 136 | * eck/dcdevice) issued by DeviceCheck, and attempts to validate it with Apple.
|
---|
| 137 | * If valid, returns an AppCheckToken. (apps.exchangeDeviceCheckToken)
|
---|
| 138 | *
|
---|
| 139 | * @param string $app Required. The relative resource name of the iOS app, in
|
---|
| 140 | * the format: ``` projects/{project_number}/apps/{app_id} ``` If necessary, the
|
---|
| 141 | * `project_number` element can be replaced with the project ID of the Firebase
|
---|
| 142 | * project. Learn more about using project identifiers in Google's [AIP
|
---|
| 143 | * 2510](https://google.aip.dev/cloud/2510) standard.
|
---|
| 144 | * @param GoogleFirebaseAppcheckV1ExchangeDeviceCheckTokenRequest $postBody
|
---|
| 145 | * @param array $optParams Optional parameters.
|
---|
| 146 | * @return GoogleFirebaseAppcheckV1AppCheckToken
|
---|
| 147 | * @throws \Google\Service\Exception
|
---|
| 148 | */
|
---|
| 149 | public function exchangeDeviceCheckToken($app, GoogleFirebaseAppcheckV1ExchangeDeviceCheckTokenRequest $postBody, $optParams = [])
|
---|
| 150 | {
|
---|
| 151 | $params = ['app' => $app, 'postBody' => $postBody];
|
---|
| 152 | $params = array_merge($params, $optParams);
|
---|
| 153 | return $this->call('exchangeDeviceCheckToken', [$params], GoogleFirebaseAppcheckV1AppCheckToken::class);
|
---|
| 154 | }
|
---|
| 155 | /**
|
---|
| 156 | * Validates an [integrity verdict response token from Play Integrity](https://d
|
---|
| 157 | * eveloper.android.com/google/play/integrity/verdict#decrypt-verify). If valid,
|
---|
| 158 | * returns an AppCheckToken. (apps.exchangePlayIntegrityToken)
|
---|
| 159 | *
|
---|
| 160 | * @param string $app Required. The relative resource name of the Android app,
|
---|
| 161 | * in the format: ``` projects/{project_number}/apps/{app_id} ``` If necessary,
|
---|
| 162 | * the `project_number` element can be replaced with the project ID of the
|
---|
| 163 | * Firebase project. Learn more about using project identifiers in Google's [AIP
|
---|
| 164 | * 2510](https://google.aip.dev/cloud/2510) standard.
|
---|
| 165 | * @param GoogleFirebaseAppcheckV1ExchangePlayIntegrityTokenRequest $postBody
|
---|
| 166 | * @param array $optParams Optional parameters.
|
---|
| 167 | * @return GoogleFirebaseAppcheckV1AppCheckToken
|
---|
| 168 | * @throws \Google\Service\Exception
|
---|
| 169 | */
|
---|
| 170 | public function exchangePlayIntegrityToken($app, GoogleFirebaseAppcheckV1ExchangePlayIntegrityTokenRequest $postBody, $optParams = [])
|
---|
| 171 | {
|
---|
| 172 | $params = ['app' => $app, 'postBody' => $postBody];
|
---|
| 173 | $params = array_merge($params, $optParams);
|
---|
| 174 | return $this->call('exchangePlayIntegrityToken', [$params], GoogleFirebaseAppcheckV1AppCheckToken::class);
|
---|
| 175 | }
|
---|
| 176 | /**
|
---|
| 177 | * Validates a [reCAPTCHA Enterprise response
|
---|
| 178 | * token](https://cloud.google.com/recaptcha-enterprise/docs/create-
|
---|
| 179 | * assessment#retrieve_token). If valid, returns an AppCheckToken.
|
---|
| 180 | * (apps.exchangeRecaptchaEnterpriseToken)
|
---|
| 181 | *
|
---|
| 182 | * @param string $app Required. The relative resource name of the web app, in
|
---|
| 183 | * the format: ``` projects/{project_number}/apps/{app_id} ``` If necessary, the
|
---|
| 184 | * `project_number` element can be replaced with the project ID of the Firebase
|
---|
| 185 | * project. Learn more about using project identifiers in Google's [AIP
|
---|
| 186 | * 2510](https://google.aip.dev/cloud/2510) standard.
|
---|
| 187 | * @param GoogleFirebaseAppcheckV1ExchangeRecaptchaEnterpriseTokenRequest $postBody
|
---|
| 188 | * @param array $optParams Optional parameters.
|
---|
| 189 | * @return GoogleFirebaseAppcheckV1AppCheckToken
|
---|
| 190 | * @throws \Google\Service\Exception
|
---|
| 191 | */
|
---|
| 192 | public function exchangeRecaptchaEnterpriseToken($app, GoogleFirebaseAppcheckV1ExchangeRecaptchaEnterpriseTokenRequest $postBody, $optParams = [])
|
---|
| 193 | {
|
---|
| 194 | $params = ['app' => $app, 'postBody' => $postBody];
|
---|
| 195 | $params = array_merge($params, $optParams);
|
---|
| 196 | return $this->call('exchangeRecaptchaEnterpriseToken', [$params], GoogleFirebaseAppcheckV1AppCheckToken::class);
|
---|
| 197 | }
|
---|
| 198 | /**
|
---|
| 199 | * Validates a [reCAPTCHA v3 response
|
---|
| 200 | * token](https://developers.google.com/recaptcha/docs/v3). If valid, returns an
|
---|
| 201 | * AppCheckToken. (apps.exchangeRecaptchaV3Token)
|
---|
| 202 | *
|
---|
| 203 | * @param string $app Required. The relative resource name of the web app, in
|
---|
| 204 | * the format: ``` projects/{project_number}/apps/{app_id} ``` If necessary, the
|
---|
| 205 | * `project_number` element can be replaced with the project ID of the Firebase
|
---|
| 206 | * project. Learn more about using project identifiers in Google's [AIP
|
---|
| 207 | * 2510](https://google.aip.dev/cloud/2510) standard.
|
---|
| 208 | * @param GoogleFirebaseAppcheckV1ExchangeRecaptchaV3TokenRequest $postBody
|
---|
| 209 | * @param array $optParams Optional parameters.
|
---|
| 210 | * @return GoogleFirebaseAppcheckV1AppCheckToken
|
---|
| 211 | * @throws \Google\Service\Exception
|
---|
| 212 | */
|
---|
| 213 | public function exchangeRecaptchaV3Token($app, GoogleFirebaseAppcheckV1ExchangeRecaptchaV3TokenRequest $postBody, $optParams = [])
|
---|
| 214 | {
|
---|
| 215 | $params = ['app' => $app, 'postBody' => $postBody];
|
---|
| 216 | $params = array_merge($params, $optParams);
|
---|
| 217 | return $this->call('exchangeRecaptchaV3Token', [$params], GoogleFirebaseAppcheckV1AppCheckToken::class);
|
---|
| 218 | }
|
---|
| 219 | /**
|
---|
| 220 | * Validates a [SafetyNet
|
---|
| 221 | * token](https://developer.android.com/training/safetynet/attestation#request-
|
---|
| 222 | * attestation-step). If valid, returns an AppCheckToken.
|
---|
| 223 | * (apps.exchangeSafetyNetToken)
|
---|
| 224 | *
|
---|
| 225 | * @param string $app Required. The relative resource name of the Android app,
|
---|
| 226 | * in the format: ``` projects/{project_number}/apps/{app_id} ``` If necessary,
|
---|
| 227 | * the `project_number` element can be replaced with the project ID of the
|
---|
| 228 | * Firebase project. Learn more about using project identifiers in Google's [AIP
|
---|
| 229 | * 2510](https://google.aip.dev/cloud/2510) standard.
|
---|
| 230 | * @param GoogleFirebaseAppcheckV1ExchangeSafetyNetTokenRequest $postBody
|
---|
| 231 | * @param array $optParams Optional parameters.
|
---|
| 232 | * @return GoogleFirebaseAppcheckV1AppCheckToken
|
---|
| 233 | * @throws \Google\Service\Exception
|
---|
| 234 | */
|
---|
| 235 | public function exchangeSafetyNetToken($app, GoogleFirebaseAppcheckV1ExchangeSafetyNetTokenRequest $postBody, $optParams = [])
|
---|
| 236 | {
|
---|
| 237 | $params = ['app' => $app, 'postBody' => $postBody];
|
---|
| 238 | $params = array_merge($params, $optParams);
|
---|
| 239 | return $this->call('exchangeSafetyNetToken', [$params], GoogleFirebaseAppcheckV1AppCheckToken::class);
|
---|
| 240 | }
|
---|
| 241 | /**
|
---|
| 242 | * Generates a challenge that protects the integrity of an immediately following
|
---|
| 243 | * call to ExchangeAppAttestAttestation or ExchangeAppAttestAssertion. A
|
---|
| 244 | * challenge should not be reused for multiple calls.
|
---|
| 245 | * (apps.generateAppAttestChallenge)
|
---|
| 246 | *
|
---|
| 247 | * @param string $app Required. The relative resource name of the iOS app, in
|
---|
| 248 | * the format: ``` projects/{project_number}/apps/{app_id} ``` If necessary, the
|
---|
| 249 | * `project_number` element can be replaced with the project ID of the Firebase
|
---|
| 250 | * project. Learn more about using project identifiers in Google's [AIP
|
---|
| 251 | * 2510](https://google.aip.dev/cloud/2510) standard.
|
---|
| 252 | * @param GoogleFirebaseAppcheckV1GenerateAppAttestChallengeRequest $postBody
|
---|
| 253 | * @param array $optParams Optional parameters.
|
---|
| 254 | * @return GoogleFirebaseAppcheckV1GenerateAppAttestChallengeResponse
|
---|
| 255 | * @throws \Google\Service\Exception
|
---|
| 256 | */
|
---|
| 257 | public function generateAppAttestChallenge($app, GoogleFirebaseAppcheckV1GenerateAppAttestChallengeRequest $postBody, $optParams = [])
|
---|
| 258 | {
|
---|
| 259 | $params = ['app' => $app, 'postBody' => $postBody];
|
---|
| 260 | $params = array_merge($params, $optParams);
|
---|
| 261 | return $this->call('generateAppAttestChallenge', [$params], GoogleFirebaseAppcheckV1GenerateAppAttestChallengeResponse::class);
|
---|
| 262 | }
|
---|
| 263 | /**
|
---|
| 264 | * Generates a challenge that protects the integrity of an immediately following
|
---|
| 265 | * integrity verdict request to the Play Integrity API. The next call to
|
---|
| 266 | * ExchangePlayIntegrityToken using the resulting integrity token will verify
|
---|
| 267 | * the presence and validity of the challenge. A challenge should not be reused
|
---|
| 268 | * for multiple calls. (apps.generatePlayIntegrityChallenge)
|
---|
| 269 | *
|
---|
| 270 | * @param string $app Required. The relative resource name of the app, in the
|
---|
| 271 | * format: ``` projects/{project_number}/apps/{app_id} ``` If necessary, the
|
---|
| 272 | * `project_number` element can be replaced with the project ID of the Firebase
|
---|
| 273 | * project. Learn more about using project identifiers in Google's [AIP
|
---|
| 274 | * 2510](https://google.aip.dev/cloud/2510) standard.
|
---|
| 275 | * @param GoogleFirebaseAppcheckV1GeneratePlayIntegrityChallengeRequest $postBody
|
---|
| 276 | * @param array $optParams Optional parameters.
|
---|
| 277 | * @return GoogleFirebaseAppcheckV1GeneratePlayIntegrityChallengeResponse
|
---|
| 278 | * @throws \Google\Service\Exception
|
---|
| 279 | */
|
---|
| 280 | public function generatePlayIntegrityChallenge($app, GoogleFirebaseAppcheckV1GeneratePlayIntegrityChallengeRequest $postBody, $optParams = [])
|
---|
| 281 | {
|
---|
| 282 | $params = ['app' => $app, 'postBody' => $postBody];
|
---|
| 283 | $params = array_merge($params, $optParams);
|
---|
| 284 | return $this->call('generatePlayIntegrityChallenge', [$params], GoogleFirebaseAppcheckV1GeneratePlayIntegrityChallengeResponse::class);
|
---|
| 285 | }
|
---|
| 286 | }
|
---|
| 287 |
|
---|
| 288 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 289 | class_alias(ProjectsApps::class, 'Google_Service_Firebaseappcheck_Resource_ProjectsApps');
|
---|