diff --git a/ArtifactRegistry/metadata/V1/Attachment.php b/ArtifactRegistry/metadata/V1/Attachment.php new file mode 100644 index 000000000000..394ad21ccd46 --- /dev/null +++ b/ArtifactRegistry/metadata/V1/Attachment.php @@ -0,0 +1,66 @@ +internalAddGeneratedFile( + ' + +4google/devtools/artifactregistry/v1/attachment.proto#google.devtools.artifactregistry.v1google/api/resource.protogoogle/protobuf/timestamp.proto" + +Attachment +name (  +target ( BA +type (  +attachment_namespace ( Z + annotations ( 2@.google.devtools.artifactregistry.v1.Attachment.AnnotationsEntryBA4 + create_time ( 2.google.protobuf.TimestampBA4 + update_time ( 2.google.protobuf.TimestampBA; +files ( B,AA& +$artifactregistry.googleapis.com/File +oci_version_name ( BA2 +AnnotationsEntry +key (  +value ( :8:A +*artifactregistry.googleapis.com/AttachmentZprojects/{project}/locations/{location}/repositories/{repository}/attachments/{attachment}" +ListAttachmentsRequestB +parent ( B2AA,*artifactregistry.googleapis.com/Attachment +filter ( BA + page_size ( + +page_token ( "x +ListAttachmentsResponseD + attachments ( 2/.google.devtools.artifactregistry.v1.Attachment +next_page_token ( "X +GetAttachmentRequest@ +name ( B2AA, +*artifactregistry.googleapis.com/Attachment" +CreateAttachmentRequestB +parent ( B2AA,*artifactregistry.googleapis.com/Attachment + attachment_id ( BAH + +attachment ( 2/.google.devtools.artifactregistry.v1.AttachmentBA"[ +DeleteAttachmentRequest@ +name ( B2AA, +*artifactregistry.googleapis.com/AttachmentB +\'com.google.devtools.artifactregistry.v1BAttachmentProtoPZPcloud.google.com/go/artifactregistry/apiv1/artifactregistrypb;artifactregistrypb Google.Cloud.ArtifactRegistry.V1 Google\\Cloud\\ArtifactRegistry\\V1#Google::Cloud::ArtifactRegistry::V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/ArtifactRegistry/metadata/V1/File.php b/ArtifactRegistry/metadata/V1/File.php index 381fb05293ac..2cbadf3e7315 100644 Binary files a/ArtifactRegistry/metadata/V1/File.php and b/ArtifactRegistry/metadata/V1/File.php differ diff --git a/ArtifactRegistry/metadata/V1/Generic.php b/ArtifactRegistry/metadata/V1/Generic.php new file mode 100644 index 000000000000..df27ecb26042 --- /dev/null +++ b/ArtifactRegistry/metadata/V1/Generic.php @@ -0,0 +1,36 @@ +internalAddGeneratedFile( + ' + +1google/devtools/artifactregistry/v1/generic.proto#google.devtools.artifactregistry.v1google/api/resource.protogoogle/protobuf/timestamp.proto" +GenericArtifact +name (  +version ( 4 + create_time ( 2.google.protobuf.TimestampBA4 + update_time ( 2.google.protobuf.TimestampBA:A +/artifactregistry.googleapis.com/GenericArtifacteprojects/{project}/locations/{location}/repositories/{repository}/genericArtifacts/{generic_artifact}B +\'com.google.devtools.artifactregistry.v1B GenericProtoPZPcloud.google.com/go/artifactregistry/apiv1/artifactregistrypb;artifactregistrypb Google.Cloud.ArtifactRegistry.V1 Google\\Cloud\\ArtifactRegistry\\V1#Google::Cloud::ArtifactRegistry::V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/ArtifactRegistry/metadata/V1/Package.php b/ArtifactRegistry/metadata/V1/Package.php index c0351d017912..1970c0d56337 100644 --- a/ArtifactRegistry/metadata/V1/Package.php +++ b/ArtifactRegistry/metadata/V1/Package.php @@ -16,22 +16,29 @@ public static function initOnce() { } \GPBMetadata\Google\Api\FieldBehavior::initOnce(); \GPBMetadata\Google\Api\Resource::initOnce(); + \GPBMetadata\Google\Protobuf\FieldMask::initOnce(); \GPBMetadata\Google\Protobuf\Timestamp::initOnce(); $pool->internalAddGeneratedFile( ' - -1google/devtools/artifactregistry/v1/package.proto#google.devtools.artifactregistry.v1google/api/resource.protogoogle/protobuf/timestamp.proto" + +1google/devtools/artifactregistry/v1/package.proto#google.devtools.artifactregistry.v1google/api/resource.proto google/protobuf/field_mask.protogoogle/protobuf/timestamp.proto" Package name (  display_name ( / create_time ( 2.google.protobuf.Timestamp/ - update_time ( 2.google.protobuf.Timestamp:A -\'artifactregistry.googleapis.com/PackageTprojects/{project}/locations/{location}/repositories/{repository}/packages/{package}"} + update_time ( 2.google.protobuf.TimestampW + annotations ( 2=.google.devtools.artifactregistry.v1.Package.AnnotationsEntryBA2 +AnnotationsEntry +key (  +value ( :8:A +\'artifactregistry.googleapis.com/PackageTprojects/{project}/locations/{location}/repositories/{repository}/packages/{package}" ListPackagesRequest? parent ( B/AA)\'artifactregistry.googleapis.com/Package page_size ( -page_token ( "o +page_token (  +filter ( BA +order_by ( BA"o ListPackagesResponse> packages ( 2,.google.devtools.artifactregistry.v1.Package next_page_token ( "R @@ -40,7 +47,10 @@ public static function initOnce() { \'artifactregistry.googleapis.com/Package"U DeletePackageRequest= name ( B/AA) -\'artifactregistry.googleapis.com/PackageB +\'artifactregistry.googleapis.com/Package" +UpdatePackageRequest= +package ( 2,.google.devtools.artifactregistry.v1.Package/ + update_mask ( 2.google.protobuf.FieldMaskB \'com.google.devtools.artifactregistry.v1B PackageProtoPZPcloud.google.com/go/artifactregistry/apiv1/artifactregistrypb;artifactregistrypb Google.Cloud.ArtifactRegistry.V1 Google\\Cloud\\ArtifactRegistry\\V1#Google::Cloud::ArtifactRegistry::V1bproto3' , true); diff --git a/ArtifactRegistry/metadata/V1/Repository.php b/ArtifactRegistry/metadata/V1/Repository.php index d6f9d5f46897..f36277f4dfde 100644 Binary files a/ArtifactRegistry/metadata/V1/Repository.php and b/ArtifactRegistry/metadata/V1/Repository.php differ diff --git a/ArtifactRegistry/metadata/V1/Rule.php b/ArtifactRegistry/metadata/V1/Rule.php new file mode 100644 index 000000000000..88272adadee9 Binary files /dev/null and b/ArtifactRegistry/metadata/V1/Rule.php differ diff --git a/ArtifactRegistry/metadata/V1/Service.php b/ArtifactRegistry/metadata/V1/Service.php index 8674203ac04c..2fa797ac764f 100644 --- a/ArtifactRegistry/metadata/V1/Service.php +++ b/ArtifactRegistry/metadata/V1/Service.php @@ -18,9 +18,11 @@ public static function initOnce() { \GPBMetadata\Google\Api\Client::initOnce(); \GPBMetadata\Google\Devtools\Artifactregistry\V1\AptArtifact::initOnce(); \GPBMetadata\Google\Devtools\Artifactregistry\V1\Artifact::initOnce(); + \GPBMetadata\Google\Devtools\Artifactregistry\V1\Attachment::initOnce(); \GPBMetadata\Google\Devtools\Artifactregistry\V1\File::initOnce(); \GPBMetadata\Google\Devtools\Artifactregistry\V1\Package::initOnce(); \GPBMetadata\Google\Devtools\Artifactregistry\V1\Repository::initOnce(); + \GPBMetadata\Google\Devtools\Artifactregistry\V1\Rule::initOnce(); \GPBMetadata\Google\Devtools\Artifactregistry\V1\Settings::initOnce(); \GPBMetadata\Google\Devtools\Artifactregistry\V1\Tag::initOnce(); \GPBMetadata\Google\Devtools\Artifactregistry\V1\Version::initOnce(); @@ -32,9 +34,9 @@ public static function initOnce() { \GPBMetadata\Google\Protobuf\GPBEmpty::initOnce(); $pool->internalAddGeneratedFile( ' -H -1google/devtools/artifactregistry/v1/service.proto#google.devtools.artifactregistry.v1google/api/client.proto6google/devtools/artifactregistry/v1/apt_artifact.proto2google/devtools/artifactregistry/v1/artifact.proto.google/devtools/artifactregistry/v1/file.proto1google/devtools/artifactregistry/v1/package.proto4google/devtools/artifactregistry/v1/repository.proto2google/devtools/artifactregistry/v1/settings.proto-google/devtools/artifactregistry/v1/tag.proto1google/devtools/artifactregistry/v1/version.proto6google/devtools/artifactregistry/v1/vpcsc_config.proto6google/devtools/artifactregistry/v1/yum_artifact.protogoogle/iam/v1/iam_policy.protogoogle/iam/v1/policy.proto#google/longrunning/operations.protogoogle/protobuf/empty.proto" -OperationMetadata2@ +` +1google/devtools/artifactregistry/v1/service.proto#google.devtools.artifactregistry.v1google/api/client.proto6google/devtools/artifactregistry/v1/apt_artifact.proto2google/devtools/artifactregistry/v1/artifact.proto4google/devtools/artifactregistry/v1/attachment.proto.google/devtools/artifactregistry/v1/file.proto1google/devtools/artifactregistry/v1/package.proto4google/devtools/artifactregistry/v1/repository.proto.google/devtools/artifactregistry/v1/rule.proto2google/devtools/artifactregistry/v1/settings.proto-google/devtools/artifactregistry/v1/tag.proto1google/devtools/artifactregistry/v1/version.proto6google/devtools/artifactregistry/v1/vpcsc_config.proto6google/devtools/artifactregistry/v1/yum_artifact.protogoogle/iam/v1/iam_policy.protogoogle/iam/v1/policy.proto#google/longrunning/operations.protogoogle/protobuf/empty.proto" +OperationMetadata2W ArtifactRegistry ListDockerImages<.google.devtools.artifactregistry.v1.ListDockerImagesRequest=.google.devtools.artifactregistry.v1.ListDockerImagesResponse"PAparentA?/v1/{parent=projects/*/locations/*/repositories/*}/dockerImages GetDockerImage:.google.devtools.artifactregistry.v1.GetDockerImageRequest0.google.devtools.artifactregistry.v1.DockerImage"NAnameA?/v1/{name=projects/*/locations/*/repositories/*/dockerImages/*} @@ -68,21 +70,43 @@ public static function initOnce() { DeleteVersion9.google.devtools.artifactregistry.v1.DeleteVersionRequest.google.longrunning.Operation"AN google.protobuf.Empty5google.devtools.artifactregistry.v1.OperationMetadataAnameH*F/v1/{name=projects/*/locations/*/repositories/*/packages/*/versions/*} BatchDeleteVersions?.google.devtools.artifactregistry.v1.BatchDeleteVersionsRequest.google.longrunning.Operation"AX -google.protobuf.Empty?google.devtools.artifactregistry.v1.BatchDeleteVersionsMetadataA parent,namesW"R/v1/{parent=projects/*/locations/*/repositories/*/packages/*}/versions:batchDelete:* +google.protobuf.Empty?google.devtools.artifactregistry.v1.BatchDeleteVersionsMetadataA parent,namesW"R/v1/{parent=projects/*/locations/*/repositories/*/packages/*}/versions:batchDelete:* + UpdateVersion9.google.devtools.artifactregistry.v1.UpdateVersionRequest,.google.devtools.artifactregistry.v1.Version"uAversion,update_maskY2N/v1/{version.name=projects/*/locations/*/repositories/*/packages/*/versions/*}:version ListFiles5.google.devtools.artifactregistry.v1.ListFilesRequest6.google.devtools.artifactregistry.v1.ListFilesResponse"IAparent:8/v1/{parent=projects/*/locations/*/repositories/*}/files -GetFile3.google.devtools.artifactregistry.v1.GetFileRequest).google.devtools.artifactregistry.v1.File"HAname;9/v1/{name=projects/*/locations/*/repositories/*/files/**} +GetFile3.google.devtools.artifactregistry.v1.GetFileRequest).google.devtools.artifactregistry.v1.File"HAname;9/v1/{name=projects/*/locations/*/repositories/*/files/**} + +DeleteFile6.google.devtools.artifactregistry.v1.DeleteFileRequest.google.longrunning.Operation"AN +google.protobuf.Empty5google.devtools.artifactregistry.v1.OperationMetadataAname:*8/v1/{name=projects/*/locations/*/repositories/*/files/*} + +UpdateFile6.google.devtools.artifactregistry.v1.UpdateFileRequest).google.devtools.artifactregistry.v1.File"^Afile,update_maskE2=/v1/{file.name=projects/*/locations/*/repositories/*/files/*}:file ListTags4.google.devtools.artifactregistry.v1.ListTagsRequest5.google.devtools.artifactregistry.v1.ListTagsResponse"SAparentDB/v1/{parent=projects/*/locations/*/repositories/*/packages/*}/tags GetTag2.google.devtools.artifactregistry.v1.GetTagRequest(.google.devtools.artifactregistry.v1.Tag"QAnameDB/v1/{name=projects/*/locations/*/repositories/*/packages/*/tags/*} CreateTag5.google.devtools.artifactregistry.v1.CreateTagRequest(.google.devtools.artifactregistry.v1.Tag"cAparent,tag,tag_idI"B/v1/{parent=projects/*/locations/*/repositories/*/packages/*}/tags:tag UpdateTag5.google.devtools.artifactregistry.v1.UpdateTagRequest(.google.devtools.artifactregistry.v1.Tag"eAtag,update_maskM2F/v1/{tag.name=projects/*/locations/*/repositories/*/packages/*/tags/*}:tag - DeleteTag5.google.devtools.artifactregistry.v1.DeleteTagRequest.google.protobuf.Empty"QAnameD*B/v1/{name=projects/*/locations/*/repositories/*/packages/*/tags/*} + DeleteTag5.google.devtools.artifactregistry.v1.DeleteTagRequest.google.protobuf.Empty"QAnameD*B/v1/{name=projects/*/locations/*/repositories/*/packages/*/tags/*} + +CreateRule6.google.devtools.artifactregistry.v1.CreateRuleRequest).google.devtools.artifactregistry.v1.Rule"\\Aparent,rule,rule_id@"8/v1/{parent=projects/*/locations/*/repositories/*}/rules:rule + ListRules5.google.devtools.artifactregistry.v1.ListRulesRequest6.google.devtools.artifactregistry.v1.ListRulesResponse"IAparent:8/v1/{parent=projects/*/locations/*/repositories/*}/rules +GetRule3.google.devtools.artifactregistry.v1.GetRuleRequest).google.devtools.artifactregistry.v1.Rule"GAname:8/v1/{name=projects/*/locations/*/repositories/*/rules/*} + +UpdateRule6.google.devtools.artifactregistry.v1.UpdateRuleRequest).google.devtools.artifactregistry.v1.Rule"^Arule,update_maskE2=/v1/{rule.name=projects/*/locations/*/repositories/*/rules/*}:rule + +DeleteRule6.google.devtools.artifactregistry.v1.DeleteRuleRequest.google.protobuf.Empty"GAname:*8/v1/{name=projects/*/locations/*/repositories/*/rules/*} SetIamPolicy".google.iam.v1.SetIamPolicyRequest.google.iam.v1.Policy"LF"A/v1/{resource=projects/*/locations/*/repositories/*}:setIamPolicy:* GetIamPolicy".google.iam.v1.GetIamPolicyRequest.google.iam.v1.Policy"ICA/v1/{resource=projects/*/locations/*/repositories/*}:getIamPolicy TestIamPermissions(.google.iam.v1.TestIamPermissionsRequest).google.iam.v1.TestIamPermissionsResponse"RL"G/v1/{resource=projects/*/locations/*/repositories/*}:testIamPermissions:* GetProjectSettings>.google.devtools.artifactregistry.v1.GetProjectSettingsRequest4.google.devtools.artifactregistry.v1.ProjectSettings"4Aname\'%/v1/{name=projects/*/projectSettings} UpdateProjectSettingsA.google.devtools.artifactregistry.v1.UpdateProjectSettingsRequest4.google.devtools.artifactregistry.v1.ProjectSettings"oAproject_settings,update_maskJ26/v1/{project_settings.name=projects/*/projectSettings}:project_settings GetVPCSCConfig:.google.devtools.artifactregistry.v1.GetVPCSCConfigRequest0.google.devtools.artifactregistry.v1.VPCSCConfig"/v1/{parent=projects/*/locations/*/repositories/*}/attachments + GetAttachment9.google.devtools.artifactregistry.v1.GetAttachmentRequest/.google.devtools.artifactregistry.v1.Attachment"MAname@>/v1/{name=projects/*/locations/*/repositories/*/attachments/*} +CreateAttachment<.google.devtools.artifactregistry.v1.CreateAttachmentRequest.google.longrunning.Operation"Ag +.google.devtools.artifactregistry.v1.Attachment5google.devtools.artifactregistry.v1.OperationMetadataAparent,attachment,attachment_idL">/v1/{parent=projects/*/locations/*/repositories/*}/attachments: +attachment +DeleteAttachment<.google.devtools.artifactregistry.v1.DeleteAttachmentRequest.google.longrunning.Operation"AN +google.protobuf.Empty5google.devtools.artifactregistry.v1.OperationMetadataAname@*>/v1/{name=projects/*/locations/*/repositories/*/attachments/*}Aartifactregistry.googleapis.comAghttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-onlyB \'com.google.devtools.artifactregistry.v1B ServiceProtoPZPcloud.google.com/go/artifactregistry/apiv1/artifactregistrypb;artifactregistrypb Google.Cloud.ArtifactRegistry.V1 Google\\Cloud\\ArtifactRegistry\\V1#Google::Cloud::ArtifactRegistry::V1bproto3' , true); diff --git a/ArtifactRegistry/metadata/V1/Settings.php b/ArtifactRegistry/metadata/V1/Settings.php index 5823e6f990ac..49d4de20ff0f 100644 Binary files a/ArtifactRegistry/metadata/V1/Settings.php and b/ArtifactRegistry/metadata/V1/Settings.php differ diff --git a/ArtifactRegistry/metadata/V1/Version.php b/ArtifactRegistry/metadata/V1/Version.php index 3bc4fca9498c..81d53cf2a243 100644 Binary files a/ArtifactRegistry/metadata/V1/Version.php and b/ArtifactRegistry/metadata/V1/Version.php differ diff --git a/ArtifactRegistry/samples/V1/ArtifactRegistryClient/create_attachment.php b/ArtifactRegistry/samples/V1/ArtifactRegistryClient/create_attachment.php new file mode 100644 index 000000000000..55bc03d75de2 --- /dev/null +++ b/ArtifactRegistry/samples/V1/ArtifactRegistryClient/create_attachment.php @@ -0,0 +1,120 @@ +`. Please see + * {@see ArtifactRegistryClient::fileName()} for help formatting this field. + */ +function create_attachment_sample( + string $formattedParent, + string $attachmentId, + string $attachmentTarget, + string $formattedAttachmentFilesElement +): void { + // Create a client. + $artifactRegistryClient = new ArtifactRegistryClient(); + + // Prepare the request message. + $formattedAttachmentFiles = [$formattedAttachmentFilesElement,]; + $attachment = (new Attachment()) + ->setTarget($attachmentTarget) + ->setFiles($formattedAttachmentFiles); + $request = (new CreateAttachmentRequest()) + ->setParent($formattedParent) + ->setAttachmentId($attachmentId) + ->setAttachment($attachment); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $artifactRegistryClient->createAttachment($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Attachment $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ArtifactRegistryClient::repositoryName( + '[PROJECT]', + '[LOCATION]', + '[REPOSITORY]' + ); + $attachmentId = '[ATTACHMENT_ID]'; + $attachmentTarget = '[TARGET]'; + $formattedAttachmentFilesElement = ArtifactRegistryClient::fileName( + '[PROJECT]', + '[LOCATION]', + '[REPOSITORY]', + '[FILE]' + ); + + create_attachment_sample( + $formattedParent, + $attachmentId, + $attachmentTarget, + $formattedAttachmentFilesElement + ); +} +// [END artifactregistry_v1_generated_ArtifactRegistry_CreateAttachment_sync] diff --git a/ArtifactRegistry/samples/V1/ArtifactRegistryClient/create_rule.php b/ArtifactRegistry/samples/V1/ArtifactRegistryClient/create_rule.php new file mode 100644 index 000000000000..c3849cd60f21 --- /dev/null +++ b/ArtifactRegistry/samples/V1/ArtifactRegistryClient/create_rule.php @@ -0,0 +1,75 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var Rule $response */ + $response = $artifactRegistryClient->createRule($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ArtifactRegistryClient::repositoryName( + '[PROJECT]', + '[LOCATION]', + '[REPOSITORY]' + ); + + create_rule_sample($formattedParent); +} +// [END artifactregistry_v1_generated_ArtifactRegistry_CreateRule_sync] diff --git a/ArtifactRegistry/samples/V1/ArtifactRegistryClient/delete_attachment.php b/ArtifactRegistry/samples/V1/ArtifactRegistryClient/delete_attachment.php new file mode 100644 index 000000000000..54728b57aece --- /dev/null +++ b/ArtifactRegistry/samples/V1/ArtifactRegistryClient/delete_attachment.php @@ -0,0 +1,87 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $artifactRegistryClient->deleteAttachment($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ArtifactRegistryClient::attachmentName( + '[PROJECT]', + '[LOCATION]', + '[REPOSITORY]', + '[ATTACHMENT]' + ); + + delete_attachment_sample($formattedName); +} +// [END artifactregistry_v1_generated_ArtifactRegistry_DeleteAttachment_sync] diff --git a/ArtifactRegistry/samples/V1/ArtifactRegistryClient/delete_file.php b/ArtifactRegistry/samples/V1/ArtifactRegistryClient/delete_file.php new file mode 100644 index 000000000000..3e466d22af2e --- /dev/null +++ b/ArtifactRegistry/samples/V1/ArtifactRegistryClient/delete_file.php @@ -0,0 +1,87 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $artifactRegistryClient->deleteFile($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ArtifactRegistryClient::fileName( + '[PROJECT]', + '[LOCATION]', + '[REPOSITORY]', + '[FILE]' + ); + + delete_file_sample($formattedName); +} +// [END artifactregistry_v1_generated_ArtifactRegistry_DeleteFile_sync] diff --git a/ArtifactRegistry/samples/V1/ArtifactRegistryClient/delete_rule.php b/ArtifactRegistry/samples/V1/ArtifactRegistryClient/delete_rule.php new file mode 100644 index 000000000000..e51c4979d7f2 --- /dev/null +++ b/ArtifactRegistry/samples/V1/ArtifactRegistryClient/delete_rule.php @@ -0,0 +1,74 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + $artifactRegistryClient->deleteRule($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ArtifactRegistryClient::ruleName( + '[PROJECT]', + '[LOCATION]', + '[REPOSITORY]', + '[RULE]' + ); + + delete_rule_sample($formattedName); +} +// [END artifactregistry_v1_generated_ArtifactRegistry_DeleteRule_sync] diff --git a/ArtifactRegistry/samples/V1/ArtifactRegistryClient/get_attachment.php b/ArtifactRegistry/samples/V1/ArtifactRegistryClient/get_attachment.php new file mode 100644 index 000000000000..7db7fe48e5e0 --- /dev/null +++ b/ArtifactRegistry/samples/V1/ArtifactRegistryClient/get_attachment.php @@ -0,0 +1,76 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Attachment $response */ + $response = $artifactRegistryClient->getAttachment($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ArtifactRegistryClient::attachmentName( + '[PROJECT]', + '[LOCATION]', + '[REPOSITORY]', + '[ATTACHMENT]' + ); + + get_attachment_sample($formattedName); +} +// [END artifactregistry_v1_generated_ArtifactRegistry_GetAttachment_sync] diff --git a/ArtifactRegistry/samples/V1/ArtifactRegistryClient/get_rule.php b/ArtifactRegistry/samples/V1/ArtifactRegistryClient/get_rule.php new file mode 100644 index 000000000000..998656c310af --- /dev/null +++ b/ArtifactRegistry/samples/V1/ArtifactRegistryClient/get_rule.php @@ -0,0 +1,76 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Rule $response */ + $response = $artifactRegistryClient->getRule($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = ArtifactRegistryClient::ruleName( + '[PROJECT]', + '[LOCATION]', + '[REPOSITORY]', + '[RULE]' + ); + + get_rule_sample($formattedName); +} +// [END artifactregistry_v1_generated_ArtifactRegistry_GetRule_sync] diff --git a/ArtifactRegistry/samples/V1/ArtifactRegistryClient/list_attachments.php b/ArtifactRegistry/samples/V1/ArtifactRegistryClient/list_attachments.php new file mode 100644 index 000000000000..c624ce8e8132 --- /dev/null +++ b/ArtifactRegistry/samples/V1/ArtifactRegistryClient/list_attachments.php @@ -0,0 +1,80 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $artifactRegistryClient->listAttachments($request); + + /** @var Attachment $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ArtifactRegistryClient::repositoryName( + '[PROJECT]', + '[LOCATION]', + '[REPOSITORY]' + ); + + list_attachments_sample($formattedParent); +} +// [END artifactregistry_v1_generated_ArtifactRegistry_ListAttachments_sync] diff --git a/ArtifactRegistry/samples/V1/ArtifactRegistryClient/list_rules.php b/ArtifactRegistry/samples/V1/ArtifactRegistryClient/list_rules.php new file mode 100644 index 000000000000..ac4df58ccfc0 --- /dev/null +++ b/ArtifactRegistry/samples/V1/ArtifactRegistryClient/list_rules.php @@ -0,0 +1,82 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $artifactRegistryClient->listRules($request); + + /** @var Rule $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = ArtifactRegistryClient::repositoryName( + '[PROJECT]', + '[LOCATION]', + '[REPOSITORY]' + ); + + list_rules_sample($formattedParent); +} +// [END artifactregistry_v1_generated_ArtifactRegistry_ListRules_sync] diff --git a/ArtifactRegistry/samples/V1/ArtifactRegistryClient/update_file.php b/ArtifactRegistry/samples/V1/ArtifactRegistryClient/update_file.php new file mode 100644 index 000000000000..d7848dba8bc5 --- /dev/null +++ b/ArtifactRegistry/samples/V1/ArtifactRegistryClient/update_file.php @@ -0,0 +1,62 @@ +setFile($file) + ->setUpdateMask($updateMask); + + // Call the API and handle any network failures. + try { + /** @var File $response */ + $response = $artifactRegistryClient->updateFile($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END artifactregistry_v1_generated_ArtifactRegistry_UpdateFile_sync] diff --git a/ArtifactRegistry/samples/V1/ArtifactRegistryClient/update_package.php b/ArtifactRegistry/samples/V1/ArtifactRegistryClient/update_package.php new file mode 100644 index 000000000000..ceb5ee521284 --- /dev/null +++ b/ArtifactRegistry/samples/V1/ArtifactRegistryClient/update_package.php @@ -0,0 +1,57 @@ +updatePackage($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END artifactregistry_v1_generated_ArtifactRegistry_UpdatePackage_sync] diff --git a/ArtifactRegistry/samples/V1/ArtifactRegistryClient/update_rule.php b/ArtifactRegistry/samples/V1/ArtifactRegistryClient/update_rule.php new file mode 100644 index 000000000000..d52bb220c640 --- /dev/null +++ b/ArtifactRegistry/samples/V1/ArtifactRegistryClient/update_rule.php @@ -0,0 +1,57 @@ +updateRule($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END artifactregistry_v1_generated_ArtifactRegistry_UpdateRule_sync] diff --git a/ArtifactRegistry/samples/V1/ArtifactRegistryClient/update_version.php b/ArtifactRegistry/samples/V1/ArtifactRegistryClient/update_version.php new file mode 100644 index 000000000000..2a3684f43630 --- /dev/null +++ b/ArtifactRegistry/samples/V1/ArtifactRegistryClient/update_version.php @@ -0,0 +1,59 @@ +setVersion($version); + + // Call the API and handle any network failures. + try { + /** @var Version $response */ + $response = $artifactRegistryClient->updateVersion($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END artifactregistry_v1_generated_ArtifactRegistry_UpdateVersion_sync] diff --git a/ArtifactRegistry/src/V1/Attachment.php b/ArtifactRegistry/src/V1/Attachment.php new file mode 100644 index 000000000000..c0fbabaade4b --- /dev/null +++ b/ArtifactRegistry/src/V1/Attachment.php @@ -0,0 +1,412 @@ +google.devtools.artifactregistry.v1.Attachment + */ +class Attachment extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the attachment. E.g. + * `projects/p1/locations/us/repositories/repo/attachments/sbom`. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Required. The target the attachment is for, can be a Version, Package or + * Repository. E.g. + * `projects/p1/locations/us-central1/repositories/repo1/packages/p1/versions/v1`. + * + * Generated from protobuf field string target = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target = ''; + /** + * Type of attachment. + * E.g. `application/vnd.spdx+json` + * + * Generated from protobuf field string type = 3; + */ + protected $type = ''; + /** + * The namespace this attachment belongs to. + * E.g. If an attachment is created by artifact analysis, namespace is set + * to `artifactanalysis.googleapis.com`. + * + * Generated from protobuf field string attachment_namespace = 4; + */ + protected $attachment_namespace = ''; + /** + * Optional. User annotations. These attributes can only be set and used by + * the user, and not by Artifact Registry. See + * https://google.aip.dev/128#annotations for more details such as format and + * size limitations. + * + * Generated from protobuf field map annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $annotations; + /** + * Output only. The time when the attachment was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The time when the attachment was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Required. The files that belong to this attachment. + * If the file ID part contains slashes, they are escaped. E.g. + * `projects/p1/locations/us-central1/repositories/repo1/files/sha:`. + * + * Generated from protobuf field repeated string files = 8 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + private $files; + /** + * Output only. The name of the OCI version that this attachment created. Only + * populated for Docker attachments. E.g. + * `projects/p1/locations/us-central1/repositories/repo1/packages/p1/versions/v1`. + * + * Generated from protobuf field string oci_version_name = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $oci_version_name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The name of the attachment. E.g. + * `projects/p1/locations/us/repositories/repo/attachments/sbom`. + * @type string $target + * Required. The target the attachment is for, can be a Version, Package or + * Repository. E.g. + * `projects/p1/locations/us-central1/repositories/repo1/packages/p1/versions/v1`. + * @type string $type + * Type of attachment. + * E.g. `application/vnd.spdx+json` + * @type string $attachment_namespace + * The namespace this attachment belongs to. + * E.g. If an attachment is created by artifact analysis, namespace is set + * to `artifactanalysis.googleapis.com`. + * @type array|\Google\Protobuf\Internal\MapField $annotations + * Optional. User annotations. These attributes can only be set and used by + * the user, and not by Artifact Registry. See + * https://google.aip.dev/128#annotations for more details such as format and + * size limitations. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time when the attachment was created. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The time when the attachment was last updated. + * @type array|\Google\Protobuf\Internal\RepeatedField $files + * Required. The files that belong to this attachment. + * If the file ID part contains slashes, they are escaped. E.g. + * `projects/p1/locations/us-central1/repositories/repo1/files/sha:`. + * @type string $oci_version_name + * Output only. The name of the OCI version that this attachment created. Only + * populated for Docker attachments. E.g. + * `projects/p1/locations/us-central1/repositories/repo1/packages/p1/versions/v1`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Devtools\Artifactregistry\V1\Attachment::initOnce(); + parent::__construct($data); + } + + /** + * The name of the attachment. E.g. + * `projects/p1/locations/us/repositories/repo/attachments/sbom`. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The name of the attachment. E.g. + * `projects/p1/locations/us/repositories/repo/attachments/sbom`. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The target the attachment is for, can be a Version, Package or + * Repository. E.g. + * `projects/p1/locations/us-central1/repositories/repo1/packages/p1/versions/v1`. + * + * Generated from protobuf field string target = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTarget() + { + return $this->target; + } + + /** + * Required. The target the attachment is for, can be a Version, Package or + * Repository. E.g. + * `projects/p1/locations/us-central1/repositories/repo1/packages/p1/versions/v1`. + * + * 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; + } + + /** + * Type of attachment. + * E.g. `application/vnd.spdx+json` + * + * Generated from protobuf field string type = 3; + * @return string + */ + public function getType() + { + return $this->type; + } + + /** + * Type of attachment. + * E.g. `application/vnd.spdx+json` + * + * Generated from protobuf field string type = 3; + * @param string $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkString($var, True); + $this->type = $var; + + return $this; + } + + /** + * The namespace this attachment belongs to. + * E.g. If an attachment is created by artifact analysis, namespace is set + * to `artifactanalysis.googleapis.com`. + * + * Generated from protobuf field string attachment_namespace = 4; + * @return string + */ + public function getAttachmentNamespace() + { + return $this->attachment_namespace; + } + + /** + * The namespace this attachment belongs to. + * E.g. If an attachment is created by artifact analysis, namespace is set + * to `artifactanalysis.googleapis.com`. + * + * Generated from protobuf field string attachment_namespace = 4; + * @param string $var + * @return $this + */ + public function setAttachmentNamespace($var) + { + GPBUtil::checkString($var, True); + $this->attachment_namespace = $var; + + return $this; + } + + /** + * Optional. User annotations. These attributes can only be set and used by + * the user, and not by Artifact Registry. See + * https://google.aip.dev/128#annotations for more details such as format and + * size limitations. + * + * Generated from protobuf field map annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getAnnotations() + { + return $this->annotations; + } + + /** + * Optional. User annotations. These attributes can only be set and used by + * the user, and not by Artifact Registry. See + * https://google.aip.dev/128#annotations for more details such as format and + * size limitations. + * + * Generated from protobuf field map annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setAnnotations($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->annotations = $arr; + + return $this; + } + + /** + * Output only. The time when the attachment was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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. The time when the attachment was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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 time when the attachment was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. The time when the attachment was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Required. The files that belong to this attachment. + * If the file ID part contains slashes, they are escaped. E.g. + * `projects/p1/locations/us-central1/repositories/repo1/files/sha:`. + * + * Generated from protobuf field repeated string files = 8 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFiles() + { + return $this->files; + } + + /** + * Required. The files that belong to this attachment. + * If the file ID part contains slashes, they are escaped. E.g. + * `projects/p1/locations/us-central1/repositories/repo1/files/sha:`. + * + * Generated from protobuf field repeated string files = 8 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFiles($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->files = $arr; + + return $this; + } + + /** + * Output only. The name of the OCI version that this attachment created. Only + * populated for Docker attachments. E.g. + * `projects/p1/locations/us-central1/repositories/repo1/packages/p1/versions/v1`. + * + * Generated from protobuf field string oci_version_name = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getOciVersionName() + { + return $this->oci_version_name; + } + + /** + * Output only. The name of the OCI version that this attachment created. Only + * populated for Docker attachments. E.g. + * `projects/p1/locations/us-central1/repositories/repo1/packages/p1/versions/v1`. + * + * Generated from protobuf field string oci_version_name = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setOciVersionName($var) + { + GPBUtil::checkString($var, True); + $this->oci_version_name = $var; + + return $this; + } + +} + diff --git a/ArtifactRegistry/src/V1/Client/ArtifactRegistryClient.php b/ArtifactRegistry/src/V1/Client/ArtifactRegistryClient.php index 8ef0e0bde17b..b47093978340 100644 --- a/ArtifactRegistry/src/V1/Client/ArtifactRegistryClient.php +++ b/ArtifactRegistry/src/V1/Client/ArtifactRegistryClient.php @@ -34,15 +34,22 @@ use Google\ApiCore\Transport\TransportInterface; use Google\ApiCore\ValidationException; use Google\Auth\FetchAuthTokenInterface; +use Google\Cloud\ArtifactRegistry\V1\Attachment; use Google\Cloud\ArtifactRegistry\V1\BatchDeleteVersionsRequest; +use Google\Cloud\ArtifactRegistry\V1\CreateAttachmentRequest; use Google\Cloud\ArtifactRegistry\V1\CreateRepositoryRequest; +use Google\Cloud\ArtifactRegistry\V1\CreateRuleRequest; use Google\Cloud\ArtifactRegistry\V1\CreateTagRequest; +use Google\Cloud\ArtifactRegistry\V1\DeleteAttachmentRequest; +use Google\Cloud\ArtifactRegistry\V1\DeleteFileRequest; use Google\Cloud\ArtifactRegistry\V1\DeletePackageRequest; use Google\Cloud\ArtifactRegistry\V1\DeleteRepositoryRequest; +use Google\Cloud\ArtifactRegistry\V1\DeleteRuleRequest; use Google\Cloud\ArtifactRegistry\V1\DeleteTagRequest; use Google\Cloud\ArtifactRegistry\V1\DeleteVersionRequest; use Google\Cloud\ArtifactRegistry\V1\DockerImage; use Google\Cloud\ArtifactRegistry\V1\File; +use Google\Cloud\ArtifactRegistry\V1\GetAttachmentRequest; use Google\Cloud\ArtifactRegistry\V1\GetDockerImageRequest; use Google\Cloud\ArtifactRegistry\V1\GetFileRequest; use Google\Cloud\ArtifactRegistry\V1\GetMavenArtifactRequest; @@ -51,11 +58,13 @@ use Google\Cloud\ArtifactRegistry\V1\GetProjectSettingsRequest; use Google\Cloud\ArtifactRegistry\V1\GetPythonPackageRequest; use Google\Cloud\ArtifactRegistry\V1\GetRepositoryRequest; +use Google\Cloud\ArtifactRegistry\V1\GetRuleRequest; use Google\Cloud\ArtifactRegistry\V1\GetTagRequest; use Google\Cloud\ArtifactRegistry\V1\GetVPCSCConfigRequest; use Google\Cloud\ArtifactRegistry\V1\GetVersionRequest; use Google\Cloud\ArtifactRegistry\V1\ImportAptArtifactsRequest; use Google\Cloud\ArtifactRegistry\V1\ImportYumArtifactsRequest; +use Google\Cloud\ArtifactRegistry\V1\ListAttachmentsRequest; use Google\Cloud\ArtifactRegistry\V1\ListDockerImagesRequest; use Google\Cloud\ArtifactRegistry\V1\ListFilesRequest; use Google\Cloud\ArtifactRegistry\V1\ListMavenArtifactsRequest; @@ -63,6 +72,7 @@ use Google\Cloud\ArtifactRegistry\V1\ListPackagesRequest; use Google\Cloud\ArtifactRegistry\V1\ListPythonPackagesRequest; use Google\Cloud\ArtifactRegistry\V1\ListRepositoriesRequest; +use Google\Cloud\ArtifactRegistry\V1\ListRulesRequest; use Google\Cloud\ArtifactRegistry\V1\ListTagsRequest; use Google\Cloud\ArtifactRegistry\V1\ListVersionsRequest; use Google\Cloud\ArtifactRegistry\V1\MavenArtifact; @@ -71,11 +81,16 @@ use Google\Cloud\ArtifactRegistry\V1\ProjectSettings; use Google\Cloud\ArtifactRegistry\V1\PythonPackage; use Google\Cloud\ArtifactRegistry\V1\Repository; +use Google\Cloud\ArtifactRegistry\V1\Rule; use Google\Cloud\ArtifactRegistry\V1\Tag; +use Google\Cloud\ArtifactRegistry\V1\UpdateFileRequest; +use Google\Cloud\ArtifactRegistry\V1\UpdatePackageRequest; use Google\Cloud\ArtifactRegistry\V1\UpdateProjectSettingsRequest; use Google\Cloud\ArtifactRegistry\V1\UpdateRepositoryRequest; +use Google\Cloud\ArtifactRegistry\V1\UpdateRuleRequest; use Google\Cloud\ArtifactRegistry\V1\UpdateTagRequest; use Google\Cloud\ArtifactRegistry\V1\UpdateVPCSCConfigRequest; +use Google\Cloud\ArtifactRegistry\V1\UpdateVersionRequest; use Google\Cloud\ArtifactRegistry\V1\VPCSCConfig; use Google\Cloud\ArtifactRegistry\V1\Version; use Google\Cloud\Iam\V1\GetIamPolicyRequest; @@ -114,12 +129,18 @@ * contained within formatted names that are returned by the API. * * @method PromiseInterface batchDeleteVersionsAsync(BatchDeleteVersionsRequest $request, array $optionalArgs = []) + * @method PromiseInterface createAttachmentAsync(CreateAttachmentRequest $request, array $optionalArgs = []) * @method PromiseInterface createRepositoryAsync(CreateRepositoryRequest $request, array $optionalArgs = []) + * @method PromiseInterface createRuleAsync(CreateRuleRequest $request, array $optionalArgs = []) * @method PromiseInterface createTagAsync(CreateTagRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteAttachmentAsync(DeleteAttachmentRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteFileAsync(DeleteFileRequest $request, array $optionalArgs = []) * @method PromiseInterface deletePackageAsync(DeletePackageRequest $request, array $optionalArgs = []) * @method PromiseInterface deleteRepositoryAsync(DeleteRepositoryRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteRuleAsync(DeleteRuleRequest $request, array $optionalArgs = []) * @method PromiseInterface deleteTagAsync(DeleteTagRequest $request, array $optionalArgs = []) * @method PromiseInterface deleteVersionAsync(DeleteVersionRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAttachmentAsync(GetAttachmentRequest $request, array $optionalArgs = []) * @method PromiseInterface getDockerImageAsync(GetDockerImageRequest $request, array $optionalArgs = []) * @method PromiseInterface getFileAsync(GetFileRequest $request, array $optionalArgs = []) * @method PromiseInterface getIamPolicyAsync(GetIamPolicyRequest $request, array $optionalArgs = []) @@ -129,11 +150,13 @@ * @method PromiseInterface getProjectSettingsAsync(GetProjectSettingsRequest $request, array $optionalArgs = []) * @method PromiseInterface getPythonPackageAsync(GetPythonPackageRequest $request, array $optionalArgs = []) * @method PromiseInterface getRepositoryAsync(GetRepositoryRequest $request, array $optionalArgs = []) + * @method PromiseInterface getRuleAsync(GetRuleRequest $request, array $optionalArgs = []) * @method PromiseInterface getTagAsync(GetTagRequest $request, array $optionalArgs = []) * @method PromiseInterface getVPCSCConfigAsync(GetVPCSCConfigRequest $request, array $optionalArgs = []) * @method PromiseInterface getVersionAsync(GetVersionRequest $request, array $optionalArgs = []) * @method PromiseInterface importAptArtifactsAsync(ImportAptArtifactsRequest $request, array $optionalArgs = []) * @method PromiseInterface importYumArtifactsAsync(ImportYumArtifactsRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAttachmentsAsync(ListAttachmentsRequest $request, array $optionalArgs = []) * @method PromiseInterface listDockerImagesAsync(ListDockerImagesRequest $request, array $optionalArgs = []) * @method PromiseInterface listFilesAsync(ListFilesRequest $request, array $optionalArgs = []) * @method PromiseInterface listMavenArtifactsAsync(ListMavenArtifactsRequest $request, array $optionalArgs = []) @@ -141,14 +164,19 @@ * @method PromiseInterface listPackagesAsync(ListPackagesRequest $request, array $optionalArgs = []) * @method PromiseInterface listPythonPackagesAsync(ListPythonPackagesRequest $request, array $optionalArgs = []) * @method PromiseInterface listRepositoriesAsync(ListRepositoriesRequest $request, array $optionalArgs = []) + * @method PromiseInterface listRulesAsync(ListRulesRequest $request, array $optionalArgs = []) * @method PromiseInterface listTagsAsync(ListTagsRequest $request, array $optionalArgs = []) * @method PromiseInterface listVersionsAsync(ListVersionsRequest $request, array $optionalArgs = []) * @method PromiseInterface setIamPolicyAsync(SetIamPolicyRequest $request, array $optionalArgs = []) * @method PromiseInterface testIamPermissionsAsync(TestIamPermissionsRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateFileAsync(UpdateFileRequest $request, array $optionalArgs = []) + * @method PromiseInterface updatePackageAsync(UpdatePackageRequest $request, array $optionalArgs = []) * @method PromiseInterface updateProjectSettingsAsync(UpdateProjectSettingsRequest $request, array $optionalArgs = []) * @method PromiseInterface updateRepositoryAsync(UpdateRepositoryRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateRuleAsync(UpdateRuleRequest $request, array $optionalArgs = []) * @method PromiseInterface updateTagAsync(UpdateTagRequest $request, array $optionalArgs = []) * @method PromiseInterface updateVPCSCConfigAsync(UpdateVPCSCConfigRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateVersionAsync(UpdateVersionRequest $request, array $optionalArgs = []) * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) * @method PromiseInterface listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = []) */ @@ -253,6 +281,31 @@ private function createOperationsClient(array $options) return new OperationsClient($options); } + /** + * Formats a string containing the fully-qualified path to represent a attachment + * resource. + * + * @param string $project + * @param string $location + * @param string $repository + * @param string $attachment + * + * @return string The formatted attachment resource. + */ + public static function attachmentName( + string $project, + string $location, + string $repository, + string $attachment + ): string { + return self::getPathTemplate('attachment')->render([ + 'project' => $project, + 'location' => $location, + 'repository' => $repository, + 'attachment' => $attachment, + ]); + } + /** * Formats a string containing the fully-qualified path to represent a docker_image * resource. @@ -446,6 +499,27 @@ public static function repositoryName(string $project, string $location, string ]); } + /** + * Formats a string containing the fully-qualified path to represent a rule + * resource. + * + * @param string $project + * @param string $location + * @param string $repository + * @param string $rule + * + * @return string The formatted rule resource. + */ + public static function ruleName(string $project, string $location, string $repository, string $rule): string + { + return self::getPathTemplate('rule')->render([ + 'project' => $project, + 'location' => $location, + 'repository' => $repository, + 'rule' => $rule, + ]); + } + /** * Formats a string containing the fully-qualified path to represent a * secret_version resource. @@ -542,6 +616,7 @@ public static function vpcscConfigName(string $project, string $location): strin * Parses a formatted name string and returns an associative array of the components in the name. * The following name formats are supported: * Template: Pattern + * - attachment: projects/{project}/locations/{location}/repositories/{repository}/attachments/{attachment} * - dockerImage: projects/{project}/locations/{location}/repositories/{repository}/dockerImages/{docker_image} * - file: projects/{project}/locations/{location}/repositories/{repository}/files/{file} * - location: projects/{project}/locations/{location} @@ -551,6 +626,7 @@ public static function vpcscConfigName(string $project, string $location): strin * - projectSettings: projects/{project}/projectSettings * - pythonPackage: projects/{project}/locations/{location}/repositories/{repository}/pythonPackages/{python_package} * - repository: projects/{project}/locations/{location}/repositories/{repository} + * - rule: projects/{project}/locations/{location}/repositories/{repository}/rules/{rule} * - secretVersion: projects/{project}/secrets/{secret}/versions/{secret_version} * - tag: projects/{project}/locations/{location}/repositories/{repository}/packages/{package}/tags/{tag} * - version: projects/{project}/locations/{location}/repositories/{repository}/packages/{package}/versions/{version} @@ -673,6 +749,33 @@ public function batchDeleteVersions(BatchDeleteVersionsRequest $request, array $ return $this->startApiCall('BatchDeleteVersions', $request, $callOptions)->wait(); } + /** + * Creates an attachment. The returned Operation will finish once the + * attachment has been created. Its response will be the created attachment. + * + * The async variant is {@see ArtifactRegistryClient::createAttachmentAsync()} . + * + * @example samples/V1/ArtifactRegistryClient/create_attachment.php + * + * @param CreateAttachmentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createAttachment(CreateAttachmentRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateAttachment', $request, $callOptions)->wait(); + } + /** * Creates a repository. The returned Operation will finish once the * repository has been created. Its response will be the created Repository. @@ -700,6 +803,32 @@ public function createRepository(CreateRepositoryRequest $request, array $callOp return $this->startApiCall('CreateRepository', $request, $callOptions)->wait(); } + /** + * Creates a rule. + * + * The async variant is {@see ArtifactRegistryClient::createRuleAsync()} . + * + * @example samples/V1/ArtifactRegistryClient/create_rule.php + * + * @param CreateRuleRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Rule + * + * @throws ApiException Thrown if the API call fails. + */ + public function createRule(CreateRuleRequest $request, array $callOptions = []): Rule + { + return $this->startApiCall('CreateRule', $request, $callOptions)->wait(); + } + /** * Creates a tag. * @@ -726,6 +855,62 @@ public function createTag(CreateTagRequest $request, array $callOptions = []): T return $this->startApiCall('CreateTag', $request, $callOptions)->wait(); } + /** + * Deletes an attachment. The returned Operation will + * finish once the attachments has been deleted. It will not have any + * Operation metadata and will return a `google.protobuf.Empty` response. + * + * The async variant is {@see ArtifactRegistryClient::deleteAttachmentAsync()} . + * + * @example samples/V1/ArtifactRegistryClient/delete_attachment.php + * + * @param DeleteAttachmentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteAttachment(DeleteAttachmentRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteAttachment', $request, $callOptions)->wait(); + } + + /** + * Deletes a file and all of its content. It is only allowed on generic + * repositories. The returned operation will complete once the file has been + * deleted. + * + * The async variant is {@see ArtifactRegistryClient::deleteFileAsync()} . + * + * @example samples/V1/ArtifactRegistryClient/delete_file.php + * + * @param DeleteFileRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteFile(DeleteFileRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteFile', $request, $callOptions)->wait(); + } + /** * Deletes a package and all of its versions and tags. The returned operation * will complete once the package has been deleted. @@ -781,6 +966,30 @@ public function deleteRepository(DeleteRepositoryRequest $request, array $callOp return $this->startApiCall('DeleteRepository', $request, $callOptions)->wait(); } + /** + * Deletes a rule. + * + * The async variant is {@see ArtifactRegistryClient::deleteRuleAsync()} . + * + * @example samples/V1/ArtifactRegistryClient/delete_rule.php + * + * @param DeleteRuleRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteRule(DeleteRuleRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteRule', $request, $callOptions)->wait(); + } + /** * Deletes a tag. * @@ -832,6 +1041,32 @@ public function deleteVersion(DeleteVersionRequest $request, array $callOptions return $this->startApiCall('DeleteVersion', $request, $callOptions)->wait(); } + /** + * Gets an attachment. + * + * The async variant is {@see ArtifactRegistryClient::getAttachmentAsync()} . + * + * @example samples/V1/ArtifactRegistryClient/get_attachment.php + * + * @param GetAttachmentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Attachment + * + * @throws ApiException Thrown if the API call fails. + */ + public function getAttachment(GetAttachmentRequest $request, array $callOptions = []): Attachment + { + return $this->startApiCall('GetAttachment', $request, $callOptions)->wait(); + } + /** * Gets a docker image. * @@ -1066,6 +1301,32 @@ public function getRepository(GetRepositoryRequest $request, array $callOptions return $this->startApiCall('GetRepository', $request, $callOptions)->wait(); } + /** + * Gets a rule. + * + * The async variant is {@see ArtifactRegistryClient::getRuleAsync()} . + * + * @example samples/V1/ArtifactRegistryClient/get_rule.php + * + * @param GetRuleRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Rule + * + * @throws ApiException Thrown if the API call fails. + */ + public function getRule(GetRuleRequest $request, array $callOptions = []): Rule + { + return $this->startApiCall('GetRule', $request, $callOptions)->wait(); + } + /** * Gets a tag. * @@ -1202,6 +1463,32 @@ public function importYumArtifacts(ImportYumArtifactsRequest $request, array $ca return $this->startApiCall('ImportYumArtifacts', $request, $callOptions)->wait(); } + /** + * Lists attachments. + * + * The async variant is {@see ArtifactRegistryClient::listAttachmentsAsync()} . + * + * @example samples/V1/ArtifactRegistryClient/list_attachments.php + * + * @param ListAttachmentsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listAttachments(ListAttachmentsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListAttachments', $request, $callOptions); + } + /** * Lists docker images. * @@ -1384,6 +1671,32 @@ public function listRepositories(ListRepositoriesRequest $request, array $callOp return $this->startApiCall('ListRepositories', $request, $callOptions); } + /** + * Lists rules. + * + * The async variant is {@see ArtifactRegistryClient::listRulesAsync()} . + * + * @example samples/V1/ArtifactRegistryClient/list_rules.php + * + * @param ListRulesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listRules(ListRulesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListRules', $request, $callOptions); + } + /** * Lists tags. * @@ -1490,6 +1803,58 @@ public function testIamPermissions( return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); } + /** + * Updates a file. + * + * The async variant is {@see ArtifactRegistryClient::updateFileAsync()} . + * + * @example samples/V1/ArtifactRegistryClient/update_file.php + * + * @param UpdateFileRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return File + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateFile(UpdateFileRequest $request, array $callOptions = []): File + { + return $this->startApiCall('UpdateFile', $request, $callOptions)->wait(); + } + + /** + * Updates a package. + * + * The async variant is {@see ArtifactRegistryClient::updatePackageAsync()} . + * + * @example samples/V1/ArtifactRegistryClient/update_package.php + * + * @param UpdatePackageRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Package + * + * @throws ApiException Thrown if the API call fails. + */ + public function updatePackage(UpdatePackageRequest $request, array $callOptions = []): Package + { + return $this->startApiCall('UpdatePackage', $request, $callOptions)->wait(); + } + /** * Updates the Settings for the Project. * @@ -1545,6 +1910,32 @@ public function updateRepository(UpdateRepositoryRequest $request, array $callOp return $this->startApiCall('UpdateRepository', $request, $callOptions)->wait(); } + /** + * Updates a rule. + * + * The async variant is {@see ArtifactRegistryClient::updateRuleAsync()} . + * + * @example samples/V1/ArtifactRegistryClient/update_rule.php + * + * @param UpdateRuleRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Rule + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateRule(UpdateRuleRequest $request, array $callOptions = []): Rule + { + return $this->startApiCall('UpdateRule', $request, $callOptions)->wait(); + } + /** * Updates a tag. * @@ -1597,6 +1988,32 @@ public function updateVPCSCConfig(UpdateVPCSCConfigRequest $request, array $call return $this->startApiCall('UpdateVPCSCConfig', $request, $callOptions)->wait(); } + /** + * Updates a version. + * + * The async variant is {@see ArtifactRegistryClient::updateVersionAsync()} . + * + * @example samples/V1/ArtifactRegistryClient/update_version.php + * + * @param UpdateVersionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Version + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateVersion(UpdateVersionRequest $request, array $callOptions = []): Version + { + return $this->startApiCall('UpdateVersion', $request, $callOptions)->wait(); + } + /** * Gets information about a location. * diff --git a/ArtifactRegistry/src/V1/CreateAttachmentRequest.php b/ArtifactRegistry/src/V1/CreateAttachmentRequest.php new file mode 100644 index 000000000000..595ccb3ed8a3 --- /dev/null +++ b/ArtifactRegistry/src/V1/CreateAttachmentRequest.php @@ -0,0 +1,168 @@ +google.devtools.artifactregistry.v1.CreateAttachmentRequest + */ +class CreateAttachmentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the parent resource where the attachment will be + * created. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The attachment id to use for this attachment. + * + * Generated from protobuf field string attachment_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $attachment_id = ''; + /** + * Required. The attachment to be created. + * + * Generated from protobuf field .google.devtools.artifactregistry.v1.Attachment attachment = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $attachment = null; + + /** + * @param string $parent Required. The name of the parent resource where the attachment will be + * created. Please see + * {@see ArtifactRegistryClient::repositoryName()} for help formatting this field. + * @param \Google\Cloud\ArtifactRegistry\V1\Attachment $attachment Required. The attachment to be created. + * @param string $attachmentId Required. The attachment id to use for this attachment. + * + * @return \Google\Cloud\ArtifactRegistry\V1\CreateAttachmentRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\ArtifactRegistry\V1\Attachment $attachment, string $attachmentId): self + { + return (new self()) + ->setParent($parent) + ->setAttachment($attachment) + ->setAttachmentId($attachmentId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the parent resource where the attachment will be + * created. + * @type string $attachment_id + * Required. The attachment id to use for this attachment. + * @type \Google\Cloud\ArtifactRegistry\V1\Attachment $attachment + * Required. The attachment to be created. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Devtools\Artifactregistry\V1\Attachment::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the parent resource where the attachment will be + * created. + * + * 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 name of the parent resource where the attachment will be + * created. + * + * 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. The attachment id to use for this attachment. + * + * Generated from protobuf field string attachment_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getAttachmentId() + { + return $this->attachment_id; + } + + /** + * Required. The attachment id to use for this attachment. + * + * Generated from protobuf field string attachment_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setAttachmentId($var) + { + GPBUtil::checkString($var, True); + $this->attachment_id = $var; + + return $this; + } + + /** + * Required. The attachment to be created. + * + * Generated from protobuf field .google.devtools.artifactregistry.v1.Attachment attachment = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\ArtifactRegistry\V1\Attachment|null + */ + public function getAttachment() + { + return $this->attachment; + } + + public function hasAttachment() + { + return isset($this->attachment); + } + + public function clearAttachment() + { + unset($this->attachment); + } + + /** + * Required. The attachment to be created. + * + * Generated from protobuf field .google.devtools.artifactregistry.v1.Attachment attachment = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\ArtifactRegistry\V1\Attachment $var + * @return $this + */ + public function setAttachment($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ArtifactRegistry\V1\Attachment::class); + $this->attachment = $var; + + return $this; + } + +} + diff --git a/ArtifactRegistry/src/V1/CreateRuleRequest.php b/ArtifactRegistry/src/V1/CreateRuleRequest.php new file mode 100644 index 000000000000..a088d5919b2e --- /dev/null +++ b/ArtifactRegistry/src/V1/CreateRuleRequest.php @@ -0,0 +1,163 @@ +google.devtools.artifactregistry.v1.CreateRuleRequest + */ +class CreateRuleRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the parent resource where the rule will be created. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * The rule id to use for this repository. + * + * Generated from protobuf field string rule_id = 2; + */ + protected $rule_id = ''; + /** + * The rule to be created. + * + * Generated from protobuf field .google.devtools.artifactregistry.v1.Rule rule = 3; + */ + protected $rule = null; + + /** + * @param string $parent Required. The name of the parent resource where the rule will be created. Please see + * {@see ArtifactRegistryClient::repositoryName()} for help formatting this field. + * @param \Google\Cloud\ArtifactRegistry\V1\Rule $rule The rule to be created. + * @param string $ruleId The rule id to use for this repository. + * + * @return \Google\Cloud\ArtifactRegistry\V1\CreateRuleRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\ArtifactRegistry\V1\Rule $rule, string $ruleId): self + { + return (new self()) + ->setParent($parent) + ->setRule($rule) + ->setRuleId($ruleId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the parent resource where the rule will be created. + * @type string $rule_id + * The rule id to use for this repository. + * @type \Google\Cloud\ArtifactRegistry\V1\Rule $rule + * The rule to be created. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Devtools\Artifactregistry\V1\Rule::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the parent resource where the rule will be created. + * + * 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 name of the parent resource where the rule will be created. + * + * 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; + } + + /** + * The rule id to use for this repository. + * + * Generated from protobuf field string rule_id = 2; + * @return string + */ + public function getRuleId() + { + return $this->rule_id; + } + + /** + * The rule id to use for this repository. + * + * Generated from protobuf field string rule_id = 2; + * @param string $var + * @return $this + */ + public function setRuleId($var) + { + GPBUtil::checkString($var, True); + $this->rule_id = $var; + + return $this; + } + + /** + * The rule to be created. + * + * Generated from protobuf field .google.devtools.artifactregistry.v1.Rule rule = 3; + * @return \Google\Cloud\ArtifactRegistry\V1\Rule|null + */ + public function getRule() + { + return $this->rule; + } + + public function hasRule() + { + return isset($this->rule); + } + + public function clearRule() + { + unset($this->rule); + } + + /** + * The rule to be created. + * + * Generated from protobuf field .google.devtools.artifactregistry.v1.Rule rule = 3; + * @param \Google\Cloud\ArtifactRegistry\V1\Rule $var + * @return $this + */ + public function setRule($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ArtifactRegistry\V1\Rule::class); + $this->rule = $var; + + return $this; + } + +} + diff --git a/ArtifactRegistry/src/V1/DeleteAttachmentRequest.php b/ArtifactRegistry/src/V1/DeleteAttachmentRequest.php new file mode 100644 index 000000000000..5b9bf5f09725 --- /dev/null +++ b/ArtifactRegistry/src/V1/DeleteAttachmentRequest.php @@ -0,0 +1,81 @@ +google.devtools.artifactregistry.v1.DeleteAttachmentRequest + */ +class DeleteAttachmentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the attachment to delete. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the attachment to delete. Please see + * {@see ArtifactRegistryClient::attachmentName()} for help formatting this field. + * + * @return \Google\Cloud\ArtifactRegistry\V1\DeleteAttachmentRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the attachment to delete. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Devtools\Artifactregistry\V1\Attachment::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the attachment to delete. + * + * 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 of the attachment to delete. + * + * 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/ArtifactRegistry/src/V1/DeleteFileRequest.php b/ArtifactRegistry/src/V1/DeleteFileRequest.php new file mode 100644 index 000000000000..0a1b6041a92d --- /dev/null +++ b/ArtifactRegistry/src/V1/DeleteFileRequest.php @@ -0,0 +1,81 @@ +google.devtools.artifactregistry.v1.DeleteFileRequest + */ +class DeleteFileRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the file to delete. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the file to delete. Please see + * {@see ArtifactRegistryClient::fileName()} for help formatting this field. + * + * @return \Google\Cloud\ArtifactRegistry\V1\DeleteFileRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the file to delete. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Devtools\Artifactregistry\V1\File::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the file to delete. + * + * 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 of the file to delete. + * + * 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/ArtifactRegistry/src/V1/DeleteRuleRequest.php b/ArtifactRegistry/src/V1/DeleteRuleRequest.php new file mode 100644 index 000000000000..1f09d0e1cb48 --- /dev/null +++ b/ArtifactRegistry/src/V1/DeleteRuleRequest.php @@ -0,0 +1,81 @@ +google.devtools.artifactregistry.v1.DeleteRuleRequest + */ +class DeleteRuleRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the rule to delete. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the rule to delete. Please see + * {@see ArtifactRegistryClient::ruleName()} for help formatting this field. + * + * @return \Google\Cloud\ArtifactRegistry\V1\DeleteRuleRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the rule to delete. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Devtools\Artifactregistry\V1\Rule::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the rule to delete. + * + * 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 of the rule to delete. + * + * 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/ArtifactRegistry/src/V1/File.php b/ArtifactRegistry/src/V1/File.php index a9aa22d95500..78f5157fbf56 100644 --- a/ArtifactRegistry/src/V1/File.php +++ b/ArtifactRegistry/src/V1/File.php @@ -17,7 +17,7 @@ class File extends \Google\Protobuf\Internal\Message { /** * The name of the file, for example: - * "projects/p1/locations/us-central1/repositories/repo1/files/a%2Fb%2Fc.txt". + * `projects/p1/locations/us-central1/repositories/repo1/files/a%2Fb%2Fc.txt`. * If the file ID part contains slashes, they are escaped. * * Generated from protobuf field string name = 1; @@ -60,6 +60,12 @@ class File extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.protobuf.Timestamp fetch_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ protected $fetch_time = null; + /** + * Optional. Client specified annotations. + * + * Generated from protobuf field map annotations = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $annotations; /** * Constructor. @@ -69,7 +75,7 @@ class File extends \Google\Protobuf\Internal\Message * * @type string $name * The name of the file, for example: - * "projects/p1/locations/us-central1/repositories/repo1/files/a%2Fb%2Fc.txt". + * `projects/p1/locations/us-central1/repositories/repo1/files/a%2Fb%2Fc.txt`. * If the file ID part contains slashes, they are escaped. * @type int|string $size_bytes * The size of the File in bytes. @@ -84,6 +90,8 @@ class File extends \Google\Protobuf\Internal\Message * @type \Google\Protobuf\Timestamp $fetch_time * Output only. The time when the last attempt to refresh the file's data was * made. Only set when the repository is remote. + * @type array|\Google\Protobuf\Internal\MapField $annotations + * Optional. Client specified annotations. * } */ public function __construct($data = NULL) { @@ -93,7 +101,7 @@ public function __construct($data = NULL) { /** * The name of the file, for example: - * "projects/p1/locations/us-central1/repositories/repo1/files/a%2Fb%2Fc.txt". + * `projects/p1/locations/us-central1/repositories/repo1/files/a%2Fb%2Fc.txt`. * If the file ID part contains slashes, they are escaped. * * Generated from protobuf field string name = 1; @@ -106,7 +114,7 @@ public function getName() /** * The name of the file, for example: - * "projects/p1/locations/us-central1/repositories/repo1/files/a%2Fb%2Fc.txt". + * `projects/p1/locations/us-central1/repositories/repo1/files/a%2Fb%2Fc.txt`. * If the file ID part contains slashes, they are escaped. * * Generated from protobuf field string name = 1; @@ -309,5 +317,31 @@ public function setFetchTime($var) return $this; } + /** + * Optional. Client specified annotations. + * + * Generated from protobuf field map annotations = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getAnnotations() + { + return $this->annotations; + } + + /** + * Optional. Client specified annotations. + * + * Generated from protobuf field map annotations = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setAnnotations($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->annotations = $arr; + + return $this; + } + } diff --git a/ArtifactRegistry/src/V1/GenericArtifact.php b/ArtifactRegistry/src/V1/GenericArtifact.php new file mode 100644 index 000000000000..4a6efd0137ef --- /dev/null +++ b/ArtifactRegistry/src/V1/GenericArtifact.php @@ -0,0 +1,205 @@ +google.devtools.artifactregistry.v1.GenericArtifact + */ +class GenericArtifact extends \Google\Protobuf\Internal\Message +{ + /** + * Resource name of the generic artifact. + * project, location, repository, package_id and version_id + * create a unique generic artifact. + * i.e. "projects/test-project/locations/us-west4/repositories/test-repo/ + * genericArtifacts/package_id:version_id" + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * The version of the generic artifact. + * + * Generated from protobuf field string version = 2; + */ + protected $version = ''; + /** + * Output only. The time when the Generic module is created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The time when the Generic module is updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Resource name of the generic artifact. + * project, location, repository, package_id and version_id + * create a unique generic artifact. + * i.e. "projects/test-project/locations/us-west4/repositories/test-repo/ + * genericArtifacts/package_id:version_id" + * @type string $version + * The version of the generic artifact. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time when the Generic module is created. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The time when the Generic module is updated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Devtools\Artifactregistry\V1\Generic::initOnce(); + parent::__construct($data); + } + + /** + * Resource name of the generic artifact. + * project, location, repository, package_id and version_id + * create a unique generic artifact. + * i.e. "projects/test-project/locations/us-west4/repositories/test-repo/ + * genericArtifacts/package_id:version_id" + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Resource name of the generic artifact. + * project, location, repository, package_id and version_id + * create a unique generic artifact. + * i.e. "projects/test-project/locations/us-west4/repositories/test-repo/ + * genericArtifacts/package_id:version_id" + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The version of the generic artifact. + * + * Generated from protobuf field string version = 2; + * @return string + */ + public function getVersion() + { + return $this->version; + } + + /** + * The version of the generic artifact. + * + * Generated from protobuf field string version = 2; + * @param string $var + * @return $this + */ + public function setVersion($var) + { + GPBUtil::checkString($var, True); + $this->version = $var; + + return $this; + } + + /** + * Output only. The time when the Generic module is created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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. The time when the Generic module is created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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 time when the Generic module is updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. The time when the Generic module is updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + +} + diff --git a/ArtifactRegistry/src/V1/GetAttachmentRequest.php b/ArtifactRegistry/src/V1/GetAttachmentRequest.php new file mode 100644 index 000000000000..b06cb6b7177b --- /dev/null +++ b/ArtifactRegistry/src/V1/GetAttachmentRequest.php @@ -0,0 +1,81 @@ +google.devtools.artifactregistry.v1.GetAttachmentRequest + */ +class GetAttachmentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the attachment to retrieve. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the attachment to retrieve. Please see + * {@see ArtifactRegistryClient::attachmentName()} for help formatting this field. + * + * @return \Google\Cloud\ArtifactRegistry\V1\GetAttachmentRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the attachment to retrieve. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Devtools\Artifactregistry\V1\Attachment::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the attachment to retrieve. + * + * 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 of the attachment to retrieve. + * + * 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/ArtifactRegistry/src/V1/GetRuleRequest.php b/ArtifactRegistry/src/V1/GetRuleRequest.php new file mode 100644 index 000000000000..1e23880ca5ca --- /dev/null +++ b/ArtifactRegistry/src/V1/GetRuleRequest.php @@ -0,0 +1,81 @@ +google.devtools.artifactregistry.v1.GetRuleRequest + */ +class GetRuleRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the rule to retrieve. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the rule to retrieve. Please see + * {@see ArtifactRegistryClient::ruleName()} for help formatting this field. + * + * @return \Google\Cloud\ArtifactRegistry\V1\GetRuleRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the rule to retrieve. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Devtools\Artifactregistry\V1\Rule::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the rule to retrieve. + * + * 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 of the rule to retrieve. + * + * 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/ArtifactRegistry/src/V1/ListAttachmentsRequest.php b/ArtifactRegistry/src/V1/ListAttachmentsRequest.php new file mode 100644 index 000000000000..9717a3807920 --- /dev/null +++ b/ArtifactRegistry/src/V1/ListAttachmentsRequest.php @@ -0,0 +1,199 @@ +google.devtools.artifactregistry.v1.ListAttachmentsRequest + */ +class ListAttachmentsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the parent resource whose attachments will be listed. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. An expression for filtering the results of the request. Filter + * rules are case insensitive. The fields eligible for filtering are: + * * `target` + * * `type` + * * `attachment_namespace` + * + * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * The maximum number of attachments to return. Maximum page size is 1,000. + * + * Generated from protobuf field int32 page_size = 3; + */ + protected $page_size = 0; + /** + * The next_page_token value returned from a previous list request, if any. + * + * Generated from protobuf field string page_token = 4; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The name of the parent resource whose attachments will be listed. Please see + * {@see ArtifactRegistryClient::repositoryName()} for help formatting this field. + * + * @return \Google\Cloud\ArtifactRegistry\V1\ListAttachmentsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the parent resource whose attachments will be listed. + * @type string $filter + * Optional. An expression for filtering the results of the request. Filter + * rules are case insensitive. The fields eligible for filtering are: + * * `target` + * * `type` + * * `attachment_namespace` + * @type int $page_size + * The maximum number of attachments to return. Maximum page size is 1,000. + * @type string $page_token + * The next_page_token value returned from a previous list request, if any. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Devtools\Artifactregistry\V1\Attachment::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the parent resource whose attachments will be listed. + * + * 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 name of the parent resource whose attachments will be listed. + * + * 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; + } + + /** + * Optional. An expression for filtering the results of the request. Filter + * rules are case insensitive. The fields eligible for filtering are: + * * `target` + * * `type` + * * `attachment_namespace` + * + * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. An expression for filtering the results of the request. Filter + * rules are case insensitive. The fields eligible for filtering are: + * * `target` + * * `type` + * * `attachment_namespace` + * + * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * The maximum number of attachments to return. Maximum page size is 1,000. + * + * Generated from protobuf field int32 page_size = 3; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * The maximum number of attachments to return. Maximum page size is 1,000. + * + * Generated from protobuf field int32 page_size = 3; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * The next_page_token value returned from a previous list request, if any. + * + * Generated from protobuf field string page_token = 4; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * The next_page_token value returned from a previous list request, if any. + * + * Generated from protobuf field string page_token = 4; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/ArtifactRegistry/src/V1/ListAttachmentsResponse.php b/ArtifactRegistry/src/V1/ListAttachmentsResponse.php new file mode 100644 index 000000000000..81c1780e2d0b --- /dev/null +++ b/ArtifactRegistry/src/V1/ListAttachmentsResponse.php @@ -0,0 +1,105 @@ +google.devtools.artifactregistry.v1.ListAttachmentsResponse + */ +class ListAttachmentsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The attachments returned. + * + * Generated from protobuf field repeated .google.devtools.artifactregistry.v1.Attachment attachments = 1; + */ + private $attachments; + /** + * The token to retrieve the next page of attachments, or empty if there are + * no more attachments to return. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\ArtifactRegistry\V1\Attachment>|\Google\Protobuf\Internal\RepeatedField $attachments + * The attachments returned. + * @type string $next_page_token + * The token to retrieve the next page of attachments, or empty if there are + * no more attachments to return. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Devtools\Artifactregistry\V1\Attachment::initOnce(); + parent::__construct($data); + } + + /** + * The attachments returned. + * + * Generated from protobuf field repeated .google.devtools.artifactregistry.v1.Attachment attachments = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAttachments() + { + return $this->attachments; + } + + /** + * The attachments returned. + * + * Generated from protobuf field repeated .google.devtools.artifactregistry.v1.Attachment attachments = 1; + * @param array<\Google\Cloud\ArtifactRegistry\V1\Attachment>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAttachments($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ArtifactRegistry\V1\Attachment::class); + $this->attachments = $arr; + + return $this; + } + + /** + * The token to retrieve the next page of attachments, or empty if there are + * no more attachments to return. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * The token to retrieve the next page of attachments, or empty if there are + * no more attachments to return. + * + * 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/ArtifactRegistry/src/V1/ListDockerImagesRequest.php b/ArtifactRegistry/src/V1/ListDockerImagesRequest.php index 6b0dff272eab..fc3d59be882a 100644 --- a/ArtifactRegistry/src/V1/ListDockerImagesRequest.php +++ b/ArtifactRegistry/src/V1/ListDockerImagesRequest.php @@ -23,7 +23,7 @@ class ListDockerImagesRequest extends \Google\Protobuf\Internal\Message */ protected $parent = ''; /** - * The maximum number of artifacts to return. + * The maximum number of artifacts to return. Maximum page size is 1,000. * * Generated from protobuf field int32 page_size = 2; */ @@ -65,7 +65,7 @@ public static function build(string $parent): self * Required. The name of the parent resource whose docker images will be * listed. * @type int $page_size - * The maximum number of artifacts to return. + * The maximum number of artifacts to return. Maximum page size is 1,000. * @type string $page_token * The next_page_token value returned from a previous list request, if any. * @type string $order_by @@ -106,7 +106,7 @@ public function setParent($var) } /** - * The maximum number of artifacts to return. + * The maximum number of artifacts to return. Maximum page size is 1,000. * * Generated from protobuf field int32 page_size = 2; * @return int @@ -117,7 +117,7 @@ public function getPageSize() } /** - * The maximum number of artifacts to return. + * The maximum number of artifacts to return. Maximum page size is 1,000. * * Generated from protobuf field int32 page_size = 2; * @param int $var diff --git a/ArtifactRegistry/src/V1/ListFilesRequest.php b/ArtifactRegistry/src/V1/ListFilesRequest.php index f8cf0a6173ca..9e06eec43575 100644 --- a/ArtifactRegistry/src/V1/ListFilesRequest.php +++ b/ArtifactRegistry/src/V1/ListFilesRequest.php @@ -27,17 +27,42 @@ class ListFilesRequest extends \Google\Protobuf\Internal\Message * case insensitive. The fields eligible for filtering are: * * `name` * * `owner` - * An example of using a filter: - * * `name="projects/p1/locations/us-central1/repositories/repo1/files/a/b/*"` --> Files with an - * ID starting with "a/b/". - * * `owner="projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/1.0"` --> - * Files owned by the version `1.0` in package `pkg1`. + * * `annotations` + * Examples of using a filter: + * To filter the results of your request to files with the name `my_file.txt` + * in project `my-project` in the `us-central` region, in repository + * `my-repo`, append the following filter expression to your request: + * * `name="projects/my-project/locations/us-central1/repositories/my-repo/files/my-file.txt"` + * You can also use wildcards to match any number of characters before or + * after the value: + * * `name="projects/my-project/locations/us-central1/repositories/my-repo/files/my-*"` + * * `name="projects/my-project/locations/us-central1/repositories/my-repo/files/*file.txt"` + * * `name="projects/my-project/locations/us-central1/repositories/my-repo/files/*file*"` + * To filter the results of your request to files owned by the version `1.0` + * in package `pkg1`, append the following filter expression to your request: + * * `owner="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/versions/1.0"` + * To filter the results of your request to files with the annotation + * key-value pair [`external_link`: `external_link_value`], append the + * following filter expression to your request: + * * `"annotations.external_link:external_link_value"` + * To filter just for a specific annotation key `external_link`, append the + * following filter expression to your request: + * * `"annotations.external_link"` + * If the annotation key or value contains special characters, you can escape + * them by surrounding the value with backticks. For example, to filter the + * results of your request to files with the annotation key-value pair + * [`external.link`:`https://example.com/my-file`], append the following + * filter expression to your request: + * * `` "annotations.`external.link`:`https://example.com/my-file`" `` + * You can also filter with annotations with a wildcard to + * match any number of characters before or after the value: + * * `` "annotations.*_link:`*example.com*`" `` * * Generated from protobuf field string filter = 4; */ protected $filter = ''; /** - * The maximum number of files to return. + * The maximum number of files to return. Maximum page size is 1,000. * * Generated from protobuf field int32 page_size = 2; */ @@ -84,13 +109,38 @@ public static function build(string $parent): self * case insensitive. The fields eligible for filtering are: * * `name` * * `owner` - * An example of using a filter: - * * `name="projects/p1/locations/us-central1/repositories/repo1/files/a/b/*"` --> Files with an - * ID starting with "a/b/". - * * `owner="projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/1.0"` --> - * Files owned by the version `1.0` in package `pkg1`. + * * `annotations` + * Examples of using a filter: + * To filter the results of your request to files with the name `my_file.txt` + * in project `my-project` in the `us-central` region, in repository + * `my-repo`, append the following filter expression to your request: + * * `name="projects/my-project/locations/us-central1/repositories/my-repo/files/my-file.txt"` + * You can also use wildcards to match any number of characters before or + * after the value: + * * `name="projects/my-project/locations/us-central1/repositories/my-repo/files/my-*"` + * * `name="projects/my-project/locations/us-central1/repositories/my-repo/files/*file.txt"` + * * `name="projects/my-project/locations/us-central1/repositories/my-repo/files/*file*"` + * To filter the results of your request to files owned by the version `1.0` + * in package `pkg1`, append the following filter expression to your request: + * * `owner="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/versions/1.0"` + * To filter the results of your request to files with the annotation + * key-value pair [`external_link`: `external_link_value`], append the + * following filter expression to your request: + * * `"annotations.external_link:external_link_value"` + * To filter just for a specific annotation key `external_link`, append the + * following filter expression to your request: + * * `"annotations.external_link"` + * If the annotation key or value contains special characters, you can escape + * them by surrounding the value with backticks. For example, to filter the + * results of your request to files with the annotation key-value pair + * [`external.link`:`https://example.com/my-file`], append the following + * filter expression to your request: + * * `` "annotations.`external.link`:`https://example.com/my-file`" `` + * You can also filter with annotations with a wildcard to + * match any number of characters before or after the value: + * * `` "annotations.*_link:`*example.com*`" `` * @type int $page_size - * The maximum number of files to return. + * The maximum number of files to return. Maximum page size is 1,000. * @type string $page_token * The next_page_token value returned from a previous list request, if any. * @type string $order_by @@ -135,11 +185,36 @@ public function setParent($var) * case insensitive. The fields eligible for filtering are: * * `name` * * `owner` - * An example of using a filter: - * * `name="projects/p1/locations/us-central1/repositories/repo1/files/a/b/*"` --> Files with an - * ID starting with "a/b/". - * * `owner="projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/1.0"` --> - * Files owned by the version `1.0` in package `pkg1`. + * * `annotations` + * Examples of using a filter: + * To filter the results of your request to files with the name `my_file.txt` + * in project `my-project` in the `us-central` region, in repository + * `my-repo`, append the following filter expression to your request: + * * `name="projects/my-project/locations/us-central1/repositories/my-repo/files/my-file.txt"` + * You can also use wildcards to match any number of characters before or + * after the value: + * * `name="projects/my-project/locations/us-central1/repositories/my-repo/files/my-*"` + * * `name="projects/my-project/locations/us-central1/repositories/my-repo/files/*file.txt"` + * * `name="projects/my-project/locations/us-central1/repositories/my-repo/files/*file*"` + * To filter the results of your request to files owned by the version `1.0` + * in package `pkg1`, append the following filter expression to your request: + * * `owner="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/versions/1.0"` + * To filter the results of your request to files with the annotation + * key-value pair [`external_link`: `external_link_value`], append the + * following filter expression to your request: + * * `"annotations.external_link:external_link_value"` + * To filter just for a specific annotation key `external_link`, append the + * following filter expression to your request: + * * `"annotations.external_link"` + * If the annotation key or value contains special characters, you can escape + * them by surrounding the value with backticks. For example, to filter the + * results of your request to files with the annotation key-value pair + * [`external.link`:`https://example.com/my-file`], append the following + * filter expression to your request: + * * `` "annotations.`external.link`:`https://example.com/my-file`" `` + * You can also filter with annotations with a wildcard to + * match any number of characters before or after the value: + * * `` "annotations.*_link:`*example.com*`" `` * * Generated from protobuf field string filter = 4; * @return string @@ -154,11 +229,36 @@ public function getFilter() * case insensitive. The fields eligible for filtering are: * * `name` * * `owner` - * An example of using a filter: - * * `name="projects/p1/locations/us-central1/repositories/repo1/files/a/b/*"` --> Files with an - * ID starting with "a/b/". - * * `owner="projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/1.0"` --> - * Files owned by the version `1.0` in package `pkg1`. + * * `annotations` + * Examples of using a filter: + * To filter the results of your request to files with the name `my_file.txt` + * in project `my-project` in the `us-central` region, in repository + * `my-repo`, append the following filter expression to your request: + * * `name="projects/my-project/locations/us-central1/repositories/my-repo/files/my-file.txt"` + * You can also use wildcards to match any number of characters before or + * after the value: + * * `name="projects/my-project/locations/us-central1/repositories/my-repo/files/my-*"` + * * `name="projects/my-project/locations/us-central1/repositories/my-repo/files/*file.txt"` + * * `name="projects/my-project/locations/us-central1/repositories/my-repo/files/*file*"` + * To filter the results of your request to files owned by the version `1.0` + * in package `pkg1`, append the following filter expression to your request: + * * `owner="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/versions/1.0"` + * To filter the results of your request to files with the annotation + * key-value pair [`external_link`: `external_link_value`], append the + * following filter expression to your request: + * * `"annotations.external_link:external_link_value"` + * To filter just for a specific annotation key `external_link`, append the + * following filter expression to your request: + * * `"annotations.external_link"` + * If the annotation key or value contains special characters, you can escape + * them by surrounding the value with backticks. For example, to filter the + * results of your request to files with the annotation key-value pair + * [`external.link`:`https://example.com/my-file`], append the following + * filter expression to your request: + * * `` "annotations.`external.link`:`https://example.com/my-file`" `` + * You can also filter with annotations with a wildcard to + * match any number of characters before or after the value: + * * `` "annotations.*_link:`*example.com*`" `` * * Generated from protobuf field string filter = 4; * @param string $var @@ -173,7 +273,7 @@ public function setFilter($var) } /** - * The maximum number of files to return. + * The maximum number of files to return. Maximum page size is 1,000. * * Generated from protobuf field int32 page_size = 2; * @return int @@ -184,7 +284,7 @@ public function getPageSize() } /** - * The maximum number of files to return. + * The maximum number of files to return. Maximum page size is 1,000. * * Generated from protobuf field int32 page_size = 2; * @param int $var diff --git a/ArtifactRegistry/src/V1/ListMavenArtifactsRequest.php b/ArtifactRegistry/src/V1/ListMavenArtifactsRequest.php index 4db5ada82688..5f9eca2db026 100644 --- a/ArtifactRegistry/src/V1/ListMavenArtifactsRequest.php +++ b/ArtifactRegistry/src/V1/ListMavenArtifactsRequest.php @@ -23,7 +23,7 @@ class ListMavenArtifactsRequest extends \Google\Protobuf\Internal\Message */ protected $parent = ''; /** - * The maximum number of artifacts to return. + * The maximum number of artifacts to return. Maximum page size is 1,000. * * Generated from protobuf field int32 page_size = 2; */ @@ -60,7 +60,7 @@ public static function build(string $parent): self * Required. The name of the parent resource whose maven artifacts will be * listed. * @type int $page_size - * The maximum number of artifacts to return. + * The maximum number of artifacts to return. Maximum page size is 1,000. * @type string $page_token * The next_page_token value returned from a previous list request, if any. * } @@ -99,7 +99,7 @@ public function setParent($var) } /** - * The maximum number of artifacts to return. + * The maximum number of artifacts to return. Maximum page size is 1,000. * * Generated from protobuf field int32 page_size = 2; * @return int @@ -110,7 +110,7 @@ public function getPageSize() } /** - * The maximum number of artifacts to return. + * The maximum number of artifacts to return. Maximum page size is 1,000. * * Generated from protobuf field int32 page_size = 2; * @param int $var diff --git a/ArtifactRegistry/src/V1/ListNpmPackagesRequest.php b/ArtifactRegistry/src/V1/ListNpmPackagesRequest.php index 66ab4c44a7c4..4c33928e1271 100644 --- a/ArtifactRegistry/src/V1/ListNpmPackagesRequest.php +++ b/ArtifactRegistry/src/V1/ListNpmPackagesRequest.php @@ -23,7 +23,7 @@ class ListNpmPackagesRequest extends \Google\Protobuf\Internal\Message */ protected $parent = ''; /** - * The maximum number of artifacts to return. + * The maximum number of artifacts to return. Maximum page size is 1,000. * * Generated from protobuf field int32 page_size = 2; */ @@ -60,7 +60,7 @@ public static function build(string $parent): self * Required. The name of the parent resource whose npm packages will be * listed. * @type int $page_size - * The maximum number of artifacts to return. + * The maximum number of artifacts to return. Maximum page size is 1,000. * @type string $page_token * The next_page_token value returned from a previous list request, if any. * } @@ -99,7 +99,7 @@ public function setParent($var) } /** - * The maximum number of artifacts to return. + * The maximum number of artifacts to return. Maximum page size is 1,000. * * Generated from protobuf field int32 page_size = 2; * @return int @@ -110,7 +110,7 @@ public function getPageSize() } /** - * The maximum number of artifacts to return. + * The maximum number of artifacts to return. Maximum page size is 1,000. * * Generated from protobuf field int32 page_size = 2; * @param int $var diff --git a/ArtifactRegistry/src/V1/ListPackagesRequest.php b/ArtifactRegistry/src/V1/ListPackagesRequest.php index cf8929daaf9d..d4d32aa996fc 100644 --- a/ArtifactRegistry/src/V1/ListPackagesRequest.php +++ b/ArtifactRegistry/src/V1/ListPackagesRequest.php @@ -33,6 +33,48 @@ class ListPackagesRequest extends \Google\Protobuf\Internal\Message * Generated from protobuf field string page_token = 3; */ protected $page_token = ''; + /** + * Optional. An expression for filtering the results of the request. Filter + * rules are case insensitive. The fields eligible for filtering are: + * * `name` + * * `annotations` + * Examples of using a filter: + * To filter the results of your request to packages with the name + * `my-package` in project `my-project` in the `us-central` region, in + * repository `my-repo`, append the following filter expression to your + * request: + * * `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package"` + * You can also use wildcards to match any number of characters before or + * after the value: + * * `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-*"` + * * `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/*package"` + * * `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/*pack*"` + * To filter the results of your request to packages with the annotation + * key-value pair [`external_link`: `external_link_value`], append the + * following filter expression to your request": + * * `"annotations.external_link:external_link_value"` + * To filter the results just for a specific annotation key `external_link`, + * append the following filter expression to your request: + * * `"annotations.external_link"` + * If the annotation key or value contains special characters, you can escape + * them by surrounding the value with backticks. For example, to filter the + * results of your request to packages with the annotation key-value pair + * [`external.link`:`https://example.com/my-package`], append the following + * filter expression to your request: + * * `` "annotations.`external.link`:`https://example.com/my-package`" `` + * You can also filter with annotations with a wildcard to + * match any number of characters before or after the value: + * * `` "annotations.*_link:`*example.com*`" `` + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. The field to order the results by. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; /** * @param string $parent Required. The name of the parent resource whose packages will be listed. Please see @@ -60,6 +102,40 @@ public static function build(string $parent): self * The maximum number of packages to return. Maximum page size is 1,000. * @type string $page_token * The next_page_token value returned from a previous list request, if any. + * @type string $filter + * Optional. An expression for filtering the results of the request. Filter + * rules are case insensitive. The fields eligible for filtering are: + * * `name` + * * `annotations` + * Examples of using a filter: + * To filter the results of your request to packages with the name + * `my-package` in project `my-project` in the `us-central` region, in + * repository `my-repo`, append the following filter expression to your + * request: + * * `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package"` + * You can also use wildcards to match any number of characters before or + * after the value: + * * `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-*"` + * * `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/*package"` + * * `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/*pack*"` + * To filter the results of your request to packages with the annotation + * key-value pair [`external_link`: `external_link_value`], append the + * following filter expression to your request": + * * `"annotations.external_link:external_link_value"` + * To filter the results just for a specific annotation key `external_link`, + * append the following filter expression to your request: + * * `"annotations.external_link"` + * If the annotation key or value contains special characters, you can escape + * them by surrounding the value with backticks. For example, to filter the + * results of your request to packages with the annotation key-value pair + * [`external.link`:`https://example.com/my-package`], append the following + * filter expression to your request: + * * `` "annotations.`external.link`:`https://example.com/my-package`" `` + * You can also filter with annotations with a wildcard to + * match any number of characters before or after the value: + * * `` "annotations.*_link:`*example.com*`" `` + * @type string $order_by + * Optional. The field to order the results by. * } */ public function __construct($data = NULL) { @@ -145,5 +221,117 @@ public function setPageToken($var) return $this; } + /** + * Optional. An expression for filtering the results of the request. Filter + * rules are case insensitive. The fields eligible for filtering are: + * * `name` + * * `annotations` + * Examples of using a filter: + * To filter the results of your request to packages with the name + * `my-package` in project `my-project` in the `us-central` region, in + * repository `my-repo`, append the following filter expression to your + * request: + * * `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package"` + * You can also use wildcards to match any number of characters before or + * after the value: + * * `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-*"` + * * `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/*package"` + * * `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/*pack*"` + * To filter the results of your request to packages with the annotation + * key-value pair [`external_link`: `external_link_value`], append the + * following filter expression to your request": + * * `"annotations.external_link:external_link_value"` + * To filter the results just for a specific annotation key `external_link`, + * append the following filter expression to your request: + * * `"annotations.external_link"` + * If the annotation key or value contains special characters, you can escape + * them by surrounding the value with backticks. For example, to filter the + * results of your request to packages with the annotation key-value pair + * [`external.link`:`https://example.com/my-package`], append the following + * filter expression to your request: + * * `` "annotations.`external.link`:`https://example.com/my-package`" `` + * You can also filter with annotations with a wildcard to + * match any number of characters before or after the value: + * * `` "annotations.*_link:`*example.com*`" `` + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. An expression for filtering the results of the request. Filter + * rules are case insensitive. The fields eligible for filtering are: + * * `name` + * * `annotations` + * Examples of using a filter: + * To filter the results of your request to packages with the name + * `my-package` in project `my-project` in the `us-central` region, in + * repository `my-repo`, append the following filter expression to your + * request: + * * `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package"` + * You can also use wildcards to match any number of characters before or + * after the value: + * * `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-*"` + * * `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/*package"` + * * `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/*pack*"` + * To filter the results of your request to packages with the annotation + * key-value pair [`external_link`: `external_link_value`], append the + * following filter expression to your request": + * * `"annotations.external_link:external_link_value"` + * To filter the results just for a specific annotation key `external_link`, + * append the following filter expression to your request: + * * `"annotations.external_link"` + * If the annotation key or value contains special characters, you can escape + * them by surrounding the value with backticks. For example, to filter the + * results of your request to packages with the annotation key-value pair + * [`external.link`:`https://example.com/my-package`], append the following + * filter expression to your request: + * * `` "annotations.`external.link`:`https://example.com/my-package`" `` + * You can also filter with annotations with a wildcard to + * match any number of characters before or after the value: + * * `` "annotations.*_link:`*example.com*`" `` + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. The field to order the results by. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. The field to order the results by. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + } diff --git a/ArtifactRegistry/src/V1/ListPythonPackagesRequest.php b/ArtifactRegistry/src/V1/ListPythonPackagesRequest.php index a49653837a14..0435c92ec3b7 100644 --- a/ArtifactRegistry/src/V1/ListPythonPackagesRequest.php +++ b/ArtifactRegistry/src/V1/ListPythonPackagesRequest.php @@ -23,7 +23,7 @@ class ListPythonPackagesRequest extends \Google\Protobuf\Internal\Message */ protected $parent = ''; /** - * The maximum number of artifacts to return. + * The maximum number of artifacts to return. Maximum page size is 1,000. * * Generated from protobuf field int32 page_size = 2; */ @@ -60,7 +60,7 @@ public static function build(string $parent): self * Required. The name of the parent resource whose python packages will be * listed. * @type int $page_size - * The maximum number of artifacts to return. + * The maximum number of artifacts to return. Maximum page size is 1,000. * @type string $page_token * The next_page_token value returned from a previous list request, if any. * } @@ -99,7 +99,7 @@ public function setParent($var) } /** - * The maximum number of artifacts to return. + * The maximum number of artifacts to return. Maximum page size is 1,000. * * Generated from protobuf field int32 page_size = 2; * @return int @@ -110,7 +110,7 @@ public function getPageSize() } /** - * The maximum number of artifacts to return. + * The maximum number of artifacts to return. Maximum page size is 1,000. * * Generated from protobuf field int32 page_size = 2; * @param int $var diff --git a/ArtifactRegistry/src/V1/ListRepositoriesRequest.php b/ArtifactRegistry/src/V1/ListRepositoriesRequest.php index 6c4d1e49225d..968b3ea9eb1d 100644 --- a/ArtifactRegistry/src/V1/ListRepositoriesRequest.php +++ b/ArtifactRegistry/src/V1/ListRepositoriesRequest.php @@ -34,6 +34,30 @@ class ListRepositoriesRequest extends \Google\Protobuf\Internal\Message * Generated from protobuf field string page_token = 3; */ protected $page_token = ''; + /** + * Optional. An expression for filtering the results of the request. Filter + * rules are case insensitive. The fields eligible for filtering are: + * * `name` + * Examples of using a filter: + * To filter the results of your request to repositories with the name + * `my-repo` in project `my-project` in the `us-central` region, append the + * following filter expression to your request: + * * `name="projects/my-project/locations/us-central1/repositories/my-repo"` + * You can also use wildcards to match any number of characters before or + * after the value: + * * `name="projects/my-project/locations/us-central1/repositories/my-*"` + * * `name="projects/my-project/locations/us-central1/repositories/*repo"` + * * `name="projects/my-project/locations/us-central1/repositories/*repo*"` + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. The field to order the results by. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; /** * @param string $parent Required. The name of the parent resource whose repositories will be @@ -63,6 +87,22 @@ public static function build(string $parent): self * The maximum number of repositories to return. Maximum page size is 1,000. * @type string $page_token * The next_page_token value returned from a previous list request, if any. + * @type string $filter + * Optional. An expression for filtering the results of the request. Filter + * rules are case insensitive. The fields eligible for filtering are: + * * `name` + * Examples of using a filter: + * To filter the results of your request to repositories with the name + * `my-repo` in project `my-project` in the `us-central` region, append the + * following filter expression to your request: + * * `name="projects/my-project/locations/us-central1/repositories/my-repo"` + * You can also use wildcards to match any number of characters before or + * after the value: + * * `name="projects/my-project/locations/us-central1/repositories/my-*"` + * * `name="projects/my-project/locations/us-central1/repositories/*repo"` + * * `name="projects/my-project/locations/us-central1/repositories/*repo*"` + * @type string $order_by + * Optional. The field to order the results by. * } */ public function __construct($data = NULL) { @@ -150,5 +190,81 @@ public function setPageToken($var) return $this; } + /** + * Optional. An expression for filtering the results of the request. Filter + * rules are case insensitive. The fields eligible for filtering are: + * * `name` + * Examples of using a filter: + * To filter the results of your request to repositories with the name + * `my-repo` in project `my-project` in the `us-central` region, append the + * following filter expression to your request: + * * `name="projects/my-project/locations/us-central1/repositories/my-repo"` + * You can also use wildcards to match any number of characters before or + * after the value: + * * `name="projects/my-project/locations/us-central1/repositories/my-*"` + * * `name="projects/my-project/locations/us-central1/repositories/*repo"` + * * `name="projects/my-project/locations/us-central1/repositories/*repo*"` + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. An expression for filtering the results of the request. Filter + * rules are case insensitive. The fields eligible for filtering are: + * * `name` + * Examples of using a filter: + * To filter the results of your request to repositories with the name + * `my-repo` in project `my-project` in the `us-central` region, append the + * following filter expression to your request: + * * `name="projects/my-project/locations/us-central1/repositories/my-repo"` + * You can also use wildcards to match any number of characters before or + * after the value: + * * `name="projects/my-project/locations/us-central1/repositories/my-*"` + * * `name="projects/my-project/locations/us-central1/repositories/*repo"` + * * `name="projects/my-project/locations/us-central1/repositories/*repo*"` + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. The field to order the results by. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. The field to order the results by. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + } diff --git a/ArtifactRegistry/src/V1/ListRulesRequest.php b/ArtifactRegistry/src/V1/ListRulesRequest.php new file mode 100644 index 000000000000..0e1d3f2a3e30 --- /dev/null +++ b/ArtifactRegistry/src/V1/ListRulesRequest.php @@ -0,0 +1,159 @@ +google.devtools.artifactregistry.v1.ListRulesRequest + */ +class ListRulesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the parent repository whose rules will be listed. + * For example: + * `projects/p1/locations/us-central1/repositories/repo1`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * The maximum number of rules to return. Maximum page size is 1,000. + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * The next_page_token value returned from a previous list request, if any. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The name of the parent repository whose rules will be listed. + * For example: + * `projects/p1/locations/us-central1/repositories/repo1`. Please see + * {@see ArtifactRegistryClient::repositoryName()} for help formatting this field. + * + * @return \Google\Cloud\ArtifactRegistry\V1\ListRulesRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The name of the parent repository whose rules will be listed. + * For example: + * `projects/p1/locations/us-central1/repositories/repo1`. + * @type int $page_size + * The maximum number of rules to return. Maximum page size is 1,000. + * @type string $page_token + * The next_page_token value returned from a previous list request, if any. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Devtools\Artifactregistry\V1\Rule::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the parent repository whose rules will be listed. + * For example: + * `projects/p1/locations/us-central1/repositories/repo1`. + * + * 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 name of the parent repository whose rules will be listed. + * For example: + * `projects/p1/locations/us-central1/repositories/repo1`. + * + * 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; + } + + /** + * The maximum number of rules to return. Maximum page size is 1,000. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * The maximum number of rules to return. Maximum page size is 1,000. + * + * 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; + } + + /** + * The next_page_token value returned from a previous list request, if any. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * The next_page_token value returned from a previous list request, if any. + * + * 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; + } + +} + diff --git a/ArtifactRegistry/src/V1/ListRulesResponse.php b/ArtifactRegistry/src/V1/ListRulesResponse.php new file mode 100644 index 000000000000..bc9bcda95a7b --- /dev/null +++ b/ArtifactRegistry/src/V1/ListRulesResponse.php @@ -0,0 +1,105 @@ +google.devtools.artifactregistry.v1.ListRulesResponse + */ +class ListRulesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The rules returned. + * + * Generated from protobuf field repeated .google.devtools.artifactregistry.v1.Rule rules = 1; + */ + private $rules; + /** + * The token to retrieve the next page of rules, or empty if there are no + * more rules to return. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\ArtifactRegistry\V1\Rule>|\Google\Protobuf\Internal\RepeatedField $rules + * The rules returned. + * @type string $next_page_token + * The token to retrieve the next page of rules, or empty if there are no + * more rules to return. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Devtools\Artifactregistry\V1\Rule::initOnce(); + parent::__construct($data); + } + + /** + * The rules returned. + * + * Generated from protobuf field repeated .google.devtools.artifactregistry.v1.Rule rules = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRules() + { + return $this->rules; + } + + /** + * The rules returned. + * + * Generated from protobuf field repeated .google.devtools.artifactregistry.v1.Rule rules = 1; + * @param array<\Google\Cloud\ArtifactRegistry\V1\Rule>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRules($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ArtifactRegistry\V1\Rule::class); + $this->rules = $arr; + + return $this; + } + + /** + * The token to retrieve the next page of rules, or empty if there are no + * more rules to return. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * The token to retrieve the next page of rules, or empty if there are no + * more rules to return. + * + * 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/ArtifactRegistry/src/V1/ListTagsRequest.php b/ArtifactRegistry/src/V1/ListTagsRequest.php index 3f5b8a81b0c6..91c35567cfe5 100644 --- a/ArtifactRegistry/src/V1/ListTagsRequest.php +++ b/ArtifactRegistry/src/V1/ListTagsRequest.php @@ -26,16 +26,29 @@ class ListTagsRequest extends \Google\Protobuf\Internal\Message /** * An expression for filtering the results of the request. Filter rules are * case insensitive. The fields eligible for filtering are: + * * `name` * * `version` - * An example of using a filter: - * * `version="projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/1.0"` - * --> Tags that are applied to the version `1.0` in package `pkg1`. + * Examples of using a filter: + * To filter the results of your request to tags with the name `my-tag` in + * package `my-package` in repository `my-repo` in project "`y-project` in + * the us-central region, append the following filter expression to your + * request: + * * `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/tags/my-tag"` + * You can also use wildcards to match any number of characters before or + * after the value: + * * `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/tags/my*"` + * * `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/tags/*tag"` + * * `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/tags/*tag*"` + * To filter the results of your request to tags applied to the version + * `1.0` in package `my-package`, append the following filter expression to + * your request: + * * `version="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/versions/1.0"` * * Generated from protobuf field string filter = 4; */ protected $filter = ''; /** - * The maximum number of tags to return. Maximum page size is 10,000. + * The maximum number of tags to return. Maximum page size is 1,000. * * Generated from protobuf field int32 page_size = 2; */ @@ -75,12 +88,25 @@ public static function build(string $parent): self * @type string $filter * An expression for filtering the results of the request. Filter rules are * case insensitive. The fields eligible for filtering are: + * * `name` * * `version` - * An example of using a filter: - * * `version="projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/1.0"` - * --> Tags that are applied to the version `1.0` in package `pkg1`. + * Examples of using a filter: + * To filter the results of your request to tags with the name `my-tag` in + * package `my-package` in repository `my-repo` in project "`y-project` in + * the us-central region, append the following filter expression to your + * request: + * * `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/tags/my-tag"` + * You can also use wildcards to match any number of characters before or + * after the value: + * * `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/tags/my*"` + * * `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/tags/*tag"` + * * `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/tags/*tag*"` + * To filter the results of your request to tags applied to the version + * `1.0` in package `my-package`, append the following filter expression to + * your request: + * * `version="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/versions/1.0"` * @type int $page_size - * The maximum number of tags to return. Maximum page size is 10,000. + * The maximum number of tags to return. Maximum page size is 1,000. * @type string $page_token * The next_page_token value returned from a previous list request, if any. * } @@ -123,10 +149,23 @@ public function setParent($var) /** * An expression for filtering the results of the request. Filter rules are * case insensitive. The fields eligible for filtering are: + * * `name` * * `version` - * An example of using a filter: - * * `version="projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/1.0"` - * --> Tags that are applied to the version `1.0` in package `pkg1`. + * Examples of using a filter: + * To filter the results of your request to tags with the name `my-tag` in + * package `my-package` in repository `my-repo` in project "`y-project` in + * the us-central region, append the following filter expression to your + * request: + * * `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/tags/my-tag"` + * You can also use wildcards to match any number of characters before or + * after the value: + * * `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/tags/my*"` + * * `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/tags/*tag"` + * * `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/tags/*tag*"` + * To filter the results of your request to tags applied to the version + * `1.0` in package `my-package`, append the following filter expression to + * your request: + * * `version="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/versions/1.0"` * * Generated from protobuf field string filter = 4; * @return string @@ -139,10 +178,23 @@ public function getFilter() /** * An expression for filtering the results of the request. Filter rules are * case insensitive. The fields eligible for filtering are: + * * `name` * * `version` - * An example of using a filter: - * * `version="projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/1.0"` - * --> Tags that are applied to the version `1.0` in package `pkg1`. + * Examples of using a filter: + * To filter the results of your request to tags with the name `my-tag` in + * package `my-package` in repository `my-repo` in project "`y-project` in + * the us-central region, append the following filter expression to your + * request: + * * `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/tags/my-tag"` + * You can also use wildcards to match any number of characters before or + * after the value: + * * `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/tags/my*"` + * * `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/tags/*tag"` + * * `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/tags/*tag*"` + * To filter the results of your request to tags applied to the version + * `1.0` in package `my-package`, append the following filter expression to + * your request: + * * `version="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/versions/1.0"` * * Generated from protobuf field string filter = 4; * @param string $var @@ -157,7 +209,7 @@ public function setFilter($var) } /** - * The maximum number of tags to return. Maximum page size is 10,000. + * The maximum number of tags to return. Maximum page size is 1,000. * * Generated from protobuf field int32 page_size = 2; * @return int @@ -168,7 +220,7 @@ public function getPageSize() } /** - * The maximum number of tags to return. Maximum page size is 10,000. + * The maximum number of tags to return. Maximum page size is 1,000. * * Generated from protobuf field int32 page_size = 2; * @param int $var diff --git a/ArtifactRegistry/src/V1/ListVersionsRequest.php b/ArtifactRegistry/src/V1/ListVersionsRequest.php index b10835ebe609..e7e73d781b2d 100644 --- a/ArtifactRegistry/src/V1/ListVersionsRequest.php +++ b/ArtifactRegistry/src/V1/ListVersionsRequest.php @@ -45,6 +45,42 @@ class ListVersionsRequest extends \Google\Protobuf\Internal\Message * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; */ protected $order_by = ''; + /** + * Optional. An expression for filtering the results of the request. Filter + * rules are case insensitive. The fields eligible for filtering are: + * * `name` + * * `annotations` + * Examples of using a filter: + * To filter the results of your request to versions with the name + * `my-version` in project `my-project` in the `us-central` region, in + * repository `my-repo`, append the following filter expression to your + * request: + * * `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/versions/my-version"` + * You can also use wildcards to match any number of characters before or + * after the value: + * * `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/versions/*version"` + * * `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/versions/my*"` + * * `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/versions/*version*"` + * To filter the results of your request to versions with the annotation + * key-value pair [`external_link`: `external_link_value`], append the + * following filter expression to your request: + * * `"annotations.external_link:external_link_value"` + * To filter just for a specific annotation key `external_link`, append the + * following filter expression to your request: + * * `"annotations.external_link"` + * If the annotation key or value contains special characters, you can escape + * them by surrounding the value with backticks. For example, to filter the + * results of your request to versions with the annotation key-value pair + * [`external.link`:`https://example.com/my-version`], append the following + * filter expression to your request: + * * `` "annotations.`external.link`:`https://example.com/my-version`" `` + * You can also filter with annotations with a wildcard to + * match any number of characters before or after the value: + * * `` "annotations.*_link:`*example.com*`" `` + * + * Generated from protobuf field string filter = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; /** * @param string $parent The name of the parent resource whose versions will be listed. @@ -75,6 +111,38 @@ public static function build(string $parent): self * The view that should be returned in the response. * @type string $order_by * Optional. The field to order the results by. + * @type string $filter + * Optional. An expression for filtering the results of the request. Filter + * rules are case insensitive. The fields eligible for filtering are: + * * `name` + * * `annotations` + * Examples of using a filter: + * To filter the results of your request to versions with the name + * `my-version` in project `my-project` in the `us-central` region, in + * repository `my-repo`, append the following filter expression to your + * request: + * * `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/versions/my-version"` + * You can also use wildcards to match any number of characters before or + * after the value: + * * `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/versions/*version"` + * * `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/versions/my*"` + * * `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/versions/*version*"` + * To filter the results of your request to versions with the annotation + * key-value pair [`external_link`: `external_link_value`], append the + * following filter expression to your request: + * * `"annotations.external_link:external_link_value"` + * To filter just for a specific annotation key `external_link`, append the + * following filter expression to your request: + * * `"annotations.external_link"` + * If the annotation key or value contains special characters, you can escape + * them by surrounding the value with backticks. For example, to filter the + * results of your request to versions with the annotation key-value pair + * [`external.link`:`https://example.com/my-version`], append the following + * filter expression to your request: + * * `` "annotations.`external.link`:`https://example.com/my-version`" `` + * You can also filter with annotations with a wildcard to + * match any number of characters before or after the value: + * * `` "annotations.*_link:`*example.com*`" `` * } */ public function __construct($data = NULL) { @@ -212,5 +280,91 @@ public function setOrderBy($var) return $this; } + /** + * Optional. An expression for filtering the results of the request. Filter + * rules are case insensitive. The fields eligible for filtering are: + * * `name` + * * `annotations` + * Examples of using a filter: + * To filter the results of your request to versions with the name + * `my-version` in project `my-project` in the `us-central` region, in + * repository `my-repo`, append the following filter expression to your + * request: + * * `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/versions/my-version"` + * You can also use wildcards to match any number of characters before or + * after the value: + * * `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/versions/*version"` + * * `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/versions/my*"` + * * `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/versions/*version*"` + * To filter the results of your request to versions with the annotation + * key-value pair [`external_link`: `external_link_value`], append the + * following filter expression to your request: + * * `"annotations.external_link:external_link_value"` + * To filter just for a specific annotation key `external_link`, append the + * following filter expression to your request: + * * `"annotations.external_link"` + * If the annotation key or value contains special characters, you can escape + * them by surrounding the value with backticks. For example, to filter the + * results of your request to versions with the annotation key-value pair + * [`external.link`:`https://example.com/my-version`], append the following + * filter expression to your request: + * * `` "annotations.`external.link`:`https://example.com/my-version`" `` + * You can also filter with annotations with a wildcard to + * match any number of characters before or after the value: + * * `` "annotations.*_link:`*example.com*`" `` + * + * Generated from protobuf field string filter = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. An expression for filtering the results of the request. Filter + * rules are case insensitive. The fields eligible for filtering are: + * * `name` + * * `annotations` + * Examples of using a filter: + * To filter the results of your request to versions with the name + * `my-version` in project `my-project` in the `us-central` region, in + * repository `my-repo`, append the following filter expression to your + * request: + * * `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/versions/my-version"` + * You can also use wildcards to match any number of characters before or + * after the value: + * * `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/versions/*version"` + * * `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/versions/my*"` + * * `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/versions/*version*"` + * To filter the results of your request to versions with the annotation + * key-value pair [`external_link`: `external_link_value`], append the + * following filter expression to your request: + * * `"annotations.external_link:external_link_value"` + * To filter just for a specific annotation key `external_link`, append the + * following filter expression to your request: + * * `"annotations.external_link"` + * If the annotation key or value contains special characters, you can escape + * them by surrounding the value with backticks. For example, to filter the + * results of your request to versions with the annotation key-value pair + * [`external.link`:`https://example.com/my-version`], append the following + * filter expression to your request: + * * `` "annotations.`external.link`:`https://example.com/my-version`" `` + * You can also filter with annotations with a wildcard to + * match any number of characters before or after the value: + * * `` "annotations.*_link:`*example.com*`" `` + * + * Generated from protobuf field string filter = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + } diff --git a/ArtifactRegistry/src/V1/Package.php b/ArtifactRegistry/src/V1/Package.php index a61c4fe1b73a..fb2ef7cd265c 100644 --- a/ArtifactRegistry/src/V1/Package.php +++ b/ArtifactRegistry/src/V1/Package.php @@ -42,6 +42,12 @@ class Package extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.protobuf.Timestamp update_time = 6; */ protected $update_time = null; + /** + * Optional. Client specified annotations. + * + * Generated from protobuf field map annotations = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $annotations; /** * Constructor. @@ -60,6 +66,8 @@ class Package extends \Google\Protobuf\Internal\Message * @type \Google\Protobuf\Timestamp $update_time * The time when the package was last updated. This includes publishing a new * version of the package. + * @type array|\Google\Protobuf\Internal\MapField $annotations + * Optional. Client specified annotations. * } */ public function __construct($data = NULL) { @@ -197,5 +205,31 @@ public function setUpdateTime($var) return $this; } + /** + * Optional. Client specified annotations. + * + * Generated from protobuf field map annotations = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getAnnotations() + { + return $this->annotations; + } + + /** + * Optional. Client specified annotations. + * + * Generated from protobuf field map annotations = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setAnnotations($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->annotations = $arr; + + return $this; + } + } diff --git a/ArtifactRegistry/src/V1/ProjectSettings.php b/ArtifactRegistry/src/V1/ProjectSettings.php index d9ff5a79afbf..499f6a847b9c 100644 --- a/ArtifactRegistry/src/V1/ProjectSettings.php +++ b/ArtifactRegistry/src/V1/ProjectSettings.php @@ -31,6 +31,13 @@ class ProjectSettings extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.devtools.artifactregistry.v1.ProjectSettings.RedirectionState legacy_redirection_state = 2; */ protected $legacy_redirection_state = 0; + /** + * The percentage of pull traffic to redirect from GCR to AR when using + * partial redirection. + * + * Generated from protobuf field int32 pull_percent = 3; + */ + protected $pull_percent = 0; /** * Constructor. @@ -46,6 +53,9 @@ class ProjectSettings extends \Google\Protobuf\Internal\Message * In response: always set * @type int $legacy_redirection_state * The redirection state of the legacy repositories in this project. + * @type int $pull_percent + * The percentage of pull traffic to redirect from GCR to AR when using + * partial redirection. * } */ public function __construct($data = NULL) { @@ -113,5 +123,33 @@ public function setLegacyRedirectionState($var) return $this; } + /** + * The percentage of pull traffic to redirect from GCR to AR when using + * partial redirection. + * + * Generated from protobuf field int32 pull_percent = 3; + * @return int + */ + public function getPullPercent() + { + return $this->pull_percent; + } + + /** + * The percentage of pull traffic to redirect from GCR to AR when using + * partial redirection. + * + * Generated from protobuf field int32 pull_percent = 3; + * @param int $var + * @return $this + */ + public function setPullPercent($var) + { + GPBUtil::checkInt32($var); + $this->pull_percent = $var; + + return $this; + } + } diff --git a/ArtifactRegistry/src/V1/ProjectSettings/RedirectionState.php b/ArtifactRegistry/src/V1/ProjectSettings/RedirectionState.php index e07820abc46e..49dabdd2afe2 100644 --- a/ArtifactRegistry/src/V1/ProjectSettings/RedirectionState.php +++ b/ArtifactRegistry/src/V1/ProjectSettings/RedirectionState.php @@ -37,12 +37,26 @@ class RedirectionState * Generated from protobuf enum REDIRECTION_FROM_GCR_IO_FINALIZED = 3 [deprecated = true]; */ const REDIRECTION_FROM_GCR_IO_FINALIZED = 3; + /** + * Redirection is enabled and missing images are copied from GCR + * + * Generated from protobuf enum REDIRECTION_FROM_GCR_IO_ENABLED_AND_COPYING = 5; + */ + const REDIRECTION_FROM_GCR_IO_ENABLED_AND_COPYING = 5; + /** + * Redirection is partially enabled and missing images are copied from GCR + * + * Generated from protobuf enum REDIRECTION_FROM_GCR_IO_PARTIAL_AND_COPYING = 6; + */ + const REDIRECTION_FROM_GCR_IO_PARTIAL_AND_COPYING = 6; private static $valueToName = [ self::REDIRECTION_STATE_UNSPECIFIED => 'REDIRECTION_STATE_UNSPECIFIED', self::REDIRECTION_FROM_GCR_IO_DISABLED => 'REDIRECTION_FROM_GCR_IO_DISABLED', self::REDIRECTION_FROM_GCR_IO_ENABLED => 'REDIRECTION_FROM_GCR_IO_ENABLED', self::REDIRECTION_FROM_GCR_IO_FINALIZED => 'REDIRECTION_FROM_GCR_IO_FINALIZED', + self::REDIRECTION_FROM_GCR_IO_ENABLED_AND_COPYING => 'REDIRECTION_FROM_GCR_IO_ENABLED_AND_COPYING', + self::REDIRECTION_FROM_GCR_IO_PARTIAL_AND_COPYING => 'REDIRECTION_FROM_GCR_IO_PARTIAL_AND_COPYING', ]; public static function name($value) diff --git a/ArtifactRegistry/src/V1/RemoteRepositoryConfig.php b/ArtifactRegistry/src/V1/RemoteRepositoryConfig.php index cb55a85f5d2b..35567249d52c 100644 --- a/ArtifactRegistry/src/V1/RemoteRepositoryConfig.php +++ b/ArtifactRegistry/src/V1/RemoteRepositoryConfig.php @@ -27,6 +27,13 @@ class RemoteRepositoryConfig extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.devtools.artifactregistry.v1.RemoteRepositoryConfig.UpstreamCredentials upstream_credentials = 9 [(.google.api.field_behavior) = OPTIONAL]; */ protected $upstream_credentials = null; + /** + * Input only. A create/update remote repo option to avoid making a HEAD/GET + * request to validate a remote repo and any supplied upstream credentials. + * + * Generated from protobuf field bool disable_upstream_validation = 12 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + protected $disable_upstream_validation = false; protected $remote_source; /** @@ -47,10 +54,16 @@ class RemoteRepositoryConfig extends \Google\Protobuf\Internal\Message * Specific settings for an Apt remote repository. * @type \Google\Cloud\ArtifactRegistry\V1\RemoteRepositoryConfig\YumRepository $yum_repository * Specific settings for a Yum remote repository. + * @type \Google\Cloud\ArtifactRegistry\V1\RemoteRepositoryConfig\CommonRemoteRepository $common_repository + * Common remote repository settings. + * Used as the remote repository upstream URL. * @type string $description * The description of the remote source. * @type \Google\Cloud\ArtifactRegistry\V1\RemoteRepositoryConfig\UpstreamCredentials $upstream_credentials * Optional. The credentials used to access the remote repository. + * @type bool $disable_upstream_validation + * Input only. A create/update remote repo option to avoid making a HEAD/GET + * request to validate a remote repo and any supplied upstream credentials. * } */ public function __construct($data = NULL) { @@ -244,6 +257,39 @@ public function setYumRepository($var) return $this; } + /** + * Common remote repository settings. + * Used as the remote repository upstream URL. + * + * Generated from protobuf field .google.devtools.artifactregistry.v1.RemoteRepositoryConfig.CommonRemoteRepository common_repository = 14; + * @return \Google\Cloud\ArtifactRegistry\V1\RemoteRepositoryConfig\CommonRemoteRepository|null + */ + public function getCommonRepository() + { + return $this->readOneof(14); + } + + public function hasCommonRepository() + { + return $this->hasOneof(14); + } + + /** + * Common remote repository settings. + * Used as the remote repository upstream URL. + * + * Generated from protobuf field .google.devtools.artifactregistry.v1.RemoteRepositoryConfig.CommonRemoteRepository common_repository = 14; + * @param \Google\Cloud\ArtifactRegistry\V1\RemoteRepositoryConfig\CommonRemoteRepository $var + * @return $this + */ + public function setCommonRepository($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ArtifactRegistry\V1\RemoteRepositoryConfig\CommonRemoteRepository::class); + $this->writeOneof(14, $var); + + return $this; + } + /** * The description of the remote source. * @@ -306,6 +352,34 @@ public function setUpstreamCredentials($var) return $this; } + /** + * Input only. A create/update remote repo option to avoid making a HEAD/GET + * request to validate a remote repo and any supplied upstream credentials. + * + * Generated from protobuf field bool disable_upstream_validation = 12 [(.google.api.field_behavior) = INPUT_ONLY]; + * @return bool + */ + public function getDisableUpstreamValidation() + { + return $this->disable_upstream_validation; + } + + /** + * Input only. A create/update remote repo option to avoid making a HEAD/GET + * request to validate a remote repo and any supplied upstream credentials. + * + * Generated from protobuf field bool disable_upstream_validation = 12 [(.google.api.field_behavior) = INPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setDisableUpstreamValidation($var) + { + GPBUtil::checkBool($var); + $this->disable_upstream_validation = $var; + + return $this; + } + /** * @return string */ diff --git a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/AptRepository.php b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/AptRepository.php index 18e276a813fc..751a6b19c24d 100644 --- a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/AptRepository.php +++ b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/AptRepository.php @@ -26,6 +26,8 @@ class AptRepository extends \Google\Protobuf\Internal\Message * @type \Google\Cloud\ArtifactRegistry\V1\RemoteRepositoryConfig\AptRepository\PublicRepository $public_repository * One of the publicly available Apt repositories supported by Artifact * Registry. + * @type \Google\Cloud\ArtifactRegistry\V1\RemoteRepositoryConfig\AptRepository\CustomRepository $custom_repository + * Customer-specified remote repository. * } */ public function __construct($data = NULL) { @@ -66,6 +68,37 @@ public function setPublicRepository($var) return $this; } + /** + * Customer-specified remote repository. + * + * Generated from protobuf field .google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.CustomRepository custom_repository = 3; + * @return \Google\Cloud\ArtifactRegistry\V1\RemoteRepositoryConfig\AptRepository\CustomRepository|null + */ + public function getCustomRepository() + { + return $this->readOneof(3); + } + + public function hasCustomRepository() + { + return $this->hasOneof(3); + } + + /** + * Customer-specified remote repository. + * + * Generated from protobuf field .google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.CustomRepository custom_repository = 3; + * @param \Google\Cloud\ArtifactRegistry\V1\RemoteRepositoryConfig\AptRepository\CustomRepository $var + * @return $this + */ + public function setCustomRepository($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ArtifactRegistry\V1\RemoteRepositoryConfig\AptRepository\CustomRepository::class); + $this->writeOneof(3, $var); + + return $this; + } + /** * @return string */ diff --git a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/AptRepository/CustomRepository.php b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/AptRepository/CustomRepository.php new file mode 100644 index 000000000000..9eda4eafde5b --- /dev/null +++ b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/AptRepository/CustomRepository.php @@ -0,0 +1,72 @@ +google.devtools.artifactregistry.v1.RemoteRepositoryConfig.AptRepository.CustomRepository + */ +class CustomRepository extends \Google\Protobuf\Internal\Message +{ + /** + * An http/https uri reference to the upstream remote repository, for ex: + * "https://my.apt.registry/". + * + * Generated from protobuf field string uri = 1; + */ + protected $uri = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $uri + * An http/https uri reference to the upstream remote repository, for ex: + * "https://my.apt.registry/". + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Devtools\Artifactregistry\V1\Repository::initOnce(); + parent::__construct($data); + } + + /** + * An http/https uri reference to the upstream remote repository, for ex: + * "https://my.apt.registry/". + * + * Generated from protobuf field string uri = 1; + * @return string + */ + public function getUri() + { + return $this->uri; + } + + /** + * An http/https uri reference to the upstream remote repository, for ex: + * "https://my.apt.registry/". + * + * Generated from protobuf field string uri = 1; + * @param string $var + * @return $this + */ + public function setUri($var) + { + GPBUtil::checkString($var, True); + $this->uri = $var; + + return $this; + } + +} + + diff --git a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/AptRepository/PublicRepository/RepositoryBase.php b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/AptRepository/PublicRepository/RepositoryBase.php index 54db0e457c47..f15cd6a96f53 100644 --- a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/AptRepository/PublicRepository/RepositoryBase.php +++ b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/AptRepository/PublicRepository/RepositoryBase.php @@ -31,11 +31,18 @@ class RepositoryBase * Generated from protobuf enum UBUNTU = 2; */ const UBUNTU = 2; + /** + * Archived Debian. + * + * Generated from protobuf enum DEBIAN_SNAPSHOT = 3; + */ + const DEBIAN_SNAPSHOT = 3; private static $valueToName = [ self::REPOSITORY_BASE_UNSPECIFIED => 'REPOSITORY_BASE_UNSPECIFIED', self::DEBIAN => 'DEBIAN', self::UBUNTU => 'UBUNTU', + self::DEBIAN_SNAPSHOT => 'DEBIAN_SNAPSHOT', ]; public static function name($value) diff --git a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/CommonRemoteRepository.php b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/CommonRemoteRepository.php new file mode 100644 index 000000000000..5545f93e6c24 --- /dev/null +++ b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/CommonRemoteRepository.php @@ -0,0 +1,68 @@ +google.devtools.artifactregistry.v1.RemoteRepositoryConfig.CommonRemoteRepository + */ +class CommonRemoteRepository extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A common public repository base for remote repository. + * + * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $uri = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $uri + * Required. A common public repository base for remote repository. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Devtools\Artifactregistry\V1\Repository::initOnce(); + parent::__construct($data); + } + + /** + * Required. A common public repository base for remote repository. + * + * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getUri() + { + return $this->uri; + } + + /** + * Required. A common public repository base for remote repository. + * + * Generated from protobuf field string uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setUri($var) + { + GPBUtil::checkString($var, True); + $this->uri = $var; + + return $this; + } + +} + + diff --git a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/DockerRepository.php b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/DockerRepository.php index 07f77336e9c7..f8f21b6dfa7a 100644 --- a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/DockerRepository.php +++ b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/DockerRepository.php @@ -26,6 +26,8 @@ class DockerRepository extends \Google\Protobuf\Internal\Message * @type int $public_repository * One of the publicly available Docker repositories supported by Artifact * Registry. + * @type \Google\Cloud\ArtifactRegistry\V1\RemoteRepositoryConfig\DockerRepository\CustomRepository $custom_repository + * Customer-specified remote repository. * } */ public function __construct($data = NULL) { @@ -66,6 +68,37 @@ public function setPublicRepository($var) return $this; } + /** + * Customer-specified remote repository. + * + * Generated from protobuf field .google.devtools.artifactregistry.v1.RemoteRepositoryConfig.DockerRepository.CustomRepository custom_repository = 3; + * @return \Google\Cloud\ArtifactRegistry\V1\RemoteRepositoryConfig\DockerRepository\CustomRepository|null + */ + public function getCustomRepository() + { + return $this->readOneof(3); + } + + public function hasCustomRepository() + { + return $this->hasOneof(3); + } + + /** + * Customer-specified remote repository. + * + * Generated from protobuf field .google.devtools.artifactregistry.v1.RemoteRepositoryConfig.DockerRepository.CustomRepository custom_repository = 3; + * @param \Google\Cloud\ArtifactRegistry\V1\RemoteRepositoryConfig\DockerRepository\CustomRepository $var + * @return $this + */ + public function setCustomRepository($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ArtifactRegistry\V1\RemoteRepositoryConfig\DockerRepository\CustomRepository::class); + $this->writeOneof(3, $var); + + return $this; + } + /** * @return string */ diff --git a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/DockerRepository/CustomRepository.php b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/DockerRepository/CustomRepository.php new file mode 100644 index 000000000000..a11bf9886f6c --- /dev/null +++ b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/DockerRepository/CustomRepository.php @@ -0,0 +1,72 @@ +google.devtools.artifactregistry.v1.RemoteRepositoryConfig.DockerRepository.CustomRepository + */ +class CustomRepository extends \Google\Protobuf\Internal\Message +{ + /** + * An http/https uri reference to the custom remote repository, for ex: + * "https://registry-1.docker.io". + * + * Generated from protobuf field string uri = 1; + */ + protected $uri = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $uri + * An http/https uri reference to the custom remote repository, for ex: + * "https://registry-1.docker.io". + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Devtools\Artifactregistry\V1\Repository::initOnce(); + parent::__construct($data); + } + + /** + * An http/https uri reference to the custom remote repository, for ex: + * "https://registry-1.docker.io". + * + * Generated from protobuf field string uri = 1; + * @return string + */ + public function getUri() + { + return $this->uri; + } + + /** + * An http/https uri reference to the custom remote repository, for ex: + * "https://registry-1.docker.io". + * + * Generated from protobuf field string uri = 1; + * @param string $var + * @return $this + */ + public function setUri($var) + { + GPBUtil::checkString($var, True); + $this->uri = $var; + + return $this; + } + +} + + diff --git a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/MavenRepository.php b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/MavenRepository.php index 85653c2ba49d..8559180dc496 100644 --- a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/MavenRepository.php +++ b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/MavenRepository.php @@ -26,6 +26,8 @@ class MavenRepository extends \Google\Protobuf\Internal\Message * @type int $public_repository * One of the publicly available Maven repositories supported by Artifact * Registry. + * @type \Google\Cloud\ArtifactRegistry\V1\RemoteRepositoryConfig\MavenRepository\CustomRepository $custom_repository + * Customer-specified remote repository. * } */ public function __construct($data = NULL) { @@ -66,6 +68,37 @@ public function setPublicRepository($var) return $this; } + /** + * Customer-specified remote repository. + * + * Generated from protobuf field .google.devtools.artifactregistry.v1.RemoteRepositoryConfig.MavenRepository.CustomRepository custom_repository = 3; + * @return \Google\Cloud\ArtifactRegistry\V1\RemoteRepositoryConfig\MavenRepository\CustomRepository|null + */ + public function getCustomRepository() + { + return $this->readOneof(3); + } + + public function hasCustomRepository() + { + return $this->hasOneof(3); + } + + /** + * Customer-specified remote repository. + * + * Generated from protobuf field .google.devtools.artifactregistry.v1.RemoteRepositoryConfig.MavenRepository.CustomRepository custom_repository = 3; + * @param \Google\Cloud\ArtifactRegistry\V1\RemoteRepositoryConfig\MavenRepository\CustomRepository $var + * @return $this + */ + public function setCustomRepository($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ArtifactRegistry\V1\RemoteRepositoryConfig\MavenRepository\CustomRepository::class); + $this->writeOneof(3, $var); + + return $this; + } + /** * @return string */ diff --git a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/MavenRepository/CustomRepository.php b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/MavenRepository/CustomRepository.php new file mode 100644 index 000000000000..15d4e0b015f6 --- /dev/null +++ b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/MavenRepository/CustomRepository.php @@ -0,0 +1,72 @@ +google.devtools.artifactregistry.v1.RemoteRepositoryConfig.MavenRepository.CustomRepository + */ +class CustomRepository extends \Google\Protobuf\Internal\Message +{ + /** + * An http/https uri reference to the upstream remote repository, for ex: + * "https://my.maven.registry/". + * + * Generated from protobuf field string uri = 1; + */ + protected $uri = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $uri + * An http/https uri reference to the upstream remote repository, for ex: + * "https://my.maven.registry/". + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Devtools\Artifactregistry\V1\Repository::initOnce(); + parent::__construct($data); + } + + /** + * An http/https uri reference to the upstream remote repository, for ex: + * "https://my.maven.registry/". + * + * Generated from protobuf field string uri = 1; + * @return string + */ + public function getUri() + { + return $this->uri; + } + + /** + * An http/https uri reference to the upstream remote repository, for ex: + * "https://my.maven.registry/". + * + * Generated from protobuf field string uri = 1; + * @param string $var + * @return $this + */ + public function setUri($var) + { + GPBUtil::checkString($var, True); + $this->uri = $var; + + return $this; + } + +} + + diff --git a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/NpmRepository.php b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/NpmRepository.php index 9dabce6bd8f3..e6a7e0d51970 100644 --- a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/NpmRepository.php +++ b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/NpmRepository.php @@ -26,6 +26,8 @@ class NpmRepository extends \Google\Protobuf\Internal\Message * @type int $public_repository * One of the publicly available Npm repositories supported by Artifact * Registry. + * @type \Google\Cloud\ArtifactRegistry\V1\RemoteRepositoryConfig\NpmRepository\CustomRepository $custom_repository + * Customer-specified remote repository. * } */ public function __construct($data = NULL) { @@ -66,6 +68,37 @@ public function setPublicRepository($var) return $this; } + /** + * Customer-specified remote repository. + * + * Generated from protobuf field .google.devtools.artifactregistry.v1.RemoteRepositoryConfig.NpmRepository.CustomRepository custom_repository = 3; + * @return \Google\Cloud\ArtifactRegistry\V1\RemoteRepositoryConfig\NpmRepository\CustomRepository|null + */ + public function getCustomRepository() + { + return $this->readOneof(3); + } + + public function hasCustomRepository() + { + return $this->hasOneof(3); + } + + /** + * Customer-specified remote repository. + * + * Generated from protobuf field .google.devtools.artifactregistry.v1.RemoteRepositoryConfig.NpmRepository.CustomRepository custom_repository = 3; + * @param \Google\Cloud\ArtifactRegistry\V1\RemoteRepositoryConfig\NpmRepository\CustomRepository $var + * @return $this + */ + public function setCustomRepository($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ArtifactRegistry\V1\RemoteRepositoryConfig\NpmRepository\CustomRepository::class); + $this->writeOneof(3, $var); + + return $this; + } + /** * @return string */ diff --git a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/NpmRepository/CustomRepository.php b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/NpmRepository/CustomRepository.php new file mode 100644 index 000000000000..fdf6c7619632 --- /dev/null +++ b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/NpmRepository/CustomRepository.php @@ -0,0 +1,72 @@ +google.devtools.artifactregistry.v1.RemoteRepositoryConfig.NpmRepository.CustomRepository + */ +class CustomRepository extends \Google\Protobuf\Internal\Message +{ + /** + * An http/https uri reference to the upstream remote repository, for ex: + * "https://my.npm.registry/". + * + * Generated from protobuf field string uri = 1; + */ + protected $uri = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $uri + * An http/https uri reference to the upstream remote repository, for ex: + * "https://my.npm.registry/". + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Devtools\Artifactregistry\V1\Repository::initOnce(); + parent::__construct($data); + } + + /** + * An http/https uri reference to the upstream remote repository, for ex: + * "https://my.npm.registry/". + * + * Generated from protobuf field string uri = 1; + * @return string + */ + public function getUri() + { + return $this->uri; + } + + /** + * An http/https uri reference to the upstream remote repository, for ex: + * "https://my.npm.registry/". + * + * Generated from protobuf field string uri = 1; + * @param string $var + * @return $this + */ + public function setUri($var) + { + GPBUtil::checkString($var, True); + $this->uri = $var; + + return $this; + } + +} + + diff --git a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/PythonRepository.php b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/PythonRepository.php index 8dd53a3ffb4d..4d9ea86e145a 100644 --- a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/PythonRepository.php +++ b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/PythonRepository.php @@ -26,6 +26,8 @@ class PythonRepository extends \Google\Protobuf\Internal\Message * @type int $public_repository * One of the publicly available Python repositories supported by Artifact * Registry. + * @type \Google\Cloud\ArtifactRegistry\V1\RemoteRepositoryConfig\PythonRepository\CustomRepository $custom_repository + * Customer-specified remote repository. * } */ public function __construct($data = NULL) { @@ -66,6 +68,37 @@ public function setPublicRepository($var) return $this; } + /** + * Customer-specified remote repository. + * + * Generated from protobuf field .google.devtools.artifactregistry.v1.RemoteRepositoryConfig.PythonRepository.CustomRepository custom_repository = 3; + * @return \Google\Cloud\ArtifactRegistry\V1\RemoteRepositoryConfig\PythonRepository\CustomRepository|null + */ + public function getCustomRepository() + { + return $this->readOneof(3); + } + + public function hasCustomRepository() + { + return $this->hasOneof(3); + } + + /** + * Customer-specified remote repository. + * + * Generated from protobuf field .google.devtools.artifactregistry.v1.RemoteRepositoryConfig.PythonRepository.CustomRepository custom_repository = 3; + * @param \Google\Cloud\ArtifactRegistry\V1\RemoteRepositoryConfig\PythonRepository\CustomRepository $var + * @return $this + */ + public function setCustomRepository($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ArtifactRegistry\V1\RemoteRepositoryConfig\PythonRepository\CustomRepository::class); + $this->writeOneof(3, $var); + + return $this; + } + /** * @return string */ diff --git a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/PythonRepository/CustomRepository.php b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/PythonRepository/CustomRepository.php new file mode 100644 index 000000000000..63559216f0e9 --- /dev/null +++ b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/PythonRepository/CustomRepository.php @@ -0,0 +1,72 @@ +google.devtools.artifactregistry.v1.RemoteRepositoryConfig.PythonRepository.CustomRepository + */ +class CustomRepository extends \Google\Protobuf\Internal\Message +{ + /** + * An http/https uri reference to the upstream remote repository, for ex: + * "https://my.python.registry/". + * + * Generated from protobuf field string uri = 1; + */ + protected $uri = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $uri + * An http/https uri reference to the upstream remote repository, for ex: + * "https://my.python.registry/". + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Devtools\Artifactregistry\V1\Repository::initOnce(); + parent::__construct($data); + } + + /** + * An http/https uri reference to the upstream remote repository, for ex: + * "https://my.python.registry/". + * + * Generated from protobuf field string uri = 1; + * @return string + */ + public function getUri() + { + return $this->uri; + } + + /** + * An http/https uri reference to the upstream remote repository, for ex: + * "https://my.python.registry/". + * + * Generated from protobuf field string uri = 1; + * @param string $var + * @return $this + */ + public function setUri($var) + { + GPBUtil::checkString($var, True); + $this->uri = $var; + + return $this; + } + +} + + diff --git a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/YumRepository.php b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/YumRepository.php index a9792a1236b4..5e721e529381 100644 --- a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/YumRepository.php +++ b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/YumRepository.php @@ -26,6 +26,8 @@ class YumRepository extends \Google\Protobuf\Internal\Message * @type \Google\Cloud\ArtifactRegistry\V1\RemoteRepositoryConfig\YumRepository\PublicRepository $public_repository * One of the publicly available Yum repositories supported by Artifact * Registry. + * @type \Google\Cloud\ArtifactRegistry\V1\RemoteRepositoryConfig\YumRepository\CustomRepository $custom_repository + * Customer-specified remote repository. * } */ public function __construct($data = NULL) { @@ -66,6 +68,37 @@ public function setPublicRepository($var) return $this; } + /** + * Customer-specified remote repository. + * + * Generated from protobuf field .google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.CustomRepository custom_repository = 3; + * @return \Google\Cloud\ArtifactRegistry\V1\RemoteRepositoryConfig\YumRepository\CustomRepository|null + */ + public function getCustomRepository() + { + return $this->readOneof(3); + } + + public function hasCustomRepository() + { + return $this->hasOneof(3); + } + + /** + * Customer-specified remote repository. + * + * Generated from protobuf field .google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.CustomRepository custom_repository = 3; + * @param \Google\Cloud\ArtifactRegistry\V1\RemoteRepositoryConfig\YumRepository\CustomRepository $var + * @return $this + */ + public function setCustomRepository($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ArtifactRegistry\V1\RemoteRepositoryConfig\YumRepository\CustomRepository::class); + $this->writeOneof(3, $var); + + return $this; + } + /** * @return string */ diff --git a/ArtifactRegistry/src/V1/RemoteRepositoryConfig/YumRepository/CustomRepository.php b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/YumRepository/CustomRepository.php new file mode 100644 index 000000000000..70e161c48890 --- /dev/null +++ b/ArtifactRegistry/src/V1/RemoteRepositoryConfig/YumRepository/CustomRepository.php @@ -0,0 +1,72 @@ +google.devtools.artifactregistry.v1.RemoteRepositoryConfig.YumRepository.CustomRepository + */ +class CustomRepository extends \Google\Protobuf\Internal\Message +{ + /** + * An http/https uri reference to the upstream remote repository, for ex: + * "https://my.yum.registry/". + * + * Generated from protobuf field string uri = 1; + */ + protected $uri = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $uri + * An http/https uri reference to the upstream remote repository, for ex: + * "https://my.yum.registry/". + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Devtools\Artifactregistry\V1\Repository::initOnce(); + parent::__construct($data); + } + + /** + * An http/https uri reference to the upstream remote repository, for ex: + * "https://my.yum.registry/". + * + * Generated from protobuf field string uri = 1; + * @return string + */ + public function getUri() + { + return $this->uri; + } + + /** + * An http/https uri reference to the upstream remote repository, for ex: + * "https://my.yum.registry/". + * + * Generated from protobuf field string uri = 1; + * @param string $var + * @return $this + */ + public function setUri($var) + { + GPBUtil::checkString($var, True); + $this->uri = $var; + + return $this; + } + +} + + diff --git a/ArtifactRegistry/src/V1/Repository.php b/ArtifactRegistry/src/V1/Repository.php index b162598ad0f5..89434412b4ea 100644 --- a/ArtifactRegistry/src/V1/Repository.php +++ b/ArtifactRegistry/src/V1/Repository.php @@ -17,7 +17,8 @@ class Repository extends \Google\Protobuf\Internal\Message { /** * The name of the repository, for example: - * `projects/p1/locations/us-central1/repositories/repo1`. + * `projects/p1/locations/us-central1/repositories/repo1`. For each location + * in a project, repository names must be unique. * * Generated from protobuf field string name = 1; */ @@ -101,6 +102,26 @@ class Repository extends \Google\Protobuf\Internal\Message * Generated from protobuf field bool cleanup_policy_dry_run = 18 [(.google.api.field_behavior) = OPTIONAL]; */ protected $cleanup_policy_dry_run = false; + /** + * Optional. Config and state for vulnerability scanning of resources within + * this Repository. + * + * Generated from protobuf field .google.devtools.artifactregistry.v1.Repository.VulnerabilityScanningConfig vulnerability_scanning_config = 19 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $vulnerability_scanning_config = null; + /** + * Optional. If this is true, an unspecified repo type will be treated as + * error rather than defaulting to standard. + * + * Generated from protobuf field bool disallow_unspecified_mode = 21 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $disallow_unspecified_mode = false; + /** + * Output only. If set, the repository satisfies physical zone isolation. + * + * Generated from protobuf field bool satisfies_pzi = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $satisfies_pzi = false; protected $format_config; protected $mode_config; @@ -122,7 +143,8 @@ class Repository extends \Google\Protobuf\Internal\Message * Configuration specific for a Remote Repository. * @type string $name * The name of the repository, for example: - * `projects/p1/locations/us-central1/repositories/repo1`. + * `projects/p1/locations/us-central1/repositories/repo1`. For each location + * in a project, repository names must be unique. * @type int $format * Optional. The format of packages that are stored in the repository. * @type string $description @@ -158,6 +180,14 @@ class Repository extends \Google\Protobuf\Internal\Message * @type bool $cleanup_policy_dry_run * Optional. If true, the cleanup pipeline is prevented from deleting versions * in this repository. + * @type \Google\Cloud\ArtifactRegistry\V1\Repository\VulnerabilityScanningConfig $vulnerability_scanning_config + * Optional. Config and state for vulnerability scanning of resources within + * this Repository. + * @type bool $disallow_unspecified_mode + * Optional. If this is true, an unspecified repo type will be treated as + * error rather than defaulting to standard. + * @type bool $satisfies_pzi + * Output only. If set, the repository satisfies physical zone isolation. * } */ public function __construct($data = NULL) { @@ -295,7 +325,8 @@ public function setRemoteRepositoryConfig($var) /** * The name of the repository, for example: - * `projects/p1/locations/us-central1/repositories/repo1`. + * `projects/p1/locations/us-central1/repositories/repo1`. For each location + * in a project, repository names must be unique. * * Generated from protobuf field string name = 1; * @return string @@ -307,7 +338,8 @@ public function getName() /** * The name of the repository, for example: - * `projects/p1/locations/us-central1/repositories/repo1`. + * `projects/p1/locations/us-central1/repositories/repo1`. For each location + * in a project, repository names must be unique. * * Generated from protobuf field string name = 1; * @param string $var @@ -653,6 +685,98 @@ public function setCleanupPolicyDryRun($var) return $this; } + /** + * Optional. Config and state for vulnerability scanning of resources within + * this Repository. + * + * Generated from protobuf field .google.devtools.artifactregistry.v1.Repository.VulnerabilityScanningConfig vulnerability_scanning_config = 19 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\ArtifactRegistry\V1\Repository\VulnerabilityScanningConfig|null + */ + public function getVulnerabilityScanningConfig() + { + return $this->vulnerability_scanning_config; + } + + public function hasVulnerabilityScanningConfig() + { + return isset($this->vulnerability_scanning_config); + } + + public function clearVulnerabilityScanningConfig() + { + unset($this->vulnerability_scanning_config); + } + + /** + * Optional. Config and state for vulnerability scanning of resources within + * this Repository. + * + * Generated from protobuf field .google.devtools.artifactregistry.v1.Repository.VulnerabilityScanningConfig vulnerability_scanning_config = 19 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\ArtifactRegistry\V1\Repository\VulnerabilityScanningConfig $var + * @return $this + */ + public function setVulnerabilityScanningConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ArtifactRegistry\V1\Repository\VulnerabilityScanningConfig::class); + $this->vulnerability_scanning_config = $var; + + return $this; + } + + /** + * Optional. If this is true, an unspecified repo type will be treated as + * error rather than defaulting to standard. + * + * Generated from protobuf field bool disallow_unspecified_mode = 21 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getDisallowUnspecifiedMode() + { + return $this->disallow_unspecified_mode; + } + + /** + * Optional. If this is true, an unspecified repo type will be treated as + * error rather than defaulting to standard. + * + * Generated from protobuf field bool disallow_unspecified_mode = 21 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setDisallowUnspecifiedMode($var) + { + GPBUtil::checkBool($var); + $this->disallow_unspecified_mode = $var; + + return $this; + } + + /** + * Output only. If set, the repository satisfies physical zone isolation. + * + * Generated from protobuf field bool satisfies_pzi = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getSatisfiesPzi() + { + return $this->satisfies_pzi; + } + + /** + * Output only. If set, the repository satisfies physical zone isolation. + * + * Generated from protobuf field bool satisfies_pzi = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setSatisfiesPzi($var) + { + GPBUtil::checkBool($var); + $this->satisfies_pzi = $var; + + return $this; + } + /** * @return string */ diff --git a/ArtifactRegistry/src/V1/Repository/Format.php b/ArtifactRegistry/src/V1/Repository/Format.php index 6fc8c1369014..ec1cbc331259 100644 --- a/ArtifactRegistry/src/V1/Repository/Format.php +++ b/ArtifactRegistry/src/V1/Repository/Format.php @@ -67,6 +67,12 @@ class Format * Generated from protobuf enum GO = 10; */ const GO = 10; + /** + * Generic package format. + * + * Generated from protobuf enum GENERIC = 11; + */ + const GENERIC = 11; private static $valueToName = [ self::FORMAT_UNSPECIFIED => 'FORMAT_UNSPECIFIED', @@ -78,6 +84,7 @@ class Format self::PYTHON => 'PYTHON', self::KFP => 'KFP', self::GO => 'GO', + self::GENERIC => 'GENERIC', ]; public static function name($value) diff --git a/ArtifactRegistry/src/V1/Repository/VulnerabilityScanningConfig.php b/ArtifactRegistry/src/V1/Repository/VulnerabilityScanningConfig.php new file mode 100644 index 000000000000..1b53439ccf85 --- /dev/null +++ b/ArtifactRegistry/src/V1/Repository/VulnerabilityScanningConfig.php @@ -0,0 +1,189 @@ +google.devtools.artifactregistry.v1.Repository.VulnerabilityScanningConfig + */ +class VulnerabilityScanningConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Config for whether this repository has vulnerability scanning + * disabled. + * + * Generated from protobuf field .google.devtools.artifactregistry.v1.Repository.VulnerabilityScanningConfig.EnablementConfig enablement_config = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $enablement_config = 0; + /** + * Output only. The last time this repository config was enabled. + * + * Generated from protobuf field .google.protobuf.Timestamp last_enable_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $last_enable_time = null; + /** + * Output only. State of feature enablement, combining repository enablement + * config and API enablement state. + * + * Generated from protobuf field .google.devtools.artifactregistry.v1.Repository.VulnerabilityScanningConfig.EnablementState enablement_state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $enablement_state = 0; + /** + * Output only. Reason for the repository state. + * + * Generated from protobuf field string enablement_state_reason = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $enablement_state_reason = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $enablement_config + * Optional. Config for whether this repository has vulnerability scanning + * disabled. + * @type \Google\Protobuf\Timestamp $last_enable_time + * Output only. The last time this repository config was enabled. + * @type int $enablement_state + * Output only. State of feature enablement, combining repository enablement + * config and API enablement state. + * @type string $enablement_state_reason + * Output only. Reason for the repository state. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Devtools\Artifactregistry\V1\Repository::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Config for whether this repository has vulnerability scanning + * disabled. + * + * Generated from protobuf field .google.devtools.artifactregistry.v1.Repository.VulnerabilityScanningConfig.EnablementConfig enablement_config = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getEnablementConfig() + { + return $this->enablement_config; + } + + /** + * Optional. Config for whether this repository has vulnerability scanning + * disabled. + * + * Generated from protobuf field .google.devtools.artifactregistry.v1.Repository.VulnerabilityScanningConfig.EnablementConfig enablement_config = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setEnablementConfig($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\ArtifactRegistry\V1\Repository\VulnerabilityScanningConfig\EnablementConfig::class); + $this->enablement_config = $var; + + return $this; + } + + /** + * Output only. The last time this repository config was enabled. + * + * Generated from protobuf field .google.protobuf.Timestamp last_enable_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getLastEnableTime() + { + return $this->last_enable_time; + } + + public function hasLastEnableTime() + { + return isset($this->last_enable_time); + } + + public function clearLastEnableTime() + { + unset($this->last_enable_time); + } + + /** + * Output only. The last time this repository config was enabled. + * + * Generated from protobuf field .google.protobuf.Timestamp last_enable_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setLastEnableTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->last_enable_time = $var; + + return $this; + } + + /** + * Output only. State of feature enablement, combining repository enablement + * config and API enablement state. + * + * Generated from protobuf field .google.devtools.artifactregistry.v1.Repository.VulnerabilityScanningConfig.EnablementState enablement_state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getEnablementState() + { + return $this->enablement_state; + } + + /** + * Output only. State of feature enablement, combining repository enablement + * config and API enablement state. + * + * Generated from protobuf field .google.devtools.artifactregistry.v1.Repository.VulnerabilityScanningConfig.EnablementState enablement_state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setEnablementState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\ArtifactRegistry\V1\Repository\VulnerabilityScanningConfig\EnablementState::class); + $this->enablement_state = $var; + + return $this; + } + + /** + * Output only. Reason for the repository state. + * + * Generated from protobuf field string enablement_state_reason = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getEnablementStateReason() + { + return $this->enablement_state_reason; + } + + /** + * Output only. Reason for the repository state. + * + * Generated from protobuf field string enablement_state_reason = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setEnablementStateReason($var) + { + GPBUtil::checkString($var, True); + $this->enablement_state_reason = $var; + + return $this; + } + +} + + diff --git a/ArtifactRegistry/src/V1/Repository/VulnerabilityScanningConfig/EnablementConfig.php b/ArtifactRegistry/src/V1/Repository/VulnerabilityScanningConfig/EnablementConfig.php new file mode 100644 index 000000000000..c46312733816 --- /dev/null +++ b/ArtifactRegistry/src/V1/Repository/VulnerabilityScanningConfig/EnablementConfig.php @@ -0,0 +1,63 @@ +google.devtools.artifactregistry.v1.Repository.VulnerabilityScanningConfig.EnablementConfig + */ +class EnablementConfig +{ + /** + * Not set. This will be treated as INHERITED. + * + * Generated from protobuf enum ENABLEMENT_CONFIG_UNSPECIFIED = 0; + */ + const ENABLEMENT_CONFIG_UNSPECIFIED = 0; + /** + * Scanning is Enabled, but dependent on API enablement. + * + * Generated from protobuf enum INHERITED = 1; + */ + const INHERITED = 1; + /** + * No automatic vulnerability scanning will be performed for this + * repository. + * + * Generated from protobuf enum DISABLED = 2; + */ + const DISABLED = 2; + + private static $valueToName = [ + self::ENABLEMENT_CONFIG_UNSPECIFIED => 'ENABLEMENT_CONFIG_UNSPECIFIED', + self::INHERITED => 'INHERITED', + self::DISABLED => 'DISABLED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/ArtifactRegistry/src/V1/Repository/VulnerabilityScanningConfig/EnablementState.php b/ArtifactRegistry/src/V1/Repository/VulnerabilityScanningConfig/EnablementState.php new file mode 100644 index 000000000000..4418c2f815d1 --- /dev/null +++ b/ArtifactRegistry/src/V1/Repository/VulnerabilityScanningConfig/EnablementState.php @@ -0,0 +1,70 @@ +google.devtools.artifactregistry.v1.Repository.VulnerabilityScanningConfig.EnablementState + */ +class EnablementState +{ + /** + * Enablement state is unclear. + * + * Generated from protobuf enum ENABLEMENT_STATE_UNSPECIFIED = 0; + */ + const ENABLEMENT_STATE_UNSPECIFIED = 0; + /** + * Repository does not support vulnerability scanning. + * + * Generated from protobuf enum SCANNING_UNSUPPORTED = 1; + */ + const SCANNING_UNSUPPORTED = 1; + /** + * Vulnerability scanning is disabled for this repository. + * + * Generated from protobuf enum SCANNING_DISABLED = 2; + */ + const SCANNING_DISABLED = 2; + /** + * Vulnerability scanning is active for this repository. + * + * Generated from protobuf enum SCANNING_ACTIVE = 3; + */ + const SCANNING_ACTIVE = 3; + + private static $valueToName = [ + self::ENABLEMENT_STATE_UNSPECIFIED => 'ENABLEMENT_STATE_UNSPECIFIED', + self::SCANNING_UNSUPPORTED => 'SCANNING_UNSUPPORTED', + self::SCANNING_DISABLED => 'SCANNING_DISABLED', + self::SCANNING_ACTIVE => 'SCANNING_ACTIVE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/ArtifactRegistry/src/V1/Rule.php b/ArtifactRegistry/src/V1/Rule.php new file mode 100644 index 000000000000..6268ad14e9a5 --- /dev/null +++ b/ArtifactRegistry/src/V1/Rule.php @@ -0,0 +1,220 @@ +google.devtools.artifactregistry.v1.Rule + */ +class Rule extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the rule, for example: + * `projects/p1/locations/us-central1/repositories/repo1/rules/rule1`. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * The action this rule takes. + * + * Generated from protobuf field .google.devtools.artifactregistry.v1.Rule.Action action = 2; + */ + protected $action = 0; + /** + * Generated from protobuf field .google.devtools.artifactregistry.v1.Rule.Operation operation = 3; + */ + protected $operation = 0; + /** + * Optional. A CEL expression for conditions that must be met in order for the + * rule to apply. If not provided, the rule matches all objects. + * + * Generated from protobuf field .google.type.Expr condition = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $condition = null; + /** + * The package ID the rule applies to. + * If empty, this rule applies to all packages inside the repository. + * + * Generated from protobuf field string package_id = 5; + */ + protected $package_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The name of the rule, for example: + * `projects/p1/locations/us-central1/repositories/repo1/rules/rule1`. + * @type int $action + * The action this rule takes. + * @type int $operation + * @type \Google\Type\Expr $condition + * Optional. A CEL expression for conditions that must be met in order for the + * rule to apply. If not provided, the rule matches all objects. + * @type string $package_id + * The package ID the rule applies to. + * If empty, this rule applies to all packages inside the repository. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Devtools\Artifactregistry\V1\Rule::initOnce(); + parent::__construct($data); + } + + /** + * The name of the rule, for example: + * `projects/p1/locations/us-central1/repositories/repo1/rules/rule1`. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The name of the rule, for example: + * `projects/p1/locations/us-central1/repositories/repo1/rules/rule1`. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The action this rule takes. + * + * Generated from protobuf field .google.devtools.artifactregistry.v1.Rule.Action action = 2; + * @return int + */ + public function getAction() + { + return $this->action; + } + + /** + * The action this rule takes. + * + * Generated from protobuf field .google.devtools.artifactregistry.v1.Rule.Action action = 2; + * @param int $var + * @return $this + */ + public function setAction($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\ArtifactRegistry\V1\Rule\Action::class); + $this->action = $var; + + return $this; + } + + /** + * Generated from protobuf field .google.devtools.artifactregistry.v1.Rule.Operation operation = 3; + * @return int + */ + public function getOperation() + { + return $this->operation; + } + + /** + * Generated from protobuf field .google.devtools.artifactregistry.v1.Rule.Operation operation = 3; + * @param int $var + * @return $this + */ + public function setOperation($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\ArtifactRegistry\V1\Rule\Operation::class); + $this->operation = $var; + + return $this; + } + + /** + * Optional. A CEL expression for conditions that must be met in order for the + * rule to apply. If not provided, the rule matches all objects. + * + * Generated from protobuf field .google.type.Expr condition = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Type\Expr|null + */ + public function getCondition() + { + return $this->condition; + } + + public function hasCondition() + { + return isset($this->condition); + } + + public function clearCondition() + { + unset($this->condition); + } + + /** + * Optional. A CEL expression for conditions that must be met in order for the + * rule to apply. If not provided, the rule matches all objects. + * + * Generated from protobuf field .google.type.Expr condition = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Type\Expr $var + * @return $this + */ + public function setCondition($var) + { + GPBUtil::checkMessage($var, \Google\Type\Expr::class); + $this->condition = $var; + + return $this; + } + + /** + * The package ID the rule applies to. + * If empty, this rule applies to all packages inside the repository. + * + * Generated from protobuf field string package_id = 5; + * @return string + */ + public function getPackageId() + { + return $this->package_id; + } + + /** + * The package ID the rule applies to. + * If empty, this rule applies to all packages inside the repository. + * + * Generated from protobuf field string package_id = 5; + * @param string $var + * @return $this + */ + public function setPackageId($var) + { + GPBUtil::checkString($var, True); + $this->package_id = $var; + + return $this; + } + +} + diff --git a/ArtifactRegistry/src/V1/Rule/Action.php b/ArtifactRegistry/src/V1/Rule/Action.php new file mode 100644 index 000000000000..f9e6589f25c5 --- /dev/null +++ b/ArtifactRegistry/src/V1/Rule/Action.php @@ -0,0 +1,62 @@ +google.devtools.artifactregistry.v1.Rule.Action + */ +class Action +{ + /** + * Action not specified. + * + * Generated from protobuf enum ACTION_UNSPECIFIED = 0; + */ + const ACTION_UNSPECIFIED = 0; + /** + * Allow the operation. + * + * Generated from protobuf enum ALLOW = 1; + */ + const ALLOW = 1; + /** + * Deny the operation. + * + * Generated from protobuf enum DENY = 2; + */ + const DENY = 2; + + private static $valueToName = [ + self::ACTION_UNSPECIFIED => 'ACTION_UNSPECIFIED', + self::ALLOW => 'ALLOW', + self::DENY => 'DENY', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/ArtifactRegistry/src/V1/Rule/Operation.php b/ArtifactRegistry/src/V1/Rule/Operation.php new file mode 100644 index 000000000000..11f4b57d58ce --- /dev/null +++ b/ArtifactRegistry/src/V1/Rule/Operation.php @@ -0,0 +1,55 @@ +google.devtools.artifactregistry.v1.Rule.Operation + */ +class Operation +{ + /** + * Operation not specified. + * + * Generated from protobuf enum OPERATION_UNSPECIFIED = 0; + */ + const OPERATION_UNSPECIFIED = 0; + /** + * Download operation. + * + * Generated from protobuf enum DOWNLOAD = 1; + */ + const DOWNLOAD = 1; + + private static $valueToName = [ + self::OPERATION_UNSPECIFIED => 'OPERATION_UNSPECIFIED', + self::DOWNLOAD => 'DOWNLOAD', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/ArtifactRegistry/src/V1/Tag.php b/ArtifactRegistry/src/V1/Tag.php index 01d7525b1fee..88d671f343ff 100644 --- a/ArtifactRegistry/src/V1/Tag.php +++ b/ArtifactRegistry/src/V1/Tag.php @@ -28,7 +28,7 @@ class Tag extends \Google\Protobuf\Internal\Message protected $name = ''; /** * The name of the version the tag refers to, for example: - * "projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/sha256:5243811" + * `projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/sha256:5243811` * If the package or version ID parts contain slashes, the slashes are * escaped. * @@ -50,7 +50,7 @@ class Tag extends \Google\Protobuf\Internal\Message * must be URL encoded. * @type string $version * The name of the version the tag refers to, for example: - * "projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/sha256:5243811" + * `projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/sha256:5243811` * If the package or version ID parts contain slashes, the slashes are * escaped. * } @@ -96,7 +96,7 @@ public function setName($var) /** * The name of the version the tag refers to, for example: - * "projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/sha256:5243811" + * `projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/sha256:5243811` * If the package or version ID parts contain slashes, the slashes are * escaped. * @@ -110,7 +110,7 @@ public function getVersion() /** * The name of the version the tag refers to, for example: - * "projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/sha256:5243811" + * `projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/sha256:5243811` * If the package or version ID parts contain slashes, the slashes are * escaped. * diff --git a/ArtifactRegistry/src/V1/UpdateFileRequest.php b/ArtifactRegistry/src/V1/UpdateFileRequest.php new file mode 100644 index 000000000000..8158ac1dd758 --- /dev/null +++ b/ArtifactRegistry/src/V1/UpdateFileRequest.php @@ -0,0 +1,146 @@ +google.devtools.artifactregistry.v1.UpdateFileRequest + */ +class UpdateFileRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The File that replaces the resource on the server. + * + * Generated from protobuf field .google.devtools.artifactregistry.v1.File file = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $file = null; + /** + * Required. The update mask applies to the resource. For the `FieldMask` + * definition, see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\ArtifactRegistry\V1\File $file Required. The File that replaces the resource on the server. + * @param \Google\Protobuf\FieldMask $updateMask Required. The update mask applies to the resource. For the `FieldMask` + * definition, see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + * + * @return \Google\Cloud\ArtifactRegistry\V1\UpdateFileRequest + * + * @experimental + */ + public static function build(\Google\Cloud\ArtifactRegistry\V1\File $file, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setFile($file) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\ArtifactRegistry\V1\File $file + * Required. The File that replaces the resource on the server. + * @type \Google\Protobuf\FieldMask $update_mask + * Required. The update mask applies to the resource. For the `FieldMask` + * definition, see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Devtools\Artifactregistry\V1\File::initOnce(); + parent::__construct($data); + } + + /** + * Required. The File that replaces the resource on the server. + * + * Generated from protobuf field .google.devtools.artifactregistry.v1.File file = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\ArtifactRegistry\V1\File|null + */ + public function getFile() + { + return $this->file; + } + + public function hasFile() + { + return isset($this->file); + } + + public function clearFile() + { + unset($this->file); + } + + /** + * Required. The File that replaces the resource on the server. + * + * Generated from protobuf field .google.devtools.artifactregistry.v1.File file = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\ArtifactRegistry\V1\File $var + * @return $this + */ + public function setFile($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ArtifactRegistry\V1\File::class); + $this->file = $var; + + return $this; + } + + /** + * Required. The update mask applies to the resource. For the `FieldMask` + * definition, see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + * + * 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 update mask applies to the resource. For the `FieldMask` + * definition, see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + * + * 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/ArtifactRegistry/src/V1/UpdatePackageRequest.php b/ArtifactRegistry/src/V1/UpdatePackageRequest.php new file mode 100644 index 000000000000..253ac00c595b --- /dev/null +++ b/ArtifactRegistry/src/V1/UpdatePackageRequest.php @@ -0,0 +1,146 @@ +google.devtools.artifactregistry.v1.UpdatePackageRequest + */ +class UpdatePackageRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The package that replaces the resource on the server. + * + * Generated from protobuf field .google.devtools.artifactregistry.v1.Package package = 1; + */ + protected $package = null; + /** + * The update mask applies to the resource. For the `FieldMask` definition, + * see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\ArtifactRegistry\V1\Package $package The package that replaces the resource on the server. + * @param \Google\Protobuf\FieldMask $updateMask The update mask applies to the resource. For the `FieldMask` definition, + * see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + * + * @return \Google\Cloud\ArtifactRegistry\V1\UpdatePackageRequest + * + * @experimental + */ + public static function build(\Google\Cloud\ArtifactRegistry\V1\Package $package, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setPackage($package) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\ArtifactRegistry\V1\Package $package + * The package that replaces the resource on the server. + * @type \Google\Protobuf\FieldMask $update_mask + * The update mask applies to the resource. For the `FieldMask` definition, + * see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Devtools\Artifactregistry\V1\Package::initOnce(); + parent::__construct($data); + } + + /** + * The package that replaces the resource on the server. + * + * Generated from protobuf field .google.devtools.artifactregistry.v1.Package package = 1; + * @return \Google\Cloud\ArtifactRegistry\V1\Package|null + */ + public function getPackage() + { + return $this->package; + } + + public function hasPackage() + { + return isset($this->package); + } + + public function clearPackage() + { + unset($this->package); + } + + /** + * The package that replaces the resource on the server. + * + * Generated from protobuf field .google.devtools.artifactregistry.v1.Package package = 1; + * @param \Google\Cloud\ArtifactRegistry\V1\Package $var + * @return $this + */ + public function setPackage($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ArtifactRegistry\V1\Package::class); + $this->package = $var; + + return $this; + } + + /** + * The update mask applies to the resource. For the `FieldMask` definition, + * see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @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); + } + + /** + * The update mask applies to the resource. For the `FieldMask` definition, + * see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @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/ArtifactRegistry/src/V1/UpdateRuleRequest.php b/ArtifactRegistry/src/V1/UpdateRuleRequest.php new file mode 100644 index 000000000000..52743d36ad42 --- /dev/null +++ b/ArtifactRegistry/src/V1/UpdateRuleRequest.php @@ -0,0 +1,146 @@ +google.devtools.artifactregistry.v1.UpdateRuleRequest + */ +class UpdateRuleRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The rule that replaces the resource on the server. + * + * Generated from protobuf field .google.devtools.artifactregistry.v1.Rule rule = 1; + */ + protected $rule = null; + /** + * The update mask applies to the resource. For the `FieldMask` definition, + * see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\ArtifactRegistry\V1\Rule $rule The rule that replaces the resource on the server. + * @param \Google\Protobuf\FieldMask $updateMask The update mask applies to the resource. For the `FieldMask` definition, + * see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + * + * @return \Google\Cloud\ArtifactRegistry\V1\UpdateRuleRequest + * + * @experimental + */ + public static function build(\Google\Cloud\ArtifactRegistry\V1\Rule $rule, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setRule($rule) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\ArtifactRegistry\V1\Rule $rule + * The rule that replaces the resource on the server. + * @type \Google\Protobuf\FieldMask $update_mask + * The update mask applies to the resource. For the `FieldMask` definition, + * see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Devtools\Artifactregistry\V1\Rule::initOnce(); + parent::__construct($data); + } + + /** + * The rule that replaces the resource on the server. + * + * Generated from protobuf field .google.devtools.artifactregistry.v1.Rule rule = 1; + * @return \Google\Cloud\ArtifactRegistry\V1\Rule|null + */ + public function getRule() + { + return $this->rule; + } + + public function hasRule() + { + return isset($this->rule); + } + + public function clearRule() + { + unset($this->rule); + } + + /** + * The rule that replaces the resource on the server. + * + * Generated from protobuf field .google.devtools.artifactregistry.v1.Rule rule = 1; + * @param \Google\Cloud\ArtifactRegistry\V1\Rule $var + * @return $this + */ + public function setRule($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ArtifactRegistry\V1\Rule::class); + $this->rule = $var; + + return $this; + } + + /** + * The update mask applies to the resource. For the `FieldMask` definition, + * see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @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); + } + + /** + * The update mask applies to the resource. For the `FieldMask` definition, + * see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @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/ArtifactRegistry/src/V1/UpdateVersionRequest.php b/ArtifactRegistry/src/V1/UpdateVersionRequest.php new file mode 100644 index 000000000000..dc65a3000f55 --- /dev/null +++ b/ArtifactRegistry/src/V1/UpdateVersionRequest.php @@ -0,0 +1,146 @@ +google.devtools.artifactregistry.v1.UpdateVersionRequest + */ +class UpdateVersionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The Version that replaces the resource on the server. + * + * Generated from protobuf field .google.devtools.artifactregistry.v1.Version version = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $version = null; + /** + * The update mask applies to the resource. For the `FieldMask` definition, + * see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\ArtifactRegistry\V1\Version $version Required. The Version that replaces the resource on the server. + * @param \Google\Protobuf\FieldMask $updateMask The update mask applies to the resource. For the `FieldMask` definition, + * see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + * + * @return \Google\Cloud\ArtifactRegistry\V1\UpdateVersionRequest + * + * @experimental + */ + public static function build(\Google\Cloud\ArtifactRegistry\V1\Version $version, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setVersion($version) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\ArtifactRegistry\V1\Version $version + * Required. The Version that replaces the resource on the server. + * @type \Google\Protobuf\FieldMask $update_mask + * The update mask applies to the resource. For the `FieldMask` definition, + * see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Devtools\Artifactregistry\V1\Version::initOnce(); + parent::__construct($data); + } + + /** + * Required. The Version that replaces the resource on the server. + * + * Generated from protobuf field .google.devtools.artifactregistry.v1.Version version = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\ArtifactRegistry\V1\Version|null + */ + public function getVersion() + { + return $this->version; + } + + public function hasVersion() + { + return isset($this->version); + } + + public function clearVersion() + { + unset($this->version); + } + + /** + * Required. The Version that replaces the resource on the server. + * + * Generated from protobuf field .google.devtools.artifactregistry.v1.Version version = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\ArtifactRegistry\V1\Version $var + * @return $this + */ + public function setVersion($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\ArtifactRegistry\V1\Version::class); + $this->version = $var; + + return $this; + } + + /** + * The update mask applies to the resource. For the `FieldMask` definition, + * see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @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); + } + + /** + * The update mask applies to the resource. For the `FieldMask` definition, + * see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @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/ArtifactRegistry/src/V1/Version.php b/ArtifactRegistry/src/V1/Version.php index d0e6b33aa05a..c085f4368d36 100644 --- a/ArtifactRegistry/src/V1/Version.php +++ b/ArtifactRegistry/src/V1/Version.php @@ -19,7 +19,7 @@ class Version extends \Google\Protobuf\Internal\Message { /** * The name of the version, for example: - * "projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/art1". + * `projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/art1`. * If the package or version ID parts contain slashes, the slashes are * escaped. * @@ -61,6 +61,12 @@ class Version extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.protobuf.Struct metadata = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ protected $metadata = null; + /** + * Optional. Client specified annotations. + * + * Generated from protobuf field map annotations = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $annotations; /** * Constructor. @@ -70,7 +76,7 @@ class Version extends \Google\Protobuf\Internal\Message * * @type string $name * The name of the version, for example: - * "projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/art1". + * `projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/art1`. * If the package or version ID parts contain slashes, the slashes are * escaped. * @type string $description @@ -88,6 +94,8 @@ class Version extends \Google\Protobuf\Internal\Message * resource. Currently, the resources could be: * [DockerImage][google.devtools.artifactregistry.v1.DockerImage] * [MavenArtifact][google.devtools.artifactregistry.v1.MavenArtifact] + * @type array|\Google\Protobuf\Internal\MapField $annotations + * Optional. Client specified annotations. * } */ public function __construct($data = NULL) { @@ -97,7 +105,7 @@ public function __construct($data = NULL) { /** * The name of the version, for example: - * "projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/art1". + * `projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/art1`. * If the package or version ID parts contain slashes, the slashes are * escaped. * @@ -111,7 +119,7 @@ public function getName() /** * The name of the version, for example: - * "projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/art1". + * `projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/art1`. * If the package or version ID parts contain slashes, the slashes are * escaped. * @@ -297,5 +305,31 @@ public function setMetadata($var) return $this; } + /** + * Optional. Client specified annotations. + * + * Generated from protobuf field map annotations = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getAnnotations() + { + return $this->annotations; + } + + /** + * Optional. Client specified annotations. + * + * Generated from protobuf field map annotations = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setAnnotations($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->annotations = $arr; + + return $this; + } + } diff --git a/ArtifactRegistry/src/V1/gapic_metadata.json b/ArtifactRegistry/src/V1/gapic_metadata.json index e39fa3da4120..304e0a5ee2f2 100644 --- a/ArtifactRegistry/src/V1/gapic_metadata.json +++ b/ArtifactRegistry/src/V1/gapic_metadata.json @@ -15,16 +15,36 @@ "batchDeleteVersions" ] }, + "CreateAttachment": { + "methods": [ + "createAttachment" + ] + }, "CreateRepository": { "methods": [ "createRepository" ] }, + "CreateRule": { + "methods": [ + "createRule" + ] + }, "CreateTag": { "methods": [ "createTag" ] }, + "DeleteAttachment": { + "methods": [ + "deleteAttachment" + ] + }, + "DeleteFile": { + "methods": [ + "deleteFile" + ] + }, "DeletePackage": { "methods": [ "deletePackage" @@ -35,6 +55,11 @@ "deleteRepository" ] }, + "DeleteRule": { + "methods": [ + "deleteRule" + ] + }, "DeleteTag": { "methods": [ "deleteTag" @@ -45,6 +70,11 @@ "deleteVersion" ] }, + "GetAttachment": { + "methods": [ + "getAttachment" + ] + }, "GetDockerImage": { "methods": [ "getDockerImage" @@ -90,6 +120,11 @@ "getRepository" ] }, + "GetRule": { + "methods": [ + "getRule" + ] + }, "GetTag": { "methods": [ "getTag" @@ -115,6 +150,11 @@ "importYumArtifacts" ] }, + "ListAttachments": { + "methods": [ + "listAttachments" + ] + }, "ListDockerImages": { "methods": [ "listDockerImages" @@ -150,6 +190,11 @@ "listRepositories" ] }, + "ListRules": { + "methods": [ + "listRules" + ] + }, "ListTags": { "methods": [ "listTags" @@ -170,6 +215,16 @@ "testIamPermissions" ] }, + "UpdateFile": { + "methods": [ + "updateFile" + ] + }, + "UpdatePackage": { + "methods": [ + "updatePackage" + ] + }, "UpdateProjectSettings": { "methods": [ "updateProjectSettings" @@ -180,6 +235,11 @@ "updateRepository" ] }, + "UpdateRule": { + "methods": [ + "updateRule" + ] + }, "UpdateTag": { "methods": [ "updateTag" @@ -190,6 +250,11 @@ "updateVPCSCConfig" ] }, + "UpdateVersion": { + "methods": [ + "updateVersion" + ] + }, "GetLocation": { "methods": [ "getLocation" diff --git a/ArtifactRegistry/src/V1/resources/artifact_registry_client_config.json b/ArtifactRegistry/src/V1/resources/artifact_registry_client_config.json index 8ef829a0812e..665bff1a7b12 100644 --- a/ArtifactRegistry/src/V1/resources/artifact_registry_client_config.json +++ b/ArtifactRegistry/src/V1/resources/artifact_registry_client_config.json @@ -31,16 +31,36 @@ "retry_codes_name": "no_retry_1_codes", "retry_params_name": "no_retry_1_params" }, + "CreateAttachment": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, "CreateRepository": { "timeout_millis": 60000, "retry_codes_name": "no_retry_1_codes", "retry_params_name": "no_retry_1_params" }, + "CreateRule": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, "CreateTag": { "timeout_millis": 60000, "retry_codes_name": "no_retry_1_codes", "retry_params_name": "no_retry_1_params" }, + "DeleteAttachment": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DeleteFile": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, "DeletePackage": { "timeout_millis": 60000, "retry_codes_name": "no_retry_1_codes", @@ -51,6 +71,11 @@ "retry_codes_name": "no_retry_1_codes", "retry_params_name": "no_retry_1_params" }, + "DeleteRule": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, "DeleteTag": { "timeout_millis": 60000, "retry_codes_name": "no_retry_1_codes", @@ -61,6 +86,11 @@ "retry_codes_name": "no_retry_1_codes", "retry_params_name": "no_retry_1_params" }, + "GetAttachment": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, "GetDockerImage": { "timeout_millis": 60000, "retry_codes_name": "no_retry_1_codes", @@ -106,6 +136,11 @@ "retry_codes_name": "no_retry_1_codes", "retry_params_name": "no_retry_1_params" }, + "GetRule": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, "GetTag": { "timeout_millis": 60000, "retry_codes_name": "no_retry_1_codes", @@ -131,6 +166,11 @@ "retry_codes_name": "no_retry_1_codes", "retry_params_name": "no_retry_1_params" }, + "ListAttachments": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, "ListDockerImages": { "timeout_millis": 60000, "retry_codes_name": "no_retry_1_codes", @@ -166,6 +206,11 @@ "retry_codes_name": "no_retry_1_codes", "retry_params_name": "no_retry_1_params" }, + "ListRules": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, "ListTags": { "timeout_millis": 60000, "retry_codes_name": "no_retry_1_codes", @@ -186,6 +231,16 @@ "retry_codes_name": "no_retry_1_codes", "retry_params_name": "no_retry_1_params" }, + "UpdateFile": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "UpdatePackage": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, "UpdateProjectSettings": { "timeout_millis": 60000, "retry_codes_name": "no_retry_1_codes", @@ -196,6 +251,11 @@ "retry_codes_name": "no_retry_1_codes", "retry_params_name": "no_retry_1_params" }, + "UpdateRule": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, "UpdateTag": { "timeout_millis": 60000, "retry_codes_name": "no_retry_1_codes", @@ -206,6 +266,11 @@ "retry_codes_name": "no_retry_1_codes", "retry_params_name": "no_retry_1_params" }, + "UpdateVersion": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, "GetLocation": { "timeout_millis": 60000, "retry_codes_name": "no_retry_1_codes", diff --git a/ArtifactRegistry/src/V1/resources/artifact_registry_descriptor_config.php b/ArtifactRegistry/src/V1/resources/artifact_registry_descriptor_config.php index 277b58a2606b..326ffcd9825b 100644 --- a/ArtifactRegistry/src/V1/resources/artifact_registry_descriptor_config.php +++ b/ArtifactRegistry/src/V1/resources/artifact_registry_descriptor_config.php @@ -42,6 +42,25 @@ ], ], ], + 'CreateAttachment' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\ArtifactRegistry\V1\Attachment', + 'metadataReturnType' => '\Google\Cloud\ArtifactRegistry\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], 'CreateRepository' => [ 'longRunning' => [ 'operationReturnType' => '\Google\Cloud\ArtifactRegistry\V1\Repository', @@ -61,6 +80,44 @@ ], ], ], + 'DeleteAttachment' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\ArtifactRegistry\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DeleteFile' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\ArtifactRegistry\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], 'DeletePackage' => [ 'longRunning' => [ 'operationReturnType' => '\Google\Protobuf\GPBEmpty', @@ -156,6 +213,18 @@ ], ], ], + 'CreateRule' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\ArtifactRegistry\V1\Rule', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], 'CreateTag' => [ 'callType' => \Google\ApiCore\Call::UNARY_CALL, 'responseType' => 'Google\Cloud\ArtifactRegistry\V1\Tag', @@ -168,6 +237,18 @@ ], ], ], + 'DeleteRule' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], 'DeleteTag' => [ 'callType' => \Google\ApiCore\Call::UNARY_CALL, 'responseType' => 'Google\Protobuf\GPBEmpty', @@ -180,6 +261,18 @@ ], ], ], + 'GetAttachment' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\ArtifactRegistry\V1\Attachment', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], 'GetDockerImage' => [ 'callType' => \Google\ApiCore\Call::UNARY_CALL, 'responseType' => 'Google\Cloud\ArtifactRegistry\V1\DockerImage', @@ -288,6 +381,18 @@ ], ], ], + 'GetRule' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\ArtifactRegistry\V1\Rule', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], 'GetTag' => [ 'callType' => \Google\ApiCore\Call::UNARY_CALL, 'responseType' => 'Google\Cloud\ArtifactRegistry\V1\Tag', @@ -324,6 +429,26 @@ ], ], ], + 'ListAttachments' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getAttachments', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\ArtifactRegistry\V1\ListAttachmentsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], 'ListDockerImages' => [ 'pageStreaming' => [ 'requestPageTokenGetMethod' => 'getPageToken', @@ -464,6 +589,26 @@ ], ], ], + 'ListRules' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getRules', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\ArtifactRegistry\V1\ListRulesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], 'ListTags' => [ 'pageStreaming' => [ 'requestPageTokenGetMethod' => 'getPageToken', @@ -528,6 +673,32 @@ ], ], ], + 'UpdateFile' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\ArtifactRegistry\V1\File', + 'headerParams' => [ + [ + 'keyName' => 'file.name', + 'fieldAccessors' => [ + 'getFile', + 'getName', + ], + ], + ], + ], + 'UpdatePackage' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\ArtifactRegistry\V1\Package', + 'headerParams' => [ + [ + 'keyName' => 'package.name', + 'fieldAccessors' => [ + 'getPackage', + 'getName', + ], + ], + ], + ], 'UpdateProjectSettings' => [ 'callType' => \Google\ApiCore\Call::UNARY_CALL, 'responseType' => 'Google\Cloud\ArtifactRegistry\V1\ProjectSettings', @@ -554,6 +725,19 @@ ], ], ], + 'UpdateRule' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\ArtifactRegistry\V1\Rule', + 'headerParams' => [ + [ + 'keyName' => 'rule.name', + 'fieldAccessors' => [ + 'getRule', + 'getName', + ], + ], + ], + ], 'UpdateTag' => [ 'callType' => \Google\ApiCore\Call::UNARY_CALL, 'responseType' => 'Google\Cloud\ArtifactRegistry\V1\Tag', @@ -580,6 +764,19 @@ ], ], ], + 'UpdateVersion' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\ArtifactRegistry\V1\Version', + 'headerParams' => [ + [ + 'keyName' => 'version.name', + 'fieldAccessors' => [ + 'getVersion', + 'getName', + ], + ], + ], + ], 'GetLocation' => [ 'callType' => \Google\ApiCore\Call::UNARY_CALL, 'responseType' => 'Google\Cloud\Location\Location', @@ -615,6 +812,7 @@ 'interfaceOverride' => 'google.cloud.location.Locations', ], 'templateMap' => [ + 'attachment' => 'projects/{project}/locations/{location}/repositories/{repository}/attachments/{attachment}', 'dockerImage' => 'projects/{project}/locations/{location}/repositories/{repository}/dockerImages/{docker_image}', 'file' => 'projects/{project}/locations/{location}/repositories/{repository}/files/{file}', 'location' => 'projects/{project}/locations/{location}', @@ -624,6 +822,7 @@ 'projectSettings' => 'projects/{project}/projectSettings', 'pythonPackage' => 'projects/{project}/locations/{location}/repositories/{repository}/pythonPackages/{python_package}', 'repository' => 'projects/{project}/locations/{location}/repositories/{repository}', + 'rule' => 'projects/{project}/locations/{location}/repositories/{repository}/rules/{rule}', 'secretVersion' => 'projects/{project}/secrets/{secret}/versions/{secret_version}', 'tag' => 'projects/{project}/locations/{location}/repositories/{repository}/packages/{package}/tags/{tag}', 'version' => 'projects/{project}/locations/{location}/repositories/{repository}/packages/{package}/versions/{version}', diff --git a/ArtifactRegistry/src/V1/resources/artifact_registry_rest_client_config.php b/ArtifactRegistry/src/V1/resources/artifact_registry_rest_client_config.php index bc592c9417dc..29ec04db60ad 100644 --- a/ArtifactRegistry/src/V1/resources/artifact_registry_rest_client_config.php +++ b/ArtifactRegistry/src/V1/resources/artifact_registry_rest_client_config.php @@ -59,6 +59,21 @@ ], ], ], + 'CreateAttachment' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/repositories/*}/attachments', + 'body' => 'attachment', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'attachment_id', + ], + ], 'CreateRepository' => [ 'method' => 'post', 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/repositories', @@ -71,6 +86,18 @@ ], ], ], + 'CreateRule' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/repositories/*}/rules', + 'body' => 'rule', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], 'CreateTag' => [ 'method' => 'post', 'uriTemplate' => '/v1/{parent=projects/*/locations/*/repositories/*/packages/*}/tags', @@ -83,6 +110,28 @@ ], ], ], + 'DeleteAttachment' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/repositories/*/attachments/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteFile' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/repositories/*/files/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'DeletePackage' => [ 'method' => 'delete', 'uriTemplate' => '/v1/{name=projects/*/locations/*/repositories/*/packages/*}', @@ -105,6 +154,17 @@ ], ], ], + 'DeleteRule' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/repositories/*/rules/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'DeleteTag' => [ 'method' => 'delete', 'uriTemplate' => '/v1/{name=projects/*/locations/*/repositories/*/packages/*/tags/*}', @@ -127,6 +187,17 @@ ], ], ], + 'GetAttachment' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/repositories/*/attachments/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'GetDockerImage' => [ 'method' => 'get', 'uriTemplate' => '/v1/{name=projects/*/locations/*/repositories/*/dockerImages/*}', @@ -226,6 +297,17 @@ ], ], ], + 'GetRule' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/repositories/*/rules/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'GetTag' => [ 'method' => 'get', 'uriTemplate' => '/v1/{name=projects/*/locations/*/repositories/*/packages/*/tags/*}', @@ -283,6 +365,17 @@ ], ], ], + 'ListAttachments' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/repositories/*}/attachments', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], 'ListDockerImages' => [ 'method' => 'get', 'uriTemplate' => '/v1/{parent=projects/*/locations/*/repositories/*}/dockerImages', @@ -360,6 +453,17 @@ ], ], ], + 'ListRules' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/repositories/*}/rules', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], 'ListTags' => [ 'method' => 'get', 'uriTemplate' => '/v1/{parent=projects/*/locations/*/repositories/*/packages/*}/tags', @@ -406,6 +510,35 @@ ], ], ], + 'UpdateFile' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{file.name=projects/*/locations/*/repositories/*/files/*}', + 'body' => 'file', + 'placeholders' => [ + 'file.name' => [ + 'getters' => [ + 'getFile', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + 'UpdatePackage' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{package.name=projects/*/locations/*/repositories/*/packages/*}', + 'body' => 'package', + 'placeholders' => [ + 'package.name' => [ + 'getters' => [ + 'getPackage', + 'getName', + ], + ], + ], + ], 'UpdateProjectSettings' => [ 'method' => 'patch', 'uriTemplate' => '/v1/{project_settings.name=projects/*/projectSettings}', @@ -432,6 +565,19 @@ ], ], ], + 'UpdateRule' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{rule.name=projects/*/locations/*/repositories/*/rules/*}', + 'body' => 'rule', + 'placeholders' => [ + 'rule.name' => [ + 'getters' => [ + 'getRule', + 'getName', + ], + ], + ], + ], 'UpdateTag' => [ 'method' => 'patch', 'uriTemplate' => '/v1/{tag.name=projects/*/locations/*/repositories/*/packages/*/tags/*}', @@ -458,6 +604,19 @@ ], ], ], + 'UpdateVersion' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{version.name=projects/*/locations/*/repositories/*/packages/*/versions/*}', + 'body' => 'version', + 'placeholders' => [ + 'version.name' => [ + 'getters' => [ + 'getVersion', + 'getName', + ], + ], + ], + ], ], 'google.longrunning.Operations' => [ 'GetOperation' => [ diff --git a/ArtifactRegistry/tests/Unit/V1/Client/ArtifactRegistryClientTest.php b/ArtifactRegistry/tests/Unit/V1/Client/ArtifactRegistryClientTest.php index f718ccb27026..03113c0557e7 100644 --- a/ArtifactRegistry/tests/Unit/V1/Client/ArtifactRegistryClientTest.php +++ b/ArtifactRegistry/tests/Unit/V1/Client/ArtifactRegistryClientTest.php @@ -26,16 +26,23 @@ use Google\ApiCore\CredentialsWrapper; use Google\ApiCore\Testing\GeneratedTest; use Google\ApiCore\Testing\MockTransport; +use Google\Cloud\ArtifactRegistry\V1\Attachment; use Google\Cloud\ArtifactRegistry\V1\BatchDeleteVersionsRequest; use Google\Cloud\ArtifactRegistry\V1\Client\ArtifactRegistryClient; +use Google\Cloud\ArtifactRegistry\V1\CreateAttachmentRequest; use Google\Cloud\ArtifactRegistry\V1\CreateRepositoryRequest; +use Google\Cloud\ArtifactRegistry\V1\CreateRuleRequest; use Google\Cloud\ArtifactRegistry\V1\CreateTagRequest; +use Google\Cloud\ArtifactRegistry\V1\DeleteAttachmentRequest; +use Google\Cloud\ArtifactRegistry\V1\DeleteFileRequest; use Google\Cloud\ArtifactRegistry\V1\DeletePackageRequest; use Google\Cloud\ArtifactRegistry\V1\DeleteRepositoryRequest; +use Google\Cloud\ArtifactRegistry\V1\DeleteRuleRequest; use Google\Cloud\ArtifactRegistry\V1\DeleteTagRequest; use Google\Cloud\ArtifactRegistry\V1\DeleteVersionRequest; use Google\Cloud\ArtifactRegistry\V1\DockerImage; use Google\Cloud\ArtifactRegistry\V1\File; +use Google\Cloud\ArtifactRegistry\V1\GetAttachmentRequest; use Google\Cloud\ArtifactRegistry\V1\GetDockerImageRequest; use Google\Cloud\ArtifactRegistry\V1\GetFileRequest; use Google\Cloud\ArtifactRegistry\V1\GetMavenArtifactRequest; @@ -44,6 +51,7 @@ use Google\Cloud\ArtifactRegistry\V1\GetProjectSettingsRequest; use Google\Cloud\ArtifactRegistry\V1\GetPythonPackageRequest; use Google\Cloud\ArtifactRegistry\V1\GetRepositoryRequest; +use Google\Cloud\ArtifactRegistry\V1\GetRuleRequest; use Google\Cloud\ArtifactRegistry\V1\GetTagRequest; use Google\Cloud\ArtifactRegistry\V1\GetVPCSCConfigRequest; use Google\Cloud\ArtifactRegistry\V1\GetVersionRequest; @@ -51,6 +59,8 @@ use Google\Cloud\ArtifactRegistry\V1\ImportAptArtifactsResponse; use Google\Cloud\ArtifactRegistry\V1\ImportYumArtifactsRequest; use Google\Cloud\ArtifactRegistry\V1\ImportYumArtifactsResponse; +use Google\Cloud\ArtifactRegistry\V1\ListAttachmentsRequest; +use Google\Cloud\ArtifactRegistry\V1\ListAttachmentsResponse; use Google\Cloud\ArtifactRegistry\V1\ListDockerImagesRequest; use Google\Cloud\ArtifactRegistry\V1\ListDockerImagesResponse; use Google\Cloud\ArtifactRegistry\V1\ListFilesRequest; @@ -65,6 +75,8 @@ use Google\Cloud\ArtifactRegistry\V1\ListPythonPackagesResponse; use Google\Cloud\ArtifactRegistry\V1\ListRepositoriesRequest; use Google\Cloud\ArtifactRegistry\V1\ListRepositoriesResponse; +use Google\Cloud\ArtifactRegistry\V1\ListRulesRequest; +use Google\Cloud\ArtifactRegistry\V1\ListRulesResponse; use Google\Cloud\ArtifactRegistry\V1\ListTagsRequest; use Google\Cloud\ArtifactRegistry\V1\ListTagsResponse; use Google\Cloud\ArtifactRegistry\V1\ListVersionsRequest; @@ -75,11 +87,16 @@ use Google\Cloud\ArtifactRegistry\V1\ProjectSettings; use Google\Cloud\ArtifactRegistry\V1\PythonPackage; use Google\Cloud\ArtifactRegistry\V1\Repository; +use Google\Cloud\ArtifactRegistry\V1\Rule; use Google\Cloud\ArtifactRegistry\V1\Tag; +use Google\Cloud\ArtifactRegistry\V1\UpdateFileRequest; +use Google\Cloud\ArtifactRegistry\V1\UpdatePackageRequest; use Google\Cloud\ArtifactRegistry\V1\UpdateProjectSettingsRequest; use Google\Cloud\ArtifactRegistry\V1\UpdateRepositoryRequest; +use Google\Cloud\ArtifactRegistry\V1\UpdateRuleRequest; use Google\Cloud\ArtifactRegistry\V1\UpdateTagRequest; use Google\Cloud\ArtifactRegistry\V1\UpdateVPCSCConfigRequest; +use Google\Cloud\ArtifactRegistry\V1\UpdateVersionRequest; use Google\Cloud\ArtifactRegistry\V1\VPCSCConfig; use Google\Cloud\ArtifactRegistry\V1\Version; use Google\Cloud\Iam\V1\GetIamPolicyRequest; @@ -95,6 +112,7 @@ use Google\LongRunning\GetOperationRequest; use Google\LongRunning\Operation; use Google\Protobuf\Any; +use Google\Protobuf\FieldMask; use Google\Protobuf\GPBEmpty; use Google\Rpc\Code; use stdClass; @@ -258,6 +276,160 @@ public function batchDeleteVersionsExceptionTest() $this->assertTrue($operationsTransport->isExhausted()); } + /** @test */ + public function createAttachmentTest() + { + $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/createAttachmentTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $target = 'target-880905839'; + $type = 'type3575610'; + $attachmentNamespace = 'attachmentNamespace1367660863'; + $ociVersionName = 'ociVersionName-1366178692'; + $expectedResponse = new Attachment(); + $expectedResponse->setName($name); + $expectedResponse->setTarget($target); + $expectedResponse->setType($type); + $expectedResponse->setAttachmentNamespace($attachmentNamespace); + $expectedResponse->setOciVersionName($ociVersionName); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createAttachmentTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); + $attachmentId = 'attachmentId-1506844233'; + $attachment = new Attachment(); + $attachmentTarget = 'attachmentTarget279842964'; + $attachment->setTarget($attachmentTarget); + $attachmentFiles = [$gapicClient->fileName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[FILE]')]; + $attachment->setFiles($attachmentFiles); + $request = (new CreateAttachmentRequest()) + ->setParent($formattedParent) + ->setAttachmentId($attachmentId) + ->setAttachment($attachment); + $response = $gapicClient->createAttachment($request); + $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.devtools.artifactregistry.v1.ArtifactRegistry/CreateAttachment', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getAttachmentId(); + $this->assertProtobufEquals($attachmentId, $actualValue); + $actualValue = $actualApiRequestObject->getAttachment(); + $this->assertProtobufEquals($attachment, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createAttachmentTest'); + $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 createAttachmentExceptionTest() + { + $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/createAttachmentTest'); + $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->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); + $attachmentId = 'attachmentId-1506844233'; + $attachment = new Attachment(); + $attachmentTarget = 'attachmentTarget279842964'; + $attachment->setTarget($attachmentTarget); + $attachmentFiles = [$gapicClient->fileName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[FILE]')]; + $attachment->setFiles($attachmentFiles); + $request = (new CreateAttachmentRequest()) + ->setParent($formattedParent) + ->setAttachmentId($attachmentId) + ->setAttachment($attachment); + $response = $gapicClient->createAttachment($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createAttachmentTest'); + 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 createRepositoryTest() { @@ -285,6 +457,8 @@ public function createRepositoryTest() $sizeBytes = 1796325715; $satisfiesPzs = false; $cleanupPolicyDryRun = false; + $disallowUnspecifiedMode = false; + $satisfiesPzi = false; $expectedResponse = new Repository(); $expectedResponse->setName($name); $expectedResponse->setDescription($description); @@ -292,6 +466,8 @@ public function createRepositoryTest() $expectedResponse->setSizeBytes($sizeBytes); $expectedResponse->setSatisfiesPzs($satisfiesPzs); $expectedResponse->setCleanupPolicyDryRun($cleanupPolicyDryRun); + $expectedResponse->setDisallowUnspecifiedMode($disallowUnspecifiedMode); + $expectedResponse->setSatisfiesPzi($satisfiesPzi); $anyResponse = new Any(); $anyResponse->setValue($expectedResponse->serializeToString()); $completeOperation = new Operation(); @@ -392,6 +568,73 @@ public function createRepositoryExceptionTest() $this->assertTrue($operationsTransport->isExhausted()); } + /** @test */ + public function createRuleTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $packageId = 'packageId29331380'; + $expectedResponse = new Rule(); + $expectedResponse->setName($name); + $expectedResponse->setPackageId($packageId); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); + $request = (new CreateRuleRequest())->setParent($formattedParent); + $response = $gapicClient->createRule($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.devtools.artifactregistry.v1.ArtifactRegistry/CreateRule', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createRuleExceptionTest() + { + $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->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); + $request = (new CreateRuleRequest())->setParent($formattedParent); + try { + $gapicClient->createRule($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + /** @test */ public function createTagTest() { @@ -453,6 +696,250 @@ public function createTagExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** @test */ + public function deleteAttachmentTest() + { + $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/deleteAttachmentTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteAttachmentTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->attachmentName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[ATTACHMENT]'); + $request = (new DeleteAttachmentRequest())->setName($formattedName); + $response = $gapicClient->deleteAttachment($request); + $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.devtools.artifactregistry.v1.ArtifactRegistry/DeleteAttachment', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteAttachmentTest'); + $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 deleteAttachmentExceptionTest() + { + $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/deleteAttachmentTest'); + $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 + $formattedName = $gapicClient->attachmentName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[ATTACHMENT]'); + $request = (new DeleteAttachmentRequest())->setName($formattedName); + $response = $gapicClient->deleteAttachment($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteAttachmentTest'); + 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 deleteFileTest() + { + $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/deleteFileTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteFileTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->fileName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[FILE]'); + $request = (new DeleteFileRequest())->setName($formattedName); + $response = $gapicClient->deleteFile($request); + $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.devtools.artifactregistry.v1.ArtifactRegistry/DeleteFile', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteFileTest'); + $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 deleteFileExceptionTest() + { + $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/deleteFileTest'); + $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 + $formattedName = $gapicClient->fileName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[FILE]'); + $request = (new DeleteFileRequest())->setName($formattedName); + $response = $gapicClient->deleteFile($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteFileTest'); + 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 deletePackageTest() { @@ -673,28 +1160,90 @@ public function deleteRepositoryExceptionTest() ); $operationsTransport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $request = (new DeleteRepositoryRequest())->setName($formattedName); - $response = $gapicClient->deleteRepository($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteRepositoryTest'); + $formattedName = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); + $request = (new DeleteRepositoryRequest())->setName($formattedName); + $response = $gapicClient->deleteRepository($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteRepositoryTest'); + 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 deleteRuleTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->ruleName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[RULE]'); + $request = (new DeleteRuleRequest())->setName($formattedName); + $gapicClient->deleteRule($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.devtools.artifactregistry.v1.ArtifactRegistry/DeleteRule', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteRuleExceptionTest() + { + $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->ruleName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[RULE]'); + $request = (new DeleteRuleRequest())->setName($formattedName); try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test + $gapicClient->deleteRule($request); + // If the $gapicClient method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { $this->assertEquals($status->code, $ex->getCode()); $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); } - // Call popReceivedCalls to ensure the stubs are exhausted + // Call popReceivedCalls to ensure the stub is exhausted $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); } /** @test */ @@ -869,6 +1418,79 @@ public function deleteVersionExceptionTest() $this->assertTrue($operationsTransport->isExhausted()); } + /** @test */ + public function getAttachmentTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $target = 'target-880905839'; + $type = 'type3575610'; + $attachmentNamespace = 'attachmentNamespace1367660863'; + $ociVersionName = 'ociVersionName-1366178692'; + $expectedResponse = new Attachment(); + $expectedResponse->setName($name2); + $expectedResponse->setTarget($target); + $expectedResponse->setType($type); + $expectedResponse->setAttachmentNamespace($attachmentNamespace); + $expectedResponse->setOciVersionName($ociVersionName); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->attachmentName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[ATTACHMENT]'); + $request = (new GetAttachmentRequest())->setName($formattedName); + $response = $gapicClient->getAttachment($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.devtools.artifactregistry.v1.ArtifactRegistry/GetAttachment', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getAttachmentExceptionTest() + { + $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->attachmentName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[ATTACHMENT]'); + $request = (new GetAttachmentRequest())->setName($formattedName); + try { + $gapicClient->getAttachment($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + /** @test */ public function getDockerImageTest() { @@ -1295,8 +1917,10 @@ public function getProjectSettingsTest() $this->assertTrue($transport->isExhausted()); // Mock response $name2 = 'name2-1052831874'; + $pullPercent = 1781572683; $expectedResponse = new ProjectSettings(); $expectedResponse->setName($name2); + $expectedResponse->setPullPercent($pullPercent); $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->projectSettingsName('[PROJECT]'); @@ -1436,6 +2060,8 @@ public function getRepositoryTest() $sizeBytes = 1796325715; $satisfiesPzs = false; $cleanupPolicyDryRun = false; + $disallowUnspecifiedMode = false; + $satisfiesPzi = false; $expectedResponse = new Repository(); $expectedResponse->setName($name2); $expectedResponse->setDescription($description); @@ -1443,6 +2069,8 @@ public function getRepositoryTest() $expectedResponse->setSizeBytes($sizeBytes); $expectedResponse->setSatisfiesPzs($satisfiesPzs); $expectedResponse->setCleanupPolicyDryRun($cleanupPolicyDryRun); + $expectedResponse->setDisallowUnspecifiedMode($disallowUnspecifiedMode); + $expectedResponse->setSatisfiesPzi($satisfiesPzi); $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); @@ -1496,6 +2124,73 @@ public function getRepositoryExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** @test */ + public function getRuleTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $packageId = 'packageId29331380'; + $expectedResponse = new Rule(); + $expectedResponse->setName($name2); + $expectedResponse->setPackageId($packageId); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->ruleName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[RULE]'); + $request = (new GetRuleRequest())->setName($formattedName); + $response = $gapicClient->getRule($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.devtools.artifactregistry.v1.ArtifactRegistry/GetRule', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getRuleExceptionTest() + { + $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->ruleName('[PROJECT]', '[LOCATION]', '[REPOSITORY]', '[RULE]'); + $request = (new GetRuleRequest())->setName($formattedName); + try { + $gapicClient->getRule($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + /** @test */ public function getTagTest() { @@ -1921,6 +2616,77 @@ public function importYumArtifactsExceptionTest() $this->assertTrue($operationsTransport->isExhausted()); } + /** @test */ + public function listAttachmentsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $attachmentsElement = new Attachment(); + $attachments = [$attachmentsElement]; + $expectedResponse = new ListAttachmentsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setAttachments($attachments); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); + $request = (new ListAttachmentsRequest())->setParent($formattedParent); + $response = $gapicClient->listAttachments($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getAttachments()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.devtools.artifactregistry.v1.ArtifactRegistry/ListAttachments', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listAttachmentsExceptionTest() + { + $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->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); + $request = (new ListAttachmentsRequest())->setParent($formattedParent); + try { + $gapicClient->listAttachments($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + /** @test */ public function listDockerImagesTest() { @@ -2290,28 +3056,99 @@ public function listPythonPackagesTest() $pythonPackages = [$pythonPackagesElement]; $expectedResponse = new ListPythonPackagesResponse(); $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setPythonPackages($pythonPackages); + $expectedResponse->setPythonPackages($pythonPackages); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); + $request = (new ListPythonPackagesRequest())->setParent($formattedParent); + $response = $gapicClient->listPythonPackages($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getPythonPackages()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.devtools.artifactregistry.v1.ArtifactRegistry/ListPythonPackages', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listPythonPackagesExceptionTest() + { + $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->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); + $request = (new ListPythonPackagesRequest())->setParent($formattedParent); + try { + $gapicClient->listPythonPackages($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listRepositoriesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $repositoriesElement = new Repository(); + $repositories = [$repositoriesElement]; + $expectedResponse = new ListRepositoriesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setRepositories($repositories); $transport->addResponse($expectedResponse); // Mock request - $formattedParent = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $request = (new ListPythonPackagesRequest())->setParent($formattedParent); - $response = $gapicClient->listPythonPackages($request); + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListRepositoriesRequest())->setParent($formattedParent); + $response = $gapicClient->listRepositories($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getPythonPackages()[0], $resources[0]); + $this->assertEquals($expectedResponse->getRepositories()[0], $resources[0]); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.artifactregistry.v1.ArtifactRegistry/ListPythonPackages', $actualFuncCall); + $this->assertSame('/google.devtools.artifactregistry.v1.ArtifactRegistry/ListRepositories', $actualFuncCall); $actualValue = $actualRequestObject->getParent(); $this->assertProtobufEquals($formattedParent, $actualValue); $this->assertTrue($transport->isExhausted()); } /** @test */ - public function listPythonPackagesExceptionTest() + public function listRepositoriesExceptionTest() { $transport = $this->createTransport(); $gapicClient = $this->createClient([ @@ -2332,10 +3169,10 @@ public function listPythonPackagesExceptionTest() ); $transport->addResponse(null, $status); // Mock request - $formattedParent = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); - $request = (new ListPythonPackagesRequest())->setParent($formattedParent); + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListRepositoriesRequest())->setParent($formattedParent); try { - $gapicClient->listPythonPackages($request); + $gapicClient->listRepositories($request); // If the $gapicClient method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { @@ -2348,7 +3185,7 @@ public function listPythonPackagesExceptionTest() } /** @test */ - public function listRepositoriesTest() + public function listRulesTest() { $transport = $this->createTransport(); $gapicClient = $this->createClient([ @@ -2357,32 +3194,32 @@ public function listRepositoriesTest() $this->assertTrue($transport->isExhausted()); // Mock response $nextPageToken = ''; - $repositoriesElement = new Repository(); - $repositories = [$repositoriesElement]; - $expectedResponse = new ListRepositoriesResponse(); + $rulesElement = new Rule(); + $rules = [$rulesElement]; + $expectedResponse = new ListRulesResponse(); $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setRepositories($repositories); + $expectedResponse->setRules($rules); $transport->addResponse($expectedResponse); // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListRepositoriesRequest())->setParent($formattedParent); - $response = $gapicClient->listRepositories($request); + $formattedParent = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); + $request = (new ListRulesRequest())->setParent($formattedParent); + $response = $gapicClient->listRules($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getRepositories()[0], $resources[0]); + $this->assertEquals($expectedResponse->getRules()[0], $resources[0]); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.artifactregistry.v1.ArtifactRegistry/ListRepositories', $actualFuncCall); + $this->assertSame('/google.devtools.artifactregistry.v1.ArtifactRegistry/ListRules', $actualFuncCall); $actualValue = $actualRequestObject->getParent(); $this->assertProtobufEquals($formattedParent, $actualValue); $this->assertTrue($transport->isExhausted()); } /** @test */ - public function listRepositoriesExceptionTest() + public function listRulesExceptionTest() { $transport = $this->createTransport(); $gapicClient = $this->createClient([ @@ -2403,10 +3240,10 @@ public function listRepositoriesExceptionTest() ); $transport->addResponse(null, $status); // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListRepositoriesRequest())->setParent($formattedParent); + $formattedParent = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]'); + $request = (new ListRulesRequest())->setParent($formattedParent); try { - $gapicClient->listRepositories($request); + $gapicClient->listRules($request); // If the $gapicClient method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { @@ -2686,6 +3523,140 @@ public function testIamPermissionsExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** @test */ + public function updateFileTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $sizeBytes = 1796325715; + $owner = 'owner106164915'; + $expectedResponse = new File(); + $expectedResponse->setName($name); + $expectedResponse->setSizeBytes($sizeBytes); + $expectedResponse->setOwner($owner); + $transport->addResponse($expectedResponse); + // Mock request + $file = new File(); + $updateMask = new FieldMask(); + $request = (new UpdateFileRequest())->setFile($file)->setUpdateMask($updateMask); + $response = $gapicClient->updateFile($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.devtools.artifactregistry.v1.ArtifactRegistry/UpdateFile', $actualFuncCall); + $actualValue = $actualRequestObject->getFile(); + $this->assertProtobufEquals($file, $actualValue); + $actualValue = $actualRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateFileExceptionTest() + { + $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 + $file = new File(); + $updateMask = new FieldMask(); + $request = (new UpdateFileRequest())->setFile($file)->setUpdateMask($updateMask); + try { + $gapicClient->updateFile($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updatePackageTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Package(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $request = new UpdatePackageRequest(); + $response = $gapicClient->updatePackage($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.devtools.artifactregistry.v1.ArtifactRegistry/UpdatePackage', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updatePackageExceptionTest() + { + $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); + $request = new UpdatePackageRequest(); + try { + $gapicClient->updatePackage($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + /** @test */ public function updateProjectSettingsTest() { @@ -2696,8 +3667,10 @@ public function updateProjectSettingsTest() $this->assertTrue($transport->isExhausted()); // Mock response $name = 'name3373707'; + $pullPercent = 1781572683; $expectedResponse = new ProjectSettings(); $expectedResponse->setName($name); + $expectedResponse->setPullPercent($pullPercent); $transport->addResponse($expectedResponse); $request = new UpdateProjectSettingsRequest(); $response = $gapicClient->updateProjectSettings($request); @@ -2763,6 +3736,8 @@ public function updateRepositoryTest() $sizeBytes = 1796325715; $satisfiesPzs = false; $cleanupPolicyDryRun = false; + $disallowUnspecifiedMode = false; + $satisfiesPzi = false; $expectedResponse = new Repository(); $expectedResponse->setName($name); $expectedResponse->setDescription($description); @@ -2770,6 +3745,8 @@ public function updateRepositoryTest() $expectedResponse->setSizeBytes($sizeBytes); $expectedResponse->setSatisfiesPzs($satisfiesPzs); $expectedResponse->setCleanupPolicyDryRun($cleanupPolicyDryRun); + $expectedResponse->setDisallowUnspecifiedMode($disallowUnspecifiedMode); + $expectedResponse->setSatisfiesPzi($satisfiesPzi); $transport->addResponse($expectedResponse); $request = new UpdateRepositoryRequest(); $response = $gapicClient->updateRepository($request); @@ -2817,6 +3794,67 @@ public function updateRepositoryExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** @test */ + public function updateRuleTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $packageId = 'packageId29331380'; + $expectedResponse = new Rule(); + $expectedResponse->setName($name); + $expectedResponse->setPackageId($packageId); + $transport->addResponse($expectedResponse); + $request = new UpdateRuleRequest(); + $response = $gapicClient->updateRule($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.devtools.artifactregistry.v1.ArtifactRegistry/UpdateRule', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateRuleExceptionTest() + { + $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); + $request = new UpdateRuleRequest(); + try { + $gapicClient->updateRule($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + /** @test */ public function updateTagTest() { @@ -2937,6 +3975,73 @@ public function updateVPCSCConfigExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** @test */ + public function updateVersionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $description = 'description-1724546052'; + $expectedResponse = new Version(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $transport->addResponse($expectedResponse); + // Mock request + $version = new Version(); + $request = (new UpdateVersionRequest())->setVersion($version); + $response = $gapicClient->updateVersion($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.devtools.artifactregistry.v1.ArtifactRegistry/UpdateVersion', $actualFuncCall); + $actualValue = $actualRequestObject->getVersion(); + $this->assertProtobufEquals($version, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateVersionExceptionTest() + { + $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 + $version = new Version(); + $request = (new UpdateVersionRequest())->setVersion($version); + try { + $gapicClient->updateVersion($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + /** @test */ public function getLocationTest() {