diff --git a/GkeHub/metadata/V1/Feature.php b/GkeHub/metadata/V1/Feature.php index d26e5f8ddeaa..d9a3c5008613 100644 Binary files a/GkeHub/metadata/V1/Feature.php and b/GkeHub/metadata/V1/Feature.php differ diff --git a/GkeHub/metadata/V1/Fleet.php b/GkeHub/metadata/V1/Fleet.php new file mode 100644 index 000000000000..62a07417f908 Binary files /dev/null and b/GkeHub/metadata/V1/Fleet.php differ diff --git a/GkeHub/metadata/V1/Rbacrolebindingactuation/Rbacrolebindingactuation.php b/GkeHub/metadata/V1/Rbacrolebindingactuation/Rbacrolebindingactuation.php new file mode 100644 index 000000000000..2e6387fb9408 --- /dev/null +++ b/GkeHub/metadata/V1/Rbacrolebindingactuation/Rbacrolebindingactuation.php @@ -0,0 +1,31 @@ +internalAddGeneratedFile( + ' +ª +Ngoogle/cloud/gkehub/v1/rbacrolebindingactuation/rbacrolebindingactuation.proto/google.cloud.gkehub.rbacrolebindingactuation.v1"+ + FeatureSpec +allowed_custom_roles ( " + FeatureStateBá +3com.google.cloud.gkehub.rbacrolebindingactuation.v1BRBACRoleBindingActuationProtoPZocloud.google.com/go/gkehub/rbacrolebindingactuation/apiv1/rbacrolebindingactuationpb;rbacrolebindingactuationpbª/Google.Cloud.GkeHub.RbacRoleBindingActuation.V1Ê/Google\\Cloud\\GkeHub\\RbacRoleBindingActuation\\V1ê3Google::Cloud::GkeHub::RbacRoleBindingActuation::V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/GkeHub/metadata/V1/Service.php b/GkeHub/metadata/V1/Service.php index 2401f2d81a41..4ea182879931 100644 --- a/GkeHub/metadata/V1/Service.php +++ b/GkeHub/metadata/V1/Service.php @@ -19,28 +19,164 @@ public static function initOnce() { \GPBMetadata\Google\Api\FieldBehavior::initOnce(); \GPBMetadata\Google\Api\Resource::initOnce(); \GPBMetadata\Google\Cloud\Gkehub\V1\Feature::initOnce(); + \GPBMetadata\Google\Cloud\Gkehub\V1\Fleet::initOnce(); \GPBMetadata\Google\Cloud\Gkehub\V1\Membership::initOnce(); \GPBMetadata\Google\Longrunning\Operations::initOnce(); \GPBMetadata\Google\Protobuf\FieldMask::initOnce(); \GPBMetadata\Google\Protobuf\Timestamp::initOnce(); $pool->internalAddGeneratedFile( ' -—) -$google/cloud/gkehub/v1/service.protogoogle.cloud.gkehub.v1google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto$google/cloud/gkehub/v1/feature.proto\'google/cloud/gkehub/v1/membership.proto#google/longrunning/operations.proto google/protobuf/field_mask.protogoogle/protobuf/timestamp.proto"¯ +‚ +$google/cloud/gkehub/v1/service.protogoogle.cloud.gkehub.v1google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto$google/cloud/gkehub/v1/feature.proto"google/cloud/gkehub/v1/fleet.proto\'google/cloud/gkehub/v1/membership.proto#google/longrunning/operations.proto google/protobuf/field_mask.protogoogle/protobuf/timestamp.proto"Q +GetScopeNamespaceRequest5 +name ( B\'àAúA! +gkehub.googleapis.com/Namespace"¸ +CreateScopeNamespaceRequest7 +parent ( B\'àAúA!gkehub.googleapis.com/Namespace +scope_namespace_id ( BàA? +scope_namespace ( 2!.google.cloud.gkehub.v1.NamespaceBàA"” +UpdateScopeNamespaceRequest? +scope_namespace ( 2!.google.cloud.gkehub.v1.NamespaceBàA4 + update_mask ( 2.google.protobuf.FieldMaskBàA"T +DeleteScopeNamespaceRequest5 +name ( B\'àAúA! +gkehub.googleapis.com/Namespace"† +ListScopeNamespacesRequest7 +parent ( B\'àAúA!gkehub.googleapis.com/Namespace + page_size (BàA + +page_token ( BàA"s +ListScopeNamespacesResponse; +scope_namespaces ( 2!.google.cloud.gkehub.v1.Namespace +next_page_token ( "] +GetScopeRBACRoleBindingRequest; +name ( B-àAúA\' +%gkehub.googleapis.com/RBACRoleBinding"Ê +!CreateScopeRBACRoleBindingRequest= +parent ( B-àAúA\'%gkehub.googleapis.com/RBACRoleBinding +rbacrolebinding_id ( BàAE +rbacrolebinding ( 2\'.google.cloud.gkehub.v1.RBACRoleBindingBàA"  +!UpdateScopeRBACRoleBindingRequestE +rbacrolebinding ( 2\'.google.cloud.gkehub.v1.RBACRoleBindingBàA4 + update_mask ( 2.google.protobuf.FieldMaskBàA"` +!DeleteScopeRBACRoleBindingRequest; +name ( B-àAúA\' +%gkehub.googleapis.com/RBACRoleBinding"’ + ListScopeRBACRoleBindingsRequest= +parent ( B-àAúA\'%gkehub.googleapis.com/RBACRoleBinding + page_size (BàA + +page_token ( BàA" +!ListScopeRBACRoleBindingsResponseA +rbacrolebindings ( 2\'.google.cloud.gkehub.v1.RBACRoleBinding +next_page_token ( "D +GetScopeRequest1 +name ( B#àAúA +gkehub.googleapis.com/Scope"“ +CreateScopeRequest3 +parent ( B#àAúAgkehub.googleapis.com/Scope +scope_id ( BàA1 +scope ( 2.google.cloud.gkehub.v1.ScopeBàA"} +UpdateScopeRequest1 +scope ( 2.google.cloud.gkehub.v1.ScopeBàA4 + update_mask ( 2.google.protobuf.FieldMaskBàA"G +DeleteScopeRequest1 +name ( B#àAúA +gkehub.googleapis.com/Scope"y +ListScopesRequest3 +parent ( B#àAúAgkehub.googleapis.com/Scope + page_size (BàA + +page_token ( BàA"\\ +ListScopesResponse- +scopes ( 2.google.cloud.gkehub.v1.Scope +next_page_token ( "‚ +ListPermittedScopesRequest3 +parent ( B#àAúAgkehub.googleapis.com/Scope + page_size (BàA + +page_token ( BàA"e +ListPermittedScopesResponse- +scopes ( 2.google.cloud.gkehub.v1.Scope +next_page_token ( "\\ +GetMembershipBindingRequest= +name ( B/àAúA) +\'gkehub.googleapis.com/MembershipBinding"Ñ +CreateMembershipBindingRequest? +parent ( B/àAúA)\'gkehub.googleapis.com/MembershipBindingJ +membership_binding ( 2).google.cloud.gkehub.v1.MembershipBindingBàA" +membership_binding_id ( BàA"¢ +UpdateMembershipBindingRequestJ +membership_binding ( 2).google.cloud.gkehub.v1.MembershipBindingBàA4 + update_mask ( 2.google.protobuf.FieldMaskBàA"_ +DeleteMembershipBindingRequest= +name ( B/àAúA) +\'gkehub.googleapis.com/MembershipBinding"¦ +ListMembershipBindingsRequest? +parent ( B/àAúA)\'gkehub.googleapis.com/MembershipBinding + page_size (BàA + +page_token ( BàA +filter ( BàA"– +ListMembershipBindingsResponseF +membership_bindings ( 2).google.cloud.gkehub.v1.MembershipBinding +next_page_token (  + unreachable ( "¯ ListMembershipsRequest8 parent ( B(àAúA" gkehub.googleapis.com/Membership page_size (BàA page_token ( BàA filter ( BàA -order_by ( BàA"~ +order_by ( BàA"b +#GetMembershipRBACRoleBindingRequest; +name ( B-àAúA\' +%gkehub.googleapis.com/RBACRoleBinding"Ï +&CreateMembershipRBACRoleBindingRequest= +parent ( B-àAúA\'%gkehub.googleapis.com/RBACRoleBinding +rbacrolebinding_id ( BàAE +rbacrolebinding ( 2\'.google.cloud.gkehub.v1.RBACRoleBindingBàA"¥ +&UpdateMembershipRBACRoleBindingRequestE +rbacrolebinding ( 2\'.google.cloud.gkehub.v1.RBACRoleBindingBàA4 + update_mask ( 2.google.protobuf.FieldMaskBàA"e +&DeleteMembershipRBACRoleBindingRequest; +name ( B-àAúA\' +%gkehub.googleapis.com/RBACRoleBinding"— +%ListMembershipRBACRoleBindingsRequest= +parent ( B-àAúA\'%gkehub.googleapis.com/RBACRoleBinding + page_size (BàA + +page_token ( BàA"™ +&ListMembershipRBACRoleBindingsResponseA +rbacrolebindings ( 2\'.google.cloud.gkehub.v1.RBACRoleBinding +next_page_token (  + unreachable ( "Ð +,GenerateMembershipRBACRoleBindingYAMLRequest8 +parent ( B(àAúA" + gkehub.googleapis.com/Membership +rbacrolebinding_id ( BàAE +rbacrolebinding ( 2\'.google.cloud.gkehub.v1.RBACRoleBindingBàA"K +-GenerateMembershipRBACRoleBindingYAMLResponse +role_bindings_yaml ( "~ ListMembershipsResponse5 resources ( 2".google.cloud.gkehub.v1.Membership next_page_token (  unreachable ( "N GetMembershipRequest6 name ( B(àAúA" - gkehub.googleapis.com/Membership"à + gkehub.googleapis.com/Membership"œ +ListBoundMembershipsRequest7 + +scope_name ( B#àAúA +gkehub.googleapis.com/Scope +filter ( BàA + page_size (BàA + +page_token ( BàA"… +ListBoundMembershipsResponse7 + memberships ( 2".google.cloud.gkehub.v1.Membership + unreachable (  +next_page_token ( "à CreateMembershipRequest8 parent ( B(àAúA" gkehub.googleapis.com/Membership membership_id ( BàA9 @@ -77,20 +213,22 @@ public static function initOnce() { manifest ( "- TypeMeta kind (  - api_version ( "’ + api_version ( "· ListFeaturesRequest2 parent ( B"úAgkehub.googleapis.com/Feature page_size ( page_token (  filter (  -order_by ( "c +order_by ( # +return_partial_success (BàA"c ListFeaturesResponse2 resources ( 2.google.cloud.gkehub.v1.Feature -next_page_token ( "E +next_page_token ( "j GetFeatureRequest0 name ( B"úA -gkehub.googleapis.com/Feature"¥ +gkehub.googleapis.com/Feature# +return_partial_success (BàA"¥ CreateFeatureRequest2 parent ( B"úAgkehub.googleapis.com/Feature @@ -110,7 +248,29 @@ public static function initOnce() { update_mask ( 2.google.protobuf.FieldMask1 resource ( 2.google.cloud.gkehub.v1.Feature -request_id ( "ù +request_id ( "‚ +CreateFleetRequest9 +parent ( B)àAúA# +!locations.googleapis.com/Location1 +fleet ( 2.google.cloud.gkehub.v1.FleetBàA"D +GetFleetRequest1 +name ( B#àAúA +gkehub.googleapis.com/Fleet"} +UpdateFleetRequest1 +fleet ( 2.google.cloud.gkehub.v1.FleetBàA4 + update_mask ( 2.google.protobuf.FieldMaskBàA"G +DeleteFleetRequest1 +name ( B#àAúA +gkehub.googleapis.com/Fleet" +ListFleetsRequest9 +parent ( B)àAúA# +!locations.googleapis.com/Location + +page_token ( BàA + page_size (BàA"\\ +ListFleetsResponse- +fleets ( 2.google.cloud.gkehub.v1.Fleet +next_page_token ( "ù OperationMetadata4 create_time ( 2.google.protobuf.TimestampBàA1 end_time ( 2.google.protobuf.TimestampBàA @@ -118,9 +278,11 @@ public static function initOnce() { verb ( BàA status_detail ( BàA cancel_requested (BàA - api_version ( BàA2ð + api_version ( BàA2–M GkeHub´ -ListMemberships..google.cloud.gkehub.v1.ListMembershipsRequest/.google.cloud.gkehub.v1.ListMembershipsResponse"@ÚAparent‚Óä“1//v1/{parent=projects/*/locations/*}/memberships¨ +ListMemberships..google.cloud.gkehub.v1.ListMembershipsRequest/.google.cloud.gkehub.v1.ListMembershipsResponse"@ÚAparent‚Óä“1//v1/{parent=projects/*/locations/*}/membershipsØ +ListBoundMemberships3.google.cloud.gkehub.v1.ListBoundMembershipsRequest4.google.cloud.gkehub.v1.ListBoundMembershipsResponse"UÚA +scope_name‚Óä“B@/v1/{scope_name=projects/*/locations/*/scopes/*}:listMemberships¨ ListFeatures+.google.cloud.gkehub.v1.ListFeaturesRequest,.google.cloud.gkehub.v1.ListFeaturesResponse"=ÚAparent‚Óä“.,/v1/{parent=projects/*/locations/*}/features¡ GetMembership,.google.cloud.gkehub.v1.GetMembershipRequest".google.cloud.gkehub.v1.Membership">ÚAname‚Óä“1//v1/{name=projects/*/locations/*/memberships/*}• @@ -139,7 +301,59 @@ public static function initOnce() { MembershipOperationMetadataÚAname,resource,update_mask‚Óä“;2//v1/{name=projects/*/locations/*/memberships/*}:resource× UpdateFeature,.google.cloud.gkehub.v1.UpdateFeatureRequest.google.longrunning.Operation"yÊA FeatureOperationMetadataÚAname,resource,update_mask‚Óä“82,/v1/{name=projects/*/locations/*/features/*}:resourceÛ -GenerateConnectManifest6.google.cloud.gkehub.v1.GenerateConnectManifestRequest7.google.cloud.gkehub.v1.GenerateConnectManifestResponse"O‚Óä“IG/v1/{name=projects/*/locations/*/memberships/*}:generateConnectManifestIÊAgkehub.googleapis.comÒA.https://www.googleapis.com/auth/cloud-platformB® +GenerateConnectManifest6.google.cloud.gkehub.v1.GenerateConnectManifestRequest7.google.cloud.gkehub.v1.GenerateConnectManifestResponse"O‚Óä“IG/v1/{name=projects/*/locations/*/memberships/*}:generateConnectManifest¿ + CreateFleet*.google.cloud.gkehub.v1.CreateFleetRequest.google.longrunning.Operation"eÊA +FleetOperationMetadataÚA parent,fleet‚Óä“3"*/v1/{parent=projects/*/locations/*}/fleets:fleet +GetFleet\'.google.cloud.gkehub.v1.GetFleetRequest.google.cloud.gkehub.v1.Fleet"9ÚAname‚Óä“,*/v1/{name=projects/*/locations/*/fleets/*}Ê + UpdateFleet*.google.cloud.gkehub.v1.UpdateFleetRequest.google.longrunning.Operation"pÊA +FleetOperationMetadataÚAfleet,update_mask‚Óä“920/v1/{fleet.name=projects/*/locations/*/fleets/*}:fleetÀ + DeleteFleet*.google.cloud.gkehub.v1.DeleteFleetRequest.google.longrunning.Operation"fÊA* +google.protobuf.EmptyOperationMetadataÚAname‚Óä“,**/v1/{name=projects/*/locations/*/fleets/*}Ó + +ListFleets).google.cloud.gkehub.v1.ListFleetsRequest*.google.cloud.gkehub.v1.ListFleetsResponse"nÚAparent‚Óä“_*/v1/{parent=projects/*/locations/*}/fleetsZ1//v1/{parent=organizations/*/locations/*}/fleets° +GetScopeNamespace0.google.cloud.gkehub.v1.GetScopeNamespaceRequest!.google.cloud.gkehub.v1.Namespace"FÚAname‚Óä“97/v1/{name=projects/*/locations/*/scopes/*/namespaces/*}Š +CreateScopeNamespace3.google.cloud.gkehub.v1.CreateScopeNamespaceRequest.google.longrunning.Operation"ÊA + NamespaceOperationMetadataÚA)parent,scope_namespace,scope_namespace_id‚Óä“J"7/v1/{parent=projects/*/locations/*/scopes/*}/namespaces:scope_namespaceŒ +UpdateScopeNamespace3.google.cloud.gkehub.v1.UpdateScopeNamespaceRequest.google.longrunning.Operation"ŸÊA + NamespaceOperationMetadataÚAscope_namespace,update_mask‚Óä“Z2G/v1/{scope_namespace.name=projects/*/locations/*/scopes/*/namespaces/*}:scope_namespaceß +DeleteScopeNamespace3.google.cloud.gkehub.v1.DeleteScopeNamespaceRequest.google.longrunning.Operation"sÊA* +google.protobuf.EmptyOperationMetadataÚAname‚Óä“9*7/v1/{name=projects/*/locations/*/scopes/*/namespaces/*}È +ListScopeNamespaces2.google.cloud.gkehub.v1.ListScopeNamespacesRequest3.google.cloud.gkehub.v1.ListScopeNamespacesResponse"HÚAparent‚Óä“97/v1/{parent=projects/*/locations/*/scopes/*}/namespacesÈ +GetScopeRBACRoleBinding6.google.cloud.gkehub.v1.GetScopeRBACRoleBindingRequest\'.google.cloud.gkehub.v1.RBACRoleBinding"LÚAname‚Óä“?=/v1/{name=projects/*/locations/*/scopes/*/rbacrolebindings/*}¢ +CreateScopeRBACRoleBinding9.google.cloud.gkehub.v1.CreateScopeRBACRoleBindingRequest.google.longrunning.Operation"©ÊA$ +RBACRoleBindingOperationMetadataÚA)parent,rbacrolebinding,rbacrolebinding_id‚Óä“P"=/v1/{parent=projects/*/locations/*/scopes/*}/rbacrolebindings:rbacrolebinding¤ +UpdateScopeRBACRoleBinding9.google.cloud.gkehub.v1.UpdateScopeRBACRoleBindingRequest.google.longrunning.Operation"«ÊA$ +RBACRoleBindingOperationMetadataÚArbacrolebinding,update_mask‚Óä“`2M/v1/{rbacrolebinding.name=projects/*/locations/*/scopes/*/rbacrolebindings/*}:rbacrolebindingñ +DeleteScopeRBACRoleBinding9.google.cloud.gkehub.v1.DeleteScopeRBACRoleBindingRequest.google.longrunning.Operation"yÊA* +google.protobuf.EmptyOperationMetadataÚAname‚Óä“?*=/v1/{name=projects/*/locations/*/scopes/*/rbacrolebindings/*}à +ListScopeRBACRoleBindings8.google.cloud.gkehub.v1.ListScopeRBACRoleBindingsRequest9.google.cloud.gkehub.v1.ListScopeRBACRoleBindingsResponse"NÚAparent‚Óä“?=/v1/{parent=projects/*/locations/*/scopes/*}/rbacrolebindings +GetScope\'.google.cloud.gkehub.v1.GetScopeRequest.google.cloud.gkehub.v1.Scope"9ÚAname‚Óä“,*/v1/{name=projects/*/locations/*/scopes/*}È + CreateScope*.google.cloud.gkehub.v1.CreateScopeRequest.google.longrunning.Operation"nÊA +ScopeOperationMetadataÚAparent,scope,scope_id‚Óä“3"*/v1/{parent=projects/*/locations/*}/scopes:scopeÊ + UpdateScope*.google.cloud.gkehub.v1.UpdateScopeRequest.google.longrunning.Operation"pÊA +ScopeOperationMetadataÚAscope,update_mask‚Óä“920/v1/{scope.name=projects/*/locations/*/scopes/*}:scopeÀ + DeleteScope*.google.cloud.gkehub.v1.DeleteScopeRequest.google.longrunning.Operation"fÊA* +google.protobuf.EmptyOperationMetadataÚAname‚Óä“,**/v1/{name=projects/*/locations/*/scopes/*}  + +ListScopes).google.cloud.gkehub.v1.ListScopesRequest*.google.cloud.gkehub.v1.ListScopesResponse";ÚAparent‚Óä“,*/v1/{parent=projects/*/locations/*}/scopesÉ +ListPermittedScopes2.google.cloud.gkehub.v1.ListPermittedScopesRequest3.google.cloud.gkehub.v1.ListPermittedScopesResponse"IÚAparent‚Óä“:8/v1/{parent=projects/*/locations/*}/scopes:listPermittedÁ +GetMembershipBinding3.google.cloud.gkehub.v1.GetMembershipBindingRequest).google.cloud.gkehub.v1.MembershipBinding"IÚAname‚Óä“<:/v1/{name=projects/*/locations/*/memberships/*/bindings/*}¤ +CreateMembershipBinding6.google.cloud.gkehub.v1.CreateMembershipBindingRequest.google.longrunning.Operation"±ÊA& +MembershipBindingOperationMetadataÚA/parent,membership_binding,membership_binding_id‚Óä“P":/v1/{parent=projects/*/locations/*/memberships/*}/bindings:membership_binding¦ +UpdateMembershipBinding6.google.cloud.gkehub.v1.UpdateMembershipBindingRequest.google.longrunning.Operation"³ÊA& +MembershipBindingOperationMetadataÚAmembership_binding,update_mask‚Óä“c2M/v1/{membership_binding.name=projects/*/locations/*/memberships/*/bindings/*}:membership_bindingè +DeleteMembershipBinding6.google.cloud.gkehub.v1.DeleteMembershipBindingRequest.google.longrunning.Operation"vÊA* +google.protobuf.EmptyOperationMetadataÚAname‚Óä“<*:/v1/{name=projects/*/locations/*/memberships/*/bindings/*}Ô +ListMembershipBindings5.google.cloud.gkehub.v1.ListMembershipBindingsRequest6.google.cloud.gkehub.v1.ListMembershipBindingsResponse"KÚAparent‚Óä“<:/v1/{parent=projects/*/locations/*/memberships/*}/bindings× +GetMembershipRBACRoleBinding;.google.cloud.gkehub.v1.GetMembershipRBACRoleBindingRequest\'.google.cloud.gkehub.v1.RBACRoleBinding"QÚAname‚Óä“DB/v1/{name=projects/*/locations/*/memberships/*/rbacrolebindings/*}± +CreateMembershipRBACRoleBinding>.google.cloud.gkehub.v1.CreateMembershipRBACRoleBindingRequest.google.longrunning.Operation"®ÊA$ +RBACRoleBindingOperationMetadataÚA)parent,rbacrolebinding,rbacrolebinding_id‚Óä“U"B/v1/{parent=projects/*/locations/*/memberships/*}/rbacrolebindings:rbacrolebinding³ +UpdateMembershipRBACRoleBinding>.google.cloud.gkehub.v1.UpdateMembershipRBACRoleBindingRequest.google.longrunning.Operation"°ÊA$ +RBACRoleBindingOperationMetadataÚArbacrolebinding,update_mask‚Óä“e2R/v1/{rbacrolebinding.name=projects/*/locations/*/memberships/*/rbacrolebindings/*}:rbacrolebinding€ +DeleteMembershipRBACRoleBinding>.google.cloud.gkehub.v1.DeleteMembershipRBACRoleBindingRequest.google.longrunning.Operation"~ÊA* +google.protobuf.EmptyOperationMetadataÚAname‚Óä“D*B/v1/{name=projects/*/locations/*/memberships/*/rbacrolebindings/*}ô +ListMembershipRBACRoleBindings=.google.cloud.gkehub.v1.ListMembershipRBACRoleBindingsRequest>.google.cloud.gkehub.v1.ListMembershipRBACRoleBindingsResponse"SÚAparent‚Óä“DB/v1/{parent=projects/*/locations/*/memberships/*}/rbacrolebindings¸ +%GenerateMembershipRBACRoleBindingYAMLD.google.cloud.gkehub.v1.GenerateMembershipRBACRoleBindingYAMLRequestE.google.cloud.gkehub.v1.GenerateMembershipRBACRoleBindingYAMLResponse"‚Óä“{"h/v1/{parent=projects/*/locations/*/memberships/*}/rbacrolebindings:generateMembershipRBACRoleBindingYAML:rbacrolebindingIÊAgkehub.googleapis.comÒA.https://www.googleapis.com/auth/cloud-platformB® com.google.cloud.gkehub.v1B ServiceProtoPZ2cloud.google.com/go/gkehub/apiv1/gkehubpb;gkehubpbªGoogle.Cloud.GkeHub.V1ÊGoogle\\Cloud\\GkeHub\\V1êGoogle::Cloud::GkeHub::V1bproto3' , true); diff --git a/GkeHub/samples/V1/GkeHubClient/create_fleet.php b/GkeHub/samples/V1/GkeHubClient/create_fleet.php new file mode 100644 index 000000000000..5721765b8dc4 --- /dev/null +++ b/GkeHub/samples/V1/GkeHubClient/create_fleet.php @@ -0,0 +1,86 @@ +setParent($formattedParent) + ->setFleet($fleet); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $gkeHubClient->createFleet($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Fleet $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 = GkeHubClient::locationName('[PROJECT]', '[LOCATION]'); + + create_fleet_sample($formattedParent); +} +// [END gkehub_v1_generated_GkeHub_CreateFleet_sync] diff --git a/GkeHub/samples/V1/GkeHubClient/create_membership_binding.php b/GkeHub/samples/V1/GkeHubClient/create_membership_binding.php new file mode 100644 index 000000000000..5a0758554366 --- /dev/null +++ b/GkeHub/samples/V1/GkeHubClient/create_membership_binding.php @@ -0,0 +1,92 @@ +setParent($formattedParent) + ->setMembershipBinding($membershipBinding) + ->setMembershipBindingId($membershipBindingId); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $gkeHubClient->createMembershipBinding($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var MembershipBinding $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 = GkeHubClient::membershipName('[PROJECT]', '[LOCATION]', '[MEMBERSHIP]'); + $membershipBindingId = '[MEMBERSHIP_BINDING_ID]'; + + create_membership_binding_sample($formattedParent, $membershipBindingId); +} +// [END gkehub_v1_generated_GkeHub_CreateMembershipBinding_sync] diff --git a/GkeHub/samples/V1/GkeHubClient/create_membership_rbac_role_binding.php b/GkeHub/samples/V1/GkeHubClient/create_membership_rbac_role_binding.php new file mode 100644 index 000000000000..9769b43a3552 --- /dev/null +++ b/GkeHub/samples/V1/GkeHubClient/create_membership_rbac_role_binding.php @@ -0,0 +1,102 @@ +setRole($rbacrolebindingRole); + $request = (new CreateMembershipRBACRoleBindingRequest()) + ->setParent($formattedParent) + ->setRbacrolebindingId($rbacrolebindingId) + ->setRbacrolebinding($rbacrolebinding); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $gkeHubClient->createMembershipRBACRoleBinding($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var RBACRoleBinding $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 = GkeHubClient::scopeName('[PROJECT]', '[LOCATION]', '[SCOPE]'); + $rbacrolebindingId = '[RBACROLEBINDING_ID]'; + + create_membership_rbac_role_binding_sample($formattedParent, $rbacrolebindingId); +} +// [END gkehub_v1_generated_GkeHub_CreateMembershipRBACRoleBinding_sync] diff --git a/GkeHub/samples/V1/GkeHubClient/create_scope.php b/GkeHub/samples/V1/GkeHubClient/create_scope.php new file mode 100644 index 000000000000..03384a4204e9 --- /dev/null +++ b/GkeHub/samples/V1/GkeHubClient/create_scope.php @@ -0,0 +1,90 @@ +setParent($formattedParent) + ->setScopeId($scopeId) + ->setScope($scope); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $gkeHubClient->createScope($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Scope $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 = GkeHubClient::locationName('[PROJECT]', '[LOCATION]'); + $scopeId = '[SCOPE_ID]'; + + create_scope_sample($formattedParent, $scopeId); +} +// [END gkehub_v1_generated_GkeHub_CreateScope_sync] diff --git a/GkeHub/samples/V1/GkeHubClient/create_scope_namespace.php b/GkeHub/samples/V1/GkeHubClient/create_scope_namespace.php new file mode 100644 index 000000000000..d62c115c9bbb --- /dev/null +++ b/GkeHub/samples/V1/GkeHubClient/create_scope_namespace.php @@ -0,0 +1,104 @@ +setScope($formattedScopeNamespaceScope); + $request = (new CreateScopeNamespaceRequest()) + ->setParent($formattedParent) + ->setScopeNamespaceId($scopeNamespaceId) + ->setScopeNamespace($scopeNamespace); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $gkeHubClient->createScopeNamespace($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var PBNamespace $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 = GkeHubClient::scopeName('[PROJECT]', '[LOCATION]', '[SCOPE]'); + $scopeNamespaceId = '[SCOPE_NAMESPACE_ID]'; + $formattedScopeNamespaceScope = GkeHubClient::scopeName('[PROJECT]', '[LOCATION]', '[SCOPE]'); + + create_scope_namespace_sample($formattedParent, $scopeNamespaceId, $formattedScopeNamespaceScope); +} +// [END gkehub_v1_generated_GkeHub_CreateScopeNamespace_sync] diff --git a/GkeHub/samples/V1/GkeHubClient/create_scope_rbac_role_binding.php b/GkeHub/samples/V1/GkeHubClient/create_scope_rbac_role_binding.php new file mode 100644 index 000000000000..3a4b33f8320d --- /dev/null +++ b/GkeHub/samples/V1/GkeHubClient/create_scope_rbac_role_binding.php @@ -0,0 +1,102 @@ +setRole($rbacrolebindingRole); + $request = (new CreateScopeRBACRoleBindingRequest()) + ->setParent($formattedParent) + ->setRbacrolebindingId($rbacrolebindingId) + ->setRbacrolebinding($rbacrolebinding); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $gkeHubClient->createScopeRBACRoleBinding($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var RBACRoleBinding $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 = GkeHubClient::scopeName('[PROJECT]', '[LOCATION]', '[SCOPE]'); + $rbacrolebindingId = '[RBACROLEBINDING_ID]'; + + create_scope_rbac_role_binding_sample($formattedParent, $rbacrolebindingId); +} +// [END gkehub_v1_generated_GkeHub_CreateScopeRBACRoleBinding_sync] diff --git a/GkeHub/samples/V1/GkeHubClient/delete_fleet.php b/GkeHub/samples/V1/GkeHubClient/delete_fleet.php new file mode 100644 index 000000000000..a17fdcf3d80e --- /dev/null +++ b/GkeHub/samples/V1/GkeHubClient/delete_fleet.php @@ -0,0 +1,81 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $gkeHubClient->deleteFleet($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 = GkeHubClient::fleetName('[PROJECT]', '[LOCATION]', '[FLEET]'); + + delete_fleet_sample($formattedName); +} +// [END gkehub_v1_generated_GkeHub_DeleteFleet_sync] diff --git a/GkeHub/samples/V1/GkeHubClient/delete_membership_binding.php b/GkeHub/samples/V1/GkeHubClient/delete_membership_binding.php new file mode 100644 index 000000000000..d33574ead7b0 --- /dev/null +++ b/GkeHub/samples/V1/GkeHubClient/delete_membership_binding.php @@ -0,0 +1,86 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $gkeHubClient->deleteMembershipBinding($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 = GkeHubClient::membershipBindingName( + '[PROJECT]', + '[LOCATION]', + '[MEMBERSHIP]', + '[MEMBERSHIPBINDING]' + ); + + delete_membership_binding_sample($formattedName); +} +// [END gkehub_v1_generated_GkeHub_DeleteMembershipBinding_sync] diff --git a/GkeHub/samples/V1/GkeHubClient/delete_membership_rbac_role_binding.php b/GkeHub/samples/V1/GkeHubClient/delete_membership_rbac_role_binding.php new file mode 100644 index 000000000000..d0796b608d3d --- /dev/null +++ b/GkeHub/samples/V1/GkeHubClient/delete_membership_rbac_role_binding.php @@ -0,0 +1,86 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $gkeHubClient->deleteMembershipRBACRoleBinding($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 = GkeHubClient::rBACRoleBindingName( + '[PROJECT]', + '[LOCATION]', + '[SCOPE]', + '[RBACROLEBINDING]' + ); + + delete_membership_rbac_role_binding_sample($formattedName); +} +// [END gkehub_v1_generated_GkeHub_DeleteMembershipRBACRoleBinding_sync] diff --git a/GkeHub/samples/V1/GkeHubClient/delete_scope.php b/GkeHub/samples/V1/GkeHubClient/delete_scope.php new file mode 100644 index 000000000000..dfa3180c70c7 --- /dev/null +++ b/GkeHub/samples/V1/GkeHubClient/delete_scope.php @@ -0,0 +1,81 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $gkeHubClient->deleteScope($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 = GkeHubClient::scopeName('[PROJECT]', '[LOCATION]', '[SCOPE]'); + + delete_scope_sample($formattedName); +} +// [END gkehub_v1_generated_GkeHub_DeleteScope_sync] diff --git a/GkeHub/samples/V1/GkeHubClient/delete_scope_namespace.php b/GkeHub/samples/V1/GkeHubClient/delete_scope_namespace.php new file mode 100644 index 000000000000..322bf21fbd09 --- /dev/null +++ b/GkeHub/samples/V1/GkeHubClient/delete_scope_namespace.php @@ -0,0 +1,81 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $gkeHubClient->deleteScopeNamespace($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 = GkeHubClient::namespaceName('[PROJECT]', '[LOCATION]', '[SCOPE]', '[NAMESPACE]'); + + delete_scope_namespace_sample($formattedName); +} +// [END gkehub_v1_generated_GkeHub_DeleteScopeNamespace_sync] diff --git a/GkeHub/samples/V1/GkeHubClient/delete_scope_rbac_role_binding.php b/GkeHub/samples/V1/GkeHubClient/delete_scope_rbac_role_binding.php new file mode 100644 index 000000000000..5710584b271c --- /dev/null +++ b/GkeHub/samples/V1/GkeHubClient/delete_scope_rbac_role_binding.php @@ -0,0 +1,86 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $gkeHubClient->deleteScopeRBACRoleBinding($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 = GkeHubClient::rBACRoleBindingName( + '[PROJECT]', + '[LOCATION]', + '[SCOPE]', + '[RBACROLEBINDING]' + ); + + delete_scope_rbac_role_binding_sample($formattedName); +} +// [END gkehub_v1_generated_GkeHub_DeleteScopeRBACRoleBinding_sync] diff --git a/GkeHub/samples/V1/GkeHubClient/generate_membership_rbac_role_binding_yaml.php b/GkeHub/samples/V1/GkeHubClient/generate_membership_rbac_role_binding_yaml.php new file mode 100644 index 000000000000..94dfd1851e73 --- /dev/null +++ b/GkeHub/samples/V1/GkeHubClient/generate_membership_rbac_role_binding_yaml.php @@ -0,0 +1,92 @@ +setRole($rbacrolebindingRole); + $request = (new GenerateMembershipRBACRoleBindingYAMLRequest()) + ->setParent($formattedParent) + ->setRbacrolebindingId($rbacrolebindingId) + ->setRbacrolebinding($rbacrolebinding); + + // Call the API and handle any network failures. + try { + /** @var GenerateMembershipRBACRoleBindingYAMLResponse $response */ + $response = $gkeHubClient->generateMembershipRBACRoleBindingYAML($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = GkeHubClient::membershipName('[PROJECT]', '[LOCATION]', '[MEMBERSHIP]'); + $rbacrolebindingId = '[RBACROLEBINDING_ID]'; + + generate_membership_rbac_role_binding_yaml_sample($formattedParent, $rbacrolebindingId); +} +// [END gkehub_v1_generated_GkeHub_GenerateMembershipRBACRoleBindingYAML_sync] diff --git a/GkeHub/samples/V1/GkeHubClient/get_fleet.php b/GkeHub/samples/V1/GkeHubClient/get_fleet.php new file mode 100644 index 000000000000..530d7576828b --- /dev/null +++ b/GkeHub/samples/V1/GkeHubClient/get_fleet.php @@ -0,0 +1,72 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Fleet $response */ + $response = $gkeHubClient->getFleet($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 = GkeHubClient::fleetName('[PROJECT]', '[LOCATION]', '[FLEET]'); + + get_fleet_sample($formattedName); +} +// [END gkehub_v1_generated_GkeHub_GetFleet_sync] diff --git a/GkeHub/samples/V1/GkeHubClient/get_membership_binding.php b/GkeHub/samples/V1/GkeHubClient/get_membership_binding.php new file mode 100644 index 000000000000..a8b2eb57588b --- /dev/null +++ b/GkeHub/samples/V1/GkeHubClient/get_membership_binding.php @@ -0,0 +1,77 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var MembershipBinding $response */ + $response = $gkeHubClient->getMembershipBinding($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 = GkeHubClient::membershipBindingName( + '[PROJECT]', + '[LOCATION]', + '[MEMBERSHIP]', + '[MEMBERSHIPBINDING]' + ); + + get_membership_binding_sample($formattedName); +} +// [END gkehub_v1_generated_GkeHub_GetMembershipBinding_sync] diff --git a/GkeHub/samples/V1/GkeHubClient/get_membership_rbac_role_binding.php b/GkeHub/samples/V1/GkeHubClient/get_membership_rbac_role_binding.php new file mode 100644 index 000000000000..0f017f6da4be --- /dev/null +++ b/GkeHub/samples/V1/GkeHubClient/get_membership_rbac_role_binding.php @@ -0,0 +1,77 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var RBACRoleBinding $response */ + $response = $gkeHubClient->getMembershipRBACRoleBinding($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 = GkeHubClient::rBACRoleBindingName( + '[PROJECT]', + '[LOCATION]', + '[SCOPE]', + '[RBACROLEBINDING]' + ); + + get_membership_rbac_role_binding_sample($formattedName); +} +// [END gkehub_v1_generated_GkeHub_GetMembershipRBACRoleBinding_sync] diff --git a/GkeHub/samples/V1/GkeHubClient/get_scope.php b/GkeHub/samples/V1/GkeHubClient/get_scope.php new file mode 100644 index 000000000000..1d784dc4df6f --- /dev/null +++ b/GkeHub/samples/V1/GkeHubClient/get_scope.php @@ -0,0 +1,72 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Scope $response */ + $response = $gkeHubClient->getScope($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 = GkeHubClient::scopeName('[PROJECT]', '[LOCATION]', '[SCOPE]'); + + get_scope_sample($formattedName); +} +// [END gkehub_v1_generated_GkeHub_GetScope_sync] diff --git a/GkeHub/samples/V1/GkeHubClient/get_scope_namespace.php b/GkeHub/samples/V1/GkeHubClient/get_scope_namespace.php new file mode 100644 index 000000000000..34731ff6f754 --- /dev/null +++ b/GkeHub/samples/V1/GkeHubClient/get_scope_namespace.php @@ -0,0 +1,72 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var PBNamespace $response */ + $response = $gkeHubClient->getScopeNamespace($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 = GkeHubClient::namespaceName('[PROJECT]', '[LOCATION]', '[SCOPE]', '[NAMESPACE]'); + + get_scope_namespace_sample($formattedName); +} +// [END gkehub_v1_generated_GkeHub_GetScopeNamespace_sync] diff --git a/GkeHub/samples/V1/GkeHubClient/get_scope_rbac_role_binding.php b/GkeHub/samples/V1/GkeHubClient/get_scope_rbac_role_binding.php new file mode 100644 index 000000000000..a4a4f0f23686 --- /dev/null +++ b/GkeHub/samples/V1/GkeHubClient/get_scope_rbac_role_binding.php @@ -0,0 +1,77 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var RBACRoleBinding $response */ + $response = $gkeHubClient->getScopeRBACRoleBinding($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 = GkeHubClient::rBACRoleBindingName( + '[PROJECT]', + '[LOCATION]', + '[SCOPE]', + '[RBACROLEBINDING]' + ); + + get_scope_rbac_role_binding_sample($formattedName); +} +// [END gkehub_v1_generated_GkeHub_GetScopeRBACRoleBinding_sync] diff --git a/GkeHub/samples/V1/GkeHubClient/list_bound_memberships.php b/GkeHub/samples/V1/GkeHubClient/list_bound_memberships.php new file mode 100644 index 000000000000..a95655798984 --- /dev/null +++ b/GkeHub/samples/V1/GkeHubClient/list_bound_memberships.php @@ -0,0 +1,78 @@ +setScopeName($formattedScopeName); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $gkeHubClient->listBoundMemberships($request); + + /** @var Membership $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 +{ + $formattedScopeName = GkeHubClient::scopeName('[PROJECT]', '[LOCATION]', '[SCOPE]'); + + list_bound_memberships_sample($formattedScopeName); +} +// [END gkehub_v1_generated_GkeHub_ListBoundMemberships_sync] diff --git a/GkeHub/samples/V1/GkeHubClient/list_fleets.php b/GkeHub/samples/V1/GkeHubClient/list_fleets.php new file mode 100644 index 000000000000..b2f8cadb7911 --- /dev/null +++ b/GkeHub/samples/V1/GkeHubClient/list_fleets.php @@ -0,0 +1,78 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $gkeHubClient->listFleets($request); + + /** @var Fleet $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 = GkeHubClient::locationName('[PROJECT]', '[LOCATION]'); + + list_fleets_sample($formattedParent); +} +// [END gkehub_v1_generated_GkeHub_ListFleets_sync] diff --git a/GkeHub/samples/V1/GkeHubClient/list_membership_bindings.php b/GkeHub/samples/V1/GkeHubClient/list_membership_bindings.php new file mode 100644 index 000000000000..e8b2cb7667d2 --- /dev/null +++ b/GkeHub/samples/V1/GkeHubClient/list_membership_bindings.php @@ -0,0 +1,77 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $gkeHubClient->listMembershipBindings($request); + + /** @var MembershipBinding $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 = GkeHubClient::membershipName('[PROJECT]', '[LOCATION]', '[MEMBERSHIP]'); + + list_membership_bindings_sample($formattedParent); +} +// [END gkehub_v1_generated_GkeHub_ListMembershipBindings_sync] diff --git a/GkeHub/samples/V1/GkeHubClient/list_membership_rbac_role_bindings.php b/GkeHub/samples/V1/GkeHubClient/list_membership_rbac_role_bindings.php new file mode 100644 index 000000000000..35fafd292544 --- /dev/null +++ b/GkeHub/samples/V1/GkeHubClient/list_membership_rbac_role_bindings.php @@ -0,0 +1,77 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $gkeHubClient->listMembershipRBACRoleBindings($request); + + /** @var RBACRoleBinding $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 = GkeHubClient::scopeName('[PROJECT]', '[LOCATION]', '[SCOPE]'); + + list_membership_rbac_role_bindings_sample($formattedParent); +} +// [END gkehub_v1_generated_GkeHub_ListMembershipRBACRoleBindings_sync] diff --git a/GkeHub/samples/V1/GkeHubClient/list_permitted_scopes.php b/GkeHub/samples/V1/GkeHubClient/list_permitted_scopes.php new file mode 100644 index 000000000000..2283dad77ec4 --- /dev/null +++ b/GkeHub/samples/V1/GkeHubClient/list_permitted_scopes.php @@ -0,0 +1,77 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $gkeHubClient->listPermittedScopes($request); + + /** @var Scope $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 = GkeHubClient::locationName('[PROJECT]', '[LOCATION]'); + + list_permitted_scopes_sample($formattedParent); +} +// [END gkehub_v1_generated_GkeHub_ListPermittedScopes_sync] diff --git a/GkeHub/samples/V1/GkeHubClient/list_scope_namespaces.php b/GkeHub/samples/V1/GkeHubClient/list_scope_namespaces.php new file mode 100644 index 000000000000..6ddc9423d332 --- /dev/null +++ b/GkeHub/samples/V1/GkeHubClient/list_scope_namespaces.php @@ -0,0 +1,77 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $gkeHubClient->listScopeNamespaces($request); + + /** @var PBNamespace $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 = GkeHubClient::scopeName('[PROJECT]', '[LOCATION]', '[SCOPE]'); + + list_scope_namespaces_sample($formattedParent); +} +// [END gkehub_v1_generated_GkeHub_ListScopeNamespaces_sync] diff --git a/GkeHub/samples/V1/GkeHubClient/list_scope_rbac_role_bindings.php b/GkeHub/samples/V1/GkeHubClient/list_scope_rbac_role_bindings.php new file mode 100644 index 000000000000..4da4798533db --- /dev/null +++ b/GkeHub/samples/V1/GkeHubClient/list_scope_rbac_role_bindings.php @@ -0,0 +1,77 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $gkeHubClient->listScopeRBACRoleBindings($request); + + /** @var RBACRoleBinding $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 = GkeHubClient::scopeName('[PROJECT]', '[LOCATION]', '[SCOPE]'); + + list_scope_rbac_role_bindings_sample($formattedParent); +} +// [END gkehub_v1_generated_GkeHub_ListScopeRBACRoleBindings_sync] diff --git a/GkeHub/samples/V1/GkeHubClient/list_scopes.php b/GkeHub/samples/V1/GkeHubClient/list_scopes.php new file mode 100644 index 000000000000..bb224085cb23 --- /dev/null +++ b/GkeHub/samples/V1/GkeHubClient/list_scopes.php @@ -0,0 +1,77 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $gkeHubClient->listScopes($request); + + /** @var Scope $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 = GkeHubClient::locationName('[PROJECT]', '[LOCATION]'); + + list_scopes_sample($formattedParent); +} +// [END gkehub_v1_generated_GkeHub_ListScopes_sync] diff --git a/GkeHub/samples/V1/GkeHubClient/update_fleet.php b/GkeHub/samples/V1/GkeHubClient/update_fleet.php new file mode 100644 index 000000000000..28e85bb5cf3e --- /dev/null +++ b/GkeHub/samples/V1/GkeHubClient/update_fleet.php @@ -0,0 +1,74 @@ +setFleet($fleet) + ->setUpdateMask($updateMask); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $gkeHubClient->updateFleet($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Fleet $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 gkehub_v1_generated_GkeHub_UpdateFleet_sync] diff --git a/GkeHub/samples/V1/GkeHubClient/update_membership_binding.php b/GkeHub/samples/V1/GkeHubClient/update_membership_binding.php new file mode 100644 index 000000000000..e1a30ffe4140 --- /dev/null +++ b/GkeHub/samples/V1/GkeHubClient/update_membership_binding.php @@ -0,0 +1,74 @@ +setMembershipBinding($membershipBinding) + ->setUpdateMask($updateMask); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $gkeHubClient->updateMembershipBinding($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var MembershipBinding $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 gkehub_v1_generated_GkeHub_UpdateMembershipBinding_sync] diff --git a/GkeHub/samples/V1/GkeHubClient/update_membership_rbac_role_binding.php b/GkeHub/samples/V1/GkeHubClient/update_membership_rbac_role_binding.php new file mode 100644 index 000000000000..67b58378a330 --- /dev/null +++ b/GkeHub/samples/V1/GkeHubClient/update_membership_rbac_role_binding.php @@ -0,0 +1,77 @@ +setRole($rbacrolebindingRole); + $updateMask = new FieldMask(); + $request = (new UpdateMembershipRBACRoleBindingRequest()) + ->setRbacrolebinding($rbacrolebinding) + ->setUpdateMask($updateMask); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $gkeHubClient->updateMembershipRBACRoleBinding($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var RBACRoleBinding $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 gkehub_v1_generated_GkeHub_UpdateMembershipRBACRoleBinding_sync] diff --git a/GkeHub/samples/V1/GkeHubClient/update_scope.php b/GkeHub/samples/V1/GkeHubClient/update_scope.php new file mode 100644 index 000000000000..08a67253bb5a --- /dev/null +++ b/GkeHub/samples/V1/GkeHubClient/update_scope.php @@ -0,0 +1,74 @@ +setScope($scope) + ->setUpdateMask($updateMask); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $gkeHubClient->updateScope($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Scope $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 gkehub_v1_generated_GkeHub_UpdateScope_sync] diff --git a/GkeHub/samples/V1/GkeHubClient/update_scope_namespace.php b/GkeHub/samples/V1/GkeHubClient/update_scope_namespace.php new file mode 100644 index 000000000000..ce155884bc88 --- /dev/null +++ b/GkeHub/samples/V1/GkeHubClient/update_scope_namespace.php @@ -0,0 +1,88 @@ +setScope($formattedScopeNamespaceScope); + $updateMask = new FieldMask(); + $request = (new UpdateScopeNamespaceRequest()) + ->setScopeNamespace($scopeNamespace) + ->setUpdateMask($updateMask); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $gkeHubClient->updateScopeNamespace($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var PBNamespace $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 +{ + $formattedScopeNamespaceScope = GkeHubClient::scopeName('[PROJECT]', '[LOCATION]', '[SCOPE]'); + + update_scope_namespace_sample($formattedScopeNamespaceScope); +} +// [END gkehub_v1_generated_GkeHub_UpdateScopeNamespace_sync] diff --git a/GkeHub/samples/V1/GkeHubClient/update_scope_rbac_role_binding.php b/GkeHub/samples/V1/GkeHubClient/update_scope_rbac_role_binding.php new file mode 100644 index 000000000000..e2eea1d1802a --- /dev/null +++ b/GkeHub/samples/V1/GkeHubClient/update_scope_rbac_role_binding.php @@ -0,0 +1,77 @@ +setRole($rbacrolebindingRole); + $updateMask = new FieldMask(); + $request = (new UpdateScopeRBACRoleBindingRequest()) + ->setRbacrolebinding($rbacrolebinding) + ->setUpdateMask($updateMask); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $gkeHubClient->updateScopeRBACRoleBinding($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var RBACRoleBinding $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 gkehub_v1_generated_GkeHub_UpdateScopeRBACRoleBinding_sync] diff --git a/GkeHub/src/RbacRoleBindingActuation/V1/FeatureSpec.php b/GkeHub/src/RbacRoleBindingActuation/V1/FeatureSpec.php new file mode 100644 index 000000000000..009a3914d922 --- /dev/null +++ b/GkeHub/src/RbacRoleBindingActuation/V1/FeatureSpec.php @@ -0,0 +1,76 @@ +google.cloud.gkehub.rbacrolebindingactuation.v1.FeatureSpec + */ +class FeatureSpec extends \Google\Protobuf\Internal\Message +{ + /** + * The list of allowed custom roles (ClusterRoles). If a ClusterRole is not + * part of this list, it cannot be used in a Scope RBACRoleBinding. If a + * ClusterRole in this list is in use, it cannot be removed from the list. + * + * Generated from protobuf field repeated string allowed_custom_roles = 2; + */ + private $allowed_custom_roles; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $allowed_custom_roles + * The list of allowed custom roles (ClusterRoles). If a ClusterRole is not + * part of this list, it cannot be used in a Scope RBACRoleBinding. If a + * ClusterRole in this list is in use, it cannot be removed from the list. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gkehub\V1\Rbacrolebindingactuation\Rbacrolebindingactuation::initOnce(); + parent::__construct($data); + } + + /** + * The list of allowed custom roles (ClusterRoles). If a ClusterRole is not + * part of this list, it cannot be used in a Scope RBACRoleBinding. If a + * ClusterRole in this list is in use, it cannot be removed from the list. + * + * Generated from protobuf field repeated string allowed_custom_roles = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAllowedCustomRoles() + { + return $this->allowed_custom_roles; + } + + /** + * The list of allowed custom roles (ClusterRoles). If a ClusterRole is not + * part of this list, it cannot be used in a Scope RBACRoleBinding. If a + * ClusterRole in this list is in use, it cannot be removed from the list. + * + * Generated from protobuf field repeated string allowed_custom_roles = 2; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAllowedCustomRoles($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->allowed_custom_roles = $arr; + + return $this; + } + +} + diff --git a/GkeHub/src/RbacRoleBindingActuation/V1/FeatureState.php b/GkeHub/src/RbacRoleBindingActuation/V1/FeatureState.php new file mode 100644 index 000000000000..fc27f23f8ee3 --- /dev/null +++ b/GkeHub/src/RbacRoleBindingActuation/V1/FeatureState.php @@ -0,0 +1,34 @@ +google.cloud.gkehub.rbacrolebindingactuation.v1.FeatureState + */ +class FeatureState extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gkehub\V1\Rbacrolebindingactuation\Rbacrolebindingactuation::initOnce(); + parent::__construct($data); + } + +} + diff --git a/GkeHub/src/V1/BinaryAuthorizationConfig.php b/GkeHub/src/V1/BinaryAuthorizationConfig.php new file mode 100644 index 000000000000..25e27fcaeb8f --- /dev/null +++ b/GkeHub/src/V1/BinaryAuthorizationConfig.php @@ -0,0 +1,102 @@ +google.cloud.gkehub.v1.BinaryAuthorizationConfig + */ +class BinaryAuthorizationConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Mode of operation for binauthz policy evaluation. + * + * Generated from protobuf field .google.cloud.gkehub.v1.BinaryAuthorizationConfig.EvaluationMode evaluation_mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $evaluation_mode = 0; + /** + * Optional. Binauthz policies that apply to this cluster. + * + * Generated from protobuf field repeated .google.cloud.gkehub.v1.BinaryAuthorizationConfig.PolicyBinding policy_bindings = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $policy_bindings; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $evaluation_mode + * Optional. Mode of operation for binauthz policy evaluation. + * @type array<\Google\Cloud\GkeHub\V1\BinaryAuthorizationConfig\PolicyBinding>|\Google\Protobuf\Internal\RepeatedField $policy_bindings + * Optional. Binauthz policies that apply to this cluster. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gkehub\V1\Fleet::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Mode of operation for binauthz policy evaluation. + * + * Generated from protobuf field .google.cloud.gkehub.v1.BinaryAuthorizationConfig.EvaluationMode evaluation_mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getEvaluationMode() + { + return $this->evaluation_mode; + } + + /** + * Optional. Mode of operation for binauthz policy evaluation. + * + * Generated from protobuf field .google.cloud.gkehub.v1.BinaryAuthorizationConfig.EvaluationMode evaluation_mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setEvaluationMode($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\GkeHub\V1\BinaryAuthorizationConfig\EvaluationMode::class); + $this->evaluation_mode = $var; + + return $this; + } + + /** + * Optional. Binauthz policies that apply to this cluster. + * + * Generated from protobuf field repeated .google.cloud.gkehub.v1.BinaryAuthorizationConfig.PolicyBinding policy_bindings = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPolicyBindings() + { + return $this->policy_bindings; + } + + /** + * Optional. Binauthz policies that apply to this cluster. + * + * Generated from protobuf field repeated .google.cloud.gkehub.v1.BinaryAuthorizationConfig.PolicyBinding policy_bindings = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\GkeHub\V1\BinaryAuthorizationConfig\PolicyBinding>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPolicyBindings($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\GkeHub\V1\BinaryAuthorizationConfig\PolicyBinding::class); + $this->policy_bindings = $arr; + + return $this; + } + +} + diff --git a/GkeHub/src/V1/BinaryAuthorizationConfig/EvaluationMode.php b/GkeHub/src/V1/BinaryAuthorizationConfig/EvaluationMode.php new file mode 100644 index 000000000000..0630e7cb0bd3 --- /dev/null +++ b/GkeHub/src/V1/BinaryAuthorizationConfig/EvaluationMode.php @@ -0,0 +1,62 @@ +google.cloud.gkehub.v1.BinaryAuthorizationConfig.EvaluationMode + */ +class EvaluationMode +{ + /** + * Default value + * + * Generated from protobuf enum EVALUATION_MODE_UNSPECIFIED = 0; + */ + const EVALUATION_MODE_UNSPECIFIED = 0; + /** + * Disable BinaryAuthorization + * + * Generated from protobuf enum DISABLED = 1; + */ + const DISABLED = 1; + /** + * Use Binary Authorization with the policies specified in policy_bindings. + * + * Generated from protobuf enum POLICY_BINDINGS = 2; + */ + const POLICY_BINDINGS = 2; + + private static $valueToName = [ + self::EVALUATION_MODE_UNSPECIFIED => 'EVALUATION_MODE_UNSPECIFIED', + self::DISABLED => 'DISABLED', + self::POLICY_BINDINGS => 'POLICY_BINDINGS', + ]; + + 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/GkeHub/src/V1/BinaryAuthorizationConfig/PolicyBinding.php b/GkeHub/src/V1/BinaryAuthorizationConfig/PolicyBinding.php new file mode 100644 index 000000000000..b3f7abb8bb2e --- /dev/null +++ b/GkeHub/src/V1/BinaryAuthorizationConfig/PolicyBinding.php @@ -0,0 +1,76 @@ +google.cloud.gkehub.v1.BinaryAuthorizationConfig.PolicyBinding + */ +class PolicyBinding extends \Google\Protobuf\Internal\Message +{ + /** + * The relative resource name of the binauthz platform policy to audit. GKE + * platform policies have the following format: + * `projects/{project_number}/platforms/gke/policies/{policy_id}`. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The relative resource name of the binauthz platform policy to audit. GKE + * platform policies have the following format: + * `projects/{project_number}/platforms/gke/policies/{policy_id}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gkehub\V1\Fleet::initOnce(); + parent::__construct($data); + } + + /** + * The relative resource name of the binauthz platform policy to audit. GKE + * platform policies have the following format: + * `projects/{project_number}/platforms/gke/policies/{policy_id}`. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The relative resource name of the binauthz platform policy to audit. GKE + * platform policies have the following format: + * `projects/{project_number}/platforms/gke/policies/{policy_id}`. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + + diff --git a/GkeHub/src/V1/Client/GkeHubClient.php b/GkeHub/src/V1/Client/GkeHubClient.php index 5e575732b03f..6c4ef1a8d8cc 100644 --- a/GkeHub/src/V1/Client/GkeHubClient.php +++ b/GkeHub/src/V1/Client/GkeHubClient.php @@ -36,19 +36,58 @@ use Google\ApiCore\ValidationException; use Google\Auth\FetchAuthTokenInterface; use Google\Cloud\GkeHub\V1\CreateFeatureRequest; +use Google\Cloud\GkeHub\V1\CreateFleetRequest; +use Google\Cloud\GkeHub\V1\CreateMembershipBindingRequest; +use Google\Cloud\GkeHub\V1\CreateMembershipRBACRoleBindingRequest; use Google\Cloud\GkeHub\V1\CreateMembershipRequest; +use Google\Cloud\GkeHub\V1\CreateScopeNamespaceRequest; +use Google\Cloud\GkeHub\V1\CreateScopeRBACRoleBindingRequest; +use Google\Cloud\GkeHub\V1\CreateScopeRequest; use Google\Cloud\GkeHub\V1\DeleteFeatureRequest; +use Google\Cloud\GkeHub\V1\DeleteFleetRequest; +use Google\Cloud\GkeHub\V1\DeleteMembershipBindingRequest; +use Google\Cloud\GkeHub\V1\DeleteMembershipRBACRoleBindingRequest; use Google\Cloud\GkeHub\V1\DeleteMembershipRequest; +use Google\Cloud\GkeHub\V1\DeleteScopeNamespaceRequest; +use Google\Cloud\GkeHub\V1\DeleteScopeRBACRoleBindingRequest; +use Google\Cloud\GkeHub\V1\DeleteScopeRequest; use Google\Cloud\GkeHub\V1\Feature; +use Google\Cloud\GkeHub\V1\Fleet; use Google\Cloud\GkeHub\V1\GenerateConnectManifestRequest; use Google\Cloud\GkeHub\V1\GenerateConnectManifestResponse; +use Google\Cloud\GkeHub\V1\GenerateMembershipRBACRoleBindingYAMLRequest; +use Google\Cloud\GkeHub\V1\GenerateMembershipRBACRoleBindingYAMLResponse; use Google\Cloud\GkeHub\V1\GetFeatureRequest; +use Google\Cloud\GkeHub\V1\GetFleetRequest; +use Google\Cloud\GkeHub\V1\GetMembershipBindingRequest; +use Google\Cloud\GkeHub\V1\GetMembershipRBACRoleBindingRequest; use Google\Cloud\GkeHub\V1\GetMembershipRequest; +use Google\Cloud\GkeHub\V1\GetScopeNamespaceRequest; +use Google\Cloud\GkeHub\V1\GetScopeRBACRoleBindingRequest; +use Google\Cloud\GkeHub\V1\GetScopeRequest; +use Google\Cloud\GkeHub\V1\ListBoundMembershipsRequest; use Google\Cloud\GkeHub\V1\ListFeaturesRequest; +use Google\Cloud\GkeHub\V1\ListFleetsRequest; +use Google\Cloud\GkeHub\V1\ListMembershipBindingsRequest; +use Google\Cloud\GkeHub\V1\ListMembershipRBACRoleBindingsRequest; use Google\Cloud\GkeHub\V1\ListMembershipsRequest; +use Google\Cloud\GkeHub\V1\ListPermittedScopesRequest; +use Google\Cloud\GkeHub\V1\ListScopeNamespacesRequest; +use Google\Cloud\GkeHub\V1\ListScopeRBACRoleBindingsRequest; +use Google\Cloud\GkeHub\V1\ListScopesRequest; use Google\Cloud\GkeHub\V1\Membership; +use Google\Cloud\GkeHub\V1\MembershipBinding; +use Google\Cloud\GkeHub\V1\PBNamespace; +use Google\Cloud\GkeHub\V1\RBACRoleBinding; +use Google\Cloud\GkeHub\V1\Scope; use Google\Cloud\GkeHub\V1\UpdateFeatureRequest; +use Google\Cloud\GkeHub\V1\UpdateFleetRequest; +use Google\Cloud\GkeHub\V1\UpdateMembershipBindingRequest; +use Google\Cloud\GkeHub\V1\UpdateMembershipRBACRoleBindingRequest; use Google\Cloud\GkeHub\V1\UpdateMembershipRequest; +use Google\Cloud\GkeHub\V1\UpdateScopeNamespaceRequest; +use Google\Cloud\GkeHub\V1\UpdateScopeRBACRoleBindingRequest; +use Google\Cloud\GkeHub\V1\UpdateScopeRequest; use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\Operation; use GuzzleHttp\Promise\PromiseInterface; @@ -82,16 +121,49 @@ * contained within formatted names that are returned by the API. * * @method PromiseInterface createFeatureAsync(CreateFeatureRequest $request, array $optionalArgs = []) + * @method PromiseInterface createFleetAsync(CreateFleetRequest $request, array $optionalArgs = []) * @method PromiseInterface createMembershipAsync(CreateMembershipRequest $request, array $optionalArgs = []) + * @method PromiseInterface createMembershipBindingAsync(CreateMembershipBindingRequest $request, array $optionalArgs = []) + * @method PromiseInterface createMembershipRBACRoleBindingAsync(CreateMembershipRBACRoleBindingRequest $request, array $optionalArgs = []) + * @method PromiseInterface createScopeAsync(CreateScopeRequest $request, array $optionalArgs = []) + * @method PromiseInterface createScopeNamespaceAsync(CreateScopeNamespaceRequest $request, array $optionalArgs = []) + * @method PromiseInterface createScopeRBACRoleBindingAsync(CreateScopeRBACRoleBindingRequest $request, array $optionalArgs = []) * @method PromiseInterface deleteFeatureAsync(DeleteFeatureRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteFleetAsync(DeleteFleetRequest $request, array $optionalArgs = []) * @method PromiseInterface deleteMembershipAsync(DeleteMembershipRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteMembershipBindingAsync(DeleteMembershipBindingRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteMembershipRBACRoleBindingAsync(DeleteMembershipRBACRoleBindingRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteScopeAsync(DeleteScopeRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteScopeNamespaceAsync(DeleteScopeNamespaceRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteScopeRBACRoleBindingAsync(DeleteScopeRBACRoleBindingRequest $request, array $optionalArgs = []) * @method PromiseInterface generateConnectManifestAsync(GenerateConnectManifestRequest $request, array $optionalArgs = []) + * @method PromiseInterface generateMembershipRBACRoleBindingYAMLAsync(GenerateMembershipRBACRoleBindingYAMLRequest $request, array $optionalArgs = []) * @method PromiseInterface getFeatureAsync(GetFeatureRequest $request, array $optionalArgs = []) + * @method PromiseInterface getFleetAsync(GetFleetRequest $request, array $optionalArgs = []) * @method PromiseInterface getMembershipAsync(GetMembershipRequest $request, array $optionalArgs = []) + * @method PromiseInterface getMembershipBindingAsync(GetMembershipBindingRequest $request, array $optionalArgs = []) + * @method PromiseInterface getMembershipRBACRoleBindingAsync(GetMembershipRBACRoleBindingRequest $request, array $optionalArgs = []) + * @method PromiseInterface getScopeAsync(GetScopeRequest $request, array $optionalArgs = []) + * @method PromiseInterface getScopeNamespaceAsync(GetScopeNamespaceRequest $request, array $optionalArgs = []) + * @method PromiseInterface getScopeRBACRoleBindingAsync(GetScopeRBACRoleBindingRequest $request, array $optionalArgs = []) + * @method PromiseInterface listBoundMembershipsAsync(ListBoundMembershipsRequest $request, array $optionalArgs = []) * @method PromiseInterface listFeaturesAsync(ListFeaturesRequest $request, array $optionalArgs = []) + * @method PromiseInterface listFleetsAsync(ListFleetsRequest $request, array $optionalArgs = []) + * @method PromiseInterface listMembershipBindingsAsync(ListMembershipBindingsRequest $request, array $optionalArgs = []) + * @method PromiseInterface listMembershipRBACRoleBindingsAsync(ListMembershipRBACRoleBindingsRequest $request, array $optionalArgs = []) * @method PromiseInterface listMembershipsAsync(ListMembershipsRequest $request, array $optionalArgs = []) + * @method PromiseInterface listPermittedScopesAsync(ListPermittedScopesRequest $request, array $optionalArgs = []) + * @method PromiseInterface listScopeNamespacesAsync(ListScopeNamespacesRequest $request, array $optionalArgs = []) + * @method PromiseInterface listScopeRBACRoleBindingsAsync(ListScopeRBACRoleBindingsRequest $request, array $optionalArgs = []) + * @method PromiseInterface listScopesAsync(ListScopesRequest $request, array $optionalArgs = []) * @method PromiseInterface updateFeatureAsync(UpdateFeatureRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateFleetAsync(UpdateFleetRequest $request, array $optionalArgs = []) * @method PromiseInterface updateMembershipAsync(UpdateMembershipRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateMembershipBindingAsync(UpdateMembershipBindingRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateMembershipRBACRoleBindingAsync(UpdateMembershipRBACRoleBindingRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateScopeAsync(UpdateScopeRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateScopeNamespaceAsync(UpdateScopeNamespaceRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateScopeRBACRoleBindingAsync(UpdateScopeRBACRoleBindingRequest $request, array $optionalArgs = []) */ final class GkeHubClient { @@ -208,6 +280,25 @@ public static function featureName(string $project, string $location, string $fe ]); } + /** + * Formats a string containing the fully-qualified path to represent a fleet + * resource. + * + * @param string $project + * @param string $location + * @param string $fleet + * + * @return string The formatted fleet resource. + */ + public static function fleetName(string $project, string $location, string $fleet): string + { + return self::getPathTemplate('fleet')->render([ + 'project' => $project, + 'location' => $location, + 'fleet' => $fleet, + ]); + } + /** * Formats a string containing the fully-qualified path to represent a location * resource. @@ -244,13 +335,200 @@ public static function membershipName(string $project, string $location, string ]); } + /** + * Formats a string containing the fully-qualified path to represent a + * membership_binding resource. + * + * @param string $project + * @param string $location + * @param string $membership + * @param string $membershipbinding + * + * @return string The formatted membership_binding resource. + */ + public static function membershipBindingName( + string $project, + string $location, + string $membership, + string $membershipbinding + ): string { + return self::getPathTemplate('membershipBinding')->render([ + 'project' => $project, + 'location' => $location, + 'membership' => $membership, + 'membershipbinding' => $membershipbinding, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a namespace + * resource. + * + * @param string $project + * @param string $location + * @param string $scope + * @param string $namespace + * + * @return string The formatted namespace resource. + */ + public static function namespaceName(string $project, string $location, string $scope, string $namespace): string + { + return self::getPathTemplate('namespace')->render([ + 'project' => $project, + 'location' => $location, + 'scope' => $scope, + 'namespace' => $namespace, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * organization_location_fleet resource. + * + * @param string $organization + * @param string $location + * @param string $fleet + * + * @return string The formatted organization_location_fleet resource. + */ + public static function organizationLocationFleetName(string $organization, string $location, string $fleet): string + { + return self::getPathTemplate('organizationLocationFleet')->render([ + 'organization' => $organization, + 'location' => $location, + 'fleet' => $fleet, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_fleet resource. + * + * @param string $project + * @param string $location + * @param string $fleet + * + * @return string The formatted project_location_fleet resource. + */ + public static function projectLocationFleetName(string $project, string $location, string $fleet): string + { + return self::getPathTemplate('projectLocationFleet')->render([ + 'project' => $project, + 'location' => $location, + 'fleet' => $fleet, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_membership_rbacrolebinding resource. + * + * @param string $project + * @param string $location + * @param string $membership + * @param string $rbacrolebinding + * + * @return string The formatted project_location_membership_rbacrolebinding resource. + */ + public static function projectLocationMembershipRbacrolebindingName( + string $project, + string $location, + string $membership, + string $rbacrolebinding + ): string { + return self::getPathTemplate('projectLocationMembershipRbacrolebinding')->render([ + 'project' => $project, + 'location' => $location, + 'membership' => $membership, + 'rbacrolebinding' => $rbacrolebinding, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_scope_rbacrolebinding resource. + * + * @param string $project + * @param string $location + * @param string $scope + * @param string $rbacrolebinding + * + * @return string The formatted project_location_scope_rbacrolebinding resource. + */ + public static function projectLocationScopeRbacrolebindingName( + string $project, + string $location, + string $scope, + string $rbacrolebinding + ): string { + return self::getPathTemplate('projectLocationScopeRbacrolebinding')->render([ + 'project' => $project, + 'location' => $location, + 'scope' => $scope, + 'rbacrolebinding' => $rbacrolebinding, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * rbac_role_binding resource. + * + * @param string $project + * @param string $location + * @param string $scope + * @param string $rbacrolebinding + * + * @return string The formatted rbac_role_binding resource. + */ + public static function rBACRoleBindingName( + string $project, + string $location, + string $scope, + string $rbacrolebinding + ): string { + return self::getPathTemplate('rBACRoleBinding')->render([ + 'project' => $project, + 'location' => $location, + 'scope' => $scope, + 'rbacrolebinding' => $rbacrolebinding, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a scope + * resource. + * + * @param string $project + * @param string $location + * @param string $scope + * + * @return string The formatted scope resource. + */ + public static function scopeName(string $project, string $location, string $scope): string + { + return self::getPathTemplate('scope')->render([ + 'project' => $project, + 'location' => $location, + 'scope' => $scope, + ]); + } + /** * Parses a formatted name string and returns an associative array of the components in the name. * The following name formats are supported: * Template: Pattern * - feature: projects/{project}/locations/{location}/features/{feature} + * - fleet: projects/{project}/locations/{location}/fleets/{fleet} * - location: projects/{project}/locations/{location} * - membership: projects/{project}/locations/{location}/memberships/{membership} + * - membershipBinding: projects/{project}/locations/{location}/memberships/{membership}/bindings/{membershipbinding} + * - namespace: projects/{project}/locations/{location}/scopes/{scope}/namespaces/{namespace} + * - organizationLocationFleet: organizations/{organization}/locations/{location}/fleets/{fleet} + * - projectLocationFleet: projects/{project}/locations/{location}/fleets/{fleet} + * - projectLocationMembershipRbacrolebinding: projects/{project}/locations/{location}/memberships/{membership}/rbacrolebindings/{rbacrolebinding} + * - projectLocationScopeRbacrolebinding: projects/{project}/locations/{location}/scopes/{scope}/rbacrolebindings/{rbacrolebinding} + * - rBACRoleBinding: projects/{project}/locations/{location}/scopes/{scope}/rbacrolebindings/{rbacrolebinding} + * - scope: projects/{project}/locations/{location}/scopes/{scope} * * 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 @@ -382,6 +660,32 @@ public function createFeature(CreateFeatureRequest $request, array $callOptions return $this->startApiCall('CreateFeature', $request, $callOptions)->wait(); } + /** + * Creates a fleet. + * + * The async variant is {@see GkeHubClient::createFleetAsync()} . + * + * @example samples/V1/GkeHubClient/create_fleet.php + * + * @param CreateFleetRequest $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 createFleet(CreateFleetRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateFleet', $request, $callOptions)->wait(); + } + /** * Creates a new Membership. * @@ -413,14 +717,14 @@ public function createMembership(CreateMembershipRequest $request, array $callOp } /** - * Removes a Feature. + * Creates a MembershipBinding. * - * The async variant is {@see GkeHubClient::deleteFeatureAsync()} . + * The async variant is {@see GkeHubClient::createMembershipBindingAsync()} . * - * @example samples/V1/GkeHubClient/delete_feature.php + * @example samples/V1/GkeHubClient/create_membership_binding.php * - * @param DeleteFeatureRequest $request A request to house fields associated with the call. - * @param array $callOptions { + * @param CreateMembershipBindingRequest $request A request to house fields associated with the call. + * @param array $callOptions { * Optional. * * @type RetrySettings|array $retrySettings @@ -429,28 +733,55 @@ public function createMembership(CreateMembershipRequest $request, array $callOp * {@see RetrySettings} for example usage. * } * - * @return OperationResponse + * @return OperationResponse * * @throws ApiException Thrown if the API call fails. */ - public function deleteFeature(DeleteFeatureRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('DeleteFeature', $request, $callOptions)->wait(); + public function createMembershipBinding( + CreateMembershipBindingRequest $request, + array $callOptions = [] + ): OperationResponse { + return $this->startApiCall('CreateMembershipBinding', $request, $callOptions)->wait(); } /** - * Removes a Membership. + * Creates a Membership RBACRoleBinding. * - * **This is currently only supported for GKE clusters on Google Cloud**. - * To unregister other clusters, follow the instructions at - * https://cloud.google.com/anthos/multicluster-management/connect/unregistering-a-cluster. + * The async variant is {@see GkeHubClient::createMembershipRBACRoleBindingAsync()} + * . * - * The async variant is {@see GkeHubClient::deleteMembershipAsync()} . + * @example samples/V1/GkeHubClient/create_membership_rbac_role_binding.php * - * @example samples/V1/GkeHubClient/delete_membership.php + * @param CreateMembershipRBACRoleBindingRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. * - * @param DeleteMembershipRequest $request A request to house fields associated with the call. - * @param array $callOptions { + * @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 createMembershipRBACRoleBinding( + CreateMembershipRBACRoleBindingRequest $request, + array $callOptions = [] + ): OperationResponse { + return $this->startApiCall('CreateMembershipRBACRoleBinding', $request, $callOptions)->wait(); + } + + /** + * Creates a Scope. + * + * The async variant is {@see GkeHubClient::createScopeAsync()} . + * + * @example samples/V1/GkeHubClient/create_scope.php + * + * @param CreateScopeRequest $request A request to house fields associated with the call. + * @param array $callOptions { * Optional. * * @type RetrySettings|array $retrySettings @@ -459,27 +790,24 @@ public function deleteFeature(DeleteFeatureRequest $request, array $callOptions * {@see RetrySettings} for example usage. * } * - * @return OperationResponse + * @return OperationResponse * * @throws ApiException Thrown if the API call fails. */ - public function deleteMembership(DeleteMembershipRequest $request, array $callOptions = []): OperationResponse + public function createScope(CreateScopeRequest $request, array $callOptions = []): OperationResponse { - return $this->startApiCall('DeleteMembership', $request, $callOptions)->wait(); + return $this->startApiCall('CreateScope', $request, $callOptions)->wait(); } /** - * Generates the manifest for deployment of the GKE connect agent. - * - * **This method is used internally by Google-provided libraries.** - * Most clients should not need to call this method directly. + * Creates a fleet namespace. * - * The async variant is {@see GkeHubClient::generateConnectManifestAsync()} . + * The async variant is {@see GkeHubClient::createScopeNamespaceAsync()} . * - * @example samples/V1/GkeHubClient/generate_connect_manifest.php + * @example samples/V1/GkeHubClient/create_scope_namespace.php * - * @param GenerateConnectManifestRequest $request A request to house fields associated with the call. - * @param array $callOptions { + * @param CreateScopeNamespaceRequest $request A request to house fields associated with the call. + * @param array $callOptions { * Optional. * * @type RetrySettings|array $retrySettings @@ -488,26 +816,26 @@ public function deleteMembership(DeleteMembershipRequest $request, array $callOp * {@see RetrySettings} for example usage. * } * - * @return GenerateConnectManifestResponse + * @return OperationResponse * * @throws ApiException Thrown if the API call fails. */ - public function generateConnectManifest( - GenerateConnectManifestRequest $request, + public function createScopeNamespace( + CreateScopeNamespaceRequest $request, array $callOptions = [] - ): GenerateConnectManifestResponse { - return $this->startApiCall('GenerateConnectManifest', $request, $callOptions)->wait(); + ): OperationResponse { + return $this->startApiCall('CreateScopeNamespace', $request, $callOptions)->wait(); } /** - * Gets details of a single Feature. + * Creates a Scope RBACRoleBinding. * - * The async variant is {@see GkeHubClient::getFeatureAsync()} . + * The async variant is {@see GkeHubClient::createScopeRBACRoleBindingAsync()} . * - * @example samples/V1/GkeHubClient/get_feature.php + * @example samples/V1/GkeHubClient/create_scope_rbac_role_binding.php * - * @param GetFeatureRequest $request A request to house fields associated with the call. - * @param array $callOptions { + * @param CreateScopeRBACRoleBindingRequest $request A request to house fields associated with the call. + * @param array $callOptions { * Optional. * * @type RetrySettings|array $retrySettings @@ -516,23 +844,25 @@ public function generateConnectManifest( * {@see RetrySettings} for example usage. * } * - * @return Feature + * @return OperationResponse * * @throws ApiException Thrown if the API call fails. */ - public function getFeature(GetFeatureRequest $request, array $callOptions = []): Feature - { - return $this->startApiCall('GetFeature', $request, $callOptions)->wait(); + public function createScopeRBACRoleBinding( + CreateScopeRBACRoleBindingRequest $request, + array $callOptions = [] + ): OperationResponse { + return $this->startApiCall('CreateScopeRBACRoleBinding', $request, $callOptions)->wait(); } /** - * Gets the details of a Membership. + * Removes a Feature. * - * The async variant is {@see GkeHubClient::getMembershipAsync()} . + * The async variant is {@see GkeHubClient::deleteFeatureAsync()} . * - * @example samples/V1/GkeHubClient/get_membership.php + * @example samples/V1/GkeHubClient/delete_feature.php * - * @param GetMembershipRequest $request A request to house fields associated with the call. + * @param DeleteFeatureRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. * @@ -542,24 +872,24 @@ public function getFeature(GetFeatureRequest $request, array $callOptions = []): * {@see RetrySettings} for example usage. * } * - * @return Membership + * @return OperationResponse * * @throws ApiException Thrown if the API call fails. */ - public function getMembership(GetMembershipRequest $request, array $callOptions = []): Membership + public function deleteFeature(DeleteFeatureRequest $request, array $callOptions = []): OperationResponse { - return $this->startApiCall('GetMembership', $request, $callOptions)->wait(); + return $this->startApiCall('DeleteFeature', $request, $callOptions)->wait(); } /** - * Lists Features in a given project and location. + * Removes a Fleet. There must be no memberships remaining in the Fleet. * - * The async variant is {@see GkeHubClient::listFeaturesAsync()} . + * The async variant is {@see GkeHubClient::deleteFleetAsync()} . * - * @example samples/V1/GkeHubClient/list_features.php + * @example samples/V1/GkeHubClient/delete_fleet.php * - * @param ListFeaturesRequest $request A request to house fields associated with the call. - * @param array $callOptions { + * @param DeleteFleetRequest $request A request to house fields associated with the call. + * @param array $callOptions { * Optional. * * @type RetrySettings|array $retrySettings @@ -568,24 +898,28 @@ public function getMembership(GetMembershipRequest $request, array $callOptions * {@see RetrySettings} for example usage. * } * - * @return PagedListResponse + * @return OperationResponse * * @throws ApiException Thrown if the API call fails. */ - public function listFeatures(ListFeaturesRequest $request, array $callOptions = []): PagedListResponse + public function deleteFleet(DeleteFleetRequest $request, array $callOptions = []): OperationResponse { - return $this->startApiCall('ListFeatures', $request, $callOptions); + return $this->startApiCall('DeleteFleet', $request, $callOptions)->wait(); } /** - * Lists Memberships in a given project and location. + * Removes a Membership. * - * The async variant is {@see GkeHubClient::listMembershipsAsync()} . + * **This is currently only supported for GKE clusters on Google Cloud**. + * To unregister other clusters, follow the instructions at + * https://cloud.google.com/anthos/multicluster-management/connect/unregistering-a-cluster. * - * @example samples/V1/GkeHubClient/list_memberships.php + * The async variant is {@see GkeHubClient::deleteMembershipAsync()} . * - * @param ListMembershipsRequest $request A request to house fields associated with the call. - * @param array $callOptions { + * @example samples/V1/GkeHubClient/delete_membership.php + * + * @param DeleteMembershipRequest $request A request to house fields associated with the call. + * @param array $callOptions { * Optional. * * @type RetrySettings|array $retrySettings @@ -594,24 +928,24 @@ public function listFeatures(ListFeaturesRequest $request, array $callOptions = * {@see RetrySettings} for example usage. * } * - * @return PagedListResponse + * @return OperationResponse * * @throws ApiException Thrown if the API call fails. */ - public function listMemberships(ListMembershipsRequest $request, array $callOptions = []): PagedListResponse + public function deleteMembership(DeleteMembershipRequest $request, array $callOptions = []): OperationResponse { - return $this->startApiCall('ListMemberships', $request, $callOptions); + return $this->startApiCall('DeleteMembership', $request, $callOptions)->wait(); } /** - * Updates an existing Feature. + * Deletes a MembershipBinding. * - * The async variant is {@see GkeHubClient::updateFeatureAsync()} . + * The async variant is {@see GkeHubClient::deleteMembershipBindingAsync()} . * - * @example samples/V1/GkeHubClient/update_feature.php + * @example samples/V1/GkeHubClient/delete_membership_binding.php * - * @param UpdateFeatureRequest $request A request to house fields associated with the call. - * @param array $callOptions { + * @param DeleteMembershipBindingRequest $request A request to house fields associated with the call. + * @param array $callOptions { * Optional. * * @type RetrySettings|array $retrySettings @@ -620,24 +954,27 @@ public function listMemberships(ListMembershipsRequest $request, array $callOpti * {@see RetrySettings} for example usage. * } * - * @return OperationResponse + * @return OperationResponse * * @throws ApiException Thrown if the API call fails. */ - public function updateFeature(UpdateFeatureRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('UpdateFeature', $request, $callOptions)->wait(); + public function deleteMembershipBinding( + DeleteMembershipBindingRequest $request, + array $callOptions = [] + ): OperationResponse { + return $this->startApiCall('DeleteMembershipBinding', $request, $callOptions)->wait(); } /** - * Updates an existing Membership. + * Deletes a Membership RBACRoleBinding. * - * The async variant is {@see GkeHubClient::updateMembershipAsync()} . + * The async variant is {@see GkeHubClient::deleteMembershipRBACRoleBindingAsync()} + * . * - * @example samples/V1/GkeHubClient/update_membership.php + * @example samples/V1/GkeHubClient/delete_membership_rbac_role_binding.php * - * @param UpdateMembershipRequest $request A request to house fields associated with the call. - * @param array $callOptions { + * @param DeleteMembershipRBACRoleBindingRequest $request A request to house fields associated with the call. + * @param array $callOptions { * Optional. * * @type RetrySettings|array $retrySettings @@ -646,12 +983,859 @@ public function updateFeature(UpdateFeatureRequest $request, array $callOptions * {@see RetrySettings} for example usage. * } * - * @return OperationResponse + * @return OperationResponse * * @throws ApiException Thrown if the API call fails. */ - public function updateMembership(UpdateMembershipRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('UpdateMembership', $request, $callOptions)->wait(); + public function deleteMembershipRBACRoleBinding( + DeleteMembershipRBACRoleBindingRequest $request, + array $callOptions = [] + ): OperationResponse { + return $this->startApiCall('DeleteMembershipRBACRoleBinding', $request, $callOptions)->wait(); + } + + /** + * Deletes a Scope. + * + * The async variant is {@see GkeHubClient::deleteScopeAsync()} . + * + * @example samples/V1/GkeHubClient/delete_scope.php + * + * @param DeleteScopeRequest $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 deleteScope(DeleteScopeRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteScope', $request, $callOptions)->wait(); + } + + /** + * Deletes a fleet namespace. + * + * The async variant is {@see GkeHubClient::deleteScopeNamespaceAsync()} . + * + * @example samples/V1/GkeHubClient/delete_scope_namespace.php + * + * @param DeleteScopeNamespaceRequest $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 deleteScopeNamespace( + DeleteScopeNamespaceRequest $request, + array $callOptions = [] + ): OperationResponse { + return $this->startApiCall('DeleteScopeNamespace', $request, $callOptions)->wait(); + } + + /** + * Deletes a Scope RBACRoleBinding. + * + * The async variant is {@see GkeHubClient::deleteScopeRBACRoleBindingAsync()} . + * + * @example samples/V1/GkeHubClient/delete_scope_rbac_role_binding.php + * + * @param DeleteScopeRBACRoleBindingRequest $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 deleteScopeRBACRoleBinding( + DeleteScopeRBACRoleBindingRequest $request, + array $callOptions = [] + ): OperationResponse { + return $this->startApiCall('DeleteScopeRBACRoleBinding', $request, $callOptions)->wait(); + } + + /** + * Generates the manifest for deployment of the GKE connect agent. + * + * **This method is used internally by Google-provided libraries.** + * Most clients should not need to call this method directly. + * + * The async variant is {@see GkeHubClient::generateConnectManifestAsync()} . + * + * @example samples/V1/GkeHubClient/generate_connect_manifest.php + * + * @param GenerateConnectManifestRequest $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 GenerateConnectManifestResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function generateConnectManifest( + GenerateConnectManifestRequest $request, + array $callOptions = [] + ): GenerateConnectManifestResponse { + return $this->startApiCall('GenerateConnectManifest', $request, $callOptions)->wait(); + } + + /** + * Generates a YAML of the RBAC policies for the specified + * RoleBinding and its associated impersonation resources. + * + * The async variant is + * {@see GkeHubClient::generateMembershipRBACRoleBindingYAMLAsync()} . + * + * @example samples/V1/GkeHubClient/generate_membership_rbac_role_binding_yaml.php + * + * @param GenerateMembershipRBACRoleBindingYAMLRequest $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 GenerateMembershipRBACRoleBindingYAMLResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function generateMembershipRBACRoleBindingYAML( + GenerateMembershipRBACRoleBindingYAMLRequest $request, + array $callOptions = [] + ): GenerateMembershipRBACRoleBindingYAMLResponse { + return $this->startApiCall('GenerateMembershipRBACRoleBindingYAML', $request, $callOptions)->wait(); + } + + /** + * Gets details of a single Feature. + * + * The async variant is {@see GkeHubClient::getFeatureAsync()} . + * + * @example samples/V1/GkeHubClient/get_feature.php + * + * @param GetFeatureRequest $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 Feature + * + * @throws ApiException Thrown if the API call fails. + */ + public function getFeature(GetFeatureRequest $request, array $callOptions = []): Feature + { + return $this->startApiCall('GetFeature', $request, $callOptions)->wait(); + } + + /** + * Returns the details of a fleet. + * + * The async variant is {@see GkeHubClient::getFleetAsync()} . + * + * @example samples/V1/GkeHubClient/get_fleet.php + * + * @param GetFleetRequest $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 Fleet + * + * @throws ApiException Thrown if the API call fails. + */ + public function getFleet(GetFleetRequest $request, array $callOptions = []): Fleet + { + return $this->startApiCall('GetFleet', $request, $callOptions)->wait(); + } + + /** + * Gets the details of a Membership. + * + * The async variant is {@see GkeHubClient::getMembershipAsync()} . + * + * @example samples/V1/GkeHubClient/get_membership.php + * + * @param GetMembershipRequest $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 Membership + * + * @throws ApiException Thrown if the API call fails. + */ + public function getMembership(GetMembershipRequest $request, array $callOptions = []): Membership + { + return $this->startApiCall('GetMembership', $request, $callOptions)->wait(); + } + + /** + * Returns the details of a MembershipBinding. + * + * The async variant is {@see GkeHubClient::getMembershipBindingAsync()} . + * + * @example samples/V1/GkeHubClient/get_membership_binding.php + * + * @param GetMembershipBindingRequest $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 MembershipBinding + * + * @throws ApiException Thrown if the API call fails. + */ + public function getMembershipBinding( + GetMembershipBindingRequest $request, + array $callOptions = [] + ): MembershipBinding { + return $this->startApiCall('GetMembershipBinding', $request, $callOptions)->wait(); + } + + /** + * Returns the details of a Membership RBACRoleBinding. + * + * The async variant is {@see GkeHubClient::getMembershipRBACRoleBindingAsync()} . + * + * @example samples/V1/GkeHubClient/get_membership_rbac_role_binding.php + * + * @param GetMembershipRBACRoleBindingRequest $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 RBACRoleBinding + * + * @throws ApiException Thrown if the API call fails. + */ + public function getMembershipRBACRoleBinding( + GetMembershipRBACRoleBindingRequest $request, + array $callOptions = [] + ): RBACRoleBinding { + return $this->startApiCall('GetMembershipRBACRoleBinding', $request, $callOptions)->wait(); + } + + /** + * Returns the details of a Scope. + * + * The async variant is {@see GkeHubClient::getScopeAsync()} . + * + * @example samples/V1/GkeHubClient/get_scope.php + * + * @param GetScopeRequest $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 Scope + * + * @throws ApiException Thrown if the API call fails. + */ + public function getScope(GetScopeRequest $request, array $callOptions = []): Scope + { + return $this->startApiCall('GetScope', $request, $callOptions)->wait(); + } + + /** + * Returns the details of a fleet namespace. + * + * The async variant is {@see GkeHubClient::getScopeNamespaceAsync()} . + * + * @example samples/V1/GkeHubClient/get_scope_namespace.php + * + * @param GetScopeNamespaceRequest $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 PBNamespace + * + * @throws ApiException Thrown if the API call fails. + */ + public function getScopeNamespace(GetScopeNamespaceRequest $request, array $callOptions = []): PBNamespace + { + return $this->startApiCall('GetScopeNamespace', $request, $callOptions)->wait(); + } + + /** + * Returns the details of a Scope RBACRoleBinding. + * + * The async variant is {@see GkeHubClient::getScopeRBACRoleBindingAsync()} . + * + * @example samples/V1/GkeHubClient/get_scope_rbac_role_binding.php + * + * @param GetScopeRBACRoleBindingRequest $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 RBACRoleBinding + * + * @throws ApiException Thrown if the API call fails. + */ + public function getScopeRBACRoleBinding( + GetScopeRBACRoleBindingRequest $request, + array $callOptions = [] + ): RBACRoleBinding { + return $this->startApiCall('GetScopeRBACRoleBinding', $request, $callOptions)->wait(); + } + + /** + * Lists Memberships bound to a Scope. The response includes relevant + * Memberships from all regions. + * + * The async variant is {@see GkeHubClient::listBoundMembershipsAsync()} . + * + * @example samples/V1/GkeHubClient/list_bound_memberships.php + * + * @param ListBoundMembershipsRequest $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 listBoundMemberships( + ListBoundMembershipsRequest $request, + array $callOptions = [] + ): PagedListResponse { + return $this->startApiCall('ListBoundMemberships', $request, $callOptions); + } + + /** + * Lists Features in a given project and location. + * + * The async variant is {@see GkeHubClient::listFeaturesAsync()} . + * + * @example samples/V1/GkeHubClient/list_features.php + * + * @param ListFeaturesRequest $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 listFeatures(ListFeaturesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListFeatures', $request, $callOptions); + } + + /** + * Returns all fleets within an organization or a project that the caller has + * access to. + * + * The async variant is {@see GkeHubClient::listFleetsAsync()} . + * + * @example samples/V1/GkeHubClient/list_fleets.php + * + * @param ListFleetsRequest $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 listFleets(ListFleetsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListFleets', $request, $callOptions); + } + + /** + * Lists MembershipBindings. + * + * The async variant is {@see GkeHubClient::listMembershipBindingsAsync()} . + * + * @example samples/V1/GkeHubClient/list_membership_bindings.php + * + * @param ListMembershipBindingsRequest $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 listMembershipBindings( + ListMembershipBindingsRequest $request, + array $callOptions = [] + ): PagedListResponse { + return $this->startApiCall('ListMembershipBindings', $request, $callOptions); + } + + /** + * Lists all Membership RBACRoleBindings. + * + * The async variant is {@see GkeHubClient::listMembershipRBACRoleBindingsAsync()} + * . + * + * @example samples/V1/GkeHubClient/list_membership_rbac_role_bindings.php + * + * @param ListMembershipRBACRoleBindingsRequest $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 listMembershipRBACRoleBindings( + ListMembershipRBACRoleBindingsRequest $request, + array $callOptions = [] + ): PagedListResponse { + return $this->startApiCall('ListMembershipRBACRoleBindings', $request, $callOptions); + } + + /** + * Lists Memberships in a given project and location. + * + * The async variant is {@see GkeHubClient::listMembershipsAsync()} . + * + * @example samples/V1/GkeHubClient/list_memberships.php + * + * @param ListMembershipsRequest $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 listMemberships(ListMembershipsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListMemberships', $request, $callOptions); + } + + /** + * Lists permitted Scopes. + * + * The async variant is {@see GkeHubClient::listPermittedScopesAsync()} . + * + * @example samples/V1/GkeHubClient/list_permitted_scopes.php + * + * @param ListPermittedScopesRequest $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 listPermittedScopes(ListPermittedScopesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListPermittedScopes', $request, $callOptions); + } + + /** + * Lists fleet namespaces. + * + * The async variant is {@see GkeHubClient::listScopeNamespacesAsync()} . + * + * @example samples/V1/GkeHubClient/list_scope_namespaces.php + * + * @param ListScopeNamespacesRequest $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 listScopeNamespaces(ListScopeNamespacesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListScopeNamespaces', $request, $callOptions); + } + + /** + * Lists all Scope RBACRoleBindings. + * + * The async variant is {@see GkeHubClient::listScopeRBACRoleBindingsAsync()} . + * + * @example samples/V1/GkeHubClient/list_scope_rbac_role_bindings.php + * + * @param ListScopeRBACRoleBindingsRequest $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 listScopeRBACRoleBindings( + ListScopeRBACRoleBindingsRequest $request, + array $callOptions = [] + ): PagedListResponse { + return $this->startApiCall('ListScopeRBACRoleBindings', $request, $callOptions); + } + + /** + * Lists Scopes. + * + * The async variant is {@see GkeHubClient::listScopesAsync()} . + * + * @example samples/V1/GkeHubClient/list_scopes.php + * + * @param ListScopesRequest $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 listScopes(ListScopesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListScopes', $request, $callOptions); + } + + /** + * Updates an existing Feature. + * + * The async variant is {@see GkeHubClient::updateFeatureAsync()} . + * + * @example samples/V1/GkeHubClient/update_feature.php + * + * @param UpdateFeatureRequest $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 updateFeature(UpdateFeatureRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UpdateFeature', $request, $callOptions)->wait(); + } + + /** + * Updates a fleet. + * + * The async variant is {@see GkeHubClient::updateFleetAsync()} . + * + * @example samples/V1/GkeHubClient/update_fleet.php + * + * @param UpdateFleetRequest $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 updateFleet(UpdateFleetRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UpdateFleet', $request, $callOptions)->wait(); + } + + /** + * Updates an existing Membership. + * + * The async variant is {@see GkeHubClient::updateMembershipAsync()} . + * + * @example samples/V1/GkeHubClient/update_membership.php + * + * @param UpdateMembershipRequest $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 updateMembership(UpdateMembershipRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UpdateMembership', $request, $callOptions)->wait(); + } + + /** + * Updates a MembershipBinding. + * + * The async variant is {@see GkeHubClient::updateMembershipBindingAsync()} . + * + * @example samples/V1/GkeHubClient/update_membership_binding.php + * + * @param UpdateMembershipBindingRequest $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 updateMembershipBinding( + UpdateMembershipBindingRequest $request, + array $callOptions = [] + ): OperationResponse { + return $this->startApiCall('UpdateMembershipBinding', $request, $callOptions)->wait(); + } + + /** + * Updates a Membership RBACRoleBinding. + * + * The async variant is {@see GkeHubClient::updateMembershipRBACRoleBindingAsync()} + * . + * + * @example samples/V1/GkeHubClient/update_membership_rbac_role_binding.php + * + * @param UpdateMembershipRBACRoleBindingRequest $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 updateMembershipRBACRoleBinding( + UpdateMembershipRBACRoleBindingRequest $request, + array $callOptions = [] + ): OperationResponse { + return $this->startApiCall('UpdateMembershipRBACRoleBinding', $request, $callOptions)->wait(); + } + + /** + * Updates a scopes. + * + * The async variant is {@see GkeHubClient::updateScopeAsync()} . + * + * @example samples/V1/GkeHubClient/update_scope.php + * + * @param UpdateScopeRequest $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 updateScope(UpdateScopeRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UpdateScope', $request, $callOptions)->wait(); + } + + /** + * Updates a fleet namespace. + * + * The async variant is {@see GkeHubClient::updateScopeNamespaceAsync()} . + * + * @example samples/V1/GkeHubClient/update_scope_namespace.php + * + * @param UpdateScopeNamespaceRequest $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 updateScopeNamespace( + UpdateScopeNamespaceRequest $request, + array $callOptions = [] + ): OperationResponse { + return $this->startApiCall('UpdateScopeNamespace', $request, $callOptions)->wait(); + } + + /** + * Updates a Scope RBACRoleBinding. + * + * The async variant is {@see GkeHubClient::updateScopeRBACRoleBindingAsync()} . + * + * @example samples/V1/GkeHubClient/update_scope_rbac_role_binding.php + * + * @param UpdateScopeRBACRoleBindingRequest $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 updateScopeRBACRoleBinding( + UpdateScopeRBACRoleBindingRequest $request, + array $callOptions = [] + ): OperationResponse { + return $this->startApiCall('UpdateScopeRBACRoleBinding', $request, $callOptions)->wait(); } } diff --git a/GkeHub/src/V1/CommonFeatureState.php b/GkeHub/src/V1/CommonFeatureState.php index 58319d7a887c..735109ce2381 100644 --- a/GkeHub/src/V1/CommonFeatureState.php +++ b/GkeHub/src/V1/CommonFeatureState.php @@ -9,18 +9,19 @@ use Google\Protobuf\Internal\GPBUtil; /** - * CommonFeatureState contains Hub-wide Feature status information. + * CommonFeatureState contains Fleet-wide Feature status information. * * Generated from protobuf message google.cloud.gkehub.v1.CommonFeatureState */ class CommonFeatureState extends \Google\Protobuf\Internal\Message { /** - * Output only. The "running state" of the Feature in this Hub. + * Output only. The "running state" of the Feature in this Fleet. * * Generated from protobuf field .google.cloud.gkehub.v1.FeatureState state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ protected $state = null; + protected $feature_state; /** * Constructor. @@ -28,8 +29,10 @@ class CommonFeatureState extends \Google\Protobuf\Internal\Message * @param array $data { * Optional. Data for populating the Message object. * + * @type \Google\Cloud\GkeHub\RbacRoleBindingActuation\V1\FeatureState $rbacrolebindingactuation + * RBAC Role Binding Actuation feature state * @type \Google\Cloud\GkeHub\V1\FeatureState $state - * Output only. The "running state" of the Feature in this Hub. + * Output only. The "running state" of the Feature in this Fleet. * } */ public function __construct($data = NULL) { @@ -38,7 +41,38 @@ public function __construct($data = NULL) { } /** - * Output only. The "running state" of the Feature in this Hub. + * RBAC Role Binding Actuation feature state + * + * Generated from protobuf field .google.cloud.gkehub.rbacrolebindingactuation.v1.FeatureState rbacrolebindingactuation = 120; + * @return \Google\Cloud\GkeHub\RbacRoleBindingActuation\V1\FeatureState|null + */ + public function getRbacrolebindingactuation() + { + return $this->readOneof(120); + } + + public function hasRbacrolebindingactuation() + { + return $this->hasOneof(120); + } + + /** + * RBAC Role Binding Actuation feature state + * + * Generated from protobuf field .google.cloud.gkehub.rbacrolebindingactuation.v1.FeatureState rbacrolebindingactuation = 120; + * @param \Google\Cloud\GkeHub\RbacRoleBindingActuation\V1\FeatureState $var + * @return $this + */ + public function setRbacrolebindingactuation($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GkeHub\RbacRoleBindingActuation\V1\FeatureState::class); + $this->writeOneof(120, $var); + + return $this; + } + + /** + * Output only. The "running state" of the Feature in this Fleet. * * Generated from protobuf field .google.cloud.gkehub.v1.FeatureState state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @return \Google\Cloud\GkeHub\V1\FeatureState|null @@ -59,7 +93,7 @@ public function clearState() } /** - * Output only. The "running state" of the Feature in this Hub. + * Output only. The "running state" of the Feature in this Fleet. * * Generated from protobuf field .google.cloud.gkehub.v1.FeatureState state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @param \Google\Cloud\GkeHub\V1\FeatureState $var @@ -73,5 +107,13 @@ public function setState($var) return $this; } + /** + * @return string + */ + public function getFeatureState() + { + return $this->whichOneof("feature_state"); + } + } diff --git a/GkeHub/src/V1/CompliancePostureConfig.php b/GkeHub/src/V1/CompliancePostureConfig.php new file mode 100644 index 000000000000..97ff18dc2f63 --- /dev/null +++ b/GkeHub/src/V1/CompliancePostureConfig.php @@ -0,0 +1,102 @@ +google.cloud.gkehub.v1.CompliancePostureConfig + */ +class CompliancePostureConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Defines the enablement mode for Compliance Posture. + * + * Generated from protobuf field .google.cloud.gkehub.v1.CompliancePostureConfig.Mode mode = 1; + */ + protected $mode = 0; + /** + * List of enabled compliance standards. + * + * Generated from protobuf field repeated .google.cloud.gkehub.v1.CompliancePostureConfig.ComplianceStandard compliance_standards = 2; + */ + private $compliance_standards; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $mode + * Defines the enablement mode for Compliance Posture. + * @type array<\Google\Cloud\GkeHub\V1\CompliancePostureConfig\ComplianceStandard>|\Google\Protobuf\Internal\RepeatedField $compliance_standards + * List of enabled compliance standards. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gkehub\V1\Fleet::initOnce(); + parent::__construct($data); + } + + /** + * Defines the enablement mode for Compliance Posture. + * + * Generated from protobuf field .google.cloud.gkehub.v1.CompliancePostureConfig.Mode mode = 1; + * @return int + */ + public function getMode() + { + return $this->mode; + } + + /** + * Defines the enablement mode for Compliance Posture. + * + * Generated from protobuf field .google.cloud.gkehub.v1.CompliancePostureConfig.Mode mode = 1; + * @param int $var + * @return $this + */ + public function setMode($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\GkeHub\V1\CompliancePostureConfig\Mode::class); + $this->mode = $var; + + return $this; + } + + /** + * List of enabled compliance standards. + * + * Generated from protobuf field repeated .google.cloud.gkehub.v1.CompliancePostureConfig.ComplianceStandard compliance_standards = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getComplianceStandards() + { + return $this->compliance_standards; + } + + /** + * List of enabled compliance standards. + * + * Generated from protobuf field repeated .google.cloud.gkehub.v1.CompliancePostureConfig.ComplianceStandard compliance_standards = 2; + * @param array<\Google\Cloud\GkeHub\V1\CompliancePostureConfig\ComplianceStandard>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setComplianceStandards($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\GkeHub\V1\CompliancePostureConfig\ComplianceStandard::class); + $this->compliance_standards = $arr; + + return $this; + } + +} + diff --git a/GkeHub/src/V1/CompliancePostureConfig/ComplianceStandard.php b/GkeHub/src/V1/CompliancePostureConfig/ComplianceStandard.php new file mode 100644 index 000000000000..27b373df5c97 --- /dev/null +++ b/GkeHub/src/V1/CompliancePostureConfig/ComplianceStandard.php @@ -0,0 +1,66 @@ +google.cloud.gkehub.v1.CompliancePostureConfig.ComplianceStandard + */ +class ComplianceStandard extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the compliance standard. + * + * Generated from protobuf field string standard = 1; + */ + protected $standard = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $standard + * Name of the compliance standard. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gkehub\V1\Fleet::initOnce(); + parent::__construct($data); + } + + /** + * Name of the compliance standard. + * + * Generated from protobuf field string standard = 1; + * @return string + */ + public function getStandard() + { + return $this->standard; + } + + /** + * Name of the compliance standard. + * + * Generated from protobuf field string standard = 1; + * @param string $var + * @return $this + */ + public function setStandard($var) + { + GPBUtil::checkString($var, True); + $this->standard = $var; + + return $this; + } + +} + + diff --git a/GkeHub/src/V1/CompliancePostureConfig/Mode.php b/GkeHub/src/V1/CompliancePostureConfig/Mode.php new file mode 100644 index 000000000000..f364286c16e9 --- /dev/null +++ b/GkeHub/src/V1/CompliancePostureConfig/Mode.php @@ -0,0 +1,60 @@ +google.cloud.gkehub.v1.CompliancePostureConfig.Mode + */ +class Mode +{ + /** + * Default value not specified. + * + * Generated from protobuf enum MODE_UNSPECIFIED = 0; + */ + const MODE_UNSPECIFIED = 0; + /** + * Disables Compliance Posture features on the cluster. + * + * Generated from protobuf enum DISABLED = 1; + */ + const DISABLED = 1; + /** + * Enables Compliance Posture features on the cluster. + * + * Generated from protobuf enum ENABLED = 2; + */ + const ENABLED = 2; + + private static $valueToName = [ + self::MODE_UNSPECIFIED => 'MODE_UNSPECIFIED', + self::DISABLED => 'DISABLED', + self::ENABLED => 'ENABLED', + ]; + + 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/GkeHub/src/V1/CreateFeatureRequest.php b/GkeHub/src/V1/CreateFeatureRequest.php index c28628f4d442..695f638751c3 100644 --- a/GkeHub/src/V1/CreateFeatureRequest.php +++ b/GkeHub/src/V1/CreateFeatureRequest.php @@ -35,7 +35,7 @@ class CreateFeatureRequest extends \Google\Protobuf\Internal\Message */ protected $resource = null; /** - * Optional. A request ID to identify requests. Specify a unique request ID + * A 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. @@ -83,7 +83,7 @@ public static function build(string $parent, \Google\Cloud\GkeHub\V1\Feature $re * @type \Google\Cloud\GkeHub\V1\Feature $resource * The Feature resource to create. * @type string $request_id - * Optional. A request ID to identify requests. Specify a unique request ID + * A 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. @@ -192,7 +192,7 @@ public function setResource($var) } /** - * Optional. A request ID to identify requests. Specify a unique request ID + * A 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. @@ -213,7 +213,7 @@ public function getRequestId() } /** - * Optional. A request ID to identify requests. Specify a unique request ID + * A 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. diff --git a/GkeHub/src/V1/CreateFleetRequest.php b/GkeHub/src/V1/CreateFleetRequest.php new file mode 100644 index 000000000000..42b09741456d --- /dev/null +++ b/GkeHub/src/V1/CreateFleetRequest.php @@ -0,0 +1,132 @@ +google.cloud.gkehub.v1.CreateFleetRequest + */ +class CreateFleetRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent (project and location) where the Fleet will be + * created. Specified in the format `projects/*/locations/*`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The fleet to create. + * + * Generated from protobuf field .google.cloud.gkehub.v1.Fleet fleet = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $fleet = null; + + /** + * @param string $parent Required. The parent (project and location) where the Fleet will be + * created. Specified in the format `projects/*/locations/*`. Please see + * {@see GkeHubClient::locationName()} for help formatting this field. + * @param \Google\Cloud\GkeHub\V1\Fleet $fleet Required. The fleet to create. + * + * @return \Google\Cloud\GkeHub\V1\CreateFleetRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\GkeHub\V1\Fleet $fleet): self + { + return (new self()) + ->setParent($parent) + ->setFleet($fleet); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent (project and location) where the Fleet will be + * created. Specified in the format `projects/*/locations/*`. + * @type \Google\Cloud\GkeHub\V1\Fleet $fleet + * Required. The fleet to create. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gkehub\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent (project and location) where the Fleet will be + * created. Specified in the format `projects/*/locations/*`. + * + * 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 (project and location) where the Fleet will be + * created. Specified in the format `projects/*/locations/*`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The fleet to create. + * + * Generated from protobuf field .google.cloud.gkehub.v1.Fleet fleet = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\GkeHub\V1\Fleet|null + */ + public function getFleet() + { + return $this->fleet; + } + + public function hasFleet() + { + return isset($this->fleet); + } + + public function clearFleet() + { + unset($this->fleet); + } + + /** + * Required. The fleet to create. + * + * Generated from protobuf field .google.cloud.gkehub.v1.Fleet fleet = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\GkeHub\V1\Fleet $var + * @return $this + */ + public function setFleet($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GkeHub\V1\Fleet::class); + $this->fleet = $var; + + return $this; + } + +} + diff --git a/GkeHub/src/V1/CreateMembershipBindingRequest.php b/GkeHub/src/V1/CreateMembershipBindingRequest.php new file mode 100644 index 000000000000..b198ff4157f8 --- /dev/null +++ b/GkeHub/src/V1/CreateMembershipBindingRequest.php @@ -0,0 +1,173 @@ +google.cloud.gkehub.v1.CreateMembershipBindingRequest + */ +class CreateMembershipBindingRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent (project and location) where the MembershipBinding + * will be created. Specified in the format + * `projects/*/locations/*/memberships/*`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The MembershipBinding to create. + * + * Generated from protobuf field .google.cloud.gkehub.v1.MembershipBinding membership_binding = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $membership_binding = null; + /** + * Required. The ID to use for the MembershipBinding. + * + * Generated from protobuf field string membership_binding_id = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $membership_binding_id = ''; + + /** + * @param string $parent Required. The parent (project and location) where the MembershipBinding + * will be created. Specified in the format + * `projects/*/locations/*/memberships/*`. Please see + * {@see GkeHubClient::membershipName()} for help formatting this field. + * @param \Google\Cloud\GkeHub\V1\MembershipBinding $membershipBinding Required. The MembershipBinding to create. + * @param string $membershipBindingId Required. The ID to use for the MembershipBinding. + * + * @return \Google\Cloud\GkeHub\V1\CreateMembershipBindingRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\GkeHub\V1\MembershipBinding $membershipBinding, string $membershipBindingId): self + { + return (new self()) + ->setParent($parent) + ->setMembershipBinding($membershipBinding) + ->setMembershipBindingId($membershipBindingId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent (project and location) where the MembershipBinding + * will be created. Specified in the format + * `projects/*/locations/*/memberships/*`. + * @type \Google\Cloud\GkeHub\V1\MembershipBinding $membership_binding + * Required. The MembershipBinding to create. + * @type string $membership_binding_id + * Required. The ID to use for the MembershipBinding. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gkehub\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent (project and location) where the MembershipBinding + * will be created. Specified in the format + * `projects/*/locations/*/memberships/*`. + * + * 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 (project and location) where the MembershipBinding + * will be created. Specified in the format + * `projects/*/locations/*/memberships/*`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The MembershipBinding to create. + * + * Generated from protobuf field .google.cloud.gkehub.v1.MembershipBinding membership_binding = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\GkeHub\V1\MembershipBinding|null + */ + public function getMembershipBinding() + { + return $this->membership_binding; + } + + public function hasMembershipBinding() + { + return isset($this->membership_binding); + } + + public function clearMembershipBinding() + { + unset($this->membership_binding); + } + + /** + * Required. The MembershipBinding to create. + * + * Generated from protobuf field .google.cloud.gkehub.v1.MembershipBinding membership_binding = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\GkeHub\V1\MembershipBinding $var + * @return $this + */ + public function setMembershipBinding($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GkeHub\V1\MembershipBinding::class); + $this->membership_binding = $var; + + return $this; + } + + /** + * Required. The ID to use for the MembershipBinding. + * + * Generated from protobuf field string membership_binding_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getMembershipBindingId() + { + return $this->membership_binding_id; + } + + /** + * Required. The ID to use for the MembershipBinding. + * + * Generated from protobuf field string membership_binding_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setMembershipBindingId($var) + { + GPBUtil::checkString($var, True); + $this->membership_binding_id = $var; + + return $this; + } + +} + diff --git a/GkeHub/src/V1/CreateMembershipRBACRoleBindingRequest.php b/GkeHub/src/V1/CreateMembershipRBACRoleBindingRequest.php new file mode 100644 index 000000000000..1a6aaf3c5ca7 --- /dev/null +++ b/GkeHub/src/V1/CreateMembershipRBACRoleBindingRequest.php @@ -0,0 +1,200 @@ +google.cloud.gkehub.v1.CreateMembershipRBACRoleBindingRequest + */ +class CreateMembershipRBACRoleBindingRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent (project and location) where the RBACRoleBinding will + * be created. Specified in the format `projects/*/locations/*/memberships/*`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. Client chosen ID for the RBACRoleBinding. `rbacrolebinding_id` + * must be a valid RFC 1123 compliant DNS label: + * 1. At most 63 characters in length + * 2. It must consist of lower case alphanumeric characters or `-` + * 3. It must start and end with an alphanumeric character + * Which can be expressed as the regex: `[a-z0-9]([-a-z0-9]*[a-z0-9])?`, + * with a maximum length of 63 characters. + * + * Generated from protobuf field string rbacrolebinding_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $rbacrolebinding_id = ''; + /** + * Required. The rbacrolebindings to create. + * + * Generated from protobuf field .google.cloud.gkehub.v1.RBACRoleBinding rbacrolebinding = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $rbacrolebinding = null; + + /** + * @param string $parent Required. The parent (project and location) where the RBACRoleBinding will + * be created. Specified in the format `projects/*/locations/*/memberships/*`. Please see + * {@see GkeHubClient::scopeName()} for help formatting this field. + * @param \Google\Cloud\GkeHub\V1\RBACRoleBinding $rbacrolebinding Required. The rbacrolebindings to create. + * @param string $rbacrolebindingId Required. Client chosen ID for the RBACRoleBinding. `rbacrolebinding_id` + * must be a valid RFC 1123 compliant DNS label: + * + * 1. At most 63 characters in length + * 2. It must consist of lower case alphanumeric characters or `-` + * 3. It must start and end with an alphanumeric character + * + * Which can be expressed as the regex: `[a-z0-9]([-a-z0-9]*[a-z0-9])?`, + * with a maximum length of 63 characters. + * + * @return \Google\Cloud\GkeHub\V1\CreateMembershipRBACRoleBindingRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\GkeHub\V1\RBACRoleBinding $rbacrolebinding, string $rbacrolebindingId): self + { + return (new self()) + ->setParent($parent) + ->setRbacrolebinding($rbacrolebinding) + ->setRbacrolebindingId($rbacrolebindingId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent (project and location) where the RBACRoleBinding will + * be created. Specified in the format `projects/*/locations/*/memberships/*`. + * @type string $rbacrolebinding_id + * Required. Client chosen ID for the RBACRoleBinding. `rbacrolebinding_id` + * must be a valid RFC 1123 compliant DNS label: + * 1. At most 63 characters in length + * 2. It must consist of lower case alphanumeric characters or `-` + * 3. It must start and end with an alphanumeric character + * Which can be expressed as the regex: `[a-z0-9]([-a-z0-9]*[a-z0-9])?`, + * with a maximum length of 63 characters. + * @type \Google\Cloud\GkeHub\V1\RBACRoleBinding $rbacrolebinding + * Required. The rbacrolebindings to create. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gkehub\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent (project and location) where the RBACRoleBinding will + * be created. Specified in the format `projects/*/locations/*/memberships/*`. + * + * 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 (project and location) where the RBACRoleBinding will + * be created. Specified in the format `projects/*/locations/*/memberships/*`. + * + * 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. Client chosen ID for the RBACRoleBinding. `rbacrolebinding_id` + * must be a valid RFC 1123 compliant DNS label: + * 1. At most 63 characters in length + * 2. It must consist of lower case alphanumeric characters or `-` + * 3. It must start and end with an alphanumeric character + * Which can be expressed as the regex: `[a-z0-9]([-a-z0-9]*[a-z0-9])?`, + * with a maximum length of 63 characters. + * + * Generated from protobuf field string rbacrolebinding_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRbacrolebindingId() + { + return $this->rbacrolebinding_id; + } + + /** + * Required. Client chosen ID for the RBACRoleBinding. `rbacrolebinding_id` + * must be a valid RFC 1123 compliant DNS label: + * 1. At most 63 characters in length + * 2. It must consist of lower case alphanumeric characters or `-` + * 3. It must start and end with an alphanumeric character + * Which can be expressed as the regex: `[a-z0-9]([-a-z0-9]*[a-z0-9])?`, + * with a maximum length of 63 characters. + * + * Generated from protobuf field string rbacrolebinding_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setRbacrolebindingId($var) + { + GPBUtil::checkString($var, True); + $this->rbacrolebinding_id = $var; + + return $this; + } + + /** + * Required. The rbacrolebindings to create. + * + * Generated from protobuf field .google.cloud.gkehub.v1.RBACRoleBinding rbacrolebinding = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\GkeHub\V1\RBACRoleBinding|null + */ + public function getRbacrolebinding() + { + return $this->rbacrolebinding; + } + + public function hasRbacrolebinding() + { + return isset($this->rbacrolebinding); + } + + public function clearRbacrolebinding() + { + unset($this->rbacrolebinding); + } + + /** + * Required. The rbacrolebindings to create. + * + * Generated from protobuf field .google.cloud.gkehub.v1.RBACRoleBinding rbacrolebinding = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\GkeHub\V1\RBACRoleBinding $var + * @return $this + */ + public function setRbacrolebinding($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GkeHub\V1\RBACRoleBinding::class); + $this->rbacrolebinding = $var; + + return $this; + } + +} + diff --git a/GkeHub/src/V1/CreateScopeNamespaceRequest.php b/GkeHub/src/V1/CreateScopeNamespaceRequest.php new file mode 100644 index 000000000000..7cee2fb195a1 --- /dev/null +++ b/GkeHub/src/V1/CreateScopeNamespaceRequest.php @@ -0,0 +1,200 @@ +google.cloud.gkehub.v1.CreateScopeNamespaceRequest + */ +class CreateScopeNamespaceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent (project and location) where the Namespace will be + * created. Specified in the format `projects/*/locations/*/scopes/*`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. Client chosen ID for the Namespace. `namespace_id` must be a + * valid RFC 1123 compliant DNS label: + * 1. At most 63 characters in length + * 2. It must consist of lower case alphanumeric characters or `-` + * 3. It must start and end with an alphanumeric character + * Which can be expressed as the regex: `[a-z0-9]([-a-z0-9]*[a-z0-9])?`, + * with a maximum length of 63 characters. + * + * Generated from protobuf field string scope_namespace_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $scope_namespace_id = ''; + /** + * Required. The fleet namespace to create. + * + * Generated from protobuf field .google.cloud.gkehub.v1.Namespace scope_namespace = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $scope_namespace = null; + + /** + * @param string $parent Required. The parent (project and location) where the Namespace will be + * created. Specified in the format `projects/*/locations/*/scopes/*`. Please see + * {@see GkeHubClient::scopeName()} for help formatting this field. + * @param \Google\Cloud\GkeHub\V1\PBNamespace $scopeNamespace Required. The fleet namespace to create. + * @param string $scopeNamespaceId Required. Client chosen ID for the Namespace. `namespace_id` must be a + * valid RFC 1123 compliant DNS label: + * + * 1. At most 63 characters in length + * 2. It must consist of lower case alphanumeric characters or `-` + * 3. It must start and end with an alphanumeric character + * + * Which can be expressed as the regex: `[a-z0-9]([-a-z0-9]*[a-z0-9])?`, + * with a maximum length of 63 characters. + * + * @return \Google\Cloud\GkeHub\V1\CreateScopeNamespaceRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\GkeHub\V1\PBNamespace $scopeNamespace, string $scopeNamespaceId): self + { + return (new self()) + ->setParent($parent) + ->setScopeNamespace($scopeNamespace) + ->setScopeNamespaceId($scopeNamespaceId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent (project and location) where the Namespace will be + * created. Specified in the format `projects/*/locations/*/scopes/*`. + * @type string $scope_namespace_id + * Required. Client chosen ID for the Namespace. `namespace_id` must be a + * valid RFC 1123 compliant DNS label: + * 1. At most 63 characters in length + * 2. It must consist of lower case alphanumeric characters or `-` + * 3. It must start and end with an alphanumeric character + * Which can be expressed as the regex: `[a-z0-9]([-a-z0-9]*[a-z0-9])?`, + * with a maximum length of 63 characters. + * @type \Google\Cloud\GkeHub\V1\PBNamespace $scope_namespace + * Required. The fleet namespace to create. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gkehub\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent (project and location) where the Namespace will be + * created. Specified in the format `projects/*/locations/*/scopes/*`. + * + * 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 (project and location) where the Namespace will be + * created. Specified in the format `projects/*/locations/*/scopes/*`. + * + * 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. Client chosen ID for the Namespace. `namespace_id` must be a + * valid RFC 1123 compliant DNS label: + * 1. At most 63 characters in length + * 2. It must consist of lower case alphanumeric characters or `-` + * 3. It must start and end with an alphanumeric character + * Which can be expressed as the regex: `[a-z0-9]([-a-z0-9]*[a-z0-9])?`, + * with a maximum length of 63 characters. + * + * Generated from protobuf field string scope_namespace_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getScopeNamespaceId() + { + return $this->scope_namespace_id; + } + + /** + * Required. Client chosen ID for the Namespace. `namespace_id` must be a + * valid RFC 1123 compliant DNS label: + * 1. At most 63 characters in length + * 2. It must consist of lower case alphanumeric characters or `-` + * 3. It must start and end with an alphanumeric character + * Which can be expressed as the regex: `[a-z0-9]([-a-z0-9]*[a-z0-9])?`, + * with a maximum length of 63 characters. + * + * Generated from protobuf field string scope_namespace_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setScopeNamespaceId($var) + { + GPBUtil::checkString($var, True); + $this->scope_namespace_id = $var; + + return $this; + } + + /** + * Required. The fleet namespace to create. + * + * Generated from protobuf field .google.cloud.gkehub.v1.Namespace scope_namespace = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\GkeHub\V1\PBNamespace|null + */ + public function getScopeNamespace() + { + return $this->scope_namespace; + } + + public function hasScopeNamespace() + { + return isset($this->scope_namespace); + } + + public function clearScopeNamespace() + { + unset($this->scope_namespace); + } + + /** + * Required. The fleet namespace to create. + * + * Generated from protobuf field .google.cloud.gkehub.v1.Namespace scope_namespace = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\GkeHub\V1\PBNamespace $var + * @return $this + */ + public function setScopeNamespace($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GkeHub\V1\PBNamespace::class); + $this->scope_namespace = $var; + + return $this; + } + +} + diff --git a/GkeHub/src/V1/CreateScopeRBACRoleBindingRequest.php b/GkeHub/src/V1/CreateScopeRBACRoleBindingRequest.php new file mode 100644 index 000000000000..86ecf8a65955 --- /dev/null +++ b/GkeHub/src/V1/CreateScopeRBACRoleBindingRequest.php @@ -0,0 +1,200 @@ +google.cloud.gkehub.v1.CreateScopeRBACRoleBindingRequest + */ +class CreateScopeRBACRoleBindingRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent (project and location) where the RBACRoleBinding will + * be created. Specified in the format `projects/*/locations/*/scopes/*`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. Client chosen ID for the RBACRoleBinding. `rbacrolebinding_id` + * must be a valid RFC 1123 compliant DNS label: + * 1. At most 63 characters in length + * 2. It must consist of lower case alphanumeric characters or `-` + * 3. It must start and end with an alphanumeric character + * Which can be expressed as the regex: `[a-z0-9]([-a-z0-9]*[a-z0-9])?`, + * with a maximum length of 63 characters. + * + * Generated from protobuf field string rbacrolebinding_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $rbacrolebinding_id = ''; + /** + * Required. The rbacrolebindings to create. + * + * Generated from protobuf field .google.cloud.gkehub.v1.RBACRoleBinding rbacrolebinding = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $rbacrolebinding = null; + + /** + * @param string $parent Required. The parent (project and location) where the RBACRoleBinding will + * be created. Specified in the format `projects/*/locations/*/scopes/*`. Please see + * {@see GkeHubClient::scopeName()} for help formatting this field. + * @param \Google\Cloud\GkeHub\V1\RBACRoleBinding $rbacrolebinding Required. The rbacrolebindings to create. + * @param string $rbacrolebindingId Required. Client chosen ID for the RBACRoleBinding. `rbacrolebinding_id` + * must be a valid RFC 1123 compliant DNS label: + * + * 1. At most 63 characters in length + * 2. It must consist of lower case alphanumeric characters or `-` + * 3. It must start and end with an alphanumeric character + * + * Which can be expressed as the regex: `[a-z0-9]([-a-z0-9]*[a-z0-9])?`, + * with a maximum length of 63 characters. + * + * @return \Google\Cloud\GkeHub\V1\CreateScopeRBACRoleBindingRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\GkeHub\V1\RBACRoleBinding $rbacrolebinding, string $rbacrolebindingId): self + { + return (new self()) + ->setParent($parent) + ->setRbacrolebinding($rbacrolebinding) + ->setRbacrolebindingId($rbacrolebindingId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent (project and location) where the RBACRoleBinding will + * be created. Specified in the format `projects/*/locations/*/scopes/*`. + * @type string $rbacrolebinding_id + * Required. Client chosen ID for the RBACRoleBinding. `rbacrolebinding_id` + * must be a valid RFC 1123 compliant DNS label: + * 1. At most 63 characters in length + * 2. It must consist of lower case alphanumeric characters or `-` + * 3. It must start and end with an alphanumeric character + * Which can be expressed as the regex: `[a-z0-9]([-a-z0-9]*[a-z0-9])?`, + * with a maximum length of 63 characters. + * @type \Google\Cloud\GkeHub\V1\RBACRoleBinding $rbacrolebinding + * Required. The rbacrolebindings to create. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gkehub\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent (project and location) where the RBACRoleBinding will + * be created. Specified in the format `projects/*/locations/*/scopes/*`. + * + * 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 (project and location) where the RBACRoleBinding will + * be created. Specified in the format `projects/*/locations/*/scopes/*`. + * + * 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. Client chosen ID for the RBACRoleBinding. `rbacrolebinding_id` + * must be a valid RFC 1123 compliant DNS label: + * 1. At most 63 characters in length + * 2. It must consist of lower case alphanumeric characters or `-` + * 3. It must start and end with an alphanumeric character + * Which can be expressed as the regex: `[a-z0-9]([-a-z0-9]*[a-z0-9])?`, + * with a maximum length of 63 characters. + * + * Generated from protobuf field string rbacrolebinding_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRbacrolebindingId() + { + return $this->rbacrolebinding_id; + } + + /** + * Required. Client chosen ID for the RBACRoleBinding. `rbacrolebinding_id` + * must be a valid RFC 1123 compliant DNS label: + * 1. At most 63 characters in length + * 2. It must consist of lower case alphanumeric characters or `-` + * 3. It must start and end with an alphanumeric character + * Which can be expressed as the regex: `[a-z0-9]([-a-z0-9]*[a-z0-9])?`, + * with a maximum length of 63 characters. + * + * Generated from protobuf field string rbacrolebinding_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setRbacrolebindingId($var) + { + GPBUtil::checkString($var, True); + $this->rbacrolebinding_id = $var; + + return $this; + } + + /** + * Required. The rbacrolebindings to create. + * + * Generated from protobuf field .google.cloud.gkehub.v1.RBACRoleBinding rbacrolebinding = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\GkeHub\V1\RBACRoleBinding|null + */ + public function getRbacrolebinding() + { + return $this->rbacrolebinding; + } + + public function hasRbacrolebinding() + { + return isset($this->rbacrolebinding); + } + + public function clearRbacrolebinding() + { + unset($this->rbacrolebinding); + } + + /** + * Required. The rbacrolebindings to create. + * + * Generated from protobuf field .google.cloud.gkehub.v1.RBACRoleBinding rbacrolebinding = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\GkeHub\V1\RBACRoleBinding $var + * @return $this + */ + public function setRbacrolebinding($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GkeHub\V1\RBACRoleBinding::class); + $this->rbacrolebinding = $var; + + return $this; + } + +} + diff --git a/GkeHub/src/V1/CreateScopeRequest.php b/GkeHub/src/V1/CreateScopeRequest.php new file mode 100644 index 000000000000..f43515f00b0f --- /dev/null +++ b/GkeHub/src/V1/CreateScopeRequest.php @@ -0,0 +1,173 @@ +google.cloud.gkehub.v1.CreateScopeRequest + */ +class CreateScopeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent (project and location) where the Scope will be + * created. Specified in the format `projects/*/locations/*`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. Client chosen ID for the Scope. `scope_id` must be a + * ???? + * + * Generated from protobuf field string scope_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $scope_id = ''; + /** + * Required. The Scope to create. + * + * Generated from protobuf field .google.cloud.gkehub.v1.Scope scope = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $scope = null; + + /** + * @param string $parent Required. The parent (project and location) where the Scope will be + * created. Specified in the format `projects/*/locations/*`. Please see + * {@see GkeHubClient::locationName()} for help formatting this field. + * @param \Google\Cloud\GkeHub\V1\Scope $scope Required. The Scope to create. + * @param string $scopeId Required. Client chosen ID for the Scope. `scope_id` must be a + * ???? + * + * @return \Google\Cloud\GkeHub\V1\CreateScopeRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\GkeHub\V1\Scope $scope, string $scopeId): self + { + return (new self()) + ->setParent($parent) + ->setScope($scope) + ->setScopeId($scopeId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent (project and location) where the Scope will be + * created. Specified in the format `projects/*/locations/*`. + * @type string $scope_id + * Required. Client chosen ID for the Scope. `scope_id` must be a + * ???? + * @type \Google\Cloud\GkeHub\V1\Scope $scope + * Required. The Scope to create. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gkehub\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent (project and location) where the Scope will be + * created. Specified in the format `projects/*/locations/*`. + * + * 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 (project and location) where the Scope will be + * created. Specified in the format `projects/*/locations/*`. + * + * 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. Client chosen ID for the Scope. `scope_id` must be a + * ???? + * + * Generated from protobuf field string scope_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getScopeId() + { + return $this->scope_id; + } + + /** + * Required. Client chosen ID for the Scope. `scope_id` must be a + * ???? + * + * Generated from protobuf field string scope_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setScopeId($var) + { + GPBUtil::checkString($var, True); + $this->scope_id = $var; + + return $this; + } + + /** + * Required. The Scope to create. + * + * Generated from protobuf field .google.cloud.gkehub.v1.Scope scope = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\GkeHub\V1\Scope|null + */ + public function getScope() + { + return $this->scope; + } + + public function hasScope() + { + return isset($this->scope); + } + + public function clearScope() + { + unset($this->scope); + } + + /** + * Required. The Scope to create. + * + * Generated from protobuf field .google.cloud.gkehub.v1.Scope scope = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\GkeHub\V1\Scope $var + * @return $this + */ + public function setScope($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GkeHub\V1\Scope::class); + $this->scope = $var; + + return $this; + } + +} + diff --git a/GkeHub/src/V1/DefaultClusterConfig.php b/GkeHub/src/V1/DefaultClusterConfig.php new file mode 100644 index 000000000000..4bceba2aca0e --- /dev/null +++ b/GkeHub/src/V1/DefaultClusterConfig.php @@ -0,0 +1,174 @@ +google.cloud.gkehub.v1.DefaultClusterConfig + */ +class DefaultClusterConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Enable/Disable Security Posture features for the cluster. + * + * Generated from protobuf field .google.cloud.gkehub.v1.SecurityPostureConfig security_posture_config = 1; + */ + protected $security_posture_config = null; + /** + * Optional. Enable/Disable binary authorization features for the cluster. + * + * Generated from protobuf field .google.cloud.gkehub.v1.BinaryAuthorizationConfig binary_authorization_config = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $binary_authorization_config = null; + /** + * Optional. Enable/Disable Compliance Posture features for the cluster. + * Note that on UpdateFleet, only full replacement of this field is allowed. + * Users are not allowed for partial updates through field mask. + * + * Generated from protobuf field .google.cloud.gkehub.v1.CompliancePostureConfig compliance_posture_config = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $compliance_posture_config = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\GkeHub\V1\SecurityPostureConfig $security_posture_config + * Enable/Disable Security Posture features for the cluster. + * @type \Google\Cloud\GkeHub\V1\BinaryAuthorizationConfig $binary_authorization_config + * Optional. Enable/Disable binary authorization features for the cluster. + * @type \Google\Cloud\GkeHub\V1\CompliancePostureConfig $compliance_posture_config + * Optional. Enable/Disable Compliance Posture features for the cluster. + * Note that on UpdateFleet, only full replacement of this field is allowed. + * Users are not allowed for partial updates through field mask. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gkehub\V1\Fleet::initOnce(); + parent::__construct($data); + } + + /** + * Enable/Disable Security Posture features for the cluster. + * + * Generated from protobuf field .google.cloud.gkehub.v1.SecurityPostureConfig security_posture_config = 1; + * @return \Google\Cloud\GkeHub\V1\SecurityPostureConfig|null + */ + public function getSecurityPostureConfig() + { + return $this->security_posture_config; + } + + public function hasSecurityPostureConfig() + { + return isset($this->security_posture_config); + } + + public function clearSecurityPostureConfig() + { + unset($this->security_posture_config); + } + + /** + * Enable/Disable Security Posture features for the cluster. + * + * Generated from protobuf field .google.cloud.gkehub.v1.SecurityPostureConfig security_posture_config = 1; + * @param \Google\Cloud\GkeHub\V1\SecurityPostureConfig $var + * @return $this + */ + public function setSecurityPostureConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GkeHub\V1\SecurityPostureConfig::class); + $this->security_posture_config = $var; + + return $this; + } + + /** + * Optional. Enable/Disable binary authorization features for the cluster. + * + * Generated from protobuf field .google.cloud.gkehub.v1.BinaryAuthorizationConfig binary_authorization_config = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\GkeHub\V1\BinaryAuthorizationConfig|null + */ + public function getBinaryAuthorizationConfig() + { + return $this->binary_authorization_config; + } + + public function hasBinaryAuthorizationConfig() + { + return isset($this->binary_authorization_config); + } + + public function clearBinaryAuthorizationConfig() + { + unset($this->binary_authorization_config); + } + + /** + * Optional. Enable/Disable binary authorization features for the cluster. + * + * Generated from protobuf field .google.cloud.gkehub.v1.BinaryAuthorizationConfig binary_authorization_config = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\GkeHub\V1\BinaryAuthorizationConfig $var + * @return $this + */ + public function setBinaryAuthorizationConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GkeHub\V1\BinaryAuthorizationConfig::class); + $this->binary_authorization_config = $var; + + return $this; + } + + /** + * Optional. Enable/Disable Compliance Posture features for the cluster. + * Note that on UpdateFleet, only full replacement of this field is allowed. + * Users are not allowed for partial updates through field mask. + * + * Generated from protobuf field .google.cloud.gkehub.v1.CompliancePostureConfig compliance_posture_config = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\GkeHub\V1\CompliancePostureConfig|null + */ + public function getCompliancePostureConfig() + { + return $this->compliance_posture_config; + } + + public function hasCompliancePostureConfig() + { + return isset($this->compliance_posture_config); + } + + public function clearCompliancePostureConfig() + { + unset($this->compliance_posture_config); + } + + /** + * Optional. Enable/Disable Compliance Posture features for the cluster. + * Note that on UpdateFleet, only full replacement of this field is allowed. + * Users are not allowed for partial updates through field mask. + * + * Generated from protobuf field .google.cloud.gkehub.v1.CompliancePostureConfig compliance_posture_config = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\GkeHub\V1\CompliancePostureConfig $var + * @return $this + */ + public function setCompliancePostureConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GkeHub\V1\CompliancePostureConfig::class); + $this->compliance_posture_config = $var; + + return $this; + } + +} + diff --git a/GkeHub/src/V1/DeleteFleetRequest.php b/GkeHub/src/V1/DeleteFleetRequest.php new file mode 100644 index 000000000000..1168f4e80769 --- /dev/null +++ b/GkeHub/src/V1/DeleteFleetRequest.php @@ -0,0 +1,86 @@ +google.cloud.gkehub.v1.DeleteFleetRequest + */ +class DeleteFleetRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The Fleet resource name in the format + * `projects/*/locations/*/fleets/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The Fleet resource name in the format + * `projects/*/locations/*/fleets/*`. Please see + * {@see GkeHubClient::fleetName()} for help formatting this field. + * + * @return \Google\Cloud\GkeHub\V1\DeleteFleetRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The Fleet resource name in the format + * `projects/*/locations/*/fleets/*`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gkehub\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The Fleet resource name in the format + * `projects/*/locations/*/fleets/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The Fleet resource name in the format + * `projects/*/locations/*/fleets/*`. + * + * 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/GkeHub/src/V1/DeleteMembershipBindingRequest.php b/GkeHub/src/V1/DeleteMembershipBindingRequest.php new file mode 100644 index 000000000000..59e9d5387ef6 --- /dev/null +++ b/GkeHub/src/V1/DeleteMembershipBindingRequest.php @@ -0,0 +1,86 @@ +google.cloud.gkehub.v1.DeleteMembershipBindingRequest + */ +class DeleteMembershipBindingRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The MembershipBinding resource name in the format + * `projects/*/locations/*/memberships/*/bindings/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The MembershipBinding resource name in the format + * `projects/*/locations/*/memberships/*/bindings/*`. Please see + * {@see GkeHubClient::membershipBindingName()} for help formatting this field. + * + * @return \Google\Cloud\GkeHub\V1\DeleteMembershipBindingRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The MembershipBinding resource name in the format + * `projects/*/locations/*/memberships/*/bindings/*`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gkehub\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The MembershipBinding resource name in the format + * `projects/*/locations/*/memberships/*/bindings/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The MembershipBinding resource name in the format + * `projects/*/locations/*/memberships/*/bindings/*`. + * + * 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/GkeHub/src/V1/DeleteMembershipRBACRoleBindingRequest.php b/GkeHub/src/V1/DeleteMembershipRBACRoleBindingRequest.php new file mode 100644 index 000000000000..6e2ce93d3178 --- /dev/null +++ b/GkeHub/src/V1/DeleteMembershipRBACRoleBindingRequest.php @@ -0,0 +1,86 @@ +google.cloud.gkehub.v1.DeleteMembershipRBACRoleBindingRequest + */ +class DeleteMembershipRBACRoleBindingRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The RBACRoleBinding resource name in the format + * `projects/*/locations/*/memberships/*/rbacrolebindings/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The RBACRoleBinding resource name in the format + * `projects/*/locations/*/memberships/*/rbacrolebindings/*`. Please see + * {@see GkeHubClient::rBACRoleBindingName()} for help formatting this field. + * + * @return \Google\Cloud\GkeHub\V1\DeleteMembershipRBACRoleBindingRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The RBACRoleBinding resource name in the format + * `projects/*/locations/*/memberships/*/rbacrolebindings/*`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gkehub\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The RBACRoleBinding resource name in the format + * `projects/*/locations/*/memberships/*/rbacrolebindings/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The RBACRoleBinding resource name in the format + * `projects/*/locations/*/memberships/*/rbacrolebindings/*`. + * + * 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/GkeHub/src/V1/DeleteScopeNamespaceRequest.php b/GkeHub/src/V1/DeleteScopeNamespaceRequest.php new file mode 100644 index 000000000000..da4a45ddeccf --- /dev/null +++ b/GkeHub/src/V1/DeleteScopeNamespaceRequest.php @@ -0,0 +1,86 @@ +google.cloud.gkehub.v1.DeleteScopeNamespaceRequest + */ +class DeleteScopeNamespaceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The Namespace resource name in the format + * `projects/*/locations/*/scopes/*/namespaces/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The Namespace resource name in the format + * `projects/*/locations/*/scopes/*/namespaces/*`. Please see + * {@see GkeHubClient::namespaceName()} for help formatting this field. + * + * @return \Google\Cloud\GkeHub\V1\DeleteScopeNamespaceRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The Namespace resource name in the format + * `projects/*/locations/*/scopes/*/namespaces/*`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gkehub\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The Namespace resource name in the format + * `projects/*/locations/*/scopes/*/namespaces/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The Namespace resource name in the format + * `projects/*/locations/*/scopes/*/namespaces/*`. + * + * 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/GkeHub/src/V1/DeleteScopeRBACRoleBindingRequest.php b/GkeHub/src/V1/DeleteScopeRBACRoleBindingRequest.php new file mode 100644 index 000000000000..f7cb6755ae90 --- /dev/null +++ b/GkeHub/src/V1/DeleteScopeRBACRoleBindingRequest.php @@ -0,0 +1,86 @@ +google.cloud.gkehub.v1.DeleteScopeRBACRoleBindingRequest + */ +class DeleteScopeRBACRoleBindingRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The RBACRoleBinding resource name in the format + * `projects/*/locations/*/scopes/*/rbacrolebindings/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The RBACRoleBinding resource name in the format + * `projects/*/locations/*/scopes/*/rbacrolebindings/*`. Please see + * {@see GkeHubClient::rBACRoleBindingName()} for help formatting this field. + * + * @return \Google\Cloud\GkeHub\V1\DeleteScopeRBACRoleBindingRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The RBACRoleBinding resource name in the format + * `projects/*/locations/*/scopes/*/rbacrolebindings/*`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gkehub\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The RBACRoleBinding resource name in the format + * `projects/*/locations/*/scopes/*/rbacrolebindings/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The RBACRoleBinding resource name in the format + * `projects/*/locations/*/scopes/*/rbacrolebindings/*`. + * + * 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/GkeHub/src/V1/DeleteScopeRequest.php b/GkeHub/src/V1/DeleteScopeRequest.php new file mode 100644 index 000000000000..5f41f3d6f5eb --- /dev/null +++ b/GkeHub/src/V1/DeleteScopeRequest.php @@ -0,0 +1,86 @@ +google.cloud.gkehub.v1.DeleteScopeRequest + */ +class DeleteScopeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The Scope resource name in the format + * `projects/*/locations/*/scopes/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The Scope resource name in the format + * `projects/*/locations/*/scopes/*`. Please see + * {@see GkeHubClient::scopeName()} for help formatting this field. + * + * @return \Google\Cloud\GkeHub\V1\DeleteScopeRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The Scope resource name in the format + * `projects/*/locations/*/scopes/*`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gkehub\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The Scope resource name in the format + * `projects/*/locations/*/scopes/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The Scope resource name in the format + * `projects/*/locations/*/scopes/*`. + * + * 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/GkeHub/src/V1/Feature.php b/GkeHub/src/V1/Feature.php index 22cbd2b42a1b..72d52cfe3f02 100644 --- a/GkeHub/src/V1/Feature.php +++ b/GkeHub/src/V1/Feature.php @@ -9,7 +9,7 @@ use Google\Protobuf\Internal\GPBUtil; /** - * Feature represents the settings and status of any Hub Feature. + * Feature represents the settings and status of any Fleet Feature. * * Generated from protobuf message google.cloud.gkehub.v1.Feature */ @@ -23,7 +23,7 @@ class Feature extends \Google\Protobuf\Internal\Message */ protected $name = ''; /** - * GCP labels for this Feature. + * Labels for this Feature. * * Generated from protobuf field map labels = 2; */ @@ -35,17 +35,18 @@ class Feature extends \Google\Protobuf\Internal\Message */ protected $resource_state = null; /** - * Optional. Hub-wide Feature configuration. If this Feature does not support any - * Hub-wide configuration, this field may be unused. + * Optional. Fleet-wide Feature configuration. If this Feature does not + * support any Fleet-wide configuration, this field may be unused. * * Generated from protobuf field .google.cloud.gkehub.v1.CommonFeatureSpec spec = 4 [(.google.api.field_behavior) = OPTIONAL]; */ protected $spec = null; /** - * Optional. Membership-specific configuration for this Feature. If this Feature does - * not support any per-Membership configuration, this field may be unused. + * Optional. Membership-specific configuration for this Feature. If this + * Feature does not support any per-Membership configuration, this field may + * be unused. * The keys indicate which Membership the configuration is for, in the form: - * projects/{p}/locations/{l}/memberships/{m} + * `projects/{p}/locations/{l}/memberships/{m}` * Where {p} is the project, {l} is a valid location and {m} is a valid * Membership in this project at that location. {p} WILL match the Feature's * project. @@ -60,7 +61,7 @@ class Feature extends \Google\Protobuf\Internal\Message */ private $membership_specs; /** - * Output only. The Hub-wide Feature state. + * Output only. The Fleet-wide Feature state. * * Generated from protobuf field .google.cloud.gkehub.v1.CommonFeatureState state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ @@ -69,7 +70,7 @@ class Feature extends \Google\Protobuf\Internal\Message * Output only. Membership-specific Feature status. If this Feature does * report any per-Membership status, this field may be unused. * The keys indicate which Membership the state is for, in the form: - * projects/{p}/locations/{l}/memberships/{m} + * `projects/{p}/locations/{l}/memberships/{m}` * Where {p} is the project number, {l} is a valid location and {m} is a valid * Membership in this project at that location. {p} MUST match the Feature's * project number. @@ -95,6 +96,41 @@ class Feature extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.protobuf.Timestamp delete_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ protected $delete_time = null; + /** + * Optional. Scope-specific configuration for this Feature. If this Feature + * does not support any per-Scope configuration, this field may be unused. + * The keys indicate which Scope the configuration is for, in the form: + * `projects/{p}/locations/global/scopes/{s}` + * Where {p} is the project, {s} is a valid Scope in this project. + * {p} WILL match the Feature's project. + * {p} will always be returned as the project number, but the project ID is + * also accepted during input. If the same Scope is specified in the map + * twice (using the project ID form, and the project number form), exactly + * ONE of the entries will be saved, with no guarantees as to which. For this + * reason, it is recommended the same format be used for all entries when + * mutating a Feature. + * + * Generated from protobuf field map scope_specs = 12 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $scope_specs; + /** + * Output only. Scope-specific Feature status. If this Feature does + * report any per-Scope status, this field may be unused. + * The keys indicate which Scope the state is for, in the form: + * `projects/{p}/locations/global/scopes/{s}` + * Where {p} is the project, {s} is a valid Scope in this project. + * {p} WILL match the Feature's project. + * + * Generated from protobuf field map scope_states = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $scope_states; + /** + * Output only. List of locations that could not be reached while fetching + * this feature. + * + * Generated from protobuf field repeated string unreachable = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $unreachable; /** * Constructor. @@ -106,17 +142,18 @@ class Feature extends \Google\Protobuf\Internal\Message * Output only. The full, unique name of this Feature resource in the format * `projects/*/locations/*/features/*`. * @type array|\Google\Protobuf\Internal\MapField $labels - * GCP labels for this Feature. + * Labels for this Feature. * @type \Google\Cloud\GkeHub\V1\FeatureResourceState $resource_state * Output only. State of the Feature resource itself. * @type \Google\Cloud\GkeHub\V1\CommonFeatureSpec $spec - * Optional. Hub-wide Feature configuration. If this Feature does not support any - * Hub-wide configuration, this field may be unused. + * Optional. Fleet-wide Feature configuration. If this Feature does not + * support any Fleet-wide configuration, this field may be unused. * @type array|\Google\Protobuf\Internal\MapField $membership_specs - * Optional. Membership-specific configuration for this Feature. If this Feature does - * not support any per-Membership configuration, this field may be unused. + * Optional. Membership-specific configuration for this Feature. If this + * Feature does not support any per-Membership configuration, this field may + * be unused. * The keys indicate which Membership the configuration is for, in the form: - * projects/{p}/locations/{l}/memberships/{m} + * `projects/{p}/locations/{l}/memberships/{m}` * Where {p} is the project, {l} is a valid location and {m} is a valid * Membership in this project at that location. {p} WILL match the Feature's * project. @@ -127,12 +164,12 @@ class Feature extends \Google\Protobuf\Internal\Message * reason, it is recommended the same format be used for all entries when * mutating a Feature. * @type \Google\Cloud\GkeHub\V1\CommonFeatureState $state - * Output only. The Hub-wide Feature state. + * Output only. The Fleet-wide Feature state. * @type array|\Google\Protobuf\Internal\MapField $membership_states * Output only. Membership-specific Feature status. If this Feature does * report any per-Membership status, this field may be unused. * The keys indicate which Membership the state is for, in the form: - * projects/{p}/locations/{l}/memberships/{m} + * `projects/{p}/locations/{l}/memberships/{m}` * Where {p} is the project number, {l} is a valid location and {m} is a valid * Membership in this project at that location. {p} MUST match the Feature's * project number. @@ -142,6 +179,29 @@ class Feature extends \Google\Protobuf\Internal\Message * Output only. When the Feature resource was last updated. * @type \Google\Protobuf\Timestamp $delete_time * Output only. When the Feature resource was deleted. + * @type array|\Google\Protobuf\Internal\MapField $scope_specs + * Optional. Scope-specific configuration for this Feature. If this Feature + * does not support any per-Scope configuration, this field may be unused. + * The keys indicate which Scope the configuration is for, in the form: + * `projects/{p}/locations/global/scopes/{s}` + * Where {p} is the project, {s} is a valid Scope in this project. + * {p} WILL match the Feature's project. + * {p} will always be returned as the project number, but the project ID is + * also accepted during input. If the same Scope is specified in the map + * twice (using the project ID form, and the project number form), exactly + * ONE of the entries will be saved, with no guarantees as to which. For this + * reason, it is recommended the same format be used for all entries when + * mutating a Feature. + * @type array|\Google\Protobuf\Internal\MapField $scope_states + * Output only. Scope-specific Feature status. If this Feature does + * report any per-Scope status, this field may be unused. + * The keys indicate which Scope the state is for, in the form: + * `projects/{p}/locations/global/scopes/{s}` + * Where {p} is the project, {s} is a valid Scope in this project. + * {p} WILL match the Feature's project. + * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable + * Output only. List of locations that could not be reached while fetching + * this feature. * } */ public function __construct($data = NULL) { @@ -178,7 +238,7 @@ public function setName($var) } /** - * GCP labels for this Feature. + * Labels for this Feature. * * Generated from protobuf field map labels = 2; * @return \Google\Protobuf\Internal\MapField @@ -189,7 +249,7 @@ public function getLabels() } /** - * GCP labels for this Feature. + * Labels for this Feature. * * Generated from protobuf field map labels = 2; * @param array|\Google\Protobuf\Internal\MapField $var @@ -240,8 +300,8 @@ public function setResourceState($var) } /** - * Optional. Hub-wide Feature configuration. If this Feature does not support any - * Hub-wide configuration, this field may be unused. + * Optional. Fleet-wide Feature configuration. If this Feature does not + * support any Fleet-wide configuration, this field may be unused. * * Generated from protobuf field .google.cloud.gkehub.v1.CommonFeatureSpec spec = 4 [(.google.api.field_behavior) = OPTIONAL]; * @return \Google\Cloud\GkeHub\V1\CommonFeatureSpec|null @@ -262,8 +322,8 @@ public function clearSpec() } /** - * Optional. Hub-wide Feature configuration. If this Feature does not support any - * Hub-wide configuration, this field may be unused. + * Optional. Fleet-wide Feature configuration. If this Feature does not + * support any Fleet-wide configuration, this field may be unused. * * Generated from protobuf field .google.cloud.gkehub.v1.CommonFeatureSpec spec = 4 [(.google.api.field_behavior) = OPTIONAL]; * @param \Google\Cloud\GkeHub\V1\CommonFeatureSpec $var @@ -278,10 +338,11 @@ public function setSpec($var) } /** - * Optional. Membership-specific configuration for this Feature. If this Feature does - * not support any per-Membership configuration, this field may be unused. + * Optional. Membership-specific configuration for this Feature. If this + * Feature does not support any per-Membership configuration, this field may + * be unused. * The keys indicate which Membership the configuration is for, in the form: - * projects/{p}/locations/{l}/memberships/{m} + * `projects/{p}/locations/{l}/memberships/{m}` * Where {p} is the project, {l} is a valid location and {m} is a valid * Membership in this project at that location. {p} WILL match the Feature's * project. @@ -301,10 +362,11 @@ public function getMembershipSpecs() } /** - * Optional. Membership-specific configuration for this Feature. If this Feature does - * not support any per-Membership configuration, this field may be unused. + * Optional. Membership-specific configuration for this Feature. If this + * Feature does not support any per-Membership configuration, this field may + * be unused. * The keys indicate which Membership the configuration is for, in the form: - * projects/{p}/locations/{l}/memberships/{m} + * `projects/{p}/locations/{l}/memberships/{m}` * Where {p} is the project, {l} is a valid location and {m} is a valid * Membership in this project at that location. {p} WILL match the Feature's * project. @@ -328,7 +390,7 @@ public function setMembershipSpecs($var) } /** - * Output only. The Hub-wide Feature state. + * Output only. The Fleet-wide Feature state. * * Generated from protobuf field .google.cloud.gkehub.v1.CommonFeatureState state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @return \Google\Cloud\GkeHub\V1\CommonFeatureState|null @@ -349,7 +411,7 @@ public function clearState() } /** - * Output only. The Hub-wide Feature state. + * Output only. The Fleet-wide Feature state. * * Generated from protobuf field .google.cloud.gkehub.v1.CommonFeatureState state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @param \Google\Cloud\GkeHub\V1\CommonFeatureState $var @@ -367,7 +429,7 @@ public function setState($var) * Output only. Membership-specific Feature status. If this Feature does * report any per-Membership status, this field may be unused. * The keys indicate which Membership the state is for, in the form: - * projects/{p}/locations/{l}/memberships/{m} + * `projects/{p}/locations/{l}/memberships/{m}` * Where {p} is the project number, {l} is a valid location and {m} is a valid * Membership in this project at that location. {p} MUST match the Feature's * project number. @@ -384,7 +446,7 @@ public function getMembershipStates() * Output only. Membership-specific Feature status. If this Feature does * report any per-Membership status, this field may be unused. * The keys indicate which Membership the state is for, in the form: - * projects/{p}/locations/{l}/memberships/{m} + * `projects/{p}/locations/{l}/memberships/{m}` * Where {p} is the project number, {l} is a valid location and {m} is a valid * Membership in this project at that location. {p} MUST match the Feature's * project number. @@ -509,5 +571,117 @@ public function setDeleteTime($var) return $this; } + /** + * Optional. Scope-specific configuration for this Feature. If this Feature + * does not support any per-Scope configuration, this field may be unused. + * The keys indicate which Scope the configuration is for, in the form: + * `projects/{p}/locations/global/scopes/{s}` + * Where {p} is the project, {s} is a valid Scope in this project. + * {p} WILL match the Feature's project. + * {p} will always be returned as the project number, but the project ID is + * also accepted during input. If the same Scope is specified in the map + * twice (using the project ID form, and the project number form), exactly + * ONE of the entries will be saved, with no guarantees as to which. For this + * reason, it is recommended the same format be used for all entries when + * mutating a Feature. + * + * Generated from protobuf field map scope_specs = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getScopeSpecs() + { + return $this->scope_specs; + } + + /** + * Optional. Scope-specific configuration for this Feature. If this Feature + * does not support any per-Scope configuration, this field may be unused. + * The keys indicate which Scope the configuration is for, in the form: + * `projects/{p}/locations/global/scopes/{s}` + * Where {p} is the project, {s} is a valid Scope in this project. + * {p} WILL match the Feature's project. + * {p} will always be returned as the project number, but the project ID is + * also accepted during input. If the same Scope is specified in the map + * twice (using the project ID form, and the project number form), exactly + * ONE of the entries will be saved, with no guarantees as to which. For this + * reason, it is recommended the same format be used for all entries when + * mutating a Feature. + * + * Generated from protobuf field map scope_specs = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setScopeSpecs($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\GkeHub\V1\ScopeFeatureSpec::class); + $this->scope_specs = $arr; + + return $this; + } + + /** + * Output only. Scope-specific Feature status. If this Feature does + * report any per-Scope status, this field may be unused. + * The keys indicate which Scope the state is for, in the form: + * `projects/{p}/locations/global/scopes/{s}` + * Where {p} is the project, {s} is a valid Scope in this project. + * {p} WILL match the Feature's project. + * + * Generated from protobuf field map scope_states = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getScopeStates() + { + return $this->scope_states; + } + + /** + * Output only. Scope-specific Feature status. If this Feature does + * report any per-Scope status, this field may be unused. + * The keys indicate which Scope the state is for, in the form: + * `projects/{p}/locations/global/scopes/{s}` + * Where {p} is the project, {s} is a valid Scope in this project. + * {p} WILL match the Feature's project. + * + * Generated from protobuf field map scope_states = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setScopeStates($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\GkeHub\V1\ScopeFeatureState::class); + $this->scope_states = $arr; + + return $this; + } + + /** + * Output only. List of locations that could not be reached while fetching + * this feature. + * + * Generated from protobuf field repeated string unreachable = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachable() + { + return $this->unreachable; + } + + /** + * Output only. List of locations that could not be reached while fetching + * this feature. + * + * Generated from protobuf field repeated string unreachable = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachable($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachable = $arr; + + return $this; + } + } diff --git a/GkeHub/src/V1/FeatureResourceState.php b/GkeHub/src/V1/FeatureResourceState.php index 52b5f7983c2f..5337d248ca6d 100644 --- a/GkeHub/src/V1/FeatureResourceState.php +++ b/GkeHub/src/V1/FeatureResourceState.php @@ -11,7 +11,7 @@ /** * FeatureResourceState describes the state of a Feature *resource* in the * GkeHub API. See `FeatureState` for the "running state" of the Feature in the - * Hub and across Memberships. + * Fleet and across Memberships. * * Generated from protobuf message google.cloud.gkehub.v1.FeatureResourceState */ diff --git a/GkeHub/src/V1/FeatureResourceState/State.php b/GkeHub/src/V1/FeatureResourceState/State.php index ec3ef54aa1a4..52342766c274 100644 --- a/GkeHub/src/V1/FeatureResourceState/State.php +++ b/GkeHub/src/V1/FeatureResourceState/State.php @@ -21,20 +21,20 @@ class State const STATE_UNSPECIFIED = 0; /** * The Feature is being enabled, and the Feature resource is being created. - * Once complete, the corresponding Feature will be enabled in this Hub. + * Once complete, the corresponding Feature will be enabled in this Fleet. * * Generated from protobuf enum ENABLING = 1; */ const ENABLING = 1; /** - * The Feature is enabled in this Hub, and the Feature resource is fully + * The Feature is enabled in this Fleet, and the Feature resource is fully * available. * * Generated from protobuf enum ACTIVE = 2; */ const ACTIVE = 2; /** - * The Feature is being disabled in this Hub, and the Feature resource + * The Feature is being disabled in this Fleet, and the Feature resource * is being deleted. * * Generated from protobuf enum DISABLING = 3; diff --git a/GkeHub/src/V1/Fleet.php b/GkeHub/src/V1/Fleet.php new file mode 100644 index 000000000000..b394422e96a4 --- /dev/null +++ b/GkeHub/src/V1/Fleet.php @@ -0,0 +1,425 @@ +google.cloud.gkehub.v1.Fleet + */ +class Fleet extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The full, unique resource name of this fleet in the format of + * `projects/{project}/locations/{location}/fleets/{fleet}`. + * Each Google Cloud project can have at most one fleet resource, named + * "default". + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * Optional. A user-assigned display name of the Fleet. + * When present, it must be between 4 to 30 characters. + * Allowed characters are: lowercase and uppercase letters, numbers, + * hyphen, single-quote, double-quote, space, and exclamation point. + * Example: `Production Fleet` + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $display_name = ''; + /** + * Output only. When the Fleet was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. When the Fleet was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Output only. When the Fleet was deleted. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $delete_time = null; + /** + * Output only. Google-generated UUID for this resource. This is unique across + * all Fleet resources. If a Fleet resource is deleted and another resource + * with the same name is created, it gets a different uid. + * + * Generated from protobuf field string uid = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $uid = ''; + /** + * Output only. State of the namespace resource. + * + * Generated from protobuf field .google.cloud.gkehub.v1.FleetLifecycleState state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = null; + /** + * Optional. The default cluster configurations to apply across the fleet. + * + * Generated from protobuf field .google.cloud.gkehub.v1.DefaultClusterConfig default_cluster_config = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $default_cluster_config = null; + /** + * Optional. Labels for this Fleet. + * + * Generated from protobuf field map labels = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. The full, unique resource name of this fleet in the format of + * `projects/{project}/locations/{location}/fleets/{fleet}`. + * Each Google Cloud project can have at most one fleet resource, named + * "default". + * @type string $display_name + * Optional. A user-assigned display name of the Fleet. + * When present, it must be between 4 to 30 characters. + * Allowed characters are: lowercase and uppercase letters, numbers, + * hyphen, single-quote, double-quote, space, and exclamation point. + * Example: `Production Fleet` + * @type \Google\Protobuf\Timestamp $create_time + * Output only. When the Fleet was created. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. When the Fleet was last updated. + * @type \Google\Protobuf\Timestamp $delete_time + * Output only. When the Fleet was deleted. + * @type string $uid + * Output only. Google-generated UUID for this resource. This is unique across + * all Fleet resources. If a Fleet resource is deleted and another resource + * with the same name is created, it gets a different uid. + * @type \Google\Cloud\GkeHub\V1\FleetLifecycleState $state + * Output only. State of the namespace resource. + * @type \Google\Cloud\GkeHub\V1\DefaultClusterConfig $default_cluster_config + * Optional. The default cluster configurations to apply across the fleet. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. Labels for this Fleet. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gkehub\V1\Fleet::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The full, unique resource name of this fleet in the format of + * `projects/{project}/locations/{location}/fleets/{fleet}`. + * Each Google Cloud project can have at most one fleet resource, named + * "default". + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. The full, unique resource name of this fleet in the format of + * `projects/{project}/locations/{location}/fleets/{fleet}`. + * Each Google Cloud project can have at most one fleet resource, named + * "default". + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. A user-assigned display name of the Fleet. + * When present, it must be between 4 to 30 characters. + * Allowed characters are: lowercase and uppercase letters, numbers, + * hyphen, single-quote, double-quote, space, and exclamation point. + * Example: `Production Fleet` + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDisplayName() + { + return $this->display_name; + } + + /** + * Optional. A user-assigned display name of the Fleet. + * When present, it must be between 4 to 30 characters. + * Allowed characters are: lowercase and uppercase letters, numbers, + * hyphen, single-quote, double-quote, space, and exclamation point. + * Example: `Production Fleet` + * + * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Output only. When the Fleet was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. When the Fleet was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. When the Fleet was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. When the Fleet was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Output only. When the Fleet was deleted. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getDeleteTime() + { + return $this->delete_time; + } + + public function hasDeleteTime() + { + return isset($this->delete_time); + } + + public function clearDeleteTime() + { + unset($this->delete_time); + } + + /** + * Output only. When the Fleet was deleted. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setDeleteTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->delete_time = $var; + + return $this; + } + + /** + * Output only. Google-generated UUID for this resource. This is unique across + * all Fleet resources. If a Fleet resource is deleted and another resource + * with the same name is created, it gets a different uid. + * + * Generated from protobuf field string uid = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getUid() + { + return $this->uid; + } + + /** + * Output only. Google-generated UUID for this resource. This is unique across + * all Fleet resources. If a Fleet resource is deleted and another resource + * with the same name is created, it gets a different uid. + * + * Generated from protobuf field string uid = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setUid($var) + { + GPBUtil::checkString($var, True); + $this->uid = $var; + + return $this; + } + + /** + * Output only. State of the namespace resource. + * + * Generated from protobuf field .google.cloud.gkehub.v1.FleetLifecycleState state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\GkeHub\V1\FleetLifecycleState|null + */ + public function getState() + { + return $this->state; + } + + public function hasState() + { + return isset($this->state); + } + + public function clearState() + { + unset($this->state); + } + + /** + * Output only. State of the namespace resource. + * + * Generated from protobuf field .google.cloud.gkehub.v1.FleetLifecycleState state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\GkeHub\V1\FleetLifecycleState $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GkeHub\V1\FleetLifecycleState::class); + $this->state = $var; + + return $this; + } + + /** + * Optional. The default cluster configurations to apply across the fleet. + * + * Generated from protobuf field .google.cloud.gkehub.v1.DefaultClusterConfig default_cluster_config = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\GkeHub\V1\DefaultClusterConfig|null + */ + public function getDefaultClusterConfig() + { + return $this->default_cluster_config; + } + + public function hasDefaultClusterConfig() + { + return isset($this->default_cluster_config); + } + + public function clearDefaultClusterConfig() + { + unset($this->default_cluster_config); + } + + /** + * Optional. The default cluster configurations to apply across the fleet. + * + * Generated from protobuf field .google.cloud.gkehub.v1.DefaultClusterConfig default_cluster_config = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\GkeHub\V1\DefaultClusterConfig $var + * @return $this + */ + public function setDefaultClusterConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GkeHub\V1\DefaultClusterConfig::class); + $this->default_cluster_config = $var; + + return $this; + } + + /** + * Optional. Labels for this Fleet. + * + * Generated from protobuf field map labels = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. Labels for this Fleet. + * + * Generated from protobuf field map labels = 11 [(.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; + } + +} + diff --git a/GkeHub/src/V1/FleetLifecycleState.php b/GkeHub/src/V1/FleetLifecycleState.php new file mode 100644 index 000000000000..30e10a49f2ab --- /dev/null +++ b/GkeHub/src/V1/FleetLifecycleState.php @@ -0,0 +1,67 @@ +google.cloud.gkehub.v1.FleetLifecycleState + */ +class FleetLifecycleState extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The current state of the Fleet resource. + * + * Generated from protobuf field .google.cloud.gkehub.v1.FleetLifecycleState.Code code = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $code = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $code + * Output only. The current state of the Fleet resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gkehub\V1\Fleet::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The current state of the Fleet resource. + * + * Generated from protobuf field .google.cloud.gkehub.v1.FleetLifecycleState.Code code = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getCode() + { + return $this->code; + } + + /** + * Output only. The current state of the Fleet resource. + * + * Generated from protobuf field .google.cloud.gkehub.v1.FleetLifecycleState.Code code = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setCode($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\GkeHub\V1\FleetLifecycleState\Code::class); + $this->code = $var; + + return $this; + } + +} + diff --git a/GkeHub/src/V1/FleetLifecycleState/Code.php b/GkeHub/src/V1/FleetLifecycleState/Code.php new file mode 100644 index 000000000000..bd604fd3ea50 --- /dev/null +++ b/GkeHub/src/V1/FleetLifecycleState/Code.php @@ -0,0 +1,76 @@ +google.cloud.gkehub.v1.FleetLifecycleState.Code + */ +class Code +{ + /** + * The code is not set. + * + * Generated from protobuf enum CODE_UNSPECIFIED = 0; + */ + const CODE_UNSPECIFIED = 0; + /** + * The fleet is being created. + * + * Generated from protobuf enum CREATING = 1; + */ + const CREATING = 1; + /** + * The fleet active. + * + * Generated from protobuf enum READY = 2; + */ + const READY = 2; + /** + * The fleet is being deleted. + * + * Generated from protobuf enum DELETING = 3; + */ + const DELETING = 3; + /** + * The fleet is being updated. + * + * Generated from protobuf enum UPDATING = 4; + */ + const UPDATING = 4; + + private static $valueToName = [ + self::CODE_UNSPECIFIED => 'CODE_UNSPECIFIED', + self::CREATING => 'CREATING', + self::READY => 'READY', + self::DELETING => 'DELETING', + self::UPDATING => 'UPDATING', + ]; + + 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/GkeHub/src/V1/GenerateMembershipRBACRoleBindingYAMLRequest.php b/GkeHub/src/V1/GenerateMembershipRBACRoleBindingYAMLRequest.php new file mode 100644 index 000000000000..0a8f53f5db8f --- /dev/null +++ b/GkeHub/src/V1/GenerateMembershipRBACRoleBindingYAMLRequest.php @@ -0,0 +1,174 @@ +google.cloud.gkehub.v1.GenerateMembershipRBACRoleBindingYAMLRequest + */ +class GenerateMembershipRBACRoleBindingYAMLRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent (project and location) where the RBACRoleBinding will + * be created. Specified in the format `projects/*/locations/*/memberships/*`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. Client chosen ID for the RBACRoleBinding. `rbacrolebinding_id` + * must be a valid RFC 1123 compliant DNS label: + * 1. At most 63 characters in length + * 2. It must consist of lower case alphanumeric characters or `-` + * 3. It must start and end with an alphanumeric character + * Which can be expressed as the regex: `[a-z0-9]([-a-z0-9]*[a-z0-9])?`, + * with a maximum length of 63 characters. + * + * Generated from protobuf field string rbacrolebinding_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $rbacrolebinding_id = ''; + /** + * Required. The rbacrolebindings to generate the YAML for. + * + * Generated from protobuf field .google.cloud.gkehub.v1.RBACRoleBinding rbacrolebinding = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $rbacrolebinding = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent (project and location) where the RBACRoleBinding will + * be created. Specified in the format `projects/*/locations/*/memberships/*`. + * @type string $rbacrolebinding_id + * Required. Client chosen ID for the RBACRoleBinding. `rbacrolebinding_id` + * must be a valid RFC 1123 compliant DNS label: + * 1. At most 63 characters in length + * 2. It must consist of lower case alphanumeric characters or `-` + * 3. It must start and end with an alphanumeric character + * Which can be expressed as the regex: `[a-z0-9]([-a-z0-9]*[a-z0-9])?`, + * with a maximum length of 63 characters. + * @type \Google\Cloud\GkeHub\V1\RBACRoleBinding $rbacrolebinding + * Required. The rbacrolebindings to generate the YAML for. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gkehub\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent (project and location) where the RBACRoleBinding will + * be created. Specified in the format `projects/*/locations/*/memberships/*`. + * + * 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 (project and location) where the RBACRoleBinding will + * be created. Specified in the format `projects/*/locations/*/memberships/*`. + * + * 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. Client chosen ID for the RBACRoleBinding. `rbacrolebinding_id` + * must be a valid RFC 1123 compliant DNS label: + * 1. At most 63 characters in length + * 2. It must consist of lower case alphanumeric characters or `-` + * 3. It must start and end with an alphanumeric character + * Which can be expressed as the regex: `[a-z0-9]([-a-z0-9]*[a-z0-9])?`, + * with a maximum length of 63 characters. + * + * Generated from protobuf field string rbacrolebinding_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRbacrolebindingId() + { + return $this->rbacrolebinding_id; + } + + /** + * Required. Client chosen ID for the RBACRoleBinding. `rbacrolebinding_id` + * must be a valid RFC 1123 compliant DNS label: + * 1. At most 63 characters in length + * 2. It must consist of lower case alphanumeric characters or `-` + * 3. It must start and end with an alphanumeric character + * Which can be expressed as the regex: `[a-z0-9]([-a-z0-9]*[a-z0-9])?`, + * with a maximum length of 63 characters. + * + * Generated from protobuf field string rbacrolebinding_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setRbacrolebindingId($var) + { + GPBUtil::checkString($var, True); + $this->rbacrolebinding_id = $var; + + return $this; + } + + /** + * Required. The rbacrolebindings to generate the YAML for. + * + * Generated from protobuf field .google.cloud.gkehub.v1.RBACRoleBinding rbacrolebinding = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\GkeHub\V1\RBACRoleBinding|null + */ + public function getRbacrolebinding() + { + return $this->rbacrolebinding; + } + + public function hasRbacrolebinding() + { + return isset($this->rbacrolebinding); + } + + public function clearRbacrolebinding() + { + unset($this->rbacrolebinding); + } + + /** + * Required. The rbacrolebindings to generate the YAML for. + * + * Generated from protobuf field .google.cloud.gkehub.v1.RBACRoleBinding rbacrolebinding = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\GkeHub\V1\RBACRoleBinding $var + * @return $this + */ + public function setRbacrolebinding($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GkeHub\V1\RBACRoleBinding::class); + $this->rbacrolebinding = $var; + + return $this; + } + +} + diff --git a/GkeHub/src/V1/GenerateMembershipRBACRoleBindingYAMLResponse.php b/GkeHub/src/V1/GenerateMembershipRBACRoleBindingYAMLResponse.php new file mode 100644 index 000000000000..9a5ad5ab8627 --- /dev/null +++ b/GkeHub/src/V1/GenerateMembershipRBACRoleBindingYAMLResponse.php @@ -0,0 +1,67 @@ +google.cloud.gkehub.v1.GenerateMembershipRBACRoleBindingYAMLResponse + */ +class GenerateMembershipRBACRoleBindingYAMLResponse extends \Google\Protobuf\Internal\Message +{ + /** + * a yaml text blob including the RBAC policies. + * + * Generated from protobuf field string role_bindings_yaml = 1; + */ + protected $role_bindings_yaml = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $role_bindings_yaml + * a yaml text blob including the RBAC policies. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gkehub\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * a yaml text blob including the RBAC policies. + * + * Generated from protobuf field string role_bindings_yaml = 1; + * @return string + */ + public function getRoleBindingsYaml() + { + return $this->role_bindings_yaml; + } + + /** + * a yaml text blob including the RBAC policies. + * + * Generated from protobuf field string role_bindings_yaml = 1; + * @param string $var + * @return $this + */ + public function setRoleBindingsYaml($var) + { + GPBUtil::checkString($var, True); + $this->role_bindings_yaml = $var; + + return $this; + } + +} + diff --git a/GkeHub/src/V1/GetFeatureRequest.php b/GkeHub/src/V1/GetFeatureRequest.php index 5fd540450a6b..62ab7c5a9934 100644 --- a/GkeHub/src/V1/GetFeatureRequest.php +++ b/GkeHub/src/V1/GetFeatureRequest.php @@ -22,6 +22,15 @@ class GetFeatureRequest extends \Google\Protobuf\Internal\Message * Generated from protobuf field string name = 1 [(.google.api.resource_reference) = { */ protected $name = ''; + /** + * Optional. If set to true, the response will return partial results when + * some regions are unreachable and the unreachable field in Feature proto + * will be populated. If set to false, the request will fail when some regions + * are unreachable. + * + * Generated from protobuf field bool return_partial_success = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $return_partial_success = false; /** * @param string $name Required. The Feature resource name in the format @@ -46,6 +55,11 @@ public static function build(string $name): self * @type string $name * Required. The Feature resource name in the format * `projects/*/locations/*/features/*` + * @type bool $return_partial_success + * Optional. If set to true, the response will return partial results when + * some regions are unreachable and the unreachable field in Feature proto + * will be populated. If set to false, the request will fail when some regions + * are unreachable. * } */ public function __construct($data = NULL) { @@ -81,5 +95,37 @@ public function setName($var) return $this; } + /** + * Optional. If set to true, the response will return partial results when + * some regions are unreachable and the unreachable field in Feature proto + * will be populated. If set to false, the request will fail when some regions + * are unreachable. + * + * Generated from protobuf field bool return_partial_success = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getReturnPartialSuccess() + { + return $this->return_partial_success; + } + + /** + * Optional. If set to true, the response will return partial results when + * some regions are unreachable and the unreachable field in Feature proto + * will be populated. If set to false, the request will fail when some regions + * are unreachable. + * + * Generated from protobuf field bool return_partial_success = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setReturnPartialSuccess($var) + { + GPBUtil::checkBool($var); + $this->return_partial_success = $var; + + return $this; + } + } diff --git a/GkeHub/src/V1/GetFleetRequest.php b/GkeHub/src/V1/GetFleetRequest.php new file mode 100644 index 000000000000..c6888038d2aa --- /dev/null +++ b/GkeHub/src/V1/GetFleetRequest.php @@ -0,0 +1,86 @@ +google.cloud.gkehub.v1.GetFleetRequest + */ +class GetFleetRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The Fleet resource name in the format + * `projects/*/locations/*/fleets/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The Fleet resource name in the format + * `projects/*/locations/*/fleets/*`. Please see + * {@see GkeHubClient::fleetName()} for help formatting this field. + * + * @return \Google\Cloud\GkeHub\V1\GetFleetRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The Fleet resource name in the format + * `projects/*/locations/*/fleets/*`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gkehub\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The Fleet resource name in the format + * `projects/*/locations/*/fleets/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The Fleet resource name in the format + * `projects/*/locations/*/fleets/*`. + * + * 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/GkeHub/src/V1/GetMembershipBindingRequest.php b/GkeHub/src/V1/GetMembershipBindingRequest.php new file mode 100644 index 000000000000..281f8ca52922 --- /dev/null +++ b/GkeHub/src/V1/GetMembershipBindingRequest.php @@ -0,0 +1,86 @@ +google.cloud.gkehub.v1.GetMembershipBindingRequest + */ +class GetMembershipBindingRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The MembershipBinding resource name in the format + * `projects/*/locations/*/memberships/*/bindings/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The MembershipBinding resource name in the format + * `projects/*/locations/*/memberships/*/bindings/*`. Please see + * {@see GkeHubClient::membershipBindingName()} for help formatting this field. + * + * @return \Google\Cloud\GkeHub\V1\GetMembershipBindingRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The MembershipBinding resource name in the format + * `projects/*/locations/*/memberships/*/bindings/*`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gkehub\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The MembershipBinding resource name in the format + * `projects/*/locations/*/memberships/*/bindings/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The MembershipBinding resource name in the format + * `projects/*/locations/*/memberships/*/bindings/*`. + * + * 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/GkeHub/src/V1/GetMembershipRBACRoleBindingRequest.php b/GkeHub/src/V1/GetMembershipRBACRoleBindingRequest.php new file mode 100644 index 000000000000..1116fbf218c4 --- /dev/null +++ b/GkeHub/src/V1/GetMembershipRBACRoleBindingRequest.php @@ -0,0 +1,86 @@ +google.cloud.gkehub.v1.GetMembershipRBACRoleBindingRequest + */ +class GetMembershipRBACRoleBindingRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The RBACRoleBinding resource name in the format + * `projects/*/locations/*/memberships/*/rbacrolebindings/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The RBACRoleBinding resource name in the format + * `projects/*/locations/*/memberships/*/rbacrolebindings/*`. Please see + * {@see GkeHubClient::rBACRoleBindingName()} for help formatting this field. + * + * @return \Google\Cloud\GkeHub\V1\GetMembershipRBACRoleBindingRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The RBACRoleBinding resource name in the format + * `projects/*/locations/*/memberships/*/rbacrolebindings/*`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gkehub\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The RBACRoleBinding resource name in the format + * `projects/*/locations/*/memberships/*/rbacrolebindings/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The RBACRoleBinding resource name in the format + * `projects/*/locations/*/memberships/*/rbacrolebindings/*`. + * + * 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/GkeHub/src/V1/GetScopeNamespaceRequest.php b/GkeHub/src/V1/GetScopeNamespaceRequest.php new file mode 100644 index 000000000000..c0379c17da1b --- /dev/null +++ b/GkeHub/src/V1/GetScopeNamespaceRequest.php @@ -0,0 +1,86 @@ +google.cloud.gkehub.v1.GetScopeNamespaceRequest + */ +class GetScopeNamespaceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The Namespace resource name in the format + * `projects/*/locations/*/scopes/*/namespaces/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The Namespace resource name in the format + * `projects/*/locations/*/scopes/*/namespaces/*`. Please see + * {@see GkeHubClient::namespaceName()} for help formatting this field. + * + * @return \Google\Cloud\GkeHub\V1\GetScopeNamespaceRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The Namespace resource name in the format + * `projects/*/locations/*/scopes/*/namespaces/*`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gkehub\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The Namespace resource name in the format + * `projects/*/locations/*/scopes/*/namespaces/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The Namespace resource name in the format + * `projects/*/locations/*/scopes/*/namespaces/*`. + * + * 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/GkeHub/src/V1/GetScopeRBACRoleBindingRequest.php b/GkeHub/src/V1/GetScopeRBACRoleBindingRequest.php new file mode 100644 index 000000000000..6ffacd6594e2 --- /dev/null +++ b/GkeHub/src/V1/GetScopeRBACRoleBindingRequest.php @@ -0,0 +1,86 @@ +google.cloud.gkehub.v1.GetScopeRBACRoleBindingRequest + */ +class GetScopeRBACRoleBindingRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The RBACRoleBinding resource name in the format + * `projects/*/locations/*/scopes/*/rbacrolebindings/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The RBACRoleBinding resource name in the format + * `projects/*/locations/*/scopes/*/rbacrolebindings/*`. Please see + * {@see GkeHubClient::rBACRoleBindingName()} for help formatting this field. + * + * @return \Google\Cloud\GkeHub\V1\GetScopeRBACRoleBindingRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The RBACRoleBinding resource name in the format + * `projects/*/locations/*/scopes/*/rbacrolebindings/*`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gkehub\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The RBACRoleBinding resource name in the format + * `projects/*/locations/*/scopes/*/rbacrolebindings/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The RBACRoleBinding resource name in the format + * `projects/*/locations/*/scopes/*/rbacrolebindings/*`. + * + * 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/GkeHub/src/V1/GetScopeRequest.php b/GkeHub/src/V1/GetScopeRequest.php new file mode 100644 index 000000000000..f9e686bce4b2 --- /dev/null +++ b/GkeHub/src/V1/GetScopeRequest.php @@ -0,0 +1,86 @@ +google.cloud.gkehub.v1.GetScopeRequest + */ +class GetScopeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The Scope resource name in the format + * `projects/*/locations/*/scopes/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The Scope resource name in the format + * `projects/*/locations/*/scopes/*`. Please see + * {@see GkeHubClient::scopeName()} for help formatting this field. + * + * @return \Google\Cloud\GkeHub\V1\GetScopeRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The Scope resource name in the format + * `projects/*/locations/*/scopes/*`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gkehub\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The Scope resource name in the format + * `projects/*/locations/*/scopes/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The Scope resource name in the format + * `projects/*/locations/*/scopes/*`. + * + * 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/GkeHub/src/V1/ListBoundMembershipsRequest.php b/GkeHub/src/V1/ListBoundMembershipsRequest.php new file mode 100644 index 000000000000..bde56c249ee1 --- /dev/null +++ b/GkeHub/src/V1/ListBoundMembershipsRequest.php @@ -0,0 +1,220 @@ +google.cloud.gkehub.v1.ListBoundMembershipsRequest + */ +class ListBoundMembershipsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the Scope, in the format + * `projects/*/locations/global/scopes/*`, to which the Memberships are bound. + * + * Generated from protobuf field string scope_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $scope_name = ''; + /** + * Optional. Lists Memberships that match the filter expression, following the + * syntax outlined in https://google.aip.dev/160. Currently, filtering + * can be done only based on Memberships's `name`, `labels`, `create_time`, + * `update_time`, and `unique_id`. + * + * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. When requesting a 'page' of resources, `page_size` specifies + * number of resources to return. If unspecified or set to 0, all resources + * will be returned. Pagination is currently not supported; therefore, setting + * this field does not have any impact for now. + * + * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. Token returned by previous call to `ListBoundMemberships` which + * specifies the position in the list from where to continue listing the + * resources. + * + * Generated from protobuf field string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * @param string $scopeName Required. Name of the Scope, in the format + * `projects/*/locations/global/scopes/*`, to which the Memberships are bound. Please see + * {@see GkeHubClient::scopeName()} for help formatting this field. + * + * @return \Google\Cloud\GkeHub\V1\ListBoundMembershipsRequest + * + * @experimental + */ + public static function build(string $scopeName): self + { + return (new self()) + ->setScopeName($scopeName); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $scope_name + * Required. Name of the Scope, in the format + * `projects/*/locations/global/scopes/*`, to which the Memberships are bound. + * @type string $filter + * Optional. Lists Memberships that match the filter expression, following the + * syntax outlined in https://google.aip.dev/160. Currently, filtering + * can be done only based on Memberships's `name`, `labels`, `create_time`, + * `update_time`, and `unique_id`. + * @type int $page_size + * Optional. When requesting a 'page' of resources, `page_size` specifies + * number of resources to return. If unspecified or set to 0, all resources + * will be returned. Pagination is currently not supported; therefore, setting + * this field does not have any impact for now. + * @type string $page_token + * Optional. Token returned by previous call to `ListBoundMemberships` which + * specifies the position in the list from where to continue listing the + * resources. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gkehub\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the Scope, in the format + * `projects/*/locations/global/scopes/*`, to which the Memberships are bound. + * + * Generated from protobuf field string scope_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getScopeName() + { + return $this->scope_name; + } + + /** + * Required. Name of the Scope, in the format + * `projects/*/locations/global/scopes/*`, to which the Memberships are bound. + * + * Generated from protobuf field string scope_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setScopeName($var) + { + GPBUtil::checkString($var, True); + $this->scope_name = $var; + + return $this; + } + + /** + * Optional. Lists Memberships that match the filter expression, following the + * syntax outlined in https://google.aip.dev/160. Currently, filtering + * can be done only based on Memberships's `name`, `labels`, `create_time`, + * `update_time`, and `unique_id`. + * + * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Lists Memberships that match the filter expression, following the + * syntax outlined in https://google.aip.dev/160. Currently, filtering + * can be done only based on Memberships's `name`, `labels`, `create_time`, + * `update_time`, and `unique_id`. + * + * Generated from protobuf field string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. When requesting a 'page' of resources, `page_size` specifies + * number of resources to return. If unspecified or set to 0, all resources + * will be returned. Pagination is currently not supported; therefore, setting + * this field does not have any impact for now. + * + * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. When requesting a 'page' of resources, `page_size` specifies + * number of resources to return. If unspecified or set to 0, all resources + * will be returned. Pagination is currently not supported; therefore, setting + * this field does not have any impact for now. + * + * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. Token returned by previous call to `ListBoundMemberships` which + * specifies the position in the list from where to continue listing the + * resources. + * + * Generated from protobuf field string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. Token returned by previous call to `ListBoundMemberships` which + * specifies the position in the list from where to continue listing the + * resources. + * + * Generated from protobuf field string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/GkeHub/src/V1/ListBoundMembershipsResponse.php b/GkeHub/src/V1/ListBoundMembershipsResponse.php new file mode 100644 index 000000000000..c0b97a46566c --- /dev/null +++ b/GkeHub/src/V1/ListBoundMembershipsResponse.php @@ -0,0 +1,143 @@ +google.cloud.gkehub.v1.ListBoundMembershipsResponse + */ +class ListBoundMembershipsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of Memberships bound to the given Scope. + * + * Generated from protobuf field repeated .google.cloud.gkehub.v1.Membership memberships = 1; + */ + private $memberships; + /** + * List of locations that could not be reached while fetching this list. + * + * Generated from protobuf field repeated string unreachable = 2; + */ + private $unreachable; + /** + * A token to request the next page of resources from the + * `ListBoundMemberships` method. The value of an empty string means that + * there are no more resources to return. + * + * Generated from protobuf field string next_page_token = 3; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\GkeHub\V1\Membership>|\Google\Protobuf\Internal\RepeatedField $memberships + * The list of Memberships bound to the given Scope. + * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable + * List of locations that could not be reached while fetching this list. + * @type string $next_page_token + * A token to request the next page of resources from the + * `ListBoundMemberships` method. The value of an empty string means that + * there are no more resources to return. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gkehub\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * The list of Memberships bound to the given Scope. + * + * Generated from protobuf field repeated .google.cloud.gkehub.v1.Membership memberships = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMemberships() + { + return $this->memberships; + } + + /** + * The list of Memberships bound to the given Scope. + * + * Generated from protobuf field repeated .google.cloud.gkehub.v1.Membership memberships = 1; + * @param array<\Google\Cloud\GkeHub\V1\Membership>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMemberships($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\GkeHub\V1\Membership::class); + $this->memberships = $arr; + + return $this; + } + + /** + * List of locations that could not be reached while fetching this list. + * + * Generated from protobuf field repeated string unreachable = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachable() + { + return $this->unreachable; + } + + /** + * List of locations that could not be reached while fetching this list. + * + * Generated from protobuf field repeated string unreachable = 2; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachable($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachable = $arr; + + return $this; + } + + /** + * A token to request the next page of resources from the + * `ListBoundMemberships` method. The value of an empty string means that + * there are no more resources to return. + * + * Generated from protobuf field string next_page_token = 3; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token to request the next page of resources from the + * `ListBoundMemberships` method. The value of an empty string means that + * there are no more resources to return. + * + * Generated from protobuf field string next_page_token = 3; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/GkeHub/src/V1/ListFeaturesRequest.php b/GkeHub/src/V1/ListFeaturesRequest.php index e9d2982682b6..47144ac4215d 100644 --- a/GkeHub/src/V1/ListFeaturesRequest.php +++ b/GkeHub/src/V1/ListFeaturesRequest.php @@ -59,6 +59,15 @@ class ListFeaturesRequest extends \Google\Protobuf\Internal\Message * Generated from protobuf field string order_by = 5; */ protected $order_by = ''; + /** + * Optional. If set to true, the response will return partial results when + * some regions are unreachable and the unreachable field in Feature proto + * will be populated. If set to false, the request will fail when some regions + * are unreachable. + * + * Generated from protobuf field bool return_partial_success = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $return_partial_success = false; /** * @param string $parent Required. The parent (project and location) where the Features will be @@ -104,6 +113,11 @@ public static function build(string $parent): self * @type string $order_by * One or more fields to compare and use to sort the output. * See https://google.aip.dev/132#ordering. + * @type bool $return_partial_success + * Optional. If set to true, the response will return partial results when + * some regions are unreachable and the unreachable field in Feature proto + * will be populated. If set to false, the request will fail when some regions + * are unreachable. * } */ public function __construct($data = NULL) { @@ -269,5 +283,37 @@ public function setOrderBy($var) return $this; } + /** + * Optional. If set to true, the response will return partial results when + * some regions are unreachable and the unreachable field in Feature proto + * will be populated. If set to false, the request will fail when some regions + * are unreachable. + * + * Generated from protobuf field bool return_partial_success = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getReturnPartialSuccess() + { + return $this->return_partial_success; + } + + /** + * Optional. If set to true, the response will return partial results when + * some regions are unreachable and the unreachable field in Feature proto + * will be populated. If set to false, the request will fail when some regions + * are unreachable. + * + * Generated from protobuf field bool return_partial_success = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setReturnPartialSuccess($var) + { + GPBUtil::checkBool($var); + $this->return_partial_success = $var; + + return $this; + } + } diff --git a/GkeHub/src/V1/ListFleetsRequest.php b/GkeHub/src/V1/ListFleetsRequest.php new file mode 100644 index 000000000000..efb3dd2c7711 --- /dev/null +++ b/GkeHub/src/V1/ListFleetsRequest.php @@ -0,0 +1,174 @@ +google.cloud.gkehub.v1.ListFleetsRequest + */ +class ListFleetsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The organization or project to list for Fleets under, in the + * format `organizations/*/locations/*` or `projects/*/locations/*`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. A page token, received from a previous `ListFleets` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListFleets` must match + * the call that provided the page token. + * + * Generated from protobuf field string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. The maximum number of fleets to return. The service may return + * fewer than this value. If unspecified, at most 200 fleets will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * + * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + + /** + * @param string $parent Required. The organization or project to list for Fleets under, in the + * format `organizations/*/locations/*` or `projects/*/locations/*`. Please see + * {@see GkeHubClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\GkeHub\V1\ListFleetsRequest + * + * @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 organization or project to list for Fleets under, in the + * format `organizations/*/locations/*` or `projects/*/locations/*`. + * @type string $page_token + * Optional. A page token, received from a previous `ListFleets` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListFleets` must match + * the call that provided the page token. + * @type int $page_size + * Optional. The maximum number of fleets to return. The service may return + * fewer than this value. If unspecified, at most 200 fleets will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gkehub\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The organization or project to list for Fleets under, in the + * format `organizations/*/locations/*` or `projects/*/locations/*`. + * + * 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 organization or project to list for Fleets under, in the + * format `organizations/*/locations/*` or `projects/*/locations/*`. + * + * 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. A page token, received from a previous `ListFleets` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListFleets` must match + * the call that provided the page token. + * + * Generated from protobuf field string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A page token, received from a previous `ListFleets` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListFleets` must match + * the call that provided the page token. + * + * Generated from protobuf field string page_token = 2 [(.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. The maximum number of fleets to return. The service may return + * fewer than this value. If unspecified, at most 200 fleets will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * + * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of fleets to return. The service may return + * fewer than this value. If unspecified, at most 200 fleets will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * + * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + +} + diff --git a/GkeHub/src/V1/ListFleetsResponse.php b/GkeHub/src/V1/ListFleetsResponse.php new file mode 100644 index 000000000000..d9c8ecb26d5a --- /dev/null +++ b/GkeHub/src/V1/ListFleetsResponse.php @@ -0,0 +1,109 @@ +google.cloud.gkehub.v1.ListFleetsResponse + */ +class ListFleetsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of matching fleets. + * + * Generated from protobuf field repeated .google.cloud.gkehub.v1.Fleet fleets = 1; + */ + private $fleets; + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * The token is only valid for 1h. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\GkeHub\V1\Fleet>|\Google\Protobuf\Internal\RepeatedField $fleets + * The list of matching fleets. + * @type string $next_page_token + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * The token is only valid for 1h. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gkehub\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * The list of matching fleets. + * + * Generated from protobuf field repeated .google.cloud.gkehub.v1.Fleet fleets = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFleets() + { + return $this->fleets; + } + + /** + * The list of matching fleets. + * + * Generated from protobuf field repeated .google.cloud.gkehub.v1.Fleet fleets = 1; + * @param array<\Google\Cloud\GkeHub\V1\Fleet>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFleets($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\GkeHub\V1\Fleet::class); + $this->fleets = $arr; + + return $this; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * The token is only valid for 1h. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * The token is only valid for 1h. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/GkeHub/src/V1/ListMembershipBindingsRequest.php b/GkeHub/src/V1/ListMembershipBindingsRequest.php new file mode 100644 index 000000000000..76ec9ec5b06a --- /dev/null +++ b/GkeHub/src/V1/ListMembershipBindingsRequest.php @@ -0,0 +1,208 @@ +google.cloud.gkehub.v1.ListMembershipBindingsRequest + */ +class ListMembershipBindingsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent Membership for which the MembershipBindings will be + * listed. Specified in the format `projects/*/locations/*/memberships/*`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. When requesting a 'page' of resources, `page_size` specifies + * number of resources to return. If unspecified or set to 0, all resources + * will be returned. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. Token returned by previous call to `ListMembershipBindings` which + * specifies the position in the list from where to continue listing the + * resources. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. Lists MembershipBindings that match the filter expression, + * following the syntax outlined in https://google.aip.dev/160. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + + /** + * @param string $parent Required. The parent Membership for which the MembershipBindings will be + * listed. Specified in the format `projects/*/locations/*/memberships/*`. Please see + * {@see GkeHubClient::membershipName()} for help formatting this field. + * + * @return \Google\Cloud\GkeHub\V1\ListMembershipBindingsRequest + * + * @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 Membership for which the MembershipBindings will be + * listed. Specified in the format `projects/*/locations/*/memberships/*`. + * @type int $page_size + * Optional. When requesting a 'page' of resources, `page_size` specifies + * number of resources to return. If unspecified or set to 0, all resources + * will be returned. + * @type string $page_token + * Optional. Token returned by previous call to `ListMembershipBindings` which + * specifies the position in the list from where to continue listing the + * resources. + * @type string $filter + * Optional. Lists MembershipBindings that match the filter expression, + * following the syntax outlined in https://google.aip.dev/160. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gkehub\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent Membership for which the MembershipBindings will be + * listed. Specified in the format `projects/*/locations/*/memberships/*`. + * + * 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 Membership for which the MembershipBindings will be + * listed. Specified in the format `projects/*/locations/*/memberships/*`. + * + * 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. When requesting a 'page' of resources, `page_size` specifies + * number of resources to return. If unspecified or set to 0, all resources + * will be returned. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. When requesting a 'page' of resources, `page_size` specifies + * number of resources to return. If unspecified or set to 0, all resources + * will be returned. + * + * 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. Token returned by previous call to `ListMembershipBindings` which + * specifies the position in the list from where to continue listing the + * resources. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. Token returned by previous call to `ListMembershipBindings` which + * specifies the position in the list from where to continue listing the + * resources. + * + * 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. Lists MembershipBindings that match the filter expression, + * following the syntax outlined in https://google.aip.dev/160. + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Lists MembershipBindings that match the filter expression, + * following the syntax outlined in https://google.aip.dev/160. + * + * 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; + } + +} + diff --git a/GkeHub/src/V1/ListMembershipBindingsResponse.php b/GkeHub/src/V1/ListMembershipBindingsResponse.php new file mode 100644 index 000000000000..3c64db6acada --- /dev/null +++ b/GkeHub/src/V1/ListMembershipBindingsResponse.php @@ -0,0 +1,143 @@ +google.cloud.gkehub.v1.ListMembershipBindingsResponse + */ +class ListMembershipBindingsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of membership_bindings + * + * Generated from protobuf field repeated .google.cloud.gkehub.v1.MembershipBinding membership_bindings = 1; + */ + private $membership_bindings; + /** + * A token to request the next page of resources from the + * `ListMembershipBindings` method. The value of an empty string means + * that there are no more resources to return. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * List of locations that could not be reached while fetching this list. + * + * Generated from protobuf field repeated string unreachable = 3; + */ + private $unreachable; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\GkeHub\V1\MembershipBinding>|\Google\Protobuf\Internal\RepeatedField $membership_bindings + * The list of membership_bindings + * @type string $next_page_token + * A token to request the next page of resources from the + * `ListMembershipBindings` method. The value of an empty string means + * that there are no more resources to return. + * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable + * List of locations that could not be reached while fetching this list. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gkehub\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * The list of membership_bindings + * + * Generated from protobuf field repeated .google.cloud.gkehub.v1.MembershipBinding membership_bindings = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMembershipBindings() + { + return $this->membership_bindings; + } + + /** + * The list of membership_bindings + * + * Generated from protobuf field repeated .google.cloud.gkehub.v1.MembershipBinding membership_bindings = 1; + * @param array<\Google\Cloud\GkeHub\V1\MembershipBinding>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMembershipBindings($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\GkeHub\V1\MembershipBinding::class); + $this->membership_bindings = $arr; + + return $this; + } + + /** + * A token to request the next page of resources from the + * `ListMembershipBindings` method. The value of an empty string means + * that there are no more resources to return. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token to request the next page of resources from the + * `ListMembershipBindings` method. The value of an empty string means + * that there are no more resources to return. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * List of locations that could not be reached while fetching this list. + * + * Generated from protobuf field repeated string unreachable = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachable() + { + return $this->unreachable; + } + + /** + * List of locations that could not be reached while fetching this list. + * + * Generated from protobuf field repeated string unreachable = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachable($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachable = $arr; + + return $this; + } + +} + diff --git a/GkeHub/src/V1/ListMembershipRBACRoleBindingsRequest.php b/GkeHub/src/V1/ListMembershipRBACRoleBindingsRequest.php new file mode 100644 index 000000000000..ac01d9d83bd7 --- /dev/null +++ b/GkeHub/src/V1/ListMembershipRBACRoleBindingsRequest.php @@ -0,0 +1,170 @@ +google.cloud.gkehub.v1.ListMembershipRBACRoleBindingsRequest + */ +class ListMembershipRBACRoleBindingsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent (project and location) where the Features will be + * listed. Specified in the format `projects/*/locations/*/memberships/*`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. When requesting a 'page' of resources, `page_size` specifies + * number of resources to return. If unspecified or set to 0, all resources + * will be returned. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. Token returned by previous call to + * `ListMembershipRBACRoleBindings` which specifies the position in the list + * from where to continue listing the resources. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The parent (project and location) where the Features will be + * listed. Specified in the format `projects/*/locations/*/memberships/*`. Please see + * {@see GkeHubClient::scopeName()} for help formatting this field. + * + * @return \Google\Cloud\GkeHub\V1\ListMembershipRBACRoleBindingsRequest + * + * @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 (project and location) where the Features will be + * listed. Specified in the format `projects/*/locations/*/memberships/*`. + * @type int $page_size + * Optional. When requesting a 'page' of resources, `page_size` specifies + * number of resources to return. If unspecified or set to 0, all resources + * will be returned. + * @type string $page_token + * Optional. Token returned by previous call to + * `ListMembershipRBACRoleBindings` which specifies the position in the list + * from where to continue listing the resources. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gkehub\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent (project and location) where the Features will be + * listed. Specified in the format `projects/*/locations/*/memberships/*`. + * + * 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 (project and location) where the Features will be + * listed. Specified in the format `projects/*/locations/*/memberships/*`. + * + * 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. When requesting a 'page' of resources, `page_size` specifies + * number of resources to return. If unspecified or set to 0, all resources + * will be returned. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. When requesting a 'page' of resources, `page_size` specifies + * number of resources to return. If unspecified or set to 0, all resources + * will be returned. + * + * 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. Token returned by previous call to + * `ListMembershipRBACRoleBindings` which specifies the position in the list + * from where to continue listing the resources. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. Token returned by previous call to + * `ListMembershipRBACRoleBindings` which specifies the position in the list + * from where to continue listing the resources. + * + * 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; + } + +} + diff --git a/GkeHub/src/V1/ListMembershipRBACRoleBindingsResponse.php b/GkeHub/src/V1/ListMembershipRBACRoleBindingsResponse.php new file mode 100644 index 000000000000..d03fe6a7bf5d --- /dev/null +++ b/GkeHub/src/V1/ListMembershipRBACRoleBindingsResponse.php @@ -0,0 +1,143 @@ +google.cloud.gkehub.v1.ListMembershipRBACRoleBindingsResponse + */ +class ListMembershipRBACRoleBindingsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of Membership RBACRoleBindings. + * + * Generated from protobuf field repeated .google.cloud.gkehub.v1.RBACRoleBinding rbacrolebindings = 1; + */ + private $rbacrolebindings; + /** + * A token to request the next page of resources from the + * `ListMembershipRBACRoleBindings` method. The value of an empty string means + * that there are no more resources to return. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * List of locations that could not be reached while fetching this list. + * + * Generated from protobuf field repeated string unreachable = 3; + */ + private $unreachable; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\GkeHub\V1\RBACRoleBinding>|\Google\Protobuf\Internal\RepeatedField $rbacrolebindings + * The list of Membership RBACRoleBindings. + * @type string $next_page_token + * A token to request the next page of resources from the + * `ListMembershipRBACRoleBindings` method. The value of an empty string means + * that there are no more resources to return. + * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable + * List of locations that could not be reached while fetching this list. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gkehub\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * The list of Membership RBACRoleBindings. + * + * Generated from protobuf field repeated .google.cloud.gkehub.v1.RBACRoleBinding rbacrolebindings = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRbacrolebindings() + { + return $this->rbacrolebindings; + } + + /** + * The list of Membership RBACRoleBindings. + * + * Generated from protobuf field repeated .google.cloud.gkehub.v1.RBACRoleBinding rbacrolebindings = 1; + * @param array<\Google\Cloud\GkeHub\V1\RBACRoleBinding>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRbacrolebindings($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\GkeHub\V1\RBACRoleBinding::class); + $this->rbacrolebindings = $arr; + + return $this; + } + + /** + * A token to request the next page of resources from the + * `ListMembershipRBACRoleBindings` method. The value of an empty string means + * that there are no more resources to return. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token to request the next page of resources from the + * `ListMembershipRBACRoleBindings` method. The value of an empty string means + * that there are no more resources to return. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * List of locations that could not be reached while fetching this list. + * + * Generated from protobuf field repeated string unreachable = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachable() + { + return $this->unreachable; + } + + /** + * List of locations that could not be reached while fetching this list. + * + * Generated from protobuf field repeated string unreachable = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachable($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachable = $arr; + + return $this; + } + +} + diff --git a/GkeHub/src/V1/ListPermittedScopesRequest.php b/GkeHub/src/V1/ListPermittedScopesRequest.php new file mode 100644 index 000000000000..d9c4c66e32ed --- /dev/null +++ b/GkeHub/src/V1/ListPermittedScopesRequest.php @@ -0,0 +1,170 @@ +google.cloud.gkehub.v1.ListPermittedScopesRequest + */ +class ListPermittedScopesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent (project and location) where the Scope will be listed. + * Specified in the format `projects/*/locations/*`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. When requesting a 'page' of resources, `page_size` specifies + * number of resources to return. If unspecified or set to 0, all resources + * will be returned. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. Token returned by previous call to `ListPermittedScopes` which + * specifies the position in the list from where to continue listing the + * resources. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The parent (project and location) where the Scope will be listed. + * Specified in the format `projects/*/locations/*`. Please see + * {@see GkeHubClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\GkeHub\V1\ListPermittedScopesRequest + * + * @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 (project and location) where the Scope will be listed. + * Specified in the format `projects/*/locations/*`. + * @type int $page_size + * Optional. When requesting a 'page' of resources, `page_size` specifies + * number of resources to return. If unspecified or set to 0, all resources + * will be returned. + * @type string $page_token + * Optional. Token returned by previous call to `ListPermittedScopes` which + * specifies the position in the list from where to continue listing the + * resources. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gkehub\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent (project and location) where the Scope will be listed. + * Specified in the format `projects/*/locations/*`. + * + * 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 (project and location) where the Scope will be listed. + * Specified in the format `projects/*/locations/*`. + * + * 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. When requesting a 'page' of resources, `page_size` specifies + * number of resources to return. If unspecified or set to 0, all resources + * will be returned. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. When requesting a 'page' of resources, `page_size` specifies + * number of resources to return. If unspecified or set to 0, all resources + * will be returned. + * + * 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. Token returned by previous call to `ListPermittedScopes` which + * specifies the position in the list from where to continue listing the + * resources. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. Token returned by previous call to `ListPermittedScopes` which + * specifies the position in the list from where to continue listing the + * resources. + * + * 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; + } + +} + diff --git a/GkeHub/src/V1/ListPermittedScopesResponse.php b/GkeHub/src/V1/ListPermittedScopesResponse.php new file mode 100644 index 000000000000..2cc7053c4d7a --- /dev/null +++ b/GkeHub/src/V1/ListPermittedScopesResponse.php @@ -0,0 +1,109 @@ +google.cloud.gkehub.v1.ListPermittedScopesResponse + */ +class ListPermittedScopesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of permitted Scopes + * + * Generated from protobuf field repeated .google.cloud.gkehub.v1.Scope scopes = 1; + */ + private $scopes; + /** + * A token to request the next page of resources from the + * `ListPermittedScopes` method. The value of an empty string means + * that there are no more resources to return. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\GkeHub\V1\Scope>|\Google\Protobuf\Internal\RepeatedField $scopes + * The list of permitted Scopes + * @type string $next_page_token + * A token to request the next page of resources from the + * `ListPermittedScopes` method. The value of an empty string means + * that there are no more resources to return. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gkehub\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * The list of permitted Scopes + * + * Generated from protobuf field repeated .google.cloud.gkehub.v1.Scope scopes = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getScopes() + { + return $this->scopes; + } + + /** + * The list of permitted Scopes + * + * Generated from protobuf field repeated .google.cloud.gkehub.v1.Scope scopes = 1; + * @param array<\Google\Cloud\GkeHub\V1\Scope>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setScopes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\GkeHub\V1\Scope::class); + $this->scopes = $arr; + + return $this; + } + + /** + * A token to request the next page of resources from the + * `ListPermittedScopes` method. The value of an empty string means + * that there are no more resources to return. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token to request the next page of resources from the + * `ListPermittedScopes` method. The value of an empty string means + * that there are no more resources to return. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/GkeHub/src/V1/ListScopeNamespacesRequest.php b/GkeHub/src/V1/ListScopeNamespacesRequest.php new file mode 100644 index 000000000000..78d6b756b883 --- /dev/null +++ b/GkeHub/src/V1/ListScopeNamespacesRequest.php @@ -0,0 +1,170 @@ +google.cloud.gkehub.v1.ListScopeNamespacesRequest + */ +class ListScopeNamespacesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent (project and location) where the Features will be + * listed. Specified in the format `projects/*/locations/*/scopes/*`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. When requesting a 'page' of resources, `page_size` specifies + * number of resources to return. If unspecified or set to 0, all resources + * will be returned. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. Token returned by previous call to `ListFeatures` which + * specifies the position in the list from where to continue listing the + * resources. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The parent (project and location) where the Features will be + * listed. Specified in the format `projects/*/locations/*/scopes/*`. Please see + * {@see GkeHubClient::scopeName()} for help formatting this field. + * + * @return \Google\Cloud\GkeHub\V1\ListScopeNamespacesRequest + * + * @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 (project and location) where the Features will be + * listed. Specified in the format `projects/*/locations/*/scopes/*`. + * @type int $page_size + * Optional. When requesting a 'page' of resources, `page_size` specifies + * number of resources to return. If unspecified or set to 0, all resources + * will be returned. + * @type string $page_token + * Optional. Token returned by previous call to `ListFeatures` which + * specifies the position in the list from where to continue listing the + * resources. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gkehub\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent (project and location) where the Features will be + * listed. Specified in the format `projects/*/locations/*/scopes/*`. + * + * 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 (project and location) where the Features will be + * listed. Specified in the format `projects/*/locations/*/scopes/*`. + * + * 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. When requesting a 'page' of resources, `page_size` specifies + * number of resources to return. If unspecified or set to 0, all resources + * will be returned. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. When requesting a 'page' of resources, `page_size` specifies + * number of resources to return. If unspecified or set to 0, all resources + * will be returned. + * + * 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. Token returned by previous call to `ListFeatures` which + * specifies the position in the list from where to continue listing the + * resources. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. Token returned by previous call to `ListFeatures` which + * specifies the position in the list from where to continue listing the + * resources. + * + * 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; + } + +} + diff --git a/GkeHub/src/V1/ListScopeNamespacesResponse.php b/GkeHub/src/V1/ListScopeNamespacesResponse.php new file mode 100644 index 000000000000..aa84bc4d604f --- /dev/null +++ b/GkeHub/src/V1/ListScopeNamespacesResponse.php @@ -0,0 +1,109 @@ +google.cloud.gkehub.v1.ListScopeNamespacesResponse + */ +class ListScopeNamespacesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of fleet namespaces + * + * Generated from protobuf field repeated .google.cloud.gkehub.v1.Namespace scope_namespaces = 1; + */ + private $scope_namespaces; + /** + * A token to request the next page of resources from the + * `ListNamespaces` method. The value of an empty string means + * that there are no more resources to return. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\GkeHub\V1\PBNamespace>|\Google\Protobuf\Internal\RepeatedField $scope_namespaces + * The list of fleet namespaces + * @type string $next_page_token + * A token to request the next page of resources from the + * `ListNamespaces` method. The value of an empty string means + * that there are no more resources to return. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gkehub\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * The list of fleet namespaces + * + * Generated from protobuf field repeated .google.cloud.gkehub.v1.Namespace scope_namespaces = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getScopeNamespaces() + { + return $this->scope_namespaces; + } + + /** + * The list of fleet namespaces + * + * Generated from protobuf field repeated .google.cloud.gkehub.v1.Namespace scope_namespaces = 1; + * @param array<\Google\Cloud\GkeHub\V1\PBNamespace>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setScopeNamespaces($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\GkeHub\V1\PBNamespace::class); + $this->scope_namespaces = $arr; + + return $this; + } + + /** + * A token to request the next page of resources from the + * `ListNamespaces` method. The value of an empty string means + * that there are no more resources to return. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token to request the next page of resources from the + * `ListNamespaces` method. The value of an empty string means + * that there are no more resources to return. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/GkeHub/src/V1/ListScopeRBACRoleBindingsRequest.php b/GkeHub/src/V1/ListScopeRBACRoleBindingsRequest.php new file mode 100644 index 000000000000..b6cb81f007f1 --- /dev/null +++ b/GkeHub/src/V1/ListScopeRBACRoleBindingsRequest.php @@ -0,0 +1,170 @@ +google.cloud.gkehub.v1.ListScopeRBACRoleBindingsRequest + */ +class ListScopeRBACRoleBindingsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent (project and location) where the Features will be + * listed. Specified in the format `projects/*/locations/*/scopes/*`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. When requesting a 'page' of resources, `page_size` specifies + * number of resources to return. If unspecified or set to 0, all resources + * will be returned. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. Token returned by previous call to `ListScopeRBACRoleBindings` + * which specifies the position in the list from where to continue listing the + * resources. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The parent (project and location) where the Features will be + * listed. Specified in the format `projects/*/locations/*/scopes/*`. Please see + * {@see GkeHubClient::scopeName()} for help formatting this field. + * + * @return \Google\Cloud\GkeHub\V1\ListScopeRBACRoleBindingsRequest + * + * @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 (project and location) where the Features will be + * listed. Specified in the format `projects/*/locations/*/scopes/*`. + * @type int $page_size + * Optional. When requesting a 'page' of resources, `page_size` specifies + * number of resources to return. If unspecified or set to 0, all resources + * will be returned. + * @type string $page_token + * Optional. Token returned by previous call to `ListScopeRBACRoleBindings` + * which specifies the position in the list from where to continue listing the + * resources. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gkehub\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent (project and location) where the Features will be + * listed. Specified in the format `projects/*/locations/*/scopes/*`. + * + * 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 (project and location) where the Features will be + * listed. Specified in the format `projects/*/locations/*/scopes/*`. + * + * 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. When requesting a 'page' of resources, `page_size` specifies + * number of resources to return. If unspecified or set to 0, all resources + * will be returned. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. When requesting a 'page' of resources, `page_size` specifies + * number of resources to return. If unspecified or set to 0, all resources + * will be returned. + * + * 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. Token returned by previous call to `ListScopeRBACRoleBindings` + * which specifies the position in the list from where to continue listing the + * resources. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. Token returned by previous call to `ListScopeRBACRoleBindings` + * which specifies the position in the list from where to continue listing the + * resources. + * + * 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; + } + +} + diff --git a/GkeHub/src/V1/ListScopeRBACRoleBindingsResponse.php b/GkeHub/src/V1/ListScopeRBACRoleBindingsResponse.php new file mode 100644 index 000000000000..efe78b890344 --- /dev/null +++ b/GkeHub/src/V1/ListScopeRBACRoleBindingsResponse.php @@ -0,0 +1,109 @@ +google.cloud.gkehub.v1.ListScopeRBACRoleBindingsResponse + */ +class ListScopeRBACRoleBindingsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of Scope RBACRoleBindings. + * + * Generated from protobuf field repeated .google.cloud.gkehub.v1.RBACRoleBinding rbacrolebindings = 1; + */ + private $rbacrolebindings; + /** + * A token to request the next page of resources from the + * `ListScopeRBACRoleBindings` method. The value of an empty string means + * that there are no more resources to return. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\GkeHub\V1\RBACRoleBinding>|\Google\Protobuf\Internal\RepeatedField $rbacrolebindings + * The list of Scope RBACRoleBindings. + * @type string $next_page_token + * A token to request the next page of resources from the + * `ListScopeRBACRoleBindings` method. The value of an empty string means + * that there are no more resources to return. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gkehub\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * The list of Scope RBACRoleBindings. + * + * Generated from protobuf field repeated .google.cloud.gkehub.v1.RBACRoleBinding rbacrolebindings = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRbacrolebindings() + { + return $this->rbacrolebindings; + } + + /** + * The list of Scope RBACRoleBindings. + * + * Generated from protobuf field repeated .google.cloud.gkehub.v1.RBACRoleBinding rbacrolebindings = 1; + * @param array<\Google\Cloud\GkeHub\V1\RBACRoleBinding>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRbacrolebindings($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\GkeHub\V1\RBACRoleBinding::class); + $this->rbacrolebindings = $arr; + + return $this; + } + + /** + * A token to request the next page of resources from the + * `ListScopeRBACRoleBindings` method. The value of an empty string means + * that there are no more resources to return. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token to request the next page of resources from the + * `ListScopeRBACRoleBindings` method. The value of an empty string means + * that there are no more resources to return. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/GkeHub/src/V1/ListScopesRequest.php b/GkeHub/src/V1/ListScopesRequest.php new file mode 100644 index 000000000000..62786ed385c1 --- /dev/null +++ b/GkeHub/src/V1/ListScopesRequest.php @@ -0,0 +1,170 @@ +google.cloud.gkehub.v1.ListScopesRequest + */ +class ListScopesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent (project and location) where the Scope will be listed. + * Specified in the format `projects/*/locations/*`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. When requesting a 'page' of resources, `page_size` specifies + * number of resources to return. If unspecified or set to 0, all resources + * will be returned. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. Token returned by previous call to `ListScopes` which + * specifies the position in the list from where to continue listing the + * resources. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. The parent (project and location) where the Scope will be listed. + * Specified in the format `projects/*/locations/*`. Please see + * {@see GkeHubClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\GkeHub\V1\ListScopesRequest + * + * @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 (project and location) where the Scope will be listed. + * Specified in the format `projects/*/locations/*`. + * @type int $page_size + * Optional. When requesting a 'page' of resources, `page_size` specifies + * number of resources to return. If unspecified or set to 0, all resources + * will be returned. + * @type string $page_token + * Optional. Token returned by previous call to `ListScopes` which + * specifies the position in the list from where to continue listing the + * resources. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gkehub\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent (project and location) where the Scope will be listed. + * Specified in the format `projects/*/locations/*`. + * + * 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 (project and location) where the Scope will be listed. + * Specified in the format `projects/*/locations/*`. + * + * 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. When requesting a 'page' of resources, `page_size` specifies + * number of resources to return. If unspecified or set to 0, all resources + * will be returned. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. When requesting a 'page' of resources, `page_size` specifies + * number of resources to return. If unspecified or set to 0, all resources + * will be returned. + * + * 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. Token returned by previous call to `ListScopes` which + * specifies the position in the list from where to continue listing the + * resources. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. Token returned by previous call to `ListScopes` which + * specifies the position in the list from where to continue listing the + * resources. + * + * 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; + } + +} + diff --git a/GkeHub/src/V1/ListScopesResponse.php b/GkeHub/src/V1/ListScopesResponse.php new file mode 100644 index 000000000000..11f51612af64 --- /dev/null +++ b/GkeHub/src/V1/ListScopesResponse.php @@ -0,0 +1,109 @@ +google.cloud.gkehub.v1.ListScopesResponse + */ +class ListScopesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of Scopes + * + * Generated from protobuf field repeated .google.cloud.gkehub.v1.Scope scopes = 1; + */ + private $scopes; + /** + * A token to request the next page of resources from the + * `ListScopes` method. The value of an empty string means + * that there are no more resources to return. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\GkeHub\V1\Scope>|\Google\Protobuf\Internal\RepeatedField $scopes + * The list of Scopes + * @type string $next_page_token + * A token to request the next page of resources from the + * `ListScopes` method. The value of an empty string means + * that there are no more resources to return. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gkehub\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * The list of Scopes + * + * Generated from protobuf field repeated .google.cloud.gkehub.v1.Scope scopes = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getScopes() + { + return $this->scopes; + } + + /** + * The list of Scopes + * + * Generated from protobuf field repeated .google.cloud.gkehub.v1.Scope scopes = 1; + * @param array<\Google\Cloud\GkeHub\V1\Scope>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setScopes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\GkeHub\V1\Scope::class); + $this->scopes = $arr; + + return $this; + } + + /** + * A token to request the next page of resources from the + * `ListScopes` method. The value of an empty string means + * that there are no more resources to return. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token to request the next page of resources from the + * `ListScopes` method. The value of an empty string means + * that there are no more resources to return. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/GkeHub/src/V1/MembershipBinding.php b/GkeHub/src/V1/MembershipBinding.php new file mode 100644 index 000000000000..b845df157a71 --- /dev/null +++ b/GkeHub/src/V1/MembershipBinding.php @@ -0,0 +1,374 @@ +google.cloud.gkehub.v1.MembershipBinding + */ +class MembershipBinding extends \Google\Protobuf\Internal\Message +{ + /** + * The resource name for the membershipbinding itself + * `projects/{project}/locations/{location}/memberships/{membership}/bindings/{membershipbinding}` + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Output only. Google-generated UUID for this resource. This is unique across + * all membershipbinding resources. If a membershipbinding resource is deleted + * and another resource with the same name is created, it gets a different + * uid. + * + * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $uid = ''; + /** + * Output only. When the membership binding was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. When the membership binding was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Output only. When the membership binding was deleted. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $delete_time = null; + /** + * Output only. State of the membership binding resource. + * + * Generated from protobuf field .google.cloud.gkehub.v1.MembershipBindingLifecycleState state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = null; + /** + * Optional. Labels for this MembershipBinding. + * + * Generated from protobuf field map labels = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + protected $target; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $scope + * A Scope resource name in the format + * `projects/*/locations/*/scopes/*`. + * @type string $name + * The resource name for the membershipbinding itself + * `projects/{project}/locations/{location}/memberships/{membership}/bindings/{membershipbinding}` + * @type string $uid + * Output only. Google-generated UUID for this resource. This is unique across + * all membershipbinding resources. If a membershipbinding resource is deleted + * and another resource with the same name is created, it gets a different + * uid. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. When the membership binding was created. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. When the membership binding was last updated. + * @type \Google\Protobuf\Timestamp $delete_time + * Output only. When the membership binding was deleted. + * @type \Google\Cloud\GkeHub\V1\MembershipBindingLifecycleState $state + * Output only. State of the membership binding resource. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. Labels for this MembershipBinding. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gkehub\V1\Fleet::initOnce(); + parent::__construct($data); + } + + /** + * A Scope resource name in the format + * `projects/*/locations/*/scopes/*`. + * + * Generated from protobuf field string scope = 3 [(.google.api.resource_reference) = { + * @return string + */ + public function getScope() + { + return $this->readOneof(3); + } + + public function hasScope() + { + return $this->hasOneof(3); + } + + /** + * A Scope resource name in the format + * `projects/*/locations/*/scopes/*`. + * + * Generated from protobuf field string scope = 3 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setScope($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * The resource name for the membershipbinding itself + * `projects/{project}/locations/{location}/memberships/{membership}/bindings/{membershipbinding}` + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The resource name for the membershipbinding itself + * `projects/{project}/locations/{location}/memberships/{membership}/bindings/{membershipbinding}` + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. Google-generated UUID for this resource. This is unique across + * all membershipbinding resources. If a membershipbinding resource is deleted + * and another resource with the same name is created, it gets a different + * uid. + * + * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getUid() + { + return $this->uid; + } + + /** + * Output only. Google-generated UUID for this resource. This is unique across + * all membershipbinding resources. If a membershipbinding resource is deleted + * and another resource with the same name is created, it gets a different + * uid. + * + * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setUid($var) + { + GPBUtil::checkString($var, True); + $this->uid = $var; + + return $this; + } + + /** + * Output only. When the membership binding was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.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. When the membership binding was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.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. When the membership binding was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.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. When the membership binding was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.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; + } + + /** + * Output only. When the membership binding was deleted. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getDeleteTime() + { + return $this->delete_time; + } + + public function hasDeleteTime() + { + return isset($this->delete_time); + } + + public function clearDeleteTime() + { + unset($this->delete_time); + } + + /** + * Output only. When the membership binding was deleted. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setDeleteTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->delete_time = $var; + + return $this; + } + + /** + * Output only. State of the membership binding resource. + * + * Generated from protobuf field .google.cloud.gkehub.v1.MembershipBindingLifecycleState state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\GkeHub\V1\MembershipBindingLifecycleState|null + */ + public function getState() + { + return $this->state; + } + + public function hasState() + { + return isset($this->state); + } + + public function clearState() + { + unset($this->state); + } + + /** + * Output only. State of the membership binding resource. + * + * Generated from protobuf field .google.cloud.gkehub.v1.MembershipBindingLifecycleState state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\GkeHub\V1\MembershipBindingLifecycleState $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GkeHub\V1\MembershipBindingLifecycleState::class); + $this->state = $var; + + return $this; + } + + /** + * Optional. Labels for this MembershipBinding. + * + * Generated from protobuf field map labels = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. Labels for this MembershipBinding. + * + * Generated from protobuf field map labels = 9 [(.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; + } + + /** + * @return string + */ + public function getTarget() + { + return $this->whichOneof("target"); + } + +} + diff --git a/GkeHub/src/V1/MembershipBindingLifecycleState.php b/GkeHub/src/V1/MembershipBindingLifecycleState.php new file mode 100644 index 000000000000..268a32dfd8bf --- /dev/null +++ b/GkeHub/src/V1/MembershipBindingLifecycleState.php @@ -0,0 +1,67 @@ +google.cloud.gkehub.v1.MembershipBindingLifecycleState + */ +class MembershipBindingLifecycleState extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The current state of the MembershipBinding resource. + * + * Generated from protobuf field .google.cloud.gkehub.v1.MembershipBindingLifecycleState.Code code = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $code = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $code + * Output only. The current state of the MembershipBinding resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gkehub\V1\Fleet::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The current state of the MembershipBinding resource. + * + * Generated from protobuf field .google.cloud.gkehub.v1.MembershipBindingLifecycleState.Code code = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getCode() + { + return $this->code; + } + + /** + * Output only. The current state of the MembershipBinding resource. + * + * Generated from protobuf field .google.cloud.gkehub.v1.MembershipBindingLifecycleState.Code code = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setCode($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\GkeHub\V1\MembershipBindingLifecycleState\Code::class); + $this->code = $var; + + return $this; + } + +} + diff --git a/GkeHub/src/V1/MembershipBindingLifecycleState/Code.php b/GkeHub/src/V1/MembershipBindingLifecycleState/Code.php new file mode 100644 index 000000000000..e7a5175c94be --- /dev/null +++ b/GkeHub/src/V1/MembershipBindingLifecycleState/Code.php @@ -0,0 +1,76 @@ +google.cloud.gkehub.v1.MembershipBindingLifecycleState.Code + */ +class Code +{ + /** + * The code is not set. + * + * Generated from protobuf enum CODE_UNSPECIFIED = 0; + */ + const CODE_UNSPECIFIED = 0; + /** + * The membershipbinding is being created. + * + * Generated from protobuf enum CREATING = 1; + */ + const CREATING = 1; + /** + * The membershipbinding active. + * + * Generated from protobuf enum READY = 2; + */ + const READY = 2; + /** + * The membershipbinding is being deleted. + * + * Generated from protobuf enum DELETING = 3; + */ + const DELETING = 3; + /** + * The membershipbinding is being updated. + * + * Generated from protobuf enum UPDATING = 4; + */ + const UPDATING = 4; + + private static $valueToName = [ + self::CODE_UNSPECIFIED => 'CODE_UNSPECIFIED', + self::CREATING => 'CREATING', + self::READY => 'READY', + self::DELETING => 'DELETING', + self::UPDATING => 'UPDATING', + ]; + + 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/GkeHub/src/V1/NamespaceLifecycleState.php b/GkeHub/src/V1/NamespaceLifecycleState.php new file mode 100644 index 000000000000..356165d63119 --- /dev/null +++ b/GkeHub/src/V1/NamespaceLifecycleState.php @@ -0,0 +1,67 @@ +google.cloud.gkehub.v1.NamespaceLifecycleState + */ +class NamespaceLifecycleState extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The current state of the Namespace resource. + * + * Generated from protobuf field .google.cloud.gkehub.v1.NamespaceLifecycleState.Code code = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $code = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $code + * Output only. The current state of the Namespace resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gkehub\V1\Fleet::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The current state of the Namespace resource. + * + * Generated from protobuf field .google.cloud.gkehub.v1.NamespaceLifecycleState.Code code = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getCode() + { + return $this->code; + } + + /** + * Output only. The current state of the Namespace resource. + * + * Generated from protobuf field .google.cloud.gkehub.v1.NamespaceLifecycleState.Code code = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setCode($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\GkeHub\V1\NamespaceLifecycleState\Code::class); + $this->code = $var; + + return $this; + } + +} + diff --git a/GkeHub/src/V1/NamespaceLifecycleState/Code.php b/GkeHub/src/V1/NamespaceLifecycleState/Code.php new file mode 100644 index 000000000000..c468f997efbd --- /dev/null +++ b/GkeHub/src/V1/NamespaceLifecycleState/Code.php @@ -0,0 +1,76 @@ +google.cloud.gkehub.v1.NamespaceLifecycleState.Code + */ +class Code +{ + /** + * The code is not set. + * + * Generated from protobuf enum CODE_UNSPECIFIED = 0; + */ + const CODE_UNSPECIFIED = 0; + /** + * The namespace is being created. + * + * Generated from protobuf enum CREATING = 1; + */ + const CREATING = 1; + /** + * The namespace active. + * + * Generated from protobuf enum READY = 2; + */ + const READY = 2; + /** + * The namespace is being deleted. + * + * Generated from protobuf enum DELETING = 3; + */ + const DELETING = 3; + /** + * The namespace is being updated. + * + * Generated from protobuf enum UPDATING = 4; + */ + const UPDATING = 4; + + private static $valueToName = [ + self::CODE_UNSPECIFIED => 'CODE_UNSPECIFIED', + self::CREATING => 'CREATING', + self::READY => 'READY', + self::DELETING => 'DELETING', + self::UPDATING => 'UPDATING', + ]; + + 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/GkeHub/src/V1/OperationMetadata.php b/GkeHub/src/V1/OperationMetadata.php index a09857d77830..0dfdf1677061 100644 --- a/GkeHub/src/V1/OperationMetadata.php +++ b/GkeHub/src/V1/OperationMetadata.php @@ -48,9 +48,10 @@ class OperationMetadata extends \Google\Protobuf\Internal\Message /** * Output only. Identifies whether the user has requested cancellation * of the operation. Operations that have successfully been cancelled - * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. + * have + * [google.longrunning.Operation.error][google.longrunning.Operation.error] + * value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, + * corresponding to `Code.CANCELLED`. * * Generated from protobuf field bool cancel_requested = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ @@ -81,9 +82,10 @@ class OperationMetadata extends \Google\Protobuf\Internal\Message * @type bool $cancel_requested * Output only. Identifies whether the user has requested cancellation * of the operation. Operations that have successfully been cancelled - * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. + * have + * [google.longrunning.Operation.error][google.longrunning.Operation.error] + * value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, + * corresponding to `Code.CANCELLED`. * @type string $api_version * Output only. API version used to start the operation. * } @@ -246,9 +248,10 @@ public function setStatusDetail($var) /** * Output only. Identifies whether the user has requested cancellation * of the operation. Operations that have successfully been cancelled - * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. + * have + * [google.longrunning.Operation.error][google.longrunning.Operation.error] + * value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, + * corresponding to `Code.CANCELLED`. * * Generated from protobuf field bool cancel_requested = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @return bool @@ -261,9 +264,10 @@ public function getCancelRequested() /** * Output only. Identifies whether the user has requested cancellation * of the operation. Operations that have successfully been cancelled - * have [Operation.error][] value with a - * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - * `Code.CANCELLED`. + * have + * [google.longrunning.Operation.error][google.longrunning.Operation.error] + * value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, + * corresponding to `Code.CANCELLED`. * * Generated from protobuf field bool cancel_requested = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @param bool $var diff --git a/GkeHub/src/V1/PBNamespace.php b/GkeHub/src/V1/PBNamespace.php new file mode 100644 index 000000000000..2f14f6436c88 --- /dev/null +++ b/GkeHub/src/V1/PBNamespace.php @@ -0,0 +1,407 @@ +google.cloud.gkehub.v1.Namespace + */ +class PBNamespace extends \Google\Protobuf\Internal\Message +{ + /** + * The resource name for the namespace + * `projects/{project}/locations/{location}/namespaces/{namespace}` + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Output only. Google-generated UUID for this resource. This is unique across + * all namespace resources. If a namespace resource is deleted and another + * resource with the same name is created, it gets a different uid. + * + * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $uid = ''; + /** + * Output only. When the namespace was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. When the namespace was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Output only. When the namespace was deleted. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $delete_time = null; + /** + * Output only. State of the namespace resource. + * + * Generated from protobuf field .google.cloud.gkehub.v1.NamespaceLifecycleState state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = null; + /** + * Required. Scope associated with the namespace + * + * Generated from protobuf field string scope = 8 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $scope = ''; + /** + * Optional. Namespace-level cluster namespace labels. These labels are + * applied to the related namespace of the member clusters bound to the parent + * Scope. Scope-level labels (`namespace_labels` in the Fleet Scope + * resource) take precedence over Namespace-level labels if they share + * a key. Keys and values must be Kubernetes-conformant. + * + * Generated from protobuf field map namespace_labels = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $namespace_labels; + /** + * Optional. Labels for this Namespace. + * + * Generated from protobuf field map labels = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The resource name for the namespace + * `projects/{project}/locations/{location}/namespaces/{namespace}` + * @type string $uid + * Output only. Google-generated UUID for this resource. This is unique across + * all namespace resources. If a namespace resource is deleted and another + * resource with the same name is created, it gets a different uid. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. When the namespace was created. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. When the namespace was last updated. + * @type \Google\Protobuf\Timestamp $delete_time + * Output only. When the namespace was deleted. + * @type \Google\Cloud\GkeHub\V1\NamespaceLifecycleState $state + * Output only. State of the namespace resource. + * @type string $scope + * Required. Scope associated with the namespace + * @type array|\Google\Protobuf\Internal\MapField $namespace_labels + * Optional. Namespace-level cluster namespace labels. These labels are + * applied to the related namespace of the member clusters bound to the parent + * Scope. Scope-level labels (`namespace_labels` in the Fleet Scope + * resource) take precedence over Namespace-level labels if they share + * a key. Keys and values must be Kubernetes-conformant. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. Labels for this Namespace. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gkehub\V1\Fleet::initOnce(); + parent::__construct($data); + } + + /** + * The resource name for the namespace + * `projects/{project}/locations/{location}/namespaces/{namespace}` + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The resource name for the namespace + * `projects/{project}/locations/{location}/namespaces/{namespace}` + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. Google-generated UUID for this resource. This is unique across + * all namespace resources. If a namespace resource is deleted and another + * resource with the same name is created, it gets a different uid. + * + * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getUid() + { + return $this->uid; + } + + /** + * Output only. Google-generated UUID for this resource. This is unique across + * all namespace resources. If a namespace resource is deleted and another + * resource with the same name is created, it gets a different uid. + * + * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setUid($var) + { + GPBUtil::checkString($var, True); + $this->uid = $var; + + return $this; + } + + /** + * Output only. When the namespace was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. When the namespace was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. When the namespace was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. When the namespace was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Output only. When the namespace was deleted. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getDeleteTime() + { + return $this->delete_time; + } + + public function hasDeleteTime() + { + return isset($this->delete_time); + } + + public function clearDeleteTime() + { + unset($this->delete_time); + } + + /** + * Output only. When the namespace was deleted. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setDeleteTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->delete_time = $var; + + return $this; + } + + /** + * Output only. State of the namespace resource. + * + * Generated from protobuf field .google.cloud.gkehub.v1.NamespaceLifecycleState state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\GkeHub\V1\NamespaceLifecycleState|null + */ + public function getState() + { + return $this->state; + } + + public function hasState() + { + return isset($this->state); + } + + public function clearState() + { + unset($this->state); + } + + /** + * Output only. State of the namespace resource. + * + * Generated from protobuf field .google.cloud.gkehub.v1.NamespaceLifecycleState state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\GkeHub\V1\NamespaceLifecycleState $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GkeHub\V1\NamespaceLifecycleState::class); + $this->state = $var; + + return $this; + } + + /** + * Required. Scope associated with the namespace + * + * Generated from protobuf field string scope = 8 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getScope() + { + return $this->scope; + } + + /** + * Required. Scope associated with the namespace + * + * Generated from protobuf field string scope = 8 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setScope($var) + { + GPBUtil::checkString($var, True); + $this->scope = $var; + + return $this; + } + + /** + * Optional. Namespace-level cluster namespace labels. These labels are + * applied to the related namespace of the member clusters bound to the parent + * Scope. Scope-level labels (`namespace_labels` in the Fleet Scope + * resource) take precedence over Namespace-level labels if they share + * a key. Keys and values must be Kubernetes-conformant. + * + * Generated from protobuf field map namespace_labels = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getNamespaceLabels() + { + return $this->namespace_labels; + } + + /** + * Optional. Namespace-level cluster namespace labels. These labels are + * applied to the related namespace of the member clusters bound to the parent + * Scope. Scope-level labels (`namespace_labels` in the Fleet Scope + * resource) take precedence over Namespace-level labels if they share + * a key. Keys and values must be Kubernetes-conformant. + * + * Generated from protobuf field map namespace_labels = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setNamespaceLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->namespace_labels = $arr; + + return $this; + } + + /** + * Optional. Labels for this Namespace. + * + * Generated from protobuf field map labels = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. Labels for this Namespace. + * + * Generated from protobuf field map labels = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + +} + diff --git a/GkeHub/src/V1/RBACRoleBinding.php b/GkeHub/src/V1/RBACRoleBinding.php new file mode 100644 index 000000000000..dcc8783e0510 --- /dev/null +++ b/GkeHub/src/V1/RBACRoleBinding.php @@ -0,0 +1,453 @@ +google.cloud.gkehub.v1.RBACRoleBinding + */ +class RBACRoleBinding extends \Google\Protobuf\Internal\Message +{ + /** + * The resource name for the rbacrolebinding + * `projects/{project}/locations/{location}/scopes/{scope}/rbacrolebindings/{rbacrolebinding}` + * or + * `projects/{project}/locations/{location}/memberships/{membership}/rbacrolebindings/{rbacrolebinding}` + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Output only. Google-generated UUID for this resource. This is unique across + * all rbacrolebinding resources. If a rbacrolebinding resource is deleted and + * another resource with the same name is created, it gets a different uid. + * + * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $uid = ''; + /** + * Output only. When the rbacrolebinding was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. When the rbacrolebinding was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Output only. When the rbacrolebinding was deleted. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $delete_time = null; + /** + * Output only. State of the rbacrolebinding resource. + * + * Generated from protobuf field .google.cloud.gkehub.v1.RBACRoleBindingLifecycleState state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = null; + /** + * Required. Role to bind to the principal + * + * Generated from protobuf field .google.cloud.gkehub.v1.RBACRoleBinding.Role role = 9 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $role = null; + /** + * Optional. Labels for this RBACRolebinding. + * + * Generated from protobuf field map labels = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + protected $principal; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $user + * user is the name of the user as seen by the kubernetes cluster, example + * "alice" or "alice@domain.tld" + * @type string $group + * group is the group, as seen by the kubernetes cluster. + * @type string $name + * The resource name for the rbacrolebinding + * `projects/{project}/locations/{location}/scopes/{scope}/rbacrolebindings/{rbacrolebinding}` + * or + * `projects/{project}/locations/{location}/memberships/{membership}/rbacrolebindings/{rbacrolebinding}` + * @type string $uid + * Output only. Google-generated UUID for this resource. This is unique across + * all rbacrolebinding resources. If a rbacrolebinding resource is deleted and + * another resource with the same name is created, it gets a different uid. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. When the rbacrolebinding was created. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. When the rbacrolebinding was last updated. + * @type \Google\Protobuf\Timestamp $delete_time + * Output only. When the rbacrolebinding was deleted. + * @type \Google\Cloud\GkeHub\V1\RBACRoleBindingLifecycleState $state + * Output only. State of the rbacrolebinding resource. + * @type \Google\Cloud\GkeHub\V1\RBACRoleBinding\Role $role + * Required. Role to bind to the principal + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. Labels for this RBACRolebinding. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gkehub\V1\Fleet::initOnce(); + parent::__construct($data); + } + + /** + * user is the name of the user as seen by the kubernetes cluster, example + * "alice" or "alice@domain.tld" + * + * Generated from protobuf field string user = 7; + * @return string + */ + public function getUser() + { + return $this->readOneof(7); + } + + public function hasUser() + { + return $this->hasOneof(7); + } + + /** + * user is the name of the user as seen by the kubernetes cluster, example + * "alice" or "alice@domain.tld" + * + * Generated from protobuf field string user = 7; + * @param string $var + * @return $this + */ + public function setUser($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(7, $var); + + return $this; + } + + /** + * group is the group, as seen by the kubernetes cluster. + * + * Generated from protobuf field string group = 8; + * @return string + */ + public function getGroup() + { + return $this->readOneof(8); + } + + public function hasGroup() + { + return $this->hasOneof(8); + } + + /** + * group is the group, as seen by the kubernetes cluster. + * + * Generated from protobuf field string group = 8; + * @param string $var + * @return $this + */ + public function setGroup($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(8, $var); + + return $this; + } + + /** + * The resource name for the rbacrolebinding + * `projects/{project}/locations/{location}/scopes/{scope}/rbacrolebindings/{rbacrolebinding}` + * or + * `projects/{project}/locations/{location}/memberships/{membership}/rbacrolebindings/{rbacrolebinding}` + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The resource name for the rbacrolebinding + * `projects/{project}/locations/{location}/scopes/{scope}/rbacrolebindings/{rbacrolebinding}` + * or + * `projects/{project}/locations/{location}/memberships/{membership}/rbacrolebindings/{rbacrolebinding}` + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. Google-generated UUID for this resource. This is unique across + * all rbacrolebinding resources. If a rbacrolebinding resource is deleted and + * another resource with the same name is created, it gets a different uid. + * + * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getUid() + { + return $this->uid; + } + + /** + * Output only. Google-generated UUID for this resource. This is unique across + * all rbacrolebinding resources. If a rbacrolebinding resource is deleted and + * another resource with the same name is created, it gets a different uid. + * + * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setUid($var) + { + GPBUtil::checkString($var, True); + $this->uid = $var; + + return $this; + } + + /** + * Output only. When the rbacrolebinding was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. When the rbacrolebinding was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. When the rbacrolebinding was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. When the rbacrolebinding was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Output only. When the rbacrolebinding was deleted. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getDeleteTime() + { + return $this->delete_time; + } + + public function hasDeleteTime() + { + return isset($this->delete_time); + } + + public function clearDeleteTime() + { + unset($this->delete_time); + } + + /** + * Output only. When the rbacrolebinding was deleted. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setDeleteTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->delete_time = $var; + + return $this; + } + + /** + * Output only. State of the rbacrolebinding resource. + * + * Generated from protobuf field .google.cloud.gkehub.v1.RBACRoleBindingLifecycleState state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\GkeHub\V1\RBACRoleBindingLifecycleState|null + */ + public function getState() + { + return $this->state; + } + + public function hasState() + { + return isset($this->state); + } + + public function clearState() + { + unset($this->state); + } + + /** + * Output only. State of the rbacrolebinding resource. + * + * Generated from protobuf field .google.cloud.gkehub.v1.RBACRoleBindingLifecycleState state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\GkeHub\V1\RBACRoleBindingLifecycleState $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GkeHub\V1\RBACRoleBindingLifecycleState::class); + $this->state = $var; + + return $this; + } + + /** + * Required. Role to bind to the principal + * + * Generated from protobuf field .google.cloud.gkehub.v1.RBACRoleBinding.Role role = 9 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\GkeHub\V1\RBACRoleBinding\Role|null + */ + public function getRole() + { + return $this->role; + } + + public function hasRole() + { + return isset($this->role); + } + + public function clearRole() + { + unset($this->role); + } + + /** + * Required. Role to bind to the principal + * + * Generated from protobuf field .google.cloud.gkehub.v1.RBACRoleBinding.Role role = 9 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\GkeHub\V1\RBACRoleBinding\Role $var + * @return $this + */ + public function setRole($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GkeHub\V1\RBACRoleBinding\Role::class); + $this->role = $var; + + return $this; + } + + /** + * Optional. Labels for this RBACRolebinding. + * + * Generated from protobuf field map labels = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. Labels for this RBACRolebinding. + * + * Generated from protobuf field map labels = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * @return string + */ + public function getPrincipal() + { + return $this->whichOneof("principal"); + } + +} + diff --git a/GkeHub/src/V1/RBACRoleBinding/Role.php b/GkeHub/src/V1/RBACRoleBinding/Role.php new file mode 100644 index 000000000000..44f6fc98ff50 --- /dev/null +++ b/GkeHub/src/V1/RBACRoleBinding/Role.php @@ -0,0 +1,106 @@ +google.cloud.gkehub.v1.RBACRoleBinding.Role + */ +class Role extends \Google\Protobuf\Internal\Message +{ + /** + * predefined_role is the Kubernetes default role to use + * + * Generated from protobuf field .google.cloud.gkehub.v1.RBACRoleBinding.Role.PredefinedRoles predefined_role = 1; + */ + protected $predefined_role = 0; + /** + * Optional. custom_role is the name of a custom KubernetesClusterRole to + * use. + * + * Generated from protobuf field string custom_role = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $custom_role = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $predefined_role + * predefined_role is the Kubernetes default role to use + * @type string $custom_role + * Optional. custom_role is the name of a custom KubernetesClusterRole to + * use. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gkehub\V1\Fleet::initOnce(); + parent::__construct($data); + } + + /** + * predefined_role is the Kubernetes default role to use + * + * Generated from protobuf field .google.cloud.gkehub.v1.RBACRoleBinding.Role.PredefinedRoles predefined_role = 1; + * @return int + */ + public function getPredefinedRole() + { + return $this->predefined_role; + } + + /** + * predefined_role is the Kubernetes default role to use + * + * Generated from protobuf field .google.cloud.gkehub.v1.RBACRoleBinding.Role.PredefinedRoles predefined_role = 1; + * @param int $var + * @return $this + */ + public function setPredefinedRole($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\GkeHub\V1\RBACRoleBinding\Role\PredefinedRoles::class); + $this->predefined_role = $var; + + return $this; + } + + /** + * Optional. custom_role is the name of a custom KubernetesClusterRole to + * use. + * + * Generated from protobuf field string custom_role = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getCustomRole() + { + return $this->custom_role; + } + + /** + * Optional. custom_role is the name of a custom KubernetesClusterRole to + * use. + * + * Generated from protobuf field string custom_role = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setCustomRole($var) + { + GPBUtil::checkString($var, True); + $this->custom_role = $var; + + return $this; + } + +} + + diff --git a/GkeHub/src/V1/RBACRoleBinding/Role/PredefinedRoles.php b/GkeHub/src/V1/RBACRoleBinding/Role/PredefinedRoles.php new file mode 100644 index 000000000000..5033b7af4f28 --- /dev/null +++ b/GkeHub/src/V1/RBACRoleBinding/Role/PredefinedRoles.php @@ -0,0 +1,77 @@ +google.cloud.gkehub.v1.RBACRoleBinding.Role.PredefinedRoles + */ +class PredefinedRoles +{ + /** + * UNKNOWN + * + * Generated from protobuf enum UNKNOWN = 0; + */ + const UNKNOWN = 0; + /** + * ADMIN has EDIT and RBAC permissions + * + * Generated from protobuf enum ADMIN = 1; + */ + const ADMIN = 1; + /** + * EDIT can edit all resources except RBAC + * + * Generated from protobuf enum EDIT = 2; + */ + const EDIT = 2; + /** + * VIEW can only read resources + * + * Generated from protobuf enum VIEW = 3; + */ + const VIEW = 3; + /** + * ANTHOS_SUPPORT gives Google Support read-only access to a number of + * cluster resources. + * + * Generated from protobuf enum ANTHOS_SUPPORT = 4; + */ + const ANTHOS_SUPPORT = 4; + + private static $valueToName = [ + self::UNKNOWN => 'UNKNOWN', + self::ADMIN => 'ADMIN', + self::EDIT => 'EDIT', + self::VIEW => 'VIEW', + self::ANTHOS_SUPPORT => 'ANTHOS_SUPPORT', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/GkeHub/src/V1/RBACRoleBindingLifecycleState.php b/GkeHub/src/V1/RBACRoleBindingLifecycleState.php new file mode 100644 index 000000000000..7a36415506a4 --- /dev/null +++ b/GkeHub/src/V1/RBACRoleBindingLifecycleState.php @@ -0,0 +1,68 @@ +google.cloud.gkehub.v1.RBACRoleBindingLifecycleState + */ +class RBACRoleBindingLifecycleState extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The current state of the rbacrolebinding resource. + * + * Generated from protobuf field .google.cloud.gkehub.v1.RBACRoleBindingLifecycleState.Code code = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $code = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $code + * Output only. The current state of the rbacrolebinding resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gkehub\V1\Fleet::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The current state of the rbacrolebinding resource. + * + * Generated from protobuf field .google.cloud.gkehub.v1.RBACRoleBindingLifecycleState.Code code = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getCode() + { + return $this->code; + } + + /** + * Output only. The current state of the rbacrolebinding resource. + * + * Generated from protobuf field .google.cloud.gkehub.v1.RBACRoleBindingLifecycleState.Code code = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setCode($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\GkeHub\V1\RBACRoleBindingLifecycleState\Code::class); + $this->code = $var; + + return $this; + } + +} + diff --git a/GkeHub/src/V1/RBACRoleBindingLifecycleState/Code.php b/GkeHub/src/V1/RBACRoleBindingLifecycleState/Code.php new file mode 100644 index 000000000000..ce97a3194265 --- /dev/null +++ b/GkeHub/src/V1/RBACRoleBindingLifecycleState/Code.php @@ -0,0 +1,76 @@ +google.cloud.gkehub.v1.RBACRoleBindingLifecycleState.Code + */ +class Code +{ + /** + * The code is not set. + * + * Generated from protobuf enum CODE_UNSPECIFIED = 0; + */ + const CODE_UNSPECIFIED = 0; + /** + * The rbacrolebinding is being created. + * + * Generated from protobuf enum CREATING = 1; + */ + const CREATING = 1; + /** + * The rbacrolebinding active. + * + * Generated from protobuf enum READY = 2; + */ + const READY = 2; + /** + * The rbacrolebinding is being deleted. + * + * Generated from protobuf enum DELETING = 3; + */ + const DELETING = 3; + /** + * The rbacrolebinding is being updated. + * + * Generated from protobuf enum UPDATING = 4; + */ + const UPDATING = 4; + + private static $valueToName = [ + self::CODE_UNSPECIFIED => 'CODE_UNSPECIFIED', + self::CREATING => 'CREATING', + self::READY => 'READY', + self::DELETING => 'DELETING', + self::UPDATING => 'UPDATING', + ]; + + 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/GkeHub/src/V1/Scope.php b/GkeHub/src/V1/Scope.php new file mode 100644 index 000000000000..ecdfc81637f4 --- /dev/null +++ b/GkeHub/src/V1/Scope.php @@ -0,0 +1,373 @@ +google.cloud.gkehub.v1.Scope + */ +class Scope extends \Google\Protobuf\Internal\Message +{ + /** + * The resource name for the scope + * `projects/{project}/locations/{location}/scopes/{scope}` + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Output only. Google-generated UUID for this resource. This is unique across + * all scope resources. If a scope resource is deleted and another resource + * with the same name is created, it gets a different uid. + * + * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $uid = ''; + /** + * Output only. When the scope was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. When the scope was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Output only. When the scope was deleted. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $delete_time = null; + /** + * Output only. State of the scope resource. + * + * Generated from protobuf field .google.cloud.gkehub.v1.ScopeLifecycleState state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = null; + /** + * Optional. Scope-level cluster namespace labels. For the member clusters + * bound to the Scope, these labels are applied to each namespace under the + * Scope. Scope-level labels take precedence over Namespace-level + * labels (`namespace_labels` in the Fleet Namespace resource) if they + * share a key. Keys and values must be Kubernetes-conformant. + * + * Generated from protobuf field map namespace_labels = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $namespace_labels; + /** + * Optional. Labels for this Scope. + * + * Generated from protobuf field map labels = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The resource name for the scope + * `projects/{project}/locations/{location}/scopes/{scope}` + * @type string $uid + * Output only. Google-generated UUID for this resource. This is unique across + * all scope resources. If a scope resource is deleted and another resource + * with the same name is created, it gets a different uid. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. When the scope was created. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. When the scope was last updated. + * @type \Google\Protobuf\Timestamp $delete_time + * Output only. When the scope was deleted. + * @type \Google\Cloud\GkeHub\V1\ScopeLifecycleState $state + * Output only. State of the scope resource. + * @type array|\Google\Protobuf\Internal\MapField $namespace_labels + * Optional. Scope-level cluster namespace labels. For the member clusters + * bound to the Scope, these labels are applied to each namespace under the + * Scope. Scope-level labels take precedence over Namespace-level + * labels (`namespace_labels` in the Fleet Namespace resource) if they + * share a key. Keys and values must be Kubernetes-conformant. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. Labels for this Scope. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gkehub\V1\Fleet::initOnce(); + parent::__construct($data); + } + + /** + * The resource name for the scope + * `projects/{project}/locations/{location}/scopes/{scope}` + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The resource name for the scope + * `projects/{project}/locations/{location}/scopes/{scope}` + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. Google-generated UUID for this resource. This is unique across + * all scope resources. If a scope resource is deleted and another resource + * with the same name is created, it gets a different uid. + * + * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getUid() + { + return $this->uid; + } + + /** + * Output only. Google-generated UUID for this resource. This is unique across + * all scope resources. If a scope resource is deleted and another resource + * with the same name is created, it gets a different uid. + * + * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setUid($var) + { + GPBUtil::checkString($var, True); + $this->uid = $var; + + return $this; + } + + /** + * Output only. When the scope was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. When the scope was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. When the scope was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. When the scope was last updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Output only. When the scope was deleted. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getDeleteTime() + { + return $this->delete_time; + } + + public function hasDeleteTime() + { + return isset($this->delete_time); + } + + public function clearDeleteTime() + { + unset($this->delete_time); + } + + /** + * Output only. When the scope was deleted. + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setDeleteTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->delete_time = $var; + + return $this; + } + + /** + * Output only. State of the scope resource. + * + * Generated from protobuf field .google.cloud.gkehub.v1.ScopeLifecycleState state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\GkeHub\V1\ScopeLifecycleState|null + */ + public function getState() + { + return $this->state; + } + + public function hasState() + { + return isset($this->state); + } + + public function clearState() + { + unset($this->state); + } + + /** + * Output only. State of the scope resource. + * + * Generated from protobuf field .google.cloud.gkehub.v1.ScopeLifecycleState state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\GkeHub\V1\ScopeLifecycleState $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GkeHub\V1\ScopeLifecycleState::class); + $this->state = $var; + + return $this; + } + + /** + * Optional. Scope-level cluster namespace labels. For the member clusters + * bound to the Scope, these labels are applied to each namespace under the + * Scope. Scope-level labels take precedence over Namespace-level + * labels (`namespace_labels` in the Fleet Namespace resource) if they + * share a key. Keys and values must be Kubernetes-conformant. + * + * Generated from protobuf field map namespace_labels = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getNamespaceLabels() + { + return $this->namespace_labels; + } + + /** + * Optional. Scope-level cluster namespace labels. For the member clusters + * bound to the Scope, these labels are applied to each namespace under the + * Scope. Scope-level labels take precedence over Namespace-level + * labels (`namespace_labels` in the Fleet Namespace resource) if they + * share a key. Keys and values must be Kubernetes-conformant. + * + * Generated from protobuf field map namespace_labels = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setNamespaceLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->namespace_labels = $arr; + + return $this; + } + + /** + * Optional. Labels for this Scope. + * + * Generated from protobuf field map labels = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. Labels for this Scope. + * + * Generated from protobuf field map labels = 9 [(.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; + } + +} + diff --git a/GkeHub/src/V1/ScopeFeatureSpec.php b/GkeHub/src/V1/ScopeFeatureSpec.php new file mode 100644 index 000000000000..c40b81a5b8a3 --- /dev/null +++ b/GkeHub/src/V1/ScopeFeatureSpec.php @@ -0,0 +1,33 @@ +google.cloud.gkehub.v1.ScopeFeatureSpec + */ +class ScopeFeatureSpec extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gkehub\V1\Feature::initOnce(); + parent::__construct($data); + } + +} + diff --git a/GkeHub/src/V1/ScopeFeatureState.php b/GkeHub/src/V1/ScopeFeatureState.php new file mode 100644 index 000000000000..7e86a6076fd2 --- /dev/null +++ b/GkeHub/src/V1/ScopeFeatureState.php @@ -0,0 +1,77 @@ +google.cloud.gkehub.v1.ScopeFeatureState + */ +class ScopeFeatureState extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The "running state" of the Feature in this Scope. + * + * Generated from protobuf field .google.cloud.gkehub.v1.FeatureState state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\GkeHub\V1\FeatureState $state + * Output only. The "running state" of the Feature in this Scope. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gkehub\V1\Feature::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The "running state" of the Feature in this Scope. + * + * Generated from protobuf field .google.cloud.gkehub.v1.FeatureState state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\GkeHub\V1\FeatureState|null + */ + public function getState() + { + return $this->state; + } + + public function hasState() + { + return isset($this->state); + } + + public function clearState() + { + unset($this->state); + } + + /** + * Output only. The "running state" of the Feature in this Scope. + * + * Generated from protobuf field .google.cloud.gkehub.v1.FeatureState state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\GkeHub\V1\FeatureState $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GkeHub\V1\FeatureState::class); + $this->state = $var; + + return $this; + } + +} + diff --git a/GkeHub/src/V1/ScopeLifecycleState.php b/GkeHub/src/V1/ScopeLifecycleState.php new file mode 100644 index 000000000000..156752d228a3 --- /dev/null +++ b/GkeHub/src/V1/ScopeLifecycleState.php @@ -0,0 +1,67 @@ +google.cloud.gkehub.v1.ScopeLifecycleState + */ +class ScopeLifecycleState extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The current state of the scope resource. + * + * Generated from protobuf field .google.cloud.gkehub.v1.ScopeLifecycleState.Code code = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $code = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $code + * Output only. The current state of the scope resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gkehub\V1\Fleet::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The current state of the scope resource. + * + * Generated from protobuf field .google.cloud.gkehub.v1.ScopeLifecycleState.Code code = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getCode() + { + return $this->code; + } + + /** + * Output only. The current state of the scope resource. + * + * Generated from protobuf field .google.cloud.gkehub.v1.ScopeLifecycleState.Code code = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setCode($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\GkeHub\V1\ScopeLifecycleState\Code::class); + $this->code = $var; + + return $this; + } + +} + diff --git a/GkeHub/src/V1/ScopeLifecycleState/Code.php b/GkeHub/src/V1/ScopeLifecycleState/Code.php new file mode 100644 index 000000000000..ee65364d7bf5 --- /dev/null +++ b/GkeHub/src/V1/ScopeLifecycleState/Code.php @@ -0,0 +1,76 @@ +google.cloud.gkehub.v1.ScopeLifecycleState.Code + */ +class Code +{ + /** + * The code is not set. + * + * Generated from protobuf enum CODE_UNSPECIFIED = 0; + */ + const CODE_UNSPECIFIED = 0; + /** + * The scope is being created. + * + * Generated from protobuf enum CREATING = 1; + */ + const CREATING = 1; + /** + * The scope active. + * + * Generated from protobuf enum READY = 2; + */ + const READY = 2; + /** + * The scope is being deleted. + * + * Generated from protobuf enum DELETING = 3; + */ + const DELETING = 3; + /** + * The scope is being updated. + * + * Generated from protobuf enum UPDATING = 4; + */ + const UPDATING = 4; + + private static $valueToName = [ + self::CODE_UNSPECIFIED => 'CODE_UNSPECIFIED', + self::CREATING => 'CREATING', + self::READY => 'READY', + self::DELETING => 'DELETING', + self::UPDATING => 'UPDATING', + ]; + + 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/GkeHub/src/V1/SecurityPostureConfig.php b/GkeHub/src/V1/SecurityPostureConfig.php new file mode 100644 index 000000000000..fd91e6b2887e --- /dev/null +++ b/GkeHub/src/V1/SecurityPostureConfig.php @@ -0,0 +1,102 @@ +google.cloud.gkehub.v1.SecurityPostureConfig + */ +class SecurityPostureConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Sets which mode to use for Security Posture features. + * + * Generated from protobuf field .google.cloud.gkehub.v1.SecurityPostureConfig.Mode mode = 1; + */ + protected $mode = 0; + /** + * Sets which mode to use for vulnerability scanning. + * + * Generated from protobuf field .google.cloud.gkehub.v1.SecurityPostureConfig.VulnerabilityMode vulnerability_mode = 2; + */ + protected $vulnerability_mode = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $mode + * Sets which mode to use for Security Posture features. + * @type int $vulnerability_mode + * Sets which mode to use for vulnerability scanning. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gkehub\V1\Fleet::initOnce(); + parent::__construct($data); + } + + /** + * Sets which mode to use for Security Posture features. + * + * Generated from protobuf field .google.cloud.gkehub.v1.SecurityPostureConfig.Mode mode = 1; + * @return int + */ + public function getMode() + { + return $this->mode; + } + + /** + * Sets which mode to use for Security Posture features. + * + * Generated from protobuf field .google.cloud.gkehub.v1.SecurityPostureConfig.Mode mode = 1; + * @param int $var + * @return $this + */ + public function setMode($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\GkeHub\V1\SecurityPostureConfig\Mode::class); + $this->mode = $var; + + return $this; + } + + /** + * Sets which mode to use for vulnerability scanning. + * + * Generated from protobuf field .google.cloud.gkehub.v1.SecurityPostureConfig.VulnerabilityMode vulnerability_mode = 2; + * @return int + */ + public function getVulnerabilityMode() + { + return $this->vulnerability_mode; + } + + /** + * Sets which mode to use for vulnerability scanning. + * + * Generated from protobuf field .google.cloud.gkehub.v1.SecurityPostureConfig.VulnerabilityMode vulnerability_mode = 2; + * @param int $var + * @return $this + */ + public function setVulnerabilityMode($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\GkeHub\V1\SecurityPostureConfig\VulnerabilityMode::class); + $this->vulnerability_mode = $var; + + return $this; + } + +} + diff --git a/GkeHub/src/V1/SecurityPostureConfig/Mode.php b/GkeHub/src/V1/SecurityPostureConfig/Mode.php new file mode 100644 index 000000000000..39ab3e6ce16f --- /dev/null +++ b/GkeHub/src/V1/SecurityPostureConfig/Mode.php @@ -0,0 +1,69 @@ +google.cloud.gkehub.v1.SecurityPostureConfig.Mode + */ +class Mode +{ + /** + * Default value not specified. + * + * Generated from protobuf enum MODE_UNSPECIFIED = 0; + */ + const MODE_UNSPECIFIED = 0; + /** + * Disables Security Posture features on the cluster. + * + * Generated from protobuf enum DISABLED = 1; + */ + const DISABLED = 1; + /** + * Applies Security Posture features on the cluster. + * + * Generated from protobuf enum BASIC = 2; + */ + const BASIC = 2; + /** + * Applies the Security Posture off cluster Enterprise level features. + * + * Generated from protobuf enum ENTERPRISE = 3; + */ + const ENTERPRISE = 3; + + private static $valueToName = [ + self::MODE_UNSPECIFIED => 'MODE_UNSPECIFIED', + self::DISABLED => 'DISABLED', + self::BASIC => 'BASIC', + self::ENTERPRISE => 'ENTERPRISE', + ]; + + 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/GkeHub/src/V1/SecurityPostureConfig/VulnerabilityMode.php b/GkeHub/src/V1/SecurityPostureConfig/VulnerabilityMode.php new file mode 100644 index 000000000000..ca629d51a8ea --- /dev/null +++ b/GkeHub/src/V1/SecurityPostureConfig/VulnerabilityMode.php @@ -0,0 +1,70 @@ +google.cloud.gkehub.v1.SecurityPostureConfig.VulnerabilityMode + */ +class VulnerabilityMode +{ + /** + * Default value not specified. + * + * Generated from protobuf enum VULNERABILITY_MODE_UNSPECIFIED = 0; + */ + const VULNERABILITY_MODE_UNSPECIFIED = 0; + /** + * Disables vulnerability scanning on the cluster. + * + * Generated from protobuf enum VULNERABILITY_DISABLED = 1; + */ + const VULNERABILITY_DISABLED = 1; + /** + * Applies basic vulnerability scanning on the cluster. + * + * Generated from protobuf enum VULNERABILITY_BASIC = 2; + */ + const VULNERABILITY_BASIC = 2; + /** + * Applies the Security Posture's vulnerability on cluster Enterprise level + * features. + * + * Generated from protobuf enum VULNERABILITY_ENTERPRISE = 3; + */ + const VULNERABILITY_ENTERPRISE = 3; + + private static $valueToName = [ + self::VULNERABILITY_MODE_UNSPECIFIED => 'VULNERABILITY_MODE_UNSPECIFIED', + self::VULNERABILITY_DISABLED => 'VULNERABILITY_DISABLED', + self::VULNERABILITY_BASIC => 'VULNERABILITY_BASIC', + self::VULNERABILITY_ENTERPRISE => 'VULNERABILITY_ENTERPRISE', + ]; + + 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/GkeHub/src/V1/UpdateFeatureRequest.php b/GkeHub/src/V1/UpdateFeatureRequest.php index 89a7b5b28dbb..1433112bee7b 100644 --- a/GkeHub/src/V1/UpdateFeatureRequest.php +++ b/GkeHub/src/V1/UpdateFeatureRequest.php @@ -42,7 +42,7 @@ class UpdateFeatureRequest extends \Google\Protobuf\Internal\Message */ protected $resource = null; /** - * Optional. A request ID to identify requests. Specify a unique request ID + * A 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. @@ -104,7 +104,7 @@ public static function build(string $name, \Google\Cloud\GkeHub\V1\Feature $reso * If you specify the update_mask to be a special path "*", fully replaces all * user-modifiable fields to match `resource`. * @type string $request_id - * Optional. A request ID to identify requests. Specify a unique request ID + * A 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. @@ -237,7 +237,7 @@ public function setResource($var) } /** - * Optional. A request ID to identify requests. Specify a unique request ID + * A 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. @@ -258,7 +258,7 @@ public function getRequestId() } /** - * Optional. A request ID to identify requests. Specify a unique request ID + * A 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. diff --git a/GkeHub/src/V1/UpdateFleetRequest.php b/GkeHub/src/V1/UpdateFleetRequest.php new file mode 100644 index 000000000000..cf9e71565a9d --- /dev/null +++ b/GkeHub/src/V1/UpdateFleetRequest.php @@ -0,0 +1,147 @@ +google.cloud.gkehub.v1.UpdateFleetRequest + */ +class UpdateFleetRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The Fleet to update. + * The `name` field of the Fleet object identifies which fleet will be + * updated. + * + * Generated from protobuf field .google.cloud.gkehub.v1.Fleet fleet = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $fleet = null; + /** + * Required. The fields to be updated; + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\GkeHub\V1\Fleet $fleet Required. The Fleet to update. + * + * The `name` field of the Fleet object identifies which fleet will be + * updated. + * @param \Google\Protobuf\FieldMask $updateMask Required. The fields to be updated; + * + * @return \Google\Cloud\GkeHub\V1\UpdateFleetRequest + * + * @experimental + */ + public static function build(\Google\Cloud\GkeHub\V1\Fleet $fleet, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setFleet($fleet) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\GkeHub\V1\Fleet $fleet + * Required. The Fleet to update. + * The `name` field of the Fleet object identifies which fleet will be + * updated. + * @type \Google\Protobuf\FieldMask $update_mask + * Required. The fields to be updated; + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gkehub\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The Fleet to update. + * The `name` field of the Fleet object identifies which fleet will be + * updated. + * + * Generated from protobuf field .google.cloud.gkehub.v1.Fleet fleet = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\GkeHub\V1\Fleet|null + */ + public function getFleet() + { + return $this->fleet; + } + + public function hasFleet() + { + return isset($this->fleet); + } + + public function clearFleet() + { + unset($this->fleet); + } + + /** + * Required. The Fleet to update. + * The `name` field of the Fleet object identifies which fleet will be + * updated. + * + * Generated from protobuf field .google.cloud.gkehub.v1.Fleet fleet = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\GkeHub\V1\Fleet $var + * @return $this + */ + public function setFleet($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GkeHub\V1\Fleet::class); + $this->fleet = $var; + + return $this; + } + + /** + * Required. The fields to be updated; + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. The fields to be updated; + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/GkeHub/src/V1/UpdateMembershipBindingRequest.php b/GkeHub/src/V1/UpdateMembershipBindingRequest.php new file mode 100644 index 000000000000..09166b9134b5 --- /dev/null +++ b/GkeHub/src/V1/UpdateMembershipBindingRequest.php @@ -0,0 +1,136 @@ +google.cloud.gkehub.v1.UpdateMembershipBindingRequest + */ +class UpdateMembershipBindingRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The MembershipBinding object with fields updated. + * + * Generated from protobuf field .google.cloud.gkehub.v1.MembershipBinding membership_binding = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $membership_binding = null; + /** + * Required. The fields to be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\GkeHub\V1\MembershipBinding $membershipBinding Required. The MembershipBinding object with fields updated. + * @param \Google\Protobuf\FieldMask $updateMask Required. The fields to be updated. + * + * @return \Google\Cloud\GkeHub\V1\UpdateMembershipBindingRequest + * + * @experimental + */ + public static function build(\Google\Cloud\GkeHub\V1\MembershipBinding $membershipBinding, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setMembershipBinding($membershipBinding) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\GkeHub\V1\MembershipBinding $membership_binding + * Required. The MembershipBinding object with fields updated. + * @type \Google\Protobuf\FieldMask $update_mask + * Required. The fields to be updated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gkehub\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. The MembershipBinding object with fields updated. + * + * Generated from protobuf field .google.cloud.gkehub.v1.MembershipBinding membership_binding = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\GkeHub\V1\MembershipBinding|null + */ + public function getMembershipBinding() + { + return $this->membership_binding; + } + + public function hasMembershipBinding() + { + return isset($this->membership_binding); + } + + public function clearMembershipBinding() + { + unset($this->membership_binding); + } + + /** + * Required. The MembershipBinding object with fields updated. + * + * Generated from protobuf field .google.cloud.gkehub.v1.MembershipBinding membership_binding = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\GkeHub\V1\MembershipBinding $var + * @return $this + */ + public function setMembershipBinding($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GkeHub\V1\MembershipBinding::class); + $this->membership_binding = $var; + + return $this; + } + + /** + * Required. The fields to be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. The fields to be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/GkeHub/src/V1/UpdateMembershipRBACRoleBindingRequest.php b/GkeHub/src/V1/UpdateMembershipRBACRoleBindingRequest.php new file mode 100644 index 000000000000..10c3eab25c35 --- /dev/null +++ b/GkeHub/src/V1/UpdateMembershipRBACRoleBindingRequest.php @@ -0,0 +1,141 @@ +google.cloud.gkehub.v1.UpdateMembershipRBACRoleBindingRequest + */ +class UpdateMembershipRBACRoleBindingRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A rbacrolebinding with fields updated. The 'name' field in this + * rbacrolebinding is used to identify the resource to update. + * + * Generated from protobuf field .google.cloud.gkehub.v1.RBACRoleBinding rbacrolebinding = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $rbacrolebinding = null; + /** + * Required. The fields to be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\GkeHub\V1\RBACRoleBinding $rbacrolebinding Required. A rbacrolebinding with fields updated. The 'name' field in this + * rbacrolebinding is used to identify the resource to update. + * @param \Google\Protobuf\FieldMask $updateMask Required. The fields to be updated. + * + * @return \Google\Cloud\GkeHub\V1\UpdateMembershipRBACRoleBindingRequest + * + * @experimental + */ + public static function build(\Google\Cloud\GkeHub\V1\RBACRoleBinding $rbacrolebinding, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setRbacrolebinding($rbacrolebinding) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\GkeHub\V1\RBACRoleBinding $rbacrolebinding + * Required. A rbacrolebinding with fields updated. The 'name' field in this + * rbacrolebinding is used to identify the resource to update. + * @type \Google\Protobuf\FieldMask $update_mask + * Required. The fields to be updated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gkehub\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. A rbacrolebinding with fields updated. The 'name' field in this + * rbacrolebinding is used to identify the resource to update. + * + * Generated from protobuf field .google.cloud.gkehub.v1.RBACRoleBinding rbacrolebinding = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\GkeHub\V1\RBACRoleBinding|null + */ + public function getRbacrolebinding() + { + return $this->rbacrolebinding; + } + + public function hasRbacrolebinding() + { + return isset($this->rbacrolebinding); + } + + public function clearRbacrolebinding() + { + unset($this->rbacrolebinding); + } + + /** + * Required. A rbacrolebinding with fields updated. The 'name' field in this + * rbacrolebinding is used to identify the resource to update. + * + * Generated from protobuf field .google.cloud.gkehub.v1.RBACRoleBinding rbacrolebinding = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\GkeHub\V1\RBACRoleBinding $var + * @return $this + */ + public function setRbacrolebinding($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GkeHub\V1\RBACRoleBinding::class); + $this->rbacrolebinding = $var; + + return $this; + } + + /** + * Required. The fields to be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. The fields to be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/GkeHub/src/V1/UpdateScopeNamespaceRequest.php b/GkeHub/src/V1/UpdateScopeNamespaceRequest.php new file mode 100644 index 000000000000..266ef1a2f7c2 --- /dev/null +++ b/GkeHub/src/V1/UpdateScopeNamespaceRequest.php @@ -0,0 +1,146 @@ +google.cloud.gkehub.v1.UpdateScopeNamespaceRequest + */ +class UpdateScopeNamespaceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A namespace with fields updated. The 'name' field in this + * namespace is used to identify the resource to update. Given 'updated' + * prefix to follow go/proto-best-practices-checkers#keyword_conflict + * + * Generated from protobuf field .google.cloud.gkehub.v1.Namespace scope_namespace = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $scope_namespace = null; + /** + * Required. The fields to be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\GkeHub\V1\PBNamespace $scopeNamespace Required. A namespace with fields updated. The 'name' field in this + * namespace is used to identify the resource to update. Given 'updated' + * prefix to follow go/proto-best-practices-checkers#keyword_conflict + * @param \Google\Protobuf\FieldMask $updateMask Required. The fields to be updated. + * + * @return \Google\Cloud\GkeHub\V1\UpdateScopeNamespaceRequest + * + * @experimental + */ + public static function build(\Google\Cloud\GkeHub\V1\PBNamespace $scopeNamespace, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setScopeNamespace($scopeNamespace) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\GkeHub\V1\PBNamespace $scope_namespace + * Required. A namespace with fields updated. The 'name' field in this + * namespace is used to identify the resource to update. Given 'updated' + * prefix to follow go/proto-best-practices-checkers#keyword_conflict + * @type \Google\Protobuf\FieldMask $update_mask + * Required. The fields to be updated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gkehub\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. A namespace with fields updated. The 'name' field in this + * namespace is used to identify the resource to update. Given 'updated' + * prefix to follow go/proto-best-practices-checkers#keyword_conflict + * + * Generated from protobuf field .google.cloud.gkehub.v1.Namespace scope_namespace = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\GkeHub\V1\PBNamespace|null + */ + public function getScopeNamespace() + { + return $this->scope_namespace; + } + + public function hasScopeNamespace() + { + return isset($this->scope_namespace); + } + + public function clearScopeNamespace() + { + unset($this->scope_namespace); + } + + /** + * Required. A namespace with fields updated. The 'name' field in this + * namespace is used to identify the resource to update. Given 'updated' + * prefix to follow go/proto-best-practices-checkers#keyword_conflict + * + * Generated from protobuf field .google.cloud.gkehub.v1.Namespace scope_namespace = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\GkeHub\V1\PBNamespace $var + * @return $this + */ + public function setScopeNamespace($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GkeHub\V1\PBNamespace::class); + $this->scope_namespace = $var; + + return $this; + } + + /** + * Required. The fields to be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. The fields to be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/GkeHub/src/V1/UpdateScopeRBACRoleBindingRequest.php b/GkeHub/src/V1/UpdateScopeRBACRoleBindingRequest.php new file mode 100644 index 000000000000..d2279d02f03e --- /dev/null +++ b/GkeHub/src/V1/UpdateScopeRBACRoleBindingRequest.php @@ -0,0 +1,141 @@ +google.cloud.gkehub.v1.UpdateScopeRBACRoleBindingRequest + */ +class UpdateScopeRBACRoleBindingRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A rbacrolebinding with fields updated. The 'name' field in this + * rbacrolebinding is used to identify the resource to update. + * + * Generated from protobuf field .google.cloud.gkehub.v1.RBACRoleBinding rbacrolebinding = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $rbacrolebinding = null; + /** + * Required. The fields to be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\GkeHub\V1\RBACRoleBinding $rbacrolebinding Required. A rbacrolebinding with fields updated. The 'name' field in this + * rbacrolebinding is used to identify the resource to update. + * @param \Google\Protobuf\FieldMask $updateMask Required. The fields to be updated. + * + * @return \Google\Cloud\GkeHub\V1\UpdateScopeRBACRoleBindingRequest + * + * @experimental + */ + public static function build(\Google\Cloud\GkeHub\V1\RBACRoleBinding $rbacrolebinding, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setRbacrolebinding($rbacrolebinding) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\GkeHub\V1\RBACRoleBinding $rbacrolebinding + * Required. A rbacrolebinding with fields updated. The 'name' field in this + * rbacrolebinding is used to identify the resource to update. + * @type \Google\Protobuf\FieldMask $update_mask + * Required. The fields to be updated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gkehub\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. A rbacrolebinding with fields updated. The 'name' field in this + * rbacrolebinding is used to identify the resource to update. + * + * Generated from protobuf field .google.cloud.gkehub.v1.RBACRoleBinding rbacrolebinding = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\GkeHub\V1\RBACRoleBinding|null + */ + public function getRbacrolebinding() + { + return $this->rbacrolebinding; + } + + public function hasRbacrolebinding() + { + return isset($this->rbacrolebinding); + } + + public function clearRbacrolebinding() + { + unset($this->rbacrolebinding); + } + + /** + * Required. A rbacrolebinding with fields updated. The 'name' field in this + * rbacrolebinding is used to identify the resource to update. + * + * Generated from protobuf field .google.cloud.gkehub.v1.RBACRoleBinding rbacrolebinding = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\GkeHub\V1\RBACRoleBinding $var + * @return $this + */ + public function setRbacrolebinding($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GkeHub\V1\RBACRoleBinding::class); + $this->rbacrolebinding = $var; + + return $this; + } + + /** + * Required. The fields to be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. The fields to be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/GkeHub/src/V1/UpdateScopeRequest.php b/GkeHub/src/V1/UpdateScopeRequest.php new file mode 100644 index 000000000000..43853b5613d9 --- /dev/null +++ b/GkeHub/src/V1/UpdateScopeRequest.php @@ -0,0 +1,141 @@ +google.cloud.gkehub.v1.UpdateScopeRequest + */ +class UpdateScopeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A Scope with fields updated. The 'name' field in this + * namespace is used to identify the resource to update. + * + * Generated from protobuf field .google.cloud.gkehub.v1.Scope scope = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $scope = null; + /** + * Required. The fields to be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\GkeHub\V1\Scope $scope Required. A Scope with fields updated. The 'name' field in this + * namespace is used to identify the resource to update. + * @param \Google\Protobuf\FieldMask $updateMask Required. The fields to be updated. + * + * @return \Google\Cloud\GkeHub\V1\UpdateScopeRequest + * + * @experimental + */ + public static function build(\Google\Cloud\GkeHub\V1\Scope $scope, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setScope($scope) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\GkeHub\V1\Scope $scope + * Required. A Scope with fields updated. The 'name' field in this + * namespace is used to identify the resource to update. + * @type \Google\Protobuf\FieldMask $update_mask + * Required. The fields to be updated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Gkehub\V1\Service::initOnce(); + parent::__construct($data); + } + + /** + * Required. A Scope with fields updated. The 'name' field in this + * namespace is used to identify the resource to update. + * + * Generated from protobuf field .google.cloud.gkehub.v1.Scope scope = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\GkeHub\V1\Scope|null + */ + public function getScope() + { + return $this->scope; + } + + public function hasScope() + { + return isset($this->scope); + } + + public function clearScope() + { + unset($this->scope); + } + + /** + * Required. A Scope with fields updated. The 'name' field in this + * namespace is used to identify the resource to update. + * + * Generated from protobuf field .google.cloud.gkehub.v1.Scope scope = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\GkeHub\V1\Scope $var + * @return $this + */ + public function setScope($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\GkeHub\V1\Scope::class); + $this->scope = $var; + + return $this; + } + + /** + * Required. The fields to be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. The fields to be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/GkeHub/src/V1/gapic_metadata.json b/GkeHub/src/V1/gapic_metadata.json index 7b0047620c7f..b97f2929ef6b 100644 --- a/GkeHub/src/V1/gapic_metadata.json +++ b/GkeHub/src/V1/gapic_metadata.json @@ -15,55 +15,220 @@ "createFeature" ] }, + "CreateFleet": { + "methods": [ + "createFleet" + ] + }, "CreateMembership": { "methods": [ "createMembership" ] }, + "CreateMembershipBinding": { + "methods": [ + "createMembershipBinding" + ] + }, + "CreateMembershipRBACRoleBinding": { + "methods": [ + "createMembershipRBACRoleBinding" + ] + }, + "CreateScope": { + "methods": [ + "createScope" + ] + }, + "CreateScopeNamespace": { + "methods": [ + "createScopeNamespace" + ] + }, + "CreateScopeRBACRoleBinding": { + "methods": [ + "createScopeRBACRoleBinding" + ] + }, "DeleteFeature": { "methods": [ "deleteFeature" ] }, + "DeleteFleet": { + "methods": [ + "deleteFleet" + ] + }, "DeleteMembership": { "methods": [ "deleteMembership" ] }, + "DeleteMembershipBinding": { + "methods": [ + "deleteMembershipBinding" + ] + }, + "DeleteMembershipRBACRoleBinding": { + "methods": [ + "deleteMembershipRBACRoleBinding" + ] + }, + "DeleteScope": { + "methods": [ + "deleteScope" + ] + }, + "DeleteScopeNamespace": { + "methods": [ + "deleteScopeNamespace" + ] + }, + "DeleteScopeRBACRoleBinding": { + "methods": [ + "deleteScopeRBACRoleBinding" + ] + }, "GenerateConnectManifest": { "methods": [ "generateConnectManifest" ] }, + "GenerateMembershipRBACRoleBindingYAML": { + "methods": [ + "generateMembershipRBACRoleBindingYAML" + ] + }, "GetFeature": { "methods": [ "getFeature" ] }, + "GetFleet": { + "methods": [ + "getFleet" + ] + }, "GetMembership": { "methods": [ "getMembership" ] }, + "GetMembershipBinding": { + "methods": [ + "getMembershipBinding" + ] + }, + "GetMembershipRBACRoleBinding": { + "methods": [ + "getMembershipRBACRoleBinding" + ] + }, + "GetScope": { + "methods": [ + "getScope" + ] + }, + "GetScopeNamespace": { + "methods": [ + "getScopeNamespace" + ] + }, + "GetScopeRBACRoleBinding": { + "methods": [ + "getScopeRBACRoleBinding" + ] + }, + "ListBoundMemberships": { + "methods": [ + "listBoundMemberships" + ] + }, "ListFeatures": { "methods": [ "listFeatures" ] }, + "ListFleets": { + "methods": [ + "listFleets" + ] + }, + "ListMembershipBindings": { + "methods": [ + "listMembershipBindings" + ] + }, + "ListMembershipRBACRoleBindings": { + "methods": [ + "listMembershipRBACRoleBindings" + ] + }, "ListMemberships": { "methods": [ "listMemberships" ] }, + "ListPermittedScopes": { + "methods": [ + "listPermittedScopes" + ] + }, + "ListScopeNamespaces": { + "methods": [ + "listScopeNamespaces" + ] + }, + "ListScopeRBACRoleBindings": { + "methods": [ + "listScopeRBACRoleBindings" + ] + }, + "ListScopes": { + "methods": [ + "listScopes" + ] + }, "UpdateFeature": { "methods": [ "updateFeature" ] }, + "UpdateFleet": { + "methods": [ + "updateFleet" + ] + }, "UpdateMembership": { "methods": [ "updateMembership" ] + }, + "UpdateMembershipBinding": { + "methods": [ + "updateMembershipBinding" + ] + }, + "UpdateMembershipRBACRoleBinding": { + "methods": [ + "updateMembershipRBACRoleBinding" + ] + }, + "UpdateScope": { + "methods": [ + "updateScope" + ] + }, + "UpdateScopeNamespace": { + "methods": [ + "updateScopeNamespace" + ] + }, + "UpdateScopeRBACRoleBinding": { + "methods": [ + "updateScopeRBACRoleBinding" + ] } } } diff --git a/GkeHub/src/V1/resources/gke_hub_client_config.json b/GkeHub/src/V1/resources/gke_hub_client_config.json index f361405e676f..71f5c1b998c6 100644 --- a/GkeHub/src/V1/resources/gke_hub_client_config.json +++ b/GkeHub/src/V1/resources/gke_hub_client_config.json @@ -33,55 +33,220 @@ "retry_codes_name": "retry_policy_1_codes", "retry_params_name": "retry_policy_1_params" }, + "CreateFleet": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, "CreateMembership": { "timeout_millis": 60000, "retry_codes_name": "retry_policy_1_codes", "retry_params_name": "retry_policy_1_params" }, + "CreateMembershipBinding": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "CreateMembershipRBACRoleBinding": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "CreateScope": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "CreateScopeNamespace": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "CreateScopeRBACRoleBinding": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, "DeleteFeature": { "timeout_millis": 60000, "retry_codes_name": "retry_policy_1_codes", "retry_params_name": "retry_policy_1_params" }, + "DeleteFleet": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, "DeleteMembership": { "timeout_millis": 60000, "retry_codes_name": "retry_policy_1_codes", "retry_params_name": "retry_policy_1_params" }, + "DeleteMembershipBinding": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteMembershipRBACRoleBinding": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteScope": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteScopeNamespace": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteScopeRBACRoleBinding": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, "GenerateConnectManifest": { "timeout_millis": 60000, "retry_codes_name": "retry_policy_1_codes", "retry_params_name": "retry_policy_1_params" }, + "GenerateMembershipRBACRoleBindingYAML": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, "GetFeature": { "timeout_millis": 60000, "retry_codes_name": "retry_policy_1_codes", "retry_params_name": "retry_policy_1_params" }, + "GetFleet": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, "GetMembership": { "timeout_millis": 60000, "retry_codes_name": "retry_policy_1_codes", "retry_params_name": "retry_policy_1_params" }, + "GetMembershipBinding": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetMembershipRBACRoleBinding": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetScope": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetScopeNamespace": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetScopeRBACRoleBinding": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListBoundMemberships": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, "ListFeatures": { "timeout_millis": 60000, "retry_codes_name": "retry_policy_1_codes", "retry_params_name": "retry_policy_1_params" }, + "ListFleets": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListMembershipBindings": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListMembershipRBACRoleBindings": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, "ListMemberships": { "timeout_millis": 60000, "retry_codes_name": "retry_policy_1_codes", "retry_params_name": "retry_policy_1_params" }, + "ListPermittedScopes": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListScopeNamespaces": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListScopeRBACRoleBindings": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListScopes": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, "UpdateFeature": { "timeout_millis": 60000, "retry_codes_name": "retry_policy_1_codes", "retry_params_name": "retry_policy_1_params" }, + "UpdateFleet": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, "UpdateMembership": { "timeout_millis": 60000, "retry_codes_name": "retry_policy_1_codes", "retry_params_name": "retry_policy_1_params" + }, + "UpdateMembershipBinding": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateMembershipRBACRoleBinding": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateScope": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateScopeNamespace": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateScopeRBACRoleBinding": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" } } } diff --git a/GkeHub/src/V1/resources/gke_hub_descriptor_config.php b/GkeHub/src/V1/resources/gke_hub_descriptor_config.php index 490753e5428b..041197f34244 100644 --- a/GkeHub/src/V1/resources/gke_hub_descriptor_config.php +++ b/GkeHub/src/V1/resources/gke_hub_descriptor_config.php @@ -42,6 +42,25 @@ ], ], ], + 'CreateFleet' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\GkeHub\V1\Fleet', + 'metadataReturnType' => '\Google\Cloud\GkeHub\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], 'CreateMembership' => [ 'longRunning' => [ 'operationReturnType' => '\Google\Cloud\GkeHub\V1\Membership', @@ -61,6 +80,101 @@ ], ], ], + 'CreateMembershipBinding' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\GkeHub\V1\MembershipBinding', + 'metadataReturnType' => '\Google\Cloud\GkeHub\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'CreateMembershipRBACRoleBinding' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\GkeHub\V1\RBACRoleBinding', + 'metadataReturnType' => '\Google\Cloud\GkeHub\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'CreateScope' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\GkeHub\V1\Scope', + 'metadataReturnType' => '\Google\Cloud\GkeHub\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'CreateScopeNamespace' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\GkeHub\V1\PBNamespace', + 'metadataReturnType' => '\Google\Cloud\GkeHub\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'CreateScopeRBACRoleBinding' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\GkeHub\V1\RBACRoleBinding', + 'metadataReturnType' => '\Google\Cloud\GkeHub\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], 'DeleteFeature' => [ 'longRunning' => [ 'operationReturnType' => '\Google\Protobuf\GPBEmpty', @@ -80,6 +194,25 @@ ], ], ], + 'DeleteFleet' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\GkeHub\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], 'DeleteMembership' => [ 'longRunning' => [ 'operationReturnType' => '\Google\Protobuf\GPBEmpty', @@ -99,6 +232,101 @@ ], ], ], + 'DeleteMembershipBinding' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\GkeHub\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DeleteMembershipRBACRoleBinding' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\GkeHub\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DeleteScope' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\GkeHub\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DeleteScopeNamespace' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\GkeHub\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DeleteScopeRBACRoleBinding' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\GkeHub\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], 'UpdateFeature' => [ 'longRunning' => [ 'operationReturnType' => '\Google\Cloud\GkeHub\V1\Feature', @@ -118,6 +346,26 @@ ], ], ], + 'UpdateFleet' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\GkeHub\V1\Fleet', + 'metadataReturnType' => '\Google\Cloud\GkeHub\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'fleet.name', + 'fieldAccessors' => [ + 'getFleet', + 'getName', + ], + ], + ], + ], 'UpdateMembership' => [ 'longRunning' => [ 'operationReturnType' => '\Google\Cloud\GkeHub\V1\Membership', @@ -137,6 +385,106 @@ ], ], ], + 'UpdateMembershipBinding' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\GkeHub\V1\MembershipBinding', + 'metadataReturnType' => '\Google\Cloud\GkeHub\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'membership_binding.name', + 'fieldAccessors' => [ + 'getMembershipBinding', + 'getName', + ], + ], + ], + ], + 'UpdateMembershipRBACRoleBinding' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\GkeHub\V1\RBACRoleBinding', + 'metadataReturnType' => '\Google\Cloud\GkeHub\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'rbacrolebinding.name', + 'fieldAccessors' => [ + 'getRbacrolebinding', + 'getName', + ], + ], + ], + ], + 'UpdateScope' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\GkeHub\V1\Scope', + 'metadataReturnType' => '\Google\Cloud\GkeHub\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'scope.name', + 'fieldAccessors' => [ + 'getScope', + 'getName', + ], + ], + ], + ], + 'UpdateScopeNamespace' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\GkeHub\V1\PBNamespace', + 'metadataReturnType' => '\Google\Cloud\GkeHub\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'scope_namespace.name', + 'fieldAccessors' => [ + 'getScopeNamespace', + 'getName', + ], + ], + ], + ], + 'UpdateScopeRBACRoleBinding' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\GkeHub\V1\RBACRoleBinding', + 'metadataReturnType' => '\Google\Cloud\GkeHub\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'rbacrolebinding.name', + 'fieldAccessors' => [ + 'getRbacrolebinding', + 'getName', + ], + ], + ], + ], 'GenerateConnectManifest' => [ 'callType' => \Google\ApiCore\Call::UNARY_CALL, 'responseType' => 'Google\Cloud\GkeHub\V1\GenerateConnectManifestResponse', @@ -149,6 +497,18 @@ ], ], ], + 'GenerateMembershipRBACRoleBindingYAML' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\GkeHub\V1\GenerateMembershipRBACRoleBindingYAMLResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], 'GetFeature' => [ 'callType' => \Google\ApiCore\Call::UNARY_CALL, 'responseType' => 'Google\Cloud\GkeHub\V1\Feature', @@ -161,6 +521,18 @@ ], ], ], + 'GetFleet' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\GkeHub\V1\Fleet', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], 'GetMembership' => [ 'callType' => \Google\ApiCore\Call::UNARY_CALL, 'responseType' => 'Google\Cloud\GkeHub\V1\Membership', @@ -173,6 +545,86 @@ ], ], ], + 'GetMembershipBinding' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\GkeHub\V1\MembershipBinding', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetMembershipRBACRoleBinding' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\GkeHub\V1\RBACRoleBinding', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetScope' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\GkeHub\V1\Scope', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetScopeNamespace' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\GkeHub\V1\PBNamespace', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetScopeRBACRoleBinding' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\GkeHub\V1\RBACRoleBinding', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListBoundMemberships' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getMemberships', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\GkeHub\V1\ListBoundMembershipsResponse', + 'headerParams' => [ + [ + 'keyName' => 'scope_name', + 'fieldAccessors' => [ + 'getScopeName', + ], + ], + ], + ], 'ListFeatures' => [ 'pageStreaming' => [ 'requestPageTokenGetMethod' => 'getPageToken', @@ -193,6 +645,66 @@ ], ], ], + 'ListFleets' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getFleets', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\GkeHub\V1\ListFleetsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListMembershipBindings' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getMembershipBindings', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\GkeHub\V1\ListMembershipBindingsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListMembershipRBACRoleBindings' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getRbacrolebindings', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\GkeHub\V1\ListMembershipRBACRoleBindingsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], 'ListMemberships' => [ 'pageStreaming' => [ 'requestPageTokenGetMethod' => 'getPageToken', @@ -213,10 +725,99 @@ ], ], ], + 'ListPermittedScopes' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getScopes', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\GkeHub\V1\ListPermittedScopesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListScopeNamespaces' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getScopeNamespaces', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\GkeHub\V1\ListScopeNamespacesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListScopeRBACRoleBindings' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getRbacrolebindings', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\GkeHub\V1\ListScopeRBACRoleBindingsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListScopes' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getScopes', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\GkeHub\V1\ListScopesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], 'templateMap' => [ 'feature' => 'projects/{project}/locations/{location}/features/{feature}', + 'fleet' => 'projects/{project}/locations/{location}/fleets/{fleet}', 'location' => 'projects/{project}/locations/{location}', 'membership' => 'projects/{project}/locations/{location}/memberships/{membership}', + 'membershipBinding' => 'projects/{project}/locations/{location}/memberships/{membership}/bindings/{membershipbinding}', + 'namespace' => 'projects/{project}/locations/{location}/scopes/{scope}/namespaces/{namespace}', + 'organizationLocationFleet' => 'organizations/{organization}/locations/{location}/fleets/{fleet}', + 'projectLocationFleet' => 'projects/{project}/locations/{location}/fleets/{fleet}', + 'projectLocationMembershipRbacrolebinding' => 'projects/{project}/locations/{location}/memberships/{membership}/rbacrolebindings/{rbacrolebinding}', + 'projectLocationScopeRbacrolebinding' => 'projects/{project}/locations/{location}/scopes/{scope}/rbacrolebindings/{rbacrolebinding}', + 'rBACRoleBinding' => 'projects/{project}/locations/{location}/scopes/{scope}/rbacrolebindings/{rbacrolebinding}', + 'scope' => 'projects/{project}/locations/{location}/scopes/{scope}', ], ], ], diff --git a/GkeHub/src/V1/resources/gke_hub_rest_client_config.php b/GkeHub/src/V1/resources/gke_hub_rest_client_config.php index 3b91c2de285d..b534146a0787 100644 --- a/GkeHub/src/V1/resources/gke_hub_rest_client_config.php +++ b/GkeHub/src/V1/resources/gke_hub_rest_client_config.php @@ -35,6 +35,18 @@ ], ], ], + 'CreateFleet' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/fleets', + 'body' => 'fleet', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], 'CreateMembership' => [ 'method' => 'post', 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/memberships', @@ -50,6 +62,81 @@ 'membership_id', ], ], + 'CreateMembershipBinding' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/memberships/*}/bindings', + 'body' => 'membership_binding', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'membership_binding_id', + ], + ], + 'CreateMembershipRBACRoleBinding' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/memberships/*}/rbacrolebindings', + 'body' => 'rbacrolebinding', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'rbacrolebinding_id', + ], + ], + 'CreateScope' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/scopes', + 'body' => 'scope', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'scope_id', + ], + ], + 'CreateScopeNamespace' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/scopes/*}/namespaces', + 'body' => 'scope_namespace', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'scope_namespace_id', + ], + ], + 'CreateScopeRBACRoleBinding' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/scopes/*}/rbacrolebindings', + 'body' => 'rbacrolebinding', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'rbacrolebinding_id', + ], + ], 'DeleteFeature' => [ 'method' => 'delete', 'uriTemplate' => '/v1/{name=projects/*/locations/*/features/*}', @@ -61,6 +148,17 @@ ], ], ], + 'DeleteFleet' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/fleets/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'DeleteMembership' => [ 'method' => 'delete', 'uriTemplate' => '/v1/{name=projects/*/locations/*/memberships/*}', @@ -72,6 +170,61 @@ ], ], ], + 'DeleteMembershipBinding' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/memberships/*/bindings/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteMembershipRBACRoleBinding' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/memberships/*/rbacrolebindings/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteScope' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/scopes/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteScopeNamespace' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/scopes/*/namespaces/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteScopeRBACRoleBinding' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/scopes/*/rbacrolebindings/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'GenerateConnectManifest' => [ 'method' => 'get', 'uriTemplate' => '/v1/{name=projects/*/locations/*/memberships/*}:generateConnectManifest', @@ -83,6 +236,18 @@ ], ], ], + 'GenerateMembershipRBACRoleBindingYAML' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/memberships/*}/rbacrolebindings:generateMembershipRBACRoleBindingYAML', + 'body' => 'rbacrolebinding', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], 'GetFeature' => [ 'method' => 'get', 'uriTemplate' => '/v1/{name=projects/*/locations/*/features/*}', @@ -94,6 +259,17 @@ ], ], ], + 'GetFleet' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/fleets/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'GetMembership' => [ 'method' => 'get', 'uriTemplate' => '/v1/{name=projects/*/locations/*/memberships/*}', @@ -105,6 +281,72 @@ ], ], ], + 'GetMembershipBinding' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/memberships/*/bindings/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetMembershipRBACRoleBinding' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/memberships/*/rbacrolebindings/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetScope' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/scopes/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetScopeNamespace' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/scopes/*/namespaces/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetScopeRBACRoleBinding' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/scopes/*/rbacrolebindings/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListBoundMemberships' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{scope_name=projects/*/locations/*/scopes/*}:listMemberships', + 'placeholders' => [ + 'scope_name' => [ + 'getters' => [ + 'getScopeName', + ], + ], + ], + ], 'ListFeatures' => [ 'method' => 'get', 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/features', @@ -116,6 +358,45 @@ ], ], ], + 'ListFleets' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/fleets', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=organizations/*/locations/*}/fleets', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListMembershipBindings' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/memberships/*}/bindings', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListMembershipRBACRoleBindings' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/memberships/*}/rbacrolebindings', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], 'ListMemberships' => [ 'method' => 'get', 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/memberships', @@ -127,6 +408,50 @@ ], ], ], + 'ListPermittedScopes' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/scopes:listPermitted', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListScopeNamespaces' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/scopes/*}/namespaces', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListScopeRBACRoleBindings' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/scopes/*}/rbacrolebindings', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListScopes' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/scopes', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], 'UpdateFeature' => [ 'method' => 'patch', 'uriTemplate' => '/v1/{name=projects/*/locations/*/features/*}', @@ -139,6 +464,22 @@ ], ], ], + 'UpdateFleet' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{fleet.name=projects/*/locations/*/fleets/*}', + 'body' => 'fleet', + 'placeholders' => [ + 'fleet.name' => [ + 'getters' => [ + 'getFleet', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], 'UpdateMembership' => [ 'method' => 'patch', 'uriTemplate' => '/v1/{name=projects/*/locations/*/memberships/*}', @@ -154,6 +495,86 @@ 'update_mask', ], ], + 'UpdateMembershipBinding' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{membership_binding.name=projects/*/locations/*/memberships/*/bindings/*}', + 'body' => 'membership_binding', + 'placeholders' => [ + 'membership_binding.name' => [ + 'getters' => [ + 'getMembershipBinding', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + 'UpdateMembershipRBACRoleBinding' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{rbacrolebinding.name=projects/*/locations/*/memberships/*/rbacrolebindings/*}', + 'body' => 'rbacrolebinding', + 'placeholders' => [ + 'rbacrolebinding.name' => [ + 'getters' => [ + 'getRbacrolebinding', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + 'UpdateScope' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{scope.name=projects/*/locations/*/scopes/*}', + 'body' => 'scope', + 'placeholders' => [ + 'scope.name' => [ + 'getters' => [ + 'getScope', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + 'UpdateScopeNamespace' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{scope_namespace.name=projects/*/locations/*/scopes/*/namespaces/*}', + 'body' => 'scope_namespace', + 'placeholders' => [ + 'scope_namespace.name' => [ + 'getters' => [ + 'getScopeNamespace', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + 'UpdateScopeRBACRoleBinding' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{rbacrolebinding.name=projects/*/locations/*/scopes/*/rbacrolebindings/*}', + 'body' => 'rbacrolebinding', + 'placeholders' => [ + 'rbacrolebinding.name' => [ + 'getters' => [ + 'getRbacrolebinding', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], ], 'google.cloud.location.Locations' => [ 'GetLocation' => [ diff --git a/GkeHub/tests/Unit/V1/Client/GkeHubClientTest.php b/GkeHub/tests/Unit/V1/Client/GkeHubClientTest.php index 799b50276e35..0d7d7967744b 100644 --- a/GkeHub/tests/Unit/V1/Client/GkeHubClientTest.php +++ b/GkeHub/tests/Unit/V1/Client/GkeHubClientTest.php @@ -28,21 +28,69 @@ use Google\ApiCore\Testing\MockTransport; use Google\Cloud\GkeHub\V1\Client\GkeHubClient; use Google\Cloud\GkeHub\V1\CreateFeatureRequest; +use Google\Cloud\GkeHub\V1\CreateFleetRequest; +use Google\Cloud\GkeHub\V1\CreateMembershipBindingRequest; +use Google\Cloud\GkeHub\V1\CreateMembershipRBACRoleBindingRequest; use Google\Cloud\GkeHub\V1\CreateMembershipRequest; +use Google\Cloud\GkeHub\V1\CreateScopeNamespaceRequest; +use Google\Cloud\GkeHub\V1\CreateScopeRBACRoleBindingRequest; +use Google\Cloud\GkeHub\V1\CreateScopeRequest; use Google\Cloud\GkeHub\V1\DeleteFeatureRequest; +use Google\Cloud\GkeHub\V1\DeleteFleetRequest; +use Google\Cloud\GkeHub\V1\DeleteMembershipBindingRequest; +use Google\Cloud\GkeHub\V1\DeleteMembershipRBACRoleBindingRequest; use Google\Cloud\GkeHub\V1\DeleteMembershipRequest; +use Google\Cloud\GkeHub\V1\DeleteScopeNamespaceRequest; +use Google\Cloud\GkeHub\V1\DeleteScopeRBACRoleBindingRequest; +use Google\Cloud\GkeHub\V1\DeleteScopeRequest; use Google\Cloud\GkeHub\V1\Feature; +use Google\Cloud\GkeHub\V1\Fleet; use Google\Cloud\GkeHub\V1\GenerateConnectManifestRequest; use Google\Cloud\GkeHub\V1\GenerateConnectManifestResponse; +use Google\Cloud\GkeHub\V1\GenerateMembershipRBACRoleBindingYAMLRequest; +use Google\Cloud\GkeHub\V1\GenerateMembershipRBACRoleBindingYAMLResponse; use Google\Cloud\GkeHub\V1\GetFeatureRequest; +use Google\Cloud\GkeHub\V1\GetFleetRequest; +use Google\Cloud\GkeHub\V1\GetMembershipBindingRequest; +use Google\Cloud\GkeHub\V1\GetMembershipRBACRoleBindingRequest; use Google\Cloud\GkeHub\V1\GetMembershipRequest; +use Google\Cloud\GkeHub\V1\GetScopeNamespaceRequest; +use Google\Cloud\GkeHub\V1\GetScopeRBACRoleBindingRequest; +use Google\Cloud\GkeHub\V1\GetScopeRequest; +use Google\Cloud\GkeHub\V1\ListBoundMembershipsRequest; +use Google\Cloud\GkeHub\V1\ListBoundMembershipsResponse; use Google\Cloud\GkeHub\V1\ListFeaturesRequest; use Google\Cloud\GkeHub\V1\ListFeaturesResponse; +use Google\Cloud\GkeHub\V1\ListFleetsRequest; +use Google\Cloud\GkeHub\V1\ListFleetsResponse; +use Google\Cloud\GkeHub\V1\ListMembershipBindingsRequest; +use Google\Cloud\GkeHub\V1\ListMembershipBindingsResponse; +use Google\Cloud\GkeHub\V1\ListMembershipRBACRoleBindingsRequest; +use Google\Cloud\GkeHub\V1\ListMembershipRBACRoleBindingsResponse; use Google\Cloud\GkeHub\V1\ListMembershipsRequest; use Google\Cloud\GkeHub\V1\ListMembershipsResponse; +use Google\Cloud\GkeHub\V1\ListPermittedScopesRequest; +use Google\Cloud\GkeHub\V1\ListPermittedScopesResponse; +use Google\Cloud\GkeHub\V1\ListScopeNamespacesRequest; +use Google\Cloud\GkeHub\V1\ListScopeNamespacesResponse; +use Google\Cloud\GkeHub\V1\ListScopeRBACRoleBindingsRequest; +use Google\Cloud\GkeHub\V1\ListScopeRBACRoleBindingsResponse; +use Google\Cloud\GkeHub\V1\ListScopesRequest; +use Google\Cloud\GkeHub\V1\ListScopesResponse; use Google\Cloud\GkeHub\V1\Membership; +use Google\Cloud\GkeHub\V1\MembershipBinding; +use Google\Cloud\GkeHub\V1\PBNamespace; +use Google\Cloud\GkeHub\V1\RBACRoleBinding; +use Google\Cloud\GkeHub\V1\RBACRoleBinding\Role; +use Google\Cloud\GkeHub\V1\Scope; use Google\Cloud\GkeHub\V1\UpdateFeatureRequest; +use Google\Cloud\GkeHub\V1\UpdateFleetRequest; +use Google\Cloud\GkeHub\V1\UpdateMembershipBindingRequest; +use Google\Cloud\GkeHub\V1\UpdateMembershipRBACRoleBindingRequest; use Google\Cloud\GkeHub\V1\UpdateMembershipRequest; +use Google\Cloud\GkeHub\V1\UpdateScopeNamespaceRequest; +use Google\Cloud\GkeHub\V1\UpdateScopeRBACRoleBindingRequest; +use Google\Cloud\GkeHub\V1\UpdateScopeRequest; use Google\LongRunning\Client\OperationsClient; use Google\LongRunning\GetOperationRequest; use Google\LongRunning\Operation; @@ -200,6 +248,138 @@ public function createFeatureExceptionTest() $this->assertTrue($operationsTransport->isExhausted()); } + /** @test */ + public function createFleetTest() + { + $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/createFleetTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $uid = 'uid115792'; + $expectedResponse = new Fleet(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setUid($uid); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createFleetTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $fleet = new Fleet(); + $request = (new CreateFleetRequest())->setParent($formattedParent)->setFleet($fleet); + $response = $gapicClient->createFleet($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.gkehub.v1.GkeHub/CreateFleet', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getFleet(); + $this->assertProtobufEquals($fleet, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createFleetTest'); + $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 createFleetExceptionTest() + { + $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/createFleetTest'); + $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]'); + $fleet = new Fleet(); + $request = (new CreateFleetRequest())->setParent($formattedParent)->setFleet($fleet); + $response = $gapicClient->createFleet($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createFleetTest'); + 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 createMembershipTest() { @@ -345,7 +525,7 @@ public function createMembershipExceptionTest() } /** @test */ - public function deleteFeatureTest() + public function createMembershipBindingTest() { $operationsTransport = $this->createTransport(); $operationsClient = new OperationsClient([ @@ -362,19 +542,32 @@ public function deleteFeatureTest() $this->assertTrue($operationsTransport->isExhausted()); // Mock response $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteFeatureTest'); + $incompleteOperation->setName('operations/createMembershipBindingTest'); $incompleteOperation->setDone(false); $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); + $scope = 'scope109264468'; + $name = 'name3373707'; + $uid = 'uid115792'; + $expectedResponse = new MembershipBinding(); + $expectedResponse->setScope($scope); + $expectedResponse->setName($name); + $expectedResponse->setUid($uid); $anyResponse = new Any(); $anyResponse->setValue($expectedResponse->serializeToString()); $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteFeatureTest'); + $completeOperation->setName('operations/createMembershipBindingTest'); $completeOperation->setDone(true); $completeOperation->setResponse($anyResponse); $operationsTransport->addResponse($completeOperation); - $request = new DeleteFeatureRequest(); - $response = $gapicClient->deleteFeature($request); + // Mock request + $formattedParent = $gapicClient->membershipName('[PROJECT]', '[LOCATION]', '[MEMBERSHIP]'); + $membershipBinding = new MembershipBinding(); + $membershipBindingId = 'membershipBindingId-1012849378'; + $request = (new CreateMembershipBindingRequest()) + ->setParent($formattedParent) + ->setMembershipBinding($membershipBinding) + ->setMembershipBindingId($membershipBindingId); + $response = $gapicClient->createMembershipBinding($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); $apiRequests = $transport->popReceivedCalls(); @@ -383,9 +576,15 @@ public function deleteFeatureTest() $this->assertSame(0, count($operationsRequestsEmpty)); $actualApiFuncCall = $apiRequests[0]->getFuncCall(); $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.gkehub.v1.GkeHub/DeleteFeature', $actualApiFuncCall); + $this->assertSame('/google.cloud.gkehub.v1.GkeHub/CreateMembershipBinding', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getMembershipBinding(); + $this->assertProtobufEquals($membershipBinding, $actualValue); + $actualValue = $actualApiRequestObject->getMembershipBindingId(); + $this->assertProtobufEquals($membershipBindingId, $actualValue); $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteFeatureTest'); + $expectedOperationsRequestObject->setName('operations/createMembershipBindingTest'); $response->pollUntilComplete([ 'initialPollDelayMillis' => 1, ]); @@ -404,7 +603,7 @@ public function deleteFeatureTest() } /** @test */ - public function deleteFeatureExceptionTest() + public function createMembershipBindingExceptionTest() { $operationsTransport = $this->createTransport(); $operationsClient = new OperationsClient([ @@ -421,7 +620,7 @@ public function deleteFeatureExceptionTest() $this->assertTrue($operationsTransport->isExhausted()); // Mock response $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteFeatureTest'); + $incompleteOperation->setName('operations/createMembershipBindingTest'); $incompleteOperation->setDone(false); $transport->addResponse($incompleteOperation); $status = new stdClass(); @@ -437,12 +636,19 @@ public function deleteFeatureExceptionTest() JSON_PRETTY_PRINT ); $operationsTransport->addResponse(null, $status); - $request = new DeleteFeatureRequest(); - $response = $gapicClient->deleteFeature($request); + // Mock request + $formattedParent = $gapicClient->membershipName('[PROJECT]', '[LOCATION]', '[MEMBERSHIP]'); + $membershipBinding = new MembershipBinding(); + $membershipBindingId = 'membershipBindingId-1012849378'; + $request = (new CreateMembershipBindingRequest()) + ->setParent($formattedParent) + ->setMembershipBinding($membershipBinding) + ->setMembershipBindingId($membershipBindingId); + $response = $gapicClient->createMembershipBinding($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteFeatureTest'); + $expectedOperationsRequestObject->setName('operations/createMembershipBindingTest'); try { $response->pollUntilComplete([ 'initialPollDelayMillis' => 1, @@ -461,7 +667,7 @@ public function deleteFeatureExceptionTest() } /** @test */ - public function deleteMembershipTest() + public function createMembershipRBACRoleBindingTest() { $operationsTransport = $this->createTransport(); $operationsClient = new OperationsClient([ @@ -478,21 +684,34 @@ public function deleteMembershipTest() $this->assertTrue($operationsTransport->isExhausted()); // Mock response $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteMembershipTest'); + $incompleteOperation->setName('operations/createMembershipRBACRoleBindingTest'); $incompleteOperation->setDone(false); $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); + $user = 'user3599307'; + $name = 'name3373707'; + $uid = 'uid115792'; + $expectedResponse = new RBACRoleBinding(); + $expectedResponse->setUser($user); + $expectedResponse->setName($name); + $expectedResponse->setUid($uid); $anyResponse = new Any(); $anyResponse->setValue($expectedResponse->serializeToString()); $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteMembershipTest'); + $completeOperation->setName('operations/createMembershipRBACRoleBindingTest'); $completeOperation->setDone(true); $completeOperation->setResponse($anyResponse); $operationsTransport->addResponse($completeOperation); // Mock request - $formattedName = $gapicClient->membershipName('[PROJECT]', '[LOCATION]', '[MEMBERSHIP]'); - $request = (new DeleteMembershipRequest())->setName($formattedName); - $response = $gapicClient->deleteMembership($request); + $formattedParent = $gapicClient->scopeName('[PROJECT]', '[LOCATION]', '[SCOPE]'); + $rbacrolebindingId = 'rbacrolebindingId-114871075'; + $rbacrolebinding = new RBACRoleBinding(); + $rbacrolebindingRole = new Role(); + $rbacrolebinding->setRole($rbacrolebindingRole); + $request = (new CreateMembershipRBACRoleBindingRequest()) + ->setParent($formattedParent) + ->setRbacrolebindingId($rbacrolebindingId) + ->setRbacrolebinding($rbacrolebinding); + $response = $gapicClient->createMembershipRBACRoleBinding($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); $apiRequests = $transport->popReceivedCalls(); @@ -501,11 +720,15 @@ public function deleteMembershipTest() $this->assertSame(0, count($operationsRequestsEmpty)); $actualApiFuncCall = $apiRequests[0]->getFuncCall(); $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.gkehub.v1.GkeHub/DeleteMembership', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertSame('/google.cloud.gkehub.v1.GkeHub/CreateMembershipRBACRoleBinding', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getRbacrolebindingId(); + $this->assertProtobufEquals($rbacrolebindingId, $actualValue); + $actualValue = $actualApiRequestObject->getRbacrolebinding(); + $this->assertProtobufEquals($rbacrolebinding, $actualValue); $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteMembershipTest'); + $expectedOperationsRequestObject->setName('operations/createMembershipRBACRoleBindingTest'); $response->pollUntilComplete([ 'initialPollDelayMillis' => 1, ]); @@ -524,7 +747,7 @@ public function deleteMembershipTest() } /** @test */ - public function deleteMembershipExceptionTest() + public function createMembershipRBACRoleBindingExceptionTest() { $operationsTransport = $this->createTransport(); $operationsClient = new OperationsClient([ @@ -541,7 +764,7 @@ public function deleteMembershipExceptionTest() $this->assertTrue($operationsTransport->isExhausted()); // Mock response $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteMembershipTest'); + $incompleteOperation->setName('operations/createMembershipRBACRoleBindingTest'); $incompleteOperation->setDone(false); $transport->addResponse($incompleteOperation); $status = new stdClass(); @@ -558,13 +781,20 @@ public function deleteMembershipExceptionTest() ); $operationsTransport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->membershipName('[PROJECT]', '[LOCATION]', '[MEMBERSHIP]'); - $request = (new DeleteMembershipRequest())->setName($formattedName); - $response = $gapicClient->deleteMembership($request); + $formattedParent = $gapicClient->scopeName('[PROJECT]', '[LOCATION]', '[SCOPE]'); + $rbacrolebindingId = 'rbacrolebindingId-114871075'; + $rbacrolebinding = new RBACRoleBinding(); + $rbacrolebindingRole = new Role(); + $rbacrolebinding->setRole($rbacrolebindingRole); + $request = (new CreateMembershipRBACRoleBindingRequest()) + ->setParent($formattedParent) + ->setRbacrolebindingId($rbacrolebindingId) + ->setRbacrolebinding($rbacrolebinding); + $response = $gapicClient->createMembershipRBACRoleBinding($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteMembershipTest'); + $expectedOperationsRequestObject->setName('operations/createMembershipRBACRoleBindingTest'); try { $response->pollUntilComplete([ 'initialPollDelayMillis' => 1, @@ -583,39 +813,102 @@ public function deleteMembershipExceptionTest() } /** @test */ - public function generateConnectManifestTest() + public function createScopeTest() { + $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 - $expectedResponse = new GenerateConnectManifestResponse(); - $transport->addResponse($expectedResponse); + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createScopeTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $uid = 'uid115792'; + $expectedResponse = new Scope(); + $expectedResponse->setName($name); + $expectedResponse->setUid($uid); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createScopeTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); // Mock request - $formattedName = $gapicClient->membershipName('[PROJECT]', '[LOCATION]', '[MEMBERSHIP]'); - $request = (new GenerateConnectManifestRequest())->setName($formattedName); - $response = $gapicClient->generateConnectManifest($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.gkehub.v1.GkeHub/GenerateConnectManifest', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $scopeId = 'scopeId-487349530'; + $scope = new Scope(); + $request = (new CreateScopeRequest()) + ->setParent($formattedParent) + ->setScopeId($scopeId) + ->setScope($scope); + $response = $gapicClient->createScope($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.gkehub.v1.GkeHub/CreateScope', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getScopeId(); + $this->assertProtobufEquals($scopeId, $actualValue); + $actualValue = $actualApiRequestObject->getScope(); + $this->assertProtobufEquals($scope, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createScopeTest'); + $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 generateConnectManifestExceptionTest() + public function createScopeExceptionTest() { + $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/createScopeTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; @@ -628,55 +921,2922 @@ public function generateConnectManifestExceptionTest() ], JSON_PRETTY_PRINT ); - $transport->addResponse(null, $status); + $operationsTransport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->membershipName('[PROJECT]', '[LOCATION]', '[MEMBERSHIP]'); - $request = (new GenerateConnectManifestRequest())->setName($formattedName); + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $scopeId = 'scopeId-487349530'; + $scope = new Scope(); + $request = (new CreateScopeRequest()) + ->setParent($formattedParent) + ->setScopeId($scopeId) + ->setScope($scope); + $response = $gapicClient->createScope($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createScopeTest'); try { - $gapicClient->generateConnectManifest($request); - // If the $gapicClient method call did not throw, fail the test + $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 stub is exhausted + // Call popReceivedCalls to ensure the stubs are exhausted $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); } /** @test */ - public function getFeatureTest() + public function createScopeNamespaceTest() { + $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/createScopeNamespaceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $uid = 'uid115792'; + $scope = 'scope109264468'; + $expectedResponse = new PBNamespace(); + $expectedResponse->setName($name); + $expectedResponse->setUid($uid); + $expectedResponse->setScope($scope); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createScopeNamespaceTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->scopeName('[PROJECT]', '[LOCATION]', '[SCOPE]'); + $scopeNamespaceId = 'scopeNamespaceId-236818806'; + $scopeNamespace = new PBNamespace(); + $scopeNamespaceScope = $gapicClient->scopeName('[PROJECT]', '[LOCATION]', '[SCOPE]'); + $scopeNamespace->setScope($scopeNamespaceScope); + $request = (new CreateScopeNamespaceRequest()) + ->setParent($formattedParent) + ->setScopeNamespaceId($scopeNamespaceId) + ->setScopeNamespace($scopeNamespace); + $response = $gapicClient->createScopeNamespace($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.gkehub.v1.GkeHub/CreateScopeNamespace', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getScopeNamespaceId(); + $this->assertProtobufEquals($scopeNamespaceId, $actualValue); + $actualValue = $actualApiRequestObject->getScopeNamespace(); + $this->assertProtobufEquals($scopeNamespace, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createScopeNamespaceTest'); + $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 createScopeNamespaceExceptionTest() + { + $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/createScopeNamespaceTest'); + $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->scopeName('[PROJECT]', '[LOCATION]', '[SCOPE]'); + $scopeNamespaceId = 'scopeNamespaceId-236818806'; + $scopeNamespace = new PBNamespace(); + $scopeNamespaceScope = $gapicClient->scopeName('[PROJECT]', '[LOCATION]', '[SCOPE]'); + $scopeNamespace->setScope($scopeNamespaceScope); + $request = (new CreateScopeNamespaceRequest()) + ->setParent($formattedParent) + ->setScopeNamespaceId($scopeNamespaceId) + ->setScopeNamespace($scopeNamespace); + $response = $gapicClient->createScopeNamespace($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createScopeNamespaceTest'); + 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 createScopeRBACRoleBindingTest() + { + $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/createScopeRBACRoleBindingTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $user = 'user3599307'; + $name = 'name3373707'; + $uid = 'uid115792'; + $expectedResponse = new RBACRoleBinding(); + $expectedResponse->setUser($user); + $expectedResponse->setName($name); + $expectedResponse->setUid($uid); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createScopeRBACRoleBindingTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->scopeName('[PROJECT]', '[LOCATION]', '[SCOPE]'); + $rbacrolebindingId = 'rbacrolebindingId-114871075'; + $rbacrolebinding = new RBACRoleBinding(); + $rbacrolebindingRole = new Role(); + $rbacrolebinding->setRole($rbacrolebindingRole); + $request = (new CreateScopeRBACRoleBindingRequest()) + ->setParent($formattedParent) + ->setRbacrolebindingId($rbacrolebindingId) + ->setRbacrolebinding($rbacrolebinding); + $response = $gapicClient->createScopeRBACRoleBinding($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.gkehub.v1.GkeHub/CreateScopeRBACRoleBinding', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getRbacrolebindingId(); + $this->assertProtobufEquals($rbacrolebindingId, $actualValue); + $actualValue = $actualApiRequestObject->getRbacrolebinding(); + $this->assertProtobufEquals($rbacrolebinding, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createScopeRBACRoleBindingTest'); + $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 createScopeRBACRoleBindingExceptionTest() + { + $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/createScopeRBACRoleBindingTest'); + $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->scopeName('[PROJECT]', '[LOCATION]', '[SCOPE]'); + $rbacrolebindingId = 'rbacrolebindingId-114871075'; + $rbacrolebinding = new RBACRoleBinding(); + $rbacrolebindingRole = new Role(); + $rbacrolebinding->setRole($rbacrolebindingRole); + $request = (new CreateScopeRBACRoleBindingRequest()) + ->setParent($formattedParent) + ->setRbacrolebindingId($rbacrolebindingId) + ->setRbacrolebinding($rbacrolebinding); + $response = $gapicClient->createScopeRBACRoleBinding($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createScopeRBACRoleBindingTest'); + 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 deleteFeatureTest() + { + $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/deleteFeatureTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteFeatureTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + $request = new DeleteFeatureRequest(); + $response = $gapicClient->deleteFeature($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.gkehub.v1.GkeHub/DeleteFeature', $actualApiFuncCall); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteFeatureTest'); + $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 deleteFeatureExceptionTest() + { + $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/deleteFeatureTest'); + $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); + $request = new DeleteFeatureRequest(); + $response = $gapicClient->deleteFeature($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteFeatureTest'); + 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 deleteFleetTest() + { + $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/deleteFleetTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteFleetTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->fleetName('[PROJECT]', '[LOCATION]', '[FLEET]'); + $request = (new DeleteFleetRequest())->setName($formattedName); + $response = $gapicClient->deleteFleet($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.gkehub.v1.GkeHub/DeleteFleet', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteFleetTest'); + $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 deleteFleetExceptionTest() + { + $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/deleteFleetTest'); + $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->fleetName('[PROJECT]', '[LOCATION]', '[FLEET]'); + $request = (new DeleteFleetRequest())->setName($formattedName); + $response = $gapicClient->deleteFleet($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteFleetTest'); + 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 deleteMembershipTest() + { + $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/deleteMembershipTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteMembershipTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->membershipName('[PROJECT]', '[LOCATION]', '[MEMBERSHIP]'); + $request = (new DeleteMembershipRequest())->setName($formattedName); + $response = $gapicClient->deleteMembership($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.gkehub.v1.GkeHub/DeleteMembership', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteMembershipTest'); + $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 deleteMembershipExceptionTest() + { + $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/deleteMembershipTest'); + $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->membershipName('[PROJECT]', '[LOCATION]', '[MEMBERSHIP]'); + $request = (new DeleteMembershipRequest())->setName($formattedName); + $response = $gapicClient->deleteMembership($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteMembershipTest'); + 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 deleteMembershipBindingTest() + { + $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/deleteMembershipBindingTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteMembershipBindingTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->membershipBindingName( + '[PROJECT]', + '[LOCATION]', + '[MEMBERSHIP]', + '[MEMBERSHIPBINDING]' + ); + $request = (new DeleteMembershipBindingRequest())->setName($formattedName); + $response = $gapicClient->deleteMembershipBinding($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.gkehub.v1.GkeHub/DeleteMembershipBinding', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteMembershipBindingTest'); + $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 deleteMembershipBindingExceptionTest() + { + $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/deleteMembershipBindingTest'); + $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->membershipBindingName( + '[PROJECT]', + '[LOCATION]', + '[MEMBERSHIP]', + '[MEMBERSHIPBINDING]' + ); + $request = (new DeleteMembershipBindingRequest())->setName($formattedName); + $response = $gapicClient->deleteMembershipBinding($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteMembershipBindingTest'); + 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 deleteMembershipRBACRoleBindingTest() + { + $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/deleteMembershipRBACRoleBindingTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteMembershipRBACRoleBindingTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->rBACRoleBindingName('[PROJECT]', '[LOCATION]', '[SCOPE]', '[RBACROLEBINDING]'); + $request = (new DeleteMembershipRBACRoleBindingRequest())->setName($formattedName); + $response = $gapicClient->deleteMembershipRBACRoleBinding($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.gkehub.v1.GkeHub/DeleteMembershipRBACRoleBinding', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteMembershipRBACRoleBindingTest'); + $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 deleteMembershipRBACRoleBindingExceptionTest() + { + $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/deleteMembershipRBACRoleBindingTest'); + $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->rBACRoleBindingName('[PROJECT]', '[LOCATION]', '[SCOPE]', '[RBACROLEBINDING]'); + $request = (new DeleteMembershipRBACRoleBindingRequest())->setName($formattedName); + $response = $gapicClient->deleteMembershipRBACRoleBinding($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteMembershipRBACRoleBindingTest'); + 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 deleteScopeTest() + { + $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/deleteScopeTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteScopeTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->scopeName('[PROJECT]', '[LOCATION]', '[SCOPE]'); + $request = (new DeleteScopeRequest())->setName($formattedName); + $response = $gapicClient->deleteScope($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.gkehub.v1.GkeHub/DeleteScope', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteScopeTest'); + $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 deleteScopeExceptionTest() + { + $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/deleteScopeTest'); + $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->scopeName('[PROJECT]', '[LOCATION]', '[SCOPE]'); + $request = (new DeleteScopeRequest())->setName($formattedName); + $response = $gapicClient->deleteScope($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteScopeTest'); + 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 deleteScopeNamespaceTest() + { + $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/deleteScopeNamespaceTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteScopeNamespaceTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->namespaceName('[PROJECT]', '[LOCATION]', '[SCOPE]', '[NAMESPACE]'); + $request = (new DeleteScopeNamespaceRequest())->setName($formattedName); + $response = $gapicClient->deleteScopeNamespace($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.gkehub.v1.GkeHub/DeleteScopeNamespace', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteScopeNamespaceTest'); + $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 deleteScopeNamespaceExceptionTest() + { + $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/deleteScopeNamespaceTest'); + $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->namespaceName('[PROJECT]', '[LOCATION]', '[SCOPE]', '[NAMESPACE]'); + $request = (new DeleteScopeNamespaceRequest())->setName($formattedName); + $response = $gapicClient->deleteScopeNamespace($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteScopeNamespaceTest'); + 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 deleteScopeRBACRoleBindingTest() + { + $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/deleteScopeRBACRoleBindingTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteScopeRBACRoleBindingTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->rBACRoleBindingName('[PROJECT]', '[LOCATION]', '[SCOPE]', '[RBACROLEBINDING]'); + $request = (new DeleteScopeRBACRoleBindingRequest())->setName($formattedName); + $response = $gapicClient->deleteScopeRBACRoleBinding($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.gkehub.v1.GkeHub/DeleteScopeRBACRoleBinding', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteScopeRBACRoleBindingTest'); + $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 deleteScopeRBACRoleBindingExceptionTest() + { + $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/deleteScopeRBACRoleBindingTest'); + $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->rBACRoleBindingName('[PROJECT]', '[LOCATION]', '[SCOPE]', '[RBACROLEBINDING]'); + $request = (new DeleteScopeRBACRoleBindingRequest())->setName($formattedName); + $response = $gapicClient->deleteScopeRBACRoleBinding($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteScopeRBACRoleBindingTest'); + 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 generateConnectManifestTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GenerateConnectManifestResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->membershipName('[PROJECT]', '[LOCATION]', '[MEMBERSHIP]'); + $request = (new GenerateConnectManifestRequest())->setName($formattedName); + $response = $gapicClient->generateConnectManifest($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.gkehub.v1.GkeHub/GenerateConnectManifest', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function generateConnectManifestExceptionTest() + { + $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->membershipName('[PROJECT]', '[LOCATION]', '[MEMBERSHIP]'); + $request = (new GenerateConnectManifestRequest())->setName($formattedName); + try { + $gapicClient->generateConnectManifest($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 generateMembershipRBACRoleBindingYAMLTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $roleBindingsYaml = 'roleBindingsYaml1394984367'; + $expectedResponse = new GenerateMembershipRBACRoleBindingYAMLResponse(); + $expectedResponse->setRoleBindingsYaml($roleBindingsYaml); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->membershipName('[PROJECT]', '[LOCATION]', '[MEMBERSHIP]'); + $rbacrolebindingId = 'rbacrolebindingId-114871075'; + $rbacrolebinding = new RBACRoleBinding(); + $rbacrolebindingRole = new Role(); + $rbacrolebinding->setRole($rbacrolebindingRole); + $request = (new GenerateMembershipRBACRoleBindingYAMLRequest()) + ->setParent($formattedParent) + ->setRbacrolebindingId($rbacrolebindingId) + ->setRbacrolebinding($rbacrolebinding); + $response = $gapicClient->generateMembershipRBACRoleBindingYAML($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.gkehub.v1.GkeHub/GenerateMembershipRBACRoleBindingYAML', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getRbacrolebindingId(); + $this->assertProtobufEquals($rbacrolebindingId, $actualValue); + $actualValue = $actualRequestObject->getRbacrolebinding(); + $this->assertProtobufEquals($rbacrolebinding, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function generateMembershipRBACRoleBindingYAMLExceptionTest() + { + $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->membershipName('[PROJECT]', '[LOCATION]', '[MEMBERSHIP]'); + $rbacrolebindingId = 'rbacrolebindingId-114871075'; + $rbacrolebinding = new RBACRoleBinding(); + $rbacrolebindingRole = new Role(); + $rbacrolebinding->setRole($rbacrolebindingRole); + $request = (new GenerateMembershipRBACRoleBindingYAMLRequest()) + ->setParent($formattedParent) + ->setRbacrolebindingId($rbacrolebindingId) + ->setRbacrolebinding($rbacrolebinding); + try { + $gapicClient->generateMembershipRBACRoleBindingYAML($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 getFeatureTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $expectedResponse = new Feature(); + $expectedResponse->setName($name2); + $transport->addResponse($expectedResponse); + $request = new GetFeatureRequest(); + $response = $gapicClient->getFeature($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.gkehub.v1.GkeHub/GetFeature', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getFeatureExceptionTest() + { + $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 GetFeatureRequest(); + try { + $gapicClient->getFeature($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 getFleetTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $displayName = 'displayName1615086568'; + $uid = 'uid115792'; + $expectedResponse = new Fleet(); + $expectedResponse->setName($name2); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setUid($uid); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->fleetName('[PROJECT]', '[LOCATION]', '[FLEET]'); + $request = (new GetFleetRequest())->setName($formattedName); + $response = $gapicClient->getFleet($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.gkehub.v1.GkeHub/GetFleet', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getFleetExceptionTest() + { + $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->fleetName('[PROJECT]', '[LOCATION]', '[FLEET]'); + $request = (new GetFleetRequest())->setName($formattedName); + try { + $gapicClient->getFleet($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 getMembershipTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $description = 'description-1724546052'; + $externalId = 'externalId-1153075697'; + $uniqueId = 'uniqueId-538310583'; + $expectedResponse = new Membership(); + $expectedResponse->setName($name2); + $expectedResponse->setDescription($description); + $expectedResponse->setExternalId($externalId); + $expectedResponse->setUniqueId($uniqueId); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->membershipName('[PROJECT]', '[LOCATION]', '[MEMBERSHIP]'); + $request = (new GetMembershipRequest())->setName($formattedName); + $response = $gapicClient->getMembership($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.gkehub.v1.GkeHub/GetMembership', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getMembershipExceptionTest() + { + $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->membershipName('[PROJECT]', '[LOCATION]', '[MEMBERSHIP]'); + $request = (new GetMembershipRequest())->setName($formattedName); + try { + $gapicClient->getMembership($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 getMembershipBindingTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $scope = 'scope109264468'; + $name2 = 'name2-1052831874'; + $uid = 'uid115792'; + $expectedResponse = new MembershipBinding(); + $expectedResponse->setScope($scope); + $expectedResponse->setName($name2); + $expectedResponse->setUid($uid); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->membershipBindingName( + '[PROJECT]', + '[LOCATION]', + '[MEMBERSHIP]', + '[MEMBERSHIPBINDING]' + ); + $request = (new GetMembershipBindingRequest())->setName($formattedName); + $response = $gapicClient->getMembershipBinding($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.gkehub.v1.GkeHub/GetMembershipBinding', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getMembershipBindingExceptionTest() + { + $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->membershipBindingName( + '[PROJECT]', + '[LOCATION]', + '[MEMBERSHIP]', + '[MEMBERSHIPBINDING]' + ); + $request = (new GetMembershipBindingRequest())->setName($formattedName); + try { + $gapicClient->getMembershipBinding($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 getMembershipRBACRoleBindingTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $user = 'user3599307'; $name2 = 'name2-1052831874'; - $expectedResponse = new Feature(); + $uid = 'uid115792'; + $expectedResponse = new RBACRoleBinding(); + $expectedResponse->setUser($user); + $expectedResponse->setName($name2); + $expectedResponse->setUid($uid); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->rBACRoleBindingName('[PROJECT]', '[LOCATION]', '[SCOPE]', '[RBACROLEBINDING]'); + $request = (new GetMembershipRBACRoleBindingRequest())->setName($formattedName); + $response = $gapicClient->getMembershipRBACRoleBinding($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.gkehub.v1.GkeHub/GetMembershipRBACRoleBinding', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getMembershipRBACRoleBindingExceptionTest() + { + $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->rBACRoleBindingName('[PROJECT]', '[LOCATION]', '[SCOPE]', '[RBACROLEBINDING]'); + $request = (new GetMembershipRBACRoleBindingRequest())->setName($formattedName); + try { + $gapicClient->getMembershipRBACRoleBinding($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 getScopeTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $uid = 'uid115792'; + $expectedResponse = new Scope(); + $expectedResponse->setName($name2); + $expectedResponse->setUid($uid); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->scopeName('[PROJECT]', '[LOCATION]', '[SCOPE]'); + $request = (new GetScopeRequest())->setName($formattedName); + $response = $gapicClient->getScope($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.gkehub.v1.GkeHub/GetScope', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getScopeExceptionTest() + { + $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->scopeName('[PROJECT]', '[LOCATION]', '[SCOPE]'); + $request = (new GetScopeRequest())->setName($formattedName); + try { + $gapicClient->getScope($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 getScopeNamespaceTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $uid = 'uid115792'; + $scope = 'scope109264468'; + $expectedResponse = new PBNamespace(); + $expectedResponse->setName($name2); + $expectedResponse->setUid($uid); + $expectedResponse->setScope($scope); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->namespaceName('[PROJECT]', '[LOCATION]', '[SCOPE]', '[NAMESPACE]'); + $request = (new GetScopeNamespaceRequest())->setName($formattedName); + $response = $gapicClient->getScopeNamespace($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.gkehub.v1.GkeHub/GetScopeNamespace', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getScopeNamespaceExceptionTest() + { + $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->namespaceName('[PROJECT]', '[LOCATION]', '[SCOPE]', '[NAMESPACE]'); + $request = (new GetScopeNamespaceRequest())->setName($formattedName); + try { + $gapicClient->getScopeNamespace($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 getScopeRBACRoleBindingTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $user = 'user3599307'; + $name2 = 'name2-1052831874'; + $uid = 'uid115792'; + $expectedResponse = new RBACRoleBinding(); + $expectedResponse->setUser($user); $expectedResponse->setName($name2); + $expectedResponse->setUid($uid); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->rBACRoleBindingName('[PROJECT]', '[LOCATION]', '[SCOPE]', '[RBACROLEBINDING]'); + $request = (new GetScopeRBACRoleBindingRequest())->setName($formattedName); + $response = $gapicClient->getScopeRBACRoleBinding($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.gkehub.v1.GkeHub/GetScopeRBACRoleBinding', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getScopeRBACRoleBindingExceptionTest() + { + $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->rBACRoleBindingName('[PROJECT]', '[LOCATION]', '[SCOPE]', '[RBACROLEBINDING]'); + $request = (new GetScopeRBACRoleBindingRequest())->setName($formattedName); + try { + $gapicClient->getScopeRBACRoleBinding($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 listBoundMembershipsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $membershipsElement = new Membership(); + $memberships = [$membershipsElement]; + $expectedResponse = new ListBoundMembershipsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setMemberships($memberships); + $transport->addResponse($expectedResponse); + // Mock request + $formattedScopeName = $gapicClient->scopeName('[PROJECT]', '[LOCATION]', '[SCOPE]'); + $request = (new ListBoundMembershipsRequest())->setScopeName($formattedScopeName); + $response = $gapicClient->listBoundMemberships($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getMemberships()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.gkehub.v1.GkeHub/ListBoundMemberships', $actualFuncCall); + $actualValue = $actualRequestObject->getScopeName(); + $this->assertProtobufEquals($formattedScopeName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listBoundMembershipsExceptionTest() + { + $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 + $formattedScopeName = $gapicClient->scopeName('[PROJECT]', '[LOCATION]', '[SCOPE]'); + $request = (new ListBoundMembershipsRequest())->setScopeName($formattedScopeName); + try { + $gapicClient->listBoundMemberships($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 listFeaturesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $resourcesElement = new Feature(); + $resources = [$resourcesElement]; + $expectedResponse = new ListFeaturesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setResources($resources); + $transport->addResponse($expectedResponse); + $request = new ListFeaturesRequest(); + $response = $gapicClient->listFeatures($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getResources()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.gkehub.v1.GkeHub/ListFeatures', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listFeaturesExceptionTest() + { + $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 ListFeaturesRequest(); + try { + $gapicClient->listFeatures($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 listFleetsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $fleetsElement = new Fleet(); + $fleets = [$fleetsElement]; + $expectedResponse = new ListFleetsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setFleets($fleets); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListFleetsRequest())->setParent($formattedParent); + $response = $gapicClient->listFleets($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getFleets()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.gkehub.v1.GkeHub/ListFleets', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listFleetsExceptionTest() + { + $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 ListFleetsRequest())->setParent($formattedParent); + try { + $gapicClient->listFleets($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 listMembershipBindingsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $membershipBindingsElement = new MembershipBinding(); + $membershipBindings = [$membershipBindingsElement]; + $expectedResponse = new ListMembershipBindingsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setMembershipBindings($membershipBindings); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->membershipName('[PROJECT]', '[LOCATION]', '[MEMBERSHIP]'); + $request = (new ListMembershipBindingsRequest())->setParent($formattedParent); + $response = $gapicClient->listMembershipBindings($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getMembershipBindings()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.gkehub.v1.GkeHub/ListMembershipBindings', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listMembershipBindingsExceptionTest() + { + $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->membershipName('[PROJECT]', '[LOCATION]', '[MEMBERSHIP]'); + $request = (new ListMembershipBindingsRequest())->setParent($formattedParent); + try { + $gapicClient->listMembershipBindings($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 listMembershipRBACRoleBindingsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $rbacrolebindingsElement = new RBACRoleBinding(); + $rbacrolebindings = [$rbacrolebindingsElement]; + $expectedResponse = new ListMembershipRBACRoleBindingsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setRbacrolebindings($rbacrolebindings); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->scopeName('[PROJECT]', '[LOCATION]', '[SCOPE]'); + $request = (new ListMembershipRBACRoleBindingsRequest())->setParent($formattedParent); + $response = $gapicClient->listMembershipRBACRoleBindings($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getRbacrolebindings()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.gkehub.v1.GkeHub/ListMembershipRBACRoleBindings', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listMembershipRBACRoleBindingsExceptionTest() + { + $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->scopeName('[PROJECT]', '[LOCATION]', '[SCOPE]'); + $request = (new ListMembershipRBACRoleBindingsRequest())->setParent($formattedParent); + try { + $gapicClient->listMembershipRBACRoleBindings($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 listMembershipsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $resourcesElement = new Membership(); + $resources = [$resourcesElement]; + $expectedResponse = new ListMembershipsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setResources($resources); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListMembershipsRequest())->setParent($formattedParent); + $response = $gapicClient->listMemberships($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getResources()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.gkehub.v1.GkeHub/ListMemberships', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listMembershipsExceptionTest() + { + $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 ListMembershipsRequest())->setParent($formattedParent); + try { + $gapicClient->listMemberships($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 listPermittedScopesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $scopesElement = new Scope(); + $scopes = [$scopesElement]; + $expectedResponse = new ListPermittedScopesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setScopes($scopes); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListPermittedScopesRequest())->setParent($formattedParent); + $response = $gapicClient->listPermittedScopes($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getScopes()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.gkehub.v1.GkeHub/ListPermittedScopes', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listPermittedScopesExceptionTest() + { + $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 ListPermittedScopesRequest())->setParent($formattedParent); + try { + $gapicClient->listPermittedScopes($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 listScopeNamespacesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $scopeNamespacesElement = new PBNamespace(); + $scopeNamespaces = [$scopeNamespacesElement]; + $expectedResponse = new ListScopeNamespacesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setScopeNamespaces($scopeNamespaces); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->scopeName('[PROJECT]', '[LOCATION]', '[SCOPE]'); + $request = (new ListScopeNamespacesRequest())->setParent($formattedParent); + $response = $gapicClient->listScopeNamespaces($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getScopeNamespaces()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.gkehub.v1.GkeHub/ListScopeNamespaces', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listScopeNamespacesExceptionTest() + { + $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->scopeName('[PROJECT]', '[LOCATION]', '[SCOPE]'); + $request = (new ListScopeNamespacesRequest())->setParent($formattedParent); + try { + $gapicClient->listScopeNamespaces($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 listScopeRBACRoleBindingsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $rbacrolebindingsElement = new RBACRoleBinding(); + $rbacrolebindings = [$rbacrolebindingsElement]; + $expectedResponse = new ListScopeRBACRoleBindingsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setRbacrolebindings($rbacrolebindings); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->scopeName('[PROJECT]', '[LOCATION]', '[SCOPE]'); + $request = (new ListScopeRBACRoleBindingsRequest())->setParent($formattedParent); + $response = $gapicClient->listScopeRBACRoleBindings($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getRbacrolebindings()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.gkehub.v1.GkeHub/ListScopeRBACRoleBindings', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listScopeRBACRoleBindingsExceptionTest() + { + $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->scopeName('[PROJECT]', '[LOCATION]', '[SCOPE]'); + $request = (new ListScopeRBACRoleBindingsRequest())->setParent($formattedParent); + try { + $gapicClient->listScopeRBACRoleBindings($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 listScopesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $scopesElement = new Scope(); + $scopes = [$scopesElement]; + $expectedResponse = new ListScopesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setScopes($scopes); $transport->addResponse($expectedResponse); - $request = new GetFeatureRequest(); - $response = $gapicClient->getFeature($request); - $this->assertEquals($expectedResponse, $response); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListScopesRequest())->setParent($formattedParent); + $response = $gapicClient->listScopes($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getScopes()[0], $resources[0]); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.gkehub.v1.GkeHub/GetFeature', $actualFuncCall); + $this->assertSame('/google.cloud.gkehub.v1.GkeHub/ListScopes', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listScopesExceptionTest() + { + $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 ListScopesRequest())->setParent($formattedParent); + try { + $gapicClient->listScopes($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 updateFeatureTest() + { + $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/updateFeatureTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $expectedResponse = new Feature(); + $expectedResponse->setName($name2); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateFeatureTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + $request = new UpdateFeatureRequest(); + $response = $gapicClient->updateFeature($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.gkehub.v1.GkeHub/UpdateFeature', $actualApiFuncCall); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateFeatureTest'); + $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 updateFeatureExceptionTest() + { + $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/updateFeatureTest'); + $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); + $request = new UpdateFeatureRequest(); + $response = $gapicClient->updateFeature($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateFeatureTest'); + 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 updateFleetTest() + { + $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/updateFleetTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $displayName = 'displayName1615086568'; + $uid = 'uid115792'; + $expectedResponse = new Fleet(); + $expectedResponse->setName($name); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setUid($uid); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateFleetTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $fleet = new Fleet(); + $updateMask = new FieldMask(); + $request = (new UpdateFleetRequest())->setFleet($fleet)->setUpdateMask($updateMask); + $response = $gapicClient->updateFleet($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.gkehub.v1.GkeHub/UpdateFleet', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getFleet(); + $this->assertProtobufEquals($fleet, $actualValue); + $actualValue = $actualApiRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateFleetTest'); + $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 getFeatureExceptionTest() + public function updateFleetExceptionTest() { + $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/updateFleetTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; @@ -689,30 +3849,54 @@ public function getFeatureExceptionTest() ], JSON_PRETTY_PRINT ); - $transport->addResponse(null, $status); - $request = new GetFeatureRequest(); + $operationsTransport->addResponse(null, $status); + // Mock request + $fleet = new Fleet(); + $updateMask = new FieldMask(); + $request = (new UpdateFleetRequest())->setFleet($fleet)->setUpdateMask($updateMask); + $response = $gapicClient->updateFleet($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateFleetTest'); try { - $gapicClient->getFeature($request); - // If the $gapicClient method call did not throw, fail the test + $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 stub is exhausted + // Call popReceivedCalls to ensure the stubs are exhausted $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); } /** @test */ - public function getMembershipTest() + public function updateMembershipTest() { + $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/updateMembershipTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); $name2 = 'name2-1052831874'; $description = 'description-1724546052'; $externalId = 'externalId-1153075697'; @@ -722,30 +3906,77 @@ public function getMembershipTest() $expectedResponse->setDescription($description); $expectedResponse->setExternalId($externalId); $expectedResponse->setUniqueId($uniqueId); - $transport->addResponse($expectedResponse); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateMembershipTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); // Mock request $formattedName = $gapicClient->membershipName('[PROJECT]', '[LOCATION]', '[MEMBERSHIP]'); - $request = (new GetMembershipRequest())->setName($formattedName); - $response = $gapicClient->getMembership($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.gkehub.v1.GkeHub/GetMembership', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); + $updateMask = new FieldMask(); + $resource = new Membership(); + $request = (new UpdateMembershipRequest()) + ->setName($formattedName) + ->setUpdateMask($updateMask) + ->setResource($resource); + $response = $gapicClient->updateMembership($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.gkehub.v1.GkeHub/UpdateMembership', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualApiRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $actualValue = $actualApiRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateMembershipTest'); + $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 getMembershipExceptionTest() + public function updateMembershipExceptionTest() { + $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/updateMembershipTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; @@ -758,61 +3989,270 @@ public function getMembershipExceptionTest() ], JSON_PRETTY_PRINT ); - $transport->addResponse(null, $status); + $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->membershipName('[PROJECT]', '[LOCATION]', '[MEMBERSHIP]'); - $request = (new GetMembershipRequest())->setName($formattedName); + $updateMask = new FieldMask(); + $resource = new Membership(); + $request = (new UpdateMembershipRequest()) + ->setName($formattedName) + ->setUpdateMask($updateMask) + ->setResource($resource); + $response = $gapicClient->updateMembership($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateMembershipTest'); try { - $gapicClient->getMembership($request); - // If the $gapicClient method call did not throw, fail the test + $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 stub is exhausted + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateMembershipBindingTest() + { + $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/updateMembershipBindingTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $scope = 'scope109264468'; + $name = 'name3373707'; + $uid = 'uid115792'; + $expectedResponse = new MembershipBinding(); + $expectedResponse->setScope($scope); + $expectedResponse->setName($name); + $expectedResponse->setUid($uid); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateMembershipBindingTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $membershipBinding = new MembershipBinding(); + $updateMask = new FieldMask(); + $request = (new UpdateMembershipBindingRequest()) + ->setMembershipBinding($membershipBinding) + ->setUpdateMask($updateMask); + $response = $gapicClient->updateMembershipBinding($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.gkehub.v1.GkeHub/UpdateMembershipBinding', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getMembershipBinding(); + $this->assertProtobufEquals($membershipBinding, $actualValue); + $actualValue = $actualApiRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateMembershipBindingTest'); + $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 updateMembershipBindingExceptionTest() + { + $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/updateMembershipBindingTest'); + $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 + $membershipBinding = new MembershipBinding(); + $updateMask = new FieldMask(); + $request = (new UpdateMembershipBindingRequest()) + ->setMembershipBinding($membershipBinding) + ->setUpdateMask($updateMask); + $response = $gapicClient->updateMembershipBinding($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateMembershipBindingTest'); + 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 listFeaturesTest() + public function updateMembershipRBACRoleBindingTest() { + $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 - $nextPageToken = ''; - $resourcesElement = new Feature(); - $resources = [$resourcesElement]; - $expectedResponse = new ListFeaturesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setResources($resources); - $transport->addResponse($expectedResponse); - $request = new ListFeaturesRequest(); - $response = $gapicClient->listFeatures($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getResources()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.gkehub.v1.GkeHub/ListFeatures', $actualFuncCall); + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateMembershipRBACRoleBindingTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $user = 'user3599307'; + $name = 'name3373707'; + $uid = 'uid115792'; + $expectedResponse = new RBACRoleBinding(); + $expectedResponse->setUser($user); + $expectedResponse->setName($name); + $expectedResponse->setUid($uid); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateMembershipRBACRoleBindingTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $rbacrolebinding = new RBACRoleBinding(); + $rbacrolebindingRole = new Role(); + $rbacrolebinding->setRole($rbacrolebindingRole); + $updateMask = new FieldMask(); + $request = (new UpdateMembershipRBACRoleBindingRequest()) + ->setRbacrolebinding($rbacrolebinding) + ->setUpdateMask($updateMask); + $response = $gapicClient->updateMembershipRBACRoleBinding($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.gkehub.v1.GkeHub/UpdateMembershipRBACRoleBinding', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getRbacrolebinding(); + $this->assertProtobufEquals($rbacrolebinding, $actualValue); + $actualValue = $actualApiRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateMembershipRBACRoleBindingTest'); + $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 listFeaturesExceptionTest() + public function updateMembershipRBACRoleBindingExceptionTest() { + $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/updateMembershipRBACRoleBindingTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; @@ -825,63 +4265,128 @@ public function listFeaturesExceptionTest() ], JSON_PRETTY_PRINT ); - $transport->addResponse(null, $status); - $request = new ListFeaturesRequest(); + $operationsTransport->addResponse(null, $status); + // Mock request + $rbacrolebinding = new RBACRoleBinding(); + $rbacrolebindingRole = new Role(); + $rbacrolebinding->setRole($rbacrolebindingRole); + $updateMask = new FieldMask(); + $request = (new UpdateMembershipRBACRoleBindingRequest()) + ->setRbacrolebinding($rbacrolebinding) + ->setUpdateMask($updateMask); + $response = $gapicClient->updateMembershipRBACRoleBinding($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateMembershipRBACRoleBindingTest'); try { - $gapicClient->listFeatures($request); - // If the $gapicClient method call did not throw, fail the test + $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 stub is exhausted + // Call popReceivedCalls to ensure the stubs are exhausted $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); } /** @test */ - public function listMembershipsTest() + public function updateScopeTest() { + $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 - $nextPageToken = ''; - $resourcesElement = new Membership(); - $resources = [$resourcesElement]; - $expectedResponse = new ListMembershipsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setResources($resources); - $transport->addResponse($expectedResponse); + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateScopeTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $uid = 'uid115792'; + $expectedResponse = new Scope(); + $expectedResponse->setName($name); + $expectedResponse->setUid($uid); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateScopeTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListMembershipsRequest())->setParent($formattedParent); - $response = $gapicClient->listMemberships($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getResources()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.gkehub.v1.GkeHub/ListMemberships', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); + $scope = new Scope(); + $updateMask = new FieldMask(); + $request = (new UpdateScopeRequest())->setScope($scope)->setUpdateMask($updateMask); + $response = $gapicClient->updateScope($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.gkehub.v1.GkeHub/UpdateScope', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getScope(); + $this->assertProtobufEquals($scope, $actualValue); + $actualValue = $actualApiRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateScopeTest'); + $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 listMembershipsExceptionTest() + public function updateScopeExceptionTest() { + $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/updateScopeTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; @@ -894,25 +4399,35 @@ public function listMembershipsExceptionTest() ], JSON_PRETTY_PRINT ); - $transport->addResponse(null, $status); + $operationsTransport->addResponse(null, $status); // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListMembershipsRequest())->setParent($formattedParent); + $scope = new Scope(); + $updateMask = new FieldMask(); + $request = (new UpdateScopeRequest())->setScope($scope)->setUpdateMask($updateMask); + $response = $gapicClient->updateScope($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateScopeTest'); try { - $gapicClient->listMemberships($request); - // If the $gapicClient method call did not throw, fail the test + $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 stub is exhausted + // Call popReceivedCalls to ensure the stubs are exhausted $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); } /** @test */ - public function updateFeatureTest() + public function updateScopeNamespaceTest() { $operationsTransport = $this->createTransport(); $operationsClient = new OperationsClient([ @@ -929,21 +4444,30 @@ public function updateFeatureTest() $this->assertTrue($operationsTransport->isExhausted()); // Mock response $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateFeatureTest'); + $incompleteOperation->setName('operations/updateScopeNamespaceTest'); $incompleteOperation->setDone(false); $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $expectedResponse = new Feature(); - $expectedResponse->setName($name2); + $name = 'name3373707'; + $uid = 'uid115792'; + $scope = 'scope109264468'; + $expectedResponse = new PBNamespace(); + $expectedResponse->setName($name); + $expectedResponse->setUid($uid); + $expectedResponse->setScope($scope); $anyResponse = new Any(); $anyResponse->setValue($expectedResponse->serializeToString()); $completeOperation = new Operation(); - $completeOperation->setName('operations/updateFeatureTest'); + $completeOperation->setName('operations/updateScopeNamespaceTest'); $completeOperation->setDone(true); $completeOperation->setResponse($anyResponse); $operationsTransport->addResponse($completeOperation); - $request = new UpdateFeatureRequest(); - $response = $gapicClient->updateFeature($request); + // Mock request + $scopeNamespace = new PBNamespace(); + $scopeNamespaceScope = $gapicClient->scopeName('[PROJECT]', '[LOCATION]', '[SCOPE]'); + $scopeNamespace->setScope($scopeNamespaceScope); + $updateMask = new FieldMask(); + $request = (new UpdateScopeNamespaceRequest())->setScopeNamespace($scopeNamespace)->setUpdateMask($updateMask); + $response = $gapicClient->updateScopeNamespace($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); $apiRequests = $transport->popReceivedCalls(); @@ -952,9 +4476,13 @@ public function updateFeatureTest() $this->assertSame(0, count($operationsRequestsEmpty)); $actualApiFuncCall = $apiRequests[0]->getFuncCall(); $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.gkehub.v1.GkeHub/UpdateFeature', $actualApiFuncCall); + $this->assertSame('/google.cloud.gkehub.v1.GkeHub/UpdateScopeNamespace', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getScopeNamespace(); + $this->assertProtobufEquals($scopeNamespace, $actualValue); + $actualValue = $actualApiRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateFeatureTest'); + $expectedOperationsRequestObject->setName('operations/updateScopeNamespaceTest'); $response->pollUntilComplete([ 'initialPollDelayMillis' => 1, ]); @@ -973,7 +4501,7 @@ public function updateFeatureTest() } /** @test */ - public function updateFeatureExceptionTest() + public function updateScopeNamespaceExceptionTest() { $operationsTransport = $this->createTransport(); $operationsClient = new OperationsClient([ @@ -990,7 +4518,7 @@ public function updateFeatureExceptionTest() $this->assertTrue($operationsTransport->isExhausted()); // Mock response $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateFeatureTest'); + $incompleteOperation->setName('operations/updateScopeNamespaceTest'); $incompleteOperation->setDone(false); $transport->addResponse($incompleteOperation); $status = new stdClass(); @@ -1006,12 +4534,17 @@ public function updateFeatureExceptionTest() JSON_PRETTY_PRINT ); $operationsTransport->addResponse(null, $status); - $request = new UpdateFeatureRequest(); - $response = $gapicClient->updateFeature($request); + // Mock request + $scopeNamespace = new PBNamespace(); + $scopeNamespaceScope = $gapicClient->scopeName('[PROJECT]', '[LOCATION]', '[SCOPE]'); + $scopeNamespace->setScope($scopeNamespaceScope); + $updateMask = new FieldMask(); + $request = (new UpdateScopeNamespaceRequest())->setScopeNamespace($scopeNamespace)->setUpdateMask($updateMask); + $response = $gapicClient->updateScopeNamespace($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateFeatureTest'); + $expectedOperationsRequestObject->setName('operations/updateScopeNamespaceTest'); try { $response->pollUntilComplete([ 'initialPollDelayMillis' => 1, @@ -1030,7 +4563,7 @@ public function updateFeatureExceptionTest() } /** @test */ - public function updateMembershipTest() + public function updateScopeRBACRoleBindingTest() { $operationsTransport = $this->createTransport(); $operationsClient = new OperationsClient([ @@ -1047,34 +4580,32 @@ public function updateMembershipTest() $this->assertTrue($operationsTransport->isExhausted()); // Mock response $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateMembershipTest'); + $incompleteOperation->setName('operations/updateScopeRBACRoleBindingTest'); $incompleteOperation->setDone(false); $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $externalId = 'externalId-1153075697'; - $uniqueId = 'uniqueId-538310583'; - $expectedResponse = new Membership(); - $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $expectedResponse->setExternalId($externalId); - $expectedResponse->setUniqueId($uniqueId); + $user = 'user3599307'; + $name = 'name3373707'; + $uid = 'uid115792'; + $expectedResponse = new RBACRoleBinding(); + $expectedResponse->setUser($user); + $expectedResponse->setName($name); + $expectedResponse->setUid($uid); $anyResponse = new Any(); $anyResponse->setValue($expectedResponse->serializeToString()); $completeOperation = new Operation(); - $completeOperation->setName('operations/updateMembershipTest'); + $completeOperation->setName('operations/updateScopeRBACRoleBindingTest'); $completeOperation->setDone(true); $completeOperation->setResponse($anyResponse); $operationsTransport->addResponse($completeOperation); // Mock request - $formattedName = $gapicClient->membershipName('[PROJECT]', '[LOCATION]', '[MEMBERSHIP]'); + $rbacrolebinding = new RBACRoleBinding(); + $rbacrolebindingRole = new Role(); + $rbacrolebinding->setRole($rbacrolebindingRole); $updateMask = new FieldMask(); - $resource = new Membership(); - $request = (new UpdateMembershipRequest()) - ->setName($formattedName) - ->setUpdateMask($updateMask) - ->setResource($resource); - $response = $gapicClient->updateMembership($request); + $request = (new UpdateScopeRBACRoleBindingRequest()) + ->setRbacrolebinding($rbacrolebinding) + ->setUpdateMask($updateMask); + $response = $gapicClient->updateScopeRBACRoleBinding($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); $apiRequests = $transport->popReceivedCalls(); @@ -1083,15 +4614,13 @@ public function updateMembershipTest() $this->assertSame(0, count($operationsRequestsEmpty)); $actualApiFuncCall = $apiRequests[0]->getFuncCall(); $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.gkehub.v1.GkeHub/UpdateMembership', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertSame('/google.cloud.gkehub.v1.GkeHub/UpdateScopeRBACRoleBinding', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getRbacrolebinding(); + $this->assertProtobufEquals($rbacrolebinding, $actualValue); $actualValue = $actualApiRequestObject->getUpdateMask(); $this->assertProtobufEquals($updateMask, $actualValue); - $actualValue = $actualApiRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateMembershipTest'); + $expectedOperationsRequestObject->setName('operations/updateScopeRBACRoleBindingTest'); $response->pollUntilComplete([ 'initialPollDelayMillis' => 1, ]); @@ -1110,7 +4639,7 @@ public function updateMembershipTest() } /** @test */ - public function updateMembershipExceptionTest() + public function updateScopeRBACRoleBindingExceptionTest() { $operationsTransport = $this->createTransport(); $operationsClient = new OperationsClient([ @@ -1127,7 +4656,7 @@ public function updateMembershipExceptionTest() $this->assertTrue($operationsTransport->isExhausted()); // Mock response $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateMembershipTest'); + $incompleteOperation->setName('operations/updateScopeRBACRoleBindingTest'); $incompleteOperation->setDone(false); $transport->addResponse($incompleteOperation); $status = new stdClass(); @@ -1144,18 +4673,18 @@ public function updateMembershipExceptionTest() ); $operationsTransport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->membershipName('[PROJECT]', '[LOCATION]', '[MEMBERSHIP]'); + $rbacrolebinding = new RBACRoleBinding(); + $rbacrolebindingRole = new Role(); + $rbacrolebinding->setRole($rbacrolebindingRole); $updateMask = new FieldMask(); - $resource = new Membership(); - $request = (new UpdateMembershipRequest()) - ->setName($formattedName) - ->setUpdateMask($updateMask) - ->setResource($resource); - $response = $gapicClient->updateMembership($request); + $request = (new UpdateScopeRBACRoleBindingRequest()) + ->setRbacrolebinding($rbacrolebinding) + ->setUpdateMask($updateMask); + $response = $gapicClient->updateScopeRBACRoleBinding($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateMembershipTest'); + $expectedOperationsRequestObject->setName('operations/updateScopeRBACRoleBindingTest'); try { $response->pollUntilComplete([ 'initialPollDelayMillis' => 1,