diff --git a/.github/workflows/backwards-compatibility-checks.yaml b/.github/workflows/backwards-compatibility-checks.yaml index 64995944328e..d70fede112d9 100644 --- a/.github/workflows/backwards-compatibility-checks.yaml +++ b/.github/workflows/backwards-compatibility-checks.yaml @@ -68,15 +68,17 @@ jobs: continue-on-error: true # OwlBot PRs which are not labelled feat should not add new files or methods run: | - ~/.composer/vendor/bin/roave-backward-compatibility-check --to=origin/main --format=github-actions + ~/.composer/vendor/bin/roave-backward-compatibility-check \ + --from=${{ github.ref_name }} \ + --to=origin/main --format=github-actions - name: "Print the action item" run: | if [[ "${{ steps.compatibility-checker.outcome }}" == 'failure' ]]; then - if [[ "${{ startsWith(github.event.pull_request.title, 'feat') }}" == "true" ]]; then + if [[ "${{ startsWith(github.event.pull_request.title, 'feat') }}" == "false" ]]; then echo "Action item: Change the conventional commit to use 'feat'" exit 1 fi - elif [[ "${{ startsWith(github.event.pull_request.title, 'feat') }}" == "false" ]]; then + elif [[ "${{ startsWith(github.event.pull_request.title, 'feat') }}" == "true" ]]; then echo "Action item: No features found, do not use 'feat' for the conventional commit" exit 1 fi diff --git a/AiPlatform/VERSION b/AiPlatform/VERSION index bd8bf882d061..27f9cd322bb9 100644 --- a/AiPlatform/VERSION +++ b/AiPlatform/VERSION @@ -1 +1 @@ -1.7.0 +1.8.0 diff --git a/AiPlatform/metadata/V1/Content.php b/AiPlatform/metadata/V1/Content.php index 6b5b5ae57d09..2f518197707f 100644 Binary files a/AiPlatform/metadata/V1/Content.php and b/AiPlatform/metadata/V1/Content.php differ diff --git a/AiPlatform/metadata/V1/FeatureView.php b/AiPlatform/metadata/V1/FeatureView.php index bad9af707b12..eecd45a3cd8e 100644 Binary files a/AiPlatform/metadata/V1/FeatureView.php and b/AiPlatform/metadata/V1/FeatureView.php differ diff --git a/AiPlatform/metadata/V1/Tool.php b/AiPlatform/metadata/V1/Tool.php index bd6a39c0b483..56d59e12d73d 100644 Binary files a/AiPlatform/metadata/V1/Tool.php and b/AiPlatform/metadata/V1/Tool.php differ diff --git a/AiPlatform/src/V1/DynamicRetrievalConfig.php b/AiPlatform/src/V1/DynamicRetrievalConfig.php new file mode 100644 index 000000000000..348546b3771f --- /dev/null +++ b/AiPlatform/src/V1/DynamicRetrievalConfig.php @@ -0,0 +1,115 @@ +google.cloud.aiplatform.v1.DynamicRetrievalConfig + */ +class DynamicRetrievalConfig extends \Google\Protobuf\Internal\Message +{ + /** + * The mode of the predictor to be used in dynamic retrieval. + * + * Generated from protobuf field .google.cloud.aiplatform.v1.DynamicRetrievalConfig.Mode mode = 1; + */ + protected $mode = 0; + /** + * Optional. The threshold to be used in dynamic retrieval. + * If not set, a system default value is used. + * + * Generated from protobuf field optional float dynamic_threshold = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $dynamic_threshold = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $mode + * The mode of the predictor to be used in dynamic retrieval. + * @type float $dynamic_threshold + * Optional. The threshold to be used in dynamic retrieval. + * If not set, a system default value is used. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Aiplatform\V1\Tool::initOnce(); + parent::__construct($data); + } + + /** + * The mode of the predictor to be used in dynamic retrieval. + * + * Generated from protobuf field .google.cloud.aiplatform.v1.DynamicRetrievalConfig.Mode mode = 1; + * @return int + */ + public function getMode() + { + return $this->mode; + } + + /** + * The mode of the predictor to be used in dynamic retrieval. + * + * Generated from protobuf field .google.cloud.aiplatform.v1.DynamicRetrievalConfig.Mode mode = 1; + * @param int $var + * @return $this + */ + public function setMode($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AIPlatform\V1\DynamicRetrievalConfig\Mode::class); + $this->mode = $var; + + return $this; + } + + /** + * Optional. The threshold to be used in dynamic retrieval. + * If not set, a system default value is used. + * + * Generated from protobuf field optional float dynamic_threshold = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return float + */ + public function getDynamicThreshold() + { + return isset($this->dynamic_threshold) ? $this->dynamic_threshold : 0.0; + } + + public function hasDynamicThreshold() + { + return isset($this->dynamic_threshold); + } + + public function clearDynamicThreshold() + { + unset($this->dynamic_threshold); + } + + /** + * Optional. The threshold to be used in dynamic retrieval. + * If not set, a system default value is used. + * + * Generated from protobuf field optional float dynamic_threshold = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param float $var + * @return $this + */ + public function setDynamicThreshold($var) + { + GPBUtil::checkFloat($var); + $this->dynamic_threshold = $var; + + return $this; + } + +} + diff --git a/AiPlatform/src/V1/DynamicRetrievalConfig/Mode.php b/AiPlatform/src/V1/DynamicRetrievalConfig/Mode.php new file mode 100644 index 000000000000..77641a620db8 --- /dev/null +++ b/AiPlatform/src/V1/DynamicRetrievalConfig/Mode.php @@ -0,0 +1,55 @@ +google.cloud.aiplatform.v1.DynamicRetrievalConfig.Mode + */ +class Mode +{ + /** + * Always trigger retrieval. + * + * Generated from protobuf enum MODE_UNSPECIFIED = 0; + */ + const MODE_UNSPECIFIED = 0; + /** + * Run retrieval only when system decides it is necessary. + * + * Generated from protobuf enum MODE_DYNAMIC = 1; + */ + const MODE_DYNAMIC = 1; + + private static $valueToName = [ + self::MODE_UNSPECIFIED => 'MODE_UNSPECIFIED', + self::MODE_DYNAMIC => 'MODE_DYNAMIC', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/AiPlatform/src/V1/FeatureView/SyncConfig.php b/AiPlatform/src/V1/FeatureView/SyncConfig.php index 2d3ea23f9625..0c1f94be63a7 100644 --- a/AiPlatform/src/V1/FeatureView/SyncConfig.php +++ b/AiPlatform/src/V1/FeatureView/SyncConfig.php @@ -26,6 +26,13 @@ class SyncConfig extends \Google\Protobuf\Internal\Message * Generated from protobuf field string cron = 1; */ protected $cron = ''; + /** + * Optional. If true, syncs the FeatureView in a continuous manner to Online + * Store. + * + * Generated from protobuf field bool continuous = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $continuous = false; /** * Constructor. @@ -40,6 +47,9 @@ class SyncConfig extends \Google\Protobuf\Internal\Message * The ${IANA_TIME_ZONE} may only be a valid string from IANA time zone * database. For example, "CRON_TZ=America/New_York 1 * * * *", or * "TZ=America/New_York 1 * * * *". + * @type bool $continuous + * Optional. If true, syncs the FeatureView in a continuous manner to Online + * Store. * } */ public function __construct($data = NULL) { @@ -83,6 +93,34 @@ public function setCron($var) return $this; } + /** + * Optional. If true, syncs the FeatureView in a continuous manner to Online + * Store. + * + * Generated from protobuf field bool continuous = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getContinuous() + { + return $this->continuous; + } + + /** + * Optional. If true, syncs the FeatureView in a continuous manner to Online + * Store. + * + * Generated from protobuf field bool continuous = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setContinuous($var) + { + GPBUtil::checkBool($var); + $this->continuous = $var; + + return $this; + } + } diff --git a/AiPlatform/src/V1/GoogleSearchRetrieval.php b/AiPlatform/src/V1/GoogleSearchRetrieval.php index cc36184fedd3..214e0c41028e 100644 --- a/AiPlatform/src/V1/GoogleSearchRetrieval.php +++ b/AiPlatform/src/V1/GoogleSearchRetrieval.php @@ -15,6 +15,12 @@ */ class GoogleSearchRetrieval extends \Google\Protobuf\Internal\Message { + /** + * Specifies the dynamic retrieval configuration for the given source. + * + * Generated from protobuf field .google.cloud.aiplatform.v1.DynamicRetrievalConfig dynamic_retrieval_config = 2; + */ + protected $dynamic_retrieval_config = null; /** * Constructor. @@ -22,6 +28,8 @@ class GoogleSearchRetrieval extends \Google\Protobuf\Internal\Message * @param array $data { * Optional. Data for populating the Message object. * + * @type \Google\Cloud\AIPlatform\V1\DynamicRetrievalConfig $dynamic_retrieval_config + * Specifies the dynamic retrieval configuration for the given source. * } */ public function __construct($data = NULL) { @@ -29,5 +37,41 @@ public function __construct($data = NULL) { parent::__construct($data); } + /** + * Specifies the dynamic retrieval configuration for the given source. + * + * Generated from protobuf field .google.cloud.aiplatform.v1.DynamicRetrievalConfig dynamic_retrieval_config = 2; + * @return \Google\Cloud\AIPlatform\V1\DynamicRetrievalConfig|null + */ + public function getDynamicRetrievalConfig() + { + return $this->dynamic_retrieval_config; + } + + public function hasDynamicRetrievalConfig() + { + return isset($this->dynamic_retrieval_config); + } + + public function clearDynamicRetrievalConfig() + { + unset($this->dynamic_retrieval_config); + } + + /** + * Specifies the dynamic retrieval configuration for the given source. + * + * Generated from protobuf field .google.cloud.aiplatform.v1.DynamicRetrievalConfig dynamic_retrieval_config = 2; + * @param \Google\Cloud\AIPlatform\V1\DynamicRetrievalConfig $var + * @return $this + */ + public function setDynamicRetrievalConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AIPlatform\V1\DynamicRetrievalConfig::class); + $this->dynamic_retrieval_config = $var; + + return $this; + } + } diff --git a/AiPlatform/src/V1/GroundingMetadata.php b/AiPlatform/src/V1/GroundingMetadata.php index 3fa308284dd7..8b7c22d3f7a7 100644 --- a/AiPlatform/src/V1/GroundingMetadata.php +++ b/AiPlatform/src/V1/GroundingMetadata.php @@ -39,6 +39,12 @@ class GroundingMetadata extends \Google\Protobuf\Internal\Message * Generated from protobuf field repeated .google.cloud.aiplatform.v1.GroundingSupport grounding_supports = 6 [(.google.api.field_behavior) = OPTIONAL]; */ private $grounding_supports; + /** + * Optional. Output only. Retrieval metadata. + * + * Generated from protobuf field optional .google.cloud.aiplatform.v1.RetrievalMetadata retrieval_metadata = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $retrieval_metadata = null; /** * Constructor. @@ -54,6 +60,8 @@ class GroundingMetadata extends \Google\Protobuf\Internal\Message * List of supporting references retrieved from specified grounding source. * @type array<\Google\Cloud\AIPlatform\V1\GroundingSupport>|\Google\Protobuf\Internal\RepeatedField $grounding_supports * Optional. List of grounding support. + * @type \Google\Cloud\AIPlatform\V1\RetrievalMetadata $retrieval_metadata + * Optional. Output only. Retrieval metadata. * } */ public function __construct($data = NULL) { @@ -175,5 +183,41 @@ public function setGroundingSupports($var) return $this; } + /** + * Optional. Output only. Retrieval metadata. + * + * Generated from protobuf field optional .google.cloud.aiplatform.v1.RetrievalMetadata retrieval_metadata = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\AIPlatform\V1\RetrievalMetadata|null + */ + public function getRetrievalMetadata() + { + return $this->retrieval_metadata; + } + + public function hasRetrievalMetadata() + { + return isset($this->retrieval_metadata); + } + + public function clearRetrievalMetadata() + { + unset($this->retrieval_metadata); + } + + /** + * Optional. Output only. Retrieval metadata. + * + * Generated from protobuf field optional .google.cloud.aiplatform.v1.RetrievalMetadata retrieval_metadata = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\AIPlatform\V1\RetrievalMetadata $var + * @return $this + */ + public function setRetrievalMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AIPlatform\V1\RetrievalMetadata::class); + $this->retrieval_metadata = $var; + + return $this; + } + } diff --git a/AiPlatform/src/V1/RetrievalMetadata.php b/AiPlatform/src/V1/RetrievalMetadata.php new file mode 100644 index 000000000000..8cf571a16f22 --- /dev/null +++ b/AiPlatform/src/V1/RetrievalMetadata.php @@ -0,0 +1,83 @@ +google.cloud.aiplatform.v1.RetrievalMetadata + */ +class RetrievalMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Score indicating how likely information from google search could + * help answer the prompt. The score is in the range `[0, 1]`, where 0 is the + * least likely and 1 is the most likely. This score is only populated when + * google search grounding and dynamic retrieval is enabled. It will be + * compared to the threshold to determine whether to trigger google search. + * + * Generated from protobuf field float google_search_dynamic_retrieval_score = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $google_search_dynamic_retrieval_score = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $google_search_dynamic_retrieval_score + * Optional. Score indicating how likely information from google search could + * help answer the prompt. The score is in the range `[0, 1]`, where 0 is the + * least likely and 1 is the most likely. This score is only populated when + * google search grounding and dynamic retrieval is enabled. It will be + * compared to the threshold to determine whether to trigger google search. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Aiplatform\V1\Content::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Score indicating how likely information from google search could + * help answer the prompt. The score is in the range `[0, 1]`, where 0 is the + * least likely and 1 is the most likely. This score is only populated when + * google search grounding and dynamic retrieval is enabled. It will be + * compared to the threshold to determine whether to trigger google search. + * + * Generated from protobuf field float google_search_dynamic_retrieval_score = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return float + */ + public function getGoogleSearchDynamicRetrievalScore() + { + return $this->google_search_dynamic_retrieval_score; + } + + /** + * Optional. Score indicating how likely information from google search could + * help answer the prompt. The score is in the range `[0, 1]`, where 0 is the + * least likely and 1 is the most likely. This score is only populated when + * google search grounding and dynamic retrieval is enabled. It will be + * compared to the threshold to determine whether to trigger google search. + * + * Generated from protobuf field float google_search_dynamic_retrieval_score = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param float $var + * @return $this + */ + public function setGoogleSearchDynamicRetrievalScore($var) + { + GPBUtil::checkFloat($var); + $this->google_search_dynamic_retrieval_score = $var; + + return $this; + } + +} + diff --git a/AppsChat/VERSION b/AppsChat/VERSION index 8f0916f768f0..a918a2aa18d5 100644 --- a/AppsChat/VERSION +++ b/AppsChat/VERSION @@ -1 +1 @@ -0.5.0 +0.6.0 diff --git a/AppsChat/metadata/Chat/V1/Space.php b/AppsChat/metadata/Chat/V1/Space.php index 674070b95f3a..d677ec095933 100644 Binary files a/AppsChat/metadata/Chat/V1/Space.php and b/AppsChat/metadata/Chat/V1/Space.php differ diff --git a/AppsChat/samples/V1/ChatServiceClient/create_membership.php b/AppsChat/samples/V1/ChatServiceClient/create_membership.php index 05291a57e064..00c98fef72c7 100644 --- a/AppsChat/samples/V1/ChatServiceClient/create_membership.php +++ b/AppsChat/samples/V1/ChatServiceClient/create_membership.php @@ -29,40 +29,25 @@ use Google\Apps\Chat\V1\Membership; /** - * Creates a human membership or app membership for the calling app. Creating - * memberships for other apps isn't supported. For an example, see - * [Invite or add a user or a Google Chat app to a - * space](https://developers.google.com/workspace/chat/create-members). + * Creates a membership for the calling Chat app, a user, or a Google Group. + * Creating memberships for other Chat apps isn't supported. * When creating a membership, if the specified member has their auto-accept * policy turned off, then they're invited, and must accept the space * invitation before joining. Otherwise, creating a membership adds the member - * directly to the specified space. Requires [user + * directly to the specified space. + * Requires [user * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). * - * To specify the member to add, set the `membership.member.name` for the - * human or app member, or set the `membership.group_member.name` for the - * group member. + * For example usage, see: * - * - To add the calling app to a space or a direct message between two human - * users, use `users/app`. Unable to add other - * apps to the space. + * - [Invite or add a user to a + * space](https://developers.google.com/workspace/chat/create-members#create-user-membership). * - * - To add a human user, use `users/{user}`, where `{user}` can be the email - * address for the user. For users in the same Workspace organization `{user}` - * can also be the `id` for the person from the People API, or the `id` for - * the user in the Directory API. For example, if the People API Person - * profile ID for `user@example.com` is `123456789`, you can add the user to - * the space by setting the `membership.member.name` to - * `users/user@example.com` or `users/123456789`. + * - [Invite or add a Google Group to a + * space](https://developers.google.com/workspace/chat/create-members#create-group-membership). * - * - To add or invite a Google group in a named space, use - * `groups/{group}`, where `{group}` is the `id` for the group from the Cloud - * Identity Groups API. For example, you can use [Cloud Identity Groups lookup - * API](https://cloud.google.com/identity/docs/reference/rest/v1/groups/lookup) - * to retrieve the ID `123456789` for group email `group@example.com`, then - * you can add or invite the group to a named space by setting the - * `membership.group_member.name` to `groups/123456789`. Group email is not - * supported, and Google groups can only be added as members in named spaces. + * - [Add the Chat app to a + * space](https://developers.google.com/workspace/chat/create-members#create-membership-calling-api). * * @param string $formattedParent The resource name of the space for which to create the * membership. diff --git a/AppsChat/samples/V1/ChatServiceClient/create_message.php b/AppsChat/samples/V1/ChatServiceClient/create_message.php index 9336aea02685..d25de7b6334b 100644 --- a/AppsChat/samples/V1/ChatServiceClient/create_message.php +++ b/AppsChat/samples/V1/ChatServiceClient/create_message.php @@ -29,18 +29,30 @@ use Google\Apps\Chat\V1\Message; /** - * Creates a message in a Google Chat space. The maximum message size, - * including text and cards, is 32,000 bytes. For an example, see [Send a + * Creates a message in a Google Chat space. For an example, see [Send a * message](https://developers.google.com/workspace/chat/create-messages). * - * Calling this method requires - * [authentication](https://developers.google.com/workspace/chat/authenticate-authorize) - * and supports the following authentication types: + * The `create()` method requires either user or app authentication. Chat + * attributes the message sender differently depending on the type of + * authentication that you use in your request. * - * - For text messages, user authentication or app authentication are - * supported. - * - For card messages, only app authentication is supported. (Only Chat apps - * can create card messages.) + * The following image shows how Chat attributes a message when you use app + * authentication. Chat displays the Chat app as the message + * sender. The content of the message can contain text (`text`), cards + * (`cardsV2`), and accessory widgets (`accessoryWidgets`). + * + * ![Message sent with app + * authentication](https://developers.google.com/workspace/chat/images/message-app-auth.svg) + * + * The following image shows how Chat attributes a message when you use user + * authentication. Chat displays the user as the message sender and attributes + * the Chat app to the message by displaying its name. The content of message + * can only contain text (`text`). + * + * ![Message sent with user + * authentication](https://developers.google.com/workspace/chat/images/message-user-auth.svg) + * + * The maximum message size, including the message contents, is 32,000 bytes. * * @param string $formattedParent The resource name of the space in which to create a message. * diff --git a/AppsChat/samples/V1/ChatServiceClient/create_space.php b/AppsChat/samples/V1/ChatServiceClient/create_space.php index bd8d809c8ed3..c331bbca54b9 100644 --- a/AppsChat/samples/V1/ChatServiceClient/create_space.php +++ b/AppsChat/samples/V1/ChatServiceClient/create_space.php @@ -29,14 +29,19 @@ use Google\Apps\Chat\V1\Space; /** - * Creates a named space. Spaces grouped by topics aren't supported. For an - * example, see [Create a + * Creates a space with no members. Can be used to create a named space. + * Spaces grouped by topics aren't supported. For an example, see + * [Create a * space](https://developers.google.com/workspace/chat/create-spaces). * * If you receive the error message `ALREADY_EXISTS` when creating * a space, try a different `displayName`. An existing space within * the Google Workspace organization might already use this display name. * + * If you're a member of the [Developer Preview + * program](https://developers.google.com/workspace/preview), you can create a + * group chat in import mode using `spaceType.GROUP_CHAT`. + * * Requires [user * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). * diff --git a/AppsChat/samples/V1/ChatServiceClient/get_space_event.php b/AppsChat/samples/V1/ChatServiceClient/get_space_event.php index 3a0bd5f76858..562dacb82ecc 100644 --- a/AppsChat/samples/V1/ChatServiceClient/get_space_event.php +++ b/AppsChat/samples/V1/ChatServiceClient/get_space_event.php @@ -36,6 +36,9 @@ * updated, the server returns the updated `Message` resource in the event * payload. * + * Note: The `permissionSettings` field is not returned in the Space + * object of the Space event data for this request. + * * Requires [user * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). * To get an event, the authenticated user must be a member of the space. diff --git a/AppsChat/samples/V1/ChatServiceClient/list_messages.php b/AppsChat/samples/V1/ChatServiceClient/list_messages.php index ad08845a872f..5755838d98d7 100644 --- a/AppsChat/samples/V1/ChatServiceClient/list_messages.php +++ b/AppsChat/samples/V1/ChatServiceClient/list_messages.php @@ -31,8 +31,12 @@ /** * Lists messages in a space that the caller is a member of, including - * messages from blocked members and spaces. For an example, see - * [List messages](/chat/api/guides/v1/messages/list). + * messages from blocked members and spaces. If you list messages from a + * space with no messages, the response is an empty object. When using a + * REST/HTTP interface, the response contains an empty JSON object, `{}`. + * For an example, see + * [List + * messages](https://developers.google.com/workspace/chat/api/guides/v1/messages/list). * Requires [user * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). * diff --git a/AppsChat/src/Chat/V1/Client/ChatServiceClient.php b/AppsChat/src/Chat/V1/Client/ChatServiceClient.php index 75ce95b1c79e..6f111785d59c 100644 --- a/AppsChat/src/Chat/V1/Client/ChatServiceClient.php +++ b/AppsChat/src/Chat/V1/Client/ChatServiceClient.php @@ -502,40 +502,25 @@ public function completeImportSpace( } /** - * Creates a human membership or app membership for the calling app. Creating - * memberships for other apps isn't supported. For an example, see - * [Invite or add a user or a Google Chat app to a - * space](https://developers.google.com/workspace/chat/create-members). + * Creates a membership for the calling Chat app, a user, or a Google Group. + * Creating memberships for other Chat apps isn't supported. * When creating a membership, if the specified member has their auto-accept * policy turned off, then they're invited, and must accept the space * invitation before joining. Otherwise, creating a membership adds the member - * directly to the specified space. Requires [user + * directly to the specified space. + * Requires [user * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). * - * To specify the member to add, set the `membership.member.name` for the - * human or app member, or set the `membership.group_member.name` for the - * group member. - * - * - To add the calling app to a space or a direct message between two human - * users, use `users/app`. Unable to add other - * apps to the space. - * - * - To add a human user, use `users/{user}`, where `{user}` can be the email - * address for the user. For users in the same Workspace organization `{user}` - * can also be the `id` for the person from the People API, or the `id` for - * the user in the Directory API. For example, if the People API Person - * profile ID for `user@example.com` is `123456789`, you can add the user to - * the space by setting the `membership.member.name` to - * `users/user@example.com` or `users/123456789`. - * - * - To add or invite a Google group in a named space, use - * `groups/{group}`, where `{group}` is the `id` for the group from the Cloud - * Identity Groups API. For example, you can use [Cloud Identity Groups lookup - * API](https://cloud.google.com/identity/docs/reference/rest/v1/groups/lookup) - * to retrieve the ID `123456789` for group email `group@example.com`, then - * you can add or invite the group to a named space by setting the - * `membership.group_member.name` to `groups/123456789`. Group email is not - * supported, and Google groups can only be added as members in named spaces. + * For example usage, see: + * + * - [Invite or add a user to a + * space](https://developers.google.com/workspace/chat/create-members#create-user-membership). + * + * - [Invite or add a Google Group to a + * space](https://developers.google.com/workspace/chat/create-members#create-group-membership). + * + * - [Add the Chat app to a + * space](https://developers.google.com/workspace/chat/create-members#create-membership-calling-api). * * The async variant is {@see ChatServiceClient::createMembershipAsync()} . * @@ -561,18 +546,30 @@ public function createMembership(CreateMembershipRequest $request, array $callOp } /** - * Creates a message in a Google Chat space. The maximum message size, - * including text and cards, is 32,000 bytes. For an example, see [Send a + * Creates a message in a Google Chat space. For an example, see [Send a * message](https://developers.google.com/workspace/chat/create-messages). * - * Calling this method requires - * [authentication](https://developers.google.com/workspace/chat/authenticate-authorize) - * and supports the following authentication types: + * The `create()` method requires either user or app authentication. Chat + * attributes the message sender differently depending on the type of + * authentication that you use in your request. * - * - For text messages, user authentication or app authentication are - * supported. - * - For card messages, only app authentication is supported. (Only Chat apps - * can create card messages.) + * The following image shows how Chat attributes a message when you use app + * authentication. Chat displays the Chat app as the message + * sender. The content of the message can contain text (`text`), cards + * (`cardsV2`), and accessory widgets (`accessoryWidgets`). + * + * ![Message sent with app + * authentication](https://developers.google.com/workspace/chat/images/message-app-auth.svg) + * + * The following image shows how Chat attributes a message when you use user + * authentication. Chat displays the user as the message sender and attributes + * the Chat app to the message by displaying its name. The content of message + * can only contain text (`text`). + * + * ![Message sent with user + * authentication](https://developers.google.com/workspace/chat/images/message-user-auth.svg) + * + * The maximum message size, including the message contents, is 32,000 bytes. * * The async variant is {@see ChatServiceClient::createMessageAsync()} . * @@ -629,14 +626,19 @@ public function createReaction(CreateReactionRequest $request, array $callOption } /** - * Creates a named space. Spaces grouped by topics aren't supported. For an - * example, see [Create a + * Creates a space with no members. Can be used to create a named space. + * Spaces grouped by topics aren't supported. For an example, see + * [Create a * space](https://developers.google.com/workspace/chat/create-spaces). * * If you receive the error message `ALREADY_EXISTS` when creating * a space, try a different `displayName`. An existing space within * the Google Workspace organization might already use this display name. * + * If you're a member of the [Developer Preview + * program](https://developers.google.com/workspace/preview), you can create a + * group chat in import mode using `spaceType.GROUP_CHAT`. + * * Requires [user * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). * @@ -985,6 +987,9 @@ public function getSpace(GetSpaceRequest $request, array $callOptions = []): Spa * updated, the server returns the updated `Message` resource in the event * payload. * + * Note: The `permissionSettings` field is not returned in the Space + * object of the Space event data for this request. + * * Requires [user * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). * To get an event, the authenticated user must be a member of the space. @@ -1126,8 +1131,12 @@ public function listMemberships(ListMembershipsRequest $request, array $callOpti /** * Lists messages in a space that the caller is a member of, including - * messages from blocked members and spaces. For an example, see - * [List messages](/chat/api/guides/v1/messages/list). + * messages from blocked members and spaces. If you list messages from a + * space with no messages, the response is an empty object. When using a + * REST/HTTP interface, the response contains an empty JSON object, `{}`. + * For an example, see + * [List + * messages](https://developers.google.com/workspace/chat/api/guides/v1/messages/list). * Requires [user * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). * diff --git a/AppsChat/src/Chat/V1/CreateSpaceRequest.php b/AppsChat/src/Chat/V1/CreateSpaceRequest.php index 6de66b3cff27..0f89cf2aafdf 100644 --- a/AppsChat/src/Chat/V1/CreateSpaceRequest.php +++ b/AppsChat/src/Chat/V1/CreateSpaceRequest.php @@ -9,7 +9,7 @@ use Google\Protobuf\Internal\GPBUtil; /** - * A request to create a named space. + * A request to create a named space with no members. * * Generated from protobuf message google.chat.v1.CreateSpaceRequest */ @@ -18,9 +18,12 @@ class CreateSpaceRequest extends \Google\Protobuf\Internal\Message /** * Required. The `displayName` and `spaceType` fields must be populated. Only * `SpaceType.SPACE` is supported. - * If you receive the error message `ALREADY_EXISTS` when creating a space, + * If you receive the error message `ALREADY_EXISTS`, * try a different `displayName`. An existing space within the Google * Workspace organization might already use this display name. + * If you're a member of the [Developer Preview + * program](https://developers.google.com/workspace/preview), + * `SpaceType.GROUP_CHAT` can be used if `importMode` is set to true. * The space `name` is assigned on the server so anything specified in this * field will be ignored. * @@ -43,10 +46,14 @@ class CreateSpaceRequest extends \Google\Protobuf\Internal\Message * @param \Google\Apps\Chat\V1\Space $space Required. The `displayName` and `spaceType` fields must be populated. Only * `SpaceType.SPACE` is supported. * - * If you receive the error message `ALREADY_EXISTS` when creating a space, + * If you receive the error message `ALREADY_EXISTS`, * try a different `displayName`. An existing space within the Google * Workspace organization might already use this display name. * + * If you're a member of the [Developer Preview + * program](https://developers.google.com/workspace/preview), + * `SpaceType.GROUP_CHAT` can be used if `importMode` is set to true. + * * The space `name` is assigned on the server so anything specified in this * field will be ignored. * @@ -69,9 +76,12 @@ public static function build(\Google\Apps\Chat\V1\Space $space): self * @type \Google\Apps\Chat\V1\Space $space * Required. The `displayName` and `spaceType` fields must be populated. Only * `SpaceType.SPACE` is supported. - * If you receive the error message `ALREADY_EXISTS` when creating a space, + * If you receive the error message `ALREADY_EXISTS`, * try a different `displayName`. An existing space within the Google * Workspace organization might already use this display name. + * If you're a member of the [Developer Preview + * program](https://developers.google.com/workspace/preview), + * `SpaceType.GROUP_CHAT` can be used if `importMode` is set to true. * The space `name` is assigned on the server so anything specified in this * field will be ignored. * @type string $request_id @@ -91,9 +101,12 @@ public function __construct($data = NULL) { /** * Required. The `displayName` and `spaceType` fields must be populated. Only * `SpaceType.SPACE` is supported. - * If you receive the error message `ALREADY_EXISTS` when creating a space, + * If you receive the error message `ALREADY_EXISTS`, * try a different `displayName`. An existing space within the Google * Workspace organization might already use this display name. + * If you're a member of the [Developer Preview + * program](https://developers.google.com/workspace/preview), + * `SpaceType.GROUP_CHAT` can be used if `importMode` is set to true. * The space `name` is assigned on the server so anything specified in this * field will be ignored. * @@ -118,9 +131,12 @@ public function clearSpace() /** * Required. The `displayName` and `spaceType` fields must be populated. Only * `SpaceType.SPACE` is supported. - * If you receive the error message `ALREADY_EXISTS` when creating a space, + * If you receive the error message `ALREADY_EXISTS`, * try a different `displayName`. An existing space within the Google * Workspace organization might already use this display name. + * If you're a member of the [Developer Preview + * program](https://developers.google.com/workspace/preview), + * `SpaceType.GROUP_CHAT` can be used if `importMode` is set to true. * The space `name` is assigned on the server so anything specified in this * field will be ignored. * diff --git a/AppsChat/src/Chat/V1/ListSpaceEventsResponse.php b/AppsChat/src/Chat/V1/ListSpaceEventsResponse.php index e2c6a3830f47..9ed151c8bdda 100644 --- a/AppsChat/src/Chat/V1/ListSpaceEventsResponse.php +++ b/AppsChat/src/Chat/V1/ListSpaceEventsResponse.php @@ -17,6 +17,8 @@ class ListSpaceEventsResponse extends \Google\Protobuf\Internal\Message { /** * Results are returned in chronological order (oldest event first). + * Note: The `permissionSettings` field is not returned in the Space + * object for list requests. * * Generated from protobuf field repeated .google.chat.v1.SpaceEvent space_events = 1; */ @@ -37,6 +39,8 @@ class ListSpaceEventsResponse extends \Google\Protobuf\Internal\Message * * @type array<\Google\Apps\Chat\V1\SpaceEvent>|\Google\Protobuf\Internal\RepeatedField $space_events * Results are returned in chronological order (oldest event first). + * Note: The `permissionSettings` field is not returned in the Space + * object for list requests. * @type string $next_page_token * Continuation token used to fetch more events. * If this field is omitted, there are no subsequent pages. @@ -49,6 +53,8 @@ public function __construct($data = NULL) { /** * Results are returned in chronological order (oldest event first). + * Note: The `permissionSettings` field is not returned in the Space + * object for list requests. * * Generated from protobuf field repeated .google.chat.v1.SpaceEvent space_events = 1; * @return \Google\Protobuf\Internal\RepeatedField @@ -60,6 +66,8 @@ public function getSpaceEvents() /** * Results are returned in chronological order (oldest event first). + * Note: The `permissionSettings` field is not returned in the Space + * object for list requests. * * Generated from protobuf field repeated .google.chat.v1.SpaceEvent space_events = 1; * @param array<\Google\Apps\Chat\V1\SpaceEvent>|\Google\Protobuf\Internal\RepeatedField $var diff --git a/AppsChat/src/Chat/V1/ListSpacesResponse.php b/AppsChat/src/Chat/V1/ListSpacesResponse.php index 64406b36ad8f..866249c6ff30 100644 --- a/AppsChat/src/Chat/V1/ListSpacesResponse.php +++ b/AppsChat/src/Chat/V1/ListSpacesResponse.php @@ -17,6 +17,8 @@ class ListSpacesResponse extends \Google\Protobuf\Internal\Message { /** * List of spaces in the requested (or first) page. + * Note: The `permissionSettings` field is not returned in the Space + * object for list requests. * * Generated from protobuf field repeated .google.chat.v1.Space spaces = 1; */ @@ -37,6 +39,8 @@ class ListSpacesResponse extends \Google\Protobuf\Internal\Message * * @type array<\Google\Apps\Chat\V1\Space>|\Google\Protobuf\Internal\RepeatedField $spaces * List of spaces in the requested (or first) page. + * Note: The `permissionSettings` field is not returned in the Space + * object for list requests. * @type string $next_page_token * You can send a token as `pageToken` to retrieve the next page of * results. If empty, there are no subsequent pages. @@ -49,6 +53,8 @@ public function __construct($data = NULL) { /** * List of spaces in the requested (or first) page. + * Note: The `permissionSettings` field is not returned in the Space + * object for list requests. * * Generated from protobuf field repeated .google.chat.v1.Space spaces = 1; * @return \Google\Protobuf\Internal\RepeatedField @@ -60,6 +66,8 @@ public function getSpaces() /** * List of spaces in the requested (or first) page. + * Note: The `permissionSettings` field is not returned in the Space + * object for list requests. * * Generated from protobuf field repeated .google.chat.v1.Space spaces = 1; * @param array<\Google\Apps\Chat\V1\Space>|\Google\Protobuf\Internal\RepeatedField $var diff --git a/AppsChat/src/Chat/V1/Message.php b/AppsChat/src/Chat/V1/Message.php index 881bdf2e84a0..4a893b5e16de 100644 --- a/AppsChat/src/Chat/V1/Message.php +++ b/AppsChat/src/Chat/V1/Message.php @@ -74,8 +74,8 @@ class Message extends \Google\Protobuf\Internal\Message * You can also [@mention a Google Chat * user](https://developers.google.com/workspace/chat/format-messages#messages-@mention), * or everyone in the space. - * To learn about creating text messages, see [Send a text - * message](https://developers.google.com/workspace/chat/create-messages#create-text-messages). + * To learn about creating text messages, see [Send a + * message](https://developers.google.com/workspace/chat/create-messages). * * Generated from protobuf field string text = 4; */ @@ -120,8 +120,8 @@ class Message extends \Google\Protobuf\Internal\Message * Only Chat apps can create cards. If your Chat app [authenticates as a * user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), * the messages can't contain cards. - * To learn about cards and how to create them, see [Send card - * messages](https://developers.google.com/workspace/chat/create-messages#create). + * To learn how to create a message that contains cards, see [Send a + * message](https://developers.google.com/workspace/chat/create-messages). * [Card builder](https://addons.gsuite.google.com/uikit/builder) * * Generated from protobuf field repeated .google.chat.v1.CardWithId cards_v2 = 22; @@ -222,14 +222,15 @@ class Message extends \Google\Protobuf\Internal\Message /** * Immutable. Input for creating a message, otherwise output only. The user * that can view the message. When set, the message is private and only - * visible to the specified user and the Chat app. Link previews and - * attachments aren't supported for private messages. - * Only Chat apps can send private messages. If your Chat app [authenticates - * as a - * user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - * to send a message, the message can't be private and must omit this field. - * For details, see [Send private messages to Google Chat - * users](https://developers.google.com/workspace/chat/private-messages). + * visible to the specified user and the Chat app. To include this field in + * your request, you must call the Chat API using [app + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + * and omit the following: + * * [Attachments](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages.attachments) + * * [Accessory + * widgets](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages#Message.AccessoryWidget) + * For details, see [Send a message + * privately](https://developers.google.com/workspace/chat/create-messages#private). * * Generated from protobuf field .google.chat.v1.User private_message_viewer = 36 [(.google.api.field_behavior) = IMMUTABLE]; */ @@ -313,8 +314,8 @@ class Message extends \Google\Protobuf\Internal\Message * You can also [@mention a Google Chat * user](https://developers.google.com/workspace/chat/format-messages#messages-@mention), * or everyone in the space. - * To learn about creating text messages, see [Send a text - * message](https://developers.google.com/workspace/chat/create-messages#create-text-messages). + * To learn about creating text messages, see [Send a + * message](https://developers.google.com/workspace/chat/create-messages). * @type string $formatted_text * Output only. Contains the message `text` with markups added to communicate * formatting. This field might not capture all formatting visible in the UI, @@ -346,8 +347,8 @@ class Message extends \Google\Protobuf\Internal\Message * Only Chat apps can create cards. If your Chat app [authenticates as a * user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), * the messages can't contain cards. - * To learn about cards and how to create them, see [Send card - * messages](https://developers.google.com/workspace/chat/create-messages#create). + * To learn how to create a message that contains cards, see [Send a + * message](https://developers.google.com/workspace/chat/create-messages). * [Card builder](https://addons.gsuite.google.com/uikit/builder) * @type array<\Google\Apps\Chat\V1\Annotation>|\Google\Protobuf\Internal\RepeatedField $annotations * Output only. Annotations associated with the `text` in this message. @@ -396,14 +397,15 @@ class Message extends \Google\Protobuf\Internal\Message * @type \Google\Apps\Chat\V1\User $private_message_viewer * Immutable. Input for creating a message, otherwise output only. The user * that can view the message. When set, the message is private and only - * visible to the specified user and the Chat app. Link previews and - * attachments aren't supported for private messages. - * Only Chat apps can send private messages. If your Chat app [authenticates - * as a - * user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - * to send a message, the message can't be private and must omit this field. - * For details, see [Send private messages to Google Chat - * users](https://developers.google.com/workspace/chat/private-messages). + * visible to the specified user and the Chat app. To include this field in + * your request, you must call the Chat API using [app + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + * and omit the following: + * * [Attachments](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages.attachments) + * * [Accessory + * widgets](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages#Message.AccessoryWidget) + * For details, see [Send a message + * privately](https://developers.google.com/workspace/chat/create-messages#private). * @type \Google\Apps\Chat\V1\DeletionMetadata $deletion_metadata * Output only. Information about a deleted message. A message is deleted when * `delete_time` is set. @@ -649,8 +651,8 @@ public function setDeleteTime($var) * You can also [@mention a Google Chat * user](https://developers.google.com/workspace/chat/format-messages#messages-@mention), * or everyone in the space. - * To learn about creating text messages, see [Send a text - * message](https://developers.google.com/workspace/chat/create-messages#create-text-messages). + * To learn about creating text messages, see [Send a + * message](https://developers.google.com/workspace/chat/create-messages). * * Generated from protobuf field string text = 4; * @return string @@ -667,8 +669,8 @@ public function getText() * You can also [@mention a Google Chat * user](https://developers.google.com/workspace/chat/format-messages#messages-@mention), * or everyone in the space. - * To learn about creating text messages, see [Send a text - * message](https://developers.google.com/workspace/chat/create-messages#create-text-messages). + * To learn about creating text messages, see [Send a + * message](https://developers.google.com/workspace/chat/create-messages). * * Generated from protobuf field string text = 4; * @param string $var @@ -786,8 +788,8 @@ public function setCards($var) * Only Chat apps can create cards. If your Chat app [authenticates as a * user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), * the messages can't contain cards. - * To learn about cards and how to create them, see [Send card - * messages](https://developers.google.com/workspace/chat/create-messages#create). + * To learn how to create a message that contains cards, see [Send a + * message](https://developers.google.com/workspace/chat/create-messages). * [Card builder](https://addons.gsuite.google.com/uikit/builder) * * Generated from protobuf field repeated .google.chat.v1.CardWithId cards_v2 = 22; @@ -804,8 +806,8 @@ public function getCardsV2() * Only Chat apps can create cards. If your Chat app [authenticates as a * user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), * the messages can't contain cards. - * To learn about cards and how to create them, see [Send card - * messages](https://developers.google.com/workspace/chat/create-messages#create). + * To learn how to create a message that contains cards, see [Send a + * message](https://developers.google.com/workspace/chat/create-messages). * [Card builder](https://addons.gsuite.google.com/uikit/builder) * * Generated from protobuf field repeated .google.chat.v1.CardWithId cards_v2 = 22; @@ -1225,14 +1227,15 @@ public function setEmojiReactionSummaries($var) /** * Immutable. Input for creating a message, otherwise output only. The user * that can view the message. When set, the message is private and only - * visible to the specified user and the Chat app. Link previews and - * attachments aren't supported for private messages. - * Only Chat apps can send private messages. If your Chat app [authenticates - * as a - * user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - * to send a message, the message can't be private and must omit this field. - * For details, see [Send private messages to Google Chat - * users](https://developers.google.com/workspace/chat/private-messages). + * visible to the specified user and the Chat app. To include this field in + * your request, you must call the Chat API using [app + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + * and omit the following: + * * [Attachments](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages.attachments) + * * [Accessory + * widgets](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages#Message.AccessoryWidget) + * For details, see [Send a message + * privately](https://developers.google.com/workspace/chat/create-messages#private). * * Generated from protobuf field .google.chat.v1.User private_message_viewer = 36 [(.google.api.field_behavior) = IMMUTABLE]; * @return \Google\Apps\Chat\V1\User|null @@ -1255,14 +1258,15 @@ public function clearPrivateMessageViewer() /** * Immutable. Input for creating a message, otherwise output only. The user * that can view the message. When set, the message is private and only - * visible to the specified user and the Chat app. Link previews and - * attachments aren't supported for private messages. - * Only Chat apps can send private messages. If your Chat app [authenticates - * as a - * user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - * to send a message, the message can't be private and must omit this field. - * For details, see [Send private messages to Google Chat - * users](https://developers.google.com/workspace/chat/private-messages). + * visible to the specified user and the Chat app. To include this field in + * your request, you must call the Chat API using [app + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + * and omit the following: + * * [Attachments](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages.attachments) + * * [Accessory + * widgets](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages#Message.AccessoryWidget) + * For details, see [Send a message + * privately](https://developers.google.com/workspace/chat/create-messages#private). * * Generated from protobuf field .google.chat.v1.User private_message_viewer = 36 [(.google.api.field_behavior) = IMMUTABLE]; * @param \Google\Apps\Chat\V1\User $var diff --git a/AppsChat/src/Chat/V1/Space.php b/AppsChat/src/Chat/V1/Space.php index 4713be4f4339..5ec5b13d3147 100644 --- a/AppsChat/src/Chat/V1/Space.php +++ b/AppsChat/src/Chat/V1/Space.php @@ -19,6 +19,12 @@ class Space extends \Google\Protobuf\Internal\Message /** * Resource name of the space. * Format: `spaces/{space}` + * Where `{space}` represents the system-assigned ID for the space. You can + * obtain the space ID by calling the + * [`spaces.list()`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces/list) + * method or from the space URL. For example, if the space URL + * is `https://mail.google.com/mail/u/0/#chat/space/AAAAAAAAA`, the space ID + * is `AAAAAAAAA`. * * Generated from protobuf field string name = 1; */ @@ -55,11 +61,11 @@ class Space extends \Google\Protobuf\Internal\Message protected $threaded = false; /** * The space's display name. Required when [creating a - * space](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces/create). - * If you receive the error message `ALREADY_EXISTS` when creating a space or - * updating the `displayName`, try a different `displayName`. An - * existing space within the Google Workspace organization might already use - * this display name. + * space](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces/create) + * with a `spaceType` of `SPACE`. If you receive the error message + * `ALREADY_EXISTS` when creating a space or updating the `displayName`, try a + * different `displayName`. An existing space within the Google Workspace + * organization might already use this display name. * For direct messages, this field might be empty. * Supports up to 128 characters. * @@ -73,14 +79,6 @@ class Space extends \Google\Protobuf\Internal\Message * * The authenticated user uses a consumer account (unmanaged user * account). By default, a space created by a consumer account permits any * Google Chat user. - * * The space is used to [import data to Google Chat] - * (https://developers.google.com/chat/api/guides/import-data-overview) - * because import mode spaces must only permit members from the same - * Google Workspace organization. However, as part of the [Google - * Workspace Developer Preview - * Program](https://developers.google.com/workspace/preview), import mode - * spaces can permit any Google Chat user so this field can then be set - * for import mode spaces. * For existing spaces, this field is output only. * * Generated from protobuf field bool external_user_allowed = 8 [(.google.api.field_behavior) = IMMUTABLE]; @@ -161,6 +159,7 @@ class Space extends \Google\Protobuf\Internal\Message * Generated from protobuf field string space_uri = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ protected $space_uri = ''; + protected $space_permission_settings; /** * Constructor. @@ -171,6 +170,12 @@ class Space extends \Google\Protobuf\Internal\Message * @type string $name * Resource name of the space. * Format: `spaces/{space}` + * Where `{space}` represents the system-assigned ID for the space. You can + * obtain the space ID by calling the + * [`spaces.list()`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces/list) + * method or from the space URL. For example, if the space URL + * is `https://mail.google.com/mail/u/0/#chat/space/AAAAAAAAA`, the space ID + * is `AAAAAAAAA`. * @type int $type * Output only. Deprecated: Use `space_type` instead. * The type of a space. @@ -185,11 +190,11 @@ class Space extends \Google\Protobuf\Internal\Message * Whether messages are threaded in this space. * @type string $display_name * The space's display name. Required when [creating a - * space](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces/create). - * If you receive the error message `ALREADY_EXISTS` when creating a space or - * updating the `displayName`, try a different `displayName`. An - * existing space within the Google Workspace organization might already use - * this display name. + * space](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces/create) + * with a `spaceType` of `SPACE`. If you receive the error message + * `ALREADY_EXISTS` when creating a space or updating the `displayName`, try a + * different `displayName`. An existing space within the Google Workspace + * organization might already use this display name. * For direct messages, this field might be empty. * Supports up to 128 characters. * @type bool $external_user_allowed @@ -199,14 +204,6 @@ class Space extends \Google\Protobuf\Internal\Message * * The authenticated user uses a consumer account (unmanaged user * account). By default, a space created by a consumer account permits any * Google Chat user. - * * The space is used to [import data to Google Chat] - * (https://developers.google.com/chat/api/guides/import-data-overview) - * because import mode spaces must only permit members from the same - * Google Workspace organization. However, as part of the [Google - * Workspace Developer Preview - * Program](https://developers.google.com/workspace/preview), import mode - * spaces can permit any Google Chat user so this field can then be set - * for import mode spaces. * For existing spaces, this field is output only. * @type int $space_threading_state * Output only. The threading state in the Chat space. @@ -243,6 +240,15 @@ class Space extends \Google\Protobuf\Internal\Message * Only populated when the `space_type` is `SPACE`. * @type string $space_uri * Output only. The URI for a user to access the space. + * @type int $predefined_permission_settings + * Optional. Input only. Predefined space permission settings, input only + * when creating a space. If the field is not set, a collaboration space is + * created. After you create the space, settings are populated in the + * `PermissionSettings` field. + * @type \Google\Apps\Chat\V1\Space\PermissionSettings $permission_settings + * Optional. Space permission settings for existing spaces. Input for + * updating exact space permission settings, where existing permission + * settings are replaced. Output lists current permission settings. * } */ public function __construct($data = NULL) { @@ -253,6 +259,12 @@ public function __construct($data = NULL) { /** * Resource name of the space. * Format: `spaces/{space}` + * Where `{space}` represents the system-assigned ID for the space. You can + * obtain the space ID by calling the + * [`spaces.list()`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces/list) + * method or from the space URL. For example, if the space URL + * is `https://mail.google.com/mail/u/0/#chat/space/AAAAAAAAA`, the space ID + * is `AAAAAAAAA`. * * Generated from protobuf field string name = 1; * @return string @@ -265,6 +277,12 @@ public function getName() /** * Resource name of the space. * Format: `spaces/{space}` + * Where `{space}` represents the system-assigned ID for the space. You can + * obtain the space ID by calling the + * [`spaces.list()`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces/list) + * method or from the space URL. For example, if the space URL + * is `https://mail.google.com/mail/u/0/#chat/space/AAAAAAAAA`, the space ID + * is `AAAAAAAAA`. * * Generated from protobuf field string name = 1; * @param string $var @@ -400,11 +418,11 @@ public function setThreaded($var) /** * The space's display name. Required when [creating a - * space](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces/create). - * If you receive the error message `ALREADY_EXISTS` when creating a space or - * updating the `displayName`, try a different `displayName`. An - * existing space within the Google Workspace organization might already use - * this display name. + * space](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces/create) + * with a `spaceType` of `SPACE`. If you receive the error message + * `ALREADY_EXISTS` when creating a space or updating the `displayName`, try a + * different `displayName`. An existing space within the Google Workspace + * organization might already use this display name. * For direct messages, this field might be empty. * Supports up to 128 characters. * @@ -418,11 +436,11 @@ public function getDisplayName() /** * The space's display name. Required when [creating a - * space](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces/create). - * If you receive the error message `ALREADY_EXISTS` when creating a space or - * updating the `displayName`, try a different `displayName`. An - * existing space within the Google Workspace organization might already use - * this display name. + * space](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces/create) + * with a `spaceType` of `SPACE`. If you receive the error message + * `ALREADY_EXISTS` when creating a space or updating the `displayName`, try a + * different `displayName`. An existing space within the Google Workspace + * organization might already use this display name. * For direct messages, this field might be empty. * Supports up to 128 characters. * @@ -445,14 +463,6 @@ public function setDisplayName($var) * * The authenticated user uses a consumer account (unmanaged user * account). By default, a space created by a consumer account permits any * Google Chat user. - * * The space is used to [import data to Google Chat] - * (https://developers.google.com/chat/api/guides/import-data-overview) - * because import mode spaces must only permit members from the same - * Google Workspace organization. However, as part of the [Google - * Workspace Developer Preview - * Program](https://developers.google.com/workspace/preview), import mode - * spaces can permit any Google Chat user so this field can then be set - * for import mode spaces. * For existing spaces, this field is output only. * * Generated from protobuf field bool external_user_allowed = 8 [(.google.api.field_behavior) = IMMUTABLE]; @@ -470,14 +480,6 @@ public function getExternalUserAllowed() * * The authenticated user uses a consumer account (unmanaged user * account). By default, a space created by a consumer account permits any * Google Chat user. - * * The space is used to [import data to Google Chat] - * (https://developers.google.com/chat/api/guides/import-data-overview) - * because import mode spaces must only permit members from the same - * Google Workspace organization. However, as part of the [Google - * Workspace Developer Preview - * Program](https://developers.google.com/workspace/preview), import mode - * spaces can permit any Google Chat user so this field can then be set - * for import mode spaces. * For existing spaces, this field is output only. * * Generated from protobuf field bool external_user_allowed = 8 [(.google.api.field_behavior) = IMMUTABLE]; @@ -832,5 +834,85 @@ public function setSpaceUri($var) return $this; } + /** + * Optional. Input only. Predefined space permission settings, input only + * when creating a space. If the field is not set, a collaboration space is + * created. After you create the space, settings are populated in the + * `PermissionSettings` field. + * + * Generated from protobuf field .google.chat.v1.Space.PredefinedPermissionSettings predefined_permission_settings = 26 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPredefinedPermissionSettings() + { + return $this->readOneof(26); + } + + public function hasPredefinedPermissionSettings() + { + return $this->hasOneof(26); + } + + /** + * Optional. Input only. Predefined space permission settings, input only + * when creating a space. If the field is not set, a collaboration space is + * created. After you create the space, settings are populated in the + * `PermissionSettings` field. + * + * Generated from protobuf field .google.chat.v1.Space.PredefinedPermissionSettings predefined_permission_settings = 26 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPredefinedPermissionSettings($var) + { + GPBUtil::checkEnum($var, \Google\Apps\Chat\V1\Space\PredefinedPermissionSettings::class); + $this->writeOneof(26, $var); + + return $this; + } + + /** + * Optional. Space permission settings for existing spaces. Input for + * updating exact space permission settings, where existing permission + * settings are replaced. Output lists current permission settings. + * + * Generated from protobuf field .google.chat.v1.Space.PermissionSettings permission_settings = 27 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Apps\Chat\V1\Space\PermissionSettings|null + */ + public function getPermissionSettings() + { + return $this->readOneof(27); + } + + public function hasPermissionSettings() + { + return $this->hasOneof(27); + } + + /** + * Optional. Space permission settings for existing spaces. Input for + * updating exact space permission settings, where existing permission + * settings are replaced. Output lists current permission settings. + * + * Generated from protobuf field .google.chat.v1.Space.PermissionSettings permission_settings = 27 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Apps\Chat\V1\Space\PermissionSettings $var + * @return $this + */ + public function setPermissionSettings($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\Space\PermissionSettings::class); + $this->writeOneof(27, $var); + + return $this; + } + + /** + * @return string + */ + public function getSpacePermissionSettings() + { + return $this->whichOneof("space_permission_settings"); + } + } diff --git a/AppsChat/src/Chat/V1/Space/AccessSettings.php b/AppsChat/src/Chat/V1/Space/AccessSettings.php index c53a5f4ac500..4c89622cbf46 100644 --- a/AppsChat/src/Chat/V1/Space/AccessSettings.php +++ b/AppsChat/src/Chat/V1/Space/AccessSettings.php @@ -25,12 +25,16 @@ class AccessSettings extends \Google\Protobuf\Internal\Message /** * Optional. The resource name of the [target * audience](https://support.google.com/a/answer/9934697) who can discover - * the space, join the space, and preview the messages in the space. For - * details, see [Make a space discoverable to a target + * the space, join the space, and preview the messages in the space. If + * unset, only users or Google Groups who have been individually invited or + * added to the space can access it. For details, see [Make a space + * discoverable to a target * audience](https://developers.google.com/workspace/chat/space-target-audience). * Format: `audiences/{audience}` * To use the default target audience for the Google Workspace organization, * set to `audiences/default`. + * This field is not populated when using the `chat.bot` scope with [app + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). * * Generated from protobuf field string audience = 3 [(.google.api.field_behavior) = OPTIONAL]; */ @@ -47,12 +51,16 @@ class AccessSettings extends \Google\Protobuf\Internal\Message * @type string $audience * Optional. The resource name of the [target * audience](https://support.google.com/a/answer/9934697) who can discover - * the space, join the space, and preview the messages in the space. For - * details, see [Make a space discoverable to a target + * the space, join the space, and preview the messages in the space. If + * unset, only users or Google Groups who have been individually invited or + * added to the space can access it. For details, see [Make a space + * discoverable to a target * audience](https://developers.google.com/workspace/chat/space-target-audience). * Format: `audiences/{audience}` * To use the default target audience for the Google Workspace organization, * set to `audiences/default`. + * This field is not populated when using the `chat.bot` scope with [app + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). * } */ public function __construct($data = NULL) { @@ -89,12 +97,16 @@ public function setAccessState($var) /** * Optional. The resource name of the [target * audience](https://support.google.com/a/answer/9934697) who can discover - * the space, join the space, and preview the messages in the space. For - * details, see [Make a space discoverable to a target + * the space, join the space, and preview the messages in the space. If + * unset, only users or Google Groups who have been individually invited or + * added to the space can access it. For details, see [Make a space + * discoverable to a target * audience](https://developers.google.com/workspace/chat/space-target-audience). * Format: `audiences/{audience}` * To use the default target audience for the Google Workspace organization, * set to `audiences/default`. + * This field is not populated when using the `chat.bot` scope with [app + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). * * Generated from protobuf field string audience = 3 [(.google.api.field_behavior) = OPTIONAL]; * @return string @@ -107,12 +119,16 @@ public function getAudience() /** * Optional. The resource name of the [target * audience](https://support.google.com/a/answer/9934697) who can discover - * the space, join the space, and preview the messages in the space. For - * details, see [Make a space discoverable to a target + * the space, join the space, and preview the messages in the space. If + * unset, only users or Google Groups who have been individually invited or + * added to the space can access it. For details, see [Make a space + * discoverable to a target * audience](https://developers.google.com/workspace/chat/space-target-audience). * Format: `audiences/{audience}` * To use the default target audience for the Google Workspace organization, * set to `audiences/default`. + * This field is not populated when using the `chat.bot` scope with [app + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). * * Generated from protobuf field string audience = 3 [(.google.api.field_behavior) = OPTIONAL]; * @param string $var diff --git a/AppsChat/src/Chat/V1/Space/AccessSettings/AccessState.php b/AppsChat/src/Chat/V1/Space/AccessSettings/AccessState.php index 3e3f2d95cea8..280f8e0b4ad5 100644 --- a/AppsChat/src/Chat/V1/Space/AccessSettings/AccessState.php +++ b/AppsChat/src/Chat/V1/Space/AccessSettings/AccessState.php @@ -20,15 +20,19 @@ class AccessState */ const ACCESS_STATE_UNSPECIFIED = 0; /** - * Space is discoverable by added or invited members or groups. + * Only users or Google Groups that have been individually added or + * invited by other users or Google Workspace administrators can discover + * and access the space. * * Generated from protobuf enum PRIVATE = 1; */ const PBPRIVATE = 1; /** - * Space is discoverable by the selected [target - * audience](https://support.google.com/a/answer/9934697), as well as - * added or invited members or groups. + * A space manager has granted a target audience access to + * the space. Users or Google Groups that have been individually added or + * invited to the space can also discover and access the space. To learn + * more, see [Make a space discoverable to specific + * users](https://developers.google.com/workspace/chat/space-target-audience). * * Generated from protobuf enum DISCOVERABLE = 2; */ diff --git a/AppsChat/src/Chat/V1/Space/PermissionSetting.php b/AppsChat/src/Chat/V1/Space/PermissionSetting.php new file mode 100644 index 000000000000..8132b74f377a --- /dev/null +++ b/AppsChat/src/Chat/V1/Space/PermissionSetting.php @@ -0,0 +1,102 @@ +google.chat.v1.Space.PermissionSetting + */ +class PermissionSetting extends \Google\Protobuf\Internal\Message +{ + /** + * Whether spaces managers have this permission. + * + * Generated from protobuf field bool managers_allowed = 1; + */ + protected $managers_allowed = false; + /** + * Whether non-manager members have this permission. + * + * Generated from protobuf field bool members_allowed = 2; + */ + protected $members_allowed = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $managers_allowed + * Whether spaces managers have this permission. + * @type bool $members_allowed + * Whether non-manager members have this permission. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\Space::initOnce(); + parent::__construct($data); + } + + /** + * Whether spaces managers have this permission. + * + * Generated from protobuf field bool managers_allowed = 1; + * @return bool + */ + public function getManagersAllowed() + { + return $this->managers_allowed; + } + + /** + * Whether spaces managers have this permission. + * + * Generated from protobuf field bool managers_allowed = 1; + * @param bool $var + * @return $this + */ + public function setManagersAllowed($var) + { + GPBUtil::checkBool($var); + $this->managers_allowed = $var; + + return $this; + } + + /** + * Whether non-manager members have this permission. + * + * Generated from protobuf field bool members_allowed = 2; + * @return bool + */ + public function getMembersAllowed() + { + return $this->members_allowed; + } + + /** + * Whether non-manager members have this permission. + * + * Generated from protobuf field bool members_allowed = 2; + * @param bool $var + * @return $this + */ + public function setMembersAllowed($var) + { + GPBUtil::checkBool($var); + $this->members_allowed = $var; + + return $this; + } + +} + + diff --git a/AppsChat/src/Chat/V1/Space/PermissionSettings.php b/AppsChat/src/Chat/V1/Space/PermissionSettings.php new file mode 100644 index 000000000000..a582b37b674b --- /dev/null +++ b/AppsChat/src/Chat/V1/Space/PermissionSettings.php @@ -0,0 +1,389 @@ +google.chat.v1.Space.PermissionSettings + */ +class PermissionSettings extends \Google\Protobuf\Internal\Message +{ + /** + * Setting for managing members and groups in a space. + * + * Generated from protobuf field optional .google.chat.v1.Space.PermissionSetting manage_members_and_groups = 1; + */ + protected $manage_members_and_groups = null; + /** + * Setting for updating space name, avatar, description and guidelines. + * + * Generated from protobuf field optional .google.chat.v1.Space.PermissionSetting modify_space_details = 2; + */ + protected $modify_space_details = null; + /** + * Setting for toggling space history on and off. + * + * Generated from protobuf field optional .google.chat.v1.Space.PermissionSetting toggle_history = 3; + */ + protected $toggle_history = null; + /** + * Setting for using @all in a space. + * + * Generated from protobuf field optional .google.chat.v1.Space.PermissionSetting use_at_mention_all = 4; + */ + protected $use_at_mention_all = null; + /** + * Setting for managing apps in a space. + * + * Generated from protobuf field optional .google.chat.v1.Space.PermissionSetting manage_apps = 5; + */ + protected $manage_apps = null; + /** + * Setting for managing webhooks in a space. + * + * Generated from protobuf field optional .google.chat.v1.Space.PermissionSetting manage_webhooks = 6; + */ + protected $manage_webhooks = null; + /** + * Output only. Setting for posting messages in a space. + * + * Generated from protobuf field optional .google.chat.v1.Space.PermissionSetting post_messages = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $post_messages = null; + /** + * Setting for replying to messages in a space. + * + * Generated from protobuf field optional .google.chat.v1.Space.PermissionSetting reply_messages = 8; + */ + protected $reply_messages = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Apps\Chat\V1\Space\PermissionSetting $manage_members_and_groups + * Setting for managing members and groups in a space. + * @type \Google\Apps\Chat\V1\Space\PermissionSetting $modify_space_details + * Setting for updating space name, avatar, description and guidelines. + * @type \Google\Apps\Chat\V1\Space\PermissionSetting $toggle_history + * Setting for toggling space history on and off. + * @type \Google\Apps\Chat\V1\Space\PermissionSetting $use_at_mention_all + * Setting for using @all in a space. + * @type \Google\Apps\Chat\V1\Space\PermissionSetting $manage_apps + * Setting for managing apps in a space. + * @type \Google\Apps\Chat\V1\Space\PermissionSetting $manage_webhooks + * Setting for managing webhooks in a space. + * @type \Google\Apps\Chat\V1\Space\PermissionSetting $post_messages + * Output only. Setting for posting messages in a space. + * @type \Google\Apps\Chat\V1\Space\PermissionSetting $reply_messages + * Setting for replying to messages in a space. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Chat\V1\Space::initOnce(); + parent::__construct($data); + } + + /** + * Setting for managing members and groups in a space. + * + * Generated from protobuf field optional .google.chat.v1.Space.PermissionSetting manage_members_and_groups = 1; + * @return \Google\Apps\Chat\V1\Space\PermissionSetting|null + */ + public function getManageMembersAndGroups() + { + return $this->manage_members_and_groups; + } + + public function hasManageMembersAndGroups() + { + return isset($this->manage_members_and_groups); + } + + public function clearManageMembersAndGroups() + { + unset($this->manage_members_and_groups); + } + + /** + * Setting for managing members and groups in a space. + * + * Generated from protobuf field optional .google.chat.v1.Space.PermissionSetting manage_members_and_groups = 1; + * @param \Google\Apps\Chat\V1\Space\PermissionSetting $var + * @return $this + */ + public function setManageMembersAndGroups($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\Space\PermissionSetting::class); + $this->manage_members_and_groups = $var; + + return $this; + } + + /** + * Setting for updating space name, avatar, description and guidelines. + * + * Generated from protobuf field optional .google.chat.v1.Space.PermissionSetting modify_space_details = 2; + * @return \Google\Apps\Chat\V1\Space\PermissionSetting|null + */ + public function getModifySpaceDetails() + { + return $this->modify_space_details; + } + + public function hasModifySpaceDetails() + { + return isset($this->modify_space_details); + } + + public function clearModifySpaceDetails() + { + unset($this->modify_space_details); + } + + /** + * Setting for updating space name, avatar, description and guidelines. + * + * Generated from protobuf field optional .google.chat.v1.Space.PermissionSetting modify_space_details = 2; + * @param \Google\Apps\Chat\V1\Space\PermissionSetting $var + * @return $this + */ + public function setModifySpaceDetails($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\Space\PermissionSetting::class); + $this->modify_space_details = $var; + + return $this; + } + + /** + * Setting for toggling space history on and off. + * + * Generated from protobuf field optional .google.chat.v1.Space.PermissionSetting toggle_history = 3; + * @return \Google\Apps\Chat\V1\Space\PermissionSetting|null + */ + public function getToggleHistory() + { + return $this->toggle_history; + } + + public function hasToggleHistory() + { + return isset($this->toggle_history); + } + + public function clearToggleHistory() + { + unset($this->toggle_history); + } + + /** + * Setting for toggling space history on and off. + * + * Generated from protobuf field optional .google.chat.v1.Space.PermissionSetting toggle_history = 3; + * @param \Google\Apps\Chat\V1\Space\PermissionSetting $var + * @return $this + */ + public function setToggleHistory($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\Space\PermissionSetting::class); + $this->toggle_history = $var; + + return $this; + } + + /** + * Setting for using @all in a space. + * + * Generated from protobuf field optional .google.chat.v1.Space.PermissionSetting use_at_mention_all = 4; + * @return \Google\Apps\Chat\V1\Space\PermissionSetting|null + */ + public function getUseAtMentionAll() + { + return $this->use_at_mention_all; + } + + public function hasUseAtMentionAll() + { + return isset($this->use_at_mention_all); + } + + public function clearUseAtMentionAll() + { + unset($this->use_at_mention_all); + } + + /** + * Setting for using @all in a space. + * + * Generated from protobuf field optional .google.chat.v1.Space.PermissionSetting use_at_mention_all = 4; + * @param \Google\Apps\Chat\V1\Space\PermissionSetting $var + * @return $this + */ + public function setUseAtMentionAll($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\Space\PermissionSetting::class); + $this->use_at_mention_all = $var; + + return $this; + } + + /** + * Setting for managing apps in a space. + * + * Generated from protobuf field optional .google.chat.v1.Space.PermissionSetting manage_apps = 5; + * @return \Google\Apps\Chat\V1\Space\PermissionSetting|null + */ + public function getManageApps() + { + return $this->manage_apps; + } + + public function hasManageApps() + { + return isset($this->manage_apps); + } + + public function clearManageApps() + { + unset($this->manage_apps); + } + + /** + * Setting for managing apps in a space. + * + * Generated from protobuf field optional .google.chat.v1.Space.PermissionSetting manage_apps = 5; + * @param \Google\Apps\Chat\V1\Space\PermissionSetting $var + * @return $this + */ + public function setManageApps($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\Space\PermissionSetting::class); + $this->manage_apps = $var; + + return $this; + } + + /** + * Setting for managing webhooks in a space. + * + * Generated from protobuf field optional .google.chat.v1.Space.PermissionSetting manage_webhooks = 6; + * @return \Google\Apps\Chat\V1\Space\PermissionSetting|null + */ + public function getManageWebhooks() + { + return $this->manage_webhooks; + } + + public function hasManageWebhooks() + { + return isset($this->manage_webhooks); + } + + public function clearManageWebhooks() + { + unset($this->manage_webhooks); + } + + /** + * Setting for managing webhooks in a space. + * + * Generated from protobuf field optional .google.chat.v1.Space.PermissionSetting manage_webhooks = 6; + * @param \Google\Apps\Chat\V1\Space\PermissionSetting $var + * @return $this + */ + public function setManageWebhooks($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\Space\PermissionSetting::class); + $this->manage_webhooks = $var; + + return $this; + } + + /** + * Output only. Setting for posting messages in a space. + * + * Generated from protobuf field optional .google.chat.v1.Space.PermissionSetting post_messages = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Apps\Chat\V1\Space\PermissionSetting|null + */ + public function getPostMessages() + { + return $this->post_messages; + } + + public function hasPostMessages() + { + return isset($this->post_messages); + } + + public function clearPostMessages() + { + unset($this->post_messages); + } + + /** + * Output only. Setting for posting messages in a space. + * + * Generated from protobuf field optional .google.chat.v1.Space.PermissionSetting post_messages = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Apps\Chat\V1\Space\PermissionSetting $var + * @return $this + */ + public function setPostMessages($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\Space\PermissionSetting::class); + $this->post_messages = $var; + + return $this; + } + + /** + * Setting for replying to messages in a space. + * + * Generated from protobuf field optional .google.chat.v1.Space.PermissionSetting reply_messages = 8; + * @return \Google\Apps\Chat\V1\Space\PermissionSetting|null + */ + public function getReplyMessages() + { + return $this->reply_messages; + } + + public function hasReplyMessages() + { + return isset($this->reply_messages); + } + + public function clearReplyMessages() + { + unset($this->reply_messages); + } + + /** + * Setting for replying to messages in a space. + * + * Generated from protobuf field optional .google.chat.v1.Space.PermissionSetting reply_messages = 8; + * @param \Google\Apps\Chat\V1\Space\PermissionSetting $var + * @return $this + */ + public function setReplyMessages($var) + { + GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\Space\PermissionSetting::class); + $this->reply_messages = $var; + + return $this; + } + +} + + diff --git a/AppsChat/src/Chat/V1/Space/PredefinedPermissionSettings.php b/AppsChat/src/Chat/V1/Space/PredefinedPermissionSettings.php new file mode 100644 index 000000000000..d0978e1b0e43 --- /dev/null +++ b/AppsChat/src/Chat/V1/Space/PredefinedPermissionSettings.php @@ -0,0 +1,67 @@ +google.chat.v1.Space.PredefinedPermissionSettings + */ +class PredefinedPermissionSettings +{ + /** + * Unspecified. Don't use. + * + * Generated from protobuf enum PREDEFINED_PERMISSION_SETTINGS_UNSPECIFIED = 0; + */ + const PREDEFINED_PERMISSION_SETTINGS_UNSPECIFIED = 0; + /** + * Setting to make the space a collaboration space where all members can + * post messages. + * + * Generated from protobuf enum COLLABORATION_SPACE = 1; + */ + const COLLABORATION_SPACE = 1; + /** + * Setting to make the space an announcement space where only space managers + * can post messages. + * + * Generated from protobuf enum ANNOUNCEMENT_SPACE = 2; + */ + const ANNOUNCEMENT_SPACE = 2; + + private static $valueToName = [ + self::PREDEFINED_PERMISSION_SETTINGS_UNSPECIFIED => 'PREDEFINED_PERMISSION_SETTINGS_UNSPECIFIED', + self::COLLABORATION_SPACE => 'COLLABORATION_SPACE', + self::ANNOUNCEMENT_SPACE => 'ANNOUNCEMENT_SPACE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/AppsChat/src/Chat/V1/Thread.php b/AppsChat/src/Chat/V1/Thread.php index 199a101cc358..cef404ea9070 100644 --- a/AppsChat/src/Chat/V1/Thread.php +++ b/AppsChat/src/Chat/V1/Thread.php @@ -21,7 +21,7 @@ class Thread extends \Google\Protobuf\Internal\Message { /** - * Output only. Resource name of the thread. + * Resource name of the thread. * Example: `spaces/{space}/threads/{thread}` * * Generated from protobuf field string name = 1; @@ -47,7 +47,7 @@ class Thread extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $name - * Output only. Resource name of the thread. + * Resource name of the thread. * Example: `spaces/{space}/threads/{thread}` * @type string $thread_key * Optional. Input for creating or updating a thread. Otherwise, output only. @@ -65,7 +65,7 @@ public function __construct($data = NULL) { } /** - * Output only. Resource name of the thread. + * Resource name of the thread. * Example: `spaces/{space}/threads/{thread}` * * Generated from protobuf field string name = 1; @@ -77,7 +77,7 @@ public function getName() } /** - * Output only. Resource name of the thread. + * Resource name of the thread. * Example: `spaces/{space}/threads/{thread}` * * Generated from protobuf field string name = 1; diff --git a/AppsChat/src/Chat/V1/UpdateSpaceRequest.php b/AppsChat/src/Chat/V1/UpdateSpaceRequest.php index 0c6e81d62483..ef832bfb3be3 100644 --- a/AppsChat/src/Chat/V1/UpdateSpaceRequest.php +++ b/AppsChat/src/Chat/V1/UpdateSpaceRequest.php @@ -26,48 +26,57 @@ class UpdateSpaceRequest extends \Google\Protobuf\Internal\Message /** * Required. The updated field paths, comma separated if there are * multiple. - * Currently supported field paths: - * - `display_name` (Only supports changing the display name of a space with - * the `SPACE` type, or when also including the `space_type` mask to change a - * `GROUP_CHAT` space type to `SPACE`. Trying to update the display name of a - * `GROUP_CHAT` or a `DIRECT_MESSAGE` space results in an invalid argument - * error. If you receive the error message `ALREADY_EXISTS` when updating the - * `displayName`, try a different `displayName`. An existing space within the - * Google Workspace organization might already use this display name.) - * - `space_type` (Only supports changing a `GROUP_CHAT` space type to + * You can update the following fields for a space: + * `space_details`: Updates the space's description. Supports up to 150 + * characters. + * `display_name`: Only supports updating the display name for spaces where + * `spaceType` field is `SPACE`. + * If you receive the error message `ALREADY_EXISTS`, try a different + * value. An existing space within the + * Google Workspace organization might already use this display name. + * `space_type`: Only supports changing a `GROUP_CHAT` space type to * `SPACE`. Include `display_name` together * with `space_type` in the update mask and ensure that the specified space * has a non-empty display name and the `SPACE` space type. Including the * `space_type` mask and the `SPACE` type in the specified space when updating * the display name is optional if the existing space already has the `SPACE` * type. Trying to update the space type in other ways results in an invalid - * argument error). - * `space_type` is not supported with admin access. - * - `space_details` - * - `space_history_state` (Supports [turning history on or off for the - * space](https://support.google.com/chat/answer/7664687) if [the organization - * allows users to change their history - * setting](https://support.google.com/a/answer/7664184). - * Warning: mutually exclusive with all other field paths.) - * `space_history_state` is not supported with admin access. - * - `access_settings.audience` (Supports changing the [access + * argument error. + * `space_type` is not supported with `useAdminAccess`. + * `space_history_state`: Updates [space history + * settings](https://support.google.com/chat/answer/7664687) by turning + * history on or off for the space. Only supported if history settings are + * enabled for the Google Workspace organization. To update the + * space history state, you must omit all other field masks in your request. + * `space_history_state` is not supported with `useAdminAccess`. + * `access_settings.audience`: Updates the [access * setting](https://support.google.com/chat/answer/11971020) of who can - * discover the space, join the space, and preview the messages in space. If - * no audience is specified in the access setting, the space's access setting - * is updated to private. Warning: mutually exclusive with all other field - * paths.) - * `access_settings.audience` is not supported with admin access. - * - Developer Preview: Supports changing the [permission - * settings](https://support.google.com/chat/answer/13340792) of a space, - * supported field paths - * include: `permission_settings.manage_members_and_groups`, - * `permission_settings.modify_space_details`, - * `permission_settings.toggle_history`, - * `permission_settings.use_at_mention_all`, - * `permission_settings.manage_apps`, `permission_settings.manage_webhooks`, - * `permission_settings.reply_messages` - * (Warning: mutually exclusive with all other non-permission settings field - * paths). `permission_settings` is not supported with admin access. + * discover the space, join the space, and preview the messages in named space + * where `spaceType` field is `SPACE`. If the existing space has a + * target audience, you can remove the audience and restrict space access by + * omitting a value for this field mask. To update access settings for a + * space, the authenticating user must be a space manager and omit all other + * field masks in your request. You can't update this field if the space is in + * [import + * mode](https://developers.google.com/workspace/chat/import-data-overview). + * To learn more, see [Make a space discoverable to specific + * users](https://developers.google.com/workspace/chat/space-target-audience). + * `access_settings.audience` is not supported with `useAdminAccess`. + * `permission_settings`: Supports changing the + * [permission settings](https://support.google.com/chat/answer/13340792) + * of a space. + * When updating permission settings, you can only specify + * `permissionSettings` field masks; you cannot update other field masks + * at the same time. `permissionSettings` is not supported with + * `useAdminAccess`. + * The supported field masks include: + * - `permission_settings.manageMembersAndGroups` + * - `permission_settings.modifySpaceDetails` + * - `permission_settings.toggleHistory` + * - `permission_settings.useAtMentionAll` + * - `permission_settings.manageApps` + * - `permission_settings.manageWebhooks` + * - `permission_settings.replyMessages` * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; */ @@ -94,54 +103,64 @@ class UpdateSpaceRequest extends \Google\Protobuf\Internal\Message * @param \Google\Protobuf\FieldMask $updateMask Required. The updated field paths, comma separated if there are * multiple. * - * Currently supported field paths: + * You can update the following fields for a space: * - * - `display_name` (Only supports changing the display name of a space with - * the `SPACE` type, or when also including the `space_type` mask to change a - * `GROUP_CHAT` space type to `SPACE`. Trying to update the display name of a - * `GROUP_CHAT` or a `DIRECT_MESSAGE` space results in an invalid argument - * error. If you receive the error message `ALREADY_EXISTS` when updating the - * `displayName`, try a different `displayName`. An existing space within the - * Google Workspace organization might already use this display name.) + * `space_details`: Updates the space's description. Supports up to 150 + * characters. * - * - `space_type` (Only supports changing a `GROUP_CHAT` space type to + * `display_name`: Only supports updating the display name for spaces where + * `spaceType` field is `SPACE`. + * If you receive the error message `ALREADY_EXISTS`, try a different + * value. An existing space within the + * Google Workspace organization might already use this display name. + * + * `space_type`: Only supports changing a `GROUP_CHAT` space type to * `SPACE`. Include `display_name` together * with `space_type` in the update mask and ensure that the specified space * has a non-empty display name and the `SPACE` space type. Including the * `space_type` mask and the `SPACE` type in the specified space when updating * the display name is optional if the existing space already has the `SPACE` * type. Trying to update the space type in other ways results in an invalid - * argument error). - * `space_type` is not supported with admin access. - * - * - `space_details` + * argument error. + * `space_type` is not supported with `useAdminAccess`. * - * - `space_history_state` (Supports [turning history on or off for the - * space](https://support.google.com/chat/answer/7664687) if [the organization - * allows users to change their history - * setting](https://support.google.com/a/answer/7664184). - * Warning: mutually exclusive with all other field paths.) - * `space_history_state` is not supported with admin access. + * `space_history_state`: Updates [space history + * settings](https://support.google.com/chat/answer/7664687) by turning + * history on or off for the space. Only supported if history settings are + * enabled for the Google Workspace organization. To update the + * space history state, you must omit all other field masks in your request. + * `space_history_state` is not supported with `useAdminAccess`. * - * - `access_settings.audience` (Supports changing the [access + * `access_settings.audience`: Updates the [access * setting](https://support.google.com/chat/answer/11971020) of who can - * discover the space, join the space, and preview the messages in space. If - * no audience is specified in the access setting, the space's access setting - * is updated to private. Warning: mutually exclusive with all other field - * paths.) - * `access_settings.audience` is not supported with admin access. + * discover the space, join the space, and preview the messages in named space + * where `spaceType` field is `SPACE`. If the existing space has a + * target audience, you can remove the audience and restrict space access by + * omitting a value for this field mask. To update access settings for a + * space, the authenticating user must be a space manager and omit all other + * field masks in your request. You can't update this field if the space is in + * [import + * mode](https://developers.google.com/workspace/chat/import-data-overview). + * To learn more, see [Make a space discoverable to specific + * users](https://developers.google.com/workspace/chat/space-target-audience). + * `access_settings.audience` is not supported with `useAdminAccess`. + * + * `permission_settings`: Supports changing the + * [permission settings](https://support.google.com/chat/answer/13340792) + * of a space. + * When updating permission settings, you can only specify + * `permissionSettings` field masks; you cannot update other field masks + * at the same time. `permissionSettings` is not supported with + * `useAdminAccess`. + * The supported field masks include: * - * - Developer Preview: Supports changing the [permission - * settings](https://support.google.com/chat/answer/13340792) of a space, - * supported field paths - * include: `permission_settings.manage_members_and_groups`, - * `permission_settings.modify_space_details`, - * `permission_settings.toggle_history`, - * `permission_settings.use_at_mention_all`, - * `permission_settings.manage_apps`, `permission_settings.manage_webhooks`, - * `permission_settings.reply_messages` - * (Warning: mutually exclusive with all other non-permission settings field - * paths). `permission_settings` is not supported with admin access. + * - `permission_settings.manageMembersAndGroups` + * - `permission_settings.modifySpaceDetails` + * - `permission_settings.toggleHistory` + * - `permission_settings.useAtMentionAll` + * - `permission_settings.manageApps` + * - `permission_settings.manageWebhooks` + * - `permission_settings.replyMessages` * * @return \Google\Apps\Chat\V1\UpdateSpaceRequest * @@ -167,48 +186,57 @@ public static function build(\Google\Apps\Chat\V1\Space $space, \Google\Protobuf * @type \Google\Protobuf\FieldMask $update_mask * Required. The updated field paths, comma separated if there are * multiple. - * Currently supported field paths: - * - `display_name` (Only supports changing the display name of a space with - * the `SPACE` type, or when also including the `space_type` mask to change a - * `GROUP_CHAT` space type to `SPACE`. Trying to update the display name of a - * `GROUP_CHAT` or a `DIRECT_MESSAGE` space results in an invalid argument - * error. If you receive the error message `ALREADY_EXISTS` when updating the - * `displayName`, try a different `displayName`. An existing space within the - * Google Workspace organization might already use this display name.) - * - `space_type` (Only supports changing a `GROUP_CHAT` space type to + * You can update the following fields for a space: + * `space_details`: Updates the space's description. Supports up to 150 + * characters. + * `display_name`: Only supports updating the display name for spaces where + * `spaceType` field is `SPACE`. + * If you receive the error message `ALREADY_EXISTS`, try a different + * value. An existing space within the + * Google Workspace organization might already use this display name. + * `space_type`: Only supports changing a `GROUP_CHAT` space type to * `SPACE`. Include `display_name` together * with `space_type` in the update mask and ensure that the specified space * has a non-empty display name and the `SPACE` space type. Including the * `space_type` mask and the `SPACE` type in the specified space when updating * the display name is optional if the existing space already has the `SPACE` * type. Trying to update the space type in other ways results in an invalid - * argument error). - * `space_type` is not supported with admin access. - * - `space_details` - * - `space_history_state` (Supports [turning history on or off for the - * space](https://support.google.com/chat/answer/7664687) if [the organization - * allows users to change their history - * setting](https://support.google.com/a/answer/7664184). - * Warning: mutually exclusive with all other field paths.) - * `space_history_state` is not supported with admin access. - * - `access_settings.audience` (Supports changing the [access + * argument error. + * `space_type` is not supported with `useAdminAccess`. + * `space_history_state`: Updates [space history + * settings](https://support.google.com/chat/answer/7664687) by turning + * history on or off for the space. Only supported if history settings are + * enabled for the Google Workspace organization. To update the + * space history state, you must omit all other field masks in your request. + * `space_history_state` is not supported with `useAdminAccess`. + * `access_settings.audience`: Updates the [access * setting](https://support.google.com/chat/answer/11971020) of who can - * discover the space, join the space, and preview the messages in space. If - * no audience is specified in the access setting, the space's access setting - * is updated to private. Warning: mutually exclusive with all other field - * paths.) - * `access_settings.audience` is not supported with admin access. - * - Developer Preview: Supports changing the [permission - * settings](https://support.google.com/chat/answer/13340792) of a space, - * supported field paths - * include: `permission_settings.manage_members_and_groups`, - * `permission_settings.modify_space_details`, - * `permission_settings.toggle_history`, - * `permission_settings.use_at_mention_all`, - * `permission_settings.manage_apps`, `permission_settings.manage_webhooks`, - * `permission_settings.reply_messages` - * (Warning: mutually exclusive with all other non-permission settings field - * paths). `permission_settings` is not supported with admin access. + * discover the space, join the space, and preview the messages in named space + * where `spaceType` field is `SPACE`. If the existing space has a + * target audience, you can remove the audience and restrict space access by + * omitting a value for this field mask. To update access settings for a + * space, the authenticating user must be a space manager and omit all other + * field masks in your request. You can't update this field if the space is in + * [import + * mode](https://developers.google.com/workspace/chat/import-data-overview). + * To learn more, see [Make a space discoverable to specific + * users](https://developers.google.com/workspace/chat/space-target-audience). + * `access_settings.audience` is not supported with `useAdminAccess`. + * `permission_settings`: Supports changing the + * [permission settings](https://support.google.com/chat/answer/13340792) + * of a space. + * When updating permission settings, you can only specify + * `permissionSettings` field masks; you cannot update other field masks + * at the same time. `permissionSettings` is not supported with + * `useAdminAccess`. + * The supported field masks include: + * - `permission_settings.manageMembersAndGroups` + * - `permission_settings.modifySpaceDetails` + * - `permission_settings.toggleHistory` + * - `permission_settings.useAtMentionAll` + * - `permission_settings.manageApps` + * - `permission_settings.manageWebhooks` + * - `permission_settings.replyMessages` * @type bool $use_admin_access * When `true`, the method runs using the user's Google Workspace * administrator privileges. @@ -269,48 +297,57 @@ public function setSpace($var) /** * Required. The updated field paths, comma separated if there are * multiple. - * Currently supported field paths: - * - `display_name` (Only supports changing the display name of a space with - * the `SPACE` type, or when also including the `space_type` mask to change a - * `GROUP_CHAT` space type to `SPACE`. Trying to update the display name of a - * `GROUP_CHAT` or a `DIRECT_MESSAGE` space results in an invalid argument - * error. If you receive the error message `ALREADY_EXISTS` when updating the - * `displayName`, try a different `displayName`. An existing space within the - * Google Workspace organization might already use this display name.) - * - `space_type` (Only supports changing a `GROUP_CHAT` space type to + * You can update the following fields for a space: + * `space_details`: Updates the space's description. Supports up to 150 + * characters. + * `display_name`: Only supports updating the display name for spaces where + * `spaceType` field is `SPACE`. + * If you receive the error message `ALREADY_EXISTS`, try a different + * value. An existing space within the + * Google Workspace organization might already use this display name. + * `space_type`: Only supports changing a `GROUP_CHAT` space type to * `SPACE`. Include `display_name` together * with `space_type` in the update mask and ensure that the specified space * has a non-empty display name and the `SPACE` space type. Including the * `space_type` mask and the `SPACE` type in the specified space when updating * the display name is optional if the existing space already has the `SPACE` * type. Trying to update the space type in other ways results in an invalid - * argument error). - * `space_type` is not supported with admin access. - * - `space_details` - * - `space_history_state` (Supports [turning history on or off for the - * space](https://support.google.com/chat/answer/7664687) if [the organization - * allows users to change their history - * setting](https://support.google.com/a/answer/7664184). - * Warning: mutually exclusive with all other field paths.) - * `space_history_state` is not supported with admin access. - * - `access_settings.audience` (Supports changing the [access + * argument error. + * `space_type` is not supported with `useAdminAccess`. + * `space_history_state`: Updates [space history + * settings](https://support.google.com/chat/answer/7664687) by turning + * history on or off for the space. Only supported if history settings are + * enabled for the Google Workspace organization. To update the + * space history state, you must omit all other field masks in your request. + * `space_history_state` is not supported with `useAdminAccess`. + * `access_settings.audience`: Updates the [access * setting](https://support.google.com/chat/answer/11971020) of who can - * discover the space, join the space, and preview the messages in space. If - * no audience is specified in the access setting, the space's access setting - * is updated to private. Warning: mutually exclusive with all other field - * paths.) - * `access_settings.audience` is not supported with admin access. - * - Developer Preview: Supports changing the [permission - * settings](https://support.google.com/chat/answer/13340792) of a space, - * supported field paths - * include: `permission_settings.manage_members_and_groups`, - * `permission_settings.modify_space_details`, - * `permission_settings.toggle_history`, - * `permission_settings.use_at_mention_all`, - * `permission_settings.manage_apps`, `permission_settings.manage_webhooks`, - * `permission_settings.reply_messages` - * (Warning: mutually exclusive with all other non-permission settings field - * paths). `permission_settings` is not supported with admin access. + * discover the space, join the space, and preview the messages in named space + * where `spaceType` field is `SPACE`. If the existing space has a + * target audience, you can remove the audience and restrict space access by + * omitting a value for this field mask. To update access settings for a + * space, the authenticating user must be a space manager and omit all other + * field masks in your request. You can't update this field if the space is in + * [import + * mode](https://developers.google.com/workspace/chat/import-data-overview). + * To learn more, see [Make a space discoverable to specific + * users](https://developers.google.com/workspace/chat/space-target-audience). + * `access_settings.audience` is not supported with `useAdminAccess`. + * `permission_settings`: Supports changing the + * [permission settings](https://support.google.com/chat/answer/13340792) + * of a space. + * When updating permission settings, you can only specify + * `permissionSettings` field masks; you cannot update other field masks + * at the same time. `permissionSettings` is not supported with + * `useAdminAccess`. + * The supported field masks include: + * - `permission_settings.manageMembersAndGroups` + * - `permission_settings.modifySpaceDetails` + * - `permission_settings.toggleHistory` + * - `permission_settings.useAtMentionAll` + * - `permission_settings.manageApps` + * - `permission_settings.manageWebhooks` + * - `permission_settings.replyMessages` * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; * @return \Google\Protobuf\FieldMask|null @@ -333,48 +370,57 @@ public function clearUpdateMask() /** * Required. The updated field paths, comma separated if there are * multiple. - * Currently supported field paths: - * - `display_name` (Only supports changing the display name of a space with - * the `SPACE` type, or when also including the `space_type` mask to change a - * `GROUP_CHAT` space type to `SPACE`. Trying to update the display name of a - * `GROUP_CHAT` or a `DIRECT_MESSAGE` space results in an invalid argument - * error. If you receive the error message `ALREADY_EXISTS` when updating the - * `displayName`, try a different `displayName`. An existing space within the - * Google Workspace organization might already use this display name.) - * - `space_type` (Only supports changing a `GROUP_CHAT` space type to + * You can update the following fields for a space: + * `space_details`: Updates the space's description. Supports up to 150 + * characters. + * `display_name`: Only supports updating the display name for spaces where + * `spaceType` field is `SPACE`. + * If you receive the error message `ALREADY_EXISTS`, try a different + * value. An existing space within the + * Google Workspace organization might already use this display name. + * `space_type`: Only supports changing a `GROUP_CHAT` space type to * `SPACE`. Include `display_name` together * with `space_type` in the update mask and ensure that the specified space * has a non-empty display name and the `SPACE` space type. Including the * `space_type` mask and the `SPACE` type in the specified space when updating * the display name is optional if the existing space already has the `SPACE` * type. Trying to update the space type in other ways results in an invalid - * argument error). - * `space_type` is not supported with admin access. - * - `space_details` - * - `space_history_state` (Supports [turning history on or off for the - * space](https://support.google.com/chat/answer/7664687) if [the organization - * allows users to change their history - * setting](https://support.google.com/a/answer/7664184). - * Warning: mutually exclusive with all other field paths.) - * `space_history_state` is not supported with admin access. - * - `access_settings.audience` (Supports changing the [access + * argument error. + * `space_type` is not supported with `useAdminAccess`. + * `space_history_state`: Updates [space history + * settings](https://support.google.com/chat/answer/7664687) by turning + * history on or off for the space. Only supported if history settings are + * enabled for the Google Workspace organization. To update the + * space history state, you must omit all other field masks in your request. + * `space_history_state` is not supported with `useAdminAccess`. + * `access_settings.audience`: Updates the [access * setting](https://support.google.com/chat/answer/11971020) of who can - * discover the space, join the space, and preview the messages in space. If - * no audience is specified in the access setting, the space's access setting - * is updated to private. Warning: mutually exclusive with all other field - * paths.) - * `access_settings.audience` is not supported with admin access. - * - Developer Preview: Supports changing the [permission - * settings](https://support.google.com/chat/answer/13340792) of a space, - * supported field paths - * include: `permission_settings.manage_members_and_groups`, - * `permission_settings.modify_space_details`, - * `permission_settings.toggle_history`, - * `permission_settings.use_at_mention_all`, - * `permission_settings.manage_apps`, `permission_settings.manage_webhooks`, - * `permission_settings.reply_messages` - * (Warning: mutually exclusive with all other non-permission settings field - * paths). `permission_settings` is not supported with admin access. + * discover the space, join the space, and preview the messages in named space + * where `spaceType` field is `SPACE`. If the existing space has a + * target audience, you can remove the audience and restrict space access by + * omitting a value for this field mask. To update access settings for a + * space, the authenticating user must be a space manager and omit all other + * field masks in your request. You can't update this field if the space is in + * [import + * mode](https://developers.google.com/workspace/chat/import-data-overview). + * To learn more, see [Make a space discoverable to specific + * users](https://developers.google.com/workspace/chat/space-target-audience). + * `access_settings.audience` is not supported with `useAdminAccess`. + * `permission_settings`: Supports changing the + * [permission settings](https://support.google.com/chat/answer/13340792) + * of a space. + * When updating permission settings, you can only specify + * `permissionSettings` field masks; you cannot update other field masks + * at the same time. `permissionSettings` is not supported with + * `useAdminAccess`. + * The supported field masks include: + * - `permission_settings.manageMembersAndGroups` + * - `permission_settings.modifySpaceDetails` + * - `permission_settings.toggleHistory` + * - `permission_settings.useAtMentionAll` + * - `permission_settings.manageApps` + * - `permission_settings.manageWebhooks` + * - `permission_settings.replyMessages` * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; * @param \Google\Protobuf\FieldMask $var diff --git a/Batch/VERSION b/Batch/VERSION index 9084fa2f716a..524cb55242b5 100644 --- a/Batch/VERSION +++ b/Batch/VERSION @@ -1 +1 @@ -1.1.0 +1.1.1 diff --git a/BigQueryDataTransfer/VERSION b/BigQueryDataTransfer/VERSION index 227cea215648..7ec1d6db4087 100644 --- a/BigQueryDataTransfer/VERSION +++ b/BigQueryDataTransfer/VERSION @@ -1 +1 @@ -2.0.0 +2.1.0 diff --git a/CHANGELOG.md b/CHANGELOG.md index a16d0a0d2e2d..212fce24d2e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,159 @@ # Changelog +## 0.262.0 + +
google/cloud-ai-platform 1.8.0 + + + +### Features + +* Add a dynamic retrieval API ([#7724](https://github.com/googleapis/google-cloud-php/issues/7724)) ([7674a3e](https://github.com/googleapis/google-cloud-php/commit/7674a3ea25e138f41ebfb4c3becceaf3221556b4)) +* Add continuous sync option in feature_view.proto ([7674a3e](https://github.com/googleapis/google-cloud-php/commit/7674a3ea25e138f41ebfb4c3becceaf3221556b4)) +* Add psc_automation_configs to DeployIndex v1 ([#7720](https://github.com/googleapis/google-cloud-php/issues/7720)) ([2c48383](https://github.com/googleapis/google-cloud-php/commit/2c483836197e47fbe9f2c9f284d56c0548d4946b)) + +
+ +
google/apps-chat 0.6.0 + + + +### Features + +* Add doc for import mode external users support ([0c917c4](https://github.com/googleapis/google-cloud-php/commit/0c917c4b62bbde18fcdb5e3d18c67cebcc4daddb)) +* Add doc for permission settings & announcement space support ([#7721](https://github.com/googleapis/google-cloud-php/issues/7721)) ([0c917c4](https://github.com/googleapis/google-cloud-php/commit/0c917c4b62bbde18fcdb5e3d18c67cebcc4daddb)) + + +### Documentation + +* Discoverable space docs improvement ([0c917c4](https://github.com/googleapis/google-cloud-php/commit/0c917c4b62bbde18fcdb5e3d18c67cebcc4daddb)) +* Memberships API dev docs improvement ([0c917c4](https://github.com/googleapis/google-cloud-php/commit/0c917c4b62bbde18fcdb5e3d18c67cebcc4daddb)) +* Messages API dev docs improvement ([0c917c4](https://github.com/googleapis/google-cloud-php/commit/0c917c4b62bbde18fcdb5e3d18c67cebcc4daddb)) + +
+ +
google/cloud-batch 1.1.1 + + + +### Documentation + +* Clarify Batch only supports global custom instance template now ([#7719](https://github.com/googleapis/google-cloud-php/issues/7719)) ([f3ffdb1](https://github.com/googleapis/google-cloud-php/commit/f3ffdb1a7b5439a861afa6b93bbbe05e8c662ce7)) + +
+ +
google/cloud-bigquerydatatransfer 2.1.0 + + + +### Features + +* Add scheduleOptionsV2 and Error fields for TransferConfig ([#7718](https://github.com/googleapis/google-cloud-php/issues/7718)) ([1cb914b](https://github.com/googleapis/google-cloud-php/commit/1cb914be9a7d3577acf2f69ff9405be1757e62e6)) + +
+ +
google/cloud-channel 2.1.0 + + + +### Features + +* Add support for importing team customer from a different reseller ([aa62991](https://github.com/googleapis/google-cloud-php/commit/aa62991dc2d9b7df26abbb19306564fabdffdee9)) +* Add support for primary_admin_email as customer_identity for ImportCustomer ([#7727](https://github.com/googleapis/google-cloud-php/issues/7727)) ([aa62991](https://github.com/googleapis/google-cloud-php/commit/aa62991dc2d9b7df26abbb19306564fabdffdee9)) +* Add support to look up team customer Cloud Identity information ([aa62991](https://github.com/googleapis/google-cloud-php/commit/aa62991dc2d9b7df26abbb19306564fabdffdee9)) + + +### Documentation + +* Clarify the expected value of the domain field for team type customers ([aa62991](https://github.com/googleapis/google-cloud-php/commit/aa62991dc2d9b7df26abbb19306564fabdffdee9)) + +
+ +
google/cloud-parallelstore 0.6.1 + + + +### Documentation + +* Minor documentation formatting fix for Parallelstore ([#7722](https://github.com/googleapis/google-cloud-php/issues/7722)) ([72a9414](https://github.com/googleapis/google-cloud-php/commit/72a941468c6d3970fffef3da6ad9af05e5b3e2ab)) + +
+ +
google/cloud-redis 2.1.1 + + + +
+ +
google/cloud-run 1.2.0 + + + +### Features + +* Add Builds API([#7725](https://github.com/googleapis/google-cloud-php/issues/7725)) ([3b7f251](https://github.com/googleapis/google-cloud-php/commit/3b7f251e0d73d9aa5c42a696a783f38087e3fbe1)) +* Add GPU configuration to Services ([3b7f251](https://github.com/googleapis/google-cloud-php/commit/3b7f251e0d73d9aa5c42a696a783f38087e3fbe1)) +* Add INGRESS_TRAFFIC_NONE to Services ([3b7f251](https://github.com/googleapis/google-cloud-php/commit/3b7f251e0d73d9aa5c42a696a783f38087e3fbe1)) +* Add Service Mesh configuration to Services ([3b7f251](https://github.com/googleapis/google-cloud-php/commit/3b7f251e0d73d9aa5c42a696a783f38087e3fbe1)) +* Add ServiceScaling to Services ([3b7f251](https://github.com/googleapis/google-cloud-php/commit/3b7f251e0d73d9aa5c42a696a783f38087e3fbe1)) + + +### Documentation + +* Fixed formatting of some documentation ([3b7f251](https://github.com/googleapis/google-cloud-php/commit/3b7f251e0d73d9aa5c42a696a783f38087e3fbe1)) + +
+ +
google/shopping-merchant-accounts 0.3.0 + + + +### Features + +* Add 'force' parameter for accounts.delete method ([#7714](https://github.com/googleapis/google-cloud-php/issues/7714)) ([7bbcfd6](https://github.com/googleapis/google-cloud-php/commit/7bbcfd6d641eb2a1fd9c626e47620d09374db9b5)) + + +### Documentation + +* Updated descriptions for the DeleteAccount and ListAccounts RPCs ([7bbcfd6](https://github.com/googleapis/google-cloud-php/commit/7bbcfd6d641eb2a1fd9c626e47620d09374db9b5)) + +
+ +
google/shopping-merchant-datasources 0.2.1 + + + +### Documentation + +* Adding some more information about supplemental data sources ([#7726](https://github.com/googleapis/google-cloud-php/issues/7726)) ([061fec1](https://github.com/googleapis/google-cloud-php/commit/061fec1d38d476d0d955acf7e2a5d09d8b1b1e2e)) + +
+ +
google/cloud-spanner 1.86.0 + + + +### Features + +* Add INTERVAL API ([#7712](https://github.com/googleapis/google-cloud-php/issues/7712)) ([132254f](https://github.com/googleapis/google-cloud-php/commit/132254fa537dfece87f3b836c51ed5248c230db4)) +* Add new QueryMode enum values (WITH_STATS, WITH_PLAN_AND_STATS) ([132254f](https://github.com/googleapis/google-cloud-php/commit/132254fa537dfece87f3b836c51ed5248c230db4)) +* Define ReplicaComputeCapacity and AsymmetricAutoscalingOption ([#7723](https://github.com/googleapis/google-cloud-php/issues/7723)) ([0e366ef](https://github.com/googleapis/google-cloud-php/commit/0e366efa02e8d6100cf4a61e5b7fd731ad8157e4)) + + +### Documentation + +* A comment for field `node_count` in message `spanner.admin.instance.v1.Instance` is changed ([0e366ef](https://github.com/googleapis/google-cloud-php/commit/0e366efa02e8d6100cf4a61e5b7fd731ad8157e4)) +* A comment for field `processing_units` in message `spanner.admin.instance.v1.Instance` is changed ([0e366ef](https://github.com/googleapis/google-cloud-php/commit/0e366efa02e8d6100cf4a61e5b7fd731ad8157e4)) +* Update comment for PROFILE QueryMode ([132254f](https://github.com/googleapis/google-cloud-php/commit/132254fa537dfece87f3b836c51ed5248c230db4)) + +
+ +
google/cloud-storage 1.43.1 + + + +
+ ## 0.261.0
google/ads-marketingplatform-admin 0.1.0 diff --git a/Channel/VERSION b/Channel/VERSION index 227cea215648..7ec1d6db4087 100644 --- a/Channel/VERSION +++ b/Channel/VERSION @@ -1 +1 @@ -2.0.0 +2.1.0 diff --git a/Channel/metadata/V1/Service.php b/Channel/metadata/V1/Service.php index 71319ee1a15d..7e02d5f6bc99 100644 Binary files a/Channel/metadata/V1/Service.php and b/Channel/metadata/V1/Service.php differ diff --git a/Channel/samples/V1/CloudChannelServiceClient/check_cloud_identity_accounts_exist.php b/Channel/samples/V1/CloudChannelServiceClient/check_cloud_identity_accounts_exist.php index 4397b7e99b51..4485be4347b3 100644 --- a/Channel/samples/V1/CloudChannelServiceClient/check_cloud_identity_accounts_exist.php +++ b/Channel/samples/V1/CloudChannelServiceClient/check_cloud_identity_accounts_exist.php @@ -51,7 +51,9 @@ * * @param string $parent The reseller account's resource name. * Parent uses the format: accounts/{account_id} - * @param string $domain Domain to fetch for Cloud Identity account customer. + * @param string $domain Domain to fetch for Cloud Identity account customers, including + * domain and team customers. For team customers, please use the domain for + * their emails. */ function check_cloud_identity_accounts_exist_sample(string $parent, string $domain): void { diff --git a/Channel/src/V1/CheckCloudIdentityAccountsExistRequest.php b/Channel/src/V1/CheckCloudIdentityAccountsExistRequest.php index 519cdf4fcaed..39dde78e6f22 100644 --- a/Channel/src/V1/CheckCloudIdentityAccountsExistRequest.php +++ b/Channel/src/V1/CheckCloudIdentityAccountsExistRequest.php @@ -24,11 +24,20 @@ class CheckCloudIdentityAccountsExistRequest extends \Google\Protobuf\Internal\M */ protected $parent = ''; /** - * Required. Domain to fetch for Cloud Identity account customer. + * Required. Domain to fetch for Cloud Identity account customers, including + * domain and team customers. For team customers, please use the domain for + * their emails. * * Generated from protobuf field string domain = 2 [(.google.api.field_behavior) = REQUIRED]; */ protected $domain = ''; + /** + * Optional. Primary admin email to fetch for Cloud Identity account team + * customer. + * + * Generated from protobuf field string primary_admin_email = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $primary_admin_email = ''; /** * Constructor. @@ -40,7 +49,12 @@ class CheckCloudIdentityAccountsExistRequest extends \Google\Protobuf\Internal\M * Required. The reseller account's resource name. * Parent uses the format: accounts/{account_id} * @type string $domain - * Required. Domain to fetch for Cloud Identity account customer. + * Required. Domain to fetch for Cloud Identity account customers, including + * domain and team customers. For team customers, please use the domain for + * their emails. + * @type string $primary_admin_email + * Optional. Primary admin email to fetch for Cloud Identity account team + * customer. * } */ public function __construct($data = NULL) { @@ -77,7 +91,9 @@ public function setParent($var) } /** - * Required. Domain to fetch for Cloud Identity account customer. + * Required. Domain to fetch for Cloud Identity account customers, including + * domain and team customers. For team customers, please use the domain for + * their emails. * * Generated from protobuf field string domain = 2 [(.google.api.field_behavior) = REQUIRED]; * @return string @@ -88,7 +104,9 @@ public function getDomain() } /** - * Required. Domain to fetch for Cloud Identity account customer. + * Required. Domain to fetch for Cloud Identity account customers, including + * domain and team customers. For team customers, please use the domain for + * their emails. * * Generated from protobuf field string domain = 2 [(.google.api.field_behavior) = REQUIRED]; * @param string $var @@ -102,5 +120,33 @@ public function setDomain($var) return $this; } + /** + * Optional. Primary admin email to fetch for Cloud Identity account team + * customer. + * + * Generated from protobuf field string primary_admin_email = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPrimaryAdminEmail() + { + return $this->primary_admin_email; + } + + /** + * Optional. Primary admin email to fetch for Cloud Identity account team + * customer. + * + * Generated from protobuf field string primary_admin_email = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPrimaryAdminEmail($var) + { + GPBUtil::checkString($var, True); + $this->primary_admin_email = $var; + + return $this; + } + } diff --git a/Channel/src/V1/CloudIdentityCustomerAccount.php b/Channel/src/V1/CloudIdentityCustomerAccount.php index a49e1dea73ac..d0826c87fe24 100644 --- a/Channel/src/V1/CloudIdentityCustomerAccount.php +++ b/Channel/src/V1/CloudIdentityCustomerAccount.php @@ -44,6 +44,19 @@ class CloudIdentityCustomerAccount extends \Google\Protobuf\Internal\Message * Generated from protobuf field string customer_cloud_identity_id = 4; */ protected $customer_cloud_identity_id = ''; + /** + * If existing = true, the type of the customer. + * + * Generated from protobuf field .google.cloud.channel.v1.CloudIdentityInfo.CustomerType customer_type = 5; + */ + protected $customer_type = 0; + /** + * If existing = true, and is 2-tier customer, the channel partner of the + * customer. + * + * Generated from protobuf field string channel_partner_cloud_identity_id = 6; + */ + protected $channel_partner_cloud_identity_id = ''; /** * Constructor. @@ -63,6 +76,11 @@ class CloudIdentityCustomerAccount extends \Google\Protobuf\Internal\Message * accounts/{account_id}/customers/{customer_id} * @type string $customer_cloud_identity_id * If existing = true, the Cloud Identity ID of the customer. + * @type int $customer_type + * If existing = true, the type of the customer. + * @type string $channel_partner_cloud_identity_id + * If existing = true, and is 2-tier customer, the channel partner of the + * customer. * } */ public function __construct($data = NULL) { @@ -182,5 +200,59 @@ public function setCustomerCloudIdentityId($var) return $this; } + /** + * If existing = true, the type of the customer. + * + * Generated from protobuf field .google.cloud.channel.v1.CloudIdentityInfo.CustomerType customer_type = 5; + * @return int + */ + public function getCustomerType() + { + return $this->customer_type; + } + + /** + * If existing = true, the type of the customer. + * + * Generated from protobuf field .google.cloud.channel.v1.CloudIdentityInfo.CustomerType customer_type = 5; + * @param int $var + * @return $this + */ + public function setCustomerType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Channel\V1\CloudIdentityInfo\CustomerType::class); + $this->customer_type = $var; + + return $this; + } + + /** + * If existing = true, and is 2-tier customer, the channel partner of the + * customer. + * + * Generated from protobuf field string channel_partner_cloud_identity_id = 6; + * @return string + */ + public function getChannelPartnerCloudIdentityId() + { + return $this->channel_partner_cloud_identity_id; + } + + /** + * If existing = true, and is 2-tier customer, the channel partner of the + * customer. + * + * Generated from protobuf field string channel_partner_cloud_identity_id = 6; + * @param string $var + * @return $this + */ + public function setChannelPartnerCloudIdentityId($var) + { + GPBUtil::checkString($var, True); + $this->channel_partner_cloud_identity_id = $var; + + return $this; + } + } diff --git a/Channel/src/V1/ImportCustomerRequest.php b/Channel/src/V1/ImportCustomerRequest.php index b33687134d58..66b9c2eb6a15 100644 --- a/Channel/src/V1/ImportCustomerRequest.php +++ b/Channel/src/V1/ImportCustomerRequest.php @@ -70,6 +70,8 @@ class ImportCustomerRequest extends \Google\Protobuf\Internal\Message * Required. Customer domain. * @type string $cloud_identity_id * Required. Customer's Cloud Identity ID + * @type string $primary_admin_email + * Required. Customer's primary admin email. * @type string $parent * Required. The resource name of the reseller's account. * Parent takes the format: accounts/{account_id} or @@ -161,6 +163,37 @@ public function setCloudIdentityId($var) return $this; } + /** + * Required. Customer's primary admin email. + * + * Generated from protobuf field string primary_admin_email = 8 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getPrimaryAdminEmail() + { + return $this->readOneof(8); + } + + public function hasPrimaryAdminEmail() + { + return $this->hasOneof(8); + } + + /** + * Required. Customer's primary admin email. + * + * Generated from protobuf field string primary_admin_email = 8 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setPrimaryAdminEmail($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(8, $var); + + return $this; + } + /** * Required. The resource name of the reseller's account. * Parent takes the format: accounts/{account_id} or diff --git a/Parallelstore/VERSION b/Parallelstore/VERSION index a918a2aa18d5..ee6cdce3c290 100644 --- a/Parallelstore/VERSION +++ b/Parallelstore/VERSION @@ -1 +1 @@ -0.6.0 +0.6.1 diff --git a/Parallelstore/src/V1beta/ExportDataRequest.php b/Parallelstore/src/V1beta/ExportDataRequest.php index 2bb95ee6c34f..b5b2af48db2a 100644 --- a/Parallelstore/src/V1beta/ExportDataRequest.php +++ b/Parallelstore/src/V1beta/ExportDataRequest.php @@ -41,9 +41,9 @@ class ExportDataRequest extends \Google\Protobuf\Internal\Message * Optional. User-specified Service Account (SA) credentials to be used when * performing the transfer. * Use one of the following formats: - * * {EMAIL_ADDRESS_OR_UNIQUE_ID} + * * `{EMAIL_ADDRESS_OR_UNIQUE_ID}` * * `projects/{PROJECT_ID_OR_NUMBER}/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` - * * `projects/-/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID} + * * `projects/-/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` * If unspecified, the Parallelstore service agent is used: * `service-@gcp-sa-parallelstore.iam.gserviceaccount.com` * @@ -81,9 +81,9 @@ class ExportDataRequest extends \Google\Protobuf\Internal\Message * Optional. User-specified Service Account (SA) credentials to be used when * performing the transfer. * Use one of the following formats: - * * {EMAIL_ADDRESS_OR_UNIQUE_ID} + * * `{EMAIL_ADDRESS_OR_UNIQUE_ID}` * * `projects/{PROJECT_ID_OR_NUMBER}/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` - * * `projects/-/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID} + * * `projects/-/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` * If unspecified, the Parallelstore service agent is used: * `service-@gcp-sa-parallelstore.iam.gserviceaccount.com` * } @@ -231,9 +231,9 @@ public function setRequestId($var) * Optional. User-specified Service Account (SA) credentials to be used when * performing the transfer. * Use one of the following formats: - * * {EMAIL_ADDRESS_OR_UNIQUE_ID} + * * `{EMAIL_ADDRESS_OR_UNIQUE_ID}` * * `projects/{PROJECT_ID_OR_NUMBER}/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` - * * `projects/-/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID} + * * `projects/-/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` * If unspecified, the Parallelstore service agent is used: * `service-@gcp-sa-parallelstore.iam.gserviceaccount.com` * @@ -249,9 +249,9 @@ public function getServiceAccount() * Optional. User-specified Service Account (SA) credentials to be used when * performing the transfer. * Use one of the following formats: - * * {EMAIL_ADDRESS_OR_UNIQUE_ID} + * * `{EMAIL_ADDRESS_OR_UNIQUE_ID}` * * `projects/{PROJECT_ID_OR_NUMBER}/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` - * * `projects/-/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID} + * * `projects/-/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` * If unspecified, the Parallelstore service agent is used: * `service-@gcp-sa-parallelstore.iam.gserviceaccount.com` * diff --git a/Parallelstore/src/V1beta/ImportDataRequest.php b/Parallelstore/src/V1beta/ImportDataRequest.php index 8adf8e031c1e..7c2e0471a0dc 100644 --- a/Parallelstore/src/V1beta/ImportDataRequest.php +++ b/Parallelstore/src/V1beta/ImportDataRequest.php @@ -41,9 +41,9 @@ class ImportDataRequest extends \Google\Protobuf\Internal\Message * Optional. User-specified service account credentials to be used when * performing the transfer. * Use one of the following formats: - * * {EMAIL_ADDRESS_OR_UNIQUE_ID} + * * `{EMAIL_ADDRESS_OR_UNIQUE_ID}` * * `projects/{PROJECT_ID_OR_NUMBER}/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` - * * `projects/-/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID} + * * `projects/-/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` * If unspecified, the Parallelstore service agent is used: * `service-@gcp-sa-parallelstore.iam.gserviceaccount.com` * @@ -81,9 +81,9 @@ class ImportDataRequest extends \Google\Protobuf\Internal\Message * Optional. User-specified service account credentials to be used when * performing the transfer. * Use one of the following formats: - * * {EMAIL_ADDRESS_OR_UNIQUE_ID} + * * `{EMAIL_ADDRESS_OR_UNIQUE_ID}` * * `projects/{PROJECT_ID_OR_NUMBER}/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` - * * `projects/-/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID} + * * `projects/-/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` * If unspecified, the Parallelstore service agent is used: * `service-@gcp-sa-parallelstore.iam.gserviceaccount.com` * } @@ -231,9 +231,9 @@ public function setRequestId($var) * Optional. User-specified service account credentials to be used when * performing the transfer. * Use one of the following formats: - * * {EMAIL_ADDRESS_OR_UNIQUE_ID} + * * `{EMAIL_ADDRESS_OR_UNIQUE_ID}` * * `projects/{PROJECT_ID_OR_NUMBER}/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` - * * `projects/-/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID} + * * `projects/-/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` * If unspecified, the Parallelstore service agent is used: * `service-@gcp-sa-parallelstore.iam.gserviceaccount.com` * @@ -249,9 +249,9 @@ public function getServiceAccount() * Optional. User-specified service account credentials to be used when * performing the transfer. * Use one of the following formats: - * * {EMAIL_ADDRESS_OR_UNIQUE_ID} + * * `{EMAIL_ADDRESS_OR_UNIQUE_ID}` * * `projects/{PROJECT_ID_OR_NUMBER}/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` - * * `projects/-/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID} + * * `projects/-/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` * If unspecified, the Parallelstore service agent is used: * `service-@gcp-sa-parallelstore.iam.gserviceaccount.com` * diff --git a/Redis/VERSION b/Redis/VERSION index 7ec1d6db4087..3e3c2f1e5edb 100644 --- a/Redis/VERSION +++ b/Redis/VERSION @@ -1 +1 @@ -2.1.0 +2.1.1 diff --git a/Redis/tests/System/V1/CloudRedisClientTest.php b/Redis/tests/System/V1/CloudRedisClientTest.php index 2065ead61ac3..37cd2dd4cf21 100644 --- a/Redis/tests/System/V1/CloudRedisClientTest.php +++ b/Redis/tests/System/V1/CloudRedisClientTest.php @@ -109,7 +109,7 @@ public function testDeleteOperation() // Ensure delete op succeeded $instances = self::$client->listInstances(ListInstancesRequest::build(self::$parent)); $this->assertSame(0, count(array_map( - fn ($instance) => $instance->getName() === $instanceName, + fn ($instance) => $instance->getName() === self::$instanceName, iterator_to_array($instances->iterateAllElements()) ))); } diff --git a/Run/VERSION b/Run/VERSION index 9084fa2f716a..26aaba0e8663 100644 --- a/Run/VERSION +++ b/Run/VERSION @@ -1 +1 @@ -1.1.0 +1.2.0 diff --git a/Run/metadata/V2/Build.php b/Run/metadata/V2/Build.php new file mode 100644 index 000000000000..d54649f835f7 Binary files /dev/null and b/Run/metadata/V2/Build.php differ diff --git a/Run/metadata/V2/Job.php b/Run/metadata/V2/Job.php index 086bf7569285..f04aa7b7517d 100644 Binary files a/Run/metadata/V2/Job.php and b/Run/metadata/V2/Job.php differ diff --git a/Run/metadata/V2/Revision.php b/Run/metadata/V2/Revision.php index 1ef84a040295..9d79c58305c9 100644 --- a/Run/metadata/V2/Revision.php +++ b/Run/metadata/V2/Revision.php @@ -29,7 +29,7 @@ public static function initOnce() { \GPBMetadata\Google\Protobuf\Timestamp::initOnce(); $pool->internalAddGeneratedFile( ' -Â +´ "google/cloud/run/v2/revision.protogoogle.cloud.run.v2google/api/client.protogoogle/api/field_behavior.protogoogle/api/launch_stage.protogoogle/api/resource.protogoogle/api/routing.proto#google/cloud/run/v2/condition.proto!google/cloud/run/v2/k8s.min.proto google/cloud/run/v2/status.proto)google/cloud/run/v2/vendor_settings.proto#google/longrunning/operations.protogoogle/protobuf/duration.protogoogle/protobuf/timestamp.proto"G GetRevisionRequest1 name ( B#àAúA @@ -47,7 +47,7 @@ public static function initOnce() { name ( B#àAúA run.googleapis.com/Revision validate_only ( -etag ( "í +etag ( "ß Revision name ( BàA uid ( BàA @@ -74,7 +74,8 @@ public static function initOnce() { volumes ( 2.google.cloud.run.v2.VolumeH execution_environment (2).google.cloud.run.v2.ExecutionEnvironment> encryption_key ( B&úA# -!cloudkms.googleapis.com/CryptoKey\\ +!cloudkms.googleapis.com/CryptoKey6 + service_mesh ( 2 .google.cloud.run.v2.ServiceMesh\\ encryption_key_revocation_action (22.google.cloud.run.v2.EncryptionKeyRevocationActionC encryption_key_shutdown_duration ( 2.google.protobuf.Duration reconciling (BàA7 @@ -84,7 +85,8 @@ public static function initOnce() { log_uri! ( BàA satisfies_pzs% (BàA session_affinity& (G -scaling_status\' ( 2*.google.cloud.run.v2.RevisionScalingStatusBàA +scaling_status\' ( 2*.google.cloud.run.v2.RevisionScalingStatusBàA8 + node_selector( ( 2!.google.cloud.run.v2.NodeSelector etagc ( BàA- LabelsEntry key (  diff --git a/Run/metadata/V2/RevisionTemplate.php b/Run/metadata/V2/RevisionTemplate.php index 55ab1ab45ba0..51eb821e6f7a 100644 --- a/Run/metadata/V2/RevisionTemplate.php +++ b/Run/metadata/V2/RevisionTemplate.php @@ -21,8 +21,9 @@ public static function initOnce() { \GPBMetadata\Google\Protobuf\Duration::initOnce(); $pool->internalAddGeneratedFile( ' -§ -+google/cloud/run/v2/revision_template.protogoogle.cloud.run.v2google/api/resource.proto!google/cloud/run/v2/k8s.min.proto)google/cloud/run/v2/vendor_settings.protogoogle/protobuf/duration.proto"ò +£ + ++google/cloud/run/v2/revision_template.protogoogle.cloud.run.v2google/api/resource.proto!google/cloud/run/v2/k8s.min.proto)google/cloud/run/v2/vendor_settings.protogoogle/protobuf/duration.proto"î RevisionTemplate5 revision ( B#àAúA run.googleapis.com/RevisionF @@ -40,9 +41,11 @@ public static function initOnce() { execution_environment (2).google.cloud.run.v2.ExecutionEnvironmentBàA> encryption_key ( B&úA# !cloudkms.googleapis.com/CryptoKey- - max_instance_request_concurrency (BàA + max_instance_request_concurrency (BàA; + service_mesh ( 2 .google.cloud.run.v2.ServiceMeshBàA session_affinity (BàA" -health_check_disabled (BàA- +health_check_disabled (BàA= + node_selector ( 2!.google.cloud.run.v2.NodeSelectorBàA- LabelsEntry key (  value ( :82 diff --git a/Run/metadata/V2/Service.php b/Run/metadata/V2/Service.php index b5a84216ba3f..784370ba87dd 100644 --- a/Run/metadata/V2/Service.php +++ b/Run/metadata/V2/Service.php @@ -31,7 +31,7 @@ public static function initOnce() { \GPBMetadata\Google\Protobuf\Timestamp::initOnce(); $pool->internalAddGeneratedFile( ' -“% +É% !google/cloud/run/v2/service.protogoogle.cloud.run.v2google/api/client.protogoogle/api/field_behavior.protogoogle/api/launch_stage.protogoogle/api/resource.protogoogle/api/routing.proto#google/cloud/run/v2/condition.proto+google/cloud/run/v2/revision_template.proto(google/cloud/run/v2/traffic_target.proto)google/cloud/run/v2/vendor_settings.protogoogle/iam/v1/iam_policy.protogoogle/iam/v1/policy.proto#google/longrunning/operations.proto google/protobuf/field_mask.protogoogle/protobuf/timestamp.proto"® CreateServiceRequest2 parent ( B"àAúArun.googleapis.com/Service2 @@ -60,7 +60,7 @@ public static function initOnce() { name ( B"àAúA run.googleapis.com/Service validate_only ( -etag ( "Ê +etag ( "€ Service name (  description (  @@ -84,7 +84,10 @@ public static function initOnce() { template ( 2%.google.cloud.run.v2.RevisionTemplateBàA8 traffic ( 2".google.cloud.run.v2.TrafficTargetBàA9 scaling ( 2#.google.cloud.run.v2.ServiceScalingBàA! -default_uri_disabled (BàA +invoker_iam_disabled (BàA! +default_uri_disabled (BàA +urls ( BàA +custom_audiences% (  observed_generation (BàA? terminal_condition ( 2.google.cloud.run.v2.ConditionBàA7 @@ -94,8 +97,7 @@ public static function initOnce() { latest_created_revision" ( B#àAúA run.googleapis.com/RevisionG traffic_statuses# ( 2(.google.cloud.run.v2.TrafficTargetStatusBàA -uri$ ( BàA -custom_audiences% (  +uri$ ( BàA satisfies_pzs& (BàA reconcilingb (BàA etagc ( BàA- diff --git a/Run/metadata/V2/VendorSettings.php b/Run/metadata/V2/VendorSettings.php index 60b296955fad..c96bdb10ec79 100644 Binary files a/Run/metadata/V2/VendorSettings.php and b/Run/metadata/V2/VendorSettings.php differ diff --git a/Run/samples/V2/BuildsClient/submit_build.php b/Run/samples/V2/BuildsClient/submit_build.php new file mode 100644 index 000000000000..efba13142139 --- /dev/null +++ b/Run/samples/V2/BuildsClient/submit_build.php @@ -0,0 +1,94 @@ +setBucket($storageSourceBucket) + ->setObject($storageSourceObject); + $request = (new SubmitBuildRequest()) + ->setParent($parent) + ->setStorageSource($storageSource) + ->setImageUri($imageUri); + + // Call the API and handle any network failures. + try { + /** @var SubmitBuildResponse $response */ + $response = $buildsClient->submitBuild($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $parent = '[PARENT]'; + $storageSourceBucket = '[BUCKET]'; + $storageSourceObject = '[OBJECT]'; + $imageUri = '[IMAGE_URI]'; + + submit_build_sample($parent, $storageSourceBucket, $storageSourceObject, $imageUri); +} +// [END run_v2_generated_Builds_SubmitBuild_sync] diff --git a/Run/src/V2/BinaryAuthorization.php b/Run/src/V2/BinaryAuthorization.php index a5e1fdc009fb..c0169d3c5d71 100644 --- a/Run/src/V2/BinaryAuthorization.php +++ b/Run/src/V2/BinaryAuthorization.php @@ -37,7 +37,7 @@ class BinaryAuthorization extends \Google\Protobuf\Internal\Message * authorization policy. If False, binary authorization will be disabled. * @type string $policy * Optional. The path to a binary authorization policy. - * Format: projects/{project}/platforms/cloudRun/{policy-name} + * Format: `projects/{project}/platforms/cloudRun/{policy-name}` * @type string $breakglass_justification * Optional. If present, indicates to use Breakglass using this justification. * If use_default is False, then it must be empty. @@ -85,9 +85,9 @@ public function setUseDefault($var) /** * Optional. The path to a binary authorization policy. - * Format: projects/{project}/platforms/cloudRun/{policy-name} + * Format: `projects/{project}/platforms/cloudRun/{policy-name}` * - * Generated from protobuf field string policy = 3 [(.google.api.field_behavior) = OPTIONAL]; + * Generated from protobuf field string policy = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { * @return string */ public function getPolicy() @@ -102,9 +102,9 @@ public function hasPolicy() /** * Optional. The path to a binary authorization policy. - * Format: projects/{project}/platforms/cloudRun/{policy-name} + * Format: `projects/{project}/platforms/cloudRun/{policy-name}` * - * Generated from protobuf field string policy = 3 [(.google.api.field_behavior) = OPTIONAL]; + * Generated from protobuf field string policy = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { * @param string $var * @return $this */ diff --git a/Run/src/V2/Client/BuildsClient.php b/Run/src/V2/Client/BuildsClient.php new file mode 100644 index 000000000000..f801387ac125 --- /dev/null +++ b/Run/src/V2/Client/BuildsClient.php @@ -0,0 +1,237 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/builds_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/builds_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/builds_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/builds_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a worker_pool + * resource. + * + * @param string $project + * @param string $location + * @param string $workerPool + * + * @return string The formatted worker_pool resource. + */ + public static function workerPoolName(string $project, string $location, string $workerPool): string + { + return self::getPathTemplate('workerPool')->render([ + 'project' => $project, + 'location' => $location, + 'worker_pool' => $workerPool, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - workerPool: projects/{project}/locations/{location}/workerPools/{worker_pool} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'run.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Submits a build in a given project. + * + * The async variant is {@see BuildsClient::submitBuildAsync()} . + * + * @example samples/V2/BuildsClient/submit_build.php + * + * @param SubmitBuildRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return SubmitBuildResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function submitBuild(SubmitBuildRequest $request, array $callOptions = []): SubmitBuildResponse + { + return $this->startApiCall('SubmitBuild', $request, $callOptions)->wait(); + } +} diff --git a/Run/src/V2/Client/JobsClient.php b/Run/src/V2/Client/JobsClient.php index 570ee809b563..8cd57be3122d 100644 --- a/Run/src/V2/Client/JobsClient.php +++ b/Run/src/V2/Client/JobsClient.php @@ -267,6 +267,51 @@ public static function locationName(string $project, string $location): string ]); } + /** + * Formats a string containing the fully-qualified path to represent a + * location_policy resource. + * + * @param string $location + * + * @return string The formatted location_policy resource. + */ + public static function locationPolicyName(string $location): string + { + return self::getPathTemplate('locationPolicy')->render([ + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a policy + * resource. + * + * @param string $project + * + * @return string The formatted policy resource. + */ + public static function policyName(string $project): string + { + return self::getPathTemplate('policy')->render([ + 'project' => $project, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_policy resource. + * + * @param string $project + * + * @return string The formatted project_policy resource. + */ + public static function projectPolicyName(string $project): string + { + return self::getPathTemplate('projectPolicy')->render([ + 'project' => $project, + ]); + } + /** * Formats a string containing the fully-qualified path to represent a secret * resource. @@ -312,6 +357,9 @@ public static function secretVersionName(string $project, string $secret, string * - execution: projects/{project}/locations/{location}/jobs/{job}/executions/{execution} * - job: projects/{project}/locations/{location}/jobs/{job} * - location: projects/{project}/locations/{location} + * - locationPolicy: locations/{location}/policy + * - policy: projects/{project}/policy + * - projectPolicy: projects/{project}/policy * - secret: projects/{project}/secrets/{secret} * - secretVersion: projects/{project}/secrets/{secret}/versions/{version} * diff --git a/Run/src/V2/Client/ServicesClient.php b/Run/src/V2/Client/ServicesClient.php index 794121b04e1c..d6e89a0c64dd 100644 --- a/Run/src/V2/Client/ServicesClient.php +++ b/Run/src/V2/Client/ServicesClient.php @@ -224,6 +224,70 @@ public static function locationName(string $project, string $location): string ]); } + /** + * Formats a string containing the fully-qualified path to represent a + * location_policy resource. + * + * @param string $location + * + * @return string The formatted location_policy resource. + */ + public static function locationPolicyName(string $location): string + { + return self::getPathTemplate('locationPolicy')->render([ + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a mesh + * resource. + * + * @param string $project + * @param string $location + * @param string $mesh + * + * @return string The formatted mesh resource. + */ + public static function meshName(string $project, string $location, string $mesh): string + { + return self::getPathTemplate('mesh')->render([ + 'project' => $project, + 'location' => $location, + 'mesh' => $mesh, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a policy + * resource. + * + * @param string $project + * + * @return string The formatted policy resource. + */ + public static function policyName(string $project): string + { + return self::getPathTemplate('policy')->render([ + 'project' => $project, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_policy resource. + * + * @param string $project + * + * @return string The formatted project_policy resource. + */ + public static function projectPolicyName(string $project): string + { + return self::getPathTemplate('projectPolicy')->render([ + 'project' => $project, + ]); + } + /** * Formats a string containing the fully-qualified path to represent a revision * resource. @@ -307,6 +371,10 @@ public static function serviceName(string $project, string $location, string $se * - connector: projects/{project}/locations/{location}/connectors/{connector} * - cryptoKey: projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key} * - location: projects/{project}/locations/{location} + * - locationPolicy: locations/{location}/policy + * - mesh: projects/{project}/locations/{location}/meshes/{mesh} + * - policy: projects/{project}/policy + * - projectPolicy: projects/{project}/policy * - revision: projects/{project}/locations/{location}/services/{service}/revisions/{revision} * - secret: projects/{project}/secrets/{secret} * - secretVersion: projects/{project}/secrets/{secret}/versions/{version} diff --git a/Run/src/V2/IngressTraffic.php b/Run/src/V2/IngressTraffic.php index 4bcff9e224cb..c9e391f2e464 100644 --- a/Run/src/V2/IngressTraffic.php +++ b/Run/src/V2/IngressTraffic.php @@ -37,12 +37,19 @@ class IngressTraffic * Generated from protobuf enum INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER = 3; */ const INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER = 3; + /** + * No ingress traffic is allowed. + * + * Generated from protobuf enum INGRESS_TRAFFIC_NONE = 4; + */ + const INGRESS_TRAFFIC_NONE = 4; private static $valueToName = [ self::INGRESS_TRAFFIC_UNSPECIFIED => 'INGRESS_TRAFFIC_UNSPECIFIED', self::INGRESS_TRAFFIC_ALL => 'INGRESS_TRAFFIC_ALL', self::INGRESS_TRAFFIC_INTERNAL_ONLY => 'INGRESS_TRAFFIC_INTERNAL_ONLY', self::INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER => 'INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER', + self::INGRESS_TRAFFIC_NONE => 'INGRESS_TRAFFIC_NONE', ]; public static function name($value) diff --git a/Run/src/V2/NodeSelector.php b/Run/src/V2/NodeSelector.php new file mode 100644 index 000000000000..54fd94337d57 --- /dev/null +++ b/Run/src/V2/NodeSelector.php @@ -0,0 +1,67 @@ +google.cloud.run.v2.NodeSelector + */ +class NodeSelector extends \Google\Protobuf\Internal\Message +{ + /** + * Required. GPU accelerator type to attach to an instance. + * + * Generated from protobuf field string accelerator = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $accelerator = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $accelerator + * Required. GPU accelerator type to attach to an instance. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\VendorSettings::initOnce(); + parent::__construct($data); + } + + /** + * Required. GPU accelerator type to attach to an instance. + * + * Generated from protobuf field string accelerator = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getAccelerator() + { + return $this->accelerator; + } + + /** + * Required. GPU accelerator type to attach to an instance. + * + * Generated from protobuf field string accelerator = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setAccelerator($var) + { + GPBUtil::checkString($var, True); + $this->accelerator = $var; + + return $this; + } + +} + diff --git a/Run/src/V2/Revision.php b/Run/src/V2/Revision.php index 18c074852e0b..f3bdf65355ab 100644 --- a/Run/src/V2/Revision.php +++ b/Run/src/V2/Revision.php @@ -164,6 +164,12 @@ class Revision extends \Google\Protobuf\Internal\Message * Generated from protobuf field string encryption_key = 21 [(.google.api.resource_reference) = { */ protected $encryption_key = ''; + /** + * Enables service mesh connectivity. + * + * Generated from protobuf field .google.cloud.run.v2.ServiceMesh service_mesh = 22; + */ + protected $service_mesh = null; /** * The action to take if the encryption key is revoked. * @@ -225,6 +231,12 @@ class Revision extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.cloud.run.v2.RevisionScalingStatus scaling_status = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ protected $scaling_status = null; + /** + * The node selector for the revision. + * + * Generated from protobuf field .google.cloud.run.v2.NodeSelector node_selector = 40; + */ + protected $node_selector = null; /** * Output only. A system-generated fingerprint for this version of the * resource. May be used to detect modification conflict during updates. @@ -306,6 +318,8 @@ class Revision extends \Google\Protobuf\Internal\Message * A reference to a customer managed encryption key (CMEK) to use to encrypt * this container image. For more information, go to * https://cloud.google.com/run/docs/securing/using-cmek + * @type \Google\Cloud\Run\V2\ServiceMesh $service_mesh + * Enables service mesh connectivity. * @type int $encryption_key_revocation_action * The action to take if the encryption key is revoked. * @type \Google\Protobuf\Duration $encryption_key_shutdown_duration @@ -331,6 +345,8 @@ class Revision extends \Google\Protobuf\Internal\Message * Enable session affinity. * @type \Google\Cloud\Run\V2\RevisionScalingStatus $scaling_status * Output only. The current effective scaling settings for the revision. + * @type \Google\Cloud\Run\V2\NodeSelector $node_selector + * The node selector for the revision. * @type string $etag * Output only. A system-generated fingerprint for this version of the * resource. May be used to detect modification conflict during updates. @@ -985,6 +1001,42 @@ public function setEncryptionKey($var) return $this; } + /** + * Enables service mesh connectivity. + * + * Generated from protobuf field .google.cloud.run.v2.ServiceMesh service_mesh = 22; + * @return \Google\Cloud\Run\V2\ServiceMesh|null + */ + public function getServiceMesh() + { + return $this->service_mesh; + } + + public function hasServiceMesh() + { + return isset($this->service_mesh); + } + + public function clearServiceMesh() + { + unset($this->service_mesh); + } + + /** + * Enables service mesh connectivity. + * + * Generated from protobuf field .google.cloud.run.v2.ServiceMesh service_mesh = 22; + * @param \Google\Cloud\Run\V2\ServiceMesh $var + * @return $this + */ + public function setServiceMesh($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\ServiceMesh::class); + $this->service_mesh = $var; + + return $this; + } + /** * The action to take if the encryption key is revoked. * @@ -1253,6 +1305,42 @@ public function setScalingStatus($var) return $this; } + /** + * The node selector for the revision. + * + * Generated from protobuf field .google.cloud.run.v2.NodeSelector node_selector = 40; + * @return \Google\Cloud\Run\V2\NodeSelector|null + */ + public function getNodeSelector() + { + return $this->node_selector; + } + + public function hasNodeSelector() + { + return isset($this->node_selector); + } + + public function clearNodeSelector() + { + unset($this->node_selector); + } + + /** + * The node selector for the revision. + * + * Generated from protobuf field .google.cloud.run.v2.NodeSelector node_selector = 40; + * @param \Google\Cloud\Run\V2\NodeSelector $var + * @return $this + */ + public function setNodeSelector($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\NodeSelector::class); + $this->node_selector = $var; + + return $this; + } + /** * Output only. A system-generated fingerprint for this version of the * resource. May be used to detect modification conflict during updates. diff --git a/Run/src/V2/RevisionScaling.php b/Run/src/V2/RevisionScaling.php index 892c5df3338c..5536c70fe0a4 100644 --- a/Run/src/V2/RevisionScaling.php +++ b/Run/src/V2/RevisionScaling.php @@ -24,7 +24,9 @@ class RevisionScaling extends \Google\Protobuf\Internal\Message protected $min_instance_count = 0; /** * Optional. Maximum number of serving instances that this resource should - * have. + * have. When unspecified, the field is set to the server default value of + * 100. For more information see + * https://cloud.google.com/run/docs/configuring/max-instances * * Generated from protobuf field int32 max_instance_count = 2 [(.google.api.field_behavior) = OPTIONAL]; */ @@ -41,7 +43,9 @@ class RevisionScaling extends \Google\Protobuf\Internal\Message * have. * @type int $max_instance_count * Optional. Maximum number of serving instances that this resource should - * have. + * have. When unspecified, the field is set to the server default value of + * 100. For more information see + * https://cloud.google.com/run/docs/configuring/max-instances * } */ public function __construct($data = NULL) { @@ -79,7 +83,9 @@ public function setMinInstanceCount($var) /** * Optional. Maximum number of serving instances that this resource should - * have. + * have. When unspecified, the field is set to the server default value of + * 100. For more information see + * https://cloud.google.com/run/docs/configuring/max-instances * * Generated from protobuf field int32 max_instance_count = 2 [(.google.api.field_behavior) = OPTIONAL]; * @return int @@ -91,7 +97,9 @@ public function getMaxInstanceCount() /** * Optional. Maximum number of serving instances that this resource should - * have. + * have. When unspecified, the field is set to the server default value of + * 100. For more information see + * https://cloud.google.com/run/docs/configuring/max-instances * * Generated from protobuf field int32 max_instance_count = 2 [(.google.api.field_behavior) = OPTIONAL]; * @param int $var diff --git a/Run/src/V2/RevisionTemplate.php b/Run/src/V2/RevisionTemplate.php index 868e51c42159..4ba3f6a2eb08 100644 --- a/Run/src/V2/RevisionTemplate.php +++ b/Run/src/V2/RevisionTemplate.php @@ -110,11 +110,18 @@ class RevisionTemplate extends \Google\Protobuf\Internal\Message protected $encryption_key = ''; /** * Optional. Sets the maximum number of requests that each serving instance - * can receive. + * can receive. If not specified or 0, defaults to 80 when requested + * `CPU >= 1` and defaults to 1 when requested `CPU < 1`. * * Generated from protobuf field int32 max_instance_request_concurrency = 15 [(.google.api.field_behavior) = OPTIONAL]; */ protected $max_instance_request_concurrency = 0; + /** + * Optional. Enables service mesh connectivity. + * + * Generated from protobuf field .google.cloud.run.v2.ServiceMesh service_mesh = 16 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $service_mesh = null; /** * Optional. Enable session affinity. * @@ -127,6 +134,12 @@ class RevisionTemplate extends \Google\Protobuf\Internal\Message * Generated from protobuf field bool health_check_disabled = 20 [(.google.api.field_behavior) = OPTIONAL]; */ protected $health_check_disabled = false; + /** + * Optional. The node selector for the revision template. + * + * Generated from protobuf field .google.cloud.run.v2.NodeSelector node_selector = 21 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $node_selector = null; /** * Constructor. @@ -184,11 +197,16 @@ class RevisionTemplate extends \Google\Protobuf\Internal\Message * https://cloud.google.com/run/docs/securing/using-cmek * @type int $max_instance_request_concurrency * Optional. Sets the maximum number of requests that each serving instance - * can receive. + * can receive. If not specified or 0, defaults to 80 when requested + * `CPU >= 1` and defaults to 1 when requested `CPU < 1`. + * @type \Google\Cloud\Run\V2\ServiceMesh $service_mesh + * Optional. Enables service mesh connectivity. * @type bool $session_affinity * Optional. Enable session affinity. * @type bool $health_check_disabled * Optional. Disables health checking containers during deployment. + * @type \Google\Cloud\Run\V2\NodeSelector $node_selector + * Optional. The node selector for the revision template. * } */ public function __construct($data = NULL) { @@ -566,7 +584,8 @@ public function setEncryptionKey($var) /** * Optional. Sets the maximum number of requests that each serving instance - * can receive. + * can receive. If not specified or 0, defaults to 80 when requested + * `CPU >= 1` and defaults to 1 when requested `CPU < 1`. * * Generated from protobuf field int32 max_instance_request_concurrency = 15 [(.google.api.field_behavior) = OPTIONAL]; * @return int @@ -578,7 +597,8 @@ public function getMaxInstanceRequestConcurrency() /** * Optional. Sets the maximum number of requests that each serving instance - * can receive. + * can receive. If not specified or 0, defaults to 80 when requested + * `CPU >= 1` and defaults to 1 when requested `CPU < 1`. * * Generated from protobuf field int32 max_instance_request_concurrency = 15 [(.google.api.field_behavior) = OPTIONAL]; * @param int $var @@ -592,6 +612,42 @@ public function setMaxInstanceRequestConcurrency($var) return $this; } + /** + * Optional. Enables service mesh connectivity. + * + * Generated from protobuf field .google.cloud.run.v2.ServiceMesh service_mesh = 16 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Run\V2\ServiceMesh|null + */ + public function getServiceMesh() + { + return $this->service_mesh; + } + + public function hasServiceMesh() + { + return isset($this->service_mesh); + } + + public function clearServiceMesh() + { + unset($this->service_mesh); + } + + /** + * Optional. Enables service mesh connectivity. + * + * Generated from protobuf field .google.cloud.run.v2.ServiceMesh service_mesh = 16 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Run\V2\ServiceMesh $var + * @return $this + */ + public function setServiceMesh($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\ServiceMesh::class); + $this->service_mesh = $var; + + return $this; + } + /** * Optional. Enable session affinity. * @@ -644,5 +700,41 @@ public function setHealthCheckDisabled($var) return $this; } + /** + * Optional. The node selector for the revision template. + * + * Generated from protobuf field .google.cloud.run.v2.NodeSelector node_selector = 21 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Run\V2\NodeSelector|null + */ + public function getNodeSelector() + { + return $this->node_selector; + } + + public function hasNodeSelector() + { + return isset($this->node_selector); + } + + public function clearNodeSelector() + { + unset($this->node_selector); + } + + /** + * Optional. The node selector for the revision template. + * + * Generated from protobuf field .google.cloud.run.v2.NodeSelector node_selector = 21 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Run\V2\NodeSelector $var + * @return $this + */ + public function setNodeSelector($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\NodeSelector::class); + $this->node_selector = $var; + + return $this; + } + } diff --git a/Run/src/V2/Service.php b/Run/src/V2/Service.php index 379f89b04695..ad7d6330dc2a 100644 --- a/Run/src/V2/Service.php +++ b/Run/src/V2/Service.php @@ -181,12 +181,35 @@ class Service extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.cloud.run.v2.ServiceScaling scaling = 20 [(.google.api.field_behavior) = OPTIONAL]; */ protected $scaling = null; + /** + * Optional. Disables IAM permission check for run.routes.invoke for callers + * of this service. This setting should not be used with external ingress. + * + * Generated from protobuf field bool invoker_iam_disabled = 21 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $invoker_iam_disabled = false; /** * Optional. Disables public resolution of the default URI of this service. * * Generated from protobuf field bool default_uri_disabled = 22 [(.google.api.field_behavior) = OPTIONAL]; */ protected $default_uri_disabled = false; + /** + * Output only. All URLs serving traffic for this Service. + * + * Generated from protobuf field repeated string urls = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $urls; + /** + * One or more custom audiences that you want this service to support. Specify + * each custom audience as the full URL in a string. The custom audiences are + * encoded in the token and used to authenticate requests. For more + * information, see + * https://cloud.google.com/run/docs/configuring/custom-audiences. + * + * Generated from protobuf field repeated string custom_audiences = 37; + */ + private $custom_audiences; /** * Output only. The generation of this Service currently serving traffic. See * comments in `reconciling` for additional information on reconciliation @@ -245,16 +268,6 @@ class Service extends \Google\Protobuf\Internal\Message * Generated from protobuf field string uri = 36 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ protected $uri = ''; - /** - * One or more custom audiences that you want this service to support. Specify - * each custom audience as the full URL in a string. The custom audiences are - * encoded in the token and used to authenticate requests. For more - * information, see - * https://cloud.google.com/run/docs/configuring/custom-audiences. - * - * Generated from protobuf field repeated string custom_audiences = 37; - */ - private $custom_audiences; /** * Output only. Reserved for future use. * @@ -381,8 +394,19 @@ class Service extends \Google\Protobuf\Internal\Message * defaults to 100% traffic to the latest `Ready` Revision. * @type \Google\Cloud\Run\V2\ServiceScaling $scaling * Optional. Specifies service-level scaling settings + * @type bool $invoker_iam_disabled + * Optional. Disables IAM permission check for run.routes.invoke for callers + * of this service. This setting should not be used with external ingress. * @type bool $default_uri_disabled * Optional. Disables public resolution of the default URI of this service. + * @type array|\Google\Protobuf\Internal\RepeatedField $urls + * Output only. All URLs serving traffic for this Service. + * @type array|\Google\Protobuf\Internal\RepeatedField $custom_audiences + * One or more custom audiences that you want this service to support. Specify + * each custom audience as the full URL in a string. The custom audiences are + * encoded in the token and used to authenticate requests. For more + * information, see + * https://cloud.google.com/run/docs/configuring/custom-audiences. * @type int|string $observed_generation * Output only. The generation of this Service currently serving traffic. See * comments in `reconciling` for additional information on reconciliation @@ -413,12 +437,6 @@ class Service extends \Google\Protobuf\Internal\Message * process in Cloud Run. * @type string $uri * Output only. The main URI in which this Service is serving traffic. - * @type array|\Google\Protobuf\Internal\RepeatedField $custom_audiences - * One or more custom audiences that you want this service to support. Specify - * each custom audience as the full URL in a string. The custom audiences are - * encoded in the token and used to authenticate requests. For more - * information, see - * https://cloud.google.com/run/docs/configuring/custom-audiences. * @type bool $satisfies_pzs * Output only. Reserved for future use. * @type bool $reconciling @@ -1125,6 +1143,34 @@ public function setScaling($var) return $this; } + /** + * Optional. Disables IAM permission check for run.routes.invoke for callers + * of this service. This setting should not be used with external ingress. + * + * Generated from protobuf field bool invoker_iam_disabled = 21 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getInvokerIamDisabled() + { + return $this->invoker_iam_disabled; + } + + /** + * Optional. Disables IAM permission check for run.routes.invoke for callers + * of this service. This setting should not be used with external ingress. + * + * Generated from protobuf field bool invoker_iam_disabled = 21 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setInvokerIamDisabled($var) + { + GPBUtil::checkBool($var); + $this->invoker_iam_disabled = $var; + + return $this; + } + /** * Optional. Disables public resolution of the default URI of this service. * @@ -1151,6 +1197,66 @@ public function setDefaultUriDisabled($var) return $this; } + /** + * Output only. All URLs serving traffic for this Service. + * + * Generated from protobuf field repeated string urls = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUrls() + { + return $this->urls; + } + + /** + * Output only. All URLs serving traffic for this Service. + * + * Generated from protobuf field repeated string urls = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUrls($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->urls = $arr; + + return $this; + } + + /** + * One or more custom audiences that you want this service to support. Specify + * each custom audience as the full URL in a string. The custom audiences are + * encoded in the token and used to authenticate requests. For more + * information, see + * https://cloud.google.com/run/docs/configuring/custom-audiences. + * + * Generated from protobuf field repeated string custom_audiences = 37; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCustomAudiences() + { + return $this->custom_audiences; + } + + /** + * One or more custom audiences that you want this service to support. Specify + * each custom audience as the full URL in a string. The custom audiences are + * encoded in the token and used to authenticate requests. For more + * information, see + * https://cloud.google.com/run/docs/configuring/custom-audiences. + * + * Generated from protobuf field repeated string custom_audiences = 37; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCustomAudiences($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->custom_audiences = $arr; + + return $this; + } + /** * Output only. The generation of this Service currently serving traffic. See * comments in `reconciling` for additional information on reconciliation @@ -1375,40 +1481,6 @@ public function setUri($var) return $this; } - /** - * One or more custom audiences that you want this service to support. Specify - * each custom audience as the full URL in a string. The custom audiences are - * encoded in the token and used to authenticate requests. For more - * information, see - * https://cloud.google.com/run/docs/configuring/custom-audiences. - * - * Generated from protobuf field repeated string custom_audiences = 37; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getCustomAudiences() - { - return $this->custom_audiences; - } - - /** - * One or more custom audiences that you want this service to support. Specify - * each custom audience as the full URL in a string. The custom audiences are - * encoded in the token and used to authenticate requests. For more - * information, see - * https://cloud.google.com/run/docs/configuring/custom-audiences. - * - * Generated from protobuf field repeated string custom_audiences = 37; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setCustomAudiences($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->custom_audiences = $arr; - - return $this; - } - /** * Output only. Reserved for future use. * diff --git a/Run/src/V2/ServiceMesh.php b/Run/src/V2/ServiceMesh.php new file mode 100644 index 000000000000..19cd1b0263c1 --- /dev/null +++ b/Run/src/V2/ServiceMesh.php @@ -0,0 +1,76 @@ +google.cloud.run.v2.ServiceMesh + */ +class ServiceMesh extends \Google\Protobuf\Internal\Message +{ + /** + * The Mesh resource name. Format: + * `projects/{project}/locations/global/meshes/{mesh}`, where `{project}` can + * be project id or number. + * + * Generated from protobuf field string mesh = 1 [(.google.api.resource_reference) = { + */ + protected $mesh = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $mesh + * The Mesh resource name. Format: + * `projects/{project}/locations/global/meshes/{mesh}`, where `{project}` can + * be project id or number. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\VendorSettings::initOnce(); + parent::__construct($data); + } + + /** + * The Mesh resource name. Format: + * `projects/{project}/locations/global/meshes/{mesh}`, where `{project}` can + * be project id or number. + * + * Generated from protobuf field string mesh = 1 [(.google.api.resource_reference) = { + * @return string + */ + public function getMesh() + { + return $this->mesh; + } + + /** + * The Mesh resource name. Format: + * `projects/{project}/locations/global/meshes/{mesh}`, where `{project}` can + * be project id or number. + * + * Generated from protobuf field string mesh = 1 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setMesh($var) + { + GPBUtil::checkString($var, True); + $this->mesh = $var; + + return $this; + } + +} + diff --git a/Run/src/V2/ServiceScaling.php b/Run/src/V2/ServiceScaling.php index e8bad225cc66..eff3cf1badc1 100644 --- a/Run/src/V2/ServiceScaling.php +++ b/Run/src/V2/ServiceScaling.php @@ -19,11 +19,17 @@ class ServiceScaling extends \Google\Protobuf\Internal\Message /** * Optional. total min instances for the service. This number of instances is * divided among all revisions with specified traffic based on the percent - * of traffic they are receiving. (BETA) + * of traffic they are receiving. * * Generated from protobuf field int32 min_instance_count = 1 [(.google.api.field_behavior) = OPTIONAL]; */ protected $min_instance_count = 0; + /** + * Optional. The scaling mode for the service. + * + * Generated from protobuf field .google.cloud.run.v2.ServiceScaling.ScalingMode scaling_mode = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $scaling_mode = 0; /** * Constructor. @@ -34,7 +40,9 @@ class ServiceScaling extends \Google\Protobuf\Internal\Message * @type int $min_instance_count * Optional. total min instances for the service. This number of instances is * divided among all revisions with specified traffic based on the percent - * of traffic they are receiving. (BETA) + * of traffic they are receiving. + * @type int $scaling_mode + * Optional. The scaling mode for the service. * } */ public function __construct($data = NULL) { @@ -45,7 +53,7 @@ public function __construct($data = NULL) { /** * Optional. total min instances for the service. This number of instances is * divided among all revisions with specified traffic based on the percent - * of traffic they are receiving. (BETA) + * of traffic they are receiving. * * Generated from protobuf field int32 min_instance_count = 1 [(.google.api.field_behavior) = OPTIONAL]; * @return int @@ -58,7 +66,7 @@ public function getMinInstanceCount() /** * Optional. total min instances for the service. This number of instances is * divided among all revisions with specified traffic based on the percent - * of traffic they are receiving. (BETA) + * of traffic they are receiving. * * Generated from protobuf field int32 min_instance_count = 1 [(.google.api.field_behavior) = OPTIONAL]; * @param int $var @@ -72,5 +80,31 @@ public function setMinInstanceCount($var) return $this; } + /** + * Optional. The scaling mode for the service. + * + * Generated from protobuf field .google.cloud.run.v2.ServiceScaling.ScalingMode scaling_mode = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getScalingMode() + { + return $this->scaling_mode; + } + + /** + * Optional. The scaling mode for the service. + * + * Generated from protobuf field .google.cloud.run.v2.ServiceScaling.ScalingMode scaling_mode = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setScalingMode($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Run\V2\ServiceScaling\ScalingMode::class); + $this->scaling_mode = $var; + + return $this; + } + } diff --git a/Run/src/V2/ServiceScaling/ScalingMode.php b/Run/src/V2/ServiceScaling/ScalingMode.php new file mode 100644 index 000000000000..3df73f6e4af0 --- /dev/null +++ b/Run/src/V2/ServiceScaling/ScalingMode.php @@ -0,0 +1,63 @@ +google.cloud.run.v2.ServiceScaling.ScalingMode + */ +class ScalingMode +{ + /** + * Unspecified. + * + * Generated from protobuf enum SCALING_MODE_UNSPECIFIED = 0; + */ + const SCALING_MODE_UNSPECIFIED = 0; + /** + * Scale based on traffic between min and max instances. + * + * Generated from protobuf enum AUTOMATIC = 1; + */ + const AUTOMATIC = 1; + /** + * Scale to exactly min instances and ignore max instances. + * + * Generated from protobuf enum MANUAL = 2; + */ + const MANUAL = 2; + + private static $valueToName = [ + self::SCALING_MODE_UNSPECIFIED => 'SCALING_MODE_UNSPECIFIED', + self::AUTOMATIC => 'AUTOMATIC', + self::MANUAL => 'MANUAL', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/Run/src/V2/StorageSource.php b/Run/src/V2/StorageSource.php new file mode 100644 index 000000000000..a577d719f1a5 --- /dev/null +++ b/Run/src/V2/StorageSource.php @@ -0,0 +1,155 @@ +google.cloud.run.v2.StorageSource + */ +class StorageSource extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Google Cloud Storage bucket containing the source (see + * [Bucket Name + * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). + * + * Generated from protobuf field string bucket = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $bucket = ''; + /** + * Required. Google Cloud Storage object containing the source. + * This object must be a gzipped archive file (`.tar.gz`) containing source to + * build. + * + * Generated from protobuf field string object = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $object = ''; + /** + * Optional. Google Cloud Storage generation for the object. If the generation + * is omitted, the latest generation will be used. + * + * Generated from protobuf field int64 generation = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $generation = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $bucket + * Required. Google Cloud Storage bucket containing the source (see + * [Bucket Name + * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). + * @type string $object + * Required. Google Cloud Storage object containing the source. + * This object must be a gzipped archive file (`.tar.gz`) containing source to + * build. + * @type int|string $generation + * Optional. Google Cloud Storage generation for the object. If the generation + * is omitted, the latest generation will be used. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Build::initOnce(); + parent::__construct($data); + } + + /** + * Required. Google Cloud Storage bucket containing the source (see + * [Bucket Name + * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). + * + * Generated from protobuf field string bucket = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getBucket() + { + return $this->bucket; + } + + /** + * Required. Google Cloud Storage bucket containing the source (see + * [Bucket Name + * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). + * + * Generated from protobuf field string bucket = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setBucket($var) + { + GPBUtil::checkString($var, True); + $this->bucket = $var; + + return $this; + } + + /** + * Required. Google Cloud Storage object containing the source. + * This object must be a gzipped archive file (`.tar.gz`) containing source to + * build. + * + * Generated from protobuf field string object = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getObject() + { + return $this->object; + } + + /** + * Required. Google Cloud Storage object containing the source. + * This object must be a gzipped archive file (`.tar.gz`) containing source to + * build. + * + * Generated from protobuf field string object = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setObject($var) + { + GPBUtil::checkString($var, True); + $this->object = $var; + + return $this; + } + + /** + * Optional. Google Cloud Storage generation for the object. If the generation + * is omitted, the latest generation will be used. + * + * Generated from protobuf field int64 generation = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int|string + */ + public function getGeneration() + { + return $this->generation; + } + + /** + * Optional. Google Cloud Storage generation for the object. If the generation + * is omitted, the latest generation will be used. + * + * Generated from protobuf field int64 generation = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int|string $var + * @return $this + */ + public function setGeneration($var) + { + GPBUtil::checkInt64($var); + $this->generation = $var; + + return $this; + } + +} + diff --git a/Run/src/V2/SubmitBuildRequest.php b/Run/src/V2/SubmitBuildRequest.php new file mode 100644 index 000000000000..cb260e21eed3 --- /dev/null +++ b/Run/src/V2/SubmitBuildRequest.php @@ -0,0 +1,356 @@ +google.cloud.run.v2.SubmitBuildRequest + */ +class SubmitBuildRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project and location to build in. Location must be a region, + * e.g., 'us-central1' or 'global' if the global builder is to be used. + * Format: + * `projects/{project}/locations/{location}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $parent = ''; + /** + * Required. Artifact Registry URI to store the built image. + * + * Generated from protobuf field string image_uri = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $image_uri = ''; + /** + * Optional. The service account to use for the build. If not set, the default + * Cloud Build service account for the project will be used. + * + * Generated from protobuf field string service_account = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $service_account = ''; + /** + * Optional. Name of the Cloud Build Custom Worker Pool that should be used to + * build the function. The format of this field is + * `projects/{project}/locations/{region}/workerPools/{workerPool}` where + * `{project}` and `{region}` are the project id and region respectively where + * the worker pool is defined and `{workerPool}` is the short name of the + * worker pool. + * + * Generated from protobuf field string worker_pool = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $worker_pool = ''; + /** + * Optional. Additional tags to annotate the build. + * + * Generated from protobuf field repeated string tags = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $tags; + protected $source; + protected $build_type; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project and location to build in. Location must be a region, + * e.g., 'us-central1' or 'global' if the global builder is to be used. + * Format: + * `projects/{project}/locations/{location}` + * @type \Google\Cloud\Run\V2\StorageSource $storage_source + * Required. Source for the build. + * @type string $image_uri + * Required. Artifact Registry URI to store the built image. + * @type \Google\Cloud\Run\V2\SubmitBuildRequest\BuildpacksBuild $buildpack_build + * Build the source using Buildpacks. + * @type \Google\Cloud\Run\V2\SubmitBuildRequest\DockerBuild $docker_build + * Build the source using Docker. This means the source has a Dockerfile. + * @type string $service_account + * Optional. The service account to use for the build. If not set, the default + * Cloud Build service account for the project will be used. + * @type string $worker_pool + * Optional. Name of the Cloud Build Custom Worker Pool that should be used to + * build the function. The format of this field is + * `projects/{project}/locations/{region}/workerPools/{workerPool}` where + * `{project}` and `{region}` are the project id and region respectively where + * the worker pool is defined and `{workerPool}` is the short name of the + * worker pool. + * @type array|\Google\Protobuf\Internal\RepeatedField $tags + * Optional. Additional tags to annotate the build. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Build::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project and location to build in. Location must be a region, + * e.g., 'us-central1' or 'global' if the global builder is to be used. + * Format: + * `projects/{project}/locations/{location}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project and location to build in. Location must be a region, + * e.g., 'us-central1' or 'global' if the global builder is to be used. + * Format: + * `projects/{project}/locations/{location}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. Source for the build. + * + * Generated from protobuf field .google.cloud.run.v2.StorageSource storage_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Run\V2\StorageSource|null + */ + public function getStorageSource() + { + return $this->readOneof(2); + } + + public function hasStorageSource() + { + return $this->hasOneof(2); + } + + /** + * Required. Source for the build. + * + * Generated from protobuf field .google.cloud.run.v2.StorageSource storage_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Run\V2\StorageSource $var + * @return $this + */ + public function setStorageSource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\StorageSource::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Required. Artifact Registry URI to store the built image. + * + * Generated from protobuf field string image_uri = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getImageUri() + { + return $this->image_uri; + } + + /** + * Required. Artifact Registry URI to store the built image. + * + * Generated from protobuf field string image_uri = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setImageUri($var) + { + GPBUtil::checkString($var, True); + $this->image_uri = $var; + + return $this; + } + + /** + * Build the source using Buildpacks. + * + * Generated from protobuf field .google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild buildpack_build = 4; + * @return \Google\Cloud\Run\V2\SubmitBuildRequest\BuildpacksBuild|null + */ + public function getBuildpackBuild() + { + return $this->readOneof(4); + } + + public function hasBuildpackBuild() + { + return $this->hasOneof(4); + } + + /** + * Build the source using Buildpacks. + * + * Generated from protobuf field .google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild buildpack_build = 4; + * @param \Google\Cloud\Run\V2\SubmitBuildRequest\BuildpacksBuild $var + * @return $this + */ + public function setBuildpackBuild($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\SubmitBuildRequest\BuildpacksBuild::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Build the source using Docker. This means the source has a Dockerfile. + * + * Generated from protobuf field .google.cloud.run.v2.SubmitBuildRequest.DockerBuild docker_build = 5; + * @return \Google\Cloud\Run\V2\SubmitBuildRequest\DockerBuild|null + */ + public function getDockerBuild() + { + return $this->readOneof(5); + } + + public function hasDockerBuild() + { + return $this->hasOneof(5); + } + + /** + * Build the source using Docker. This means the source has a Dockerfile. + * + * Generated from protobuf field .google.cloud.run.v2.SubmitBuildRequest.DockerBuild docker_build = 5; + * @param \Google\Cloud\Run\V2\SubmitBuildRequest\DockerBuild $var + * @return $this + */ + public function setDockerBuild($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\SubmitBuildRequest\DockerBuild::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * Optional. The service account to use for the build. If not set, the default + * Cloud Build service account for the project will be used. + * + * Generated from protobuf field string service_account = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getServiceAccount() + { + return $this->service_account; + } + + /** + * Optional. The service account to use for the build. If not set, the default + * Cloud Build service account for the project will be used. + * + * Generated from protobuf field string service_account = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setServiceAccount($var) + { + GPBUtil::checkString($var, True); + $this->service_account = $var; + + return $this; + } + + /** + * Optional. Name of the Cloud Build Custom Worker Pool that should be used to + * build the function. The format of this field is + * `projects/{project}/locations/{region}/workerPools/{workerPool}` where + * `{project}` and `{region}` are the project id and region respectively where + * the worker pool is defined and `{workerPool}` is the short name of the + * worker pool. + * + * Generated from protobuf field string worker_pool = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getWorkerPool() + { + return $this->worker_pool; + } + + /** + * Optional. Name of the Cloud Build Custom Worker Pool that should be used to + * build the function. The format of this field is + * `projects/{project}/locations/{region}/workerPools/{workerPool}` where + * `{project}` and `{region}` are the project id and region respectively where + * the worker pool is defined and `{workerPool}` is the short name of the + * worker pool. + * + * Generated from protobuf field string worker_pool = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setWorkerPool($var) + { + GPBUtil::checkString($var, True); + $this->worker_pool = $var; + + return $this; + } + + /** + * Optional. Additional tags to annotate the build. + * + * Generated from protobuf field repeated string tags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTags() + { + return $this->tags; + } + + /** + * Optional. Additional tags to annotate the build. + * + * Generated from protobuf field repeated string tags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTags($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->tags = $arr; + + return $this; + } + + /** + * @return string + */ + public function getSource() + { + return $this->whichOneof("source"); + } + + /** + * @return string + */ + public function getBuildType() + { + return $this->whichOneof("build_type"); + } + +} + diff --git a/Run/src/V2/SubmitBuildRequest/BuildpacksBuild.php b/Run/src/V2/SubmitBuildRequest/BuildpacksBuild.php new file mode 100644 index 000000000000..b7256e54523a --- /dev/null +++ b/Run/src/V2/SubmitBuildRequest/BuildpacksBuild.php @@ -0,0 +1,271 @@ +google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild + */ +class BuildpacksBuild extends \Google\Protobuf\Internal\Message +{ + /** + * The runtime name, e.g. 'go113'. Leave blank for generic builds. + * + * Generated from protobuf field string runtime = 1 [deprecated = true]; + * @deprecated + */ + protected $runtime = ''; + /** + * Optional. Name of the function target if the source is a function source. + * Required for function builds. + * + * Generated from protobuf field string function_target = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $function_target = ''; + /** + * Optional. cache_image_uri is the GCR/AR URL where the cache image will be + * stored. cache_image_uri is optional and omitting it will disable caching. + * This URL must be stable across builds. It is used to derive a + * build-specific temporary URL by substituting the tag with the build ID. + * The build will clean up the temporary image on a best-effort basis. + * + * Generated from protobuf field string cache_image_uri = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $cache_image_uri = ''; + /** + * Optional. The base image used to opt into automatic base image updates. + * + * Generated from protobuf field string base_image = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $base_image = ''; + /** + * Optional. User-provided build-time environment variables. + * + * Generated from protobuf field map environment_variables = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $environment_variables; + /** + * Optional. Whether or not the application container will be enrolled in + * automatic base image updates. When true, the application will be built on + * a scratch base image, so the base layers can be appended at run time. + * + * Generated from protobuf field bool enable_automatic_updates = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $enable_automatic_updates = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $runtime + * The runtime name, e.g. 'go113'. Leave blank for generic builds. + * @type string $function_target + * Optional. Name of the function target if the source is a function source. + * Required for function builds. + * @type string $cache_image_uri + * Optional. cache_image_uri is the GCR/AR URL where the cache image will be + * stored. cache_image_uri is optional and omitting it will disable caching. + * This URL must be stable across builds. It is used to derive a + * build-specific temporary URL by substituting the tag with the build ID. + * The build will clean up the temporary image on a best-effort basis. + * @type string $base_image + * Optional. The base image used to opt into automatic base image updates. + * @type array|\Google\Protobuf\Internal\MapField $environment_variables + * Optional. User-provided build-time environment variables. + * @type bool $enable_automatic_updates + * Optional. Whether or not the application container will be enrolled in + * automatic base image updates. When true, the application will be built on + * a scratch base image, so the base layers can be appended at run time. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Build::initOnce(); + parent::__construct($data); + } + + /** + * The runtime name, e.g. 'go113'. Leave blank for generic builds. + * + * Generated from protobuf field string runtime = 1 [deprecated = true]; + * @return string + * @deprecated + */ + public function getRuntime() + { + @trigger_error('runtime is deprecated.', E_USER_DEPRECATED); + return $this->runtime; + } + + /** + * The runtime name, e.g. 'go113'. Leave blank for generic builds. + * + * Generated from protobuf field string runtime = 1 [deprecated = true]; + * @param string $var + * @return $this + * @deprecated + */ + public function setRuntime($var) + { + @trigger_error('runtime is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkString($var, True); + $this->runtime = $var; + + return $this; + } + + /** + * Optional. Name of the function target if the source is a function source. + * Required for function builds. + * + * Generated from protobuf field string function_target = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFunctionTarget() + { + return $this->function_target; + } + + /** + * Optional. Name of the function target if the source is a function source. + * Required for function builds. + * + * Generated from protobuf field string function_target = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFunctionTarget($var) + { + GPBUtil::checkString($var, True); + $this->function_target = $var; + + return $this; + } + + /** + * Optional. cache_image_uri is the GCR/AR URL where the cache image will be + * stored. cache_image_uri is optional and omitting it will disable caching. + * This URL must be stable across builds. It is used to derive a + * build-specific temporary URL by substituting the tag with the build ID. + * The build will clean up the temporary image on a best-effort basis. + * + * Generated from protobuf field string cache_image_uri = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getCacheImageUri() + { + return $this->cache_image_uri; + } + + /** + * Optional. cache_image_uri is the GCR/AR URL where the cache image will be + * stored. cache_image_uri is optional and omitting it will disable caching. + * This URL must be stable across builds. It is used to derive a + * build-specific temporary URL by substituting the tag with the build ID. + * The build will clean up the temporary image on a best-effort basis. + * + * Generated from protobuf field string cache_image_uri = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setCacheImageUri($var) + { + GPBUtil::checkString($var, True); + $this->cache_image_uri = $var; + + return $this; + } + + /** + * Optional. The base image used to opt into automatic base image updates. + * + * Generated from protobuf field string base_image = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getBaseImage() + { + return $this->base_image; + } + + /** + * Optional. The base image used to opt into automatic base image updates. + * + * Generated from protobuf field string base_image = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setBaseImage($var) + { + GPBUtil::checkString($var, True); + $this->base_image = $var; + + return $this; + } + + /** + * Optional. User-provided build-time environment variables. + * + * Generated from protobuf field map environment_variables = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getEnvironmentVariables() + { + return $this->environment_variables; + } + + /** + * Optional. User-provided build-time environment variables. + * + * Generated from protobuf field map environment_variables = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setEnvironmentVariables($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->environment_variables = $arr; + + return $this; + } + + /** + * Optional. Whether or not the application container will be enrolled in + * automatic base image updates. When true, the application will be built on + * a scratch base image, so the base layers can be appended at run time. + * + * Generated from protobuf field bool enable_automatic_updates = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getEnableAutomaticUpdates() + { + return $this->enable_automatic_updates; + } + + /** + * Optional. Whether or not the application container will be enrolled in + * automatic base image updates. When true, the application will be built on + * a scratch base image, so the base layers can be appended at run time. + * + * Generated from protobuf field bool enable_automatic_updates = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setEnableAutomaticUpdates($var) + { + GPBUtil::checkBool($var); + $this->enable_automatic_updates = $var; + + return $this; + } + +} + + diff --git a/Run/src/V2/SubmitBuildRequest/DockerBuild.php b/Run/src/V2/SubmitBuildRequest/DockerBuild.php new file mode 100644 index 000000000000..5b8a06980739 --- /dev/null +++ b/Run/src/V2/SubmitBuildRequest/DockerBuild.php @@ -0,0 +1,34 @@ +google.cloud.run.v2.SubmitBuildRequest.DockerBuild + */ +class DockerBuild extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Build::initOnce(); + parent::__construct($data); + } + +} + + diff --git a/Run/src/V2/SubmitBuildResponse.php b/Run/src/V2/SubmitBuildResponse.php new file mode 100644 index 000000000000..42440dbfebd4 --- /dev/null +++ b/Run/src/V2/SubmitBuildResponse.php @@ -0,0 +1,149 @@ +google.cloud.run.v2.SubmitBuildResponse + */ +class SubmitBuildResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Cloud Build operation to be polled via CloudBuild API. + * + * Generated from protobuf field .google.longrunning.Operation build_operation = 1; + */ + protected $build_operation = null; + /** + * URI of the base builder image in Artifact Registry being used in the build. + * Used to opt into automatic base image updates. + * + * Generated from protobuf field string base_image_uri = 2; + */ + protected $base_image_uri = ''; + /** + * Warning message for the base image. + * + * Generated from protobuf field string base_image_warning = 3; + */ + protected $base_image_warning = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\LongRunning\Operation $build_operation + * Cloud Build operation to be polled via CloudBuild API. + * @type string $base_image_uri + * URI of the base builder image in Artifact Registry being used in the build. + * Used to opt into automatic base image updates. + * @type string $base_image_warning + * Warning message for the base image. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Build::initOnce(); + parent::__construct($data); + } + + /** + * Cloud Build operation to be polled via CloudBuild API. + * + * Generated from protobuf field .google.longrunning.Operation build_operation = 1; + * @return \Google\LongRunning\Operation|null + */ + public function getBuildOperation() + { + return $this->build_operation; + } + + public function hasBuildOperation() + { + return isset($this->build_operation); + } + + public function clearBuildOperation() + { + unset($this->build_operation); + } + + /** + * Cloud Build operation to be polled via CloudBuild API. + * + * Generated from protobuf field .google.longrunning.Operation build_operation = 1; + * @param \Google\LongRunning\Operation $var + * @return $this + */ + public function setBuildOperation($var) + { + GPBUtil::checkMessage($var, \Google\LongRunning\Operation::class); + $this->build_operation = $var; + + return $this; + } + + /** + * URI of the base builder image in Artifact Registry being used in the build. + * Used to opt into automatic base image updates. + * + * Generated from protobuf field string base_image_uri = 2; + * @return string + */ + public function getBaseImageUri() + { + return $this->base_image_uri; + } + + /** + * URI of the base builder image in Artifact Registry being used in the build. + * Used to opt into automatic base image updates. + * + * Generated from protobuf field string base_image_uri = 2; + * @param string $var + * @return $this + */ + public function setBaseImageUri($var) + { + GPBUtil::checkString($var, True); + $this->base_image_uri = $var; + + return $this; + } + + /** + * Warning message for the base image. + * + * Generated from protobuf field string base_image_warning = 3; + * @return string + */ + public function getBaseImageWarning() + { + return $this->base_image_warning; + } + + /** + * Warning message for the base image. + * + * Generated from protobuf field string base_image_warning = 3; + * @param string $var + * @return $this + */ + public function setBaseImageWarning($var) + { + GPBUtil::checkString($var, True); + $this->base_image_warning = $var; + + return $this; + } + +} + diff --git a/Run/src/V2/VpcAccess.php b/Run/src/V2/VpcAccess.php index f38ecdf80556..2edc5d9e89bc 100644 --- a/Run/src/V2/VpcAccess.php +++ b/Run/src/V2/VpcAccess.php @@ -18,8 +18,8 @@ class VpcAccess extends \Google\Protobuf\Internal\Message { /** * VPC Access connector name. - * Format: projects/{project}/locations/{location}/connectors/{connector}, - * where {project} can be project id or number. + * Format: `projects/{project}/locations/{location}/connectors/{connector}`, + * where `{project}` can be project id or number. * For more information on sending traffic to a VPC network via a connector, * visit https://cloud.google.com/run/docs/configuring/vpc-connectors. * @@ -49,8 +49,8 @@ class VpcAccess extends \Google\Protobuf\Internal\Message * * @type string $connector * VPC Access connector name. - * Format: projects/{project}/locations/{location}/connectors/{connector}, - * where {project} can be project id or number. + * Format: `projects/{project}/locations/{location}/connectors/{connector}`, + * where `{project}` can be project id or number. * For more information on sending traffic to a VPC network via a connector, * visit https://cloud.google.com/run/docs/configuring/vpc-connectors. * @type int $egress @@ -68,8 +68,8 @@ public function __construct($data = NULL) { /** * VPC Access connector name. - * Format: projects/{project}/locations/{location}/connectors/{connector}, - * where {project} can be project id or number. + * Format: `projects/{project}/locations/{location}/connectors/{connector}`, + * where `{project}` can be project id or number. * For more information on sending traffic to a VPC network via a connector, * visit https://cloud.google.com/run/docs/configuring/vpc-connectors. * @@ -83,8 +83,8 @@ public function getConnector() /** * VPC Access connector name. - * Format: projects/{project}/locations/{location}/connectors/{connector}, - * where {project} can be project id or number. + * Format: `projects/{project}/locations/{location}/connectors/{connector}`, + * where `{project}` can be project id or number. * For more information on sending traffic to a VPC network via a connector, * visit https://cloud.google.com/run/docs/configuring/vpc-connectors. * diff --git a/Run/src/V2/gapic_metadata.json b/Run/src/V2/gapic_metadata.json index 300fbd7d62bd..2bf7b36f81c0 100644 --- a/Run/src/V2/gapic_metadata.json +++ b/Run/src/V2/gapic_metadata.json @@ -5,6 +5,20 @@ "protoPackage": "google.cloud.run.v2", "libraryPackage": "Google\\Cloud\\Run\\V2", "services": { + "Builds": { + "clients": { + "grpc": { + "libraryClient": "BuildsGapicClient", + "rpcs": { + "SubmitBuild": { + "methods": [ + "submitBuild" + ] + } + } + } + } + }, "Executions": { "clients": { "grpc": { diff --git a/Run/src/V2/resources/builds_client_config.json b/Run/src/V2/resources/builds_client_config.json new file mode 100644 index 000000000000..b09e6e721847 --- /dev/null +++ b/Run/src/V2/resources/builds_client_config.json @@ -0,0 +1,27 @@ +{ + "interfaces": { + "google.cloud.run.v2.Builds": { + "retry_codes": { + "no_retry_codes": [] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + } + }, + "methods": { + "SubmitBuild": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/Run/src/V2/resources/builds_descriptor_config.php b/Run/src/V2/resources/builds_descriptor_config.php new file mode 100644 index 000000000000..5cb8ed8624cb --- /dev/null +++ b/Run/src/V2/resources/builds_descriptor_config.php @@ -0,0 +1,43 @@ + [ + 'google.cloud.run.v2.Builds' => [ + 'SubmitBuild' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Run\V2\SubmitBuildResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'templateMap' => [ + 'workerPool' => 'projects/{project}/locations/{location}/workerPools/{worker_pool}', + ], + ], + ], +]; diff --git a/Run/src/V2/resources/builds_rest_client_config.php b/Run/src/V2/resources/builds_rest_client_config.php new file mode 100644 index 000000000000..5654061ec5f6 --- /dev/null +++ b/Run/src/V2/resources/builds_rest_client_config.php @@ -0,0 +1,88 @@ + [ + 'google.cloud.run.v2.Builds' => [ + 'SubmitBuild' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/builds:submit', + 'body' => '*', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'DeleteOperation' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'WaitOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:wait', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/Run/src/V2/resources/jobs_descriptor_config.php b/Run/src/V2/resources/jobs_descriptor_config.php index 33bd0d89d3f4..dabd773405ac 100644 --- a/Run/src/V2/resources/jobs_descriptor_config.php +++ b/Run/src/V2/resources/jobs_descriptor_config.php @@ -180,6 +180,9 @@ 'execution' => 'projects/{project}/locations/{location}/jobs/{job}/executions/{execution}', 'job' => 'projects/{project}/locations/{location}/jobs/{job}', 'location' => 'projects/{project}/locations/{location}', + 'locationPolicy' => 'locations/{location}/policy', + 'policy' => 'projects/{project}/policy', + 'projectPolicy' => 'projects/{project}/policy', 'secret' => 'projects/{project}/secrets/{secret}', 'secretVersion' => 'projects/{project}/secrets/{secret}/versions/{version}', ], diff --git a/Run/src/V2/resources/services_descriptor_config.php b/Run/src/V2/resources/services_descriptor_config.php index 82c5c01c31d6..3264c3a5d624 100644 --- a/Run/src/V2/resources/services_descriptor_config.php +++ b/Run/src/V2/resources/services_descriptor_config.php @@ -158,6 +158,10 @@ 'connector' => 'projects/{project}/locations/{location}/connectors/{connector}', 'cryptoKey' => 'projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}', 'location' => 'projects/{project}/locations/{location}', + 'locationPolicy' => 'locations/{location}/policy', + 'mesh' => 'projects/{project}/locations/{location}/meshes/{mesh}', + 'policy' => 'projects/{project}/policy', + 'projectPolicy' => 'projects/{project}/policy', 'revision' => 'projects/{project}/locations/{location}/services/{service}/revisions/{revision}', 'secret' => 'projects/{project}/secrets/{secret}', 'secretVersion' => 'projects/{project}/secrets/{secret}/versions/{version}', diff --git a/Run/tests/Unit/V2/Client/BuildsClientTest.php b/Run/tests/Unit/V2/Client/BuildsClientTest.php new file mode 100644 index 000000000000..dbea8b8c64b4 --- /dev/null +++ b/Run/tests/Unit/V2/Client/BuildsClientTest.php @@ -0,0 +1,197 @@ +getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); + } + + /** @return BuildsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new BuildsClient($options); + } + + /** @test */ + public function submitBuildTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $baseImageUri = 'baseImageUri2088954010'; + $baseImageWarning = 'baseImageWarning-2033873974'; + $expectedResponse = new SubmitBuildResponse(); + $expectedResponse->setBaseImageUri($baseImageUri); + $expectedResponse->setBaseImageWarning($baseImageWarning); + $transport->addResponse($expectedResponse); + // Mock request + $parent = 'parent-995424086'; + $storageSource = new StorageSource(); + $storageSourceBucket = 'storageSourceBucket608605184'; + $storageSource->setBucket($storageSourceBucket); + $storageSourceObject = 'storageSourceObject963439957'; + $storageSource->setObject($storageSourceObject); + $imageUri = 'imageUri-877823864'; + $request = (new SubmitBuildRequest()) + ->setParent($parent) + ->setStorageSource($storageSource) + ->setImageUri($imageUri); + $response = $gapicClient->submitBuild($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.run.v2.Builds/SubmitBuild', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $actualValue = $actualRequestObject->getStorageSource(); + $this->assertProtobufEquals($storageSource, $actualValue); + $actualValue = $actualRequestObject->getImageUri(); + $this->assertProtobufEquals($imageUri, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function submitBuildExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $parent = 'parent-995424086'; + $storageSource = new StorageSource(); + $storageSourceBucket = 'storageSourceBucket608605184'; + $storageSource->setBucket($storageSourceBucket); + $storageSourceObject = 'storageSourceObject963439957'; + $storageSource->setObject($storageSourceObject); + $imageUri = 'imageUri-877823864'; + $request = (new SubmitBuildRequest()) + ->setParent($parent) + ->setStorageSource($storageSource) + ->setImageUri($imageUri); + try { + $gapicClient->submitBuild($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function submitBuildAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $baseImageUri = 'baseImageUri2088954010'; + $baseImageWarning = 'baseImageWarning-2033873974'; + $expectedResponse = new SubmitBuildResponse(); + $expectedResponse->setBaseImageUri($baseImageUri); + $expectedResponse->setBaseImageWarning($baseImageWarning); + $transport->addResponse($expectedResponse); + // Mock request + $parent = 'parent-995424086'; + $storageSource = new StorageSource(); + $storageSourceBucket = 'storageSourceBucket608605184'; + $storageSource->setBucket($storageSourceBucket); + $storageSourceObject = 'storageSourceObject963439957'; + $storageSource->setObject($storageSourceObject); + $imageUri = 'imageUri-877823864'; + $request = (new SubmitBuildRequest()) + ->setParent($parent) + ->setStorageSource($storageSource) + ->setImageUri($imageUri); + $response = $gapicClient->submitBuildAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.run.v2.Builds/SubmitBuild', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $actualValue = $actualRequestObject->getStorageSource(); + $this->assertProtobufEquals($storageSource, $actualValue); + $actualValue = $actualRequestObject->getImageUri(); + $this->assertProtobufEquals($imageUri, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/Run/tests/Unit/V2/Client/ServicesClientTest.php b/Run/tests/Unit/V2/Client/ServicesClientTest.php index e9f9c5834b8e..68727e2c70f0 100644 --- a/Run/tests/Unit/V2/Client/ServicesClientTest.php +++ b/Run/tests/Unit/V2/Client/ServicesClientTest.php @@ -106,6 +106,7 @@ public function createServiceTest() $lastModifier = 'lastModifier-28366240'; $client = 'client-1357712437'; $clientVersion = 'clientVersion-1506231196'; + $invokerIamDisabled = false; $defaultUriDisabled = false; $observedGeneration = 900833007; $latestReadyRevision = 'latestReadyRevision-853854545'; @@ -123,6 +124,7 @@ public function createServiceTest() $expectedResponse->setLastModifier($lastModifier); $expectedResponse->setClient($client); $expectedResponse->setClientVersion($clientVersion); + $expectedResponse->setInvokerIamDisabled($invokerIamDisabled); $expectedResponse->setDefaultUriDisabled($defaultUriDisabled); $expectedResponse->setObservedGeneration($observedGeneration); $expectedResponse->setLatestReadyRevision($latestReadyRevision); @@ -278,6 +280,7 @@ public function deleteServiceTest() $lastModifier = 'lastModifier-28366240'; $client = 'client-1357712437'; $clientVersion = 'clientVersion-1506231196'; + $invokerIamDisabled = false; $defaultUriDisabled = false; $observedGeneration = 900833007; $latestReadyRevision = 'latestReadyRevision-853854545'; @@ -295,6 +298,7 @@ public function deleteServiceTest() $expectedResponse->setLastModifier($lastModifier); $expectedResponse->setClient($client); $expectedResponse->setClientVersion($clientVersion); + $expectedResponse->setInvokerIamDisabled($invokerIamDisabled); $expectedResponse->setDefaultUriDisabled($defaultUriDisabled); $expectedResponse->setObservedGeneration($observedGeneration); $expectedResponse->setLatestReadyRevision($latestReadyRevision); @@ -487,6 +491,7 @@ public function getServiceTest() $lastModifier = 'lastModifier-28366240'; $client = 'client-1357712437'; $clientVersion = 'clientVersion-1506231196'; + $invokerIamDisabled = false; $defaultUriDisabled = false; $observedGeneration = 900833007; $latestReadyRevision = 'latestReadyRevision-853854545'; @@ -504,6 +509,7 @@ public function getServiceTest() $expectedResponse->setLastModifier($lastModifier); $expectedResponse->setClient($client); $expectedResponse->setClientVersion($clientVersion); + $expectedResponse->setInvokerIamDisabled($invokerIamDisabled); $expectedResponse->setDefaultUriDisabled($defaultUriDisabled); $expectedResponse->setObservedGeneration($observedGeneration); $expectedResponse->setLatestReadyRevision($latestReadyRevision); @@ -803,6 +809,7 @@ public function updateServiceTest() $lastModifier = 'lastModifier-28366240'; $client = 'client-1357712437'; $clientVersion = 'clientVersion-1506231196'; + $invokerIamDisabled = false; $defaultUriDisabled = false; $observedGeneration = 900833007; $latestReadyRevision = 'latestReadyRevision-853854545'; @@ -820,6 +827,7 @@ public function updateServiceTest() $expectedResponse->setLastModifier($lastModifier); $expectedResponse->setClient($client); $expectedResponse->setClientVersion($clientVersion); + $expectedResponse->setInvokerIamDisabled($invokerIamDisabled); $expectedResponse->setDefaultUriDisabled($defaultUriDisabled); $expectedResponse->setObservedGeneration($observedGeneration); $expectedResponse->setLatestReadyRevision($latestReadyRevision); @@ -961,6 +969,7 @@ public function createServiceAsyncTest() $lastModifier = 'lastModifier-28366240'; $client = 'client-1357712437'; $clientVersion = 'clientVersion-1506231196'; + $invokerIamDisabled = false; $defaultUriDisabled = false; $observedGeneration = 900833007; $latestReadyRevision = 'latestReadyRevision-853854545'; @@ -978,6 +987,7 @@ public function createServiceAsyncTest() $expectedResponse->setLastModifier($lastModifier); $expectedResponse->setClient($client); $expectedResponse->setClientVersion($clientVersion); + $expectedResponse->setInvokerIamDisabled($invokerIamDisabled); $expectedResponse->setDefaultUriDisabled($defaultUriDisabled); $expectedResponse->setObservedGeneration($observedGeneration); $expectedResponse->setLatestReadyRevision($latestReadyRevision); diff --git a/ShoppingMerchantAccounts/VERSION b/ShoppingMerchantAccounts/VERSION index 0ea3a944b399..0d91a54c7d43 100644 --- a/ShoppingMerchantAccounts/VERSION +++ b/ShoppingMerchantAccounts/VERSION @@ -1 +1 @@ -0.2.0 +0.3.0 diff --git a/ShoppingMerchantDataSources/VERSION b/ShoppingMerchantDataSources/VERSION index 0ea3a944b399..0c62199f16ac 100644 --- a/ShoppingMerchantDataSources/VERSION +++ b/ShoppingMerchantDataSources/VERSION @@ -1 +1 @@ -0.2.0 +0.2.1 diff --git a/ShoppingMerchantDataSources/src/V1beta/PrimaryProductDataSource/DefaultRule.php b/ShoppingMerchantDataSources/src/V1beta/PrimaryProductDataSource/DefaultRule.php index bb519afedb51..29179ed03b30 100644 --- a/ShoppingMerchantDataSources/src/V1beta/PrimaryProductDataSource/DefaultRule.php +++ b/ShoppingMerchantDataSources/src/V1beta/PrimaryProductDataSource/DefaultRule.php @@ -24,8 +24,10 @@ class DefaultRule extends \Google\Protobuf\Internal\Message * The list must not be empty. * To link the data source to the default rule, you need to add a * new reference to this list (in sequential order). - * To unlink the data source from the default rule, you need to - * remove the given reference from this list. + * To unlink the data source from the default rule, you need to remove the + * given reference from this list. To create attribute rules that are + * different from the default rule, see [Set up your attribute + * rules](//support.google.com/merchants/answer/14994083). * Changing the order of this list will result in changing the priority of * data sources in the default rule. * For example, providing the following list: [`1001`, `self`] will @@ -51,8 +53,10 @@ class DefaultRule extends \Google\Protobuf\Internal\Message * The list must not be empty. * To link the data source to the default rule, you need to add a * new reference to this list (in sequential order). - * To unlink the data source from the default rule, you need to - * remove the given reference from this list. + * To unlink the data source from the default rule, you need to remove the + * given reference from this list. To create attribute rules that are + * different from the default rule, see [Set up your attribute + * rules](//support.google.com/merchants/answer/14994083). * Changing the order of this list will result in changing the priority of * data sources in the default rule. * For example, providing the following list: [`1001`, `self`] will @@ -74,8 +78,10 @@ public function __construct($data = NULL) { * The list must not be empty. * To link the data source to the default rule, you need to add a * new reference to this list (in sequential order). - * To unlink the data source from the default rule, you need to - * remove the given reference from this list. + * To unlink the data source from the default rule, you need to remove the + * given reference from this list. To create attribute rules that are + * different from the default rule, see [Set up your attribute + * rules](//support.google.com/merchants/answer/14994083). * Changing the order of this list will result in changing the priority of * data sources in the default rule. * For example, providing the following list: [`1001`, `self`] will @@ -99,8 +105,10 @@ public function getTakeFromDataSources() * The list must not be empty. * To link the data source to the default rule, you need to add a * new reference to this list (in sequential order). - * To unlink the data source from the default rule, you need to - * remove the given reference from this list. + * To unlink the data source from the default rule, you need to remove the + * given reference from this list. To create attribute rules that are + * different from the default rule, see [Set up your attribute + * rules](//support.google.com/merchants/answer/14994083). * Changing the order of this list will result in changing the priority of * data sources in the default rule. * For example, providing the following list: [`1001`, `self`] will diff --git a/ShoppingMerchantDataSources/src/V1beta/SupplementalProductDataSource.php b/ShoppingMerchantDataSources/src/V1beta/SupplementalProductDataSource.php index 342d480790b7..9b74dcc9c2bd 100644 --- a/ShoppingMerchantDataSources/src/V1beta/SupplementalProductDataSource.php +++ b/ShoppingMerchantDataSources/src/V1beta/SupplementalProductDataSource.php @@ -9,7 +9,12 @@ use Google\Protobuf\Internal\GPBUtil; /** - * The supplemental data source for local and online products. + * The supplemental data source for local and online products. Supplemental API + * data sources must not have `feedLabel` and `contentLanguage` fields set. You + * can only use supplemental data sources to update existing products. For + * information about creating a supplemental data source, see [Create a + * supplemental data source and link it to the primary data + * source](/merchant/api/guides/data-sources/overview#create-supplemental-data-source). * * Generated from protobuf message google.shopping.merchant.datasources.v1beta.SupplementalProductDataSource */ diff --git a/Spanner/VERSION b/Spanner/VERSION index f288d11142d1..b7844a6ffdcb 100644 --- a/Spanner/VERSION +++ b/Spanner/VERSION @@ -1 +1 @@ -1.85.0 +1.86.0 diff --git a/Spanner/metadata/Admin/Instance/V1/Common.php b/Spanner/metadata/Admin/Instance/V1/Common.php index 4e83339471a1..75e8043d35ca 100644 Binary files a/Spanner/metadata/Admin/Instance/V1/Common.php and b/Spanner/metadata/Admin/Instance/V1/Common.php differ diff --git a/Spanner/metadata/Admin/Instance/V1/SpannerInstanceAdmin.php b/Spanner/metadata/Admin/Instance/V1/SpannerInstanceAdmin.php index 24d377df44a0..1e2e58c40e2c 100644 Binary files a/Spanner/metadata/Admin/Instance/V1/SpannerInstanceAdmin.php and b/Spanner/metadata/Admin/Instance/V1/SpannerInstanceAdmin.php differ diff --git a/Spanner/src/Admin/Instance/V1/AutoscalingConfig.php b/Spanner/src/Admin/Instance/V1/AutoscalingConfig.php index 772557fed2ab..341c101be0f1 100644 --- a/Spanner/src/Admin/Instance/V1/AutoscalingConfig.php +++ b/Spanner/src/Admin/Instance/V1/AutoscalingConfig.php @@ -27,6 +27,19 @@ class AutoscalingConfig extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets autoscaling_targets = 2 [(.google.api.field_behavior) = REQUIRED]; */ private $autoscaling_targets = null; + /** + * Optional. Optional asymmetric autoscaling options. + * Replicas matching the replica selection criteria will be autoscaled + * independently from other replicas. The autoscaler will scale the replicas + * based on the utilization of replicas identified by the replica selection. + * Replica selections should not overlap with each other. + * Other replicas (those do not match any replica selection) will be + * autoscaled together and will have the same compute capacity allocated to + * them. + * + * Generated from protobuf field repeated .google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption asymmetric_autoscaling_options = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $asymmetric_autoscaling_options; /** * Constructor. @@ -38,6 +51,15 @@ class AutoscalingConfig extends \Google\Protobuf\Internal\Message * Required. Autoscaling limits for an instance. * @type \Google\Cloud\Spanner\Admin\Instance\V1\AutoscalingConfig\AutoscalingTargets $autoscaling_targets * Required. The autoscaling targets for an instance. + * @type array<\Google\Cloud\Spanner\Admin\Instance\V1\AutoscalingConfig\AsymmetricAutoscalingOption>|\Google\Protobuf\Internal\RepeatedField $asymmetric_autoscaling_options + * Optional. Optional asymmetric autoscaling options. + * Replicas matching the replica selection criteria will be autoscaled + * independently from other replicas. The autoscaler will scale the replicas + * based on the utilization of replicas identified by the replica selection. + * Replica selections should not overlap with each other. + * Other replicas (those do not match any replica selection) will be + * autoscaled together and will have the same compute capacity allocated to + * them. * } */ public function __construct($data = NULL) { @@ -117,5 +139,45 @@ public function setAutoscalingTargets($var) return $this; } + /** + * Optional. Optional asymmetric autoscaling options. + * Replicas matching the replica selection criteria will be autoscaled + * independently from other replicas. The autoscaler will scale the replicas + * based on the utilization of replicas identified by the replica selection. + * Replica selections should not overlap with each other. + * Other replicas (those do not match any replica selection) will be + * autoscaled together and will have the same compute capacity allocated to + * them. + * + * Generated from protobuf field repeated .google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption asymmetric_autoscaling_options = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAsymmetricAutoscalingOptions() + { + return $this->asymmetric_autoscaling_options; + } + + /** + * Optional. Optional asymmetric autoscaling options. + * Replicas matching the replica selection criteria will be autoscaled + * independently from other replicas. The autoscaler will scale the replicas + * based on the utilization of replicas identified by the replica selection. + * Replica selections should not overlap with each other. + * Other replicas (those do not match any replica selection) will be + * autoscaled together and will have the same compute capacity allocated to + * them. + * + * Generated from protobuf field repeated .google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption asymmetric_autoscaling_options = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\Spanner\Admin\Instance\V1\AutoscalingConfig\AsymmetricAutoscalingOption>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAsymmetricAutoscalingOptions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Spanner\Admin\Instance\V1\AutoscalingConfig\AsymmetricAutoscalingOption::class); + $this->asymmetric_autoscaling_options = $arr; + + return $this; + } + } diff --git a/Spanner/src/Admin/Instance/V1/AutoscalingConfig/AsymmetricAutoscalingOption.php b/Spanner/src/Admin/Instance/V1/AutoscalingConfig/AsymmetricAutoscalingOption.php new file mode 100644 index 000000000000..946771ada7dc --- /dev/null +++ b/Spanner/src/Admin/Instance/V1/AutoscalingConfig/AsymmetricAutoscalingOption.php @@ -0,0 +1,133 @@ +google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption + */ +class AsymmetricAutoscalingOption extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Selects the replicas to which this AsymmetricAutoscalingOption + * applies. Only read-only replicas are supported. + * + * Generated from protobuf field .google.spanner.admin.instance.v1.ReplicaSelection replica_selection = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $replica_selection = null; + /** + * Optional. Overrides applied to the top-level autoscaling configuration + * for the selected replicas. + * + * Generated from protobuf field .google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides overrides = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $overrides = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Spanner\Admin\Instance\V1\ReplicaSelection $replica_selection + * Required. Selects the replicas to which this AsymmetricAutoscalingOption + * applies. Only read-only replicas are supported. + * @type \Google\Cloud\Spanner\Admin\Instance\V1\AutoscalingConfig\AsymmetricAutoscalingOption\AutoscalingConfigOverrides $overrides + * Optional. Overrides applied to the top-level autoscaling configuration + * for the selected replicas. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Spanner\Admin\Instance\V1\SpannerInstanceAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Required. Selects the replicas to which this AsymmetricAutoscalingOption + * applies. Only read-only replicas are supported. + * + * Generated from protobuf field .google.spanner.admin.instance.v1.ReplicaSelection replica_selection = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Spanner\Admin\Instance\V1\ReplicaSelection|null + */ + public function getReplicaSelection() + { + return $this->replica_selection; + } + + public function hasReplicaSelection() + { + return isset($this->replica_selection); + } + + public function clearReplicaSelection() + { + unset($this->replica_selection); + } + + /** + * Required. Selects the replicas to which this AsymmetricAutoscalingOption + * applies. Only read-only replicas are supported. + * + * Generated from protobuf field .google.spanner.admin.instance.v1.ReplicaSelection replica_selection = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Spanner\Admin\Instance\V1\ReplicaSelection $var + * @return $this + */ + public function setReplicaSelection($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Spanner\Admin\Instance\V1\ReplicaSelection::class); + $this->replica_selection = $var; + + return $this; + } + + /** + * Optional. Overrides applied to the top-level autoscaling configuration + * for the selected replicas. + * + * Generated from protobuf field .google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides overrides = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Spanner\Admin\Instance\V1\AutoscalingConfig\AsymmetricAutoscalingOption\AutoscalingConfigOverrides|null + */ + public function getOverrides() + { + return $this->overrides; + } + + public function hasOverrides() + { + return isset($this->overrides); + } + + public function clearOverrides() + { + unset($this->overrides); + } + + /** + * Optional. Overrides applied to the top-level autoscaling configuration + * for the selected replicas. + * + * Generated from protobuf field .google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides overrides = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Spanner\Admin\Instance\V1\AutoscalingConfig\AsymmetricAutoscalingOption\AutoscalingConfigOverrides $var + * @return $this + */ + public function setOverrides($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Spanner\Admin\Instance\V1\AutoscalingConfig\AsymmetricAutoscalingOption\AutoscalingConfigOverrides::class); + $this->overrides = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(AsymmetricAutoscalingOption::class, \Google\Cloud\Spanner\Admin\Instance\V1\AutoscalingConfig_AsymmetricAutoscalingOption::class); + diff --git a/Spanner/src/Admin/Instance/V1/AutoscalingConfig/AsymmetricAutoscalingOption/AutoscalingConfigOverrides.php b/Spanner/src/Admin/Instance/V1/AutoscalingConfig/AsymmetricAutoscalingOption/AutoscalingConfigOverrides.php new file mode 100644 index 000000000000..584720806a65 --- /dev/null +++ b/Spanner/src/Admin/Instance/V1/AutoscalingConfig/AsymmetricAutoscalingOption/AutoscalingConfigOverrides.php @@ -0,0 +1,129 @@ +google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides + */ +class AutoscalingConfigOverrides extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. If specified, overrides the min/max limit in the top-level + * autoscaling configuration for the selected replicas. + * + * Generated from protobuf field .google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits autoscaling_limits = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $autoscaling_limits = null; + /** + * Optional. If specified, overrides the autoscaling target + * high_priority_cpu_utilization_percent in the top-level autoscaling + * configuration for the selected replicas. + * + * Generated from protobuf field int32 autoscaling_target_high_priority_cpu_utilization_percent = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $autoscaling_target_high_priority_cpu_utilization_percent = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Spanner\Admin\Instance\V1\AutoscalingConfig\AutoscalingLimits $autoscaling_limits + * Optional. If specified, overrides the min/max limit in the top-level + * autoscaling configuration for the selected replicas. + * @type int $autoscaling_target_high_priority_cpu_utilization_percent + * Optional. If specified, overrides the autoscaling target + * high_priority_cpu_utilization_percent in the top-level autoscaling + * configuration for the selected replicas. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Spanner\Admin\Instance\V1\SpannerInstanceAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Optional. If specified, overrides the min/max limit in the top-level + * autoscaling configuration for the selected replicas. + * + * Generated from protobuf field .google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits autoscaling_limits = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Spanner\Admin\Instance\V1\AutoscalingConfig\AutoscalingLimits|null + */ + public function getAutoscalingLimits() + { + return $this->autoscaling_limits; + } + + public function hasAutoscalingLimits() + { + return isset($this->autoscaling_limits); + } + + public function clearAutoscalingLimits() + { + unset($this->autoscaling_limits); + } + + /** + * Optional. If specified, overrides the min/max limit in the top-level + * autoscaling configuration for the selected replicas. + * + * Generated from protobuf field .google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits autoscaling_limits = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Spanner\Admin\Instance\V1\AutoscalingConfig\AutoscalingLimits $var + * @return $this + */ + public function setAutoscalingLimits($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Spanner\Admin\Instance\V1\AutoscalingConfig\AutoscalingLimits::class); + $this->autoscaling_limits = $var; + + return $this; + } + + /** + * Optional. If specified, overrides the autoscaling target + * high_priority_cpu_utilization_percent in the top-level autoscaling + * configuration for the selected replicas. + * + * Generated from protobuf field int32 autoscaling_target_high_priority_cpu_utilization_percent = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getAutoscalingTargetHighPriorityCpuUtilizationPercent() + { + return $this->autoscaling_target_high_priority_cpu_utilization_percent; + } + + /** + * Optional. If specified, overrides the autoscaling target + * high_priority_cpu_utilization_percent in the top-level autoscaling + * configuration for the selected replicas. + * + * Generated from protobuf field int32 autoscaling_target_high_priority_cpu_utilization_percent = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setAutoscalingTargetHighPriorityCpuUtilizationPercent($var) + { + GPBUtil::checkInt32($var); + $this->autoscaling_target_high_priority_cpu_utilization_percent = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(AutoscalingConfigOverrides::class, \Google\Cloud\Spanner\Admin\Instance\V1\AutoscalingConfig_AsymmetricAutoscalingOption_AutoscalingConfigOverrides::class); + diff --git a/Spanner/src/Admin/Instance/V1/Instance.php b/Spanner/src/Admin/Instance/V1/Instance.php index 4d2fffe9f4f1..f16c7ca56c88 100644 --- a/Spanner/src/Admin/Instance/V1/Instance.php +++ b/Spanner/src/Admin/Instance/V1/Instance.php @@ -41,33 +41,53 @@ class Instance extends \Google\Protobuf\Internal\Message */ private $display_name = ''; /** - * The number of nodes allocated to this instance. At most one of either - * node_count or processing_units should be present in the message. - * Users can set the node_count field to specify the target number of nodes + * The number of nodes allocated to this instance. At most, one of either + * `node_count` or `processing_units` should be present in the message. + * Users can set the `node_count` field to specify the target number of nodes * allocated to the instance. - * This may be zero in API responses for instances that are not yet in state - * `READY`. - * See [the - * documentation](https://cloud.google.com/spanner/docs/compute-capacity) - * for more information about nodes and processing units. + * If autoscaling is enabled, `node_count` is treated as an `OUTPUT_ONLY` + * field and reflects the current number of nodes allocated to the instance. + * This might be zero in API responses for instances that are not yet in the + * `READY` state. + * If the instance has varying node count across replicas (achieved by + * setting asymmetric_autoscaling_options in autoscaling config), the + * node_count here is the maximum node count across all replicas. + * For more information, see + * [Compute capacity, nodes, and processing + * units](https://cloud.google.com/spanner/docs/compute-capacity). * * Generated from protobuf field int32 node_count = 5; */ private $node_count = 0; /** - * The number of processing units allocated to this instance. At most one of - * processing_units or node_count should be present in the message. - * Users can set the processing_units field to specify the target number of + * The number of processing units allocated to this instance. At most, one of + * either `processing_units` or `node_count` should be present in the message. + * Users can set the `processing_units` field to specify the target number of * processing units allocated to the instance. - * This may be zero in API responses for instances that are not yet in state - * `READY`. - * See [the - * documentation](https://cloud.google.com/spanner/docs/compute-capacity) - * for more information about nodes and processing units. + * If autoscaling is enabled, `processing_units` is treated as an + * `OUTPUT_ONLY` field and reflects the current number of processing units + * allocated to the instance. + * This might be zero in API responses for instances that are not yet in the + * `READY` state. + * If the instance has varying processing units per replica + * (achieved by setting asymmetric_autoscaling_options in autoscaling config), + * the processing_units here is the maximum processing units across all + * replicas. + * For more information, see + * [Compute capacity, nodes and processing + * units](https://cloud.google.com/spanner/docs/compute-capacity). * * Generated from protobuf field int32 processing_units = 9; */ private $processing_units = 0; + /** + * Output only. Lists the compute capacity per ReplicaSelection. A replica + * selection identifies a set of replicas with common properties. Replicas + * identified by a ReplicaSelection are scaled with the same compute capacity. + * + * Generated from protobuf field repeated .google.spanner.admin.instance.v1.ReplicaComputeCapacity replica_compute_capacity = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $replica_compute_capacity; /** * Optional. The autoscaling configuration. Autoscaling is enabled if this * field is set. When autoscaling is enabled, node_count and processing_units @@ -155,25 +175,41 @@ class Instance extends \Google\Protobuf\Internal\Message * Required. The descriptive name for this instance as it appears in UIs. * Must be unique per project and between 4 and 30 characters in length. * @type int $node_count - * The number of nodes allocated to this instance. At most one of either - * node_count or processing_units should be present in the message. - * Users can set the node_count field to specify the target number of nodes + * The number of nodes allocated to this instance. At most, one of either + * `node_count` or `processing_units` should be present in the message. + * Users can set the `node_count` field to specify the target number of nodes * allocated to the instance. - * This may be zero in API responses for instances that are not yet in state - * `READY`. - * See [the - * documentation](https://cloud.google.com/spanner/docs/compute-capacity) - * for more information about nodes and processing units. + * If autoscaling is enabled, `node_count` is treated as an `OUTPUT_ONLY` + * field and reflects the current number of nodes allocated to the instance. + * This might be zero in API responses for instances that are not yet in the + * `READY` state. + * If the instance has varying node count across replicas (achieved by + * setting asymmetric_autoscaling_options in autoscaling config), the + * node_count here is the maximum node count across all replicas. + * For more information, see + * [Compute capacity, nodes, and processing + * units](https://cloud.google.com/spanner/docs/compute-capacity). * @type int $processing_units - * The number of processing units allocated to this instance. At most one of - * processing_units or node_count should be present in the message. - * Users can set the processing_units field to specify the target number of + * The number of processing units allocated to this instance. At most, one of + * either `processing_units` or `node_count` should be present in the message. + * Users can set the `processing_units` field to specify the target number of * processing units allocated to the instance. - * This may be zero in API responses for instances that are not yet in state - * `READY`. - * See [the - * documentation](https://cloud.google.com/spanner/docs/compute-capacity) - * for more information about nodes and processing units. + * If autoscaling is enabled, `processing_units` is treated as an + * `OUTPUT_ONLY` field and reflects the current number of processing units + * allocated to the instance. + * This might be zero in API responses for instances that are not yet in the + * `READY` state. + * If the instance has varying processing units per replica + * (achieved by setting asymmetric_autoscaling_options in autoscaling config), + * the processing_units here is the maximum processing units across all + * replicas. + * For more information, see + * [Compute capacity, nodes and processing + * units](https://cloud.google.com/spanner/docs/compute-capacity). + * @type array<\Google\Cloud\Spanner\Admin\Instance\V1\ReplicaComputeCapacity>|\Google\Protobuf\Internal\RepeatedField $replica_compute_capacity + * Output only. Lists the compute capacity per ReplicaSelection. A replica + * selection identifies a set of replicas with common properties. Replicas + * identified by a ReplicaSelection are scaled with the same compute capacity. * @type \Google\Cloud\Spanner\Admin\Instance\V1\AutoscalingConfig $autoscaling_config * Optional. The autoscaling configuration. Autoscaling is enabled if this * field is set. When autoscaling is enabled, node_count and processing_units @@ -312,15 +348,20 @@ public function setDisplayName($var) } /** - * The number of nodes allocated to this instance. At most one of either - * node_count or processing_units should be present in the message. - * Users can set the node_count field to specify the target number of nodes + * The number of nodes allocated to this instance. At most, one of either + * `node_count` or `processing_units` should be present in the message. + * Users can set the `node_count` field to specify the target number of nodes * allocated to the instance. - * This may be zero in API responses for instances that are not yet in state - * `READY`. - * See [the - * documentation](https://cloud.google.com/spanner/docs/compute-capacity) - * for more information about nodes and processing units. + * If autoscaling is enabled, `node_count` is treated as an `OUTPUT_ONLY` + * field and reflects the current number of nodes allocated to the instance. + * This might be zero in API responses for instances that are not yet in the + * `READY` state. + * If the instance has varying node count across replicas (achieved by + * setting asymmetric_autoscaling_options in autoscaling config), the + * node_count here is the maximum node count across all replicas. + * For more information, see + * [Compute capacity, nodes, and processing + * units](https://cloud.google.com/spanner/docs/compute-capacity). * * Generated from protobuf field int32 node_count = 5; * @return int @@ -331,15 +372,20 @@ public function getNodeCount() } /** - * The number of nodes allocated to this instance. At most one of either - * node_count or processing_units should be present in the message. - * Users can set the node_count field to specify the target number of nodes + * The number of nodes allocated to this instance. At most, one of either + * `node_count` or `processing_units` should be present in the message. + * Users can set the `node_count` field to specify the target number of nodes * allocated to the instance. - * This may be zero in API responses for instances that are not yet in state - * `READY`. - * See [the - * documentation](https://cloud.google.com/spanner/docs/compute-capacity) - * for more information about nodes and processing units. + * If autoscaling is enabled, `node_count` is treated as an `OUTPUT_ONLY` + * field and reflects the current number of nodes allocated to the instance. + * This might be zero in API responses for instances that are not yet in the + * `READY` state. + * If the instance has varying node count across replicas (achieved by + * setting asymmetric_autoscaling_options in autoscaling config), the + * node_count here is the maximum node count across all replicas. + * For more information, see + * [Compute capacity, nodes, and processing + * units](https://cloud.google.com/spanner/docs/compute-capacity). * * Generated from protobuf field int32 node_count = 5; * @param int $var @@ -354,15 +400,22 @@ public function setNodeCount($var) } /** - * The number of processing units allocated to this instance. At most one of - * processing_units or node_count should be present in the message. - * Users can set the processing_units field to specify the target number of + * The number of processing units allocated to this instance. At most, one of + * either `processing_units` or `node_count` should be present in the message. + * Users can set the `processing_units` field to specify the target number of * processing units allocated to the instance. - * This may be zero in API responses for instances that are not yet in state - * `READY`. - * See [the - * documentation](https://cloud.google.com/spanner/docs/compute-capacity) - * for more information about nodes and processing units. + * If autoscaling is enabled, `processing_units` is treated as an + * `OUTPUT_ONLY` field and reflects the current number of processing units + * allocated to the instance. + * This might be zero in API responses for instances that are not yet in the + * `READY` state. + * If the instance has varying processing units per replica + * (achieved by setting asymmetric_autoscaling_options in autoscaling config), + * the processing_units here is the maximum processing units across all + * replicas. + * For more information, see + * [Compute capacity, nodes and processing + * units](https://cloud.google.com/spanner/docs/compute-capacity). * * Generated from protobuf field int32 processing_units = 9; * @return int @@ -373,15 +426,22 @@ public function getProcessingUnits() } /** - * The number of processing units allocated to this instance. At most one of - * processing_units or node_count should be present in the message. - * Users can set the processing_units field to specify the target number of + * The number of processing units allocated to this instance. At most, one of + * either `processing_units` or `node_count` should be present in the message. + * Users can set the `processing_units` field to specify the target number of * processing units allocated to the instance. - * This may be zero in API responses for instances that are not yet in state - * `READY`. - * See [the - * documentation](https://cloud.google.com/spanner/docs/compute-capacity) - * for more information about nodes and processing units. + * If autoscaling is enabled, `processing_units` is treated as an + * `OUTPUT_ONLY` field and reflects the current number of processing units + * allocated to the instance. + * This might be zero in API responses for instances that are not yet in the + * `READY` state. + * If the instance has varying processing units per replica + * (achieved by setting asymmetric_autoscaling_options in autoscaling config), + * the processing_units here is the maximum processing units across all + * replicas. + * For more information, see + * [Compute capacity, nodes and processing + * units](https://cloud.google.com/spanner/docs/compute-capacity). * * Generated from protobuf field int32 processing_units = 9; * @param int $var @@ -395,6 +455,36 @@ public function setProcessingUnits($var) return $this; } + /** + * Output only. Lists the compute capacity per ReplicaSelection. A replica + * selection identifies a set of replicas with common properties. Replicas + * identified by a ReplicaSelection are scaled with the same compute capacity. + * + * Generated from protobuf field repeated .google.spanner.admin.instance.v1.ReplicaComputeCapacity replica_compute_capacity = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getReplicaComputeCapacity() + { + return $this->replica_compute_capacity; + } + + /** + * Output only. Lists the compute capacity per ReplicaSelection. A replica + * selection identifies a set of replicas with common properties. Replicas + * identified by a ReplicaSelection are scaled with the same compute capacity. + * + * Generated from protobuf field repeated .google.spanner.admin.instance.v1.ReplicaComputeCapacity replica_compute_capacity = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Cloud\Spanner\Admin\Instance\V1\ReplicaComputeCapacity>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setReplicaComputeCapacity($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Spanner\Admin\Instance\V1\ReplicaComputeCapacity::class); + $this->replica_compute_capacity = $arr; + + return $this; + } + /** * Optional. The autoscaling configuration. Autoscaling is enabled if this * field is set. When autoscaling is enabled, node_count and processing_units diff --git a/Spanner/src/Admin/Instance/V1/ReplicaComputeCapacity.php b/Spanner/src/Admin/Instance/V1/ReplicaComputeCapacity.php new file mode 100644 index 000000000000..a4e880f0b6c3 --- /dev/null +++ b/Spanner/src/Admin/Instance/V1/ReplicaComputeCapacity.php @@ -0,0 +1,169 @@ +google.spanner.admin.instance.v1.ReplicaComputeCapacity + */ +class ReplicaComputeCapacity extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Identifies replicas by specified properties. + * All replicas in the selection have the same amount of compute capacity. + * + * Generated from protobuf field .google.spanner.admin.instance.v1.ReplicaSelection replica_selection = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $replica_selection = null; + protected $compute_capacity; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Spanner\Admin\Instance\V1\ReplicaSelection $replica_selection + * Required. Identifies replicas by specified properties. + * All replicas in the selection have the same amount of compute capacity. + * @type int $node_count + * The number of nodes allocated to each replica. + * This may be zero in API responses for instances that are not yet in + * state `READY`. + * @type int $processing_units + * The number of processing units allocated to each replica. + * This may be zero in API responses for instances that are not yet in + * state `READY`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Spanner\Admin\Instance\V1\SpannerInstanceAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Required. Identifies replicas by specified properties. + * All replicas in the selection have the same amount of compute capacity. + * + * Generated from protobuf field .google.spanner.admin.instance.v1.ReplicaSelection replica_selection = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Spanner\Admin\Instance\V1\ReplicaSelection|null + */ + public function getReplicaSelection() + { + return $this->replica_selection; + } + + public function hasReplicaSelection() + { + return isset($this->replica_selection); + } + + public function clearReplicaSelection() + { + unset($this->replica_selection); + } + + /** + * Required. Identifies replicas by specified properties. + * All replicas in the selection have the same amount of compute capacity. + * + * Generated from protobuf field .google.spanner.admin.instance.v1.ReplicaSelection replica_selection = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Spanner\Admin\Instance\V1\ReplicaSelection $var + * @return $this + */ + public function setReplicaSelection($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Spanner\Admin\Instance\V1\ReplicaSelection::class); + $this->replica_selection = $var; + + return $this; + } + + /** + * The number of nodes allocated to each replica. + * This may be zero in API responses for instances that are not yet in + * state `READY`. + * + * Generated from protobuf field int32 node_count = 2; + * @return int + */ + public function getNodeCount() + { + return $this->readOneof(2); + } + + public function hasNodeCount() + { + return $this->hasOneof(2); + } + + /** + * The number of nodes allocated to each replica. + * This may be zero in API responses for instances that are not yet in + * state `READY`. + * + * Generated from protobuf field int32 node_count = 2; + * @param int $var + * @return $this + */ + public function setNodeCount($var) + { + GPBUtil::checkInt32($var); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * The number of processing units allocated to each replica. + * This may be zero in API responses for instances that are not yet in + * state `READY`. + * + * Generated from protobuf field int32 processing_units = 3; + * @return int + */ + public function getProcessingUnits() + { + return $this->readOneof(3); + } + + public function hasProcessingUnits() + { + return $this->hasOneof(3); + } + + /** + * The number of processing units allocated to each replica. + * This may be zero in API responses for instances that are not yet in + * state `READY`. + * + * Generated from protobuf field int32 processing_units = 3; + * @param int $var + * @return $this + */ + public function setProcessingUnits($var) + { + GPBUtil::checkInt32($var); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * @return string + */ + public function getComputeCapacity() + { + return $this->whichOneof("compute_capacity"); + } + +} + diff --git a/Spanner/src/Admin/Instance/V1/ReplicaSelection.php b/Spanner/src/Admin/Instance/V1/ReplicaSelection.php new file mode 100644 index 000000000000..556dad423abf --- /dev/null +++ b/Spanner/src/Admin/Instance/V1/ReplicaSelection.php @@ -0,0 +1,67 @@ +google.spanner.admin.instance.v1.ReplicaSelection + */ +class ReplicaSelection extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the location of the replicas (e.g., "us-central1"). + * + * Generated from protobuf field string location = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $location = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $location + * Required. Name of the location of the replicas (e.g., "us-central1"). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Spanner\Admin\Instance\V1\Common::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the location of the replicas (e.g., "us-central1"). + * + * Generated from protobuf field string location = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getLocation() + { + return $this->location; + } + + /** + * Required. Name of the location of the replicas (e.g., "us-central1"). + * + * Generated from protobuf field string location = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setLocation($var) + { + GPBUtil::checkString($var, True); + $this->location = $var; + + return $this; + } + +} + diff --git a/Spanner/src/SpannerClient.php b/Spanner/src/SpannerClient.php index 99e398f1fe27..5d273ed4e707 100644 --- a/Spanner/src/SpannerClient.php +++ b/Spanner/src/SpannerClient.php @@ -117,7 +117,7 @@ class SpannerClient use LROTrait; use ValidateTrait; - const VERSION = '1.85.0'; + const VERSION = '1.86.0'; const FULL_CONTROL_SCOPE = 'https://www.googleapis.com/auth/spanner.data'; const ADMIN_SCOPE = 'https://www.googleapis.com/auth/spanner.admin'; diff --git a/Storage/VERSION b/Storage/VERSION index b978278f05f5..3987c472943e 100644 --- a/Storage/VERSION +++ b/Storage/VERSION @@ -1 +1 @@ -1.43.0 +1.43.1 diff --git a/Storage/src/StorageClient.php b/Storage/src/StorageClient.php index ba3020d2c260..2eef4fb0f9f1 100644 --- a/Storage/src/StorageClient.php +++ b/Storage/src/StorageClient.php @@ -47,7 +47,7 @@ class StorageClient use ArrayTrait; use ClientTrait; - const VERSION = '1.43.0'; + const VERSION = '1.43.1'; const FULL_CONTROL_SCOPE = 'https://www.googleapis.com/auth/devstorage.full_control'; const READ_ONLY_SCOPE = 'https://www.googleapis.com/auth/devstorage.read_only'; diff --git a/Storage/tests/System/ManageAclTest.php b/Storage/tests/System/ManageAclTest.php index b3fedf4f9c7d..fdaf2097887b 100644 --- a/Storage/tests/System/ManageAclTest.php +++ b/Storage/tests/System/ManageAclTest.php @@ -21,8 +21,12 @@ use Google\Cloud\Core\Exception\NotFoundException; /** + * These tests are marked flakey because they often throw RateLimitExceeded and + * ServiceException. + * * @group storage * @group storage-acl + * @group flakey */ class ManageAclTest extends StorageTestCase { @@ -32,12 +36,6 @@ public function testManageBucketAcl() $this->assertAcl(self::$bucket->acl(), $kind); } - /** - * This test is marked flakey because it often throws a RateLimitExceeded - * error - * - * @group flakey - */ public function testManageDefaultObjectAcl() { $kind = 'storage#objectAccessControl'; diff --git a/Storage/tests/System/StorageTestCase.php b/Storage/tests/System/StorageTestCase.php index db13a7495ee6..161db8b211be 100644 --- a/Storage/tests/System/StorageTestCase.php +++ b/Storage/tests/System/StorageTestCase.php @@ -54,11 +54,6 @@ public static function setUpTestFixtures(): void self::$unauthenticatedClient = new StorageClient([ 'credentialsFetcher' => new AnonymousCredentials() ]); - self::$universeDomainClient = new StorageClient([ - 'keyFilePath' => getenv('TEST_UNIVERSE_DOMAIN_CREDENTIAL'), - 'projectId' => getenv('TEST_UNIVERSE_PROJECT_ID'), - 'universeDomain' => getenv('TEST_UNIVERSE_DOMAIN') - ]); self::$pubsubClient = new PubSubClient($config); self::$mainBucketName = getenv('BUCKET') ?: uniqid(self::TESTING_PREFIX); diff --git a/Storage/tests/System/UniverseDomainTest.php b/Storage/tests/System/UniverseDomainTest.php index 3f93e13e30e0..e8c559566e8a 100644 --- a/Storage/tests/System/UniverseDomainTest.php +++ b/Storage/tests/System/UniverseDomainTest.php @@ -17,52 +17,92 @@ namespace Google\Cloud\Storage\Tests\System; +use Google\Cloud\Core\Testing\System\SystemTestCase; use Google\Cloud\Storage\Bucket; +use Google\Cloud\Storage\StorageClient; -class UniverseDomainTest extends StorageTestCase +class UniverseDomainTest extends SystemTestCase { - private static $universeDomainBucket; - private static $bucketName; + private static $bucket; + private static $client; + /** - * Test creating a bucket with universe domain credentials + * @beforeClass + */ + public static function setUpTestFixtures(): void + { + if (!$keyFilePath = getenv('GOOGLE_CLOUD_PHP_TESTS_UNIVERSE_DOMAIN_KEY_PATH')) { + self::markTestSkipped('Set GOOGLE_CLOUD_PHP_TESTS_UNIVERSE_DOMAIN_KEY_PATH to run system tests'); + } + + $credentials = json_decode(file_get_contents($keyFilePath), true); + if (!isset($credentials['universe_domain'])) { + throw new \Exception('The provided key file does not contain universe domain credentials'); + } + + self::$client = new StorageClient([ + 'keyFilePath' => $keyFilePath, + 'projectId' => $credentials['project_id'] ?? null, + 'universeDomain' => $credentials['universe_domain'] ?? null + ]); + } + + /** + * Test creating a bucket with universe domain credentials */ public function testCreateBucketWithUniverseDomain() { - self::$bucketName = uniqid(self::TESTING_PREFIX); - self::$universeDomainBucket = self::createBucket( - self::$universeDomainClient, - self::$bucketName, - [ - 'location' => getenv('TEST_UNIVERSE_LOCATION') - ] + if (!$location = getenv('GOOGLE_CLOUD_PHP_TESTS_UNIVERSE_DOMAIN_LOCATION')) { + $this->markTestSkipped('Set GOOGLE_CLOUD_PHP_TESTS_UNIVERSE_DOMAIN_LOCATION to run system tests'); + } + $bucketName = uniqid(StorageTestCase::TESTING_PREFIX); + self::$bucket = self::createBucket( + self::$client, + $bucketName, + ['location' => $location] ); - $this->assertEquals(self::$bucketName, self::$universeDomainBucket->info()['name']); + $this->assertEquals($bucketName, self::$bucket->info()['name']); } /** - * Test uploading and retrieving objects to a bucket using universe domain credentials. + * Test uploading and retrieving objects to a bucket using universe domain credentials. + * + * @depends testCreateBucketWithUniverseDomain */ public function testListsObjectsWithUniverseDomain() { $foundObjects = []; $objectsToCreate = [ - uniqid(self::TESTING_PREFIX), - uniqid(self::TESTING_PREFIX) + uniqid(StorageTestCase::TESTING_PREFIX), + uniqid(StorageTestCase::TESTING_PREFIX) ]; foreach ($objectsToCreate as $objectToCreate) { - self::$universeDomainBucket->upload('data', ['name' => $objectToCreate]); + self::$bucket->upload('data', ['name' => $objectToCreate]); } - $objects = self::$universeDomainBucket->objects(['prefix' => self::TESTING_PREFIX]); + $objects = self::$bucket->objects(['prefix' => StorageTestCase::TESTING_PREFIX]); + + $foundObjects = array_filter( + iterator_to_array($objects), + fn ($object) => in_array($object->name(), $objectsToCreate) + ); - foreach ($objects as $object) { - foreach ($objectsToCreate as $key => $objectToCreate) { - if ($object->name() === $objectToCreate) { - $foundObjects[$key] = $object->name(); - } - } + $this->assertCount(2, $foundObjects); + } + /** + * Test uploading and retrieving objects to a bucket using universe domain credentials. + * + * @depends testCreateBucketWithUniverseDomain + */ + public function testDeleteBucketWithUniverseDomain() + { + foreach (self::$bucket->objects() as $object) { + $object->delete(); } - $this->assertEquals($objectsToCreate, $foundObjects); + self::$bucket->delete(); + $this->assertFalse(self::$bucket->exists()); + $buckets = self::$client->buckets(['prefix' => self::$bucket->name()]); + $this->assertCount(0, iterator_to_array($buckets)); } } diff --git a/composer.json b/composer.json index 7c0e7a4e27f6..cef449693376 100644 --- a/composer.json +++ b/composer.json @@ -71,12 +71,12 @@ "google/ads-marketingplatform-admin": "0.1.0", "google/analytics-admin": "0.24.0", "google/analytics-data": "0.19.0", - "google/apps-chat": "0.5.0", + "google/apps-chat": "0.6.0", "google/apps-events-subscriptions": "0.1.3", "google/apps-meet": "0.2.3", "google/cloud-access-approval": "2.0.1", "google/cloud-advisorynotifications": "1.0.0", - "google/cloud-ai-platform": "1.7.0", + "google/cloud-ai-platform": "1.8.0", "google/cloud-alloydb": "1.0.0", "google/cloud-api-gateway": "2.0.0", "google/cloud-api-keys": "1.0.0", @@ -91,7 +91,7 @@ "google/cloud-automl": "2.0.0", "google/cloud-backupdr": "0.3.0", "google/cloud-bare-metal-solution": "1.0.0", - "google/cloud-batch": "1.1.0", + "google/cloud-batch": "1.1.1", "google/cloud-beyondcorp-appconnections": "1.0.0", "google/cloud-beyondcorp-appconnectors": "1.0.0", "google/cloud-beyondcorp-appgateways": "1.0.0", @@ -105,14 +105,14 @@ "google/cloud-bigquery-migration": "1.1.0", "google/cloud-bigquery-reservation": "2.0.1", "google/cloud-bigquery-storage": "2.0.0", - "google/cloud-bigquerydatatransfer": "2.0.0", + "google/cloud-bigquerydatatransfer": "2.1.0", "google/cloud-bigtable": "2.5.0", "google/cloud-billing": "2.0.0", "google/cloud-billing-budgets": "2.0.1", "google/cloud-binary-authorization": "1.0.1", "google/cloud-build": "1.0.0", "google/cloud-certificate-manager": "1.0.0", - "google/cloud-channel": "2.0.0", + "google/cloud-channel": "2.1.0", "google/cloud-cloudcontrolspartner": "0.2.0", "google/cloud-commerce-consumer-procurement": "1.0.0", "google/cloud-common-protos": "0.6.0", @@ -185,7 +185,7 @@ "google/cloud-org-policy": "1.1.0", "google/cloud-osconfig": "2.0.0", "google/cloud-oslogin": "2.0.1", - "google/cloud-parallelstore": "0.6.0", + "google/cloud-parallelstore": "0.6.1", "google/cloud-policy-troubleshooter": "2.0.1", "google/cloud-policysimulator": "1.0.0", "google/cloud-policytroubleshooter-iam": "0.2.6", @@ -198,12 +198,12 @@ "google/cloud-recaptcha-enterprise": "1.15.0", "google/cloud-recommendations-ai": "0.7.5", "google/cloud-recommender": "2.0.1", - "google/cloud-redis": "2.1.0", + "google/cloud-redis": "2.1.1", "google/cloud-redis-cluster": "0.3.0", "google/cloud-resource-manager": "1.0.0", "google/cloud-resource-settings": "2.0.1", "google/cloud-retail": "2.0.0", - "google/cloud-run": "1.1.0", + "google/cloud-run": "1.2.0", "google/cloud-scheduler": "2.0.0", "google/cloud-secret-manager": "1.15.2", "google/cloud-securesourcemanager": "1.1.0", @@ -217,10 +217,10 @@ "google/cloud-service-usage": "2.0.0", "google/cloud-servicehealth": "0.1.6", "google/cloud-shell": "2.0.1", - "google/cloud-spanner": "1.85.0", + "google/cloud-spanner": "1.86.0", "google/cloud-speech": "1.19.0", "google/cloud-sql-admin": "1.2.0", - "google/cloud-storage": "1.43.0", + "google/cloud-storage": "1.43.1", "google/cloud-storage-control": "1.0.0", "google/cloud-storage-transfer": "2.0.0", "google/cloud-storageinsights": "1.0.0", @@ -252,9 +252,9 @@ "google/maps-routeoptimization": "0.3.0", "google/shopping-common-protos": "0.4.0", "google/shopping-css": "0.2.9", - "google/shopping-merchant-accounts": "0.2.0", + "google/shopping-merchant-accounts": "0.3.0", "google/shopping-merchant-conversions": "0.1.2", - "google/shopping-merchant-datasources": "0.2.0", + "google/shopping-merchant-datasources": "0.2.1", "google/shopping-merchant-inventories": "0.5.0", "google/shopping-merchant-lfp": "0.1.0", "google/shopping-merchant-notifications": "0.1.0", diff --git a/dev/src/Command/ComponentInfoCommand.php b/dev/src/Command/ComponentInfoCommand.php index 82654e0184c6..a3984163cdb8 100644 --- a/dev/src/Command/ComponentInfoCommand.php +++ b/dev/src/Command/ComponentInfoCommand.php @@ -276,7 +276,7 @@ private function parseFilters(string $filterString): array { $filters = []; foreach (array_filter(explode(',', $filterString)) as $filter) { - if (!preg_match('/^(\w+?)(!~=|~=|!=|>=|<=|=|<|>)(.+)$/', $filter, $matches)) { + if (!preg_match('/^(\w+?)(!~=|~=|!=|>=|<=|=|<|>|\^=)(.+)$/', $filter, $matches)) { throw new \InvalidArgumentException(sprintf('Invalid filter: %s', $filter)); } $filters[] = [$matches[1], $matches[3], $matches[2]]; @@ -303,6 +303,7 @@ private function filterRow(array $row, array $filters): bool '!=' => ($row[$field] !== $value), '~=' => strpos($row[$field], $value) !== false, '!~=' => strpos($row[$field], $value) === false, + '^=' => str_starts_with($row[$field], $value) !== false, '>','<','>=','<=' => match($field) { 'downloads' => version_compare( str_replace(',' , '', $row[$field]),