Skip to content

Commit cf9e930

Browse files
1 parent fc47370 commit cf9e930

8 files changed

Lines changed: 339 additions & 2 deletions
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
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\FirebaseDataConnect;
19+
20+
class ClientCache extends \Google\Model
21+
{
22+
/**
23+
* Optional. A field that, if true, means that responses served by this
24+
* connector will include entityIds in GraphQL response extensions. This helps
25+
* the client SDK cache responses in an improved way, known as "normalized
26+
* caching", if caching is enabled on the client. Each entityId is a stable
27+
* key based on primary key values. Therefore, this field should only be set
28+
* to true if the primary keys of accessed tables do not contain sensitive
29+
* information.
30+
*
31+
* @var bool
32+
*/
33+
public $entityIdIncluded;
34+
/**
35+
* Optional. A field that, if true, enables stricter validation on the
36+
* connector source code to make sure the operation response shapes are
37+
* suitable for client-side caching. This can include additional errors and
38+
* warnings. For example, using the same alias for different fields is
39+
* disallowed, as it may cause conflicts or confusion with normalized caching.
40+
* (This field is off by default for compatibility, but enabling it is highly
41+
* recommended to catch common caching pitfalls.)
42+
*
43+
* @var bool
44+
*/
45+
public $strictValidationEnabled;
46+
47+
/**
48+
* Optional. A field that, if true, means that responses served by this
49+
* connector will include entityIds in GraphQL response extensions. This helps
50+
* the client SDK cache responses in an improved way, known as "normalized
51+
* caching", if caching is enabled on the client. Each entityId is a stable
52+
* key based on primary key values. Therefore, this field should only be set
53+
* to true if the primary keys of accessed tables do not contain sensitive
54+
* information.
55+
*
56+
* @param bool $entityIdIncluded
57+
*/
58+
public function setEntityIdIncluded($entityIdIncluded)
59+
{
60+
$this->entityIdIncluded = $entityIdIncluded;
61+
}
62+
/**
63+
* @return bool
64+
*/
65+
public function getEntityIdIncluded()
66+
{
67+
return $this->entityIdIncluded;
68+
}
69+
/**
70+
* Optional. A field that, if true, enables stricter validation on the
71+
* connector source code to make sure the operation response shapes are
72+
* suitable for client-side caching. This can include additional errors and
73+
* warnings. For example, using the same alias for different fields is
74+
* disallowed, as it may cause conflicts or confusion with normalized caching.
75+
* (This field is off by default for compatibility, but enabling it is highly
76+
* recommended to catch common caching pitfalls.)
77+
*
78+
* @param bool $strictValidationEnabled
79+
*/
80+
public function setStrictValidationEnabled($strictValidationEnabled)
81+
{
82+
$this->strictValidationEnabled = $strictValidationEnabled;
83+
}
84+
/**
85+
* @return bool
86+
*/
87+
public function getStrictValidationEnabled()
88+
{
89+
return $this->strictValidationEnabled;
90+
}
91+
}
92+
93+
// Adding a class alias for backwards compatibility with the previous class name.
94+
class_alias(ClientCache::class, 'Google_Service_FirebaseDataConnect_ClientCache');

src/FirebaseDataConnect/Connector.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ class Connector extends \Google\Model
2525
* @var string[]
2626
*/
2727
public $annotations;
28+
protected $clientCacheType = ClientCache::class;
29+
protected $clientCacheDataType = '';
2830
/**
2931
* Output only. [Output only] Create time stamp.
3032
*
@@ -98,6 +100,22 @@ public function getAnnotations()
98100
{
99101
return $this->annotations;
100102
}
103+
/**
104+
* Optional. The client cache settings of the connector.
105+
*
106+
* @param ClientCache $clientCache
107+
*/
108+
public function setClientCache(ClientCache $clientCache)
109+
{
110+
$this->clientCache = $clientCache;
111+
}
112+
/**
113+
* @return ClientCache
114+
*/
115+
public function getClientCache()
116+
{
117+
return $this->clientCache;
118+
}
101119
/**
102120
* Output only. [Output only] Create time stamp.
103121
*
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
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\FirebaseDataConnect;
19+
20+
class DataConnectProperties extends \Google\Collection
21+
{
22+
protected $collection_key = 'path';
23+
/**
24+
* A single Entity ID. Set if the path points to a single entity.
25+
*
26+
* @var string
27+
*/
28+
public $entityId;
29+
/**
30+
* A list of Entity IDs. Set if the path points to an array of entities. An ID
31+
* is present for each element of the array at the corresponding index.
32+
*
33+
* @var string[]
34+
*/
35+
public $entityIds;
36+
/**
37+
* The server-suggested duration before data under path is considered stale.
38+
*
39+
* @var string
40+
*/
41+
public $maxAge;
42+
/**
43+
* The path under response.data where the rest of the fields apply. Each
44+
* element may be a string (field name) or number (array index). The root of
45+
* response.data is denoted by the empty list `[]`.
46+
*
47+
* @var array[]
48+
*/
49+
public $path;
50+
51+
/**
52+
* A single Entity ID. Set if the path points to a single entity.
53+
*
54+
* @param string $entityId
55+
*/
56+
public function setEntityId($entityId)
57+
{
58+
$this->entityId = $entityId;
59+
}
60+
/**
61+
* @return string
62+
*/
63+
public function getEntityId()
64+
{
65+
return $this->entityId;
66+
}
67+
/**
68+
* A list of Entity IDs. Set if the path points to an array of entities. An ID
69+
* is present for each element of the array at the corresponding index.
70+
*
71+
* @param string[] $entityIds
72+
*/
73+
public function setEntityIds($entityIds)
74+
{
75+
$this->entityIds = $entityIds;
76+
}
77+
/**
78+
* @return string[]
79+
*/
80+
public function getEntityIds()
81+
{
82+
return $this->entityIds;
83+
}
84+
/**
85+
* The server-suggested duration before data under path is considered stale.
86+
*
87+
* @param string $maxAge
88+
*/
89+
public function setMaxAge($maxAge)
90+
{
91+
$this->maxAge = $maxAge;
92+
}
93+
/**
94+
* @return string
95+
*/
96+
public function getMaxAge()
97+
{
98+
return $this->maxAge;
99+
}
100+
/**
101+
* The path under response.data where the rest of the fields apply. Each
102+
* element may be a string (field name) or number (array index). The root of
103+
* response.data is denoted by the empty list `[]`.
104+
*
105+
* @param array[] $path
106+
*/
107+
public function setPath($path)
108+
{
109+
$this->path = $path;
110+
}
111+
/**
112+
* @return array[]
113+
*/
114+
public function getPath()
115+
{
116+
return $this->path;
117+
}
118+
}
119+
120+
// Adding a class alias for backwards compatibility with the previous class name.
121+
class_alias(DataConnectProperties::class, 'Google_Service_FirebaseDataConnect_DataConnectProperties');

src/FirebaseDataConnect/ExecuteMutationResponse.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ class ExecuteMutationResponse extends \Google\Collection
2828
public $data;
2929
protected $errorsType = GraphqlError::class;
3030
protected $errorsDataType = 'array';
31+
protected $extensionsType = GraphqlResponseExtensions::class;
32+
protected $extensionsDataType = '';
3133

3234
/**
3335
* The result of executing the requested operation.
@@ -61,6 +63,22 @@ public function getErrors()
6163
{
6264
return $this->errors;
6365
}
66+
/**
67+
* Additional response information.
68+
*
69+
* @param GraphqlResponseExtensions $extensions
70+
*/
71+
public function setExtensions(GraphqlResponseExtensions $extensions)
72+
{
73+
$this->extensions = $extensions;
74+
}
75+
/**
76+
* @return GraphqlResponseExtensions
77+
*/
78+
public function getExtensions()
79+
{
80+
return $this->extensions;
81+
}
6482
}
6583

6684
// Adding a class alias for backwards compatibility with the previous class name.

src/FirebaseDataConnect/ExecuteQueryResponse.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ class ExecuteQueryResponse extends \Google\Collection
2828
public $data;
2929
protected $errorsType = GraphqlError::class;
3030
protected $errorsDataType = 'array';
31+
protected $extensionsType = GraphqlResponseExtensions::class;
32+
protected $extensionsDataType = '';
3133

3234
/**
3335
* The result of executing the requested operation.
@@ -61,6 +63,22 @@ public function getErrors()
6163
{
6264
return $this->errors;
6365
}
66+
/**
67+
* Additional response information.
68+
*
69+
* @param GraphqlResponseExtensions $extensions
70+
*/
71+
public function setExtensions(GraphqlResponseExtensions $extensions)
72+
{
73+
$this->extensions = $extensions;
74+
}
75+
/**
76+
* @return GraphqlResponseExtensions
77+
*/
78+
public function getExtensions()
79+
{
80+
return $this->extensions;
81+
}
6482
}
6583

6684
// Adding a class alias for backwards compatibility with the previous class name.

src/FirebaseDataConnect/GraphqlResponse.php

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ class GraphqlResponse extends \Google\Collection
3434
public $data;
3535
protected $errorsType = GraphqlError::class;
3636
protected $errorsDataType = 'array';
37+
protected $extensionsType = GraphqlResponseExtensions::class;
38+
protected $extensionsDataType = '';
3739

3840
/**
3941
* The result of the execution of the requested operation. If an error was
@@ -60,7 +62,7 @@ public function getData()
6062
/**
6163
* Errors of this response. If the data entry in the response is not present,
6264
* the errors entry must be present. It conforms to
63-
* https://spec.graphql.org/draft/#sec-Errors.
65+
* https://spec.graphql.org/draft/#sec-Errors .
6466
*
6567
* @param GraphqlError[] $errors
6668
*/
@@ -75,6 +77,23 @@ public function getErrors()
7577
{
7678
return $this->errors;
7779
}
80+
/**
81+
* Additional response information. It conforms to
82+
* https://spec.graphql.org/draft/#sec-Extensions .
83+
*
84+
* @param GraphqlResponseExtensions $extensions
85+
*/
86+
public function setExtensions(GraphqlResponseExtensions $extensions)
87+
{
88+
$this->extensions = $extensions;
89+
}
90+
/**
91+
* @return GraphqlResponseExtensions
92+
*/
93+
public function getExtensions()
94+
{
95+
return $this->extensions;
96+
}
7897
}
7998

8099
// Adding a class alias for backwards compatibility with the previous class name.

0 commit comments

Comments
 (0)