diff --git a/.repo-metadata-full.json b/.repo-metadata-full.json index 49b3491111d7..722d49d27604 100644 --- a/.repo-metadata-full.json +++ b/.repo-metadata-full.json @@ -148,7 +148,7 @@ "AssuredWorkloads": { "language": "php", "distribution_name": "google/cloud-assured-workloads", - "release_level": "preview", + "release_level": "stable", "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-assured-workloads/latest", "library_type": "GAPIC_AUTO", "api_shortname": "assuredworkloads" diff --git a/AssuredWorkloads/.OwlBot.yaml b/AssuredWorkloads/.OwlBot.yaml index dd576b772491..503f2d9e7e46 100644 --- a/AssuredWorkloads/.OwlBot.yaml +++ b/AssuredWorkloads/.OwlBot.yaml @@ -1,4 +1,4 @@ deep-copy-regex: - - source: /google/cloud/assuredworkloads/(v1|v1beta1)/.*-php/(.*) + - source: /google/cloud/assuredworkloads/(v1)/.*-php/(.*) dest: /owl-bot-staging/AssuredWorkloads/$1/$2 api-name: AssuredWorkloads diff --git a/AssuredWorkloads/README.md b/AssuredWorkloads/README.md index 019cd2dfec23..2ba6957ef361 100644 --- a/AssuredWorkloads/README.md +++ b/AssuredWorkloads/README.md @@ -48,9 +48,8 @@ foreach ($workloads as $workload) { ### Version -This component is considered beta. As such, it should be expected to be mostly -stable and we're working towards a release candidate. We will address issues -and requests with a higher priority. +This component is considered GA (generally available). As such, it will not introduce backwards-incompatible changes in +any minor or patch releases. We will address issues and requests with the highest priority. ### Next Steps diff --git a/AssuredWorkloads/metadata/V1Beta1/Assuredworkloads.php b/AssuredWorkloads/metadata/V1Beta1/Assuredworkloads.php deleted file mode 100644 index 6ba11ddfa4af..000000000000 Binary files a/AssuredWorkloads/metadata/V1Beta1/Assuredworkloads.php and /dev/null differ diff --git a/AssuredWorkloads/metadata/V1Beta1/AssuredworkloadsService.php b/AssuredWorkloads/metadata/V1Beta1/AssuredworkloadsService.php deleted file mode 100644 index be55b72a2230..000000000000 --- a/AssuredWorkloads/metadata/V1Beta1/AssuredworkloadsService.php +++ /dev/null @@ -1,41 +0,0 @@ -internalAddGeneratedFile( - ' -� -Dgoogle/cloud/assuredworkloads/v1beta1/assuredworkloads_service.proto%google.cloud.assuredworkloads.v1beta1google/api/client.protostring name = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $name = ''; + protected $name = ''; /** * Required. Business justification explaining the need for violation acknowledgement * * Generated from protobuf field string comment = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $comment = ''; + protected $comment = ''; /** * Optional. This field is deprecated and will be removed in future version of the API. * Name of the OrgPolicy which was modified with non-compliant change and diff --git a/AssuredWorkloads/src/V1/AssuredWorkloadsServiceGrpcClient.php b/AssuredWorkloads/src/V1/AssuredWorkloadsServiceGrpcClient.php deleted file mode 100644 index 9c58d26be31b..000000000000 --- a/AssuredWorkloads/src/V1/AssuredWorkloadsServiceGrpcClient.php +++ /dev/null @@ -1,187 +0,0 @@ -_simpleRequest('/google.cloud.assuredworkloads.v1.AssuredWorkloadsService/CreateWorkload', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Updates an existing workload. - * Currently allows updating of workload display_name and labels. - * For force updates don't set etag field in the Workload. - * Only one update operation per workload can be in progress. - * @param \Google\Cloud\AssuredWorkloads\V1\UpdateWorkloadRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateWorkload(\Google\Cloud\AssuredWorkloads\V1\UpdateWorkloadRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.assuredworkloads.v1.AssuredWorkloadsService/UpdateWorkload', - $argument, - ['\Google\Cloud\AssuredWorkloads\V1\Workload', 'decode'], - $metadata, $options); - } - - /** - * Restrict the list of resources allowed in the Workload environment. - * The current list of allowed products can be found at - * https://cloud.google.com/assured-workloads/docs/supported-products - * In addition to assuredworkloads.workload.update permission, the user should - * also have orgpolicy.policy.set permission on the folder resource - * to use this functionality. - * @param \Google\Cloud\AssuredWorkloads\V1\RestrictAllowedResourcesRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function RestrictAllowedResources(\Google\Cloud\AssuredWorkloads\V1\RestrictAllowedResourcesRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.assuredworkloads.v1.AssuredWorkloadsService/RestrictAllowedResources', - $argument, - ['\Google\Cloud\AssuredWorkloads\V1\RestrictAllowedResourcesResponse', 'decode'], - $metadata, $options); - } - - /** - * Deletes the workload. Make sure that workload's direct children are already - * in a deleted state, otherwise the request will fail with a - * FAILED_PRECONDITION error. - * @param \Google\Cloud\AssuredWorkloads\V1\DeleteWorkloadRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteWorkload(\Google\Cloud\AssuredWorkloads\V1\DeleteWorkloadRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.assuredworkloads.v1.AssuredWorkloadsService/DeleteWorkload', - $argument, - ['\Google\Protobuf\GPBEmpty', 'decode'], - $metadata, $options); - } - - /** - * Gets Assured Workload associated with a CRM Node - * @param \Google\Cloud\AssuredWorkloads\V1\GetWorkloadRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetWorkload(\Google\Cloud\AssuredWorkloads\V1\GetWorkloadRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.assuredworkloads.v1.AssuredWorkloadsService/GetWorkload', - $argument, - ['\Google\Cloud\AssuredWorkloads\V1\Workload', 'decode'], - $metadata, $options); - } - - /** - * Lists Assured Workloads under a CRM Node. - * @param \Google\Cloud\AssuredWorkloads\V1\ListWorkloadsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListWorkloads(\Google\Cloud\AssuredWorkloads\V1\ListWorkloadsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.assuredworkloads.v1.AssuredWorkloadsService/ListWorkloads', - $argument, - ['\Google\Cloud\AssuredWorkloads\V1\ListWorkloadsResponse', 'decode'], - $metadata, $options); - } - - /** - * Lists the Violations in the AssuredWorkload Environment. - * Callers may also choose to read across multiple Workloads as per - * [AIP-159](https://google.aip.dev/159) by using '-' (the hyphen or dash - * character) as a wildcard character instead of workload-id in the parent. - * Format `organizations/{org_id}/locations/{location}/workloads/-` - * @param \Google\Cloud\AssuredWorkloads\V1\ListViolationsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListViolations(\Google\Cloud\AssuredWorkloads\V1\ListViolationsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.assuredworkloads.v1.AssuredWorkloadsService/ListViolations', - $argument, - ['\Google\Cloud\AssuredWorkloads\V1\ListViolationsResponse', 'decode'], - $metadata, $options); - } - - /** - * Retrieves Assured Workload Violation based on ID. - * @param \Google\Cloud\AssuredWorkloads\V1\GetViolationRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetViolation(\Google\Cloud\AssuredWorkloads\V1\GetViolationRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.assuredworkloads.v1.AssuredWorkloadsService/GetViolation', - $argument, - ['\Google\Cloud\AssuredWorkloads\V1\Violation', 'decode'], - $metadata, $options); - } - - /** - * Acknowledges an existing violation. By acknowledging a violation, users - * acknowledge the existence of a compliance violation in their workload and - * decide to ignore it due to a valid business justification. Acknowledgement - * is a permanent operation and it cannot be reverted. - * @param \Google\Cloud\AssuredWorkloads\V1\AcknowledgeViolationRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function AcknowledgeViolation(\Google\Cloud\AssuredWorkloads\V1\AcknowledgeViolationRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.assuredworkloads.v1.AssuredWorkloadsService/AcknowledgeViolation', - $argument, - ['\Google\Cloud\AssuredWorkloads\V1\AcknowledgeViolationResponse', 'decode'], - $metadata, $options); - } - -} diff --git a/AssuredWorkloads/src/V1/Client/AssuredWorkloadsServiceClient.php b/AssuredWorkloads/src/V1/Client/AssuredWorkloadsServiceClient.php index 74ccd4fa487e..635f6b4714a0 100644 --- a/AssuredWorkloads/src/V1/Client/AssuredWorkloadsServiceClient.php +++ b/AssuredWorkloads/src/V1/Client/AssuredWorkloadsServiceClient.php @@ -1,6 +1,6 @@ [ 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/assured_workloads_service_rest_client_config.php', + 'restClientConfigPath' => + __DIR__ . '/../resources/assured_workloads_service_rest_client_config.php', ], ], ]; @@ -145,7 +144,9 @@ public function getOperationsClient() */ public function resumeOperation($operationName, $methodName = null) { - $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $options = isset($this->descriptors[$methodName]['longRunning']) + ? $this->descriptors[$methodName]['longRunning'] + : []; $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); $operation->reload(); return $operation; @@ -198,8 +199,12 @@ public static function locationName(string $organization, string $location): str * * @return string The formatted violation resource. */ - public static function violationName(string $organization, string $location, string $workload, string $violation): string - { + public static function violationName( + string $organization, + string $location, + string $workload, + string $violation + ): string { return self::getPathTemplate('violation')->render([ 'organization' => $organization, 'location' => $location, @@ -350,8 +355,10 @@ public function __call($method, $args) * * @throws ApiException Thrown if the API call fails. */ - public function acknowledgeViolation(AcknowledgeViolationRequest $request, array $callOptions = []): AcknowledgeViolationResponse - { + public function acknowledgeViolation( + AcknowledgeViolationRequest $request, + array $callOptions = [] + ): AcknowledgeViolationResponse { return $this->startApiCall('AcknowledgeViolation', $request, $callOptions)->wait(); } @@ -546,8 +553,10 @@ public function listWorkloads(ListWorkloadsRequest $request, array $callOptions * * @throws ApiException Thrown if the API call fails. */ - public function restrictAllowedResources(RestrictAllowedResourcesRequest $request, array $callOptions = []): RestrictAllowedResourcesResponse - { + public function restrictAllowedResources( + RestrictAllowedResourcesRequest $request, + array $callOptions = [] + ): RestrictAllowedResourcesResponse { return $this->startApiCall('RestrictAllowedResources', $request, $callOptions)->wait(); } diff --git a/AssuredWorkloads/src/V1/CreateWorkloadOperationMetadata.php b/AssuredWorkloads/src/V1/CreateWorkloadOperationMetadata.php index 05e561746633..1a4b40123dbc 100644 --- a/AssuredWorkloads/src/V1/CreateWorkloadOperationMetadata.php +++ b/AssuredWorkloads/src/V1/CreateWorkloadOperationMetadata.php @@ -20,26 +20,26 @@ class CreateWorkloadOperationMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OPTIONAL]; */ - private $create_time = null; + protected $create_time = null; /** * Optional. The display name of the workload. * * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $display_name = ''; + protected $display_name = ''; /** * Optional. The parent of the workload. * * Generated from protobuf field string parent = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $parent = ''; + protected $parent = ''; /** * Optional. Compliance controls that should be applied to the resources managed by * the workload. * * Generated from protobuf field .google.cloud.assuredworkloads.v1.Workload.ComplianceRegime compliance_regime = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $compliance_regime = 0; + protected $compliance_regime = 0; /** * Constructor. diff --git a/AssuredWorkloads/src/V1/CreateWorkloadRequest.php b/AssuredWorkloads/src/V1/CreateWorkloadRequest.php index 348b0e4498f6..be66d2add195 100644 --- a/AssuredWorkloads/src/V1/CreateWorkloadRequest.php +++ b/AssuredWorkloads/src/V1/CreateWorkloadRequest.php @@ -21,13 +21,13 @@ class CreateWorkloadRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. Assured Workload to create * * Generated from protobuf field .google.cloud.assuredworkloads.v1.Workload workload = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $workload = null; + protected $workload = null; /** * Optional. A identifier associated with the workload and underlying projects which * allows for the break down of billing costs for a workload. The value @@ -36,7 +36,7 @@ class CreateWorkloadRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string external_id = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $external_id = ''; + protected $external_id = ''; /** * @param string $parent Required. The resource name of the new Workload's parent. diff --git a/AssuredWorkloads/src/V1/DeleteWorkloadRequest.php b/AssuredWorkloads/src/V1/DeleteWorkloadRequest.php index 876cc89d552f..2c5dfe38cdf4 100644 --- a/AssuredWorkloads/src/V1/DeleteWorkloadRequest.php +++ b/AssuredWorkloads/src/V1/DeleteWorkloadRequest.php @@ -22,14 +22,14 @@ class DeleteWorkloadRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * Optional. The etag of the workload. * If this is provided, it must match the server's etag. * * Generated from protobuf field string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $etag = ''; + protected $etag = ''; /** * @param string $name Required. The `name` field is used to identify the workload. diff --git a/AssuredWorkloads/src/V1/GetViolationRequest.php b/AssuredWorkloads/src/V1/GetViolationRequest.php index 5cfcdde39915..6790c069eb29 100644 --- a/AssuredWorkloads/src/V1/GetViolationRequest.php +++ b/AssuredWorkloads/src/V1/GetViolationRequest.php @@ -22,7 +22,7 @@ class GetViolationRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The resource name of the Violation to fetch (ie. Violation.name). diff --git a/AssuredWorkloads/src/V1/GetWorkloadRequest.php b/AssuredWorkloads/src/V1/GetWorkloadRequest.php index e7b6a0aa4a96..96dccb40d104 100644 --- a/AssuredWorkloads/src/V1/GetWorkloadRequest.php +++ b/AssuredWorkloads/src/V1/GetWorkloadRequest.php @@ -24,7 +24,7 @@ class GetWorkloadRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The resource name of the Workload to fetch. This is the workload's diff --git a/AssuredWorkloads/src/V1/ListViolationsRequest.php b/AssuredWorkloads/src/V1/ListViolationsRequest.php index 7e8a85eb52ab..deeba4814a66 100644 --- a/AssuredWorkloads/src/V1/ListViolationsRequest.php +++ b/AssuredWorkloads/src/V1/ListViolationsRequest.php @@ -21,7 +21,7 @@ class ListViolationsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Optional. Specifies the time window for retrieving active Violations. * When specified, retrieves Violations that were active between start_time @@ -29,25 +29,25 @@ class ListViolationsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.assuredworkloads.v1.TimeWindow interval = 2 [(.google.api.field_behavior) = OPTIONAL]; */ - private $interval = null; + protected $interval = null; /** * Optional. Page size. * * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_size = 0; + protected $page_size = 0; /** * Optional. Page token returned from previous request. * * Generated from protobuf field string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; */ - private $page_token = ''; + protected $page_token = ''; /** * Optional. A custom filter for filtering by the Violations properties. * * Generated from protobuf field string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $filter = ''; + protected $filter = ''; /** * @param string $parent Required. The Workload name. diff --git a/AssuredWorkloads/src/V1/ListViolationsResponse.php b/AssuredWorkloads/src/V1/ListViolationsResponse.php index 7b1c4dc42bc8..9cd32a438855 100644 --- a/AssuredWorkloads/src/V1/ListViolationsResponse.php +++ b/AssuredWorkloads/src/V1/ListViolationsResponse.php @@ -26,7 +26,7 @@ class ListViolationsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/AssuredWorkloads/src/V1/ListWorkloadsRequest.php b/AssuredWorkloads/src/V1/ListWorkloadsRequest.php index e839981172e4..fc9101c054ff 100644 --- a/AssuredWorkloads/src/V1/ListWorkloadsRequest.php +++ b/AssuredWorkloads/src/V1/ListWorkloadsRequest.php @@ -21,13 +21,13 @@ class ListWorkloadsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Page size. * * Generated from protobuf field int32 page_size = 2; */ - private $page_size = 0; + protected $page_size = 0; /** * Page token returned from previous request. Page token contains context from * previous request. Page token needs to be passed in the second and following @@ -35,14 +35,14 @@ class ListWorkloadsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string page_token = 3; */ - private $page_token = ''; + protected $page_token = ''; /** * A custom filter for filtering by properties of a workload. At this time, * only filtering by labels is supported. * * Generated from protobuf field string filter = 4; */ - private $filter = ''; + protected $filter = ''; /** * @param string $parent Required. Parent Resource to list workloads from. diff --git a/AssuredWorkloads/src/V1/ListWorkloadsResponse.php b/AssuredWorkloads/src/V1/ListWorkloadsResponse.php index babb8db1c9b8..0c78b8bd31d0 100644 --- a/AssuredWorkloads/src/V1/ListWorkloadsResponse.php +++ b/AssuredWorkloads/src/V1/ListWorkloadsResponse.php @@ -26,7 +26,7 @@ class ListWorkloadsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/AssuredWorkloads/src/V1/RestrictAllowedResourcesRequest.php b/AssuredWorkloads/src/V1/RestrictAllowedResourcesRequest.php index 849083c077da..12940165bbd3 100644 --- a/AssuredWorkloads/src/V1/RestrictAllowedResourcesRequest.php +++ b/AssuredWorkloads/src/V1/RestrictAllowedResourcesRequest.php @@ -24,13 +24,13 @@ class RestrictAllowedResourcesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $name = ''; + protected $name = ''; /** * Required. The type of restriction for using gcp products in the Workload environment. * * Generated from protobuf field .google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest.RestrictionType restriction_type = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $restriction_type = 0; + protected $restriction_type = 0; /** * Constructor. diff --git a/AssuredWorkloads/src/V1/RestrictAllowedResourcesRequest/RestrictionType.php b/AssuredWorkloads/src/V1/RestrictAllowedResourcesRequest/RestrictionType.php index 630c16506a1c..35b75ae87199 100644 --- a/AssuredWorkloads/src/V1/RestrictAllowedResourcesRequest/RestrictionType.php +++ b/AssuredWorkloads/src/V1/RestrictAllowedResourcesRequest/RestrictionType.php @@ -63,6 +63,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(RestrictionType::class, \Google\Cloud\AssuredWorkloads\V1\RestrictAllowedResourcesRequest_RestrictionType::class); diff --git a/AssuredWorkloads/src/V1/TimeWindow.php b/AssuredWorkloads/src/V1/TimeWindow.php index 662fc79922d9..d85b5f8d271b 100644 --- a/AssuredWorkloads/src/V1/TimeWindow.php +++ b/AssuredWorkloads/src/V1/TimeWindow.php @@ -20,13 +20,13 @@ class TimeWindow extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; */ - private $start_time = null; + protected $start_time = null; /** * The end of the time window. * * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; */ - private $end_time = null; + protected $end_time = null; /** * Constructor. diff --git a/AssuredWorkloads/src/V1/UpdateWorkloadRequest.php b/AssuredWorkloads/src/V1/UpdateWorkloadRequest.php index 66d585972ee7..686a9c01e44b 100644 --- a/AssuredWorkloads/src/V1/UpdateWorkloadRequest.php +++ b/AssuredWorkloads/src/V1/UpdateWorkloadRequest.php @@ -23,13 +23,13 @@ class UpdateWorkloadRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.assuredworkloads.v1.Workload workload = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $workload = null; + protected $workload = null; /** * Required. The list of fields to be updated. * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $update_mask = null; + protected $update_mask = null; /** * @param \Google\Cloud\AssuredWorkloads\V1\Workload $workload Required. The workload to update. diff --git a/AssuredWorkloads/src/V1/Violation.php b/AssuredWorkloads/src/V1/Violation.php index fdb6779f1c06..513913ec2734 100644 --- a/AssuredWorkloads/src/V1/Violation.php +++ b/AssuredWorkloads/src/V1/Violation.php @@ -22,53 +22,53 @@ class Violation extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; */ - private $name = ''; + protected $name = ''; /** * Output only. Description for the Violation. * e.g. OrgPolicy gcp.resourceLocations has non compliant value. * * Generated from protobuf field string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $description = ''; + protected $description = ''; /** * Output only. Time of the event which triggered the Violation. * * Generated from protobuf field .google.protobuf.Timestamp begin_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $begin_time = null; + protected $begin_time = null; /** * Output only. The last time when the Violation record was updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * Output only. Time of the event which fixed the Violation. * If the violation is ACTIVE this will be empty. * * Generated from protobuf field .google.protobuf.Timestamp resolve_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $resolve_time = null; + protected $resolve_time = null; /** * Output only. Category under which this violation is mapped. * e.g. Location, Service Usage, Access, Encryption, etc. * * Generated from protobuf field string category = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $category = ''; + protected $category = ''; /** * Output only. State of the violation * * Generated from protobuf field .google.cloud.assuredworkloads.v1.Violation.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $state = 0; + protected $state = 0; /** * Output only. Immutable. The org-policy-constraint that was incorrectly changed, which resulted in * this violation. * * Generated from protobuf field string org_policy_constraint = 8 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; */ - private $org_policy_constraint = ''; + protected $org_policy_constraint = ''; /** * Output only. Immutable. Audit Log Link for violated resource * Format: @@ -76,7 +76,7 @@ class Violation extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string audit_log_link = 11 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; */ - private $audit_log_link = ''; + protected $audit_log_link = ''; /** * Output only. Immutable. Name of the OrgPolicy which was modified with non-compliant change and * resulted this violation. @@ -87,26 +87,26 @@ class Violation extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string non_compliant_org_policy = 12 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; */ - private $non_compliant_org_policy = ''; + protected $non_compliant_org_policy = ''; /** * Output only. Compliance violation remediation * * Generated from protobuf field .google.cloud.assuredworkloads.v1.Violation.Remediation remediation = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $remediation = null; + protected $remediation = null; /** * Output only. A boolean that indicates if the violation is acknowledged * * Generated from protobuf field bool acknowledged = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $acknowledged = false; + protected $acknowledged = false; /** * Optional. Timestamp when this violation was acknowledged last. * This will be absent when acknowledged field is marked as false. * * Generated from protobuf field optional .google.protobuf.Timestamp acknowledgement_time = 15 [(.google.api.field_behavior) = OPTIONAL]; */ - private $acknowledgement_time = null; + protected $acknowledgement_time = null; /** * Output only. Immutable. Audit Log link to find business justification provided for violation * exception. Format: @@ -114,7 +114,7 @@ class Violation extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string exception_audit_log_link = 16 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; */ - private $exception_audit_log_link = ''; + protected $exception_audit_log_link = ''; /** * Constructor. diff --git a/AssuredWorkloads/src/V1/Violation/Remediation.php b/AssuredWorkloads/src/V1/Violation/Remediation.php index 5bbe4158ada5..11159e2597d1 100644 --- a/AssuredWorkloads/src/V1/Violation/Remediation.php +++ b/AssuredWorkloads/src/V1/Violation/Remediation.php @@ -21,7 +21,7 @@ class Remediation extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions instructions = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $instructions = null; + protected $instructions = null; /** * Values that can resolve the violation * For example: for list org policy violations, this will either be the list @@ -35,7 +35,7 @@ class Remediation extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.assuredworkloads.v1.Violation.Remediation.RemediationType remediation_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $remediation_type = 0; + protected $remediation_type = 0; /** * Constructor. @@ -152,6 +152,4 @@ public function setRemediationType($var) } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Remediation::class, \Google\Cloud\AssuredWorkloads\V1\Violation_Remediation::class); diff --git a/AssuredWorkloads/src/V1/Violation/Remediation/Instructions.php b/AssuredWorkloads/src/V1/Violation/Remediation/Instructions.php index e1beb14dcfcf..0e7b4d1d475f 100644 --- a/AssuredWorkloads/src/V1/Violation/Remediation/Instructions.php +++ b/AssuredWorkloads/src/V1/Violation/Remediation/Instructions.php @@ -20,13 +20,13 @@ class Instructions extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud gcloud_instructions = 1; */ - private $gcloud_instructions = null; + protected $gcloud_instructions = null; /** * Remediation instructions to resolve violation via cloud console * * Generated from protobuf field .google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console console_instructions = 2; */ - private $console_instructions = null; + protected $console_instructions = null; /** * Constructor. @@ -119,6 +119,4 @@ public function setConsoleInstructions($var) } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Instructions::class, \Google\Cloud\AssuredWorkloads\V1\Violation_Remediation_Instructions::class); diff --git a/AssuredWorkloads/src/V1/Violation/Remediation/Instructions/Console.php b/AssuredWorkloads/src/V1/Violation/Remediation/Instructions/Console.php index cdf9485e5183..32fef6eb1508 100644 --- a/AssuredWorkloads/src/V1/Violation/Remediation/Instructions/Console.php +++ b/AssuredWorkloads/src/V1/Violation/Remediation/Instructions/Console.php @@ -133,6 +133,4 @@ public function setAdditionalLinks($var) } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Console::class, \Google\Cloud\AssuredWorkloads\V1\Violation_Remediation_Instructions_Console::class); diff --git a/AssuredWorkloads/src/V1/Violation/Remediation/Instructions/Gcloud.php b/AssuredWorkloads/src/V1/Violation/Remediation/Instructions/Gcloud.php index d3d08eceacca..be103fa766f3 100644 --- a/AssuredWorkloads/src/V1/Violation/Remediation/Instructions/Gcloud.php +++ b/AssuredWorkloads/src/V1/Violation/Remediation/Instructions/Gcloud.php @@ -133,6 +133,4 @@ public function setAdditionalLinks($var) } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Gcloud::class, \Google\Cloud\AssuredWorkloads\V1\Violation_Remediation_Instructions_Gcloud::class); diff --git a/AssuredWorkloads/src/V1/Violation/Remediation/RemediationType.php b/AssuredWorkloads/src/V1/Violation/Remediation/RemediationType.php index 838ccee58368..c58698446b73 100644 --- a/AssuredWorkloads/src/V1/Violation/Remediation/RemediationType.php +++ b/AssuredWorkloads/src/V1/Violation/Remediation/RemediationType.php @@ -78,6 +78,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(RemediationType::class, \Google\Cloud\AssuredWorkloads\V1\Violation_Remediation_RemediationType::class); diff --git a/AssuredWorkloads/src/V1/Violation/State.php b/AssuredWorkloads/src/V1/Violation/State.php index 3dffecec7cbf..0d3ee235af0c 100644 --- a/AssuredWorkloads/src/V1/Violation/State.php +++ b/AssuredWorkloads/src/V1/Violation/State.php @@ -66,6 +66,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(State::class, \Google\Cloud\AssuredWorkloads\V1\Violation_State::class); diff --git a/AssuredWorkloads/src/V1/Workload.php b/AssuredWorkloads/src/V1/Workload.php index fa58b28f653b..134a7e8f8a3b 100644 --- a/AssuredWorkloads/src/V1/Workload.php +++ b/AssuredWorkloads/src/V1/Workload.php @@ -24,7 +24,7 @@ class Workload extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; */ - private $name = ''; + protected $name = ''; /** * Required. The user-assigned display name of the Workload. * When present it must be between 4 to 30 characters. @@ -34,7 +34,7 @@ class Workload extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $display_name = ''; + protected $display_name = ''; /** * Output only. The resources associated with this workload. * These resources will be created when creating the workload. @@ -49,13 +49,13 @@ class Workload extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.assuredworkloads.v1.Workload.ComplianceRegime compliance_regime = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; */ - private $compliance_regime = 0; + protected $compliance_regime = 0; /** * Output only. Immutable. The Workload creation timestamp. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; */ - private $create_time = null; + protected $create_time = null; /** * Optional. The billing account used for the resources which are * direct children of workload. This billing account is initially associated @@ -68,14 +68,14 @@ class Workload extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string billing_account = 6 [(.google.api.field_behavior) = OPTIONAL]; */ - private $billing_account = ''; + protected $billing_account = ''; /** * Optional. ETag of the workload, it is calculated on the basis * of the Workload contents. It will be used in Update & Delete operations. * * Generated from protobuf field string etag = 9 [(.google.api.field_behavior) = OPTIONAL]; */ - private $etag = ''; + protected $etag = ''; /** * Optional. Labels applied to the workload. * @@ -92,7 +92,7 @@ class Workload extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string provisioned_resources_parent = 13 [(.google.api.field_behavior) = INPUT_ONLY]; */ - private $provisioned_resources_parent = ''; + protected $provisioned_resources_parent = ''; /** * Input only. Settings used to create a CMEK crypto key. When set, a project with a KMS * CMEK key is provisioned. @@ -117,14 +117,14 @@ class Workload extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.assuredworkloads.v1.Workload.KajEnrollmentState kaj_enrollment_state = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $kaj_enrollment_state = 0; + protected $kaj_enrollment_state = 0; /** * Optional. Indicates the sovereignty status of the given workload. * Currently meant to be used by Europe/Canada customers. * * Generated from protobuf field bool enable_sovereign_controls = 18 [(.google.api.field_behavior) = OPTIONAL]; */ - private $enable_sovereign_controls = false; + protected $enable_sovereign_controls = false; /** * Output only. Represents the SAA enrollment response of the given workload. * SAA enrollment response is queried during GetWorkload call. @@ -132,7 +132,7 @@ class Workload extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse saa_enrollment_response = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $saa_enrollment_response = null; + protected $saa_enrollment_response = null; /** * Output only. Urls for services which are compliant for this Assured Workload, but which * are currently disallowed by the ResourceUsageRestriction org policy. @@ -147,7 +147,7 @@ class Workload extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.assuredworkloads.v1.Workload.Partner partner = 25 [(.google.api.field_behavior) = OPTIONAL]; */ - private $partner = 0; + protected $partner = 0; /** * Constructor. diff --git a/AssuredWorkloads/src/V1/Workload/ComplianceRegime.php b/AssuredWorkloads/src/V1/Workload/ComplianceRegime.php index f921eaced85e..40333fc47c2d 100644 --- a/AssuredWorkloads/src/V1/Workload/ComplianceRegime.php +++ b/AssuredWorkloads/src/V1/Workload/ComplianceRegime.php @@ -131,6 +131,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ComplianceRegime::class, \Google\Cloud\AssuredWorkloads\V1\Workload_ComplianceRegime::class); diff --git a/AssuredWorkloads/src/V1/Workload/KMSSettings.php b/AssuredWorkloads/src/V1/Workload/KMSSettings.php index c5552a23a983..d8842b17b814 100644 --- a/AssuredWorkloads/src/V1/Workload/KMSSettings.php +++ b/AssuredWorkloads/src/V1/Workload/KMSSettings.php @@ -25,7 +25,7 @@ class KMSSettings extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp next_rotation_time = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; */ - private $next_rotation_time = null; + protected $next_rotation_time = null; /** * Required. Input only. Immutable. [next_rotation_time] will be advanced by this period when the Key * Management Service automatically rotates a key. Must be at least 24 hours @@ -33,7 +33,7 @@ class KMSSettings extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Duration rotation_period = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; */ - private $rotation_period = null; + protected $rotation_period = null; /** * Constructor. @@ -135,6 +135,4 @@ public function setRotationPeriod($var) } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(KMSSettings::class, \Google\Cloud\AssuredWorkloads\V1\Workload_KMSSettings::class); diff --git a/AssuredWorkloads/src/V1/Workload/KajEnrollmentState.php b/AssuredWorkloads/src/V1/Workload/KajEnrollmentState.php index 5daeeb90a74f..50a571517eaa 100644 --- a/AssuredWorkloads/src/V1/Workload/KajEnrollmentState.php +++ b/AssuredWorkloads/src/V1/Workload/KajEnrollmentState.php @@ -59,6 +59,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(KajEnrollmentState::class, \Google\Cloud\AssuredWorkloads\V1\Workload_KajEnrollmentState::class); diff --git a/AssuredWorkloads/src/V1/Workload/Partner.php b/AssuredWorkloads/src/V1/Workload/Partner.php index b3ab77303ba3..0b2606d72d24 100644 --- a/AssuredWorkloads/src/V1/Workload/Partner.php +++ b/AssuredWorkloads/src/V1/Workload/Partner.php @@ -52,6 +52,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Partner::class, \Google\Cloud\AssuredWorkloads\V1\Workload_Partner::class); diff --git a/AssuredWorkloads/src/V1/Workload/ResourceInfo.php b/AssuredWorkloads/src/V1/Workload/ResourceInfo.php index ca47d24b1c66..a10c4193ce0a 100644 --- a/AssuredWorkloads/src/V1/Workload/ResourceInfo.php +++ b/AssuredWorkloads/src/V1/Workload/ResourceInfo.php @@ -21,13 +21,13 @@ class ResourceInfo extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int64 resource_id = 1; */ - private $resource_id = 0; + protected $resource_id = 0; /** * Indicates the type of resource. * * Generated from protobuf field .google.cloud.assuredworkloads.v1.Workload.ResourceInfo.ResourceType resource_type = 2; */ - private $resource_type = 0; + protected $resource_type = 0; /** * Constructor. @@ -103,6 +103,4 @@ public function setResourceType($var) } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ResourceInfo::class, \Google\Cloud\AssuredWorkloads\V1\Workload_ResourceInfo::class); diff --git a/AssuredWorkloads/src/V1/Workload/ResourceInfo/ResourceType.php b/AssuredWorkloads/src/V1/Workload/ResourceInfo/ResourceType.php index dc3182744b09..76e36b979c72 100644 --- a/AssuredWorkloads/src/V1/Workload/ResourceInfo/ResourceType.php +++ b/AssuredWorkloads/src/V1/Workload/ResourceInfo/ResourceType.php @@ -77,6 +77,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ResourceType::class, \Google\Cloud\AssuredWorkloads\V1\Workload_ResourceInfo_ResourceType::class); diff --git a/AssuredWorkloads/src/V1/Workload/ResourceSettings.php b/AssuredWorkloads/src/V1/Workload/ResourceSettings.php index 77413bf5dd3d..7a9ee52d06bb 100644 --- a/AssuredWorkloads/src/V1/Workload/ResourceSettings.php +++ b/AssuredWorkloads/src/V1/Workload/ResourceSettings.php @@ -24,7 +24,7 @@ class ResourceSettings extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string resource_id = 1; */ - private $resource_id = ''; + protected $resource_id = ''; /** * Indicates the type of resource. This field should be specified to * correspond the id to the right resource type (CONSUMER_FOLDER or @@ -32,7 +32,7 @@ class ResourceSettings extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.cloud.assuredworkloads.v1.Workload.ResourceInfo.ResourceType resource_type = 2; */ - private $resource_type = 0; + protected $resource_type = 0; /** * User-assigned resource display name. * If not empty it will be used to create a resource with the specified @@ -40,7 +40,7 @@ class ResourceSettings extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string display_name = 3; */ - private $display_name = ''; + protected $display_name = ''; /** * Constructor. @@ -165,6 +165,4 @@ public function setDisplayName($var) } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ResourceSettings::class, \Google\Cloud\AssuredWorkloads\V1\Workload_ResourceSettings::class); diff --git a/AssuredWorkloads/src/V1/Workload/SaaEnrollmentResponse.php b/AssuredWorkloads/src/V1/Workload/SaaEnrollmentResponse.php index 71de2ac364db..0a16a146d91b 100644 --- a/AssuredWorkloads/src/V1/Workload/SaaEnrollmentResponse.php +++ b/AssuredWorkloads/src/V1/Workload/SaaEnrollmentResponse.php @@ -20,7 +20,7 @@ class SaaEnrollmentResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field optional .google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse.SetupState setup_status = 1; */ - private $setup_status = null; + protected $setup_status = null; /** * Indicates SAA enrollment setup error if any. * @@ -109,6 +109,4 @@ public function setSetupErrors($var) } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(SaaEnrollmentResponse::class, \Google\Cloud\AssuredWorkloads\V1\Workload_SaaEnrollmentResponse::class); diff --git a/AssuredWorkloads/src/V1/Workload/SaaEnrollmentResponse/SetupError.php b/AssuredWorkloads/src/V1/Workload/SaaEnrollmentResponse/SetupError.php index 6ced16897348..0a5232c393ba 100644 --- a/AssuredWorkloads/src/V1/Workload/SaaEnrollmentResponse/SetupError.php +++ b/AssuredWorkloads/src/V1/Workload/SaaEnrollmentResponse/SetupError.php @@ -76,6 +76,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(SetupError::class, \Google\Cloud\AssuredWorkloads\V1\Workload_SaaEnrollmentResponse_SetupError::class); diff --git a/AssuredWorkloads/src/V1/Workload/SaaEnrollmentResponse/SetupState.php b/AssuredWorkloads/src/V1/Workload/SaaEnrollmentResponse/SetupState.php index 27112e59383a..7ccd00e753ac 100644 --- a/AssuredWorkloads/src/V1/Workload/SaaEnrollmentResponse/SetupState.php +++ b/AssuredWorkloads/src/V1/Workload/SaaEnrollmentResponse/SetupState.php @@ -59,6 +59,4 @@ public static function value($name) } } -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(SetupState::class, \Google\Cloud\AssuredWorkloads\V1\Workload_SaaEnrollmentResponse_SetupState::class); diff --git a/AssuredWorkloads/src/V1beta1/AnalyzeWorkloadMoveRequest.php b/AssuredWorkloads/src/V1beta1/AnalyzeWorkloadMoveRequest.php deleted file mode 100644 index 2fe6c54431da..000000000000 --- a/AssuredWorkloads/src/V1beta1/AnalyzeWorkloadMoveRequest.php +++ /dev/null @@ -1,190 +0,0 @@ -google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveRequest - */ -class AnalyzeWorkloadMoveRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource ID of the folder-based destination workload. This workload is - * where the source project will hypothetically be moved to. Specify the - * workload's relative resource name, formatted as: - * "organizations/{ORGANIZATION_ID}/locations/{LOCATION_ID}/workloads/{WORKLOAD_ID}" - * For example: - * "organizations/123/locations/us-east1/workloads/assured-workload-2" - * - * Generated from protobuf field string target = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $target = ''; - protected $projectOrWorkloadResource; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $source - * The source type is a project-based workload. Specify the workloads's - * relative resource name, formatted as: - * "organizations/{ORGANIZATION_ID}/locations/{LOCATION_ID}/workloads/{WORKLOAD_ID}" - * For example: - * "organizations/123/locations/us-east1/workloads/assured-workload-1" - * @type string $project - * The source type is a project. Specify the project's relative resource - * name, formatted as either a project number or a project ID: - * "projects/{PROJECT_NUMBER}" or "projects/{PROJECT_ID}" - * For example: - * "projects/951040570662" when specifying a project number, or - * "projects/my-project-123" when specifying a project ID. - * @type string $target - * Required. The resource ID of the folder-based destination workload. This workload is - * where the source project will hypothetically be moved to. Specify the - * workload's relative resource name, formatted as: - * "organizations/{ORGANIZATION_ID}/locations/{LOCATION_ID}/workloads/{WORKLOAD_ID}" - * For example: - * "organizations/123/locations/us-east1/workloads/assured-workload-2" - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Assuredworkloads\V1Beta1\Assuredworkloads::initOnce(); - parent::__construct($data); - } - - /** - * The source type is a project-based workload. Specify the workloads's - * relative resource name, formatted as: - * "organizations/{ORGANIZATION_ID}/locations/{LOCATION_ID}/workloads/{WORKLOAD_ID}" - * For example: - * "organizations/123/locations/us-east1/workloads/assured-workload-1" - * - * Generated from protobuf field string source = 1; - * @return string - */ - public function getSource() - { - return $this->readOneof(1); - } - - public function hasSource() - { - return $this->hasOneof(1); - } - - /** - * The source type is a project-based workload. Specify the workloads's - * relative resource name, formatted as: - * "organizations/{ORGANIZATION_ID}/locations/{LOCATION_ID}/workloads/{WORKLOAD_ID}" - * For example: - * "organizations/123/locations/us-east1/workloads/assured-workload-1" - * - * Generated from protobuf field string source = 1; - * @param string $var - * @return $this - */ - public function setSource($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * The source type is a project. Specify the project's relative resource - * name, formatted as either a project number or a project ID: - * "projects/{PROJECT_NUMBER}" or "projects/{PROJECT_ID}" - * For example: - * "projects/951040570662" when specifying a project number, or - * "projects/my-project-123" when specifying a project ID. - * - * Generated from protobuf field string project = 3; - * @return string - */ - public function getProject() - { - return $this->readOneof(3); - } - - public function hasProject() - { - return $this->hasOneof(3); - } - - /** - * The source type is a project. Specify the project's relative resource - * name, formatted as either a project number or a project ID: - * "projects/{PROJECT_NUMBER}" or "projects/{PROJECT_ID}" - * For example: - * "projects/951040570662" when specifying a project number, or - * "projects/my-project-123" when specifying a project ID. - * - * Generated from protobuf field string project = 3; - * @param string $var - * @return $this - */ - public function setProject($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * Required. The resource ID of the folder-based destination workload. This workload is - * where the source project will hypothetically be moved to. Specify the - * workload's relative resource name, formatted as: - * "organizations/{ORGANIZATION_ID}/locations/{LOCATION_ID}/workloads/{WORKLOAD_ID}" - * For example: - * "organizations/123/locations/us-east1/workloads/assured-workload-2" - * - * Generated from protobuf field string target = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getTarget() - { - return $this->target; - } - - /** - * Required. The resource ID of the folder-based destination workload. This workload is - * where the source project will hypothetically be moved to. Specify the - * workload's relative resource name, formatted as: - * "organizations/{ORGANIZATION_ID}/locations/{LOCATION_ID}/workloads/{WORKLOAD_ID}" - * For example: - * "organizations/123/locations/us-east1/workloads/assured-workload-2" - * - * Generated from protobuf field string target = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setTarget($var) - { - GPBUtil::checkString($var, True); - $this->target = $var; - - return $this; - } - - /** - * @return string - */ - public function getProjectOrWorkloadResource() - { - return $this->whichOneof("projectOrWorkloadResource"); - } - -} - diff --git a/AssuredWorkloads/src/V1beta1/AnalyzeWorkloadMoveResponse.php b/AssuredWorkloads/src/V1beta1/AnalyzeWorkloadMoveResponse.php deleted file mode 100644 index 358677fb9f89..000000000000 --- a/AssuredWorkloads/src/V1beta1/AnalyzeWorkloadMoveResponse.php +++ /dev/null @@ -1,71 +0,0 @@ -google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveResponse - */ -class AnalyzeWorkloadMoveResponse extends \Google\Protobuf\Internal\Message -{ - /** - * A list of blockers that should be addressed before moving the source - * project or project-based workload to the destination folder-based workload. - * - * Generated from protobuf field repeated string blockers = 1; - */ - private $blockers; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\RepeatedField $blockers - * A list of blockers that should be addressed before moving the source - * project or project-based workload to the destination folder-based workload. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Assuredworkloads\V1Beta1\Assuredworkloads::initOnce(); - parent::__construct($data); - } - - /** - * A list of blockers that should be addressed before moving the source - * project or project-based workload to the destination folder-based workload. - * - * Generated from protobuf field repeated string blockers = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getBlockers() - { - return $this->blockers; - } - - /** - * A list of blockers that should be addressed before moving the source - * project or project-based workload to the destination folder-based workload. - * - * Generated from protobuf field repeated string blockers = 1; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setBlockers($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->blockers = $arr; - - return $this; - } - -} - diff --git a/AssuredWorkloads/src/V1beta1/AssuredWorkloadsServiceClient.php b/AssuredWorkloads/src/V1beta1/AssuredWorkloadsServiceClient.php deleted file mode 100644 index d3beb8ce6161..000000000000 --- a/AssuredWorkloads/src/V1beta1/AssuredWorkloadsServiceClient.php +++ /dev/null @@ -1,36 +0,0 @@ -_simpleRequest('/google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService/CreateWorkload', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Updates an existing workload. - * Currently allows updating of workload display_name and labels. - * For force updates don't set etag field in the Workload. - * Only one update operation per workload can be in progress. - * @param \Google\Cloud\AssuredWorkloads\V1beta1\UpdateWorkloadRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateWorkload(\Google\Cloud\AssuredWorkloads\V1beta1\UpdateWorkloadRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService/UpdateWorkload', - $argument, - ['\Google\Cloud\AssuredWorkloads\V1beta1\Workload', 'decode'], - $metadata, $options); - } - - /** - * Restrict the list of resources allowed in the Workload environment. - * The current list of allowed products can be found at - * https://cloud.google.com/assured-workloads/docs/supported-products - * In addition to assuredworkloads.workload.update permission, the user should - * also have orgpolicy.policy.set permission on the folder resource - * to use this functionality. - * @param \Google\Cloud\AssuredWorkloads\V1beta1\RestrictAllowedResourcesRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function RestrictAllowedResources(\Google\Cloud\AssuredWorkloads\V1beta1\RestrictAllowedResourcesRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService/RestrictAllowedResources', - $argument, - ['\Google\Cloud\AssuredWorkloads\V1beta1\RestrictAllowedResourcesResponse', 'decode'], - $metadata, $options); - } - - /** - * Deletes the workload. Make sure that workload's direct children are already - * in a deleted state, otherwise the request will fail with a - * FAILED_PRECONDITION error. - * In addition to assuredworkloads.workload.delete permission, the user should - * also have orgpolicy.policy.set permission on the deleted folder to remove - * Assured Workloads OrgPolicies. - * @param \Google\Cloud\AssuredWorkloads\V1beta1\DeleteWorkloadRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteWorkload(\Google\Cloud\AssuredWorkloads\V1beta1\DeleteWorkloadRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService/DeleteWorkload', - $argument, - ['\Google\Protobuf\GPBEmpty', 'decode'], - $metadata, $options); - } - - /** - * Gets Assured Workload associated with a CRM Node - * @param \Google\Cloud\AssuredWorkloads\V1beta1\GetWorkloadRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetWorkload(\Google\Cloud\AssuredWorkloads\V1beta1\GetWorkloadRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService/GetWorkload', - $argument, - ['\Google\Cloud\AssuredWorkloads\V1beta1\Workload', 'decode'], - $metadata, $options); - } - - /** - * Analyze if the source Assured Workloads can be moved to the target Assured - * Workload - * @param \Google\Cloud\AssuredWorkloads\V1beta1\AnalyzeWorkloadMoveRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function AnalyzeWorkloadMove(\Google\Cloud\AssuredWorkloads\V1beta1\AnalyzeWorkloadMoveRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService/AnalyzeWorkloadMove', - $argument, - ['\Google\Cloud\AssuredWorkloads\V1beta1\AnalyzeWorkloadMoveResponse', 'decode'], - $metadata, $options); - } - - /** - * Lists Assured Workloads under a CRM Node. - * @param \Google\Cloud\AssuredWorkloads\V1beta1\ListWorkloadsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListWorkloads(\Google\Cloud\AssuredWorkloads\V1beta1\ListWorkloadsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService/ListWorkloads', - $argument, - ['\Google\Cloud\AssuredWorkloads\V1beta1\ListWorkloadsResponse', 'decode'], - $metadata, $options); - } - -} diff --git a/AssuredWorkloads/src/V1beta1/CreateWorkloadOperationMetadata.php b/AssuredWorkloads/src/V1beta1/CreateWorkloadOperationMetadata.php deleted file mode 100644 index 7a7a6d5dd466..000000000000 --- a/AssuredWorkloads/src/V1beta1/CreateWorkloadOperationMetadata.php +++ /dev/null @@ -1,221 +0,0 @@ -google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata - */ -class CreateWorkloadOperationMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. Time when the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $create_time = null; - /** - * Optional. The display name of the workload. - * - * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $display_name = ''; - /** - * Optional. The parent of the workload. - * - * Generated from protobuf field string parent = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $parent = ''; - /** - * Optional. Compliance controls that should be applied to the resources managed by - * the workload. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime compliance_regime = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $compliance_regime = 0; - /** - * Optional. Resource properties in the input that are used for creating/customizing - * workload resources. - * - * Generated from protobuf field repeated .google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings resource_settings = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $resource_settings; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Timestamp $create_time - * Optional. Time when the operation was created. - * @type string $display_name - * Optional. The display name of the workload. - * @type string $parent - * Optional. The parent of the workload. - * @type int $compliance_regime - * Optional. Compliance controls that should be applied to the resources managed by - * the workload. - * @type array<\Google\Cloud\AssuredWorkloads\V1beta1\Workload\ResourceSettings>|\Google\Protobuf\Internal\RepeatedField $resource_settings - * Optional. Resource properties in the input that are used for creating/customizing - * workload resources. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Assuredworkloads\V1Beta1\Assuredworkloads::initOnce(); - parent::__construct($data); - } - - /** - * Optional. Time when the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * Optional. Time when the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Optional. The display name of the workload. - * - * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getDisplayName() - { - return $this->display_name; - } - - /** - * Optional. The display name of the workload. - * - * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setDisplayName($var) - { - GPBUtil::checkString($var, True); - $this->display_name = $var; - - return $this; - } - - /** - * Optional. The parent of the workload. - * - * Generated from protobuf field string parent = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Optional. The parent of the workload. - * - * Generated from protobuf field string parent = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Optional. Compliance controls that should be applied to the resources managed by - * the workload. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime compliance_regime = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getComplianceRegime() - { - return $this->compliance_regime; - } - - /** - * Optional. Compliance controls that should be applied to the resources managed by - * the workload. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime compliance_regime = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setComplianceRegime($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\AssuredWorkloads\V1beta1\Workload\ComplianceRegime::class); - $this->compliance_regime = $var; - - return $this; - } - - /** - * Optional. Resource properties in the input that are used for creating/customizing - * workload resources. - * - * Generated from protobuf field repeated .google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings resource_settings = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getResourceSettings() - { - return $this->resource_settings; - } - - /** - * Optional. Resource properties in the input that are used for creating/customizing - * workload resources. - * - * Generated from protobuf field repeated .google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings resource_settings = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param array<\Google\Cloud\AssuredWorkloads\V1beta1\Workload\ResourceSettings>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setResourceSettings($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AssuredWorkloads\V1beta1\Workload\ResourceSettings::class); - $this->resource_settings = $arr; - - return $this; - } - -} - diff --git a/AssuredWorkloads/src/V1beta1/CreateWorkloadRequest.php b/AssuredWorkloads/src/V1beta1/CreateWorkloadRequest.php deleted file mode 100644 index 31afabe7175c..000000000000 --- a/AssuredWorkloads/src/V1beta1/CreateWorkloadRequest.php +++ /dev/null @@ -1,161 +0,0 @@ -google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest - */ -class CreateWorkloadRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the new Workload's parent. - * Must be of the form `organizations/{org_id}/locations/{location_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $parent = ''; - /** - * Required. Assured Workload to create - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload workload = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $workload = null; - /** - * Optional. A identifier associated with the workload and underlying projects which - * allows for the break down of billing costs for a workload. The value - * provided for the identifier will add a label to the workload and contained - * projects with the identifier as the value. - * - * Generated from protobuf field string external_id = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $external_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The resource name of the new Workload's parent. - * Must be of the form `organizations/{org_id}/locations/{location_id}`. - * @type \Google\Cloud\AssuredWorkloads\V1beta1\Workload $workload - * Required. Assured Workload to create - * @type string $external_id - * Optional. A identifier associated with the workload and underlying projects which - * allows for the break down of billing costs for a workload. The value - * provided for the identifier will add a label to the workload and contained - * projects with the identifier as the value. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Assuredworkloads\V1Beta1\Assuredworkloads::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the new Workload's parent. - * Must be of the form `organizations/{org_id}/locations/{location_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The resource name of the new Workload's parent. - * Must be of the form `organizations/{org_id}/locations/{location_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Required. Assured Workload to create - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload workload = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\AssuredWorkloads\V1beta1\Workload|null - */ - public function getWorkload() - { - return $this->workload; - } - - public function hasWorkload() - { - return isset($this->workload); - } - - public function clearWorkload() - { - unset($this->workload); - } - - /** - * Required. Assured Workload to create - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload workload = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\AssuredWorkloads\V1beta1\Workload $var - * @return $this - */ - public function setWorkload($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AssuredWorkloads\V1beta1\Workload::class); - $this->workload = $var; - - return $this; - } - - /** - * Optional. A identifier associated with the workload and underlying projects which - * allows for the break down of billing costs for a workload. The value - * provided for the identifier will add a label to the workload and contained - * projects with the identifier as the value. - * - * Generated from protobuf field string external_id = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getExternalId() - { - return $this->external_id; - } - - /** - * Optional. A identifier associated with the workload and underlying projects which - * allows for the break down of billing costs for a workload. The value - * provided for the identifier will add a label to the workload and contained - * projects with the identifier as the value. - * - * Generated from protobuf field string external_id = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setExternalId($var) - { - GPBUtil::checkString($var, True); - $this->external_id = $var; - - return $this; - } - -} - diff --git a/AssuredWorkloads/src/V1beta1/DeleteWorkloadRequest.php b/AssuredWorkloads/src/V1beta1/DeleteWorkloadRequest.php deleted file mode 100644 index 37ec1ea5c89f..000000000000 --- a/AssuredWorkloads/src/V1beta1/DeleteWorkloadRequest.php +++ /dev/null @@ -1,113 +0,0 @@ -google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest - */ -class DeleteWorkloadRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The `name` field is used to identify the workload. - * Format: - * organizations/{org_id}/locations/{location_id}/workloads/{workload_id} - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $name = ''; - /** - * Optional. The etag of the workload. - * If this is provided, it must match the server's etag. - * - * Generated from protobuf field string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $etag = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The `name` field is used to identify the workload. - * Format: - * organizations/{org_id}/locations/{location_id}/workloads/{workload_id} - * @type string $etag - * Optional. The etag of the workload. - * If this is provided, it must match the server's etag. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Assuredworkloads\V1Beta1\Assuredworkloads::initOnce(); - parent::__construct($data); - } - - /** - * Required. The `name` field is used to identify the workload. - * Format: - * organizations/{org_id}/locations/{location_id}/workloads/{workload_id} - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The `name` field is used to identify the workload. - * Format: - * organizations/{org_id}/locations/{location_id}/workloads/{workload_id} - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Optional. The etag of the workload. - * If this is provided, it must match the server's etag. - * - * Generated from protobuf field string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * Optional. The etag of the workload. - * If this is provided, it must match the server's etag. - * - * Generated from protobuf field string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - -} - diff --git a/AssuredWorkloads/src/V1beta1/Gapic/AssuredWorkloadsServiceGapicClient.php b/AssuredWorkloads/src/V1beta1/Gapic/AssuredWorkloadsServiceGapicClient.php deleted file mode 100644 index 3934c60be5f8..000000000000 --- a/AssuredWorkloads/src/V1beta1/Gapic/AssuredWorkloadsServiceGapicClient.php +++ /dev/null @@ -1,756 +0,0 @@ -analyzeWorkloadMove($target); - * } finally { - * $assuredWorkloadsServiceClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * @experimental - * - * @deprecated This class will be removed in the next major version update. - */ -class AssuredWorkloadsServiceGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'assuredworkloads.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'assuredworkloads.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static $locationNameTemplate; - - private static $workloadNameTemplate; - - private static $pathTemplateMap; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/assured_workloads_service_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/assured_workloads_service_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/assured_workloads_service_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/assured_workloads_service_rest_client_config.php', - ], - ], - ]; - } - - private static function getLocationNameTemplate() - { - if (self::$locationNameTemplate == null) { - self::$locationNameTemplate = new PathTemplate('organizations/{organization}/locations/{location}'); - } - - return self::$locationNameTemplate; - } - - private static function getWorkloadNameTemplate() - { - if (self::$workloadNameTemplate == null) { - self::$workloadNameTemplate = new PathTemplate('organizations/{organization}/locations/{location}/workloads/{workload}'); - } - - return self::$workloadNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'location' => self::getLocationNameTemplate(), - 'workload' => self::getWorkloadNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a location - * resource. - * - * @param string $organization - * @param string $location - * - * @return string The formatted location resource. - * - * @experimental - */ - public static function locationName($organization, $location) - { - return self::getLocationNameTemplate()->render([ - 'organization' => $organization, - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a workload - * resource. - * - * @param string $organization - * @param string $location - * @param string $workload - * - * @return string The formatted workload resource. - * - * @experimental - */ - public static function workloadName($organization, $location, $workload) - { - return self::getWorkloadNameTemplate()->render([ - 'organization' => $organization, - 'location' => $location, - 'workload' => $workload, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - location: organizations/{organization}/locations/{location} - * - workload: organizations/{organization}/locations/{location}/workloads/{workload} - * - * 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. - * - * @experimental - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException("Template name $template does not exist"); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException("Input did not match any known format. Input: $formattedName"); - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - * - * @experimental - */ - public function getOperationsClient() - { - return $this->operationsClient; - } - - /** - * Resume an existing long running operation that was previously started by a long - * running API method. If $methodName is not provided, or does not match a long - * running API method, then the operation can still be resumed, but the - * OperationResponse object will not deserialize the final response. - * - * @param string $operationName The name of the long running operation - * @param string $methodName The name of the method used to start the operation - * - * @return OperationResponse - * - * @experimental - */ - public function resumeOperation($operationName, $methodName = null) - { - $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; - $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); - $operation->reload(); - return $operation; - } - - /** - * 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 'assuredworkloads.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 - * - * @experimental - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** - * Analyze if the source Assured Workloads can be moved to the target Assured - * Workload - * - * Sample code: - * ``` - * $assuredWorkloadsServiceClient = new AssuredWorkloadsServiceClient(); - * try { - * $target = 'target'; - * $response = $assuredWorkloadsServiceClient->analyzeWorkloadMove($target); - * } finally { - * $assuredWorkloadsServiceClient->close(); - * } - * ``` - * - * @param string $target Required. The resource ID of the folder-based destination workload. This workload is - * where the source project will hypothetically be moved to. Specify the - * workload's relative resource name, formatted as: - * "organizations/{ORGANIZATION_ID}/locations/{LOCATION_ID}/workloads/{WORKLOAD_ID}" - * For example: - * "organizations/123/locations/us-east1/workloads/assured-workload-2" - * @param array $optionalArgs { - * Optional. - * - * @type string $source - * The source type is a project-based workload. Specify the workloads's - * relative resource name, formatted as: - * "organizations/{ORGANIZATION_ID}/locations/{LOCATION_ID}/workloads/{WORKLOAD_ID}" - * For example: - * "organizations/123/locations/us-east1/workloads/assured-workload-1" - * @type string $project - * The source type is a project. Specify the project's relative resource - * name, formatted as either a project number or a project ID: - * "projects/{PROJECT_NUMBER}" or "projects/{PROJECT_ID}" - * For example: - * "projects/951040570662" when specifying a project number, or - * "projects/my-project-123" when specifying a project ID. - * @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 \Google\Cloud\AssuredWorkloads\V1beta1\AnalyzeWorkloadMoveResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function analyzeWorkloadMove($target, array $optionalArgs = []) - { - $request = new AnalyzeWorkloadMoveRequest(); - $request->setTarget($target); - if (isset($optionalArgs['source'])) { - $request->setSource($optionalArgs['source']); - } - - if (isset($optionalArgs['project'])) { - $request->setProject($optionalArgs['project']); - } - - return $this->startCall('AnalyzeWorkloadMove', AnalyzeWorkloadMoveResponse::class, $optionalArgs, $request)->wait(); - } - - /** - * Creates Assured Workload. - * - * Sample code: - * ``` - * $assuredWorkloadsServiceClient = new AssuredWorkloadsServiceClient(); - * try { - * $formattedParent = $assuredWorkloadsServiceClient->locationName('[ORGANIZATION]', '[LOCATION]'); - * $workload = new Workload(); - * $operationResponse = $assuredWorkloadsServiceClient->createWorkload($formattedParent, $workload); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $assuredWorkloadsServiceClient->createWorkload($formattedParent, $workload); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $assuredWorkloadsServiceClient->resumeOperation($operationName, 'createWorkload'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $assuredWorkloadsServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. The resource name of the new Workload's parent. - * Must be of the form `organizations/{org_id}/locations/{location_id}`. - * @param Workload $workload Required. Assured Workload to create - * @param array $optionalArgs { - * Optional. - * - * @type string $externalId - * Optional. A identifier associated with the workload and underlying projects which - * allows for the break down of billing costs for a workload. The value - * provided for the identifier will add a label to the workload and contained - * projects with the identifier as the value. - * @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 \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function createWorkload($parent, $workload, array $optionalArgs = []) - { - $request = new CreateWorkloadRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setWorkload($workload); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['externalId'])) { - $request->setExternalId($optionalArgs['externalId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('CreateWorkload', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Deletes the workload. Make sure that workload's direct children are already - * in a deleted state, otherwise the request will fail with a - * FAILED_PRECONDITION error. - * In addition to assuredworkloads.workload.delete permission, the user should - * also have orgpolicy.policy.set permission on the deleted folder to remove - * Assured Workloads OrgPolicies. - * - * Sample code: - * ``` - * $assuredWorkloadsServiceClient = new AssuredWorkloadsServiceClient(); - * try { - * $formattedName = $assuredWorkloadsServiceClient->workloadName('[ORGANIZATION]', '[LOCATION]', '[WORKLOAD]'); - * $assuredWorkloadsServiceClient->deleteWorkload($formattedName); - * } finally { - * $assuredWorkloadsServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The `name` field is used to identify the workload. - * Format: - * organizations/{org_id}/locations/{location_id}/workloads/{workload_id} - * @param array $optionalArgs { - * Optional. - * - * @type string $etag - * Optional. The etag of the workload. - * If this is provided, it must match the server's etag. - * @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. - * } - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function deleteWorkload($name, array $optionalArgs = []) - { - $request = new DeleteWorkloadRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['etag'])) { - $request->setEtag($optionalArgs['etag']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('DeleteWorkload', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets Assured Workload associated with a CRM Node - * - * Sample code: - * ``` - * $assuredWorkloadsServiceClient = new AssuredWorkloadsServiceClient(); - * try { - * $formattedName = $assuredWorkloadsServiceClient->workloadName('[ORGANIZATION]', '[LOCATION]', '[WORKLOAD]'); - * $response = $assuredWorkloadsServiceClient->getWorkload($formattedName); - * } finally { - * $assuredWorkloadsServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the Workload to fetch. This is the workloads's - * relative path in the API, formatted as - * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". - * For example, - * "organizations/123/locations/us-east1/workloads/assured-workload-1". - * @param array $optionalArgs { - * 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 \Google\Cloud\AssuredWorkloads\V1beta1\Workload - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function getWorkload($name, array $optionalArgs = []) - { - $request = new GetWorkloadRequest(); - $request->setName($name); - return $this->startCall('GetWorkload', Workload::class, $optionalArgs, $request)->wait(); - } - - /** - * Lists Assured Workloads under a CRM Node. - * - * Sample code: - * ``` - * $assuredWorkloadsServiceClient = new AssuredWorkloadsServiceClient(); - * try { - * $formattedParent = $assuredWorkloadsServiceClient->locationName('[ORGANIZATION]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $assuredWorkloadsServiceClient->listWorkloads($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $assuredWorkloadsServiceClient->listWorkloads($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $assuredWorkloadsServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. Parent Resource to list workloads from. - * Must be of the form `organizations/{org_id}/locations/{location}`. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $filter - * A custom filter for filtering by properties of a workload. At this time, - * only filtering by labels is supported. - * @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 \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function listWorkloads($parent, array $optionalArgs = []) - { - $request = new ListWorkloadsRequest(); - $request->setParent($parent); - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - return $this->getPagedListResponse('ListWorkloads', $optionalArgs, ListWorkloadsResponse::class, $request); - } - - /** - * Restrict the list of resources allowed in the Workload environment. - * The current list of allowed products can be found at - * https://cloud.google.com/assured-workloads/docs/supported-products - * In addition to assuredworkloads.workload.update permission, the user should - * also have orgpolicy.policy.set permission on the folder resource - * to use this functionality. - * - * Sample code: - * ``` - * $assuredWorkloadsServiceClient = new AssuredWorkloadsServiceClient(); - * try { - * $name = 'name'; - * $restrictionType = RestrictionType::RESTRICTION_TYPE_UNSPECIFIED; - * $response = $assuredWorkloadsServiceClient->restrictAllowedResources($name, $restrictionType); - * } finally { - * $assuredWorkloadsServiceClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the Workload. This is the workloads's - * relative path in the API, formatted as - * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". - * For example, - * "organizations/123/locations/us-east1/workloads/assured-workload-1". - * @param int $restrictionType Required. The type of restriction for using gcp products in the Workload environment. - * For allowed values, use constants defined on {@see \Google\Cloud\AssuredWorkloads\V1beta1\RestrictAllowedResourcesRequest\RestrictionType} - * @param array $optionalArgs { - * 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 \Google\Cloud\AssuredWorkloads\V1beta1\RestrictAllowedResourcesResponse - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function restrictAllowedResources($name, $restrictionType, array $optionalArgs = []) - { - $request = new RestrictAllowedResourcesRequest(); - $requestParamHeaders = []; - $request->setName($name); - $request->setRestrictionType($restrictionType); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('RestrictAllowedResources', RestrictAllowedResourcesResponse::class, $optionalArgs, $request)->wait(); - } - - /** - * Updates an existing workload. - * Currently allows updating of workload display_name and labels. - * For force updates don't set etag field in the Workload. - * Only one update operation per workload can be in progress. - * - * Sample code: - * ``` - * $assuredWorkloadsServiceClient = new AssuredWorkloadsServiceClient(); - * try { - * $workload = new Workload(); - * $updateMask = new FieldMask(); - * $response = $assuredWorkloadsServiceClient->updateWorkload($workload, $updateMask); - * } finally { - * $assuredWorkloadsServiceClient->close(); - * } - * ``` - * - * @param Workload $workload Required. The workload to update. - * The workload's `name` field is used to identify the workload to be updated. - * Format: - * organizations/{org_id}/locations/{location_id}/workloads/{workload_id} - * @param FieldMask $updateMask Required. The list of fields to be updated. - * @param array $optionalArgs { - * 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 \Google\Cloud\AssuredWorkloads\V1beta1\Workload - * - * @throws ApiException if the remote call fails - * - * @experimental - */ - public function updateWorkload($workload, $updateMask, array $optionalArgs = []) - { - $request = new UpdateWorkloadRequest(); - $request->setWorkload($workload); - $request->setUpdateMask($updateMask); - return $this->startCall('UpdateWorkload', Workload::class, $optionalArgs, $request)->wait(); - } -} diff --git a/AssuredWorkloads/src/V1beta1/GetWorkloadRequest.php b/AssuredWorkloads/src/V1beta1/GetWorkloadRequest.php deleted file mode 100644 index ddc24db8f691..000000000000 --- a/AssuredWorkloads/src/V1beta1/GetWorkloadRequest.php +++ /dev/null @@ -1,83 +0,0 @@ -google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest - */ -class GetWorkloadRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the Workload to fetch. This is the workloads's - * relative path in the API, formatted as - * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". - * For example, - * "organizations/123/locations/us-east1/workloads/assured-workload-1". - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The resource name of the Workload to fetch. This is the workloads's - * relative path in the API, formatted as - * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". - * For example, - * "organizations/123/locations/us-east1/workloads/assured-workload-1". - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Assuredworkloads\V1Beta1\Assuredworkloads::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the Workload to fetch. This is the workloads's - * relative path in the API, formatted as - * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". - * For example, - * "organizations/123/locations/us-east1/workloads/assured-workload-1". - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The resource name of the Workload to fetch. This is the workloads's - * relative path in the API, formatted as - * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". - * For example, - * "organizations/123/locations/us-east1/workloads/assured-workload-1". - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/AssuredWorkloads/src/V1beta1/ListWorkloadsRequest.php b/AssuredWorkloads/src/V1beta1/ListWorkloadsRequest.php deleted file mode 100644 index 886782a32a43..000000000000 --- a/AssuredWorkloads/src/V1beta1/ListWorkloadsRequest.php +++ /dev/null @@ -1,185 +0,0 @@ -google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest - */ -class ListWorkloadsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Parent Resource to list workloads from. - * Must be of the form `organizations/{org_id}/locations/{location}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $parent = ''; - /** - * Page size. - * - * Generated from protobuf field int32 page_size = 2; - */ - private $page_size = 0; - /** - * Page token returned from previous request. Page token contains context from - * previous request. Page token needs to be passed in the second and following - * requests. - * - * Generated from protobuf field string page_token = 3; - */ - private $page_token = ''; - /** - * A custom filter for filtering by properties of a workload. At this time, - * only filtering by labels is supported. - * - * Generated from protobuf field string filter = 4; - */ - private $filter = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. Parent Resource to list workloads from. - * Must be of the form `organizations/{org_id}/locations/{location}`. - * @type int $page_size - * Page size. - * @type string $page_token - * Page token returned from previous request. Page token contains context from - * previous request. Page token needs to be passed in the second and following - * requests. - * @type string $filter - * A custom filter for filtering by properties of a workload. At this time, - * only filtering by labels is supported. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Assuredworkloads\V1Beta1\Assuredworkloads::initOnce(); - parent::__construct($data); - } - - /** - * Required. Parent Resource to list workloads from. - * Must be of the form `organizations/{org_id}/locations/{location}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. Parent Resource to list workloads from. - * Must be of the form `organizations/{org_id}/locations/{location}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Page size. - * - * Generated from protobuf field int32 page_size = 2; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Page size. - * - * Generated from protobuf field int32 page_size = 2; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * Page token returned from previous request. Page token contains context from - * previous request. Page token needs to be passed in the second and following - * requests. - * - * Generated from protobuf field string page_token = 3; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Page token returned from previous request. Page token contains context from - * previous request. Page token needs to be passed in the second and following - * requests. - * - * Generated from protobuf field string page_token = 3; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - - /** - * A custom filter for filtering by properties of a workload. At this time, - * only filtering by labels is supported. - * - * Generated from protobuf field string filter = 4; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * A custom filter for filtering by properties of a workload. At this time, - * only filtering by labels is supported. - * - * Generated from protobuf field string filter = 4; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - -} - diff --git a/AssuredWorkloads/src/V1beta1/ListWorkloadsResponse.php b/AssuredWorkloads/src/V1beta1/ListWorkloadsResponse.php deleted file mode 100644 index cbb1c3f37e61..000000000000 --- a/AssuredWorkloads/src/V1beta1/ListWorkloadsResponse.php +++ /dev/null @@ -1,101 +0,0 @@ -google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse - */ -class ListWorkloadsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * List of Workloads under a given parent. - * - * Generated from protobuf field repeated .google.cloud.assuredworkloads.v1beta1.Workload workloads = 1; - */ - private $workloads; - /** - * The next page token. Return empty if reached the last page. - * - * Generated from protobuf field string next_page_token = 2; - */ - private $next_page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\AssuredWorkloads\V1beta1\Workload>|\Google\Protobuf\Internal\RepeatedField $workloads - * List of Workloads under a given parent. - * @type string $next_page_token - * The next page token. Return empty if reached the last page. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Assuredworkloads\V1Beta1\Assuredworkloads::initOnce(); - parent::__construct($data); - } - - /** - * List of Workloads under a given parent. - * - * Generated from protobuf field repeated .google.cloud.assuredworkloads.v1beta1.Workload workloads = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getWorkloads() - { - return $this->workloads; - } - - /** - * List of Workloads under a given parent. - * - * Generated from protobuf field repeated .google.cloud.assuredworkloads.v1beta1.Workload workloads = 1; - * @param array<\Google\Cloud\AssuredWorkloads\V1beta1\Workload>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setWorkloads($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AssuredWorkloads\V1beta1\Workload::class); - $this->workloads = $arr; - - return $this; - } - - /** - * The next page token. Return empty if reached the last page. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * The next page token. Return empty if reached the last page. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - -} - diff --git a/AssuredWorkloads/src/V1beta1/README.md b/AssuredWorkloads/src/V1beta1/README.md deleted file mode 100644 index c923670fae12..000000000000 --- a/AssuredWorkloads/src/V1beta1/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# Google Cloud Assured Workloads V1beta1 generated client for PHP - -### Sample - -```php -require 'vendor/autoload.php'; - -use Google\Cloud\AssuredWorkloads\V1beta1\AssuredWorkloadsServiceClient; - -$client = new AssuredWorkloadsServiceClient(); - -$workloads = $client->listWorkloads( - AssuredWorkloadsServiceClient::locationNAme('[MY_ORGANIZATION'], 'us-west1') -); - -foreach ($workloads as $workload) { - print 'Workload: ' . $workload->getName() . PHP_EOL; -} -``` diff --git a/AssuredWorkloads/src/V1beta1/RestrictAllowedResourcesRequest.php b/AssuredWorkloads/src/V1beta1/RestrictAllowedResourcesRequest.php deleted file mode 100644 index 7367d285f25e..000000000000 --- a/AssuredWorkloads/src/V1beta1/RestrictAllowedResourcesRequest.php +++ /dev/null @@ -1,117 +0,0 @@ -google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesRequest - */ -class RestrictAllowedResourcesRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the Workload. This is the workloads's - * relative path in the API, formatted as - * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". - * For example, - * "organizations/123/locations/us-east1/workloads/assured-workload-1". - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $name = ''; - /** - * Required. The type of restriction for using gcp products in the Workload environment. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesRequest.RestrictionType restriction_type = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $restriction_type = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The resource name of the Workload. This is the workloads's - * relative path in the API, formatted as - * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". - * For example, - * "organizations/123/locations/us-east1/workloads/assured-workload-1". - * @type int $restriction_type - * Required. The type of restriction for using gcp products in the Workload environment. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Assuredworkloads\V1Beta1\Assuredworkloads::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the Workload. This is the workloads's - * relative path in the API, formatted as - * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". - * For example, - * "organizations/123/locations/us-east1/workloads/assured-workload-1". - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The resource name of the Workload. This is the workloads's - * relative path in the API, formatted as - * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". - * For example, - * "organizations/123/locations/us-east1/workloads/assured-workload-1". - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Required. The type of restriction for using gcp products in the Workload environment. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesRequest.RestrictionType restriction_type = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return int - */ - public function getRestrictionType() - { - return $this->restriction_type; - } - - /** - * Required. The type of restriction for using gcp products in the Workload environment. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesRequest.RestrictionType restriction_type = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param int $var - * @return $this - */ - public function setRestrictionType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\AssuredWorkloads\V1beta1\RestrictAllowedResourcesRequest\RestrictionType::class); - $this->restriction_type = $var; - - return $this; - } - -} - diff --git a/AssuredWorkloads/src/V1beta1/RestrictAllowedResourcesRequest/RestrictionType.php b/AssuredWorkloads/src/V1beta1/RestrictAllowedResourcesRequest/RestrictionType.php deleted file mode 100644 index b6587e19dd4d..000000000000 --- a/AssuredWorkloads/src/V1beta1/RestrictAllowedResourcesRequest/RestrictionType.php +++ /dev/null @@ -1,68 +0,0 @@ -google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesRequest.RestrictionType - */ -class RestrictionType -{ - /** - * Unknown restriction type. - * - * Generated from protobuf enum RESTRICTION_TYPE_UNSPECIFIED = 0; - */ - const RESTRICTION_TYPE_UNSPECIFIED = 0; - /** - * Allow the use all of all gcp products, irrespective of the compliance - * posture. This effectively removes gcp.restrictServiceUsage OrgPolicy - * on the AssuredWorkloads Folder. - * - * Generated from protobuf enum ALLOW_ALL_GCP_RESOURCES = 1; - */ - const ALLOW_ALL_GCP_RESOURCES = 1; - /** - * Based on Workload's compliance regime, allowed list changes. - * See - https://cloud.google.com/assured-workloads/docs/supported-products - * for the list of supported resources. - * - * Generated from protobuf enum ALLOW_COMPLIANT_RESOURCES = 2; - */ - const ALLOW_COMPLIANT_RESOURCES = 2; - - private static $valueToName = [ - self::RESTRICTION_TYPE_UNSPECIFIED => 'RESTRICTION_TYPE_UNSPECIFIED', - self::ALLOW_ALL_GCP_RESOURCES => 'ALLOW_ALL_GCP_RESOURCES', - self::ALLOW_COMPLIANT_RESOURCES => 'ALLOW_COMPLIANT_RESOURCES', - ]; - - 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); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(RestrictionType::class, \Google\Cloud\AssuredWorkloads\V1beta1\RestrictAllowedResourcesRequest_RestrictionType::class); - diff --git a/AssuredWorkloads/src/V1beta1/RestrictAllowedResourcesRequest_RestrictionType.php b/AssuredWorkloads/src/V1beta1/RestrictAllowedResourcesRequest_RestrictionType.php deleted file mode 100644 index 42268d62e7b7..000000000000 --- a/AssuredWorkloads/src/V1beta1/RestrictAllowedResourcesRequest_RestrictionType.php +++ /dev/null @@ -1,16 +0,0 @@ -google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesResponse - */ -class RestrictAllowedResourcesResponse extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Assuredworkloads\V1Beta1\Assuredworkloads::initOnce(); - parent::__construct($data); - } - -} - diff --git a/AssuredWorkloads/src/V1beta1/UpdateWorkloadRequest.php b/AssuredWorkloads/src/V1beta1/UpdateWorkloadRequest.php deleted file mode 100644 index af5e97b5f06d..000000000000 --- a/AssuredWorkloads/src/V1beta1/UpdateWorkloadRequest.php +++ /dev/null @@ -1,133 +0,0 @@ -google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest - */ -class UpdateWorkloadRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The workload to update. - * The workload's `name` field is used to identify the workload to be updated. - * Format: - * organizations/{org_id}/locations/{location_id}/workloads/{workload_id} - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload workload = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $workload = null; - /** - * Required. The list of fields to be updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $update_mask = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\AssuredWorkloads\V1beta1\Workload $workload - * Required. The workload to update. - * The workload's `name` field is used to identify the workload to be updated. - * Format: - * organizations/{org_id}/locations/{location_id}/workloads/{workload_id} - * @type \Google\Protobuf\FieldMask $update_mask - * Required. The list of fields to be updated. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Assuredworkloads\V1Beta1\Assuredworkloads::initOnce(); - parent::__construct($data); - } - - /** - * Required. The workload to update. - * The workload's `name` field is used to identify the workload to be updated. - * Format: - * organizations/{org_id}/locations/{location_id}/workloads/{workload_id} - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload workload = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\AssuredWorkloads\V1beta1\Workload|null - */ - public function getWorkload() - { - return $this->workload; - } - - public function hasWorkload() - { - return isset($this->workload); - } - - public function clearWorkload() - { - unset($this->workload); - } - - /** - * Required. The workload to update. - * The workload's `name` field is used to identify the workload to be updated. - * Format: - * organizations/{org_id}/locations/{location_id}/workloads/{workload_id} - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload workload = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\AssuredWorkloads\V1beta1\Workload $var - * @return $this - */ - public function setWorkload($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AssuredWorkloads\V1beta1\Workload::class); - $this->workload = $var; - - return $this; - } - - /** - * Required. The list of fields to be updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Protobuf\FieldMask|null - */ - public function getUpdateMask() - { - return $this->update_mask; - } - - public function hasUpdateMask() - { - return isset($this->update_mask); - } - - public function clearUpdateMask() - { - unset($this->update_mask); - } - - /** - * Required. The list of fields to be updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->update_mask = $var; - - return $this; - } - -} - diff --git a/AssuredWorkloads/src/V1beta1/Workload.php b/AssuredWorkloads/src/V1beta1/Workload.php deleted file mode 100644 index 7325a29fdb5a..000000000000 --- a/AssuredWorkloads/src/V1beta1/Workload.php +++ /dev/null @@ -1,882 +0,0 @@ -google.cloud.assuredworkloads.v1beta1.Workload - */ -class Workload extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. The resource name of the workload. - * Format: - * organizations/{organization}/locations/{location}/workloads/{workload} - * Read-only. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $name = ''; - /** - * Required. The user-assigned display name of the Workload. - * When present it must be between 4 to 30 characters. - * Allowed characters are: lowercase and uppercase letters, numbers, - * hyphen, and spaces. - * Example: My Workload - * - * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $display_name = ''; - /** - * Output only. The resources associated with this workload. - * These resources will be created when creating the workload. - * If any of the projects already exist, the workload creation will fail. - * Always read only. - * - * Generated from protobuf field repeated .google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo resources = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $resources; - /** - * Required. Immutable. Compliance Regime associated with this workload. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime compliance_regime = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; - */ - private $compliance_regime = 0; - /** - * Output only. Immutable. The Workload creation timestamp. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; - */ - private $create_time = null; - /** - * Output only. The billing account used for the resources which are - * direct children of workload. This billing account is initially associated - * with the resources created as part of Workload creation. - * After the initial creation of these resources, the customer can change - * the assigned billing account. - * The resource name has the form - * `billingAccounts/{billing_account_id}`. For example, - * `billingAccounts/012345-567890-ABCDEF`. - * - * Generated from protobuf field string billing_account = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $billing_account = ''; - /** - * Optional. ETag of the workload, it is calculated on the basis - * of the Workload contents. It will be used in Update & Delete operations. - * - * Generated from protobuf field string etag = 9 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $etag = ''; - /** - * Optional. Labels applied to the workload. - * - * Generated from protobuf field map labels = 10 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $labels; - /** - * Input only. The parent resource for the resources managed by this Assured Workload. May - * be either empty or a folder resource which is a child of the - * Workload parent. If not specified all resources are created under the - * parent organization. - * Format: - * folders/{folder_id} - * - * Generated from protobuf field string provisioned_resources_parent = 13 [(.google.api.field_behavior) = INPUT_ONLY]; - */ - private $provisioned_resources_parent = ''; - /** - * Input only. Settings used to create a CMEK crypto key. When set, a project with a KMS - * CMEK key is provisioned. - * This field is deprecated as of Feb 28, 2022. - * In order to create a Keyring, callers should specify, - * ENCRYPTION_KEYS_PROJECT or KEYRING in ResourceSettings.resource_type field. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 14 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY]; - * @deprecated - */ - protected $kms_settings = null; - /** - * Input only. Resource properties that are used to customize workload resources. - * These properties (such as custom project id) will be used to create - * workload resources if possible. This field is optional. - * - * Generated from protobuf field repeated .google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings resource_settings = 15 [(.google.api.field_behavior) = INPUT_ONLY]; - */ - private $resource_settings; - /** - * Output only. Represents the KAJ enrollment state of the given workload. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.KajEnrollmentState kaj_enrollment_state = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $kaj_enrollment_state = 0; - /** - * Optional. Indicates the sovereignty status of the given workload. - * Currently meant to be used by Europe/Canada customers. - * - * Generated from protobuf field bool enable_sovereign_controls = 18 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $enable_sovereign_controls = false; - /** - * Output only. Represents the SAA enrollment response of the given workload. - * SAA enrollment response is queried during GetWorkload call. - * In failure cases, user friendly error message is shown in SAA details page. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse saa_enrollment_response = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $saa_enrollment_response = null; - /** - * Output only. Urls for services which are compliant for this Assured Workload, but which - * are currently disallowed by the ResourceUsageRestriction org policy. - * Invoke RestrictAllowedResources endpoint to allow your project developers - * to use these services in their environment." - * - * Generated from protobuf field repeated string compliant_but_disallowed_services = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $compliant_but_disallowed_services; - protected $compliance_regime_settings; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Optional. The resource name of the workload. - * Format: - * organizations/{organization}/locations/{location}/workloads/{workload} - * Read-only. - * @type string $display_name - * Required. The user-assigned display name of the Workload. - * When present it must be between 4 to 30 characters. - * Allowed characters are: lowercase and uppercase letters, numbers, - * hyphen, and spaces. - * Example: My Workload - * @type array<\Google\Cloud\AssuredWorkloads\V1beta1\Workload\ResourceInfo>|\Google\Protobuf\Internal\RepeatedField $resources - * Output only. The resources associated with this workload. - * These resources will be created when creating the workload. - * If any of the projects already exist, the workload creation will fail. - * Always read only. - * @type int $compliance_regime - * Required. Immutable. Compliance Regime associated with this workload. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. Immutable. The Workload creation timestamp. - * @type string $billing_account - * Output only. The billing account used for the resources which are - * direct children of workload. This billing account is initially associated - * with the resources created as part of Workload creation. - * After the initial creation of these resources, the customer can change - * the assigned billing account. - * The resource name has the form - * `billingAccounts/{billing_account_id}`. For example, - * `billingAccounts/012345-567890-ABCDEF`. - * @type \Google\Cloud\AssuredWorkloads\V1beta1\Workload\IL4Settings $il4_settings - * Input only. Immutable. Settings specific to resources needed for IL4. - * @type \Google\Cloud\AssuredWorkloads\V1beta1\Workload\CJISSettings $cjis_settings - * Input only. Immutable. Settings specific to resources needed for CJIS. - * @type \Google\Cloud\AssuredWorkloads\V1beta1\Workload\FedrampHighSettings $fedramp_high_settings - * Input only. Immutable. Settings specific to resources needed for FedRAMP High. - * @type \Google\Cloud\AssuredWorkloads\V1beta1\Workload\FedrampModerateSettings $fedramp_moderate_settings - * Input only. Immutable. Settings specific to resources needed for FedRAMP Moderate. - * @type string $etag - * Optional. ETag of the workload, it is calculated on the basis - * of the Workload contents. It will be used in Update & Delete operations. - * @type array|\Google\Protobuf\Internal\MapField $labels - * Optional. Labels applied to the workload. - * @type string $provisioned_resources_parent - * Input only. The parent resource for the resources managed by this Assured Workload. May - * be either empty or a folder resource which is a child of the - * Workload parent. If not specified all resources are created under the - * parent organization. - * Format: - * folders/{folder_id} - * @type \Google\Cloud\AssuredWorkloads\V1beta1\Workload\KMSSettings $kms_settings - * Input only. Settings used to create a CMEK crypto key. When set, a project with a KMS - * CMEK key is provisioned. - * This field is deprecated as of Feb 28, 2022. - * In order to create a Keyring, callers should specify, - * ENCRYPTION_KEYS_PROJECT or KEYRING in ResourceSettings.resource_type field. - * @type array<\Google\Cloud\AssuredWorkloads\V1beta1\Workload\ResourceSettings>|\Google\Protobuf\Internal\RepeatedField $resource_settings - * Input only. Resource properties that are used to customize workload resources. - * These properties (such as custom project id) will be used to create - * workload resources if possible. This field is optional. - * @type int $kaj_enrollment_state - * Output only. Represents the KAJ enrollment state of the given workload. - * @type bool $enable_sovereign_controls - * Optional. Indicates the sovereignty status of the given workload. - * Currently meant to be used by Europe/Canada customers. - * @type \Google\Cloud\AssuredWorkloads\V1beta1\Workload\SaaEnrollmentResponse $saa_enrollment_response - * Output only. Represents the SAA enrollment response of the given workload. - * SAA enrollment response is queried during GetWorkload call. - * In failure cases, user friendly error message is shown in SAA details page. - * @type array|\Google\Protobuf\Internal\RepeatedField $compliant_but_disallowed_services - * Output only. Urls for services which are compliant for this Assured Workload, but which - * are currently disallowed by the ResourceUsageRestriction org policy. - * Invoke RestrictAllowedResources endpoint to allow your project developers - * to use these services in their environment." - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Assuredworkloads\V1Beta1\Assuredworkloads::initOnce(); - parent::__construct($data); - } - - /** - * Optional. The resource name of the workload. - * Format: - * organizations/{organization}/locations/{location}/workloads/{workload} - * Read-only. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Optional. The resource name of the workload. - * Format: - * organizations/{organization}/locations/{location}/workloads/{workload} - * Read-only. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Required. The user-assigned display name of the Workload. - * When present it must be between 4 to 30 characters. - * Allowed characters are: lowercase and uppercase letters, numbers, - * hyphen, and spaces. - * Example: My Workload - * - * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getDisplayName() - { - return $this->display_name; - } - - /** - * Required. The user-assigned display name of the Workload. - * When present it must be between 4 to 30 characters. - * Allowed characters are: lowercase and uppercase letters, numbers, - * hyphen, and spaces. - * Example: My Workload - * - * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setDisplayName($var) - { - GPBUtil::checkString($var, True); - $this->display_name = $var; - - return $this; - } - - /** - * Output only. The resources associated with this workload. - * These resources will be created when creating the workload. - * If any of the projects already exist, the workload creation will fail. - * Always read only. - * - * Generated from protobuf field repeated .google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo resources = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getResources() - { - return $this->resources; - } - - /** - * Output only. The resources associated with this workload. - * These resources will be created when creating the workload. - * If any of the projects already exist, the workload creation will fail. - * Always read only. - * - * Generated from protobuf field repeated .google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo resources = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param array<\Google\Cloud\AssuredWorkloads\V1beta1\Workload\ResourceInfo>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setResources($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AssuredWorkloads\V1beta1\Workload\ResourceInfo::class); - $this->resources = $arr; - - return $this; - } - - /** - * Required. Immutable. Compliance Regime associated with this workload. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime compliance_regime = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; - * @return int - */ - public function getComplianceRegime() - { - return $this->compliance_regime; - } - - /** - * Required. Immutable. Compliance Regime associated with this workload. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime compliance_regime = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; - * @param int $var - * @return $this - */ - public function setComplianceRegime($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\AssuredWorkloads\V1beta1\Workload\ComplianceRegime::class); - $this->compliance_regime = $var; - - return $this; - } - - /** - * Output only. Immutable. The Workload creation timestamp. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * Output only. Immutable. The Workload creation timestamp. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. The billing account used for the resources which are - * direct children of workload. This billing account is initially associated - * with the resources created as part of Workload creation. - * After the initial creation of these resources, the customer can change - * the assigned billing account. - * The resource name has the form - * `billingAccounts/{billing_account_id}`. For example, - * `billingAccounts/012345-567890-ABCDEF`. - * - * Generated from protobuf field string billing_account = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getBillingAccount() - { - return $this->billing_account; - } - - /** - * Output only. The billing account used for the resources which are - * direct children of workload. This billing account is initially associated - * with the resources created as part of Workload creation. - * After the initial creation of these resources, the customer can change - * the assigned billing account. - * The resource name has the form - * `billingAccounts/{billing_account_id}`. For example, - * `billingAccounts/012345-567890-ABCDEF`. - * - * Generated from protobuf field string billing_account = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setBillingAccount($var) - { - GPBUtil::checkString($var, True); - $this->billing_account = $var; - - return $this; - } - - /** - * Input only. Immutable. Settings specific to resources needed for IL4. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings il4_settings = 7 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; - * @return \Google\Cloud\AssuredWorkloads\V1beta1\Workload\IL4Settings|null - * @deprecated - */ - public function getIl4Settings() - { - @trigger_error('il4_settings is deprecated.', E_USER_DEPRECATED); - return $this->readOneof(7); - } - - public function hasIl4Settings() - { - @trigger_error('il4_settings is deprecated.', E_USER_DEPRECATED); - return $this->hasOneof(7); - } - - /** - * Input only. Immutable. Settings specific to resources needed for IL4. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings il4_settings = 7 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; - * @param \Google\Cloud\AssuredWorkloads\V1beta1\Workload\IL4Settings $var - * @return $this - * @deprecated - */ - public function setIl4Settings($var) - { - @trigger_error('il4_settings is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkMessage($var, \Google\Cloud\AssuredWorkloads\V1beta1\Workload\IL4Settings::class); - $this->writeOneof(7, $var); - - return $this; - } - - /** - * Input only. Immutable. Settings specific to resources needed for CJIS. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings cjis_settings = 8 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; - * @return \Google\Cloud\AssuredWorkloads\V1beta1\Workload\CJISSettings|null - * @deprecated - */ - public function getCjisSettings() - { - @trigger_error('cjis_settings is deprecated.', E_USER_DEPRECATED); - return $this->readOneof(8); - } - - public function hasCjisSettings() - { - @trigger_error('cjis_settings is deprecated.', E_USER_DEPRECATED); - return $this->hasOneof(8); - } - - /** - * Input only. Immutable. Settings specific to resources needed for CJIS. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings cjis_settings = 8 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; - * @param \Google\Cloud\AssuredWorkloads\V1beta1\Workload\CJISSettings $var - * @return $this - * @deprecated - */ - public function setCjisSettings($var) - { - @trigger_error('cjis_settings is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkMessage($var, \Google\Cloud\AssuredWorkloads\V1beta1\Workload\CJISSettings::class); - $this->writeOneof(8, $var); - - return $this; - } - - /** - * Input only. Immutable. Settings specific to resources needed for FedRAMP High. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings fedramp_high_settings = 11 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; - * @return \Google\Cloud\AssuredWorkloads\V1beta1\Workload\FedrampHighSettings|null - * @deprecated - */ - public function getFedrampHighSettings() - { - @trigger_error('fedramp_high_settings is deprecated.', E_USER_DEPRECATED); - return $this->readOneof(11); - } - - public function hasFedrampHighSettings() - { - @trigger_error('fedramp_high_settings is deprecated.', E_USER_DEPRECATED); - return $this->hasOneof(11); - } - - /** - * Input only. Immutable. Settings specific to resources needed for FedRAMP High. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings fedramp_high_settings = 11 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; - * @param \Google\Cloud\AssuredWorkloads\V1beta1\Workload\FedrampHighSettings $var - * @return $this - * @deprecated - */ - public function setFedrampHighSettings($var) - { - @trigger_error('fedramp_high_settings is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkMessage($var, \Google\Cloud\AssuredWorkloads\V1beta1\Workload\FedrampHighSettings::class); - $this->writeOneof(11, $var); - - return $this; - } - - /** - * Input only. Immutable. Settings specific to resources needed for FedRAMP Moderate. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings fedramp_moderate_settings = 12 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; - * @return \Google\Cloud\AssuredWorkloads\V1beta1\Workload\FedrampModerateSettings|null - * @deprecated - */ - public function getFedrampModerateSettings() - { - @trigger_error('fedramp_moderate_settings is deprecated.', E_USER_DEPRECATED); - return $this->readOneof(12); - } - - public function hasFedrampModerateSettings() - { - @trigger_error('fedramp_moderate_settings is deprecated.', E_USER_DEPRECATED); - return $this->hasOneof(12); - } - - /** - * Input only. Immutable. Settings specific to resources needed for FedRAMP Moderate. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings fedramp_moderate_settings = 12 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; - * @param \Google\Cloud\AssuredWorkloads\V1beta1\Workload\FedrampModerateSettings $var - * @return $this - * @deprecated - */ - public function setFedrampModerateSettings($var) - { - @trigger_error('fedramp_moderate_settings is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkMessage($var, \Google\Cloud\AssuredWorkloads\V1beta1\Workload\FedrampModerateSettings::class); - $this->writeOneof(12, $var); - - return $this; - } - - /** - * Optional. ETag of the workload, it is calculated on the basis - * of the Workload contents. It will be used in Update & Delete operations. - * - * Generated from protobuf field string etag = 9 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * Optional. ETag of the workload, it is calculated on the basis - * of the Workload contents. It will be used in Update & Delete operations. - * - * Generated from protobuf field string etag = 9 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - - /** - * Optional. Labels applied to the workload. - * - * Generated from protobuf field map labels = 10 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\MapField - */ - public function getLabels() - { - return $this->labels; - } - - /** - * Optional. Labels applied to the workload. - * - * Generated from protobuf field map labels = 10 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setLabels($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->labels = $arr; - - return $this; - } - - /** - * Input only. The parent resource for the resources managed by this Assured Workload. May - * be either empty or a folder resource which is a child of the - * Workload parent. If not specified all resources are created under the - * parent organization. - * Format: - * folders/{folder_id} - * - * Generated from protobuf field string provisioned_resources_parent = 13 [(.google.api.field_behavior) = INPUT_ONLY]; - * @return string - */ - public function getProvisionedResourcesParent() - { - return $this->provisioned_resources_parent; - } - - /** - * Input only. The parent resource for the resources managed by this Assured Workload. May - * be either empty or a folder resource which is a child of the - * Workload parent. If not specified all resources are created under the - * parent organization. - * Format: - * folders/{folder_id} - * - * Generated from protobuf field string provisioned_resources_parent = 13 [(.google.api.field_behavior) = INPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setProvisionedResourcesParent($var) - { - GPBUtil::checkString($var, True); - $this->provisioned_resources_parent = $var; - - return $this; - } - - /** - * Input only. Settings used to create a CMEK crypto key. When set, a project with a KMS - * CMEK key is provisioned. - * This field is deprecated as of Feb 28, 2022. - * In order to create a Keyring, callers should specify, - * ENCRYPTION_KEYS_PROJECT or KEYRING in ResourceSettings.resource_type field. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 14 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY]; - * @return \Google\Cloud\AssuredWorkloads\V1beta1\Workload\KMSSettings|null - * @deprecated - */ - public function getKmsSettings() - { - @trigger_error('kms_settings is deprecated.', E_USER_DEPRECATED); - return $this->kms_settings; - } - - public function hasKmsSettings() - { - @trigger_error('kms_settings is deprecated.', E_USER_DEPRECATED); - return isset($this->kms_settings); - } - - public function clearKmsSettings() - { - @trigger_error('kms_settings is deprecated.', E_USER_DEPRECATED); - unset($this->kms_settings); - } - - /** - * Input only. Settings used to create a CMEK crypto key. When set, a project with a KMS - * CMEK key is provisioned. - * This field is deprecated as of Feb 28, 2022. - * In order to create a Keyring, callers should specify, - * ENCRYPTION_KEYS_PROJECT or KEYRING in ResourceSettings.resource_type field. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 14 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY]; - * @param \Google\Cloud\AssuredWorkloads\V1beta1\Workload\KMSSettings $var - * @return $this - * @deprecated - */ - public function setKmsSettings($var) - { - @trigger_error('kms_settings is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkMessage($var, \Google\Cloud\AssuredWorkloads\V1beta1\Workload\KMSSettings::class); - $this->kms_settings = $var; - - return $this; - } - - /** - * Input only. Resource properties that are used to customize workload resources. - * These properties (such as custom project id) will be used to create - * workload resources if possible. This field is optional. - * - * Generated from protobuf field repeated .google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings resource_settings = 15 [(.google.api.field_behavior) = INPUT_ONLY]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getResourceSettings() - { - return $this->resource_settings; - } - - /** - * Input only. Resource properties that are used to customize workload resources. - * These properties (such as custom project id) will be used to create - * workload resources if possible. This field is optional. - * - * Generated from protobuf field repeated .google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings resource_settings = 15 [(.google.api.field_behavior) = INPUT_ONLY]; - * @param array<\Google\Cloud\AssuredWorkloads\V1beta1\Workload\ResourceSettings>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setResourceSettings($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AssuredWorkloads\V1beta1\Workload\ResourceSettings::class); - $this->resource_settings = $arr; - - return $this; - } - - /** - * Output only. Represents the KAJ enrollment state of the given workload. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.KajEnrollmentState kaj_enrollment_state = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getKajEnrollmentState() - { - return $this->kaj_enrollment_state; - } - - /** - * Output only. Represents the KAJ enrollment state of the given workload. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.KajEnrollmentState kaj_enrollment_state = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setKajEnrollmentState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\AssuredWorkloads\V1beta1\Workload\KajEnrollmentState::class); - $this->kaj_enrollment_state = $var; - - return $this; - } - - /** - * Optional. Indicates the sovereignty status of the given workload. - * Currently meant to be used by Europe/Canada customers. - * - * Generated from protobuf field bool enable_sovereign_controls = 18 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getEnableSovereignControls() - { - return $this->enable_sovereign_controls; - } - - /** - * Optional. Indicates the sovereignty status of the given workload. - * Currently meant to be used by Europe/Canada customers. - * - * Generated from protobuf field bool enable_sovereign_controls = 18 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setEnableSovereignControls($var) - { - GPBUtil::checkBool($var); - $this->enable_sovereign_controls = $var; - - return $this; - } - - /** - * Output only. Represents the SAA enrollment response of the given workload. - * SAA enrollment response is queried during GetWorkload call. - * In failure cases, user friendly error message is shown in SAA details page. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse saa_enrollment_response = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\AssuredWorkloads\V1beta1\Workload\SaaEnrollmentResponse|null - */ - public function getSaaEnrollmentResponse() - { - return $this->saa_enrollment_response; - } - - public function hasSaaEnrollmentResponse() - { - return isset($this->saa_enrollment_response); - } - - public function clearSaaEnrollmentResponse() - { - unset($this->saa_enrollment_response); - } - - /** - * Output only. Represents the SAA enrollment response of the given workload. - * SAA enrollment response is queried during GetWorkload call. - * In failure cases, user friendly error message is shown in SAA details page. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse saa_enrollment_response = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\AssuredWorkloads\V1beta1\Workload\SaaEnrollmentResponse $var - * @return $this - */ - public function setSaaEnrollmentResponse($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AssuredWorkloads\V1beta1\Workload\SaaEnrollmentResponse::class); - $this->saa_enrollment_response = $var; - - return $this; - } - - /** - * Output only. Urls for services which are compliant for this Assured Workload, but which - * are currently disallowed by the ResourceUsageRestriction org policy. - * Invoke RestrictAllowedResources endpoint to allow your project developers - * to use these services in their environment." - * - * Generated from protobuf field repeated string compliant_but_disallowed_services = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getCompliantButDisallowedServices() - { - return $this->compliant_but_disallowed_services; - } - - /** - * Output only. Urls for services which are compliant for this Assured Workload, but which - * are currently disallowed by the ResourceUsageRestriction org policy. - * Invoke RestrictAllowedResources endpoint to allow your project developers - * to use these services in their environment." - * - * Generated from protobuf field repeated string compliant_but_disallowed_services = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setCompliantButDisallowedServices($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->compliant_but_disallowed_services = $arr; - - return $this; - } - - /** - * @return string - */ - public function getComplianceRegimeSettings() - { - return $this->whichOneof("compliance_regime_settings"); - } - -} - diff --git a/AssuredWorkloads/src/V1beta1/Workload/CJISSettings.php b/AssuredWorkloads/src/V1beta1/Workload/CJISSettings.php deleted file mode 100644 index 8bc80d4866cf..000000000000 --- a/AssuredWorkloads/src/V1beta1/Workload/CJISSettings.php +++ /dev/null @@ -1,81 +0,0 @@ -google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings - */ -class CJISSettings extends \Google\Protobuf\Internal\Message -{ - /** - * Input only. Immutable. Settings used to create a CMEK crypto key. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; - */ - private $kms_settings = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\AssuredWorkloads\V1beta1\Workload\KMSSettings $kms_settings - * Input only. Immutable. Settings used to create a CMEK crypto key. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Assuredworkloads\V1Beta1\Assuredworkloads::initOnce(); - parent::__construct($data); - } - - /** - * Input only. Immutable. Settings used to create a CMEK crypto key. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; - * @return \Google\Cloud\AssuredWorkloads\V1beta1\Workload\KMSSettings|null - */ - public function getKmsSettings() - { - return $this->kms_settings; - } - - public function hasKmsSettings() - { - return isset($this->kms_settings); - } - - public function clearKmsSettings() - { - unset($this->kms_settings); - } - - /** - * Input only. Immutable. Settings used to create a CMEK crypto key. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; - * @param \Google\Cloud\AssuredWorkloads\V1beta1\Workload\KMSSettings $var - * @return $this - */ - public function setKmsSettings($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AssuredWorkloads\V1beta1\Workload\KMSSettings::class); - $this->kms_settings = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(CJISSettings::class, \Google\Cloud\AssuredWorkloads\V1beta1\Workload_CJISSettings::class); - diff --git a/AssuredWorkloads/src/V1beta1/Workload/ComplianceRegime.php b/AssuredWorkloads/src/V1beta1/Workload/ComplianceRegime.php deleted file mode 100644 index 2a313655a862..000000000000 --- a/AssuredWorkloads/src/V1beta1/Workload/ComplianceRegime.php +++ /dev/null @@ -1,127 +0,0 @@ -google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime - */ -class ComplianceRegime -{ - /** - * Unknown compliance regime. - * - * Generated from protobuf enum COMPLIANCE_REGIME_UNSPECIFIED = 0; - */ - const COMPLIANCE_REGIME_UNSPECIFIED = 0; - /** - * Information protection as per DoD IL4 requirements. - * - * Generated from protobuf enum IL4 = 1; - */ - const IL4 = 1; - /** - * Criminal Justice Information Services (CJIS) Security policies. - * - * Generated from protobuf enum CJIS = 2; - */ - const CJIS = 2; - /** - * FedRAMP High data protection controls - * - * Generated from protobuf enum FEDRAMP_HIGH = 3; - */ - const FEDRAMP_HIGH = 3; - /** - * FedRAMP Moderate data protection controls - * - * Generated from protobuf enum FEDRAMP_MODERATE = 4; - */ - const FEDRAMP_MODERATE = 4; - /** - * Assured Workloads For US Regions data protection controls - * - * Generated from protobuf enum US_REGIONAL_ACCESS = 5; - */ - const US_REGIONAL_ACCESS = 5; - /** - * Health Insurance Portability and Accountability Act controls - * - * Generated from protobuf enum HIPAA = 6; - */ - const HIPAA = 6; - /** - * Health Information Trust Alliance controls - * - * Generated from protobuf enum HITRUST = 7; - */ - const HITRUST = 7; - /** - * Assured Workloads For EU Regions and Support controls - * - * Generated from protobuf enum EU_REGIONS_AND_SUPPORT = 8; - */ - const EU_REGIONS_AND_SUPPORT = 8; - /** - * Assured Workloads For Canada Regions and Support controls - * - * Generated from protobuf enum CA_REGIONS_AND_SUPPORT = 9; - */ - const CA_REGIONS_AND_SUPPORT = 9; - /** - * International Traffic in Arms Regulations - * - * Generated from protobuf enum ITAR = 10; - */ - const ITAR = 10; - /** - * Assured Workloads for Australia Regions and Support controls - * - * Generated from protobuf enum AU_REGIONS_AND_US_SUPPORT = 11; - */ - const AU_REGIONS_AND_US_SUPPORT = 11; - - private static $valueToName = [ - self::COMPLIANCE_REGIME_UNSPECIFIED => 'COMPLIANCE_REGIME_UNSPECIFIED', - self::IL4 => 'IL4', - self::CJIS => 'CJIS', - self::FEDRAMP_HIGH => 'FEDRAMP_HIGH', - self::FEDRAMP_MODERATE => 'FEDRAMP_MODERATE', - self::US_REGIONAL_ACCESS => 'US_REGIONAL_ACCESS', - self::HIPAA => 'HIPAA', - self::HITRUST => 'HITRUST', - self::EU_REGIONS_AND_SUPPORT => 'EU_REGIONS_AND_SUPPORT', - self::CA_REGIONS_AND_SUPPORT => 'CA_REGIONS_AND_SUPPORT', - self::ITAR => 'ITAR', - self::AU_REGIONS_AND_US_SUPPORT => 'AU_REGIONS_AND_US_SUPPORT', - ]; - - 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); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ComplianceRegime::class, \Google\Cloud\AssuredWorkloads\V1beta1\Workload_ComplianceRegime::class); - diff --git a/AssuredWorkloads/src/V1beta1/Workload/FedrampHighSettings.php b/AssuredWorkloads/src/V1beta1/Workload/FedrampHighSettings.php deleted file mode 100644 index e74383103c46..000000000000 --- a/AssuredWorkloads/src/V1beta1/Workload/FedrampHighSettings.php +++ /dev/null @@ -1,81 +0,0 @@ -google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings - */ -class FedrampHighSettings extends \Google\Protobuf\Internal\Message -{ - /** - * Input only. Immutable. Settings used to create a CMEK crypto key. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; - */ - private $kms_settings = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\AssuredWorkloads\V1beta1\Workload\KMSSettings $kms_settings - * Input only. Immutable. Settings used to create a CMEK crypto key. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Assuredworkloads\V1Beta1\Assuredworkloads::initOnce(); - parent::__construct($data); - } - - /** - * Input only. Immutable. Settings used to create a CMEK crypto key. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; - * @return \Google\Cloud\AssuredWorkloads\V1beta1\Workload\KMSSettings|null - */ - public function getKmsSettings() - { - return $this->kms_settings; - } - - public function hasKmsSettings() - { - return isset($this->kms_settings); - } - - public function clearKmsSettings() - { - unset($this->kms_settings); - } - - /** - * Input only. Immutable. Settings used to create a CMEK crypto key. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; - * @param \Google\Cloud\AssuredWorkloads\V1beta1\Workload\KMSSettings $var - * @return $this - */ - public function setKmsSettings($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AssuredWorkloads\V1beta1\Workload\KMSSettings::class); - $this->kms_settings = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(FedrampHighSettings::class, \Google\Cloud\AssuredWorkloads\V1beta1\Workload_FedrampHighSettings::class); - diff --git a/AssuredWorkloads/src/V1beta1/Workload/FedrampModerateSettings.php b/AssuredWorkloads/src/V1beta1/Workload/FedrampModerateSettings.php deleted file mode 100644 index c40f0181afb7..000000000000 --- a/AssuredWorkloads/src/V1beta1/Workload/FedrampModerateSettings.php +++ /dev/null @@ -1,81 +0,0 @@ -google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings - */ -class FedrampModerateSettings extends \Google\Protobuf\Internal\Message -{ - /** - * Input only. Immutable. Settings used to create a CMEK crypto key. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; - */ - private $kms_settings = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\AssuredWorkloads\V1beta1\Workload\KMSSettings $kms_settings - * Input only. Immutable. Settings used to create a CMEK crypto key. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Assuredworkloads\V1Beta1\Assuredworkloads::initOnce(); - parent::__construct($data); - } - - /** - * Input only. Immutable. Settings used to create a CMEK crypto key. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; - * @return \Google\Cloud\AssuredWorkloads\V1beta1\Workload\KMSSettings|null - */ - public function getKmsSettings() - { - return $this->kms_settings; - } - - public function hasKmsSettings() - { - return isset($this->kms_settings); - } - - public function clearKmsSettings() - { - unset($this->kms_settings); - } - - /** - * Input only. Immutable. Settings used to create a CMEK crypto key. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; - * @param \Google\Cloud\AssuredWorkloads\V1beta1\Workload\KMSSettings $var - * @return $this - */ - public function setKmsSettings($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AssuredWorkloads\V1beta1\Workload\KMSSettings::class); - $this->kms_settings = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(FedrampModerateSettings::class, \Google\Cloud\AssuredWorkloads\V1beta1\Workload_FedrampModerateSettings::class); - diff --git a/AssuredWorkloads/src/V1beta1/Workload/IL4Settings.php b/AssuredWorkloads/src/V1beta1/Workload/IL4Settings.php deleted file mode 100644 index aef40fe8f140..000000000000 --- a/AssuredWorkloads/src/V1beta1/Workload/IL4Settings.php +++ /dev/null @@ -1,81 +0,0 @@ -google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings - */ -class IL4Settings extends \Google\Protobuf\Internal\Message -{ - /** - * Input only. Immutable. Settings used to create a CMEK crypto key. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; - */ - private $kms_settings = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\AssuredWorkloads\V1beta1\Workload\KMSSettings $kms_settings - * Input only. Immutable. Settings used to create a CMEK crypto key. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Assuredworkloads\V1Beta1\Assuredworkloads::initOnce(); - parent::__construct($data); - } - - /** - * Input only. Immutable. Settings used to create a CMEK crypto key. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; - * @return \Google\Cloud\AssuredWorkloads\V1beta1\Workload\KMSSettings|null - */ - public function getKmsSettings() - { - return $this->kms_settings; - } - - public function hasKmsSettings() - { - return isset($this->kms_settings); - } - - public function clearKmsSettings() - { - unset($this->kms_settings); - } - - /** - * Input only. Immutable. Settings used to create a CMEK crypto key. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings kms_settings = 1 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; - * @param \Google\Cloud\AssuredWorkloads\V1beta1\Workload\KMSSettings $var - * @return $this - */ - public function setKmsSettings($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\AssuredWorkloads\V1beta1\Workload\KMSSettings::class); - $this->kms_settings = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(IL4Settings::class, \Google\Cloud\AssuredWorkloads\V1beta1\Workload_IL4Settings::class); - diff --git a/AssuredWorkloads/src/V1beta1/Workload/KMSSettings.php b/AssuredWorkloads/src/V1beta1/Workload/KMSSettings.php deleted file mode 100644 index 3bfcdc8a6f9e..000000000000 --- a/AssuredWorkloads/src/V1beta1/Workload/KMSSettings.php +++ /dev/null @@ -1,137 +0,0 @@ -google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings - */ -class KMSSettings extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Input only. Immutable. The time at which the Key Management Service will automatically create a - * new version of the crypto key and mark it as the primary. - * - * Generated from protobuf field .google.protobuf.Timestamp next_rotation_time = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; - */ - private $next_rotation_time = null; - /** - * Required. Input only. Immutable. [next_rotation_time] will be advanced by this period when the Key - * Management Service automatically rotates a key. Must be at least 24 hours - * and at most 876,000 hours. - * - * Generated from protobuf field .google.protobuf.Duration rotation_period = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; - */ - private $rotation_period = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Timestamp $next_rotation_time - * Required. Input only. Immutable. The time at which the Key Management Service will automatically create a - * new version of the crypto key and mark it as the primary. - * @type \Google\Protobuf\Duration $rotation_period - * Required. Input only. Immutable. [next_rotation_time] will be advanced by this period when the Key - * Management Service automatically rotates a key. Must be at least 24 hours - * and at most 876,000 hours. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Assuredworkloads\V1Beta1\Assuredworkloads::initOnce(); - parent::__construct($data); - } - - /** - * Required. Input only. Immutable. The time at which the Key Management Service will automatically create a - * new version of the crypto key and mark it as the primary. - * - * Generated from protobuf field .google.protobuf.Timestamp next_rotation_time = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getNextRotationTime() - { - return $this->next_rotation_time; - } - - public function hasNextRotationTime() - { - return isset($this->next_rotation_time); - } - - public function clearNextRotationTime() - { - unset($this->next_rotation_time); - } - - /** - * Required. Input only. Immutable. The time at which the Key Management Service will automatically create a - * new version of the crypto key and mark it as the primary. - * - * Generated from protobuf field .google.protobuf.Timestamp next_rotation_time = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setNextRotationTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->next_rotation_time = $var; - - return $this; - } - - /** - * Required. Input only. Immutable. [next_rotation_time] will be advanced by this period when the Key - * Management Service automatically rotates a key. Must be at least 24 hours - * and at most 876,000 hours. - * - * Generated from protobuf field .google.protobuf.Duration rotation_period = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; - * @return \Google\Protobuf\Duration|null - */ - public function getRotationPeriod() - { - return $this->rotation_period; - } - - public function hasRotationPeriod() - { - return isset($this->rotation_period); - } - - public function clearRotationPeriod() - { - unset($this->rotation_period); - } - - /** - * Required. Input only. Immutable. [next_rotation_time] will be advanced by this period when the Key - * Management Service automatically rotates a key. Must be at least 24 hours - * and at most 876,000 hours. - * - * Generated from protobuf field .google.protobuf.Duration rotation_period = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setRotationPeriod($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->rotation_period = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(KMSSettings::class, \Google\Cloud\AssuredWorkloads\V1beta1\Workload_KMSSettings::class); - diff --git a/AssuredWorkloads/src/V1beta1/Workload/KajEnrollmentState.php b/AssuredWorkloads/src/V1beta1/Workload/KajEnrollmentState.php deleted file mode 100644 index 393673186a18..000000000000 --- a/AssuredWorkloads/src/V1beta1/Workload/KajEnrollmentState.php +++ /dev/null @@ -1,64 +0,0 @@ -google.cloud.assuredworkloads.v1beta1.Workload.KajEnrollmentState - */ -class KajEnrollmentState -{ - /** - * Default State for KAJ Enrollment. - * - * Generated from protobuf enum KAJ_ENROLLMENT_STATE_UNSPECIFIED = 0; - */ - const KAJ_ENROLLMENT_STATE_UNSPECIFIED = 0; - /** - * Pending State for KAJ Enrollment. - * - * Generated from protobuf enum KAJ_ENROLLMENT_STATE_PENDING = 1; - */ - const KAJ_ENROLLMENT_STATE_PENDING = 1; - /** - * Complete State for KAJ Enrollment. - * - * Generated from protobuf enum KAJ_ENROLLMENT_STATE_COMPLETE = 2; - */ - const KAJ_ENROLLMENT_STATE_COMPLETE = 2; - - private static $valueToName = [ - self::KAJ_ENROLLMENT_STATE_UNSPECIFIED => 'KAJ_ENROLLMENT_STATE_UNSPECIFIED', - self::KAJ_ENROLLMENT_STATE_PENDING => 'KAJ_ENROLLMENT_STATE_PENDING', - self::KAJ_ENROLLMENT_STATE_COMPLETE => 'KAJ_ENROLLMENT_STATE_COMPLETE', - ]; - - 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); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(KajEnrollmentState::class, \Google\Cloud\AssuredWorkloads\V1beta1\Workload_KajEnrollmentState::class); - diff --git a/AssuredWorkloads/src/V1beta1/Workload/ResourceInfo.php b/AssuredWorkloads/src/V1beta1/Workload/ResourceInfo.php deleted file mode 100644 index 71798337d145..000000000000 --- a/AssuredWorkloads/src/V1beta1/Workload/ResourceInfo.php +++ /dev/null @@ -1,108 +0,0 @@ -google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo - */ -class ResourceInfo extends \Google\Protobuf\Internal\Message -{ - /** - * Resource identifier. - * For a project this represents project_number. - * - * Generated from protobuf field int64 resource_id = 1; - */ - private $resource_id = 0; - /** - * Indicates the type of resource. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType resource_type = 2; - */ - private $resource_type = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int|string $resource_id - * Resource identifier. - * For a project this represents project_number. - * @type int $resource_type - * Indicates the type of resource. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Assuredworkloads\V1Beta1\Assuredworkloads::initOnce(); - parent::__construct($data); - } - - /** - * Resource identifier. - * For a project this represents project_number. - * - * Generated from protobuf field int64 resource_id = 1; - * @return int|string - */ - public function getResourceId() - { - return $this->resource_id; - } - - /** - * Resource identifier. - * For a project this represents project_number. - * - * Generated from protobuf field int64 resource_id = 1; - * @param int|string $var - * @return $this - */ - public function setResourceId($var) - { - GPBUtil::checkInt64($var); - $this->resource_id = $var; - - return $this; - } - - /** - * Indicates the type of resource. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType resource_type = 2; - * @return int - */ - public function getResourceType() - { - return $this->resource_type; - } - - /** - * Indicates the type of resource. - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType resource_type = 2; - * @param int $var - * @return $this - */ - public function setResourceType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\AssuredWorkloads\V1beta1\Workload\ResourceInfo\ResourceType::class); - $this->resource_type = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ResourceInfo::class, \Google\Cloud\AssuredWorkloads\V1beta1\Workload_ResourceInfo::class); - diff --git a/AssuredWorkloads/src/V1beta1/Workload/ResourceInfo/ResourceType.php b/AssuredWorkloads/src/V1beta1/Workload/ResourceInfo/ResourceType.php deleted file mode 100644 index 0e9955769014..000000000000 --- a/AssuredWorkloads/src/V1beta1/Workload/ResourceInfo/ResourceType.php +++ /dev/null @@ -1,79 +0,0 @@ -google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType - */ -class ResourceType -{ - /** - * Unknown resource type. - * - * Generated from protobuf enum RESOURCE_TYPE_UNSPECIFIED = 0; - */ - const RESOURCE_TYPE_UNSPECIFIED = 0; - /** - * Deprecated. Existing workloads will continue to support this, but new - * CreateWorkloadRequests should not specify this as an input value. - * - * Generated from protobuf enum CONSUMER_PROJECT = 1 [deprecated = true]; - */ - const CONSUMER_PROJECT = 1; - /** - * Consumer Folder. - * - * Generated from protobuf enum CONSUMER_FOLDER = 4; - */ - const CONSUMER_FOLDER = 4; - /** - * Consumer project containing encryption keys. - * - * Generated from protobuf enum ENCRYPTION_KEYS_PROJECT = 2; - */ - const ENCRYPTION_KEYS_PROJECT = 2; - /** - * Keyring resource that hosts encryption keys. - * - * Generated from protobuf enum KEYRING = 3; - */ - const KEYRING = 3; - - private static $valueToName = [ - self::RESOURCE_TYPE_UNSPECIFIED => 'RESOURCE_TYPE_UNSPECIFIED', - self::CONSUMER_PROJECT => 'CONSUMER_PROJECT', - self::CONSUMER_FOLDER => 'CONSUMER_FOLDER', - self::ENCRYPTION_KEYS_PROJECT => 'ENCRYPTION_KEYS_PROJECT', - self::KEYRING => 'KEYRING', - ]; - - 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); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ResourceType::class, \Google\Cloud\AssuredWorkloads\V1beta1\Workload_ResourceInfo_ResourceType::class); - diff --git a/AssuredWorkloads/src/V1beta1/Workload/ResourceSettings.php b/AssuredWorkloads/src/V1beta1/Workload/ResourceSettings.php deleted file mode 100644 index b64e1982f79a..000000000000 --- a/AssuredWorkloads/src/V1beta1/Workload/ResourceSettings.php +++ /dev/null @@ -1,170 +0,0 @@ -google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings - */ -class ResourceSettings extends \Google\Protobuf\Internal\Message -{ - /** - * Resource identifier. - * For a project this represents project_id. If the project is already - * taken, the workload creation will fail. - * For KeyRing, this represents the keyring_id. - * For a folder, don't set this value as folder_id is assigned by Google. - * - * Generated from protobuf field string resource_id = 1; - */ - private $resource_id = ''; - /** - * Indicates the type of resource. This field should be specified to - * correspond the id to the right project type (CONSUMER_PROJECT or - * ENCRYPTION_KEYS_PROJECT) - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType resource_type = 2; - */ - private $resource_type = 0; - /** - * User-assigned resource display name. - * If not empty it will be used to create a resource with the specified - * name. - * - * Generated from protobuf field string display_name = 3; - */ - private $display_name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $resource_id - * Resource identifier. - * For a project this represents project_id. If the project is already - * taken, the workload creation will fail. - * For KeyRing, this represents the keyring_id. - * For a folder, don't set this value as folder_id is assigned by Google. - * @type int $resource_type - * Indicates the type of resource. This field should be specified to - * correspond the id to the right project type (CONSUMER_PROJECT or - * ENCRYPTION_KEYS_PROJECT) - * @type string $display_name - * User-assigned resource display name. - * If not empty it will be used to create a resource with the specified - * name. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Assuredworkloads\V1Beta1\Assuredworkloads::initOnce(); - parent::__construct($data); - } - - /** - * Resource identifier. - * For a project this represents project_id. If the project is already - * taken, the workload creation will fail. - * For KeyRing, this represents the keyring_id. - * For a folder, don't set this value as folder_id is assigned by Google. - * - * Generated from protobuf field string resource_id = 1; - * @return string - */ - public function getResourceId() - { - return $this->resource_id; - } - - /** - * Resource identifier. - * For a project this represents project_id. If the project is already - * taken, the workload creation will fail. - * For KeyRing, this represents the keyring_id. - * For a folder, don't set this value as folder_id is assigned by Google. - * - * Generated from protobuf field string resource_id = 1; - * @param string $var - * @return $this - */ - public function setResourceId($var) - { - GPBUtil::checkString($var, True); - $this->resource_id = $var; - - return $this; - } - - /** - * Indicates the type of resource. This field should be specified to - * correspond the id to the right project type (CONSUMER_PROJECT or - * ENCRYPTION_KEYS_PROJECT) - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType resource_type = 2; - * @return int - */ - public function getResourceType() - { - return $this->resource_type; - } - - /** - * Indicates the type of resource. This field should be specified to - * correspond the id to the right project type (CONSUMER_PROJECT or - * ENCRYPTION_KEYS_PROJECT) - * - * Generated from protobuf field .google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType resource_type = 2; - * @param int $var - * @return $this - */ - public function setResourceType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\AssuredWorkloads\V1beta1\Workload\ResourceInfo\ResourceType::class); - $this->resource_type = $var; - - return $this; - } - - /** - * User-assigned resource display name. - * If not empty it will be used to create a resource with the specified - * name. - * - * Generated from protobuf field string display_name = 3; - * @return string - */ - public function getDisplayName() - { - return $this->display_name; - } - - /** - * User-assigned resource display name. - * If not empty it will be used to create a resource with the specified - * name. - * - * Generated from protobuf field string display_name = 3; - * @param string $var - * @return $this - */ - public function setDisplayName($var) - { - GPBUtil::checkString($var, True); - $this->display_name = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ResourceSettings::class, \Google\Cloud\AssuredWorkloads\V1beta1\Workload_ResourceSettings::class); - diff --git a/AssuredWorkloads/src/V1beta1/Workload/SaaEnrollmentResponse.php b/AssuredWorkloads/src/V1beta1/Workload/SaaEnrollmentResponse.php deleted file mode 100644 index 3262c3e36835..000000000000 --- a/AssuredWorkloads/src/V1beta1/Workload/SaaEnrollmentResponse.php +++ /dev/null @@ -1,114 +0,0 @@ -google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse - */ -class SaaEnrollmentResponse extends \Google\Protobuf\Internal\Message -{ - /** - * Indicates SAA enrollment status of a given workload. - * - * Generated from protobuf field optional .google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse.SetupState setup_status = 1; - */ - private $setup_status = null; - /** - * Indicates SAA enrollment setup error if any. - * - * Generated from protobuf field repeated .google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse.SetupError setup_errors = 2; - */ - private $setup_errors; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $setup_status - * Indicates SAA enrollment status of a given workload. - * @type array|\Google\Protobuf\Internal\RepeatedField $setup_errors - * Indicates SAA enrollment setup error if any. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Assuredworkloads\V1Beta1\Assuredworkloads::initOnce(); - parent::__construct($data); - } - - /** - * Indicates SAA enrollment status of a given workload. - * - * Generated from protobuf field optional .google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse.SetupState setup_status = 1; - * @return int - */ - public function getSetupStatus() - { - return isset($this->setup_status) ? $this->setup_status : 0; - } - - public function hasSetupStatus() - { - return isset($this->setup_status); - } - - public function clearSetupStatus() - { - unset($this->setup_status); - } - - /** - * Indicates SAA enrollment status of a given workload. - * - * Generated from protobuf field optional .google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse.SetupState setup_status = 1; - * @param int $var - * @return $this - */ - public function setSetupStatus($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\AssuredWorkloads\V1beta1\Workload\SaaEnrollmentResponse\SetupState::class); - $this->setup_status = $var; - - return $this; - } - - /** - * Indicates SAA enrollment setup error if any. - * - * Generated from protobuf field repeated .google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse.SetupError setup_errors = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getSetupErrors() - { - return $this->setup_errors; - } - - /** - * Indicates SAA enrollment setup error if any. - * - * Generated from protobuf field repeated .google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse.SetupError setup_errors = 2; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setSetupErrors($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\AssuredWorkloads\V1beta1\Workload\SaaEnrollmentResponse\SetupError::class); - $this->setup_errors = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(SaaEnrollmentResponse::class, \Google\Cloud\AssuredWorkloads\V1beta1\Workload_SaaEnrollmentResponse::class); - diff --git a/AssuredWorkloads/src/V1beta1/Workload/SaaEnrollmentResponse/SetupError.php b/AssuredWorkloads/src/V1beta1/Workload/SaaEnrollmentResponse/SetupError.php deleted file mode 100644 index 8a777f423600..000000000000 --- a/AssuredWorkloads/src/V1beta1/Workload/SaaEnrollmentResponse/SetupError.php +++ /dev/null @@ -1,81 +0,0 @@ -google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse.SetupError - */ -class SetupError -{ - /** - * Unspecified. - * - * Generated from protobuf enum SETUP_ERROR_UNSPECIFIED = 0; - */ - const SETUP_ERROR_UNSPECIFIED = 0; - /** - * Invalid states for all customers, to be redirected to AA UI for - * additional details. - * - * Generated from protobuf enum ERROR_INVALID_BASE_SETUP = 1; - */ - const ERROR_INVALID_BASE_SETUP = 1; - /** - * Returned when there is not an EKM key configured. - * - * Generated from protobuf enum ERROR_MISSING_EXTERNAL_SIGNING_KEY = 2; - */ - const ERROR_MISSING_EXTERNAL_SIGNING_KEY = 2; - /** - * Returned when there are no enrolled services or the customer is - * enrolled in CAA only for a subset of services. - * - * Generated from protobuf enum ERROR_NOT_ALL_SERVICES_ENROLLED = 3; - */ - const ERROR_NOT_ALL_SERVICES_ENROLLED = 3; - /** - * Returned when exception was encountered during evaluation of other - * criteria. - * - * Generated from protobuf enum ERROR_SETUP_CHECK_FAILED = 4; - */ - const ERROR_SETUP_CHECK_FAILED = 4; - - private static $valueToName = [ - self::SETUP_ERROR_UNSPECIFIED => 'SETUP_ERROR_UNSPECIFIED', - self::ERROR_INVALID_BASE_SETUP => 'ERROR_INVALID_BASE_SETUP', - self::ERROR_MISSING_EXTERNAL_SIGNING_KEY => 'ERROR_MISSING_EXTERNAL_SIGNING_KEY', - self::ERROR_NOT_ALL_SERVICES_ENROLLED => 'ERROR_NOT_ALL_SERVICES_ENROLLED', - self::ERROR_SETUP_CHECK_FAILED => 'ERROR_SETUP_CHECK_FAILED', - ]; - - 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); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(SetupError::class, \Google\Cloud\AssuredWorkloads\V1beta1\Workload_SaaEnrollmentResponse_SetupError::class); - diff --git a/AssuredWorkloads/src/V1beta1/Workload/SaaEnrollmentResponse/SetupState.php b/AssuredWorkloads/src/V1beta1/Workload/SaaEnrollmentResponse/SetupState.php deleted file mode 100644 index 14bd01931eb5..000000000000 --- a/AssuredWorkloads/src/V1beta1/Workload/SaaEnrollmentResponse/SetupState.php +++ /dev/null @@ -1,64 +0,0 @@ -google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse.SetupState - */ -class SetupState -{ - /** - * Unspecified. - * - * Generated from protobuf enum SETUP_STATE_UNSPECIFIED = 0; - */ - const SETUP_STATE_UNSPECIFIED = 0; - /** - * SAA enrollment pending. - * - * Generated from protobuf enum STATUS_PENDING = 1; - */ - const STATUS_PENDING = 1; - /** - * SAA enrollment comopleted. - * - * Generated from protobuf enum STATUS_COMPLETE = 2; - */ - const STATUS_COMPLETE = 2; - - private static $valueToName = [ - self::SETUP_STATE_UNSPECIFIED => 'SETUP_STATE_UNSPECIFIED', - self::STATUS_PENDING => 'STATUS_PENDING', - self::STATUS_COMPLETE => 'STATUS_COMPLETE', - ]; - - 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); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(SetupState::class, \Google\Cloud\AssuredWorkloads\V1beta1\Workload_SaaEnrollmentResponse_SetupState::class); - diff --git a/AssuredWorkloads/src/V1beta1/Workload_CJISSettings.php b/AssuredWorkloads/src/V1beta1/Workload_CJISSettings.php deleted file mode 100644 index eb7a4423946a..000000000000 --- a/AssuredWorkloads/src/V1beta1/Workload_CJISSettings.php +++ /dev/null @@ -1,16 +0,0 @@ - [ - 'google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService' => [ - 'CreateWorkload' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\AssuredWorkloads\V1beta1\Workload', - 'metadataReturnType' => '\Google\Cloud\AssuredWorkloads\V1beta1\CreateWorkloadOperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'ListWorkloads' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getWorkloads', - ], - ], - ], - ], -]; diff --git a/AssuredWorkloads/src/V1beta1/resources/assured_workloads_service_rest_client_config.php b/AssuredWorkloads/src/V1beta1/resources/assured_workloads_service_rest_client_config.php deleted file mode 100644 index 2148a2339c57..000000000000 --- a/AssuredWorkloads/src/V1beta1/resources/assured_workloads_service_rest_client_config.php +++ /dev/null @@ -1,88 +0,0 @@ - [ - 'google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService' => [ - 'CreateWorkload' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta1/{parent=organizations/*/locations/*}/workloads', - 'body' => 'workload', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'DeleteWorkload' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1beta1/{name=organizations/*/locations/*/workloads/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'RestrictAllowedResources' => [ - 'method' => 'post', - 'uriTemplate' => '/v1beta1/{name=organizations/*/locations/*/workloads/*}:restrictAllowedResources', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - 'google.longrunning.Operations' => [ - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta1/{name=organizations/*/locations/*/operations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListOperations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1beta1/{name=organizations/*/locations/*}/operations', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/AssuredWorkloads/tests/Unit/V1/Client/AssuredWorkloadsServiceClientTest.php b/AssuredWorkloads/tests/Unit/V1/Client/AssuredWorkloadsServiceClientTest.php index a4d68a7aa61a..b319fe71a485 100644 --- a/AssuredWorkloads/tests/Unit/V1/Client/AssuredWorkloadsServiceClientTest.php +++ b/AssuredWorkloads/tests/Unit/V1/Client/AssuredWorkloadsServiceClientTest.php @@ -1,6 +1,6 @@ getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); } /** @return AssuredWorkloadsServiceClient */ @@ -95,16 +97,17 @@ public function acknowledgeViolationTest() // Mock request $name = 'name3373707'; $comment = 'comment950398559'; - $request = (new AcknowledgeViolationRequest()) - ->setName($name) - ->setComment($comment); + $request = (new AcknowledgeViolationRequest())->setName($name)->setComment($comment); $response = $gapicClient->acknowledgeViolation($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.assuredworkloads.v1.AssuredWorkloadsService/AcknowledgeViolation', $actualFuncCall); + $this->assertSame( + '/google.cloud.assuredworkloads.v1.AssuredWorkloadsService/AcknowledgeViolation', + $actualFuncCall + ); $actualValue = $actualRequestObject->getName(); $this->assertProtobufEquals($name, $actualValue); $actualValue = $actualRequestObject->getComment(); @@ -123,19 +126,20 @@ public function acknowledgeViolationExceptionTest() $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); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $name = 'name3373707'; $comment = 'comment950398559'; - $request = (new AcknowledgeViolationRequest()) - ->setName($name) - ->setComment($comment); + $request = (new AcknowledgeViolationRequest())->setName($name)->setComment($comment); try { $gapicClient->acknowledgeViolation($request); // If the $gapicClient method call did not throw, fail the test @@ -197,9 +201,7 @@ public function createWorkloadTest() $workload->setDisplayName($workloadDisplayName); $workloadComplianceRegime = ComplianceRegime::COMPLIANCE_REGIME_UNSPECIFIED; $workload->setComplianceRegime($workloadComplianceRegime); - $request = (new CreateWorkloadRequest()) - ->setParent($formattedParent) - ->setWorkload($workload); + $request = (new CreateWorkloadRequest())->setParent($formattedParent)->setWorkload($workload); $response = $gapicClient->createWorkload($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -209,7 +211,10 @@ public function createWorkloadTest() $this->assertSame(0, count($operationsRequestsEmpty)); $actualApiFuncCall = $apiRequests[0]->getFuncCall(); $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.assuredworkloads.v1.AssuredWorkloadsService/CreateWorkload', $actualApiFuncCall); + $this->assertSame( + '/google.cloud.assuredworkloads.v1.AssuredWorkloadsService/CreateWorkload', + $actualApiFuncCall + ); $actualValue = $actualApiRequestObject->getParent(); $this->assertProtobufEquals($formattedParent, $actualValue); $actualValue = $actualApiRequestObject->getWorkload(); @@ -257,12 +262,15 @@ public function createWorkloadExceptionTest() $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); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[ORGANIZATION]', '[LOCATION]'); @@ -271,9 +279,7 @@ public function createWorkloadExceptionTest() $workload->setDisplayName($workloadDisplayName); $workloadComplianceRegime = ComplianceRegime::COMPLIANCE_REGIME_UNSPECIFIED; $workload->setComplianceRegime($workloadComplianceRegime); - $request = (new CreateWorkloadRequest()) - ->setParent($formattedParent) - ->setWorkload($workload); + $request = (new CreateWorkloadRequest())->setParent($formattedParent)->setWorkload($workload); $response = $gapicClient->createWorkload($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -309,8 +315,7 @@ public function deleteWorkloadTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->workloadName('[ORGANIZATION]', '[LOCATION]', '[WORKLOAD]'); - $request = (new DeleteWorkloadRequest()) - ->setName($formattedName); + $request = (new DeleteWorkloadRequest())->setName($formattedName); $gapicClient->deleteWorkload($request); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -333,17 +338,19 @@ public function deleteWorkloadExceptionTest() $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); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->workloadName('[ORGANIZATION]', '[LOCATION]', '[WORKLOAD]'); - $request = (new DeleteWorkloadRequest()) - ->setName($formattedName); + $request = (new DeleteWorkloadRequest())->setName($formattedName); try { $gapicClient->deleteWorkload($request); // If the $gapicClient method call did not throw, fail the test @@ -386,8 +393,7 @@ public function getViolationTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->violationName('[ORGANIZATION]', '[LOCATION]', '[WORKLOAD]', '[VIOLATION]'); - $request = (new GetViolationRequest()) - ->setName($formattedName); + $request = (new GetViolationRequest())->setName($formattedName); $response = $gapicClient->getViolation($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -411,17 +417,19 @@ public function getViolationExceptionTest() $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); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->violationName('[ORGANIZATION]', '[LOCATION]', '[WORKLOAD]', '[VIOLATION]'); - $request = (new GetViolationRequest()) - ->setName($formattedName); + $request = (new GetViolationRequest())->setName($formattedName); try { $gapicClient->getViolation($request); // If the $gapicClient method call did not throw, fail the test @@ -460,8 +468,7 @@ public function getWorkloadTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->workloadName('[ORGANIZATION]', '[LOCATION]', '[WORKLOAD]'); - $request = (new GetWorkloadRequest()) - ->setName($formattedName); + $request = (new GetWorkloadRequest())->setName($formattedName); $response = $gapicClient->getWorkload($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -485,17 +492,19 @@ public function getWorkloadExceptionTest() $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); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->workloadName('[ORGANIZATION]', '[LOCATION]', '[WORKLOAD]'); - $request = (new GetWorkloadRequest()) - ->setName($formattedName); + $request = (new GetWorkloadRequest())->setName($formattedName); try { $gapicClient->getWorkload($request); // If the $gapicClient method call did not throw, fail the test @@ -520,17 +529,14 @@ public function listViolationsTest() // Mock response $nextPageToken = ''; $violationsElement = new Violation(); - $violations = [ - $violationsElement, - ]; + $violations = [$violationsElement]; $expectedResponse = new ListViolationsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setViolations($violations); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->workloadName('[ORGANIZATION]', '[LOCATION]', '[WORKLOAD]'); - $request = (new ListViolationsRequest()) - ->setParent($formattedParent); + $request = (new ListViolationsRequest())->setParent($formattedParent); $response = $gapicClient->listViolations($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -557,17 +563,19 @@ public function listViolationsExceptionTest() $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); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->workloadName('[ORGANIZATION]', '[LOCATION]', '[WORKLOAD]'); - $request = (new ListViolationsRequest()) - ->setParent($formattedParent); + $request = (new ListViolationsRequest())->setParent($formattedParent); try { $gapicClient->listViolations($request); // If the $gapicClient method call did not throw, fail the test @@ -592,17 +600,14 @@ public function listWorkloadsTest() // Mock response $nextPageToken = ''; $workloadsElement = new Workload(); - $workloads = [ - $workloadsElement, - ]; + $workloads = [$workloadsElement]; $expectedResponse = new ListWorkloadsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setWorkloads($workloads); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->locationName('[ORGANIZATION]', '[LOCATION]'); - $request = (new ListWorkloadsRequest()) - ->setParent($formattedParent); + $request = (new ListWorkloadsRequest())->setParent($formattedParent); $response = $gapicClient->listWorkloads($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -629,17 +634,19 @@ public function listWorkloadsExceptionTest() $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); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[ORGANIZATION]', '[LOCATION]'); - $request = (new ListWorkloadsRequest()) - ->setParent($formattedParent); + $request = (new ListWorkloadsRequest())->setParent($formattedParent); try { $gapicClient->listWorkloads($request); // If the $gapicClient method call did not throw, fail the test @@ -667,16 +674,17 @@ public function restrictAllowedResourcesTest() // Mock request $name = 'name3373707'; $restrictionType = RestrictionType::RESTRICTION_TYPE_UNSPECIFIED; - $request = (new RestrictAllowedResourcesRequest()) - ->setName($name) - ->setRestrictionType($restrictionType); + $request = (new RestrictAllowedResourcesRequest())->setName($name)->setRestrictionType($restrictionType); $response = $gapicClient->restrictAllowedResources($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.assuredworkloads.v1.AssuredWorkloadsService/RestrictAllowedResources', $actualFuncCall); + $this->assertSame( + '/google.cloud.assuredworkloads.v1.AssuredWorkloadsService/RestrictAllowedResources', + $actualFuncCall + ); $actualValue = $actualRequestObject->getName(); $this->assertProtobufEquals($name, $actualValue); $actualValue = $actualRequestObject->getRestrictionType(); @@ -695,19 +703,20 @@ public function restrictAllowedResourcesExceptionTest() $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); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $name = 'name3373707'; $restrictionType = RestrictionType::RESTRICTION_TYPE_UNSPECIFIED; - $request = (new RestrictAllowedResourcesRequest()) - ->setName($name) - ->setRestrictionType($restrictionType); + $request = (new RestrictAllowedResourcesRequest())->setName($name)->setRestrictionType($restrictionType); try { $gapicClient->restrictAllowedResources($request); // If the $gapicClient method call did not throw, fail the test @@ -751,9 +760,7 @@ public function updateWorkloadTest() $workloadComplianceRegime = ComplianceRegime::COMPLIANCE_REGIME_UNSPECIFIED; $workload->setComplianceRegime($workloadComplianceRegime); $updateMask = new FieldMask(); - $request = (new UpdateWorkloadRequest()) - ->setWorkload($workload) - ->setUpdateMask($updateMask); + $request = (new UpdateWorkloadRequest())->setWorkload($workload)->setUpdateMask($updateMask); $response = $gapicClient->updateWorkload($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -779,12 +786,15 @@ public function updateWorkloadExceptionTest() $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); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $workload = new Workload(); @@ -793,9 +803,7 @@ public function updateWorkloadExceptionTest() $workloadComplianceRegime = ComplianceRegime::COMPLIANCE_REGIME_UNSPECIFIED; $workload->setComplianceRegime($workloadComplianceRegime); $updateMask = new FieldMask(); - $request = (new UpdateWorkloadRequest()) - ->setWorkload($workload) - ->setUpdateMask($updateMask); + $request = (new UpdateWorkloadRequest())->setWorkload($workload)->setUpdateMask($updateMask); try { $gapicClient->updateWorkload($request); // If the $gapicClient method call did not throw, fail the test @@ -823,16 +831,17 @@ public function acknowledgeViolationAsyncTest() // Mock request $name = 'name3373707'; $comment = 'comment950398559'; - $request = (new AcknowledgeViolationRequest()) - ->setName($name) - ->setComment($comment); + $request = (new AcknowledgeViolationRequest())->setName($name)->setComment($comment); $response = $gapicClient->acknowledgeViolationAsync($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.assuredworkloads.v1.AssuredWorkloadsService/AcknowledgeViolation', $actualFuncCall); + $this->assertSame( + '/google.cloud.assuredworkloads.v1.AssuredWorkloadsService/AcknowledgeViolation', + $actualFuncCall + ); $actualValue = $actualRequestObject->getName(); $this->assertProtobufEquals($name, $actualValue); $actualValue = $actualRequestObject->getComment(); diff --git a/AssuredWorkloads/tests/Unit/V1beta1/AssuredWorkloadsServiceClientTest.php b/AssuredWorkloads/tests/Unit/V1beta1/AssuredWorkloadsServiceClientTest.php deleted file mode 100644 index 6aa4587bde2c..000000000000 --- a/AssuredWorkloads/tests/Unit/V1beta1/AssuredWorkloadsServiceClientTest.php +++ /dev/null @@ -1,610 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return AssuredWorkloadsServiceClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new AssuredWorkloadsServiceClient($options); - } - - /** @test */ - public function analyzeWorkloadMoveTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new AnalyzeWorkloadMoveResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $target = 'target-880905839'; - $response = $gapicClient->analyzeWorkloadMove($target); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService/AnalyzeWorkloadMove', $actualFuncCall); - $actualValue = $actualRequestObject->getTarget(); - $this->assertProtobufEquals($target, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function analyzeWorkloadMoveExceptionTest() - { - $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 - $target = 'target-880905839'; - try { - $gapicClient->analyzeWorkloadMove($target); - // 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 createWorkloadTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createWorkloadTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $billingAccount = 'billingAccount-545871767'; - $etag = 'etag3123477'; - $provisionedResourcesParent = 'provisionedResourcesParent-158134097'; - $enableSovereignControls = false; - $expectedResponse = new Workload(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setBillingAccount($billingAccount); - $expectedResponse->setEtag($etag); - $expectedResponse->setProvisionedResourcesParent($provisionedResourcesParent); - $expectedResponse->setEnableSovereignControls($enableSovereignControls); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createWorkloadTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[ORGANIZATION]', '[LOCATION]'); - $workload = new Workload(); - $workloadDisplayName = 'workloadDisplayName191619702'; - $workload->setDisplayName($workloadDisplayName); - $workloadComplianceRegime = ComplianceRegime::COMPLIANCE_REGIME_UNSPECIFIED; - $workload->setComplianceRegime($workloadComplianceRegime); - $response = $gapicClient->createWorkload($formattedParent, $workload); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService/CreateWorkload', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getWorkload(); - $this->assertProtobufEquals($workload, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createWorkloadTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createWorkloadExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createWorkloadTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $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); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[ORGANIZATION]', '[LOCATION]'); - $workload = new Workload(); - $workloadDisplayName = 'workloadDisplayName191619702'; - $workload->setDisplayName($workloadDisplayName); - $workloadComplianceRegime = ComplianceRegime::COMPLIANCE_REGIME_UNSPECIFIED; - $workload->setComplianceRegime($workloadComplianceRegime); - $response = $gapicClient->createWorkload($formattedParent, $workload); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createWorkloadTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() 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 stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteWorkloadTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->workloadName('[ORGANIZATION]', '[LOCATION]', '[WORKLOAD]'); - $gapicClient->deleteWorkload($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService/DeleteWorkload', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteWorkloadExceptionTest() - { - $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 - $formattedName = $gapicClient->workloadName('[ORGANIZATION]', '[LOCATION]', '[WORKLOAD]'); - try { - $gapicClient->deleteWorkload($formattedName); - // 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 getWorkloadTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $billingAccount = 'billingAccount-545871767'; - $etag = 'etag3123477'; - $provisionedResourcesParent = 'provisionedResourcesParent-158134097'; - $enableSovereignControls = false; - $expectedResponse = new Workload(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setBillingAccount($billingAccount); - $expectedResponse->setEtag($etag); - $expectedResponse->setProvisionedResourcesParent($provisionedResourcesParent); - $expectedResponse->setEnableSovereignControls($enableSovereignControls); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->workloadName('[ORGANIZATION]', '[LOCATION]', '[WORKLOAD]'); - $response = $gapicClient->getWorkload($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService/GetWorkload', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getWorkloadExceptionTest() - { - $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 - $formattedName = $gapicClient->workloadName('[ORGANIZATION]', '[LOCATION]', '[WORKLOAD]'); - try { - $gapicClient->getWorkload($formattedName); - // 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 listWorkloadsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $workloadsElement = new Workload(); - $workloads = [ - $workloadsElement, - ]; - $expectedResponse = new ListWorkloadsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setWorkloads($workloads); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[ORGANIZATION]', '[LOCATION]'); - $response = $gapicClient->listWorkloads($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getWorkloads()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService/ListWorkloads', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listWorkloadsExceptionTest() - { - $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 - $formattedParent = $gapicClient->locationName('[ORGANIZATION]', '[LOCATION]'); - try { - $gapicClient->listWorkloads($formattedParent); - // 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 restrictAllowedResourcesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new RestrictAllowedResourcesResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $name = 'name3373707'; - $restrictionType = RestrictionType::RESTRICTION_TYPE_UNSPECIFIED; - $response = $gapicClient->restrictAllowedResources($name, $restrictionType); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService/RestrictAllowedResources', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($name, $actualValue); - $actualValue = $actualRequestObject->getRestrictionType(); - $this->assertProtobufEquals($restrictionType, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function restrictAllowedResourcesExceptionTest() - { - $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 - $name = 'name3373707'; - $restrictionType = RestrictionType::RESTRICTION_TYPE_UNSPECIFIED; - try { - $gapicClient->restrictAllowedResources($name, $restrictionType); - // 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 updateWorkloadTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $billingAccount = 'billingAccount-545871767'; - $etag = 'etag3123477'; - $provisionedResourcesParent = 'provisionedResourcesParent-158134097'; - $enableSovereignControls = false; - $expectedResponse = new Workload(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setBillingAccount($billingAccount); - $expectedResponse->setEtag($etag); - $expectedResponse->setProvisionedResourcesParent($provisionedResourcesParent); - $expectedResponse->setEnableSovereignControls($enableSovereignControls); - $transport->addResponse($expectedResponse); - // Mock request - $workload = new Workload(); - $workloadDisplayName = 'workloadDisplayName191619702'; - $workload->setDisplayName($workloadDisplayName); - $workloadComplianceRegime = ComplianceRegime::COMPLIANCE_REGIME_UNSPECIFIED; - $workload->setComplianceRegime($workloadComplianceRegime); - $updateMask = new FieldMask(); - $response = $gapicClient->updateWorkload($workload, $updateMask); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService/UpdateWorkload', $actualFuncCall); - $actualValue = $actualRequestObject->getWorkload(); - $this->assertProtobufEquals($workload, $actualValue); - $actualValue = $actualRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateWorkloadExceptionTest() - { - $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 - $workload = new Workload(); - $workloadDisplayName = 'workloadDisplayName191619702'; - $workload->setDisplayName($workloadDisplayName); - $workloadComplianceRegime = ComplianceRegime::COMPLIANCE_REGIME_UNSPECIFIED; - $workload->setComplianceRegime($workloadComplianceRegime); - $updateMask = new FieldMask(); - try { - $gapicClient->updateWorkload($workload, $updateMask); - // 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()); - } -}