diff --git a/NetworkSecurity/metadata/V1/AuthzPolicy.php b/NetworkSecurity/metadata/V1/AuthzPolicy.php index 5f7e3c669be9..0609f4e47a9f 100644 --- a/NetworkSecurity/metadata/V1/AuthzPolicy.php +++ b/NetworkSecurity/metadata/V1/AuthzPolicy.php @@ -20,7 +20,7 @@ public static function initOnce() { \GPBMetadata\Google\Protobuf\FieldMask::initOnce(); \GPBMetadata\Google\Protobuf\Timestamp::initOnce(); $pool->internalAddGeneratedFile( - "\x0A\x92.\x0A2google/cloud/networksecurity/v1/authz_policy.proto\x12\x1Fgoogle.cloud.networksecurity.v1\x1A\x1Bgoogle/api/field_info.proto\x1A\x19google/api/resource.proto\x1A google/protobuf/field_mask.proto\x1A\x1Fgoogle/protobuf/timestamp.proto\"\xF3\"\x0A\x0BAuthzPolicy\x12\x14\x0A\x04name\x18\x01 \x01(\x09B\x06\xE0A\x02\xE0A\x08\x124\x0A\x0Bcreate_time\x18\x02 \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x03\x124\x0A\x0Bupdate_time\x18\x03 \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x03\x12\x18\x0A\x0Bdescription\x18\x04 \x01(\x09B\x03\xE0A\x01\x12M\x0A\x06labels\x18\x05 \x03(\x0B28.google.cloud.networksecurity.v1.AuthzPolicy.LabelsEntryB\x03\xE0A\x01\x12H\x0A\x06target\x18\x06 \x01(\x0B23.google.cloud.networksecurity.v1.AuthzPolicy.TargetB\x03\xE0A\x02\x12O\x0A\x0Ahttp_rules\x18\x07 \x03(\x0B26.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRuleB\x03\xE0A\x01\x12M\x0A\x06action\x18\x08 \x01(\x0E28.google.cloud.networksecurity.v1.AuthzPolicy.AuthzActionB\x03\xE0A\x02\x12Y\x0A\x0Fcustom_provider\x18\x0A \x01(\x0B2;.google.cloud.networksecurity.v1.AuthzPolicy.CustomProviderB\x03\xE0A\x01\x12Z\x0A\x0Epolicy_profile\x18\x0B \x01(\x0E2:.google.cloud.networksecurity.v1.AuthzPolicy.PolicyProfileB\x06\xE0A\x01\xE0A\x05\x1A\x86\x01\x0A\x06Target\x12d\x0A\x15load_balancing_scheme\x18\x08 \x01(\x0E2@.google.cloud.networksecurity.v1.AuthzPolicy.LoadBalancingSchemeB\x03\xE0A\x01\x12\x16\x0A\x09resources\x18\x01 \x03(\x09B\x03\xE0A\x02\x1A\xCE\x16\x0A\x09AuthzRule\x12N\x0A\x04from\x18\x01 \x01(\x0B2;.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.FromB\x03\xE0A\x01\x12J\x0A\x02to\x18\x02 \x01(\x0B29.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.ToB\x03\xE0A\x01\x12\x11\x0A\x04when\x18\x03 \x01(\x09B\x03\xE0A\x01\x1A|\x0A\x0BStringMatch\x12\x0F\x0A\x05exact\x18\x01 \x01(\x09H\x00\x12\x10\x0A\x06prefix\x18\x02 \x01(\x09H\x00\x12\x10\x0A\x06suffix\x18\x03 \x01(\x09H\x00\x12\x12\x0A\x08contains\x18\x04 \x01(\x09H\x00\x12\x13\x0A\x0Bignore_case\x18\x05 \x01(\x08B\x0F\x0A\x0Dmatch_pattern\x1A3\x0A\x07IpBlock\x12\x13\x0A\x06prefix\x18\x01 \x01(\x09B\x03\xE0A\x02\x12\x13\x0A\x06length\x18\x02 \x01(\x05B\x03\xE0A\x02\x1A\x8F\x02\x0A\x0FRequestResource\x12s\x0A\x10tag_value_id_set\x18\x01 \x01(\x0B2T.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource.TagValueIdSetB\x03\xE0A\x01\x12d\x0A\x13iam_service_account\x18\x02 \x01(\x0B2B.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatchB\x03\xE0A\x01\x1A!\x0A\x0DTagValueIdSet\x12\x10\x0A\x03ids\x18\x01 \x03(\x03B\x03\xE0A\x02\x1Ax\x0A\x0BHeaderMatch\x12\x11\x0A\x04name\x18\x01 \x01(\x09B\x03\xE0A\x01\x12V\x0A\x05value\x18\x02 \x01(\x0B2B.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatchB\x03\xE0A\x01\x1A\xEA\x02\x0A\x09Principal\x12s\x0A\x12principal_selector\x18\x01 \x01(\x0E2R.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.Principal.PrincipalSelectorB\x03\xE0A\x01\x12Z\x0A\x09principal\x18\x02 \x01(\x0B2B.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatchB\x03\xE0A\x02\"\x8B\x01\x0A\x11PrincipalSelector\x12\"\x0A\x1EPRINCIPAL_SELECTOR_UNSPECIFIED\x10\x00\x12\x17\x0A\x13CLIENT_CERT_URI_SAN\x10\x01\x12\x1C\x0A\x18CLIENT_CERT_DNS_NAME_SAN\x10\x02\x12\x1B\x0A\x17CLIENT_CERT_COMMON_NAME\x10\x03\x1A\xF1\x03\x0A\x04From\x12_\x0A\x07sources\x18\x01 \x03(\x0B2I.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From.RequestSourceB\x03\xE0A\x01\x12c\x0A\x0Bnot_sources\x18\x02 \x03(\x0B2I.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From.RequestSourceB\x03\xE0A\x01\x1A\xA2\x02\x0A\x0DRequestSource\x12Y\x0A\x0Aprincipals\x18\x01 \x03(\x0B2@.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.PrincipalB\x03\xE0A\x01\x12V\x0A\x09ip_blocks\x18\x02 \x03(\x0B2>.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IpBlockB\x03\xE0A\x01\x12^\x0A\x09resources\x18\x03 \x03(\x0B2F.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResourceB\x03\xE0A\x01\x1A\xF1\x09\x0A\x02To\x12c\x0A\x0Aoperations\x18\x01 \x03(\x0B2J.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperationB\x03\xE0A\x01\x12g\x0A\x0Enot_operations\x18\x02 \x03(\x0B2J.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperationB\x03\xE0A\x01\x1A\x9C\x08\x0A\x10RequestOperation\x12m\x0A\x0Aheader_set\x18\x01 \x01(\x0B2T.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.HeaderSetB\x03\xE0A\x01\x12V\x0A\x05hosts\x18\x02 \x03(\x0B2B.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatchB\x03\xE0A\x01\x12V\x0A\x05paths\x18\x03 \x03(\x0B2B.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatchB\x03\xE0A\x01\x12\x14\x0A\x07methods\x18\x04 \x03(\x09B\x03\xE0A\x01\x12`\x0A\x03mcp\x18\x05 \x01(\x0B2N.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCPB\x03\xE0A\x01\x1Ae\x0A\x09HeaderSet\x12X\x0A\x07headers\x18\x01 \x03(\x0B2B.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.HeaderMatchB\x03\xE0A\x02\x1Aw\x0A\x09MCPMethod\x12\x11\x0A\x04name\x18\x01 \x01(\x09B\x03\xE0A\x02\x12W\x0A\x06params\x18\x02 \x03(\x0B2B.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatchB\x03\xE0A\x01\x1A\x83\x02\x0A\x03MCP\x12\x8F\x01\x0A\x1Cbase_protocol_methods_option\x18\x01 \x01(\x0E2d.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.BaseProtocolMethodsOptionB\x03\xE0A\x01\x12j\x0A\x07methods\x18\x02 \x03(\x0B2T.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCPMethodB\x03\xE0A\x01\"\x8A\x01\x0A\x19BaseProtocolMethodsOption\x12,\x0A(BASE_PROTOCOL_METHODS_OPTION_UNSPECIFIED\x10\x00\x12\x1E\x0A\x1ASKIP_BASE_PROTOCOL_METHODS\x10\x01\x12\x1F\x0A\x1BMATCH_BASE_PROTOCOL_METHODS\x10\x02\x1A\x8E\x02\x0A\x0ECustomProvider\x12\\\x0A\x09cloud_iap\x18\x01 \x01(\x0B2D.google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.CloudIapB\x03\xE0A\x01\x12h\x0A\x0Fauthz_extension\x18\x02 \x01(\x0B2J.google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.AuthzExtensionB\x03\xE0A\x01\x1A\x0A\x0A\x08CloudIap\x1A(\x0A\x0EAuthzExtension\x12\x16\x0A\x09resources\x18\x01 \x03(\x09B\x03\xE0A\x02\x1A-\x0A\x0BLabelsEntry\x12\x0B\x0A\x03key\x18\x01 \x01(\x09\x12\x0D\x0A\x05value\x18\x02 \x01(\x09:\x028\x01\"\x83\x01\x0A\x13LoadBalancingScheme\x12%\x0A!LOAD_BALANCING_SCHEME_UNSPECIFIED\x10\x00\x12\x14\x0A\x10INTERNAL_MANAGED\x10\x01\x12\x14\x0A\x10EXTERNAL_MANAGED\x10\x02\x12\x19\x0A\x15INTERNAL_SELF_MANAGED\x10\x03\"L\x0A\x0BAuthzAction\x12\x1C\x0A\x18AUTHZ_ACTION_UNSPECIFIED\x10\x00\x12\x09\x0A\x05ALLOW\x10\x01\x12\x08\x0A\x04DENY\x10\x02\x12\x0A\x0A\x06CUSTOM\x10\x03\"U\x0A\x0DPolicyProfile\x12\x1E\x0A\x1APOLICY_PROFILE_UNSPECIFIED\x10\x00\x12\x11\x0A\x0DREQUEST_AUTHZ\x10\x01\x12\x11\x0A\x0DCONTENT_AUTHZ\x10\x02:\x92\x01\xEAA\x8E\x01\x0A*networksecurity.googleapis.com/AuthzPolicy\x12Dprojects/{project}/locations/{location}/authzPolicies/{authz_policy}*\x0DauthzPolicies2\x0BauthzPolicy\"\xE6\x01\x0A\x18CreateAuthzPolicyRequest\x12B\x0A\x06parent\x18\x01 \x01(\x09B2\xE0A\x02\xFAA,\x12*networksecurity.googleapis.com/AuthzPolicy\x12\x1C\x0A\x0Fauthz_policy_id\x18\x02 \x01(\x09B\x03\xE0A\x02\x12G\x0A\x0Cauthz_policy\x18\x03 \x01(\x0B2,.google.cloud.networksecurity.v1.AuthzPolicyB\x03\xE0A\x02\x12\x1F\x0A\x0Arequest_id\x18\x04 \x01(\x09B\x0B\xE0A\x01\xE2\x8C\xCF\xD7\x08\x02\x08\x01\"\xBB\x01\x0A\x18ListAuthzPoliciesRequest\x12B\x0A\x06parent\x18\x01 \x01(\x09B2\xE0A\x02\xFAA,\x12*networksecurity.googleapis.com/AuthzPolicy\x12\x16\x0A\x09page_size\x18\x02 \x01(\x05B\x03\xE0A\x01\x12\x17\x0A\x0Apage_token\x18\x03 \x01(\x09B\x03\xE0A\x01\x12\x13\x0A\x06filter\x18\x04 \x01(\x09B\x03\xE0A\x01\x12\x15\x0A\x08order_by\x18\x05 \x01(\x09B\x03\xE0A\x01\"\x8F\x01\x0A\x19ListAuthzPoliciesResponse\x12D\x0A\x0Eauthz_policies\x18\x01 \x03(\x0B2,.google.cloud.networksecurity.v1.AuthzPolicy\x12\x17\x0A\x0Fnext_page_token\x18\x02 \x01(\x09\x12\x13\x0A\x0Bunreachable\x18\x03 \x03(\x09\"Y\x0A\x15GetAuthzPolicyRequest\x12@\x0A\x04name\x18\x01 \x01(\x09B2\xE0A\x02\xFAA,\x0A*networksecurity.googleapis.com/AuthzPolicy\"\xBA\x01\x0A\x18UpdateAuthzPolicyRequest\x124\x0A\x0Bupdate_mask\x18\x01 \x01(\x0B2\x1A.google.protobuf.FieldMaskB\x03\xE0A\x02\x12G\x0A\x0Cauthz_policy\x18\x02 \x01(\x0B2,.google.cloud.networksecurity.v1.AuthzPolicyB\x03\xE0A\x02\x12\x1F\x0A\x0Arequest_id\x18\x03 \x01(\x09B\x0B\xE0A\x01\xE2\x8C\xCF\xD7\x08\x02\x08\x01\"}\x0A\x18DeleteAuthzPolicyRequest\x12@\x0A\x04name\x18\x01 \x01(\x09B2\xE0A\x02\xFAA,\x0A*networksecurity.googleapis.com/AuthzPolicy\x12\x1F\x0A\x0Arequest_id\x18\x02 \x01(\x09B\x0B\xE0A\x01\xE2\x8C\xCF\xD7\x08\x02\x08\x01B\xF1\x01\x0A#com.google.cloud.networksecurity.v1B\x10AuthzPolicyProtoP\x01ZMcloud.google.com/go/networksecurity/apiv1/networksecuritypb;networksecuritypb\xAA\x02\x1FGoogle.Cloud.NetworkSecurity.V1\xCA\x02\x1FGoogle\\Cloud\\NetworkSecurity\\V1\xEA\x02\"Google::Cloud::NetworkSecurity::V1b\x06proto3" + "\x0A\xBD/\x0A2google/cloud/networksecurity/v1/authz_policy.proto\x12\x1Fgoogle.cloud.networksecurity.v1\x1A\x1Bgoogle/api/field_info.proto\x1A\x19google/api/resource.proto\x1A google/protobuf/field_mask.proto\x1A\x1Fgoogle/protobuf/timestamp.proto\"\x9E\$\x0A\x0BAuthzPolicy\x12\x14\x0A\x04name\x18\x01 \x01(\x09B\x06\xE0A\x02\xE0A\x08\x124\x0A\x0Bcreate_time\x18\x02 \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x03\x124\x0A\x0Bupdate_time\x18\x03 \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x03\x12\x18\x0A\x0Bdescription\x18\x04 \x01(\x09B\x03\xE0A\x01\x12M\x0A\x06labels\x18\x05 \x03(\x0B28.google.cloud.networksecurity.v1.AuthzPolicy.LabelsEntryB\x03\xE0A\x01\x12H\x0A\x06target\x18\x06 \x01(\x0B23.google.cloud.networksecurity.v1.AuthzPolicy.TargetB\x03\xE0A\x02\x12O\x0A\x0Ahttp_rules\x18\x07 \x03(\x0B26.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRuleB\x03\xE0A\x01\x12R\x0A\x0Dnetwork_rules\x18\x0C \x03(\x0B26.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRuleB\x03\xE0A\x01\x12M\x0A\x06action\x18\x08 \x01(\x0E28.google.cloud.networksecurity.v1.AuthzPolicy.AuthzActionB\x03\xE0A\x02\x12Y\x0A\x0Fcustom_provider\x18\x0A \x01(\x0B2;.google.cloud.networksecurity.v1.AuthzPolicy.CustomProviderB\x03\xE0A\x01\x12Z\x0A\x0Epolicy_profile\x18\x0B \x01(\x0E2:.google.cloud.networksecurity.v1.AuthzPolicy.PolicyProfileB\x06\xE0A\x01\xE0A\x05\x1A\x86\x01\x0A\x06Target\x12d\x0A\x15load_balancing_scheme\x18\x08 \x01(\x0E2@.google.cloud.networksecurity.v1.AuthzPolicy.LoadBalancingSchemeB\x03\xE0A\x01\x12\x16\x0A\x09resources\x18\x01 \x03(\x09B\x03\xE0A\x02\x1A\xA5\x17\x0A\x09AuthzRule\x12N\x0A\x04from\x18\x01 \x01(\x0B2;.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.FromB\x03\xE0A\x01\x12J\x0A\x02to\x18\x02 \x01(\x0B29.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.ToB\x03\xE0A\x01\x12\x11\x0A\x04when\x18\x03 \x01(\x09B\x03\xE0A\x01\x1A|\x0A\x0BStringMatch\x12\x0F\x0A\x05exact\x18\x01 \x01(\x09H\x00\x12\x10\x0A\x06prefix\x18\x02 \x01(\x09H\x00\x12\x10\x0A\x06suffix\x18\x03 \x01(\x09H\x00\x12\x12\x0A\x08contains\x18\x04 \x01(\x09H\x00\x12\x13\x0A\x0Bignore_case\x18\x05 \x01(\x08B\x0F\x0A\x0Dmatch_pattern\x1A3\x0A\x07IpBlock\x12\x13\x0A\x06prefix\x18\x01 \x01(\x09B\x03\xE0A\x02\x12\x13\x0A\x06length\x18\x02 \x01(\x05B\x03\xE0A\x02\x1A\x8F\x02\x0A\x0FRequestResource\x12s\x0A\x10tag_value_id_set\x18\x01 \x01(\x0B2T.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource.TagValueIdSetB\x03\xE0A\x01\x12d\x0A\x13iam_service_account\x18\x02 \x01(\x0B2B.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatchB\x03\xE0A\x01\x1A!\x0A\x0DTagValueIdSet\x12\x10\x0A\x03ids\x18\x01 \x03(\x03B\x03\xE0A\x02\x1Ax\x0A\x0BHeaderMatch\x12\x11\x0A\x04name\x18\x01 \x01(\x09B\x03\xE0A\x01\x12V\x0A\x05value\x18\x02 \x01(\x0B2B.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatchB\x03\xE0A\x01\x1A\xEA\x02\x0A\x09Principal\x12s\x0A\x12principal_selector\x18\x01 \x01(\x0E2R.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.Principal.PrincipalSelectorB\x03\xE0A\x01\x12Z\x0A\x09principal\x18\x02 \x01(\x0B2B.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatchB\x03\xE0A\x02\"\x8B\x01\x0A\x11PrincipalSelector\x12\"\x0A\x1EPRINCIPAL_SELECTOR_UNSPECIFIED\x10\x00\x12\x17\x0A\x13CLIENT_CERT_URI_SAN\x10\x01\x12\x1C\x0A\x18CLIENT_CERT_DNS_NAME_SAN\x10\x02\x12\x1B\x0A\x17CLIENT_CERT_COMMON_NAME\x10\x03\x1A\xF1\x03\x0A\x04From\x12_\x0A\x07sources\x18\x01 \x03(\x0B2I.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From.RequestSourceB\x03\xE0A\x01\x12c\x0A\x0Bnot_sources\x18\x02 \x03(\x0B2I.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From.RequestSourceB\x03\xE0A\x01\x1A\xA2\x02\x0A\x0DRequestSource\x12Y\x0A\x0Aprincipals\x18\x01 \x03(\x0B2@.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.PrincipalB\x03\xE0A\x01\x12V\x0A\x09ip_blocks\x18\x02 \x03(\x0B2>.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IpBlockB\x03\xE0A\x01\x12^\x0A\x09resources\x18\x03 \x03(\x0B2F.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResourceB\x03\xE0A\x01\x1A\xC8\x0A\x0A\x02To\x12c\x0A\x0Aoperations\x18\x01 \x03(\x0B2J.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperationB\x03\xE0A\x01\x12g\x0A\x0Enot_operations\x18\x02 \x03(\x0B2J.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperationB\x03\xE0A\x01\x1A\xF3\x08\x0A\x10RequestOperation\x12m\x0A\x0Aheader_set\x18\x01 \x01(\x0B2T.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.HeaderSetB\x03\xE0A\x01\x12V\x0A\x05hosts\x18\x02 \x03(\x0B2B.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatchB\x03\xE0A\x01\x12V\x0A\x05paths\x18\x03 \x03(\x0B2B.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatchB\x03\xE0A\x01\x12\x14\x0A\x07methods\x18\x04 \x03(\x09B\x03\xE0A\x01\x12`\x0A\x03mcp\x18\x05 \x01(\x0B2N.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCPB\x03\xE0A\x01\x12U\x0A\x04snis\x18\x07 \x03(\x0B2B.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatchB\x03\xE0A\x01\x1Ae\x0A\x09HeaderSet\x12X\x0A\x07headers\x18\x01 \x03(\x0B2B.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.HeaderMatchB\x03\xE0A\x02\x1Aw\x0A\x09MCPMethod\x12\x11\x0A\x04name\x18\x01 \x01(\x09B\x03\xE0A\x02\x12W\x0A\x06params\x18\x02 \x03(\x0B2B.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatchB\x03\xE0A\x01\x1A\x83\x02\x0A\x03MCP\x12\x8F\x01\x0A\x1Cbase_protocol_methods_option\x18\x01 \x01(\x0E2d.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.BaseProtocolMethodsOptionB\x03\xE0A\x01\x12j\x0A\x07methods\x18\x02 \x03(\x0B2T.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCPMethodB\x03\xE0A\x01\"\x8A\x01\x0A\x19BaseProtocolMethodsOption\x12,\x0A(BASE_PROTOCOL_METHODS_OPTION_UNSPECIFIED\x10\x00\x12\x1E\x0A\x1ASKIP_BASE_PROTOCOL_METHODS\x10\x01\x12\x1F\x0A\x1BMATCH_BASE_PROTOCOL_METHODS\x10\x02\x1A\x8E\x02\x0A\x0ECustomProvider\x12\\\x0A\x09cloud_iap\x18\x01 \x01(\x0B2D.google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.CloudIapB\x03\xE0A\x01\x12h\x0A\x0Fauthz_extension\x18\x02 \x01(\x0B2J.google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.AuthzExtensionB\x03\xE0A\x01\x1A\x0A\x0A\x08CloudIap\x1A(\x0A\x0EAuthzExtension\x12\x16\x0A\x09resources\x18\x01 \x03(\x09B\x03\xE0A\x02\x1A-\x0A\x0BLabelsEntry\x12\x0B\x0A\x03key\x18\x01 \x01(\x09\x12\x0D\x0A\x05value\x18\x02 \x01(\x09:\x028\x01\"\x83\x01\x0A\x13LoadBalancingScheme\x12%\x0A!LOAD_BALANCING_SCHEME_UNSPECIFIED\x10\x00\x12\x14\x0A\x10INTERNAL_MANAGED\x10\x01\x12\x14\x0A\x10EXTERNAL_MANAGED\x10\x02\x12\x19\x0A\x15INTERNAL_SELF_MANAGED\x10\x03\"L\x0A\x0BAuthzAction\x12\x1C\x0A\x18AUTHZ_ACTION_UNSPECIFIED\x10\x00\x12\x09\x0A\x05ALLOW\x10\x01\x12\x08\x0A\x04DENY\x10\x02\x12\x0A\x0A\x06CUSTOM\x10\x03\"U\x0A\x0DPolicyProfile\x12\x1E\x0A\x1APOLICY_PROFILE_UNSPECIFIED\x10\x00\x12\x11\x0A\x0DREQUEST_AUTHZ\x10\x01\x12\x11\x0A\x0DCONTENT_AUTHZ\x10\x02:\x92\x01\xEAA\x8E\x01\x0A*networksecurity.googleapis.com/AuthzPolicy\x12Dprojects/{project}/locations/{location}/authzPolicies/{authz_policy}*\x0DauthzPolicies2\x0BauthzPolicy\"\xE6\x01\x0A\x18CreateAuthzPolicyRequest\x12B\x0A\x06parent\x18\x01 \x01(\x09B2\xE0A\x02\xFAA,\x12*networksecurity.googleapis.com/AuthzPolicy\x12\x1C\x0A\x0Fauthz_policy_id\x18\x02 \x01(\x09B\x03\xE0A\x02\x12G\x0A\x0Cauthz_policy\x18\x03 \x01(\x0B2,.google.cloud.networksecurity.v1.AuthzPolicyB\x03\xE0A\x02\x12\x1F\x0A\x0Arequest_id\x18\x04 \x01(\x09B\x0B\xE0A\x01\xE2\x8C\xCF\xD7\x08\x02\x08\x01\"\xBB\x01\x0A\x18ListAuthzPoliciesRequest\x12B\x0A\x06parent\x18\x01 \x01(\x09B2\xE0A\x02\xFAA,\x12*networksecurity.googleapis.com/AuthzPolicy\x12\x16\x0A\x09page_size\x18\x02 \x01(\x05B\x03\xE0A\x01\x12\x17\x0A\x0Apage_token\x18\x03 \x01(\x09B\x03\xE0A\x01\x12\x13\x0A\x06filter\x18\x04 \x01(\x09B\x03\xE0A\x01\x12\x15\x0A\x08order_by\x18\x05 \x01(\x09B\x03\xE0A\x01\"\x8F\x01\x0A\x19ListAuthzPoliciesResponse\x12D\x0A\x0Eauthz_policies\x18\x01 \x03(\x0B2,.google.cloud.networksecurity.v1.AuthzPolicy\x12\x17\x0A\x0Fnext_page_token\x18\x02 \x01(\x09\x12\x13\x0A\x0Bunreachable\x18\x03 \x03(\x09\"Y\x0A\x15GetAuthzPolicyRequest\x12@\x0A\x04name\x18\x01 \x01(\x09B2\xE0A\x02\xFAA,\x0A*networksecurity.googleapis.com/AuthzPolicy\"\xBA\x01\x0A\x18UpdateAuthzPolicyRequest\x124\x0A\x0Bupdate_mask\x18\x01 \x01(\x0B2\x1A.google.protobuf.FieldMaskB\x03\xE0A\x02\x12G\x0A\x0Cauthz_policy\x18\x02 \x01(\x0B2,.google.cloud.networksecurity.v1.AuthzPolicyB\x03\xE0A\x02\x12\x1F\x0A\x0Arequest_id\x18\x03 \x01(\x09B\x0B\xE0A\x01\xE2\x8C\xCF\xD7\x08\x02\x08\x01\"}\x0A\x18DeleteAuthzPolicyRequest\x12@\x0A\x04name\x18\x01 \x01(\x09B2\xE0A\x02\xFAA,\x0A*networksecurity.googleapis.com/AuthzPolicy\x12\x1F\x0A\x0Arequest_id\x18\x02 \x01(\x09B\x0B\xE0A\x01\xE2\x8C\xCF\xD7\x08\x02\x08\x01B\xF1\x01\x0A#com.google.cloud.networksecurity.v1B\x10AuthzPolicyProtoP\x01ZMcloud.google.com/go/networksecurity/apiv1/networksecuritypb;networksecuritypb\xAA\x02\x1FGoogle.Cloud.NetworkSecurity.V1\xCA\x02\x1FGoogle\\Cloud\\NetworkSecurity\\V1\xEA\x02\"Google::Cloud::NetworkSecurity::V1b\x06proto3" , true); static::$is_initialized = true; diff --git a/NetworkSecurity/metadata/V1/FirewallActivation.php b/NetworkSecurity/metadata/V1/FirewallActivation.php index 3e84bce9930e..b8d60a591a59 100644 --- a/NetworkSecurity/metadata/V1/FirewallActivation.php +++ b/NetworkSecurity/metadata/V1/FirewallActivation.php @@ -24,7 +24,7 @@ public static function initOnce() { \GPBMetadata\Google\Protobuf\FieldMask::initOnce(); \GPBMetadata\Google\Protobuf\Timestamp::initOnce(); $pool->internalAddGeneratedFile( - "\x0A\xDC@\x0A9google/cloud/networksecurity/v1/firewall_activation.proto\x12\x1Fgoogle.cloud.networksecurity.v1\x1A\x17google/api/client.proto\x1A\x1Fgoogle/api/field_behavior.proto\x1A\x19google/api/resource.proto\x1A,google/cloud/networksecurity/v1/common.proto\x1A#google/longrunning/operations.proto\x1A\x1Bgoogle/protobuf/empty.proto\x1A google/protobuf/field_mask.proto\x1A\x1Fgoogle/protobuf/timestamp.proto\"\xC3\x0A\x0A\x10FirewallEndpoint\x12\x14\x0A\x04name\x18\x01 \x01(\x09B\x06\xE0A\x05\xE0A\x08\x12\x18\x0A\x0Bdescription\x18\x09 \x01(\x09B\x03\xE0A\x01\x124\x0A\x0Bcreate_time\x18\x02 \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x03\x124\x0A\x0Bupdate_time\x18\x03 \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x03\x12R\x0A\x06labels\x18\x04 \x03(\x0B2=.google.cloud.networksecurity.v1.FirewallEndpoint.LabelsEntryB\x03\xE0A\x01\x12K\x0A\x05state\x18\x05 \x01(\x0E27.google.cloud.networksecurity.v1.FirewallEndpoint.StateB\x03\xE0A\x03\x12\x18\x0A\x0Breconciling\x18\x06 \x01(\x08B\x03\xE0A\x03\x12\"\x0A\x13associated_networks\x18\x07 \x03(\x09B\x05\x18\x01\xE0A\x03\x12a\x0A\x0Cassociations\x18\x0D \x03(\x0B2F.google.cloud.networksecurity.v1.FirewallEndpoint.AssociationReferenceB\x03\xE0A\x03\x12\x1F\x0A\x0Dsatisfies_pzs\x18\x0E \x01(\x08B\x03\xE0A\x03H\x00\x88\x01\x01\x12\x1F\x0A\x0Dsatisfies_pzi\x18\x0F \x01(\x08B\x03\xE0A\x03H\x01\x88\x01\x01\x12\x1F\x0A\x12billing_project_id\x18\x08 \x01(\x09B\x03\xE0A\x01\x12b\x0A\x11endpoint_settings\x18\x13 \x01(\x0B2B.google.cloud.networksecurity.v1.FirewallEndpoint.EndpointSettingsB\x03\xE0A\x01\x1A\xA1\x01\x0A\x14AssociationReference\x12P\x0A\x04name\x18\x01 \x01(\x09BB\xE0A\x03\xFAA<\x0A:networksecurity.googleapis.com/FirewallEndpointAssociation\x127\x0A\x07network\x18\x02 \x01(\x09B&\xE0A\x03\xFAA \x0A\x1Ecompute.googleapis.com/Network\x1A8\x0A\x10EndpointSettings\x12\$\x0A\x14jumbo_frames_enabled\x18\x01 \x01(\x08B\x06\xE0A\x01\xE0A\x05\x1A-\x0A\x0BLabelsEntry\x12\x0B\x0A\x03key\x18\x01 \x01(\x09\x12\x0D\x0A\x05value\x18\x02 \x01(\x09:\x028\x01\"T\x0A\x05State\x12\x15\x0A\x11STATE_UNSPECIFIED\x10\x00\x12\x0C\x0A\x08CREATING\x10\x01\x12\x0A\x0A\x06ACTIVE\x10\x02\x12\x0C\x0A\x08DELETING\x10\x03\x12\x0C\x0A\x08INACTIVE\x10\x04:\x82\x02\xEAA\xFE\x01\x0A/networksecurity.googleapis.com/FirewallEndpoint\x12Worganizations/{organization}/locations/{location}/firewallEndpoints/{firewall_endpoint}\x12Mprojects/{project}/locations/{location}/firewallEndpoints/{firewall_endpoint}*\x11firewallEndpoints2\x10firewallEndpointB\x10\x0A\x0E_satisfies_pzsB\x10\x0A\x0E_satisfies_pzi\"\xBA\x01\x0A\x1CListFirewallEndpointsRequest\x12G\x0A\x06parent\x18\x01 \x01(\x09B7\xE0A\x02\xFAA1\x12/networksecurity.googleapis.com/FirewallEndpoint\x12\x16\x0A\x09page_size\x18\x02 \x01(\x05B\x03\xE0A\x01\x12\x12\x0A\x0Apage_token\x18\x03 \x01(\x09\x12\x13\x0A\x06filter\x18\x04 \x01(\x09B\x03\xE0A\x01\x12\x10\x0A\x08order_by\x18\x05 \x01(\x09\"\x9C\x01\x0A\x1DListFirewallEndpointsResponse\x12M\x0A\x12firewall_endpoints\x18\x01 \x03(\x0B21.google.cloud.networksecurity.v1.FirewallEndpoint\x12\x17\x0A\x0Fnext_page_token\x18\x02 \x01(\x09\x12\x13\x0A\x0Bunreachable\x18\x03 \x03(\x09\"c\x0A\x1AGetFirewallEndpointRequest\x12E\x0A\x04name\x18\x01 \x01(\x09B7\xE0A\x02\xFAA1\x0A/networksecurity.googleapis.com/FirewallEndpoint\"\xF7\x01\x0A\x1DCreateFirewallEndpointRequest\x12G\x0A\x06parent\x18\x01 \x01(\x09B7\xE0A\x02\xFAA1\x12/networksecurity.googleapis.com/FirewallEndpoint\x12!\x0A\x14firewall_endpoint_id\x18\x02 \x01(\x09B\x03\xE0A\x02\x12Q\x0A\x11firewall_endpoint\x18\x03 \x01(\x0B21.google.cloud.networksecurity.v1.FirewallEndpointB\x03\xE0A\x02\x12\x17\x0A\x0Arequest_id\x18\x04 \x01(\x09B\x03\xE0A\x01\"\xC1\x01\x0A\x1DUpdateFirewallEndpointRequest\x124\x0A\x0Bupdate_mask\x18\x01 \x01(\x0B2\x1A.google.protobuf.FieldMaskB\x03\xE0A\x02\x12Q\x0A\x11firewall_endpoint\x18\x02 \x01(\x0B21.google.cloud.networksecurity.v1.FirewallEndpointB\x03\xE0A\x02\x12\x17\x0A\x0Arequest_id\x18\x03 \x01(\x09B\x03\xE0A\x01\"\x7F\x0A\x1DDeleteFirewallEndpointRequest\x12E\x0A\x04name\x18\x01 \x01(\x09B7\xE0A\x02\xFAA1\x0A/networksecurity.googleapis.com/FirewallEndpoint\x12\x17\x0A\x0Arequest_id\x18\x02 \x01(\x09B\x03\xE0A\x01\"\xD2\x06\x0A\x1BFirewallEndpointAssociation\x12\x14\x0A\x04name\x18\x01 \x01(\x09B\x06\xE0A\x05\xE0A\x08\x124\x0A\x0Bcreate_time\x18\x02 \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x03\x124\x0A\x0Bupdate_time\x18\x03 \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x03\x12]\x0A\x06labels\x18\x04 \x03(\x0B2H.google.cloud.networksecurity.v1.FirewallEndpointAssociation.LabelsEntryB\x03\xE0A\x01\x12V\x0A\x05state\x18\x05 \x01(\x0E2B.google.cloud.networksecurity.v1.FirewallEndpointAssociation.StateB\x03\xE0A\x03\x12\x14\x0A\x07network\x18\x06 \x01(\x09B\x03\xE0A\x02\x12\x1E\x0A\x11firewall_endpoint\x18\x07 \x01(\x09B\x03\xE0A\x02\x12Y\x0A\x15tls_inspection_policy\x18\x08 \x01(\x09B:\xE0A\x01\xFAA4\x0A2networksecurity.googleapis.com/TlsInspectionPolicy\x12\x18\x0A\x0Breconciling\x18\x09 \x01(\x08B\x03\xE0A\x03\x12\x15\x0A\x08disabled\x18\x0A \x01(\x08B\x03\xE0A\x01\x1A-\x0A\x0BLabelsEntry\x12\x0B\x0A\x03key\x18\x01 \x01(\x09\x12\x0D\x0A\x05value\x18\x02 \x01(\x09:\x028\x01\"`\x0A\x05State\x12\x15\x0A\x11STATE_UNSPECIFIED\x10\x00\x12\x0C\x0A\x08CREATING\x10\x01\x12\x0A\x0A\x06ACTIVE\x10\x02\x12\x0C\x0A\x08DELETING\x10\x03\x12\x0C\x0A\x08INACTIVE\x10\x04\x12\x0A\x0A\x06ORPHAN\x10\x05:\xA6\x01\xEAA\xA2\x01\x0A:networksecurity.googleapis.com/FirewallEndpointAssociation\x12dprojects/{project}/locations/{location}/firewallEndpointAssociations/{firewall_endpoint_association}\"\xD0\x01\x0A'ListFirewallEndpointAssociationsRequest\x12R\x0A\x06parent\x18\x01 \x01(\x09BB\xE0A\x02\xFAA<\x12:networksecurity.googleapis.com/FirewallEndpointAssociation\x12\x16\x0A\x09page_size\x18\x02 \x01(\x05B\x03\xE0A\x01\x12\x12\x0A\x0Apage_token\x18\x03 \x01(\x09\x12\x13\x0A\x06filter\x18\x04 \x01(\x09B\x03\xE0A\x01\x12\x10\x0A\x08order_by\x18\x05 \x01(\x09\"\xBE\x01\x0A(ListFirewallEndpointAssociationsResponse\x12d\x0A\x1Efirewall_endpoint_associations\x18\x01 \x03(\x0B2<.google.cloud.networksecurity.v1.FirewallEndpointAssociation\x12\x17\x0A\x0Fnext_page_token\x18\x02 \x01(\x09\x12\x13\x0A\x0Bunreachable\x18\x03 \x03(\x09\"y\x0A%GetFirewallEndpointAssociationRequest\x12P\x0A\x04name\x18\x01 \x01(\x09BB\xE0A\x02\xFAA<\x0A:networksecurity.googleapis.com/FirewallEndpointAssociation\"\xB0\x02\x0A(CreateFirewallEndpointAssociationRequest\x12R\x0A\x06parent\x18\x01 \x01(\x09BB\xE0A\x02\xFAA<\x12:networksecurity.googleapis.com/FirewallEndpointAssociation\x12-\x0A firewall_endpoint_association_id\x18\x02 \x01(\x09B\x03\xE0A\x01\x12h\x0A\x1Dfirewall_endpoint_association\x18\x03 \x01(\x0B2<.google.cloud.networksecurity.v1.FirewallEndpointAssociationB\x03\xE0A\x02\x12\x17\x0A\x0Arequest_id\x18\x04 \x01(\x09B\x03\xE0A\x01\"\x95\x01\x0A(DeleteFirewallEndpointAssociationRequest\x12P\x0A\x04name\x18\x01 \x01(\x09BB\xE0A\x02\xFAA<\x0A:networksecurity.googleapis.com/FirewallEndpointAssociation\x12\x17\x0A\x0Arequest_id\x18\x02 \x01(\x09B\x03\xE0A\x01\"\xE3\x01\x0A(UpdateFirewallEndpointAssociationRequest\x124\x0A\x0Bupdate_mask\x18\x01 \x01(\x0B2\x1A.google.protobuf.FieldMaskB\x03\xE0A\x02\x12h\x0A\x1Dfirewall_endpoint_association\x18\x02 \x01(\x0B2<.google.cloud.networksecurity.v1.FirewallEndpointAssociationB\x03\xE0A\x02\x12\x17\x0A\x0Arequest_id\x18\x03 \x01(\x09B\x03\xE0A\x012\xAC\x18\x0A\x12FirewallActivation\x12\xE3\x01\x0A\x15ListFirewallEndpoints\x12=.google.cloud.networksecurity.v1.ListFirewallEndpointsRequest\x1A>.google.cloud.networksecurity.v1.ListFirewallEndpointsResponse\"K\xDAA\x06parent\x82\xD3\xE4\x93\x02<\x12:/v1/{parent=organizations/*/locations/*}/firewallEndpoints\x12\xD0\x01\x0A\x13GetFirewallEndpoint\x12;.google.cloud.networksecurity.v1.GetFirewallEndpointRequest\x1A1.google.cloud.networksecurity.v1.FirewallEndpoint\"I\xDAA\x04name\x82\xD3\xE4\x93\x02<\x12:/v1/{name=organizations/*/locations/*/firewallEndpoints/*}\x12\xC7\x02\x0A\x16CreateFirewallEndpoint\x12>.google.cloud.networksecurity.v1.CreateFirewallEndpointRequest\x1A\x1D.google.longrunning.Operation\"\xCD\x01\xCAAE\x0A\x10FirewallEndpoint\x121google.cloud.networksecurity.v1.OperationMetadata\xDAA-parent,firewall_endpoint,firewall_endpoint_id\x82\xD3\xE4\x93\x02O\":/v1/{parent=organizations/*/locations/*}/firewallEndpoints:\x11firewall_endpoint\x12\x90\x02\x0A\x16DeleteFirewallEndpoint\x12>.google.cloud.networksecurity.v1.DeleteFirewallEndpointRequest\x1A\x1D.google.longrunning.Operation\"\x96\x01\xCAAJ\x0A\x15google.protobuf.Empty\x121google.cloud.networksecurity.v1.OperationMetadata\xDAA\x04name\x82\xD3\xE4\x93\x02<*:/v1/{name=organizations/*/locations/*/firewallEndpoints/*}\x12\xC9\x02\x0A\x16UpdateFirewallEndpoint\x12>.google.cloud.networksecurity.v1.UpdateFirewallEndpointRequest\x1A\x1D.google.longrunning.Operation\"\xCF\x01\xCAAE\x0A\x10FirewallEndpoint\x121google.cloud.networksecurity.v1.OperationMetadata\xDAA\x1Dfirewall_endpoint,update_mask\x82\xD3\xE4\x93\x02a2L/v1/{firewall_endpoint.name=organizations/*/locations/*/firewallEndpoints/*}:\x11firewall_endpoint\x12\x8A\x02\x0A ListFirewallEndpointAssociations\x12H.google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsRequest\x1AI.google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsResponse\"Q\xDAA\x06parent\x82\xD3\xE4\x93\x02B\x12@/v1/{parent=projects/*/locations/*}/firewallEndpointAssociations\x12\xF7\x01\x0A\x1EGetFirewallEndpointAssociation\x12F.google.cloud.networksecurity.v1.GetFirewallEndpointAssociationRequest\x1A<.google.cloud.networksecurity.v1.FirewallEndpointAssociation\"O\xDAA\x04name\x82\xD3\xE4\x93\x02B\x12@/v1/{name=projects/*/locations/*/firewallEndpointAssociations/*}\x12\x92\x03\x0A!CreateFirewallEndpointAssociation\x12I.google.cloud.networksecurity.v1.CreateFirewallEndpointAssociationRequest\x1A\x1D.google.longrunning.Operation\"\x82\x02\xCAAP\x0A\x1BFirewallEndpointAssociation\x121google.cloud.networksecurity.v1.OperationMetadata\xDAAEparent,firewall_endpoint_association,firewall_endpoint_association_id\x82\xD3\xE4\x93\x02a\"@/v1/{parent=projects/*/locations/*}/firewallEndpointAssociations:\x1Dfirewall_endpoint_association\x12\xAC\x02\x0A!DeleteFirewallEndpointAssociation\x12I.google.cloud.networksecurity.v1.DeleteFirewallEndpointAssociationRequest\x1A\x1D.google.longrunning.Operation\"\x9C\x01\xCAAJ\x0A\x15google.protobuf.Empty\x121google.cloud.networksecurity.v1.OperationMetadata\xDAA\x04name\x82\xD3\xE4\x93\x02B*@/v1/{name=projects/*/locations/*/firewallEndpointAssociations/*}\x12\x94\x03\x0A!UpdateFirewallEndpointAssociation\x12I.google.cloud.networksecurity.v1.UpdateFirewallEndpointAssociationRequest\x1A\x1D.google.longrunning.Operation\"\x84\x02\xCAAP\x0A\x1BFirewallEndpointAssociation\x121google.cloud.networksecurity.v1.OperationMetadata\xDAA)firewall_endpoint_association,update_mask\x82\xD3\xE4\x93\x02\x7F2^/v1/{firewall_endpoint_association.name=projects/*/locations/*/firewallEndpointAssociations/*}:\x1Dfirewall_endpoint_association\x1AR\xCAA\x1Enetworksecurity.googleapis.com\xD2A.https://www.googleapis.com/auth/cloud-platformB\xE3\x02\x0A#com.google.cloud.networksecurity.v1B\x17FirewallActivationProtoP\x01ZMcloud.google.com/go/networksecurity/apiv1/networksecuritypb;networksecuritypb\xAA\x02\x1FGoogle.Cloud.NetworkSecurity.V1\xCA\x02\x1FGoogle\\Cloud\\NetworkSecurity\\V1\xEA\x02\"Google::Cloud::NetworkSecurity::V1\xEAAh\x0A3networksecurity.googleapis.com/OrganizationLocation\x121organizations/{organization}/locations/{location}b\x06proto3" + "\x0A\xC8K\x0A9google/cloud/networksecurity/v1/firewall_activation.proto\x12\x1Fgoogle.cloud.networksecurity.v1\x1A\x17google/api/client.proto\x1A\x1Fgoogle/api/field_behavior.proto\x1A\x19google/api/resource.proto\x1A,google/cloud/networksecurity/v1/common.proto\x1A#google/longrunning/operations.proto\x1A\x1Bgoogle/protobuf/empty.proto\x1A google/protobuf/field_mask.proto\x1A\x1Fgoogle/protobuf/timestamp.proto\"\xC3\x0A\x0A\x10FirewallEndpoint\x12\x14\x0A\x04name\x18\x01 \x01(\x09B\x06\xE0A\x05\xE0A\x08\x12\x18\x0A\x0Bdescription\x18\x09 \x01(\x09B\x03\xE0A\x01\x124\x0A\x0Bcreate_time\x18\x02 \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x03\x124\x0A\x0Bupdate_time\x18\x03 \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x03\x12R\x0A\x06labels\x18\x04 \x03(\x0B2=.google.cloud.networksecurity.v1.FirewallEndpoint.LabelsEntryB\x03\xE0A\x01\x12K\x0A\x05state\x18\x05 \x01(\x0E27.google.cloud.networksecurity.v1.FirewallEndpoint.StateB\x03\xE0A\x03\x12\x18\x0A\x0Breconciling\x18\x06 \x01(\x08B\x03\xE0A\x03\x12\"\x0A\x13associated_networks\x18\x07 \x03(\x09B\x05\x18\x01\xE0A\x03\x12a\x0A\x0Cassociations\x18\x0D \x03(\x0B2F.google.cloud.networksecurity.v1.FirewallEndpoint.AssociationReferenceB\x03\xE0A\x03\x12\x1F\x0A\x0Dsatisfies_pzs\x18\x0E \x01(\x08B\x03\xE0A\x03H\x00\x88\x01\x01\x12\x1F\x0A\x0Dsatisfies_pzi\x18\x0F \x01(\x08B\x03\xE0A\x03H\x01\x88\x01\x01\x12\x1F\x0A\x12billing_project_id\x18\x08 \x01(\x09B\x03\xE0A\x01\x12b\x0A\x11endpoint_settings\x18\x13 \x01(\x0B2B.google.cloud.networksecurity.v1.FirewallEndpoint.EndpointSettingsB\x03\xE0A\x01\x1A\xA1\x01\x0A\x14AssociationReference\x12P\x0A\x04name\x18\x01 \x01(\x09BB\xE0A\x03\xFAA<\x0A:networksecurity.googleapis.com/FirewallEndpointAssociation\x127\x0A\x07network\x18\x02 \x01(\x09B&\xE0A\x03\xFAA \x0A\x1Ecompute.googleapis.com/Network\x1A8\x0A\x10EndpointSettings\x12\$\x0A\x14jumbo_frames_enabled\x18\x01 \x01(\x08B\x06\xE0A\x01\xE0A\x05\x1A-\x0A\x0BLabelsEntry\x12\x0B\x0A\x03key\x18\x01 \x01(\x09\x12\x0D\x0A\x05value\x18\x02 \x01(\x09:\x028\x01\"T\x0A\x05State\x12\x15\x0A\x11STATE_UNSPECIFIED\x10\x00\x12\x0C\x0A\x08CREATING\x10\x01\x12\x0A\x0A\x06ACTIVE\x10\x02\x12\x0C\x0A\x08DELETING\x10\x03\x12\x0C\x0A\x08INACTIVE\x10\x04:\x82\x02\xEAA\xFE\x01\x0A/networksecurity.googleapis.com/FirewallEndpoint\x12Worganizations/{organization}/locations/{location}/firewallEndpoints/{firewall_endpoint}\x12Mprojects/{project}/locations/{location}/firewallEndpoints/{firewall_endpoint}*\x11firewallEndpoints2\x10firewallEndpointB\x10\x0A\x0E_satisfies_pzsB\x10\x0A\x0E_satisfies_pzi\"\xBA\x01\x0A\x1CListFirewallEndpointsRequest\x12G\x0A\x06parent\x18\x01 \x01(\x09B7\xE0A\x02\xFAA1\x12/networksecurity.googleapis.com/FirewallEndpoint\x12\x16\x0A\x09page_size\x18\x02 \x01(\x05B\x03\xE0A\x01\x12\x12\x0A\x0Apage_token\x18\x03 \x01(\x09\x12\x13\x0A\x06filter\x18\x04 \x01(\x09B\x03\xE0A\x01\x12\x10\x0A\x08order_by\x18\x05 \x01(\x09\"\x9C\x01\x0A\x1DListFirewallEndpointsResponse\x12M\x0A\x12firewall_endpoints\x18\x01 \x03(\x0B21.google.cloud.networksecurity.v1.FirewallEndpoint\x12\x17\x0A\x0Fnext_page_token\x18\x02 \x01(\x09\x12\x13\x0A\x0Bunreachable\x18\x03 \x03(\x09\"c\x0A\x1AGetFirewallEndpointRequest\x12E\x0A\x04name\x18\x01 \x01(\x09B7\xE0A\x02\xFAA1\x0A/networksecurity.googleapis.com/FirewallEndpoint\"\xF7\x01\x0A\x1DCreateFirewallEndpointRequest\x12G\x0A\x06parent\x18\x01 \x01(\x09B7\xE0A\x02\xFAA1\x12/networksecurity.googleapis.com/FirewallEndpoint\x12!\x0A\x14firewall_endpoint_id\x18\x02 \x01(\x09B\x03\xE0A\x02\x12Q\x0A\x11firewall_endpoint\x18\x03 \x01(\x0B21.google.cloud.networksecurity.v1.FirewallEndpointB\x03\xE0A\x02\x12\x17\x0A\x0Arequest_id\x18\x04 \x01(\x09B\x03\xE0A\x01\"\xC1\x01\x0A\x1DUpdateFirewallEndpointRequest\x124\x0A\x0Bupdate_mask\x18\x01 \x01(\x0B2\x1A.google.protobuf.FieldMaskB\x03\xE0A\x02\x12Q\x0A\x11firewall_endpoint\x18\x02 \x01(\x0B21.google.cloud.networksecurity.v1.FirewallEndpointB\x03\xE0A\x02\x12\x17\x0A\x0Arequest_id\x18\x03 \x01(\x09B\x03\xE0A\x01\"\x7F\x0A\x1DDeleteFirewallEndpointRequest\x12E\x0A\x04name\x18\x01 \x01(\x09B7\xE0A\x02\xFAA1\x0A/networksecurity.googleapis.com/FirewallEndpoint\x12\x17\x0A\x0Arequest_id\x18\x02 \x01(\x09B\x03\xE0A\x01\"\xD2\x06\x0A\x1BFirewallEndpointAssociation\x12\x14\x0A\x04name\x18\x01 \x01(\x09B\x06\xE0A\x05\xE0A\x08\x124\x0A\x0Bcreate_time\x18\x02 \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x03\x124\x0A\x0Bupdate_time\x18\x03 \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x03\x12]\x0A\x06labels\x18\x04 \x03(\x0B2H.google.cloud.networksecurity.v1.FirewallEndpointAssociation.LabelsEntryB\x03\xE0A\x01\x12V\x0A\x05state\x18\x05 \x01(\x0E2B.google.cloud.networksecurity.v1.FirewallEndpointAssociation.StateB\x03\xE0A\x03\x12\x14\x0A\x07network\x18\x06 \x01(\x09B\x03\xE0A\x02\x12\x1E\x0A\x11firewall_endpoint\x18\x07 \x01(\x09B\x03\xE0A\x02\x12Y\x0A\x15tls_inspection_policy\x18\x08 \x01(\x09B:\xE0A\x01\xFAA4\x0A2networksecurity.googleapis.com/TlsInspectionPolicy\x12\x18\x0A\x0Breconciling\x18\x09 \x01(\x08B\x03\xE0A\x03\x12\x15\x0A\x08disabled\x18\x0A \x01(\x08B\x03\xE0A\x01\x1A-\x0A\x0BLabelsEntry\x12\x0B\x0A\x03key\x18\x01 \x01(\x09\x12\x0D\x0A\x05value\x18\x02 \x01(\x09:\x028\x01\"`\x0A\x05State\x12\x15\x0A\x11STATE_UNSPECIFIED\x10\x00\x12\x0C\x0A\x08CREATING\x10\x01\x12\x0A\x0A\x06ACTIVE\x10\x02\x12\x0C\x0A\x08DELETING\x10\x03\x12\x0C\x0A\x08INACTIVE\x10\x04\x12\x0A\x0A\x06ORPHAN\x10\x05:\xA6\x01\xEAA\xA2\x01\x0A:networksecurity.googleapis.com/FirewallEndpointAssociation\x12dprojects/{project}/locations/{location}/firewallEndpointAssociations/{firewall_endpoint_association}\"\xD0\x01\x0A'ListFirewallEndpointAssociationsRequest\x12R\x0A\x06parent\x18\x01 \x01(\x09BB\xE0A\x02\xFAA<\x12:networksecurity.googleapis.com/FirewallEndpointAssociation\x12\x16\x0A\x09page_size\x18\x02 \x01(\x05B\x03\xE0A\x01\x12\x12\x0A\x0Apage_token\x18\x03 \x01(\x09\x12\x13\x0A\x06filter\x18\x04 \x01(\x09B\x03\xE0A\x01\x12\x10\x0A\x08order_by\x18\x05 \x01(\x09\"\xBE\x01\x0A(ListFirewallEndpointAssociationsResponse\x12d\x0A\x1Efirewall_endpoint_associations\x18\x01 \x03(\x0B2<.google.cloud.networksecurity.v1.FirewallEndpointAssociation\x12\x17\x0A\x0Fnext_page_token\x18\x02 \x01(\x09\x12\x13\x0A\x0Bunreachable\x18\x03 \x03(\x09\"y\x0A%GetFirewallEndpointAssociationRequest\x12P\x0A\x04name\x18\x01 \x01(\x09BB\xE0A\x02\xFAA<\x0A:networksecurity.googleapis.com/FirewallEndpointAssociation\"\xB0\x02\x0A(CreateFirewallEndpointAssociationRequest\x12R\x0A\x06parent\x18\x01 \x01(\x09BB\xE0A\x02\xFAA<\x12:networksecurity.googleapis.com/FirewallEndpointAssociation\x12-\x0A firewall_endpoint_association_id\x18\x02 \x01(\x09B\x03\xE0A\x01\x12h\x0A\x1Dfirewall_endpoint_association\x18\x03 \x01(\x0B2<.google.cloud.networksecurity.v1.FirewallEndpointAssociationB\x03\xE0A\x02\x12\x17\x0A\x0Arequest_id\x18\x04 \x01(\x09B\x03\xE0A\x01\"\x95\x01\x0A(DeleteFirewallEndpointAssociationRequest\x12P\x0A\x04name\x18\x01 \x01(\x09BB\xE0A\x02\xFAA<\x0A:networksecurity.googleapis.com/FirewallEndpointAssociation\x12\x17\x0A\x0Arequest_id\x18\x02 \x01(\x09B\x03\xE0A\x01\"\xE3\x01\x0A(UpdateFirewallEndpointAssociationRequest\x124\x0A\x0Bupdate_mask\x18\x01 \x01(\x0B2\x1A.google.protobuf.FieldMaskB\x03\xE0A\x02\x12h\x0A\x1Dfirewall_endpoint_association\x18\x02 \x01(\x0B2<.google.cloud.networksecurity.v1.FirewallEndpointAssociationB\x03\xE0A\x02\x12\x17\x0A\x0Arequest_id\x18\x03 \x01(\x09B\x03\xE0A\x012\x98#\x0A\x12FirewallActivation\x12\xE3\x01\x0A\x15ListFirewallEndpoints\x12=.google.cloud.networksecurity.v1.ListFirewallEndpointsRequest\x1A>.google.cloud.networksecurity.v1.ListFirewallEndpointsResponse\"K\xDAA\x06parent\x82\xD3\xE4\x93\x02<\x12:/v1/{parent=organizations/*/locations/*}/firewallEndpoints\x12\xE5\x01\x0A\x1CListProjectFirewallEndpoints\x12=.google.cloud.networksecurity.v1.ListFirewallEndpointsRequest\x1A>.google.cloud.networksecurity.v1.ListFirewallEndpointsResponse\"F\xDAA\x06parent\x82\xD3\xE4\x93\x027\x125/v1/{parent=projects/*/locations/*}/firewallEndpoints\x12\xD0\x01\x0A\x13GetFirewallEndpoint\x12;.google.cloud.networksecurity.v1.GetFirewallEndpointRequest\x1A1.google.cloud.networksecurity.v1.FirewallEndpoint\"I\xDAA\x04name\x82\xD3\xE4\x93\x02<\x12:/v1/{name=organizations/*/locations/*/firewallEndpoints/*}\x12\xD2\x01\x0A\x1AGetProjectFirewallEndpoint\x12;.google.cloud.networksecurity.v1.GetFirewallEndpointRequest\x1A1.google.cloud.networksecurity.v1.FirewallEndpoint\"D\xDAA\x04name\x82\xD3\xE4\x93\x027\x125/v1/{name=projects/*/locations/*/firewallEndpoints/*}\x12\xC7\x02\x0A\x16CreateFirewallEndpoint\x12>.google.cloud.networksecurity.v1.CreateFirewallEndpointRequest\x1A\x1D.google.longrunning.Operation\"\xCD\x01\xCAAE\x0A\x10FirewallEndpoint\x121google.cloud.networksecurity.v1.OperationMetadata\xDAA-parent,firewall_endpoint,firewall_endpoint_id\x82\xD3\xE4\x93\x02O\":/v1/{parent=organizations/*/locations/*}/firewallEndpoints:\x11firewall_endpoint\x12\xC9\x02\x0A\x1DCreateProjectFirewallEndpoint\x12>.google.cloud.networksecurity.v1.CreateFirewallEndpointRequest\x1A\x1D.google.longrunning.Operation\"\xC8\x01\xCAAE\x0A\x10FirewallEndpoint\x121google.cloud.networksecurity.v1.OperationMetadata\xDAA-parent,firewall_endpoint,firewall_endpoint_id\x82\xD3\xE4\x93\x02J\"5/v1/{parent=projects/*/locations/*}/firewallEndpoints:\x11firewall_endpoint\x12\x90\x02\x0A\x16DeleteFirewallEndpoint\x12>.google.cloud.networksecurity.v1.DeleteFirewallEndpointRequest\x1A\x1D.google.longrunning.Operation\"\x96\x01\xCAAJ\x0A\x15google.protobuf.Empty\x121google.cloud.networksecurity.v1.OperationMetadata\xDAA\x04name\x82\xD3\xE4\x93\x02<*:/v1/{name=organizations/*/locations/*/firewallEndpoints/*}\x12\x92\x02\x0A\x1DDeleteProjectFirewallEndpoint\x12>.google.cloud.networksecurity.v1.DeleteFirewallEndpointRequest\x1A\x1D.google.longrunning.Operation\"\x91\x01\xCAAJ\x0A\x15google.protobuf.Empty\x121google.cloud.networksecurity.v1.OperationMetadata\xDAA\x04name\x82\xD3\xE4\x93\x027*5/v1/{name=projects/*/locations/*/firewallEndpoints/*}\x12\xC9\x02\x0A\x16UpdateFirewallEndpoint\x12>.google.cloud.networksecurity.v1.UpdateFirewallEndpointRequest\x1A\x1D.google.longrunning.Operation\"\xCF\x01\xCAAE\x0A\x10FirewallEndpoint\x121google.cloud.networksecurity.v1.OperationMetadata\xDAA\x1Dfirewall_endpoint,update_mask\x82\xD3\xE4\x93\x02a2L/v1/{firewall_endpoint.name=organizations/*/locations/*/firewallEndpoints/*}:\x11firewall_endpoint\x12\xCB\x02\x0A\x1DUpdateProjectFirewallEndpoint\x12>.google.cloud.networksecurity.v1.UpdateFirewallEndpointRequest\x1A\x1D.google.longrunning.Operation\"\xCA\x01\xCAAE\x0A\x10FirewallEndpoint\x121google.cloud.networksecurity.v1.OperationMetadata\xDAA\x1Dfirewall_endpoint,update_mask\x82\xD3\xE4\x93\x02\\2G/v1/{firewall_endpoint.name=projects/*/locations/*/firewallEndpoints/*}:\x11firewall_endpoint\x12\x8A\x02\x0A ListFirewallEndpointAssociations\x12H.google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsRequest\x1AI.google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsResponse\"Q\xDAA\x06parent\x82\xD3\xE4\x93\x02B\x12@/v1/{parent=projects/*/locations/*}/firewallEndpointAssociations\x12\xF7\x01\x0A\x1EGetFirewallEndpointAssociation\x12F.google.cloud.networksecurity.v1.GetFirewallEndpointAssociationRequest\x1A<.google.cloud.networksecurity.v1.FirewallEndpointAssociation\"O\xDAA\x04name\x82\xD3\xE4\x93\x02B\x12@/v1/{name=projects/*/locations/*/firewallEndpointAssociations/*}\x12\x92\x03\x0A!CreateFirewallEndpointAssociation\x12I.google.cloud.networksecurity.v1.CreateFirewallEndpointAssociationRequest\x1A\x1D.google.longrunning.Operation\"\x82\x02\xCAAP\x0A\x1BFirewallEndpointAssociation\x121google.cloud.networksecurity.v1.OperationMetadata\xDAAEparent,firewall_endpoint_association,firewall_endpoint_association_id\x82\xD3\xE4\x93\x02a\"@/v1/{parent=projects/*/locations/*}/firewallEndpointAssociations:\x1Dfirewall_endpoint_association\x12\xAC\x02\x0A!DeleteFirewallEndpointAssociation\x12I.google.cloud.networksecurity.v1.DeleteFirewallEndpointAssociationRequest\x1A\x1D.google.longrunning.Operation\"\x9C\x01\xCAAJ\x0A\x15google.protobuf.Empty\x121google.cloud.networksecurity.v1.OperationMetadata\xDAA\x04name\x82\xD3\xE4\x93\x02B*@/v1/{name=projects/*/locations/*/firewallEndpointAssociations/*}\x12\x94\x03\x0A!UpdateFirewallEndpointAssociation\x12I.google.cloud.networksecurity.v1.UpdateFirewallEndpointAssociationRequest\x1A\x1D.google.longrunning.Operation\"\x84\x02\xCAAP\x0A\x1BFirewallEndpointAssociation\x121google.cloud.networksecurity.v1.OperationMetadata\xDAA)firewall_endpoint_association,update_mask\x82\xD3\xE4\x93\x02\x7F2^/v1/{firewall_endpoint_association.name=projects/*/locations/*/firewallEndpointAssociations/*}:\x1Dfirewall_endpoint_association\x1AR\xCAA\x1Enetworksecurity.googleapis.com\xD2A.https://www.googleapis.com/auth/cloud-platformB\xE3\x02\x0A#com.google.cloud.networksecurity.v1B\x17FirewallActivationProtoP\x01ZMcloud.google.com/go/networksecurity/apiv1/networksecuritypb;networksecuritypb\xAA\x02\x1FGoogle.Cloud.NetworkSecurity.V1\xCA\x02\x1FGoogle\\Cloud\\NetworkSecurity\\V1\xEA\x02\"Google::Cloud::NetworkSecurity::V1\xEAAh\x0A3networksecurity.googleapis.com/OrganizationLocation\x121organizations/{organization}/locations/{location}b\x06proto3" , true); static::$is_initialized = true; diff --git a/NetworkSecurity/metadata/V1/SecurityProfileGroupService.php b/NetworkSecurity/metadata/V1/SecurityProfileGroupService.php index bd0551e5545b..cba312f616e8 100644 --- a/NetworkSecurity/metadata/V1/SecurityProfileGroupService.php +++ b/NetworkSecurity/metadata/V1/SecurityProfileGroupService.php @@ -24,7 +24,7 @@ public static function initOnce() { \GPBMetadata\Google\Protobuf\GPBEmpty::initOnce(); \GPBMetadata\Google\Protobuf\FieldMask::initOnce(); $pool->internalAddGeneratedFile( - "\x0A\x87+\x0ADgoogle/cloud/networksecurity/v1/security_profile_group_service.proto\x12\x1Fgoogle.cloud.networksecurity.v1\x1A\x17google/api/client.proto\x1A\x1Fgoogle/api/field_behavior.proto\x1A\x19google/api/resource.proto\x1A,google/cloud/networksecurity/v1/common.proto\x1A/v1/{parent=organizations/*/locations/*}/securityProfileGroups\x12\xE0\x01\x0A\x17GetSecurityProfileGroup\x12?.google.cloud.networksecurity.v1.GetSecurityProfileGroupRequest\x1A5.google.cloud.networksecurity.v1.SecurityProfileGroup\"M\xDAA\x04name\x82\xD3\xE4\x93\x02@\x12>/v1/{name=organizations/*/locations/*/securityProfileGroups/*}\x12\xE6\x02\x0A\x1ACreateSecurityProfileGroup\x12B.google.cloud.networksecurity.v1.CreateSecurityProfileGroupRequest\x1A\x1D.google.longrunning.Operation\"\xE4\x01\xCAAI\x0A\x14SecurityProfileGroup\x121google.cloud.networksecurity.v1.OperationMetadata\xDAA7parent,security_profile_group,security_profile_group_id\x82\xD3\xE4\x93\x02X\">/v1/{parent=organizations/*/locations/*}/securityProfileGroups:\x16security_profile_group\x12\xE8\x02\x0A\x1AUpdateSecurityProfileGroup\x12B.google.cloud.networksecurity.v1.UpdateSecurityProfileGroupRequest\x1A\x1D.google.longrunning.Operation\"\xE6\x01\xCAAI\x0A\x14SecurityProfileGroup\x121google.cloud.networksecurity.v1.OperationMetadata\xDAA\"security_profile_group,update_mask\x82\xD3\xE4\x93\x02o2U/v1/{security_profile_group.name=organizations/*/locations/*/securityProfileGroups/*}:\x16security_profile_group\x12\x9C\x02\x0A\x1ADeleteSecurityProfileGroup\x12B.google.cloud.networksecurity.v1.DeleteSecurityProfileGroupRequest\x1A\x1D.google.longrunning.Operation\"\x9A\x01\xCAAJ\x0A\x15google.protobuf.Empty\x121google.cloud.networksecurity.v1.OperationMetadata\xDAA\x04name\x82\xD3\xE4\x93\x02@*>/v1/{name=organizations/*/locations/*/securityProfileGroups/*}\x12\xDF\x01\x0A\x14ListSecurityProfiles\x12<.google.cloud.networksecurity.v1.ListSecurityProfilesRequest\x1A=.google.cloud.networksecurity.v1.ListSecurityProfilesResponse\"J\xDAA\x06parent\x82\xD3\xE4\x93\x02;\x129/v1/{parent=organizations/*/locations/*}/securityProfiles\x12\xCC\x01\x0A\x12GetSecurityProfile\x12:.google.cloud.networksecurity.v1.GetSecurityProfileRequest\x1A0.google.cloud.networksecurity.v1.SecurityProfile\"H\xDAA\x04name\x82\xD3\xE4\x93\x02;\x129/v1/{name=organizations/*/locations/*/securityProfiles/*}\x12\xC0\x02\x0A\x15CreateSecurityProfile\x12=.google.cloud.networksecurity.v1.CreateSecurityProfileRequest\x1A\x1D.google.longrunning.Operation\"\xC8\x01\xCAAD\x0A\x0FSecurityProfile\x121google.cloud.networksecurity.v1.OperationMetadata\xDAA+parent,security_profile,security_profile_id\x82\xD3\xE4\x93\x02M\"9/v1/{parent=organizations/*/locations/*}/securityProfiles:\x10security_profile\x12\xC2\x02\x0A\x15UpdateSecurityProfile\x12=.google.cloud.networksecurity.v1.UpdateSecurityProfileRequest\x1A\x1D.google.longrunning.Operation\"\xCA\x01\xCAAD\x0A\x0FSecurityProfile\x121google.cloud.networksecurity.v1.OperationMetadata\xDAA\x1Csecurity_profile,update_mask\x82\xD3\xE4\x93\x02^2J/v1/{security_profile.name=organizations/*/locations/*/securityProfiles/*}:\x10security_profile\x12\x8D\x02\x0A\x15DeleteSecurityProfile\x12=.google.cloud.networksecurity.v1.DeleteSecurityProfileRequest\x1A\x1D.google.longrunning.Operation\"\x95\x01\xCAAJ\x0A\x15google.protobuf.Empty\x121google.cloud.networksecurity.v1.OperationMetadata\xDAA\x04name\x82\xD3\xE4\x93\x02;*9/v1/{name=organizations/*/locations/*/securityProfiles/*}\x1AR\xCAA\x1Enetworksecurity.googleapis.com\xD2A.https://www.googleapis.com/auth/cloud-platformB\x81\x02\x0A#com.google.cloud.networksecurity.v1B SecurityProfileGroupServiceProtoP\x01ZMcloud.google.com/go/networksecurity/apiv1/networksecuritypb;networksecuritypb\xAA\x02\x1FGoogle.Cloud.NetworkSecurity.V1\xCA\x02\x1FGoogle\\Cloud\\NetworkSecurity\\V1\xEA\x02\"Google::Cloud::NetworkSecurity::V1b\x06proto3" + "\x0A\xDEA\x0ADgoogle/cloud/networksecurity/v1/security_profile_group_service.proto\x12\x1Fgoogle.cloud.networksecurity.v1\x1A\x17google/api/client.proto\x1A\x1Fgoogle/api/field_behavior.proto\x1A\x19google/api/resource.proto\x1A,google/cloud/networksecurity/v1/common.proto\x1A/v1/{parent=organizations/*/locations/*}/securityProfileGroups\x12\xE0\x01\x0A\x17GetSecurityProfileGroup\x12?.google.cloud.networksecurity.v1.GetSecurityProfileGroupRequest\x1A5.google.cloud.networksecurity.v1.SecurityProfileGroup\"M\xDAA\x04name\x82\xD3\xE4\x93\x02@\x12>/v1/{name=organizations/*/locations/*/securityProfileGroups/*}\x12\xE6\x02\x0A\x1ACreateSecurityProfileGroup\x12B.google.cloud.networksecurity.v1.CreateSecurityProfileGroupRequest\x1A\x1D.google.longrunning.Operation\"\xE4\x01\xCAAI\x0A\x14SecurityProfileGroup\x121google.cloud.networksecurity.v1.OperationMetadata\xDAA7parent,security_profile_group,security_profile_group_id\x82\xD3\xE4\x93\x02X\">/v1/{parent=organizations/*/locations/*}/securityProfileGroups:\x16security_profile_group\x12\xE8\x02\x0A\x1AUpdateSecurityProfileGroup\x12B.google.cloud.networksecurity.v1.UpdateSecurityProfileGroupRequest\x1A\x1D.google.longrunning.Operation\"\xE6\x01\xCAAI\x0A\x14SecurityProfileGroup\x121google.cloud.networksecurity.v1.OperationMetadata\xDAA\"security_profile_group,update_mask\x82\xD3\xE4\x93\x02o2U/v1/{security_profile_group.name=organizations/*/locations/*/securityProfileGroups/*}:\x16security_profile_group\x12\x9C\x02\x0A\x1ADeleteSecurityProfileGroup\x12B.google.cloud.networksecurity.v1.DeleteSecurityProfileGroupRequest\x1A\x1D.google.longrunning.Operation\"\x9A\x01\xCAAJ\x0A\x15google.protobuf.Empty\x121google.cloud.networksecurity.v1.OperationMetadata\xDAA\x04name\x82\xD3\xE4\x93\x02@*>/v1/{name=organizations/*/locations/*/securityProfileGroups/*}\x12\xDF\x01\x0A\x14ListSecurityProfiles\x12<.google.cloud.networksecurity.v1.ListSecurityProfilesRequest\x1A=.google.cloud.networksecurity.v1.ListSecurityProfilesResponse\"J\xDAA\x06parent\x82\xD3\xE4\x93\x02;\x129/v1/{parent=organizations/*/locations/*}/securityProfiles\x12\xCC\x01\x0A\x12GetSecurityProfile\x12:.google.cloud.networksecurity.v1.GetSecurityProfileRequest\x1A0.google.cloud.networksecurity.v1.SecurityProfile\"H\xDAA\x04name\x82\xD3\xE4\x93\x02;\x129/v1/{name=organizations/*/locations/*/securityProfiles/*}\x12\xC0\x02\x0A\x15CreateSecurityProfile\x12=.google.cloud.networksecurity.v1.CreateSecurityProfileRequest\x1A\x1D.google.longrunning.Operation\"\xC8\x01\xCAAD\x0A\x0FSecurityProfile\x121google.cloud.networksecurity.v1.OperationMetadata\xDAA+parent,security_profile,security_profile_id\x82\xD3\xE4\x93\x02M\"9/v1/{parent=organizations/*/locations/*}/securityProfiles:\x10security_profile\x12\xC2\x02\x0A\x15UpdateSecurityProfile\x12=.google.cloud.networksecurity.v1.UpdateSecurityProfileRequest\x1A\x1D.google.longrunning.Operation\"\xCA\x01\xCAAD\x0A\x0FSecurityProfile\x121google.cloud.networksecurity.v1.OperationMetadata\xDAA\x1Csecurity_profile,update_mask\x82\xD3\xE4\x93\x02^2J/v1/{security_profile.name=organizations/*/locations/*/securityProfiles/*}:\x10security_profile\x12\x8D\x02\x0A\x15DeleteSecurityProfile\x12=.google.cloud.networksecurity.v1.DeleteSecurityProfileRequest\x1A\x1D.google.longrunning.Operation\"\x95\x01\xCAAJ\x0A\x15google.protobuf.Empty\x121google.cloud.networksecurity.v1.OperationMetadata\xDAA\x04name\x82\xD3\xE4\x93\x02;*9/v1/{name=organizations/*/locations/*/securityProfiles/*}\x1AR\xCAA\x1Enetworksecurity.googleapis.com\xD2A.https://www.googleapis.com/auth/cloud-platformB\x81\x02\x0A#com.google.cloud.networksecurity.v1B SecurityProfileGroupServiceProtoP\x01ZMcloud.google.com/go/networksecurity/apiv1/networksecuritypb;networksecuritypb\xAA\x02\x1FGoogle.Cloud.NetworkSecurity.V1\xCA\x02\x1FGoogle\\Cloud\\NetworkSecurity\\V1\xEA\x02\"Google::Cloud::NetworkSecurity::V1b\x06proto3" , true); static::$is_initialized = true; diff --git a/NetworkSecurity/metadata/V1/SseRealm.php b/NetworkSecurity/metadata/V1/SseRealm.php new file mode 100644 index 000000000000..3b7c931e1861 --- /dev/null +++ b/NetworkSecurity/metadata/V1/SseRealm.php @@ -0,0 +1,33 @@ +internalAddGeneratedFile( + "\x0A\xBB,\x0A/google/cloud/networksecurity/v1/sse_realm.proto\x12\x1Fgoogle.cloud.networksecurity.v1\x1A\x17google/api/client.proto\x1A\x1Fgoogle/api/field_behavior.proto\x1A\x1Bgoogle/api/field_info.proto\x1A\x19google/api/resource.proto\x1A,google/cloud/networksecurity/v1/common.proto\x1A#google/longrunning/operations.proto\x1A\x1Bgoogle/protobuf/empty.proto\x1A\x1Fgoogle/protobuf/timestamp.proto\"\x9B\x07\x0A\x08SACRealm\x12\x11\x0A\x04name\x18\x01 \x01(\x09B\x03\xE0A\x08\x124\x0A\x0Bcreate_time\x18\x02 \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x03\x124\x0A\x0Bupdate_time\x18\x03 \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x03\x12J\x0A\x06labels\x18\x04 \x03(\x0B25.google.cloud.networksecurity.v1.SACRealm.LabelsEntryB\x03\xE0A\x01\x12X\x0A\x10security_service\x18\x05 \x01(\x0E29.google.cloud.networksecurity.v1.SACRealm.SecurityServiceB\x03\xE0A\x05\x12N\x0A\x0Bpairing_key\x18\x06 \x01(\x0B24.google.cloud.networksecurity.v1.SACRealm.PairingKeyB\x03\xE0A\x03\x12C\x0A\x05state\x18\x07 \x01(\x0E2/.google.cloud.networksecurity.v1.SACRealm.StateB\x03\xE0A\x03\x1AT\x0A\x0APairingKey\x12\x10\x0A\x03key\x18\x01 \x01(\x09B\x03\xE0A\x03\x124\x0A\x0Bexpire_time\x18\x02 \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x03\x1A-\x0A\x0BLabelsEntry\x12\x0B\x0A\x03key\x18\x01 \x01(\x09\x12\x0D\x0A\x05value\x18\x02 \x01(\x09:\x028\x01\"P\x0A\x0FSecurityService\x12 \x0A\x1CSECURITY_SERVICE_UNSPECIFIED\x10\x00\x12\x1B\x0A\x17PALO_ALTO_PRISMA_ACCESS\x10\x01\"{\x0A\x05State\x12\x15\x0A\x11STATE_UNSPECIFIED\x10\x00\x12\x1E\x0A\x1APENDING_PARTNER_ATTACHMENT\x10\x07\x12\x14\x0A\x10PARTNER_ATTACHED\x10\x01\x12\x14\x0A\x10PARTNER_DETACHED\x10\x02\x12\x0F\x0A\x0BKEY_EXPIRED\x10\x03:\x80\x01\xEAA}\x0A'networksecurity.googleapis.com/SACRealm\x12=projects/{project}/locations/{location}/sacRealms/{sac_realm}*\x09sacRealms2\x08sacRealm\"\xB4\x01\x0A\x14ListSACRealmsRequest\x12?\x0A\x06parent\x18\x01 \x01(\x09B/\xE0A\x02\xFAA)\x12'networksecurity.googleapis.com/SACRealm\x12\x16\x0A\x09page_size\x18\x02 \x01(\x05B\x03\xE0A\x01\x12\x17\x0A\x0Apage_token\x18\x03 \x01(\x09B\x03\xE0A\x01\x12\x13\x0A\x06filter\x18\x04 \x01(\x09B\x03\xE0A\x01\x12\x15\x0A\x08order_by\x18\x05 \x01(\x09B\x03\xE0A\x01\"\x84\x01\x0A\x15ListSACRealmsResponse\x12=\x0A\x0Asac_realms\x18\x01 \x03(\x0B2).google.cloud.networksecurity.v1.SACRealm\x12\x17\x0A\x0Fnext_page_token\x18\x02 \x01(\x09\x12\x13\x0A\x0Bunreachable\x18\x03 \x03(\x09\"S\x0A\x12GetSACRealmRequest\x12=\x0A\x04name\x18\x01 \x01(\x09B/\xE0A\x02\xFAA)\x0A'networksecurity.googleapis.com/SACRealm\"\xD7\x01\x0A\x15CreateSACRealmRequest\x12?\x0A\x06parent\x18\x01 \x01(\x09B/\xE0A\x02\xFAA)\x12'networksecurity.googleapis.com/SACRealm\x12\x19\x0A\x0Csac_realm_id\x18\x02 \x01(\x09B\x03\xE0A\x02\x12A\x0A\x09sac_realm\x18\x03 \x01(\x0B2).google.cloud.networksecurity.v1.SACRealmB\x03\xE0A\x02\x12\x1F\x0A\x0Arequest_id\x18\x04 \x01(\x09B\x0B\xE0A\x01\xE2\x8C\xCF\xD7\x08\x02\x08\x01\"w\x0A\x15DeleteSACRealmRequest\x12=\x0A\x04name\x18\x01 \x01(\x09B/\xE0A\x02\xFAA)\x0A'networksecurity.googleapis.com/SACRealm\x12\x1F\x0A\x0Arequest_id\x18\x02 \x01(\x09B\x0B\xE0A\x01\xE2\x8C\xCF\xD7\x08\x02\x08\x01\"\x93\x05\x0A\x0DSACAttachment\x12\x11\x0A\x04name\x18\x01 \x01(\x09B\x03\xE0A\x08\x124\x0A\x0Bcreate_time\x18\x02 \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x03\x124\x0A\x0Bupdate_time\x18\x03 \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x03\x12O\x0A\x06labels\x18\x04 \x03(\x0B2:.google.cloud.networksecurity.v1.SACAttachment.LabelsEntryB\x03\xE0A\x01\x12\x16\x0A\x09sac_realm\x18\x05 \x01(\x09B\x03\xE0A\x02\x12\x18\x0A\x0Bncc_gateway\x18\x06 \x01(\x09B\x03\xE0A\x02\x12H\x0A\x05state\x18\x0A \x01(\x0E24.google.cloud.networksecurity.v1.SACAttachment.StateB\x03\xE0A\x03\x1A-\x0A\x0BLabelsEntry\x12\x0B\x0A\x03key\x18\x01 \x01(\x09\x12\x0D\x0A\x05value\x18\x02 \x01(\x09:\x028\x01\"j\x0A\x05State\x12\x15\x0A\x11STATE_UNSPECIFIED\x10\x00\x12\x1E\x0A\x1APENDING_PARTNER_ATTACHMENT\x10\x01\x12\x14\x0A\x10PARTNER_ATTACHED\x10\x02\x12\x14\x0A\x10PARTNER_DETACHED\x10\x03:\x9A\x01\xEAA\x96\x01\x0A,networksecurity.googleapis.com/SACAttachment\x12Gprojects/{project}/locations/{location}/sacAttachments/{sac_attachment}*\x0EsacAttachments2\x0DsacAttachment\"\xBE\x01\x0A\x19ListSACAttachmentsRequest\x12D\x0A\x06parent\x18\x01 \x01(\x09B4\xE0A\x02\xFAA.\x12,networksecurity.googleapis.com/SACAttachment\x12\x16\x0A\x09page_size\x18\x02 \x01(\x05B\x03\xE0A\x01\x12\x17\x0A\x0Apage_token\x18\x03 \x01(\x09B\x03\xE0A\x01\x12\x13\x0A\x06filter\x18\x04 \x01(\x09B\x03\xE0A\x01\x12\x15\x0A\x08order_by\x18\x05 \x01(\x09B\x03\xE0A\x01\"\x93\x01\x0A\x1AListSACAttachmentsResponse\x12G\x0A\x0Fsac_attachments\x18\x01 \x03(\x0B2..google.cloud.networksecurity.v1.SACAttachment\x12\x17\x0A\x0Fnext_page_token\x18\x02 \x01(\x09\x12\x13\x0A\x0Bunreachable\x18\x03 \x03(\x09\"]\x0A\x17GetSACAttachmentRequest\x12B\x0A\x04name\x18\x01 \x01(\x09B4\xE0A\x02\xFAA.\x0A,networksecurity.googleapis.com/SACAttachment\"\xF0\x01\x0A\x1ACreateSACAttachmentRequest\x12D\x0A\x06parent\x18\x01 \x01(\x09B4\xE0A\x02\xFAA.\x12,networksecurity.googleapis.com/SACAttachment\x12\x1E\x0A\x11sac_attachment_id\x18\x02 \x01(\x09B\x03\xE0A\x02\x12K\x0A\x0Esac_attachment\x18\x03 \x01(\x0B2..google.cloud.networksecurity.v1.SACAttachmentB\x03\xE0A\x02\x12\x1F\x0A\x0Arequest_id\x18\x04 \x01(\x09B\x0B\xE0A\x01\xE2\x8C\xCF\xD7\x08\x02\x08\x01\"\x81\x01\x0A\x1ADeleteSACAttachmentRequest\x12B\x0A\x04name\x18\x01 \x01(\x09B4\xE0A\x02\xFAA.\x0A,networksecurity.googleapis.com/SACAttachment\x12\x1F\x0A\x0Arequest_id\x18\x02 \x01(\x09B\x0B\xE0A\x01\xE2\x8C\xCF\xD7\x08\x02\x08\x012\xA3\x0F\x0A\x0FSSERealmService\x12\xBE\x01\x0A\x0DListSACRealms\x125.google.cloud.networksecurity.v1.ListSACRealmsRequest\x1A6.google.cloud.networksecurity.v1.ListSACRealmsResponse\">\xDAA\x06parent\x82\xD3\xE4\x93\x02/\x12-/v1/{parent=projects/*/locations/*}/sacRealms\x12\xAB\x01\x0A\x0BGetSACRealm\x123.google.cloud.networksecurity.v1.GetSACRealmRequest\x1A).google.cloud.networksecurity.v1.SACRealm\"<\xDAA\x04name\x82\xD3\xE4\x93\x02/\x12-/v1/{name=projects/*/locations/*/sacRealms/*}\x12\x8A\x02\x0A\x0ECreateSACRealm\x126.google.cloud.networksecurity.v1.CreateSACRealmRequest\x1A\x1D.google.longrunning.Operation\"\xA0\x01\xCAA=\x0A\x08SACRealm\x121google.cloud.networksecurity.v1.OperationMetadata\xDAA\x1Dparent,sac_realm,sac_realm_id\x82\xD3\xE4\x93\x02:\"-/v1/{parent=projects/*/locations/*}/sacRealms:\x09sac_realm\x12\xF3\x01\x0A\x0EDeleteSACRealm\x126.google.cloud.networksecurity.v1.DeleteSACRealmRequest\x1A\x1D.google.longrunning.Operation\"\x89\x01\xCAAJ\x0A\x15google.protobuf.Empty\x121google.cloud.networksecurity.v1.OperationMetadata\xDAA\x04name\x82\xD3\xE4\x93\x02/*-/v1/{name=projects/*/locations/*/sacRealms/*}\x12\xD2\x01\x0A\x12ListSACAttachments\x12:.google.cloud.networksecurity.v1.ListSACAttachmentsRequest\x1A;.google.cloud.networksecurity.v1.ListSACAttachmentsResponse\"C\xDAA\x06parent\x82\xD3\xE4\x93\x024\x122/v1/{parent=projects/*/locations/*}/sacAttachments\x12\xBF\x01\x0A\x10GetSACAttachment\x128.google.cloud.networksecurity.v1.GetSACAttachmentRequest\x1A..google.cloud.networksecurity.v1.SACAttachment\"A\xDAA\x04name\x82\xD3\xE4\x93\x024\x122/v1/{name=projects/*/locations/*/sacAttachments/*}\x12\xAD\x02\x0A\x13CreateSACAttachment\x12;.google.cloud.networksecurity.v1.CreateSACAttachmentRequest\x1A\x1D.google.longrunning.Operation\"\xB9\x01\xCAAB\x0A\x0DSACAttachment\x121google.cloud.networksecurity.v1.OperationMetadata\xDAA'parent,sac_attachment,sac_attachment_id\x82\xD3\xE4\x93\x02D\"2/v1/{parent=projects/*/locations/*}/sacAttachments:\x0Esac_attachment\x12\x82\x02\x0A\x13DeleteSACAttachment\x12;.google.cloud.networksecurity.v1.DeleteSACAttachmentRequest\x1A\x1D.google.longrunning.Operation\"\x8E\x01\xCAAJ\x0A\x15google.protobuf.Empty\x121google.cloud.networksecurity.v1.OperationMetadata\xDAA\x04name\x82\xD3\xE4\x93\x024*2/v1/{name=projects/*/locations/*/sacAttachments/*}\x1AR\xCAA\x1Enetworksecurity.googleapis.com\xD2A.https://www.googleapis.com/auth/cloud-platformB\xEE\x01\x0A#com.google.cloud.networksecurity.v1B\x0DSSERealmProtoP\x01ZMcloud.google.com/go/networksecurity/apiv1/networksecuritypb;networksecuritypb\xAA\x02\x1FGoogle.Cloud.NetworkSecurity.V1\xCA\x02\x1FGoogle\\Cloud\\NetworkSecurity\\V1\xEA\x02\"Google::Cloud::NetworkSecurity::V1b\x06proto3" + , true); + + static::$is_initialized = true; + } +} + diff --git a/NetworkSecurity/samples/V1/AddressGroupServiceClient/list_locations.php b/NetworkSecurity/samples/V1/AddressGroupServiceClient/list_locations.php index a9d2723da7a2..6f115ecfdae1 100644 --- a/NetworkSecurity/samples/V1/AddressGroupServiceClient/list_locations.php +++ b/NetworkSecurity/samples/V1/AddressGroupServiceClient/list_locations.php @@ -33,9 +33,8 @@ * Lists information about the supported locations for this service. This method lists locations based on the resource scope provided in -the [ListLocationsRequest.name] field: - -* **Global locations**: If `name` is empty, the method lists the +the [ListLocationsRequest.name][google.cloud.location.ListLocationsRequest.name] field: * +**Global locations**: If `name` is empty, the method lists the public locations available to all projects. * **Project-specific locations**: If `name` follows the format `projects/{project}`, the method lists locations visible to that diff --git a/NetworkSecurity/samples/V1/DnsThreatDetectorServiceClient/list_locations.php b/NetworkSecurity/samples/V1/DnsThreatDetectorServiceClient/list_locations.php index f170f60959f1..59cad0db5846 100644 --- a/NetworkSecurity/samples/V1/DnsThreatDetectorServiceClient/list_locations.php +++ b/NetworkSecurity/samples/V1/DnsThreatDetectorServiceClient/list_locations.php @@ -33,9 +33,8 @@ * Lists information about the supported locations for this service. This method lists locations based on the resource scope provided in -the [ListLocationsRequest.name] field: - -* **Global locations**: If `name` is empty, the method lists the +the [ListLocationsRequest.name][google.cloud.location.ListLocationsRequest.name] field: * +**Global locations**: If `name` is empty, the method lists the public locations available to all projects. * **Project-specific locations**: If `name` follows the format `projects/{project}`, the method lists locations visible to that diff --git a/NetworkSecurity/samples/V1/FirewallActivationClient/create_project_firewall_endpoint.php b/NetworkSecurity/samples/V1/FirewallActivationClient/create_project_firewall_endpoint.php new file mode 100644 index 000000000000..4ba8342744db --- /dev/null +++ b/NetworkSecurity/samples/V1/FirewallActivationClient/create_project_firewall_endpoint.php @@ -0,0 +1,95 @@ +setParent($formattedParent) + ->setFirewallEndpointId($firewallEndpointId) + ->setFirewallEndpoint($firewallEndpoint); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $firewallActivationClient->createProjectFirewallEndpoint($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var FirewallEndpoint $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 = FirewallActivationClient::organizationLocationName( + '[ORGANIZATION]', + '[LOCATION]' + ); + $firewallEndpointId = '[FIREWALL_ENDPOINT_ID]'; + + create_project_firewall_endpoint_sample($formattedParent, $firewallEndpointId); +} +// [END networksecurity_v1_generated_FirewallActivation_CreateProjectFirewallEndpoint_sync] diff --git a/NetworkSecurity/samples/V1/FirewallActivationClient/delete_project_firewall_endpoint.php b/NetworkSecurity/samples/V1/FirewallActivationClient/delete_project_firewall_endpoint.php new file mode 100644 index 000000000000..a6dab5b54f0f --- /dev/null +++ b/NetworkSecurity/samples/V1/FirewallActivationClient/delete_project_firewall_endpoint.php @@ -0,0 +1,84 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $firewallActivationClient->deleteProjectFirewallEndpoint($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 = FirewallActivationClient::firewallEndpointName( + '[ORGANIZATION]', + '[LOCATION]', + '[FIREWALL_ENDPOINT]' + ); + + delete_project_firewall_endpoint_sample($formattedName); +} +// [END networksecurity_v1_generated_FirewallActivation_DeleteProjectFirewallEndpoint_sync] diff --git a/NetworkSecurity/samples/V1/FirewallActivationClient/get_project_firewall_endpoint.php b/NetworkSecurity/samples/V1/FirewallActivationClient/get_project_firewall_endpoint.php new file mode 100644 index 000000000000..01ca0e3db3f4 --- /dev/null +++ b/NetworkSecurity/samples/V1/FirewallActivationClient/get_project_firewall_endpoint.php @@ -0,0 +1,75 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var FirewallEndpoint $response */ + $response = $firewallActivationClient->getProjectFirewallEndpoint($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 = FirewallActivationClient::firewallEndpointName( + '[ORGANIZATION]', + '[LOCATION]', + '[FIREWALL_ENDPOINT]' + ); + + get_project_firewall_endpoint_sample($formattedName); +} +// [END networksecurity_v1_generated_FirewallActivation_GetProjectFirewallEndpoint_sync] diff --git a/NetworkSecurity/samples/V1/FirewallActivationClient/list_locations.php b/NetworkSecurity/samples/V1/FirewallActivationClient/list_locations.php index 10e1f8e1ef47..d55599b2a9b5 100644 --- a/NetworkSecurity/samples/V1/FirewallActivationClient/list_locations.php +++ b/NetworkSecurity/samples/V1/FirewallActivationClient/list_locations.php @@ -33,9 +33,8 @@ * Lists information about the supported locations for this service. This method lists locations based on the resource scope provided in -the [ListLocationsRequest.name] field: - -* **Global locations**: If `name` is empty, the method lists the +the [ListLocationsRequest.name][google.cloud.location.ListLocationsRequest.name] field: * +**Global locations**: If `name` is empty, the method lists the public locations available to all projects. * **Project-specific locations**: If `name` follows the format `projects/{project}`, the method lists locations visible to that diff --git a/NetworkSecurity/samples/V1/FirewallActivationClient/list_project_firewall_endpoints.php b/NetworkSecurity/samples/V1/FirewallActivationClient/list_project_firewall_endpoints.php new file mode 100644 index 000000000000..050eecaa2266 --- /dev/null +++ b/NetworkSecurity/samples/V1/FirewallActivationClient/list_project_firewall_endpoints.php @@ -0,0 +1,79 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $firewallActivationClient->listProjectFirewallEndpoints($request); + + /** @var FirewallEndpoint $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 = FirewallActivationClient::organizationLocationName( + '[ORGANIZATION]', + '[LOCATION]' + ); + + list_project_firewall_endpoints_sample($formattedParent); +} +// [END networksecurity_v1_generated_FirewallActivation_ListProjectFirewallEndpoints_sync] diff --git a/NetworkSecurity/samples/V1/FirewallActivationClient/update_project_firewall_endpoint.php b/NetworkSecurity/samples/V1/FirewallActivationClient/update_project_firewall_endpoint.php new file mode 100644 index 000000000000..d93724f5ad69 --- /dev/null +++ b/NetworkSecurity/samples/V1/FirewallActivationClient/update_project_firewall_endpoint.php @@ -0,0 +1,74 @@ +setUpdateMask($updateMask) + ->setFirewallEndpoint($firewallEndpoint); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $firewallActivationClient->updateProjectFirewallEndpoint($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var FirewallEndpoint $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()); + } +} +// [END networksecurity_v1_generated_FirewallActivation_UpdateProjectFirewallEndpoint_sync] diff --git a/NetworkSecurity/samples/V1/InterceptClient/list_locations.php b/NetworkSecurity/samples/V1/InterceptClient/list_locations.php index 83a5bf31675b..27cb296c3664 100644 --- a/NetworkSecurity/samples/V1/InterceptClient/list_locations.php +++ b/NetworkSecurity/samples/V1/InterceptClient/list_locations.php @@ -33,9 +33,8 @@ * Lists information about the supported locations for this service. This method lists locations based on the resource scope provided in -the [ListLocationsRequest.name] field: - -* **Global locations**: If `name` is empty, the method lists the +the [ListLocationsRequest.name][google.cloud.location.ListLocationsRequest.name] field: * +**Global locations**: If `name` is empty, the method lists the public locations available to all projects. * **Project-specific locations**: If `name` follows the format `projects/{project}`, the method lists locations visible to that diff --git a/NetworkSecurity/samples/V1/MirroringClient/list_locations.php b/NetworkSecurity/samples/V1/MirroringClient/list_locations.php index cbc3100e74de..f8ce769e224f 100644 --- a/NetworkSecurity/samples/V1/MirroringClient/list_locations.php +++ b/NetworkSecurity/samples/V1/MirroringClient/list_locations.php @@ -33,9 +33,8 @@ * Lists information about the supported locations for this service. This method lists locations based on the resource scope provided in -the [ListLocationsRequest.name] field: - -* **Global locations**: If `name` is empty, the method lists the +the [ListLocationsRequest.name][google.cloud.location.ListLocationsRequest.name] field: * +**Global locations**: If `name` is empty, the method lists the public locations available to all projects. * **Project-specific locations**: If `name` follows the format `projects/{project}`, the method lists locations visible to that diff --git a/NetworkSecurity/samples/V1/NetworkSecurityClient/create_authz_policy.php b/NetworkSecurity/samples/V1/NetworkSecurityClient/create_authz_policy.php index 2e096c51c8f2..86760e390cce 100644 --- a/NetworkSecurity/samples/V1/NetworkSecurityClient/create_authz_policy.php +++ b/NetworkSecurity/samples/V1/NetworkSecurityClient/create_authz_policy.php @@ -42,8 +42,8 @@ * @param string $authzPolicyName Identifier. Name of the `AuthzPolicy` resource in the following * format: * `projects/{project}/locations/{location}/authzPolicies/{authz_policy}`. - * @param string $authzPolicyTargetResourcesElement A list of references to the Forwarding Rules on which this - * policy will be applied. + * @param string $authzPolicyTargetResourcesElement A list of references to the Forwarding Rules, Secure Web Proxy + * Gateways, or Agent Gateways on which this policy will be applied. * @param int $authzPolicyAction Can be one of `ALLOW`, `DENY`, `CUSTOM`. * * When the action is `CUSTOM`, `customProvider` must be specified. diff --git a/NetworkSecurity/samples/V1/NetworkSecurityClient/list_locations.php b/NetworkSecurity/samples/V1/NetworkSecurityClient/list_locations.php index 0ce4a0c29514..6503105de0b6 100644 --- a/NetworkSecurity/samples/V1/NetworkSecurityClient/list_locations.php +++ b/NetworkSecurity/samples/V1/NetworkSecurityClient/list_locations.php @@ -33,9 +33,8 @@ * Lists information about the supported locations for this service. This method lists locations based on the resource scope provided in -the [ListLocationsRequest.name] field: - -* **Global locations**: If `name` is empty, the method lists the +the [ListLocationsRequest.name][google.cloud.location.ListLocationsRequest.name] field: * +**Global locations**: If `name` is empty, the method lists the public locations available to all projects. * **Project-specific locations**: If `name` follows the format `projects/{project}`, the method lists locations visible to that diff --git a/NetworkSecurity/samples/V1/NetworkSecurityClient/update_authz_policy.php b/NetworkSecurity/samples/V1/NetworkSecurityClient/update_authz_policy.php index 03dc16842a38..7b9bb458a744 100644 --- a/NetworkSecurity/samples/V1/NetworkSecurityClient/update_authz_policy.php +++ b/NetworkSecurity/samples/V1/NetworkSecurityClient/update_authz_policy.php @@ -39,8 +39,8 @@ * @param string $authzPolicyName Identifier. Name of the `AuthzPolicy` resource in the following * format: * `projects/{project}/locations/{location}/authzPolicies/{authz_policy}`. - * @param string $authzPolicyTargetResourcesElement A list of references to the Forwarding Rules on which this - * policy will be applied. + * @param string $authzPolicyTargetResourcesElement A list of references to the Forwarding Rules, Secure Web Proxy + * Gateways, or Agent Gateways on which this policy will be applied. * @param int $authzPolicyAction Can be one of `ALLOW`, `DENY`, `CUSTOM`. * * When the action is `CUSTOM`, `customProvider` must be specified. diff --git a/NetworkSecurity/samples/V1/OrganizationAddressGroupServiceClient/list_locations.php b/NetworkSecurity/samples/V1/OrganizationAddressGroupServiceClient/list_locations.php index 51c0d23b6fda..1c4f54a055ad 100644 --- a/NetworkSecurity/samples/V1/OrganizationAddressGroupServiceClient/list_locations.php +++ b/NetworkSecurity/samples/V1/OrganizationAddressGroupServiceClient/list_locations.php @@ -33,9 +33,8 @@ * Lists information about the supported locations for this service. This method lists locations based on the resource scope provided in -the [ListLocationsRequest.name] field: - -* **Global locations**: If `name` is empty, the method lists the +the [ListLocationsRequest.name][google.cloud.location.ListLocationsRequest.name] field: * +**Global locations**: If `name` is empty, the method lists the public locations available to all projects. * **Project-specific locations**: If `name` follows the format `projects/{project}`, the method lists locations visible to that diff --git a/NetworkSecurity/samples/V1/OrganizationSecurityProfileGroupServiceClient/list_locations.php b/NetworkSecurity/samples/V1/OrganizationSecurityProfileGroupServiceClient/list_locations.php index adbfa01e0294..daf258f8c9e5 100644 --- a/NetworkSecurity/samples/V1/OrganizationSecurityProfileGroupServiceClient/list_locations.php +++ b/NetworkSecurity/samples/V1/OrganizationSecurityProfileGroupServiceClient/list_locations.php @@ -33,9 +33,8 @@ * Lists information about the supported locations for this service. This method lists locations based on the resource scope provided in -the [ListLocationsRequest.name] field: - -* **Global locations**: If `name` is empty, the method lists the +the [ListLocationsRequest.name][google.cloud.location.ListLocationsRequest.name] field: * +**Global locations**: If `name` is empty, the method lists the public locations available to all projects. * **Project-specific locations**: If `name` follows the format `projects/{project}`, the method lists locations visible to that diff --git a/NetworkSecurity/samples/V1/SSERealmServiceClient/create_sac_attachment.php b/NetworkSecurity/samples/V1/SSERealmServiceClient/create_sac_attachment.php new file mode 100644 index 000000000000..9184f418de53 --- /dev/null +++ b/NetworkSecurity/samples/V1/SSERealmServiceClient/create_sac_attachment.php @@ -0,0 +1,115 @@ +RFC1035. + * Specifically, it must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` + * which means the first character must be a lowercase letter, and all + * following characters must be a dash, lowercase letter, or digit, except + * the last character, which cannot be a dash. + * @param string $sacAttachmentSacRealm SAC Realm which owns the attachment. This can be input as an ID + * or a full resource name. The output always has the form + * `projects/{project_number}/locations/{location}/sacRealms/{sac_realm}`. + * @param string $sacAttachmentNccGateway NCC Gateway associated with the attachment. This can be input as + * an ID or a full resource name. The output always has the form + * `projects/{project_number}/locations/{location}/spokes/{ncc_gateway}`. + */ +function create_sac_attachment_sample( + string $formattedParent, + string $sacAttachmentId, + string $sacAttachmentSacRealm, + string $sacAttachmentNccGateway +): void { + // Create a client. + $sSERealmServiceClient = new SSERealmServiceClient(); + + // Prepare the request message. + $sacAttachment = (new SACAttachment()) + ->setSacRealm($sacAttachmentSacRealm) + ->setNccGateway($sacAttachmentNccGateway); + $request = (new CreateSACAttachmentRequest()) + ->setParent($formattedParent) + ->setSacAttachmentId($sacAttachmentId) + ->setSacAttachment($sacAttachment); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $sSERealmServiceClient->createSACAttachment($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var SACAttachment $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 = SSERealmServiceClient::locationName('[PROJECT]', '[LOCATION]'); + $sacAttachmentId = '[SAC_ATTACHMENT_ID]'; + $sacAttachmentSacRealm = '[SAC_REALM]'; + $sacAttachmentNccGateway = '[NCC_GATEWAY]'; + + create_sac_attachment_sample( + $formattedParent, + $sacAttachmentId, + $sacAttachmentSacRealm, + $sacAttachmentNccGateway + ); +} +// [END networksecurity_v1_generated_SSERealmService_CreateSACAttachment_sync] diff --git a/NetworkSecurity/samples/V1/SSERealmServiceClient/create_sac_realm.php b/NetworkSecurity/samples/V1/SSERealmServiceClient/create_sac_realm.php new file mode 100644 index 000000000000..9db747d731b6 --- /dev/null +++ b/NetworkSecurity/samples/V1/SSERealmServiceClient/create_sac_realm.php @@ -0,0 +1,95 @@ +RFC1035. + * Specifically, it must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` + * which means the first character must be a lowercase letter, and all + * following characters must be a dash, lowercase letter, or digit, except + * the last character, which cannot be a dash. + */ +function create_sac_realm_sample(string $formattedParent, string $sacRealmId): void +{ + // Create a client. + $sSERealmServiceClient = new SSERealmServiceClient(); + + // Prepare the request message. + $sacRealm = new SACRealm(); + $request = (new CreateSACRealmRequest()) + ->setParent($formattedParent) + ->setSacRealmId($sacRealmId) + ->setSacRealm($sacRealm); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $sSERealmServiceClient->createSACRealm($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var SACRealm $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 = SSERealmServiceClient::locationName('[PROJECT]', '[LOCATION]'); + $sacRealmId = '[SAC_REALM_ID]'; + + create_sac_realm_sample($formattedParent, $sacRealmId); +} +// [END networksecurity_v1_generated_SSERealmService_CreateSACRealm_sync] diff --git a/NetworkSecurity/samples/V1/SSERealmServiceClient/delete_sac_attachment.php b/NetworkSecurity/samples/V1/SSERealmServiceClient/delete_sac_attachment.php new file mode 100644 index 000000000000..925e1bbf2b1d --- /dev/null +++ b/NetworkSecurity/samples/V1/SSERealmServiceClient/delete_sac_attachment.php @@ -0,0 +1,85 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $sSERealmServiceClient->deleteSACAttachment($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 = SSERealmServiceClient::sACAttachmentName( + '[PROJECT]', + '[LOCATION]', + '[SAC_ATTACHMENT]' + ); + + delete_sac_attachment_sample($formattedName); +} +// [END networksecurity_v1_generated_SSERealmService_DeleteSACAttachment_sync] diff --git a/NetworkSecurity/samples/V1/SSERealmServiceClient/delete_sac_realm.php b/NetworkSecurity/samples/V1/SSERealmServiceClient/delete_sac_realm.php new file mode 100644 index 000000000000..9c638648d865 --- /dev/null +++ b/NetworkSecurity/samples/V1/SSERealmServiceClient/delete_sac_realm.php @@ -0,0 +1,81 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $sSERealmServiceClient->deleteSACRealm($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 = SSERealmServiceClient::sACRealmName('[PROJECT]', '[LOCATION]', '[SAC_REALM]'); + + delete_sac_realm_sample($formattedName); +} +// [END networksecurity_v1_generated_SSERealmService_DeleteSACRealm_sync] diff --git a/NetworkSecurity/samples/V1/SSERealmServiceClient/get_iam_policy.php b/NetworkSecurity/samples/V1/SSERealmServiceClient/get_iam_policy.php new file mode 100644 index 000000000000..be5f4a404113 --- /dev/null +++ b/NetworkSecurity/samples/V1/SSERealmServiceClient/get_iam_policy.php @@ -0,0 +1,72 @@ +setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $sSERealmServiceClient->getIamPolicy($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 +{ + $resource = '[RESOURCE]'; + + get_iam_policy_sample($resource); +} +// [END networksecurity_v1_generated_SSERealmService_GetIamPolicy_sync] diff --git a/NetworkSecurity/samples/V1/SSERealmServiceClient/get_location.php b/NetworkSecurity/samples/V1/SSERealmServiceClient/get_location.php new file mode 100644 index 000000000000..2600e113062b --- /dev/null +++ b/NetworkSecurity/samples/V1/SSERealmServiceClient/get_location.php @@ -0,0 +1,57 @@ +getLocation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END networksecurity_v1_generated_SSERealmService_GetLocation_sync] diff --git a/NetworkSecurity/samples/V1/SSERealmServiceClient/get_sac_attachment.php b/NetworkSecurity/samples/V1/SSERealmServiceClient/get_sac_attachment.php new file mode 100644 index 000000000000..acf779d6be23 --- /dev/null +++ b/NetworkSecurity/samples/V1/SSERealmServiceClient/get_sac_attachment.php @@ -0,0 +1,76 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var SACAttachment $response */ + $response = $sSERealmServiceClient->getSACAttachment($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 = SSERealmServiceClient::sACAttachmentName( + '[PROJECT]', + '[LOCATION]', + '[SAC_ATTACHMENT]' + ); + + get_sac_attachment_sample($formattedName); +} +// [END networksecurity_v1_generated_SSERealmService_GetSACAttachment_sync] diff --git a/NetworkSecurity/samples/V1/SSERealmServiceClient/get_sac_realm.php b/NetworkSecurity/samples/V1/SSERealmServiceClient/get_sac_realm.php new file mode 100644 index 000000000000..3daf9e731a10 --- /dev/null +++ b/NetworkSecurity/samples/V1/SSERealmServiceClient/get_sac_realm.php @@ -0,0 +1,72 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var SACRealm $response */ + $response = $sSERealmServiceClient->getSACRealm($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 = SSERealmServiceClient::sACRealmName('[PROJECT]', '[LOCATION]', '[SAC_REALM]'); + + get_sac_realm_sample($formattedName); +} +// [END networksecurity_v1_generated_SSERealmService_GetSACRealm_sync] diff --git a/NetworkSecurity/samples/V1/SSERealmServiceClient/list_locations.php b/NetworkSecurity/samples/V1/SSERealmServiceClient/list_locations.php new file mode 100644 index 000000000000..abb36c88980a --- /dev/null +++ b/NetworkSecurity/samples/V1/SSERealmServiceClient/list_locations.php @@ -0,0 +1,77 @@ +listLocations($request); + + /** @var Location $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()); + } +} +// [END networksecurity_v1_generated_SSERealmService_ListLocations_sync] diff --git a/NetworkSecurity/samples/V1/SSERealmServiceClient/list_sac_attachments.php b/NetworkSecurity/samples/V1/SSERealmServiceClient/list_sac_attachments.php new file mode 100644 index 000000000000..7d19994b892d --- /dev/null +++ b/NetworkSecurity/samples/V1/SSERealmServiceClient/list_sac_attachments.php @@ -0,0 +1,77 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $sSERealmServiceClient->listSACAttachments($request); + + /** @var SACAttachment $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 = SSERealmServiceClient::locationName('[PROJECT]', '[LOCATION]'); + + list_sac_attachments_sample($formattedParent); +} +// [END networksecurity_v1_generated_SSERealmService_ListSACAttachments_sync] diff --git a/NetworkSecurity/samples/V1/SSERealmServiceClient/list_sac_realms.php b/NetworkSecurity/samples/V1/SSERealmServiceClient/list_sac_realms.php new file mode 100644 index 000000000000..7344271dc570 --- /dev/null +++ b/NetworkSecurity/samples/V1/SSERealmServiceClient/list_sac_realms.php @@ -0,0 +1,76 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $sSERealmServiceClient->listSACRealms($request); + + /** @var SACRealm $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 = SSERealmServiceClient::locationName('[PROJECT]', '[LOCATION]'); + + list_sac_realms_sample($formattedParent); +} +// [END networksecurity_v1_generated_SSERealmService_ListSACRealms_sync] diff --git a/NetworkSecurity/samples/V1/SSERealmServiceClient/set_iam_policy.php b/NetworkSecurity/samples/V1/SSERealmServiceClient/set_iam_policy.php new file mode 100644 index 000000000000..3d1d2a8e3d6c --- /dev/null +++ b/NetworkSecurity/samples/V1/SSERealmServiceClient/set_iam_policy.php @@ -0,0 +1,77 @@ +setResource($resource) + ->setPolicy($policy); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $sSERealmServiceClient->setIamPolicy($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 +{ + $resource = '[RESOURCE]'; + + set_iam_policy_sample($resource); +} +// [END networksecurity_v1_generated_SSERealmService_SetIamPolicy_sync] diff --git a/NetworkSecurity/samples/V1/SSERealmServiceClient/test_iam_permissions.php b/NetworkSecurity/samples/V1/SSERealmServiceClient/test_iam_permissions.php new file mode 100644 index 000000000000..187d5bb41188 --- /dev/null +++ b/NetworkSecurity/samples/V1/SSERealmServiceClient/test_iam_permissions.php @@ -0,0 +1,84 @@ +setResource($resource) + ->setPermissions($permissions); + + // Call the API and handle any network failures. + try { + /** @var TestIamPermissionsResponse $response */ + $response = $sSERealmServiceClient->testIamPermissions($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 +{ + $resource = '[RESOURCE]'; + $permissionsElement = '[PERMISSIONS]'; + + test_iam_permissions_sample($resource, $permissionsElement); +} +// [END networksecurity_v1_generated_SSERealmService_TestIamPermissions_sync] diff --git a/NetworkSecurity/samples/V1/SecurityProfileGroupServiceClient/create_security_profile.php b/NetworkSecurity/samples/V1/SecurityProfileGroupServiceClient/create_security_profile.php new file mode 100644 index 000000000000..bf014001ec63 --- /dev/null +++ b/NetworkSecurity/samples/V1/SecurityProfileGroupServiceClient/create_security_profile.php @@ -0,0 +1,95 @@ +setParent($formattedParent) + ->setSecurityProfileId($securityProfileId) + ->setSecurityProfile($securityProfile); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $securityProfileGroupServiceClient->createSecurityProfile($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var SecurityProfile $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 = SecurityProfileGroupServiceClient::organizationLocationName( + '[ORGANIZATION]', + '[LOCATION]' + ); + $securityProfileId = '[SECURITY_PROFILE_ID]'; + + create_security_profile_sample($formattedParent, $securityProfileId); +} +// [END networksecurity_v1_generated_SecurityProfileGroupService_CreateSecurityProfile_sync] diff --git a/NetworkSecurity/samples/V1/SecurityProfileGroupServiceClient/create_security_profile_group.php b/NetworkSecurity/samples/V1/SecurityProfileGroupServiceClient/create_security_profile_group.php new file mode 100644 index 000000000000..ec732f305c57 --- /dev/null +++ b/NetworkSecurity/samples/V1/SecurityProfileGroupServiceClient/create_security_profile_group.php @@ -0,0 +1,97 @@ +setParent($formattedParent) + ->setSecurityProfileGroupId($securityProfileGroupId) + ->setSecurityProfileGroup($securityProfileGroup); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $securityProfileGroupServiceClient->createSecurityProfileGroup($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var SecurityProfileGroup $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 = SecurityProfileGroupServiceClient::organizationLocationName( + '[ORGANIZATION]', + '[LOCATION]' + ); + $securityProfileGroupId = '[SECURITY_PROFILE_GROUP_ID]'; + + create_security_profile_group_sample($formattedParent, $securityProfileGroupId); +} +// [END networksecurity_v1_generated_SecurityProfileGroupService_CreateSecurityProfileGroup_sync] diff --git a/NetworkSecurity/samples/V1/SecurityProfileGroupServiceClient/delete_security_profile.php b/NetworkSecurity/samples/V1/SecurityProfileGroupServiceClient/delete_security_profile.php new file mode 100644 index 000000000000..8d1dbffa6322 --- /dev/null +++ b/NetworkSecurity/samples/V1/SecurityProfileGroupServiceClient/delete_security_profile.php @@ -0,0 +1,85 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $securityProfileGroupServiceClient->deleteSecurityProfile($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 = SecurityProfileGroupServiceClient::securityProfileName( + '[ORGANIZATION]', + '[LOCATION]', + '[SECURITY_PROFILE]' + ); + + delete_security_profile_sample($formattedName); +} +// [END networksecurity_v1_generated_SecurityProfileGroupService_DeleteSecurityProfile_sync] diff --git a/NetworkSecurity/samples/V1/SecurityProfileGroupServiceClient/delete_security_profile_group.php b/NetworkSecurity/samples/V1/SecurityProfileGroupServiceClient/delete_security_profile_group.php new file mode 100644 index 000000000000..8fa50898cf8c --- /dev/null +++ b/NetworkSecurity/samples/V1/SecurityProfileGroupServiceClient/delete_security_profile_group.php @@ -0,0 +1,86 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $securityProfileGroupServiceClient->deleteSecurityProfileGroup($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 = SecurityProfileGroupServiceClient::securityProfileGroupName( + '[ORGANIZATION]', + '[LOCATION]', + '[SECURITY_PROFILE_GROUP]' + ); + + delete_security_profile_group_sample($formattedName); +} +// [END networksecurity_v1_generated_SecurityProfileGroupService_DeleteSecurityProfileGroup_sync] diff --git a/NetworkSecurity/samples/V1/SecurityProfileGroupServiceClient/get_iam_policy.php b/NetworkSecurity/samples/V1/SecurityProfileGroupServiceClient/get_iam_policy.php new file mode 100644 index 000000000000..0d257b0ea33a --- /dev/null +++ b/NetworkSecurity/samples/V1/SecurityProfileGroupServiceClient/get_iam_policy.php @@ -0,0 +1,72 @@ +setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $securityProfileGroupServiceClient->getIamPolicy($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 +{ + $resource = '[RESOURCE]'; + + get_iam_policy_sample($resource); +} +// [END networksecurity_v1_generated_SecurityProfileGroupService_GetIamPolicy_sync] diff --git a/NetworkSecurity/samples/V1/SecurityProfileGroupServiceClient/get_location.php b/NetworkSecurity/samples/V1/SecurityProfileGroupServiceClient/get_location.php new file mode 100644 index 000000000000..e9d63d16a190 --- /dev/null +++ b/NetworkSecurity/samples/V1/SecurityProfileGroupServiceClient/get_location.php @@ -0,0 +1,57 @@ +getLocation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END networksecurity_v1_generated_SecurityProfileGroupService_GetLocation_sync] diff --git a/NetworkSecurity/samples/V1/SecurityProfileGroupServiceClient/get_security_profile.php b/NetworkSecurity/samples/V1/SecurityProfileGroupServiceClient/get_security_profile.php new file mode 100644 index 000000000000..600b4e310625 --- /dev/null +++ b/NetworkSecurity/samples/V1/SecurityProfileGroupServiceClient/get_security_profile.php @@ -0,0 +1,76 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var SecurityProfile $response */ + $response = $securityProfileGroupServiceClient->getSecurityProfile($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 = SecurityProfileGroupServiceClient::securityProfileName( + '[ORGANIZATION]', + '[LOCATION]', + '[SECURITY_PROFILE]' + ); + + get_security_profile_sample($formattedName); +} +// [END networksecurity_v1_generated_SecurityProfileGroupService_GetSecurityProfile_sync] diff --git a/NetworkSecurity/samples/V1/SecurityProfileGroupServiceClient/get_security_profile_group.php b/NetworkSecurity/samples/V1/SecurityProfileGroupServiceClient/get_security_profile_group.php new file mode 100644 index 000000000000..78aabe6a741d --- /dev/null +++ b/NetworkSecurity/samples/V1/SecurityProfileGroupServiceClient/get_security_profile_group.php @@ -0,0 +1,76 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var SecurityProfileGroup $response */ + $response = $securityProfileGroupServiceClient->getSecurityProfileGroup($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 = SecurityProfileGroupServiceClient::securityProfileGroupName( + '[ORGANIZATION]', + '[LOCATION]', + '[SECURITY_PROFILE_GROUP]' + ); + + get_security_profile_group_sample($formattedName); +} +// [END networksecurity_v1_generated_SecurityProfileGroupService_GetSecurityProfileGroup_sync] diff --git a/NetworkSecurity/samples/V1/SecurityProfileGroupServiceClient/list_locations.php b/NetworkSecurity/samples/V1/SecurityProfileGroupServiceClient/list_locations.php new file mode 100644 index 000000000000..e1611f83c96d --- /dev/null +++ b/NetworkSecurity/samples/V1/SecurityProfileGroupServiceClient/list_locations.php @@ -0,0 +1,77 @@ +listLocations($request); + + /** @var Location $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()); + } +} +// [END networksecurity_v1_generated_SecurityProfileGroupService_ListLocations_sync] diff --git a/NetworkSecurity/samples/V1/SecurityProfileGroupServiceClient/list_security_profile_groups.php b/NetworkSecurity/samples/V1/SecurityProfileGroupServiceClient/list_security_profile_groups.php new file mode 100644 index 000000000000..6cd8dcb28e5a --- /dev/null +++ b/NetworkSecurity/samples/V1/SecurityProfileGroupServiceClient/list_security_profile_groups.php @@ -0,0 +1,81 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $securityProfileGroupServiceClient->listSecurityProfileGroups($request); + + /** @var SecurityProfileGroup $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 = SecurityProfileGroupServiceClient::organizationLocationName( + '[ORGANIZATION]', + '[LOCATION]' + ); + + list_security_profile_groups_sample($formattedParent); +} +// [END networksecurity_v1_generated_SecurityProfileGroupService_ListSecurityProfileGroups_sync] diff --git a/NetworkSecurity/samples/V1/SecurityProfileGroupServiceClient/list_security_profiles.php b/NetworkSecurity/samples/V1/SecurityProfileGroupServiceClient/list_security_profiles.php new file mode 100644 index 000000000000..638860924cba --- /dev/null +++ b/NetworkSecurity/samples/V1/SecurityProfileGroupServiceClient/list_security_profiles.php @@ -0,0 +1,81 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $securityProfileGroupServiceClient->listSecurityProfiles($request); + + /** @var SecurityProfile $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 = SecurityProfileGroupServiceClient::organizationLocationName( + '[ORGANIZATION]', + '[LOCATION]' + ); + + list_security_profiles_sample($formattedParent); +} +// [END networksecurity_v1_generated_SecurityProfileGroupService_ListSecurityProfiles_sync] diff --git a/NetworkSecurity/samples/V1/SecurityProfileGroupServiceClient/set_iam_policy.php b/NetworkSecurity/samples/V1/SecurityProfileGroupServiceClient/set_iam_policy.php new file mode 100644 index 000000000000..d58dde247889 --- /dev/null +++ b/NetworkSecurity/samples/V1/SecurityProfileGroupServiceClient/set_iam_policy.php @@ -0,0 +1,77 @@ +setResource($resource) + ->setPolicy($policy); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $securityProfileGroupServiceClient->setIamPolicy($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 +{ + $resource = '[RESOURCE]'; + + set_iam_policy_sample($resource); +} +// [END networksecurity_v1_generated_SecurityProfileGroupService_SetIamPolicy_sync] diff --git a/NetworkSecurity/samples/V1/SecurityProfileGroupServiceClient/test_iam_permissions.php b/NetworkSecurity/samples/V1/SecurityProfileGroupServiceClient/test_iam_permissions.php new file mode 100644 index 000000000000..1a44a2b2252a --- /dev/null +++ b/NetworkSecurity/samples/V1/SecurityProfileGroupServiceClient/test_iam_permissions.php @@ -0,0 +1,84 @@ +setResource($resource) + ->setPermissions($permissions); + + // Call the API and handle any network failures. + try { + /** @var TestIamPermissionsResponse $response */ + $response = $securityProfileGroupServiceClient->testIamPermissions($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 +{ + $resource = '[RESOURCE]'; + $permissionsElement = '[PERMISSIONS]'; + + test_iam_permissions_sample($resource, $permissionsElement); +} +// [END networksecurity_v1_generated_SecurityProfileGroupService_TestIamPermissions_sync] diff --git a/NetworkSecurity/samples/V1/SecurityProfileGroupServiceClient/update_security_profile.php b/NetworkSecurity/samples/V1/SecurityProfileGroupServiceClient/update_security_profile.php new file mode 100644 index 000000000000..63ed02065d16 --- /dev/null +++ b/NetworkSecurity/samples/V1/SecurityProfileGroupServiceClient/update_security_profile.php @@ -0,0 +1,74 @@ +setUpdateMask($updateMask) + ->setSecurityProfile($securityProfile); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $securityProfileGroupServiceClient->updateSecurityProfile($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var SecurityProfile $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()); + } +} +// [END networksecurity_v1_generated_SecurityProfileGroupService_UpdateSecurityProfile_sync] diff --git a/NetworkSecurity/samples/V1/SecurityProfileGroupServiceClient/update_security_profile_group.php b/NetworkSecurity/samples/V1/SecurityProfileGroupServiceClient/update_security_profile_group.php new file mode 100644 index 000000000000..7b1a985bef27 --- /dev/null +++ b/NetworkSecurity/samples/V1/SecurityProfileGroupServiceClient/update_security_profile_group.php @@ -0,0 +1,74 @@ +setUpdateMask($updateMask) + ->setSecurityProfileGroup($securityProfileGroup); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $securityProfileGroupServiceClient->updateSecurityProfileGroup($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var SecurityProfileGroup $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()); + } +} +// [END networksecurity_v1_generated_SecurityProfileGroupService_UpdateSecurityProfileGroup_sync] diff --git a/NetworkSecurity/src/V1/AuthzPolicy.php b/NetworkSecurity/src/V1/AuthzPolicy.php index 6b1cfb7f80c6..bf3e2ca732c8 100644 --- a/NetworkSecurity/src/V1/AuthzPolicy.php +++ b/NetworkSecurity/src/V1/AuthzPolicy.php @@ -67,6 +67,17 @@ class AuthzPolicy extends \Google\Protobuf\Internal\Message * Generated from protobuf field repeated .google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule http_rules = 7 [(.google.api.field_behavior) = OPTIONAL]; */ private $http_rules; + /** + * Optional. A list of authorization network rules to match against the + * incoming request. A policy match occurs when at least one network rule + * matches the request. + * At least one network rule is required for Allow or Deny Action if no HTTP + * rules are provided. Network rules are mutually exclusive with HTTP rules. + * Limited to 5 rules. + * + * Generated from protobuf field repeated .google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule network_rules = 12 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $network_rules; /** * Required. Can be one of `ALLOW`, `DENY`, `CUSTOM`. * When the action is `CUSTOM`, `customProvider` must be specified. @@ -134,6 +145,13 @@ class AuthzPolicy extends \Google\Protobuf\Internal\Message * request or when no HTTP rules are specified in the policy. * At least one HTTP Rule is required for Allow or Deny Action. Limited * to 5 rules. + * @type \Google\Cloud\NetworkSecurity\V1\AuthzPolicy\AuthzRule[] $network_rules + * Optional. A list of authorization network rules to match against the + * incoming request. A policy match occurs when at least one network rule + * matches the request. + * At least one network rule is required for Allow or Deny Action if no HTTP + * rules are provided. Network rules are mutually exclusive with HTTP rules. + * Limited to 5 rules. * @type int $action * Required. Can be one of `ALLOW`, `DENY`, `CUSTOM`. * When the action is `CUSTOM`, `customProvider` must be specified. @@ -396,6 +414,42 @@ public function setHttpRules($var) return $this; } + /** + * Optional. A list of authorization network rules to match against the + * incoming request. A policy match occurs when at least one network rule + * matches the request. + * At least one network rule is required for Allow or Deny Action if no HTTP + * rules are provided. Network rules are mutually exclusive with HTTP rules. + * Limited to 5 rules. + * + * Generated from protobuf field repeated .google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule network_rules = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField<\Google\Cloud\NetworkSecurity\V1\AuthzPolicy\AuthzRule> + */ + public function getNetworkRules() + { + return $this->network_rules; + } + + /** + * Optional. A list of authorization network rules to match against the + * incoming request. A policy match occurs when at least one network rule + * matches the request. + * At least one network rule is required for Allow or Deny Action if no HTTP + * rules are provided. Network rules are mutually exclusive with HTTP rules. + * Limited to 5 rules. + * + * Generated from protobuf field repeated .google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule network_rules = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\NetworkSecurity\V1\AuthzPolicy\AuthzRule[] $var + * @return $this + */ + public function setNetworkRules($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\NetworkSecurity\V1\AuthzPolicy\AuthzRule::class); + $this->network_rules = $arr; + + return $this; + } + /** * Required. Can be one of `ALLOW`, `DENY`, `CUSTOM`. * When the action is `CUSTOM`, `customProvider` must be specified. diff --git a/NetworkSecurity/src/V1/AuthzPolicy/AuthzRule/To/RequestOperation.php b/NetworkSecurity/src/V1/AuthzPolicy/AuthzRule/To/RequestOperation.php index 620d529b7ac4..9cb25bebd987 100644 --- a/NetworkSecurity/src/V1/AuthzPolicy/AuthzRule/To/RequestOperation.php +++ b/NetworkSecurity/src/V1/AuthzPolicy/AuthzRule/To/RequestOperation.php @@ -60,6 +60,16 @@ class RequestOperation extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCP mcp = 5 [(.google.api.field_behavior) = OPTIONAL]; */ protected $mcp = null; + /** + * Optional. A list of SNIs to match against. The match can be one of + * exact, prefix, suffix, or contains (substring match). If there is no + * SNI (i.e. plaintext HTTP traffic), the request will be denied. + * Matches are always case sensitive unless the ignoreCase is set. + * Limited to 10 SNIs per Authorization Policy. + * + * Generated from protobuf field repeated .google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatch snis = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $snis; /** * Constructor. @@ -92,6 +102,12 @@ class RequestOperation extends \Google\Protobuf\Internal\Message * payload in the request body cannot be successfully parsed, the * request will be denied. This field can be set only for AuthzPolicies * targeting AgentGateway resources. + * @type \Google\Cloud\NetworkSecurity\V1\AuthzPolicy\AuthzRule\StringMatch[] $snis + * Optional. A list of SNIs to match against. The match can be one of + * exact, prefix, suffix, or contains (substring match). If there is no + * SNI (i.e. plaintext HTTP traffic), the request will be denied. + * Matches are always case sensitive unless the ignoreCase is set. + * Limited to 10 SNIs per Authorization Policy. * } */ public function __construct($data = NULL) { @@ -279,5 +295,39 @@ public function setMcp($var) return $this; } + /** + * Optional. A list of SNIs to match against. The match can be one of + * exact, prefix, suffix, or contains (substring match). If there is no + * SNI (i.e. plaintext HTTP traffic), the request will be denied. + * Matches are always case sensitive unless the ignoreCase is set. + * Limited to 10 SNIs per Authorization Policy. + * + * Generated from protobuf field repeated .google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatch snis = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return RepeatedField<\Google\Cloud\NetworkSecurity\V1\AuthzPolicy\AuthzRule\StringMatch> + */ + public function getSnis() + { + return $this->snis; + } + + /** + * Optional. A list of SNIs to match against. The match can be one of + * exact, prefix, suffix, or contains (substring match). If there is no + * SNI (i.e. plaintext HTTP traffic), the request will be denied. + * Matches are always case sensitive unless the ignoreCase is set. + * Limited to 10 SNIs per Authorization Policy. + * + * Generated from protobuf field repeated .google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatch snis = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\NetworkSecurity\V1\AuthzPolicy\AuthzRule\StringMatch[] $var + * @return $this + */ + public function setSnis($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\NetworkSecurity\V1\AuthzPolicy\AuthzRule\StringMatch::class); + $this->snis = $arr; + + return $this; + } + } diff --git a/NetworkSecurity/src/V1/AuthzPolicy/Target.php b/NetworkSecurity/src/V1/AuthzPolicy/Target.php index e4cd58f11555..226b1c9a5594 100644 --- a/NetworkSecurity/src/V1/AuthzPolicy/Target.php +++ b/NetworkSecurity/src/V1/AuthzPolicy/Target.php @@ -17,7 +17,10 @@ class Target extends \Google\Protobuf\Internal\Message { /** * Optional. All gateways and forwarding rules referenced by this policy and - * extensions must share the same load balancing scheme. Supported values: + * extensions must share the same load balancing scheme. Required only when + * targeting forwarding rules. If targeting Secure Web Proxy, this field + * must be `INTERNAL_MANAGED` or not specified. Must not be specified + * when targeting Agent Gateway. Supported values: * `INTERNAL_MANAGED` and `EXTERNAL_MANAGED`. For more information, refer * to [Backend services * overview](https://cloud.google.com/load-balancing/docs/backend-service). @@ -26,8 +29,8 @@ class Target extends \Google\Protobuf\Internal\Message */ protected $load_balancing_scheme = 0; /** - * Required. A list of references to the Forwarding Rules on which this - * policy will be applied. + * Required. A list of references to the Forwarding Rules, Secure Web Proxy + * Gateways, or Agent Gateways on which this policy will be applied. * * Generated from protobuf field repeated string resources = 1 [(.google.api.field_behavior) = REQUIRED]; */ @@ -41,13 +44,16 @@ class Target extends \Google\Protobuf\Internal\Message * * @type int $load_balancing_scheme * Optional. All gateways and forwarding rules referenced by this policy and - * extensions must share the same load balancing scheme. Supported values: + * extensions must share the same load balancing scheme. Required only when + * targeting forwarding rules. If targeting Secure Web Proxy, this field + * must be `INTERNAL_MANAGED` or not specified. Must not be specified + * when targeting Agent Gateway. Supported values: * `INTERNAL_MANAGED` and `EXTERNAL_MANAGED`. For more information, refer * to [Backend services * overview](https://cloud.google.com/load-balancing/docs/backend-service). * @type string[] $resources - * Required. A list of references to the Forwarding Rules on which this - * policy will be applied. + * Required. A list of references to the Forwarding Rules, Secure Web Proxy + * Gateways, or Agent Gateways on which this policy will be applied. * } */ public function __construct($data = NULL) { @@ -57,7 +63,10 @@ public function __construct($data = NULL) { /** * Optional. All gateways and forwarding rules referenced by this policy and - * extensions must share the same load balancing scheme. Supported values: + * extensions must share the same load balancing scheme. Required only when + * targeting forwarding rules. If targeting Secure Web Proxy, this field + * must be `INTERNAL_MANAGED` or not specified. Must not be specified + * when targeting Agent Gateway. Supported values: * `INTERNAL_MANAGED` and `EXTERNAL_MANAGED`. For more information, refer * to [Backend services * overview](https://cloud.google.com/load-balancing/docs/backend-service). @@ -72,7 +81,10 @@ public function getLoadBalancingScheme() /** * Optional. All gateways and forwarding rules referenced by this policy and - * extensions must share the same load balancing scheme. Supported values: + * extensions must share the same load balancing scheme. Required only when + * targeting forwarding rules. If targeting Secure Web Proxy, this field + * must be `INTERNAL_MANAGED` or not specified. Must not be specified + * when targeting Agent Gateway. Supported values: * `INTERNAL_MANAGED` and `EXTERNAL_MANAGED`. For more information, refer * to [Backend services * overview](https://cloud.google.com/load-balancing/docs/backend-service). @@ -90,8 +102,8 @@ public function setLoadBalancingScheme($var) } /** - * Required. A list of references to the Forwarding Rules on which this - * policy will be applied. + * Required. A list of references to the Forwarding Rules, Secure Web Proxy + * Gateways, or Agent Gateways on which this policy will be applied. * * Generated from protobuf field repeated string resources = 1 [(.google.api.field_behavior) = REQUIRED]; * @return RepeatedField @@ -102,8 +114,8 @@ public function getResources() } /** - * Required. A list of references to the Forwarding Rules on which this - * policy will be applied. + * Required. A list of references to the Forwarding Rules, Secure Web Proxy + * Gateways, or Agent Gateways on which this policy will be applied. * * Generated from protobuf field repeated string resources = 1 [(.google.api.field_behavior) = REQUIRED]; * @param string[] $var diff --git a/NetworkSecurity/src/V1/Client/AddressGroupServiceClient.php b/NetworkSecurity/src/V1/Client/AddressGroupServiceClient.php index 2970138c021f..e0c2814130e3 100644 --- a/NetworkSecurity/src/V1/Client/AddressGroupServiceClient.php +++ b/NetworkSecurity/src/V1/Client/AddressGroupServiceClient.php @@ -673,9 +673,8 @@ public function getLocation(GetLocationRequest $request, array $callOptions = [] * Lists information about the supported locations for this service. This method lists locations based on the resource scope provided in - the [ListLocationsRequest.name] field: - - * **Global locations**: If `name` is empty, the method lists the + the [ListLocationsRequest.name][google.cloud.location.ListLocationsRequest.name] field: * + **Global locations**: If `name` is empty, the method lists the public locations available to all projects. * **Project-specific locations**: If `name` follows the format `projects/{project}`, the method lists locations visible to that diff --git a/NetworkSecurity/src/V1/Client/DnsThreatDetectorServiceClient.php b/NetworkSecurity/src/V1/Client/DnsThreatDetectorServiceClient.php index b131aab53609..d7e6ba1e1dc1 100644 --- a/NetworkSecurity/src/V1/Client/DnsThreatDetectorServiceClient.php +++ b/NetworkSecurity/src/V1/Client/DnsThreatDetectorServiceClient.php @@ -455,9 +455,8 @@ public function getLocation(GetLocationRequest $request, array $callOptions = [] * Lists information about the supported locations for this service. This method lists locations based on the resource scope provided in - the [ListLocationsRequest.name] field: - - * **Global locations**: If `name` is empty, the method lists the + the [ListLocationsRequest.name][google.cloud.location.ListLocationsRequest.name] field: * + **Global locations**: If `name` is empty, the method lists the public locations available to all projects. * **Project-specific locations**: If `name` follows the format `projects/{project}`, the method lists locations visible to that diff --git a/NetworkSecurity/src/V1/Client/FirewallActivationClient.php b/NetworkSecurity/src/V1/Client/FirewallActivationClient.php index 5ec09e419473..ac8a95747e04 100644 --- a/NetworkSecurity/src/V1/Client/FirewallActivationClient.php +++ b/NetworkSecurity/src/V1/Client/FirewallActivationClient.php @@ -73,14 +73,19 @@ * * @method PromiseInterface createFirewallEndpointAsync(CreateFirewallEndpointRequest $request, array $optionalArgs = []) * @method PromiseInterface createFirewallEndpointAssociationAsync(CreateFirewallEndpointAssociationRequest $request, array $optionalArgs = []) + * @method PromiseInterface createProjectFirewallEndpointAsync(CreateFirewallEndpointRequest $request, array $optionalArgs = []) * @method PromiseInterface deleteFirewallEndpointAsync(DeleteFirewallEndpointRequest $request, array $optionalArgs = []) * @method PromiseInterface deleteFirewallEndpointAssociationAsync(DeleteFirewallEndpointAssociationRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteProjectFirewallEndpointAsync(DeleteFirewallEndpointRequest $request, array $optionalArgs = []) * @method PromiseInterface getFirewallEndpointAsync(GetFirewallEndpointRequest $request, array $optionalArgs = []) * @method PromiseInterface getFirewallEndpointAssociationAsync(GetFirewallEndpointAssociationRequest $request, array $optionalArgs = []) + * @method PromiseInterface getProjectFirewallEndpointAsync(GetFirewallEndpointRequest $request, array $optionalArgs = []) * @method PromiseInterface listFirewallEndpointAssociationsAsync(ListFirewallEndpointAssociationsRequest $request, array $optionalArgs = []) * @method PromiseInterface listFirewallEndpointsAsync(ListFirewallEndpointsRequest $request, array $optionalArgs = []) + * @method PromiseInterface listProjectFirewallEndpointsAsync(ListFirewallEndpointsRequest $request, array $optionalArgs = []) * @method PromiseInterface updateFirewallEndpointAsync(UpdateFirewallEndpointRequest $request, array $optionalArgs = []) * @method PromiseInterface updateFirewallEndpointAssociationAsync(UpdateFirewallEndpointAssociationRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateProjectFirewallEndpointAsync(UpdateFirewallEndpointRequest $request, array $optionalArgs = []) * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) * @method PromiseInterface listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = []) * @method PromiseInterface getIamPolicyAsync(GetIamPolicyRequest $request, array $optionalArgs = []) @@ -519,6 +524,35 @@ public function createFirewallEndpointAssociation( return $this->startApiCall('CreateFirewallEndpointAssociation', $request, $callOptions)->wait(); } + /** + * Creates a new FirewallEndpoint in a given project and location. + * + * The async variant is + * {@see FirewallActivationClient::createProjectFirewallEndpointAsync()} . + * + * @example samples/V1/FirewallActivationClient/create_project_firewall_endpoint.php + * + * @param CreateFirewallEndpointRequest $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 createProjectFirewallEndpoint( + CreateFirewallEndpointRequest $request, + array $callOptions = [] + ): OperationResponse { + return $this->startApiCall('CreateProjectFirewallEndpoint', $request, $callOptions)->wait(); + } + /** * Deletes a single org Endpoint. * @@ -577,6 +611,35 @@ public function deleteFirewallEndpointAssociation( return $this->startApiCall('DeleteFirewallEndpointAssociation', $request, $callOptions)->wait(); } + /** + * Deletes a single project Endpoint. + * + * The async variant is + * {@see FirewallActivationClient::deleteProjectFirewallEndpointAsync()} . + * + * @example samples/V1/FirewallActivationClient/delete_project_firewall_endpoint.php + * + * @param DeleteFirewallEndpointRequest $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 deleteProjectFirewallEndpoint( + DeleteFirewallEndpointRequest $request, + array $callOptions = [] + ): OperationResponse { + return $this->startApiCall('DeleteProjectFirewallEndpoint', $request, $callOptions)->wait(); + } + /** * Gets details of a single org Endpoint. * @@ -633,6 +696,35 @@ public function getFirewallEndpointAssociation( return $this->startApiCall('GetFirewallEndpointAssociation', $request, $callOptions)->wait(); } + /** + * Gets details of a single project Endpoint. + * + * The async variant is + * {@see FirewallActivationClient::getProjectFirewallEndpointAsync()} . + * + * @example samples/V1/FirewallActivationClient/get_project_firewall_endpoint.php + * + * @param GetFirewallEndpointRequest $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 FirewallEndpoint + * + * @throws ApiException Thrown if the API call fails. + */ + public function getProjectFirewallEndpoint( + GetFirewallEndpointRequest $request, + array $callOptions = [] + ): FirewallEndpoint { + return $this->startApiCall('GetProjectFirewallEndpoint', $request, $callOptions)->wait(); + } + /** * Lists Associations in a given project and location. * @@ -691,6 +783,35 @@ public function listFirewallEndpoints( return $this->startApiCall('ListFirewallEndpoints', $request, $callOptions); } + /** + * Lists FirewallEndpoints in a given project and location. + * + * The async variant is + * {@see FirewallActivationClient::listProjectFirewallEndpointsAsync()} . + * + * @example samples/V1/FirewallActivationClient/list_project_firewall_endpoints.php + * + * @param ListFirewallEndpointsRequest $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 listProjectFirewallEndpoints( + ListFirewallEndpointsRequest $request, + array $callOptions = [] + ): PagedListResponse { + return $this->startApiCall('ListProjectFirewallEndpoints', $request, $callOptions); + } + /** * Update a single org Endpoint. * @@ -749,6 +870,35 @@ public function updateFirewallEndpointAssociation( return $this->startApiCall('UpdateFirewallEndpointAssociation', $request, $callOptions)->wait(); } + /** + * Update a single project Endpoint. + * + * The async variant is + * {@see FirewallActivationClient::updateProjectFirewallEndpointAsync()} . + * + * @example samples/V1/FirewallActivationClient/update_project_firewall_endpoint.php + * + * @param UpdateFirewallEndpointRequest $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 updateProjectFirewallEndpoint( + UpdateFirewallEndpointRequest $request, + array $callOptions = [] + ): OperationResponse { + return $this->startApiCall('UpdateProjectFirewallEndpoint', $request, $callOptions)->wait(); + } + /** * Gets information about a location. * @@ -779,9 +929,8 @@ public function getLocation(GetLocationRequest $request, array $callOptions = [] * Lists information about the supported locations for this service. This method lists locations based on the resource scope provided in - the [ListLocationsRequest.name] field: - - * **Global locations**: If `name` is empty, the method lists the + the [ListLocationsRequest.name][google.cloud.location.ListLocationsRequest.name] field: * + **Global locations**: If `name` is empty, the method lists the public locations available to all projects. * **Project-specific locations**: If `name` follows the format `projects/{project}`, the method lists locations visible to that diff --git a/NetworkSecurity/src/V1/Client/InterceptClient.php b/NetworkSecurity/src/V1/Client/InterceptClient.php index ae3cb495ea73..2e2064e05e13 100644 --- a/NetworkSecurity/src/V1/Client/InterceptClient.php +++ b/NetworkSecurity/src/V1/Client/InterceptClient.php @@ -1085,9 +1085,8 @@ public function getLocation(GetLocationRequest $request, array $callOptions = [] * Lists information about the supported locations for this service. This method lists locations based on the resource scope provided in - the [ListLocationsRequest.name] field: - - * **Global locations**: If `name` is empty, the method lists the + the [ListLocationsRequest.name][google.cloud.location.ListLocationsRequest.name] field: * + **Global locations**: If `name` is empty, the method lists the public locations available to all projects. * **Project-specific locations**: If `name` follows the format `projects/{project}`, the method lists locations visible to that diff --git a/NetworkSecurity/src/V1/Client/MirroringClient.php b/NetworkSecurity/src/V1/Client/MirroringClient.php index 26b47408a46a..74ec2d0770ab 100644 --- a/NetworkSecurity/src/V1/Client/MirroringClient.php +++ b/NetworkSecurity/src/V1/Client/MirroringClient.php @@ -1084,9 +1084,8 @@ public function getLocation(GetLocationRequest $request, array $callOptions = [] * Lists information about the supported locations for this service. This method lists locations based on the resource scope provided in - the [ListLocationsRequest.name] field: - - * **Global locations**: If `name` is empty, the method lists the + the [ListLocationsRequest.name][google.cloud.location.ListLocationsRequest.name] field: * + **Global locations**: If `name` is empty, the method lists the public locations available to all projects. * **Project-specific locations**: If `name` follows the format `projects/{project}`, the method lists locations visible to that diff --git a/NetworkSecurity/src/V1/Client/NetworkSecurityClient.php b/NetworkSecurity/src/V1/Client/NetworkSecurityClient.php index 0167c4942479..acd0d508b0d7 100644 --- a/NetworkSecurity/src/V1/Client/NetworkSecurityClient.php +++ b/NetworkSecurity/src/V1/Client/NetworkSecurityClient.php @@ -1949,9 +1949,8 @@ public function getLocation(GetLocationRequest $request, array $callOptions = [] * Lists information about the supported locations for this service. This method lists locations based on the resource scope provided in - the [ListLocationsRequest.name] field: - - * **Global locations**: If `name` is empty, the method lists the + the [ListLocationsRequest.name][google.cloud.location.ListLocationsRequest.name] field: * + **Global locations**: If `name` is empty, the method lists the public locations available to all projects. * **Project-specific locations**: If `name` follows the format `projects/{project}`, the method lists locations visible to that diff --git a/NetworkSecurity/src/V1/Client/OrganizationAddressGroupServiceClient.php b/NetworkSecurity/src/V1/Client/OrganizationAddressGroupServiceClient.php index a05dbe7f67c4..79b7c0bfc3a7 100644 --- a/NetworkSecurity/src/V1/Client/OrganizationAddressGroupServiceClient.php +++ b/NetworkSecurity/src/V1/Client/OrganizationAddressGroupServiceClient.php @@ -678,9 +678,8 @@ public function getLocation(GetLocationRequest $request, array $callOptions = [] * Lists information about the supported locations for this service. This method lists locations based on the resource scope provided in - the [ListLocationsRequest.name] field: - - * **Global locations**: If `name` is empty, the method lists the + the [ListLocationsRequest.name][google.cloud.location.ListLocationsRequest.name] field: * + **Global locations**: If `name` is empty, the method lists the public locations available to all projects. * **Project-specific locations**: If `name` follows the format `projects/{project}`, the method lists locations visible to that diff --git a/NetworkSecurity/src/V1/Client/OrganizationSecurityProfileGroupServiceClient.php b/NetworkSecurity/src/V1/Client/OrganizationSecurityProfileGroupServiceClient.php index 48f89e6d3b74..d50cb70f2ce3 100644 --- a/NetworkSecurity/src/V1/Client/OrganizationSecurityProfileGroupServiceClient.php +++ b/NetworkSecurity/src/V1/Client/OrganizationSecurityProfileGroupServiceClient.php @@ -843,9 +843,8 @@ public function getLocation(GetLocationRequest $request, array $callOptions = [] * Lists information about the supported locations for this service. This method lists locations based on the resource scope provided in - the [ListLocationsRequest.name] field: - - * **Global locations**: If `name` is empty, the method lists the + the [ListLocationsRequest.name][google.cloud.location.ListLocationsRequest.name] field: * + **Global locations**: If `name` is empty, the method lists the public locations available to all projects. * **Project-specific locations**: If `name` follows the format `projects/{project}`, the method lists locations visible to that diff --git a/NetworkSecurity/src/V1/Client/SSERealmServiceClient.php b/NetworkSecurity/src/V1/Client/SSERealmServiceClient.php new file mode 100644 index 000000000000..723cf7c654bd --- /dev/null +++ b/NetworkSecurity/src/V1/Client/SSERealmServiceClient.php @@ -0,0 +1,714 @@ + createSACAttachmentAsync(CreateSACAttachmentRequest $request, array $optionalArgs = []) + * @method PromiseInterface createSACRealmAsync(CreateSACRealmRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteSACAttachmentAsync(DeleteSACAttachmentRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteSACRealmAsync(DeleteSACRealmRequest $request, array $optionalArgs = []) + * @method PromiseInterface getSACAttachmentAsync(GetSACAttachmentRequest $request, array $optionalArgs = []) + * @method PromiseInterface getSACRealmAsync(GetSACRealmRequest $request, array $optionalArgs = []) + * @method PromiseInterface listSACAttachmentsAsync(ListSACAttachmentsRequest $request, array $optionalArgs = []) + * @method PromiseInterface listSACRealmsAsync(ListSACRealmsRequest $request, array $optionalArgs = []) + * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) + * @method PromiseInterface listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = []) + * @method PromiseInterface getIamPolicyAsync(GetIamPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface setIamPolicyAsync(SetIamPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface testIamPermissionsAsync(TestIamPermissionsRequest $request, array $optionalArgs = []) + */ +final class SSERealmServiceClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.networksecurity.v1.SSERealmService'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'networksecurity.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'networksecurity.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = ['https://www.googleapis.com/auth/cloud-platform']; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/sse_realm_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/sse_realm_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/sse_realm_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/sse_realm_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = $this->descriptors[$methodName]['longRunning'] ?? []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + */ + public static function locationName(string $project, string $location): string + { + return self::getPathTemplate('location')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * sac_attachment resource. + * + * @param string $project + * @param string $location + * @param string $sacAttachment + * + * @return string The formatted sac_attachment resource. + */ + public static function sACAttachmentName(string $project, string $location, string $sacAttachment): string + { + return self::getPathTemplate('sACAttachment')->render([ + 'project' => $project, + 'location' => $location, + 'sac_attachment' => $sacAttachment, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a sac_realm + * resource. + * + * @param string $project + * @param string $location + * @param string $sacRealm + * + * @return string The formatted sac_realm resource. + */ + public static function sACRealmName(string $project, string $location, string $sacRealm): string + { + return self::getPathTemplate('sACRealm')->render([ + 'project' => $project, + 'location' => $location, + 'sac_realm' => $sacRealm, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - location: projects/{project}/locations/{location} + * - sACAttachment: projects/{project}/locations/{location}/sacAttachments/{sac_attachment} + * - sACRealm: projects/{project}/locations/{location}/sacRealms/{sac_realm} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param ?string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array|ClientOptions $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'networksecurity.googleapis.com:443'. + * @type FetchAuthTokenInterface|CredentialsWrapper $credentials + * This option should only be used with a pre-constructed + * {@see FetchAuthTokenInterface} or {@see CredentialsWrapper} object. Note that + * when one of these objects are provided, any settings in $credentialsConfig will + * be ignored. + * **Important**: If you are providing a path to a credentials file, or a decoded + * credentials file as a PHP array, this usage is now DEPRECATED. Providing an + * unvalidated credential configuration to Google APIs can compromise the security + * of your systems and data. It is recommended to create the credentials explicitly + * ``` + * use Google\Auth\Credentials\ServiceAccountCredentials; + * use Google\Cloud\NetworkSecurity\V1\SSERealmServiceClient; + * $creds = new ServiceAccountCredentials($scopes, $json); + * $options = new SSERealmServiceClient(['credentials' => $creds]); + * ``` + * {@see + * https://cloud.google.com/docs/authentication/external/externally-sourced-credentials} + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * @type string $universeDomain + * The service domain for the client. Defaults to 'googleapis.com'. + * } + * + * @throws ValidationException + */ + public function __construct(array|ClientOptions $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates a new SACAttachment in a given project and location. + * + * The async variant is {@see SSERealmServiceClient::createSACAttachmentAsync()} . + * + * @example samples/V1/SSERealmServiceClient/create_sac_attachment.php + * + * @param CreateSACAttachmentRequest $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 createSACAttachment(CreateSACAttachmentRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateSACAttachment', $request, $callOptions)->wait(); + } + + /** + * Creates a new SACRealm in a given project. + * + * The async variant is {@see SSERealmServiceClient::createSACRealmAsync()} . + * + * @example samples/V1/SSERealmServiceClient/create_sac_realm.php + * + * @param CreateSACRealmRequest $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 createSACRealm(CreateSACRealmRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateSACRealm', $request, $callOptions)->wait(); + } + + /** + * Deletes the specified attachment. + * + * The async variant is {@see SSERealmServiceClient::deleteSACAttachmentAsync()} . + * + * @example samples/V1/SSERealmServiceClient/delete_sac_attachment.php + * + * @param DeleteSACAttachmentRequest $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 deleteSACAttachment(DeleteSACAttachmentRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteSACAttachment', $request, $callOptions)->wait(); + } + + /** + * Deletes the specified realm. + * + * The async variant is {@see SSERealmServiceClient::deleteSACRealmAsync()} . + * + * @example samples/V1/SSERealmServiceClient/delete_sac_realm.php + * + * @param DeleteSACRealmRequest $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 deleteSACRealm(DeleteSACRealmRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteSACRealm', $request, $callOptions)->wait(); + } + + /** + * Returns the specified attachment. + * + * The async variant is {@see SSERealmServiceClient::getSACAttachmentAsync()} . + * + * @example samples/V1/SSERealmServiceClient/get_sac_attachment.php + * + * @param GetSACAttachmentRequest $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 SACAttachment + * + * @throws ApiException Thrown if the API call fails. + */ + public function getSACAttachment(GetSACAttachmentRequest $request, array $callOptions = []): SACAttachment + { + return $this->startApiCall('GetSACAttachment', $request, $callOptions)->wait(); + } + + /** + * Returns the specified realm. + * + * The async variant is {@see SSERealmServiceClient::getSACRealmAsync()} . + * + * @example samples/V1/SSERealmServiceClient/get_sac_realm.php + * + * @param GetSACRealmRequest $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 SACRealm + * + * @throws ApiException Thrown if the API call fails. + */ + public function getSACRealm(GetSACRealmRequest $request, array $callOptions = []): SACRealm + { + return $this->startApiCall('GetSACRealm', $request, $callOptions)->wait(); + } + + /** + * Lists SACAttachments in a given project and location. + * + * The async variant is {@see SSERealmServiceClient::listSACAttachmentsAsync()} . + * + * @example samples/V1/SSERealmServiceClient/list_sac_attachments.php + * + * @param ListSACAttachmentsRequest $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 listSACAttachments(ListSACAttachmentsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListSACAttachments', $request, $callOptions); + } + + /** + * Lists SACRealms in a given project. + * + * The async variant is {@see SSERealmServiceClient::listSACRealmsAsync()} . + * + * @example samples/V1/SSERealmServiceClient/list_sac_realms.php + * + * @param ListSACRealmsRequest $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 listSACRealms(ListSACRealmsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListSACRealms', $request, $callOptions); + } + + /** + * Gets information about a location. + * + * The async variant is {@see SSERealmServiceClient::getLocationAsync()} . + * + * @example samples/V1/SSERealmServiceClient/get_location.php + * + * @param GetLocationRequest $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 Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + + This method lists locations based on the resource scope provided in + the [ListLocationsRequest.name][google.cloud.location.ListLocationsRequest.name] field: * + **Global locations**: If `name` is empty, the method lists the + public locations available to all projects. * **Project-specific + locations**: If `name` follows the format + `projects/{project}`, the method lists locations visible to that + specific project. This includes public, private, or other + project-specific locations enabled for the project. + + For gRPC and client library implementations, the resource name is + passed as the `name` field. For direct service calls, the resource + name is + incorporated into the request path based on the specific service + implementation and version. + * + * The async variant is {@see SSERealmServiceClient::listLocationsAsync()} . + * + * @example samples/V1/SSERealmServiceClient/list_locations.php + * + * @param ListLocationsRequest $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 listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } + + /** + * Gets the access control policy for a resource. Returns an empty policy + if the resource exists and does not have a policy set. + * + * The async variant is {@see SSERealmServiceClient::getIamPolicyAsync()} . + * + * @example samples/V1/SSERealmServiceClient/get_iam_policy.php + * + * @param GetIamPolicyRequest $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 Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function getIamPolicy(GetIamPolicyRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('GetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Sets the access control policy on the specified resource. Replaces + any existing policy. + + Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` + errors. + * + * The async variant is {@see SSERealmServiceClient::setIamPolicyAsync()} . + * + * @example samples/V1/SSERealmServiceClient/set_iam_policy.php + * + * @param SetIamPolicyRequest $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 Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('SetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Returns permissions that a caller has on the specified resource. If the + resource does not exist, this will return an empty set of + permissions, not a `NOT_FOUND` error. + + Note: This operation is designed to be used for building + permission-aware UIs and command-line tools, not for authorization + checking. This operation may "fail open" without warning. + * + * The async variant is {@see SSERealmServiceClient::testIamPermissionsAsync()} . + * + * @example samples/V1/SSERealmServiceClient/test_iam_permissions.php + * + * @param TestIamPermissionsRequest $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 TestIamPermissionsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function testIamPermissions( + TestIamPermissionsRequest $request, + array $callOptions = [] + ): TestIamPermissionsResponse { + return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); + } +} diff --git a/NetworkSecurity/src/V1/Client/SecurityProfileGroupServiceClient.php b/NetworkSecurity/src/V1/Client/SecurityProfileGroupServiceClient.php new file mode 100644 index 000000000000..5e6ad0393e5a --- /dev/null +++ b/NetworkSecurity/src/V1/Client/SecurityProfileGroupServiceClient.php @@ -0,0 +1,964 @@ + createSecurityProfileAsync(CreateSecurityProfileRequest $request, array $optionalArgs = []) + * @method PromiseInterface createSecurityProfileGroupAsync(CreateSecurityProfileGroupRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteSecurityProfileAsync(DeleteSecurityProfileRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteSecurityProfileGroupAsync(DeleteSecurityProfileGroupRequest $request, array $optionalArgs = []) + * @method PromiseInterface getSecurityProfileAsync(GetSecurityProfileRequest $request, array $optionalArgs = []) + * @method PromiseInterface getSecurityProfileGroupAsync(GetSecurityProfileGroupRequest $request, array $optionalArgs = []) + * @method PromiseInterface listSecurityProfileGroupsAsync(ListSecurityProfileGroupsRequest $request, array $optionalArgs = []) + * @method PromiseInterface listSecurityProfilesAsync(ListSecurityProfilesRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateSecurityProfileAsync(UpdateSecurityProfileRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateSecurityProfileGroupAsync(UpdateSecurityProfileGroupRequest $request, array $optionalArgs = []) + * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) + * @method PromiseInterface listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = []) + * @method PromiseInterface getIamPolicyAsync(GetIamPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface setIamPolicyAsync(SetIamPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface testIamPermissionsAsync(TestIamPermissionsRequest $request, array $optionalArgs = []) + */ +final class SecurityProfileGroupServiceClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.networksecurity.v1.SecurityProfileGroupService'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'networksecurity.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'networksecurity.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = ['https://www.googleapis.com/auth/cloud-platform']; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/security_profile_group_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/security_profile_group_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/security_profile_group_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => + __DIR__ . '/../resources/security_profile_group_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = $this->descriptors[$methodName]['longRunning'] ?? []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * intercept_endpoint_group resource. + * + * @param string $project + * @param string $location + * @param string $interceptEndpointGroup + * + * @return string The formatted intercept_endpoint_group resource. + */ + public static function interceptEndpointGroupName( + string $project, + string $location, + string $interceptEndpointGroup + ): string { + return self::getPathTemplate('interceptEndpointGroup')->render([ + 'project' => $project, + 'location' => $location, + 'intercept_endpoint_group' => $interceptEndpointGroup, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + */ + public static function locationName(string $project, string $location): string + { + return self::getPathTemplate('location')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * mirroring_endpoint_group resource. + * + * @param string $project + * @param string $location + * @param string $mirroringEndpointGroup + * + * @return string The formatted mirroring_endpoint_group resource. + */ + public static function mirroringEndpointGroupName( + string $project, + string $location, + string $mirroringEndpointGroup + ): string { + return self::getPathTemplate('mirroringEndpointGroup')->render([ + 'project' => $project, + 'location' => $location, + 'mirroring_endpoint_group' => $mirroringEndpointGroup, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * organization_location resource. + * + * @param string $organization + * @param string $location + * + * @return string The formatted organization_location resource. + */ + public static function organizationLocationName(string $organization, string $location): string + { + return self::getPathTemplate('organizationLocation')->render([ + 'organization' => $organization, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * organization_location_security_profile resource. + * + * @param string $organization + * @param string $location + * @param string $securityProfile + * + * @return string The formatted organization_location_security_profile resource. + */ + public static function organizationLocationSecurityProfileName( + string $organization, + string $location, + string $securityProfile + ): string { + return self::getPathTemplate('organizationLocationSecurityProfile')->render([ + 'organization' => $organization, + 'location' => $location, + 'security_profile' => $securityProfile, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * organization_location_security_profile_group resource. + * + * @param string $organization + * @param string $location + * @param string $securityProfileGroup + * + * @return string The formatted organization_location_security_profile_group resource. + */ + public static function organizationLocationSecurityProfileGroupName( + string $organization, + string $location, + string $securityProfileGroup + ): string { + return self::getPathTemplate('organizationLocationSecurityProfileGroup')->render([ + 'organization' => $organization, + 'location' => $location, + 'security_profile_group' => $securityProfileGroup, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_security_profile resource. + * + * @param string $project + * @param string $location + * @param string $securityProfile + * + * @return string The formatted project_location_security_profile resource. + */ + public static function projectLocationSecurityProfileName( + string $project, + string $location, + string $securityProfile + ): string { + return self::getPathTemplate('projectLocationSecurityProfile')->render([ + 'project' => $project, + 'location' => $location, + 'security_profile' => $securityProfile, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_security_profile_group resource. + * + * @param string $project + * @param string $location + * @param string $securityProfileGroup + * + * @return string The formatted project_location_security_profile_group resource. + */ + public static function projectLocationSecurityProfileGroupName( + string $project, + string $location, + string $securityProfileGroup + ): string { + return self::getPathTemplate('projectLocationSecurityProfileGroup')->render([ + 'project' => $project, + 'location' => $location, + 'security_profile_group' => $securityProfileGroup, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * security_profile resource. + * + * @param string $organization + * @param string $location + * @param string $securityProfile + * + * @return string The formatted security_profile resource. + */ + public static function securityProfileName(string $organization, string $location, string $securityProfile): string + { + return self::getPathTemplate('securityProfile')->render([ + 'organization' => $organization, + 'location' => $location, + 'security_profile' => $securityProfile, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * security_profile_group resource. + * + * @param string $organization + * @param string $location + * @param string $securityProfileGroup + * + * @return string The formatted security_profile_group resource. + */ + public static function securityProfileGroupName( + string $organization, + string $location, + string $securityProfileGroup + ): string { + return self::getPathTemplate('securityProfileGroup')->render([ + 'organization' => $organization, + 'location' => $location, + 'security_profile_group' => $securityProfileGroup, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - interceptEndpointGroup: projects/{project}/locations/{location}/interceptEndpointGroups/{intercept_endpoint_group} + * - location: projects/{project}/locations/{location} + * - mirroringEndpointGroup: projects/{project}/locations/{location}/mirroringEndpointGroups/{mirroring_endpoint_group} + * - organizationLocation: organizations/{organization}/locations/{location} + * - organizationLocationSecurityProfile: organizations/{organization}/locations/{location}/securityProfiles/{security_profile} + * - organizationLocationSecurityProfileGroup: organizations/{organization}/locations/{location}/securityProfileGroups/{security_profile_group} + * - projectLocationSecurityProfile: projects/{project}/locations/{location}/securityProfiles/{security_profile} + * - projectLocationSecurityProfileGroup: projects/{project}/locations/{location}/securityProfileGroups/{security_profile_group} + * - securityProfile: organizations/{organization}/locations/{location}/securityProfiles/{security_profile} + * - securityProfileGroup: organizations/{organization}/locations/{location}/securityProfileGroups/{security_profile_group} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param ?string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, ?string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array|ClientOptions $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'networksecurity.googleapis.com:443'. + * @type FetchAuthTokenInterface|CredentialsWrapper $credentials + * This option should only be used with a pre-constructed + * {@see FetchAuthTokenInterface} or {@see CredentialsWrapper} object. Note that + * when one of these objects are provided, any settings in $credentialsConfig will + * be ignored. + * **Important**: If you are providing a path to a credentials file, or a decoded + * credentials file as a PHP array, this usage is now DEPRECATED. Providing an + * unvalidated credential configuration to Google APIs can compromise the security + * of your systems and data. It is recommended to create the credentials explicitly + * ``` + * use Google\Auth\Credentials\ServiceAccountCredentials; + * use Google\Cloud\NetworkSecurity\V1\SecurityProfileGroupServiceClient; + * $creds = new ServiceAccountCredentials($scopes, $json); + * $options = new SecurityProfileGroupServiceClient(['credentials' => $creds]); + * ``` + * {@see + * https://cloud.google.com/docs/authentication/external/externally-sourced-credentials} + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * @type string $universeDomain + * The service domain for the client. Defaults to 'googleapis.com'. + * } + * + * @throws ValidationException + */ + public function __construct(array|ClientOptions $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates a new SecurityProfile in a given project and location. + * + * The async variant is + * {@see SecurityProfileGroupServiceClient::createSecurityProfileAsync()} . + * + * @example samples/V1/SecurityProfileGroupServiceClient/create_security_profile.php + * + * @param CreateSecurityProfileRequest $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 createSecurityProfile( + CreateSecurityProfileRequest $request, + array $callOptions = [] + ): OperationResponse { + return $this->startApiCall('CreateSecurityProfile', $request, $callOptions)->wait(); + } + + /** + * Creates a new SecurityProfileGroup in a given project and location. + * + * The async variant is + * {@see SecurityProfileGroupServiceClient::createSecurityProfileGroupAsync()} . + * + * @example samples/V1/SecurityProfileGroupServiceClient/create_security_profile_group.php + * + * @param CreateSecurityProfileGroupRequest $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 createSecurityProfileGroup( + CreateSecurityProfileGroupRequest $request, + array $callOptions = [] + ): OperationResponse { + return $this->startApiCall('CreateSecurityProfileGroup', $request, $callOptions)->wait(); + } + + /** + * Deletes a single SecurityProfile. + * + * The async variant is + * {@see SecurityProfileGroupServiceClient::deleteSecurityProfileAsync()} . + * + * @example samples/V1/SecurityProfileGroupServiceClient/delete_security_profile.php + * + * @param DeleteSecurityProfileRequest $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 deleteSecurityProfile( + DeleteSecurityProfileRequest $request, + array $callOptions = [] + ): OperationResponse { + return $this->startApiCall('DeleteSecurityProfile', $request, $callOptions)->wait(); + } + + /** + * Deletes a single SecurityProfileGroup. + * + * The async variant is + * {@see SecurityProfileGroupServiceClient::deleteSecurityProfileGroupAsync()} . + * + * @example samples/V1/SecurityProfileGroupServiceClient/delete_security_profile_group.php + * + * @param DeleteSecurityProfileGroupRequest $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 deleteSecurityProfileGroup( + DeleteSecurityProfileGroupRequest $request, + array $callOptions = [] + ): OperationResponse { + return $this->startApiCall('DeleteSecurityProfileGroup', $request, $callOptions)->wait(); + } + + /** + * Gets details of a single SecurityProfile. + * + * The async variant is + * {@see SecurityProfileGroupServiceClient::getSecurityProfileAsync()} . + * + * @example samples/V1/SecurityProfileGroupServiceClient/get_security_profile.php + * + * @param GetSecurityProfileRequest $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 SecurityProfile + * + * @throws ApiException Thrown if the API call fails. + */ + public function getSecurityProfile(GetSecurityProfileRequest $request, array $callOptions = []): SecurityProfile + { + return $this->startApiCall('GetSecurityProfile', $request, $callOptions)->wait(); + } + + /** + * Gets details of a single SecurityProfileGroup. + * + * The async variant is + * {@see SecurityProfileGroupServiceClient::getSecurityProfileGroupAsync()} . + * + * @example samples/V1/SecurityProfileGroupServiceClient/get_security_profile_group.php + * + * @param GetSecurityProfileGroupRequest $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 SecurityProfileGroup + * + * @throws ApiException Thrown if the API call fails. + */ + public function getSecurityProfileGroup( + GetSecurityProfileGroupRequest $request, + array $callOptions = [] + ): SecurityProfileGroup { + return $this->startApiCall('GetSecurityProfileGroup', $request, $callOptions)->wait(); + } + + /** + * Lists SecurityProfileGroups in a given project and location. + * + * The async variant is + * {@see SecurityProfileGroupServiceClient::listSecurityProfileGroupsAsync()} . + * + * @example samples/V1/SecurityProfileGroupServiceClient/list_security_profile_groups.php + * + * @param ListSecurityProfileGroupsRequest $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 listSecurityProfileGroups( + ListSecurityProfileGroupsRequest $request, + array $callOptions = [] + ): PagedListResponse { + return $this->startApiCall('ListSecurityProfileGroups', $request, $callOptions); + } + + /** + * Lists SecurityProfiles in a given project and location. + * + * The async variant is + * {@see SecurityProfileGroupServiceClient::listSecurityProfilesAsync()} . + * + * @example samples/V1/SecurityProfileGroupServiceClient/list_security_profiles.php + * + * @param ListSecurityProfilesRequest $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 listSecurityProfiles( + ListSecurityProfilesRequest $request, + array $callOptions = [] + ): PagedListResponse { + return $this->startApiCall('ListSecurityProfiles', $request, $callOptions); + } + + /** + * Updates the parameters of a single SecurityProfile. + * + * The async variant is + * {@see SecurityProfileGroupServiceClient::updateSecurityProfileAsync()} . + * + * @example samples/V1/SecurityProfileGroupServiceClient/update_security_profile.php + * + * @param UpdateSecurityProfileRequest $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 updateSecurityProfile( + UpdateSecurityProfileRequest $request, + array $callOptions = [] + ): OperationResponse { + return $this->startApiCall('UpdateSecurityProfile', $request, $callOptions)->wait(); + } + + /** + * Updates the parameters of a single SecurityProfileGroup. + * + * The async variant is + * {@see SecurityProfileGroupServiceClient::updateSecurityProfileGroupAsync()} . + * + * @example samples/V1/SecurityProfileGroupServiceClient/update_security_profile_group.php + * + * @param UpdateSecurityProfileGroupRequest $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 updateSecurityProfileGroup( + UpdateSecurityProfileGroupRequest $request, + array $callOptions = [] + ): OperationResponse { + return $this->startApiCall('UpdateSecurityProfileGroup', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is + * {@see SecurityProfileGroupServiceClient::getLocationAsync()} . + * + * @example samples/V1/SecurityProfileGroupServiceClient/get_location.php + * + * @param GetLocationRequest $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 Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + + This method lists locations based on the resource scope provided in + the [ListLocationsRequest.name][google.cloud.location.ListLocationsRequest.name] field: * + **Global locations**: If `name` is empty, the method lists the + public locations available to all projects. * **Project-specific + locations**: If `name` follows the format + `projects/{project}`, the method lists locations visible to that + specific project. This includes public, private, or other + project-specific locations enabled for the project. + + For gRPC and client library implementations, the resource name is + passed as the `name` field. For direct service calls, the resource + name is + incorporated into the request path based on the specific service + implementation and version. + * + * The async variant is + * {@see SecurityProfileGroupServiceClient::listLocationsAsync()} . + * + * @example samples/V1/SecurityProfileGroupServiceClient/list_locations.php + * + * @param ListLocationsRequest $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 listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } + + /** + * Gets the access control policy for a resource. Returns an empty policy + if the resource exists and does not have a policy set. + * + * The async variant is + * {@see SecurityProfileGroupServiceClient::getIamPolicyAsync()} . + * + * @example samples/V1/SecurityProfileGroupServiceClient/get_iam_policy.php + * + * @param GetIamPolicyRequest $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 Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function getIamPolicy(GetIamPolicyRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('GetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Sets the access control policy on the specified resource. Replaces + any existing policy. + + Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` + errors. + * + * The async variant is + * {@see SecurityProfileGroupServiceClient::setIamPolicyAsync()} . + * + * @example samples/V1/SecurityProfileGroupServiceClient/set_iam_policy.php + * + * @param SetIamPolicyRequest $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 Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('SetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Returns permissions that a caller has on the specified resource. If the + resource does not exist, this will return an empty set of + permissions, not a `NOT_FOUND` error. + + Note: This operation is designed to be used for building + permission-aware UIs and command-line tools, not for authorization + checking. This operation may "fail open" without warning. + * + * The async variant is + * {@see SecurityProfileGroupServiceClient::testIamPermissionsAsync()} . + * + * @example samples/V1/SecurityProfileGroupServiceClient/test_iam_permissions.php + * + * @param TestIamPermissionsRequest $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 TestIamPermissionsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function testIamPermissions( + TestIamPermissionsRequest $request, + array $callOptions = [] + ): TestIamPermissionsResponse { + return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); + } +} diff --git a/NetworkSecurity/src/V1/CreateSACAttachmentRequest.php b/NetworkSecurity/src/V1/CreateSACAttachmentRequest.php new file mode 100644 index 000000000000..6fb576a7a9c1 --- /dev/null +++ b/NetworkSecurity/src/V1/CreateSACAttachmentRequest.php @@ -0,0 +1,277 @@ +google.cloud.networksecurity.v1.CreateSACAttachmentRequest + */ +class CreateSACAttachmentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent, in the form + * `projects/{project}/locations/{location}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. ID of the created attachment. + * The ID must be 1-63 characters long, and comply with + * RFC1035. + * Specifically, it must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` + * which means the first character must be a lowercase letter, and all + * following characters must be a dash, lowercase letter, or digit, except + * the last character, which cannot be a dash. + * + * Generated from protobuf field string sac_attachment_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $sac_attachment_id = ''; + /** + * Required. The resource being created. + * + * Generated from protobuf field .google.cloud.networksecurity.v1.SACAttachment sac_attachment = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $sac_attachment = null; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + */ + protected $request_id = ''; + + /** + * @param string $parent Required. The parent, in the form + * `projects/{project}/locations/{location}`. Please see + * {@see SSERealmServiceClient::locationName()} for help formatting this field. + * @param \Google\Cloud\NetworkSecurity\V1\SACAttachment $sacAttachment Required. The resource being created. + * @param string $sacAttachmentId Required. ID of the created attachment. + * The ID must be 1-63 characters long, and comply with + * RFC1035. + * Specifically, it must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` + * which means the first character must be a lowercase letter, and all + * following characters must be a dash, lowercase letter, or digit, except + * the last character, which cannot be a dash. + * + * @return \Google\Cloud\NetworkSecurity\V1\CreateSACAttachmentRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\NetworkSecurity\V1\SACAttachment $sacAttachment, string $sacAttachmentId): self + { + return (new self()) + ->setParent($parent) + ->setSacAttachment($sacAttachment) + ->setSacAttachmentId($sacAttachmentId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent, in the form + * `projects/{project}/locations/{location}`. + * @type string $sac_attachment_id + * Required. ID of the created attachment. + * The ID must be 1-63 characters long, and comply with + * RFC1035. + * Specifically, it must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` + * which means the first character must be a lowercase letter, and all + * following characters must be a dash, lowercase letter, or digit, except + * the last character, which cannot be a dash. + * @type \Google\Cloud\NetworkSecurity\V1\SACAttachment $sac_attachment + * Required. The resource being created. + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networksecurity\V1\SseRealm::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent, in the form + * `projects/{project}/locations/{location}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent, in the form + * `projects/{project}/locations/{location}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. ID of the created attachment. + * The ID must be 1-63 characters long, and comply with + * RFC1035. + * Specifically, it must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` + * which means the first character must be a lowercase letter, and all + * following characters must be a dash, lowercase letter, or digit, except + * the last character, which cannot be a dash. + * + * Generated from protobuf field string sac_attachment_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getSacAttachmentId() + { + return $this->sac_attachment_id; + } + + /** + * Required. ID of the created attachment. + * The ID must be 1-63 characters long, and comply with + * RFC1035. + * Specifically, it must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` + * which means the first character must be a lowercase letter, and all + * following characters must be a dash, lowercase letter, or digit, except + * the last character, which cannot be a dash. + * + * Generated from protobuf field string sac_attachment_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setSacAttachmentId($var) + { + GPBUtil::checkString($var, True); + $this->sac_attachment_id = $var; + + return $this; + } + + /** + * Required. The resource being created. + * + * Generated from protobuf field .google.cloud.networksecurity.v1.SACAttachment sac_attachment = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\NetworkSecurity\V1\SACAttachment|null + */ + public function getSacAttachment() + { + return $this->sac_attachment; + } + + public function hasSacAttachment() + { + return isset($this->sac_attachment); + } + + public function clearSacAttachment() + { + unset($this->sac_attachment); + } + + /** + * Required. The resource being created. + * + * Generated from protobuf field .google.cloud.networksecurity.v1.SACAttachment sac_attachment = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\NetworkSecurity\V1\SACAttachment $var + * @return $this + */ + public function setSacAttachment($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\NetworkSecurity\V1\SACAttachment::class); + $this->sac_attachment = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/NetworkSecurity/src/V1/CreateSACRealmRequest.php b/NetworkSecurity/src/V1/CreateSACRealmRequest.php new file mode 100644 index 000000000000..4c153eee2c65 --- /dev/null +++ b/NetworkSecurity/src/V1/CreateSACRealmRequest.php @@ -0,0 +1,272 @@ +google.cloud.networksecurity.v1.CreateSACRealmRequest + */ +class CreateSACRealmRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent, in the form `projects/{project}/locations/global`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. ID of the created realm. + * The ID must be 1-63 characters long, and comply with + * RFC1035. + * Specifically, it must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` + * which means the first character must be a lowercase letter, and all + * following characters must be a dash, lowercase letter, or digit, except + * the last character, which cannot be a dash. + * + * Generated from protobuf field string sac_realm_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $sac_realm_id = ''; + /** + * Required. The resource being created. + * + * Generated from protobuf field .google.cloud.networksecurity.v1.SACRealm sac_realm = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $sac_realm = null; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + */ + protected $request_id = ''; + + /** + * @param string $parent Required. The parent, in the form `projects/{project}/locations/global`. Please see + * {@see SSERealmServiceClient::locationName()} for help formatting this field. + * @param \Google\Cloud\NetworkSecurity\V1\SACRealm $sacRealm Required. The resource being created. + * @param string $sacRealmId Required. ID of the created realm. + * The ID must be 1-63 characters long, and comply with + * RFC1035. + * Specifically, it must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` + * which means the first character must be a lowercase letter, and all + * following characters must be a dash, lowercase letter, or digit, except + * the last character, which cannot be a dash. + * + * @return \Google\Cloud\NetworkSecurity\V1\CreateSACRealmRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\NetworkSecurity\V1\SACRealm $sacRealm, string $sacRealmId): self + { + return (new self()) + ->setParent($parent) + ->setSacRealm($sacRealm) + ->setSacRealmId($sacRealmId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent, in the form `projects/{project}/locations/global`. + * @type string $sac_realm_id + * Required. ID of the created realm. + * The ID must be 1-63 characters long, and comply with + * RFC1035. + * Specifically, it must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` + * which means the first character must be a lowercase letter, and all + * following characters must be a dash, lowercase letter, or digit, except + * the last character, which cannot be a dash. + * @type \Google\Cloud\NetworkSecurity\V1\SACRealm $sac_realm + * Required. The resource being created. + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networksecurity\V1\SseRealm::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent, in the form `projects/{project}/locations/global`. + * + * 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 parent, in the form `projects/{project}/locations/global`. + * + * 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. ID of the created realm. + * The ID must be 1-63 characters long, and comply with + * RFC1035. + * Specifically, it must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` + * which means the first character must be a lowercase letter, and all + * following characters must be a dash, lowercase letter, or digit, except + * the last character, which cannot be a dash. + * + * Generated from protobuf field string sac_realm_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getSacRealmId() + { + return $this->sac_realm_id; + } + + /** + * Required. ID of the created realm. + * The ID must be 1-63 characters long, and comply with + * RFC1035. + * Specifically, it must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` + * which means the first character must be a lowercase letter, and all + * following characters must be a dash, lowercase letter, or digit, except + * the last character, which cannot be a dash. + * + * Generated from protobuf field string sac_realm_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setSacRealmId($var) + { + GPBUtil::checkString($var, True); + $this->sac_realm_id = $var; + + return $this; + } + + /** + * Required. The resource being created. + * + * Generated from protobuf field .google.cloud.networksecurity.v1.SACRealm sac_realm = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\NetworkSecurity\V1\SACRealm|null + */ + public function getSacRealm() + { + return $this->sac_realm; + } + + public function hasSacRealm() + { + return isset($this->sac_realm); + } + + public function clearSacRealm() + { + unset($this->sac_realm); + } + + /** + * Required. The resource being created. + * + * Generated from protobuf field .google.cloud.networksecurity.v1.SACRealm sac_realm = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\NetworkSecurity\V1\SACRealm $var + * @return $this + */ + public function setSacRealm($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\NetworkSecurity\V1\SACRealm::class); + $this->sac_realm = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/NetworkSecurity/src/V1/CreateSecurityProfileGroupRequest.php b/NetworkSecurity/src/V1/CreateSecurityProfileGroupRequest.php index 865d6ae268d0..e961f90d6ecf 100644 --- a/NetworkSecurity/src/V1/CreateSecurityProfileGroupRequest.php +++ b/NetworkSecurity/src/V1/CreateSecurityProfileGroupRequest.php @@ -41,7 +41,7 @@ class CreateSecurityProfileGroupRequest extends \Google\Protobuf\Internal\Messag /** * @param string $parent Required. The parent resource of the SecurityProfileGroup. Must be in the * format `projects|organizations/*/locations/{location}`. Please see - * {@see OrganizationSecurityProfileGroupServiceClient::organizationLocationName()} for help formatting this field. + * {@see SecurityProfileGroupServiceClient::organizationLocationName()} for help formatting this field. * @param \Google\Cloud\NetworkSecurity\V1\SecurityProfileGroup $securityProfileGroup Required. SecurityProfileGroup resource to be created. * @param string $securityProfileGroupId Required. Short name of the SecurityProfileGroup resource to be created. * This value should be 1-63 characters long, containing only diff --git a/NetworkSecurity/src/V1/CreateSecurityProfileRequest.php b/NetworkSecurity/src/V1/CreateSecurityProfileRequest.php index 9fa9a15f5850..955e8198f361 100644 --- a/NetworkSecurity/src/V1/CreateSecurityProfileRequest.php +++ b/NetworkSecurity/src/V1/CreateSecurityProfileRequest.php @@ -41,7 +41,7 @@ class CreateSecurityProfileRequest extends \Google\Protobuf\Internal\Message /** * @param string $parent Required. The parent resource of the SecurityProfile. Must be in the format * `projects|organizations/*/locations/{location}`. Please see - * {@see OrganizationSecurityProfileGroupServiceClient::organizationLocationName()} for help formatting this field. + * {@see SecurityProfileGroupServiceClient::organizationLocationName()} for help formatting this field. * @param \Google\Cloud\NetworkSecurity\V1\SecurityProfile $securityProfile Required. SecurityProfile resource to be created. * @param string $securityProfileId Required. Short name of the SecurityProfile resource to be created. This * value should be 1-63 characters long, containing only letters, numbers, diff --git a/NetworkSecurity/src/V1/DeleteSACAttachmentRequest.php b/NetworkSecurity/src/V1/DeleteSACAttachmentRequest.php new file mode 100644 index 000000000000..5d06fafd4aad --- /dev/null +++ b/NetworkSecurity/src/V1/DeleteSACAttachmentRequest.php @@ -0,0 +1,160 @@ +google.cloud.networksecurity.v1.DeleteSACAttachmentRequest + */ +class DeleteSACAttachmentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the resource, in the form + * `projects/{project}/locations/{location}/sacAttachments/{sac_attachment}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + */ + protected $request_id = ''; + + /** + * @param string $name Required. Name of the resource, in the form + * `projects/{project}/locations/{location}/sacAttachments/{sac_attachment}`. Please see + * {@see SSERealmServiceClient::sACAttachmentName()} for help formatting this field. + * + * @return \Google\Cloud\NetworkSecurity\V1\DeleteSACAttachmentRequest + * + * @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. Name of the resource, in the form + * `projects/{project}/locations/{location}/sacAttachments/{sac_attachment}`. + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networksecurity\V1\SseRealm::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the resource, in the form + * `projects/{project}/locations/{location}/sacAttachments/{sac_attachment}`. + * + * 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. Name of the resource, in the form + * `projects/{project}/locations/{location}/sacAttachments/{sac_attachment}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/NetworkSecurity/src/V1/DeleteSACRealmRequest.php b/NetworkSecurity/src/V1/DeleteSACRealmRequest.php new file mode 100644 index 000000000000..4516463b248a --- /dev/null +++ b/NetworkSecurity/src/V1/DeleteSACRealmRequest.php @@ -0,0 +1,160 @@ +google.cloud.networksecurity.v1.DeleteSACRealmRequest + */ +class DeleteSACRealmRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the resource, in the form + * `projects/{project}/locations/global/sacRealms/{sacRealm}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + */ + protected $request_id = ''; + + /** + * @param string $name Required. Name of the resource, in the form + * `projects/{project}/locations/global/sacRealms/{sacRealm}`. Please see + * {@see SSERealmServiceClient::sACRealmName()} for help formatting this field. + * + * @return \Google\Cloud\NetworkSecurity\V1\DeleteSACRealmRequest + * + * @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. Name of the resource, in the form + * `projects/{project}/locations/global/sacRealms/{sacRealm}`. + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networksecurity\V1\SseRealm::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the resource, in the form + * `projects/{project}/locations/global/sacRealms/{sacRealm}`. + * + * 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. Name of the resource, in the form + * `projects/{project}/locations/global/sacRealms/{sacRealm}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/NetworkSecurity/src/V1/DeleteSecurityProfileGroupRequest.php b/NetworkSecurity/src/V1/DeleteSecurityProfileGroupRequest.php index 2273539d30ac..e5b4ff199310 100644 --- a/NetworkSecurity/src/V1/DeleteSecurityProfileGroupRequest.php +++ b/NetworkSecurity/src/V1/DeleteSecurityProfileGroupRequest.php @@ -35,7 +35,7 @@ class DeleteSecurityProfileGroupRequest extends \Google\Protobuf\Internal\Messag * @param string $name Required. A name of the SecurityProfileGroup to delete. Must be in the * format * `projects|organizations/*/locations/{location}/securityProfileGroups/{security_profile_group}`. Please see - * {@see OrganizationSecurityProfileGroupServiceClient::securityProfileGroupName()} for help formatting this field. + * {@see SecurityProfileGroupServiceClient::securityProfileGroupName()} for help formatting this field. * * @return \Google\Cloud\NetworkSecurity\V1\DeleteSecurityProfileGroupRequest * diff --git a/NetworkSecurity/src/V1/DeleteSecurityProfileRequest.php b/NetworkSecurity/src/V1/DeleteSecurityProfileRequest.php index 1531f7f355f6..f78c82cf01c1 100644 --- a/NetworkSecurity/src/V1/DeleteSecurityProfileRequest.php +++ b/NetworkSecurity/src/V1/DeleteSecurityProfileRequest.php @@ -33,7 +33,7 @@ class DeleteSecurityProfileRequest extends \Google\Protobuf\Internal\Message /** * @param string $name Required. A name of the SecurityProfile to delete. Must be in the format * `projects|organizations/*/locations/{location}/securityProfiles/{security_profile_id}`. Please see - * {@see OrganizationSecurityProfileGroupServiceClient::securityProfileName()} for help formatting this field. + * {@see SecurityProfileGroupServiceClient::securityProfileName()} for help formatting this field. * * @return \Google\Cloud\NetworkSecurity\V1\DeleteSecurityProfileRequest * diff --git a/NetworkSecurity/src/V1/FirewallEndpoint.php b/NetworkSecurity/src/V1/FirewallEndpoint.php index 5d6194ea20d1..214df11ca37d 100644 --- a/NetworkSecurity/src/V1/FirewallEndpoint.php +++ b/NetworkSecurity/src/V1/FirewallEndpoint.php @@ -60,10 +60,10 @@ class FirewallEndpoint extends \Google\Protobuf\Internal\Message */ protected $reconciling = false; /** - * Output only. List of networks that are associated with this endpoint in the - * local zone. This is a projection of the FirewallEndpointAssociations - * pointing at this endpoint. A network will only appear in this list after - * traffic routing is fully configured. Format: + * Output only. Deprecated: List of networks that are associated with this + * endpoint in the local zone. This is a projection of the + * FirewallEndpointAssociations pointing at this endpoint. A network will only + * appear in this list after traffic routing is fully configured. Format: * projects/{project}/global/networks/{name}. * * Generated from protobuf field repeated string associated_networks = 7 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; @@ -128,10 +128,10 @@ class FirewallEndpoint extends \Google\Protobuf\Internal\Message * Output only. Whether reconciling is in progress, recommended per * https://google.aip.dev/128. * @type string[] $associated_networks - * Output only. List of networks that are associated with this endpoint in the - * local zone. This is a projection of the FirewallEndpointAssociations - * pointing at this endpoint. A network will only appear in this list after - * traffic routing is fully configured. Format: + * Output only. Deprecated: List of networks that are associated with this + * endpoint in the local zone. This is a projection of the + * FirewallEndpointAssociations pointing at this endpoint. A network will only + * appear in this list after traffic routing is fully configured. Format: * projects/{project}/global/networks/{name}. * @type \Google\Cloud\NetworkSecurity\V1\FirewallEndpoint\AssociationReference[] $associations * Output only. List of FirewallEndpointAssociations that are associated to @@ -361,10 +361,10 @@ public function setReconciling($var) } /** - * Output only. List of networks that are associated with this endpoint in the - * local zone. This is a projection of the FirewallEndpointAssociations - * pointing at this endpoint. A network will only appear in this list after - * traffic routing is fully configured. Format: + * Output only. Deprecated: List of networks that are associated with this + * endpoint in the local zone. This is a projection of the + * FirewallEndpointAssociations pointing at this endpoint. A network will only + * appear in this list after traffic routing is fully configured. Format: * projects/{project}/global/networks/{name}. * * Generated from protobuf field repeated string associated_networks = 7 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; @@ -380,10 +380,10 @@ public function getAssociatedNetworks() } /** - * Output only. List of networks that are associated with this endpoint in the - * local zone. This is a projection of the FirewallEndpointAssociations - * pointing at this endpoint. A network will only appear in this list after - * traffic routing is fully configured. Format: + * Output only. Deprecated: List of networks that are associated with this + * endpoint in the local zone. This is a projection of the + * FirewallEndpointAssociations pointing at this endpoint. A network will only + * appear in this list after traffic routing is fully configured. Format: * projects/{project}/global/networks/{name}. * * Generated from protobuf field repeated string associated_networks = 7 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; diff --git a/NetworkSecurity/src/V1/GetSACAttachmentRequest.php b/NetworkSecurity/src/V1/GetSACAttachmentRequest.php new file mode 100644 index 000000000000..1390c692963a --- /dev/null +++ b/NetworkSecurity/src/V1/GetSACAttachmentRequest.php @@ -0,0 +1,86 @@ +google.cloud.networksecurity.v1.GetSACAttachmentRequest + */ +class GetSACAttachmentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the resource, in the form + * `projects/{project}/locations/{location}/sacAttachments/{sac_attachment}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Name of the resource, in the form + * `projects/{project}/locations/{location}/sacAttachments/{sac_attachment}`. Please see + * {@see SSERealmServiceClient::sACAttachmentName()} for help formatting this field. + * + * @return \Google\Cloud\NetworkSecurity\V1\GetSACAttachmentRequest + * + * @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. Name of the resource, in the form + * `projects/{project}/locations/{location}/sacAttachments/{sac_attachment}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networksecurity\V1\SseRealm::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the resource, in the form + * `projects/{project}/locations/{location}/sacAttachments/{sac_attachment}`. + * + * 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. Name of the resource, in the form + * `projects/{project}/locations/{location}/sacAttachments/{sac_attachment}`. + * + * 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/NetworkSecurity/src/V1/GetSACRealmRequest.php b/NetworkSecurity/src/V1/GetSACRealmRequest.php new file mode 100644 index 000000000000..43c31a4a261f --- /dev/null +++ b/NetworkSecurity/src/V1/GetSACRealmRequest.php @@ -0,0 +1,86 @@ +google.cloud.networksecurity.v1.GetSACRealmRequest + */ +class GetSACRealmRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the resource, in the form + * `projects/{project}/locations/global/sacRealms/{sacRealm}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Name of the resource, in the form + * `projects/{project}/locations/global/sacRealms/{sacRealm}`. Please see + * {@see SSERealmServiceClient::sACRealmName()} for help formatting this field. + * + * @return \Google\Cloud\NetworkSecurity\V1\GetSACRealmRequest + * + * @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. Name of the resource, in the form + * `projects/{project}/locations/global/sacRealms/{sacRealm}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networksecurity\V1\SseRealm::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the resource, in the form + * `projects/{project}/locations/global/sacRealms/{sacRealm}`. + * + * 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. Name of the resource, in the form + * `projects/{project}/locations/global/sacRealms/{sacRealm}`. + * + * 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/NetworkSecurity/src/V1/GetSecurityProfileGroupRequest.php b/NetworkSecurity/src/V1/GetSecurityProfileGroupRequest.php index 493ed3de061a..b29d1de00f58 100644 --- a/NetworkSecurity/src/V1/GetSecurityProfileGroupRequest.php +++ b/NetworkSecurity/src/V1/GetSecurityProfileGroupRequest.php @@ -26,7 +26,7 @@ class GetSecurityProfileGroupRequest extends \Google\Protobuf\Internal\Message /** * @param string $name Required. A name of the SecurityProfileGroup to get. Must be in the format * `projects|organizations/*/locations/{location}/securityProfileGroups/{security_profile_group}`. Please see - * {@see OrganizationSecurityProfileGroupServiceClient::securityProfileGroupName()} for help formatting this field. + * {@see SecurityProfileGroupServiceClient::securityProfileGroupName()} for help formatting this field. * * @return \Google\Cloud\NetworkSecurity\V1\GetSecurityProfileGroupRequest * diff --git a/NetworkSecurity/src/V1/GetSecurityProfileRequest.php b/NetworkSecurity/src/V1/GetSecurityProfileRequest.php index bf1967b26637..dfd70e6d05cb 100644 --- a/NetworkSecurity/src/V1/GetSecurityProfileRequest.php +++ b/NetworkSecurity/src/V1/GetSecurityProfileRequest.php @@ -26,7 +26,7 @@ class GetSecurityProfileRequest extends \Google\Protobuf\Internal\Message /** * @param string $name Required. A name of the SecurityProfile to get. Must be in the format * `projects|organizations/*/locations/{location}/securityProfiles/{security_profile_id}`. Please see - * {@see OrganizationSecurityProfileGroupServiceClient::securityProfileName()} for help formatting this field. + * {@see SecurityProfileGroupServiceClient::securityProfileName()} for help formatting this field. * * @return \Google\Cloud\NetworkSecurity\V1\GetSecurityProfileRequest * diff --git a/NetworkSecurity/src/V1/ListSACAttachmentsRequest.php b/NetworkSecurity/src/V1/ListSACAttachmentsRequest.php new file mode 100644 index 000000000000..f29ba5bfb7b3 --- /dev/null +++ b/NetworkSecurity/src/V1/ListSACAttachmentsRequest.php @@ -0,0 +1,226 @@ +google.cloud.networksecurity.v1.ListSACAttachmentsRequest + */ +class ListSACAttachmentsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent, in the form + * `projects/{project}/locations/{location}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. An expression that filters the list of results. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. Sort the results by a certain order. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + + /** + * @param string $parent Required. The parent, in the form + * `projects/{project}/locations/{location}`. Please see + * {@see SSERealmServiceClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\NetworkSecurity\V1\ListSACAttachmentsRequest + * + * @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 parent, in the form + * `projects/{project}/locations/{location}`. + * @type int $page_size + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @type string $page_token + * Optional. A token identifying a page of results the server should return. + * @type string $filter + * Optional. An expression that filters the list of results. + * @type string $order_by + * Optional. Sort the results by a certain order. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networksecurity\V1\SseRealm::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent, in the form + * `projects/{project}/locations/{location}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent, in the form + * `projects/{project}/locations/{location}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. An expression that filters the list of results. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. An expression that filters the list of results. + * + * 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. Sort the results by a certain order. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. Sort the results by a certain order. + * + * 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/NetworkSecurity/src/V1/ListSACAttachmentsResponse.php b/NetworkSecurity/src/V1/ListSACAttachmentsResponse.php new file mode 100644 index 000000000000..c77ccd03b8dc --- /dev/null +++ b/NetworkSecurity/src/V1/ListSACAttachmentsResponse.php @@ -0,0 +1,135 @@ +google.cloud.networksecurity.v1.ListSACAttachmentsResponse + */ +class ListSACAttachmentsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of SACAttachments. + * + * Generated from protobuf field repeated .google.cloud.networksecurity.v1.SACAttachment sac_attachments = 1; + */ + private $sac_attachments; + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + */ + private $unreachable; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\NetworkSecurity\V1\SACAttachment[] $sac_attachments + * The list of SACAttachments. + * @type string $next_page_token + * A token identifying a page of results the server should return. + * @type string[] $unreachable + * Locations that could not be reached. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networksecurity\V1\SseRealm::initOnce(); + parent::__construct($data); + } + + /** + * The list of SACAttachments. + * + * Generated from protobuf field repeated .google.cloud.networksecurity.v1.SACAttachment sac_attachments = 1; + * @return RepeatedField<\Google\Cloud\NetworkSecurity\V1\SACAttachment> + */ + public function getSacAttachments() + { + return $this->sac_attachments; + } + + /** + * The list of SACAttachments. + * + * Generated from protobuf field repeated .google.cloud.networksecurity.v1.SACAttachment sac_attachments = 1; + * @param \Google\Cloud\NetworkSecurity\V1\SACAttachment[] $var + * @return $this + */ + public function setSacAttachments($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\NetworkSecurity\V1\SACAttachment::class); + $this->sac_attachments = $arr; + + return $this; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token identifying a page of results the server should 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; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @return RepeatedField + */ + public function getUnreachable() + { + return $this->unreachable; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @param string[] $var + * @return $this + */ + public function setUnreachable($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachable = $arr; + + return $this; + } + +} + diff --git a/NetworkSecurity/src/V1/ListSACRealmsRequest.php b/NetworkSecurity/src/V1/ListSACRealmsRequest.php new file mode 100644 index 000000000000..77f921020d51 --- /dev/null +++ b/NetworkSecurity/src/V1/ListSACRealmsRequest.php @@ -0,0 +1,221 @@ +google.cloud.networksecurity.v1.ListSACRealmsRequest + */ +class ListSACRealmsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent, in the form `projects/{project}/locations/global`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. An expression that filters the list of results. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. Sort the results by a certain order. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + + /** + * @param string $parent Required. The parent, in the form `projects/{project}/locations/global`. Please see + * {@see SSERealmServiceClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\NetworkSecurity\V1\ListSACRealmsRequest + * + * @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 parent, in the form `projects/{project}/locations/global`. + * @type int $page_size + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @type string $page_token + * Optional. A token identifying a page of results the server should return. + * @type string $filter + * Optional. An expression that filters the list of results. + * @type string $order_by + * Optional. Sort the results by a certain order. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networksecurity\V1\SseRealm::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent, in the form `projects/{project}/locations/global`. + * + * 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 parent, in the form `projects/{project}/locations/global`. + * + * 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. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. An expression that filters the list of results. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. An expression that filters the list of results. + * + * 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. Sort the results by a certain order. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. Sort the results by a certain order. + * + * 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/NetworkSecurity/src/V1/ListSACRealmsResponse.php b/NetworkSecurity/src/V1/ListSACRealmsResponse.php new file mode 100644 index 000000000000..ba1da3f00c79 --- /dev/null +++ b/NetworkSecurity/src/V1/ListSACRealmsResponse.php @@ -0,0 +1,135 @@ +google.cloud.networksecurity.v1.ListSACRealmsResponse + */ +class ListSACRealmsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of SACRealms. + * + * Generated from protobuf field repeated .google.cloud.networksecurity.v1.SACRealm sac_realms = 1; + */ + private $sac_realms; + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + */ + private $unreachable; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\NetworkSecurity\V1\SACRealm[] $sac_realms + * The list of SACRealms. + * @type string $next_page_token + * A token identifying a page of results the server should return. + * @type string[] $unreachable + * Locations that could not be reached. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networksecurity\V1\SseRealm::initOnce(); + parent::__construct($data); + } + + /** + * The list of SACRealms. + * + * Generated from protobuf field repeated .google.cloud.networksecurity.v1.SACRealm sac_realms = 1; + * @return RepeatedField<\Google\Cloud\NetworkSecurity\V1\SACRealm> + */ + public function getSacRealms() + { + return $this->sac_realms; + } + + /** + * The list of SACRealms. + * + * Generated from protobuf field repeated .google.cloud.networksecurity.v1.SACRealm sac_realms = 1; + * @param \Google\Cloud\NetworkSecurity\V1\SACRealm[] $var + * @return $this + */ + public function setSacRealms($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\NetworkSecurity\V1\SACRealm::class); + $this->sac_realms = $arr; + + return $this; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token identifying a page of results the server should 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; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @return RepeatedField + */ + public function getUnreachable() + { + return $this->unreachable; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @param string[] $var + * @return $this + */ + public function setUnreachable($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachable = $arr; + + return $this; + } + +} + diff --git a/NetworkSecurity/src/V1/ListSecurityProfileGroupsRequest.php b/NetworkSecurity/src/V1/ListSecurityProfileGroupsRequest.php index 05b5eba79b98..5fff573f7f30 100644 --- a/NetworkSecurity/src/V1/ListSecurityProfileGroupsRequest.php +++ b/NetworkSecurity/src/V1/ListSecurityProfileGroupsRequest.php @@ -43,7 +43,7 @@ class ListSecurityProfileGroupsRequest extends \Google\Protobuf\Internal\Message * @param string $parent Required. The project or organization and location from which the * SecurityProfileGroups should be listed, specified in the format * `projects|organizations/*/locations/{location}`. Please see - * {@see OrganizationSecurityProfileGroupServiceClient::organizationLocationName()} for help formatting this field. + * {@see SecurityProfileGroupServiceClient::organizationLocationName()} for help formatting this field. * * @return \Google\Cloud\NetworkSecurity\V1\ListSecurityProfileGroupsRequest * diff --git a/NetworkSecurity/src/V1/ListSecurityProfilesRequest.php b/NetworkSecurity/src/V1/ListSecurityProfilesRequest.php index 36fd2cca3aea..9babae30f31b 100644 --- a/NetworkSecurity/src/V1/ListSecurityProfilesRequest.php +++ b/NetworkSecurity/src/V1/ListSecurityProfilesRequest.php @@ -43,7 +43,7 @@ class ListSecurityProfilesRequest extends \Google\Protobuf\Internal\Message * @param string $parent Required. The project or organization and location from which the * SecurityProfiles should be listed, specified in the format * `projects|organizations/*/locations/{location}`. Please see - * {@see OrganizationSecurityProfileGroupServiceClient::organizationLocationName()} for help formatting this field. + * {@see SecurityProfileGroupServiceClient::organizationLocationName()} for help formatting this field. * * @return \Google\Cloud\NetworkSecurity\V1\ListSecurityProfilesRequest * diff --git a/NetworkSecurity/src/V1/SACAttachment.php b/NetworkSecurity/src/V1/SACAttachment.php new file mode 100644 index 000000000000..9e48497566bd --- /dev/null +++ b/NetworkSecurity/src/V1/SACAttachment.php @@ -0,0 +1,313 @@ +google.cloud.networksecurity.v1.SACAttachment + */ +class SACAttachment extends \Google\Protobuf\Internal\Message +{ + /** + * Identifier. Resource name, in the form + * `projects/{project}/locations/{location}/sacAttachments/{sac_attachment}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Output only. Timestamp when the attachment was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. Timestamp when the attachment was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Optional. Optional list of labels applied to the resource. + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + /** + * Required. SAC Realm which owns the attachment. This can be input as an ID + * or a full resource name. The output always has the form + * `projects/{project_number}/locations/{location}/sacRealms/{sac_realm}`. + * + * Generated from protobuf field string sac_realm = 5 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $sac_realm = ''; + /** + * Required. NCC Gateway associated with the attachment. This can be input as + * an ID or a full resource name. The output always has the form + * `projects/{project_number}/locations/{location}/spokes/{ncc_gateway}`. + * + * Generated from protobuf field string ncc_gateway = 6 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $ncc_gateway = ''; + /** + * Output only. State of the attachment. + * + * Generated from protobuf field .google.cloud.networksecurity.v1.SACAttachment.State state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Identifier. Resource name, in the form + * `projects/{project}/locations/{location}/sacAttachments/{sac_attachment}`. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Timestamp when the attachment was created. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. Timestamp when the attachment was last updated. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. Optional list of labels applied to the resource. + * @type string $sac_realm + * Required. SAC Realm which owns the attachment. This can be input as an ID + * or a full resource name. The output always has the form + * `projects/{project_number}/locations/{location}/sacRealms/{sac_realm}`. + * @type string $ncc_gateway + * Required. NCC Gateway associated with the attachment. This can be input as + * an ID or a full resource name. The output always has the form + * `projects/{project_number}/locations/{location}/spokes/{ncc_gateway}`. + * @type int $state + * Output only. State of the attachment. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networksecurity\V1\SseRealm::initOnce(); + parent::__construct($data); + } + + /** + * Identifier. Resource name, in the form + * `projects/{project}/locations/{location}/sacAttachments/{sac_attachment}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Identifier. Resource name, in the form + * `projects/{project}/locations/{location}/sacAttachments/{sac_attachment}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. Timestamp when the attachment was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.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. Timestamp when the attachment was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.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. Timestamp when the attachment was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.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. Timestamp when the attachment was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.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; + } + + /** + * Optional. Optional list of labels applied to the resource. + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. Optional list of labels applied to the resource. + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * Required. SAC Realm which owns the attachment. This can be input as an ID + * or a full resource name. The output always has the form + * `projects/{project_number}/locations/{location}/sacRealms/{sac_realm}`. + * + * Generated from protobuf field string sac_realm = 5 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getSacRealm() + { + return $this->sac_realm; + } + + /** + * Required. SAC Realm which owns the attachment. This can be input as an ID + * or a full resource name. The output always has the form + * `projects/{project_number}/locations/{location}/sacRealms/{sac_realm}`. + * + * Generated from protobuf field string sac_realm = 5 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setSacRealm($var) + { + GPBUtil::checkString($var, True); + $this->sac_realm = $var; + + return $this; + } + + /** + * Required. NCC Gateway associated with the attachment. This can be input as + * an ID or a full resource name. The output always has the form + * `projects/{project_number}/locations/{location}/spokes/{ncc_gateway}`. + * + * Generated from protobuf field string ncc_gateway = 6 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getNccGateway() + { + return $this->ncc_gateway; + } + + /** + * Required. NCC Gateway associated with the attachment. This can be input as + * an ID or a full resource name. The output always has the form + * `projects/{project_number}/locations/{location}/spokes/{ncc_gateway}`. + * + * Generated from protobuf field string ncc_gateway = 6 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setNccGateway($var) + { + GPBUtil::checkString($var, True); + $this->ncc_gateway = $var; + + return $this; + } + + /** + * Output only. State of the attachment. + * + * Generated from protobuf field .google.cloud.networksecurity.v1.SACAttachment.State state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. State of the attachment. + * + * Generated from protobuf field .google.cloud.networksecurity.v1.SACAttachment.State state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\NetworkSecurity\V1\SACAttachment\State::class); + $this->state = $var; + + return $this; + } + +} + diff --git a/NetworkSecurity/src/V1/SACAttachment/State.php b/NetworkSecurity/src/V1/SACAttachment/State.php new file mode 100644 index 000000000000..5970ed14b9f3 --- /dev/null +++ b/NetworkSecurity/src/V1/SACAttachment/State.php @@ -0,0 +1,68 @@ +google.cloud.networksecurity.v1.SACAttachment.State + */ +class State +{ + /** + * No state specified. This should not be used. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * Has never been attached to a partner. + * + * Generated from protobuf enum PENDING_PARTNER_ATTACHMENT = 1; + */ + const PENDING_PARTNER_ATTACHMENT = 1; + /** + * Currently attached to a partner. + * + * Generated from protobuf enum PARTNER_ATTACHED = 2; + */ + const PARTNER_ATTACHED = 2; + /** + * Was once attached to a partner but has been detached. + * + * Generated from protobuf enum PARTNER_DETACHED = 3; + */ + const PARTNER_DETACHED = 3; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::PENDING_PARTNER_ATTACHMENT => 'PENDING_PARTNER_ATTACHMENT', + self::PARTNER_ATTACHED => 'PARTNER_ATTACHED', + self::PARTNER_DETACHED => 'PARTNER_DETACHED', + ]; + + 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/NetworkSecurity/src/V1/SACRealm.php b/NetworkSecurity/src/V1/SACRealm.php new file mode 100644 index 000000000000..ffc8878d135a --- /dev/null +++ b/NetworkSecurity/src/V1/SACRealm.php @@ -0,0 +1,307 @@ +google.cloud.networksecurity.v1.SACRealm + */ +class SACRealm extends \Google\Protobuf\Internal\Message +{ + /** + * Identifier. Resource name, in the form + * `projects/{project}/locations/global/sacRealms/{sacRealm}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Output only. Timestamp when the realm was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. Timestamp when the realm was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Optional. Optional list of labels applied to the resource. + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + /** + * Immutable. SSE service provider associated with the realm. + * + * Generated from protobuf field .google.cloud.networksecurity.v1.SACRealm.SecurityService security_service = 5 [(.google.api.field_behavior) = IMMUTABLE]; + */ + protected $security_service = 0; + /** + * Output only. Key to be shared with SSE service provider during pairing. + * + * Generated from protobuf field .google.cloud.networksecurity.v1.SACRealm.PairingKey pairing_key = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $pairing_key = null; + /** + * Output only. State of the realm. + * + * Generated from protobuf field .google.cloud.networksecurity.v1.SACRealm.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Identifier. Resource name, in the form + * `projects/{project}/locations/global/sacRealms/{sacRealm}`. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Timestamp when the realm was created. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. Timestamp when the realm was last updated. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. Optional list of labels applied to the resource. + * @type int $security_service + * Immutable. SSE service provider associated with the realm. + * @type \Google\Cloud\NetworkSecurity\V1\SACRealm\PairingKey $pairing_key + * Output only. Key to be shared with SSE service provider during pairing. + * @type int $state + * Output only. State of the realm. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networksecurity\V1\SseRealm::initOnce(); + parent::__construct($data); + } + + /** + * Identifier. Resource name, in the form + * `projects/{project}/locations/global/sacRealms/{sacRealm}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Identifier. Resource name, in the form + * `projects/{project}/locations/global/sacRealms/{sacRealm}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. Timestamp when the realm was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.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. Timestamp when the realm was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.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. Timestamp when the realm was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.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. Timestamp when the realm was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.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; + } + + /** + * Optional. Optional list of labels applied to the resource. + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. Optional list of labels applied to the resource. + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * Immutable. SSE service provider associated with the realm. + * + * Generated from protobuf field .google.cloud.networksecurity.v1.SACRealm.SecurityService security_service = 5 [(.google.api.field_behavior) = IMMUTABLE]; + * @return int + */ + public function getSecurityService() + { + return $this->security_service; + } + + /** + * Immutable. SSE service provider associated with the realm. + * + * Generated from protobuf field .google.cloud.networksecurity.v1.SACRealm.SecurityService security_service = 5 [(.google.api.field_behavior) = IMMUTABLE]; + * @param int $var + * @return $this + */ + public function setSecurityService($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\NetworkSecurity\V1\SACRealm\SecurityService::class); + $this->security_service = $var; + + return $this; + } + + /** + * Output only. Key to be shared with SSE service provider during pairing. + * + * Generated from protobuf field .google.cloud.networksecurity.v1.SACRealm.PairingKey pairing_key = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\NetworkSecurity\V1\SACRealm\PairingKey|null + */ + public function getPairingKey() + { + return $this->pairing_key; + } + + public function hasPairingKey() + { + return isset($this->pairing_key); + } + + public function clearPairingKey() + { + unset($this->pairing_key); + } + + /** + * Output only. Key to be shared with SSE service provider during pairing. + * + * Generated from protobuf field .google.cloud.networksecurity.v1.SACRealm.PairingKey pairing_key = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\NetworkSecurity\V1\SACRealm\PairingKey $var + * @return $this + */ + public function setPairingKey($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\NetworkSecurity\V1\SACRealm\PairingKey::class); + $this->pairing_key = $var; + + return $this; + } + + /** + * Output only. State of the realm. + * + * Generated from protobuf field .google.cloud.networksecurity.v1.SACRealm.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. State of the realm. + * + * Generated from protobuf field .google.cloud.networksecurity.v1.SACRealm.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\NetworkSecurity\V1\SACRealm\State::class); + $this->state = $var; + + return $this; + } + +} + diff --git a/NetworkSecurity/src/V1/SACRealm/PairingKey.php b/NetworkSecurity/src/V1/SACRealm/PairingKey.php new file mode 100644 index 000000000000..cfe32d60136f --- /dev/null +++ b/NetworkSecurity/src/V1/SACRealm/PairingKey.php @@ -0,0 +1,115 @@ +google.cloud.networksecurity.v1.SACRealm.PairingKey + */ +class PairingKey extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Key value. + * + * Generated from protobuf field string key = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $key = ''; + /** + * Output only. Timestamp in UTC of when this resource is considered + * expired. It expires 7 days after creation. + * + * Generated from protobuf field .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $expire_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $key + * Output only. Key value. + * @type \Google\Protobuf\Timestamp $expire_time + * Output only. Timestamp in UTC of when this resource is considered + * expired. It expires 7 days after creation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Networksecurity\V1\SseRealm::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Key value. + * + * Generated from protobuf field string key = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getKey() + { + return $this->key; + } + + /** + * Output only. Key value. + * + * Generated from protobuf field string key = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setKey($var) + { + GPBUtil::checkString($var, True); + $this->key = $var; + + return $this; + } + + /** + * Output only. Timestamp in UTC of when this resource is considered + * expired. It expires 7 days after creation. + * + * Generated from protobuf field .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getExpireTime() + { + return $this->expire_time; + } + + public function hasExpireTime() + { + return isset($this->expire_time); + } + + public function clearExpireTime() + { + unset($this->expire_time); + } + + /** + * Output only. Timestamp in UTC of when this resource is considered + * expired. It expires 7 days after creation. + * + * Generated from protobuf field .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setExpireTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->expire_time = $var; + + return $this; + } + +} + diff --git a/NetworkSecurity/src/V1/SACRealm/SecurityService.php b/NetworkSecurity/src/V1/SACRealm/SecurityService.php new file mode 100644 index 000000000000..f4e3fd8bc66a --- /dev/null +++ b/NetworkSecurity/src/V1/SACRealm/SecurityService.php @@ -0,0 +1,55 @@ +google.cloud.networksecurity.v1.SACRealm.SecurityService + */ +class SecurityService +{ + /** + * The default value. This value is used if the state is omitted. + * + * Generated from protobuf enum SECURITY_SERVICE_UNSPECIFIED = 0; + */ + const SECURITY_SERVICE_UNSPECIFIED = 0; + /** + * [Palo Alto Networks Prisma + * Access](https://www.paloaltonetworks.com/sase/access). + * + * Generated from protobuf enum PALO_ALTO_PRISMA_ACCESS = 1; + */ + const PALO_ALTO_PRISMA_ACCESS = 1; + + private static $valueToName = [ + self::SECURITY_SERVICE_UNSPECIFIED => 'SECURITY_SERVICE_UNSPECIFIED', + self::PALO_ALTO_PRISMA_ACCESS => 'PALO_ALTO_PRISMA_ACCESS', + ]; + + 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/NetworkSecurity/src/V1/SACRealm/State.php b/NetworkSecurity/src/V1/SACRealm/State.php new file mode 100644 index 000000000000..94275ba1f180 --- /dev/null +++ b/NetworkSecurity/src/V1/SACRealm/State.php @@ -0,0 +1,77 @@ +google.cloud.networksecurity.v1.SACRealm.State + */ +class State +{ + /** + * No state specified. This should not be used. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * Has never been attached to a partner. + * Used only for Prisma Access. + * + * Generated from protobuf enum PENDING_PARTNER_ATTACHMENT = 7; + */ + const PENDING_PARTNER_ATTACHMENT = 7; + /** + * Currently attached to a partner. + * + * Generated from protobuf enum PARTNER_ATTACHED = 1; + */ + const PARTNER_ATTACHED = 1; + /** + * Was once attached to a partner but has been detached. + * + * Generated from protobuf enum PARTNER_DETACHED = 2; + */ + const PARTNER_DETACHED = 2; + /** + * Is not attached to a partner and has an expired pairing key. + * Used only for Prisma Access. + * + * Generated from protobuf enum KEY_EXPIRED = 3; + */ + const KEY_EXPIRED = 3; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::PENDING_PARTNER_ATTACHMENT => 'PENDING_PARTNER_ATTACHMENT', + self::PARTNER_ATTACHED => 'PARTNER_ATTACHED', + self::PARTNER_DETACHED => 'PARTNER_DETACHED', + self::KEY_EXPIRED => 'KEY_EXPIRED', + ]; + + 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/NetworkSecurity/src/V1/gapic_metadata.json b/NetworkSecurity/src/V1/gapic_metadata.json index 17634b27cc60..ad0c32943526 100644 --- a/NetworkSecurity/src/V1/gapic_metadata.json +++ b/NetworkSecurity/src/V1/gapic_metadata.json @@ -237,6 +237,11 @@ "createFirewallEndpointAssociation" ] }, + "CreateProjectFirewallEndpoint": { + "methods": [ + "createProjectFirewallEndpoint" + ] + }, "DeleteFirewallEndpoint": { "methods": [ "deleteFirewallEndpoint" @@ -247,6 +252,11 @@ "deleteFirewallEndpointAssociation" ] }, + "DeleteProjectFirewallEndpoint": { + "methods": [ + "deleteProjectFirewallEndpoint" + ] + }, "GetFirewallEndpoint": { "methods": [ "getFirewallEndpoint" @@ -257,6 +267,11 @@ "getFirewallEndpointAssociation" ] }, + "GetProjectFirewallEndpoint": { + "methods": [ + "getProjectFirewallEndpoint" + ] + }, "ListFirewallEndpointAssociations": { "methods": [ "listFirewallEndpointAssociations" @@ -267,6 +282,11 @@ "listFirewallEndpoints" ] }, + "ListProjectFirewallEndpoints": { + "methods": [ + "listProjectFirewallEndpoints" + ] + }, "UpdateFirewallEndpoint": { "methods": [ "updateFirewallEndpoint" @@ -277,6 +297,11 @@ "updateFirewallEndpointAssociation" ] }, + "UpdateProjectFirewallEndpoint": { + "methods": [ + "updateProjectFirewallEndpoint" + ] + }, "GetLocation": { "methods": [ "getLocation" @@ -833,6 +858,90 @@ } } }, + "SecurityProfileGroupService": { + "clients": { + "grpc": { + "libraryClient": "SecurityProfileGroupServiceGapicClient", + "rpcs": { + "CreateSecurityProfile": { + "methods": [ + "createSecurityProfile" + ] + }, + "CreateSecurityProfileGroup": { + "methods": [ + "createSecurityProfileGroup" + ] + }, + "DeleteSecurityProfile": { + "methods": [ + "deleteSecurityProfile" + ] + }, + "DeleteSecurityProfileGroup": { + "methods": [ + "deleteSecurityProfileGroup" + ] + }, + "GetSecurityProfile": { + "methods": [ + "getSecurityProfile" + ] + }, + "GetSecurityProfileGroup": { + "methods": [ + "getSecurityProfileGroup" + ] + }, + "ListSecurityProfileGroups": { + "methods": [ + "listSecurityProfileGroups" + ] + }, + "ListSecurityProfiles": { + "methods": [ + "listSecurityProfiles" + ] + }, + "UpdateSecurityProfile": { + "methods": [ + "updateSecurityProfile" + ] + }, + "UpdateSecurityProfileGroup": { + "methods": [ + "updateSecurityProfileGroup" + ] + }, + "GetLocation": { + "methods": [ + "getLocation" + ] + }, + "ListLocations": { + "methods": [ + "listLocations" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + } + } + } + } + }, "OrganizationSecurityProfileGroupService": { "clients": { "grpc": { @@ -916,6 +1025,80 @@ } } } + }, + "SSERealmService": { + "clients": { + "grpc": { + "libraryClient": "SSERealmServiceGapicClient", + "rpcs": { + "CreateSACAttachment": { + "methods": [ + "createSACAttachment" + ] + }, + "CreateSACRealm": { + "methods": [ + "createSACRealm" + ] + }, + "DeleteSACAttachment": { + "methods": [ + "deleteSACAttachment" + ] + }, + "DeleteSACRealm": { + "methods": [ + "deleteSACRealm" + ] + }, + "GetSACAttachment": { + "methods": [ + "getSACAttachment" + ] + }, + "GetSACRealm": { + "methods": [ + "getSACRealm" + ] + }, + "ListSACAttachments": { + "methods": [ + "listSACAttachments" + ] + }, + "ListSACRealms": { + "methods": [ + "listSACRealms" + ] + }, + "GetLocation": { + "methods": [ + "getLocation" + ] + }, + "ListLocations": { + "methods": [ + "listLocations" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + } + } + } + } } } } \ No newline at end of file diff --git a/NetworkSecurity/src/V1/resources/address_group_service_rest_client_config.php b/NetworkSecurity/src/V1/resources/address_group_service_rest_client_config.php index b061a0b0b383..421ebef64327 100644 --- a/NetworkSecurity/src/V1/resources/address_group_service_rest_client_config.php +++ b/NetworkSecurity/src/V1/resources/address_group_service_rest_client_config.php @@ -46,7 +46,7 @@ 'additionalBindings' => [ [ 'method' => 'get', - 'uriTemplate' => '/v1/{name=organizations/*/locations/*}', + 'uriTemplate' => '/v1/{name=organizations/*}/locations', ], ], 'placeholders' => [ @@ -177,10 +177,6 @@ 'method' => 'get', 'uriTemplate' => '/v1/{resource=projects/*/locations/*/authorizationPolicies/*}:getIamPolicy', ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{resource=organizations/*/locations/*/addressGroups/*}:getIamPolicy', - ], [ 'method' => 'get', 'uriTemplate' => '/v1/{resource=projects/*/locations/*/serverTlsPolicies/*}:getIamPolicy', @@ -212,11 +208,6 @@ 'uriTemplate' => '/v1/{resource=projects/*/locations/*/authorizationPolicies/*}:setIamPolicy', 'body' => '*', ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{resource=organizations/*/locations/*/addressGroups/*}:setIamPolicy', - 'body' => '*', - ], [ 'method' => 'post', 'uriTemplate' => '/v1/{resource=projects/*/locations/*/serverTlsPolicies/*}:setIamPolicy', @@ -248,12 +239,12 @@ 'additionalBindings' => [ [ 'method' => 'post', - 'uriTemplate' => '/v1/{resource=projects/*/locations/*/authorizationPolicies/*}:testIamPermissions', + 'uriTemplate' => '/v1/{resource=organizations/*/locations/*/addressGroups/*}:testIamPermissions', 'body' => '*', ], [ 'method' => 'post', - 'uriTemplate' => '/v1/{resource=organizations/*/locations/*/addressGroups/*}:testIamPermissions', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/authorizationPolicies/*}:testIamPermissions', 'body' => '*', ], [ diff --git a/NetworkSecurity/src/V1/resources/dns_threat_detector_service_rest_client_config.php b/NetworkSecurity/src/V1/resources/dns_threat_detector_service_rest_client_config.php index 519f9f361903..3f448775565f 100644 --- a/NetworkSecurity/src/V1/resources/dns_threat_detector_service_rest_client_config.php +++ b/NetworkSecurity/src/V1/resources/dns_threat_detector_service_rest_client_config.php @@ -46,7 +46,7 @@ 'additionalBindings' => [ [ 'method' => 'get', - 'uriTemplate' => '/v1/{name=organizations/*/locations/*}', + 'uriTemplate' => '/v1/{name=organizations/*}/locations', ], ], 'placeholders' => [ @@ -127,10 +127,6 @@ 'method' => 'get', 'uriTemplate' => '/v1/{resource=projects/*/locations/*/authorizationPolicies/*}:getIamPolicy', ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{resource=organizations/*/locations/*/addressGroups/*}:getIamPolicy', - ], [ 'method' => 'get', 'uriTemplate' => '/v1/{resource=projects/*/locations/*/serverTlsPolicies/*}:getIamPolicy', @@ -162,11 +158,6 @@ 'uriTemplate' => '/v1/{resource=projects/*/locations/*/authorizationPolicies/*}:setIamPolicy', 'body' => '*', ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{resource=organizations/*/locations/*/addressGroups/*}:setIamPolicy', - 'body' => '*', - ], [ 'method' => 'post', 'uriTemplate' => '/v1/{resource=projects/*/locations/*/serverTlsPolicies/*}:setIamPolicy', @@ -198,12 +189,12 @@ 'additionalBindings' => [ [ 'method' => 'post', - 'uriTemplate' => '/v1/{resource=projects/*/locations/*/authorizationPolicies/*}:testIamPermissions', + 'uriTemplate' => '/v1/{resource=organizations/*/locations/*/addressGroups/*}:testIamPermissions', 'body' => '*', ], [ 'method' => 'post', - 'uriTemplate' => '/v1/{resource=organizations/*/locations/*/addressGroups/*}:testIamPermissions', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/authorizationPolicies/*}:testIamPermissions', 'body' => '*', ], [ diff --git a/NetworkSecurity/src/V1/resources/firewall_activation_client_config.json b/NetworkSecurity/src/V1/resources/firewall_activation_client_config.json index b8cf4aa877af..c6dcb81f62a3 100644 --- a/NetworkSecurity/src/V1/resources/firewall_activation_client_config.json +++ b/NetworkSecurity/src/V1/resources/firewall_activation_client_config.json @@ -26,6 +26,11 @@ "retry_codes_name": "no_retry_codes", "retry_params_name": "no_retry_params" }, + "CreateProjectFirewallEndpoint": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, "DeleteFirewallEndpoint": { "timeout_millis": 60000, "retry_codes_name": "no_retry_codes", @@ -36,6 +41,11 @@ "retry_codes_name": "no_retry_codes", "retry_params_name": "no_retry_params" }, + "DeleteProjectFirewallEndpoint": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, "GetFirewallEndpoint": { "timeout_millis": 60000, "retry_codes_name": "no_retry_codes", @@ -46,6 +56,11 @@ "retry_codes_name": "no_retry_codes", "retry_params_name": "no_retry_params" }, + "GetProjectFirewallEndpoint": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, "ListFirewallEndpointAssociations": { "timeout_millis": 60000, "retry_codes_name": "no_retry_codes", @@ -56,6 +71,11 @@ "retry_codes_name": "no_retry_codes", "retry_params_name": "no_retry_params" }, + "ListProjectFirewallEndpoints": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, "UpdateFirewallEndpoint": { "timeout_millis": 60000, "retry_codes_name": "no_retry_codes", @@ -66,6 +86,11 @@ "retry_codes_name": "no_retry_codes", "retry_params_name": "no_retry_params" }, + "UpdateProjectFirewallEndpoint": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, "GetLocation": { "timeout_millis": 60000, "retry_codes_name": "no_retry_codes", diff --git a/NetworkSecurity/src/V1/resources/firewall_activation_descriptor_config.php b/NetworkSecurity/src/V1/resources/firewall_activation_descriptor_config.php index 334dd296abe0..47db3094caf6 100644 --- a/NetworkSecurity/src/V1/resources/firewall_activation_descriptor_config.php +++ b/NetworkSecurity/src/V1/resources/firewall_activation_descriptor_config.php @@ -61,6 +61,25 @@ ], ], ], + 'CreateProjectFirewallEndpoint' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\NetworkSecurity\V1\FirewallEndpoint', + 'metadataReturnType' => '\Google\Cloud\NetworkSecurity\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], 'DeleteFirewallEndpoint' => [ 'longRunning' => [ 'operationReturnType' => '\Google\Protobuf\GPBEmpty', @@ -99,6 +118,25 @@ ], ], ], + 'DeleteProjectFirewallEndpoint' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\NetworkSecurity\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], 'UpdateFirewallEndpoint' => [ 'longRunning' => [ 'operationReturnType' => '\Google\Cloud\NetworkSecurity\V1\FirewallEndpoint', @@ -139,6 +177,26 @@ ], ], ], + 'UpdateProjectFirewallEndpoint' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\NetworkSecurity\V1\FirewallEndpoint', + 'metadataReturnType' => '\Google\Cloud\NetworkSecurity\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'firewall_endpoint.name', + 'fieldAccessors' => [ + 'getFirewallEndpoint', + 'getName', + ], + ], + ], + ], 'GetFirewallEndpoint' => [ 'callType' => \Google\ApiCore\Call::UNARY_CALL, 'responseType' => 'Google\Cloud\NetworkSecurity\V1\FirewallEndpoint', @@ -163,6 +221,18 @@ ], ], ], + 'GetProjectFirewallEndpoint' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\NetworkSecurity\V1\FirewallEndpoint', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], 'ListFirewallEndpointAssociations' => [ 'pageStreaming' => [ 'requestPageTokenGetMethod' => 'getPageToken', @@ -203,6 +273,26 @@ ], ], ], + 'ListProjectFirewallEndpoints' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getFirewallEndpoints', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\NetworkSecurity\V1\ListFirewallEndpointsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], 'GetLocation' => [ 'callType' => \Google\ApiCore\Call::UNARY_CALL, 'responseType' => 'Google\Cloud\Location\Location', diff --git a/NetworkSecurity/src/V1/resources/firewall_activation_rest_client_config.php b/NetworkSecurity/src/V1/resources/firewall_activation_rest_client_config.php index 9d2202b96533..f80e9f243b4e 100644 --- a/NetworkSecurity/src/V1/resources/firewall_activation_rest_client_config.php +++ b/NetworkSecurity/src/V1/resources/firewall_activation_rest_client_config.php @@ -46,7 +46,7 @@ 'additionalBindings' => [ [ 'method' => 'get', - 'uriTemplate' => '/v1/{name=organizations/*/locations/*}', + 'uriTemplate' => '/v1/{name=organizations/*}/locations', ], ], 'placeholders' => [ @@ -86,6 +86,21 @@ ], ], ], + 'CreateProjectFirewallEndpoint' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/firewallEndpoints', + 'body' => 'firewall_endpoint', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'firewall_endpoint_id', + ], + ], 'DeleteFirewallEndpoint' => [ 'method' => 'delete', 'uriTemplate' => '/v1/{name=organizations/*/locations/*/firewallEndpoints/*}', @@ -108,6 +123,17 @@ ], ], ], + 'DeleteProjectFirewallEndpoint' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/firewallEndpoints/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'GetFirewallEndpoint' => [ 'method' => 'get', 'uriTemplate' => '/v1/{name=organizations/*/locations/*/firewallEndpoints/*}', @@ -130,6 +156,17 @@ ], ], ], + 'GetProjectFirewallEndpoint' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/firewallEndpoints/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'ListFirewallEndpointAssociations' => [ 'method' => 'get', 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/firewallEndpointAssociations', @@ -152,6 +189,17 @@ ], ], ], + 'ListProjectFirewallEndpoints' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/firewallEndpoints', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], 'UpdateFirewallEndpoint' => [ 'method' => 'patch', 'uriTemplate' => '/v1/{firewall_endpoint.name=organizations/*/locations/*/firewallEndpoints/*}', @@ -184,6 +232,22 @@ 'update_mask', ], ], + 'UpdateProjectFirewallEndpoint' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{firewall_endpoint.name=projects/*/locations/*/firewallEndpoints/*}', + 'body' => 'firewall_endpoint', + 'placeholders' => [ + 'firewall_endpoint.name' => [ + 'getters' => [ + 'getFirewallEndpoint', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], ], 'google.iam.v1.IAMPolicy' => [ 'GetIamPolicy' => [ @@ -194,10 +258,6 @@ 'method' => 'get', 'uriTemplate' => '/v1/{resource=projects/*/locations/*/authorizationPolicies/*}:getIamPolicy', ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{resource=organizations/*/locations/*/addressGroups/*}:getIamPolicy', - ], [ 'method' => 'get', 'uriTemplate' => '/v1/{resource=projects/*/locations/*/serverTlsPolicies/*}:getIamPolicy', @@ -229,11 +289,6 @@ 'uriTemplate' => '/v1/{resource=projects/*/locations/*/authorizationPolicies/*}:setIamPolicy', 'body' => '*', ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{resource=organizations/*/locations/*/addressGroups/*}:setIamPolicy', - 'body' => '*', - ], [ 'method' => 'post', 'uriTemplate' => '/v1/{resource=projects/*/locations/*/serverTlsPolicies/*}:setIamPolicy', @@ -265,12 +320,12 @@ 'additionalBindings' => [ [ 'method' => 'post', - 'uriTemplate' => '/v1/{resource=projects/*/locations/*/authorizationPolicies/*}:testIamPermissions', + 'uriTemplate' => '/v1/{resource=organizations/*/locations/*/addressGroups/*}:testIamPermissions', 'body' => '*', ], [ 'method' => 'post', - 'uriTemplate' => '/v1/{resource=organizations/*/locations/*/addressGroups/*}:testIamPermissions', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/authorizationPolicies/*}:testIamPermissions', 'body' => '*', ], [ diff --git a/NetworkSecurity/src/V1/resources/intercept_rest_client_config.php b/NetworkSecurity/src/V1/resources/intercept_rest_client_config.php index 9938b45c8a4b..82e20835eb0c 100644 --- a/NetworkSecurity/src/V1/resources/intercept_rest_client_config.php +++ b/NetworkSecurity/src/V1/resources/intercept_rest_client_config.php @@ -46,7 +46,7 @@ 'additionalBindings' => [ [ 'method' => 'get', - 'uriTemplate' => '/v1/{name=organizations/*/locations/*}', + 'uriTemplate' => '/v1/{name=organizations/*}/locations', ], ], 'placeholders' => [ @@ -310,10 +310,6 @@ 'method' => 'get', 'uriTemplate' => '/v1/{resource=projects/*/locations/*/authorizationPolicies/*}:getIamPolicy', ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{resource=organizations/*/locations/*/addressGroups/*}:getIamPolicy', - ], [ 'method' => 'get', 'uriTemplate' => '/v1/{resource=projects/*/locations/*/serverTlsPolicies/*}:getIamPolicy', @@ -345,11 +341,6 @@ 'uriTemplate' => '/v1/{resource=projects/*/locations/*/authorizationPolicies/*}:setIamPolicy', 'body' => '*', ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{resource=organizations/*/locations/*/addressGroups/*}:setIamPolicy', - 'body' => '*', - ], [ 'method' => 'post', 'uriTemplate' => '/v1/{resource=projects/*/locations/*/serverTlsPolicies/*}:setIamPolicy', @@ -381,12 +372,12 @@ 'additionalBindings' => [ [ 'method' => 'post', - 'uriTemplate' => '/v1/{resource=projects/*/locations/*/authorizationPolicies/*}:testIamPermissions', + 'uriTemplate' => '/v1/{resource=organizations/*/locations/*/addressGroups/*}:testIamPermissions', 'body' => '*', ], [ 'method' => 'post', - 'uriTemplate' => '/v1/{resource=organizations/*/locations/*/addressGroups/*}:testIamPermissions', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/authorizationPolicies/*}:testIamPermissions', 'body' => '*', ], [ diff --git a/NetworkSecurity/src/V1/resources/mirroring_rest_client_config.php b/NetworkSecurity/src/V1/resources/mirroring_rest_client_config.php index ed98851ee68b..31f478202122 100644 --- a/NetworkSecurity/src/V1/resources/mirroring_rest_client_config.php +++ b/NetworkSecurity/src/V1/resources/mirroring_rest_client_config.php @@ -46,7 +46,7 @@ 'additionalBindings' => [ [ 'method' => 'get', - 'uriTemplate' => '/v1/{name=organizations/*/locations/*}', + 'uriTemplate' => '/v1/{name=organizations/*}/locations', ], ], 'placeholders' => [ @@ -310,10 +310,6 @@ 'method' => 'get', 'uriTemplate' => '/v1/{resource=projects/*/locations/*/authorizationPolicies/*}:getIamPolicy', ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{resource=organizations/*/locations/*/addressGroups/*}:getIamPolicy', - ], [ 'method' => 'get', 'uriTemplate' => '/v1/{resource=projects/*/locations/*/serverTlsPolicies/*}:getIamPolicy', @@ -345,11 +341,6 @@ 'uriTemplate' => '/v1/{resource=projects/*/locations/*/authorizationPolicies/*}:setIamPolicy', 'body' => '*', ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{resource=organizations/*/locations/*/addressGroups/*}:setIamPolicy', - 'body' => '*', - ], [ 'method' => 'post', 'uriTemplate' => '/v1/{resource=projects/*/locations/*/serverTlsPolicies/*}:setIamPolicy', @@ -381,12 +372,12 @@ 'additionalBindings' => [ [ 'method' => 'post', - 'uriTemplate' => '/v1/{resource=projects/*/locations/*/authorizationPolicies/*}:testIamPermissions', + 'uriTemplate' => '/v1/{resource=organizations/*/locations/*/addressGroups/*}:testIamPermissions', 'body' => '*', ], [ 'method' => 'post', - 'uriTemplate' => '/v1/{resource=organizations/*/locations/*/addressGroups/*}:testIamPermissions', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/authorizationPolicies/*}:testIamPermissions', 'body' => '*', ], [ diff --git a/NetworkSecurity/src/V1/resources/network_security_rest_client_config.php b/NetworkSecurity/src/V1/resources/network_security_rest_client_config.php index 6d22caeb9540..2454db724fd9 100644 --- a/NetworkSecurity/src/V1/resources/network_security_rest_client_config.php +++ b/NetworkSecurity/src/V1/resources/network_security_rest_client_config.php @@ -46,7 +46,7 @@ 'additionalBindings' => [ [ 'method' => 'get', - 'uriTemplate' => '/v1/{name=organizations/*/locations/*}', + 'uriTemplate' => '/v1/{name=organizations/*}/locations', ], ], 'placeholders' => [ @@ -618,10 +618,6 @@ 'method' => 'get', 'uriTemplate' => '/v1/{resource=projects/*/locations/*/authorizationPolicies/*}:getIamPolicy', ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{resource=organizations/*/locations/*/addressGroups/*}:getIamPolicy', - ], [ 'method' => 'get', 'uriTemplate' => '/v1/{resource=projects/*/locations/*/serverTlsPolicies/*}:getIamPolicy', @@ -653,11 +649,6 @@ 'uriTemplate' => '/v1/{resource=projects/*/locations/*/authorizationPolicies/*}:setIamPolicy', 'body' => '*', ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{resource=organizations/*/locations/*/addressGroups/*}:setIamPolicy', - 'body' => '*', - ], [ 'method' => 'post', 'uriTemplate' => '/v1/{resource=projects/*/locations/*/serverTlsPolicies/*}:setIamPolicy', @@ -689,12 +680,12 @@ 'additionalBindings' => [ [ 'method' => 'post', - 'uriTemplate' => '/v1/{resource=projects/*/locations/*/authorizationPolicies/*}:testIamPermissions', + 'uriTemplate' => '/v1/{resource=organizations/*/locations/*/addressGroups/*}:testIamPermissions', 'body' => '*', ], [ 'method' => 'post', - 'uriTemplate' => '/v1/{resource=organizations/*/locations/*/addressGroups/*}:testIamPermissions', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/authorizationPolicies/*}:testIamPermissions', 'body' => '*', ], [ diff --git a/NetworkSecurity/src/V1/resources/organization_address_group_service_rest_client_config.php b/NetworkSecurity/src/V1/resources/organization_address_group_service_rest_client_config.php index 9fe71d6617dd..94cfd455d640 100644 --- a/NetworkSecurity/src/V1/resources/organization_address_group_service_rest_client_config.php +++ b/NetworkSecurity/src/V1/resources/organization_address_group_service_rest_client_config.php @@ -46,7 +46,7 @@ 'additionalBindings' => [ [ 'method' => 'get', - 'uriTemplate' => '/v1/{name=organizations/*/locations/*}', + 'uriTemplate' => '/v1/{name=organizations/*}/locations', ], ], 'placeholders' => [ @@ -177,10 +177,6 @@ 'method' => 'get', 'uriTemplate' => '/v1/{resource=projects/*/locations/*/authorizationPolicies/*}:getIamPolicy', ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{resource=organizations/*/locations/*/addressGroups/*}:getIamPolicy', - ], [ 'method' => 'get', 'uriTemplate' => '/v1/{resource=projects/*/locations/*/serverTlsPolicies/*}:getIamPolicy', @@ -212,11 +208,6 @@ 'uriTemplate' => '/v1/{resource=projects/*/locations/*/authorizationPolicies/*}:setIamPolicy', 'body' => '*', ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{resource=organizations/*/locations/*/addressGroups/*}:setIamPolicy', - 'body' => '*', - ], [ 'method' => 'post', 'uriTemplate' => '/v1/{resource=projects/*/locations/*/serverTlsPolicies/*}:setIamPolicy', @@ -248,12 +239,12 @@ 'additionalBindings' => [ [ 'method' => 'post', - 'uriTemplate' => '/v1/{resource=projects/*/locations/*/authorizationPolicies/*}:testIamPermissions', + 'uriTemplate' => '/v1/{resource=organizations/*/locations/*/addressGroups/*}:testIamPermissions', 'body' => '*', ], [ 'method' => 'post', - 'uriTemplate' => '/v1/{resource=organizations/*/locations/*/addressGroups/*}:testIamPermissions', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/authorizationPolicies/*}:testIamPermissions', 'body' => '*', ], [ diff --git a/NetworkSecurity/src/V1/resources/organization_security_profile_group_service_rest_client_config.php b/NetworkSecurity/src/V1/resources/organization_security_profile_group_service_rest_client_config.php index 5064d17d535a..102388c4f401 100644 --- a/NetworkSecurity/src/V1/resources/organization_security_profile_group_service_rest_client_config.php +++ b/NetworkSecurity/src/V1/resources/organization_security_profile_group_service_rest_client_config.php @@ -46,7 +46,7 @@ 'additionalBindings' => [ [ 'method' => 'get', - 'uriTemplate' => '/v1/{name=organizations/*/locations/*}', + 'uriTemplate' => '/v1/{name=organizations/*}/locations', ], ], 'placeholders' => [ @@ -197,10 +197,6 @@ 'method' => 'get', 'uriTemplate' => '/v1/{resource=projects/*/locations/*/authorizationPolicies/*}:getIamPolicy', ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{resource=organizations/*/locations/*/addressGroups/*}:getIamPolicy', - ], [ 'method' => 'get', 'uriTemplate' => '/v1/{resource=projects/*/locations/*/serverTlsPolicies/*}:getIamPolicy', @@ -232,11 +228,6 @@ 'uriTemplate' => '/v1/{resource=projects/*/locations/*/authorizationPolicies/*}:setIamPolicy', 'body' => '*', ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{resource=organizations/*/locations/*/addressGroups/*}:setIamPolicy', - 'body' => '*', - ], [ 'method' => 'post', 'uriTemplate' => '/v1/{resource=projects/*/locations/*/serverTlsPolicies/*}:setIamPolicy', @@ -268,12 +259,12 @@ 'additionalBindings' => [ [ 'method' => 'post', - 'uriTemplate' => '/v1/{resource=projects/*/locations/*/authorizationPolicies/*}:testIamPermissions', + 'uriTemplate' => '/v1/{resource=organizations/*/locations/*/addressGroups/*}:testIamPermissions', 'body' => '*', ], [ 'method' => 'post', - 'uriTemplate' => '/v1/{resource=organizations/*/locations/*/addressGroups/*}:testIamPermissions', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/authorizationPolicies/*}:testIamPermissions', 'body' => '*', ], [ diff --git a/NetworkSecurity/src/V1/resources/security_profile_group_service_client_config.json b/NetworkSecurity/src/V1/resources/security_profile_group_service_client_config.json new file mode 100644 index 000000000000..1fba1943ba5f --- /dev/null +++ b/NetworkSecurity/src/V1/resources/security_profile_group_service_client_config.json @@ -0,0 +1,97 @@ +{ + "interfaces": { + "google.cloud.networksecurity.v1.SecurityProfileGroupService": { + "retry_codes": { + "no_retry_codes": [] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + } + }, + "methods": { + "CreateSecurityProfile": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "CreateSecurityProfileGroup": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "DeleteSecurityProfile": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "DeleteSecurityProfileGroup": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "GetSecurityProfile": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "GetSecurityProfileGroup": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListSecurityProfileGroups": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListSecurityProfiles": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "UpdateSecurityProfile": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "UpdateSecurityProfileGroup": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "GetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "SetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "TestIamPermissions": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/NetworkSecurity/src/V1/resources/security_profile_group_service_descriptor_config.php b/NetworkSecurity/src/V1/resources/security_profile_group_service_descriptor_config.php new file mode 100644 index 000000000000..0c8c11776b9f --- /dev/null +++ b/NetworkSecurity/src/V1/resources/security_profile_group_service_descriptor_config.php @@ -0,0 +1,293 @@ + [ + 'google.cloud.networksecurity.v1.SecurityProfileGroupService' => [ + 'CreateSecurityProfile' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\NetworkSecurity\V1\SecurityProfile', + 'metadataReturnType' => '\Google\Cloud\NetworkSecurity\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'CreateSecurityProfileGroup' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\NetworkSecurity\V1\SecurityProfileGroup', + 'metadataReturnType' => '\Google\Cloud\NetworkSecurity\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteSecurityProfile' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\NetworkSecurity\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DeleteSecurityProfileGroup' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\NetworkSecurity\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'UpdateSecurityProfile' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\NetworkSecurity\V1\SecurityProfile', + 'metadataReturnType' => '\Google\Cloud\NetworkSecurity\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'security_profile.name', + 'fieldAccessors' => [ + 'getSecurityProfile', + 'getName', + ], + ], + ], + ], + 'UpdateSecurityProfileGroup' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\NetworkSecurity\V1\SecurityProfileGroup', + 'metadataReturnType' => '\Google\Cloud\NetworkSecurity\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'security_profile_group.name', + 'fieldAccessors' => [ + 'getSecurityProfileGroup', + 'getName', + ], + ], + ], + ], + 'GetSecurityProfile' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\NetworkSecurity\V1\SecurityProfile', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetSecurityProfileGroup' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\NetworkSecurity\V1\SecurityProfileGroup', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListSecurityProfileGroups' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getSecurityProfileGroups', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\NetworkSecurity\V1\ListSecurityProfileGroupsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListSecurityProfiles' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getSecurityProfiles', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\NetworkSecurity\V1\ListSecurityProfilesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'GetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + 'interfaceOverride' => 'google.iam.v1.IAMPolicy', + ], + 'SetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + 'interfaceOverride' => 'google.iam.v1.IAMPolicy', + ], + 'TestIamPermissions' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\TestIamPermissionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + 'interfaceOverride' => 'google.iam.v1.IAMPolicy', + ], + 'templateMap' => [ + 'interceptEndpointGroup' => 'projects/{project}/locations/{location}/interceptEndpointGroups/{intercept_endpoint_group}', + 'location' => 'projects/{project}/locations/{location}', + 'mirroringEndpointGroup' => 'projects/{project}/locations/{location}/mirroringEndpointGroups/{mirroring_endpoint_group}', + 'organizationLocation' => 'organizations/{organization}/locations/{location}', + 'organizationLocationSecurityProfile' => 'organizations/{organization}/locations/{location}/securityProfiles/{security_profile}', + 'organizationLocationSecurityProfileGroup' => 'organizations/{organization}/locations/{location}/securityProfileGroups/{security_profile_group}', + 'projectLocationSecurityProfile' => 'projects/{project}/locations/{location}/securityProfiles/{security_profile}', + 'projectLocationSecurityProfileGroup' => 'projects/{project}/locations/{location}/securityProfileGroups/{security_profile_group}', + 'securityProfile' => 'organizations/{organization}/locations/{location}/securityProfiles/{security_profile}', + 'securityProfileGroup' => 'organizations/{organization}/locations/{location}/securityProfileGroups/{security_profile_group}', + ], + ], + ], +]; diff --git a/NetworkSecurity/src/V1/resources/security_profile_group_service_rest_client_config.php b/NetworkSecurity/src/V1/resources/security_profile_group_service_rest_client_config.php new file mode 100644 index 000000000000..5c143f506e1b --- /dev/null +++ b/NetworkSecurity/src/V1/resources/security_profile_group_service_rest_client_config.php @@ -0,0 +1,369 @@ + [ + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=organizations/*/locations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*}/locations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=organizations/*}/locations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.cloud.networksecurity.v1.SecurityProfileGroupService' => [ + 'CreateSecurityProfile' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/securityProfiles', + 'body' => 'security_profile', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'security_profile_id', + ], + ], + 'CreateSecurityProfileGroup' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/securityProfileGroups', + 'body' => 'security_profile_group', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'security_profile_group_id', + ], + ], + 'DeleteSecurityProfile' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/securityProfiles/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteSecurityProfileGroup' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/securityProfileGroups/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetSecurityProfile' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/securityProfiles/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetSecurityProfileGroup' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/securityProfileGroups/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListSecurityProfileGroups' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/securityProfileGroups', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListSecurityProfiles' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/securityProfiles', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateSecurityProfile' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{security_profile.name=projects/*/locations/*/securityProfiles/*}', + 'body' => 'security_profile', + 'placeholders' => [ + 'security_profile.name' => [ + 'getters' => [ + 'getSecurityProfile', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + 'UpdateSecurityProfileGroup' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{security_profile_group.name=projects/*/locations/*/securityProfileGroups/*}', + 'body' => 'security_profile_group', + 'placeholders' => [ + 'security_profile_group.name' => [ + 'getters' => [ + 'getSecurityProfileGroup', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + ], + 'google.iam.v1.IAMPolicy' => [ + 'GetIamPolicy' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/addressGroups/*}:getIamPolicy', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/authorizationPolicies/*}:getIamPolicy', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/serverTlsPolicies/*}:getIamPolicy', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/clientTlsPolicies/*}:getIamPolicy', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/authzPolicies/*}:getIamPolicy', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/addressGroups/*}:setIamPolicy', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/authorizationPolicies/*}:setIamPolicy', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/serverTlsPolicies/*}:setIamPolicy', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/clientTlsPolicies/*}:setIamPolicy', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/authzPolicies/*}:setIamPolicy', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/addressGroups/*}:testIamPermissions', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=organizations/*/locations/*/addressGroups/*}:testIamPermissions', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/authorizationPolicies/*}:testIamPermissions', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/serverTlsPolicies/*}:testIamPermissions', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/clientTlsPolicies/*}:testIamPermissions', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/authzPolicies/*}:testIamPermissions', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}:cancel', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=organizations/*/locations/*/operations/*}:cancel', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteOperation' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=organizations/*/locations/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=organizations/*/locations/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=organizations/*/locations/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/NetworkSecurity/src/V1/resources/sse_realm_service_client_config.json b/NetworkSecurity/src/V1/resources/sse_realm_service_client_config.json new file mode 100644 index 000000000000..0f9901c94632 --- /dev/null +++ b/NetworkSecurity/src/V1/resources/sse_realm_service_client_config.json @@ -0,0 +1,87 @@ +{ + "interfaces": { + "google.cloud.networksecurity.v1.SSERealmService": { + "retry_codes": { + "no_retry_codes": [] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + } + }, + "methods": { + "CreateSACAttachment": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "CreateSACRealm": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "DeleteSACAttachment": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "DeleteSACRealm": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "GetSACAttachment": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "GetSACRealm": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListSACAttachments": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListSACRealms": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "GetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "SetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "TestIamPermissions": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/NetworkSecurity/src/V1/resources/sse_realm_service_descriptor_config.php b/NetworkSecurity/src/V1/resources/sse_realm_service_descriptor_config.php new file mode 100644 index 000000000000..b7e8f1af894b --- /dev/null +++ b/NetworkSecurity/src/V1/resources/sse_realm_service_descriptor_config.php @@ -0,0 +1,246 @@ + [ + 'google.cloud.networksecurity.v1.SSERealmService' => [ + 'CreateSACAttachment' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\NetworkSecurity\V1\SACAttachment', + 'metadataReturnType' => '\Google\Cloud\NetworkSecurity\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'CreateSACRealm' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\NetworkSecurity\V1\SACRealm', + 'metadataReturnType' => '\Google\Cloud\NetworkSecurity\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteSACAttachment' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\NetworkSecurity\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DeleteSACRealm' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\NetworkSecurity\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetSACAttachment' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\NetworkSecurity\V1\SACAttachment', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetSACRealm' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\NetworkSecurity\V1\SACRealm', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListSACAttachments' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getSacAttachments', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\NetworkSecurity\V1\ListSACAttachmentsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListSACRealms' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getSacRealms', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\NetworkSecurity\V1\ListSACRealmsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'GetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + 'interfaceOverride' => 'google.iam.v1.IAMPolicy', + ], + 'SetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + 'interfaceOverride' => 'google.iam.v1.IAMPolicy', + ], + 'TestIamPermissions' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Iam\V1\TestIamPermissionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + 'interfaceOverride' => 'google.iam.v1.IAMPolicy', + ], + 'templateMap' => [ + 'location' => 'projects/{project}/locations/{location}', + 'sACAttachment' => 'projects/{project}/locations/{location}/sacAttachments/{sac_attachment}', + 'sACRealm' => 'projects/{project}/locations/{location}/sacRealms/{sac_realm}', + ], + ], + ], +]; diff --git a/NetworkSecurity/src/V1/resources/sse_realm_service_rest_client_config.php b/NetworkSecurity/src/V1/resources/sse_realm_service_rest_client_config.php new file mode 100644 index 000000000000..bdca04501d7d --- /dev/null +++ b/NetworkSecurity/src/V1/resources/sse_realm_service_rest_client_config.php @@ -0,0 +1,337 @@ + [ + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=organizations/*/locations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*}/locations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=organizations/*}/locations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.cloud.networksecurity.v1.SSERealmService' => [ + 'CreateSACAttachment' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/sacAttachments', + 'body' => 'sac_attachment', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'sac_attachment_id', + ], + ], + 'CreateSACRealm' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/sacRealms', + 'body' => 'sac_realm', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'sac_realm_id', + ], + ], + 'DeleteSACAttachment' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/sacAttachments/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteSACRealm' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/sacRealms/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetSACAttachment' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/sacAttachments/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetSACRealm' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/sacRealms/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListSACAttachments' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/sacAttachments', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListSACRealms' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/sacRealms', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + ], + 'google.iam.v1.IAMPolicy' => [ + 'GetIamPolicy' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/addressGroups/*}:getIamPolicy', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/authorizationPolicies/*}:getIamPolicy', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/serverTlsPolicies/*}:getIamPolicy', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/clientTlsPolicies/*}:getIamPolicy', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/authzPolicies/*}:getIamPolicy', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/addressGroups/*}:setIamPolicy', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/authorizationPolicies/*}:setIamPolicy', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/serverTlsPolicies/*}:setIamPolicy', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/clientTlsPolicies/*}:setIamPolicy', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/authzPolicies/*}:setIamPolicy', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/addressGroups/*}:testIamPermissions', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=organizations/*/locations/*/addressGroups/*}:testIamPermissions', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/authorizationPolicies/*}:testIamPermissions', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/serverTlsPolicies/*}:testIamPermissions', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/clientTlsPolicies/*}:testIamPermissions', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/authzPolicies/*}:testIamPermissions', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}:cancel', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=organizations/*/locations/*/operations/*}:cancel', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteOperation' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=organizations/*/locations/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=organizations/*/locations/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}/operations', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=organizations/*/locations/*}/operations', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/NetworkSecurity/tests/Unit/V1/Client/FirewallActivationClientTest.php b/NetworkSecurity/tests/Unit/V1/Client/FirewallActivationClientTest.php index 40f6a63aeb1f..868d1d7bff7f 100644 --- a/NetworkSecurity/tests/Unit/V1/Client/FirewallActivationClientTest.php +++ b/NetworkSecurity/tests/Unit/V1/Client/FirewallActivationClientTest.php @@ -393,6 +393,157 @@ public function createFirewallEndpointAssociationExceptionTest() $this->assertTrue($operationsTransport->isExhausted()); } + /** @test */ + public function createProjectFirewallEndpointTest() + { + $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/createProjectFirewallEndpointTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $description = 'description-1724546052'; + $reconciling = false; + $satisfiesPzs = false; + $satisfiesPzi = false; + $billingProjectId = 'billingProjectId1808796741'; + $expectedResponse = new FirewallEndpoint(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setSatisfiesPzi($satisfiesPzi); + $expectedResponse->setBillingProjectId($billingProjectId); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createProjectFirewallEndpointTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->organizationLocationName('[ORGANIZATION]', '[LOCATION]'); + $firewallEndpointId = 'firewallEndpointId1750813510'; + $firewallEndpoint = new FirewallEndpoint(); + $request = (new CreateFirewallEndpointRequest()) + ->setParent($formattedParent) + ->setFirewallEndpointId($firewallEndpointId) + ->setFirewallEndpoint($firewallEndpoint); + $response = $gapicClient->createProjectFirewallEndpoint($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.cloud.networksecurity.v1.FirewallActivation/CreateProjectFirewallEndpoint', + $actualApiFuncCall + ); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getFirewallEndpointId(); + $this->assertProtobufEquals($firewallEndpointId, $actualValue); + $actualValue = $actualApiRequestObject->getFirewallEndpoint(); + $this->assertProtobufEquals($firewallEndpoint, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createProjectFirewallEndpointTest'); + $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 createProjectFirewallEndpointExceptionTest() + { + $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/createProjectFirewallEndpointTest'); + $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->organizationLocationName('[ORGANIZATION]', '[LOCATION]'); + $firewallEndpointId = 'firewallEndpointId1750813510'; + $firewallEndpoint = new FirewallEndpoint(); + $request = (new CreateFirewallEndpointRequest()) + ->setParent($formattedParent) + ->setFirewallEndpointId($firewallEndpointId) + ->setFirewallEndpoint($firewallEndpoint); + $response = $gapicClient->createProjectFirewallEndpoint($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createProjectFirewallEndpointTest'); + 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 deleteFirewallEndpointTest() { @@ -621,38 +772,324 @@ public function deleteFirewallEndpointAssociationExceptionTest() ], JSON_PRETTY_PRINT ); - $operationsTransport->addResponse(null, $status); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->firewallEndpointAssociationName( + '[PROJECT]', + '[LOCATION]', + '[FIREWALL_ENDPOINT_ASSOCIATION]' + ); + $request = (new DeleteFirewallEndpointAssociationRequest())->setName($formattedName); + $response = $gapicClient->deleteFirewallEndpointAssociation($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteFirewallEndpointAssociationTest'); + 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 deleteProjectFirewallEndpointTest() + { + $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/deleteProjectFirewallEndpointTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteProjectFirewallEndpointTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->firewallEndpointName('[ORGANIZATION]', '[LOCATION]', '[FIREWALL_ENDPOINT]'); + $request = (new DeleteFirewallEndpointRequest())->setName($formattedName); + $response = $gapicClient->deleteProjectFirewallEndpoint($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.cloud.networksecurity.v1.FirewallActivation/DeleteProjectFirewallEndpoint', + $actualApiFuncCall + ); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteProjectFirewallEndpointTest'); + $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 deleteProjectFirewallEndpointExceptionTest() + { + $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/deleteProjectFirewallEndpointTest'); + $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->firewallEndpointName('[ORGANIZATION]', '[LOCATION]', '[FIREWALL_ENDPOINT]'); + $request = (new DeleteFirewallEndpointRequest())->setName($formattedName); + $response = $gapicClient->deleteProjectFirewallEndpoint($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteProjectFirewallEndpointTest'); + 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 getFirewallEndpointTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $description = 'description-1724546052'; + $reconciling = false; + $satisfiesPzs = false; + $satisfiesPzi = false; + $billingProjectId = 'billingProjectId1808796741'; + $expectedResponse = new FirewallEndpoint(); + $expectedResponse->setName($name2); + $expectedResponse->setDescription($description); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setSatisfiesPzi($satisfiesPzi); + $expectedResponse->setBillingProjectId($billingProjectId); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->firewallEndpointName('[ORGANIZATION]', '[LOCATION]', '[FIREWALL_ENDPOINT]'); + $request = (new GetFirewallEndpointRequest())->setName($formattedName); + $response = $gapicClient->getFirewallEndpoint($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.networksecurity.v1.FirewallActivation/GetFirewallEndpoint', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getFirewallEndpointExceptionTest() + { + $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->firewallEndpointName('[ORGANIZATION]', '[LOCATION]', '[FIREWALL_ENDPOINT]'); + $request = (new GetFirewallEndpointRequest())->setName($formattedName); + try { + $gapicClient->getFirewallEndpoint($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 getFirewallEndpointAssociationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $network = 'network1843485230'; + $firewallEndpoint = 'firewallEndpoint-560762380'; + $tlsInspectionPolicy = 'tlsInspectionPolicy77909017'; + $reconciling = false; + $disabled = true; + $expectedResponse = new FirewallEndpointAssociation(); + $expectedResponse->setName($name2); + $expectedResponse->setNetwork($network); + $expectedResponse->setFirewallEndpoint($firewallEndpoint); + $expectedResponse->setTlsInspectionPolicy($tlsInspectionPolicy); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setDisabled($disabled); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->firewallEndpointAssociationName( + '[PROJECT]', + '[LOCATION]', + '[FIREWALL_ENDPOINT_ASSOCIATION]' + ); + $request = (new GetFirewallEndpointAssociationRequest())->setName($formattedName); + $response = $gapicClient->getFirewallEndpointAssociation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.networksecurity.v1.FirewallActivation/GetFirewallEndpointAssociation', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getFirewallEndpointAssociationExceptionTest() + { + $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->firewallEndpointAssociationName( '[PROJECT]', '[LOCATION]', '[FIREWALL_ENDPOINT_ASSOCIATION]' ); - $request = (new DeleteFirewallEndpointAssociationRequest())->setName($formattedName); - $response = $gapicClient->deleteFirewallEndpointAssociation($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteFirewallEndpointAssociationTest'); + $request = (new GetFirewallEndpointAssociationRequest())->setName($formattedName); try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test + $gapicClient->getFirewallEndpointAssociation($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 */ - public function getFirewallEndpointTest() + public function getProjectFirewallEndpointTest() { $transport = $this->createTransport(); $gapicClient = $this->createClient([ @@ -677,20 +1114,23 @@ public function getFirewallEndpointTest() // Mock request $formattedName = $gapicClient->firewallEndpointName('[ORGANIZATION]', '[LOCATION]', '[FIREWALL_ENDPOINT]'); $request = (new GetFirewallEndpointRequest())->setName($formattedName); - $response = $gapicClient->getFirewallEndpoint($request); + $response = $gapicClient->getProjectFirewallEndpoint($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.networksecurity.v1.FirewallActivation/GetFirewallEndpoint', $actualFuncCall); + $this->assertSame( + '/google.cloud.networksecurity.v1.FirewallActivation/GetProjectFirewallEndpoint', + $actualFuncCall + ); $actualValue = $actualRequestObject->getName(); $this->assertProtobufEquals($formattedName, $actualValue); $this->assertTrue($transport->isExhausted()); } /** @test */ - public function getFirewallEndpointExceptionTest() + public function getProjectFirewallEndpointExceptionTest() { $transport = $this->createTransport(); $gapicClient = $this->createClient([ @@ -714,7 +1154,7 @@ public function getFirewallEndpointExceptionTest() $formattedName = $gapicClient->firewallEndpointName('[ORGANIZATION]', '[LOCATION]', '[FIREWALL_ENDPOINT]'); $request = (new GetFirewallEndpointRequest())->setName($formattedName); try { - $gapicClient->getFirewallEndpoint($request); + $gapicClient->getProjectFirewallEndpoint($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) { @@ -727,7 +1167,7 @@ public function getFirewallEndpointExceptionTest() } /** @test */ - public function getFirewallEndpointAssociationTest() + public function listFirewallEndpointAssociationsTest() { $transport = $this->createTransport(); $gapicClient = $this->createClient([ @@ -735,44 +1175,36 @@ public function getFirewallEndpointAssociationTest() ]); $this->assertTrue($transport->isExhausted()); // Mock response - $name2 = 'name2-1052831874'; - $network = 'network1843485230'; - $firewallEndpoint = 'firewallEndpoint-560762380'; - $tlsInspectionPolicy = 'tlsInspectionPolicy77909017'; - $reconciling = false; - $disabled = true; - $expectedResponse = new FirewallEndpointAssociation(); - $expectedResponse->setName($name2); - $expectedResponse->setNetwork($network); - $expectedResponse->setFirewallEndpoint($firewallEndpoint); - $expectedResponse->setTlsInspectionPolicy($tlsInspectionPolicy); - $expectedResponse->setReconciling($reconciling); - $expectedResponse->setDisabled($disabled); + $nextPageToken = ''; + $firewallEndpointAssociationsElement = new FirewallEndpointAssociation(); + $firewallEndpointAssociations = [$firewallEndpointAssociationsElement]; + $expectedResponse = new ListFirewallEndpointAssociationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setFirewallEndpointAssociations($firewallEndpointAssociations); $transport->addResponse($expectedResponse); // Mock request - $formattedName = $gapicClient->firewallEndpointAssociationName( - '[PROJECT]', - '[LOCATION]', - '[FIREWALL_ENDPOINT_ASSOCIATION]' - ); - $request = (new GetFirewallEndpointAssociationRequest())->setName($formattedName); - $response = $gapicClient->getFirewallEndpointAssociation($request); - $this->assertEquals($expectedResponse, $response); + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListFirewallEndpointAssociationsRequest())->setParent($formattedParent); + $response = $gapicClient->listFirewallEndpointAssociations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getFirewallEndpointAssociations()[0], $resources[0]); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); $this->assertSame( - '/google.cloud.networksecurity.v1.FirewallActivation/GetFirewallEndpointAssociation', + '/google.cloud.networksecurity.v1.FirewallActivation/ListFirewallEndpointAssociations', $actualFuncCall ); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); $this->assertTrue($transport->isExhausted()); } /** @test */ - public function getFirewallEndpointAssociationExceptionTest() + public function listFirewallEndpointAssociationsExceptionTest() { $transport = $this->createTransport(); $gapicClient = $this->createClient([ @@ -793,14 +1225,10 @@ public function getFirewallEndpointAssociationExceptionTest() ); $transport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->firewallEndpointAssociationName( - '[PROJECT]', - '[LOCATION]', - '[FIREWALL_ENDPOINT_ASSOCIATION]' - ); - $request = (new GetFirewallEndpointAssociationRequest())->setName($formattedName); + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListFirewallEndpointAssociationsRequest())->setParent($formattedParent); try { - $gapicClient->getFirewallEndpointAssociation($request); + $gapicClient->listFirewallEndpointAssociations($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) { @@ -813,7 +1241,7 @@ public function getFirewallEndpointAssociationExceptionTest() } /** @test */ - public function listFirewallEndpointAssociationsTest() + public function listFirewallEndpointsTest() { $transport = $this->createTransport(); $gapicClient = $this->createClient([ @@ -822,35 +1250,32 @@ public function listFirewallEndpointAssociationsTest() $this->assertTrue($transport->isExhausted()); // Mock response $nextPageToken = ''; - $firewallEndpointAssociationsElement = new FirewallEndpointAssociation(); - $firewallEndpointAssociations = [$firewallEndpointAssociationsElement]; - $expectedResponse = new ListFirewallEndpointAssociationsResponse(); + $firewallEndpointsElement = new FirewallEndpoint(); + $firewallEndpoints = [$firewallEndpointsElement]; + $expectedResponse = new ListFirewallEndpointsResponse(); $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setFirewallEndpointAssociations($firewallEndpointAssociations); + $expectedResponse->setFirewallEndpoints($firewallEndpoints); $transport->addResponse($expectedResponse); // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListFirewallEndpointAssociationsRequest())->setParent($formattedParent); - $response = $gapicClient->listFirewallEndpointAssociations($request); + $formattedParent = $gapicClient->organizationLocationName('[ORGANIZATION]', '[LOCATION]'); + $request = (new ListFirewallEndpointsRequest())->setParent($formattedParent); + $response = $gapicClient->listFirewallEndpoints($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getFirewallEndpointAssociations()[0], $resources[0]); + $this->assertEquals($expectedResponse->getFirewallEndpoints()[0], $resources[0]); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame( - '/google.cloud.networksecurity.v1.FirewallActivation/ListFirewallEndpointAssociations', - $actualFuncCall - ); + $this->assertSame('/google.cloud.networksecurity.v1.FirewallActivation/ListFirewallEndpoints', $actualFuncCall); $actualValue = $actualRequestObject->getParent(); $this->assertProtobufEquals($formattedParent, $actualValue); $this->assertTrue($transport->isExhausted()); } /** @test */ - public function listFirewallEndpointAssociationsExceptionTest() + public function listFirewallEndpointsExceptionTest() { $transport = $this->createTransport(); $gapicClient = $this->createClient([ @@ -871,10 +1296,10 @@ public function listFirewallEndpointAssociationsExceptionTest() ); $transport->addResponse(null, $status); // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListFirewallEndpointAssociationsRequest())->setParent($formattedParent); + $formattedParent = $gapicClient->organizationLocationName('[ORGANIZATION]', '[LOCATION]'); + $request = (new ListFirewallEndpointsRequest())->setParent($formattedParent); try { - $gapicClient->listFirewallEndpointAssociations($request); + $gapicClient->listFirewallEndpoints($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) { @@ -887,7 +1312,7 @@ public function listFirewallEndpointAssociationsExceptionTest() } /** @test */ - public function listFirewallEndpointsTest() + public function listProjectFirewallEndpointsTest() { $transport = $this->createTransport(); $gapicClient = $this->createClient([ @@ -905,7 +1330,7 @@ public function listFirewallEndpointsTest() // Mock request $formattedParent = $gapicClient->organizationLocationName('[ORGANIZATION]', '[LOCATION]'); $request = (new ListFirewallEndpointsRequest())->setParent($formattedParent); - $response = $gapicClient->listFirewallEndpoints($request); + $response = $gapicClient->listProjectFirewallEndpoints($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); $this->assertSame(1, count($resources)); @@ -914,14 +1339,17 @@ public function listFirewallEndpointsTest() $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.networksecurity.v1.FirewallActivation/ListFirewallEndpoints', $actualFuncCall); + $this->assertSame( + '/google.cloud.networksecurity.v1.FirewallActivation/ListProjectFirewallEndpoints', + $actualFuncCall + ); $actualValue = $actualRequestObject->getParent(); $this->assertProtobufEquals($formattedParent, $actualValue); $this->assertTrue($transport->isExhausted()); } /** @test */ - public function listFirewallEndpointsExceptionTest() + public function listProjectFirewallEndpointsExceptionTest() { $transport = $this->createTransport(); $gapicClient = $this->createClient([ @@ -945,7 +1373,7 @@ public function listFirewallEndpointsExceptionTest() $formattedParent = $gapicClient->organizationLocationName('[ORGANIZATION]', '[LOCATION]'); $request = (new ListFirewallEndpointsRequest())->setParent($formattedParent); try { - $gapicClient->listFirewallEndpoints($request); + $gapicClient->listProjectFirewallEndpoints($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) { @@ -1255,6 +1683,151 @@ public function updateFirewallEndpointAssociationExceptionTest() $this->assertTrue($operationsTransport->isExhausted()); } + /** @test */ + public function updateProjectFirewallEndpointTest() + { + $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/updateProjectFirewallEndpointTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $description = 'description-1724546052'; + $reconciling = false; + $satisfiesPzs = false; + $satisfiesPzi = false; + $billingProjectId = 'billingProjectId1808796741'; + $expectedResponse = new FirewallEndpoint(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setSatisfiesPzi($satisfiesPzi); + $expectedResponse->setBillingProjectId($billingProjectId); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateProjectFirewallEndpointTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $updateMask = new FieldMask(); + $firewallEndpoint = new FirewallEndpoint(); + $request = (new UpdateFirewallEndpointRequest()) + ->setUpdateMask($updateMask) + ->setFirewallEndpoint($firewallEndpoint); + $response = $gapicClient->updateProjectFirewallEndpoint($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.cloud.networksecurity.v1.FirewallActivation/UpdateProjectFirewallEndpoint', + $actualApiFuncCall + ); + $actualValue = $actualApiRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $actualValue = $actualApiRequestObject->getFirewallEndpoint(); + $this->assertProtobufEquals($firewallEndpoint, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateProjectFirewallEndpointTest'); + $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 updateProjectFirewallEndpointExceptionTest() + { + $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/updateProjectFirewallEndpointTest'); + $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 + $updateMask = new FieldMask(); + $firewallEndpoint = new FirewallEndpoint(); + $request = (new UpdateFirewallEndpointRequest()) + ->setUpdateMask($updateMask) + ->setFirewallEndpoint($firewallEndpoint); + $response = $gapicClient->updateProjectFirewallEndpoint($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateProjectFirewallEndpointTest'); + 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 getLocationTest() { diff --git a/NetworkSecurity/tests/Unit/V1/Client/SSERealmServiceClientTest.php b/NetworkSecurity/tests/Unit/V1/Client/SSERealmServiceClientTest.php new file mode 100644 index 000000000000..0c5a2b0f9668 --- /dev/null +++ b/NetworkSecurity/tests/Unit/V1/Client/SSERealmServiceClientTest.php @@ -0,0 +1,1311 @@ +getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); + } + + /** @return SSERealmServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new SSERealmServiceClient($options); + } + + /** @test */ + public function createSACAttachmentTest() + { + $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/createSACAttachmentTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $sacRealm = 'sacRealm346752421'; + $nccGateway = 'nccGateway1248618579'; + $expectedResponse = new SACAttachment(); + $expectedResponse->setName($name); + $expectedResponse->setSacRealm($sacRealm); + $expectedResponse->setNccGateway($nccGateway); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createSACAttachmentTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $sacAttachmentId = 'sacAttachmentId-336914739'; + $sacAttachment = new SACAttachment(); + $sacAttachmentSacRealm = 'sacAttachmentSacRealm2121941682'; + $sacAttachment->setSacRealm($sacAttachmentSacRealm); + $sacAttachmentNccGateway = 'sacAttachmentNccGateway-530654706'; + $sacAttachment->setNccGateway($sacAttachmentNccGateway); + $request = (new CreateSACAttachmentRequest()) + ->setParent($formattedParent) + ->setSacAttachmentId($sacAttachmentId) + ->setSacAttachment($sacAttachment); + $response = $gapicClient->createSACAttachment($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.cloud.networksecurity.v1.SSERealmService/CreateSACAttachment', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getSacAttachmentId(); + $this->assertProtobufEquals($sacAttachmentId, $actualValue); + $actualValue = $actualApiRequestObject->getSacAttachment(); + $this->assertProtobufEquals($sacAttachment, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createSACAttachmentTest'); + $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 createSACAttachmentExceptionTest() + { + $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/createSACAttachmentTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $sacAttachmentId = 'sacAttachmentId-336914739'; + $sacAttachment = new SACAttachment(); + $sacAttachmentSacRealm = 'sacAttachmentSacRealm2121941682'; + $sacAttachment->setSacRealm($sacAttachmentSacRealm); + $sacAttachmentNccGateway = 'sacAttachmentNccGateway-530654706'; + $sacAttachment->setNccGateway($sacAttachmentNccGateway); + $request = (new CreateSACAttachmentRequest()) + ->setParent($formattedParent) + ->setSacAttachmentId($sacAttachmentId) + ->setSacAttachment($sacAttachment); + $response = $gapicClient->createSACAttachment($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createSACAttachmentTest'); + 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 createSACRealmTest() + { + $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/createSACRealmTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $expectedResponse = new SACRealm(); + $expectedResponse->setName($name); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createSACRealmTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $sacRealmId = 'sacRealmId705121781'; + $sacRealm = new SACRealm(); + $request = (new CreateSACRealmRequest()) + ->setParent($formattedParent) + ->setSacRealmId($sacRealmId) + ->setSacRealm($sacRealm); + $response = $gapicClient->createSACRealm($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.cloud.networksecurity.v1.SSERealmService/CreateSACRealm', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getSacRealmId(); + $this->assertProtobufEquals($sacRealmId, $actualValue); + $actualValue = $actualApiRequestObject->getSacRealm(); + $this->assertProtobufEquals($sacRealm, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createSACRealmTest'); + $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 createSACRealmExceptionTest() + { + $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/createSACRealmTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $sacRealmId = 'sacRealmId705121781'; + $sacRealm = new SACRealm(); + $request = (new CreateSACRealmRequest()) + ->setParent($formattedParent) + ->setSacRealmId($sacRealmId) + ->setSacRealm($sacRealm); + $response = $gapicClient->createSACRealm($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createSACRealmTest'); + 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 deleteSACAttachmentTest() + { + $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/deleteSACAttachmentTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteSACAttachmentTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->sACAttachmentName('[PROJECT]', '[LOCATION]', '[SAC_ATTACHMENT]'); + $request = (new DeleteSACAttachmentRequest())->setName($formattedName); + $response = $gapicClient->deleteSACAttachment($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.cloud.networksecurity.v1.SSERealmService/DeleteSACAttachment', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteSACAttachmentTest'); + $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 deleteSACAttachmentExceptionTest() + { + $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/deleteSACAttachmentTest'); + $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->sACAttachmentName('[PROJECT]', '[LOCATION]', '[SAC_ATTACHMENT]'); + $request = (new DeleteSACAttachmentRequest())->setName($formattedName); + $response = $gapicClient->deleteSACAttachment($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteSACAttachmentTest'); + 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 deleteSACRealmTest() + { + $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/deleteSACRealmTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteSACRealmTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->sACRealmName('[PROJECT]', '[LOCATION]', '[SAC_REALM]'); + $request = (new DeleteSACRealmRequest())->setName($formattedName); + $response = $gapicClient->deleteSACRealm($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.cloud.networksecurity.v1.SSERealmService/DeleteSACRealm', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteSACRealmTest'); + $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 deleteSACRealmExceptionTest() + { + $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/deleteSACRealmTest'); + $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->sACRealmName('[PROJECT]', '[LOCATION]', '[SAC_REALM]'); + $request = (new DeleteSACRealmRequest())->setName($formattedName); + $response = $gapicClient->deleteSACRealm($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteSACRealmTest'); + 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 getSACAttachmentTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $sacRealm = 'sacRealm346752421'; + $nccGateway = 'nccGateway1248618579'; + $expectedResponse = new SACAttachment(); + $expectedResponse->setName($name2); + $expectedResponse->setSacRealm($sacRealm); + $expectedResponse->setNccGateway($nccGateway); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->sACAttachmentName('[PROJECT]', '[LOCATION]', '[SAC_ATTACHMENT]'); + $request = (new GetSACAttachmentRequest())->setName($formattedName); + $response = $gapicClient->getSACAttachment($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.networksecurity.v1.SSERealmService/GetSACAttachment', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getSACAttachmentExceptionTest() + { + $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->sACAttachmentName('[PROJECT]', '[LOCATION]', '[SAC_ATTACHMENT]'); + $request = (new GetSACAttachmentRequest())->setName($formattedName); + try { + $gapicClient->getSACAttachment($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 getSACRealmTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $expectedResponse = new SACRealm(); + $expectedResponse->setName($name2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->sACRealmName('[PROJECT]', '[LOCATION]', '[SAC_REALM]'); + $request = (new GetSACRealmRequest())->setName($formattedName); + $response = $gapicClient->getSACRealm($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.networksecurity.v1.SSERealmService/GetSACRealm', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getSACRealmExceptionTest() + { + $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->sACRealmName('[PROJECT]', '[LOCATION]', '[SAC_REALM]'); + $request = (new GetSACRealmRequest())->setName($formattedName); + try { + $gapicClient->getSACRealm($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 listSACAttachmentsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $sacAttachmentsElement = new SACAttachment(); + $sacAttachments = [$sacAttachmentsElement]; + $expectedResponse = new ListSACAttachmentsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSacAttachments($sacAttachments); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListSACAttachmentsRequest())->setParent($formattedParent); + $response = $gapicClient->listSACAttachments($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getSacAttachments()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.networksecurity.v1.SSERealmService/ListSACAttachments', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listSACAttachmentsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListSACAttachmentsRequest())->setParent($formattedParent); + try { + $gapicClient->listSACAttachments($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 listSACRealmsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $sacRealmsElement = new SACRealm(); + $sacRealms = [$sacRealmsElement]; + $expectedResponse = new ListSACRealmsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSacRealms($sacRealms); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListSACRealmsRequest())->setParent($formattedParent); + $response = $gapicClient->listSACRealms($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getSacRealms()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.networksecurity.v1.SSERealmService/ListSACRealms', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listSACRealmsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListSACRealmsRequest())->setParent($formattedParent); + try { + $gapicClient->listSACRealms($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() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $request = new GetLocationRequest(); + $response = $gapicClient->getLocation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $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 GetLocationRequest(); + try { + $gapicClient->getLocation($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 listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [$locationsElement]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $request = new ListLocationsRequest(); + $response = $gapicClient->listLocations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $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 ListLocationsRequest(); + try { + $gapicClient->listLocations($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 getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $request = (new GetIamPolicyRequest())->setResource($resource); + $response = $gapicClient->getIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.iam.v1.IAMPolicy/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $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 + $resource = 'resource-341064690'; + $request = (new GetIamPolicyRequest())->setResource($resource); + try { + $gapicClient->getIamPolicy($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 setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); + $response = $gapicClient->setIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.iam.v1.IAMPolicy/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPolicy(); + $this->assertProtobufEquals($policy, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $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 + $resource = 'resource-341064690'; + $policy = new Policy(); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); + try { + $gapicClient->setIamPolicy($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 testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestIamPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); + $response = $gapicClient->testIamPermissions($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.iam.v1.IAMPolicy/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPermissions(); + $this->assertProtobufEquals($permissions, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $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 + $resource = 'resource-341064690'; + $permissions = []; + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); + try { + $gapicClient->testIamPermissions($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 createSACAttachmentAsyncTest() + { + $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/createSACAttachmentTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $sacRealm = 'sacRealm346752421'; + $nccGateway = 'nccGateway1248618579'; + $expectedResponse = new SACAttachment(); + $expectedResponse->setName($name); + $expectedResponse->setSacRealm($sacRealm); + $expectedResponse->setNccGateway($nccGateway); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createSACAttachmentTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $sacAttachmentId = 'sacAttachmentId-336914739'; + $sacAttachment = new SACAttachment(); + $sacAttachmentSacRealm = 'sacAttachmentSacRealm2121941682'; + $sacAttachment->setSacRealm($sacAttachmentSacRealm); + $sacAttachmentNccGateway = 'sacAttachmentNccGateway-530654706'; + $sacAttachment->setNccGateway($sacAttachmentNccGateway); + $request = (new CreateSACAttachmentRequest()) + ->setParent($formattedParent) + ->setSacAttachmentId($sacAttachmentId) + ->setSacAttachment($sacAttachment); + $response = $gapicClient->createSACAttachmentAsync($request)->wait(); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.networksecurity.v1.SSERealmService/CreateSACAttachment', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getSacAttachmentId(); + $this->assertProtobufEquals($sacAttachmentId, $actualValue); + $actualValue = $actualApiRequestObject->getSacAttachment(); + $this->assertProtobufEquals($sacAttachment, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createSACAttachmentTest'); + $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()); + } +} diff --git a/NetworkSecurity/tests/Unit/V1/Client/SecurityProfileGroupServiceClientTest.php b/NetworkSecurity/tests/Unit/V1/Client/SecurityProfileGroupServiceClientTest.php new file mode 100644 index 000000000000..443d39eaa680 --- /dev/null +++ b/NetworkSecurity/tests/Unit/V1/Client/SecurityProfileGroupServiceClientTest.php @@ -0,0 +1,1661 @@ +getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); + } + + /** @return SecurityProfileGroupServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new SecurityProfileGroupServiceClient($options); + } + + /** @test */ + public function createSecurityProfileTest() + { + $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/createSecurityProfileTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $description = 'description-1724546052'; + $etag = 'etag3123477'; + $expectedResponse = new SecurityProfile(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createSecurityProfileTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->organizationLocationName('[ORGANIZATION]', '[LOCATION]'); + $securityProfileId = 'securityProfileId-1751387696'; + $securityProfile = new SecurityProfile(); + $request = (new CreateSecurityProfileRequest()) + ->setParent($formattedParent) + ->setSecurityProfileId($securityProfileId) + ->setSecurityProfile($securityProfile); + $response = $gapicClient->createSecurityProfile($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.cloud.networksecurity.v1.SecurityProfileGroupService/CreateSecurityProfile', + $actualApiFuncCall + ); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getSecurityProfileId(); + $this->assertProtobufEquals($securityProfileId, $actualValue); + $actualValue = $actualApiRequestObject->getSecurityProfile(); + $this->assertProtobufEquals($securityProfile, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createSecurityProfileTest'); + $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 createSecurityProfileExceptionTest() + { + $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/createSecurityProfileTest'); + $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->organizationLocationName('[ORGANIZATION]', '[LOCATION]'); + $securityProfileId = 'securityProfileId-1751387696'; + $securityProfile = new SecurityProfile(); + $request = (new CreateSecurityProfileRequest()) + ->setParent($formattedParent) + ->setSecurityProfileId($securityProfileId) + ->setSecurityProfile($securityProfile); + $response = $gapicClient->createSecurityProfile($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createSecurityProfileTest'); + 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 createSecurityProfileGroupTest() + { + $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/createSecurityProfileGroupTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $description = 'description-1724546052'; + $etag = 'etag3123477'; + $dataPathId = 1465603104; + $threatPreventionProfile = 'threatPreventionProfile142676447'; + $customMirroringProfile = 'customMirroringProfile-334448673'; + $customInterceptProfile = 'customInterceptProfile-1051702818'; + $urlFilteringProfile = 'urlFilteringProfile962621700'; + $expectedResponse = new SecurityProfileGroup(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $expectedResponse->setEtag($etag); + $expectedResponse->setDataPathId($dataPathId); + $expectedResponse->setThreatPreventionProfile($threatPreventionProfile); + $expectedResponse->setCustomMirroringProfile($customMirroringProfile); + $expectedResponse->setCustomInterceptProfile($customInterceptProfile); + $expectedResponse->setUrlFilteringProfile($urlFilteringProfile); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createSecurityProfileGroupTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->organizationLocationName('[ORGANIZATION]', '[LOCATION]'); + $securityProfileGroupId = 'securityProfileGroupId-921223216'; + $securityProfileGroup = new SecurityProfileGroup(); + $request = (new CreateSecurityProfileGroupRequest()) + ->setParent($formattedParent) + ->setSecurityProfileGroupId($securityProfileGroupId) + ->setSecurityProfileGroup($securityProfileGroup); + $response = $gapicClient->createSecurityProfileGroup($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.cloud.networksecurity.v1.SecurityProfileGroupService/CreateSecurityProfileGroup', + $actualApiFuncCall + ); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getSecurityProfileGroupId(); + $this->assertProtobufEquals($securityProfileGroupId, $actualValue); + $actualValue = $actualApiRequestObject->getSecurityProfileGroup(); + $this->assertProtobufEquals($securityProfileGroup, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createSecurityProfileGroupTest'); + $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 createSecurityProfileGroupExceptionTest() + { + $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/createSecurityProfileGroupTest'); + $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->organizationLocationName('[ORGANIZATION]', '[LOCATION]'); + $securityProfileGroupId = 'securityProfileGroupId-921223216'; + $securityProfileGroup = new SecurityProfileGroup(); + $request = (new CreateSecurityProfileGroupRequest()) + ->setParent($formattedParent) + ->setSecurityProfileGroupId($securityProfileGroupId) + ->setSecurityProfileGroup($securityProfileGroup); + $response = $gapicClient->createSecurityProfileGroup($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createSecurityProfileGroupTest'); + 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 deleteSecurityProfileTest() + { + $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/deleteSecurityProfileTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteSecurityProfileTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->securityProfileName('[ORGANIZATION]', '[LOCATION]', '[SECURITY_PROFILE]'); + $request = (new DeleteSecurityProfileRequest())->setName($formattedName); + $response = $gapicClient->deleteSecurityProfile($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.cloud.networksecurity.v1.SecurityProfileGroupService/DeleteSecurityProfile', + $actualApiFuncCall + ); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteSecurityProfileTest'); + $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 deleteSecurityProfileExceptionTest() + { + $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/deleteSecurityProfileTest'); + $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->securityProfileName('[ORGANIZATION]', '[LOCATION]', '[SECURITY_PROFILE]'); + $request = (new DeleteSecurityProfileRequest())->setName($formattedName); + $response = $gapicClient->deleteSecurityProfile($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteSecurityProfileTest'); + 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 deleteSecurityProfileGroupTest() + { + $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/deleteSecurityProfileGroupTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteSecurityProfileGroupTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->securityProfileGroupName( + '[ORGANIZATION]', + '[LOCATION]', + '[SECURITY_PROFILE_GROUP]' + ); + $request = (new DeleteSecurityProfileGroupRequest())->setName($formattedName); + $response = $gapicClient->deleteSecurityProfileGroup($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.cloud.networksecurity.v1.SecurityProfileGroupService/DeleteSecurityProfileGroup', + $actualApiFuncCall + ); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteSecurityProfileGroupTest'); + $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 deleteSecurityProfileGroupExceptionTest() + { + $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/deleteSecurityProfileGroupTest'); + $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->securityProfileGroupName( + '[ORGANIZATION]', + '[LOCATION]', + '[SECURITY_PROFILE_GROUP]' + ); + $request = (new DeleteSecurityProfileGroupRequest())->setName($formattedName); + $response = $gapicClient->deleteSecurityProfileGroup($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteSecurityProfileGroupTest'); + 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 getSecurityProfileTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $description = 'description-1724546052'; + $etag = 'etag3123477'; + $expectedResponse = new SecurityProfile(); + $expectedResponse->setName($name2); + $expectedResponse->setDescription($description); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->securityProfileName('[ORGANIZATION]', '[LOCATION]', '[SECURITY_PROFILE]'); + $request = (new GetSecurityProfileRequest())->setName($formattedName); + $response = $gapicClient->getSecurityProfile($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.networksecurity.v1.SecurityProfileGroupService/GetSecurityProfile', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getSecurityProfileExceptionTest() + { + $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->securityProfileName('[ORGANIZATION]', '[LOCATION]', '[SECURITY_PROFILE]'); + $request = (new GetSecurityProfileRequest())->setName($formattedName); + try { + $gapicClient->getSecurityProfile($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 getSecurityProfileGroupTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $description = 'description-1724546052'; + $etag = 'etag3123477'; + $dataPathId = 1465603104; + $threatPreventionProfile = 'threatPreventionProfile142676447'; + $customMirroringProfile = 'customMirroringProfile-334448673'; + $customInterceptProfile = 'customInterceptProfile-1051702818'; + $urlFilteringProfile = 'urlFilteringProfile962621700'; + $expectedResponse = new SecurityProfileGroup(); + $expectedResponse->setName($name2); + $expectedResponse->setDescription($description); + $expectedResponse->setEtag($etag); + $expectedResponse->setDataPathId($dataPathId); + $expectedResponse->setThreatPreventionProfile($threatPreventionProfile); + $expectedResponse->setCustomMirroringProfile($customMirroringProfile); + $expectedResponse->setCustomInterceptProfile($customInterceptProfile); + $expectedResponse->setUrlFilteringProfile($urlFilteringProfile); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->securityProfileGroupName( + '[ORGANIZATION]', + '[LOCATION]', + '[SECURITY_PROFILE_GROUP]' + ); + $request = (new GetSecurityProfileGroupRequest())->setName($formattedName); + $response = $gapicClient->getSecurityProfileGroup($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.networksecurity.v1.SecurityProfileGroupService/GetSecurityProfileGroup', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getSecurityProfileGroupExceptionTest() + { + $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->securityProfileGroupName( + '[ORGANIZATION]', + '[LOCATION]', + '[SECURITY_PROFILE_GROUP]' + ); + $request = (new GetSecurityProfileGroupRequest())->setName($formattedName); + try { + $gapicClient->getSecurityProfileGroup($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 listSecurityProfileGroupsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $securityProfileGroupsElement = new SecurityProfileGroup(); + $securityProfileGroups = [$securityProfileGroupsElement]; + $expectedResponse = new ListSecurityProfileGroupsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSecurityProfileGroups($securityProfileGroups); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->organizationLocationName('[ORGANIZATION]', '[LOCATION]'); + $request = (new ListSecurityProfileGroupsRequest())->setParent($formattedParent); + $response = $gapicClient->listSecurityProfileGroups($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getSecurityProfileGroups()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.networksecurity.v1.SecurityProfileGroupService/ListSecurityProfileGroups', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listSecurityProfileGroupsExceptionTest() + { + $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->organizationLocationName('[ORGANIZATION]', '[LOCATION]'); + $request = (new ListSecurityProfileGroupsRequest())->setParent($formattedParent); + try { + $gapicClient->listSecurityProfileGroups($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 listSecurityProfilesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $securityProfilesElement = new SecurityProfile(); + $securityProfiles = [$securityProfilesElement]; + $expectedResponse = new ListSecurityProfilesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSecurityProfiles($securityProfiles); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->organizationLocationName('[ORGANIZATION]', '[LOCATION]'); + $request = (new ListSecurityProfilesRequest())->setParent($formattedParent); + $response = $gapicClient->listSecurityProfiles($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getSecurityProfiles()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.networksecurity.v1.SecurityProfileGroupService/ListSecurityProfiles', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listSecurityProfilesExceptionTest() + { + $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->organizationLocationName('[ORGANIZATION]', '[LOCATION]'); + $request = (new ListSecurityProfilesRequest())->setParent($formattedParent); + try { + $gapicClient->listSecurityProfiles($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 updateSecurityProfileTest() + { + $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/updateSecurityProfileTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $description = 'description-1724546052'; + $etag = 'etag3123477'; + $expectedResponse = new SecurityProfile(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateSecurityProfileTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $updateMask = new FieldMask(); + $securityProfile = new SecurityProfile(); + $request = (new UpdateSecurityProfileRequest()) + ->setUpdateMask($updateMask) + ->setSecurityProfile($securityProfile); + $response = $gapicClient->updateSecurityProfile($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.cloud.networksecurity.v1.SecurityProfileGroupService/UpdateSecurityProfile', + $actualApiFuncCall + ); + $actualValue = $actualApiRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $actualValue = $actualApiRequestObject->getSecurityProfile(); + $this->assertProtobufEquals($securityProfile, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateSecurityProfileTest'); + $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 updateSecurityProfileExceptionTest() + { + $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/updateSecurityProfileTest'); + $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 + $updateMask = new FieldMask(); + $securityProfile = new SecurityProfile(); + $request = (new UpdateSecurityProfileRequest()) + ->setUpdateMask($updateMask) + ->setSecurityProfile($securityProfile); + $response = $gapicClient->updateSecurityProfile($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateSecurityProfileTest'); + 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 updateSecurityProfileGroupTest() + { + $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/updateSecurityProfileGroupTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $description = 'description-1724546052'; + $etag = 'etag3123477'; + $dataPathId = 1465603104; + $threatPreventionProfile = 'threatPreventionProfile142676447'; + $customMirroringProfile = 'customMirroringProfile-334448673'; + $customInterceptProfile = 'customInterceptProfile-1051702818'; + $urlFilteringProfile = 'urlFilteringProfile962621700'; + $expectedResponse = new SecurityProfileGroup(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $expectedResponse->setEtag($etag); + $expectedResponse->setDataPathId($dataPathId); + $expectedResponse->setThreatPreventionProfile($threatPreventionProfile); + $expectedResponse->setCustomMirroringProfile($customMirroringProfile); + $expectedResponse->setCustomInterceptProfile($customInterceptProfile); + $expectedResponse->setUrlFilteringProfile($urlFilteringProfile); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateSecurityProfileGroupTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $updateMask = new FieldMask(); + $securityProfileGroup = new SecurityProfileGroup(); + $request = (new UpdateSecurityProfileGroupRequest()) + ->setUpdateMask($updateMask) + ->setSecurityProfileGroup($securityProfileGroup); + $response = $gapicClient->updateSecurityProfileGroup($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.cloud.networksecurity.v1.SecurityProfileGroupService/UpdateSecurityProfileGroup', + $actualApiFuncCall + ); + $actualValue = $actualApiRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $actualValue = $actualApiRequestObject->getSecurityProfileGroup(); + $this->assertProtobufEquals($securityProfileGroup, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateSecurityProfileGroupTest'); + $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 updateSecurityProfileGroupExceptionTest() + { + $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/updateSecurityProfileGroupTest'); + $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 + $updateMask = new FieldMask(); + $securityProfileGroup = new SecurityProfileGroup(); + $request = (new UpdateSecurityProfileGroupRequest()) + ->setUpdateMask($updateMask) + ->setSecurityProfileGroup($securityProfileGroup); + $response = $gapicClient->updateSecurityProfileGroup($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateSecurityProfileGroupTest'); + 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 getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $request = new GetLocationRequest(); + $response = $gapicClient->getLocation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $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 GetLocationRequest(); + try { + $gapicClient->getLocation($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 listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [$locationsElement]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $request = new ListLocationsRequest(); + $response = $gapicClient->listLocations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $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 ListLocationsRequest(); + try { + $gapicClient->listLocations($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 getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $request = (new GetIamPolicyRequest())->setResource($resource); + $response = $gapicClient->getIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.iam.v1.IAMPolicy/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $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 + $resource = 'resource-341064690'; + $request = (new GetIamPolicyRequest())->setResource($resource); + try { + $gapicClient->getIamPolicy($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 setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); + $response = $gapicClient->setIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.iam.v1.IAMPolicy/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPolicy(); + $this->assertProtobufEquals($policy, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $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 + $resource = 'resource-341064690'; + $policy = new Policy(); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); + try { + $gapicClient->setIamPolicy($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 testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestIamPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); + $response = $gapicClient->testIamPermissions($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.iam.v1.IAMPolicy/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPermissions(); + $this->assertProtobufEquals($permissions, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $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 + $resource = 'resource-341064690'; + $permissions = []; + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); + try { + $gapicClient->testIamPermissions($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 createSecurityProfileAsyncTest() + { + $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/createSecurityProfileTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $description = 'description-1724546052'; + $etag = 'etag3123477'; + $expectedResponse = new SecurityProfile(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createSecurityProfileTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->organizationLocationName('[ORGANIZATION]', '[LOCATION]'); + $securityProfileId = 'securityProfileId-1751387696'; + $securityProfile = new SecurityProfile(); + $request = (new CreateSecurityProfileRequest()) + ->setParent($formattedParent) + ->setSecurityProfileId($securityProfileId) + ->setSecurityProfile($securityProfile); + $response = $gapicClient->createSecurityProfileAsync($request)->wait(); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.networksecurity.v1.SecurityProfileGroupService/CreateSecurityProfile', + $actualApiFuncCall + ); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getSecurityProfileId(); + $this->assertProtobufEquals($securityProfileId, $actualValue); + $actualValue = $actualApiRequestObject->getSecurityProfile(); + $this->assertProtobufEquals($securityProfile, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createSecurityProfileTest'); + $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()); + } +}