diff --git a/packages/google-cloud-compute/docs/compute_v1/interconnect_attachment_groups.rst b/packages/google-cloud-compute/docs/compute_v1/interconnect_attachment_groups.rst new file mode 100644 index 000000000000..47ba228c78da --- /dev/null +++ b/packages/google-cloud-compute/docs/compute_v1/interconnect_attachment_groups.rst @@ -0,0 +1,10 @@ +InterconnectAttachmentGroups +---------------------------------------------- + +.. automodule:: google.cloud.compute_v1.services.interconnect_attachment_groups + :members: + :inherited-members: + +.. automodule:: google.cloud.compute_v1.services.interconnect_attachment_groups.pagers + :members: + :inherited-members: diff --git a/packages/google-cloud-compute/docs/compute_v1/interconnect_groups.rst b/packages/google-cloud-compute/docs/compute_v1/interconnect_groups.rst new file mode 100644 index 000000000000..b809f6528e96 --- /dev/null +++ b/packages/google-cloud-compute/docs/compute_v1/interconnect_groups.rst @@ -0,0 +1,10 @@ +InterconnectGroups +------------------------------------ + +.. automodule:: google.cloud.compute_v1.services.interconnect_groups + :members: + :inherited-members: + +.. automodule:: google.cloud.compute_v1.services.interconnect_groups.pagers + :members: + :inherited-members: diff --git a/packages/google-cloud-compute/docs/compute_v1/reservation_sub_blocks.rst b/packages/google-cloud-compute/docs/compute_v1/reservation_sub_blocks.rst new file mode 100644 index 000000000000..fe25a5276f06 --- /dev/null +++ b/packages/google-cloud-compute/docs/compute_v1/reservation_sub_blocks.rst @@ -0,0 +1,10 @@ +ReservationSubBlocks +-------------------------------------- + +.. automodule:: google.cloud.compute_v1.services.reservation_sub_blocks + :members: + :inherited-members: + +.. automodule:: google.cloud.compute_v1.services.reservation_sub_blocks.pagers + :members: + :inherited-members: diff --git a/packages/google-cloud-compute/docs/compute_v1/services_.rst b/packages/google-cloud-compute/docs/compute_v1/services_.rst index a5bfcd526ef3..b84aa67a8fe8 100644 --- a/packages/google-cloud-compute/docs/compute_v1/services_.rst +++ b/packages/google-cloud-compute/docs/compute_v1/services_.rst @@ -30,7 +30,9 @@ Services for Google Cloud Compute v1 API instance_settings_service instance_templates instant_snapshots + interconnect_attachment_groups interconnect_attachments + interconnect_groups interconnect_locations interconnect_remote_locations interconnects @@ -78,6 +80,7 @@ Services for Google Cloud Compute v1 API region_zones reservation_blocks reservations + reservation_sub_blocks resource_policies routers routes diff --git a/packages/google-cloud-compute/google/cloud/compute/__init__.py b/packages/google-cloud-compute/google/cloud/compute/__init__.py index 9a6256c7d36f..576cb6ada602 100644 --- a/packages/google-cloud-compute/google/cloud/compute/__init__.py +++ b/packages/google-cloud-compute/google/cloud/compute/__init__.py @@ -79,9 +79,15 @@ from google.cloud.compute_v1.services.instant_snapshots.client import ( InstantSnapshotsClient, ) +from google.cloud.compute_v1.services.interconnect_attachment_groups.client import ( + InterconnectAttachmentGroupsClient, +) from google.cloud.compute_v1.services.interconnect_attachments.client import ( InterconnectAttachmentsClient, ) +from google.cloud.compute_v1.services.interconnect_groups.client import ( + InterconnectGroupsClient, +) from google.cloud.compute_v1.services.interconnect_locations.client import ( InterconnectLocationsClient, ) @@ -192,6 +198,9 @@ from google.cloud.compute_v1.services.reservation_blocks.client import ( ReservationBlocksClient, ) +from google.cloud.compute_v1.services.reservation_sub_blocks.client import ( + ReservationSubBlocksClient, +) from google.cloud.compute_v1.services.reservations.client import ReservationsClient from google.cloud.compute_v1.services.resource_policies.client import ( ResourcePoliciesClient, @@ -378,6 +387,8 @@ BackendServiceFailoverPolicy, BackendServiceGroupHealth, BackendServiceHAPolicy, + BackendServiceHAPolicyLeader, + BackendServiceHAPolicyLeaderNetworkEndpoint, BackendServiceHttpCookie, BackendServiceIAP, BackendServiceList, @@ -404,6 +415,9 @@ BulkInsertOperationStatus, BulkInsertRegionDiskRequest, BulkInsertRegionInstanceRequest, + BulkSetLabelsDiskRequest, + BulkSetLabelsRequest, + BulkZoneSetLabelsRequest, CacheInvalidationRule, CacheKeyPolicy, CancelInstanceGroupManagerResizeRequestRequest, @@ -423,6 +437,7 @@ CorsPolicy, CreateInstancesInstanceGroupManagerRequest, CreateInstancesRegionInstanceGroupManagerRequest, + CreateMembersInterconnectGroupRequest, CreateSnapshotDiskRequest, CreateSnapshotRegionDiskRequest, CustomerEncryptionKey, @@ -458,7 +473,9 @@ DeleteInstancesRegionInstanceGroupManagerRequest, DeleteInstanceTemplateRequest, DeleteInstantSnapshotRequest, + DeleteInterconnectAttachmentGroupRequest, DeleteInterconnectAttachmentRequest, + DeleteInterconnectGroupRequest, DeleteInterconnectRequest, DeleteLicenseRequest, DeleteMachineImageRequest, @@ -572,6 +589,7 @@ Firewall, FirewallList, FirewallLogConfig, + FirewallParams, FirewallPoliciesListAssociationsResponse, FirewallPoliciesScopedList, FirewallPolicy, @@ -626,6 +644,8 @@ GetIamPolicyInstanceRequest, GetIamPolicyInstanceTemplateRequest, GetIamPolicyInstantSnapshotRequest, + GetIamPolicyInterconnectAttachmentGroupRequest, + GetIamPolicyInterconnectGroupRequest, GetIamPolicyLicenseRequest, GetIamPolicyMachineImageRequest, GetIamPolicyNetworkAttachmentRequest, @@ -651,7 +671,9 @@ GetInstanceSettingRequest, GetInstanceTemplateRequest, GetInstantSnapshotRequest, + GetInterconnectAttachmentGroupRequest, GetInterconnectAttachmentRequest, + GetInterconnectGroupRequest, GetInterconnectLocationRequest, GetInterconnectRemoteLocationRequest, GetInterconnectRequest, @@ -671,6 +693,8 @@ GetNodeGroupRequest, GetNodeTemplateRequest, GetNodeTypeRequest, + GetOperationalStatusInterconnectAttachmentGroupRequest, + GetOperationalStatusInterconnectGroupRequest, GetPacketMirroringRequest, GetPacketMirroringRuleNetworkFirewallPolicyRequest, GetProjectRequest, @@ -701,6 +725,7 @@ GetRegionUrlMapRequest, GetReservationBlockRequest, GetReservationRequest, + GetReservationSubBlockRequest, GetResourcePolicyRequest, GetRoutePolicyRouterRequest, GetRouteRequest, @@ -805,7 +830,9 @@ InsertInstanceRequest, InsertInstanceTemplateRequest, InsertInstantSnapshotRequest, + InsertInterconnectAttachmentGroupRequest, InsertInterconnectAttachmentRequest, + InsertInterconnectGroupRequest, InsertInterconnectRequest, InsertLicenseRequest, InsertMachineImageRequest, @@ -957,6 +984,21 @@ InterconnectAttachmentAggregatedList, InterconnectAttachmentConfigurationConstraints, InterconnectAttachmentConfigurationConstraintsBgpPeerASNRange, + InterconnectAttachmentGroup, + InterconnectAttachmentGroupAttachment, + InterconnectAttachmentGroupConfigured, + InterconnectAttachmentGroupConfiguredAvailabilitySLA, + InterconnectAttachmentGroupConfiguredAvailabilitySLAIntendedSlaBlockers, + InterconnectAttachmentGroupIntent, + InterconnectAttachmentGroupLogicalStructure, + InterconnectAttachmentGroupLogicalStructureRegion, + InterconnectAttachmentGroupLogicalStructureRegionMetro, + InterconnectAttachmentGroupLogicalStructureRegionMetroFacility, + InterconnectAttachmentGroupLogicalStructureRegionMetroFacilityZone, + InterconnectAttachmentGroupsGetOperationalStatusResponse, + InterconnectAttachmentGroupsListResponse, + InterconnectAttachmentGroupsOperationalStatus, + InterconnectAttachmentGroupsOperationalStatusAttachmentStatus, InterconnectAttachmentList, InterconnectAttachmentPartnerMetadata, InterconnectAttachmentPrivateInfo, @@ -968,6 +1010,23 @@ InterconnectDiagnosticsLinkOpticalPower, InterconnectDiagnosticsLinkStatus, InterconnectDiagnosticsMacsecStatus, + InterconnectGroup, + InterconnectGroupConfigured, + InterconnectGroupConfiguredTopologyCapability, + InterconnectGroupConfiguredTopologyCapabilityIntendedCapabilityBlockers, + InterconnectGroupIntent, + InterconnectGroupInterconnect, + InterconnectGroupPhysicalStructure, + InterconnectGroupPhysicalStructureMetros, + InterconnectGroupPhysicalStructureMetrosFacilities, + InterconnectGroupPhysicalStructureMetrosFacilitiesZones, + InterconnectGroupsCreateMembers, + InterconnectGroupsCreateMembersInterconnectInput, + InterconnectGroupsCreateMembersRequest, + InterconnectGroupsGetOperationalStatusResponse, + InterconnectGroupsListResponse, + InterconnectGroupsOperationalStatus, + InterconnectGroupsOperationalStatusInterconnectStatus, InterconnectList, InterconnectLocation, InterconnectLocationList, @@ -1026,7 +1085,9 @@ ListInstancesRequest, ListInstanceTemplatesRequest, ListInstantSnapshotsRequest, + ListInterconnectAttachmentGroupsRequest, ListInterconnectAttachmentsRequest, + ListInterconnectGroupsRequest, ListInterconnectLocationsRequest, ListInterconnectRemoteLocationsRequest, ListInterconnectsRequest, @@ -1081,6 +1142,7 @@ ListRegionZonesRequest, ListReservationBlocksRequest, ListReservationsRequest, + ListReservationSubBlocksRequest, ListResourcePoliciesRequest, ListRoutePoliciesRoutersRequest, ListRoutersRequest, @@ -1165,6 +1227,7 @@ NetworkFirewallPolicyAggregatedList, NetworkInterface, NetworkList, + NetworkParams, NetworkPeering, NetworkPerformanceConfig, NetworkProfile, @@ -1230,7 +1293,9 @@ PatchImageRequest, PatchInstanceGroupManagerRequest, PatchInstanceSettingRequest, + PatchInterconnectAttachmentGroupRequest, PatchInterconnectAttachmentRequest, + PatchInterconnectGroupRequest, PatchInterconnectRequest, PatchNetworkAttachmentRequest, PatchNetworkEdgeSecurityServiceRequest, @@ -1375,6 +1440,10 @@ ReservationsPerformMaintenanceRequest, ReservationsResizeRequest, ReservationsScopedList, + ReservationSubBlock, + ReservationSubBlockPhysicalTopology, + ReservationSubBlocksGetResponse, + ReservationSubBlocksListResponse, ResetInstanceRequest, ResizeDiskRequest, ResizeInstanceGroupManagerRequest, @@ -1401,6 +1470,7 @@ ResourcePolicySnapshotSchedulePolicySnapshotProperties, ResourcePolicyWeeklyCycle, ResourcePolicyWeeklyCycleDayOfWeek, + ResourcePolicyWorkloadPolicy, ResourceStatus, ResourceStatusPhysicalHostTopology, ResourceStatusScheduling, @@ -1410,6 +1480,7 @@ Route, RouteAsPath, RouteList, + RouteParams, RoutePolicy, RoutePolicyPolicyTerm, Router, @@ -1444,7 +1515,6 @@ Scheduling, SchedulingNodeAffinity, SchedulingOnInstanceStopAction, - ScratchDisks, Screenshot, SecurityPoliciesAggregatedList, SecurityPoliciesListPreconfiguredExpressionSetsResponse, @@ -1512,6 +1582,8 @@ SetIamPolicyInstanceRequest, SetIamPolicyInstanceTemplateRequest, SetIamPolicyInstantSnapshotRequest, + SetIamPolicyInterconnectAttachmentGroupRequest, + SetIamPolicyInterconnectGroupRequest, SetIamPolicyLicenseRequest, SetIamPolicyMachineImageRequest, SetIamPolicyNetworkAttachmentRequest, @@ -1648,9 +1720,11 @@ SubnetworkAggregatedList, SubnetworkList, SubnetworkLogConfig, + SubnetworkParams, SubnetworkSecondaryRange, SubnetworksExpandIpCidrRangeRequest, SubnetworksScopedList, + SubnetworksScopedWarning, SubnetworksSetPrivateIpGoogleAccessRequest, Subsetting, SuspendInstanceRequest, @@ -1712,6 +1786,8 @@ TestIamPermissionsInstanceRequest, TestIamPermissionsInstanceTemplateRequest, TestIamPermissionsInstantSnapshotRequest, + TestIamPermissionsInterconnectAttachmentGroupRequest, + TestIamPermissionsInterconnectGroupRequest, TestIamPermissionsLicenseCodeRequest, TestIamPermissionsLicenseRequest, TestIamPermissionsMachineImageRequest, @@ -1745,6 +1821,7 @@ UpdateFirewallRequest, UpdateHealthCheckRequest, UpdateInstanceRequest, + UpdateLicenseRequest, UpdateNetworkInterfaceInstanceRequest, UpdatePeeringNetworkRequest, UpdatePerInstanceConfigsInstanceGroupManagerRequest, @@ -1842,7 +1919,9 @@ "InstanceSettingsServiceClient", "InstanceTemplatesClient", "InstantSnapshotsClient", + "InterconnectAttachmentGroupsClient", "InterconnectAttachmentsClient", + "InterconnectGroupsClient", "InterconnectLocationsClient", "InterconnectRemoteLocationsClient", "InterconnectsClient", @@ -1890,6 +1969,7 @@ "RegionZonesClient", "ReservationBlocksClient", "ReservationsClient", + "ReservationSubBlocksClient", "ResourcePoliciesClient", "RoutersClient", "RoutesClient", @@ -2048,6 +2128,8 @@ "BackendServiceFailoverPolicy", "BackendServiceGroupHealth", "BackendServiceHAPolicy", + "BackendServiceHAPolicyLeader", + "BackendServiceHAPolicyLeaderNetworkEndpoint", "BackendServiceHttpCookie", "BackendServiceIAP", "BackendServiceList", @@ -2074,6 +2156,9 @@ "BulkInsertOperationStatus", "BulkInsertRegionDiskRequest", "BulkInsertRegionInstanceRequest", + "BulkSetLabelsDiskRequest", + "BulkSetLabelsRequest", + "BulkZoneSetLabelsRequest", "CacheInvalidationRule", "CacheKeyPolicy", "CancelInstanceGroupManagerResizeRequestRequest", @@ -2093,6 +2178,7 @@ "CorsPolicy", "CreateInstancesInstanceGroupManagerRequest", "CreateInstancesRegionInstanceGroupManagerRequest", + "CreateMembersInterconnectGroupRequest", "CreateSnapshotDiskRequest", "CreateSnapshotRegionDiskRequest", "CustomerEncryptionKey", @@ -2128,7 +2214,9 @@ "DeleteInstancesRegionInstanceGroupManagerRequest", "DeleteInstanceTemplateRequest", "DeleteInstantSnapshotRequest", + "DeleteInterconnectAttachmentGroupRequest", "DeleteInterconnectAttachmentRequest", + "DeleteInterconnectGroupRequest", "DeleteInterconnectRequest", "DeleteLicenseRequest", "DeleteMachineImageRequest", @@ -2242,6 +2330,7 @@ "Firewall", "FirewallList", "FirewallLogConfig", + "FirewallParams", "FirewallPoliciesListAssociationsResponse", "FirewallPoliciesScopedList", "FirewallPolicy", @@ -2296,6 +2385,8 @@ "GetIamPolicyInstanceRequest", "GetIamPolicyInstanceTemplateRequest", "GetIamPolicyInstantSnapshotRequest", + "GetIamPolicyInterconnectAttachmentGroupRequest", + "GetIamPolicyInterconnectGroupRequest", "GetIamPolicyLicenseRequest", "GetIamPolicyMachineImageRequest", "GetIamPolicyNetworkAttachmentRequest", @@ -2321,7 +2412,9 @@ "GetInstanceSettingRequest", "GetInstanceTemplateRequest", "GetInstantSnapshotRequest", + "GetInterconnectAttachmentGroupRequest", "GetInterconnectAttachmentRequest", + "GetInterconnectGroupRequest", "GetInterconnectLocationRequest", "GetInterconnectRemoteLocationRequest", "GetInterconnectRequest", @@ -2341,6 +2434,8 @@ "GetNodeGroupRequest", "GetNodeTemplateRequest", "GetNodeTypeRequest", + "GetOperationalStatusInterconnectAttachmentGroupRequest", + "GetOperationalStatusInterconnectGroupRequest", "GetPacketMirroringRequest", "GetPacketMirroringRuleNetworkFirewallPolicyRequest", "GetProjectRequest", @@ -2371,6 +2466,7 @@ "GetRegionUrlMapRequest", "GetReservationBlockRequest", "GetReservationRequest", + "GetReservationSubBlockRequest", "GetResourcePolicyRequest", "GetRoutePolicyRouterRequest", "GetRouteRequest", @@ -2475,7 +2571,9 @@ "InsertInstanceRequest", "InsertInstanceTemplateRequest", "InsertInstantSnapshotRequest", + "InsertInterconnectAttachmentGroupRequest", "InsertInterconnectAttachmentRequest", + "InsertInterconnectGroupRequest", "InsertInterconnectRequest", "InsertLicenseRequest", "InsertMachineImageRequest", @@ -2627,6 +2725,21 @@ "InterconnectAttachmentAggregatedList", "InterconnectAttachmentConfigurationConstraints", "InterconnectAttachmentConfigurationConstraintsBgpPeerASNRange", + "InterconnectAttachmentGroup", + "InterconnectAttachmentGroupAttachment", + "InterconnectAttachmentGroupConfigured", + "InterconnectAttachmentGroupConfiguredAvailabilitySLA", + "InterconnectAttachmentGroupConfiguredAvailabilitySLAIntendedSlaBlockers", + "InterconnectAttachmentGroupIntent", + "InterconnectAttachmentGroupLogicalStructure", + "InterconnectAttachmentGroupLogicalStructureRegion", + "InterconnectAttachmentGroupLogicalStructureRegionMetro", + "InterconnectAttachmentGroupLogicalStructureRegionMetroFacility", + "InterconnectAttachmentGroupLogicalStructureRegionMetroFacilityZone", + "InterconnectAttachmentGroupsGetOperationalStatusResponse", + "InterconnectAttachmentGroupsListResponse", + "InterconnectAttachmentGroupsOperationalStatus", + "InterconnectAttachmentGroupsOperationalStatusAttachmentStatus", "InterconnectAttachmentList", "InterconnectAttachmentPartnerMetadata", "InterconnectAttachmentPrivateInfo", @@ -2638,6 +2751,23 @@ "InterconnectDiagnosticsLinkOpticalPower", "InterconnectDiagnosticsLinkStatus", "InterconnectDiagnosticsMacsecStatus", + "InterconnectGroup", + "InterconnectGroupConfigured", + "InterconnectGroupConfiguredTopologyCapability", + "InterconnectGroupConfiguredTopologyCapabilityIntendedCapabilityBlockers", + "InterconnectGroupIntent", + "InterconnectGroupInterconnect", + "InterconnectGroupPhysicalStructure", + "InterconnectGroupPhysicalStructureMetros", + "InterconnectGroupPhysicalStructureMetrosFacilities", + "InterconnectGroupPhysicalStructureMetrosFacilitiesZones", + "InterconnectGroupsCreateMembers", + "InterconnectGroupsCreateMembersInterconnectInput", + "InterconnectGroupsCreateMembersRequest", + "InterconnectGroupsGetOperationalStatusResponse", + "InterconnectGroupsListResponse", + "InterconnectGroupsOperationalStatus", + "InterconnectGroupsOperationalStatusInterconnectStatus", "InterconnectList", "InterconnectLocation", "InterconnectLocationList", @@ -2696,7 +2826,9 @@ "ListInstancesRequest", "ListInstanceTemplatesRequest", "ListInstantSnapshotsRequest", + "ListInterconnectAttachmentGroupsRequest", "ListInterconnectAttachmentsRequest", + "ListInterconnectGroupsRequest", "ListInterconnectLocationsRequest", "ListInterconnectRemoteLocationsRequest", "ListInterconnectsRequest", @@ -2751,6 +2883,7 @@ "ListRegionZonesRequest", "ListReservationBlocksRequest", "ListReservationsRequest", + "ListReservationSubBlocksRequest", "ListResourcePoliciesRequest", "ListRoutePoliciesRoutersRequest", "ListRoutersRequest", @@ -2835,6 +2968,7 @@ "NetworkFirewallPolicyAggregatedList", "NetworkInterface", "NetworkList", + "NetworkParams", "NetworkPeering", "NetworkPerformanceConfig", "NetworkProfile", @@ -2900,7 +3034,9 @@ "PatchImageRequest", "PatchInstanceGroupManagerRequest", "PatchInstanceSettingRequest", + "PatchInterconnectAttachmentGroupRequest", "PatchInterconnectAttachmentRequest", + "PatchInterconnectGroupRequest", "PatchInterconnectRequest", "PatchNetworkAttachmentRequest", "PatchNetworkEdgeSecurityServiceRequest", @@ -3045,6 +3181,10 @@ "ReservationsPerformMaintenanceRequest", "ReservationsResizeRequest", "ReservationsScopedList", + "ReservationSubBlock", + "ReservationSubBlockPhysicalTopology", + "ReservationSubBlocksGetResponse", + "ReservationSubBlocksListResponse", "ResetInstanceRequest", "ResizeDiskRequest", "ResizeInstanceGroupManagerRequest", @@ -3071,6 +3211,7 @@ "ResourcePolicySnapshotSchedulePolicySnapshotProperties", "ResourcePolicyWeeklyCycle", "ResourcePolicyWeeklyCycleDayOfWeek", + "ResourcePolicyWorkloadPolicy", "ResourceStatus", "ResourceStatusPhysicalHostTopology", "ResourceStatusScheduling", @@ -3080,6 +3221,7 @@ "Route", "RouteAsPath", "RouteList", + "RouteParams", "RoutePolicy", "RoutePolicyPolicyTerm", "Router", @@ -3114,7 +3256,6 @@ "Scheduling", "SchedulingNodeAffinity", "SchedulingOnInstanceStopAction", - "ScratchDisks", "Screenshot", "SecurityPoliciesAggregatedList", "SecurityPoliciesListPreconfiguredExpressionSetsResponse", @@ -3182,6 +3323,8 @@ "SetIamPolicyInstanceRequest", "SetIamPolicyInstanceTemplateRequest", "SetIamPolicyInstantSnapshotRequest", + "SetIamPolicyInterconnectAttachmentGroupRequest", + "SetIamPolicyInterconnectGroupRequest", "SetIamPolicyLicenseRequest", "SetIamPolicyMachineImageRequest", "SetIamPolicyNetworkAttachmentRequest", @@ -3318,9 +3461,11 @@ "SubnetworkAggregatedList", "SubnetworkList", "SubnetworkLogConfig", + "SubnetworkParams", "SubnetworkSecondaryRange", "SubnetworksExpandIpCidrRangeRequest", "SubnetworksScopedList", + "SubnetworksScopedWarning", "SubnetworksSetPrivateIpGoogleAccessRequest", "Subsetting", "SuspendInstanceRequest", @@ -3382,6 +3527,8 @@ "TestIamPermissionsInstanceRequest", "TestIamPermissionsInstanceTemplateRequest", "TestIamPermissionsInstantSnapshotRequest", + "TestIamPermissionsInterconnectAttachmentGroupRequest", + "TestIamPermissionsInterconnectGroupRequest", "TestIamPermissionsLicenseCodeRequest", "TestIamPermissionsLicenseRequest", "TestIamPermissionsMachineImageRequest", @@ -3415,6 +3562,7 @@ "UpdateFirewallRequest", "UpdateHealthCheckRequest", "UpdateInstanceRequest", + "UpdateLicenseRequest", "UpdateNetworkInterfaceInstanceRequest", "UpdatePeeringNetworkRequest", "UpdatePerInstanceConfigsInstanceGroupManagerRequest", diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/__init__.py b/packages/google-cloud-compute/google/cloud/compute_v1/__init__.py index 959b920a51a1..c869084f4820 100644 --- a/packages/google-cloud-compute/google/cloud/compute_v1/__init__.py +++ b/packages/google-cloud-compute/google/cloud/compute_v1/__init__.py @@ -49,7 +49,9 @@ from .services.instance_templates import InstanceTemplatesClient from .services.instances import InstancesClient from .services.instant_snapshots import InstantSnapshotsClient +from .services.interconnect_attachment_groups import InterconnectAttachmentGroupsClient from .services.interconnect_attachments import InterconnectAttachmentsClient +from .services.interconnect_groups import InterconnectGroupsClient from .services.interconnect_locations import InterconnectLocationsClient from .services.interconnect_remote_locations import InterconnectRemoteLocationsClient from .services.interconnects import InterconnectsClient @@ -98,6 +100,7 @@ from .services.region_zones import RegionZonesClient from .services.regions import RegionsClient from .services.reservation_blocks import ReservationBlocksClient +from .services.reservation_sub_blocks import ReservationSubBlocksClient from .services.reservations import ReservationsClient from .services.resource_policies import ResourcePoliciesClient from .services.routers import RoutersClient @@ -258,6 +261,8 @@ BackendServiceFailoverPolicy, BackendServiceGroupHealth, BackendServiceHAPolicy, + BackendServiceHAPolicyLeader, + BackendServiceHAPolicyLeaderNetworkEndpoint, BackendServiceHttpCookie, BackendServiceIAP, BackendServiceList, @@ -284,6 +289,9 @@ BulkInsertOperationStatus, BulkInsertRegionDiskRequest, BulkInsertRegionInstanceRequest, + BulkSetLabelsDiskRequest, + BulkSetLabelsRequest, + BulkZoneSetLabelsRequest, CacheInvalidationRule, CacheKeyPolicy, CancelInstanceGroupManagerResizeRequestRequest, @@ -303,6 +311,7 @@ CorsPolicy, CreateInstancesInstanceGroupManagerRequest, CreateInstancesRegionInstanceGroupManagerRequest, + CreateMembersInterconnectGroupRequest, CreateSnapshotDiskRequest, CreateSnapshotRegionDiskRequest, CustomerEncryptionKey, @@ -338,7 +347,9 @@ DeleteInstancesRegionInstanceGroupManagerRequest, DeleteInstanceTemplateRequest, DeleteInstantSnapshotRequest, + DeleteInterconnectAttachmentGroupRequest, DeleteInterconnectAttachmentRequest, + DeleteInterconnectGroupRequest, DeleteInterconnectRequest, DeleteLicenseRequest, DeleteMachineImageRequest, @@ -452,6 +463,7 @@ Firewall, FirewallList, FirewallLogConfig, + FirewallParams, FirewallPoliciesListAssociationsResponse, FirewallPoliciesScopedList, FirewallPolicy, @@ -506,6 +518,8 @@ GetIamPolicyInstanceRequest, GetIamPolicyInstanceTemplateRequest, GetIamPolicyInstantSnapshotRequest, + GetIamPolicyInterconnectAttachmentGroupRequest, + GetIamPolicyInterconnectGroupRequest, GetIamPolicyLicenseRequest, GetIamPolicyMachineImageRequest, GetIamPolicyNetworkAttachmentRequest, @@ -531,7 +545,9 @@ GetInstanceSettingRequest, GetInstanceTemplateRequest, GetInstantSnapshotRequest, + GetInterconnectAttachmentGroupRequest, GetInterconnectAttachmentRequest, + GetInterconnectGroupRequest, GetInterconnectLocationRequest, GetInterconnectRemoteLocationRequest, GetInterconnectRequest, @@ -551,6 +567,8 @@ GetNodeGroupRequest, GetNodeTemplateRequest, GetNodeTypeRequest, + GetOperationalStatusInterconnectAttachmentGroupRequest, + GetOperationalStatusInterconnectGroupRequest, GetPacketMirroringRequest, GetPacketMirroringRuleNetworkFirewallPolicyRequest, GetProjectRequest, @@ -581,6 +599,7 @@ GetRegionUrlMapRequest, GetReservationBlockRequest, GetReservationRequest, + GetReservationSubBlockRequest, GetResourcePolicyRequest, GetRoutePolicyRouterRequest, GetRouteRequest, @@ -685,7 +704,9 @@ InsertInstanceRequest, InsertInstanceTemplateRequest, InsertInstantSnapshotRequest, + InsertInterconnectAttachmentGroupRequest, InsertInterconnectAttachmentRequest, + InsertInterconnectGroupRequest, InsertInterconnectRequest, InsertLicenseRequest, InsertMachineImageRequest, @@ -837,6 +858,21 @@ InterconnectAttachmentAggregatedList, InterconnectAttachmentConfigurationConstraints, InterconnectAttachmentConfigurationConstraintsBgpPeerASNRange, + InterconnectAttachmentGroup, + InterconnectAttachmentGroupAttachment, + InterconnectAttachmentGroupConfigured, + InterconnectAttachmentGroupConfiguredAvailabilitySLA, + InterconnectAttachmentGroupConfiguredAvailabilitySLAIntendedSlaBlockers, + InterconnectAttachmentGroupIntent, + InterconnectAttachmentGroupLogicalStructure, + InterconnectAttachmentGroupLogicalStructureRegion, + InterconnectAttachmentGroupLogicalStructureRegionMetro, + InterconnectAttachmentGroupLogicalStructureRegionMetroFacility, + InterconnectAttachmentGroupLogicalStructureRegionMetroFacilityZone, + InterconnectAttachmentGroupsGetOperationalStatusResponse, + InterconnectAttachmentGroupsListResponse, + InterconnectAttachmentGroupsOperationalStatus, + InterconnectAttachmentGroupsOperationalStatusAttachmentStatus, InterconnectAttachmentList, InterconnectAttachmentPartnerMetadata, InterconnectAttachmentPrivateInfo, @@ -848,6 +884,23 @@ InterconnectDiagnosticsLinkOpticalPower, InterconnectDiagnosticsLinkStatus, InterconnectDiagnosticsMacsecStatus, + InterconnectGroup, + InterconnectGroupConfigured, + InterconnectGroupConfiguredTopologyCapability, + InterconnectGroupConfiguredTopologyCapabilityIntendedCapabilityBlockers, + InterconnectGroupIntent, + InterconnectGroupInterconnect, + InterconnectGroupPhysicalStructure, + InterconnectGroupPhysicalStructureMetros, + InterconnectGroupPhysicalStructureMetrosFacilities, + InterconnectGroupPhysicalStructureMetrosFacilitiesZones, + InterconnectGroupsCreateMembers, + InterconnectGroupsCreateMembersInterconnectInput, + InterconnectGroupsCreateMembersRequest, + InterconnectGroupsGetOperationalStatusResponse, + InterconnectGroupsListResponse, + InterconnectGroupsOperationalStatus, + InterconnectGroupsOperationalStatusInterconnectStatus, InterconnectList, InterconnectLocation, InterconnectLocationList, @@ -906,7 +959,9 @@ ListInstancesRequest, ListInstanceTemplatesRequest, ListInstantSnapshotsRequest, + ListInterconnectAttachmentGroupsRequest, ListInterconnectAttachmentsRequest, + ListInterconnectGroupsRequest, ListInterconnectLocationsRequest, ListInterconnectRemoteLocationsRequest, ListInterconnectsRequest, @@ -961,6 +1016,7 @@ ListRegionZonesRequest, ListReservationBlocksRequest, ListReservationsRequest, + ListReservationSubBlocksRequest, ListResourcePoliciesRequest, ListRoutePoliciesRoutersRequest, ListRoutersRequest, @@ -1045,6 +1101,7 @@ NetworkFirewallPolicyAggregatedList, NetworkInterface, NetworkList, + NetworkParams, NetworkPeering, NetworkPerformanceConfig, NetworkProfile, @@ -1110,7 +1167,9 @@ PatchImageRequest, PatchInstanceGroupManagerRequest, PatchInstanceSettingRequest, + PatchInterconnectAttachmentGroupRequest, PatchInterconnectAttachmentRequest, + PatchInterconnectGroupRequest, PatchInterconnectRequest, PatchNetworkAttachmentRequest, PatchNetworkEdgeSecurityServiceRequest, @@ -1255,6 +1314,10 @@ ReservationsPerformMaintenanceRequest, ReservationsResizeRequest, ReservationsScopedList, + ReservationSubBlock, + ReservationSubBlockPhysicalTopology, + ReservationSubBlocksGetResponse, + ReservationSubBlocksListResponse, ResetInstanceRequest, ResizeDiskRequest, ResizeInstanceGroupManagerRequest, @@ -1281,6 +1344,7 @@ ResourcePolicySnapshotSchedulePolicySnapshotProperties, ResourcePolicyWeeklyCycle, ResourcePolicyWeeklyCycleDayOfWeek, + ResourcePolicyWorkloadPolicy, ResourceStatus, ResourceStatusPhysicalHostTopology, ResourceStatusScheduling, @@ -1290,6 +1354,7 @@ Route, RouteAsPath, RouteList, + RouteParams, RoutePolicy, RoutePolicyPolicyTerm, Router, @@ -1324,7 +1389,6 @@ Scheduling, SchedulingNodeAffinity, SchedulingOnInstanceStopAction, - ScratchDisks, Screenshot, SecurityPoliciesAggregatedList, SecurityPoliciesListPreconfiguredExpressionSetsResponse, @@ -1392,6 +1456,8 @@ SetIamPolicyInstanceRequest, SetIamPolicyInstanceTemplateRequest, SetIamPolicyInstantSnapshotRequest, + SetIamPolicyInterconnectAttachmentGroupRequest, + SetIamPolicyInterconnectGroupRequest, SetIamPolicyLicenseRequest, SetIamPolicyMachineImageRequest, SetIamPolicyNetworkAttachmentRequest, @@ -1528,9 +1594,11 @@ SubnetworkAggregatedList, SubnetworkList, SubnetworkLogConfig, + SubnetworkParams, SubnetworkSecondaryRange, SubnetworksExpandIpCidrRangeRequest, SubnetworksScopedList, + SubnetworksScopedWarning, SubnetworksSetPrivateIpGoogleAccessRequest, Subsetting, SuspendInstanceRequest, @@ -1592,6 +1660,8 @@ TestIamPermissionsInstanceRequest, TestIamPermissionsInstanceTemplateRequest, TestIamPermissionsInstantSnapshotRequest, + TestIamPermissionsInterconnectAttachmentGroupRequest, + TestIamPermissionsInterconnectGroupRequest, TestIamPermissionsLicenseCodeRequest, TestIamPermissionsLicenseRequest, TestIamPermissionsMachineImageRequest, @@ -1625,6 +1695,7 @@ UpdateFirewallRequest, UpdateHealthCheckRequest, UpdateInstanceRequest, + UpdateLicenseRequest, UpdateNetworkInterfaceInstanceRequest, UpdatePeeringNetworkRequest, UpdatePerInstanceConfigsInstanceGroupManagerRequest, @@ -1832,6 +1903,8 @@ "BackendServiceFailoverPolicy", "BackendServiceGroupHealth", "BackendServiceHAPolicy", + "BackendServiceHAPolicyLeader", + "BackendServiceHAPolicyLeaderNetworkEndpoint", "BackendServiceHttpCookie", "BackendServiceIAP", "BackendServiceList", @@ -1859,6 +1932,9 @@ "BulkInsertOperationStatus", "BulkInsertRegionDiskRequest", "BulkInsertRegionInstanceRequest", + "BulkSetLabelsDiskRequest", + "BulkSetLabelsRequest", + "BulkZoneSetLabelsRequest", "CacheInvalidationRule", "CacheKeyPolicy", "CancelInstanceGroupManagerResizeRequestRequest", @@ -1878,6 +1954,7 @@ "CorsPolicy", "CreateInstancesInstanceGroupManagerRequest", "CreateInstancesRegionInstanceGroupManagerRequest", + "CreateMembersInterconnectGroupRequest", "CreateSnapshotDiskRequest", "CreateSnapshotRegionDiskRequest", "CustomErrorResponsePolicy", @@ -1913,7 +1990,9 @@ "DeleteInstancesInstanceGroupManagerRequest", "DeleteInstancesRegionInstanceGroupManagerRequest", "DeleteInstantSnapshotRequest", + "DeleteInterconnectAttachmentGroupRequest", "DeleteInterconnectAttachmentRequest", + "DeleteInterconnectGroupRequest", "DeleteInterconnectRequest", "DeleteLicenseRequest", "DeleteMachineImageRequest", @@ -2030,6 +2109,7 @@ "Firewall", "FirewallList", "FirewallLogConfig", + "FirewallParams", "FirewallPoliciesClient", "FirewallPoliciesListAssociationsResponse", "FirewallPoliciesScopedList", @@ -2088,6 +2168,8 @@ "GetIamPolicyInstanceRequest", "GetIamPolicyInstanceTemplateRequest", "GetIamPolicyInstantSnapshotRequest", + "GetIamPolicyInterconnectAttachmentGroupRequest", + "GetIamPolicyInterconnectGroupRequest", "GetIamPolicyLicenseRequest", "GetIamPolicyMachineImageRequest", "GetIamPolicyNetworkAttachmentRequest", @@ -2113,7 +2195,9 @@ "GetInstanceSettingRequest", "GetInstanceTemplateRequest", "GetInstantSnapshotRequest", + "GetInterconnectAttachmentGroupRequest", "GetInterconnectAttachmentRequest", + "GetInterconnectGroupRequest", "GetInterconnectLocationRequest", "GetInterconnectRemoteLocationRequest", "GetInterconnectRequest", @@ -2133,6 +2217,8 @@ "GetNodeGroupRequest", "GetNodeTemplateRequest", "GetNodeTypeRequest", + "GetOperationalStatusInterconnectAttachmentGroupRequest", + "GetOperationalStatusInterconnectGroupRequest", "GetPacketMirroringRequest", "GetPacketMirroringRuleNetworkFirewallPolicyRequest", "GetProjectRequest", @@ -2163,6 +2249,7 @@ "GetRegionUrlMapRequest", "GetReservationBlockRequest", "GetReservationRequest", + "GetReservationSubBlockRequest", "GetResourcePolicyRequest", "GetRoutePolicyRouterRequest", "GetRouteRequest", @@ -2275,7 +2362,9 @@ "InsertInstanceRequest", "InsertInstanceTemplateRequest", "InsertInstantSnapshotRequest", + "InsertInterconnectAttachmentGroupRequest", "InsertInterconnectAttachmentRequest", + "InsertInterconnectGroupRequest", "InsertInterconnectRequest", "InsertLicenseRequest", "InsertMachineImageRequest", @@ -2434,6 +2523,22 @@ "InterconnectAttachmentAggregatedList", "InterconnectAttachmentConfigurationConstraints", "InterconnectAttachmentConfigurationConstraintsBgpPeerASNRange", + "InterconnectAttachmentGroup", + "InterconnectAttachmentGroupAttachment", + "InterconnectAttachmentGroupConfigured", + "InterconnectAttachmentGroupConfiguredAvailabilitySLA", + "InterconnectAttachmentGroupConfiguredAvailabilitySLAIntendedSlaBlockers", + "InterconnectAttachmentGroupIntent", + "InterconnectAttachmentGroupLogicalStructure", + "InterconnectAttachmentGroupLogicalStructureRegion", + "InterconnectAttachmentGroupLogicalStructureRegionMetro", + "InterconnectAttachmentGroupLogicalStructureRegionMetroFacility", + "InterconnectAttachmentGroupLogicalStructureRegionMetroFacilityZone", + "InterconnectAttachmentGroupsClient", + "InterconnectAttachmentGroupsGetOperationalStatusResponse", + "InterconnectAttachmentGroupsListResponse", + "InterconnectAttachmentGroupsOperationalStatus", + "InterconnectAttachmentGroupsOperationalStatusAttachmentStatus", "InterconnectAttachmentList", "InterconnectAttachmentPartnerMetadata", "InterconnectAttachmentPrivateInfo", @@ -2446,6 +2551,24 @@ "InterconnectDiagnosticsLinkOpticalPower", "InterconnectDiagnosticsLinkStatus", "InterconnectDiagnosticsMacsecStatus", + "InterconnectGroup", + "InterconnectGroupConfigured", + "InterconnectGroupConfiguredTopologyCapability", + "InterconnectGroupConfiguredTopologyCapabilityIntendedCapabilityBlockers", + "InterconnectGroupIntent", + "InterconnectGroupInterconnect", + "InterconnectGroupPhysicalStructure", + "InterconnectGroupPhysicalStructureMetros", + "InterconnectGroupPhysicalStructureMetrosFacilities", + "InterconnectGroupPhysicalStructureMetrosFacilitiesZones", + "InterconnectGroupsClient", + "InterconnectGroupsCreateMembers", + "InterconnectGroupsCreateMembersInterconnectInput", + "InterconnectGroupsCreateMembersRequest", + "InterconnectGroupsGetOperationalStatusResponse", + "InterconnectGroupsListResponse", + "InterconnectGroupsOperationalStatus", + "InterconnectGroupsOperationalStatusInterconnectStatus", "InterconnectList", "InterconnectLocation", "InterconnectLocationList", @@ -2509,7 +2632,9 @@ "ListInstancesRegionInstanceGroupsRequest", "ListInstancesRequest", "ListInstantSnapshotsRequest", + "ListInterconnectAttachmentGroupsRequest", "ListInterconnectAttachmentsRequest", + "ListInterconnectGroupsRequest", "ListInterconnectLocationsRequest", "ListInterconnectRemoteLocationsRequest", "ListInterconnectsRequest", @@ -2563,6 +2688,7 @@ "ListRegionZonesRequest", "ListRegionsRequest", "ListReservationBlocksRequest", + "ListReservationSubBlocksRequest", "ListReservationsRequest", "ListResourcePoliciesRequest", "ListRoutePoliciesRoutersRequest", @@ -2654,6 +2780,7 @@ "NetworkFirewallPolicyAggregatedList", "NetworkInterface", "NetworkList", + "NetworkParams", "NetworkPeering", "NetworkPerformanceConfig", "NetworkProfile", @@ -2725,7 +2852,9 @@ "PatchImageRequest", "PatchInstanceGroupManagerRequest", "PatchInstanceSettingRequest", + "PatchInterconnectAttachmentGroupRequest", "PatchInterconnectAttachmentRequest", + "PatchInterconnectGroupRequest", "PatchInterconnectRequest", "PatchNetworkAttachmentRequest", "PatchNetworkEdgeSecurityServiceRequest", @@ -2895,6 +3024,11 @@ "ReservationBlocksGetResponse", "ReservationBlocksListResponse", "ReservationList", + "ReservationSubBlock", + "ReservationSubBlockPhysicalTopology", + "ReservationSubBlocksClient", + "ReservationSubBlocksGetResponse", + "ReservationSubBlocksListResponse", "ReservationsBlocksPerformMaintenanceRequest", "ReservationsClient", "ReservationsPerformMaintenanceRequest", @@ -2927,6 +3061,7 @@ "ResourcePolicySnapshotSchedulePolicySnapshotProperties", "ResourcePolicyWeeklyCycle", "ResourcePolicyWeeklyCycleDayOfWeek", + "ResourcePolicyWorkloadPolicy", "ResourceStatus", "ResourceStatusPhysicalHostTopology", "ResourceStatusScheduling", @@ -2936,6 +3071,7 @@ "Route", "RouteAsPath", "RouteList", + "RouteParams", "RoutePolicy", "RoutePolicyPolicyTerm", "Router", @@ -2973,7 +3109,6 @@ "Scheduling", "SchedulingNodeAffinity", "SchedulingOnInstanceStopAction", - "ScratchDisks", "Screenshot", "SecurityPoliciesAggregatedList", "SecurityPoliciesClient", @@ -3043,6 +3178,8 @@ "SetIamPolicyInstanceRequest", "SetIamPolicyInstanceTemplateRequest", "SetIamPolicyInstantSnapshotRequest", + "SetIamPolicyInterconnectAttachmentGroupRequest", + "SetIamPolicyInterconnectGroupRequest", "SetIamPolicyLicenseRequest", "SetIamPolicyMachineImageRequest", "SetIamPolicyNetworkAttachmentRequest", @@ -3184,10 +3321,12 @@ "SubnetworkAggregatedList", "SubnetworkList", "SubnetworkLogConfig", + "SubnetworkParams", "SubnetworkSecondaryRange", "SubnetworksClient", "SubnetworksExpandIpCidrRangeRequest", "SubnetworksScopedList", + "SubnetworksScopedWarning", "SubnetworksSetPrivateIpGoogleAccessRequest", "Subsetting", "SuspendInstanceRequest", @@ -3257,6 +3396,8 @@ "TestIamPermissionsInstanceRequest", "TestIamPermissionsInstanceTemplateRequest", "TestIamPermissionsInstantSnapshotRequest", + "TestIamPermissionsInterconnectAttachmentGroupRequest", + "TestIamPermissionsInterconnectGroupRequest", "TestIamPermissionsLicenseCodeRequest", "TestIamPermissionsLicenseRequest", "TestIamPermissionsMachineImageRequest", @@ -3290,6 +3431,7 @@ "UpdateFirewallRequest", "UpdateHealthCheckRequest", "UpdateInstanceRequest", + "UpdateLicenseRequest", "UpdateNetworkInterfaceInstanceRequest", "UpdatePeeringNetworkRequest", "UpdatePerInstanceConfigsInstanceGroupManagerRequest", diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/gapic_metadata.json b/packages/google-cloud-compute/google/cloud/compute_v1/gapic_metadata.json index 58b63d85afc4..52103180cfd0 100644 --- a/packages/google-cloud-compute/google/cloud/compute_v1/gapic_metadata.json +++ b/packages/google-cloud-compute/google/cloud/compute_v1/gapic_metadata.json @@ -319,6 +319,11 @@ "bulk_insert" ] }, + "BulkSetLabels": { + "methods": [ + "bulk_set_labels" + ] + }, "CreateSnapshot": { "methods": [ "create_snapshot" @@ -1558,6 +1563,60 @@ } } }, + "InterconnectAttachmentGroups": { + "clients": { + "rest": { + "libraryClient": "InterconnectAttachmentGroupsClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "GetIamPolicy": { + "methods": [ + "get_iam_policy" + ] + }, + "GetOperationalStatus": { + "methods": [ + "get_operational_status" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "List": { + "methods": [ + "list" + ] + }, + "Patch": { + "methods": [ + "patch" + ] + }, + "SetIamPolicy": { + "methods": [ + "set_iam_policy" + ] + }, + "TestIamPermissions": { + "methods": [ + "test_iam_permissions" + ] + } + } + } + } + }, "InterconnectAttachments": { "clients": { "rest": { @@ -1602,6 +1661,65 @@ } } }, + "InterconnectGroups": { + "clients": { + "rest": { + "libraryClient": "InterconnectGroupsClient", + "rpcs": { + "CreateMembers": { + "methods": [ + "create_members" + ] + }, + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "GetIamPolicy": { + "methods": [ + "get_iam_policy" + ] + }, + "GetOperationalStatus": { + "methods": [ + "get_operational_status" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "List": { + "methods": [ + "list" + ] + }, + "Patch": { + "methods": [ + "patch" + ] + }, + "SetIamPolicy": { + "methods": [ + "set_iam_policy" + ] + }, + "TestIamPermissions": { + "methods": [ + "test_iam_permissions" + ] + } + } + } + } + }, "InterconnectLocations": { "clients": { "rest": { @@ -1747,6 +1865,11 @@ "methods": [ "test_iam_permissions" ] + }, + "Update": { + "methods": [ + "update" + ] } } } @@ -3641,6 +3764,25 @@ } } }, + "ReservationSubBlocks": { + "clients": { + "rest": { + "libraryClient": "ReservationSubBlocksClient", + "rpcs": { + "Get": { + "methods": [ + "get" + ] + }, + "List": { + "methods": [ + "list" + ] + } + } + } + } + }, "Reservations": { "clients": { "rest": { diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/disks/client.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/disks/client.py index 19bddb381aa0..c079002dc320 100644 --- a/packages/google-cloud-compute/google/cloud/compute_v1/services/disks/client.py +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/disks/client.py @@ -1431,6 +1431,303 @@ def error_code(self): # Done; return the response. return response + def bulk_set_labels_unary( + self, + request: Optional[Union[compute.BulkSetLabelsDiskRequest, dict]] = None, + *, + project: Optional[str] = None, + zone: Optional[str] = None, + bulk_zone_set_labels_request_resource: Optional[ + compute.BulkZoneSetLabelsRequest + ] = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> compute.Operation: + r"""Sets the labels on many disks at once. To learn more + about labels, read the Labeling Resources documentation. + + .. code-block:: python + + # This snippet 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 as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import compute_v1 + + def sample_bulk_set_labels(): + # Create a client + client = compute_v1.DisksClient() + + # Initialize request argument(s) + request = compute_v1.BulkSetLabelsDiskRequest( + project="project_value", + zone="zone_value", + ) + + # Make the request + response = client.bulk_set_labels(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.compute_v1.types.BulkSetLabelsDiskRequest, dict]): + The request object. A request message for + Disks.BulkSetLabels. See the method + description for details. + project (str): + Project ID for this request. + This corresponds to the ``project`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + zone (str): + The name of the zone for this + request. + + This corresponds to the ``zone`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + bulk_zone_set_labels_request_resource (google.cloud.compute_v1.types.BulkZoneSetLabelsRequest): + The body resource for this request + This corresponds to the ``bulk_zone_set_labels_request_resource`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + google.api_core.extended_operation.ExtendedOperation: + An object representing a extended + long-running operation. + + """ + # Create or coerce a protobuf request object. + # - Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + flattened_params = [project, zone, bulk_zone_set_labels_request_resource] + has_flattened_params = ( + len([param for param in flattened_params if param is not None]) > 0 + ) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + # - Use the request object if provided (there's no risk of modifying the input as + # there are no flattened fields), or create one. + if not isinstance(request, compute.BulkSetLabelsDiskRequest): + request = compute.BulkSetLabelsDiskRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if project is not None: + request.project = project + if zone is not None: + request.zone = zone + if bulk_zone_set_labels_request_resource is not None: + request.bulk_zone_set_labels_request_resource = ( + bulk_zone_set_labels_request_resource + ) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.bulk_set_labels] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata( + ( + ("project", request.project), + ("zone", request.zone), + ) + ), + ) + + # Validate the universe domain. + self._validate_universe_domain() + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + def bulk_set_labels( + self, + request: Optional[Union[compute.BulkSetLabelsDiskRequest, dict]] = None, + *, + project: Optional[str] = None, + zone: Optional[str] = None, + bulk_zone_set_labels_request_resource: Optional[ + compute.BulkZoneSetLabelsRequest + ] = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> extended_operation.ExtendedOperation: + r"""Sets the labels on many disks at once. To learn more + about labels, read the Labeling Resources documentation. + + .. code-block:: python + + # This snippet 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 as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import compute_v1 + + def sample_bulk_set_labels(): + # Create a client + client = compute_v1.DisksClient() + + # Initialize request argument(s) + request = compute_v1.BulkSetLabelsDiskRequest( + project="project_value", + zone="zone_value", + ) + + # Make the request + response = client.bulk_set_labels(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.compute_v1.types.BulkSetLabelsDiskRequest, dict]): + The request object. A request message for + Disks.BulkSetLabels. See the method + description for details. + project (str): + Project ID for this request. + This corresponds to the ``project`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + zone (str): + The name of the zone for this + request. + + This corresponds to the ``zone`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + bulk_zone_set_labels_request_resource (google.cloud.compute_v1.types.BulkZoneSetLabelsRequest): + The body resource for this request + This corresponds to the ``bulk_zone_set_labels_request_resource`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + google.api_core.extended_operation.ExtendedOperation: + An object representing a extended + long-running operation. + + """ + # Create or coerce a protobuf request object. + # - Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + flattened_params = [project, zone, bulk_zone_set_labels_request_resource] + has_flattened_params = ( + len([param for param in flattened_params if param is not None]) > 0 + ) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + # - Use the request object if provided (there's no risk of modifying the input as + # there are no flattened fields), or create one. + if not isinstance(request, compute.BulkSetLabelsDiskRequest): + request = compute.BulkSetLabelsDiskRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if project is not None: + request.project = project + if zone is not None: + request.zone = zone + if bulk_zone_set_labels_request_resource is not None: + request.bulk_zone_set_labels_request_resource = ( + bulk_zone_set_labels_request_resource + ) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.bulk_set_labels] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata( + ( + ("project", request.project), + ("zone", request.zone), + ) + ), + ) + + # Validate the universe domain. + self._validate_universe_domain() + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + operation_service = self._transport._zone_operations_client + operation_request = compute.GetZoneOperationRequest() + operation_request.project = request.project + operation_request.zone = request.zone + operation_request.operation = response.name + + get_operation = functools.partial(operation_service.get, operation_request) + # Cancel is not part of extended operations yet. + cancel_operation = lambda: None + + # Note: this class is an implementation detail to provide a uniform + # set of names for certain fields in the extended operation proto message. + # See google.api_core.extended_operation.ExtendedOperation for details + # on these properties and the expected interface. + class _CustomOperation(extended_operation.ExtendedOperation): + @property + def error_message(self): + return self._extended_operation.http_error_message + + @property + def error_code(self): + return self._extended_operation.http_error_status_code + + response = _CustomOperation.make(get_operation, cancel_operation, response) + + # Done; return the response. + return response + def create_snapshot_unary( self, request: Optional[Union[compute.CreateSnapshotDiskRequest, dict]] = None, diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/disks/transports/base.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/disks/transports/base.py index 9a268d88e743..3307c8b4af14 100644 --- a/packages/google-cloud-compute/google/cloud/compute_v1/services/disks/transports/base.py +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/disks/transports/base.py @@ -152,6 +152,11 @@ def _prep_wrapped_messages(self, client_info): default_timeout=None, client_info=client_info, ), + self.bulk_set_labels: gapic_v1.method.wrap_method( + self.bulk_set_labels, + default_timeout=None, + client_info=client_info, + ), self.create_snapshot: gapic_v1.method.wrap_method( self.create_snapshot, default_timeout=None, @@ -265,6 +270,15 @@ def bulk_insert( ]: raise NotImplementedError() + @property + def bulk_set_labels( + self, + ) -> Callable[ + [compute.BulkSetLabelsDiskRequest], + Union[compute.Operation, Awaitable[compute.Operation]], + ]: + raise NotImplementedError() + @property def create_snapshot( self, diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/disks/transports/rest.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/disks/transports/rest.py index d81df335c154..911e6c2d3603 100644 --- a/packages/google-cloud-compute/google/cloud/compute_v1/services/disks/transports/rest.py +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/disks/transports/rest.py @@ -96,6 +96,14 @@ def post_bulk_insert(self, response): logging.log(f"Received response: {response}") return response + def pre_bulk_set_labels(self, request, metadata): + logging.log(f"Received request: {request}") + return request, metadata + + def post_bulk_set_labels(self, response): + logging.log(f"Received response: {response}") + return response + def pre_create_snapshot(self, request, metadata): logging.log(f"Received request: {request}") return request, metadata @@ -362,6 +370,52 @@ def post_bulk_insert_with_metadata( """ return response, metadata + def pre_bulk_set_labels( + self, + request: compute.BulkSetLabelsDiskRequest, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + compute.BulkSetLabelsDiskRequest, Sequence[Tuple[str, Union[str, bytes]]] + ]: + """Pre-rpc interceptor for bulk_set_labels + + Override in a subclass to manipulate the request or metadata + before they are sent to the Disks server. + """ + return request, metadata + + def post_bulk_set_labels(self, response: compute.Operation) -> compute.Operation: + """Post-rpc interceptor for bulk_set_labels + + DEPRECATED. Please use the `post_bulk_set_labels_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response + after it is returned by the Disks server but before + it is returned to user code. This `post_bulk_set_labels` interceptor runs + before the `post_bulk_set_labels_with_metadata` interceptor. + """ + return response + + def post_bulk_set_labels_with_metadata( + self, + response: compute.Operation, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[compute.Operation, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for bulk_set_labels + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the Disks server but before it is returned to user code. + + We recommend only using this `post_bulk_set_labels_with_metadata` + interceptor in new development instead of the `post_bulk_set_labels` interceptor. + When both interceptors are used, this `post_bulk_set_labels_with_metadata` interceptor runs after the + `post_bulk_set_labels` interceptor. The (possibly modified) response returned by + `post_bulk_set_labels` will be passed to + `post_bulk_set_labels_with_metadata`. + """ + return response, metadata + def pre_create_snapshot( self, request: compute.CreateSnapshotDiskRequest, @@ -1634,6 +1688,177 @@ def __call__( ) return resp + class _BulkSetLabels(_BaseDisksRestTransport._BaseBulkSetLabels, DisksRestStub): + def __hash__(self): + return hash("DisksRestTransport.BulkSetLabels") + + @staticmethod + def _get_response( + host, + metadata, + query_params, + session, + timeout, + transcoded_request, + body=None, + ): + uri = transcoded_request["uri"] + method = transcoded_request["method"] + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = getattr(session, method)( + "{host}{uri}".format(host=host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + data=body, + ) + return response + + def __call__( + self, + request: compute.BulkSetLabelsDiskRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> compute.Operation: + r"""Call the bulk set labels method over HTTP. + + Args: + request (~.compute.BulkSetLabelsDiskRequest): + The request object. A request message for + Disks.BulkSetLabels. See the method + description for details. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + ~.compute.Operation: + Represents an Operation resource. Google Compute Engine + has three Operation resources: \* + `Global `__ + \* + `Regional `__ + \* + `Zonal `__ + You can use an operation resource to manage asynchronous + API requests. For more information, read Handling API + responses. Operations can be global, regional or zonal. + - For global operations, use the ``globalOperations`` + resource. - For regional operations, use the + ``regionOperations`` resource. - For zonal operations, + use the ``zoneOperations`` resource. For more + information, read Global, Regional, and Zonal Resources. + Note that completed Operation resources have a limited + retention period. + + """ + + http_options = ( + _BaseDisksRestTransport._BaseBulkSetLabels._get_http_options() + ) + + request, metadata = self._interceptor.pre_bulk_set_labels(request, metadata) + transcoded_request = ( + _BaseDisksRestTransport._BaseBulkSetLabels._get_transcoded_request( + http_options, request + ) + ) + + body = _BaseDisksRestTransport._BaseBulkSetLabels._get_request_body_json( + transcoded_request + ) + + # Jsonify the query params + query_params = ( + _BaseDisksRestTransport._BaseBulkSetLabels._get_query_params_json( + transcoded_request + ) + ) + + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + try: + request_payload = type(request).to_json(request) + except: + request_payload = None + http_request = { + "payload": request_payload, + "requestMethod": method, + "requestUrl": request_url, + "headers": dict(metadata), + } + _LOGGER.debug( + f"Sending request for google.cloud.compute_v1.DisksClient.BulkSetLabels", + extra={ + "serviceName": "google.cloud.compute.v1.Disks", + "rpcName": "BulkSetLabels", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = DisksRestTransport._BulkSetLabels._get_response( + self._host, + metadata, + query_params, + self._session, + timeout, + transcoded_request, + body, + ) + + # In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception + # subclass. + if response.status_code >= 400: + raise core_exceptions.from_http_response(response) + + # Return the response + resp = compute.Operation() + pb_resp = compute.Operation.pb(resp) + + json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True) + + resp = self._interceptor.post_bulk_set_labels(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_bulk_set_labels_with_metadata( + resp, response_metadata + ) + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + try: + response_payload = compute.Operation.to_json(response) + except: + response_payload = None + http_response = { + "payload": response_payload, + "headers": dict(response.headers), + "status": response.status_code, + } + _LOGGER.debug( + "Received response for google.cloud.compute_v1.DisksClient.bulk_set_labels", + extra={ + "serviceName": "google.cloud.compute.v1.Disks", + "rpcName": "BulkSetLabels", + "metadata": http_response["headers"], + "httpResponse": http_response, + }, + ) + return resp + class _CreateSnapshot(_BaseDisksRestTransport._BaseCreateSnapshot, DisksRestStub): def __hash__(self): return hash("DisksRestTransport.CreateSnapshot") @@ -4133,6 +4358,14 @@ def bulk_insert( # In C++ this would require a dynamic_cast return self._BulkInsert(self._session, self._host, self._interceptor) # type: ignore + @property + def bulk_set_labels( + self, + ) -> Callable[[compute.BulkSetLabelsDiskRequest], compute.Operation]: + # The return type is fine, but mypy isn't sophisticated enough to determine what's going on here. + # In C++ this would require a dynamic_cast + return self._BulkSetLabels(self._session, self._host, self._interceptor) # type: ignore + @property def create_snapshot( self, diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/disks/transports/rest_base.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/disks/transports/rest_base.py index 59d177e05982..3992de014cc3 100644 --- a/packages/google-cloud-compute/google/cloud/compute_v1/services/disks/transports/rest_base.py +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/disks/transports/rest_base.py @@ -245,6 +245,62 @@ def _get_query_params_json(transcoded_request): return query_params + class _BaseBulkSetLabels: + def __hash__(self): # pragma: NO COVER + return NotImplementedError("__hash__ must be implemented.") + + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} + + @classmethod + def _get_unset_required_fields(cls, message_dict): + return { + k: v + for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items() + if k not in message_dict + } + + @staticmethod + def _get_http_options(): + http_options: List[Dict[str, str]] = [ + { + "method": "post", + "uri": "/compute/v1/projects/{project}/zones/{zone}/disks/bulkSetLabels", + "body": "bulk_zone_set_labels_request_resource", + }, + ] + return http_options + + @staticmethod + def _get_transcoded_request(http_options, request): + pb_request = compute.BulkSetLabelsDiskRequest.pb(request) + transcoded_request = path_template.transcode(http_options, pb_request) + return transcoded_request + + @staticmethod + def _get_request_body_json(transcoded_request): + # Jsonify the request body + + body = json_format.MessageToJson( + transcoded_request["body"], use_integers_for_enums=False + ) + return body + + @staticmethod + def _get_query_params_json(transcoded_request): + query_params = json.loads( + json_format.MessageToJson( + transcoded_request["query_params"], + use_integers_for_enums=False, + ) + ) + query_params.update( + _BaseDisksRestTransport._BaseBulkSetLabels._get_unset_required_fields( + query_params + ) + ) + + return query_params + class _BaseCreateSnapshot: def __hash__(self): # pragma: NO COVER return NotImplementedError("__hash__ must be implemented.") diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/interconnect_attachment_groups/__init__.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/interconnect_attachment_groups/__init__.py new file mode 100644 index 000000000000..f267ab07d77d --- /dev/null +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/interconnect_attachment_groups/__init__.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from .client import InterconnectAttachmentGroupsClient + +__all__ = ("InterconnectAttachmentGroupsClient",) diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/interconnect_attachment_groups/client.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/interconnect_attachment_groups/client.py new file mode 100644 index 000000000000..50125c531338 --- /dev/null +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/interconnect_attachment_groups/client.py @@ -0,0 +1,2440 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from collections import OrderedDict +import functools +from http import HTTPStatus +import json +import logging as std_logging +import os +import re +from typing import ( + Callable, + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, + cast, +) +import warnings + +from google.api_core import client_options as client_options_lib +from google.api_core import exceptions as core_exceptions +from google.api_core import extended_operation, gapic_v1 +from google.api_core import retry as retries +from google.auth import credentials as ga_credentials # type: ignore +from google.auth.exceptions import MutualTLSChannelError # type: ignore +from google.auth.transport import mtls # type: ignore +from google.auth.transport.grpc import SslCredentials # type: ignore +from google.oauth2 import service_account # type: ignore +import google.protobuf + +from google.cloud.compute_v1 import gapic_version as package_version + +try: + OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault, None] +except AttributeError: # pragma: NO COVER + OptionalRetry = Union[retries.Retry, object, None] # type: ignore + +try: + from google.api_core import client_logging # type: ignore + + CLIENT_LOGGING_SUPPORTED = True # pragma: NO COVER +except ImportError: # pragma: NO COVER + CLIENT_LOGGING_SUPPORTED = False + +_LOGGER = std_logging.getLogger(__name__) + +from google.api_core import extended_operation # type: ignore + +from google.cloud.compute_v1.services.interconnect_attachment_groups import pagers +from google.cloud.compute_v1.types import compute + +from .transports.base import DEFAULT_CLIENT_INFO, InterconnectAttachmentGroupsTransport +from .transports.rest import InterconnectAttachmentGroupsRestTransport + + +class InterconnectAttachmentGroupsClientMeta(type): + """Metaclass for the InterconnectAttachmentGroups client. + + This provides class-level methods for building and retrieving + support objects (e.g. transport) without polluting the client instance + objects. + """ + + _transport_registry = ( + OrderedDict() + ) # type: Dict[str, Type[InterconnectAttachmentGroupsTransport]] + _transport_registry["rest"] = InterconnectAttachmentGroupsRestTransport + + def get_transport_class( + cls, + label: Optional[str] = None, + ) -> Type[InterconnectAttachmentGroupsTransport]: + """Returns an appropriate transport class. + + Args: + label: The name of the desired transport. If none is + provided, then the first transport in the registry is used. + + Returns: + The transport class to use. + """ + # If a specific transport is requested, return that one. + if label: + return cls._transport_registry[label] + + # No transport is requested; return the default (that is, the first one + # in the dictionary). + return next(iter(cls._transport_registry.values())) + + +class InterconnectAttachmentGroupsClient( + metaclass=InterconnectAttachmentGroupsClientMeta +): + """The InterconnectAttachmentGroups API.""" + + @staticmethod + def _get_default_mtls_endpoint(api_endpoint): + """Converts api endpoint to mTLS endpoint. + + Convert "*.sandbox.googleapis.com" and "*.googleapis.com" to + "*.mtls.sandbox.googleapis.com" and "*.mtls.googleapis.com" respectively. + Args: + api_endpoint (Optional[str]): the api endpoint to convert. + Returns: + str: converted mTLS api endpoint. + """ + if not api_endpoint: + return api_endpoint + + mtls_endpoint_re = re.compile( + r"(?P[^.]+)(?P\.mtls)?(?P\.sandbox)?(?P\.googleapis\.com)?" + ) + + m = mtls_endpoint_re.match(api_endpoint) + name, mtls, sandbox, googledomain = m.groups() + if mtls or not googledomain: + return api_endpoint + + if sandbox: + return api_endpoint.replace( + "sandbox.googleapis.com", "mtls.sandbox.googleapis.com" + ) + + return api_endpoint.replace(".googleapis.com", ".mtls.googleapis.com") + + # Note: DEFAULT_ENDPOINT is deprecated. Use _DEFAULT_ENDPOINT_TEMPLATE instead. + DEFAULT_ENDPOINT = "compute.googleapis.com" + DEFAULT_MTLS_ENDPOINT = _get_default_mtls_endpoint.__func__( # type: ignore + DEFAULT_ENDPOINT + ) + + _DEFAULT_ENDPOINT_TEMPLATE = "compute.{UNIVERSE_DOMAIN}" + _DEFAULT_UNIVERSE = "googleapis.com" + + @classmethod + def from_service_account_info(cls, info: dict, *args, **kwargs): + """Creates an instance of this client using the provided credentials + info. + + Args: + info (dict): The service account private key info. + args: Additional arguments to pass to the constructor. + kwargs: Additional arguments to pass to the constructor. + + Returns: + InterconnectAttachmentGroupsClient: The constructed client. + """ + credentials = service_account.Credentials.from_service_account_info(info) + kwargs["credentials"] = credentials + return cls(*args, **kwargs) + + @classmethod + def from_service_account_file(cls, filename: str, *args, **kwargs): + """Creates an instance of this client using the provided credentials + file. + + Args: + filename (str): The path to the service account private key json + file. + args: Additional arguments to pass to the constructor. + kwargs: Additional arguments to pass to the constructor. + + Returns: + InterconnectAttachmentGroupsClient: The constructed client. + """ + credentials = service_account.Credentials.from_service_account_file(filename) + kwargs["credentials"] = credentials + return cls(*args, **kwargs) + + from_service_account_json = from_service_account_file + + @property + def transport(self) -> InterconnectAttachmentGroupsTransport: + """Returns the transport used by the client instance. + + Returns: + InterconnectAttachmentGroupsTransport: The transport used by the client + instance. + """ + return self._transport + + @staticmethod + def common_billing_account_path( + billing_account: str, + ) -> str: + """Returns a fully-qualified billing_account string.""" + return "billingAccounts/{billing_account}".format( + billing_account=billing_account, + ) + + @staticmethod + def parse_common_billing_account_path(path: str) -> Dict[str, str]: + """Parse a billing_account path into its component segments.""" + m = re.match(r"^billingAccounts/(?P.+?)$", path) + return m.groupdict() if m else {} + + @staticmethod + def common_folder_path( + folder: str, + ) -> str: + """Returns a fully-qualified folder string.""" + return "folders/{folder}".format( + folder=folder, + ) + + @staticmethod + def parse_common_folder_path(path: str) -> Dict[str, str]: + """Parse a folder path into its component segments.""" + m = re.match(r"^folders/(?P.+?)$", path) + return m.groupdict() if m else {} + + @staticmethod + def common_organization_path( + organization: str, + ) -> str: + """Returns a fully-qualified organization string.""" + return "organizations/{organization}".format( + organization=organization, + ) + + @staticmethod + def parse_common_organization_path(path: str) -> Dict[str, str]: + """Parse a organization path into its component segments.""" + m = re.match(r"^organizations/(?P.+?)$", path) + return m.groupdict() if m else {} + + @staticmethod + def common_project_path( + project: str, + ) -> str: + """Returns a fully-qualified project string.""" + return "projects/{project}".format( + project=project, + ) + + @staticmethod + def parse_common_project_path(path: str) -> Dict[str, str]: + """Parse a project path into its component segments.""" + m = re.match(r"^projects/(?P.+?)$", path) + return m.groupdict() if m else {} + + @staticmethod + def common_location_path( + project: str, + location: str, + ) -> str: + """Returns a fully-qualified location string.""" + return "projects/{project}/locations/{location}".format( + project=project, + location=location, + ) + + @staticmethod + def parse_common_location_path(path: str) -> Dict[str, str]: + """Parse a location path into its component segments.""" + m = re.match(r"^projects/(?P.+?)/locations/(?P.+?)$", path) + return m.groupdict() if m else {} + + @classmethod + def get_mtls_endpoint_and_cert_source( + cls, client_options: Optional[client_options_lib.ClientOptions] = None + ): + """Deprecated. Return the API endpoint and client cert source for mutual TLS. + + The client cert source is determined in the following order: + (1) if `GOOGLE_API_USE_CLIENT_CERTIFICATE` environment variable is not "true", the + client cert source is None. + (2) if `client_options.client_cert_source` is provided, use the provided one; if the + default client cert source exists, use the default one; otherwise the client cert + source is None. + + The API endpoint is determined in the following order: + (1) if `client_options.api_endpoint` if provided, use the provided one. + (2) if `GOOGLE_API_USE_CLIENT_CERTIFICATE` environment variable is "always", use the + default mTLS endpoint; if the environment variable is "never", use the default API + endpoint; otherwise if client cert source exists, use the default mTLS endpoint, otherwise + use the default API endpoint. + + More details can be found at https://google.aip.dev/auth/4114. + + Args: + client_options (google.api_core.client_options.ClientOptions): Custom options for the + client. Only the `api_endpoint` and `client_cert_source` properties may be used + in this method. + + Returns: + Tuple[str, Callable[[], Tuple[bytes, bytes]]]: returns the API endpoint and the + client cert source to use. + + Raises: + google.auth.exceptions.MutualTLSChannelError: If any errors happen. + """ + + warnings.warn( + "get_mtls_endpoint_and_cert_source is deprecated. Use the api_endpoint property instead.", + DeprecationWarning, + ) + if client_options is None: + client_options = client_options_lib.ClientOptions() + use_client_cert = os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false") + use_mtls_endpoint = os.getenv("GOOGLE_API_USE_MTLS_ENDPOINT", "auto") + if use_client_cert not in ("true", "false"): + raise ValueError( + "Environment variable `GOOGLE_API_USE_CLIENT_CERTIFICATE` must be either `true` or `false`" + ) + if use_mtls_endpoint not in ("auto", "never", "always"): + raise MutualTLSChannelError( + "Environment variable `GOOGLE_API_USE_MTLS_ENDPOINT` must be `never`, `auto` or `always`" + ) + + # Figure out the client cert source to use. + client_cert_source = None + if use_client_cert == "true": + if client_options.client_cert_source: + client_cert_source = client_options.client_cert_source + elif mtls.has_default_client_cert_source(): + client_cert_source = mtls.default_client_cert_source() + + # Figure out which api endpoint to use. + if client_options.api_endpoint is not None: + api_endpoint = client_options.api_endpoint + elif use_mtls_endpoint == "always" or ( + use_mtls_endpoint == "auto" and client_cert_source + ): + api_endpoint = cls.DEFAULT_MTLS_ENDPOINT + else: + api_endpoint = cls.DEFAULT_ENDPOINT + + return api_endpoint, client_cert_source + + @staticmethod + def _read_environment_variables(): + """Returns the environment variables used by the client. + + Returns: + Tuple[bool, str, str]: returns the GOOGLE_API_USE_CLIENT_CERTIFICATE, + GOOGLE_API_USE_MTLS_ENDPOINT, and GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variables. + + Raises: + ValueError: If GOOGLE_API_USE_CLIENT_CERTIFICATE is not + any of ["true", "false"]. + google.auth.exceptions.MutualTLSChannelError: If GOOGLE_API_USE_MTLS_ENDPOINT + is not any of ["auto", "never", "always"]. + """ + use_client_cert = os.getenv( + "GOOGLE_API_USE_CLIENT_CERTIFICATE", "false" + ).lower() + use_mtls_endpoint = os.getenv("GOOGLE_API_USE_MTLS_ENDPOINT", "auto").lower() + universe_domain_env = os.getenv("GOOGLE_CLOUD_UNIVERSE_DOMAIN") + if use_client_cert not in ("true", "false"): + raise ValueError( + "Environment variable `GOOGLE_API_USE_CLIENT_CERTIFICATE` must be either `true` or `false`" + ) + if use_mtls_endpoint not in ("auto", "never", "always"): + raise MutualTLSChannelError( + "Environment variable `GOOGLE_API_USE_MTLS_ENDPOINT` must be `never`, `auto` or `always`" + ) + return use_client_cert == "true", use_mtls_endpoint, universe_domain_env + + @staticmethod + def _get_client_cert_source(provided_cert_source, use_cert_flag): + """Return the client cert source to be used by the client. + + Args: + provided_cert_source (bytes): The client certificate source provided. + use_cert_flag (bool): A flag indicating whether to use the client certificate. + + Returns: + bytes or None: The client cert source to be used by the client. + """ + client_cert_source = None + if use_cert_flag: + if provided_cert_source: + client_cert_source = provided_cert_source + elif mtls.has_default_client_cert_source(): + client_cert_source = mtls.default_client_cert_source() + return client_cert_source + + @staticmethod + def _get_api_endpoint( + api_override, client_cert_source, universe_domain, use_mtls_endpoint + ): + """Return the API endpoint used by the client. + + Args: + api_override (str): The API endpoint override. If specified, this is always + the return value of this function and the other arguments are not used. + client_cert_source (bytes): The client certificate source used by the client. + universe_domain (str): The universe domain used by the client. + use_mtls_endpoint (str): How to use the mTLS endpoint, which depends also on the other parameters. + Possible values are "always", "auto", or "never". + + Returns: + str: The API endpoint to be used by the client. + """ + if api_override is not None: + api_endpoint = api_override + elif use_mtls_endpoint == "always" or ( + use_mtls_endpoint == "auto" and client_cert_source + ): + _default_universe = InterconnectAttachmentGroupsClient._DEFAULT_UNIVERSE + if universe_domain != _default_universe: + raise MutualTLSChannelError( + f"mTLS is not supported in any universe other than {_default_universe}." + ) + api_endpoint = InterconnectAttachmentGroupsClient.DEFAULT_MTLS_ENDPOINT + else: + api_endpoint = ( + InterconnectAttachmentGroupsClient._DEFAULT_ENDPOINT_TEMPLATE.format( + UNIVERSE_DOMAIN=universe_domain + ) + ) + return api_endpoint + + @staticmethod + def _get_universe_domain( + client_universe_domain: Optional[str], universe_domain_env: Optional[str] + ) -> str: + """Return the universe domain used by the client. + + Args: + client_universe_domain (Optional[str]): The universe domain configured via the client options. + universe_domain_env (Optional[str]): The universe domain configured via the "GOOGLE_CLOUD_UNIVERSE_DOMAIN" environment variable. + + Returns: + str: The universe domain to be used by the client. + + Raises: + ValueError: If the universe domain is an empty string. + """ + universe_domain = InterconnectAttachmentGroupsClient._DEFAULT_UNIVERSE + if client_universe_domain is not None: + universe_domain = client_universe_domain + elif universe_domain_env is not None: + universe_domain = universe_domain_env + if len(universe_domain.strip()) == 0: + raise ValueError("Universe Domain cannot be an empty string.") + return universe_domain + + def _validate_universe_domain(self): + """Validates client's and credentials' universe domains are consistent. + + Returns: + bool: True iff the configured universe domain is valid. + + Raises: + ValueError: If the configured universe domain is not valid. + """ + + # NOTE (b/349488459): universe validation is disabled until further notice. + return True + + def _add_cred_info_for_auth_errors( + self, error: core_exceptions.GoogleAPICallError + ) -> None: + """Adds credential info string to error details for 401/403/404 errors. + + Args: + error (google.api_core.exceptions.GoogleAPICallError): The error to add the cred info. + """ + if error.code not in [ + HTTPStatus.UNAUTHORIZED, + HTTPStatus.FORBIDDEN, + HTTPStatus.NOT_FOUND, + ]: + return + + cred = self._transport._credentials + + # get_cred_info is only available in google-auth>=2.35.0 + if not hasattr(cred, "get_cred_info"): + return + + # ignore the type check since pypy test fails when get_cred_info + # is not available + cred_info = cred.get_cred_info() # type: ignore + if cred_info and hasattr(error._details, "append"): + error._details.append(json.dumps(cred_info)) + + @property + def api_endpoint(self): + """Return the API endpoint used by the client instance. + + Returns: + str: The API endpoint used by the client instance. + """ + return self._api_endpoint + + @property + def universe_domain(self) -> str: + """Return the universe domain used by the client instance. + + Returns: + str: The universe domain used by the client instance. + """ + return self._universe_domain + + def __init__( + self, + *, + credentials: Optional[ga_credentials.Credentials] = None, + transport: Optional[ + Union[ + str, + InterconnectAttachmentGroupsTransport, + Callable[..., InterconnectAttachmentGroupsTransport], + ] + ] = None, + client_options: Optional[Union[client_options_lib.ClientOptions, dict]] = None, + client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, + ) -> None: + """Instantiates the interconnect attachment groups client. + + Args: + credentials (Optional[google.auth.credentials.Credentials]): The + authorization credentials to attach to requests. These + credentials identify the application to the service; if none + are specified, the client will attempt to ascertain the + credentials from the environment. + transport (Optional[Union[str,InterconnectAttachmentGroupsTransport,Callable[..., InterconnectAttachmentGroupsTransport]]]): + The transport to use, or a Callable that constructs and returns a new transport. + If a Callable is given, it will be called with the same set of initialization + arguments as used in the InterconnectAttachmentGroupsTransport constructor. + If set to None, a transport is chosen automatically. + NOTE: "rest" transport functionality is currently in a + beta state (preview). We welcome your feedback via an + issue in this library's source repository. + client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]): + Custom options for the client. + + 1. The ``api_endpoint`` property can be used to override the + default endpoint provided by the client when ``transport`` is + not explicitly provided. Only if this property is not set and + ``transport`` was not explicitly provided, the endpoint is + determined by the GOOGLE_API_USE_MTLS_ENDPOINT environment + variable, which have one of the following values: + "always" (always use the default mTLS endpoint), "never" (always + use the default regular endpoint) and "auto" (auto-switch to the + default mTLS endpoint if client certificate is present; this is + the default value). + + 2. If the GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable + is "true", then the ``client_cert_source`` property can be used + to provide a client certificate for mTLS transport. If + not provided, the default SSL client certificate will be used if + present. If GOOGLE_API_USE_CLIENT_CERTIFICATE is "false" or not + set, no client certificate will be used. + + 3. The ``universe_domain`` property can be used to override the + default "googleapis.com" universe. Note that the ``api_endpoint`` + property still takes precedence; and ``universe_domain`` is + currently not supported for mTLS. + + client_info (google.api_core.gapic_v1.client_info.ClientInfo): + The client info used to send a user-agent string along with + API requests. If ``None``, then default info will be used. + Generally, you only need to set this if you're developing + your own client library. + + Raises: + google.auth.exceptions.MutualTLSChannelError: If mutual TLS transport + creation failed for any reason. + """ + self._client_options = client_options + if isinstance(self._client_options, dict): + self._client_options = client_options_lib.from_dict(self._client_options) + if self._client_options is None: + self._client_options = client_options_lib.ClientOptions() + self._client_options = cast( + client_options_lib.ClientOptions, self._client_options + ) + + universe_domain_opt = getattr(self._client_options, "universe_domain", None) + + ( + self._use_client_cert, + self._use_mtls_endpoint, + self._universe_domain_env, + ) = InterconnectAttachmentGroupsClient._read_environment_variables() + self._client_cert_source = ( + InterconnectAttachmentGroupsClient._get_client_cert_source( + self._client_options.client_cert_source, self._use_client_cert + ) + ) + self._universe_domain = InterconnectAttachmentGroupsClient._get_universe_domain( + universe_domain_opt, self._universe_domain_env + ) + self._api_endpoint = None # updated below, depending on `transport` + + # Initialize the universe domain validation. + self._is_universe_domain_valid = False + + if CLIENT_LOGGING_SUPPORTED: # pragma: NO COVER + # Setup logging. + client_logging.initialize_logging() + + api_key_value = getattr(self._client_options, "api_key", None) + if api_key_value and credentials: + raise ValueError( + "client_options.api_key and credentials are mutually exclusive" + ) + + # Save or instantiate the transport. + # Ordinarily, we provide the transport, but allowing a custom transport + # instance provides an extensibility point for unusual situations. + transport_provided = isinstance( + transport, InterconnectAttachmentGroupsTransport + ) + if transport_provided: + # transport is a InterconnectAttachmentGroupsTransport instance. + if credentials or self._client_options.credentials_file or api_key_value: + raise ValueError( + "When providing a transport instance, " + "provide its credentials directly." + ) + if self._client_options.scopes: + raise ValueError( + "When providing a transport instance, provide its scopes " + "directly." + ) + self._transport = cast(InterconnectAttachmentGroupsTransport, transport) + self._api_endpoint = self._transport.host + + self._api_endpoint = ( + self._api_endpoint + or InterconnectAttachmentGroupsClient._get_api_endpoint( + self._client_options.api_endpoint, + self._client_cert_source, + self._universe_domain, + self._use_mtls_endpoint, + ) + ) + + if not transport_provided: + import google.auth._default # type: ignore + + if api_key_value and hasattr( + google.auth._default, "get_api_key_credentials" + ): + credentials = google.auth._default.get_api_key_credentials( + api_key_value + ) + + transport_init: Union[ + Type[InterconnectAttachmentGroupsTransport], + Callable[..., InterconnectAttachmentGroupsTransport], + ] = ( + InterconnectAttachmentGroupsClient.get_transport_class(transport) + if isinstance(transport, str) or transport is None + else cast( + Callable[..., InterconnectAttachmentGroupsTransport], transport + ) + ) + # initialize with the provided callable or the passed in class + self._transport = transport_init( + credentials=credentials, + credentials_file=self._client_options.credentials_file, + host=self._api_endpoint, + scopes=self._client_options.scopes, + client_cert_source_for_mtls=self._client_cert_source, + quota_project_id=self._client_options.quota_project_id, + client_info=client_info, + always_use_jwt_access=True, + api_audience=self._client_options.api_audience, + ) + + if "async" not in str(self._transport): + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + std_logging.DEBUG + ): # pragma: NO COVER + _LOGGER.debug( + "Created client `google.cloud.compute_v1.InterconnectAttachmentGroupsClient`.", + extra={ + "serviceName": "google.cloud.compute.v1.InterconnectAttachmentGroups", + "universeDomain": getattr( + self._transport._credentials, "universe_domain", "" + ), + "credentialsType": f"{type(self._transport._credentials).__module__}.{type(self._transport._credentials).__qualname__}", + "credentialsInfo": getattr( + self.transport._credentials, "get_cred_info", lambda: None + )(), + } + if hasattr(self._transport, "_credentials") + else { + "serviceName": "google.cloud.compute.v1.InterconnectAttachmentGroups", + "credentialsType": None, + }, + ) + + def delete_unary( + self, + request: Optional[ + Union[compute.DeleteInterconnectAttachmentGroupRequest, dict] + ] = None, + *, + project: Optional[str] = None, + interconnect_attachment_group: Optional[str] = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> compute.Operation: + r"""Deletes the specified InterconnectAttachmentGroup in + the given scope + + .. code-block:: python + + # This snippet 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 as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import compute_v1 + + def sample_delete(): + # Create a client + client = compute_v1.InterconnectAttachmentGroupsClient() + + # Initialize request argument(s) + request = compute_v1.DeleteInterconnectAttachmentGroupRequest( + interconnect_attachment_group="interconnect_attachment_group_value", + project="project_value", + ) + + # Make the request + response = client.delete(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.compute_v1.types.DeleteInterconnectAttachmentGroupRequest, dict]): + The request object. A request message for + InterconnectAttachmentGroups.Delete. See + the method description for details. + project (str): + Project ID for this request. + This corresponds to the ``project`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + interconnect_attachment_group (str): + Name of the + InterconnectAttachmentGroup resource to + delete. + + This corresponds to the ``interconnect_attachment_group`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + google.api_core.extended_operation.ExtendedOperation: + An object representing a extended + long-running operation. + + """ + # Create or coerce a protobuf request object. + # - Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + flattened_params = [project, interconnect_attachment_group] + has_flattened_params = ( + len([param for param in flattened_params if param is not None]) > 0 + ) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + # - Use the request object if provided (there's no risk of modifying the input as + # there are no flattened fields), or create one. + if not isinstance(request, compute.DeleteInterconnectAttachmentGroupRequest): + request = compute.DeleteInterconnectAttachmentGroupRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if project is not None: + request.project = project + if interconnect_attachment_group is not None: + request.interconnect_attachment_group = interconnect_attachment_group + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.delete] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata( + ( + ("project", request.project), + ( + "interconnect_attachment_group", + request.interconnect_attachment_group, + ), + ) + ), + ) + + # Validate the universe domain. + self._validate_universe_domain() + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + def delete( + self, + request: Optional[ + Union[compute.DeleteInterconnectAttachmentGroupRequest, dict] + ] = None, + *, + project: Optional[str] = None, + interconnect_attachment_group: Optional[str] = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> extended_operation.ExtendedOperation: + r"""Deletes the specified InterconnectAttachmentGroup in + the given scope + + .. code-block:: python + + # This snippet 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 as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import compute_v1 + + def sample_delete(): + # Create a client + client = compute_v1.InterconnectAttachmentGroupsClient() + + # Initialize request argument(s) + request = compute_v1.DeleteInterconnectAttachmentGroupRequest( + interconnect_attachment_group="interconnect_attachment_group_value", + project="project_value", + ) + + # Make the request + response = client.delete(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.compute_v1.types.DeleteInterconnectAttachmentGroupRequest, dict]): + The request object. A request message for + InterconnectAttachmentGroups.Delete. See + the method description for details. + project (str): + Project ID for this request. + This corresponds to the ``project`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + interconnect_attachment_group (str): + Name of the + InterconnectAttachmentGroup resource to + delete. + + This corresponds to the ``interconnect_attachment_group`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + google.api_core.extended_operation.ExtendedOperation: + An object representing a extended + long-running operation. + + """ + # Create or coerce a protobuf request object. + # - Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + flattened_params = [project, interconnect_attachment_group] + has_flattened_params = ( + len([param for param in flattened_params if param is not None]) > 0 + ) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + # - Use the request object if provided (there's no risk of modifying the input as + # there are no flattened fields), or create one. + if not isinstance(request, compute.DeleteInterconnectAttachmentGroupRequest): + request = compute.DeleteInterconnectAttachmentGroupRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if project is not None: + request.project = project + if interconnect_attachment_group is not None: + request.interconnect_attachment_group = interconnect_attachment_group + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.delete] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata( + ( + ("project", request.project), + ( + "interconnect_attachment_group", + request.interconnect_attachment_group, + ), + ) + ), + ) + + # Validate the universe domain. + self._validate_universe_domain() + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + operation_service = self._transport._global_operations_client + operation_request = compute.GetGlobalOperationRequest() + operation_request.project = request.project + operation_request.operation = response.name + + get_operation = functools.partial(operation_service.get, operation_request) + # Cancel is not part of extended operations yet. + cancel_operation = lambda: None + + # Note: this class is an implementation detail to provide a uniform + # set of names for certain fields in the extended operation proto message. + # See google.api_core.extended_operation.ExtendedOperation for details + # on these properties and the expected interface. + class _CustomOperation(extended_operation.ExtendedOperation): + @property + def error_message(self): + return self._extended_operation.http_error_message + + @property + def error_code(self): + return self._extended_operation.http_error_status_code + + response = _CustomOperation.make(get_operation, cancel_operation, response) + + # Done; return the response. + return response + + def get( + self, + request: Optional[ + Union[compute.GetInterconnectAttachmentGroupRequest, dict] + ] = None, + *, + project: Optional[str] = None, + interconnect_attachment_group: Optional[str] = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> compute.InterconnectAttachmentGroup: + r"""Returns the specified InterconnectAttachmentGroup + resource in the given scope. + + .. code-block:: python + + # This snippet 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 as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import compute_v1 + + def sample_get(): + # Create a client + client = compute_v1.InterconnectAttachmentGroupsClient() + + # Initialize request argument(s) + request = compute_v1.GetInterconnectAttachmentGroupRequest( + interconnect_attachment_group="interconnect_attachment_group_value", + project="project_value", + ) + + # Make the request + response = client.get(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.compute_v1.types.GetInterconnectAttachmentGroupRequest, dict]): + The request object. A request message for + InterconnectAttachmentGroups.Get. See + the method description for details. + project (str): + Project ID for this request. + This corresponds to the ``project`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + interconnect_attachment_group (str): + Name of the + InterconnectAttachmentGroup resource to + return. + + This corresponds to the ``interconnect_attachment_group`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + google.cloud.compute_v1.types.InterconnectAttachmentGroup: + An interconnect attachment group + resource allows customers to create, + analyze, and expand highly available + deployments. + + """ + # Create or coerce a protobuf request object. + # - Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + flattened_params = [project, interconnect_attachment_group] + has_flattened_params = ( + len([param for param in flattened_params if param is not None]) > 0 + ) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + # - Use the request object if provided (there's no risk of modifying the input as + # there are no flattened fields), or create one. + if not isinstance(request, compute.GetInterconnectAttachmentGroupRequest): + request = compute.GetInterconnectAttachmentGroupRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if project is not None: + request.project = project + if interconnect_attachment_group is not None: + request.interconnect_attachment_group = interconnect_attachment_group + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.get] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata( + ( + ("project", request.project), + ( + "interconnect_attachment_group", + request.interconnect_attachment_group, + ), + ) + ), + ) + + # Validate the universe domain. + self._validate_universe_domain() + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + def get_iam_policy( + self, + request: Optional[ + Union[compute.GetIamPolicyInterconnectAttachmentGroupRequest, dict] + ] = None, + *, + project: Optional[str] = None, + resource: Optional[str] = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> compute.Policy: + r"""Gets the access control policy for a resource. May be + empty if no such policy or resource exists. + + .. code-block:: python + + # This snippet 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 as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import compute_v1 + + def sample_get_iam_policy(): + # Create a client + client = compute_v1.InterconnectAttachmentGroupsClient() + + # Initialize request argument(s) + request = compute_v1.GetIamPolicyInterconnectAttachmentGroupRequest( + project="project_value", + resource="resource_value", + ) + + # Make the request + response = client.get_iam_policy(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.compute_v1.types.GetIamPolicyInterconnectAttachmentGroupRequest, dict]): + The request object. A request message for + InterconnectAttachmentGroups.GetIamPolicy. + See the method description for details. + project (str): + Project ID for this request. + This corresponds to the ``project`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + resource (str): + Name or id of the resource for this + request. + + This corresponds to the ``resource`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + google.cloud.compute_v1.types.Policy: + An Identity and Access Management (IAM) policy, which + specifies access controls for Google Cloud resources. A + Policy is a collection of bindings. A binding binds one + or more members, or principals, to a single role. + Principals can be user accounts, service accounts, + Google groups, and domains (such as G Suite). A role is + a named list of permissions; each role can be an IAM + predefined role or a user-created custom role. For some + types of Google Cloud resources, a binding can also + specify a condition, which is a logical expression that + allows access to a resource only if the expression + evaluates to true. A condition can add constraints based + on attributes of the request, the resource, or both. To + learn which resources support conditions in their IAM + policies, see the [IAM + documentation](\ https://cloud.google.com/iam/help/conditions/resource-policies). + **JSON example:** + :literal:`\` { "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": [ "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": "BwWWja0YfJA=", "version": 3 }`\ \` + **YAML example:** + :literal:`\` bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3`\ \` + For a description of IAM and its features, see the [IAM + documentation](\ https://cloud.google.com/iam/docs/). + + """ + # Create or coerce a protobuf request object. + # - Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + flattened_params = [project, resource] + has_flattened_params = ( + len([param for param in flattened_params if param is not None]) > 0 + ) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + # - Use the request object if provided (there's no risk of modifying the input as + # there are no flattened fields), or create one. + if not isinstance( + request, compute.GetIamPolicyInterconnectAttachmentGroupRequest + ): + request = compute.GetIamPolicyInterconnectAttachmentGroupRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if project is not None: + request.project = project + if resource is not None: + request.resource = resource + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.get_iam_policy] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata( + ( + ("project", request.project), + ("resource", request.resource), + ) + ), + ) + + # Validate the universe domain. + self._validate_universe_domain() + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + def get_operational_status( + self, + request: Optional[ + Union[compute.GetOperationalStatusInterconnectAttachmentGroupRequest, dict] + ] = None, + *, + project: Optional[str] = None, + interconnect_attachment_group: Optional[str] = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> compute.InterconnectAttachmentGroupsGetOperationalStatusResponse: + r"""Returns the InterconnectAttachmentStatuses for the + specified InterconnectAttachmentGroup resource. + + .. code-block:: python + + # This snippet 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 as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import compute_v1 + + def sample_get_operational_status(): + # Create a client + client = compute_v1.InterconnectAttachmentGroupsClient() + + # Initialize request argument(s) + request = compute_v1.GetOperationalStatusInterconnectAttachmentGroupRequest( + interconnect_attachment_group="interconnect_attachment_group_value", + project="project_value", + ) + + # Make the request + response = client.get_operational_status(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.compute_v1.types.GetOperationalStatusInterconnectAttachmentGroupRequest, dict]): + The request object. A request message for + InterconnectAttachmentGroups.GetOperationalStatus. + See the method description for details. + project (str): + Project ID for this request. + This corresponds to the ``project`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + interconnect_attachment_group (str): + Name of the + interconnectAttachmentGroup resource to + query. + + This corresponds to the ``interconnect_attachment_group`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + google.cloud.compute_v1.types.InterconnectAttachmentGroupsGetOperationalStatusResponse: + Response for the + InterconnectAttachmentGroupsGetOperationalStatusResponse. + + """ + # Create or coerce a protobuf request object. + # - Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + flattened_params = [project, interconnect_attachment_group] + has_flattened_params = ( + len([param for param in flattened_params if param is not None]) > 0 + ) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + # - Use the request object if provided (there's no risk of modifying the input as + # there are no flattened fields), or create one. + if not isinstance( + request, compute.GetOperationalStatusInterconnectAttachmentGroupRequest + ): + request = compute.GetOperationalStatusInterconnectAttachmentGroupRequest( + request + ) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if project is not None: + request.project = project + if interconnect_attachment_group is not None: + request.interconnect_attachment_group = interconnect_attachment_group + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.get_operational_status] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata( + ( + ("project", request.project), + ( + "interconnect_attachment_group", + request.interconnect_attachment_group, + ), + ) + ), + ) + + # Validate the universe domain. + self._validate_universe_domain() + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + def insert_unary( + self, + request: Optional[ + Union[compute.InsertInterconnectAttachmentGroupRequest, dict] + ] = None, + *, + project: Optional[str] = None, + interconnect_attachment_group_resource: Optional[ + compute.InterconnectAttachmentGroup + ] = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> compute.Operation: + r"""Creates a InterconnectAttachmentGroup in the + specified project in the given scope using the + parameters that are included in the request. + + .. code-block:: python + + # This snippet 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 as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import compute_v1 + + def sample_insert(): + # Create a client + client = compute_v1.InterconnectAttachmentGroupsClient() + + # Initialize request argument(s) + request = compute_v1.InsertInterconnectAttachmentGroupRequest( + project="project_value", + ) + + # Make the request + response = client.insert(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.compute_v1.types.InsertInterconnectAttachmentGroupRequest, dict]): + The request object. A request message for + InterconnectAttachmentGroups.Insert. See + the method description for details. + project (str): + Project ID for this request. + This corresponds to the ``project`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + interconnect_attachment_group_resource (google.cloud.compute_v1.types.InterconnectAttachmentGroup): + The body resource for this request + This corresponds to the ``interconnect_attachment_group_resource`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + google.api_core.extended_operation.ExtendedOperation: + An object representing a extended + long-running operation. + + """ + # Create or coerce a protobuf request object. + # - Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + flattened_params = [project, interconnect_attachment_group_resource] + has_flattened_params = ( + len([param for param in flattened_params if param is not None]) > 0 + ) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + # - Use the request object if provided (there's no risk of modifying the input as + # there are no flattened fields), or create one. + if not isinstance(request, compute.InsertInterconnectAttachmentGroupRequest): + request = compute.InsertInterconnectAttachmentGroupRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if project is not None: + request.project = project + if interconnect_attachment_group_resource is not None: + request.interconnect_attachment_group_resource = ( + interconnect_attachment_group_resource + ) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.insert] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("project", request.project),)), + ) + + # Validate the universe domain. + self._validate_universe_domain() + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + def insert( + self, + request: Optional[ + Union[compute.InsertInterconnectAttachmentGroupRequest, dict] + ] = None, + *, + project: Optional[str] = None, + interconnect_attachment_group_resource: Optional[ + compute.InterconnectAttachmentGroup + ] = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> extended_operation.ExtendedOperation: + r"""Creates a InterconnectAttachmentGroup in the + specified project in the given scope using the + parameters that are included in the request. + + .. code-block:: python + + # This snippet 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 as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import compute_v1 + + def sample_insert(): + # Create a client + client = compute_v1.InterconnectAttachmentGroupsClient() + + # Initialize request argument(s) + request = compute_v1.InsertInterconnectAttachmentGroupRequest( + project="project_value", + ) + + # Make the request + response = client.insert(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.compute_v1.types.InsertInterconnectAttachmentGroupRequest, dict]): + The request object. A request message for + InterconnectAttachmentGroups.Insert. See + the method description for details. + project (str): + Project ID for this request. + This corresponds to the ``project`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + interconnect_attachment_group_resource (google.cloud.compute_v1.types.InterconnectAttachmentGroup): + The body resource for this request + This corresponds to the ``interconnect_attachment_group_resource`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + google.api_core.extended_operation.ExtendedOperation: + An object representing a extended + long-running operation. + + """ + # Create or coerce a protobuf request object. + # - Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + flattened_params = [project, interconnect_attachment_group_resource] + has_flattened_params = ( + len([param for param in flattened_params if param is not None]) > 0 + ) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + # - Use the request object if provided (there's no risk of modifying the input as + # there are no flattened fields), or create one. + if not isinstance(request, compute.InsertInterconnectAttachmentGroupRequest): + request = compute.InsertInterconnectAttachmentGroupRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if project is not None: + request.project = project + if interconnect_attachment_group_resource is not None: + request.interconnect_attachment_group_resource = ( + interconnect_attachment_group_resource + ) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.insert] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("project", request.project),)), + ) + + # Validate the universe domain. + self._validate_universe_domain() + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + operation_service = self._transport._global_operations_client + operation_request = compute.GetGlobalOperationRequest() + operation_request.project = request.project + operation_request.operation = response.name + + get_operation = functools.partial(operation_service.get, operation_request) + # Cancel is not part of extended operations yet. + cancel_operation = lambda: None + + # Note: this class is an implementation detail to provide a uniform + # set of names for certain fields in the extended operation proto message. + # See google.api_core.extended_operation.ExtendedOperation for details + # on these properties and the expected interface. + class _CustomOperation(extended_operation.ExtendedOperation): + @property + def error_message(self): + return self._extended_operation.http_error_message + + @property + def error_code(self): + return self._extended_operation.http_error_status_code + + response = _CustomOperation.make(get_operation, cancel_operation, response) + + # Done; return the response. + return response + + def list( + self, + request: Optional[ + Union[compute.ListInterconnectAttachmentGroupsRequest, dict] + ] = None, + *, + project: Optional[str] = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> pagers.ListPager: + r"""Lists the InterconnectAttachmentGroups for a project + in the given scope. + + .. code-block:: python + + # This snippet 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 as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import compute_v1 + + def sample_list(): + # Create a client + client = compute_v1.InterconnectAttachmentGroupsClient() + + # Initialize request argument(s) + request = compute_v1.ListInterconnectAttachmentGroupsRequest( + project="project_value", + ) + + # Make the request + page_result = client.list(request=request) + + # Handle the response + for response in page_result: + print(response) + + Args: + request (Union[google.cloud.compute_v1.types.ListInterconnectAttachmentGroupsRequest, dict]): + The request object. A request message for + InterconnectAttachmentGroups.List. See + the method description for details. + project (str): + Project ID for this request. + This corresponds to the ``project`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + google.cloud.compute_v1.services.interconnect_attachment_groups.pagers.ListPager: + Iterating over this object will yield + results and resolve additional pages + automatically. + + """ + # Create or coerce a protobuf request object. + # - Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + flattened_params = [project] + has_flattened_params = ( + len([param for param in flattened_params if param is not None]) > 0 + ) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + # - Use the request object if provided (there's no risk of modifying the input as + # there are no flattened fields), or create one. + if not isinstance(request, compute.ListInterconnectAttachmentGroupsRequest): + request = compute.ListInterconnectAttachmentGroupsRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if project is not None: + request.project = project + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.list] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("project", request.project),)), + ) + + # Validate the universe domain. + self._validate_universe_domain() + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # This method is paged; wrap the response in a pager, which provides + # an `__iter__` convenience method. + response = pagers.ListPager( + method=rpc, + request=request, + response=response, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + def patch_unary( + self, + request: Optional[ + Union[compute.PatchInterconnectAttachmentGroupRequest, dict] + ] = None, + *, + project: Optional[str] = None, + interconnect_attachment_group: Optional[str] = None, + interconnect_attachment_group_resource: Optional[ + compute.InterconnectAttachmentGroup + ] = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> compute.Operation: + r"""Patches the specified InterconnectAttachmentGroup + resource with the data included in the request. This + method supports PATCH semantics and uses JSON merge + patch format and processing rules. + + .. code-block:: python + + # This snippet 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 as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import compute_v1 + + def sample_patch(): + # Create a client + client = compute_v1.InterconnectAttachmentGroupsClient() + + # Initialize request argument(s) + request = compute_v1.PatchInterconnectAttachmentGroupRequest( + interconnect_attachment_group="interconnect_attachment_group_value", + project="project_value", + ) + + # Make the request + response = client.patch(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.compute_v1.types.PatchInterconnectAttachmentGroupRequest, dict]): + The request object. A request message for + InterconnectAttachmentGroups.Patch. See + the method description for details. + project (str): + Project ID for this request. + This corresponds to the ``project`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + interconnect_attachment_group (str): + Name of the + InterconnectAttachmentGroup resource to + patch. + + This corresponds to the ``interconnect_attachment_group`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + interconnect_attachment_group_resource (google.cloud.compute_v1.types.InterconnectAttachmentGroup): + The body resource for this request + This corresponds to the ``interconnect_attachment_group_resource`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + google.api_core.extended_operation.ExtendedOperation: + An object representing a extended + long-running operation. + + """ + # Create or coerce a protobuf request object. + # - Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + flattened_params = [ + project, + interconnect_attachment_group, + interconnect_attachment_group_resource, + ] + has_flattened_params = ( + len([param for param in flattened_params if param is not None]) > 0 + ) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + # - Use the request object if provided (there's no risk of modifying the input as + # there are no flattened fields), or create one. + if not isinstance(request, compute.PatchInterconnectAttachmentGroupRequest): + request = compute.PatchInterconnectAttachmentGroupRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if project is not None: + request.project = project + if interconnect_attachment_group is not None: + request.interconnect_attachment_group = interconnect_attachment_group + if interconnect_attachment_group_resource is not None: + request.interconnect_attachment_group_resource = ( + interconnect_attachment_group_resource + ) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.patch] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata( + ( + ("project", request.project), + ( + "interconnect_attachment_group", + request.interconnect_attachment_group, + ), + ) + ), + ) + + # Validate the universe domain. + self._validate_universe_domain() + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + def patch( + self, + request: Optional[ + Union[compute.PatchInterconnectAttachmentGroupRequest, dict] + ] = None, + *, + project: Optional[str] = None, + interconnect_attachment_group: Optional[str] = None, + interconnect_attachment_group_resource: Optional[ + compute.InterconnectAttachmentGroup + ] = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> extended_operation.ExtendedOperation: + r"""Patches the specified InterconnectAttachmentGroup + resource with the data included in the request. This + method supports PATCH semantics and uses JSON merge + patch format and processing rules. + + .. code-block:: python + + # This snippet 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 as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import compute_v1 + + def sample_patch(): + # Create a client + client = compute_v1.InterconnectAttachmentGroupsClient() + + # Initialize request argument(s) + request = compute_v1.PatchInterconnectAttachmentGroupRequest( + interconnect_attachment_group="interconnect_attachment_group_value", + project="project_value", + ) + + # Make the request + response = client.patch(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.compute_v1.types.PatchInterconnectAttachmentGroupRequest, dict]): + The request object. A request message for + InterconnectAttachmentGroups.Patch. See + the method description for details. + project (str): + Project ID for this request. + This corresponds to the ``project`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + interconnect_attachment_group (str): + Name of the + InterconnectAttachmentGroup resource to + patch. + + This corresponds to the ``interconnect_attachment_group`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + interconnect_attachment_group_resource (google.cloud.compute_v1.types.InterconnectAttachmentGroup): + The body resource for this request + This corresponds to the ``interconnect_attachment_group_resource`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + google.api_core.extended_operation.ExtendedOperation: + An object representing a extended + long-running operation. + + """ + # Create or coerce a protobuf request object. + # - Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + flattened_params = [ + project, + interconnect_attachment_group, + interconnect_attachment_group_resource, + ] + has_flattened_params = ( + len([param for param in flattened_params if param is not None]) > 0 + ) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + # - Use the request object if provided (there's no risk of modifying the input as + # there are no flattened fields), or create one. + if not isinstance(request, compute.PatchInterconnectAttachmentGroupRequest): + request = compute.PatchInterconnectAttachmentGroupRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if project is not None: + request.project = project + if interconnect_attachment_group is not None: + request.interconnect_attachment_group = interconnect_attachment_group + if interconnect_attachment_group_resource is not None: + request.interconnect_attachment_group_resource = ( + interconnect_attachment_group_resource + ) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.patch] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata( + ( + ("project", request.project), + ( + "interconnect_attachment_group", + request.interconnect_attachment_group, + ), + ) + ), + ) + + # Validate the universe domain. + self._validate_universe_domain() + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + operation_service = self._transport._global_operations_client + operation_request = compute.GetGlobalOperationRequest() + operation_request.project = request.project + operation_request.operation = response.name + + get_operation = functools.partial(operation_service.get, operation_request) + # Cancel is not part of extended operations yet. + cancel_operation = lambda: None + + # Note: this class is an implementation detail to provide a uniform + # set of names for certain fields in the extended operation proto message. + # See google.api_core.extended_operation.ExtendedOperation for details + # on these properties and the expected interface. + class _CustomOperation(extended_operation.ExtendedOperation): + @property + def error_message(self): + return self._extended_operation.http_error_message + + @property + def error_code(self): + return self._extended_operation.http_error_status_code + + response = _CustomOperation.make(get_operation, cancel_operation, response) + + # Done; return the response. + return response + + def set_iam_policy( + self, + request: Optional[ + Union[compute.SetIamPolicyInterconnectAttachmentGroupRequest, dict] + ] = None, + *, + project: Optional[str] = None, + resource: Optional[str] = None, + global_set_policy_request_resource: Optional[ + compute.GlobalSetPolicyRequest + ] = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> compute.Policy: + r"""Sets the access control policy on the specified + resource. Replaces any existing policy. + + .. code-block:: python + + # This snippet 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 as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import compute_v1 + + def sample_set_iam_policy(): + # Create a client + client = compute_v1.InterconnectAttachmentGroupsClient() + + # Initialize request argument(s) + request = compute_v1.SetIamPolicyInterconnectAttachmentGroupRequest( + project="project_value", + resource="resource_value", + ) + + # Make the request + response = client.set_iam_policy(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.compute_v1.types.SetIamPolicyInterconnectAttachmentGroupRequest, dict]): + The request object. A request message for + InterconnectAttachmentGroups.SetIamPolicy. + See the method description for details. + project (str): + Project ID for this request. + This corresponds to the ``project`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + resource (str): + Name or id of the resource for this + request. + + This corresponds to the ``resource`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + global_set_policy_request_resource (google.cloud.compute_v1.types.GlobalSetPolicyRequest): + The body resource for this request + This corresponds to the ``global_set_policy_request_resource`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + google.cloud.compute_v1.types.Policy: + An Identity and Access Management (IAM) policy, which + specifies access controls for Google Cloud resources. A + Policy is a collection of bindings. A binding binds one + or more members, or principals, to a single role. + Principals can be user accounts, service accounts, + Google groups, and domains (such as G Suite). A role is + a named list of permissions; each role can be an IAM + predefined role or a user-created custom role. For some + types of Google Cloud resources, a binding can also + specify a condition, which is a logical expression that + allows access to a resource only if the expression + evaluates to true. A condition can add constraints based + on attributes of the request, the resource, or both. To + learn which resources support conditions in their IAM + policies, see the [IAM + documentation](\ https://cloud.google.com/iam/help/conditions/resource-policies). + **JSON example:** + :literal:`\` { "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": [ "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": "BwWWja0YfJA=", "version": 3 }`\ \` + **YAML example:** + :literal:`\` bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3`\ \` + For a description of IAM and its features, see the [IAM + documentation](\ https://cloud.google.com/iam/docs/). + + """ + # Create or coerce a protobuf request object. + # - Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + flattened_params = [project, resource, global_set_policy_request_resource] + has_flattened_params = ( + len([param for param in flattened_params if param is not None]) > 0 + ) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + # - Use the request object if provided (there's no risk of modifying the input as + # there are no flattened fields), or create one. + if not isinstance( + request, compute.SetIamPolicyInterconnectAttachmentGroupRequest + ): + request = compute.SetIamPolicyInterconnectAttachmentGroupRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if project is not None: + request.project = project + if resource is not None: + request.resource = resource + if global_set_policy_request_resource is not None: + request.global_set_policy_request_resource = ( + global_set_policy_request_resource + ) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.set_iam_policy] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata( + ( + ("project", request.project), + ("resource", request.resource), + ) + ), + ) + + # Validate the universe domain. + self._validate_universe_domain() + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + def test_iam_permissions( + self, + request: Optional[ + Union[compute.TestIamPermissionsInterconnectAttachmentGroupRequest, dict] + ] = None, + *, + project: Optional[str] = None, + resource: Optional[str] = None, + test_permissions_request_resource: Optional[ + compute.TestPermissionsRequest + ] = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> compute.TestPermissionsResponse: + r"""Returns permissions that a caller has on the + specified resource. + + .. code-block:: python + + # This snippet 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 as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import compute_v1 + + def sample_test_iam_permissions(): + # Create a client + client = compute_v1.InterconnectAttachmentGroupsClient() + + # Initialize request argument(s) + request = compute_v1.TestIamPermissionsInterconnectAttachmentGroupRequest( + project="project_value", + resource="resource_value", + ) + + # Make the request + response = client.test_iam_permissions(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.compute_v1.types.TestIamPermissionsInterconnectAttachmentGroupRequest, dict]): + The request object. A request message for + InterconnectAttachmentGroups.TestIamPermissions. + See the method description for details. + project (str): + Project ID for this request. + This corresponds to the ``project`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + resource (str): + Name or id of the resource for this + request. + + This corresponds to the ``resource`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + test_permissions_request_resource (google.cloud.compute_v1.types.TestPermissionsRequest): + The body resource for this request + This corresponds to the ``test_permissions_request_resource`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + google.cloud.compute_v1.types.TestPermissionsResponse: + + """ + # Create or coerce a protobuf request object. + # - Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + flattened_params = [project, resource, test_permissions_request_resource] + has_flattened_params = ( + len([param for param in flattened_params if param is not None]) > 0 + ) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + # - Use the request object if provided (there's no risk of modifying the input as + # there are no flattened fields), or create one. + if not isinstance( + request, compute.TestIamPermissionsInterconnectAttachmentGroupRequest + ): + request = compute.TestIamPermissionsInterconnectAttachmentGroupRequest( + request + ) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if project is not None: + request.project = project + if resource is not None: + request.resource = resource + if test_permissions_request_resource is not None: + request.test_permissions_request_resource = ( + test_permissions_request_resource + ) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.test_iam_permissions] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata( + ( + ("project", request.project), + ("resource", request.resource), + ) + ), + ) + + # Validate the universe domain. + self._validate_universe_domain() + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + def __enter__(self) -> "InterconnectAttachmentGroupsClient": + return self + + def __exit__(self, type, value, traceback): + """Releases underlying transport's resources. + + .. warning:: + ONLY use as a context manager if the transport is NOT shared + with other clients! Exiting the with block will CLOSE the transport + and may cause errors in other clients! + """ + self.transport.close() + + +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) + +if hasattr(DEFAULT_CLIENT_INFO, "protobuf_runtime_version"): # pragma: NO COVER + DEFAULT_CLIENT_INFO.protobuf_runtime_version = google.protobuf.__version__ + +__all__ = ("InterconnectAttachmentGroupsClient",) diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/interconnect_attachment_groups/pagers.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/interconnect_attachment_groups/pagers.py new file mode 100644 index 000000000000..f66621cf7cb9 --- /dev/null +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/interconnect_attachment_groups/pagers.py @@ -0,0 +1,117 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from typing import ( + Any, + AsyncIterator, + Awaitable, + Callable, + Iterator, + Optional, + Sequence, + Tuple, + Union, +) + +from google.api_core import gapic_v1 +from google.api_core import retry as retries +from google.api_core import retry_async as retries_async + +try: + OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault, None] + OptionalAsyncRetry = Union[ + retries_async.AsyncRetry, gapic_v1.method._MethodDefault, None + ] +except AttributeError: # pragma: NO COVER + OptionalRetry = Union[retries.Retry, object, None] # type: ignore + OptionalAsyncRetry = Union[retries_async.AsyncRetry, object, None] # type: ignore + +from google.cloud.compute_v1.types import compute + + +class ListPager: + """A pager for iterating through ``list`` requests. + + This class thinly wraps an initial + :class:`google.cloud.compute_v1.types.InterconnectAttachmentGroupsListResponse` object, and + provides an ``__iter__`` method to iterate through its + ``items`` field. + + If there are more pages, the ``__iter__`` method will make additional + ``List`` requests and continue to iterate + through the ``items`` field on the + corresponding responses. + + All the usual :class:`google.cloud.compute_v1.types.InterconnectAttachmentGroupsListResponse` + attributes are available on the pager. If multiple requests are made, only + the most recent response is retained, and thus used for attribute lookup. + """ + + def __init__( + self, + method: Callable[..., compute.InterconnectAttachmentGroupsListResponse], + request: compute.ListInterconnectAttachmentGroupsRequest, + response: compute.InterconnectAttachmentGroupsListResponse, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = () + ): + """Instantiate the pager. + + Args: + method (Callable): The method that was originally called, and + which instantiated this pager. + request (google.cloud.compute_v1.types.ListInterconnectAttachmentGroupsRequest): + The initial request object. + response (google.cloud.compute_v1.types.InterconnectAttachmentGroupsListResponse): + The initial response object. + retry (google.api_core.retry.Retry): Designation of what errors, + if any, should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + """ + self._method = method + self._request = compute.ListInterconnectAttachmentGroupsRequest(request) + self._response = response + self._retry = retry + self._timeout = timeout + self._metadata = metadata + + def __getattr__(self, name: str) -> Any: + return getattr(self._response, name) + + @property + def pages(self) -> Iterator[compute.InterconnectAttachmentGroupsListResponse]: + yield self._response + while self._response.next_page_token: + self._request.page_token = self._response.next_page_token + self._response = self._method( + self._request, + retry=self._retry, + timeout=self._timeout, + metadata=self._metadata, + ) + yield self._response + + def __iter__(self) -> Iterator[compute.InterconnectAttachmentGroup]: + for page in self.pages: + yield from page.items + + def __repr__(self) -> str: + return "{0}<{1!r}>".format(self.__class__.__name__, self._response) diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/interconnect_attachment_groups/transports/README.rst b/packages/google-cloud-compute/google/cloud/compute_v1/services/interconnect_attachment_groups/transports/README.rst new file mode 100644 index 000000000000..0834929c9de6 --- /dev/null +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/interconnect_attachment_groups/transports/README.rst @@ -0,0 +1,9 @@ + +transport inheritance structure +_______________________________ + +`InterconnectAttachmentGroupsTransport` is the ABC for all transports. +- public child `InterconnectAttachmentGroupsGrpcTransport` for sync gRPC transport (defined in `grpc.py`). +- public child `InterconnectAttachmentGroupsGrpcAsyncIOTransport` for async gRPC transport (defined in `grpc_asyncio.py`). +- private child `_BaseInterconnectAttachmentGroupsRestTransport` for base REST transport with inner classes `_BaseMETHOD` (defined in `rest_base.py`). +- public child `InterconnectAttachmentGroupsRestTransport` for sync REST transport with inner classes `METHOD` derived from the parent's corresponding `_BaseMETHOD` classes (defined in `rest.py`). diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/interconnect_attachment_groups/transports/__init__.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/interconnect_attachment_groups/transports/__init__.py new file mode 100644 index 000000000000..3961ad9d29df --- /dev/null +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/interconnect_attachment_groups/transports/__init__.py @@ -0,0 +1,35 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from collections import OrderedDict +from typing import Dict, Type + +from .base import InterconnectAttachmentGroupsTransport +from .rest import ( + InterconnectAttachmentGroupsRestInterceptor, + InterconnectAttachmentGroupsRestTransport, +) + +# Compile a registry of transports. +_transport_registry = ( + OrderedDict() +) # type: Dict[str, Type[InterconnectAttachmentGroupsTransport]] +_transport_registry["rest"] = InterconnectAttachmentGroupsRestTransport + +__all__ = ( + "InterconnectAttachmentGroupsTransport", + "InterconnectAttachmentGroupsRestTransport", + "InterconnectAttachmentGroupsRestInterceptor", +) diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/interconnect_attachment_groups/transports/base.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/interconnect_attachment_groups/transports/base.py new file mode 100644 index 000000000000..748082ff12f6 --- /dev/null +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/interconnect_attachment_groups/transports/base.py @@ -0,0 +1,305 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +import abc +from typing import Awaitable, Callable, Dict, Optional, Sequence, Union + +import google.api_core +from google.api_core import exceptions as core_exceptions +from google.api_core import gapic_v1 +from google.api_core import retry as retries +import google.auth # type: ignore +from google.auth import credentials as ga_credentials # type: ignore +from google.oauth2 import service_account # type: ignore +import google.protobuf + +from google.cloud.compute_v1 import gapic_version as package_version +from google.cloud.compute_v1.services import global_operations +from google.cloud.compute_v1.types import compute + +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) + +if hasattr(DEFAULT_CLIENT_INFO, "protobuf_runtime_version"): # pragma: NO COVER + DEFAULT_CLIENT_INFO.protobuf_runtime_version = google.protobuf.__version__ + + +class InterconnectAttachmentGroupsTransport(abc.ABC): + """Abstract transport class for InterconnectAttachmentGroups.""" + + AUTH_SCOPES = ( + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/cloud-platform", + ) + + DEFAULT_HOST: str = "compute.googleapis.com" + + def __init__( + self, + *, + host: str = DEFAULT_HOST, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, + scopes: Optional[Sequence[str]] = None, + quota_project_id: Optional[str] = None, + client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, + always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, + **kwargs, + ) -> None: + """Instantiate the transport. + + Args: + host (Optional[str]): + The hostname to connect to (default: 'compute.googleapis.com'). + credentials (Optional[google.auth.credentials.Credentials]): The + authorization credentials to attach to requests. These + credentials identify the application to the service; if none + are specified, the client will attempt to ascertain the + credentials from the environment. + credentials_file (Optional[str]): A file with credentials that can + be loaded with :func:`google.auth.load_credentials_from_file`. + This argument is mutually exclusive with credentials. + scopes (Optional[Sequence[str]]): A list of scopes. + quota_project_id (Optional[str]): An optional project to use for billing + and quota. + client_info (google.api_core.gapic_v1.client_info.ClientInfo): + The client info used to send a user-agent string along with + API requests. If ``None``, then default info will be used. + Generally, you only need to set this if you're developing + your own client library. + always_use_jwt_access (Optional[bool]): Whether self signed JWT should + be used for service account credentials. + """ + self._extended_operations_services: Dict[str, Any] = {} + + scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} + + # Save the scopes. + self._scopes = scopes + if not hasattr(self, "_ignore_credentials"): + self._ignore_credentials: bool = False + + # If no credentials are provided, then determine the appropriate + # defaults. + if credentials and credentials_file: + raise core_exceptions.DuplicateCredentialArgs( + "'credentials_file' and 'credentials' are mutually exclusive" + ) + + if credentials_file is not None: + credentials, _ = google.auth.load_credentials_from_file( + credentials_file, **scopes_kwargs, quota_project_id=quota_project_id + ) + elif credentials is None and not self._ignore_credentials: + credentials, _ = google.auth.default( + **scopes_kwargs, quota_project_id=quota_project_id + ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) + + # If the credentials are service account credentials, then always try to use self signed JWT. + if ( + always_use_jwt_access + and isinstance(credentials, service_account.Credentials) + and hasattr(service_account.Credentials, "with_always_use_jwt_access") + ): + credentials = credentials.with_always_use_jwt_access(True) + + # Save the credentials. + self._credentials = credentials + + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + + @property + def host(self): + return self._host + + def _prep_wrapped_messages(self, client_info): + # Precompute the wrapped methods. + self._wrapped_methods = { + self.delete: gapic_v1.method.wrap_method( + self.delete, + default_timeout=None, + client_info=client_info, + ), + self.get: gapic_v1.method.wrap_method( + self.get, + default_timeout=None, + client_info=client_info, + ), + self.get_iam_policy: gapic_v1.method.wrap_method( + self.get_iam_policy, + default_timeout=None, + client_info=client_info, + ), + self.get_operational_status: gapic_v1.method.wrap_method( + self.get_operational_status, + default_timeout=None, + client_info=client_info, + ), + self.insert: gapic_v1.method.wrap_method( + self.insert, + default_timeout=None, + client_info=client_info, + ), + self.list: gapic_v1.method.wrap_method( + self.list, + default_timeout=None, + client_info=client_info, + ), + self.patch: gapic_v1.method.wrap_method( + self.patch, + default_timeout=None, + client_info=client_info, + ), + self.set_iam_policy: gapic_v1.method.wrap_method( + self.set_iam_policy, + default_timeout=None, + client_info=client_info, + ), + self.test_iam_permissions: gapic_v1.method.wrap_method( + self.test_iam_permissions, + default_timeout=None, + client_info=client_info, + ), + } + + def close(self): + """Closes resources associated with the transport. + + .. warning:: + Only call this method if the transport is NOT shared + with other clients - this may cause errors in other clients! + """ + raise NotImplementedError() + + @property + def delete( + self, + ) -> Callable[ + [compute.DeleteInterconnectAttachmentGroupRequest], + Union[compute.Operation, Awaitable[compute.Operation]], + ]: + raise NotImplementedError() + + @property + def get( + self, + ) -> Callable[ + [compute.GetInterconnectAttachmentGroupRequest], + Union[ + compute.InterconnectAttachmentGroup, + Awaitable[compute.InterconnectAttachmentGroup], + ], + ]: + raise NotImplementedError() + + @property + def get_iam_policy( + self, + ) -> Callable[ + [compute.GetIamPolicyInterconnectAttachmentGroupRequest], + Union[compute.Policy, Awaitable[compute.Policy]], + ]: + raise NotImplementedError() + + @property + def get_operational_status( + self, + ) -> Callable[ + [compute.GetOperationalStatusInterconnectAttachmentGroupRequest], + Union[ + compute.InterconnectAttachmentGroupsGetOperationalStatusResponse, + Awaitable[compute.InterconnectAttachmentGroupsGetOperationalStatusResponse], + ], + ]: + raise NotImplementedError() + + @property + def insert( + self, + ) -> Callable[ + [compute.InsertInterconnectAttachmentGroupRequest], + Union[compute.Operation, Awaitable[compute.Operation]], + ]: + raise NotImplementedError() + + @property + def list( + self, + ) -> Callable[ + [compute.ListInterconnectAttachmentGroupsRequest], + Union[ + compute.InterconnectAttachmentGroupsListResponse, + Awaitable[compute.InterconnectAttachmentGroupsListResponse], + ], + ]: + raise NotImplementedError() + + @property + def patch( + self, + ) -> Callable[ + [compute.PatchInterconnectAttachmentGroupRequest], + Union[compute.Operation, Awaitable[compute.Operation]], + ]: + raise NotImplementedError() + + @property + def set_iam_policy( + self, + ) -> Callable[ + [compute.SetIamPolicyInterconnectAttachmentGroupRequest], + Union[compute.Policy, Awaitable[compute.Policy]], + ]: + raise NotImplementedError() + + @property + def test_iam_permissions( + self, + ) -> Callable[ + [compute.TestIamPermissionsInterconnectAttachmentGroupRequest], + Union[ + compute.TestPermissionsResponse, Awaitable[compute.TestPermissionsResponse] + ], + ]: + raise NotImplementedError() + + @property + def kind(self) -> str: + raise NotImplementedError() + + @property + def _global_operations_client(self) -> global_operations.GlobalOperationsClient: + ex_op_service = self._extended_operations_services.get("global_operations") + if not ex_op_service: + ex_op_service = global_operations.GlobalOperationsClient( + credentials=self._credentials, + transport=self.kind, + ) + self._extended_operations_services["global_operations"] = ex_op_service + + return ex_op_service + + +__all__ = ("InterconnectAttachmentGroupsTransport",) diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/interconnect_attachment_groups/transports/rest.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/interconnect_attachment_groups/transports/rest.py new file mode 100644 index 000000000000..5f2a9562d43e --- /dev/null +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/interconnect_attachment_groups/transports/rest.py @@ -0,0 +1,2255 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +import dataclasses +import json # type: ignore +import logging +from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple, Union +import warnings + +from google.api_core import exceptions as core_exceptions +from google.api_core import gapic_v1, rest_helpers, rest_streaming +from google.api_core import retry as retries +from google.auth import credentials as ga_credentials # type: ignore +from google.auth.transport.requests import AuthorizedSession # type: ignore +import google.protobuf +from google.protobuf import json_format +from requests import __version__ as requests_version + +from google.cloud.compute_v1.types import compute + +from .base import DEFAULT_CLIENT_INFO as BASE_DEFAULT_CLIENT_INFO +from .rest_base import _BaseInterconnectAttachmentGroupsRestTransport + +try: + OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault, None] +except AttributeError: # pragma: NO COVER + OptionalRetry = Union[retries.Retry, object, None] # type: ignore + +try: + from google.api_core import client_logging # type: ignore + + CLIENT_LOGGING_SUPPORTED = True # pragma: NO COVER +except ImportError: # pragma: NO COVER + CLIENT_LOGGING_SUPPORTED = False + +_LOGGER = logging.getLogger(__name__) + +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=BASE_DEFAULT_CLIENT_INFO.gapic_version, + grpc_version=None, + rest_version=f"requests@{requests_version}", +) + +if hasattr(DEFAULT_CLIENT_INFO, "protobuf_runtime_version"): # pragma: NO COVER + DEFAULT_CLIENT_INFO.protobuf_runtime_version = google.protobuf.__version__ + + +class InterconnectAttachmentGroupsRestInterceptor: + """Interceptor for InterconnectAttachmentGroups. + + Interceptors are used to manipulate requests, request metadata, and responses + in arbitrary ways. + Example use cases include: + * Logging + * Verifying requests according to service or custom semantics + * Stripping extraneous information from responses + + These use cases and more can be enabled by injecting an + instance of a custom subclass when constructing the InterconnectAttachmentGroupsRestTransport. + + .. code-block:: python + class MyCustomInterconnectAttachmentGroupsInterceptor(InterconnectAttachmentGroupsRestInterceptor): + def pre_delete(self, request, metadata): + logging.log(f"Received request: {request}") + return request, metadata + + def post_delete(self, response): + logging.log(f"Received response: {response}") + return response + + def pre_get(self, request, metadata): + logging.log(f"Received request: {request}") + return request, metadata + + def post_get(self, response): + logging.log(f"Received response: {response}") + return response + + def pre_get_iam_policy(self, request, metadata): + logging.log(f"Received request: {request}") + return request, metadata + + def post_get_iam_policy(self, response): + logging.log(f"Received response: {response}") + return response + + def pre_get_operational_status(self, request, metadata): + logging.log(f"Received request: {request}") + return request, metadata + + def post_get_operational_status(self, response): + logging.log(f"Received response: {response}") + return response + + def pre_insert(self, request, metadata): + logging.log(f"Received request: {request}") + return request, metadata + + def post_insert(self, response): + logging.log(f"Received response: {response}") + return response + + def pre_list(self, request, metadata): + logging.log(f"Received request: {request}") + return request, metadata + + def post_list(self, response): + logging.log(f"Received response: {response}") + return response + + def pre_patch(self, request, metadata): + logging.log(f"Received request: {request}") + return request, metadata + + def post_patch(self, response): + logging.log(f"Received response: {response}") + return response + + def pre_set_iam_policy(self, request, metadata): + logging.log(f"Received request: {request}") + return request, metadata + + def post_set_iam_policy(self, response): + logging.log(f"Received response: {response}") + return response + + def pre_test_iam_permissions(self, request, metadata): + logging.log(f"Received request: {request}") + return request, metadata + + def post_test_iam_permissions(self, response): + logging.log(f"Received response: {response}") + return response + + transport = InterconnectAttachmentGroupsRestTransport(interceptor=MyCustomInterconnectAttachmentGroupsInterceptor()) + client = InterconnectAttachmentGroupsClient(transport=transport) + + + """ + + def pre_delete( + self, + request: compute.DeleteInterconnectAttachmentGroupRequest, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + compute.DeleteInterconnectAttachmentGroupRequest, + Sequence[Tuple[str, Union[str, bytes]]], + ]: + """Pre-rpc interceptor for delete + + Override in a subclass to manipulate the request or metadata + before they are sent to the InterconnectAttachmentGroups server. + """ + return request, metadata + + def post_delete(self, response: compute.Operation) -> compute.Operation: + """Post-rpc interceptor for delete + + DEPRECATED. Please use the `post_delete_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response + after it is returned by the InterconnectAttachmentGroups server but before + it is returned to user code. This `post_delete` interceptor runs + before the `post_delete_with_metadata` interceptor. + """ + return response + + def post_delete_with_metadata( + self, + response: compute.Operation, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[compute.Operation, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for delete + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the InterconnectAttachmentGroups server but before it is returned to user code. + + We recommend only using this `post_delete_with_metadata` + interceptor in new development instead of the `post_delete` interceptor. + When both interceptors are used, this `post_delete_with_metadata` interceptor runs after the + `post_delete` interceptor. The (possibly modified) response returned by + `post_delete` will be passed to + `post_delete_with_metadata`. + """ + return response, metadata + + def pre_get( + self, + request: compute.GetInterconnectAttachmentGroupRequest, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + compute.GetInterconnectAttachmentGroupRequest, + Sequence[Tuple[str, Union[str, bytes]]], + ]: + """Pre-rpc interceptor for get + + Override in a subclass to manipulate the request or metadata + before they are sent to the InterconnectAttachmentGroups server. + """ + return request, metadata + + def post_get( + self, response: compute.InterconnectAttachmentGroup + ) -> compute.InterconnectAttachmentGroup: + """Post-rpc interceptor for get + + DEPRECATED. Please use the `post_get_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response + after it is returned by the InterconnectAttachmentGroups server but before + it is returned to user code. This `post_get` interceptor runs + before the `post_get_with_metadata` interceptor. + """ + return response + + def post_get_with_metadata( + self, + response: compute.InterconnectAttachmentGroup, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + compute.InterconnectAttachmentGroup, Sequence[Tuple[str, Union[str, bytes]]] + ]: + """Post-rpc interceptor for get + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the InterconnectAttachmentGroups server but before it is returned to user code. + + We recommend only using this `post_get_with_metadata` + interceptor in new development instead of the `post_get` interceptor. + When both interceptors are used, this `post_get_with_metadata` interceptor runs after the + `post_get` interceptor. The (possibly modified) response returned by + `post_get` will be passed to + `post_get_with_metadata`. + """ + return response, metadata + + def pre_get_iam_policy( + self, + request: compute.GetIamPolicyInterconnectAttachmentGroupRequest, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + compute.GetIamPolicyInterconnectAttachmentGroupRequest, + Sequence[Tuple[str, Union[str, bytes]]], + ]: + """Pre-rpc interceptor for get_iam_policy + + Override in a subclass to manipulate the request or metadata + before they are sent to the InterconnectAttachmentGroups server. + """ + return request, metadata + + def post_get_iam_policy(self, response: compute.Policy) -> compute.Policy: + """Post-rpc interceptor for get_iam_policy + + DEPRECATED. Please use the `post_get_iam_policy_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response + after it is returned by the InterconnectAttachmentGroups server but before + it is returned to user code. This `post_get_iam_policy` interceptor runs + before the `post_get_iam_policy_with_metadata` interceptor. + """ + return response + + def post_get_iam_policy_with_metadata( + self, + response: compute.Policy, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[compute.Policy, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for get_iam_policy + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the InterconnectAttachmentGroups server but before it is returned to user code. + + We recommend only using this `post_get_iam_policy_with_metadata` + interceptor in new development instead of the `post_get_iam_policy` interceptor. + When both interceptors are used, this `post_get_iam_policy_with_metadata` interceptor runs after the + `post_get_iam_policy` interceptor. The (possibly modified) response returned by + `post_get_iam_policy` will be passed to + `post_get_iam_policy_with_metadata`. + """ + return response, metadata + + def pre_get_operational_status( + self, + request: compute.GetOperationalStatusInterconnectAttachmentGroupRequest, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + compute.GetOperationalStatusInterconnectAttachmentGroupRequest, + Sequence[Tuple[str, Union[str, bytes]]], + ]: + """Pre-rpc interceptor for get_operational_status + + Override in a subclass to manipulate the request or metadata + before they are sent to the InterconnectAttachmentGroups server. + """ + return request, metadata + + def post_get_operational_status( + self, response: compute.InterconnectAttachmentGroupsGetOperationalStatusResponse + ) -> compute.InterconnectAttachmentGroupsGetOperationalStatusResponse: + """Post-rpc interceptor for get_operational_status + + DEPRECATED. Please use the `post_get_operational_status_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response + after it is returned by the InterconnectAttachmentGroups server but before + it is returned to user code. This `post_get_operational_status` interceptor runs + before the `post_get_operational_status_with_metadata` interceptor. + """ + return response + + def post_get_operational_status_with_metadata( + self, + response: compute.InterconnectAttachmentGroupsGetOperationalStatusResponse, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + compute.InterconnectAttachmentGroupsGetOperationalStatusResponse, + Sequence[Tuple[str, Union[str, bytes]]], + ]: + """Post-rpc interceptor for get_operational_status + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the InterconnectAttachmentGroups server but before it is returned to user code. + + We recommend only using this `post_get_operational_status_with_metadata` + interceptor in new development instead of the `post_get_operational_status` interceptor. + When both interceptors are used, this `post_get_operational_status_with_metadata` interceptor runs after the + `post_get_operational_status` interceptor. The (possibly modified) response returned by + `post_get_operational_status` will be passed to + `post_get_operational_status_with_metadata`. + """ + return response, metadata + + def pre_insert( + self, + request: compute.InsertInterconnectAttachmentGroupRequest, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + compute.InsertInterconnectAttachmentGroupRequest, + Sequence[Tuple[str, Union[str, bytes]]], + ]: + """Pre-rpc interceptor for insert + + Override in a subclass to manipulate the request or metadata + before they are sent to the InterconnectAttachmentGroups server. + """ + return request, metadata + + def post_insert(self, response: compute.Operation) -> compute.Operation: + """Post-rpc interceptor for insert + + DEPRECATED. Please use the `post_insert_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response + after it is returned by the InterconnectAttachmentGroups server but before + it is returned to user code. This `post_insert` interceptor runs + before the `post_insert_with_metadata` interceptor. + """ + return response + + def post_insert_with_metadata( + self, + response: compute.Operation, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[compute.Operation, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for insert + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the InterconnectAttachmentGroups server but before it is returned to user code. + + We recommend only using this `post_insert_with_metadata` + interceptor in new development instead of the `post_insert` interceptor. + When both interceptors are used, this `post_insert_with_metadata` interceptor runs after the + `post_insert` interceptor. The (possibly modified) response returned by + `post_insert` will be passed to + `post_insert_with_metadata`. + """ + return response, metadata + + def pre_list( + self, + request: compute.ListInterconnectAttachmentGroupsRequest, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + compute.ListInterconnectAttachmentGroupsRequest, + Sequence[Tuple[str, Union[str, bytes]]], + ]: + """Pre-rpc interceptor for list + + Override in a subclass to manipulate the request or metadata + before they are sent to the InterconnectAttachmentGroups server. + """ + return request, metadata + + def post_list( + self, response: compute.InterconnectAttachmentGroupsListResponse + ) -> compute.InterconnectAttachmentGroupsListResponse: + """Post-rpc interceptor for list + + DEPRECATED. Please use the `post_list_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response + after it is returned by the InterconnectAttachmentGroups server but before + it is returned to user code. This `post_list` interceptor runs + before the `post_list_with_metadata` interceptor. + """ + return response + + def post_list_with_metadata( + self, + response: compute.InterconnectAttachmentGroupsListResponse, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + compute.InterconnectAttachmentGroupsListResponse, + Sequence[Tuple[str, Union[str, bytes]]], + ]: + """Post-rpc interceptor for list + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the InterconnectAttachmentGroups server but before it is returned to user code. + + We recommend only using this `post_list_with_metadata` + interceptor in new development instead of the `post_list` interceptor. + When both interceptors are used, this `post_list_with_metadata` interceptor runs after the + `post_list` interceptor. The (possibly modified) response returned by + `post_list` will be passed to + `post_list_with_metadata`. + """ + return response, metadata + + def pre_patch( + self, + request: compute.PatchInterconnectAttachmentGroupRequest, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + compute.PatchInterconnectAttachmentGroupRequest, + Sequence[Tuple[str, Union[str, bytes]]], + ]: + """Pre-rpc interceptor for patch + + Override in a subclass to manipulate the request or metadata + before they are sent to the InterconnectAttachmentGroups server. + """ + return request, metadata + + def post_patch(self, response: compute.Operation) -> compute.Operation: + """Post-rpc interceptor for patch + + DEPRECATED. Please use the `post_patch_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response + after it is returned by the InterconnectAttachmentGroups server but before + it is returned to user code. This `post_patch` interceptor runs + before the `post_patch_with_metadata` interceptor. + """ + return response + + def post_patch_with_metadata( + self, + response: compute.Operation, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[compute.Operation, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for patch + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the InterconnectAttachmentGroups server but before it is returned to user code. + + We recommend only using this `post_patch_with_metadata` + interceptor in new development instead of the `post_patch` interceptor. + When both interceptors are used, this `post_patch_with_metadata` interceptor runs after the + `post_patch` interceptor. The (possibly modified) response returned by + `post_patch` will be passed to + `post_patch_with_metadata`. + """ + return response, metadata + + def pre_set_iam_policy( + self, + request: compute.SetIamPolicyInterconnectAttachmentGroupRequest, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + compute.SetIamPolicyInterconnectAttachmentGroupRequest, + Sequence[Tuple[str, Union[str, bytes]]], + ]: + """Pre-rpc interceptor for set_iam_policy + + Override in a subclass to manipulate the request or metadata + before they are sent to the InterconnectAttachmentGroups server. + """ + return request, metadata + + def post_set_iam_policy(self, response: compute.Policy) -> compute.Policy: + """Post-rpc interceptor for set_iam_policy + + DEPRECATED. Please use the `post_set_iam_policy_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response + after it is returned by the InterconnectAttachmentGroups server but before + it is returned to user code. This `post_set_iam_policy` interceptor runs + before the `post_set_iam_policy_with_metadata` interceptor. + """ + return response + + def post_set_iam_policy_with_metadata( + self, + response: compute.Policy, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[compute.Policy, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for set_iam_policy + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the InterconnectAttachmentGroups server but before it is returned to user code. + + We recommend only using this `post_set_iam_policy_with_metadata` + interceptor in new development instead of the `post_set_iam_policy` interceptor. + When both interceptors are used, this `post_set_iam_policy_with_metadata` interceptor runs after the + `post_set_iam_policy` interceptor. The (possibly modified) response returned by + `post_set_iam_policy` will be passed to + `post_set_iam_policy_with_metadata`. + """ + return response, metadata + + def pre_test_iam_permissions( + self, + request: compute.TestIamPermissionsInterconnectAttachmentGroupRequest, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + compute.TestIamPermissionsInterconnectAttachmentGroupRequest, + Sequence[Tuple[str, Union[str, bytes]]], + ]: + """Pre-rpc interceptor for test_iam_permissions + + Override in a subclass to manipulate the request or metadata + before they are sent to the InterconnectAttachmentGroups server. + """ + return request, metadata + + def post_test_iam_permissions( + self, response: compute.TestPermissionsResponse + ) -> compute.TestPermissionsResponse: + """Post-rpc interceptor for test_iam_permissions + + DEPRECATED. Please use the `post_test_iam_permissions_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response + after it is returned by the InterconnectAttachmentGroups server but before + it is returned to user code. This `post_test_iam_permissions` interceptor runs + before the `post_test_iam_permissions_with_metadata` interceptor. + """ + return response + + def post_test_iam_permissions_with_metadata( + self, + response: compute.TestPermissionsResponse, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + compute.TestPermissionsResponse, Sequence[Tuple[str, Union[str, bytes]]] + ]: + """Post-rpc interceptor for test_iam_permissions + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the InterconnectAttachmentGroups server but before it is returned to user code. + + We recommend only using this `post_test_iam_permissions_with_metadata` + interceptor in new development instead of the `post_test_iam_permissions` interceptor. + When both interceptors are used, this `post_test_iam_permissions_with_metadata` interceptor runs after the + `post_test_iam_permissions` interceptor. The (possibly modified) response returned by + `post_test_iam_permissions` will be passed to + `post_test_iam_permissions_with_metadata`. + """ + return response, metadata + + +@dataclasses.dataclass +class InterconnectAttachmentGroupsRestStub: + _session: AuthorizedSession + _host: str + _interceptor: InterconnectAttachmentGroupsRestInterceptor + + +class InterconnectAttachmentGroupsRestTransport( + _BaseInterconnectAttachmentGroupsRestTransport +): + """REST backend synchronous transport for InterconnectAttachmentGroups. + + The InterconnectAttachmentGroups API. + + This class defines the same methods as the primary client, so the + primary client can load the underlying transport implementation + and call it. + + It sends JSON representations of protocol buffers over HTTP/1.1 + """ + + def __init__( + self, + *, + host: str = "compute.googleapis.com", + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, + scopes: Optional[Sequence[str]] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + quota_project_id: Optional[str] = None, + client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, + always_use_jwt_access: Optional[bool] = False, + url_scheme: str = "https", + interceptor: Optional[InterconnectAttachmentGroupsRestInterceptor] = None, + api_audience: Optional[str] = None, + ) -> None: + """Instantiate the transport. + + NOTE: This REST transport functionality is currently in a beta + state (preview). We welcome your feedback via a GitHub issue in + this library's repository. Thank you! + + Args: + host (Optional[str]): + The hostname to connect to (default: 'compute.googleapis.com'). + credentials (Optional[google.auth.credentials.Credentials]): The + authorization credentials to attach to requests. These + credentials identify the application to the service; if none + are specified, the client will attempt to ascertain the + credentials from the environment. + + credentials_file (Optional[str]): A file with credentials that can + be loaded with :func:`google.auth.load_credentials_from_file`. + This argument is ignored if ``channel`` is provided. + scopes (Optional(Sequence[str])): A list of scopes. This argument is + ignored if ``channel`` is provided. + client_cert_source_for_mtls (Callable[[], Tuple[bytes, bytes]]): Client + certificate to configure mutual TLS HTTP channel. It is ignored + if ``channel`` is provided. + quota_project_id (Optional[str]): An optional project to use for billing + and quota. + client_info (google.api_core.gapic_v1.client_info.ClientInfo): + The client info used to send a user-agent string along with + API requests. If ``None``, then default info will be used. + Generally, you only need to set this if you are developing + your own client library. + always_use_jwt_access (Optional[bool]): Whether self signed JWT should + be used for service account credentials. + url_scheme: the protocol scheme for the API endpoint. Normally + "https", but for testing or local servers, + "http" can be specified. + """ + # Run the base constructor + # TODO(yon-mg): resolve other ctor params i.e. scopes, quota, etc. + # TODO: When custom host (api_endpoint) is set, `scopes` must *also* be set on the + # credentials object + super().__init__( + host=host, + credentials=credentials, + client_info=client_info, + always_use_jwt_access=always_use_jwt_access, + url_scheme=url_scheme, + api_audience=api_audience, + ) + self._session = AuthorizedSession( + self._credentials, default_host=self.DEFAULT_HOST + ) + if client_cert_source_for_mtls: + self._session.configure_mtls_channel(client_cert_source_for_mtls) + self._interceptor = interceptor or InterconnectAttachmentGroupsRestInterceptor() + self._prep_wrapped_messages(client_info) + + class _Delete( + _BaseInterconnectAttachmentGroupsRestTransport._BaseDelete, + InterconnectAttachmentGroupsRestStub, + ): + def __hash__(self): + return hash("InterconnectAttachmentGroupsRestTransport.Delete") + + @staticmethod + def _get_response( + host, + metadata, + query_params, + session, + timeout, + transcoded_request, + body=None, + ): + uri = transcoded_request["uri"] + method = transcoded_request["method"] + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = getattr(session, method)( + "{host}{uri}".format(host=host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + ) + return response + + def __call__( + self, + request: compute.DeleteInterconnectAttachmentGroupRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> compute.Operation: + r"""Call the delete method over HTTP. + + Args: + request (~.compute.DeleteInterconnectAttachmentGroupRequest): + The request object. A request message for + InterconnectAttachmentGroups.Delete. See + the method description for details. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + ~.compute.Operation: + Represents an Operation resource. Google Compute Engine + has three Operation resources: \* + `Global `__ + \* + `Regional `__ + \* + `Zonal `__ + You can use an operation resource to manage asynchronous + API requests. For more information, read Handling API + responses. Operations can be global, regional or zonal. + - For global operations, use the ``globalOperations`` + resource. - For regional operations, use the + ``regionOperations`` resource. - For zonal operations, + use the ``zoneOperations`` resource. For more + information, read Global, Regional, and Zonal Resources. + Note that completed Operation resources have a limited + retention period. + + """ + + http_options = ( + _BaseInterconnectAttachmentGroupsRestTransport._BaseDelete._get_http_options() + ) + + request, metadata = self._interceptor.pre_delete(request, metadata) + transcoded_request = _BaseInterconnectAttachmentGroupsRestTransport._BaseDelete._get_transcoded_request( + http_options, request + ) + + # Jsonify the query params + query_params = _BaseInterconnectAttachmentGroupsRestTransport._BaseDelete._get_query_params_json( + transcoded_request + ) + + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + try: + request_payload = type(request).to_json(request) + except: + request_payload = None + http_request = { + "payload": request_payload, + "requestMethod": method, + "requestUrl": request_url, + "headers": dict(metadata), + } + _LOGGER.debug( + f"Sending request for google.cloud.compute_v1.InterconnectAttachmentGroupsClient.Delete", + extra={ + "serviceName": "google.cloud.compute.v1.InterconnectAttachmentGroups", + "rpcName": "Delete", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = InterconnectAttachmentGroupsRestTransport._Delete._get_response( + self._host, + metadata, + query_params, + self._session, + timeout, + transcoded_request, + ) + + # In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception + # subclass. + if response.status_code >= 400: + raise core_exceptions.from_http_response(response) + + # Return the response + resp = compute.Operation() + pb_resp = compute.Operation.pb(resp) + + json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True) + + resp = self._interceptor.post_delete(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_delete_with_metadata( + resp, response_metadata + ) + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + try: + response_payload = compute.Operation.to_json(response) + except: + response_payload = None + http_response = { + "payload": response_payload, + "headers": dict(response.headers), + "status": response.status_code, + } + _LOGGER.debug( + "Received response for google.cloud.compute_v1.InterconnectAttachmentGroupsClient.delete", + extra={ + "serviceName": "google.cloud.compute.v1.InterconnectAttachmentGroups", + "rpcName": "Delete", + "metadata": http_response["headers"], + "httpResponse": http_response, + }, + ) + return resp + + class _Get( + _BaseInterconnectAttachmentGroupsRestTransport._BaseGet, + InterconnectAttachmentGroupsRestStub, + ): + def __hash__(self): + return hash("InterconnectAttachmentGroupsRestTransport.Get") + + @staticmethod + def _get_response( + host, + metadata, + query_params, + session, + timeout, + transcoded_request, + body=None, + ): + uri = transcoded_request["uri"] + method = transcoded_request["method"] + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = getattr(session, method)( + "{host}{uri}".format(host=host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + ) + return response + + def __call__( + self, + request: compute.GetInterconnectAttachmentGroupRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> compute.InterconnectAttachmentGroup: + r"""Call the get method over HTTP. + + Args: + request (~.compute.GetInterconnectAttachmentGroupRequest): + The request object. A request message for + InterconnectAttachmentGroups.Get. See + the method description for details. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + ~.compute.InterconnectAttachmentGroup: + An interconnect attachment group + resource allows customers to create, + analyze, and expand highly available + deployments. + + """ + + http_options = ( + _BaseInterconnectAttachmentGroupsRestTransport._BaseGet._get_http_options() + ) + + request, metadata = self._interceptor.pre_get(request, metadata) + transcoded_request = _BaseInterconnectAttachmentGroupsRestTransport._BaseGet._get_transcoded_request( + http_options, request + ) + + # Jsonify the query params + query_params = _BaseInterconnectAttachmentGroupsRestTransport._BaseGet._get_query_params_json( + transcoded_request + ) + + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + try: + request_payload = type(request).to_json(request) + except: + request_payload = None + http_request = { + "payload": request_payload, + "requestMethod": method, + "requestUrl": request_url, + "headers": dict(metadata), + } + _LOGGER.debug( + f"Sending request for google.cloud.compute_v1.InterconnectAttachmentGroupsClient.Get", + extra={ + "serviceName": "google.cloud.compute.v1.InterconnectAttachmentGroups", + "rpcName": "Get", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = InterconnectAttachmentGroupsRestTransport._Get._get_response( + self._host, + metadata, + query_params, + self._session, + timeout, + transcoded_request, + ) + + # In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception + # subclass. + if response.status_code >= 400: + raise core_exceptions.from_http_response(response) + + # Return the response + resp = compute.InterconnectAttachmentGroup() + pb_resp = compute.InterconnectAttachmentGroup.pb(resp) + + json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True) + + resp = self._interceptor.post_get(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_get_with_metadata(resp, response_metadata) + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + try: + response_payload = compute.InterconnectAttachmentGroup.to_json( + response + ) + except: + response_payload = None + http_response = { + "payload": response_payload, + "headers": dict(response.headers), + "status": response.status_code, + } + _LOGGER.debug( + "Received response for google.cloud.compute_v1.InterconnectAttachmentGroupsClient.get", + extra={ + "serviceName": "google.cloud.compute.v1.InterconnectAttachmentGroups", + "rpcName": "Get", + "metadata": http_response["headers"], + "httpResponse": http_response, + }, + ) + return resp + + class _GetIamPolicy( + _BaseInterconnectAttachmentGroupsRestTransport._BaseGetIamPolicy, + InterconnectAttachmentGroupsRestStub, + ): + def __hash__(self): + return hash("InterconnectAttachmentGroupsRestTransport.GetIamPolicy") + + @staticmethod + def _get_response( + host, + metadata, + query_params, + session, + timeout, + transcoded_request, + body=None, + ): + uri = transcoded_request["uri"] + method = transcoded_request["method"] + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = getattr(session, method)( + "{host}{uri}".format(host=host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + ) + return response + + def __call__( + self, + request: compute.GetIamPolicyInterconnectAttachmentGroupRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> compute.Policy: + r"""Call the get iam policy method over HTTP. + + Args: + request (~.compute.GetIamPolicyInterconnectAttachmentGroupRequest): + The request object. A request message for + InterconnectAttachmentGroups.GetIamPolicy. + See the method description for details. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + ~.compute.Policy: + An Identity and Access Management (IAM) policy, which + specifies access controls for Google Cloud resources. A + ``Policy`` is a collection of ``bindings``. A + ``binding`` binds one or more ``members``, or + principals, to a single ``role``. Principals can be user + accounts, service accounts, Google groups, and domains + (such as G Suite). A ``role`` is a named list of + permissions; each ``role`` can be an IAM predefined role + or a user-created custom role. For some types of Google + Cloud resources, a ``binding`` can also specify a + ``condition``, which is a logical expression that allows + access to a resource only if the expression evaluates to + ``true``. A condition can add constraints based on + attributes of the request, the resource, or both. To + learn which resources support conditions in their IAM + policies, see the `IAM + documentation `__. + **JSON example:** + ``{ "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": [ "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": "BwWWja0YfJA=", "version": 3 }`` + **YAML example:** + ``bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3`` + For a description of IAM and its features, see the `IAM + documentation `__. + + """ + + http_options = ( + _BaseInterconnectAttachmentGroupsRestTransport._BaseGetIamPolicy._get_http_options() + ) + + request, metadata = self._interceptor.pre_get_iam_policy(request, metadata) + transcoded_request = _BaseInterconnectAttachmentGroupsRestTransport._BaseGetIamPolicy._get_transcoded_request( + http_options, request + ) + + # Jsonify the query params + query_params = _BaseInterconnectAttachmentGroupsRestTransport._BaseGetIamPolicy._get_query_params_json( + transcoded_request + ) + + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + try: + request_payload = type(request).to_json(request) + except: + request_payload = None + http_request = { + "payload": request_payload, + "requestMethod": method, + "requestUrl": request_url, + "headers": dict(metadata), + } + _LOGGER.debug( + f"Sending request for google.cloud.compute_v1.InterconnectAttachmentGroupsClient.GetIamPolicy", + extra={ + "serviceName": "google.cloud.compute.v1.InterconnectAttachmentGroups", + "rpcName": "GetIamPolicy", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = ( + InterconnectAttachmentGroupsRestTransport._GetIamPolicy._get_response( + self._host, + metadata, + query_params, + self._session, + timeout, + transcoded_request, + ) + ) + + # In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception + # subclass. + if response.status_code >= 400: + raise core_exceptions.from_http_response(response) + + # Return the response + resp = compute.Policy() + pb_resp = compute.Policy.pb(resp) + + json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True) + + resp = self._interceptor.post_get_iam_policy(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_get_iam_policy_with_metadata( + resp, response_metadata + ) + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + try: + response_payload = compute.Policy.to_json(response) + except: + response_payload = None + http_response = { + "payload": response_payload, + "headers": dict(response.headers), + "status": response.status_code, + } + _LOGGER.debug( + "Received response for google.cloud.compute_v1.InterconnectAttachmentGroupsClient.get_iam_policy", + extra={ + "serviceName": "google.cloud.compute.v1.InterconnectAttachmentGroups", + "rpcName": "GetIamPolicy", + "metadata": http_response["headers"], + "httpResponse": http_response, + }, + ) + return resp + + class _GetOperationalStatus( + _BaseInterconnectAttachmentGroupsRestTransport._BaseGetOperationalStatus, + InterconnectAttachmentGroupsRestStub, + ): + def __hash__(self): + return hash( + "InterconnectAttachmentGroupsRestTransport.GetOperationalStatus" + ) + + @staticmethod + def _get_response( + host, + metadata, + query_params, + session, + timeout, + transcoded_request, + body=None, + ): + uri = transcoded_request["uri"] + method = transcoded_request["method"] + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = getattr(session, method)( + "{host}{uri}".format(host=host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + ) + return response + + def __call__( + self, + request: compute.GetOperationalStatusInterconnectAttachmentGroupRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> compute.InterconnectAttachmentGroupsGetOperationalStatusResponse: + r"""Call the get operational status method over HTTP. + + Args: + request (~.compute.GetOperationalStatusInterconnectAttachmentGroupRequest): + The request object. A request message for + InterconnectAttachmentGroups.GetOperationalStatus. + See the method description for details. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + ~.compute.InterconnectAttachmentGroupsGetOperationalStatusResponse: + Response for the + InterconnectAttachmentGroupsGetOperationalStatusResponse. + + """ + + http_options = ( + _BaseInterconnectAttachmentGroupsRestTransport._BaseGetOperationalStatus._get_http_options() + ) + + request, metadata = self._interceptor.pre_get_operational_status( + request, metadata + ) + transcoded_request = _BaseInterconnectAttachmentGroupsRestTransport._BaseGetOperationalStatus._get_transcoded_request( + http_options, request + ) + + # Jsonify the query params + query_params = _BaseInterconnectAttachmentGroupsRestTransport._BaseGetOperationalStatus._get_query_params_json( + transcoded_request + ) + + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + try: + request_payload = type(request).to_json(request) + except: + request_payload = None + http_request = { + "payload": request_payload, + "requestMethod": method, + "requestUrl": request_url, + "headers": dict(metadata), + } + _LOGGER.debug( + f"Sending request for google.cloud.compute_v1.InterconnectAttachmentGroupsClient.GetOperationalStatus", + extra={ + "serviceName": "google.cloud.compute.v1.InterconnectAttachmentGroups", + "rpcName": "GetOperationalStatus", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = InterconnectAttachmentGroupsRestTransport._GetOperationalStatus._get_response( + self._host, + metadata, + query_params, + self._session, + timeout, + transcoded_request, + ) + + # In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception + # subclass. + if response.status_code >= 400: + raise core_exceptions.from_http_response(response) + + # Return the response + resp = compute.InterconnectAttachmentGroupsGetOperationalStatusResponse() + pb_resp = ( + compute.InterconnectAttachmentGroupsGetOperationalStatusResponse.pb( + resp + ) + ) + + json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True) + + resp = self._interceptor.post_get_operational_status(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_get_operational_status_with_metadata( + resp, response_metadata + ) + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + try: + response_payload = compute.InterconnectAttachmentGroupsGetOperationalStatusResponse.to_json( + response + ) + except: + response_payload = None + http_response = { + "payload": response_payload, + "headers": dict(response.headers), + "status": response.status_code, + } + _LOGGER.debug( + "Received response for google.cloud.compute_v1.InterconnectAttachmentGroupsClient.get_operational_status", + extra={ + "serviceName": "google.cloud.compute.v1.InterconnectAttachmentGroups", + "rpcName": "GetOperationalStatus", + "metadata": http_response["headers"], + "httpResponse": http_response, + }, + ) + return resp + + class _Insert( + _BaseInterconnectAttachmentGroupsRestTransport._BaseInsert, + InterconnectAttachmentGroupsRestStub, + ): + def __hash__(self): + return hash("InterconnectAttachmentGroupsRestTransport.Insert") + + @staticmethod + def _get_response( + host, + metadata, + query_params, + session, + timeout, + transcoded_request, + body=None, + ): + uri = transcoded_request["uri"] + method = transcoded_request["method"] + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = getattr(session, method)( + "{host}{uri}".format(host=host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + data=body, + ) + return response + + def __call__( + self, + request: compute.InsertInterconnectAttachmentGroupRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> compute.Operation: + r"""Call the insert method over HTTP. + + Args: + request (~.compute.InsertInterconnectAttachmentGroupRequest): + The request object. A request message for + InterconnectAttachmentGroups.Insert. See + the method description for details. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + ~.compute.Operation: + Represents an Operation resource. Google Compute Engine + has three Operation resources: \* + `Global `__ + \* + `Regional `__ + \* + `Zonal `__ + You can use an operation resource to manage asynchronous + API requests. For more information, read Handling API + responses. Operations can be global, regional or zonal. + - For global operations, use the ``globalOperations`` + resource. - For regional operations, use the + ``regionOperations`` resource. - For zonal operations, + use the ``zoneOperations`` resource. For more + information, read Global, Regional, and Zonal Resources. + Note that completed Operation resources have a limited + retention period. + + """ + + http_options = ( + _BaseInterconnectAttachmentGroupsRestTransport._BaseInsert._get_http_options() + ) + + request, metadata = self._interceptor.pre_insert(request, metadata) + transcoded_request = _BaseInterconnectAttachmentGroupsRestTransport._BaseInsert._get_transcoded_request( + http_options, request + ) + + body = _BaseInterconnectAttachmentGroupsRestTransport._BaseInsert._get_request_body_json( + transcoded_request + ) + + # Jsonify the query params + query_params = _BaseInterconnectAttachmentGroupsRestTransport._BaseInsert._get_query_params_json( + transcoded_request + ) + + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + try: + request_payload = type(request).to_json(request) + except: + request_payload = None + http_request = { + "payload": request_payload, + "requestMethod": method, + "requestUrl": request_url, + "headers": dict(metadata), + } + _LOGGER.debug( + f"Sending request for google.cloud.compute_v1.InterconnectAttachmentGroupsClient.Insert", + extra={ + "serviceName": "google.cloud.compute.v1.InterconnectAttachmentGroups", + "rpcName": "Insert", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = InterconnectAttachmentGroupsRestTransport._Insert._get_response( + self._host, + metadata, + query_params, + self._session, + timeout, + transcoded_request, + body, + ) + + # In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception + # subclass. + if response.status_code >= 400: + raise core_exceptions.from_http_response(response) + + # Return the response + resp = compute.Operation() + pb_resp = compute.Operation.pb(resp) + + json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True) + + resp = self._interceptor.post_insert(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_insert_with_metadata( + resp, response_metadata + ) + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + try: + response_payload = compute.Operation.to_json(response) + except: + response_payload = None + http_response = { + "payload": response_payload, + "headers": dict(response.headers), + "status": response.status_code, + } + _LOGGER.debug( + "Received response for google.cloud.compute_v1.InterconnectAttachmentGroupsClient.insert", + extra={ + "serviceName": "google.cloud.compute.v1.InterconnectAttachmentGroups", + "rpcName": "Insert", + "metadata": http_response["headers"], + "httpResponse": http_response, + }, + ) + return resp + + class _List( + _BaseInterconnectAttachmentGroupsRestTransport._BaseList, + InterconnectAttachmentGroupsRestStub, + ): + def __hash__(self): + return hash("InterconnectAttachmentGroupsRestTransport.List") + + @staticmethod + def _get_response( + host, + metadata, + query_params, + session, + timeout, + transcoded_request, + body=None, + ): + uri = transcoded_request["uri"] + method = transcoded_request["method"] + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = getattr(session, method)( + "{host}{uri}".format(host=host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + ) + return response + + def __call__( + self, + request: compute.ListInterconnectAttachmentGroupsRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> compute.InterconnectAttachmentGroupsListResponse: + r"""Call the list method over HTTP. + + Args: + request (~.compute.ListInterconnectAttachmentGroupsRequest): + The request object. A request message for + InterconnectAttachmentGroups.List. See + the method description for details. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + ~.compute.InterconnectAttachmentGroupsListResponse: + + """ + + http_options = ( + _BaseInterconnectAttachmentGroupsRestTransport._BaseList._get_http_options() + ) + + request, metadata = self._interceptor.pre_list(request, metadata) + transcoded_request = _BaseInterconnectAttachmentGroupsRestTransport._BaseList._get_transcoded_request( + http_options, request + ) + + # Jsonify the query params + query_params = _BaseInterconnectAttachmentGroupsRestTransport._BaseList._get_query_params_json( + transcoded_request + ) + + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + try: + request_payload = type(request).to_json(request) + except: + request_payload = None + http_request = { + "payload": request_payload, + "requestMethod": method, + "requestUrl": request_url, + "headers": dict(metadata), + } + _LOGGER.debug( + f"Sending request for google.cloud.compute_v1.InterconnectAttachmentGroupsClient.List", + extra={ + "serviceName": "google.cloud.compute.v1.InterconnectAttachmentGroups", + "rpcName": "List", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = InterconnectAttachmentGroupsRestTransport._List._get_response( + self._host, + metadata, + query_params, + self._session, + timeout, + transcoded_request, + ) + + # In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception + # subclass. + if response.status_code >= 400: + raise core_exceptions.from_http_response(response) + + # Return the response + resp = compute.InterconnectAttachmentGroupsListResponse() + pb_resp = compute.InterconnectAttachmentGroupsListResponse.pb(resp) + + json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True) + + resp = self._interceptor.post_list(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_list_with_metadata(resp, response_metadata) + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + try: + response_payload = ( + compute.InterconnectAttachmentGroupsListResponse.to_json( + response + ) + ) + except: + response_payload = None + http_response = { + "payload": response_payload, + "headers": dict(response.headers), + "status": response.status_code, + } + _LOGGER.debug( + "Received response for google.cloud.compute_v1.InterconnectAttachmentGroupsClient.list", + extra={ + "serviceName": "google.cloud.compute.v1.InterconnectAttachmentGroups", + "rpcName": "List", + "metadata": http_response["headers"], + "httpResponse": http_response, + }, + ) + return resp + + class _Patch( + _BaseInterconnectAttachmentGroupsRestTransport._BasePatch, + InterconnectAttachmentGroupsRestStub, + ): + def __hash__(self): + return hash("InterconnectAttachmentGroupsRestTransport.Patch") + + @staticmethod + def _get_response( + host, + metadata, + query_params, + session, + timeout, + transcoded_request, + body=None, + ): + uri = transcoded_request["uri"] + method = transcoded_request["method"] + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = getattr(session, method)( + "{host}{uri}".format(host=host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + data=body, + ) + return response + + def __call__( + self, + request: compute.PatchInterconnectAttachmentGroupRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> compute.Operation: + r"""Call the patch method over HTTP. + + Args: + request (~.compute.PatchInterconnectAttachmentGroupRequest): + The request object. A request message for + InterconnectAttachmentGroups.Patch. See + the method description for details. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + ~.compute.Operation: + Represents an Operation resource. Google Compute Engine + has three Operation resources: \* + `Global `__ + \* + `Regional `__ + \* + `Zonal `__ + You can use an operation resource to manage asynchronous + API requests. For more information, read Handling API + responses. Operations can be global, regional or zonal. + - For global operations, use the ``globalOperations`` + resource. - For regional operations, use the + ``regionOperations`` resource. - For zonal operations, + use the ``zoneOperations`` resource. For more + information, read Global, Regional, and Zonal Resources. + Note that completed Operation resources have a limited + retention period. + + """ + + http_options = ( + _BaseInterconnectAttachmentGroupsRestTransport._BasePatch._get_http_options() + ) + + request, metadata = self._interceptor.pre_patch(request, metadata) + transcoded_request = _BaseInterconnectAttachmentGroupsRestTransport._BasePatch._get_transcoded_request( + http_options, request + ) + + body = _BaseInterconnectAttachmentGroupsRestTransport._BasePatch._get_request_body_json( + transcoded_request + ) + + # Jsonify the query params + query_params = _BaseInterconnectAttachmentGroupsRestTransport._BasePatch._get_query_params_json( + transcoded_request + ) + + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + try: + request_payload = type(request).to_json(request) + except: + request_payload = None + http_request = { + "payload": request_payload, + "requestMethod": method, + "requestUrl": request_url, + "headers": dict(metadata), + } + _LOGGER.debug( + f"Sending request for google.cloud.compute_v1.InterconnectAttachmentGroupsClient.Patch", + extra={ + "serviceName": "google.cloud.compute.v1.InterconnectAttachmentGroups", + "rpcName": "Patch", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = InterconnectAttachmentGroupsRestTransport._Patch._get_response( + self._host, + metadata, + query_params, + self._session, + timeout, + transcoded_request, + body, + ) + + # In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception + # subclass. + if response.status_code >= 400: + raise core_exceptions.from_http_response(response) + + # Return the response + resp = compute.Operation() + pb_resp = compute.Operation.pb(resp) + + json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True) + + resp = self._interceptor.post_patch(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_patch_with_metadata( + resp, response_metadata + ) + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + try: + response_payload = compute.Operation.to_json(response) + except: + response_payload = None + http_response = { + "payload": response_payload, + "headers": dict(response.headers), + "status": response.status_code, + } + _LOGGER.debug( + "Received response for google.cloud.compute_v1.InterconnectAttachmentGroupsClient.patch", + extra={ + "serviceName": "google.cloud.compute.v1.InterconnectAttachmentGroups", + "rpcName": "Patch", + "metadata": http_response["headers"], + "httpResponse": http_response, + }, + ) + return resp + + class _SetIamPolicy( + _BaseInterconnectAttachmentGroupsRestTransport._BaseSetIamPolicy, + InterconnectAttachmentGroupsRestStub, + ): + def __hash__(self): + return hash("InterconnectAttachmentGroupsRestTransport.SetIamPolicy") + + @staticmethod + def _get_response( + host, + metadata, + query_params, + session, + timeout, + transcoded_request, + body=None, + ): + uri = transcoded_request["uri"] + method = transcoded_request["method"] + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = getattr(session, method)( + "{host}{uri}".format(host=host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + data=body, + ) + return response + + def __call__( + self, + request: compute.SetIamPolicyInterconnectAttachmentGroupRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> compute.Policy: + r"""Call the set iam policy method over HTTP. + + Args: + request (~.compute.SetIamPolicyInterconnectAttachmentGroupRequest): + The request object. A request message for + InterconnectAttachmentGroups.SetIamPolicy. + See the method description for details. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + ~.compute.Policy: + An Identity and Access Management (IAM) policy, which + specifies access controls for Google Cloud resources. A + ``Policy`` is a collection of ``bindings``. A + ``binding`` binds one or more ``members``, or + principals, to a single ``role``. Principals can be user + accounts, service accounts, Google groups, and domains + (such as G Suite). A ``role`` is a named list of + permissions; each ``role`` can be an IAM predefined role + or a user-created custom role. For some types of Google + Cloud resources, a ``binding`` can also specify a + ``condition``, which is a logical expression that allows + access to a resource only if the expression evaluates to + ``true``. A condition can add constraints based on + attributes of the request, the resource, or both. To + learn which resources support conditions in their IAM + policies, see the `IAM + documentation `__. + **JSON example:** + ``{ "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": [ "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": "BwWWja0YfJA=", "version": 3 }`` + **YAML example:** + ``bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3`` + For a description of IAM and its features, see the `IAM + documentation `__. + + """ + + http_options = ( + _BaseInterconnectAttachmentGroupsRestTransport._BaseSetIamPolicy._get_http_options() + ) + + request, metadata = self._interceptor.pre_set_iam_policy(request, metadata) + transcoded_request = _BaseInterconnectAttachmentGroupsRestTransport._BaseSetIamPolicy._get_transcoded_request( + http_options, request + ) + + body = _BaseInterconnectAttachmentGroupsRestTransport._BaseSetIamPolicy._get_request_body_json( + transcoded_request + ) + + # Jsonify the query params + query_params = _BaseInterconnectAttachmentGroupsRestTransport._BaseSetIamPolicy._get_query_params_json( + transcoded_request + ) + + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + try: + request_payload = type(request).to_json(request) + except: + request_payload = None + http_request = { + "payload": request_payload, + "requestMethod": method, + "requestUrl": request_url, + "headers": dict(metadata), + } + _LOGGER.debug( + f"Sending request for google.cloud.compute_v1.InterconnectAttachmentGroupsClient.SetIamPolicy", + extra={ + "serviceName": "google.cloud.compute.v1.InterconnectAttachmentGroups", + "rpcName": "SetIamPolicy", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = ( + InterconnectAttachmentGroupsRestTransport._SetIamPolicy._get_response( + self._host, + metadata, + query_params, + self._session, + timeout, + transcoded_request, + body, + ) + ) + + # In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception + # subclass. + if response.status_code >= 400: + raise core_exceptions.from_http_response(response) + + # Return the response + resp = compute.Policy() + pb_resp = compute.Policy.pb(resp) + + json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True) + + resp = self._interceptor.post_set_iam_policy(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_set_iam_policy_with_metadata( + resp, response_metadata + ) + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + try: + response_payload = compute.Policy.to_json(response) + except: + response_payload = None + http_response = { + "payload": response_payload, + "headers": dict(response.headers), + "status": response.status_code, + } + _LOGGER.debug( + "Received response for google.cloud.compute_v1.InterconnectAttachmentGroupsClient.set_iam_policy", + extra={ + "serviceName": "google.cloud.compute.v1.InterconnectAttachmentGroups", + "rpcName": "SetIamPolicy", + "metadata": http_response["headers"], + "httpResponse": http_response, + }, + ) + return resp + + class _TestIamPermissions( + _BaseInterconnectAttachmentGroupsRestTransport._BaseTestIamPermissions, + InterconnectAttachmentGroupsRestStub, + ): + def __hash__(self): + return hash("InterconnectAttachmentGroupsRestTransport.TestIamPermissions") + + @staticmethod + def _get_response( + host, + metadata, + query_params, + session, + timeout, + transcoded_request, + body=None, + ): + uri = transcoded_request["uri"] + method = transcoded_request["method"] + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = getattr(session, method)( + "{host}{uri}".format(host=host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + data=body, + ) + return response + + def __call__( + self, + request: compute.TestIamPermissionsInterconnectAttachmentGroupRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> compute.TestPermissionsResponse: + r"""Call the test iam permissions method over HTTP. + + Args: + request (~.compute.TestIamPermissionsInterconnectAttachmentGroupRequest): + The request object. A request message for + InterconnectAttachmentGroups.TestIamPermissions. + See the method description for details. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + ~.compute.TestPermissionsResponse: + + """ + + http_options = ( + _BaseInterconnectAttachmentGroupsRestTransport._BaseTestIamPermissions._get_http_options() + ) + + request, metadata = self._interceptor.pre_test_iam_permissions( + request, metadata + ) + transcoded_request = _BaseInterconnectAttachmentGroupsRestTransport._BaseTestIamPermissions._get_transcoded_request( + http_options, request + ) + + body = _BaseInterconnectAttachmentGroupsRestTransport._BaseTestIamPermissions._get_request_body_json( + transcoded_request + ) + + # Jsonify the query params + query_params = _BaseInterconnectAttachmentGroupsRestTransport._BaseTestIamPermissions._get_query_params_json( + transcoded_request + ) + + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + try: + request_payload = type(request).to_json(request) + except: + request_payload = None + http_request = { + "payload": request_payload, + "requestMethod": method, + "requestUrl": request_url, + "headers": dict(metadata), + } + _LOGGER.debug( + f"Sending request for google.cloud.compute_v1.InterconnectAttachmentGroupsClient.TestIamPermissions", + extra={ + "serviceName": "google.cloud.compute.v1.InterconnectAttachmentGroups", + "rpcName": "TestIamPermissions", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = InterconnectAttachmentGroupsRestTransport._TestIamPermissions._get_response( + self._host, + metadata, + query_params, + self._session, + timeout, + transcoded_request, + body, + ) + + # In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception + # subclass. + if response.status_code >= 400: + raise core_exceptions.from_http_response(response) + + # Return the response + resp = compute.TestPermissionsResponse() + pb_resp = compute.TestPermissionsResponse.pb(resp) + + json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True) + + resp = self._interceptor.post_test_iam_permissions(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_test_iam_permissions_with_metadata( + resp, response_metadata + ) + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + try: + response_payload = compute.TestPermissionsResponse.to_json(response) + except: + response_payload = None + http_response = { + "payload": response_payload, + "headers": dict(response.headers), + "status": response.status_code, + } + _LOGGER.debug( + "Received response for google.cloud.compute_v1.InterconnectAttachmentGroupsClient.test_iam_permissions", + extra={ + "serviceName": "google.cloud.compute.v1.InterconnectAttachmentGroups", + "rpcName": "TestIamPermissions", + "metadata": http_response["headers"], + "httpResponse": http_response, + }, + ) + return resp + + @property + def delete( + self, + ) -> Callable[ + [compute.DeleteInterconnectAttachmentGroupRequest], compute.Operation + ]: + # The return type is fine, but mypy isn't sophisticated enough to determine what's going on here. + # In C++ this would require a dynamic_cast + return self._Delete(self._session, self._host, self._interceptor) # type: ignore + + @property + def get( + self, + ) -> Callable[ + [compute.GetInterconnectAttachmentGroupRequest], + compute.InterconnectAttachmentGroup, + ]: + # The return type is fine, but mypy isn't sophisticated enough to determine what's going on here. + # In C++ this would require a dynamic_cast + return self._Get(self._session, self._host, self._interceptor) # type: ignore + + @property + def get_iam_policy( + self, + ) -> Callable[ + [compute.GetIamPolicyInterconnectAttachmentGroupRequest], compute.Policy + ]: + # The return type is fine, but mypy isn't sophisticated enough to determine what's going on here. + # In C++ this would require a dynamic_cast + return self._GetIamPolicy(self._session, self._host, self._interceptor) # type: ignore + + @property + def get_operational_status( + self, + ) -> Callable[ + [compute.GetOperationalStatusInterconnectAttachmentGroupRequest], + compute.InterconnectAttachmentGroupsGetOperationalStatusResponse, + ]: + # The return type is fine, but mypy isn't sophisticated enough to determine what's going on here. + # In C++ this would require a dynamic_cast + return self._GetOperationalStatus(self._session, self._host, self._interceptor) # type: ignore + + @property + def insert( + self, + ) -> Callable[ + [compute.InsertInterconnectAttachmentGroupRequest], compute.Operation + ]: + # The return type is fine, but mypy isn't sophisticated enough to determine what's going on here. + # In C++ this would require a dynamic_cast + return self._Insert(self._session, self._host, self._interceptor) # type: ignore + + @property + def list( + self, + ) -> Callable[ + [compute.ListInterconnectAttachmentGroupsRequest], + compute.InterconnectAttachmentGroupsListResponse, + ]: + # The return type is fine, but mypy isn't sophisticated enough to determine what's going on here. + # In C++ this would require a dynamic_cast + return self._List(self._session, self._host, self._interceptor) # type: ignore + + @property + def patch( + self, + ) -> Callable[[compute.PatchInterconnectAttachmentGroupRequest], compute.Operation]: + # The return type is fine, but mypy isn't sophisticated enough to determine what's going on here. + # In C++ this would require a dynamic_cast + return self._Patch(self._session, self._host, self._interceptor) # type: ignore + + @property + def set_iam_policy( + self, + ) -> Callable[ + [compute.SetIamPolicyInterconnectAttachmentGroupRequest], compute.Policy + ]: + # The return type is fine, but mypy isn't sophisticated enough to determine what's going on here. + # In C++ this would require a dynamic_cast + return self._SetIamPolicy(self._session, self._host, self._interceptor) # type: ignore + + @property + def test_iam_permissions( + self, + ) -> Callable[ + [compute.TestIamPermissionsInterconnectAttachmentGroupRequest], + compute.TestPermissionsResponse, + ]: + # The return type is fine, but mypy isn't sophisticated enough to determine what's going on here. + # In C++ this would require a dynamic_cast + return self._TestIamPermissions(self._session, self._host, self._interceptor) # type: ignore + + @property + def kind(self) -> str: + return "rest" + + def close(self): + self._session.close() + + +__all__ = ("InterconnectAttachmentGroupsRestTransport",) diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/interconnect_attachment_groups/transports/rest_base.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/interconnect_attachment_groups/transports/rest_base.py new file mode 100644 index 000000000000..91a19bb4feb6 --- /dev/null +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/interconnect_attachment_groups/transports/rest_base.py @@ -0,0 +1,557 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +import json # type: ignore +import re +from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple, Union + +from google.api_core import gapic_v1, path_template +from google.protobuf import json_format + +from google.cloud.compute_v1.types import compute + +from .base import DEFAULT_CLIENT_INFO, InterconnectAttachmentGroupsTransport + + +class _BaseInterconnectAttachmentGroupsRestTransport( + InterconnectAttachmentGroupsTransport +): + """Base REST backend transport for InterconnectAttachmentGroups. + + Note: This class is not meant to be used directly. Use its sync and + async sub-classes instead. + + This class defines the same methods as the primary client, so the + primary client can load the underlying transport implementation + and call it. + + It sends JSON representations of protocol buffers over HTTP/1.1 + """ + + def __init__( + self, + *, + host: str = "compute.googleapis.com", + credentials: Optional[Any] = None, + client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, + always_use_jwt_access: Optional[bool] = False, + url_scheme: str = "https", + api_audience: Optional[str] = None, + ) -> None: + """Instantiate the transport. + Args: + host (Optional[str]): + The hostname to connect to (default: 'compute.googleapis.com'). + credentials (Optional[Any]): The + authorization credentials to attach to requests. These + credentials identify the application to the service; if none + are specified, the client will attempt to ascertain the + credentials from the environment. + client_info (google.api_core.gapic_v1.client_info.ClientInfo): + The client info used to send a user-agent string along with + API requests. If ``None``, then default info will be used. + Generally, you only need to set this if you are developing + your own client library. + always_use_jwt_access (Optional[bool]): Whether self signed JWT should + be used for service account credentials. + url_scheme: the protocol scheme for the API endpoint. Normally + "https", but for testing or local servers, + "http" can be specified. + """ + # Run the base constructor + maybe_url_match = re.match("^(?Phttp(?:s)?://)?(?P.*)$", host) + if maybe_url_match is None: + raise ValueError( + f"Unexpected hostname structure: {host}" + ) # pragma: NO COVER + + url_match_items = maybe_url_match.groupdict() + + host = f"{url_scheme}://{host}" if not url_match_items["scheme"] else host + + super().__init__( + host=host, + credentials=credentials, + client_info=client_info, + always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, + ) + + class _BaseDelete: + def __hash__(self): # pragma: NO COVER + return NotImplementedError("__hash__ must be implemented.") + + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} + + @classmethod + def _get_unset_required_fields(cls, message_dict): + return { + k: v + for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items() + if k not in message_dict + } + + @staticmethod + def _get_http_options(): + http_options: List[Dict[str, str]] = [ + { + "method": "delete", + "uri": "/compute/v1/projects/{project}/global/interconnectAttachmentGroups/{interconnect_attachment_group}", + }, + ] + return http_options + + @staticmethod + def _get_transcoded_request(http_options, request): + pb_request = compute.DeleteInterconnectAttachmentGroupRequest.pb(request) + transcoded_request = path_template.transcode(http_options, pb_request) + return transcoded_request + + @staticmethod + def _get_query_params_json(transcoded_request): + query_params = json.loads( + json_format.MessageToJson( + transcoded_request["query_params"], + use_integers_for_enums=False, + ) + ) + query_params.update( + _BaseInterconnectAttachmentGroupsRestTransport._BaseDelete._get_unset_required_fields( + query_params + ) + ) + + return query_params + + class _BaseGet: + def __hash__(self): # pragma: NO COVER + return NotImplementedError("__hash__ must be implemented.") + + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} + + @classmethod + def _get_unset_required_fields(cls, message_dict): + return { + k: v + for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items() + if k not in message_dict + } + + @staticmethod + def _get_http_options(): + http_options: List[Dict[str, str]] = [ + { + "method": "get", + "uri": "/compute/v1/projects/{project}/global/interconnectAttachmentGroups/{interconnect_attachment_group}", + }, + ] + return http_options + + @staticmethod + def _get_transcoded_request(http_options, request): + pb_request = compute.GetInterconnectAttachmentGroupRequest.pb(request) + transcoded_request = path_template.transcode(http_options, pb_request) + return transcoded_request + + @staticmethod + def _get_query_params_json(transcoded_request): + query_params = json.loads( + json_format.MessageToJson( + transcoded_request["query_params"], + use_integers_for_enums=False, + ) + ) + query_params.update( + _BaseInterconnectAttachmentGroupsRestTransport._BaseGet._get_unset_required_fields( + query_params + ) + ) + + return query_params + + class _BaseGetIamPolicy: + def __hash__(self): # pragma: NO COVER + return NotImplementedError("__hash__ must be implemented.") + + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} + + @classmethod + def _get_unset_required_fields(cls, message_dict): + return { + k: v + for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items() + if k not in message_dict + } + + @staticmethod + def _get_http_options(): + http_options: List[Dict[str, str]] = [ + { + "method": "get", + "uri": "/compute/v1/projects/{project}/global/interconnectAttachmentGroups/{resource}/getIamPolicy", + }, + ] + return http_options + + @staticmethod + def _get_transcoded_request(http_options, request): + pb_request = compute.GetIamPolicyInterconnectAttachmentGroupRequest.pb( + request + ) + transcoded_request = path_template.transcode(http_options, pb_request) + return transcoded_request + + @staticmethod + def _get_query_params_json(transcoded_request): + query_params = json.loads( + json_format.MessageToJson( + transcoded_request["query_params"], + use_integers_for_enums=False, + ) + ) + query_params.update( + _BaseInterconnectAttachmentGroupsRestTransport._BaseGetIamPolicy._get_unset_required_fields( + query_params + ) + ) + + return query_params + + class _BaseGetOperationalStatus: + def __hash__(self): # pragma: NO COVER + return NotImplementedError("__hash__ must be implemented.") + + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} + + @classmethod + def _get_unset_required_fields(cls, message_dict): + return { + k: v + for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items() + if k not in message_dict + } + + @staticmethod + def _get_http_options(): + http_options: List[Dict[str, str]] = [ + { + "method": "get", + "uri": "/compute/v1/projects/{project}/global/interconnectAttachmentGroups/{interconnect_attachment_group}/getOperationalStatus", + }, + ] + return http_options + + @staticmethod + def _get_transcoded_request(http_options, request): + pb_request = ( + compute.GetOperationalStatusInterconnectAttachmentGroupRequest.pb( + request + ) + ) + transcoded_request = path_template.transcode(http_options, pb_request) + return transcoded_request + + @staticmethod + def _get_query_params_json(transcoded_request): + query_params = json.loads( + json_format.MessageToJson( + transcoded_request["query_params"], + use_integers_for_enums=False, + ) + ) + query_params.update( + _BaseInterconnectAttachmentGroupsRestTransport._BaseGetOperationalStatus._get_unset_required_fields( + query_params + ) + ) + + return query_params + + class _BaseInsert: + def __hash__(self): # pragma: NO COVER + return NotImplementedError("__hash__ must be implemented.") + + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} + + @classmethod + def _get_unset_required_fields(cls, message_dict): + return { + k: v + for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items() + if k not in message_dict + } + + @staticmethod + def _get_http_options(): + http_options: List[Dict[str, str]] = [ + { + "method": "post", + "uri": "/compute/v1/projects/{project}/global/interconnectAttachmentGroups", + "body": "interconnect_attachment_group_resource", + }, + ] + return http_options + + @staticmethod + def _get_transcoded_request(http_options, request): + pb_request = compute.InsertInterconnectAttachmentGroupRequest.pb(request) + transcoded_request = path_template.transcode(http_options, pb_request) + return transcoded_request + + @staticmethod + def _get_request_body_json(transcoded_request): + # Jsonify the request body + + body = json_format.MessageToJson( + transcoded_request["body"], use_integers_for_enums=False + ) + return body + + @staticmethod + def _get_query_params_json(transcoded_request): + query_params = json.loads( + json_format.MessageToJson( + transcoded_request["query_params"], + use_integers_for_enums=False, + ) + ) + query_params.update( + _BaseInterconnectAttachmentGroupsRestTransport._BaseInsert._get_unset_required_fields( + query_params + ) + ) + + return query_params + + class _BaseList: + def __hash__(self): # pragma: NO COVER + return NotImplementedError("__hash__ must be implemented.") + + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} + + @classmethod + def _get_unset_required_fields(cls, message_dict): + return { + k: v + for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items() + if k not in message_dict + } + + @staticmethod + def _get_http_options(): + http_options: List[Dict[str, str]] = [ + { + "method": "get", + "uri": "/compute/v1/projects/{project}/global/interconnectAttachmentGroups", + }, + ] + return http_options + + @staticmethod + def _get_transcoded_request(http_options, request): + pb_request = compute.ListInterconnectAttachmentGroupsRequest.pb(request) + transcoded_request = path_template.transcode(http_options, pb_request) + return transcoded_request + + @staticmethod + def _get_query_params_json(transcoded_request): + query_params = json.loads( + json_format.MessageToJson( + transcoded_request["query_params"], + use_integers_for_enums=False, + ) + ) + query_params.update( + _BaseInterconnectAttachmentGroupsRestTransport._BaseList._get_unset_required_fields( + query_params + ) + ) + + return query_params + + class _BasePatch: + def __hash__(self): # pragma: NO COVER + return NotImplementedError("__hash__ must be implemented.") + + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} + + @classmethod + def _get_unset_required_fields(cls, message_dict): + return { + k: v + for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items() + if k not in message_dict + } + + @staticmethod + def _get_http_options(): + http_options: List[Dict[str, str]] = [ + { + "method": "patch", + "uri": "/compute/v1/projects/{project}/global/interconnectAttachmentGroups/{interconnect_attachment_group}", + "body": "interconnect_attachment_group_resource", + }, + ] + return http_options + + @staticmethod + def _get_transcoded_request(http_options, request): + pb_request = compute.PatchInterconnectAttachmentGroupRequest.pb(request) + transcoded_request = path_template.transcode(http_options, pb_request) + return transcoded_request + + @staticmethod + def _get_request_body_json(transcoded_request): + # Jsonify the request body + + body = json_format.MessageToJson( + transcoded_request["body"], use_integers_for_enums=False + ) + return body + + @staticmethod + def _get_query_params_json(transcoded_request): + query_params = json.loads( + json_format.MessageToJson( + transcoded_request["query_params"], + use_integers_for_enums=False, + ) + ) + query_params.update( + _BaseInterconnectAttachmentGroupsRestTransport._BasePatch._get_unset_required_fields( + query_params + ) + ) + + return query_params + + class _BaseSetIamPolicy: + def __hash__(self): # pragma: NO COVER + return NotImplementedError("__hash__ must be implemented.") + + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} + + @classmethod + def _get_unset_required_fields(cls, message_dict): + return { + k: v + for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items() + if k not in message_dict + } + + @staticmethod + def _get_http_options(): + http_options: List[Dict[str, str]] = [ + { + "method": "post", + "uri": "/compute/v1/projects/{project}/global/interconnectAttachmentGroups/{resource}/setIamPolicy", + "body": "global_set_policy_request_resource", + }, + ] + return http_options + + @staticmethod + def _get_transcoded_request(http_options, request): + pb_request = compute.SetIamPolicyInterconnectAttachmentGroupRequest.pb( + request + ) + transcoded_request = path_template.transcode(http_options, pb_request) + return transcoded_request + + @staticmethod + def _get_request_body_json(transcoded_request): + # Jsonify the request body + + body = json_format.MessageToJson( + transcoded_request["body"], use_integers_for_enums=False + ) + return body + + @staticmethod + def _get_query_params_json(transcoded_request): + query_params = json.loads( + json_format.MessageToJson( + transcoded_request["query_params"], + use_integers_for_enums=False, + ) + ) + query_params.update( + _BaseInterconnectAttachmentGroupsRestTransport._BaseSetIamPolicy._get_unset_required_fields( + query_params + ) + ) + + return query_params + + class _BaseTestIamPermissions: + def __hash__(self): # pragma: NO COVER + return NotImplementedError("__hash__ must be implemented.") + + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} + + @classmethod + def _get_unset_required_fields(cls, message_dict): + return { + k: v + for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items() + if k not in message_dict + } + + @staticmethod + def _get_http_options(): + http_options: List[Dict[str, str]] = [ + { + "method": "post", + "uri": "/compute/v1/projects/{project}/global/interconnectAttachmentGroups/{resource}/testIamPermissions", + "body": "test_permissions_request_resource", + }, + ] + return http_options + + @staticmethod + def _get_transcoded_request(http_options, request): + pb_request = ( + compute.TestIamPermissionsInterconnectAttachmentGroupRequest.pb(request) + ) + transcoded_request = path_template.transcode(http_options, pb_request) + return transcoded_request + + @staticmethod + def _get_request_body_json(transcoded_request): + # Jsonify the request body + + body = json_format.MessageToJson( + transcoded_request["body"], use_integers_for_enums=False + ) + return body + + @staticmethod + def _get_query_params_json(transcoded_request): + query_params = json.loads( + json_format.MessageToJson( + transcoded_request["query_params"], + use_integers_for_enums=False, + ) + ) + query_params.update( + _BaseInterconnectAttachmentGroupsRestTransport._BaseTestIamPermissions._get_unset_required_fields( + query_params + ) + ) + + return query_params + + +__all__ = ("_BaseInterconnectAttachmentGroupsRestTransport",) diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/interconnect_groups/__init__.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/interconnect_groups/__init__.py new file mode 100644 index 000000000000..a214cfdd048e --- /dev/null +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/interconnect_groups/__init__.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from .client import InterconnectGroupsClient + +__all__ = ("InterconnectGroupsClient",) diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/interconnect_groups/client.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/interconnect_groups/client.py new file mode 100644 index 000000000000..5e942db370da --- /dev/null +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/interconnect_groups/client.py @@ -0,0 +1,2663 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from collections import OrderedDict +import functools +from http import HTTPStatus +import json +import logging as std_logging +import os +import re +from typing import ( + Callable, + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, + cast, +) +import warnings + +from google.api_core import client_options as client_options_lib +from google.api_core import exceptions as core_exceptions +from google.api_core import extended_operation, gapic_v1 +from google.api_core import retry as retries +from google.auth import credentials as ga_credentials # type: ignore +from google.auth.exceptions import MutualTLSChannelError # type: ignore +from google.auth.transport import mtls # type: ignore +from google.auth.transport.grpc import SslCredentials # type: ignore +from google.oauth2 import service_account # type: ignore +import google.protobuf + +from google.cloud.compute_v1 import gapic_version as package_version + +try: + OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault, None] +except AttributeError: # pragma: NO COVER + OptionalRetry = Union[retries.Retry, object, None] # type: ignore + +try: + from google.api_core import client_logging # type: ignore + + CLIENT_LOGGING_SUPPORTED = True # pragma: NO COVER +except ImportError: # pragma: NO COVER + CLIENT_LOGGING_SUPPORTED = False + +_LOGGER = std_logging.getLogger(__name__) + +from google.api_core import extended_operation # type: ignore + +from google.cloud.compute_v1.services.interconnect_groups import pagers +from google.cloud.compute_v1.types import compute + +from .transports.base import DEFAULT_CLIENT_INFO, InterconnectGroupsTransport +from .transports.rest import InterconnectGroupsRestTransport + + +class InterconnectGroupsClientMeta(type): + """Metaclass for the InterconnectGroups client. + + This provides class-level methods for building and retrieving + support objects (e.g. transport) without polluting the client instance + objects. + """ + + _transport_registry = ( + OrderedDict() + ) # type: Dict[str, Type[InterconnectGroupsTransport]] + _transport_registry["rest"] = InterconnectGroupsRestTransport + + def get_transport_class( + cls, + label: Optional[str] = None, + ) -> Type[InterconnectGroupsTransport]: + """Returns an appropriate transport class. + + Args: + label: The name of the desired transport. If none is + provided, then the first transport in the registry is used. + + Returns: + The transport class to use. + """ + # If a specific transport is requested, return that one. + if label: + return cls._transport_registry[label] + + # No transport is requested; return the default (that is, the first one + # in the dictionary). + return next(iter(cls._transport_registry.values())) + + +class InterconnectGroupsClient(metaclass=InterconnectGroupsClientMeta): + """The InterconnectGroups API.""" + + @staticmethod + def _get_default_mtls_endpoint(api_endpoint): + """Converts api endpoint to mTLS endpoint. + + Convert "*.sandbox.googleapis.com" and "*.googleapis.com" to + "*.mtls.sandbox.googleapis.com" and "*.mtls.googleapis.com" respectively. + Args: + api_endpoint (Optional[str]): the api endpoint to convert. + Returns: + str: converted mTLS api endpoint. + """ + if not api_endpoint: + return api_endpoint + + mtls_endpoint_re = re.compile( + r"(?P[^.]+)(?P\.mtls)?(?P\.sandbox)?(?P\.googleapis\.com)?" + ) + + m = mtls_endpoint_re.match(api_endpoint) + name, mtls, sandbox, googledomain = m.groups() + if mtls or not googledomain: + return api_endpoint + + if sandbox: + return api_endpoint.replace( + "sandbox.googleapis.com", "mtls.sandbox.googleapis.com" + ) + + return api_endpoint.replace(".googleapis.com", ".mtls.googleapis.com") + + # Note: DEFAULT_ENDPOINT is deprecated. Use _DEFAULT_ENDPOINT_TEMPLATE instead. + DEFAULT_ENDPOINT = "compute.googleapis.com" + DEFAULT_MTLS_ENDPOINT = _get_default_mtls_endpoint.__func__( # type: ignore + DEFAULT_ENDPOINT + ) + + _DEFAULT_ENDPOINT_TEMPLATE = "compute.{UNIVERSE_DOMAIN}" + _DEFAULT_UNIVERSE = "googleapis.com" + + @classmethod + def from_service_account_info(cls, info: dict, *args, **kwargs): + """Creates an instance of this client using the provided credentials + info. + + Args: + info (dict): The service account private key info. + args: Additional arguments to pass to the constructor. + kwargs: Additional arguments to pass to the constructor. + + Returns: + InterconnectGroupsClient: The constructed client. + """ + credentials = service_account.Credentials.from_service_account_info(info) + kwargs["credentials"] = credentials + return cls(*args, **kwargs) + + @classmethod + def from_service_account_file(cls, filename: str, *args, **kwargs): + """Creates an instance of this client using the provided credentials + file. + + Args: + filename (str): The path to the service account private key json + file. + args: Additional arguments to pass to the constructor. + kwargs: Additional arguments to pass to the constructor. + + Returns: + InterconnectGroupsClient: The constructed client. + """ + credentials = service_account.Credentials.from_service_account_file(filename) + kwargs["credentials"] = credentials + return cls(*args, **kwargs) + + from_service_account_json = from_service_account_file + + @property + def transport(self) -> InterconnectGroupsTransport: + """Returns the transport used by the client instance. + + Returns: + InterconnectGroupsTransport: The transport used by the client + instance. + """ + return self._transport + + @staticmethod + def common_billing_account_path( + billing_account: str, + ) -> str: + """Returns a fully-qualified billing_account string.""" + return "billingAccounts/{billing_account}".format( + billing_account=billing_account, + ) + + @staticmethod + def parse_common_billing_account_path(path: str) -> Dict[str, str]: + """Parse a billing_account path into its component segments.""" + m = re.match(r"^billingAccounts/(?P.+?)$", path) + return m.groupdict() if m else {} + + @staticmethod + def common_folder_path( + folder: str, + ) -> str: + """Returns a fully-qualified folder string.""" + return "folders/{folder}".format( + folder=folder, + ) + + @staticmethod + def parse_common_folder_path(path: str) -> Dict[str, str]: + """Parse a folder path into its component segments.""" + m = re.match(r"^folders/(?P.+?)$", path) + return m.groupdict() if m else {} + + @staticmethod + def common_organization_path( + organization: str, + ) -> str: + """Returns a fully-qualified organization string.""" + return "organizations/{organization}".format( + organization=organization, + ) + + @staticmethod + def parse_common_organization_path(path: str) -> Dict[str, str]: + """Parse a organization path into its component segments.""" + m = re.match(r"^organizations/(?P.+?)$", path) + return m.groupdict() if m else {} + + @staticmethod + def common_project_path( + project: str, + ) -> str: + """Returns a fully-qualified project string.""" + return "projects/{project}".format( + project=project, + ) + + @staticmethod + def parse_common_project_path(path: str) -> Dict[str, str]: + """Parse a project path into its component segments.""" + m = re.match(r"^projects/(?P.+?)$", path) + return m.groupdict() if m else {} + + @staticmethod + def common_location_path( + project: str, + location: str, + ) -> str: + """Returns a fully-qualified location string.""" + return "projects/{project}/locations/{location}".format( + project=project, + location=location, + ) + + @staticmethod + def parse_common_location_path(path: str) -> Dict[str, str]: + """Parse a location path into its component segments.""" + m = re.match(r"^projects/(?P.+?)/locations/(?P.+?)$", path) + return m.groupdict() if m else {} + + @classmethod + def get_mtls_endpoint_and_cert_source( + cls, client_options: Optional[client_options_lib.ClientOptions] = None + ): + """Deprecated. Return the API endpoint and client cert source for mutual TLS. + + The client cert source is determined in the following order: + (1) if `GOOGLE_API_USE_CLIENT_CERTIFICATE` environment variable is not "true", the + client cert source is None. + (2) if `client_options.client_cert_source` is provided, use the provided one; if the + default client cert source exists, use the default one; otherwise the client cert + source is None. + + The API endpoint is determined in the following order: + (1) if `client_options.api_endpoint` if provided, use the provided one. + (2) if `GOOGLE_API_USE_CLIENT_CERTIFICATE` environment variable is "always", use the + default mTLS endpoint; if the environment variable is "never", use the default API + endpoint; otherwise if client cert source exists, use the default mTLS endpoint, otherwise + use the default API endpoint. + + More details can be found at https://google.aip.dev/auth/4114. + + Args: + client_options (google.api_core.client_options.ClientOptions): Custom options for the + client. Only the `api_endpoint` and `client_cert_source` properties may be used + in this method. + + Returns: + Tuple[str, Callable[[], Tuple[bytes, bytes]]]: returns the API endpoint and the + client cert source to use. + + Raises: + google.auth.exceptions.MutualTLSChannelError: If any errors happen. + """ + + warnings.warn( + "get_mtls_endpoint_and_cert_source is deprecated. Use the api_endpoint property instead.", + DeprecationWarning, + ) + if client_options is None: + client_options = client_options_lib.ClientOptions() + use_client_cert = os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false") + use_mtls_endpoint = os.getenv("GOOGLE_API_USE_MTLS_ENDPOINT", "auto") + if use_client_cert not in ("true", "false"): + raise ValueError( + "Environment variable `GOOGLE_API_USE_CLIENT_CERTIFICATE` must be either `true` or `false`" + ) + if use_mtls_endpoint not in ("auto", "never", "always"): + raise MutualTLSChannelError( + "Environment variable `GOOGLE_API_USE_MTLS_ENDPOINT` must be `never`, `auto` or `always`" + ) + + # Figure out the client cert source to use. + client_cert_source = None + if use_client_cert == "true": + if client_options.client_cert_source: + client_cert_source = client_options.client_cert_source + elif mtls.has_default_client_cert_source(): + client_cert_source = mtls.default_client_cert_source() + + # Figure out which api endpoint to use. + if client_options.api_endpoint is not None: + api_endpoint = client_options.api_endpoint + elif use_mtls_endpoint == "always" or ( + use_mtls_endpoint == "auto" and client_cert_source + ): + api_endpoint = cls.DEFAULT_MTLS_ENDPOINT + else: + api_endpoint = cls.DEFAULT_ENDPOINT + + return api_endpoint, client_cert_source + + @staticmethod + def _read_environment_variables(): + """Returns the environment variables used by the client. + + Returns: + Tuple[bool, str, str]: returns the GOOGLE_API_USE_CLIENT_CERTIFICATE, + GOOGLE_API_USE_MTLS_ENDPOINT, and GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variables. + + Raises: + ValueError: If GOOGLE_API_USE_CLIENT_CERTIFICATE is not + any of ["true", "false"]. + google.auth.exceptions.MutualTLSChannelError: If GOOGLE_API_USE_MTLS_ENDPOINT + is not any of ["auto", "never", "always"]. + """ + use_client_cert = os.getenv( + "GOOGLE_API_USE_CLIENT_CERTIFICATE", "false" + ).lower() + use_mtls_endpoint = os.getenv("GOOGLE_API_USE_MTLS_ENDPOINT", "auto").lower() + universe_domain_env = os.getenv("GOOGLE_CLOUD_UNIVERSE_DOMAIN") + if use_client_cert not in ("true", "false"): + raise ValueError( + "Environment variable `GOOGLE_API_USE_CLIENT_CERTIFICATE` must be either `true` or `false`" + ) + if use_mtls_endpoint not in ("auto", "never", "always"): + raise MutualTLSChannelError( + "Environment variable `GOOGLE_API_USE_MTLS_ENDPOINT` must be `never`, `auto` or `always`" + ) + return use_client_cert == "true", use_mtls_endpoint, universe_domain_env + + @staticmethod + def _get_client_cert_source(provided_cert_source, use_cert_flag): + """Return the client cert source to be used by the client. + + Args: + provided_cert_source (bytes): The client certificate source provided. + use_cert_flag (bool): A flag indicating whether to use the client certificate. + + Returns: + bytes or None: The client cert source to be used by the client. + """ + client_cert_source = None + if use_cert_flag: + if provided_cert_source: + client_cert_source = provided_cert_source + elif mtls.has_default_client_cert_source(): + client_cert_source = mtls.default_client_cert_source() + return client_cert_source + + @staticmethod + def _get_api_endpoint( + api_override, client_cert_source, universe_domain, use_mtls_endpoint + ): + """Return the API endpoint used by the client. + + Args: + api_override (str): The API endpoint override. If specified, this is always + the return value of this function and the other arguments are not used. + client_cert_source (bytes): The client certificate source used by the client. + universe_domain (str): The universe domain used by the client. + use_mtls_endpoint (str): How to use the mTLS endpoint, which depends also on the other parameters. + Possible values are "always", "auto", or "never". + + Returns: + str: The API endpoint to be used by the client. + """ + if api_override is not None: + api_endpoint = api_override + elif use_mtls_endpoint == "always" or ( + use_mtls_endpoint == "auto" and client_cert_source + ): + _default_universe = InterconnectGroupsClient._DEFAULT_UNIVERSE + if universe_domain != _default_universe: + raise MutualTLSChannelError( + f"mTLS is not supported in any universe other than {_default_universe}." + ) + api_endpoint = InterconnectGroupsClient.DEFAULT_MTLS_ENDPOINT + else: + api_endpoint = InterconnectGroupsClient._DEFAULT_ENDPOINT_TEMPLATE.format( + UNIVERSE_DOMAIN=universe_domain + ) + return api_endpoint + + @staticmethod + def _get_universe_domain( + client_universe_domain: Optional[str], universe_domain_env: Optional[str] + ) -> str: + """Return the universe domain used by the client. + + Args: + client_universe_domain (Optional[str]): The universe domain configured via the client options. + universe_domain_env (Optional[str]): The universe domain configured via the "GOOGLE_CLOUD_UNIVERSE_DOMAIN" environment variable. + + Returns: + str: The universe domain to be used by the client. + + Raises: + ValueError: If the universe domain is an empty string. + """ + universe_domain = InterconnectGroupsClient._DEFAULT_UNIVERSE + if client_universe_domain is not None: + universe_domain = client_universe_domain + elif universe_domain_env is not None: + universe_domain = universe_domain_env + if len(universe_domain.strip()) == 0: + raise ValueError("Universe Domain cannot be an empty string.") + return universe_domain + + def _validate_universe_domain(self): + """Validates client's and credentials' universe domains are consistent. + + Returns: + bool: True iff the configured universe domain is valid. + + Raises: + ValueError: If the configured universe domain is not valid. + """ + + # NOTE (b/349488459): universe validation is disabled until further notice. + return True + + def _add_cred_info_for_auth_errors( + self, error: core_exceptions.GoogleAPICallError + ) -> None: + """Adds credential info string to error details for 401/403/404 errors. + + Args: + error (google.api_core.exceptions.GoogleAPICallError): The error to add the cred info. + """ + if error.code not in [ + HTTPStatus.UNAUTHORIZED, + HTTPStatus.FORBIDDEN, + HTTPStatus.NOT_FOUND, + ]: + return + + cred = self._transport._credentials + + # get_cred_info is only available in google-auth>=2.35.0 + if not hasattr(cred, "get_cred_info"): + return + + # ignore the type check since pypy test fails when get_cred_info + # is not available + cred_info = cred.get_cred_info() # type: ignore + if cred_info and hasattr(error._details, "append"): + error._details.append(json.dumps(cred_info)) + + @property + def api_endpoint(self): + """Return the API endpoint used by the client instance. + + Returns: + str: The API endpoint used by the client instance. + """ + return self._api_endpoint + + @property + def universe_domain(self) -> str: + """Return the universe domain used by the client instance. + + Returns: + str: The universe domain used by the client instance. + """ + return self._universe_domain + + def __init__( + self, + *, + credentials: Optional[ga_credentials.Credentials] = None, + transport: Optional[ + Union[ + str, + InterconnectGroupsTransport, + Callable[..., InterconnectGroupsTransport], + ] + ] = None, + client_options: Optional[Union[client_options_lib.ClientOptions, dict]] = None, + client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, + ) -> None: + """Instantiates the interconnect groups client. + + Args: + credentials (Optional[google.auth.credentials.Credentials]): The + authorization credentials to attach to requests. These + credentials identify the application to the service; if none + are specified, the client will attempt to ascertain the + credentials from the environment. + transport (Optional[Union[str,InterconnectGroupsTransport,Callable[..., InterconnectGroupsTransport]]]): + The transport to use, or a Callable that constructs and returns a new transport. + If a Callable is given, it will be called with the same set of initialization + arguments as used in the InterconnectGroupsTransport constructor. + If set to None, a transport is chosen automatically. + NOTE: "rest" transport functionality is currently in a + beta state (preview). We welcome your feedback via an + issue in this library's source repository. + client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]): + Custom options for the client. + + 1. The ``api_endpoint`` property can be used to override the + default endpoint provided by the client when ``transport`` is + not explicitly provided. Only if this property is not set and + ``transport`` was not explicitly provided, the endpoint is + determined by the GOOGLE_API_USE_MTLS_ENDPOINT environment + variable, which have one of the following values: + "always" (always use the default mTLS endpoint), "never" (always + use the default regular endpoint) and "auto" (auto-switch to the + default mTLS endpoint if client certificate is present; this is + the default value). + + 2. If the GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable + is "true", then the ``client_cert_source`` property can be used + to provide a client certificate for mTLS transport. If + not provided, the default SSL client certificate will be used if + present. If GOOGLE_API_USE_CLIENT_CERTIFICATE is "false" or not + set, no client certificate will be used. + + 3. The ``universe_domain`` property can be used to override the + default "googleapis.com" universe. Note that the ``api_endpoint`` + property still takes precedence; and ``universe_domain`` is + currently not supported for mTLS. + + client_info (google.api_core.gapic_v1.client_info.ClientInfo): + The client info used to send a user-agent string along with + API requests. If ``None``, then default info will be used. + Generally, you only need to set this if you're developing + your own client library. + + Raises: + google.auth.exceptions.MutualTLSChannelError: If mutual TLS transport + creation failed for any reason. + """ + self._client_options = client_options + if isinstance(self._client_options, dict): + self._client_options = client_options_lib.from_dict(self._client_options) + if self._client_options is None: + self._client_options = client_options_lib.ClientOptions() + self._client_options = cast( + client_options_lib.ClientOptions, self._client_options + ) + + universe_domain_opt = getattr(self._client_options, "universe_domain", None) + + ( + self._use_client_cert, + self._use_mtls_endpoint, + self._universe_domain_env, + ) = InterconnectGroupsClient._read_environment_variables() + self._client_cert_source = InterconnectGroupsClient._get_client_cert_source( + self._client_options.client_cert_source, self._use_client_cert + ) + self._universe_domain = InterconnectGroupsClient._get_universe_domain( + universe_domain_opt, self._universe_domain_env + ) + self._api_endpoint = None # updated below, depending on `transport` + + # Initialize the universe domain validation. + self._is_universe_domain_valid = False + + if CLIENT_LOGGING_SUPPORTED: # pragma: NO COVER + # Setup logging. + client_logging.initialize_logging() + + api_key_value = getattr(self._client_options, "api_key", None) + if api_key_value and credentials: + raise ValueError( + "client_options.api_key and credentials are mutually exclusive" + ) + + # Save or instantiate the transport. + # Ordinarily, we provide the transport, but allowing a custom transport + # instance provides an extensibility point for unusual situations. + transport_provided = isinstance(transport, InterconnectGroupsTransport) + if transport_provided: + # transport is a InterconnectGroupsTransport instance. + if credentials or self._client_options.credentials_file or api_key_value: + raise ValueError( + "When providing a transport instance, " + "provide its credentials directly." + ) + if self._client_options.scopes: + raise ValueError( + "When providing a transport instance, provide its scopes " + "directly." + ) + self._transport = cast(InterconnectGroupsTransport, transport) + self._api_endpoint = self._transport.host + + self._api_endpoint = ( + self._api_endpoint + or InterconnectGroupsClient._get_api_endpoint( + self._client_options.api_endpoint, + self._client_cert_source, + self._universe_domain, + self._use_mtls_endpoint, + ) + ) + + if not transport_provided: + import google.auth._default # type: ignore + + if api_key_value and hasattr( + google.auth._default, "get_api_key_credentials" + ): + credentials = google.auth._default.get_api_key_credentials( + api_key_value + ) + + transport_init: Union[ + Type[InterconnectGroupsTransport], + Callable[..., InterconnectGroupsTransport], + ] = ( + InterconnectGroupsClient.get_transport_class(transport) + if isinstance(transport, str) or transport is None + else cast(Callable[..., InterconnectGroupsTransport], transport) + ) + # initialize with the provided callable or the passed in class + self._transport = transport_init( + credentials=credentials, + credentials_file=self._client_options.credentials_file, + host=self._api_endpoint, + scopes=self._client_options.scopes, + client_cert_source_for_mtls=self._client_cert_source, + quota_project_id=self._client_options.quota_project_id, + client_info=client_info, + always_use_jwt_access=True, + api_audience=self._client_options.api_audience, + ) + + if "async" not in str(self._transport): + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + std_logging.DEBUG + ): # pragma: NO COVER + _LOGGER.debug( + "Created client `google.cloud.compute_v1.InterconnectGroupsClient`.", + extra={ + "serviceName": "google.cloud.compute.v1.InterconnectGroups", + "universeDomain": getattr( + self._transport._credentials, "universe_domain", "" + ), + "credentialsType": f"{type(self._transport._credentials).__module__}.{type(self._transport._credentials).__qualname__}", + "credentialsInfo": getattr( + self.transport._credentials, "get_cred_info", lambda: None + )(), + } + if hasattr(self._transport, "_credentials") + else { + "serviceName": "google.cloud.compute.v1.InterconnectGroups", + "credentialsType": None, + }, + ) + + def create_members_unary( + self, + request: Optional[ + Union[compute.CreateMembersInterconnectGroupRequest, dict] + ] = None, + *, + project: Optional[str] = None, + interconnect_group: Optional[str] = None, + interconnect_groups_create_members_request_resource: Optional[ + compute.InterconnectGroupsCreateMembersRequest + ] = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> compute.Operation: + r"""Create Interconnects with redundancy by creating them + in a specified interconnect group. + + .. code-block:: python + + # This snippet 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 as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import compute_v1 + + def sample_create_members(): + # Create a client + client = compute_v1.InterconnectGroupsClient() + + # Initialize request argument(s) + request = compute_v1.CreateMembersInterconnectGroupRequest( + interconnect_group="interconnect_group_value", + project="project_value", + ) + + # Make the request + response = client.create_members(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.compute_v1.types.CreateMembersInterconnectGroupRequest, dict]): + The request object. A request message for + InterconnectGroups.CreateMembers. See + the method description for details. + project (str): + Project ID for this request. + This corresponds to the ``project`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + interconnect_group (str): + Name of the group resource to create + members for. + + This corresponds to the ``interconnect_group`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + interconnect_groups_create_members_request_resource (google.cloud.compute_v1.types.InterconnectGroupsCreateMembersRequest): + The body resource for this request + This corresponds to the ``interconnect_groups_create_members_request_resource`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + google.api_core.extended_operation.ExtendedOperation: + An object representing a extended + long-running operation. + + """ + # Create or coerce a protobuf request object. + # - Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + flattened_params = [ + project, + interconnect_group, + interconnect_groups_create_members_request_resource, + ] + has_flattened_params = ( + len([param for param in flattened_params if param is not None]) > 0 + ) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + # - Use the request object if provided (there's no risk of modifying the input as + # there are no flattened fields), or create one. + if not isinstance(request, compute.CreateMembersInterconnectGroupRequest): + request = compute.CreateMembersInterconnectGroupRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if project is not None: + request.project = project + if interconnect_group is not None: + request.interconnect_group = interconnect_group + if interconnect_groups_create_members_request_resource is not None: + request.interconnect_groups_create_members_request_resource = ( + interconnect_groups_create_members_request_resource + ) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.create_members] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata( + ( + ("project", request.project), + ("interconnect_group", request.interconnect_group), + ) + ), + ) + + # Validate the universe domain. + self._validate_universe_domain() + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + def create_members( + self, + request: Optional[ + Union[compute.CreateMembersInterconnectGroupRequest, dict] + ] = None, + *, + project: Optional[str] = None, + interconnect_group: Optional[str] = None, + interconnect_groups_create_members_request_resource: Optional[ + compute.InterconnectGroupsCreateMembersRequest + ] = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> extended_operation.ExtendedOperation: + r"""Create Interconnects with redundancy by creating them + in a specified interconnect group. + + .. code-block:: python + + # This snippet 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 as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import compute_v1 + + def sample_create_members(): + # Create a client + client = compute_v1.InterconnectGroupsClient() + + # Initialize request argument(s) + request = compute_v1.CreateMembersInterconnectGroupRequest( + interconnect_group="interconnect_group_value", + project="project_value", + ) + + # Make the request + response = client.create_members(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.compute_v1.types.CreateMembersInterconnectGroupRequest, dict]): + The request object. A request message for + InterconnectGroups.CreateMembers. See + the method description for details. + project (str): + Project ID for this request. + This corresponds to the ``project`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + interconnect_group (str): + Name of the group resource to create + members for. + + This corresponds to the ``interconnect_group`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + interconnect_groups_create_members_request_resource (google.cloud.compute_v1.types.InterconnectGroupsCreateMembersRequest): + The body resource for this request + This corresponds to the ``interconnect_groups_create_members_request_resource`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + google.api_core.extended_operation.ExtendedOperation: + An object representing a extended + long-running operation. + + """ + # Create or coerce a protobuf request object. + # - Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + flattened_params = [ + project, + interconnect_group, + interconnect_groups_create_members_request_resource, + ] + has_flattened_params = ( + len([param for param in flattened_params if param is not None]) > 0 + ) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + # - Use the request object if provided (there's no risk of modifying the input as + # there are no flattened fields), or create one. + if not isinstance(request, compute.CreateMembersInterconnectGroupRequest): + request = compute.CreateMembersInterconnectGroupRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if project is not None: + request.project = project + if interconnect_group is not None: + request.interconnect_group = interconnect_group + if interconnect_groups_create_members_request_resource is not None: + request.interconnect_groups_create_members_request_resource = ( + interconnect_groups_create_members_request_resource + ) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.create_members] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata( + ( + ("project", request.project), + ("interconnect_group", request.interconnect_group), + ) + ), + ) + + # Validate the universe domain. + self._validate_universe_domain() + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + operation_service = self._transport._global_operations_client + operation_request = compute.GetGlobalOperationRequest() + operation_request.project = request.project + operation_request.operation = response.name + + get_operation = functools.partial(operation_service.get, operation_request) + # Cancel is not part of extended operations yet. + cancel_operation = lambda: None + + # Note: this class is an implementation detail to provide a uniform + # set of names for certain fields in the extended operation proto message. + # See google.api_core.extended_operation.ExtendedOperation for details + # on these properties and the expected interface. + class _CustomOperation(extended_operation.ExtendedOperation): + @property + def error_message(self): + return self._extended_operation.http_error_message + + @property + def error_code(self): + return self._extended_operation.http_error_status_code + + response = _CustomOperation.make(get_operation, cancel_operation, response) + + # Done; return the response. + return response + + def delete_unary( + self, + request: Optional[Union[compute.DeleteInterconnectGroupRequest, dict]] = None, + *, + project: Optional[str] = None, + interconnect_group: Optional[str] = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> compute.Operation: + r"""Deletes the specified InterconnectGroup in the given + scope + + .. code-block:: python + + # This snippet 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 as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import compute_v1 + + def sample_delete(): + # Create a client + client = compute_v1.InterconnectGroupsClient() + + # Initialize request argument(s) + request = compute_v1.DeleteInterconnectGroupRequest( + interconnect_group="interconnect_group_value", + project="project_value", + ) + + # Make the request + response = client.delete(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.compute_v1.types.DeleteInterconnectGroupRequest, dict]): + The request object. A request message for + InterconnectGroups.Delete. See the + method description for details. + project (str): + Project ID for this request. + This corresponds to the ``project`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + interconnect_group (str): + Name of the InterconnectGroup + resource to delete. + + This corresponds to the ``interconnect_group`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + google.api_core.extended_operation.ExtendedOperation: + An object representing a extended + long-running operation. + + """ + # Create or coerce a protobuf request object. + # - Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + flattened_params = [project, interconnect_group] + has_flattened_params = ( + len([param for param in flattened_params if param is not None]) > 0 + ) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + # - Use the request object if provided (there's no risk of modifying the input as + # there are no flattened fields), or create one. + if not isinstance(request, compute.DeleteInterconnectGroupRequest): + request = compute.DeleteInterconnectGroupRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if project is not None: + request.project = project + if interconnect_group is not None: + request.interconnect_group = interconnect_group + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.delete] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata( + ( + ("project", request.project), + ("interconnect_group", request.interconnect_group), + ) + ), + ) + + # Validate the universe domain. + self._validate_universe_domain() + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + def delete( + self, + request: Optional[Union[compute.DeleteInterconnectGroupRequest, dict]] = None, + *, + project: Optional[str] = None, + interconnect_group: Optional[str] = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> extended_operation.ExtendedOperation: + r"""Deletes the specified InterconnectGroup in the given + scope + + .. code-block:: python + + # This snippet 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 as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import compute_v1 + + def sample_delete(): + # Create a client + client = compute_v1.InterconnectGroupsClient() + + # Initialize request argument(s) + request = compute_v1.DeleteInterconnectGroupRequest( + interconnect_group="interconnect_group_value", + project="project_value", + ) + + # Make the request + response = client.delete(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.compute_v1.types.DeleteInterconnectGroupRequest, dict]): + The request object. A request message for + InterconnectGroups.Delete. See the + method description for details. + project (str): + Project ID for this request. + This corresponds to the ``project`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + interconnect_group (str): + Name of the InterconnectGroup + resource to delete. + + This corresponds to the ``interconnect_group`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + google.api_core.extended_operation.ExtendedOperation: + An object representing a extended + long-running operation. + + """ + # Create or coerce a protobuf request object. + # - Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + flattened_params = [project, interconnect_group] + has_flattened_params = ( + len([param for param in flattened_params if param is not None]) > 0 + ) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + # - Use the request object if provided (there's no risk of modifying the input as + # there are no flattened fields), or create one. + if not isinstance(request, compute.DeleteInterconnectGroupRequest): + request = compute.DeleteInterconnectGroupRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if project is not None: + request.project = project + if interconnect_group is not None: + request.interconnect_group = interconnect_group + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.delete] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata( + ( + ("project", request.project), + ("interconnect_group", request.interconnect_group), + ) + ), + ) + + # Validate the universe domain. + self._validate_universe_domain() + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + operation_service = self._transport._global_operations_client + operation_request = compute.GetGlobalOperationRequest() + operation_request.project = request.project + operation_request.operation = response.name + + get_operation = functools.partial(operation_service.get, operation_request) + # Cancel is not part of extended operations yet. + cancel_operation = lambda: None + + # Note: this class is an implementation detail to provide a uniform + # set of names for certain fields in the extended operation proto message. + # See google.api_core.extended_operation.ExtendedOperation for details + # on these properties and the expected interface. + class _CustomOperation(extended_operation.ExtendedOperation): + @property + def error_message(self): + return self._extended_operation.http_error_message + + @property + def error_code(self): + return self._extended_operation.http_error_status_code + + response = _CustomOperation.make(get_operation, cancel_operation, response) + + # Done; return the response. + return response + + def get( + self, + request: Optional[Union[compute.GetInterconnectGroupRequest, dict]] = None, + *, + project: Optional[str] = None, + interconnect_group: Optional[str] = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> compute.InterconnectGroup: + r"""Returns the specified InterconnectGroup resource in + the given scope. + + .. code-block:: python + + # This snippet 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 as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import compute_v1 + + def sample_get(): + # Create a client + client = compute_v1.InterconnectGroupsClient() + + # Initialize request argument(s) + request = compute_v1.GetInterconnectGroupRequest( + interconnect_group="interconnect_group_value", + project="project_value", + ) + + # Make the request + response = client.get(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.compute_v1.types.GetInterconnectGroupRequest, dict]): + The request object. A request message for + InterconnectGroups.Get. See the method + description for details. + project (str): + Project ID for this request. + This corresponds to the ``project`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + interconnect_group (str): + Name of the InterconnectGroup + resource to return. + + This corresponds to the ``interconnect_group`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + google.cloud.compute_v1.types.InterconnectGroup: + An interconnect group resource allows + customers to create, analyze, and expand + their redundant connections. + + """ + # Create or coerce a protobuf request object. + # - Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + flattened_params = [project, interconnect_group] + has_flattened_params = ( + len([param for param in flattened_params if param is not None]) > 0 + ) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + # - Use the request object if provided (there's no risk of modifying the input as + # there are no flattened fields), or create one. + if not isinstance(request, compute.GetInterconnectGroupRequest): + request = compute.GetInterconnectGroupRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if project is not None: + request.project = project + if interconnect_group is not None: + request.interconnect_group = interconnect_group + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.get] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata( + ( + ("project", request.project), + ("interconnect_group", request.interconnect_group), + ) + ), + ) + + # Validate the universe domain. + self._validate_universe_domain() + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + def get_iam_policy( + self, + request: Optional[ + Union[compute.GetIamPolicyInterconnectGroupRequest, dict] + ] = None, + *, + project: Optional[str] = None, + resource: Optional[str] = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> compute.Policy: + r"""Gets the access control policy for a resource. May be + empty if no such policy or resource exists. + + .. code-block:: python + + # This snippet 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 as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import compute_v1 + + def sample_get_iam_policy(): + # Create a client + client = compute_v1.InterconnectGroupsClient() + + # Initialize request argument(s) + request = compute_v1.GetIamPolicyInterconnectGroupRequest( + project="project_value", + resource="resource_value", + ) + + # Make the request + response = client.get_iam_policy(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.compute_v1.types.GetIamPolicyInterconnectGroupRequest, dict]): + The request object. A request message for + InterconnectGroups.GetIamPolicy. See the + method description for details. + project (str): + Project ID for this request. + This corresponds to the ``project`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + resource (str): + Name or id of the resource for this + request. + + This corresponds to the ``resource`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + google.cloud.compute_v1.types.Policy: + An Identity and Access Management (IAM) policy, which + specifies access controls for Google Cloud resources. A + Policy is a collection of bindings. A binding binds one + or more members, or principals, to a single role. + Principals can be user accounts, service accounts, + Google groups, and domains (such as G Suite). A role is + a named list of permissions; each role can be an IAM + predefined role or a user-created custom role. For some + types of Google Cloud resources, a binding can also + specify a condition, which is a logical expression that + allows access to a resource only if the expression + evaluates to true. A condition can add constraints based + on attributes of the request, the resource, or both. To + learn which resources support conditions in their IAM + policies, see the [IAM + documentation](\ https://cloud.google.com/iam/help/conditions/resource-policies). + **JSON example:** + :literal:`\` { "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": [ "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": "BwWWja0YfJA=", "version": 3 }`\ \` + **YAML example:** + :literal:`\` bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3`\ \` + For a description of IAM and its features, see the [IAM + documentation](\ https://cloud.google.com/iam/docs/). + + """ + # Create or coerce a protobuf request object. + # - Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + flattened_params = [project, resource] + has_flattened_params = ( + len([param for param in flattened_params if param is not None]) > 0 + ) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + # - Use the request object if provided (there's no risk of modifying the input as + # there are no flattened fields), or create one. + if not isinstance(request, compute.GetIamPolicyInterconnectGroupRequest): + request = compute.GetIamPolicyInterconnectGroupRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if project is not None: + request.project = project + if resource is not None: + request.resource = resource + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.get_iam_policy] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata( + ( + ("project", request.project), + ("resource", request.resource), + ) + ), + ) + + # Validate the universe domain. + self._validate_universe_domain() + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + def get_operational_status( + self, + request: Optional[ + Union[compute.GetOperationalStatusInterconnectGroupRequest, dict] + ] = None, + *, + project: Optional[str] = None, + interconnect_group: Optional[str] = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> compute.InterconnectGroupsGetOperationalStatusResponse: + r"""Returns the interconnectStatuses for the specified + InterconnectGroup. + + .. code-block:: python + + # This snippet 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 as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import compute_v1 + + def sample_get_operational_status(): + # Create a client + client = compute_v1.InterconnectGroupsClient() + + # Initialize request argument(s) + request = compute_v1.GetOperationalStatusInterconnectGroupRequest( + interconnect_group="interconnect_group_value", + project="project_value", + ) + + # Make the request + response = client.get_operational_status(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.compute_v1.types.GetOperationalStatusInterconnectGroupRequest, dict]): + The request object. A request message for + InterconnectGroups.GetOperationalStatus. + See the method description for details. + project (str): + Project ID for this request. + This corresponds to the ``project`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + interconnect_group (str): + Name of the interconnectGroup + resource to query. + + This corresponds to the ``interconnect_group`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + google.cloud.compute_v1.types.InterconnectGroupsGetOperationalStatusResponse: + Response for the + InterconnectGroupsGetOperationalStatusResponse. + + """ + # Create or coerce a protobuf request object. + # - Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + flattened_params = [project, interconnect_group] + has_flattened_params = ( + len([param for param in flattened_params if param is not None]) > 0 + ) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + # - Use the request object if provided (there's no risk of modifying the input as + # there are no flattened fields), or create one. + if not isinstance( + request, compute.GetOperationalStatusInterconnectGroupRequest + ): + request = compute.GetOperationalStatusInterconnectGroupRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if project is not None: + request.project = project + if interconnect_group is not None: + request.interconnect_group = interconnect_group + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.get_operational_status] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata( + ( + ("project", request.project), + ("interconnect_group", request.interconnect_group), + ) + ), + ) + + # Validate the universe domain. + self._validate_universe_domain() + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + def insert_unary( + self, + request: Optional[Union[compute.InsertInterconnectGroupRequest, dict]] = None, + *, + project: Optional[str] = None, + interconnect_group_resource: Optional[compute.InterconnectGroup] = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> compute.Operation: + r"""Creates a InterconnectGroup in the specified project + in the given scope using the parameters that are + included in the request. + + .. code-block:: python + + # This snippet 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 as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import compute_v1 + + def sample_insert(): + # Create a client + client = compute_v1.InterconnectGroupsClient() + + # Initialize request argument(s) + request = compute_v1.InsertInterconnectGroupRequest( + project="project_value", + ) + + # Make the request + response = client.insert(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.compute_v1.types.InsertInterconnectGroupRequest, dict]): + The request object. A request message for + InterconnectGroups.Insert. See the + method description for details. + project (str): + Project ID for this request. + This corresponds to the ``project`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + interconnect_group_resource (google.cloud.compute_v1.types.InterconnectGroup): + The body resource for this request + This corresponds to the ``interconnect_group_resource`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + google.api_core.extended_operation.ExtendedOperation: + An object representing a extended + long-running operation. + + """ + # Create or coerce a protobuf request object. + # - Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + flattened_params = [project, interconnect_group_resource] + has_flattened_params = ( + len([param for param in flattened_params if param is not None]) > 0 + ) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + # - Use the request object if provided (there's no risk of modifying the input as + # there are no flattened fields), or create one. + if not isinstance(request, compute.InsertInterconnectGroupRequest): + request = compute.InsertInterconnectGroupRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if project is not None: + request.project = project + if interconnect_group_resource is not None: + request.interconnect_group_resource = interconnect_group_resource + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.insert] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("project", request.project),)), + ) + + # Validate the universe domain. + self._validate_universe_domain() + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + def insert( + self, + request: Optional[Union[compute.InsertInterconnectGroupRequest, dict]] = None, + *, + project: Optional[str] = None, + interconnect_group_resource: Optional[compute.InterconnectGroup] = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> extended_operation.ExtendedOperation: + r"""Creates a InterconnectGroup in the specified project + in the given scope using the parameters that are + included in the request. + + .. code-block:: python + + # This snippet 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 as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import compute_v1 + + def sample_insert(): + # Create a client + client = compute_v1.InterconnectGroupsClient() + + # Initialize request argument(s) + request = compute_v1.InsertInterconnectGroupRequest( + project="project_value", + ) + + # Make the request + response = client.insert(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.compute_v1.types.InsertInterconnectGroupRequest, dict]): + The request object. A request message for + InterconnectGroups.Insert. See the + method description for details. + project (str): + Project ID for this request. + This corresponds to the ``project`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + interconnect_group_resource (google.cloud.compute_v1.types.InterconnectGroup): + The body resource for this request + This corresponds to the ``interconnect_group_resource`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + google.api_core.extended_operation.ExtendedOperation: + An object representing a extended + long-running operation. + + """ + # Create or coerce a protobuf request object. + # - Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + flattened_params = [project, interconnect_group_resource] + has_flattened_params = ( + len([param for param in flattened_params if param is not None]) > 0 + ) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + # - Use the request object if provided (there's no risk of modifying the input as + # there are no flattened fields), or create one. + if not isinstance(request, compute.InsertInterconnectGroupRequest): + request = compute.InsertInterconnectGroupRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if project is not None: + request.project = project + if interconnect_group_resource is not None: + request.interconnect_group_resource = interconnect_group_resource + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.insert] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("project", request.project),)), + ) + + # Validate the universe domain. + self._validate_universe_domain() + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + operation_service = self._transport._global_operations_client + operation_request = compute.GetGlobalOperationRequest() + operation_request.project = request.project + operation_request.operation = response.name + + get_operation = functools.partial(operation_service.get, operation_request) + # Cancel is not part of extended operations yet. + cancel_operation = lambda: None + + # Note: this class is an implementation detail to provide a uniform + # set of names for certain fields in the extended operation proto message. + # See google.api_core.extended_operation.ExtendedOperation for details + # on these properties and the expected interface. + class _CustomOperation(extended_operation.ExtendedOperation): + @property + def error_message(self): + return self._extended_operation.http_error_message + + @property + def error_code(self): + return self._extended_operation.http_error_status_code + + response = _CustomOperation.make(get_operation, cancel_operation, response) + + # Done; return the response. + return response + + def list( + self, + request: Optional[Union[compute.ListInterconnectGroupsRequest, dict]] = None, + *, + project: Optional[str] = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> pagers.ListPager: + r"""Lists the InterconnectGroups for a project in the + given scope. + + .. code-block:: python + + # This snippet 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 as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import compute_v1 + + def sample_list(): + # Create a client + client = compute_v1.InterconnectGroupsClient() + + # Initialize request argument(s) + request = compute_v1.ListInterconnectGroupsRequest( + project="project_value", + ) + + # Make the request + page_result = client.list(request=request) + + # Handle the response + for response in page_result: + print(response) + + Args: + request (Union[google.cloud.compute_v1.types.ListInterconnectGroupsRequest, dict]): + The request object. A request message for + InterconnectGroups.List. See the method + description for details. + project (str): + Project ID for this request. + This corresponds to the ``project`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + google.cloud.compute_v1.services.interconnect_groups.pagers.ListPager: + Iterating over this object will yield + results and resolve additional pages + automatically. + + """ + # Create or coerce a protobuf request object. + # - Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + flattened_params = [project] + has_flattened_params = ( + len([param for param in flattened_params if param is not None]) > 0 + ) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + # - Use the request object if provided (there's no risk of modifying the input as + # there are no flattened fields), or create one. + if not isinstance(request, compute.ListInterconnectGroupsRequest): + request = compute.ListInterconnectGroupsRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if project is not None: + request.project = project + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.list] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("project", request.project),)), + ) + + # Validate the universe domain. + self._validate_universe_domain() + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # This method is paged; wrap the response in a pager, which provides + # an `__iter__` convenience method. + response = pagers.ListPager( + method=rpc, + request=request, + response=response, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + def patch_unary( + self, + request: Optional[Union[compute.PatchInterconnectGroupRequest, dict]] = None, + *, + project: Optional[str] = None, + interconnect_group: Optional[str] = None, + interconnect_group_resource: Optional[compute.InterconnectGroup] = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> compute.Operation: + r"""Patches the specified InterconnectGroup resource with + the data included in the request. This method supports + PATCH semantics and uses JSON merge patch format and + processing rules. + + .. code-block:: python + + # This snippet 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 as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import compute_v1 + + def sample_patch(): + # Create a client + client = compute_v1.InterconnectGroupsClient() + + # Initialize request argument(s) + request = compute_v1.PatchInterconnectGroupRequest( + interconnect_group="interconnect_group_value", + project="project_value", + ) + + # Make the request + response = client.patch(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.compute_v1.types.PatchInterconnectGroupRequest, dict]): + The request object. A request message for + InterconnectGroups.Patch. See the method + description for details. + project (str): + Project ID for this request. + This corresponds to the ``project`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + interconnect_group (str): + Name of the InterconnectGroup + resource to patch. + + This corresponds to the ``interconnect_group`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + interconnect_group_resource (google.cloud.compute_v1.types.InterconnectGroup): + The body resource for this request + This corresponds to the ``interconnect_group_resource`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + google.api_core.extended_operation.ExtendedOperation: + An object representing a extended + long-running operation. + + """ + # Create or coerce a protobuf request object. + # - Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + flattened_params = [project, interconnect_group, interconnect_group_resource] + has_flattened_params = ( + len([param for param in flattened_params if param is not None]) > 0 + ) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + # - Use the request object if provided (there's no risk of modifying the input as + # there are no flattened fields), or create one. + if not isinstance(request, compute.PatchInterconnectGroupRequest): + request = compute.PatchInterconnectGroupRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if project is not None: + request.project = project + if interconnect_group is not None: + request.interconnect_group = interconnect_group + if interconnect_group_resource is not None: + request.interconnect_group_resource = interconnect_group_resource + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.patch] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata( + ( + ("project", request.project), + ("interconnect_group", request.interconnect_group), + ) + ), + ) + + # Validate the universe domain. + self._validate_universe_domain() + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + def patch( + self, + request: Optional[Union[compute.PatchInterconnectGroupRequest, dict]] = None, + *, + project: Optional[str] = None, + interconnect_group: Optional[str] = None, + interconnect_group_resource: Optional[compute.InterconnectGroup] = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> extended_operation.ExtendedOperation: + r"""Patches the specified InterconnectGroup resource with + the data included in the request. This method supports + PATCH semantics and uses JSON merge patch format and + processing rules. + + .. code-block:: python + + # This snippet 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 as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import compute_v1 + + def sample_patch(): + # Create a client + client = compute_v1.InterconnectGroupsClient() + + # Initialize request argument(s) + request = compute_v1.PatchInterconnectGroupRequest( + interconnect_group="interconnect_group_value", + project="project_value", + ) + + # Make the request + response = client.patch(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.compute_v1.types.PatchInterconnectGroupRequest, dict]): + The request object. A request message for + InterconnectGroups.Patch. See the method + description for details. + project (str): + Project ID for this request. + This corresponds to the ``project`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + interconnect_group (str): + Name of the InterconnectGroup + resource to patch. + + This corresponds to the ``interconnect_group`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + interconnect_group_resource (google.cloud.compute_v1.types.InterconnectGroup): + The body resource for this request + This corresponds to the ``interconnect_group_resource`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + google.api_core.extended_operation.ExtendedOperation: + An object representing a extended + long-running operation. + + """ + # Create or coerce a protobuf request object. + # - Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + flattened_params = [project, interconnect_group, interconnect_group_resource] + has_flattened_params = ( + len([param for param in flattened_params if param is not None]) > 0 + ) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + # - Use the request object if provided (there's no risk of modifying the input as + # there are no flattened fields), or create one. + if not isinstance(request, compute.PatchInterconnectGroupRequest): + request = compute.PatchInterconnectGroupRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if project is not None: + request.project = project + if interconnect_group is not None: + request.interconnect_group = interconnect_group + if interconnect_group_resource is not None: + request.interconnect_group_resource = interconnect_group_resource + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.patch] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata( + ( + ("project", request.project), + ("interconnect_group", request.interconnect_group), + ) + ), + ) + + # Validate the universe domain. + self._validate_universe_domain() + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + operation_service = self._transport._global_operations_client + operation_request = compute.GetGlobalOperationRequest() + operation_request.project = request.project + operation_request.operation = response.name + + get_operation = functools.partial(operation_service.get, operation_request) + # Cancel is not part of extended operations yet. + cancel_operation = lambda: None + + # Note: this class is an implementation detail to provide a uniform + # set of names for certain fields in the extended operation proto message. + # See google.api_core.extended_operation.ExtendedOperation for details + # on these properties and the expected interface. + class _CustomOperation(extended_operation.ExtendedOperation): + @property + def error_message(self): + return self._extended_operation.http_error_message + + @property + def error_code(self): + return self._extended_operation.http_error_status_code + + response = _CustomOperation.make(get_operation, cancel_operation, response) + + # Done; return the response. + return response + + def set_iam_policy( + self, + request: Optional[ + Union[compute.SetIamPolicyInterconnectGroupRequest, dict] + ] = None, + *, + project: Optional[str] = None, + resource: Optional[str] = None, + global_set_policy_request_resource: Optional[ + compute.GlobalSetPolicyRequest + ] = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> compute.Policy: + r"""Sets the access control policy on the specified + resource. Replaces any existing policy. + + .. code-block:: python + + # This snippet 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 as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import compute_v1 + + def sample_set_iam_policy(): + # Create a client + client = compute_v1.InterconnectGroupsClient() + + # Initialize request argument(s) + request = compute_v1.SetIamPolicyInterconnectGroupRequest( + project="project_value", + resource="resource_value", + ) + + # Make the request + response = client.set_iam_policy(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.compute_v1.types.SetIamPolicyInterconnectGroupRequest, dict]): + The request object. A request message for + InterconnectGroups.SetIamPolicy. See the + method description for details. + project (str): + Project ID for this request. + This corresponds to the ``project`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + resource (str): + Name or id of the resource for this + request. + + This corresponds to the ``resource`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + global_set_policy_request_resource (google.cloud.compute_v1.types.GlobalSetPolicyRequest): + The body resource for this request + This corresponds to the ``global_set_policy_request_resource`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + google.cloud.compute_v1.types.Policy: + An Identity and Access Management (IAM) policy, which + specifies access controls for Google Cloud resources. A + Policy is a collection of bindings. A binding binds one + or more members, or principals, to a single role. + Principals can be user accounts, service accounts, + Google groups, and domains (such as G Suite). A role is + a named list of permissions; each role can be an IAM + predefined role or a user-created custom role. For some + types of Google Cloud resources, a binding can also + specify a condition, which is a logical expression that + allows access to a resource only if the expression + evaluates to true. A condition can add constraints based + on attributes of the request, the resource, or both. To + learn which resources support conditions in their IAM + policies, see the [IAM + documentation](\ https://cloud.google.com/iam/help/conditions/resource-policies). + **JSON example:** + :literal:`\` { "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": [ "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": "BwWWja0YfJA=", "version": 3 }`\ \` + **YAML example:** + :literal:`\` bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3`\ \` + For a description of IAM and its features, see the [IAM + documentation](\ https://cloud.google.com/iam/docs/). + + """ + # Create or coerce a protobuf request object. + # - Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + flattened_params = [project, resource, global_set_policy_request_resource] + has_flattened_params = ( + len([param for param in flattened_params if param is not None]) > 0 + ) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + # - Use the request object if provided (there's no risk of modifying the input as + # there are no flattened fields), or create one. + if not isinstance(request, compute.SetIamPolicyInterconnectGroupRequest): + request = compute.SetIamPolicyInterconnectGroupRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if project is not None: + request.project = project + if resource is not None: + request.resource = resource + if global_set_policy_request_resource is not None: + request.global_set_policy_request_resource = ( + global_set_policy_request_resource + ) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.set_iam_policy] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata( + ( + ("project", request.project), + ("resource", request.resource), + ) + ), + ) + + # Validate the universe domain. + self._validate_universe_domain() + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + def test_iam_permissions( + self, + request: Optional[ + Union[compute.TestIamPermissionsInterconnectGroupRequest, dict] + ] = None, + *, + project: Optional[str] = None, + resource: Optional[str] = None, + test_permissions_request_resource: Optional[ + compute.TestPermissionsRequest + ] = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> compute.TestPermissionsResponse: + r"""Returns permissions that a caller has on the + specified resource. + + .. code-block:: python + + # This snippet 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 as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import compute_v1 + + def sample_test_iam_permissions(): + # Create a client + client = compute_v1.InterconnectGroupsClient() + + # Initialize request argument(s) + request = compute_v1.TestIamPermissionsInterconnectGroupRequest( + project="project_value", + resource="resource_value", + ) + + # Make the request + response = client.test_iam_permissions(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.compute_v1.types.TestIamPermissionsInterconnectGroupRequest, dict]): + The request object. A request message for + InterconnectGroups.TestIamPermissions. + See the method description for details. + project (str): + Project ID for this request. + This corresponds to the ``project`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + resource (str): + Name or id of the resource for this + request. + + This corresponds to the ``resource`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + test_permissions_request_resource (google.cloud.compute_v1.types.TestPermissionsRequest): + The body resource for this request + This corresponds to the ``test_permissions_request_resource`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + google.cloud.compute_v1.types.TestPermissionsResponse: + + """ + # Create or coerce a protobuf request object. + # - Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + flattened_params = [project, resource, test_permissions_request_resource] + has_flattened_params = ( + len([param for param in flattened_params if param is not None]) > 0 + ) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + # - Use the request object if provided (there's no risk of modifying the input as + # there are no flattened fields), or create one. + if not isinstance(request, compute.TestIamPermissionsInterconnectGroupRequest): + request = compute.TestIamPermissionsInterconnectGroupRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if project is not None: + request.project = project + if resource is not None: + request.resource = resource + if test_permissions_request_resource is not None: + request.test_permissions_request_resource = ( + test_permissions_request_resource + ) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.test_iam_permissions] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata( + ( + ("project", request.project), + ("resource", request.resource), + ) + ), + ) + + # Validate the universe domain. + self._validate_universe_domain() + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + def __enter__(self) -> "InterconnectGroupsClient": + return self + + def __exit__(self, type, value, traceback): + """Releases underlying transport's resources. + + .. warning:: + ONLY use as a context manager if the transport is NOT shared + with other clients! Exiting the with block will CLOSE the transport + and may cause errors in other clients! + """ + self.transport.close() + + +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) + +if hasattr(DEFAULT_CLIENT_INFO, "protobuf_runtime_version"): # pragma: NO COVER + DEFAULT_CLIENT_INFO.protobuf_runtime_version = google.protobuf.__version__ + +__all__ = ("InterconnectGroupsClient",) diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/interconnect_groups/pagers.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/interconnect_groups/pagers.py new file mode 100644 index 000000000000..f5a2659d8487 --- /dev/null +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/interconnect_groups/pagers.py @@ -0,0 +1,117 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from typing import ( + Any, + AsyncIterator, + Awaitable, + Callable, + Iterator, + Optional, + Sequence, + Tuple, + Union, +) + +from google.api_core import gapic_v1 +from google.api_core import retry as retries +from google.api_core import retry_async as retries_async + +try: + OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault, None] + OptionalAsyncRetry = Union[ + retries_async.AsyncRetry, gapic_v1.method._MethodDefault, None + ] +except AttributeError: # pragma: NO COVER + OptionalRetry = Union[retries.Retry, object, None] # type: ignore + OptionalAsyncRetry = Union[retries_async.AsyncRetry, object, None] # type: ignore + +from google.cloud.compute_v1.types import compute + + +class ListPager: + """A pager for iterating through ``list`` requests. + + This class thinly wraps an initial + :class:`google.cloud.compute_v1.types.InterconnectGroupsListResponse` object, and + provides an ``__iter__`` method to iterate through its + ``items`` field. + + If there are more pages, the ``__iter__`` method will make additional + ``List`` requests and continue to iterate + through the ``items`` field on the + corresponding responses. + + All the usual :class:`google.cloud.compute_v1.types.InterconnectGroupsListResponse` + attributes are available on the pager. If multiple requests are made, only + the most recent response is retained, and thus used for attribute lookup. + """ + + def __init__( + self, + method: Callable[..., compute.InterconnectGroupsListResponse], + request: compute.ListInterconnectGroupsRequest, + response: compute.InterconnectGroupsListResponse, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = () + ): + """Instantiate the pager. + + Args: + method (Callable): The method that was originally called, and + which instantiated this pager. + request (google.cloud.compute_v1.types.ListInterconnectGroupsRequest): + The initial request object. + response (google.cloud.compute_v1.types.InterconnectGroupsListResponse): + The initial response object. + retry (google.api_core.retry.Retry): Designation of what errors, + if any, should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + """ + self._method = method + self._request = compute.ListInterconnectGroupsRequest(request) + self._response = response + self._retry = retry + self._timeout = timeout + self._metadata = metadata + + def __getattr__(self, name: str) -> Any: + return getattr(self._response, name) + + @property + def pages(self) -> Iterator[compute.InterconnectGroupsListResponse]: + yield self._response + while self._response.next_page_token: + self._request.page_token = self._response.next_page_token + self._response = self._method( + self._request, + retry=self._retry, + timeout=self._timeout, + metadata=self._metadata, + ) + yield self._response + + def __iter__(self) -> Iterator[compute.InterconnectGroup]: + for page in self.pages: + yield from page.items + + def __repr__(self) -> str: + return "{0}<{1!r}>".format(self.__class__.__name__, self._response) diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/interconnect_groups/transports/README.rst b/packages/google-cloud-compute/google/cloud/compute_v1/services/interconnect_groups/transports/README.rst new file mode 100644 index 000000000000..aff13520eab7 --- /dev/null +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/interconnect_groups/transports/README.rst @@ -0,0 +1,9 @@ + +transport inheritance structure +_______________________________ + +`InterconnectGroupsTransport` is the ABC for all transports. +- public child `InterconnectGroupsGrpcTransport` for sync gRPC transport (defined in `grpc.py`). +- public child `InterconnectGroupsGrpcAsyncIOTransport` for async gRPC transport (defined in `grpc_asyncio.py`). +- private child `_BaseInterconnectGroupsRestTransport` for base REST transport with inner classes `_BaseMETHOD` (defined in `rest_base.py`). +- public child `InterconnectGroupsRestTransport` for sync REST transport with inner classes `METHOD` derived from the parent's corresponding `_BaseMETHOD` classes (defined in `rest.py`). diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/interconnect_groups/transports/__init__.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/interconnect_groups/transports/__init__.py new file mode 100644 index 000000000000..c12b274fcacb --- /dev/null +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/interconnect_groups/transports/__init__.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from collections import OrderedDict +from typing import Dict, Type + +from .base import InterconnectGroupsTransport +from .rest import InterconnectGroupsRestInterceptor, InterconnectGroupsRestTransport + +# Compile a registry of transports. +_transport_registry = ( + OrderedDict() +) # type: Dict[str, Type[InterconnectGroupsTransport]] +_transport_registry["rest"] = InterconnectGroupsRestTransport + +__all__ = ( + "InterconnectGroupsTransport", + "InterconnectGroupsRestTransport", + "InterconnectGroupsRestInterceptor", +) diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/interconnect_groups/transports/base.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/interconnect_groups/transports/base.py new file mode 100644 index 000000000000..24e0f10e24a9 --- /dev/null +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/interconnect_groups/transports/base.py @@ -0,0 +1,316 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +import abc +from typing import Awaitable, Callable, Dict, Optional, Sequence, Union + +import google.api_core +from google.api_core import exceptions as core_exceptions +from google.api_core import gapic_v1 +from google.api_core import retry as retries +import google.auth # type: ignore +from google.auth import credentials as ga_credentials # type: ignore +from google.oauth2 import service_account # type: ignore +import google.protobuf + +from google.cloud.compute_v1 import gapic_version as package_version +from google.cloud.compute_v1.services import global_operations +from google.cloud.compute_v1.types import compute + +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) + +if hasattr(DEFAULT_CLIENT_INFO, "protobuf_runtime_version"): # pragma: NO COVER + DEFAULT_CLIENT_INFO.protobuf_runtime_version = google.protobuf.__version__ + + +class InterconnectGroupsTransport(abc.ABC): + """Abstract transport class for InterconnectGroups.""" + + AUTH_SCOPES = ( + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/cloud-platform", + ) + + DEFAULT_HOST: str = "compute.googleapis.com" + + def __init__( + self, + *, + host: str = DEFAULT_HOST, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, + scopes: Optional[Sequence[str]] = None, + quota_project_id: Optional[str] = None, + client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, + always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, + **kwargs, + ) -> None: + """Instantiate the transport. + + Args: + host (Optional[str]): + The hostname to connect to (default: 'compute.googleapis.com'). + credentials (Optional[google.auth.credentials.Credentials]): The + authorization credentials to attach to requests. These + credentials identify the application to the service; if none + are specified, the client will attempt to ascertain the + credentials from the environment. + credentials_file (Optional[str]): A file with credentials that can + be loaded with :func:`google.auth.load_credentials_from_file`. + This argument is mutually exclusive with credentials. + scopes (Optional[Sequence[str]]): A list of scopes. + quota_project_id (Optional[str]): An optional project to use for billing + and quota. + client_info (google.api_core.gapic_v1.client_info.ClientInfo): + The client info used to send a user-agent string along with + API requests. If ``None``, then default info will be used. + Generally, you only need to set this if you're developing + your own client library. + always_use_jwt_access (Optional[bool]): Whether self signed JWT should + be used for service account credentials. + """ + self._extended_operations_services: Dict[str, Any] = {} + + scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} + + # Save the scopes. + self._scopes = scopes + if not hasattr(self, "_ignore_credentials"): + self._ignore_credentials: bool = False + + # If no credentials are provided, then determine the appropriate + # defaults. + if credentials and credentials_file: + raise core_exceptions.DuplicateCredentialArgs( + "'credentials_file' and 'credentials' are mutually exclusive" + ) + + if credentials_file is not None: + credentials, _ = google.auth.load_credentials_from_file( + credentials_file, **scopes_kwargs, quota_project_id=quota_project_id + ) + elif credentials is None and not self._ignore_credentials: + credentials, _ = google.auth.default( + **scopes_kwargs, quota_project_id=quota_project_id + ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) + + # If the credentials are service account credentials, then always try to use self signed JWT. + if ( + always_use_jwt_access + and isinstance(credentials, service_account.Credentials) + and hasattr(service_account.Credentials, "with_always_use_jwt_access") + ): + credentials = credentials.with_always_use_jwt_access(True) + + # Save the credentials. + self._credentials = credentials + + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + + @property + def host(self): + return self._host + + def _prep_wrapped_messages(self, client_info): + # Precompute the wrapped methods. + self._wrapped_methods = { + self.create_members: gapic_v1.method.wrap_method( + self.create_members, + default_timeout=None, + client_info=client_info, + ), + self.delete: gapic_v1.method.wrap_method( + self.delete, + default_timeout=None, + client_info=client_info, + ), + self.get: gapic_v1.method.wrap_method( + self.get, + default_timeout=None, + client_info=client_info, + ), + self.get_iam_policy: gapic_v1.method.wrap_method( + self.get_iam_policy, + default_timeout=None, + client_info=client_info, + ), + self.get_operational_status: gapic_v1.method.wrap_method( + self.get_operational_status, + default_timeout=None, + client_info=client_info, + ), + self.insert: gapic_v1.method.wrap_method( + self.insert, + default_timeout=None, + client_info=client_info, + ), + self.list: gapic_v1.method.wrap_method( + self.list, + default_timeout=None, + client_info=client_info, + ), + self.patch: gapic_v1.method.wrap_method( + self.patch, + default_timeout=None, + client_info=client_info, + ), + self.set_iam_policy: gapic_v1.method.wrap_method( + self.set_iam_policy, + default_timeout=None, + client_info=client_info, + ), + self.test_iam_permissions: gapic_v1.method.wrap_method( + self.test_iam_permissions, + default_timeout=None, + client_info=client_info, + ), + } + + def close(self): + """Closes resources associated with the transport. + + .. warning:: + Only call this method if the transport is NOT shared + with other clients - this may cause errors in other clients! + """ + raise NotImplementedError() + + @property + def create_members( + self, + ) -> Callable[ + [compute.CreateMembersInterconnectGroupRequest], + Union[compute.Operation, Awaitable[compute.Operation]], + ]: + raise NotImplementedError() + + @property + def delete( + self, + ) -> Callable[ + [compute.DeleteInterconnectGroupRequest], + Union[compute.Operation, Awaitable[compute.Operation]], + ]: + raise NotImplementedError() + + @property + def get( + self, + ) -> Callable[ + [compute.GetInterconnectGroupRequest], + Union[compute.InterconnectGroup, Awaitable[compute.InterconnectGroup]], + ]: + raise NotImplementedError() + + @property + def get_iam_policy( + self, + ) -> Callable[ + [compute.GetIamPolicyInterconnectGroupRequest], + Union[compute.Policy, Awaitable[compute.Policy]], + ]: + raise NotImplementedError() + + @property + def get_operational_status( + self, + ) -> Callable[ + [compute.GetOperationalStatusInterconnectGroupRequest], + Union[ + compute.InterconnectGroupsGetOperationalStatusResponse, + Awaitable[compute.InterconnectGroupsGetOperationalStatusResponse], + ], + ]: + raise NotImplementedError() + + @property + def insert( + self, + ) -> Callable[ + [compute.InsertInterconnectGroupRequest], + Union[compute.Operation, Awaitable[compute.Operation]], + ]: + raise NotImplementedError() + + @property + def list( + self, + ) -> Callable[ + [compute.ListInterconnectGroupsRequest], + Union[ + compute.InterconnectGroupsListResponse, + Awaitable[compute.InterconnectGroupsListResponse], + ], + ]: + raise NotImplementedError() + + @property + def patch( + self, + ) -> Callable[ + [compute.PatchInterconnectGroupRequest], + Union[compute.Operation, Awaitable[compute.Operation]], + ]: + raise NotImplementedError() + + @property + def set_iam_policy( + self, + ) -> Callable[ + [compute.SetIamPolicyInterconnectGroupRequest], + Union[compute.Policy, Awaitable[compute.Policy]], + ]: + raise NotImplementedError() + + @property + def test_iam_permissions( + self, + ) -> Callable[ + [compute.TestIamPermissionsInterconnectGroupRequest], + Union[ + compute.TestPermissionsResponse, Awaitable[compute.TestPermissionsResponse] + ], + ]: + raise NotImplementedError() + + @property + def kind(self) -> str: + raise NotImplementedError() + + @property + def _global_operations_client(self) -> global_operations.GlobalOperationsClient: + ex_op_service = self._extended_operations_services.get("global_operations") + if not ex_op_service: + ex_op_service = global_operations.GlobalOperationsClient( + credentials=self._credentials, + transport=self.kind, + ) + self._extended_operations_services["global_operations"] = ex_op_service + + return ex_op_service + + +__all__ = ("InterconnectGroupsTransport",) diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/interconnect_groups/transports/rest.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/interconnect_groups/transports/rest.py new file mode 100644 index 000000000000..d544617605d5 --- /dev/null +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/interconnect_groups/transports/rest.py @@ -0,0 +1,2472 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +import dataclasses +import json # type: ignore +import logging +from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple, Union +import warnings + +from google.api_core import exceptions as core_exceptions +from google.api_core import gapic_v1, rest_helpers, rest_streaming +from google.api_core import retry as retries +from google.auth import credentials as ga_credentials # type: ignore +from google.auth.transport.requests import AuthorizedSession # type: ignore +import google.protobuf +from google.protobuf import json_format +from requests import __version__ as requests_version + +from google.cloud.compute_v1.types import compute + +from .base import DEFAULT_CLIENT_INFO as BASE_DEFAULT_CLIENT_INFO +from .rest_base import _BaseInterconnectGroupsRestTransport + +try: + OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault, None] +except AttributeError: # pragma: NO COVER + OptionalRetry = Union[retries.Retry, object, None] # type: ignore + +try: + from google.api_core import client_logging # type: ignore + + CLIENT_LOGGING_SUPPORTED = True # pragma: NO COVER +except ImportError: # pragma: NO COVER + CLIENT_LOGGING_SUPPORTED = False + +_LOGGER = logging.getLogger(__name__) + +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=BASE_DEFAULT_CLIENT_INFO.gapic_version, + grpc_version=None, + rest_version=f"requests@{requests_version}", +) + +if hasattr(DEFAULT_CLIENT_INFO, "protobuf_runtime_version"): # pragma: NO COVER + DEFAULT_CLIENT_INFO.protobuf_runtime_version = google.protobuf.__version__ + + +class InterconnectGroupsRestInterceptor: + """Interceptor for InterconnectGroups. + + Interceptors are used to manipulate requests, request metadata, and responses + in arbitrary ways. + Example use cases include: + * Logging + * Verifying requests according to service or custom semantics + * Stripping extraneous information from responses + + These use cases and more can be enabled by injecting an + instance of a custom subclass when constructing the InterconnectGroupsRestTransport. + + .. code-block:: python + class MyCustomInterconnectGroupsInterceptor(InterconnectGroupsRestInterceptor): + def pre_create_members(self, request, metadata): + logging.log(f"Received request: {request}") + return request, metadata + + def post_create_members(self, response): + logging.log(f"Received response: {response}") + return response + + def pre_delete(self, request, metadata): + logging.log(f"Received request: {request}") + return request, metadata + + def post_delete(self, response): + logging.log(f"Received response: {response}") + return response + + def pre_get(self, request, metadata): + logging.log(f"Received request: {request}") + return request, metadata + + def post_get(self, response): + logging.log(f"Received response: {response}") + return response + + def pre_get_iam_policy(self, request, metadata): + logging.log(f"Received request: {request}") + return request, metadata + + def post_get_iam_policy(self, response): + logging.log(f"Received response: {response}") + return response + + def pre_get_operational_status(self, request, metadata): + logging.log(f"Received request: {request}") + return request, metadata + + def post_get_operational_status(self, response): + logging.log(f"Received response: {response}") + return response + + def pre_insert(self, request, metadata): + logging.log(f"Received request: {request}") + return request, metadata + + def post_insert(self, response): + logging.log(f"Received response: {response}") + return response + + def pre_list(self, request, metadata): + logging.log(f"Received request: {request}") + return request, metadata + + def post_list(self, response): + logging.log(f"Received response: {response}") + return response + + def pre_patch(self, request, metadata): + logging.log(f"Received request: {request}") + return request, metadata + + def post_patch(self, response): + logging.log(f"Received response: {response}") + return response + + def pre_set_iam_policy(self, request, metadata): + logging.log(f"Received request: {request}") + return request, metadata + + def post_set_iam_policy(self, response): + logging.log(f"Received response: {response}") + return response + + def pre_test_iam_permissions(self, request, metadata): + logging.log(f"Received request: {request}") + return request, metadata + + def post_test_iam_permissions(self, response): + logging.log(f"Received response: {response}") + return response + + transport = InterconnectGroupsRestTransport(interceptor=MyCustomInterconnectGroupsInterceptor()) + client = InterconnectGroupsClient(transport=transport) + + + """ + + def pre_create_members( + self, + request: compute.CreateMembersInterconnectGroupRequest, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + compute.CreateMembersInterconnectGroupRequest, + Sequence[Tuple[str, Union[str, bytes]]], + ]: + """Pre-rpc interceptor for create_members + + Override in a subclass to manipulate the request or metadata + before they are sent to the InterconnectGroups server. + """ + return request, metadata + + def post_create_members(self, response: compute.Operation) -> compute.Operation: + """Post-rpc interceptor for create_members + + DEPRECATED. Please use the `post_create_members_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response + after it is returned by the InterconnectGroups server but before + it is returned to user code. This `post_create_members` interceptor runs + before the `post_create_members_with_metadata` interceptor. + """ + return response + + def post_create_members_with_metadata( + self, + response: compute.Operation, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[compute.Operation, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for create_members + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the InterconnectGroups server but before it is returned to user code. + + We recommend only using this `post_create_members_with_metadata` + interceptor in new development instead of the `post_create_members` interceptor. + When both interceptors are used, this `post_create_members_with_metadata` interceptor runs after the + `post_create_members` interceptor. The (possibly modified) response returned by + `post_create_members` will be passed to + `post_create_members_with_metadata`. + """ + return response, metadata + + def pre_delete( + self, + request: compute.DeleteInterconnectGroupRequest, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + compute.DeleteInterconnectGroupRequest, Sequence[Tuple[str, Union[str, bytes]]] + ]: + """Pre-rpc interceptor for delete + + Override in a subclass to manipulate the request or metadata + before they are sent to the InterconnectGroups server. + """ + return request, metadata + + def post_delete(self, response: compute.Operation) -> compute.Operation: + """Post-rpc interceptor for delete + + DEPRECATED. Please use the `post_delete_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response + after it is returned by the InterconnectGroups server but before + it is returned to user code. This `post_delete` interceptor runs + before the `post_delete_with_metadata` interceptor. + """ + return response + + def post_delete_with_metadata( + self, + response: compute.Operation, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[compute.Operation, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for delete + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the InterconnectGroups server but before it is returned to user code. + + We recommend only using this `post_delete_with_metadata` + interceptor in new development instead of the `post_delete` interceptor. + When both interceptors are used, this `post_delete_with_metadata` interceptor runs after the + `post_delete` interceptor. The (possibly modified) response returned by + `post_delete` will be passed to + `post_delete_with_metadata`. + """ + return response, metadata + + def pre_get( + self, + request: compute.GetInterconnectGroupRequest, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + compute.GetInterconnectGroupRequest, Sequence[Tuple[str, Union[str, bytes]]] + ]: + """Pre-rpc interceptor for get + + Override in a subclass to manipulate the request or metadata + before they are sent to the InterconnectGroups server. + """ + return request, metadata + + def post_get( + self, response: compute.InterconnectGroup + ) -> compute.InterconnectGroup: + """Post-rpc interceptor for get + + DEPRECATED. Please use the `post_get_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response + after it is returned by the InterconnectGroups server but before + it is returned to user code. This `post_get` interceptor runs + before the `post_get_with_metadata` interceptor. + """ + return response + + def post_get_with_metadata( + self, + response: compute.InterconnectGroup, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[compute.InterconnectGroup, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for get + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the InterconnectGroups server but before it is returned to user code. + + We recommend only using this `post_get_with_metadata` + interceptor in new development instead of the `post_get` interceptor. + When both interceptors are used, this `post_get_with_metadata` interceptor runs after the + `post_get` interceptor. The (possibly modified) response returned by + `post_get` will be passed to + `post_get_with_metadata`. + """ + return response, metadata + + def pre_get_iam_policy( + self, + request: compute.GetIamPolicyInterconnectGroupRequest, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + compute.GetIamPolicyInterconnectGroupRequest, + Sequence[Tuple[str, Union[str, bytes]]], + ]: + """Pre-rpc interceptor for get_iam_policy + + Override in a subclass to manipulate the request or metadata + before they are sent to the InterconnectGroups server. + """ + return request, metadata + + def post_get_iam_policy(self, response: compute.Policy) -> compute.Policy: + """Post-rpc interceptor for get_iam_policy + + DEPRECATED. Please use the `post_get_iam_policy_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response + after it is returned by the InterconnectGroups server but before + it is returned to user code. This `post_get_iam_policy` interceptor runs + before the `post_get_iam_policy_with_metadata` interceptor. + """ + return response + + def post_get_iam_policy_with_metadata( + self, + response: compute.Policy, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[compute.Policy, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for get_iam_policy + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the InterconnectGroups server but before it is returned to user code. + + We recommend only using this `post_get_iam_policy_with_metadata` + interceptor in new development instead of the `post_get_iam_policy` interceptor. + When both interceptors are used, this `post_get_iam_policy_with_metadata` interceptor runs after the + `post_get_iam_policy` interceptor. The (possibly modified) response returned by + `post_get_iam_policy` will be passed to + `post_get_iam_policy_with_metadata`. + """ + return response, metadata + + def pre_get_operational_status( + self, + request: compute.GetOperationalStatusInterconnectGroupRequest, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + compute.GetOperationalStatusInterconnectGroupRequest, + Sequence[Tuple[str, Union[str, bytes]]], + ]: + """Pre-rpc interceptor for get_operational_status + + Override in a subclass to manipulate the request or metadata + before they are sent to the InterconnectGroups server. + """ + return request, metadata + + def post_get_operational_status( + self, response: compute.InterconnectGroupsGetOperationalStatusResponse + ) -> compute.InterconnectGroupsGetOperationalStatusResponse: + """Post-rpc interceptor for get_operational_status + + DEPRECATED. Please use the `post_get_operational_status_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response + after it is returned by the InterconnectGroups server but before + it is returned to user code. This `post_get_operational_status` interceptor runs + before the `post_get_operational_status_with_metadata` interceptor. + """ + return response + + def post_get_operational_status_with_metadata( + self, + response: compute.InterconnectGroupsGetOperationalStatusResponse, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + compute.InterconnectGroupsGetOperationalStatusResponse, + Sequence[Tuple[str, Union[str, bytes]]], + ]: + """Post-rpc interceptor for get_operational_status + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the InterconnectGroups server but before it is returned to user code. + + We recommend only using this `post_get_operational_status_with_metadata` + interceptor in new development instead of the `post_get_operational_status` interceptor. + When both interceptors are used, this `post_get_operational_status_with_metadata` interceptor runs after the + `post_get_operational_status` interceptor. The (possibly modified) response returned by + `post_get_operational_status` will be passed to + `post_get_operational_status_with_metadata`. + """ + return response, metadata + + def pre_insert( + self, + request: compute.InsertInterconnectGroupRequest, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + compute.InsertInterconnectGroupRequest, Sequence[Tuple[str, Union[str, bytes]]] + ]: + """Pre-rpc interceptor for insert + + Override in a subclass to manipulate the request or metadata + before they are sent to the InterconnectGroups server. + """ + return request, metadata + + def post_insert(self, response: compute.Operation) -> compute.Operation: + """Post-rpc interceptor for insert + + DEPRECATED. Please use the `post_insert_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response + after it is returned by the InterconnectGroups server but before + it is returned to user code. This `post_insert` interceptor runs + before the `post_insert_with_metadata` interceptor. + """ + return response + + def post_insert_with_metadata( + self, + response: compute.Operation, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[compute.Operation, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for insert + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the InterconnectGroups server but before it is returned to user code. + + We recommend only using this `post_insert_with_metadata` + interceptor in new development instead of the `post_insert` interceptor. + When both interceptors are used, this `post_insert_with_metadata` interceptor runs after the + `post_insert` interceptor. The (possibly modified) response returned by + `post_insert` will be passed to + `post_insert_with_metadata`. + """ + return response, metadata + + def pre_list( + self, + request: compute.ListInterconnectGroupsRequest, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + compute.ListInterconnectGroupsRequest, Sequence[Tuple[str, Union[str, bytes]]] + ]: + """Pre-rpc interceptor for list + + Override in a subclass to manipulate the request or metadata + before they are sent to the InterconnectGroups server. + """ + return request, metadata + + def post_list( + self, response: compute.InterconnectGroupsListResponse + ) -> compute.InterconnectGroupsListResponse: + """Post-rpc interceptor for list + + DEPRECATED. Please use the `post_list_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response + after it is returned by the InterconnectGroups server but before + it is returned to user code. This `post_list` interceptor runs + before the `post_list_with_metadata` interceptor. + """ + return response + + def post_list_with_metadata( + self, + response: compute.InterconnectGroupsListResponse, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + compute.InterconnectGroupsListResponse, Sequence[Tuple[str, Union[str, bytes]]] + ]: + """Post-rpc interceptor for list + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the InterconnectGroups server but before it is returned to user code. + + We recommend only using this `post_list_with_metadata` + interceptor in new development instead of the `post_list` interceptor. + When both interceptors are used, this `post_list_with_metadata` interceptor runs after the + `post_list` interceptor. The (possibly modified) response returned by + `post_list` will be passed to + `post_list_with_metadata`. + """ + return response, metadata + + def pre_patch( + self, + request: compute.PatchInterconnectGroupRequest, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + compute.PatchInterconnectGroupRequest, Sequence[Tuple[str, Union[str, bytes]]] + ]: + """Pre-rpc interceptor for patch + + Override in a subclass to manipulate the request or metadata + before they are sent to the InterconnectGroups server. + """ + return request, metadata + + def post_patch(self, response: compute.Operation) -> compute.Operation: + """Post-rpc interceptor for patch + + DEPRECATED. Please use the `post_patch_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response + after it is returned by the InterconnectGroups server but before + it is returned to user code. This `post_patch` interceptor runs + before the `post_patch_with_metadata` interceptor. + """ + return response + + def post_patch_with_metadata( + self, + response: compute.Operation, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[compute.Operation, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for patch + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the InterconnectGroups server but before it is returned to user code. + + We recommend only using this `post_patch_with_metadata` + interceptor in new development instead of the `post_patch` interceptor. + When both interceptors are used, this `post_patch_with_metadata` interceptor runs after the + `post_patch` interceptor. The (possibly modified) response returned by + `post_patch` will be passed to + `post_patch_with_metadata`. + """ + return response, metadata + + def pre_set_iam_policy( + self, + request: compute.SetIamPolicyInterconnectGroupRequest, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + compute.SetIamPolicyInterconnectGroupRequest, + Sequence[Tuple[str, Union[str, bytes]]], + ]: + """Pre-rpc interceptor for set_iam_policy + + Override in a subclass to manipulate the request or metadata + before they are sent to the InterconnectGroups server. + """ + return request, metadata + + def post_set_iam_policy(self, response: compute.Policy) -> compute.Policy: + """Post-rpc interceptor for set_iam_policy + + DEPRECATED. Please use the `post_set_iam_policy_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response + after it is returned by the InterconnectGroups server but before + it is returned to user code. This `post_set_iam_policy` interceptor runs + before the `post_set_iam_policy_with_metadata` interceptor. + """ + return response + + def post_set_iam_policy_with_metadata( + self, + response: compute.Policy, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[compute.Policy, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for set_iam_policy + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the InterconnectGroups server but before it is returned to user code. + + We recommend only using this `post_set_iam_policy_with_metadata` + interceptor in new development instead of the `post_set_iam_policy` interceptor. + When both interceptors are used, this `post_set_iam_policy_with_metadata` interceptor runs after the + `post_set_iam_policy` interceptor. The (possibly modified) response returned by + `post_set_iam_policy` will be passed to + `post_set_iam_policy_with_metadata`. + """ + return response, metadata + + def pre_test_iam_permissions( + self, + request: compute.TestIamPermissionsInterconnectGroupRequest, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + compute.TestIamPermissionsInterconnectGroupRequest, + Sequence[Tuple[str, Union[str, bytes]]], + ]: + """Pre-rpc interceptor for test_iam_permissions + + Override in a subclass to manipulate the request or metadata + before they are sent to the InterconnectGroups server. + """ + return request, metadata + + def post_test_iam_permissions( + self, response: compute.TestPermissionsResponse + ) -> compute.TestPermissionsResponse: + """Post-rpc interceptor for test_iam_permissions + + DEPRECATED. Please use the `post_test_iam_permissions_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response + after it is returned by the InterconnectGroups server but before + it is returned to user code. This `post_test_iam_permissions` interceptor runs + before the `post_test_iam_permissions_with_metadata` interceptor. + """ + return response + + def post_test_iam_permissions_with_metadata( + self, + response: compute.TestPermissionsResponse, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + compute.TestPermissionsResponse, Sequence[Tuple[str, Union[str, bytes]]] + ]: + """Post-rpc interceptor for test_iam_permissions + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the InterconnectGroups server but before it is returned to user code. + + We recommend only using this `post_test_iam_permissions_with_metadata` + interceptor in new development instead of the `post_test_iam_permissions` interceptor. + When both interceptors are used, this `post_test_iam_permissions_with_metadata` interceptor runs after the + `post_test_iam_permissions` interceptor. The (possibly modified) response returned by + `post_test_iam_permissions` will be passed to + `post_test_iam_permissions_with_metadata`. + """ + return response, metadata + + +@dataclasses.dataclass +class InterconnectGroupsRestStub: + _session: AuthorizedSession + _host: str + _interceptor: InterconnectGroupsRestInterceptor + + +class InterconnectGroupsRestTransport(_BaseInterconnectGroupsRestTransport): + """REST backend synchronous transport for InterconnectGroups. + + The InterconnectGroups API. + + This class defines the same methods as the primary client, so the + primary client can load the underlying transport implementation + and call it. + + It sends JSON representations of protocol buffers over HTTP/1.1 + """ + + def __init__( + self, + *, + host: str = "compute.googleapis.com", + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, + scopes: Optional[Sequence[str]] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + quota_project_id: Optional[str] = None, + client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, + always_use_jwt_access: Optional[bool] = False, + url_scheme: str = "https", + interceptor: Optional[InterconnectGroupsRestInterceptor] = None, + api_audience: Optional[str] = None, + ) -> None: + """Instantiate the transport. + + NOTE: This REST transport functionality is currently in a beta + state (preview). We welcome your feedback via a GitHub issue in + this library's repository. Thank you! + + Args: + host (Optional[str]): + The hostname to connect to (default: 'compute.googleapis.com'). + credentials (Optional[google.auth.credentials.Credentials]): The + authorization credentials to attach to requests. These + credentials identify the application to the service; if none + are specified, the client will attempt to ascertain the + credentials from the environment. + + credentials_file (Optional[str]): A file with credentials that can + be loaded with :func:`google.auth.load_credentials_from_file`. + This argument is ignored if ``channel`` is provided. + scopes (Optional(Sequence[str])): A list of scopes. This argument is + ignored if ``channel`` is provided. + client_cert_source_for_mtls (Callable[[], Tuple[bytes, bytes]]): Client + certificate to configure mutual TLS HTTP channel. It is ignored + if ``channel`` is provided. + quota_project_id (Optional[str]): An optional project to use for billing + and quota. + client_info (google.api_core.gapic_v1.client_info.ClientInfo): + The client info used to send a user-agent string along with + API requests. If ``None``, then default info will be used. + Generally, you only need to set this if you are developing + your own client library. + always_use_jwt_access (Optional[bool]): Whether self signed JWT should + be used for service account credentials. + url_scheme: the protocol scheme for the API endpoint. Normally + "https", but for testing or local servers, + "http" can be specified. + """ + # Run the base constructor + # TODO(yon-mg): resolve other ctor params i.e. scopes, quota, etc. + # TODO: When custom host (api_endpoint) is set, `scopes` must *also* be set on the + # credentials object + super().__init__( + host=host, + credentials=credentials, + client_info=client_info, + always_use_jwt_access=always_use_jwt_access, + url_scheme=url_scheme, + api_audience=api_audience, + ) + self._session = AuthorizedSession( + self._credentials, default_host=self.DEFAULT_HOST + ) + if client_cert_source_for_mtls: + self._session.configure_mtls_channel(client_cert_source_for_mtls) + self._interceptor = interceptor or InterconnectGroupsRestInterceptor() + self._prep_wrapped_messages(client_info) + + class _CreateMembers( + _BaseInterconnectGroupsRestTransport._BaseCreateMembers, + InterconnectGroupsRestStub, + ): + def __hash__(self): + return hash("InterconnectGroupsRestTransport.CreateMembers") + + @staticmethod + def _get_response( + host, + metadata, + query_params, + session, + timeout, + transcoded_request, + body=None, + ): + uri = transcoded_request["uri"] + method = transcoded_request["method"] + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = getattr(session, method)( + "{host}{uri}".format(host=host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + data=body, + ) + return response + + def __call__( + self, + request: compute.CreateMembersInterconnectGroupRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> compute.Operation: + r"""Call the create members method over HTTP. + + Args: + request (~.compute.CreateMembersInterconnectGroupRequest): + The request object. A request message for + InterconnectGroups.CreateMembers. See + the method description for details. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + ~.compute.Operation: + Represents an Operation resource. Google Compute Engine + has three Operation resources: \* + `Global `__ + \* + `Regional `__ + \* + `Zonal `__ + You can use an operation resource to manage asynchronous + API requests. For more information, read Handling API + responses. Operations can be global, regional or zonal. + - For global operations, use the ``globalOperations`` + resource. - For regional operations, use the + ``regionOperations`` resource. - For zonal operations, + use the ``zoneOperations`` resource. For more + information, read Global, Regional, and Zonal Resources. + Note that completed Operation resources have a limited + retention period. + + """ + + http_options = ( + _BaseInterconnectGroupsRestTransport._BaseCreateMembers._get_http_options() + ) + + request, metadata = self._interceptor.pre_create_members(request, metadata) + transcoded_request = _BaseInterconnectGroupsRestTransport._BaseCreateMembers._get_transcoded_request( + http_options, request + ) + + body = _BaseInterconnectGroupsRestTransport._BaseCreateMembers._get_request_body_json( + transcoded_request + ) + + # Jsonify the query params + query_params = _BaseInterconnectGroupsRestTransport._BaseCreateMembers._get_query_params_json( + transcoded_request + ) + + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + try: + request_payload = type(request).to_json(request) + except: + request_payload = None + http_request = { + "payload": request_payload, + "requestMethod": method, + "requestUrl": request_url, + "headers": dict(metadata), + } + _LOGGER.debug( + f"Sending request for google.cloud.compute_v1.InterconnectGroupsClient.CreateMembers", + extra={ + "serviceName": "google.cloud.compute.v1.InterconnectGroups", + "rpcName": "CreateMembers", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = InterconnectGroupsRestTransport._CreateMembers._get_response( + self._host, + metadata, + query_params, + self._session, + timeout, + transcoded_request, + body, + ) + + # In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception + # subclass. + if response.status_code >= 400: + raise core_exceptions.from_http_response(response) + + # Return the response + resp = compute.Operation() + pb_resp = compute.Operation.pb(resp) + + json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True) + + resp = self._interceptor.post_create_members(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_create_members_with_metadata( + resp, response_metadata + ) + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + try: + response_payload = compute.Operation.to_json(response) + except: + response_payload = None + http_response = { + "payload": response_payload, + "headers": dict(response.headers), + "status": response.status_code, + } + _LOGGER.debug( + "Received response for google.cloud.compute_v1.InterconnectGroupsClient.create_members", + extra={ + "serviceName": "google.cloud.compute.v1.InterconnectGroups", + "rpcName": "CreateMembers", + "metadata": http_response["headers"], + "httpResponse": http_response, + }, + ) + return resp + + class _Delete( + _BaseInterconnectGroupsRestTransport._BaseDelete, InterconnectGroupsRestStub + ): + def __hash__(self): + return hash("InterconnectGroupsRestTransport.Delete") + + @staticmethod + def _get_response( + host, + metadata, + query_params, + session, + timeout, + transcoded_request, + body=None, + ): + uri = transcoded_request["uri"] + method = transcoded_request["method"] + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = getattr(session, method)( + "{host}{uri}".format(host=host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + ) + return response + + def __call__( + self, + request: compute.DeleteInterconnectGroupRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> compute.Operation: + r"""Call the delete method over HTTP. + + Args: + request (~.compute.DeleteInterconnectGroupRequest): + The request object. A request message for + InterconnectGroups.Delete. See the + method description for details. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + ~.compute.Operation: + Represents an Operation resource. Google Compute Engine + has three Operation resources: \* + `Global `__ + \* + `Regional `__ + \* + `Zonal `__ + You can use an operation resource to manage asynchronous + API requests. For more information, read Handling API + responses. Operations can be global, regional or zonal. + - For global operations, use the ``globalOperations`` + resource. - For regional operations, use the + ``regionOperations`` resource. - For zonal operations, + use the ``zoneOperations`` resource. For more + information, read Global, Regional, and Zonal Resources. + Note that completed Operation resources have a limited + retention period. + + """ + + http_options = ( + _BaseInterconnectGroupsRestTransport._BaseDelete._get_http_options() + ) + + request, metadata = self._interceptor.pre_delete(request, metadata) + transcoded_request = _BaseInterconnectGroupsRestTransport._BaseDelete._get_transcoded_request( + http_options, request + ) + + # Jsonify the query params + query_params = ( + _BaseInterconnectGroupsRestTransport._BaseDelete._get_query_params_json( + transcoded_request + ) + ) + + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + try: + request_payload = type(request).to_json(request) + except: + request_payload = None + http_request = { + "payload": request_payload, + "requestMethod": method, + "requestUrl": request_url, + "headers": dict(metadata), + } + _LOGGER.debug( + f"Sending request for google.cloud.compute_v1.InterconnectGroupsClient.Delete", + extra={ + "serviceName": "google.cloud.compute.v1.InterconnectGroups", + "rpcName": "Delete", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = InterconnectGroupsRestTransport._Delete._get_response( + self._host, + metadata, + query_params, + self._session, + timeout, + transcoded_request, + ) + + # In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception + # subclass. + if response.status_code >= 400: + raise core_exceptions.from_http_response(response) + + # Return the response + resp = compute.Operation() + pb_resp = compute.Operation.pb(resp) + + json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True) + + resp = self._interceptor.post_delete(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_delete_with_metadata( + resp, response_metadata + ) + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + try: + response_payload = compute.Operation.to_json(response) + except: + response_payload = None + http_response = { + "payload": response_payload, + "headers": dict(response.headers), + "status": response.status_code, + } + _LOGGER.debug( + "Received response for google.cloud.compute_v1.InterconnectGroupsClient.delete", + extra={ + "serviceName": "google.cloud.compute.v1.InterconnectGroups", + "rpcName": "Delete", + "metadata": http_response["headers"], + "httpResponse": http_response, + }, + ) + return resp + + class _Get( + _BaseInterconnectGroupsRestTransport._BaseGet, InterconnectGroupsRestStub + ): + def __hash__(self): + return hash("InterconnectGroupsRestTransport.Get") + + @staticmethod + def _get_response( + host, + metadata, + query_params, + session, + timeout, + transcoded_request, + body=None, + ): + uri = transcoded_request["uri"] + method = transcoded_request["method"] + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = getattr(session, method)( + "{host}{uri}".format(host=host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + ) + return response + + def __call__( + self, + request: compute.GetInterconnectGroupRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> compute.InterconnectGroup: + r"""Call the get method over HTTP. + + Args: + request (~.compute.GetInterconnectGroupRequest): + The request object. A request message for + InterconnectGroups.Get. See the method + description for details. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + ~.compute.InterconnectGroup: + An interconnect group resource allows + customers to create, analyze, and expand + their redundant connections. + + """ + + http_options = ( + _BaseInterconnectGroupsRestTransport._BaseGet._get_http_options() + ) + + request, metadata = self._interceptor.pre_get(request, metadata) + transcoded_request = ( + _BaseInterconnectGroupsRestTransport._BaseGet._get_transcoded_request( + http_options, request + ) + ) + + # Jsonify the query params + query_params = ( + _BaseInterconnectGroupsRestTransport._BaseGet._get_query_params_json( + transcoded_request + ) + ) + + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + try: + request_payload = type(request).to_json(request) + except: + request_payload = None + http_request = { + "payload": request_payload, + "requestMethod": method, + "requestUrl": request_url, + "headers": dict(metadata), + } + _LOGGER.debug( + f"Sending request for google.cloud.compute_v1.InterconnectGroupsClient.Get", + extra={ + "serviceName": "google.cloud.compute.v1.InterconnectGroups", + "rpcName": "Get", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = InterconnectGroupsRestTransport._Get._get_response( + self._host, + metadata, + query_params, + self._session, + timeout, + transcoded_request, + ) + + # In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception + # subclass. + if response.status_code >= 400: + raise core_exceptions.from_http_response(response) + + # Return the response + resp = compute.InterconnectGroup() + pb_resp = compute.InterconnectGroup.pb(resp) + + json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True) + + resp = self._interceptor.post_get(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_get_with_metadata(resp, response_metadata) + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + try: + response_payload = compute.InterconnectGroup.to_json(response) + except: + response_payload = None + http_response = { + "payload": response_payload, + "headers": dict(response.headers), + "status": response.status_code, + } + _LOGGER.debug( + "Received response for google.cloud.compute_v1.InterconnectGroupsClient.get", + extra={ + "serviceName": "google.cloud.compute.v1.InterconnectGroups", + "rpcName": "Get", + "metadata": http_response["headers"], + "httpResponse": http_response, + }, + ) + return resp + + class _GetIamPolicy( + _BaseInterconnectGroupsRestTransport._BaseGetIamPolicy, + InterconnectGroupsRestStub, + ): + def __hash__(self): + return hash("InterconnectGroupsRestTransport.GetIamPolicy") + + @staticmethod + def _get_response( + host, + metadata, + query_params, + session, + timeout, + transcoded_request, + body=None, + ): + uri = transcoded_request["uri"] + method = transcoded_request["method"] + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = getattr(session, method)( + "{host}{uri}".format(host=host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + ) + return response + + def __call__( + self, + request: compute.GetIamPolicyInterconnectGroupRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> compute.Policy: + r"""Call the get iam policy method over HTTP. + + Args: + request (~.compute.GetIamPolicyInterconnectGroupRequest): + The request object. A request message for + InterconnectGroups.GetIamPolicy. See the + method description for details. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + ~.compute.Policy: + An Identity and Access Management (IAM) policy, which + specifies access controls for Google Cloud resources. A + ``Policy`` is a collection of ``bindings``. A + ``binding`` binds one or more ``members``, or + principals, to a single ``role``. Principals can be user + accounts, service accounts, Google groups, and domains + (such as G Suite). A ``role`` is a named list of + permissions; each ``role`` can be an IAM predefined role + or a user-created custom role. For some types of Google + Cloud resources, a ``binding`` can also specify a + ``condition``, which is a logical expression that allows + access to a resource only if the expression evaluates to + ``true``. A condition can add constraints based on + attributes of the request, the resource, or both. To + learn which resources support conditions in their IAM + policies, see the `IAM + documentation `__. + **JSON example:** + ``{ "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": [ "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": "BwWWja0YfJA=", "version": 3 }`` + **YAML example:** + ``bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3`` + For a description of IAM and its features, see the `IAM + documentation `__. + + """ + + http_options = ( + _BaseInterconnectGroupsRestTransport._BaseGetIamPolicy._get_http_options() + ) + + request, metadata = self._interceptor.pre_get_iam_policy(request, metadata) + transcoded_request = _BaseInterconnectGroupsRestTransport._BaseGetIamPolicy._get_transcoded_request( + http_options, request + ) + + # Jsonify the query params + query_params = _BaseInterconnectGroupsRestTransport._BaseGetIamPolicy._get_query_params_json( + transcoded_request + ) + + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + try: + request_payload = type(request).to_json(request) + except: + request_payload = None + http_request = { + "payload": request_payload, + "requestMethod": method, + "requestUrl": request_url, + "headers": dict(metadata), + } + _LOGGER.debug( + f"Sending request for google.cloud.compute_v1.InterconnectGroupsClient.GetIamPolicy", + extra={ + "serviceName": "google.cloud.compute.v1.InterconnectGroups", + "rpcName": "GetIamPolicy", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = InterconnectGroupsRestTransport._GetIamPolicy._get_response( + self._host, + metadata, + query_params, + self._session, + timeout, + transcoded_request, + ) + + # In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception + # subclass. + if response.status_code >= 400: + raise core_exceptions.from_http_response(response) + + # Return the response + resp = compute.Policy() + pb_resp = compute.Policy.pb(resp) + + json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True) + + resp = self._interceptor.post_get_iam_policy(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_get_iam_policy_with_metadata( + resp, response_metadata + ) + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + try: + response_payload = compute.Policy.to_json(response) + except: + response_payload = None + http_response = { + "payload": response_payload, + "headers": dict(response.headers), + "status": response.status_code, + } + _LOGGER.debug( + "Received response for google.cloud.compute_v1.InterconnectGroupsClient.get_iam_policy", + extra={ + "serviceName": "google.cloud.compute.v1.InterconnectGroups", + "rpcName": "GetIamPolicy", + "metadata": http_response["headers"], + "httpResponse": http_response, + }, + ) + return resp + + class _GetOperationalStatus( + _BaseInterconnectGroupsRestTransport._BaseGetOperationalStatus, + InterconnectGroupsRestStub, + ): + def __hash__(self): + return hash("InterconnectGroupsRestTransport.GetOperationalStatus") + + @staticmethod + def _get_response( + host, + metadata, + query_params, + session, + timeout, + transcoded_request, + body=None, + ): + uri = transcoded_request["uri"] + method = transcoded_request["method"] + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = getattr(session, method)( + "{host}{uri}".format(host=host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + ) + return response + + def __call__( + self, + request: compute.GetOperationalStatusInterconnectGroupRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> compute.InterconnectGroupsGetOperationalStatusResponse: + r"""Call the get operational status method over HTTP. + + Args: + request (~.compute.GetOperationalStatusInterconnectGroupRequest): + The request object. A request message for + InterconnectGroups.GetOperationalStatus. + See the method description for details. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + ~.compute.InterconnectGroupsGetOperationalStatusResponse: + Response for the + InterconnectGroupsGetOperationalStatusResponse. + + """ + + http_options = ( + _BaseInterconnectGroupsRestTransport._BaseGetOperationalStatus._get_http_options() + ) + + request, metadata = self._interceptor.pre_get_operational_status( + request, metadata + ) + transcoded_request = _BaseInterconnectGroupsRestTransport._BaseGetOperationalStatus._get_transcoded_request( + http_options, request + ) + + # Jsonify the query params + query_params = _BaseInterconnectGroupsRestTransport._BaseGetOperationalStatus._get_query_params_json( + transcoded_request + ) + + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + try: + request_payload = type(request).to_json(request) + except: + request_payload = None + http_request = { + "payload": request_payload, + "requestMethod": method, + "requestUrl": request_url, + "headers": dict(metadata), + } + _LOGGER.debug( + f"Sending request for google.cloud.compute_v1.InterconnectGroupsClient.GetOperationalStatus", + extra={ + "serviceName": "google.cloud.compute.v1.InterconnectGroups", + "rpcName": "GetOperationalStatus", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = ( + InterconnectGroupsRestTransport._GetOperationalStatus._get_response( + self._host, + metadata, + query_params, + self._session, + timeout, + transcoded_request, + ) + ) + + # In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception + # subclass. + if response.status_code >= 400: + raise core_exceptions.from_http_response(response) + + # Return the response + resp = compute.InterconnectGroupsGetOperationalStatusResponse() + pb_resp = compute.InterconnectGroupsGetOperationalStatusResponse.pb(resp) + + json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True) + + resp = self._interceptor.post_get_operational_status(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_get_operational_status_with_metadata( + resp, response_metadata + ) + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + try: + response_payload = ( + compute.InterconnectGroupsGetOperationalStatusResponse.to_json( + response + ) + ) + except: + response_payload = None + http_response = { + "payload": response_payload, + "headers": dict(response.headers), + "status": response.status_code, + } + _LOGGER.debug( + "Received response for google.cloud.compute_v1.InterconnectGroupsClient.get_operational_status", + extra={ + "serviceName": "google.cloud.compute.v1.InterconnectGroups", + "rpcName": "GetOperationalStatus", + "metadata": http_response["headers"], + "httpResponse": http_response, + }, + ) + return resp + + class _Insert( + _BaseInterconnectGroupsRestTransport._BaseInsert, InterconnectGroupsRestStub + ): + def __hash__(self): + return hash("InterconnectGroupsRestTransport.Insert") + + @staticmethod + def _get_response( + host, + metadata, + query_params, + session, + timeout, + transcoded_request, + body=None, + ): + uri = transcoded_request["uri"] + method = transcoded_request["method"] + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = getattr(session, method)( + "{host}{uri}".format(host=host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + data=body, + ) + return response + + def __call__( + self, + request: compute.InsertInterconnectGroupRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> compute.Operation: + r"""Call the insert method over HTTP. + + Args: + request (~.compute.InsertInterconnectGroupRequest): + The request object. A request message for + InterconnectGroups.Insert. See the + method description for details. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + ~.compute.Operation: + Represents an Operation resource. Google Compute Engine + has three Operation resources: \* + `Global `__ + \* + `Regional `__ + \* + `Zonal `__ + You can use an operation resource to manage asynchronous + API requests. For more information, read Handling API + responses. Operations can be global, regional or zonal. + - For global operations, use the ``globalOperations`` + resource. - For regional operations, use the + ``regionOperations`` resource. - For zonal operations, + use the ``zoneOperations`` resource. For more + information, read Global, Regional, and Zonal Resources. + Note that completed Operation resources have a limited + retention period. + + """ + + http_options = ( + _BaseInterconnectGroupsRestTransport._BaseInsert._get_http_options() + ) + + request, metadata = self._interceptor.pre_insert(request, metadata) + transcoded_request = _BaseInterconnectGroupsRestTransport._BaseInsert._get_transcoded_request( + http_options, request + ) + + body = ( + _BaseInterconnectGroupsRestTransport._BaseInsert._get_request_body_json( + transcoded_request + ) + ) + + # Jsonify the query params + query_params = ( + _BaseInterconnectGroupsRestTransport._BaseInsert._get_query_params_json( + transcoded_request + ) + ) + + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + try: + request_payload = type(request).to_json(request) + except: + request_payload = None + http_request = { + "payload": request_payload, + "requestMethod": method, + "requestUrl": request_url, + "headers": dict(metadata), + } + _LOGGER.debug( + f"Sending request for google.cloud.compute_v1.InterconnectGroupsClient.Insert", + extra={ + "serviceName": "google.cloud.compute.v1.InterconnectGroups", + "rpcName": "Insert", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = InterconnectGroupsRestTransport._Insert._get_response( + self._host, + metadata, + query_params, + self._session, + timeout, + transcoded_request, + body, + ) + + # In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception + # subclass. + if response.status_code >= 400: + raise core_exceptions.from_http_response(response) + + # Return the response + resp = compute.Operation() + pb_resp = compute.Operation.pb(resp) + + json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True) + + resp = self._interceptor.post_insert(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_insert_with_metadata( + resp, response_metadata + ) + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + try: + response_payload = compute.Operation.to_json(response) + except: + response_payload = None + http_response = { + "payload": response_payload, + "headers": dict(response.headers), + "status": response.status_code, + } + _LOGGER.debug( + "Received response for google.cloud.compute_v1.InterconnectGroupsClient.insert", + extra={ + "serviceName": "google.cloud.compute.v1.InterconnectGroups", + "rpcName": "Insert", + "metadata": http_response["headers"], + "httpResponse": http_response, + }, + ) + return resp + + class _List( + _BaseInterconnectGroupsRestTransport._BaseList, InterconnectGroupsRestStub + ): + def __hash__(self): + return hash("InterconnectGroupsRestTransport.List") + + @staticmethod + def _get_response( + host, + metadata, + query_params, + session, + timeout, + transcoded_request, + body=None, + ): + uri = transcoded_request["uri"] + method = transcoded_request["method"] + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = getattr(session, method)( + "{host}{uri}".format(host=host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + ) + return response + + def __call__( + self, + request: compute.ListInterconnectGroupsRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> compute.InterconnectGroupsListResponse: + r"""Call the list method over HTTP. + + Args: + request (~.compute.ListInterconnectGroupsRequest): + The request object. A request message for + InterconnectGroups.List. See the method + description for details. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + ~.compute.InterconnectGroupsListResponse: + + """ + + http_options = ( + _BaseInterconnectGroupsRestTransport._BaseList._get_http_options() + ) + + request, metadata = self._interceptor.pre_list(request, metadata) + transcoded_request = ( + _BaseInterconnectGroupsRestTransport._BaseList._get_transcoded_request( + http_options, request + ) + ) + + # Jsonify the query params + query_params = ( + _BaseInterconnectGroupsRestTransport._BaseList._get_query_params_json( + transcoded_request + ) + ) + + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + try: + request_payload = type(request).to_json(request) + except: + request_payload = None + http_request = { + "payload": request_payload, + "requestMethod": method, + "requestUrl": request_url, + "headers": dict(metadata), + } + _LOGGER.debug( + f"Sending request for google.cloud.compute_v1.InterconnectGroupsClient.List", + extra={ + "serviceName": "google.cloud.compute.v1.InterconnectGroups", + "rpcName": "List", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = InterconnectGroupsRestTransport._List._get_response( + self._host, + metadata, + query_params, + self._session, + timeout, + transcoded_request, + ) + + # In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception + # subclass. + if response.status_code >= 400: + raise core_exceptions.from_http_response(response) + + # Return the response + resp = compute.InterconnectGroupsListResponse() + pb_resp = compute.InterconnectGroupsListResponse.pb(resp) + + json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True) + + resp = self._interceptor.post_list(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_list_with_metadata(resp, response_metadata) + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + try: + response_payload = compute.InterconnectGroupsListResponse.to_json( + response + ) + except: + response_payload = None + http_response = { + "payload": response_payload, + "headers": dict(response.headers), + "status": response.status_code, + } + _LOGGER.debug( + "Received response for google.cloud.compute_v1.InterconnectGroupsClient.list", + extra={ + "serviceName": "google.cloud.compute.v1.InterconnectGroups", + "rpcName": "List", + "metadata": http_response["headers"], + "httpResponse": http_response, + }, + ) + return resp + + class _Patch( + _BaseInterconnectGroupsRestTransport._BasePatch, InterconnectGroupsRestStub + ): + def __hash__(self): + return hash("InterconnectGroupsRestTransport.Patch") + + @staticmethod + def _get_response( + host, + metadata, + query_params, + session, + timeout, + transcoded_request, + body=None, + ): + uri = transcoded_request["uri"] + method = transcoded_request["method"] + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = getattr(session, method)( + "{host}{uri}".format(host=host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + data=body, + ) + return response + + def __call__( + self, + request: compute.PatchInterconnectGroupRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> compute.Operation: + r"""Call the patch method over HTTP. + + Args: + request (~.compute.PatchInterconnectGroupRequest): + The request object. A request message for + InterconnectGroups.Patch. See the method + description for details. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + ~.compute.Operation: + Represents an Operation resource. Google Compute Engine + has three Operation resources: \* + `Global `__ + \* + `Regional `__ + \* + `Zonal `__ + You can use an operation resource to manage asynchronous + API requests. For more information, read Handling API + responses. Operations can be global, regional or zonal. + - For global operations, use the ``globalOperations`` + resource. - For regional operations, use the + ``regionOperations`` resource. - For zonal operations, + use the ``zoneOperations`` resource. For more + information, read Global, Regional, and Zonal Resources. + Note that completed Operation resources have a limited + retention period. + + """ + + http_options = ( + _BaseInterconnectGroupsRestTransport._BasePatch._get_http_options() + ) + + request, metadata = self._interceptor.pre_patch(request, metadata) + transcoded_request = ( + _BaseInterconnectGroupsRestTransport._BasePatch._get_transcoded_request( + http_options, request + ) + ) + + body = ( + _BaseInterconnectGroupsRestTransport._BasePatch._get_request_body_json( + transcoded_request + ) + ) + + # Jsonify the query params + query_params = ( + _BaseInterconnectGroupsRestTransport._BasePatch._get_query_params_json( + transcoded_request + ) + ) + + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + try: + request_payload = type(request).to_json(request) + except: + request_payload = None + http_request = { + "payload": request_payload, + "requestMethod": method, + "requestUrl": request_url, + "headers": dict(metadata), + } + _LOGGER.debug( + f"Sending request for google.cloud.compute_v1.InterconnectGroupsClient.Patch", + extra={ + "serviceName": "google.cloud.compute.v1.InterconnectGroups", + "rpcName": "Patch", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = InterconnectGroupsRestTransport._Patch._get_response( + self._host, + metadata, + query_params, + self._session, + timeout, + transcoded_request, + body, + ) + + # In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception + # subclass. + if response.status_code >= 400: + raise core_exceptions.from_http_response(response) + + # Return the response + resp = compute.Operation() + pb_resp = compute.Operation.pb(resp) + + json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True) + + resp = self._interceptor.post_patch(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_patch_with_metadata( + resp, response_metadata + ) + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + try: + response_payload = compute.Operation.to_json(response) + except: + response_payload = None + http_response = { + "payload": response_payload, + "headers": dict(response.headers), + "status": response.status_code, + } + _LOGGER.debug( + "Received response for google.cloud.compute_v1.InterconnectGroupsClient.patch", + extra={ + "serviceName": "google.cloud.compute.v1.InterconnectGroups", + "rpcName": "Patch", + "metadata": http_response["headers"], + "httpResponse": http_response, + }, + ) + return resp + + class _SetIamPolicy( + _BaseInterconnectGroupsRestTransport._BaseSetIamPolicy, + InterconnectGroupsRestStub, + ): + def __hash__(self): + return hash("InterconnectGroupsRestTransport.SetIamPolicy") + + @staticmethod + def _get_response( + host, + metadata, + query_params, + session, + timeout, + transcoded_request, + body=None, + ): + uri = transcoded_request["uri"] + method = transcoded_request["method"] + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = getattr(session, method)( + "{host}{uri}".format(host=host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + data=body, + ) + return response + + def __call__( + self, + request: compute.SetIamPolicyInterconnectGroupRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> compute.Policy: + r"""Call the set iam policy method over HTTP. + + Args: + request (~.compute.SetIamPolicyInterconnectGroupRequest): + The request object. A request message for + InterconnectGroups.SetIamPolicy. See the + method description for details. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + ~.compute.Policy: + An Identity and Access Management (IAM) policy, which + specifies access controls for Google Cloud resources. A + ``Policy`` is a collection of ``bindings``. A + ``binding`` binds one or more ``members``, or + principals, to a single ``role``. Principals can be user + accounts, service accounts, Google groups, and domains + (such as G Suite). A ``role`` is a named list of + permissions; each ``role`` can be an IAM predefined role + or a user-created custom role. For some types of Google + Cloud resources, a ``binding`` can also specify a + ``condition``, which is a logical expression that allows + access to a resource only if the expression evaluates to + ``true``. A condition can add constraints based on + attributes of the request, the resource, or both. To + learn which resources support conditions in their IAM + policies, see the `IAM + documentation `__. + **JSON example:** + ``{ "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": [ "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": "BwWWja0YfJA=", "version": 3 }`` + **YAML example:** + ``bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3`` + For a description of IAM and its features, see the `IAM + documentation `__. + + """ + + http_options = ( + _BaseInterconnectGroupsRestTransport._BaseSetIamPolicy._get_http_options() + ) + + request, metadata = self._interceptor.pre_set_iam_policy(request, metadata) + transcoded_request = _BaseInterconnectGroupsRestTransport._BaseSetIamPolicy._get_transcoded_request( + http_options, request + ) + + body = _BaseInterconnectGroupsRestTransport._BaseSetIamPolicy._get_request_body_json( + transcoded_request + ) + + # Jsonify the query params + query_params = _BaseInterconnectGroupsRestTransport._BaseSetIamPolicy._get_query_params_json( + transcoded_request + ) + + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + try: + request_payload = type(request).to_json(request) + except: + request_payload = None + http_request = { + "payload": request_payload, + "requestMethod": method, + "requestUrl": request_url, + "headers": dict(metadata), + } + _LOGGER.debug( + f"Sending request for google.cloud.compute_v1.InterconnectGroupsClient.SetIamPolicy", + extra={ + "serviceName": "google.cloud.compute.v1.InterconnectGroups", + "rpcName": "SetIamPolicy", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = InterconnectGroupsRestTransport._SetIamPolicy._get_response( + self._host, + metadata, + query_params, + self._session, + timeout, + transcoded_request, + body, + ) + + # In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception + # subclass. + if response.status_code >= 400: + raise core_exceptions.from_http_response(response) + + # Return the response + resp = compute.Policy() + pb_resp = compute.Policy.pb(resp) + + json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True) + + resp = self._interceptor.post_set_iam_policy(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_set_iam_policy_with_metadata( + resp, response_metadata + ) + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + try: + response_payload = compute.Policy.to_json(response) + except: + response_payload = None + http_response = { + "payload": response_payload, + "headers": dict(response.headers), + "status": response.status_code, + } + _LOGGER.debug( + "Received response for google.cloud.compute_v1.InterconnectGroupsClient.set_iam_policy", + extra={ + "serviceName": "google.cloud.compute.v1.InterconnectGroups", + "rpcName": "SetIamPolicy", + "metadata": http_response["headers"], + "httpResponse": http_response, + }, + ) + return resp + + class _TestIamPermissions( + _BaseInterconnectGroupsRestTransport._BaseTestIamPermissions, + InterconnectGroupsRestStub, + ): + def __hash__(self): + return hash("InterconnectGroupsRestTransport.TestIamPermissions") + + @staticmethod + def _get_response( + host, + metadata, + query_params, + session, + timeout, + transcoded_request, + body=None, + ): + uri = transcoded_request["uri"] + method = transcoded_request["method"] + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = getattr(session, method)( + "{host}{uri}".format(host=host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + data=body, + ) + return response + + def __call__( + self, + request: compute.TestIamPermissionsInterconnectGroupRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> compute.TestPermissionsResponse: + r"""Call the test iam permissions method over HTTP. + + Args: + request (~.compute.TestIamPermissionsInterconnectGroupRequest): + The request object. A request message for + InterconnectGroups.TestIamPermissions. + See the method description for details. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + ~.compute.TestPermissionsResponse: + + """ + + http_options = ( + _BaseInterconnectGroupsRestTransport._BaseTestIamPermissions._get_http_options() + ) + + request, metadata = self._interceptor.pre_test_iam_permissions( + request, metadata + ) + transcoded_request = _BaseInterconnectGroupsRestTransport._BaseTestIamPermissions._get_transcoded_request( + http_options, request + ) + + body = _BaseInterconnectGroupsRestTransport._BaseTestIamPermissions._get_request_body_json( + transcoded_request + ) + + # Jsonify the query params + query_params = _BaseInterconnectGroupsRestTransport._BaseTestIamPermissions._get_query_params_json( + transcoded_request + ) + + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + try: + request_payload = type(request).to_json(request) + except: + request_payload = None + http_request = { + "payload": request_payload, + "requestMethod": method, + "requestUrl": request_url, + "headers": dict(metadata), + } + _LOGGER.debug( + f"Sending request for google.cloud.compute_v1.InterconnectGroupsClient.TestIamPermissions", + extra={ + "serviceName": "google.cloud.compute.v1.InterconnectGroups", + "rpcName": "TestIamPermissions", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = ( + InterconnectGroupsRestTransport._TestIamPermissions._get_response( + self._host, + metadata, + query_params, + self._session, + timeout, + transcoded_request, + body, + ) + ) + + # In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception + # subclass. + if response.status_code >= 400: + raise core_exceptions.from_http_response(response) + + # Return the response + resp = compute.TestPermissionsResponse() + pb_resp = compute.TestPermissionsResponse.pb(resp) + + json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True) + + resp = self._interceptor.post_test_iam_permissions(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_test_iam_permissions_with_metadata( + resp, response_metadata + ) + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + try: + response_payload = compute.TestPermissionsResponse.to_json(response) + except: + response_payload = None + http_response = { + "payload": response_payload, + "headers": dict(response.headers), + "status": response.status_code, + } + _LOGGER.debug( + "Received response for google.cloud.compute_v1.InterconnectGroupsClient.test_iam_permissions", + extra={ + "serviceName": "google.cloud.compute.v1.InterconnectGroups", + "rpcName": "TestIamPermissions", + "metadata": http_response["headers"], + "httpResponse": http_response, + }, + ) + return resp + + @property + def create_members( + self, + ) -> Callable[[compute.CreateMembersInterconnectGroupRequest], compute.Operation]: + # The return type is fine, but mypy isn't sophisticated enough to determine what's going on here. + # In C++ this would require a dynamic_cast + return self._CreateMembers(self._session, self._host, self._interceptor) # type: ignore + + @property + def delete( + self, + ) -> Callable[[compute.DeleteInterconnectGroupRequest], compute.Operation]: + # The return type is fine, but mypy isn't sophisticated enough to determine what's going on here. + # In C++ this would require a dynamic_cast + return self._Delete(self._session, self._host, self._interceptor) # type: ignore + + @property + def get( + self, + ) -> Callable[[compute.GetInterconnectGroupRequest], compute.InterconnectGroup]: + # The return type is fine, but mypy isn't sophisticated enough to determine what's going on here. + # In C++ this would require a dynamic_cast + return self._Get(self._session, self._host, self._interceptor) # type: ignore + + @property + def get_iam_policy( + self, + ) -> Callable[[compute.GetIamPolicyInterconnectGroupRequest], compute.Policy]: + # The return type is fine, but mypy isn't sophisticated enough to determine what's going on here. + # In C++ this would require a dynamic_cast + return self._GetIamPolicy(self._session, self._host, self._interceptor) # type: ignore + + @property + def get_operational_status( + self, + ) -> Callable[ + [compute.GetOperationalStatusInterconnectGroupRequest], + compute.InterconnectGroupsGetOperationalStatusResponse, + ]: + # The return type is fine, but mypy isn't sophisticated enough to determine what's going on here. + # In C++ this would require a dynamic_cast + return self._GetOperationalStatus(self._session, self._host, self._interceptor) # type: ignore + + @property + def insert( + self, + ) -> Callable[[compute.InsertInterconnectGroupRequest], compute.Operation]: + # The return type is fine, but mypy isn't sophisticated enough to determine what's going on here. + # In C++ this would require a dynamic_cast + return self._Insert(self._session, self._host, self._interceptor) # type: ignore + + @property + def list( + self, + ) -> Callable[ + [compute.ListInterconnectGroupsRequest], compute.InterconnectGroupsListResponse + ]: + # The return type is fine, but mypy isn't sophisticated enough to determine what's going on here. + # In C++ this would require a dynamic_cast + return self._List(self._session, self._host, self._interceptor) # type: ignore + + @property + def patch( + self, + ) -> Callable[[compute.PatchInterconnectGroupRequest], compute.Operation]: + # The return type is fine, but mypy isn't sophisticated enough to determine what's going on here. + # In C++ this would require a dynamic_cast + return self._Patch(self._session, self._host, self._interceptor) # type: ignore + + @property + def set_iam_policy( + self, + ) -> Callable[[compute.SetIamPolicyInterconnectGroupRequest], compute.Policy]: + # The return type is fine, but mypy isn't sophisticated enough to determine what's going on here. + # In C++ this would require a dynamic_cast + return self._SetIamPolicy(self._session, self._host, self._interceptor) # type: ignore + + @property + def test_iam_permissions( + self, + ) -> Callable[ + [compute.TestIamPermissionsInterconnectGroupRequest], + compute.TestPermissionsResponse, + ]: + # The return type is fine, but mypy isn't sophisticated enough to determine what's going on here. + # In C++ this would require a dynamic_cast + return self._TestIamPermissions(self._session, self._host, self._interceptor) # type: ignore + + @property + def kind(self) -> str: + return "rest" + + def close(self): + self._session.close() + + +__all__ = ("InterconnectGroupsRestTransport",) diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/interconnect_groups/transports/rest_base.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/interconnect_groups/transports/rest_base.py new file mode 100644 index 000000000000..fbec1f5fe919 --- /dev/null +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/interconnect_groups/transports/rest_base.py @@ -0,0 +1,603 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +import json # type: ignore +import re +from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple, Union + +from google.api_core import gapic_v1, path_template +from google.protobuf import json_format + +from google.cloud.compute_v1.types import compute + +from .base import DEFAULT_CLIENT_INFO, InterconnectGroupsTransport + + +class _BaseInterconnectGroupsRestTransport(InterconnectGroupsTransport): + """Base REST backend transport for InterconnectGroups. + + Note: This class is not meant to be used directly. Use its sync and + async sub-classes instead. + + This class defines the same methods as the primary client, so the + primary client can load the underlying transport implementation + and call it. + + It sends JSON representations of protocol buffers over HTTP/1.1 + """ + + def __init__( + self, + *, + host: str = "compute.googleapis.com", + credentials: Optional[Any] = None, + client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, + always_use_jwt_access: Optional[bool] = False, + url_scheme: str = "https", + api_audience: Optional[str] = None, + ) -> None: + """Instantiate the transport. + Args: + host (Optional[str]): + The hostname to connect to (default: 'compute.googleapis.com'). + credentials (Optional[Any]): The + authorization credentials to attach to requests. These + credentials identify the application to the service; if none + are specified, the client will attempt to ascertain the + credentials from the environment. + client_info (google.api_core.gapic_v1.client_info.ClientInfo): + The client info used to send a user-agent string along with + API requests. If ``None``, then default info will be used. + Generally, you only need to set this if you are developing + your own client library. + always_use_jwt_access (Optional[bool]): Whether self signed JWT should + be used for service account credentials. + url_scheme: the protocol scheme for the API endpoint. Normally + "https", but for testing or local servers, + "http" can be specified. + """ + # Run the base constructor + maybe_url_match = re.match("^(?Phttp(?:s)?://)?(?P.*)$", host) + if maybe_url_match is None: + raise ValueError( + f"Unexpected hostname structure: {host}" + ) # pragma: NO COVER + + url_match_items = maybe_url_match.groupdict() + + host = f"{url_scheme}://{host}" if not url_match_items["scheme"] else host + + super().__init__( + host=host, + credentials=credentials, + client_info=client_info, + always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, + ) + + class _BaseCreateMembers: + def __hash__(self): # pragma: NO COVER + return NotImplementedError("__hash__ must be implemented.") + + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} + + @classmethod + def _get_unset_required_fields(cls, message_dict): + return { + k: v + for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items() + if k not in message_dict + } + + @staticmethod + def _get_http_options(): + http_options: List[Dict[str, str]] = [ + { + "method": "post", + "uri": "/compute/v1/projects/{project}/global/interconnectGroups/{interconnect_group}/createMembers", + "body": "interconnect_groups_create_members_request_resource", + }, + ] + return http_options + + @staticmethod + def _get_transcoded_request(http_options, request): + pb_request = compute.CreateMembersInterconnectGroupRequest.pb(request) + transcoded_request = path_template.transcode(http_options, pb_request) + return transcoded_request + + @staticmethod + def _get_request_body_json(transcoded_request): + # Jsonify the request body + + body = json_format.MessageToJson( + transcoded_request["body"], use_integers_for_enums=False + ) + return body + + @staticmethod + def _get_query_params_json(transcoded_request): + query_params = json.loads( + json_format.MessageToJson( + transcoded_request["query_params"], + use_integers_for_enums=False, + ) + ) + query_params.update( + _BaseInterconnectGroupsRestTransport._BaseCreateMembers._get_unset_required_fields( + query_params + ) + ) + + return query_params + + class _BaseDelete: + def __hash__(self): # pragma: NO COVER + return NotImplementedError("__hash__ must be implemented.") + + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} + + @classmethod + def _get_unset_required_fields(cls, message_dict): + return { + k: v + for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items() + if k not in message_dict + } + + @staticmethod + def _get_http_options(): + http_options: List[Dict[str, str]] = [ + { + "method": "delete", + "uri": "/compute/v1/projects/{project}/global/interconnectGroups/{interconnect_group}", + }, + ] + return http_options + + @staticmethod + def _get_transcoded_request(http_options, request): + pb_request = compute.DeleteInterconnectGroupRequest.pb(request) + transcoded_request = path_template.transcode(http_options, pb_request) + return transcoded_request + + @staticmethod + def _get_query_params_json(transcoded_request): + query_params = json.loads( + json_format.MessageToJson( + transcoded_request["query_params"], + use_integers_for_enums=False, + ) + ) + query_params.update( + _BaseInterconnectGroupsRestTransport._BaseDelete._get_unset_required_fields( + query_params + ) + ) + + return query_params + + class _BaseGet: + def __hash__(self): # pragma: NO COVER + return NotImplementedError("__hash__ must be implemented.") + + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} + + @classmethod + def _get_unset_required_fields(cls, message_dict): + return { + k: v + for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items() + if k not in message_dict + } + + @staticmethod + def _get_http_options(): + http_options: List[Dict[str, str]] = [ + { + "method": "get", + "uri": "/compute/v1/projects/{project}/global/interconnectGroups/{interconnect_group}", + }, + ] + return http_options + + @staticmethod + def _get_transcoded_request(http_options, request): + pb_request = compute.GetInterconnectGroupRequest.pb(request) + transcoded_request = path_template.transcode(http_options, pb_request) + return transcoded_request + + @staticmethod + def _get_query_params_json(transcoded_request): + query_params = json.loads( + json_format.MessageToJson( + transcoded_request["query_params"], + use_integers_for_enums=False, + ) + ) + query_params.update( + _BaseInterconnectGroupsRestTransport._BaseGet._get_unset_required_fields( + query_params + ) + ) + + return query_params + + class _BaseGetIamPolicy: + def __hash__(self): # pragma: NO COVER + return NotImplementedError("__hash__ must be implemented.") + + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} + + @classmethod + def _get_unset_required_fields(cls, message_dict): + return { + k: v + for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items() + if k not in message_dict + } + + @staticmethod + def _get_http_options(): + http_options: List[Dict[str, str]] = [ + { + "method": "get", + "uri": "/compute/v1/projects/{project}/global/interconnectGroups/{resource}/getIamPolicy", + }, + ] + return http_options + + @staticmethod + def _get_transcoded_request(http_options, request): + pb_request = compute.GetIamPolicyInterconnectGroupRequest.pb(request) + transcoded_request = path_template.transcode(http_options, pb_request) + return transcoded_request + + @staticmethod + def _get_query_params_json(transcoded_request): + query_params = json.loads( + json_format.MessageToJson( + transcoded_request["query_params"], + use_integers_for_enums=False, + ) + ) + query_params.update( + _BaseInterconnectGroupsRestTransport._BaseGetIamPolicy._get_unset_required_fields( + query_params + ) + ) + + return query_params + + class _BaseGetOperationalStatus: + def __hash__(self): # pragma: NO COVER + return NotImplementedError("__hash__ must be implemented.") + + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} + + @classmethod + def _get_unset_required_fields(cls, message_dict): + return { + k: v + for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items() + if k not in message_dict + } + + @staticmethod + def _get_http_options(): + http_options: List[Dict[str, str]] = [ + { + "method": "get", + "uri": "/compute/v1/projects/{project}/global/interconnectGroups/{interconnect_group}/getOperationalStatus", + }, + ] + return http_options + + @staticmethod + def _get_transcoded_request(http_options, request): + pb_request = compute.GetOperationalStatusInterconnectGroupRequest.pb( + request + ) + transcoded_request = path_template.transcode(http_options, pb_request) + return transcoded_request + + @staticmethod + def _get_query_params_json(transcoded_request): + query_params = json.loads( + json_format.MessageToJson( + transcoded_request["query_params"], + use_integers_for_enums=False, + ) + ) + query_params.update( + _BaseInterconnectGroupsRestTransport._BaseGetOperationalStatus._get_unset_required_fields( + query_params + ) + ) + + return query_params + + class _BaseInsert: + def __hash__(self): # pragma: NO COVER + return NotImplementedError("__hash__ must be implemented.") + + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} + + @classmethod + def _get_unset_required_fields(cls, message_dict): + return { + k: v + for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items() + if k not in message_dict + } + + @staticmethod + def _get_http_options(): + http_options: List[Dict[str, str]] = [ + { + "method": "post", + "uri": "/compute/v1/projects/{project}/global/interconnectGroups", + "body": "interconnect_group_resource", + }, + ] + return http_options + + @staticmethod + def _get_transcoded_request(http_options, request): + pb_request = compute.InsertInterconnectGroupRequest.pb(request) + transcoded_request = path_template.transcode(http_options, pb_request) + return transcoded_request + + @staticmethod + def _get_request_body_json(transcoded_request): + # Jsonify the request body + + body = json_format.MessageToJson( + transcoded_request["body"], use_integers_for_enums=False + ) + return body + + @staticmethod + def _get_query_params_json(transcoded_request): + query_params = json.loads( + json_format.MessageToJson( + transcoded_request["query_params"], + use_integers_for_enums=False, + ) + ) + query_params.update( + _BaseInterconnectGroupsRestTransport._BaseInsert._get_unset_required_fields( + query_params + ) + ) + + return query_params + + class _BaseList: + def __hash__(self): # pragma: NO COVER + return NotImplementedError("__hash__ must be implemented.") + + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} + + @classmethod + def _get_unset_required_fields(cls, message_dict): + return { + k: v + for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items() + if k not in message_dict + } + + @staticmethod + def _get_http_options(): + http_options: List[Dict[str, str]] = [ + { + "method": "get", + "uri": "/compute/v1/projects/{project}/global/interconnectGroups", + }, + ] + return http_options + + @staticmethod + def _get_transcoded_request(http_options, request): + pb_request = compute.ListInterconnectGroupsRequest.pb(request) + transcoded_request = path_template.transcode(http_options, pb_request) + return transcoded_request + + @staticmethod + def _get_query_params_json(transcoded_request): + query_params = json.loads( + json_format.MessageToJson( + transcoded_request["query_params"], + use_integers_for_enums=False, + ) + ) + query_params.update( + _BaseInterconnectGroupsRestTransport._BaseList._get_unset_required_fields( + query_params + ) + ) + + return query_params + + class _BasePatch: + def __hash__(self): # pragma: NO COVER + return NotImplementedError("__hash__ must be implemented.") + + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} + + @classmethod + def _get_unset_required_fields(cls, message_dict): + return { + k: v + for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items() + if k not in message_dict + } + + @staticmethod + def _get_http_options(): + http_options: List[Dict[str, str]] = [ + { + "method": "patch", + "uri": "/compute/v1/projects/{project}/global/interconnectGroups/{interconnect_group}", + "body": "interconnect_group_resource", + }, + ] + return http_options + + @staticmethod + def _get_transcoded_request(http_options, request): + pb_request = compute.PatchInterconnectGroupRequest.pb(request) + transcoded_request = path_template.transcode(http_options, pb_request) + return transcoded_request + + @staticmethod + def _get_request_body_json(transcoded_request): + # Jsonify the request body + + body = json_format.MessageToJson( + transcoded_request["body"], use_integers_for_enums=False + ) + return body + + @staticmethod + def _get_query_params_json(transcoded_request): + query_params = json.loads( + json_format.MessageToJson( + transcoded_request["query_params"], + use_integers_for_enums=False, + ) + ) + query_params.update( + _BaseInterconnectGroupsRestTransport._BasePatch._get_unset_required_fields( + query_params + ) + ) + + return query_params + + class _BaseSetIamPolicy: + def __hash__(self): # pragma: NO COVER + return NotImplementedError("__hash__ must be implemented.") + + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} + + @classmethod + def _get_unset_required_fields(cls, message_dict): + return { + k: v + for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items() + if k not in message_dict + } + + @staticmethod + def _get_http_options(): + http_options: List[Dict[str, str]] = [ + { + "method": "post", + "uri": "/compute/v1/projects/{project}/global/interconnectGroups/{resource}/setIamPolicy", + "body": "global_set_policy_request_resource", + }, + ] + return http_options + + @staticmethod + def _get_transcoded_request(http_options, request): + pb_request = compute.SetIamPolicyInterconnectGroupRequest.pb(request) + transcoded_request = path_template.transcode(http_options, pb_request) + return transcoded_request + + @staticmethod + def _get_request_body_json(transcoded_request): + # Jsonify the request body + + body = json_format.MessageToJson( + transcoded_request["body"], use_integers_for_enums=False + ) + return body + + @staticmethod + def _get_query_params_json(transcoded_request): + query_params = json.loads( + json_format.MessageToJson( + transcoded_request["query_params"], + use_integers_for_enums=False, + ) + ) + query_params.update( + _BaseInterconnectGroupsRestTransport._BaseSetIamPolicy._get_unset_required_fields( + query_params + ) + ) + + return query_params + + class _BaseTestIamPermissions: + def __hash__(self): # pragma: NO COVER + return NotImplementedError("__hash__ must be implemented.") + + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} + + @classmethod + def _get_unset_required_fields(cls, message_dict): + return { + k: v + for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items() + if k not in message_dict + } + + @staticmethod + def _get_http_options(): + http_options: List[Dict[str, str]] = [ + { + "method": "post", + "uri": "/compute/v1/projects/{project}/global/interconnectGroups/{resource}/testIamPermissions", + "body": "test_permissions_request_resource", + }, + ] + return http_options + + @staticmethod + def _get_transcoded_request(http_options, request): + pb_request = compute.TestIamPermissionsInterconnectGroupRequest.pb(request) + transcoded_request = path_template.transcode(http_options, pb_request) + return transcoded_request + + @staticmethod + def _get_request_body_json(transcoded_request): + # Jsonify the request body + + body = json_format.MessageToJson( + transcoded_request["body"], use_integers_for_enums=False + ) + return body + + @staticmethod + def _get_query_params_json(transcoded_request): + query_params = json.loads( + json_format.MessageToJson( + transcoded_request["query_params"], + use_integers_for_enums=False, + ) + ) + query_params.update( + _BaseInterconnectGroupsRestTransport._BaseTestIamPermissions._get_unset_required_fields( + query_params + ) + ) + + return query_params + + +__all__ = ("_BaseInterconnectGroupsRestTransport",) diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/licenses/client.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/licenses/client.py index e80311dc7663..36de13b7df8c 100644 --- a/packages/google-cloud-compute/google/cloud/compute_v1/services/licenses/client.py +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/licenses/client.py @@ -1910,6 +1910,292 @@ def sample_test_iam_permissions(): # Done; return the response. return response + def update_unary( + self, + request: Optional[Union[compute.UpdateLicenseRequest, dict]] = None, + *, + project: Optional[str] = None, + license_: Optional[str] = None, + license_resource: Optional[compute.License] = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> compute.Operation: + r"""Updates a License resource in the specified project. *Caution* + This resource is intended for use only by third-party partners + who are creating Cloud Marketplace images. + + .. code-block:: python + + # This snippet 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 as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import compute_v1 + + def sample_update(): + # Create a client + client = compute_v1.LicensesClient() + + # Initialize request argument(s) + request = compute_v1.UpdateLicenseRequest( + license_="license__value", + project="project_value", + ) + + # Make the request + response = client.update(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.compute_v1.types.UpdateLicenseRequest, dict]): + The request object. A request message for + Licenses.Update. See the method + description for details. + project (str): + Project ID for this request. + This corresponds to the ``project`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + license_ (str): + The license name for this request. + This corresponds to the ``license_`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + license_resource (google.cloud.compute_v1.types.License): + The body resource for this request + This corresponds to the ``license_resource`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + google.api_core.extended_operation.ExtendedOperation: + An object representing a extended + long-running operation. + + """ + # Create or coerce a protobuf request object. + # - Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + flattened_params = [project, license_, license_resource] + has_flattened_params = ( + len([param for param in flattened_params if param is not None]) > 0 + ) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + # - Use the request object if provided (there's no risk of modifying the input as + # there are no flattened fields), or create one. + if not isinstance(request, compute.UpdateLicenseRequest): + request = compute.UpdateLicenseRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if project is not None: + request.project = project + if license_ is not None: + request.license_ = license_ + if license_resource is not None: + request.license_resource = license_resource + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.update] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata( + ( + ("project", request.project), + ("license", request.license_), + ) + ), + ) + + # Validate the universe domain. + self._validate_universe_domain() + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + def update( + self, + request: Optional[Union[compute.UpdateLicenseRequest, dict]] = None, + *, + project: Optional[str] = None, + license_: Optional[str] = None, + license_resource: Optional[compute.License] = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> extended_operation.ExtendedOperation: + r"""Updates a License resource in the specified project. *Caution* + This resource is intended for use only by third-party partners + who are creating Cloud Marketplace images. + + .. code-block:: python + + # This snippet 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 as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import compute_v1 + + def sample_update(): + # Create a client + client = compute_v1.LicensesClient() + + # Initialize request argument(s) + request = compute_v1.UpdateLicenseRequest( + license_="license__value", + project="project_value", + ) + + # Make the request + response = client.update(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.compute_v1.types.UpdateLicenseRequest, dict]): + The request object. A request message for + Licenses.Update. See the method + description for details. + project (str): + Project ID for this request. + This corresponds to the ``project`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + license_ (str): + The license name for this request. + This corresponds to the ``license_`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + license_resource (google.cloud.compute_v1.types.License): + The body resource for this request + This corresponds to the ``license_resource`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + google.api_core.extended_operation.ExtendedOperation: + An object representing a extended + long-running operation. + + """ + # Create or coerce a protobuf request object. + # - Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + flattened_params = [project, license_, license_resource] + has_flattened_params = ( + len([param for param in flattened_params if param is not None]) > 0 + ) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + # - Use the request object if provided (there's no risk of modifying the input as + # there are no flattened fields), or create one. + if not isinstance(request, compute.UpdateLicenseRequest): + request = compute.UpdateLicenseRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if project is not None: + request.project = project + if license_ is not None: + request.license_ = license_ + if license_resource is not None: + request.license_resource = license_resource + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.update] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata( + ( + ("project", request.project), + ("license", request.license_), + ) + ), + ) + + # Validate the universe domain. + self._validate_universe_domain() + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + operation_service = self._transport._global_operations_client + operation_request = compute.GetGlobalOperationRequest() + operation_request.project = request.project + operation_request.operation = response.name + + get_operation = functools.partial(operation_service.get, operation_request) + # Cancel is not part of extended operations yet. + cancel_operation = lambda: None + + # Note: this class is an implementation detail to provide a uniform + # set of names for certain fields in the extended operation proto message. + # See google.api_core.extended_operation.ExtendedOperation for details + # on these properties and the expected interface. + class _CustomOperation(extended_operation.ExtendedOperation): + @property + def error_message(self): + return self._extended_operation.http_error_message + + @property + def error_code(self): + return self._extended_operation.http_error_status_code + + response = _CustomOperation.make(get_operation, cancel_operation, response) + + # Done; return the response. + return response + def __enter__(self) -> "LicensesClient": return self diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/licenses/transports/base.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/licenses/transports/base.py index 12fc92c155e7..74e41488069a 100644 --- a/packages/google-cloud-compute/google/cloud/compute_v1/services/licenses/transports/base.py +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/licenses/transports/base.py @@ -172,6 +172,11 @@ def _prep_wrapped_messages(self, client_info): default_timeout=None, client_info=client_info, ), + self.update: gapic_v1.method.wrap_method( + self.update, + default_timeout=None, + client_info=client_info, + ), } def close(self): @@ -247,6 +252,15 @@ def test_iam_permissions( ]: raise NotImplementedError() + @property + def update( + self, + ) -> Callable[ + [compute.UpdateLicenseRequest], + Union[compute.Operation, Awaitable[compute.Operation]], + ]: + raise NotImplementedError() + @property def kind(self) -> str: raise NotImplementedError() diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/licenses/transports/rest.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/licenses/transports/rest.py index d4ce44aa6a04..5bbc30a2daa8 100644 --- a/packages/google-cloud-compute/google/cloud/compute_v1/services/licenses/transports/rest.py +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/licenses/transports/rest.py @@ -128,6 +128,14 @@ def post_test_iam_permissions(self, response): logging.log(f"Received response: {response}") return response + def pre_update(self, request, metadata): + logging.log(f"Received request: {request}") + return request, metadata + + def post_update(self, response): + logging.log(f"Received response: {response}") + return response + transport = LicensesRestTransport(interceptor=MyCustomLicensesInterceptor()) client = LicensesClient(transport=transport) @@ -455,6 +463,50 @@ def post_test_iam_permissions_with_metadata( """ return response, metadata + def pre_update( + self, + request: compute.UpdateLicenseRequest, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[compute.UpdateLicenseRequest, Sequence[Tuple[str, Union[str, bytes]]]]: + """Pre-rpc interceptor for update + + Override in a subclass to manipulate the request or metadata + before they are sent to the Licenses server. + """ + return request, metadata + + def post_update(self, response: compute.Operation) -> compute.Operation: + """Post-rpc interceptor for update + + DEPRECATED. Please use the `post_update_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response + after it is returned by the Licenses server but before + it is returned to user code. This `post_update` interceptor runs + before the `post_update_with_metadata` interceptor. + """ + return response + + def post_update_with_metadata( + self, + response: compute.Operation, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[compute.Operation, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for update + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the Licenses server but before it is returned to user code. + + We recommend only using this `post_update_with_metadata` + interceptor in new development instead of the `post_update` interceptor. + When both interceptors are used, this `post_update_with_metadata` interceptor runs after the + `post_update` interceptor. The (possibly modified) response returned by + `post_update` will be passed to + `post_update_with_metadata`. + """ + return response, metadata + @dataclasses.dataclass class LicensesRestStub: @@ -1667,6 +1719,175 @@ def __call__( ) return resp + class _Update(_BaseLicensesRestTransport._BaseUpdate, LicensesRestStub): + def __hash__(self): + return hash("LicensesRestTransport.Update") + + @staticmethod + def _get_response( + host, + metadata, + query_params, + session, + timeout, + transcoded_request, + body=None, + ): + uri = transcoded_request["uri"] + method = transcoded_request["method"] + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = getattr(session, method)( + "{host}{uri}".format(host=host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + data=body, + ) + return response + + def __call__( + self, + request: compute.UpdateLicenseRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> compute.Operation: + r"""Call the update method over HTTP. + + Args: + request (~.compute.UpdateLicenseRequest): + The request object. A request message for + Licenses.Update. See the method + description for details. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + ~.compute.Operation: + Represents an Operation resource. Google Compute Engine + has three Operation resources: \* + `Global `__ + \* + `Regional `__ + \* + `Zonal `__ + You can use an operation resource to manage asynchronous + API requests. For more information, read Handling API + responses. Operations can be global, regional or zonal. + - For global operations, use the ``globalOperations`` + resource. - For regional operations, use the + ``regionOperations`` resource. - For zonal operations, + use the ``zoneOperations`` resource. For more + information, read Global, Regional, and Zonal Resources. + Note that completed Operation resources have a limited + retention period. + + """ + + http_options = _BaseLicensesRestTransport._BaseUpdate._get_http_options() + + request, metadata = self._interceptor.pre_update(request, metadata) + transcoded_request = ( + _BaseLicensesRestTransport._BaseUpdate._get_transcoded_request( + http_options, request + ) + ) + + body = _BaseLicensesRestTransport._BaseUpdate._get_request_body_json( + transcoded_request + ) + + # Jsonify the query params + query_params = ( + _BaseLicensesRestTransport._BaseUpdate._get_query_params_json( + transcoded_request + ) + ) + + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + try: + request_payload = type(request).to_json(request) + except: + request_payload = None + http_request = { + "payload": request_payload, + "requestMethod": method, + "requestUrl": request_url, + "headers": dict(metadata), + } + _LOGGER.debug( + f"Sending request for google.cloud.compute_v1.LicensesClient.Update", + extra={ + "serviceName": "google.cloud.compute.v1.Licenses", + "rpcName": "Update", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = LicensesRestTransport._Update._get_response( + self._host, + metadata, + query_params, + self._session, + timeout, + transcoded_request, + body, + ) + + # In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception + # subclass. + if response.status_code >= 400: + raise core_exceptions.from_http_response(response) + + # Return the response + resp = compute.Operation() + pb_resp = compute.Operation.pb(resp) + + json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True) + + resp = self._interceptor.post_update(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_update_with_metadata( + resp, response_metadata + ) + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + try: + response_payload = compute.Operation.to_json(response) + except: + response_payload = None + http_response = { + "payload": response_payload, + "headers": dict(response.headers), + "status": response.status_code, + } + _LOGGER.debug( + "Received response for google.cloud.compute_v1.LicensesClient.update", + extra={ + "serviceName": "google.cloud.compute.v1.Licenses", + "rpcName": "Update", + "metadata": http_response["headers"], + "httpResponse": http_response, + }, + ) + return resp + @property def delete(self) -> Callable[[compute.DeleteLicenseRequest], compute.Operation]: # The return type is fine, but mypy isn't sophisticated enough to determine what's going on here. @@ -1719,6 +1940,12 @@ def test_iam_permissions( # In C++ this would require a dynamic_cast return self._TestIamPermissions(self._session, self._host, self._interceptor) # type: ignore + @property + def update(self) -> Callable[[compute.UpdateLicenseRequest], compute.Operation]: + # The return type is fine, but mypy isn't sophisticated enough to determine what's going on here. + # In C++ this would require a dynamic_cast + return self._Update(self._session, self._host, self._interceptor) # type: ignore + @property def kind(self) -> str: return "rest" diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/licenses/transports/rest_base.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/licenses/transports/rest_base.py index ccf4193b1d9d..b4e878235f11 100644 --- a/packages/google-cloud-compute/google/cloud/compute_v1/services/licenses/transports/rest_base.py +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/licenses/transports/rest_base.py @@ -443,5 +443,63 @@ def _get_query_params_json(transcoded_request): return query_params + class _BaseUpdate: + def __hash__(self): # pragma: NO COVER + return NotImplementedError("__hash__ must be implemented.") + + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = { + "license": "", + } + + @classmethod + def _get_unset_required_fields(cls, message_dict): + return { + k: v + for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items() + if k not in message_dict + } + + @staticmethod + def _get_http_options(): + http_options: List[Dict[str, str]] = [ + { + "method": "patch", + "uri": "/compute/v1/projects/{project}/global/licenses/{license_}", + "body": "license_resource", + }, + ] + return http_options + + @staticmethod + def _get_transcoded_request(http_options, request): + pb_request = compute.UpdateLicenseRequest.pb(request) + transcoded_request = path_template.transcode(http_options, pb_request) + return transcoded_request + + @staticmethod + def _get_request_body_json(transcoded_request): + # Jsonify the request body + + body = json_format.MessageToJson( + transcoded_request["body"], use_integers_for_enums=False + ) + return body + + @staticmethod + def _get_query_params_json(transcoded_request): + query_params = json.loads( + json_format.MessageToJson( + transcoded_request["query_params"], + use_integers_for_enums=False, + ) + ) + query_params.update( + _BaseLicensesRestTransport._BaseUpdate._get_unset_required_fields( + query_params + ) + ) + + return query_params + __all__ = ("_BaseLicensesRestTransport",) diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/reservation_sub_blocks/__init__.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/reservation_sub_blocks/__init__.py new file mode 100644 index 000000000000..4a1a944ee416 --- /dev/null +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/reservation_sub_blocks/__init__.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from .client import ReservationSubBlocksClient + +__all__ = ("ReservationSubBlocksClient",) diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/reservation_sub_blocks/client.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/reservation_sub_blocks/client.py new file mode 100644 index 000000000000..e8e7cab78a29 --- /dev/null +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/reservation_sub_blocks/client.py @@ -0,0 +1,1016 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from collections import OrderedDict +from http import HTTPStatus +import json +import logging as std_logging +import os +import re +from typing import ( + Callable, + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, + cast, +) +import warnings + +from google.api_core import client_options as client_options_lib +from google.api_core import exceptions as core_exceptions +from google.api_core import gapic_v1 +from google.api_core import retry as retries +from google.auth import credentials as ga_credentials # type: ignore +from google.auth.exceptions import MutualTLSChannelError # type: ignore +from google.auth.transport import mtls # type: ignore +from google.auth.transport.grpc import SslCredentials # type: ignore +from google.oauth2 import service_account # type: ignore +import google.protobuf + +from google.cloud.compute_v1 import gapic_version as package_version + +try: + OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault, None] +except AttributeError: # pragma: NO COVER + OptionalRetry = Union[retries.Retry, object, None] # type: ignore + +try: + from google.api_core import client_logging # type: ignore + + CLIENT_LOGGING_SUPPORTED = True # pragma: NO COVER +except ImportError: # pragma: NO COVER + CLIENT_LOGGING_SUPPORTED = False + +_LOGGER = std_logging.getLogger(__name__) + +from google.cloud.compute_v1.services.reservation_sub_blocks import pagers +from google.cloud.compute_v1.types import compute + +from .transports.base import DEFAULT_CLIENT_INFO, ReservationSubBlocksTransport +from .transports.rest import ReservationSubBlocksRestTransport + + +class ReservationSubBlocksClientMeta(type): + """Metaclass for the ReservationSubBlocks client. + + This provides class-level methods for building and retrieving + support objects (e.g. transport) without polluting the client instance + objects. + """ + + _transport_registry = ( + OrderedDict() + ) # type: Dict[str, Type[ReservationSubBlocksTransport]] + _transport_registry["rest"] = ReservationSubBlocksRestTransport + + def get_transport_class( + cls, + label: Optional[str] = None, + ) -> Type[ReservationSubBlocksTransport]: + """Returns an appropriate transport class. + + Args: + label: The name of the desired transport. If none is + provided, then the first transport in the registry is used. + + Returns: + The transport class to use. + """ + # If a specific transport is requested, return that one. + if label: + return cls._transport_registry[label] + + # No transport is requested; return the default (that is, the first one + # in the dictionary). + return next(iter(cls._transport_registry.values())) + + +class ReservationSubBlocksClient(metaclass=ReservationSubBlocksClientMeta): + """The ReservationSubBlocks API.""" + + @staticmethod + def _get_default_mtls_endpoint(api_endpoint): + """Converts api endpoint to mTLS endpoint. + + Convert "*.sandbox.googleapis.com" and "*.googleapis.com" to + "*.mtls.sandbox.googleapis.com" and "*.mtls.googleapis.com" respectively. + Args: + api_endpoint (Optional[str]): the api endpoint to convert. + Returns: + str: converted mTLS api endpoint. + """ + if not api_endpoint: + return api_endpoint + + mtls_endpoint_re = re.compile( + r"(?P[^.]+)(?P\.mtls)?(?P\.sandbox)?(?P\.googleapis\.com)?" + ) + + m = mtls_endpoint_re.match(api_endpoint) + name, mtls, sandbox, googledomain = m.groups() + if mtls or not googledomain: + return api_endpoint + + if sandbox: + return api_endpoint.replace( + "sandbox.googleapis.com", "mtls.sandbox.googleapis.com" + ) + + return api_endpoint.replace(".googleapis.com", ".mtls.googleapis.com") + + # Note: DEFAULT_ENDPOINT is deprecated. Use _DEFAULT_ENDPOINT_TEMPLATE instead. + DEFAULT_ENDPOINT = "compute.googleapis.com" + DEFAULT_MTLS_ENDPOINT = _get_default_mtls_endpoint.__func__( # type: ignore + DEFAULT_ENDPOINT + ) + + _DEFAULT_ENDPOINT_TEMPLATE = "compute.{UNIVERSE_DOMAIN}" + _DEFAULT_UNIVERSE = "googleapis.com" + + @classmethod + def from_service_account_info(cls, info: dict, *args, **kwargs): + """Creates an instance of this client using the provided credentials + info. + + Args: + info (dict): The service account private key info. + args: Additional arguments to pass to the constructor. + kwargs: Additional arguments to pass to the constructor. + + Returns: + ReservationSubBlocksClient: The constructed client. + """ + credentials = service_account.Credentials.from_service_account_info(info) + kwargs["credentials"] = credentials + return cls(*args, **kwargs) + + @classmethod + def from_service_account_file(cls, filename: str, *args, **kwargs): + """Creates an instance of this client using the provided credentials + file. + + Args: + filename (str): The path to the service account private key json + file. + args: Additional arguments to pass to the constructor. + kwargs: Additional arguments to pass to the constructor. + + Returns: + ReservationSubBlocksClient: The constructed client. + """ + credentials = service_account.Credentials.from_service_account_file(filename) + kwargs["credentials"] = credentials + return cls(*args, **kwargs) + + from_service_account_json = from_service_account_file + + @property + def transport(self) -> ReservationSubBlocksTransport: + """Returns the transport used by the client instance. + + Returns: + ReservationSubBlocksTransport: The transport used by the client + instance. + """ + return self._transport + + @staticmethod + def common_billing_account_path( + billing_account: str, + ) -> str: + """Returns a fully-qualified billing_account string.""" + return "billingAccounts/{billing_account}".format( + billing_account=billing_account, + ) + + @staticmethod + def parse_common_billing_account_path(path: str) -> Dict[str, str]: + """Parse a billing_account path into its component segments.""" + m = re.match(r"^billingAccounts/(?P.+?)$", path) + return m.groupdict() if m else {} + + @staticmethod + def common_folder_path( + folder: str, + ) -> str: + """Returns a fully-qualified folder string.""" + return "folders/{folder}".format( + folder=folder, + ) + + @staticmethod + def parse_common_folder_path(path: str) -> Dict[str, str]: + """Parse a folder path into its component segments.""" + m = re.match(r"^folders/(?P.+?)$", path) + return m.groupdict() if m else {} + + @staticmethod + def common_organization_path( + organization: str, + ) -> str: + """Returns a fully-qualified organization string.""" + return "organizations/{organization}".format( + organization=organization, + ) + + @staticmethod + def parse_common_organization_path(path: str) -> Dict[str, str]: + """Parse a organization path into its component segments.""" + m = re.match(r"^organizations/(?P.+?)$", path) + return m.groupdict() if m else {} + + @staticmethod + def common_project_path( + project: str, + ) -> str: + """Returns a fully-qualified project string.""" + return "projects/{project}".format( + project=project, + ) + + @staticmethod + def parse_common_project_path(path: str) -> Dict[str, str]: + """Parse a project path into its component segments.""" + m = re.match(r"^projects/(?P.+?)$", path) + return m.groupdict() if m else {} + + @staticmethod + def common_location_path( + project: str, + location: str, + ) -> str: + """Returns a fully-qualified location string.""" + return "projects/{project}/locations/{location}".format( + project=project, + location=location, + ) + + @staticmethod + def parse_common_location_path(path: str) -> Dict[str, str]: + """Parse a location path into its component segments.""" + m = re.match(r"^projects/(?P.+?)/locations/(?P.+?)$", path) + return m.groupdict() if m else {} + + @classmethod + def get_mtls_endpoint_and_cert_source( + cls, client_options: Optional[client_options_lib.ClientOptions] = None + ): + """Deprecated. Return the API endpoint and client cert source for mutual TLS. + + The client cert source is determined in the following order: + (1) if `GOOGLE_API_USE_CLIENT_CERTIFICATE` environment variable is not "true", the + client cert source is None. + (2) if `client_options.client_cert_source` is provided, use the provided one; if the + default client cert source exists, use the default one; otherwise the client cert + source is None. + + The API endpoint is determined in the following order: + (1) if `client_options.api_endpoint` if provided, use the provided one. + (2) if `GOOGLE_API_USE_CLIENT_CERTIFICATE` environment variable is "always", use the + default mTLS endpoint; if the environment variable is "never", use the default API + endpoint; otherwise if client cert source exists, use the default mTLS endpoint, otherwise + use the default API endpoint. + + More details can be found at https://google.aip.dev/auth/4114. + + Args: + client_options (google.api_core.client_options.ClientOptions): Custom options for the + client. Only the `api_endpoint` and `client_cert_source` properties may be used + in this method. + + Returns: + Tuple[str, Callable[[], Tuple[bytes, bytes]]]: returns the API endpoint and the + client cert source to use. + + Raises: + google.auth.exceptions.MutualTLSChannelError: If any errors happen. + """ + + warnings.warn( + "get_mtls_endpoint_and_cert_source is deprecated. Use the api_endpoint property instead.", + DeprecationWarning, + ) + if client_options is None: + client_options = client_options_lib.ClientOptions() + use_client_cert = os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false") + use_mtls_endpoint = os.getenv("GOOGLE_API_USE_MTLS_ENDPOINT", "auto") + if use_client_cert not in ("true", "false"): + raise ValueError( + "Environment variable `GOOGLE_API_USE_CLIENT_CERTIFICATE` must be either `true` or `false`" + ) + if use_mtls_endpoint not in ("auto", "never", "always"): + raise MutualTLSChannelError( + "Environment variable `GOOGLE_API_USE_MTLS_ENDPOINT` must be `never`, `auto` or `always`" + ) + + # Figure out the client cert source to use. + client_cert_source = None + if use_client_cert == "true": + if client_options.client_cert_source: + client_cert_source = client_options.client_cert_source + elif mtls.has_default_client_cert_source(): + client_cert_source = mtls.default_client_cert_source() + + # Figure out which api endpoint to use. + if client_options.api_endpoint is not None: + api_endpoint = client_options.api_endpoint + elif use_mtls_endpoint == "always" or ( + use_mtls_endpoint == "auto" and client_cert_source + ): + api_endpoint = cls.DEFAULT_MTLS_ENDPOINT + else: + api_endpoint = cls.DEFAULT_ENDPOINT + + return api_endpoint, client_cert_source + + @staticmethod + def _read_environment_variables(): + """Returns the environment variables used by the client. + + Returns: + Tuple[bool, str, str]: returns the GOOGLE_API_USE_CLIENT_CERTIFICATE, + GOOGLE_API_USE_MTLS_ENDPOINT, and GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variables. + + Raises: + ValueError: If GOOGLE_API_USE_CLIENT_CERTIFICATE is not + any of ["true", "false"]. + google.auth.exceptions.MutualTLSChannelError: If GOOGLE_API_USE_MTLS_ENDPOINT + is not any of ["auto", "never", "always"]. + """ + use_client_cert = os.getenv( + "GOOGLE_API_USE_CLIENT_CERTIFICATE", "false" + ).lower() + use_mtls_endpoint = os.getenv("GOOGLE_API_USE_MTLS_ENDPOINT", "auto").lower() + universe_domain_env = os.getenv("GOOGLE_CLOUD_UNIVERSE_DOMAIN") + if use_client_cert not in ("true", "false"): + raise ValueError( + "Environment variable `GOOGLE_API_USE_CLIENT_CERTIFICATE` must be either `true` or `false`" + ) + if use_mtls_endpoint not in ("auto", "never", "always"): + raise MutualTLSChannelError( + "Environment variable `GOOGLE_API_USE_MTLS_ENDPOINT` must be `never`, `auto` or `always`" + ) + return use_client_cert == "true", use_mtls_endpoint, universe_domain_env + + @staticmethod + def _get_client_cert_source(provided_cert_source, use_cert_flag): + """Return the client cert source to be used by the client. + + Args: + provided_cert_source (bytes): The client certificate source provided. + use_cert_flag (bool): A flag indicating whether to use the client certificate. + + Returns: + bytes or None: The client cert source to be used by the client. + """ + client_cert_source = None + if use_cert_flag: + if provided_cert_source: + client_cert_source = provided_cert_source + elif mtls.has_default_client_cert_source(): + client_cert_source = mtls.default_client_cert_source() + return client_cert_source + + @staticmethod + def _get_api_endpoint( + api_override, client_cert_source, universe_domain, use_mtls_endpoint + ): + """Return the API endpoint used by the client. + + Args: + api_override (str): The API endpoint override. If specified, this is always + the return value of this function and the other arguments are not used. + client_cert_source (bytes): The client certificate source used by the client. + universe_domain (str): The universe domain used by the client. + use_mtls_endpoint (str): How to use the mTLS endpoint, which depends also on the other parameters. + Possible values are "always", "auto", or "never". + + Returns: + str: The API endpoint to be used by the client. + """ + if api_override is not None: + api_endpoint = api_override + elif use_mtls_endpoint == "always" or ( + use_mtls_endpoint == "auto" and client_cert_source + ): + _default_universe = ReservationSubBlocksClient._DEFAULT_UNIVERSE + if universe_domain != _default_universe: + raise MutualTLSChannelError( + f"mTLS is not supported in any universe other than {_default_universe}." + ) + api_endpoint = ReservationSubBlocksClient.DEFAULT_MTLS_ENDPOINT + else: + api_endpoint = ReservationSubBlocksClient._DEFAULT_ENDPOINT_TEMPLATE.format( + UNIVERSE_DOMAIN=universe_domain + ) + return api_endpoint + + @staticmethod + def _get_universe_domain( + client_universe_domain: Optional[str], universe_domain_env: Optional[str] + ) -> str: + """Return the universe domain used by the client. + + Args: + client_universe_domain (Optional[str]): The universe domain configured via the client options. + universe_domain_env (Optional[str]): The universe domain configured via the "GOOGLE_CLOUD_UNIVERSE_DOMAIN" environment variable. + + Returns: + str: The universe domain to be used by the client. + + Raises: + ValueError: If the universe domain is an empty string. + """ + universe_domain = ReservationSubBlocksClient._DEFAULT_UNIVERSE + if client_universe_domain is not None: + universe_domain = client_universe_domain + elif universe_domain_env is not None: + universe_domain = universe_domain_env + if len(universe_domain.strip()) == 0: + raise ValueError("Universe Domain cannot be an empty string.") + return universe_domain + + def _validate_universe_domain(self): + """Validates client's and credentials' universe domains are consistent. + + Returns: + bool: True iff the configured universe domain is valid. + + Raises: + ValueError: If the configured universe domain is not valid. + """ + + # NOTE (b/349488459): universe validation is disabled until further notice. + return True + + def _add_cred_info_for_auth_errors( + self, error: core_exceptions.GoogleAPICallError + ) -> None: + """Adds credential info string to error details for 401/403/404 errors. + + Args: + error (google.api_core.exceptions.GoogleAPICallError): The error to add the cred info. + """ + if error.code not in [ + HTTPStatus.UNAUTHORIZED, + HTTPStatus.FORBIDDEN, + HTTPStatus.NOT_FOUND, + ]: + return + + cred = self._transport._credentials + + # get_cred_info is only available in google-auth>=2.35.0 + if not hasattr(cred, "get_cred_info"): + return + + # ignore the type check since pypy test fails when get_cred_info + # is not available + cred_info = cred.get_cred_info() # type: ignore + if cred_info and hasattr(error._details, "append"): + error._details.append(json.dumps(cred_info)) + + @property + def api_endpoint(self): + """Return the API endpoint used by the client instance. + + Returns: + str: The API endpoint used by the client instance. + """ + return self._api_endpoint + + @property + def universe_domain(self) -> str: + """Return the universe domain used by the client instance. + + Returns: + str: The universe domain used by the client instance. + """ + return self._universe_domain + + def __init__( + self, + *, + credentials: Optional[ga_credentials.Credentials] = None, + transport: Optional[ + Union[ + str, + ReservationSubBlocksTransport, + Callable[..., ReservationSubBlocksTransport], + ] + ] = None, + client_options: Optional[Union[client_options_lib.ClientOptions, dict]] = None, + client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, + ) -> None: + """Instantiates the reservation sub blocks client. + + Args: + credentials (Optional[google.auth.credentials.Credentials]): The + authorization credentials to attach to requests. These + credentials identify the application to the service; if none + are specified, the client will attempt to ascertain the + credentials from the environment. + transport (Optional[Union[str,ReservationSubBlocksTransport,Callable[..., ReservationSubBlocksTransport]]]): + The transport to use, or a Callable that constructs and returns a new transport. + If a Callable is given, it will be called with the same set of initialization + arguments as used in the ReservationSubBlocksTransport constructor. + If set to None, a transport is chosen automatically. + NOTE: "rest" transport functionality is currently in a + beta state (preview). We welcome your feedback via an + issue in this library's source repository. + client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]): + Custom options for the client. + + 1. The ``api_endpoint`` property can be used to override the + default endpoint provided by the client when ``transport`` is + not explicitly provided. Only if this property is not set and + ``transport`` was not explicitly provided, the endpoint is + determined by the GOOGLE_API_USE_MTLS_ENDPOINT environment + variable, which have one of the following values: + "always" (always use the default mTLS endpoint), "never" (always + use the default regular endpoint) and "auto" (auto-switch to the + default mTLS endpoint if client certificate is present; this is + the default value). + + 2. If the GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable + is "true", then the ``client_cert_source`` property can be used + to provide a client certificate for mTLS transport. If + not provided, the default SSL client certificate will be used if + present. If GOOGLE_API_USE_CLIENT_CERTIFICATE is "false" or not + set, no client certificate will be used. + + 3. The ``universe_domain`` property can be used to override the + default "googleapis.com" universe. Note that the ``api_endpoint`` + property still takes precedence; and ``universe_domain`` is + currently not supported for mTLS. + + client_info (google.api_core.gapic_v1.client_info.ClientInfo): + The client info used to send a user-agent string along with + API requests. If ``None``, then default info will be used. + Generally, you only need to set this if you're developing + your own client library. + + Raises: + google.auth.exceptions.MutualTLSChannelError: If mutual TLS transport + creation failed for any reason. + """ + self._client_options = client_options + if isinstance(self._client_options, dict): + self._client_options = client_options_lib.from_dict(self._client_options) + if self._client_options is None: + self._client_options = client_options_lib.ClientOptions() + self._client_options = cast( + client_options_lib.ClientOptions, self._client_options + ) + + universe_domain_opt = getattr(self._client_options, "universe_domain", None) + + ( + self._use_client_cert, + self._use_mtls_endpoint, + self._universe_domain_env, + ) = ReservationSubBlocksClient._read_environment_variables() + self._client_cert_source = ReservationSubBlocksClient._get_client_cert_source( + self._client_options.client_cert_source, self._use_client_cert + ) + self._universe_domain = ReservationSubBlocksClient._get_universe_domain( + universe_domain_opt, self._universe_domain_env + ) + self._api_endpoint = None # updated below, depending on `transport` + + # Initialize the universe domain validation. + self._is_universe_domain_valid = False + + if CLIENT_LOGGING_SUPPORTED: # pragma: NO COVER + # Setup logging. + client_logging.initialize_logging() + + api_key_value = getattr(self._client_options, "api_key", None) + if api_key_value and credentials: + raise ValueError( + "client_options.api_key and credentials are mutually exclusive" + ) + + # Save or instantiate the transport. + # Ordinarily, we provide the transport, but allowing a custom transport + # instance provides an extensibility point for unusual situations. + transport_provided = isinstance(transport, ReservationSubBlocksTransport) + if transport_provided: + # transport is a ReservationSubBlocksTransport instance. + if credentials or self._client_options.credentials_file or api_key_value: + raise ValueError( + "When providing a transport instance, " + "provide its credentials directly." + ) + if self._client_options.scopes: + raise ValueError( + "When providing a transport instance, provide its scopes " + "directly." + ) + self._transport = cast(ReservationSubBlocksTransport, transport) + self._api_endpoint = self._transport.host + + self._api_endpoint = ( + self._api_endpoint + or ReservationSubBlocksClient._get_api_endpoint( + self._client_options.api_endpoint, + self._client_cert_source, + self._universe_domain, + self._use_mtls_endpoint, + ) + ) + + if not transport_provided: + import google.auth._default # type: ignore + + if api_key_value and hasattr( + google.auth._default, "get_api_key_credentials" + ): + credentials = google.auth._default.get_api_key_credentials( + api_key_value + ) + + transport_init: Union[ + Type[ReservationSubBlocksTransport], + Callable[..., ReservationSubBlocksTransport], + ] = ( + ReservationSubBlocksClient.get_transport_class(transport) + if isinstance(transport, str) or transport is None + else cast(Callable[..., ReservationSubBlocksTransport], transport) + ) + # initialize with the provided callable or the passed in class + self._transport = transport_init( + credentials=credentials, + credentials_file=self._client_options.credentials_file, + host=self._api_endpoint, + scopes=self._client_options.scopes, + client_cert_source_for_mtls=self._client_cert_source, + quota_project_id=self._client_options.quota_project_id, + client_info=client_info, + always_use_jwt_access=True, + api_audience=self._client_options.api_audience, + ) + + if "async" not in str(self._transport): + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + std_logging.DEBUG + ): # pragma: NO COVER + _LOGGER.debug( + "Created client `google.cloud.compute_v1.ReservationSubBlocksClient`.", + extra={ + "serviceName": "google.cloud.compute.v1.ReservationSubBlocks", + "universeDomain": getattr( + self._transport._credentials, "universe_domain", "" + ), + "credentialsType": f"{type(self._transport._credentials).__module__}.{type(self._transport._credentials).__qualname__}", + "credentialsInfo": getattr( + self.transport._credentials, "get_cred_info", lambda: None + )(), + } + if hasattr(self._transport, "_credentials") + else { + "serviceName": "google.cloud.compute.v1.ReservationSubBlocks", + "credentialsType": None, + }, + ) + + def get( + self, + request: Optional[Union[compute.GetReservationSubBlockRequest, dict]] = None, + *, + project: Optional[str] = None, + zone: Optional[str] = None, + parent_name: Optional[str] = None, + reservation_sub_block: Optional[str] = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> compute.ReservationSubBlocksGetResponse: + r"""Retrieves information about the specified reservation + subBlock. + + .. code-block:: python + + # This snippet 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 as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import compute_v1 + + def sample_get(): + # Create a client + client = compute_v1.ReservationSubBlocksClient() + + # Initialize request argument(s) + request = compute_v1.GetReservationSubBlockRequest( + parent_name="parent_name_value", + project="project_value", + reservation_sub_block="reservation_sub_block_value", + zone="zone_value", + ) + + # Make the request + response = client.get(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.compute_v1.types.GetReservationSubBlockRequest, dict]): + The request object. A request message for + ReservationSubBlocks.Get. See the method + description for details. + project (str): + Project ID for this request. + This corresponds to the ``project`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + zone (str): + Name of the zone for this request. + Zone name should conform to RFC1035. + + This corresponds to the ``zone`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + parent_name (str): + The name of the parent reservation and parent block. In + the format of + reservations/{reservation_name}/reservationBlocks/{reservation_block_name} + + This corresponds to the ``parent_name`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + reservation_sub_block (str): + The name of the reservation subBlock. + Name should conform to RFC1035 or be a + resource ID. + + This corresponds to the ``reservation_sub_block`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + google.cloud.compute_v1.types.ReservationSubBlocksGetResponse: + + """ + # Create or coerce a protobuf request object. + # - Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + flattened_params = [project, zone, parent_name, reservation_sub_block] + has_flattened_params = ( + len([param for param in flattened_params if param is not None]) > 0 + ) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + # - Use the request object if provided (there's no risk of modifying the input as + # there are no flattened fields), or create one. + if not isinstance(request, compute.GetReservationSubBlockRequest): + request = compute.GetReservationSubBlockRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if project is not None: + request.project = project + if zone is not None: + request.zone = zone + if parent_name is not None: + request.parent_name = parent_name + if reservation_sub_block is not None: + request.reservation_sub_block = reservation_sub_block + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.get] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata( + ( + ("project", request.project), + ("zone", request.zone), + ("parent_name", request.parent_name), + ("reservation_sub_block", request.reservation_sub_block), + ) + ), + ) + + # Validate the universe domain. + self._validate_universe_domain() + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + def list( + self, + request: Optional[Union[compute.ListReservationSubBlocksRequest, dict]] = None, + *, + project: Optional[str] = None, + zone: Optional[str] = None, + parent_name: Optional[str] = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> pagers.ListPager: + r"""Retrieves a list of reservation subBlocks under a + single reservation. + + .. code-block:: python + + # This snippet 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 as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import compute_v1 + + def sample_list(): + # Create a client + client = compute_v1.ReservationSubBlocksClient() + + # Initialize request argument(s) + request = compute_v1.ListReservationSubBlocksRequest( + parent_name="parent_name_value", + project="project_value", + zone="zone_value", + ) + + # Make the request + page_result = client.list(request=request) + + # Handle the response + for response in page_result: + print(response) + + Args: + request (Union[google.cloud.compute_v1.types.ListReservationSubBlocksRequest, dict]): + The request object. A request message for + ReservationSubBlocks.List. See the + method description for details. + project (str): + Project ID for this request. + This corresponds to the ``project`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + zone (str): + Name of the zone for this request. + Zone name should conform to RFC1035. + + This corresponds to the ``zone`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + parent_name (str): + The name of the parent reservation and parent block. In + the format of + reservations/{reservation_name}/reservationBlocks/{reservation_block_name} + + This corresponds to the ``parent_name`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + google.cloud.compute_v1.services.reservation_sub_blocks.pagers.ListPager: + A list of reservation subBlocks under + a single reservation. + Iterating over this object will yield + results and resolve additional pages + automatically. + + """ + # Create or coerce a protobuf request object. + # - Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + flattened_params = [project, zone, parent_name] + has_flattened_params = ( + len([param for param in flattened_params if param is not None]) > 0 + ) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + # - Use the request object if provided (there's no risk of modifying the input as + # there are no flattened fields), or create one. + if not isinstance(request, compute.ListReservationSubBlocksRequest): + request = compute.ListReservationSubBlocksRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if project is not None: + request.project = project + if zone is not None: + request.zone = zone + if parent_name is not None: + request.parent_name = parent_name + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.list] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata( + ( + ("project", request.project), + ("zone", request.zone), + ("parent_name", request.parent_name), + ) + ), + ) + + # Validate the universe domain. + self._validate_universe_domain() + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # This method is paged; wrap the response in a pager, which provides + # an `__iter__` convenience method. + response = pagers.ListPager( + method=rpc, + request=request, + response=response, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + def __enter__(self) -> "ReservationSubBlocksClient": + return self + + def __exit__(self, type, value, traceback): + """Releases underlying transport's resources. + + .. warning:: + ONLY use as a context manager if the transport is NOT shared + with other clients! Exiting the with block will CLOSE the transport + and may cause errors in other clients! + """ + self.transport.close() + + +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) + +if hasattr(DEFAULT_CLIENT_INFO, "protobuf_runtime_version"): # pragma: NO COVER + DEFAULT_CLIENT_INFO.protobuf_runtime_version = google.protobuf.__version__ + +__all__ = ("ReservationSubBlocksClient",) diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/reservation_sub_blocks/pagers.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/reservation_sub_blocks/pagers.py new file mode 100644 index 000000000000..26b2474f58f0 --- /dev/null +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/reservation_sub_blocks/pagers.py @@ -0,0 +1,117 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from typing import ( + Any, + AsyncIterator, + Awaitable, + Callable, + Iterator, + Optional, + Sequence, + Tuple, + Union, +) + +from google.api_core import gapic_v1 +from google.api_core import retry as retries +from google.api_core import retry_async as retries_async + +try: + OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault, None] + OptionalAsyncRetry = Union[ + retries_async.AsyncRetry, gapic_v1.method._MethodDefault, None + ] +except AttributeError: # pragma: NO COVER + OptionalRetry = Union[retries.Retry, object, None] # type: ignore + OptionalAsyncRetry = Union[retries_async.AsyncRetry, object, None] # type: ignore + +from google.cloud.compute_v1.types import compute + + +class ListPager: + """A pager for iterating through ``list`` requests. + + This class thinly wraps an initial + :class:`google.cloud.compute_v1.types.ReservationSubBlocksListResponse` object, and + provides an ``__iter__`` method to iterate through its + ``items`` field. + + If there are more pages, the ``__iter__`` method will make additional + ``List`` requests and continue to iterate + through the ``items`` field on the + corresponding responses. + + All the usual :class:`google.cloud.compute_v1.types.ReservationSubBlocksListResponse` + attributes are available on the pager. If multiple requests are made, only + the most recent response is retained, and thus used for attribute lookup. + """ + + def __init__( + self, + method: Callable[..., compute.ReservationSubBlocksListResponse], + request: compute.ListReservationSubBlocksRequest, + response: compute.ReservationSubBlocksListResponse, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = () + ): + """Instantiate the pager. + + Args: + method (Callable): The method that was originally called, and + which instantiated this pager. + request (google.cloud.compute_v1.types.ListReservationSubBlocksRequest): + The initial request object. + response (google.cloud.compute_v1.types.ReservationSubBlocksListResponse): + The initial response object. + retry (google.api_core.retry.Retry): Designation of what errors, + if any, should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + """ + self._method = method + self._request = compute.ListReservationSubBlocksRequest(request) + self._response = response + self._retry = retry + self._timeout = timeout + self._metadata = metadata + + def __getattr__(self, name: str) -> Any: + return getattr(self._response, name) + + @property + def pages(self) -> Iterator[compute.ReservationSubBlocksListResponse]: + yield self._response + while self._response.next_page_token: + self._request.page_token = self._response.next_page_token + self._response = self._method( + self._request, + retry=self._retry, + timeout=self._timeout, + metadata=self._metadata, + ) + yield self._response + + def __iter__(self) -> Iterator[compute.ReservationSubBlock]: + for page in self.pages: + yield from page.items + + def __repr__(self) -> str: + return "{0}<{1!r}>".format(self.__class__.__name__, self._response) diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/reservation_sub_blocks/transports/README.rst b/packages/google-cloud-compute/google/cloud/compute_v1/services/reservation_sub_blocks/transports/README.rst new file mode 100644 index 000000000000..5c23b59d8c44 --- /dev/null +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/reservation_sub_blocks/transports/README.rst @@ -0,0 +1,9 @@ + +transport inheritance structure +_______________________________ + +`ReservationSubBlocksTransport` is the ABC for all transports. +- public child `ReservationSubBlocksGrpcTransport` for sync gRPC transport (defined in `grpc.py`). +- public child `ReservationSubBlocksGrpcAsyncIOTransport` for async gRPC transport (defined in `grpc_asyncio.py`). +- private child `_BaseReservationSubBlocksRestTransport` for base REST transport with inner classes `_BaseMETHOD` (defined in `rest_base.py`). +- public child `ReservationSubBlocksRestTransport` for sync REST transport with inner classes `METHOD` derived from the parent's corresponding `_BaseMETHOD` classes (defined in `rest.py`). diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/reservation_sub_blocks/transports/__init__.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/reservation_sub_blocks/transports/__init__.py new file mode 100644 index 000000000000..b1aa0cc62777 --- /dev/null +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/reservation_sub_blocks/transports/__init__.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from collections import OrderedDict +from typing import Dict, Type + +from .base import ReservationSubBlocksTransport +from .rest import ReservationSubBlocksRestInterceptor, ReservationSubBlocksRestTransport + +# Compile a registry of transports. +_transport_registry = ( + OrderedDict() +) # type: Dict[str, Type[ReservationSubBlocksTransport]] +_transport_registry["rest"] = ReservationSubBlocksRestTransport + +__all__ = ( + "ReservationSubBlocksTransport", + "ReservationSubBlocksRestTransport", + "ReservationSubBlocksRestInterceptor", +) diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/reservation_sub_blocks/transports/base.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/reservation_sub_blocks/transports/base.py new file mode 100644 index 000000000000..b76206257cba --- /dev/null +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/reservation_sub_blocks/transports/base.py @@ -0,0 +1,189 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +import abc +from typing import Awaitable, Callable, Dict, Optional, Sequence, Union + +import google.api_core +from google.api_core import exceptions as core_exceptions +from google.api_core import gapic_v1 +from google.api_core import retry as retries +import google.auth # type: ignore +from google.auth import credentials as ga_credentials # type: ignore +from google.oauth2 import service_account # type: ignore +import google.protobuf + +from google.cloud.compute_v1 import gapic_version as package_version +from google.cloud.compute_v1.types import compute + +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) + +if hasattr(DEFAULT_CLIENT_INFO, "protobuf_runtime_version"): # pragma: NO COVER + DEFAULT_CLIENT_INFO.protobuf_runtime_version = google.protobuf.__version__ + + +class ReservationSubBlocksTransport(abc.ABC): + """Abstract transport class for ReservationSubBlocks.""" + + AUTH_SCOPES = ( + "https://www.googleapis.com/auth/compute.readonly", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/cloud-platform", + ) + + DEFAULT_HOST: str = "compute.googleapis.com" + + def __init__( + self, + *, + host: str = DEFAULT_HOST, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, + scopes: Optional[Sequence[str]] = None, + quota_project_id: Optional[str] = None, + client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, + always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, + **kwargs, + ) -> None: + """Instantiate the transport. + + Args: + host (Optional[str]): + The hostname to connect to (default: 'compute.googleapis.com'). + credentials (Optional[google.auth.credentials.Credentials]): The + authorization credentials to attach to requests. These + credentials identify the application to the service; if none + are specified, the client will attempt to ascertain the + credentials from the environment. + credentials_file (Optional[str]): A file with credentials that can + be loaded with :func:`google.auth.load_credentials_from_file`. + This argument is mutually exclusive with credentials. + scopes (Optional[Sequence[str]]): A list of scopes. + quota_project_id (Optional[str]): An optional project to use for billing + and quota. + client_info (google.api_core.gapic_v1.client_info.ClientInfo): + The client info used to send a user-agent string along with + API requests. If ``None``, then default info will be used. + Generally, you only need to set this if you're developing + your own client library. + always_use_jwt_access (Optional[bool]): Whether self signed JWT should + be used for service account credentials. + """ + + scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} + + # Save the scopes. + self._scopes = scopes + if not hasattr(self, "_ignore_credentials"): + self._ignore_credentials: bool = False + + # If no credentials are provided, then determine the appropriate + # defaults. + if credentials and credentials_file: + raise core_exceptions.DuplicateCredentialArgs( + "'credentials_file' and 'credentials' are mutually exclusive" + ) + + if credentials_file is not None: + credentials, _ = google.auth.load_credentials_from_file( + credentials_file, **scopes_kwargs, quota_project_id=quota_project_id + ) + elif credentials is None and not self._ignore_credentials: + credentials, _ = google.auth.default( + **scopes_kwargs, quota_project_id=quota_project_id + ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) + + # If the credentials are service account credentials, then always try to use self signed JWT. + if ( + always_use_jwt_access + and isinstance(credentials, service_account.Credentials) + and hasattr(service_account.Credentials, "with_always_use_jwt_access") + ): + credentials = credentials.with_always_use_jwt_access(True) + + # Save the credentials. + self._credentials = credentials + + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + + @property + def host(self): + return self._host + + def _prep_wrapped_messages(self, client_info): + # Precompute the wrapped methods. + self._wrapped_methods = { + self.get: gapic_v1.method.wrap_method( + self.get, + default_timeout=None, + client_info=client_info, + ), + self.list: gapic_v1.method.wrap_method( + self.list, + default_timeout=None, + client_info=client_info, + ), + } + + def close(self): + """Closes resources associated with the transport. + + .. warning:: + Only call this method if the transport is NOT shared + with other clients - this may cause errors in other clients! + """ + raise NotImplementedError() + + @property + def get( + self, + ) -> Callable[ + [compute.GetReservationSubBlockRequest], + Union[ + compute.ReservationSubBlocksGetResponse, + Awaitable[compute.ReservationSubBlocksGetResponse], + ], + ]: + raise NotImplementedError() + + @property + def list( + self, + ) -> Callable[ + [compute.ListReservationSubBlocksRequest], + Union[ + compute.ReservationSubBlocksListResponse, + Awaitable[compute.ReservationSubBlocksListResponse], + ], + ]: + raise NotImplementedError() + + @property + def kind(self) -> str: + raise NotImplementedError() + + +__all__ = ("ReservationSubBlocksTransport",) diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/reservation_sub_blocks/transports/rest.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/reservation_sub_blocks/transports/rest.py new file mode 100644 index 000000000000..c79af154f6d5 --- /dev/null +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/reservation_sub_blocks/transports/rest.py @@ -0,0 +1,618 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +import dataclasses +import json # type: ignore +import logging +from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple, Union +import warnings + +from google.api_core import exceptions as core_exceptions +from google.api_core import gapic_v1, rest_helpers, rest_streaming +from google.api_core import retry as retries +from google.auth import credentials as ga_credentials # type: ignore +from google.auth.transport.requests import AuthorizedSession # type: ignore +import google.protobuf +from google.protobuf import json_format +from requests import __version__ as requests_version + +from google.cloud.compute_v1.types import compute + +from .base import DEFAULT_CLIENT_INFO as BASE_DEFAULT_CLIENT_INFO +from .rest_base import _BaseReservationSubBlocksRestTransport + +try: + OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault, None] +except AttributeError: # pragma: NO COVER + OptionalRetry = Union[retries.Retry, object, None] # type: ignore + +try: + from google.api_core import client_logging # type: ignore + + CLIENT_LOGGING_SUPPORTED = True # pragma: NO COVER +except ImportError: # pragma: NO COVER + CLIENT_LOGGING_SUPPORTED = False + +_LOGGER = logging.getLogger(__name__) + +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=BASE_DEFAULT_CLIENT_INFO.gapic_version, + grpc_version=None, + rest_version=f"requests@{requests_version}", +) + +if hasattr(DEFAULT_CLIENT_INFO, "protobuf_runtime_version"): # pragma: NO COVER + DEFAULT_CLIENT_INFO.protobuf_runtime_version = google.protobuf.__version__ + + +class ReservationSubBlocksRestInterceptor: + """Interceptor for ReservationSubBlocks. + + Interceptors are used to manipulate requests, request metadata, and responses + in arbitrary ways. + Example use cases include: + * Logging + * Verifying requests according to service or custom semantics + * Stripping extraneous information from responses + + These use cases and more can be enabled by injecting an + instance of a custom subclass when constructing the ReservationSubBlocksRestTransport. + + .. code-block:: python + class MyCustomReservationSubBlocksInterceptor(ReservationSubBlocksRestInterceptor): + def pre_get(self, request, metadata): + logging.log(f"Received request: {request}") + return request, metadata + + def post_get(self, response): + logging.log(f"Received response: {response}") + return response + + def pre_list(self, request, metadata): + logging.log(f"Received request: {request}") + return request, metadata + + def post_list(self, response): + logging.log(f"Received response: {response}") + return response + + transport = ReservationSubBlocksRestTransport(interceptor=MyCustomReservationSubBlocksInterceptor()) + client = ReservationSubBlocksClient(transport=transport) + + + """ + + def pre_get( + self, + request: compute.GetReservationSubBlockRequest, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + compute.GetReservationSubBlockRequest, Sequence[Tuple[str, Union[str, bytes]]] + ]: + """Pre-rpc interceptor for get + + Override in a subclass to manipulate the request or metadata + before they are sent to the ReservationSubBlocks server. + """ + return request, metadata + + def post_get( + self, response: compute.ReservationSubBlocksGetResponse + ) -> compute.ReservationSubBlocksGetResponse: + """Post-rpc interceptor for get + + DEPRECATED. Please use the `post_get_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response + after it is returned by the ReservationSubBlocks server but before + it is returned to user code. This `post_get` interceptor runs + before the `post_get_with_metadata` interceptor. + """ + return response + + def post_get_with_metadata( + self, + response: compute.ReservationSubBlocksGetResponse, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + compute.ReservationSubBlocksGetResponse, Sequence[Tuple[str, Union[str, bytes]]] + ]: + """Post-rpc interceptor for get + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the ReservationSubBlocks server but before it is returned to user code. + + We recommend only using this `post_get_with_metadata` + interceptor in new development instead of the `post_get` interceptor. + When both interceptors are used, this `post_get_with_metadata` interceptor runs after the + `post_get` interceptor. The (possibly modified) response returned by + `post_get` will be passed to + `post_get_with_metadata`. + """ + return response, metadata + + def pre_list( + self, + request: compute.ListReservationSubBlocksRequest, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + compute.ListReservationSubBlocksRequest, Sequence[Tuple[str, Union[str, bytes]]] + ]: + """Pre-rpc interceptor for list + + Override in a subclass to manipulate the request or metadata + before they are sent to the ReservationSubBlocks server. + """ + return request, metadata + + def post_list( + self, response: compute.ReservationSubBlocksListResponse + ) -> compute.ReservationSubBlocksListResponse: + """Post-rpc interceptor for list + + DEPRECATED. Please use the `post_list_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response + after it is returned by the ReservationSubBlocks server but before + it is returned to user code. This `post_list` interceptor runs + before the `post_list_with_metadata` interceptor. + """ + return response + + def post_list_with_metadata( + self, + response: compute.ReservationSubBlocksListResponse, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + compute.ReservationSubBlocksListResponse, + Sequence[Tuple[str, Union[str, bytes]]], + ]: + """Post-rpc interceptor for list + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the ReservationSubBlocks server but before it is returned to user code. + + We recommend only using this `post_list_with_metadata` + interceptor in new development instead of the `post_list` interceptor. + When both interceptors are used, this `post_list_with_metadata` interceptor runs after the + `post_list` interceptor. The (possibly modified) response returned by + `post_list` will be passed to + `post_list_with_metadata`. + """ + return response, metadata + + +@dataclasses.dataclass +class ReservationSubBlocksRestStub: + _session: AuthorizedSession + _host: str + _interceptor: ReservationSubBlocksRestInterceptor + + +class ReservationSubBlocksRestTransport(_BaseReservationSubBlocksRestTransport): + """REST backend synchronous transport for ReservationSubBlocks. + + The ReservationSubBlocks API. + + This class defines the same methods as the primary client, so the + primary client can load the underlying transport implementation + and call it. + + It sends JSON representations of protocol buffers over HTTP/1.1 + """ + + def __init__( + self, + *, + host: str = "compute.googleapis.com", + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, + scopes: Optional[Sequence[str]] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + quota_project_id: Optional[str] = None, + client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, + always_use_jwt_access: Optional[bool] = False, + url_scheme: str = "https", + interceptor: Optional[ReservationSubBlocksRestInterceptor] = None, + api_audience: Optional[str] = None, + ) -> None: + """Instantiate the transport. + + NOTE: This REST transport functionality is currently in a beta + state (preview). We welcome your feedback via a GitHub issue in + this library's repository. Thank you! + + Args: + host (Optional[str]): + The hostname to connect to (default: 'compute.googleapis.com'). + credentials (Optional[google.auth.credentials.Credentials]): The + authorization credentials to attach to requests. These + credentials identify the application to the service; if none + are specified, the client will attempt to ascertain the + credentials from the environment. + + credentials_file (Optional[str]): A file with credentials that can + be loaded with :func:`google.auth.load_credentials_from_file`. + This argument is ignored if ``channel`` is provided. + scopes (Optional(Sequence[str])): A list of scopes. This argument is + ignored if ``channel`` is provided. + client_cert_source_for_mtls (Callable[[], Tuple[bytes, bytes]]): Client + certificate to configure mutual TLS HTTP channel. It is ignored + if ``channel`` is provided. + quota_project_id (Optional[str]): An optional project to use for billing + and quota. + client_info (google.api_core.gapic_v1.client_info.ClientInfo): + The client info used to send a user-agent string along with + API requests. If ``None``, then default info will be used. + Generally, you only need to set this if you are developing + your own client library. + always_use_jwt_access (Optional[bool]): Whether self signed JWT should + be used for service account credentials. + url_scheme: the protocol scheme for the API endpoint. Normally + "https", but for testing or local servers, + "http" can be specified. + """ + # Run the base constructor + # TODO(yon-mg): resolve other ctor params i.e. scopes, quota, etc. + # TODO: When custom host (api_endpoint) is set, `scopes` must *also* be set on the + # credentials object + super().__init__( + host=host, + credentials=credentials, + client_info=client_info, + always_use_jwt_access=always_use_jwt_access, + url_scheme=url_scheme, + api_audience=api_audience, + ) + self._session = AuthorizedSession( + self._credentials, default_host=self.DEFAULT_HOST + ) + if client_cert_source_for_mtls: + self._session.configure_mtls_channel(client_cert_source_for_mtls) + self._interceptor = interceptor or ReservationSubBlocksRestInterceptor() + self._prep_wrapped_messages(client_info) + + class _Get( + _BaseReservationSubBlocksRestTransport._BaseGet, ReservationSubBlocksRestStub + ): + def __hash__(self): + return hash("ReservationSubBlocksRestTransport.Get") + + @staticmethod + def _get_response( + host, + metadata, + query_params, + session, + timeout, + transcoded_request, + body=None, + ): + uri = transcoded_request["uri"] + method = transcoded_request["method"] + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = getattr(session, method)( + "{host}{uri}".format(host=host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + ) + return response + + def __call__( + self, + request: compute.GetReservationSubBlockRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> compute.ReservationSubBlocksGetResponse: + r"""Call the get method over HTTP. + + Args: + request (~.compute.GetReservationSubBlockRequest): + The request object. A request message for + ReservationSubBlocks.Get. See the method + description for details. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + ~.compute.ReservationSubBlocksGetResponse: + + """ + + http_options = ( + _BaseReservationSubBlocksRestTransport._BaseGet._get_http_options() + ) + + request, metadata = self._interceptor.pre_get(request, metadata) + transcoded_request = ( + _BaseReservationSubBlocksRestTransport._BaseGet._get_transcoded_request( + http_options, request + ) + ) + + # Jsonify the query params + query_params = ( + _BaseReservationSubBlocksRestTransport._BaseGet._get_query_params_json( + transcoded_request + ) + ) + + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + try: + request_payload = type(request).to_json(request) + except: + request_payload = None + http_request = { + "payload": request_payload, + "requestMethod": method, + "requestUrl": request_url, + "headers": dict(metadata), + } + _LOGGER.debug( + f"Sending request for google.cloud.compute_v1.ReservationSubBlocksClient.Get", + extra={ + "serviceName": "google.cloud.compute.v1.ReservationSubBlocks", + "rpcName": "Get", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = ReservationSubBlocksRestTransport._Get._get_response( + self._host, + metadata, + query_params, + self._session, + timeout, + transcoded_request, + ) + + # In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception + # subclass. + if response.status_code >= 400: + raise core_exceptions.from_http_response(response) + + # Return the response + resp = compute.ReservationSubBlocksGetResponse() + pb_resp = compute.ReservationSubBlocksGetResponse.pb(resp) + + json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True) + + resp = self._interceptor.post_get(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_get_with_metadata(resp, response_metadata) + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + try: + response_payload = compute.ReservationSubBlocksGetResponse.to_json( + response + ) + except: + response_payload = None + http_response = { + "payload": response_payload, + "headers": dict(response.headers), + "status": response.status_code, + } + _LOGGER.debug( + "Received response for google.cloud.compute_v1.ReservationSubBlocksClient.get", + extra={ + "serviceName": "google.cloud.compute.v1.ReservationSubBlocks", + "rpcName": "Get", + "metadata": http_response["headers"], + "httpResponse": http_response, + }, + ) + return resp + + class _List( + _BaseReservationSubBlocksRestTransport._BaseList, ReservationSubBlocksRestStub + ): + def __hash__(self): + return hash("ReservationSubBlocksRestTransport.List") + + @staticmethod + def _get_response( + host, + metadata, + query_params, + session, + timeout, + transcoded_request, + body=None, + ): + uri = transcoded_request["uri"] + method = transcoded_request["method"] + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = getattr(session, method)( + "{host}{uri}".format(host=host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + ) + return response + + def __call__( + self, + request: compute.ListReservationSubBlocksRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> compute.ReservationSubBlocksListResponse: + r"""Call the list method over HTTP. + + Args: + request (~.compute.ListReservationSubBlocksRequest): + The request object. A request message for + ReservationSubBlocks.List. See the + method description for details. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + ~.compute.ReservationSubBlocksListResponse: + A list of reservation subBlocks under + a single reservation. + + """ + + http_options = ( + _BaseReservationSubBlocksRestTransport._BaseList._get_http_options() + ) + + request, metadata = self._interceptor.pre_list(request, metadata) + transcoded_request = _BaseReservationSubBlocksRestTransport._BaseList._get_transcoded_request( + http_options, request + ) + + # Jsonify the query params + query_params = ( + _BaseReservationSubBlocksRestTransport._BaseList._get_query_params_json( + transcoded_request + ) + ) + + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + try: + request_payload = type(request).to_json(request) + except: + request_payload = None + http_request = { + "payload": request_payload, + "requestMethod": method, + "requestUrl": request_url, + "headers": dict(metadata), + } + _LOGGER.debug( + f"Sending request for google.cloud.compute_v1.ReservationSubBlocksClient.List", + extra={ + "serviceName": "google.cloud.compute.v1.ReservationSubBlocks", + "rpcName": "List", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = ReservationSubBlocksRestTransport._List._get_response( + self._host, + metadata, + query_params, + self._session, + timeout, + transcoded_request, + ) + + # In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception + # subclass. + if response.status_code >= 400: + raise core_exceptions.from_http_response(response) + + # Return the response + resp = compute.ReservationSubBlocksListResponse() + pb_resp = compute.ReservationSubBlocksListResponse.pb(resp) + + json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True) + + resp = self._interceptor.post_list(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_list_with_metadata(resp, response_metadata) + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + try: + response_payload = compute.ReservationSubBlocksListResponse.to_json( + response + ) + except: + response_payload = None + http_response = { + "payload": response_payload, + "headers": dict(response.headers), + "status": response.status_code, + } + _LOGGER.debug( + "Received response for google.cloud.compute_v1.ReservationSubBlocksClient.list", + extra={ + "serviceName": "google.cloud.compute.v1.ReservationSubBlocks", + "rpcName": "List", + "metadata": http_response["headers"], + "httpResponse": http_response, + }, + ) + return resp + + @property + def get( + self, + ) -> Callable[ + [compute.GetReservationSubBlockRequest], compute.ReservationSubBlocksGetResponse + ]: + # The return type is fine, but mypy isn't sophisticated enough to determine what's going on here. + # In C++ this would require a dynamic_cast + return self._Get(self._session, self._host, self._interceptor) # type: ignore + + @property + def list( + self, + ) -> Callable[ + [compute.ListReservationSubBlocksRequest], + compute.ReservationSubBlocksListResponse, + ]: + # The return type is fine, but mypy isn't sophisticated enough to determine what's going on here. + # In C++ this would require a dynamic_cast + return self._List(self._session, self._host, self._interceptor) # type: ignore + + @property + def kind(self) -> str: + return "rest" + + def close(self): + self._session.close() + + +__all__ = ("ReservationSubBlocksRestTransport",) diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/reservation_sub_blocks/transports/rest_base.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/reservation_sub_blocks/transports/rest_base.py new file mode 100644 index 000000000000..4dd7c2f80b49 --- /dev/null +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/reservation_sub_blocks/transports/rest_base.py @@ -0,0 +1,183 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +import json # type: ignore +import re +from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple, Union + +from google.api_core import gapic_v1, path_template +from google.protobuf import json_format + +from google.cloud.compute_v1.types import compute + +from .base import DEFAULT_CLIENT_INFO, ReservationSubBlocksTransport + + +class _BaseReservationSubBlocksRestTransport(ReservationSubBlocksTransport): + """Base REST backend transport for ReservationSubBlocks. + + Note: This class is not meant to be used directly. Use its sync and + async sub-classes instead. + + This class defines the same methods as the primary client, so the + primary client can load the underlying transport implementation + and call it. + + It sends JSON representations of protocol buffers over HTTP/1.1 + """ + + def __init__( + self, + *, + host: str = "compute.googleapis.com", + credentials: Optional[Any] = None, + client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, + always_use_jwt_access: Optional[bool] = False, + url_scheme: str = "https", + api_audience: Optional[str] = None, + ) -> None: + """Instantiate the transport. + Args: + host (Optional[str]): + The hostname to connect to (default: 'compute.googleapis.com'). + credentials (Optional[Any]): The + authorization credentials to attach to requests. These + credentials identify the application to the service; if none + are specified, the client will attempt to ascertain the + credentials from the environment. + client_info (google.api_core.gapic_v1.client_info.ClientInfo): + The client info used to send a user-agent string along with + API requests. If ``None``, then default info will be used. + Generally, you only need to set this if you are developing + your own client library. + always_use_jwt_access (Optional[bool]): Whether self signed JWT should + be used for service account credentials. + url_scheme: the protocol scheme for the API endpoint. Normally + "https", but for testing or local servers, + "http" can be specified. + """ + # Run the base constructor + maybe_url_match = re.match("^(?Phttp(?:s)?://)?(?P.*)$", host) + if maybe_url_match is None: + raise ValueError( + f"Unexpected hostname structure: {host}" + ) # pragma: NO COVER + + url_match_items = maybe_url_match.groupdict() + + host = f"{url_scheme}://{host}" if not url_match_items["scheme"] else host + + super().__init__( + host=host, + credentials=credentials, + client_info=client_info, + always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, + ) + + class _BaseGet: + def __hash__(self): # pragma: NO COVER + return NotImplementedError("__hash__ must be implemented.") + + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} + + @classmethod + def _get_unset_required_fields(cls, message_dict): + return { + k: v + for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items() + if k not in message_dict + } + + @staticmethod + def _get_http_options(): + http_options: List[Dict[str, str]] = [ + { + "method": "get", + "uri": "/compute/v1/projects/{project}/zones/{zone}/{parent_name}/reservationSubBlocks/{reservation_sub_block}", + }, + ] + return http_options + + @staticmethod + def _get_transcoded_request(http_options, request): + pb_request = compute.GetReservationSubBlockRequest.pb(request) + transcoded_request = path_template.transcode(http_options, pb_request) + return transcoded_request + + @staticmethod + def _get_query_params_json(transcoded_request): + query_params = json.loads( + json_format.MessageToJson( + transcoded_request["query_params"], + use_integers_for_enums=False, + ) + ) + query_params.update( + _BaseReservationSubBlocksRestTransport._BaseGet._get_unset_required_fields( + query_params + ) + ) + + return query_params + + class _BaseList: + def __hash__(self): # pragma: NO COVER + return NotImplementedError("__hash__ must be implemented.") + + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} + + @classmethod + def _get_unset_required_fields(cls, message_dict): + return { + k: v + for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items() + if k not in message_dict + } + + @staticmethod + def _get_http_options(): + http_options: List[Dict[str, str]] = [ + { + "method": "get", + "uri": "/compute/v1/projects/{project}/zones/{zone}/{parent_name}/reservationSubBlocks", + }, + ] + return http_options + + @staticmethod + def _get_transcoded_request(http_options, request): + pb_request = compute.ListReservationSubBlocksRequest.pb(request) + transcoded_request = path_template.transcode(http_options, pb_request) + return transcoded_request + + @staticmethod + def _get_query_params_json(transcoded_request): + query_params = json.loads( + json_format.MessageToJson( + transcoded_request["query_params"], + use_integers_for_enums=False, + ) + ) + query_params.update( + _BaseReservationSubBlocksRestTransport._BaseList._get_unset_required_fields( + query_params + ) + ) + + return query_params + + +__all__ = ("_BaseReservationSubBlocksRestTransport",) diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/types/__init__.py b/packages/google-cloud-compute/google/cloud/compute_v1/types/__init__.py index e2864d3cbdd7..712c05565b7b 100644 --- a/packages/google-cloud-compute/google/cloud/compute_v1/types/__init__.py +++ b/packages/google-cloud-compute/google/cloud/compute_v1/types/__init__.py @@ -147,6 +147,8 @@ BackendServiceFailoverPolicy, BackendServiceGroupHealth, BackendServiceHAPolicy, + BackendServiceHAPolicyLeader, + BackendServiceHAPolicyLeaderNetworkEndpoint, BackendServiceHttpCookie, BackendServiceIAP, BackendServiceList, @@ -173,6 +175,9 @@ BulkInsertOperationStatus, BulkInsertRegionDiskRequest, BulkInsertRegionInstanceRequest, + BulkSetLabelsDiskRequest, + BulkSetLabelsRequest, + BulkZoneSetLabelsRequest, CacheInvalidationRule, CacheKeyPolicy, CancelInstanceGroupManagerResizeRequestRequest, @@ -192,6 +197,7 @@ CorsPolicy, CreateInstancesInstanceGroupManagerRequest, CreateInstancesRegionInstanceGroupManagerRequest, + CreateMembersInterconnectGroupRequest, CreateSnapshotDiskRequest, CreateSnapshotRegionDiskRequest, CustomerEncryptionKey, @@ -227,7 +233,9 @@ DeleteInstancesRegionInstanceGroupManagerRequest, DeleteInstanceTemplateRequest, DeleteInstantSnapshotRequest, + DeleteInterconnectAttachmentGroupRequest, DeleteInterconnectAttachmentRequest, + DeleteInterconnectGroupRequest, DeleteInterconnectRequest, DeleteLicenseRequest, DeleteMachineImageRequest, @@ -341,6 +349,7 @@ Firewall, FirewallList, FirewallLogConfig, + FirewallParams, FirewallPoliciesListAssociationsResponse, FirewallPoliciesScopedList, FirewallPolicy, @@ -395,6 +404,8 @@ GetIamPolicyInstanceRequest, GetIamPolicyInstanceTemplateRequest, GetIamPolicyInstantSnapshotRequest, + GetIamPolicyInterconnectAttachmentGroupRequest, + GetIamPolicyInterconnectGroupRequest, GetIamPolicyLicenseRequest, GetIamPolicyMachineImageRequest, GetIamPolicyNetworkAttachmentRequest, @@ -420,7 +431,9 @@ GetInstanceSettingRequest, GetInstanceTemplateRequest, GetInstantSnapshotRequest, + GetInterconnectAttachmentGroupRequest, GetInterconnectAttachmentRequest, + GetInterconnectGroupRequest, GetInterconnectLocationRequest, GetInterconnectRemoteLocationRequest, GetInterconnectRequest, @@ -440,6 +453,8 @@ GetNodeGroupRequest, GetNodeTemplateRequest, GetNodeTypeRequest, + GetOperationalStatusInterconnectAttachmentGroupRequest, + GetOperationalStatusInterconnectGroupRequest, GetPacketMirroringRequest, GetPacketMirroringRuleNetworkFirewallPolicyRequest, GetProjectRequest, @@ -470,6 +485,7 @@ GetRegionUrlMapRequest, GetReservationBlockRequest, GetReservationRequest, + GetReservationSubBlockRequest, GetResourcePolicyRequest, GetRoutePolicyRouterRequest, GetRouteRequest, @@ -574,7 +590,9 @@ InsertInstanceRequest, InsertInstanceTemplateRequest, InsertInstantSnapshotRequest, + InsertInterconnectAttachmentGroupRequest, InsertInterconnectAttachmentRequest, + InsertInterconnectGroupRequest, InsertInterconnectRequest, InsertLicenseRequest, InsertMachineImageRequest, @@ -726,6 +744,21 @@ InterconnectAttachmentAggregatedList, InterconnectAttachmentConfigurationConstraints, InterconnectAttachmentConfigurationConstraintsBgpPeerASNRange, + InterconnectAttachmentGroup, + InterconnectAttachmentGroupAttachment, + InterconnectAttachmentGroupConfigured, + InterconnectAttachmentGroupConfiguredAvailabilitySLA, + InterconnectAttachmentGroupConfiguredAvailabilitySLAIntendedSlaBlockers, + InterconnectAttachmentGroupIntent, + InterconnectAttachmentGroupLogicalStructure, + InterconnectAttachmentGroupLogicalStructureRegion, + InterconnectAttachmentGroupLogicalStructureRegionMetro, + InterconnectAttachmentGroupLogicalStructureRegionMetroFacility, + InterconnectAttachmentGroupLogicalStructureRegionMetroFacilityZone, + InterconnectAttachmentGroupsGetOperationalStatusResponse, + InterconnectAttachmentGroupsListResponse, + InterconnectAttachmentGroupsOperationalStatus, + InterconnectAttachmentGroupsOperationalStatusAttachmentStatus, InterconnectAttachmentList, InterconnectAttachmentPartnerMetadata, InterconnectAttachmentPrivateInfo, @@ -737,6 +770,23 @@ InterconnectDiagnosticsLinkOpticalPower, InterconnectDiagnosticsLinkStatus, InterconnectDiagnosticsMacsecStatus, + InterconnectGroup, + InterconnectGroupConfigured, + InterconnectGroupConfiguredTopologyCapability, + InterconnectGroupConfiguredTopologyCapabilityIntendedCapabilityBlockers, + InterconnectGroupIntent, + InterconnectGroupInterconnect, + InterconnectGroupPhysicalStructure, + InterconnectGroupPhysicalStructureMetros, + InterconnectGroupPhysicalStructureMetrosFacilities, + InterconnectGroupPhysicalStructureMetrosFacilitiesZones, + InterconnectGroupsCreateMembers, + InterconnectGroupsCreateMembersInterconnectInput, + InterconnectGroupsCreateMembersRequest, + InterconnectGroupsGetOperationalStatusResponse, + InterconnectGroupsListResponse, + InterconnectGroupsOperationalStatus, + InterconnectGroupsOperationalStatusInterconnectStatus, InterconnectList, InterconnectLocation, InterconnectLocationList, @@ -795,7 +845,9 @@ ListInstancesRequest, ListInstanceTemplatesRequest, ListInstantSnapshotsRequest, + ListInterconnectAttachmentGroupsRequest, ListInterconnectAttachmentsRequest, + ListInterconnectGroupsRequest, ListInterconnectLocationsRequest, ListInterconnectRemoteLocationsRequest, ListInterconnectsRequest, @@ -850,6 +902,7 @@ ListRegionZonesRequest, ListReservationBlocksRequest, ListReservationsRequest, + ListReservationSubBlocksRequest, ListResourcePoliciesRequest, ListRoutePoliciesRoutersRequest, ListRoutersRequest, @@ -934,6 +987,7 @@ NetworkFirewallPolicyAggregatedList, NetworkInterface, NetworkList, + NetworkParams, NetworkPeering, NetworkPerformanceConfig, NetworkProfile, @@ -999,7 +1053,9 @@ PatchImageRequest, PatchInstanceGroupManagerRequest, PatchInstanceSettingRequest, + PatchInterconnectAttachmentGroupRequest, PatchInterconnectAttachmentRequest, + PatchInterconnectGroupRequest, PatchInterconnectRequest, PatchNetworkAttachmentRequest, PatchNetworkEdgeSecurityServiceRequest, @@ -1144,6 +1200,10 @@ ReservationsPerformMaintenanceRequest, ReservationsResizeRequest, ReservationsScopedList, + ReservationSubBlock, + ReservationSubBlockPhysicalTopology, + ReservationSubBlocksGetResponse, + ReservationSubBlocksListResponse, ResetInstanceRequest, ResizeDiskRequest, ResizeInstanceGroupManagerRequest, @@ -1170,6 +1230,7 @@ ResourcePolicySnapshotSchedulePolicySnapshotProperties, ResourcePolicyWeeklyCycle, ResourcePolicyWeeklyCycleDayOfWeek, + ResourcePolicyWorkloadPolicy, ResourceStatus, ResourceStatusPhysicalHostTopology, ResourceStatusScheduling, @@ -1179,6 +1240,7 @@ Route, RouteAsPath, RouteList, + RouteParams, RoutePolicy, RoutePolicyPolicyTerm, Router, @@ -1213,7 +1275,6 @@ Scheduling, SchedulingNodeAffinity, SchedulingOnInstanceStopAction, - ScratchDisks, Screenshot, SecurityPoliciesAggregatedList, SecurityPoliciesListPreconfiguredExpressionSetsResponse, @@ -1281,6 +1342,8 @@ SetIamPolicyInstanceRequest, SetIamPolicyInstanceTemplateRequest, SetIamPolicyInstantSnapshotRequest, + SetIamPolicyInterconnectAttachmentGroupRequest, + SetIamPolicyInterconnectGroupRequest, SetIamPolicyLicenseRequest, SetIamPolicyMachineImageRequest, SetIamPolicyNetworkAttachmentRequest, @@ -1417,9 +1480,11 @@ SubnetworkAggregatedList, SubnetworkList, SubnetworkLogConfig, + SubnetworkParams, SubnetworkSecondaryRange, SubnetworksExpandIpCidrRangeRequest, SubnetworksScopedList, + SubnetworksScopedWarning, SubnetworksSetPrivateIpGoogleAccessRequest, Subsetting, SuspendInstanceRequest, @@ -1481,6 +1546,8 @@ TestIamPermissionsInstanceRequest, TestIamPermissionsInstanceTemplateRequest, TestIamPermissionsInstantSnapshotRequest, + TestIamPermissionsInterconnectAttachmentGroupRequest, + TestIamPermissionsInterconnectGroupRequest, TestIamPermissionsLicenseCodeRequest, TestIamPermissionsLicenseRequest, TestIamPermissionsMachineImageRequest, @@ -1514,6 +1581,7 @@ UpdateFirewallRequest, UpdateHealthCheckRequest, UpdateInstanceRequest, + UpdateLicenseRequest, UpdateNetworkInterfaceInstanceRequest, UpdatePeeringNetworkRequest, UpdatePerInstanceConfigsInstanceGroupManagerRequest, @@ -1717,6 +1785,8 @@ "BackendServiceFailoverPolicy", "BackendServiceGroupHealth", "BackendServiceHAPolicy", + "BackendServiceHAPolicyLeader", + "BackendServiceHAPolicyLeaderNetworkEndpoint", "BackendServiceHttpCookie", "BackendServiceIAP", "BackendServiceList", @@ -1743,6 +1813,9 @@ "BulkInsertOperationStatus", "BulkInsertRegionDiskRequest", "BulkInsertRegionInstanceRequest", + "BulkSetLabelsDiskRequest", + "BulkSetLabelsRequest", + "BulkZoneSetLabelsRequest", "CacheInvalidationRule", "CacheKeyPolicy", "CancelInstanceGroupManagerResizeRequestRequest", @@ -1762,6 +1835,7 @@ "CorsPolicy", "CreateInstancesInstanceGroupManagerRequest", "CreateInstancesRegionInstanceGroupManagerRequest", + "CreateMembersInterconnectGroupRequest", "CreateSnapshotDiskRequest", "CreateSnapshotRegionDiskRequest", "CustomerEncryptionKey", @@ -1797,7 +1871,9 @@ "DeleteInstancesRegionInstanceGroupManagerRequest", "DeleteInstanceTemplateRequest", "DeleteInstantSnapshotRequest", + "DeleteInterconnectAttachmentGroupRequest", "DeleteInterconnectAttachmentRequest", + "DeleteInterconnectGroupRequest", "DeleteInterconnectRequest", "DeleteLicenseRequest", "DeleteMachineImageRequest", @@ -1911,6 +1987,7 @@ "Firewall", "FirewallList", "FirewallLogConfig", + "FirewallParams", "FirewallPoliciesListAssociationsResponse", "FirewallPoliciesScopedList", "FirewallPolicy", @@ -1965,6 +2042,8 @@ "GetIamPolicyInstanceRequest", "GetIamPolicyInstanceTemplateRequest", "GetIamPolicyInstantSnapshotRequest", + "GetIamPolicyInterconnectAttachmentGroupRequest", + "GetIamPolicyInterconnectGroupRequest", "GetIamPolicyLicenseRequest", "GetIamPolicyMachineImageRequest", "GetIamPolicyNetworkAttachmentRequest", @@ -1990,7 +2069,9 @@ "GetInstanceSettingRequest", "GetInstanceTemplateRequest", "GetInstantSnapshotRequest", + "GetInterconnectAttachmentGroupRequest", "GetInterconnectAttachmentRequest", + "GetInterconnectGroupRequest", "GetInterconnectLocationRequest", "GetInterconnectRemoteLocationRequest", "GetInterconnectRequest", @@ -2010,6 +2091,8 @@ "GetNodeGroupRequest", "GetNodeTemplateRequest", "GetNodeTypeRequest", + "GetOperationalStatusInterconnectAttachmentGroupRequest", + "GetOperationalStatusInterconnectGroupRequest", "GetPacketMirroringRequest", "GetPacketMirroringRuleNetworkFirewallPolicyRequest", "GetProjectRequest", @@ -2040,6 +2123,7 @@ "GetRegionUrlMapRequest", "GetReservationBlockRequest", "GetReservationRequest", + "GetReservationSubBlockRequest", "GetResourcePolicyRequest", "GetRoutePolicyRouterRequest", "GetRouteRequest", @@ -2144,7 +2228,9 @@ "InsertInstanceRequest", "InsertInstanceTemplateRequest", "InsertInstantSnapshotRequest", + "InsertInterconnectAttachmentGroupRequest", "InsertInterconnectAttachmentRequest", + "InsertInterconnectGroupRequest", "InsertInterconnectRequest", "InsertLicenseRequest", "InsertMachineImageRequest", @@ -2296,6 +2382,21 @@ "InterconnectAttachmentAggregatedList", "InterconnectAttachmentConfigurationConstraints", "InterconnectAttachmentConfigurationConstraintsBgpPeerASNRange", + "InterconnectAttachmentGroup", + "InterconnectAttachmentGroupAttachment", + "InterconnectAttachmentGroupConfigured", + "InterconnectAttachmentGroupConfiguredAvailabilitySLA", + "InterconnectAttachmentGroupConfiguredAvailabilitySLAIntendedSlaBlockers", + "InterconnectAttachmentGroupIntent", + "InterconnectAttachmentGroupLogicalStructure", + "InterconnectAttachmentGroupLogicalStructureRegion", + "InterconnectAttachmentGroupLogicalStructureRegionMetro", + "InterconnectAttachmentGroupLogicalStructureRegionMetroFacility", + "InterconnectAttachmentGroupLogicalStructureRegionMetroFacilityZone", + "InterconnectAttachmentGroupsGetOperationalStatusResponse", + "InterconnectAttachmentGroupsListResponse", + "InterconnectAttachmentGroupsOperationalStatus", + "InterconnectAttachmentGroupsOperationalStatusAttachmentStatus", "InterconnectAttachmentList", "InterconnectAttachmentPartnerMetadata", "InterconnectAttachmentPrivateInfo", @@ -2307,6 +2408,23 @@ "InterconnectDiagnosticsLinkOpticalPower", "InterconnectDiagnosticsLinkStatus", "InterconnectDiagnosticsMacsecStatus", + "InterconnectGroup", + "InterconnectGroupConfigured", + "InterconnectGroupConfiguredTopologyCapability", + "InterconnectGroupConfiguredTopologyCapabilityIntendedCapabilityBlockers", + "InterconnectGroupIntent", + "InterconnectGroupInterconnect", + "InterconnectGroupPhysicalStructure", + "InterconnectGroupPhysicalStructureMetros", + "InterconnectGroupPhysicalStructureMetrosFacilities", + "InterconnectGroupPhysicalStructureMetrosFacilitiesZones", + "InterconnectGroupsCreateMembers", + "InterconnectGroupsCreateMembersInterconnectInput", + "InterconnectGroupsCreateMembersRequest", + "InterconnectGroupsGetOperationalStatusResponse", + "InterconnectGroupsListResponse", + "InterconnectGroupsOperationalStatus", + "InterconnectGroupsOperationalStatusInterconnectStatus", "InterconnectList", "InterconnectLocation", "InterconnectLocationList", @@ -2365,7 +2483,9 @@ "ListInstancesRequest", "ListInstanceTemplatesRequest", "ListInstantSnapshotsRequest", + "ListInterconnectAttachmentGroupsRequest", "ListInterconnectAttachmentsRequest", + "ListInterconnectGroupsRequest", "ListInterconnectLocationsRequest", "ListInterconnectRemoteLocationsRequest", "ListInterconnectsRequest", @@ -2420,6 +2540,7 @@ "ListRegionZonesRequest", "ListReservationBlocksRequest", "ListReservationsRequest", + "ListReservationSubBlocksRequest", "ListResourcePoliciesRequest", "ListRoutePoliciesRoutersRequest", "ListRoutersRequest", @@ -2504,6 +2625,7 @@ "NetworkFirewallPolicyAggregatedList", "NetworkInterface", "NetworkList", + "NetworkParams", "NetworkPeering", "NetworkPerformanceConfig", "NetworkProfile", @@ -2569,7 +2691,9 @@ "PatchImageRequest", "PatchInstanceGroupManagerRequest", "PatchInstanceSettingRequest", + "PatchInterconnectAttachmentGroupRequest", "PatchInterconnectAttachmentRequest", + "PatchInterconnectGroupRequest", "PatchInterconnectRequest", "PatchNetworkAttachmentRequest", "PatchNetworkEdgeSecurityServiceRequest", @@ -2714,6 +2838,10 @@ "ReservationsPerformMaintenanceRequest", "ReservationsResizeRequest", "ReservationsScopedList", + "ReservationSubBlock", + "ReservationSubBlockPhysicalTopology", + "ReservationSubBlocksGetResponse", + "ReservationSubBlocksListResponse", "ResetInstanceRequest", "ResizeDiskRequest", "ResizeInstanceGroupManagerRequest", @@ -2740,6 +2868,7 @@ "ResourcePolicySnapshotSchedulePolicySnapshotProperties", "ResourcePolicyWeeklyCycle", "ResourcePolicyWeeklyCycleDayOfWeek", + "ResourcePolicyWorkloadPolicy", "ResourceStatus", "ResourceStatusPhysicalHostTopology", "ResourceStatusScheduling", @@ -2749,6 +2878,7 @@ "Route", "RouteAsPath", "RouteList", + "RouteParams", "RoutePolicy", "RoutePolicyPolicyTerm", "Router", @@ -2783,7 +2913,6 @@ "Scheduling", "SchedulingNodeAffinity", "SchedulingOnInstanceStopAction", - "ScratchDisks", "Screenshot", "SecurityPoliciesAggregatedList", "SecurityPoliciesListPreconfiguredExpressionSetsResponse", @@ -2851,6 +2980,8 @@ "SetIamPolicyInstanceRequest", "SetIamPolicyInstanceTemplateRequest", "SetIamPolicyInstantSnapshotRequest", + "SetIamPolicyInterconnectAttachmentGroupRequest", + "SetIamPolicyInterconnectGroupRequest", "SetIamPolicyLicenseRequest", "SetIamPolicyMachineImageRequest", "SetIamPolicyNetworkAttachmentRequest", @@ -2987,9 +3118,11 @@ "SubnetworkAggregatedList", "SubnetworkList", "SubnetworkLogConfig", + "SubnetworkParams", "SubnetworkSecondaryRange", "SubnetworksExpandIpCidrRangeRequest", "SubnetworksScopedList", + "SubnetworksScopedWarning", "SubnetworksSetPrivateIpGoogleAccessRequest", "Subsetting", "SuspendInstanceRequest", @@ -3051,6 +3184,8 @@ "TestIamPermissionsInstanceRequest", "TestIamPermissionsInstanceTemplateRequest", "TestIamPermissionsInstantSnapshotRequest", + "TestIamPermissionsInterconnectAttachmentGroupRequest", + "TestIamPermissionsInterconnectGroupRequest", "TestIamPermissionsLicenseCodeRequest", "TestIamPermissionsLicenseRequest", "TestIamPermissionsMachineImageRequest", @@ -3084,6 +3219,7 @@ "UpdateFirewallRequest", "UpdateHealthCheckRequest", "UpdateInstanceRequest", + "UpdateLicenseRequest", "UpdateNetworkInterfaceInstanceRequest", "UpdatePeeringNetworkRequest", "UpdatePerInstanceConfigsInstanceGroupManagerRequest", diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/types/compute.py b/packages/google-cloud-compute/google/cloud/compute_v1/types/compute.py index 9a25a216c586..0681e3a820ae 100644 --- a/packages/google-cloud-compute/google/cloud/compute_v1/types/compute.py +++ b/packages/google-cloud-compute/google/cloud/compute_v1/types/compute.py @@ -156,6 +156,8 @@ "BackendServiceFailoverPolicy", "BackendServiceGroupHealth", "BackendServiceHAPolicy", + "BackendServiceHAPolicyLeader", + "BackendServiceHAPolicyLeaderNetworkEndpoint", "BackendServiceHttpCookie", "BackendServiceIAP", "BackendServiceList", @@ -182,6 +184,9 @@ "BulkInsertOperationStatus", "BulkInsertRegionDiskRequest", "BulkInsertRegionInstanceRequest", + "BulkSetLabelsDiskRequest", + "BulkSetLabelsRequest", + "BulkZoneSetLabelsRequest", "CacheInvalidationRule", "CacheKeyPolicy", "CancelInstanceGroupManagerResizeRequestRequest", @@ -201,6 +206,7 @@ "CorsPolicy", "CreateInstancesInstanceGroupManagerRequest", "CreateInstancesRegionInstanceGroupManagerRequest", + "CreateMembersInterconnectGroupRequest", "CreateSnapshotDiskRequest", "CreateSnapshotRegionDiskRequest", "CustomErrorResponsePolicy", @@ -236,7 +242,9 @@ "DeleteInstancesInstanceGroupManagerRequest", "DeleteInstancesRegionInstanceGroupManagerRequest", "DeleteInstantSnapshotRequest", + "DeleteInterconnectAttachmentGroupRequest", "DeleteInterconnectAttachmentRequest", + "DeleteInterconnectGroupRequest", "DeleteInterconnectRequest", "DeleteLicenseRequest", "DeleteMachineImageRequest", @@ -350,6 +358,7 @@ "Firewall", "FirewallList", "FirewallLogConfig", + "FirewallParams", "FirewallPoliciesListAssociationsResponse", "FirewallPoliciesScopedList", "FirewallPolicy", @@ -405,6 +414,8 @@ "GetIamPolicyInstanceRequest", "GetIamPolicyInstanceTemplateRequest", "GetIamPolicyInstantSnapshotRequest", + "GetIamPolicyInterconnectAttachmentGroupRequest", + "GetIamPolicyInterconnectGroupRequest", "GetIamPolicyLicenseRequest", "GetIamPolicyMachineImageRequest", "GetIamPolicyNetworkAttachmentRequest", @@ -430,7 +441,9 @@ "GetInstanceSettingRequest", "GetInstanceTemplateRequest", "GetInstantSnapshotRequest", + "GetInterconnectAttachmentGroupRequest", "GetInterconnectAttachmentRequest", + "GetInterconnectGroupRequest", "GetInterconnectLocationRequest", "GetInterconnectRemoteLocationRequest", "GetInterconnectRequest", @@ -450,6 +463,8 @@ "GetNodeGroupRequest", "GetNodeTemplateRequest", "GetNodeTypeRequest", + "GetOperationalStatusInterconnectAttachmentGroupRequest", + "GetOperationalStatusInterconnectGroupRequest", "GetPacketMirroringRequest", "GetPacketMirroringRuleNetworkFirewallPolicyRequest", "GetProjectRequest", @@ -480,6 +495,7 @@ "GetRegionUrlMapRequest", "GetReservationBlockRequest", "GetReservationRequest", + "GetReservationSubBlockRequest", "GetResourcePolicyRequest", "GetRoutePolicyRouterRequest", "GetRouteRequest", @@ -583,7 +599,9 @@ "InsertInstanceRequest", "InsertInstanceTemplateRequest", "InsertInstantSnapshotRequest", + "InsertInterconnectAttachmentGroupRequest", "InsertInterconnectAttachmentRequest", + "InsertInterconnectGroupRequest", "InsertInterconnectRequest", "InsertLicenseRequest", "InsertMachineImageRequest", @@ -735,6 +753,21 @@ "InterconnectAttachmentAggregatedList", "InterconnectAttachmentConfigurationConstraints", "InterconnectAttachmentConfigurationConstraintsBgpPeerASNRange", + "InterconnectAttachmentGroup", + "InterconnectAttachmentGroupAttachment", + "InterconnectAttachmentGroupConfigured", + "InterconnectAttachmentGroupConfiguredAvailabilitySLA", + "InterconnectAttachmentGroupConfiguredAvailabilitySLAIntendedSlaBlockers", + "InterconnectAttachmentGroupIntent", + "InterconnectAttachmentGroupLogicalStructure", + "InterconnectAttachmentGroupLogicalStructureRegion", + "InterconnectAttachmentGroupLogicalStructureRegionMetro", + "InterconnectAttachmentGroupLogicalStructureRegionMetroFacility", + "InterconnectAttachmentGroupLogicalStructureRegionMetroFacilityZone", + "InterconnectAttachmentGroupsGetOperationalStatusResponse", + "InterconnectAttachmentGroupsListResponse", + "InterconnectAttachmentGroupsOperationalStatus", + "InterconnectAttachmentGroupsOperationalStatusAttachmentStatus", "InterconnectAttachmentList", "InterconnectAttachmentPartnerMetadata", "InterconnectAttachmentPrivateInfo", @@ -746,6 +779,23 @@ "InterconnectDiagnosticsLinkOpticalPower", "InterconnectDiagnosticsLinkStatus", "InterconnectDiagnosticsMacsecStatus", + "InterconnectGroup", + "InterconnectGroupConfigured", + "InterconnectGroupConfiguredTopologyCapability", + "InterconnectGroupConfiguredTopologyCapabilityIntendedCapabilityBlockers", + "InterconnectGroupIntent", + "InterconnectGroupInterconnect", + "InterconnectGroupPhysicalStructure", + "InterconnectGroupPhysicalStructureMetros", + "InterconnectGroupPhysicalStructureMetrosFacilities", + "InterconnectGroupPhysicalStructureMetrosFacilitiesZones", + "InterconnectGroupsCreateMembers", + "InterconnectGroupsCreateMembersInterconnectInput", + "InterconnectGroupsCreateMembersRequest", + "InterconnectGroupsGetOperationalStatusResponse", + "InterconnectGroupsListResponse", + "InterconnectGroupsOperationalStatus", + "InterconnectGroupsOperationalStatusInterconnectStatus", "InterconnectList", "InterconnectLocation", "InterconnectLocationList", @@ -804,7 +854,9 @@ "ListInstancesRegionInstanceGroupsRequest", "ListInstancesRequest", "ListInstantSnapshotsRequest", + "ListInterconnectAttachmentGroupsRequest", "ListInterconnectAttachmentsRequest", + "ListInterconnectGroupsRequest", "ListInterconnectLocationsRequest", "ListInterconnectRemoteLocationsRequest", "ListInterconnectsRequest", @@ -858,6 +910,7 @@ "ListRegionZonesRequest", "ListRegionsRequest", "ListReservationBlocksRequest", + "ListReservationSubBlocksRequest", "ListReservationsRequest", "ListResourcePoliciesRequest", "ListRoutePoliciesRoutersRequest", @@ -943,6 +996,7 @@ "NetworkFirewallPolicyAggregatedList", "NetworkInterface", "NetworkList", + "NetworkParams", "NetworkPeering", "NetworkPerformanceConfig", "NetworkProfile", @@ -1008,7 +1062,9 @@ "PatchImageRequest", "PatchInstanceGroupManagerRequest", "PatchInstanceSettingRequest", + "PatchInterconnectAttachmentGroupRequest", "PatchInterconnectAttachmentRequest", + "PatchInterconnectGroupRequest", "PatchInterconnectRequest", "PatchNetworkAttachmentRequest", "PatchNetworkEdgeSecurityServiceRequest", @@ -1149,6 +1205,10 @@ "ReservationBlocksGetResponse", "ReservationBlocksListResponse", "ReservationList", + "ReservationSubBlock", + "ReservationSubBlockPhysicalTopology", + "ReservationSubBlocksGetResponse", + "ReservationSubBlocksListResponse", "ReservationsBlocksPerformMaintenanceRequest", "ReservationsPerformMaintenanceRequest", "ReservationsResizeRequest", @@ -1179,6 +1239,7 @@ "ResourcePolicySnapshotSchedulePolicySnapshotProperties", "ResourcePolicyWeeklyCycle", "ResourcePolicyWeeklyCycleDayOfWeek", + "ResourcePolicyWorkloadPolicy", "ResourceStatus", "ResourceStatusPhysicalHostTopology", "ResourceStatusScheduling", @@ -1188,6 +1249,7 @@ "Route", "RouteAsPath", "RouteList", + "RouteParams", "RoutePolicy", "RoutePolicyPolicyTerm", "Router", @@ -1223,7 +1285,6 @@ "Scheduling", "SchedulingNodeAffinity", "SchedulingOnInstanceStopAction", - "ScratchDisks", "Screenshot", "SecurityPoliciesAggregatedList", "SecurityPoliciesListPreconfiguredExpressionSetsResponse", @@ -1291,6 +1352,8 @@ "SetIamPolicyInstanceRequest", "SetIamPolicyInstanceTemplateRequest", "SetIamPolicyInstantSnapshotRequest", + "SetIamPolicyInterconnectAttachmentGroupRequest", + "SetIamPolicyInterconnectGroupRequest", "SetIamPolicyLicenseRequest", "SetIamPolicyMachineImageRequest", "SetIamPolicyNetworkAttachmentRequest", @@ -1426,9 +1489,11 @@ "SubnetworkAggregatedList", "SubnetworkList", "SubnetworkLogConfig", + "SubnetworkParams", "SubnetworkSecondaryRange", "SubnetworksExpandIpCidrRangeRequest", "SubnetworksScopedList", + "SubnetworksScopedWarning", "SubnetworksSetPrivateIpGoogleAccessRequest", "Subsetting", "SuspendInstanceRequest", @@ -1490,6 +1555,8 @@ "TestIamPermissionsInstanceRequest", "TestIamPermissionsInstanceTemplateRequest", "TestIamPermissionsInstantSnapshotRequest", + "TestIamPermissionsInterconnectAttachmentGroupRequest", + "TestIamPermissionsInterconnectGroupRequest", "TestIamPermissionsLicenseCodeRequest", "TestIamPermissionsLicenseRequest", "TestIamPermissionsMachineImageRequest", @@ -1523,6 +1590,7 @@ "UpdateFirewallRequest", "UpdateHealthCheckRequest", "UpdateInstanceRequest", + "UpdateLicenseRequest", "UpdateNetworkInterfaceInstanceRequest", "UpdatePeeringNetworkRequest", "UpdatePerInstanceConfigsInstanceGroupManagerRequest", @@ -14476,6 +14544,15 @@ class BackendBucket(proto.Message): Type of the resource. This field is a member of `oneof`_ ``_kind``. + load_balancing_scheme (str): + The value can only be INTERNAL_MANAGED for cross-region + internal layer 7 load balancer. If loadBalancingScheme is + not specified, the backend bucket can be used by classic + global external load balancers, or global application + external load balancers, or both. Check the + LoadBalancingScheme enum for the list of possible values. + + This field is a member of `oneof`_ ``_load_balancing_scheme``. name (str): Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, @@ -14517,6 +14594,23 @@ class CompressionMode(proto.Enum): AUTOMATIC = 165298699 DISABLED = 516696700 + class LoadBalancingScheme(proto.Enum): + r"""The value can only be INTERNAL_MANAGED for cross-region internal + layer 7 load balancer. If loadBalancingScheme is not specified, the + backend bucket can be used by classic global external load + balancers, or global application external load balancers, or both. + + Values: + UNDEFINED_LOAD_BALANCING_SCHEME (0): + A value indicating that the enum field is not + set. + INTERNAL_MANAGED (37350397): + Signifies that this will be used for internal + Application Load Balancers. + """ + UNDEFINED_LOAD_BALANCING_SCHEME = 0 + INTERNAL_MANAGED = 37350397 + bucket_name: str = proto.Field( proto.STRING, number=283610048, @@ -14567,6 +14661,11 @@ class CompressionMode(proto.Enum): number=3292052, optional=True, ) + load_balancing_scheme: str = proto.Field( + proto.STRING, + number=363890244, + optional=True, + ) name: str = proto.Field( proto.STRING, number=3373707, @@ -15157,7 +15256,7 @@ class BackendService(proto.Message): field is only applicable when localityLbPolicy is set to MAGLEV or RING_HASH. This field is applicable to either: - A regional backend service with the service_protocol set to - HTTP, HTTPS, or HTTP2, and load_balancing_scheme set to + HTTP, HTTPS, HTTP2 or H2C, and load_balancing_scheme set to INTERNAL_MANAGED. - A global backend service with the load_balancing_scheme set to INTERNAL_SELF_MANAGED. @@ -15371,7 +15470,7 @@ class BackendService(proto.Message): For more information about Maglev, see https://ai.google/research/pubs/pub44824 This field is applicable to either: - A regional backend service with the - service_protocol set to HTTP, HTTPS, or HTTP2, and + service_protocol set to HTTP, HTTPS, HTTP2 or H2C, and load_balancing_scheme set to INTERNAL_MANAGED. - A global backend service with the load_balancing_scheme set to INTERNAL_SELF_MANAGED, INTERNAL_MANAGED, or @@ -15431,7 +15530,9 @@ class BackendService(proto.Message): Passthrough Network Load Balancers when the haPolicy fastIpMove is enabled. This field can only be specified when the load balancing scheme - is set to INTERNAL. + is set to INTERNAL, or when the load balancing + scheme is set to EXTERNAL and haPolicy + fastIpMove is enabled. This field is a member of `oneof`_ ``_network``. outlier_detection (google.cloud.compute_v1.types.OutlierDetection): @@ -15460,7 +15561,7 @@ class BackendService(proto.Message): be: - A global backend service with the loadBalancingScheme set to INTERNAL_SELF_MANAGED or EXTERNAL_MANAGED. - A regional backend service with the serviceProtocol set to - HTTP, HTTPS, or HTTP2, and loadBalancingScheme set to + HTTP, HTTPS, HTTP2 or H2C, and loadBalancingScheme set to INTERNAL_MANAGED or EXTERNAL_MANAGED. Not supported for Serverless NEGs. Not supported when the backend service is referenced by a URL map that is bound to target gRPC proxy @@ -15488,7 +15589,7 @@ class BackendService(proto.Message): protocol (str): The protocol this BackendService uses to communicate with backends. Possible values are - HTTP, HTTPS, HTTP2, TCP, SSL, UDP or GRPC. + HTTP, HTTPS, HTTP2, H2C, TCP, SSL, UDP or GRPC. depending on the chosen load balancer or Traffic Director configuration. Refer to the documentation for the load balancers or for @@ -15740,7 +15841,7 @@ class LocalityLbPolicy(proto.Enum): information about Maglev, see https://ai.google/research/pubs/pub44824 This field is applicable to either: - A regional backend service with the service_protocol set - to HTTP, HTTPS, or HTTP2, and load_balancing_scheme set to + to HTTP, HTTPS, HTTP2 or H2C, and load_balancing_scheme set to INTERNAL_MANAGED. - A global backend service with the load_balancing_scheme set to INTERNAL_SELF_MANAGED, INTERNAL_MANAGED, or EXTERNAL_MANAGED. If sessionAffinity is not @@ -15825,8 +15926,8 @@ class LocalityLbPolicy(proto.Enum): class Protocol(proto.Enum): r"""The protocol this BackendService uses to communicate with - backends. Possible values are HTTP, HTTPS, HTTP2, TCP, SSL, UDP - or GRPC. depending on the chosen load balancer or Traffic + backends. Possible values are HTTP, HTTPS, HTTP2, H2C, TCP, SSL, + UDP or GRPC. depending on the chosen load balancer or Traffic Director configuration. Refer to the documentation for the load balancers or for Traffic Director for more information. Must be set to GRPC when the backend service is referenced by a URL map @@ -15838,6 +15939,8 @@ class Protocol(proto.Enum): set. GRPC (2196510): gRPC (available for Traffic Director). + H2C (70809): + HTTP2 over cleartext HTTP (2228360): No description available. HTTP2 (69079210): @@ -15857,6 +15960,7 @@ class Protocol(proto.Enum): """ UNDEFINED_PROTOCOL = 0 GRPC = 2196510 + H2C = 70809 HTTP = 2228360 HTTP2 = 69079210 HTTPS = 69079243 @@ -16952,7 +17056,7 @@ class BackendServiceHAPolicy(proto.Message): must belong to that network. However, individual NEGs can belong to different subnetworks of that network. - The maximum number of network endpoints across all backends of a - backend service with fastIPMove is 64. - The maximum number + backend service with fastIPMove is 32. - The maximum number of backend services with fastIPMove that can have the same network endpoint attached to one of its backends is 64. - The maximum number of backend services with fastIPMove in a @@ -16970,6 +17074,21 @@ class BackendServiceHAPolicy(proto.Message): the list of possible values. This field is a member of `oneof`_ ``_fast_i_p_move``. + leader (google.cloud.compute_v1.types.BackendServiceHAPolicyLeader): + Selects one of the network endpoints attached + to the backend NEGs of this service as the + active endpoint (the leader) that receives all + traffic. When the leader changes, there is no + connection draining to persist existing + connections on the old leader. You are + responsible for selecting a suitable endpoint as + the leader. For example, preferring a healthy + endpoint over unhealthy ones. Note that this + service does not track backend endpoint health, + and selects the configured leader + unconditionally. + + This field is a member of `oneof`_ ``_leader``. """ class FastIPMove(proto.Enum): @@ -17014,7 +17133,7 @@ class FastIPMove(proto.Enum): must belong to that network. However, individual NEGs can belong to different subnetworks of that network. - The maximum number of network endpoints across all backends of a backend service with - fastIPMove is 64. - The maximum number of backend services with + fastIPMove is 32. - The maximum number of backend services with fastIPMove that can have the same network endpoint attached to one of its backends is 64. - The maximum number of backend services with fastIPMove in a VPC in a region is 64. - The network endpoints that @@ -17046,6 +17165,79 @@ class FastIPMove(proto.Enum): number=222633817, optional=True, ) + leader: "BackendServiceHAPolicyLeader" = proto.Field( + proto.MESSAGE, + number=503858441, + optional=True, + message="BackendServiceHAPolicyLeader", + ) + + +class BackendServiceHAPolicyLeader(proto.Message): + r""" + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + backend_group (str): + A fully-qualified URL (starting with + https://www.googleapis.com/) of the zonal Network Endpoint + Group (NEG) with ``GCE_VM_IP`` endpoints that the leader is + attached to. The leader's backendGroup must already be + specified as a backend of this backend service. Removing a + backend that is designated as the leader's backendGroup is + not permitted. + + This field is a member of `oneof`_ ``_backend_group``. + network_endpoint (google.cloud.compute_v1.types.BackendServiceHAPolicyLeaderNetworkEndpoint): + The network endpoint within the + leader.backendGroup that is designated as the + leader. This network endpoint cannot be detached + from the NEG specified in the + haPolicy.leader.backendGroup until the leader is + updated with another network endpoint, or the + leader is removed from the haPolicy. + + This field is a member of `oneof`_ ``_network_endpoint``. + """ + + backend_group: str = proto.Field( + proto.STRING, + number=457777428, + optional=True, + ) + network_endpoint: "BackendServiceHAPolicyLeaderNetworkEndpoint" = proto.Field( + proto.MESSAGE, + number=56789126, + optional=True, + message="BackendServiceHAPolicyLeaderNetworkEndpoint", + ) + + +class BackendServiceHAPolicyLeaderNetworkEndpoint(proto.Message): + r""" + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + instance (str): + The name of the VM instance of the leader + network endpoint. The instance must already be + attached to the NEG specified in the + haPolicy.leader.backendGroup. The name must be + 1-63 characters long, and comply with RFC1035. + Authorization requires the following IAM + permission on the specified resource instance: + compute.instances.use + + This field is a member of `oneof`_ ``_instance``. + """ + + instance: str = proto.Field( + proto.STRING, + number=18257045, + optional=True, + ) class BackendServiceHttpCookie(proto.Message): @@ -18878,6 +19070,117 @@ class BulkInsertRegionInstanceRequest(proto.Message): ) +class BulkSetLabelsDiskRequest(proto.Message): + r"""A request message for Disks.BulkSetLabels. See the method + description for details. + + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + bulk_zone_set_labels_request_resource (google.cloud.compute_v1.types.BulkZoneSetLabelsRequest): + The body resource for this request + project (str): + Project ID for this request. + request_id (str): + An optional request ID to identify requests. + Specify a unique request ID so that if you must + retry your request, the server will know to + ignore the request if it has already been + completed. For example, consider a situation + where you make an initial request and the + request times out. If you make the request again + with the same request ID, the server can check + if original operation with the same request ID + was received, and if so, will ignore the second + request. This prevents clients from accidentally + creating duplicate commitments. The request ID + must be a valid UUID with the exception that + zero UUID is not supported ( + 00000000-0000-0000-0000-000000000000). + + This field is a member of `oneof`_ ``_request_id``. + resource (str): + Name or id of the resource for this request. + + This field is a member of `oneof`_ ``_resource``. + zone (str): + The name of the zone for this request. + """ + + bulk_zone_set_labels_request_resource: "BulkZoneSetLabelsRequest" = proto.Field( + proto.MESSAGE, + number=531305115, + message="BulkZoneSetLabelsRequest", + ) + project: str = proto.Field( + proto.STRING, + number=227560217, + ) + request_id: str = proto.Field( + proto.STRING, + number=37109963, + optional=True, + ) + resource: str = proto.Field( + proto.STRING, + number=195806222, + optional=True, + ) + zone: str = proto.Field( + proto.STRING, + number=3744684, + ) + + +class BulkSetLabelsRequest(proto.Message): + r""" + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + label_fingerprint (str): + The fingerprint of the previous set of labels + for this resource, used to detect conflicts. The + fingerprint is initially generated by Compute + Engine and changes after every request to modify + or update labels. You may optionally provide an + up-to-date fingerprint hash in order to update + or change labels. Make a get() request to the + resource to get the latest fingerprint. + + This field is a member of `oneof`_ ``_label_fingerprint``. + labels (MutableMapping[str, str]): + The labels to set for this resource. + """ + + label_fingerprint: str = proto.Field( + proto.STRING, + number=178124825, + optional=True, + ) + labels: MutableMapping[str, str] = proto.MapField( + proto.STRING, + proto.STRING, + number=500195327, + ) + + +class BulkZoneSetLabelsRequest(proto.Message): + r""" + + Attributes: + requests (MutableSequence[google.cloud.compute_v1.types.BulkSetLabelsRequest]): + + """ + + requests: MutableSequence["BulkSetLabelsRequest"] = proto.RepeatedField( + proto.MESSAGE, + number=143613892, + message="BulkSetLabelsRequest", + ) + + class CacheInvalidationRule(proto.Message): r""" @@ -19623,12 +19926,16 @@ class Type(proto.Enum): No description available. COMPUTE_OPTIMIZED_H3 (428004939): No description available. + COMPUTE_OPTIMIZED_H4D (383251320): + No description available. GENERAL_PURPOSE (299793543): No description available. GENERAL_PURPOSE_C4 (301911817): No description available. GENERAL_PURPOSE_C4A (232460888): No description available. + GENERAL_PURPOSE_C4D (232460891): + No description available. GENERAL_PURPOSE_E2 (301911877): No description available. GENERAL_PURPOSE_N2 (301912156): @@ -19647,6 +19954,8 @@ class Type(proto.Enum): No description available. MEMORY_OPTIMIZED_M4 (276301373): No description available. + MEMORY_OPTIMIZED_M4_6TB (210543650): + No description available. MEMORY_OPTIMIZED_X4_16TB (183089120): No description available. MEMORY_OPTIMIZED_X4_24TB (183116989): @@ -19672,9 +19981,11 @@ class Type(proto.Enum): COMPUTE_OPTIMIZED_C3 = 428004784 COMPUTE_OPTIMIZED_C3D = 383246484 COMPUTE_OPTIMIZED_H3 = 428004939 + COMPUTE_OPTIMIZED_H4D = 383251320 GENERAL_PURPOSE = 299793543 GENERAL_PURPOSE_C4 = 301911817 GENERAL_PURPOSE_C4A = 232460888 + GENERAL_PURPOSE_C4D = 232460891 GENERAL_PURPOSE_E2 = 301911877 GENERAL_PURPOSE_N2 = 301912156 GENERAL_PURPOSE_N2D = 232471400 @@ -19684,6 +19995,7 @@ class Type(proto.Enum): MEMORY_OPTIMIZED = 281753417 MEMORY_OPTIMIZED_M3 = 276301372 MEMORY_OPTIMIZED_M4 = 276301373 + MEMORY_OPTIMIZED_M4_6TB = 210543650 MEMORY_OPTIMIZED_X4_16TB = 183089120 MEMORY_OPTIMIZED_X4_24TB = 183116989 MEMORY_OPTIMIZED_X4_32TB = 183144858 @@ -20403,6 +20715,35 @@ class CreateInstancesRegionInstanceGroupManagerRequest(proto.Message): ) +class CreateMembersInterconnectGroupRequest(proto.Message): + r"""A request message for InterconnectGroups.CreateMembers. See + the method description for details. + + Attributes: + interconnect_group (str): + Name of the group resource to create members + for. + interconnect_groups_create_members_request_resource (google.cloud.compute_v1.types.InterconnectGroupsCreateMembersRequest): + The body resource for this request + project (str): + Project ID for this request. + """ + + interconnect_group: str = proto.Field( + proto.STRING, + number=388651918, + ) + interconnect_groups_create_members_request_resource: "InterconnectGroupsCreateMembersRequest" = proto.Field( + proto.MESSAGE, + number=348323437, + message="InterconnectGroupsCreateMembersRequest", + ) + project: str = proto.Field( + proto.STRING, + number=227560217, + ) + + class CreateSnapshotDiskRequest(proto.Message): r"""A request message for Disks.CreateSnapshot. See the method description for details. @@ -22117,6 +22458,52 @@ class DeleteInstantSnapshotRequest(proto.Message): ) +class DeleteInterconnectAttachmentGroupRequest(proto.Message): + r"""A request message for InterconnectAttachmentGroups.Delete. + See the method description for details. + + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + interconnect_attachment_group (str): + Name of the InterconnectAttachmentGroup + resource to delete. + project (str): + Project ID for this request. + request_id (str): + An optional request ID to identify requests. Specify a + unique request ID so that if you must retry your request, + the server will know to ignore the request if it has already + been completed. For example, consider a situation where you + make an initial request and the request times out. If you + make the request again with the same request ID, the server + can check if original operation with the same request ID was + received, and if so, will ignore the second request. This + prevents clients from accidentally creating duplicate + commitments. The request ID must be a valid UUID with the + exception that zero UUID is not supported ( + 00000000-0000-0000-0000-000000000000). end_interface: + MixerMutationRequestBuilder + + This field is a member of `oneof`_ ``_request_id``. + """ + + interconnect_attachment_group: str = proto.Field( + proto.STRING, + number=75905012, + ) + project: str = proto.Field( + proto.STRING, + number=227560217, + ) + request_id: str = proto.Field( + proto.STRING, + number=37109963, + optional=True, + ) + + class DeleteInterconnectAttachmentRequest(proto.Message): r"""A request message for InterconnectAttachments.Delete. See the method description for details. @@ -22171,6 +22558,52 @@ class DeleteInterconnectAttachmentRequest(proto.Message): ) +class DeleteInterconnectGroupRequest(proto.Message): + r"""A request message for InterconnectGroups.Delete. See the + method description for details. + + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + interconnect_group (str): + Name of the InterconnectGroup resource to + delete. + project (str): + Project ID for this request. + request_id (str): + An optional request ID to identify requests. Specify a + unique request ID so that if you must retry your request, + the server will know to ignore the request if it has already + been completed. For example, consider a situation where you + make an initial request and the request times out. If you + make the request again with the same request ID, the server + can check if original operation with the same request ID was + received, and if so, will ignore the second request. This + prevents clients from accidentally creating duplicate + commitments. The request ID must be a valid UUID with the + exception that zero UUID is not supported ( + 00000000-0000-0000-0000-000000000000). end_interface: + MixerMutationRequestBuilder + + This field is a member of `oneof`_ ``_request_id``. + """ + + interconnect_group: str = proto.Field( + proto.STRING, + number=388651918, + ) + project: str = proto.Field( + proto.STRING, + number=227560217, + ) + request_id: str = proto.Field( + proto.STRING, + number=37109963, + optional=True, + ) + + class DeleteInterconnectRequest(proto.Message): r"""A request message for Interconnects.Delete. See the method description for details. @@ -28675,6 +29108,11 @@ class Firewall(proto.Message): - global/networks/default This field is a member of `oneof`_ ``_network``. + params (google.cloud.compute_v1.types.FirewallParams): + Input only. [Input Only] Additional params passed with the + request, but not persisted as part of resource payload. + + This field is a member of `oneof`_ ``_params``. priority (int): Priority for this rule. This is an integer between ``0`` and ``65535``, both inclusive. The default value is ``1000``. @@ -28838,6 +29276,12 @@ class Direction(proto.Enum): number=232872494, optional=True, ) + params: "FirewallParams" = proto.Field( + proto.MESSAGE, + number=78313862, + optional=True, + message="FirewallParams", + ) priority: int = proto.Field( proto.INT32, number=445151652, @@ -28996,6 +29440,30 @@ class Metadata(proto.Enum): ) +class FirewallParams(proto.Message): + r"""Additional firewall parameters. + + Attributes: + resource_manager_tags (MutableMapping[str, str]): + Tag keys/values directly bound to this resource. Tag keys + and values have the same definition as resource manager + tags. The field is allowed for INSERT only. The keys/values + to set on the resource should be specified in either ID { : + } or Namespaced format { : }. For example the following are + valid inputs: \* {"tagKeys/333" : "tagValues/444", + "tagKeys/123" : "tagValues/456"} \* {"123/environment" : + "production", "345/abc" : "xyz"} Note: \* Invalid + combinations of ID & namespaced format is not supported. For + instance: {"123/environment" : "tagValues/444"} is invalid. + """ + + resource_manager_tags: MutableMapping[str, str] = proto.MapField( + proto.STRING, + proto.STRING, + number=377671164, + ) + + class FirewallPoliciesListAssociationsResponse(proto.Message): r""" @@ -29586,6 +30054,9 @@ class FirewallPolicyRuleMatcher(proto.Message): r"""Represents a match condition that incoming traffic is evaluated against. Exactly one field must be specified. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + Attributes: dest_address_groups (MutableSequence[str]): Address groups which should be matched @@ -29599,6 +30070,12 @@ class FirewallPolicyRuleMatcher(proto.Message): dest_ip_ranges (MutableSequence[str]): CIDR IP address range. Maximum number of destination CIDR IP ranges allowed is 5000. + dest_network_type (str): + Network type of the traffic destination. Allowed values are: + - UNSPECIFIED - INTERNET - NON_INTERNET Check the + DestNetworkType enum for the list of possible values. + + This field is a member of `oneof`_ ``_dest_network_type``. dest_region_codes (MutableSequence[str]): Region codes whose IP addresses will be used to match for destination of traffic. Should be @@ -29624,6 +30101,16 @@ class FirewallPolicyRuleMatcher(proto.Message): src_ip_ranges (MutableSequence[str]): CIDR IP address range. Maximum number of source CIDR IP ranges allowed is 5000. + src_network_type (str): + Network type of the traffic source. Allowed values are: - + UNSPECIFIED - INTERNET - INTRA_VPC - NON_INTERNET - + VPC_NETWORKS Check the SrcNetworkType enum for the list of + possible values. + + This field is a member of `oneof`_ ``_src_network_type``. + src_networks (MutableSequence[str]): + Networks of the traffic source. It can be + either a full or partial url. src_region_codes (MutableSequence[str]): Region codes whose IP addresses will be used to match for source of traffic. Should be @@ -29644,6 +30131,33 @@ class FirewallPolicyRuleMatcher(proto.Message): traffic source. """ + class DestNetworkType(proto.Enum): + r"""Network type of the traffic destination. Allowed values are: - + UNSPECIFIED - INTERNET - NON_INTERNET Additional supported values + which may be not listed in the enum directly due to technical + reasons: INTERNET INTRA_VPC NON_INTERNET UNSPECIFIED VPC_NETWORKS + + Values: + UNDEFINED_DEST_NETWORK_TYPE (0): + A value indicating that the enum field is not + set. + """ + UNDEFINED_DEST_NETWORK_TYPE = 0 + + class SrcNetworkType(proto.Enum): + r"""Network type of the traffic source. Allowed values are: - + UNSPECIFIED - INTERNET - INTRA_VPC - NON_INTERNET - VPC_NETWORKS + Additional supported values which may be not listed in the enum + directly due to technical reasons: INTERNET INTRA_VPC NON_INTERNET + UNSPECIFIED VPC_NETWORKS + + Values: + UNDEFINED_SRC_NETWORK_TYPE (0): + A value indicating that the enum field is not + set. + """ + UNDEFINED_SRC_NETWORK_TYPE = 0 + dest_address_groups: MutableSequence[str] = proto.RepeatedField( proto.STRING, number=468760508, @@ -29656,6 +30170,11 @@ class FirewallPolicyRuleMatcher(proto.Message): proto.STRING, number=337357713, ) + dest_network_type: str = proto.Field( + proto.STRING, + number=409853224, + optional=True, + ) dest_region_codes: MutableSequence[str] = proto.RepeatedField( proto.STRING, number=199120280, @@ -29683,6 +30202,15 @@ class FirewallPolicyRuleMatcher(proto.Message): proto.STRING, number=432128083, ) + src_network_type: str = proto.Field( + proto.STRING, + number=309819686, + optional=True, + ) + src_networks: MutableSequence[str] = proto.RepeatedField( + proto.STRING, + number=247119872, + ) src_region_codes: MutableSequence[str] = proto.RepeatedField( proto.STRING, number=99086742, @@ -29952,6 +30480,38 @@ class ForwardingRule(proto.Message): resource. This field is a member of `oneof`_ ``_description``. + external_managed_backend_bucket_migration_state (str): + Specifies the canary migration state for the backend buckets + attached to this forwarding rule. Possible values are + PREPARE, TEST_BY_PERCENTAGE, and TEST_ALL_TRAFFIC. To begin + the migration from EXTERNAL to EXTERNAL_MANAGED, the state + must be changed to PREPARE. The state must be changed to + TEST_ALL_TRAFFIC before the loadBalancingScheme can be + changed to EXTERNAL_MANAGED. Optionally, the + TEST_BY_PERCENTAGE state can be used to migrate traffic to + backend buckets attached to this forwarding rule by + percentage using + externalManagedBackendBucketMigrationTestingPercentage. + Rolling back a migration requires the states to be set in + reverse order. So changing the scheme from EXTERNAL_MANAGED + to EXTERNAL requires the state to be set to TEST_ALL_TRAFFIC + at the same time. Optionally, the TEST_BY_PERCENTAGE state + can be used to migrate some traffic back to EXTERNAL or + PREPARE can be used to migrate all traffic back to EXTERNAL. + Check the ExternalManagedBackendBucketMigrationState enum + for the list of possible values. + + This field is a member of `oneof`_ ``_external_managed_backend_bucket_migration_state``. + external_managed_backend_bucket_migration_testing_percentage (float): + Determines the fraction of requests to backend buckets that + should be processed by the global external Application Load + Balancer. The value of this field must be in the range [0, + 100]. This value can only be set if the loadBalancingScheme + in the BackendService is set to EXTERNAL (when using the + classic Application Load Balancer) and the migration state + is TEST_BY_PERCENTAGE. + + This field is a member of `oneof`_ ``_external_managed_backend_bucket_migration_testing_percentage``. fingerprint (str): Fingerprint of this resource. A hash of the contents stored in this object. This field is @@ -30164,6 +30724,11 @@ class ForwardingRule(proto.Message): [Output Only] Server-defined URL for the resource. This field is a member of `oneof`_ ``_self_link``. + self_link_with_id (str): + [Output Only] Server-defined URL for this resource with the + resource id. + + This field is a member of `oneof`_ ``_self_link_with_id``. service_directory_registrations (MutableSequence[google.cloud.compute_v1.types.ForwardingRuleServiceDirectoryRegistration]): Service Directory resources to register this forwarding rule with. Currently, only supports a @@ -30229,6 +30794,39 @@ class ForwardingRule(proto.Message): This field is a member of `oneof`_ ``_target``. """ + class ExternalManagedBackendBucketMigrationState(proto.Enum): + r"""Specifies the canary migration state for the backend buckets + attached to this forwarding rule. Possible values are PREPARE, + TEST_BY_PERCENTAGE, and TEST_ALL_TRAFFIC. To begin the migration + from EXTERNAL to EXTERNAL_MANAGED, the state must be changed to + PREPARE. The state must be changed to TEST_ALL_TRAFFIC before the + loadBalancingScheme can be changed to EXTERNAL_MANAGED. Optionally, + the TEST_BY_PERCENTAGE state can be used to migrate traffic to + backend buckets attached to this forwarding rule by percentage using + externalManagedBackendBucketMigrationTestingPercentage. Rolling back + a migration requires the states to be set in reverse order. So + changing the scheme from EXTERNAL_MANAGED to EXTERNAL requires the + state to be set to TEST_ALL_TRAFFIC at the same time. Optionally, + the TEST_BY_PERCENTAGE state can be used to migrate some traffic + back to EXTERNAL or PREPARE can be used to migrate all traffic back + to EXTERNAL. + + Values: + UNDEFINED_EXTERNAL_MANAGED_BACKEND_BUCKET_MIGRATION_STATE (0): + A value indicating that the enum field is not + set. + PREPARE (399612135): + No description available. + TEST_ALL_TRAFFIC (79728882): + No description available. + TEST_BY_PERCENTAGE (513738389): + No description available. + """ + UNDEFINED_EXTERNAL_MANAGED_BACKEND_BUCKET_MIGRATION_STATE = 0 + PREPARE = 399612135 + TEST_ALL_TRAFFIC = 79728882 + TEST_BY_PERCENTAGE = 513738389 + class IPProtocolEnum(proto.Enum): r"""The IP protocol to which this rule applies. For protocol forwarding, valid options are TCP, UDP, ESP, AH, SCTP, ICMP and L3_DEFAULT. The @@ -30425,6 +31023,16 @@ class PscConnectionStatus(proto.Enum): number=422937596, optional=True, ) + external_managed_backend_bucket_migration_state: str = proto.Field( + proto.STRING, + number=107811370, + optional=True, + ) + external_managed_backend_bucket_migration_testing_percentage: float = proto.Field( + proto.FLOAT, + number=105676592, + optional=True, + ) fingerprint: str = proto.Field( proto.STRING, number=234678500, @@ -30524,6 +31132,11 @@ class PscConnectionStatus(proto.Enum): number=456214797, optional=True, ) + self_link_with_id: str = proto.Field( + proto.STRING, + number=44520962, + optional=True, + ) service_directory_registrations: MutableSequence[ "ForwardingRuleServiceDirectoryRegistration" ] = proto.RepeatedField( @@ -32010,8 +32623,9 @@ class GetIamPolicyInstantSnapshotRequest(proto.Message): ) -class GetIamPolicyLicenseRequest(proto.Message): - r"""A request message for Licenses.GetIamPolicy. See the method +class GetIamPolicyInterconnectAttachmentGroupRequest(proto.Message): + r"""A request message for + InterconnectAttachmentGroups.GetIamPolicy. See the method description for details. @@ -32043,41 +32657,8 @@ class GetIamPolicyLicenseRequest(proto.Message): ) -class GetIamPolicyMachineImageRequest(proto.Message): - r"""A request message for MachineImages.GetIamPolicy. See the - method description for details. - - - .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields - - Attributes: - options_requested_policy_version (int): - Requested IAM Policy version. - - This field is a member of `oneof`_ ``_options_requested_policy_version``. - project (str): - Project ID for this request. - resource (str): - Name or id of the resource for this request. - """ - - options_requested_policy_version: int = proto.Field( - proto.INT32, - number=499220029, - optional=True, - ) - project: str = proto.Field( - proto.STRING, - number=227560217, - ) - resource: str = proto.Field( - proto.STRING, - number=195806222, - ) - - -class GetIamPolicyNetworkAttachmentRequest(proto.Message): - r"""A request message for NetworkAttachments.GetIamPolicy. See +class GetIamPolicyInterconnectGroupRequest(proto.Message): + r"""A request message for InterconnectGroups.GetIamPolicy. See the method description for details. @@ -32090,8 +32671,6 @@ class GetIamPolicyNetworkAttachmentRequest(proto.Message): This field is a member of `oneof`_ ``_options_requested_policy_version``. project (str): Project ID for this request. - region (str): - The name of the region for this request. resource (str): Name or id of the resource for this request. """ @@ -32105,19 +32684,15 @@ class GetIamPolicyNetworkAttachmentRequest(proto.Message): proto.STRING, number=227560217, ) - region: str = proto.Field( - proto.STRING, - number=138946292, - ) resource: str = proto.Field( proto.STRING, number=195806222, ) -class GetIamPolicyNetworkFirewallPolicyRequest(proto.Message): - r"""A request message for NetworkFirewallPolicies.GetIamPolicy. - See the method description for details. +class GetIamPolicyLicenseRequest(proto.Message): + r"""A request message for Licenses.GetIamPolicy. See the method + description for details. .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields @@ -32148,9 +32723,9 @@ class GetIamPolicyNetworkFirewallPolicyRequest(proto.Message): ) -class GetIamPolicyNodeGroupRequest(proto.Message): - r"""A request message for NodeGroups.GetIamPolicy. See the method - description for details. +class GetIamPolicyMachineImageRequest(proto.Message): + r"""A request message for MachineImages.GetIamPolicy. See the + method description for details. .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields @@ -32164,8 +32739,6 @@ class GetIamPolicyNodeGroupRequest(proto.Message): Project ID for this request. resource (str): Name or id of the resource for this request. - zone (str): - The name of the zone for this request. """ options_requested_policy_version: int = proto.Field( @@ -32181,15 +32754,11 @@ class GetIamPolicyNodeGroupRequest(proto.Message): proto.STRING, number=195806222, ) - zone: str = proto.Field( - proto.STRING, - number=3744684, - ) -class GetIamPolicyNodeTemplateRequest(proto.Message): - r"""A request message for NodeTemplates.GetIamPolicy. See the - method description for details. +class GetIamPolicyNetworkAttachmentRequest(proto.Message): + r"""A request message for NetworkAttachments.GetIamPolicy. See + the method description for details. .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields @@ -32226,9 +32795,9 @@ class GetIamPolicyNodeTemplateRequest(proto.Message): ) -class GetIamPolicyRegionBackendServiceRequest(proto.Message): - r"""A request message for RegionBackendServices.GetIamPolicy. See - the method description for details. +class GetIamPolicyNetworkFirewallPolicyRequest(proto.Message): + r"""A request message for NetworkFirewallPolicies.GetIamPolicy. + See the method description for details. .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields @@ -32240,8 +32809,6 @@ class GetIamPolicyRegionBackendServiceRequest(proto.Message): This field is a member of `oneof`_ ``_options_requested_policy_version``. project (str): Project ID for this request. - region (str): - The name of the region for this request. resource (str): Name or id of the resource for this request. """ @@ -32255,19 +32822,15 @@ class GetIamPolicyRegionBackendServiceRequest(proto.Message): proto.STRING, number=227560217, ) - region: str = proto.Field( - proto.STRING, - number=138946292, - ) resource: str = proto.Field( proto.STRING, number=195806222, ) -class GetIamPolicyRegionDiskRequest(proto.Message): - r"""A request message for RegionDisks.GetIamPolicy. See the - method description for details. +class GetIamPolicyNodeGroupRequest(proto.Message): + r"""A request message for NodeGroups.GetIamPolicy. See the method + description for details. .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields @@ -32279,10 +32842,10 @@ class GetIamPolicyRegionDiskRequest(proto.Message): This field is a member of `oneof`_ ``_options_requested_policy_version``. project (str): Project ID for this request. - region (str): - The name of the region for this request. resource (str): Name or id of the resource for this request. + zone (str): + The name of the zone for this request. """ options_requested_policy_version: int = proto.Field( @@ -32294,19 +32857,19 @@ class GetIamPolicyRegionDiskRequest(proto.Message): proto.STRING, number=227560217, ) - region: str = proto.Field( - proto.STRING, - number=138946292, - ) resource: str = proto.Field( proto.STRING, number=195806222, ) + zone: str = proto.Field( + proto.STRING, + number=3744684, + ) -class GetIamPolicyRegionInstantSnapshotRequest(proto.Message): - r"""A request message for RegionInstantSnapshots.GetIamPolicy. - See the method description for details. +class GetIamPolicyNodeTemplateRequest(proto.Message): + r"""A request message for NodeTemplates.GetIamPolicy. See the + method description for details. .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields @@ -32343,10 +32906,9 @@ class GetIamPolicyRegionInstantSnapshotRequest(proto.Message): ) -class GetIamPolicyRegionNetworkFirewallPolicyRequest(proto.Message): - r"""A request message for - RegionNetworkFirewallPolicies.GetIamPolicy. See the method - description for details. +class GetIamPolicyRegionBackendServiceRequest(proto.Message): + r"""A request message for RegionBackendServices.GetIamPolicy. See + the method description for details. .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields @@ -32383,47 +32945,8 @@ class GetIamPolicyRegionNetworkFirewallPolicyRequest(proto.Message): ) -class GetIamPolicyReservationRequest(proto.Message): - r"""A request message for Reservations.GetIamPolicy. See the - method description for details. - - - .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields - - Attributes: - options_requested_policy_version (int): - Requested IAM Policy version. - - This field is a member of `oneof`_ ``_options_requested_policy_version``. - project (str): - Project ID for this request. - resource (str): - Name or id of the resource for this request. - zone (str): - The name of the zone for this request. - """ - - options_requested_policy_version: int = proto.Field( - proto.INT32, - number=499220029, - optional=True, - ) - project: str = proto.Field( - proto.STRING, - number=227560217, - ) - resource: str = proto.Field( - proto.STRING, - number=195806222, - ) - zone: str = proto.Field( - proto.STRING, - number=3744684, - ) - - -class GetIamPolicyResourcePolicyRequest(proto.Message): - r"""A request message for ResourcePolicies.GetIamPolicy. See the +class GetIamPolicyRegionDiskRequest(proto.Message): + r"""A request message for RegionDisks.GetIamPolicy. See the method description for details. @@ -32461,9 +32984,166 @@ class GetIamPolicyResourcePolicyRequest(proto.Message): ) -class GetIamPolicyServiceAttachmentRequest(proto.Message): - r"""A request message for ServiceAttachments.GetIamPolicy. See - the method description for details. +class GetIamPolicyRegionInstantSnapshotRequest(proto.Message): + r"""A request message for RegionInstantSnapshots.GetIamPolicy. + See the method description for details. + + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + options_requested_policy_version (int): + Requested IAM Policy version. + + This field is a member of `oneof`_ ``_options_requested_policy_version``. + project (str): + Project ID for this request. + region (str): + The name of the region for this request. + resource (str): + Name or id of the resource for this request. + """ + + options_requested_policy_version: int = proto.Field( + proto.INT32, + number=499220029, + optional=True, + ) + project: str = proto.Field( + proto.STRING, + number=227560217, + ) + region: str = proto.Field( + proto.STRING, + number=138946292, + ) + resource: str = proto.Field( + proto.STRING, + number=195806222, + ) + + +class GetIamPolicyRegionNetworkFirewallPolicyRequest(proto.Message): + r"""A request message for + RegionNetworkFirewallPolicies.GetIamPolicy. See the method + description for details. + + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + options_requested_policy_version (int): + Requested IAM Policy version. + + This field is a member of `oneof`_ ``_options_requested_policy_version``. + project (str): + Project ID for this request. + region (str): + The name of the region for this request. + resource (str): + Name or id of the resource for this request. + """ + + options_requested_policy_version: int = proto.Field( + proto.INT32, + number=499220029, + optional=True, + ) + project: str = proto.Field( + proto.STRING, + number=227560217, + ) + region: str = proto.Field( + proto.STRING, + number=138946292, + ) + resource: str = proto.Field( + proto.STRING, + number=195806222, + ) + + +class GetIamPolicyReservationRequest(proto.Message): + r"""A request message for Reservations.GetIamPolicy. See the + method description for details. + + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + options_requested_policy_version (int): + Requested IAM Policy version. + + This field is a member of `oneof`_ ``_options_requested_policy_version``. + project (str): + Project ID for this request. + resource (str): + Name or id of the resource for this request. + zone (str): + The name of the zone for this request. + """ + + options_requested_policy_version: int = proto.Field( + proto.INT32, + number=499220029, + optional=True, + ) + project: str = proto.Field( + proto.STRING, + number=227560217, + ) + resource: str = proto.Field( + proto.STRING, + number=195806222, + ) + zone: str = proto.Field( + proto.STRING, + number=3744684, + ) + + +class GetIamPolicyResourcePolicyRequest(proto.Message): + r"""A request message for ResourcePolicies.GetIamPolicy. See the + method description for details. + + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + options_requested_policy_version (int): + Requested IAM Policy version. + + This field is a member of `oneof`_ ``_options_requested_policy_version``. + project (str): + Project ID for this request. + region (str): + The name of the region for this request. + resource (str): + Name or id of the resource for this request. + """ + + options_requested_policy_version: int = proto.Field( + proto.INT32, + number=499220029, + optional=True, + ) + project: str = proto.Field( + proto.STRING, + number=227560217, + ) + region: str = proto.Field( + proto.STRING, + number=138946292, + ) + resource: str = proto.Field( + proto.STRING, + number=195806222, + ) + + +class GetIamPolicyServiceAttachmentRequest(proto.Message): + r"""A request message for ServiceAttachments.GetIamPolicy. See + the method description for details. .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields @@ -32850,6 +33530,28 @@ class GetInstantSnapshotRequest(proto.Message): ) +class GetInterconnectAttachmentGroupRequest(proto.Message): + r"""A request message for InterconnectAttachmentGroups.Get. See + the method description for details. + + Attributes: + interconnect_attachment_group (str): + Name of the InterconnectAttachmentGroup + resource to return. + project (str): + Project ID for this request. + """ + + interconnect_attachment_group: str = proto.Field( + proto.STRING, + number=75905012, + ) + project: str = proto.Field( + proto.STRING, + number=227560217, + ) + + class GetInterconnectAttachmentRequest(proto.Message): r"""A request message for InterconnectAttachments.Get. See the method description for details. @@ -32878,6 +33580,28 @@ class GetInterconnectAttachmentRequest(proto.Message): ) +class GetInterconnectGroupRequest(proto.Message): + r"""A request message for InterconnectGroups.Get. See the method + description for details. + + Attributes: + interconnect_group (str): + Name of the InterconnectGroup resource to + return. + project (str): + Project ID for this request. + """ + + interconnect_group: str = proto.Field( + proto.STRING, + number=388651918, + ) + project: str = proto.Field( + proto.STRING, + number=227560217, + ) + + class GetInterconnectLocationRequest(proto.Message): r"""A request message for InterconnectLocations.Get. See the method description for details. @@ -33478,6 +34202,52 @@ class GetNodeTypeRequest(proto.Message): ) +class GetOperationalStatusInterconnectAttachmentGroupRequest(proto.Message): + r"""A request message for + InterconnectAttachmentGroups.GetOperationalStatus. See the + method description for details. + + Attributes: + interconnect_attachment_group (str): + Name of the interconnectAttachmentGroup + resource to query. + project (str): + Project ID for this request. + """ + + interconnect_attachment_group: str = proto.Field( + proto.STRING, + number=75905012, + ) + project: str = proto.Field( + proto.STRING, + number=227560217, + ) + + +class GetOperationalStatusInterconnectGroupRequest(proto.Message): + r"""A request message for + InterconnectGroups.GetOperationalStatus. See the method + description for details. + + Attributes: + interconnect_group (str): + Name of the interconnectGroup resource to + query. + project (str): + Project ID for this request. + """ + + interconnect_group: str = proto.Field( + proto.STRING, + number=388651918, + ) + project: str = proto.Field( + proto.STRING, + number=227560217, + ) + + class GetPacketMirroringRequest(proto.Message): r"""A request message for PacketMirrorings.Get. See the method description for details. @@ -34302,6 +35072,43 @@ class GetReservationRequest(proto.Message): ) +class GetReservationSubBlockRequest(proto.Message): + r"""A request message for ReservationSubBlocks.Get. See the + method description for details. + + Attributes: + parent_name (str): + The name of the parent reservation and parent block. In the + format of + reservations/{reservation_name}/reservationBlocks/{reservation_block_name} + project (str): + Project ID for this request. + reservation_sub_block (str): + The name of the reservation subBlock. Name + should conform to RFC1035 or be a resource ID. + zone (str): + Name of the zone for this request. Zone name + should conform to RFC1035. + """ + + parent_name: str = proto.Field( + proto.STRING, + number=478151936, + ) + project: str = proto.Field( + proto.STRING, + number=227560217, + ) + reservation_sub_block: str = proto.Field( + proto.STRING, + number=22750491, + ) + zone: str = proto.Field( + proto.STRING, + number=3744684, + ) + + class GetResourcePolicyRequest(proto.Message): r"""A request message for ResourcePolicies.Get. See the method description for details. @@ -35865,6 +36672,8 @@ class Type(proto.Enum): UNDEFINED_TYPE (0): A value indicating that the enum field is not set. + BARE_METAL_LINUX_COMPATIBLE (354232740): + No description available. FEATURE_TYPE_UNSPECIFIED (531767259): No description available. GVNIC (68209305): @@ -35883,6 +36692,8 @@ class Type(proto.Enum): No description available. SEV_SNP_CAPABLE (426919): No description available. + SNP_SVSM_CAPABLE (52921460): + No description available. TDX_CAPABLE (240446133): No description available. UEFI_COMPATIBLE (195865408): @@ -35893,6 +36704,7 @@ class Type(proto.Enum): No description available. """ UNDEFINED_TYPE = 0 + BARE_METAL_LINUX_COMPATIBLE = 354232740 FEATURE_TYPE_UNSPECIFIED = 531767259 GVNIC = 68209305 IDPF = 2242641 @@ -35902,6 +36714,7 @@ class Type(proto.Enum): SEV_LIVE_MIGRATABLE = 392039820 SEV_LIVE_MIGRATABLE_V2 = 168551983 SEV_SNP_CAPABLE = 426919 + SNP_SVSM_CAPABLE = 52921460 TDX_CAPABLE = 240446133 UEFI_COMPATIBLE = 195865408 VIRTIO_SCSI_MULTIQUEUE = 201597069 @@ -37978,7 +38791,9 @@ class HttpHeaderOption(proto.Message): values that already exist for the header. If true, headerValue is set for the header, discarding any values that were set for that - header. The default value is false. + header. The default value is true, unless a + variable is present in headerValue, in which + case the default value is false. . This field is a member of `oneof`_ ``_replace``. """ @@ -40470,6 +41285,52 @@ class InsertInstantSnapshotRequest(proto.Message): ) +class InsertInterconnectAttachmentGroupRequest(proto.Message): + r"""A request message for InterconnectAttachmentGroups.Insert. + See the method description for details. + + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + interconnect_attachment_group_resource (google.cloud.compute_v1.types.InterconnectAttachmentGroup): + The body resource for this request + project (str): + Project ID for this request. + request_id (str): + An optional request ID to identify requests. Specify a + unique request ID so that if you must retry your request, + the server will know to ignore the request if it has already + been completed. For example, consider a situation where you + make an initial request and the request times out. If you + make the request again with the same request ID, the server + can check if original operation with the same request ID was + received, and if so, will ignore the second request. This + prevents clients from accidentally creating duplicate + commitments. The request ID must be a valid UUID with the + exception that zero UUID is not supported ( + 00000000-0000-0000-0000-000000000000). end_interface: + MixerMutationRequestBuilder + + This field is a member of `oneof`_ ``_request_id``. + """ + + interconnect_attachment_group_resource: "InterconnectAttachmentGroup" = proto.Field( + proto.MESSAGE, + number=9990137, + message="InterconnectAttachmentGroup", + ) + project: str = proto.Field( + proto.STRING, + number=227560217, + ) + request_id: str = proto.Field( + proto.STRING, + number=37109963, + optional=True, + ) + + class InsertInterconnectAttachmentRequest(proto.Message): r"""A request message for InterconnectAttachments.Insert. See the method description for details. @@ -40533,6 +41394,52 @@ class InsertInterconnectAttachmentRequest(proto.Message): ) +class InsertInterconnectGroupRequest(proto.Message): + r"""A request message for InterconnectGroups.Insert. See the + method description for details. + + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + interconnect_group_resource (google.cloud.compute_v1.types.InterconnectGroup): + The body resource for this request + project (str): + Project ID for this request. + request_id (str): + An optional request ID to identify requests. Specify a + unique request ID so that if you must retry your request, + the server will know to ignore the request if it has already + been completed. For example, consider a situation where you + make an initial request and the request times out. If you + make the request again with the same request ID, the server + can check if original operation with the same request ID was + received, and if so, will ignore the second request. This + prevents clients from accidentally creating duplicate + commitments. The request ID must be a valid UUID with the + exception that zero UUID is not supported ( + 00000000-0000-0000-0000-000000000000). end_interface: + MixerMutationRequestBuilder + + This field is a member of `oneof`_ ``_request_id``. + """ + + interconnect_group_resource: "InterconnectGroup" = proto.Field( + proto.MESSAGE, + number=85571999, + message="InterconnectGroup", + ) + project: str = proto.Field( + proto.STRING, + number=227560217, + ) + request_id: str = proto.Field( + proto.STRING, + number=37109963, + optional=True, + ) + + class InsertInterconnectRequest(proto.Message): r"""A request message for Interconnects.Insert. See the method description for details. @@ -43549,8 +44456,8 @@ class Instance(proto.Message): This field is a member of `oneof`_ ``_machine_type``. metadata (google.cloud.compute_v1.types.Metadata): The metadata key/value pairs assigned to this - instance. This includes custom metadata and - predefined keys. + instance. This includes metadata keys that were + explicitly defined for the instance. This field is a member of `oneof`_ ``_metadata``. min_cpu_platform (str): @@ -49475,6 +50382,9 @@ class Interconnect(proto.Message): interconnect_attachments (MutableSequence[str]): [Output Only] A list of the URLs of all InterconnectAttachments configured to use this Interconnect. + interconnect_groups (MutableSequence[str]): + [Output Only] URLs of InterconnectGroups that include this + Interconnect. Order is arbitrary and items are unique. interconnect_type (str): Type of interconnect, which can take one of the following values: - PARTNER: A partner-managed interconnection shared @@ -49815,6 +50725,10 @@ class State(proto.Enum): proto.STRING, number=425388415, ) + interconnect_groups: MutableSequence[str] = proto.RepeatedField( + proto.STRING, + number=237049509, + ) interconnect_type: str = proto.Field( proto.STRING, number=515165259, @@ -49928,6 +50842,11 @@ class InterconnectAttachment(proto.Message): present for PARTNER_PROVIDER. This field is a member of `oneof`_ ``_admin_enabled``. + attachment_group (str): + [Output Only] URL of the AttachmentGroup that includes this + Attachment. + + This field is a member of `oneof`_ ``_attachment_group``. bandwidth (str): Provisioned bandwidth capacity for the interconnect attachment. For attachments of type DEDICATED, the user can @@ -50106,8 +51025,9 @@ class InterconnectAttachment(proto.Message): mtu (int): Maximum Transmission Unit (MTU), in bytes, of packets passing through this interconnect - attachment. Only 1440 and 1500 are allowed. If - not specified, the value will default to 1440. + attachment. Valid values are 1440, 1460, 1500, + and 8896. If not specified, the value will + default to 1440. This field is a member of `oneof`_ ``_mtu``. name (str): @@ -50513,6 +51433,11 @@ class Type(proto.Enum): number=445675089, optional=True, ) + attachment_group: str = proto.Field( + proto.STRING, + number=63442019, + optional=True, + ) bandwidth: str = proto.Field( proto.STRING, number=181715121, @@ -50896,68 +51821,145 @@ class InterconnectAttachmentConfigurationConstraintsBgpPeerASNRange(proto.Messag ) -class InterconnectAttachmentList(proto.Message): - r"""Response to the list request, and contains a list of - interconnect attachments. +class InterconnectAttachmentGroup(proto.Message): + r"""An interconnect attachment group resource allows customers to + create, analyze, and expand highly available deployments. .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields Attributes: - id (str): - [Output Only] Unique identifier for the resource; defined by - the server. + attachments (MutableMapping[str, google.cloud.compute_v1.types.InterconnectAttachmentGroupAttachment]): + Attachments in the AttachmentGroup. Keys are + arbitrary user-specified strings. Users are + encouraged, but not required, to use their + preferred format for resource links as keys. + Note that there are add-members and + remove-members methods in gcloud. The size of + this map is limited by an "Attachments per + group" quota. + configured (google.cloud.compute_v1.types.InterconnectAttachmentGroupConfigured): + + This field is a member of `oneof`_ ``_configured``. + creation_timestamp (str): + [Output Only] Creation timestamp in RFC3339 text format. + + This field is a member of `oneof`_ ``_creation_timestamp``. + description (str): + An optional description of this resource. + Provide this property when you create the + resource. + + This field is a member of `oneof`_ ``_description``. + etag (str): + Opaque system-generated token that uniquely + identifies the configuration. If provided when + patching a configuration in update mode, the + provided token must match the current token or + the update is rejected. This provides a reliable + means of doing read-modify-write (optimistic + locking) as described by AIP 154. + + This field is a member of `oneof`_ ``_etag``. + id (int): + [Output Only] The unique identifier for the resource type. + The server generates this identifier. This field is a member of `oneof`_ ``_id``. - items (MutableSequence[google.cloud.compute_v1.types.InterconnectAttachment]): - A list of InterconnectAttachment resources. + intent (google.cloud.compute_v1.types.InterconnectAttachmentGroupIntent): + + This field is a member of `oneof`_ ``_intent``. + interconnect_group (str): + The URL of an InterconnectGroup that groups + these Attachments' Interconnects. Customers do + not need to set this unless directed by Google + Support. + + This field is a member of `oneof`_ ``_interconnect_group``. kind (str): - [Output Only] Type of resource. Always - compute#interconnectAttachmentList for lists of interconnect - attachments. + [Output Only] Type of the resource. Always + compute#interconnectAttachmentGroup. This field is a member of `oneof`_ ``_kind``. - next_page_token (str): - [Output Only] This token allows you to get the next page of - results for list requests. If the number of results is - larger than maxResults, use the nextPageToken as a value for - the query parameter pageToken in the next list request. - Subsequent list requests will have their own nextPageToken - to continue paging through the results. + logical_structure (google.cloud.compute_v1.types.InterconnectAttachmentGroupLogicalStructure): - This field is a member of `oneof`_ ``_next_page_token``. + This field is a member of `oneof`_ ``_logical_structure``. + name (str): + Name of the resource. Provided by the client when the + resource is created. The name must be 1-63 characters long, + and comply with RFC1035. Specifically, the name must be 1-63 + characters long and match the regular expression + ``[a-z]([-a-z0-9]*[a-z0-9])?`` which means the first + character must be a lowercase letter, and all following + characters must be a dash, lowercase letter, or digit, + except the last character, which cannot be a dash. + + This field is a member of `oneof`_ ``_name``. self_link (str): - [Output Only] Server-defined URL for this resource. + [Output Only] Server-defined URL for the resource. This field is a member of `oneof`_ ``_self_link``. - warning (google.cloud.compute_v1.types.Warning): - [Output Only] Informational warning message. - - This field is a member of `oneof`_ ``_warning``. """ - @property - def raw_page(self): - return self - - id: str = proto.Field( + attachments: MutableMapping[ + str, "InterconnectAttachmentGroupAttachment" + ] = proto.MapField( + proto.STRING, + proto.MESSAGE, + number=334744496, + message="InterconnectAttachmentGroupAttachment", + ) + configured: "InterconnectAttachmentGroupConfigured" = proto.Field( + proto.MESSAGE, + number=295631422, + optional=True, + message="InterconnectAttachmentGroupConfigured", + ) + creation_timestamp: str = proto.Field( + proto.STRING, + number=30525366, + optional=True, + ) + description: str = proto.Field( proto.STRING, + number=422937596, + optional=True, + ) + etag: str = proto.Field( + proto.STRING, + number=3123477, + optional=True, + ) + id: int = proto.Field( + proto.UINT64, number=3355, optional=True, ) - items: MutableSequence["InterconnectAttachment"] = proto.RepeatedField( + intent: "InterconnectAttachmentGroupIntent" = proto.Field( proto.MESSAGE, - number=100526016, - message="InterconnectAttachment", + number=426849948, + optional=True, + message="InterconnectAttachmentGroupIntent", + ) + interconnect_group: str = proto.Field( + proto.STRING, + number=388651918, + optional=True, ) kind: str = proto.Field( proto.STRING, number=3292052, optional=True, ) - next_page_token: str = proto.Field( + logical_structure: "InterconnectAttachmentGroupLogicalStructure" = proto.Field( + proto.MESSAGE, + number=142412989, + optional=True, + message="InterconnectAttachmentGroupLogicalStructure", + ) + name: str = proto.Field( proto.STRING, - number=79797525, + number=3373707, optional=True, ) self_link: str = proto.Field( @@ -50965,586 +51967,2459 @@ def raw_page(self): number=456214797, optional=True, ) - warning: "Warning" = proto.Field( - proto.MESSAGE, - number=50704284, - optional=True, - message="Warning", - ) -class InterconnectAttachmentPartnerMetadata(proto.Message): - r"""Informational metadata about Partner attachments from Partners to - display to customers. These fields are propagated from - PARTNER_PROVIDER attachments to their corresponding PARTNER - attachments. - +class InterconnectAttachmentGroupAttachment(proto.Message): + r"""An Attachment in this AttachmentGroup. .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields Attributes: - interconnect_name (str): - Plain text name of the Interconnect this - attachment is connected to, as displayed in the - Partner's portal. For instance "Chicago 1". This - value may be validated to match approved Partner - values. - - This field is a member of `oneof`_ ``_interconnect_name``. - partner_name (str): - Plain text name of the Partner providing this - attachment. This value may be validated to match - approved Partner values. - - This field is a member of `oneof`_ ``_partner_name``. - portal_url (str): - URL of the Partner's portal for this - Attachment. Partners may customise this to be a - deep link to the specific resource on the - Partner portal. This value may be validated to - match approved Partner values. + attachment (str): - This field is a member of `oneof`_ ``_portal_url``. + This field is a member of `oneof`_ ``_attachment``. """ - interconnect_name: str = proto.Field( - proto.STRING, - number=514963356, - optional=True, - ) - partner_name: str = proto.Field( - proto.STRING, - number=161747874, - optional=True, - ) - portal_url: str = proto.Field( + attachment: str = proto.Field( proto.STRING, - number=269182748, + number=183982371, optional=True, ) -class InterconnectAttachmentPrivateInfo(proto.Message): - r"""Information for an interconnect attachment when this belongs - to an interconnect of type DEDICATED. +class InterconnectAttachmentGroupConfigured(proto.Message): + r"""[Output Only] The redundancy this group is configured to support. + The way a user queries what SLA their Attachment gets is by looking + at this field of the Attachment's AttachmentGroup. .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields Attributes: - tag8021q (int): - [Output Only] 802.1q encapsulation tag to be used for - traffic between Google and the customer, going to and from - this network and region. + availability_sla (google.cloud.compute_v1.types.InterconnectAttachmentGroupConfiguredAvailabilitySLA): - This field is a member of `oneof`_ ``_tag8021q``. + This field is a member of `oneof`_ ``_availability_sla``. """ - tag8021q: int = proto.Field( - proto.UINT32, - number=271820992, - optional=True, + availability_sla: "InterconnectAttachmentGroupConfiguredAvailabilitySLA" = ( + proto.Field( + proto.MESSAGE, + number=472702020, + optional=True, + message="InterconnectAttachmentGroupConfiguredAvailabilitySLA", + ) ) -class InterconnectAttachmentsScopedList(proto.Message): - r""" +class InterconnectAttachmentGroupConfiguredAvailabilitySLA(proto.Message): + r"""[Output Only] Which SLA this group is configured to support, and why + this group does or does not meet that SLA's requirements. + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields Attributes: - interconnect_attachments (MutableSequence[google.cloud.compute_v1.types.InterconnectAttachment]): - A list of interconnect attachments contained - in this scope. - warning (google.cloud.compute_v1.types.Warning): - Informational warning which replaces the list - of addresses when the list is empty. + effective_sla (str): + Check the EffectiveSla enum for the list of + possible values. + + This field is a member of `oneof`_ ``_effective_sla``. + intended_sla_blockers (MutableSequence[google.cloud.compute_v1.types.InterconnectAttachmentGroupConfiguredAvailabilitySLAIntendedSlaBlockers]): - This field is a member of `oneof`_ ``_warning``. """ - interconnect_attachments: MutableSequence[ - "InterconnectAttachment" - ] = proto.RepeatedField( - proto.MESSAGE, - number=425388415, - message="InterconnectAttachment", + class EffectiveSla(proto.Enum): + r""" + + Values: + UNDEFINED_EFFECTIVE_SLA (0): + A value indicating that the enum field is not + set. + EFFECTIVE_SLA_UNSPECIFIED (491000744): + No description available. + NO_SLA (161460618): + No description available. + PRODUCTION_CRITICAL (470416485): + No description available. + PRODUCTION_NON_CRITICAL (117399223): + No description available. + """ + UNDEFINED_EFFECTIVE_SLA = 0 + EFFECTIVE_SLA_UNSPECIFIED = 491000744 + NO_SLA = 161460618 + PRODUCTION_CRITICAL = 470416485 + PRODUCTION_NON_CRITICAL = 117399223 + + effective_sla: str = proto.Field( + proto.STRING, + number=144173712, + optional=True, ) - warning: "Warning" = proto.Field( + intended_sla_blockers: MutableSequence[ + "InterconnectAttachmentGroupConfiguredAvailabilitySLAIntendedSlaBlockers" + ] = proto.RepeatedField( proto.MESSAGE, - number=50704284, - optional=True, - message="Warning", + number=448370308, + message="InterconnectAttachmentGroupConfiguredAvailabilitySLAIntendedSlaBlockers", ) -class InterconnectCircuitInfo(proto.Message): - r"""Describes a single physical circuit between the Customer and - Google. CircuitInfo objects are created by Google, so all fields - are output only. +class InterconnectAttachmentGroupConfiguredAvailabilitySLAIntendedSlaBlockers( + proto.Message +): + r"""[Output Only] Reasons why configuration.availabilitySLA.sla differs + from intent.availabilitySLA. This list is empty if and only if those + are the same. .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields Attributes: - customer_demarc_id (str): - Customer-side demarc ID for this circuit. + attachments (MutableSequence[str]): + [Output Only] URLs of any particular Attachments to explain + this blocker in more detail. + blocker_type (str): + Check the BlockerType enum for the list of + possible values. - This field is a member of `oneof`_ ``_customer_demarc_id``. - google_circuit_id (str): - Google-assigned unique ID for this circuit. - Assigned at circuit turn-up. + This field is a member of `oneof`_ ``_blocker_type``. + documentation_link (str): + [Output Only] The url of Google Cloud public documentation + explaining this requirement. This is set for every type of + requirement. + + This field is a member of `oneof`_ ``_documentation_link``. + explanation (str): + [Output Only] A human-readable explanation of this + requirement and why it's not met. This is set for every type + of requirement. + + This field is a member of `oneof`_ ``_explanation``. + metros (MutableSequence[str]): + [Output Only] Metros used to explain this blocker in more + detail. These are three-letter lowercase strings like "iad". + This will be set for some blockers (like + NO_ATTACHMENTS_IN_METRO_AND_ZONE) but does not apply to + others. + regions (MutableSequence[str]): + [Output Only] Regions used to explain this blocker in more + detail. These are region names formatted like "us-central1". + This will be set for some blockers (like + INCOMPATIBLE_REGIONS) but does not apply to others. + zones (MutableSequence[str]): + [Output Only] Zones used to explain this blocker in more + detail. Format is "zone1" and/or "zone2". This will be set + for some blockers (like MISSING_ZONE) but does not apply to + others. + """ - This field is a member of `oneof`_ ``_google_circuit_id``. - google_demarc_id (str): - Google-side demarc ID for this circuit. - Assigned at circuit turn-up and provided by - Google to the customer in the LOA. + class BlockerType(proto.Enum): + r""" - This field is a member of `oneof`_ ``_google_demarc_id``. - """ + Values: + UNDEFINED_BLOCKER_TYPE (0): + A value indicating that the enum field is not + set. + BLOCKER_TYPE_UNSPECIFIED (429793623): + No description available. + INCOMPATIBLE_METROS (290410432): + No description available. + INCOMPATIBLE_REGIONS (6195033): + No description available. + MISSING_GLOBAL_ROUTING (165913635): + No description available. + NO_ATTACHMENTS (456535570): + No description available. + NO_ATTACHMENTS_IN_METRO_AND_ZONE (51684135): + No description available. + OTHER (75532016): + No description available. + """ + UNDEFINED_BLOCKER_TYPE = 0 + BLOCKER_TYPE_UNSPECIFIED = 429793623 + INCOMPATIBLE_METROS = 290410432 + INCOMPATIBLE_REGIONS = 6195033 + MISSING_GLOBAL_ROUTING = 165913635 + NO_ATTACHMENTS = 456535570 + NO_ATTACHMENTS_IN_METRO_AND_ZONE = 51684135 + OTHER = 75532016 - customer_demarc_id: str = proto.Field( + attachments: MutableSequence[str] = proto.RepeatedField( proto.STRING, - number=28771859, + number=334744496, + ) + blocker_type: str = proto.Field( + proto.STRING, + number=381194847, optional=True, ) - google_circuit_id: str = proto.Field( + documentation_link: str = proto.Field( proto.STRING, - number=262014711, + number=93465183, optional=True, ) - google_demarc_id: str = proto.Field( + explanation: str = proto.Field( proto.STRING, - number=448196270, + number=504745497, optional=True, ) + metros: MutableSequence[str] = proto.RepeatedField( + proto.STRING, + number=533067386, + ) + regions: MutableSequence[str] = proto.RepeatedField( + proto.STRING, + number=12367871, + ) + zones: MutableSequence[str] = proto.RepeatedField( + proto.STRING, + number=116085319, + ) -class InterconnectDiagnostics(proto.Message): - r"""Diagnostics information about the Interconnect connection, - which contains detailed and current technical information about - Google's side of the connection. +class InterconnectAttachmentGroupIntent(proto.Message): + r"""The user's intent for this AttachmentGroup. This is the only + required field besides the name that must be specified on group + creation. .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields Attributes: - arp_caches (MutableSequence[google.cloud.compute_v1.types.InterconnectDiagnosticsARPEntry]): - A list of InterconnectDiagnostics.ARPEntry - objects, describing individual neighbors - currently seen by the Google router in the ARP - cache for the Interconnect. This will be empty - when the Interconnect is not bundled. - bundle_aggregation_type (str): - The aggregation type of the bundle interface. - Check the BundleAggregationType enum for the - list of possible values. - - This field is a member of `oneof`_ ``_bundle_aggregation_type``. - bundle_operational_status (str): - The operational status of the bundle - interface. Check the BundleOperationalStatus - enum for the list of possible values. - - This field is a member of `oneof`_ ``_bundle_operational_status``. - links (MutableSequence[google.cloud.compute_v1.types.InterconnectDiagnosticsLinkStatus]): - A list of InterconnectDiagnostics.LinkStatus - objects, describing the status for each link on - the Interconnect. - mac_address (str): - The MAC address of the Interconnect's bundle - interface. + availability_sla (str): + Check the AvailabilitySla enum for the list + of possible values. - This field is a member of `oneof`_ ``_mac_address``. + This field is a member of `oneof`_ ``_availability_sla``. """ - class BundleAggregationType(proto.Enum): - r"""The aggregation type of the bundle interface. + class AvailabilitySla(proto.Enum): + r""" Values: - UNDEFINED_BUNDLE_AGGREGATION_TYPE (0): + UNDEFINED_AVAILABILITY_SLA (0): A value indicating that the enum field is not set. - BUNDLE_AGGREGATION_TYPE_LACP (27758925): - LACP is enabled. - BUNDLE_AGGREGATION_TYPE_STATIC (50678873): - LACP is disabled. + AVAILABILITY_SLA_UNSPECIFIED (11186044): + No description available. + NO_SLA (161460618): + No description available. + PRODUCTION_CRITICAL (470416485): + No description available. + PRODUCTION_NON_CRITICAL (117399223): + No description available. """ - UNDEFINED_BUNDLE_AGGREGATION_TYPE = 0 - BUNDLE_AGGREGATION_TYPE_LACP = 27758925 - BUNDLE_AGGREGATION_TYPE_STATIC = 50678873 + UNDEFINED_AVAILABILITY_SLA = 0 + AVAILABILITY_SLA_UNSPECIFIED = 11186044 + NO_SLA = 161460618 + PRODUCTION_CRITICAL = 470416485 + PRODUCTION_NON_CRITICAL = 117399223 - class BundleOperationalStatus(proto.Enum): - r"""The operational status of the bundle interface. + availability_sla: str = proto.Field( + proto.STRING, + number=472702020, + optional=True, + ) - Values: - UNDEFINED_BUNDLE_OPERATIONAL_STATUS (0): - A value indicating that the enum field is not - set. - BUNDLE_OPERATIONAL_STATUS_DOWN (453842693): - If bundleAggregationType is LACP: LACP is not - established and/or all links in the bundle have - DOWN operational status. If - bundleAggregationType is STATIC: one or more - links in the bundle has DOWN operational status. - BUNDLE_OPERATIONAL_STATUS_UP (161366462): - If bundleAggregationType is LACP: LACP is - established and at least one link in the bundle - has UP operational status. If - bundleAggregationType is STATIC: all links in - the bundle (typically just one) have UP - operational status. - """ - UNDEFINED_BUNDLE_OPERATIONAL_STATUS = 0 - BUNDLE_OPERATIONAL_STATUS_DOWN = 453842693 - BUNDLE_OPERATIONAL_STATUS_UP = 161366462 - arp_caches: MutableSequence[ - "InterconnectDiagnosticsARPEntry" +class InterconnectAttachmentGroupLogicalStructure(proto.Message): + r"""[Output Only] An analysis of the logical layout of Attachments in + this group. Every Attachment in the group is shown once in this + structure. + + Attributes: + regions (MutableSequence[google.cloud.compute_v1.types.InterconnectAttachmentGroupLogicalStructureRegion]): + + """ + + regions: MutableSequence[ + "InterconnectAttachmentGroupLogicalStructureRegion" ] = proto.RepeatedField( proto.MESSAGE, - number=414591761, - message="InterconnectDiagnosticsARPEntry", + number=12367871, + message="InterconnectAttachmentGroupLogicalStructureRegion", ) - bundle_aggregation_type: str = proto.Field( - proto.STRING, - number=434939028, - optional=True, + + +class InterconnectAttachmentGroupLogicalStructureRegion(proto.Message): + r"""[Output Only] The regions Attachments in this group are in. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + metros (MutableSequence[google.cloud.compute_v1.types.InterconnectAttachmentGroupLogicalStructureRegionMetro]): + + region (str): + [Output Only] The name of a region, like "us-central1". + + This field is a member of `oneof`_ ``_region``. + """ + + metros: MutableSequence[ + "InterconnectAttachmentGroupLogicalStructureRegionMetro" + ] = proto.RepeatedField( + proto.MESSAGE, + number=533067386, + message="InterconnectAttachmentGroupLogicalStructureRegionMetro", ) - bundle_operational_status: str = proto.Field( + region: str = proto.Field( proto.STRING, - number=106433500, + number=138946292, optional=True, ) - links: MutableSequence["InterconnectDiagnosticsLinkStatus"] = proto.RepeatedField( + + +class InterconnectAttachmentGroupLogicalStructureRegionMetro(proto.Message): + r"""[Output Only] The metros of Attachments in this group in this + region. + + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + facilities (MutableSequence[google.cloud.compute_v1.types.InterconnectAttachmentGroupLogicalStructureRegionMetroFacility]): + + metro (str): + [Output Only] The name of the metro, as a three-letter + lowercase string like "iad". This is the first component of + the location of an Interconnect. + + This field is a member of `oneof`_ ``_metro``. + """ + + facilities: MutableSequence[ + "InterconnectAttachmentGroupLogicalStructureRegionMetroFacility" + ] = proto.RepeatedField( proto.MESSAGE, - number=102977465, - message="InterconnectDiagnosticsLinkStatus", + number=536683137, + message="InterconnectAttachmentGroupLogicalStructureRegionMetroFacility", ) - mac_address: str = proto.Field( + metro: str = proto.Field( proto.STRING, - number=332540164, + number=103787801, optional=True, ) -class InterconnectDiagnosticsARPEntry(proto.Message): - r"""Describing the ARP neighbor entries seen on this link +class InterconnectAttachmentGroupLogicalStructureRegionMetroFacility(proto.Message): + r"""[Output Only] The facilities used for this group's Attachments' + Interconnects. + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields Attributes: - ip_address (str): - The IP address of this ARP neighbor. + facility (str): + [Output Only] The name of a facility, like "iad-1234". - This field is a member of `oneof`_ ``_ip_address``. - mac_address (str): - The MAC address of this ARP neighbor. + This field is a member of `oneof`_ ``_facility``. + zones (MutableSequence[google.cloud.compute_v1.types.InterconnectAttachmentGroupLogicalStructureRegionMetroFacilityZone]): - This field is a member of `oneof`_ ``_mac_address``. """ - ip_address: str = proto.Field( + facility: str = proto.Field( proto.STRING, - number=406272220, + number=501116579, optional=True, ) - mac_address: str = proto.Field( - proto.STRING, - number=332540164, - optional=True, + zones: MutableSequence[ + "InterconnectAttachmentGroupLogicalStructureRegionMetroFacilityZone" + ] = proto.RepeatedField( + proto.MESSAGE, + number=116085319, + message="InterconnectAttachmentGroupLogicalStructureRegionMetroFacilityZone", ) -class InterconnectDiagnosticsLinkLACPStatus(proto.Message): - r""" +class InterconnectAttachmentGroupLogicalStructureRegionMetroFacilityZone(proto.Message): + r"""[Output Only] The zones that Attachments in this group are present + in, in the given facilities. This is inherited from their + Interconnects. + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields Attributes: - google_system_id (str): - System ID of the port on Google's side of the - LACP exchange. - - This field is a member of `oneof`_ ``_google_system_id``. - neighbor_system_id (str): - System ID of the port on the neighbor's side - of the LACP exchange. - - This field is a member of `oneof`_ ``_neighbor_system_id``. - state (str): - The state of a LACP link, which can take one - of the following values: - ACTIVE: The link is - configured and active within the bundle. - - DETACHED: The link is not configured within the - bundle. This means that the rest of the object - should be empty. Check the State enum for the - list of possible values. + attachments (MutableSequence[str]): + [Output Only] URLs of Attachments in the given zone, to the + given region, on Interconnects in the given facility and + metro. Every Attachment in the AG has such an entry. + zone (str): + [Output Only] The name of a zone, either "zone1" or "zone2". - This field is a member of `oneof`_ ``_state``. + This field is a member of `oneof`_ ``_zone``. """ - class State(proto.Enum): - r"""The state of a LACP link, which can take one of the following - values: - ACTIVE: The link is configured and active within the - bundle. - DETACHED: The link is not configured within the - bundle. This means that the rest of the object should be empty. - - Values: - UNDEFINED_STATE (0): - A value indicating that the enum field is not - set. - ACTIVE (314733318): - The link is configured and active within the - bundle. - DETACHED (216562546): - The link is not configured within the bundle, - this means the rest of the object should be - empty. - """ - UNDEFINED_STATE = 0 - ACTIVE = 314733318 - DETACHED = 216562546 - - google_system_id: str = proto.Field( + attachments: MutableSequence[str] = proto.RepeatedField( proto.STRING, - number=91210405, - optional=True, + number=334744496, ) - neighbor_system_id: str = proto.Field( + zone: str = proto.Field( proto.STRING, - number=343821342, + number=3744684, optional=True, ) - state: str = proto.Field( + + +class InterconnectAttachmentGroupsGetOperationalStatusResponse(proto.Message): + r"""Response for the + InterconnectAttachmentGroupsGetOperationalStatusResponse. + + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + etag (str): + + This field is a member of `oneof`_ ``_etag``. + result (google.cloud.compute_v1.types.InterconnectAttachmentGroupsOperationalStatus): + + This field is a member of `oneof`_ ``_result``. + """ + + etag: str = proto.Field( proto.STRING, - number=109757585, + number=3123477, + optional=True, + ) + result: "InterconnectAttachmentGroupsOperationalStatus" = proto.Field( + proto.MESSAGE, + number=139315229, optional=True, + message="InterconnectAttachmentGroupsOperationalStatus", ) -class InterconnectDiagnosticsLinkOpticalPower(proto.Message): +class InterconnectAttachmentGroupsListResponse(proto.Message): r""" .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields Attributes: - state (str): - The status of the current value when compared to the warning - and alarm levels for the receiving or transmitting - transceiver. Possible states include: - OK: The value has - not crossed a warning threshold. - LOW_WARNING: The value - has crossed below the low warning threshold. - HIGH_WARNING: - The value has crossed above the high warning threshold. - + etag (str): + + This field is a member of `oneof`_ ``_etag``. + id (str): + [Output Only] Unique identifier for the resource; defined by + the server. + + This field is a member of `oneof`_ ``_id``. + items (MutableSequence[google.cloud.compute_v1.types.InterconnectAttachmentGroup]): + A list of InterconnectAttachmentGroup + resources. + kind (str): + + This field is a member of `oneof`_ ``_kind``. + next_page_token (str): + [Output Only] This token allows you to get the next page of + results for list requests. If the number of results is + larger than maxResults, use the nextPageToken as a value for + the query parameter pageToken in the next list request. + Subsequent list requests will have their own nextPageToken + to continue paging through the results. + + This field is a member of `oneof`_ ``_next_page_token``. + self_link (str): + [Output Only] Server-defined URL for this resource. + + This field is a member of `oneof`_ ``_self_link``. + unreachables (MutableSequence[str]): + [Output Only] Unreachable resources. end_interface: + MixerListResponseWithEtagBuilder + warning (google.cloud.compute_v1.types.Warning): + [Output Only] Informational warning message. + + This field is a member of `oneof`_ ``_warning``. + """ + + @property + def raw_page(self): + return self + + etag: str = proto.Field( + proto.STRING, + number=3123477, + optional=True, + ) + id: str = proto.Field( + proto.STRING, + number=3355, + optional=True, + ) + items: MutableSequence["InterconnectAttachmentGroup"] = proto.RepeatedField( + proto.MESSAGE, + number=100526016, + message="InterconnectAttachmentGroup", + ) + kind: str = proto.Field( + proto.STRING, + number=3292052, + optional=True, + ) + next_page_token: str = proto.Field( + proto.STRING, + number=79797525, + optional=True, + ) + self_link: str = proto.Field( + proto.STRING, + number=456214797, + optional=True, + ) + unreachables: MutableSequence[str] = proto.RepeatedField( + proto.STRING, + number=243372063, + ) + warning: "Warning" = proto.Field( + proto.MESSAGE, + number=50704284, + optional=True, + message="Warning", + ) + + +class InterconnectAttachmentGroupsOperationalStatus(proto.Message): + r""" + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + attachment_statuses (MutableSequence[google.cloud.compute_v1.types.InterconnectAttachmentGroupsOperationalStatusAttachmentStatus]): + + configured (google.cloud.compute_v1.types.InterconnectAttachmentGroupConfigured): + + This field is a member of `oneof`_ ``_configured``. + group_status (str): + Summarizes the status of the group. + Check the GroupStatus enum for the list of + possible values. + + This field is a member of `oneof`_ ``_group_status``. + intent (google.cloud.compute_v1.types.InterconnectAttachmentGroupIntent): + + This field is a member of `oneof`_ ``_intent``. + operational (google.cloud.compute_v1.types.InterconnectAttachmentGroupConfigured): + The operational state of the group, including + only active Attachments. + + This field is a member of `oneof`_ ``_operational``. + """ + + class GroupStatus(proto.Enum): + r"""Summarizes the status of the group. + + Values: + UNDEFINED_GROUP_STATUS (0): + A value indicating that the enum field is not + set. + DEGRADED (396890926): + No description available. + FULLY_DOWN (255514647): + No description available. + FULLY_UP (504176464): + No description available. + UNSPECIFIED (526786327): + No description available. + """ + UNDEFINED_GROUP_STATUS = 0 + DEGRADED = 396890926 + FULLY_DOWN = 255514647 + FULLY_UP = 504176464 + UNSPECIFIED = 526786327 + + attachment_statuses: MutableSequence[ + "InterconnectAttachmentGroupsOperationalStatusAttachmentStatus" + ] = proto.RepeatedField( + proto.MESSAGE, + number=491132860, + message="InterconnectAttachmentGroupsOperationalStatusAttachmentStatus", + ) + configured: "InterconnectAttachmentGroupConfigured" = proto.Field( + proto.MESSAGE, + number=295631422, + optional=True, + message="InterconnectAttachmentGroupConfigured", + ) + group_status: str = proto.Field( + proto.STRING, + number=338778546, + optional=True, + ) + intent: "InterconnectAttachmentGroupIntent" = proto.Field( + proto.MESSAGE, + number=426849948, + optional=True, + message="InterconnectAttachmentGroupIntent", + ) + operational: "InterconnectAttachmentGroupConfigured" = proto.Field( + proto.MESSAGE, + number=129704914, + optional=True, + message="InterconnectAttachmentGroupConfigured", + ) + + +class InterconnectAttachmentGroupsOperationalStatusAttachmentStatus(proto.Message): + r"""The status of one Attachment in the group. List order is + arbitrary. + + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + admin_enabled (bool): + Whether this Attachment is enabled. This + becomes false when the customer drains their + Attachment. + + This field is a member of `oneof`_ ``_admin_enabled``. + attachment (str): + The URL of the Attachment being described. + + This field is a member of `oneof`_ ``_attachment``. + is_active (str): + Whether this Attachment is participating in the redundant + configuration. This will be ACTIVE if and only if the status + below is CONNECTION_UP. Any INACTIVE Attachments are + excluded from the analysis that generates + operational.availabilitySLA. Check the IsActive enum for the + list of possible values. + + This field is a member of `oneof`_ ``_is_active``. + status (str): + Whether this Attachment is active, and if so, whether BGP is + up. This is based on the statuses available in the Pantheon + UI here: + http://google3/java/com/google/cloud/boq/clientapi/gce/hybrid/api/interconnect_models.proto + Check the Status enum for the list of possible values. + + This field is a member of `oneof`_ ``_status``. + """ + + class IsActive(proto.Enum): + r"""Whether this Attachment is participating in the redundant + configuration. This will be ACTIVE if and only if the status below + is CONNECTION_UP. Any INACTIVE Attachments are excluded from the + analysis that generates operational.availabilitySLA. + + Values: + UNDEFINED_IS_ACTIVE (0): + A value indicating that the enum field is not + set. + ACTIVE (314733318): + No description available. + INACTIVE (270421099): + No description available. + UNSPECIFIED (526786327): + No description available. + """ + UNDEFINED_IS_ACTIVE = 0 + ACTIVE = 314733318 + INACTIVE = 270421099 + UNSPECIFIED = 526786327 + + class Status(proto.Enum): + r"""Whether this Attachment is active, and if so, whether BGP is up. + This is based on the statuses available in the Pantheon UI here: + http://google3/java/com/google/cloud/boq/clientapi/gce/hybrid/api/interconnect_models.proto + + Values: + UNDEFINED_STATUS (0): + A value indicating that the enum field is not + set. + ATTACHMENT_STATUS_UNKNOWN (472477561): + No description available. + CONNECTION_DISABLED (432687805): + No description available. + CONNECTION_DOWN (267552099): + No description available. + CONNECTION_UP (455585692): + No description available. + DEFUNCT (115891759): + No description available. + IPSEC_CONFIGURATION_NEEDED_STATUS (455203582): + No description available. + IPSEC_READY_TO_RESUME_FLOW_STATUS (384830596): + No description available. + IPV4_DOWN_IPV6_UP (277490992): + No description available. + IPV4_UP_IPV6_DOWN (316051248): + No description available. + PARTNER_REQUEST_RECEIVED (513587304): + No description available. + PENDING_CUSTOMER (167494054): + No description available. + PENDING_PARTNER (387890656): + No description available. + PROVISIONED (355751956): + No description available. + ROUTER_CONFIGURATION_BROKEN (150505108): + No description available. + UNPROVISIONED (517333979): + No description available. + """ + UNDEFINED_STATUS = 0 + ATTACHMENT_STATUS_UNKNOWN = 472477561 + CONNECTION_DISABLED = 432687805 + CONNECTION_DOWN = 267552099 + CONNECTION_UP = 455585692 + DEFUNCT = 115891759 + IPSEC_CONFIGURATION_NEEDED_STATUS = 455203582 + IPSEC_READY_TO_RESUME_FLOW_STATUS = 384830596 + IPV4_DOWN_IPV6_UP = 277490992 + IPV4_UP_IPV6_DOWN = 316051248 + PARTNER_REQUEST_RECEIVED = 513587304 + PENDING_CUSTOMER = 167494054 + PENDING_PARTNER = 387890656 + PROVISIONED = 355751956 + ROUTER_CONFIGURATION_BROKEN = 150505108 + UNPROVISIONED = 517333979 + + admin_enabled: bool = proto.Field( + proto.BOOL, + number=445675089, + optional=True, + ) + attachment: str = proto.Field( + proto.STRING, + number=183982371, + optional=True, + ) + is_active: str = proto.Field( + proto.STRING, + number=114830267, + optional=True, + ) + status: str = proto.Field( + proto.STRING, + number=181260274, + optional=True, + ) + + +class InterconnectAttachmentList(proto.Message): + r"""Response to the list request, and contains a list of + interconnect attachments. + + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + id (str): + [Output Only] Unique identifier for the resource; defined by + the server. + + This field is a member of `oneof`_ ``_id``. + items (MutableSequence[google.cloud.compute_v1.types.InterconnectAttachment]): + A list of InterconnectAttachment resources. + kind (str): + [Output Only] Type of resource. Always + compute#interconnectAttachmentList for lists of interconnect + attachments. + + This field is a member of `oneof`_ ``_kind``. + next_page_token (str): + [Output Only] This token allows you to get the next page of + results for list requests. If the number of results is + larger than maxResults, use the nextPageToken as a value for + the query parameter pageToken in the next list request. + Subsequent list requests will have their own nextPageToken + to continue paging through the results. + + This field is a member of `oneof`_ ``_next_page_token``. + self_link (str): + [Output Only] Server-defined URL for this resource. + + This field is a member of `oneof`_ ``_self_link``. + warning (google.cloud.compute_v1.types.Warning): + [Output Only] Informational warning message. + + This field is a member of `oneof`_ ``_warning``. + """ + + @property + def raw_page(self): + return self + + id: str = proto.Field( + proto.STRING, + number=3355, + optional=True, + ) + items: MutableSequence["InterconnectAttachment"] = proto.RepeatedField( + proto.MESSAGE, + number=100526016, + message="InterconnectAttachment", + ) + kind: str = proto.Field( + proto.STRING, + number=3292052, + optional=True, + ) + next_page_token: str = proto.Field( + proto.STRING, + number=79797525, + optional=True, + ) + self_link: str = proto.Field( + proto.STRING, + number=456214797, + optional=True, + ) + warning: "Warning" = proto.Field( + proto.MESSAGE, + number=50704284, + optional=True, + message="Warning", + ) + + +class InterconnectAttachmentPartnerMetadata(proto.Message): + r"""Informational metadata about Partner attachments from Partners to + display to customers. These fields are propagated from + PARTNER_PROVIDER attachments to their corresponding PARTNER + attachments. + + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + interconnect_name (str): + Plain text name of the Interconnect this + attachment is connected to, as displayed in the + Partner's portal. For instance "Chicago 1". This + value may be validated to match approved Partner + values. + + This field is a member of `oneof`_ ``_interconnect_name``. + partner_name (str): + Plain text name of the Partner providing this + attachment. This value may be validated to match + approved Partner values. + + This field is a member of `oneof`_ ``_partner_name``. + portal_url (str): + URL of the Partner's portal for this + Attachment. Partners may customise this to be a + deep link to the specific resource on the + Partner portal. This value may be validated to + match approved Partner values. + + This field is a member of `oneof`_ ``_portal_url``. + """ + + interconnect_name: str = proto.Field( + proto.STRING, + number=514963356, + optional=True, + ) + partner_name: str = proto.Field( + proto.STRING, + number=161747874, + optional=True, + ) + portal_url: str = proto.Field( + proto.STRING, + number=269182748, + optional=True, + ) + + +class InterconnectAttachmentPrivateInfo(proto.Message): + r"""Information for an interconnect attachment when this belongs + to an interconnect of type DEDICATED. + + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + tag8021q (int): + [Output Only] 802.1q encapsulation tag to be used for + traffic between Google and the customer, going to and from + this network and region. + + This field is a member of `oneof`_ ``_tag8021q``. + """ + + tag8021q: int = proto.Field( + proto.UINT32, + number=271820992, + optional=True, + ) + + +class InterconnectAttachmentsScopedList(proto.Message): + r""" + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + interconnect_attachments (MutableSequence[google.cloud.compute_v1.types.InterconnectAttachment]): + A list of interconnect attachments contained + in this scope. + warning (google.cloud.compute_v1.types.Warning): + Informational warning which replaces the list + of addresses when the list is empty. + + This field is a member of `oneof`_ ``_warning``. + """ + + interconnect_attachments: MutableSequence[ + "InterconnectAttachment" + ] = proto.RepeatedField( + proto.MESSAGE, + number=425388415, + message="InterconnectAttachment", + ) + warning: "Warning" = proto.Field( + proto.MESSAGE, + number=50704284, + optional=True, + message="Warning", + ) + + +class InterconnectCircuitInfo(proto.Message): + r"""Describes a single physical circuit between the Customer and + Google. CircuitInfo objects are created by Google, so all fields + are output only. + + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + customer_demarc_id (str): + Customer-side demarc ID for this circuit. + + This field is a member of `oneof`_ ``_customer_demarc_id``. + google_circuit_id (str): + Google-assigned unique ID for this circuit. + Assigned at circuit turn-up. + + This field is a member of `oneof`_ ``_google_circuit_id``. + google_demarc_id (str): + Google-side demarc ID for this circuit. + Assigned at circuit turn-up and provided by + Google to the customer in the LOA. + + This field is a member of `oneof`_ ``_google_demarc_id``. + """ + + customer_demarc_id: str = proto.Field( + proto.STRING, + number=28771859, + optional=True, + ) + google_circuit_id: str = proto.Field( + proto.STRING, + number=262014711, + optional=True, + ) + google_demarc_id: str = proto.Field( + proto.STRING, + number=448196270, + optional=True, + ) + + +class InterconnectDiagnostics(proto.Message): + r"""Diagnostics information about the Interconnect connection, + which contains detailed and current technical information about + Google's side of the connection. + + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + arp_caches (MutableSequence[google.cloud.compute_v1.types.InterconnectDiagnosticsARPEntry]): + A list of InterconnectDiagnostics.ARPEntry + objects, describing individual neighbors + currently seen by the Google router in the ARP + cache for the Interconnect. This will be empty + when the Interconnect is not bundled. + bundle_aggregation_type (str): + The aggregation type of the bundle interface. + Check the BundleAggregationType enum for the + list of possible values. + + This field is a member of `oneof`_ ``_bundle_aggregation_type``. + bundle_operational_status (str): + The operational status of the bundle + interface. Check the BundleOperationalStatus + enum for the list of possible values. + + This field is a member of `oneof`_ ``_bundle_operational_status``. + links (MutableSequence[google.cloud.compute_v1.types.InterconnectDiagnosticsLinkStatus]): + A list of InterconnectDiagnostics.LinkStatus + objects, describing the status for each link on + the Interconnect. + mac_address (str): + The MAC address of the Interconnect's bundle + interface. + + This field is a member of `oneof`_ ``_mac_address``. + """ + + class BundleAggregationType(proto.Enum): + r"""The aggregation type of the bundle interface. + + Values: + UNDEFINED_BUNDLE_AGGREGATION_TYPE (0): + A value indicating that the enum field is not + set. + BUNDLE_AGGREGATION_TYPE_LACP (27758925): + LACP is enabled. + BUNDLE_AGGREGATION_TYPE_STATIC (50678873): + LACP is disabled. + """ + UNDEFINED_BUNDLE_AGGREGATION_TYPE = 0 + BUNDLE_AGGREGATION_TYPE_LACP = 27758925 + BUNDLE_AGGREGATION_TYPE_STATIC = 50678873 + + class BundleOperationalStatus(proto.Enum): + r"""The operational status of the bundle interface. + + Values: + UNDEFINED_BUNDLE_OPERATIONAL_STATUS (0): + A value indicating that the enum field is not + set. + BUNDLE_OPERATIONAL_STATUS_DOWN (453842693): + If bundleAggregationType is LACP: LACP is not + established and/or all links in the bundle have + DOWN operational status. If + bundleAggregationType is STATIC: one or more + links in the bundle has DOWN operational status. + BUNDLE_OPERATIONAL_STATUS_UP (161366462): + If bundleAggregationType is LACP: LACP is + established and at least one link in the bundle + has UP operational status. If + bundleAggregationType is STATIC: all links in + the bundle (typically just one) have UP + operational status. + """ + UNDEFINED_BUNDLE_OPERATIONAL_STATUS = 0 + BUNDLE_OPERATIONAL_STATUS_DOWN = 453842693 + BUNDLE_OPERATIONAL_STATUS_UP = 161366462 + + arp_caches: MutableSequence[ + "InterconnectDiagnosticsARPEntry" + ] = proto.RepeatedField( + proto.MESSAGE, + number=414591761, + message="InterconnectDiagnosticsARPEntry", + ) + bundle_aggregation_type: str = proto.Field( + proto.STRING, + number=434939028, + optional=True, + ) + bundle_operational_status: str = proto.Field( + proto.STRING, + number=106433500, + optional=True, + ) + links: MutableSequence["InterconnectDiagnosticsLinkStatus"] = proto.RepeatedField( + proto.MESSAGE, + number=102977465, + message="InterconnectDiagnosticsLinkStatus", + ) + mac_address: str = proto.Field( + proto.STRING, + number=332540164, + optional=True, + ) + + +class InterconnectDiagnosticsARPEntry(proto.Message): + r"""Describing the ARP neighbor entries seen on this link + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + ip_address (str): + The IP address of this ARP neighbor. + + This field is a member of `oneof`_ ``_ip_address``. + mac_address (str): + The MAC address of this ARP neighbor. + + This field is a member of `oneof`_ ``_mac_address``. + """ + + ip_address: str = proto.Field( + proto.STRING, + number=406272220, + optional=True, + ) + mac_address: str = proto.Field( + proto.STRING, + number=332540164, + optional=True, + ) + + +class InterconnectDiagnosticsLinkLACPStatus(proto.Message): + r""" + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + google_system_id (str): + System ID of the port on Google's side of the + LACP exchange. + + This field is a member of `oneof`_ ``_google_system_id``. + neighbor_system_id (str): + System ID of the port on the neighbor's side + of the LACP exchange. + + This field is a member of `oneof`_ ``_neighbor_system_id``. + state (str): + The state of a LACP link, which can take one + of the following values: - ACTIVE: The link is + configured and active within the bundle. - + DETACHED: The link is not configured within the + bundle. This means that the rest of the object + should be empty. Check the State enum for the + list of possible values. + + This field is a member of `oneof`_ ``_state``. + """ + + class State(proto.Enum): + r"""The state of a LACP link, which can take one of the following + values: - ACTIVE: The link is configured and active within the + bundle. - DETACHED: The link is not configured within the + bundle. This means that the rest of the object should be empty. + + Values: + UNDEFINED_STATE (0): + A value indicating that the enum field is not + set. + ACTIVE (314733318): + The link is configured and active within the + bundle. + DETACHED (216562546): + The link is not configured within the bundle, + this means the rest of the object should be + empty. + """ + UNDEFINED_STATE = 0 + ACTIVE = 314733318 + DETACHED = 216562546 + + google_system_id: str = proto.Field( + proto.STRING, + number=91210405, + optional=True, + ) + neighbor_system_id: str = proto.Field( + proto.STRING, + number=343821342, + optional=True, + ) + state: str = proto.Field( + proto.STRING, + number=109757585, + optional=True, + ) + + +class InterconnectDiagnosticsLinkOpticalPower(proto.Message): + r""" + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + state (str): + The status of the current value when compared to the warning + and alarm levels for the receiving or transmitting + transceiver. Possible states include: - OK: The value has + not crossed a warning threshold. - LOW_WARNING: The value + has crossed below the low warning threshold. - HIGH_WARNING: + The value has crossed above the high warning threshold. - LOW_ALARM: The value has crossed below the low alarm threshold. - HIGH_ALARM: The value has crossed above the high alarm threshold. Check the State enum for the list of possible values. - This field is a member of `oneof`_ ``_state``. - value (float): - Value of the current receiving or - transmitting optical power, read in dBm. Take a - known good optical value, give it a 10% margin - and trigger warnings relative to that value. In - general, a -7dBm warning and a -11dBm alarm are - good optical value estimates for most links. + This field is a member of `oneof`_ ``_state``. + value (float): + Value of the current receiving or + transmitting optical power, read in dBm. Take a + known good optical value, give it a 10% margin + and trigger warnings relative to that value. In + general, a -7dBm warning and a -11dBm alarm are + good optical value estimates for most links. + + This field is a member of `oneof`_ ``_value``. + """ + + class State(proto.Enum): + r"""The status of the current value when compared to the warning and + alarm levels for the receiving or transmitting transceiver. Possible + states include: - OK: The value has not crossed a warning threshold. + - LOW_WARNING: The value has crossed below the low warning + threshold. - HIGH_WARNING: The value has crossed above the high + warning threshold. - LOW_ALARM: The value has crossed below the low + alarm threshold. - HIGH_ALARM: The value has crossed above the high + alarm threshold. + + Values: + UNDEFINED_STATE (0): + A value indicating that the enum field is not + set. + HIGH_ALARM (305363284): + The value has crossed above the high alarm + threshold. + HIGH_WARNING (220984799): + The value of the current optical power has + crossed above the high warning threshold. + LOW_ALARM (316659046): + The value of the current optical power has + crossed below the low alarm threshold. + LOW_WARNING (338793841): + The value of the current optical power has + crossed below the low warning threshold. + OK (2524): + The value of the current optical power has + not crossed a warning threshold. + """ + UNDEFINED_STATE = 0 + HIGH_ALARM = 305363284 + HIGH_WARNING = 220984799 + LOW_ALARM = 316659046 + LOW_WARNING = 338793841 + OK = 2524 + + state: str = proto.Field( + proto.STRING, + number=109757585, + optional=True, + ) + value: float = proto.Field( + proto.FLOAT, + number=111972721, + optional=True, + ) + + +class InterconnectDiagnosticsLinkStatus(proto.Message): + r""" + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + arp_caches (MutableSequence[google.cloud.compute_v1.types.InterconnectDiagnosticsARPEntry]): + A list of InterconnectDiagnostics.ARPEntry + objects, describing the ARP neighbor entries + seen on this link. This will be empty if the + link is bundled + circuit_id (str): + The unique ID for this link assigned during + turn up by Google. + + This field is a member of `oneof`_ ``_circuit_id``. + google_demarc (str): + The Demarc address assigned by Google and + provided in the LoA. + + This field is a member of `oneof`_ ``_google_demarc``. + lacp_status (google.cloud.compute_v1.types.InterconnectDiagnosticsLinkLACPStatus): + + This field is a member of `oneof`_ ``_lacp_status``. + macsec (google.cloud.compute_v1.types.InterconnectDiagnosticsMacsecStatus): + Describes the status of MACsec encryption on + this link. + + This field is a member of `oneof`_ ``_macsec``. + operational_status (str): + The operational status of the link. + Check the OperationalStatus enum for the list of + possible values. + + This field is a member of `oneof`_ ``_operational_status``. + receiving_optical_power (google.cloud.compute_v1.types.InterconnectDiagnosticsLinkOpticalPower): + An InterconnectDiagnostics.LinkOpticalPower + object, describing the current value and status + of the received light level. + + This field is a member of `oneof`_ ``_receiving_optical_power``. + transmitting_optical_power (google.cloud.compute_v1.types.InterconnectDiagnosticsLinkOpticalPower): + An InterconnectDiagnostics.LinkOpticalPower + object, describing the current value and status + of the transmitted light level. + + This field is a member of `oneof`_ ``_transmitting_optical_power``. + """ + + class OperationalStatus(proto.Enum): + r"""The operational status of the link. + + Values: + UNDEFINED_OPERATIONAL_STATUS (0): + A value indicating that the enum field is not + set. + LINK_OPERATIONAL_STATUS_DOWN (281653885): + The interface is unable to communicate with + the remote end. + LINK_OPERATIONAL_STATUS_UP (305879862): + The interface has low level communication + with the remote end. + """ + UNDEFINED_OPERATIONAL_STATUS = 0 + LINK_OPERATIONAL_STATUS_DOWN = 281653885 + LINK_OPERATIONAL_STATUS_UP = 305879862 + + arp_caches: MutableSequence[ + "InterconnectDiagnosticsARPEntry" + ] = proto.RepeatedField( + proto.MESSAGE, + number=414591761, + message="InterconnectDiagnosticsARPEntry", + ) + circuit_id: str = proto.Field( + proto.STRING, + number=225180977, + optional=True, + ) + google_demarc: str = proto.Field( + proto.STRING, + number=51084, + optional=True, + ) + lacp_status: "InterconnectDiagnosticsLinkLACPStatus" = proto.Field( + proto.MESSAGE, + number=361210415, + optional=True, + message="InterconnectDiagnosticsLinkLACPStatus", + ) + macsec: "InterconnectDiagnosticsMacsecStatus" = proto.Field( + proto.MESSAGE, + number=528867490, + optional=True, + message="InterconnectDiagnosticsMacsecStatus", + ) + operational_status: str = proto.Field( + proto.STRING, + number=201070847, + optional=True, + ) + receiving_optical_power: "InterconnectDiagnosticsLinkOpticalPower" = proto.Field( + proto.MESSAGE, + number=244717279, + optional=True, + message="InterconnectDiagnosticsLinkOpticalPower", + ) + transmitting_optical_power: "InterconnectDiagnosticsLinkOpticalPower" = proto.Field( + proto.MESSAGE, + number=459431197, + optional=True, + message="InterconnectDiagnosticsLinkOpticalPower", + ) + + +class InterconnectDiagnosticsMacsecStatus(proto.Message): + r"""Describes the status of MACsec encryption on the link. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + ckn (str): + Indicates the Connectivity Association Key + Name (CKN) currently being used if MACsec is + operational. + + This field is a member of `oneof`_ ``_ckn``. + operational (bool): + Indicates whether or not MACsec is + operational on this link. + + This field is a member of `oneof`_ ``_operational``. + """ + + ckn: str = proto.Field( + proto.STRING, + number=98566, + optional=True, + ) + operational: bool = proto.Field( + proto.BOOL, + number=129704914, + optional=True, + ) + + +class InterconnectGroup(proto.Message): + r"""An interconnect group resource allows customers to create, + analyze, and expand their redundant connections. + + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + configured (google.cloud.compute_v1.types.InterconnectGroupConfigured): + + This field is a member of `oneof`_ ``_configured``. + creation_timestamp (str): + [Output Only] Creation timestamp in RFC3339 text format. + + This field is a member of `oneof`_ ``_creation_timestamp``. + description (str): + An optional description of this resource. + Provide this property when you create the + resource. + + This field is a member of `oneof`_ ``_description``. + etag (str): + Opaque system-generated token that uniquely + identifies the configuration. If provided when + patching a configuration in update mode, the + provided token must match the current token or + the update is rejected. This provides a reliable + means of doing read-modify-write (optimistic + locking) as described by API 154. + + This field is a member of `oneof`_ ``_etag``. + id (int): + [Output Only] The unique identifier for the resource type. + The server generates this identifier. + + This field is a member of `oneof`_ ``_id``. + intent (google.cloud.compute_v1.types.InterconnectGroupIntent): + + This field is a member of `oneof`_ ``_intent``. + interconnects (MutableMapping[str, google.cloud.compute_v1.types.InterconnectGroupInterconnect]): + Interconnects in the InterconnectGroup. Keys + are arbitrary user-specified strings. Users are + encouraged, but not required, to use their + preferred format for resource links as keys. + Note that there are add-members and + remove-members methods in gcloud. The size of + this map is limited by an "Interconnects per + group" quota. + kind (str): + [Output Only] Type of the resource. Always + compute#InterconnectGroup + + This field is a member of `oneof`_ ``_kind``. + name (str): + Name of the resource. Provided by the client when the + resource is created. The name must be 1-63 characters long, + and comply with RFC1035. Specifically, the name must be 1-63 + characters long and match the regular expression + ``[a-z]([-a-z0-9]*[a-z0-9])?`` which means the first + character must be a lowercase letter, and all following + characters must be a dash, lowercase letter, or digit, + except the last character, which cannot be a dash. + + This field is a member of `oneof`_ ``_name``. + physical_structure (google.cloud.compute_v1.types.InterconnectGroupPhysicalStructure): + + This field is a member of `oneof`_ ``_physical_structure``. + self_link (str): + [Output Only] Server-defined URL for the resource. + + This field is a member of `oneof`_ ``_self_link``. + """ + + configured: "InterconnectGroupConfigured" = proto.Field( + proto.MESSAGE, + number=295631422, + optional=True, + message="InterconnectGroupConfigured", + ) + creation_timestamp: str = proto.Field( + proto.STRING, + number=30525366, + optional=True, + ) + description: str = proto.Field( + proto.STRING, + number=422937596, + optional=True, + ) + etag: str = proto.Field( + proto.STRING, + number=3123477, + optional=True, + ) + id: int = proto.Field( + proto.UINT64, + number=3355, + optional=True, + ) + intent: "InterconnectGroupIntent" = proto.Field( + proto.MESSAGE, + number=426849948, + optional=True, + message="InterconnectGroupIntent", + ) + interconnects: MutableMapping[ + str, "InterconnectGroupInterconnect" + ] = proto.MapField( + proto.STRING, + proto.MESSAGE, + number=520187301, + message="InterconnectGroupInterconnect", + ) + kind: str = proto.Field( + proto.STRING, + number=3292052, + optional=True, + ) + name: str = proto.Field( + proto.STRING, + number=3373707, + optional=True, + ) + physical_structure: "InterconnectGroupPhysicalStructure" = proto.Field( + proto.MESSAGE, + number=195307531, + optional=True, + message="InterconnectGroupPhysicalStructure", + ) + self_link: str = proto.Field( + proto.STRING, + number=456214797, + optional=True, + ) + + +class InterconnectGroupConfigured(proto.Message): + r"""[Output Only] The status of the group as configured. This has the + same structure as the operational field reported by the + OperationalStatus method, but does not take into account the + operational status of each resource. + + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + topology_capability (google.cloud.compute_v1.types.InterconnectGroupConfiguredTopologyCapability): + + This field is a member of `oneof`_ ``_topology_capability``. + """ + + topology_capability: "InterconnectGroupConfiguredTopologyCapability" = proto.Field( + proto.MESSAGE, + number=144190696, + optional=True, + message="InterconnectGroupConfiguredTopologyCapability", + ) + + +class InterconnectGroupConfiguredTopologyCapability(proto.Message): + r"""[Output Only] How reliable this topology is configured to be, and + why this group does or does not meet the requirements for the + intended capability. + + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + intended_capability_blockers (MutableSequence[google.cloud.compute_v1.types.InterconnectGroupConfiguredTopologyCapabilityIntendedCapabilityBlockers]): + + supported_sla (str): + Check the SupportedSla enum for the list of + possible values. + + This field is a member of `oneof`_ ``_supported_sla``. + """ + + class SupportedSla(proto.Enum): + r""" + + Values: + UNDEFINED_SUPPORTED_SLA (0): + A value indicating that the enum field is not + set. + NO_SLA (161460618): + No description available. + PRODUCTION_CRITICAL (470416485): + No description available. + PRODUCTION_NON_CRITICAL (117399223): + No description available. + UNSPECIFIED (526786327): + No description available. + """ + UNDEFINED_SUPPORTED_SLA = 0 + NO_SLA = 161460618 + PRODUCTION_CRITICAL = 470416485 + PRODUCTION_NON_CRITICAL = 117399223 + UNSPECIFIED = 526786327 + + intended_capability_blockers: MutableSequence[ + "InterconnectGroupConfiguredTopologyCapabilityIntendedCapabilityBlockers" + ] = proto.RepeatedField( + proto.MESSAGE, + number=531644140, + message="InterconnectGroupConfiguredTopologyCapabilityIntendedCapabilityBlockers", + ) + supported_sla: str = proto.Field( + proto.STRING, + number=59292183, + optional=True, + ) + + +class InterconnectGroupConfiguredTopologyCapabilityIntendedCapabilityBlockers( + proto.Message +): + r"""[Output Only] Reasons why configuration.topologyCapability.sla + differs from intent.topologyCapability. This list is empty if and + only if those are the same. + + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + blocker_type (str): + Check the BlockerType enum for the list of + possible values. + + This field is a member of `oneof`_ ``_blocker_type``. + documentation_link (str): + [Output Only] The url of Google Cloud public documentation + explaining this requirement. This is set for every type of + requirement. + + This field is a member of `oneof`_ ``_documentation_link``. + explanation (str): + [Output Only] A human-readable explanation of this + requirement and why it's not met. This is set for every type + of requirement. + + This field is a member of `oneof`_ ``_explanation``. + facilities (MutableSequence[str]): + [Output Only] Facilities used to explain this blocker in + more detail. Like + physicalStructure.metros.facilities.facility, this is a + numeric string like "5467". + interconnects (MutableSequence[str]): + [Output Only] Interconnects used to explain this blocker in + more detail. + metros (MutableSequence[str]): + [Output Only] Metros used to explain this blocker in more + detail. These are three-letter lowercase strings like "iad". + A blocker like INCOMPATIBLE_METROS will specify the + problematic metros in this field. + zones (MutableSequence[str]): + [Output Only] Zones used to explain this blocker in more + detail. Zone names are "zone1" and/or "zone2". + """ + + class BlockerType(proto.Enum): + r""" + + Values: + UNDEFINED_BLOCKER_TYPE (0): + A value indicating that the enum field is not + set. + INCOMPATIBLE_METROS (290410432): + No description available. + NOT_AVAILABLE (140722205): + No description available. + NO_INTERCONNECTS (523549575): + No description available. + NO_INTERCONNECTS_IN_METRO_AND_ZONE (440966492): + No description available. + OTHER (75532016): + No description available. + UNSPECIFIED (526786327): + No description available. + """ + UNDEFINED_BLOCKER_TYPE = 0 + INCOMPATIBLE_METROS = 290410432 + NOT_AVAILABLE = 140722205 + NO_INTERCONNECTS = 523549575 + NO_INTERCONNECTS_IN_METRO_AND_ZONE = 440966492 + OTHER = 75532016 + UNSPECIFIED = 526786327 + + blocker_type: str = proto.Field( + proto.STRING, + number=381194847, + optional=True, + ) + documentation_link: str = proto.Field( + proto.STRING, + number=93465183, + optional=True, + ) + explanation: str = proto.Field( + proto.STRING, + number=504745497, + optional=True, + ) + facilities: MutableSequence[str] = proto.RepeatedField( + proto.STRING, + number=536683137, + ) + interconnects: MutableSequence[str] = proto.RepeatedField( + proto.STRING, + number=520187301, + ) + metros: MutableSequence[str] = proto.RepeatedField( + proto.STRING, + number=533067386, + ) + zones: MutableSequence[str] = proto.RepeatedField( + proto.STRING, + number=116085319, + ) + + +class InterconnectGroupIntent(proto.Message): + r"""The user's intent for this group. This is the only required + field besides the name that must be specified on group creation. + + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + topology_capability (str): + Check the TopologyCapability enum for the + list of possible values. + + This field is a member of `oneof`_ ``_topology_capability``. + """ + + class TopologyCapability(proto.Enum): + r""" + + Values: + UNDEFINED_TOPOLOGY_CAPABILITY (0): + A value indicating that the enum field is not + set. + NO_SLA (161460618): + No description available. + PRODUCTION_CRITICAL (470416485): + No description available. + PRODUCTION_NON_CRITICAL (117399223): + No description available. + UNSPECIFIED (526786327): + No description available. + """ + UNDEFINED_TOPOLOGY_CAPABILITY = 0 + NO_SLA = 161460618 + PRODUCTION_CRITICAL = 470416485 + PRODUCTION_NON_CRITICAL = 117399223 + UNSPECIFIED = 526786327 + + topology_capability: str = proto.Field( + proto.STRING, + number=144190696, + optional=True, + ) + + +class InterconnectGroupInterconnect(proto.Message): + r"""An Interconnect in this InterconnectGroup. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + interconnect (str): + The URL of an Interconnect in this group. All + Interconnects in the group are unique. + + This field is a member of `oneof`_ ``_interconnect``. + """ + + interconnect: str = proto.Field( + proto.STRING, + number=224601230, + optional=True, + ) + + +class InterconnectGroupPhysicalStructure(proto.Message): + r"""[Output Only] An analysis of the physical layout of Interconnects in + this group. Every Interconnect in the group is shown once in this + structure. + + Attributes: + metros (MutableSequence[google.cloud.compute_v1.types.InterconnectGroupPhysicalStructureMetros]): + + """ + + metros: MutableSequence[ + "InterconnectGroupPhysicalStructureMetros" + ] = proto.RepeatedField( + proto.MESSAGE, + number=533067386, + message="InterconnectGroupPhysicalStructureMetros", + ) + + +class InterconnectGroupPhysicalStructureMetros(proto.Message): + r"""[Output Only] The metros Interconnects in this group are in. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + facilities (MutableSequence[google.cloud.compute_v1.types.InterconnectGroupPhysicalStructureMetrosFacilities]): + + metro (str): + [Output Only] The name of the metro, as a three-letter + lowercase string like "iad". This is the first component of + the location of Interconnects underneath this. + + This field is a member of `oneof`_ ``_metro``. + """ + + facilities: MutableSequence[ + "InterconnectGroupPhysicalStructureMetrosFacilities" + ] = proto.RepeatedField( + proto.MESSAGE, + number=536683137, + message="InterconnectGroupPhysicalStructureMetrosFacilities", + ) + metro: str = proto.Field( + proto.STRING, + number=103787801, + optional=True, + ) + + +class InterconnectGroupPhysicalStructureMetrosFacilities(proto.Message): + r"""[Output Only] The facilities Interconnects in this metro are present + in. + + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + facility (str): + [Output Only] The ID of this facility, as a numeric string + like "5467". This is the third component of the location of + Interconnects in this facility. + + This field is a member of `oneof`_ ``_facility``. + zones (MutableSequence[google.cloud.compute_v1.types.InterconnectGroupPhysicalStructureMetrosFacilitiesZones]): + + """ + + facility: str = proto.Field( + proto.STRING, + number=501116579, + optional=True, + ) + zones: MutableSequence[ + "InterconnectGroupPhysicalStructureMetrosFacilitiesZones" + ] = proto.RepeatedField( + proto.MESSAGE, + number=116085319, + message="InterconnectGroupPhysicalStructureMetrosFacilitiesZones", + ) + + +class InterconnectGroupPhysicalStructureMetrosFacilitiesZones(proto.Message): + r"""[Output Only] The zones that Interconnects in this facility are + present in. + + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + interconnects (MutableSequence[str]): + [Output Only] URLs of Interconnects in this redundancy group + in the given metro, facility, and zone. + zone (str): + [Output Only] The name of the zone, either "zone1" or + "zone2". This is the second component of the location of + Interconnects in this facility. + + This field is a member of `oneof`_ ``_zone``. + """ + + interconnects: MutableSequence[str] = proto.RepeatedField( + proto.STRING, + number=520187301, + ) + zone: str = proto.Field( + proto.STRING, + number=3744684, + optional=True, + ) + + +class InterconnectGroupsCreateMembers(proto.Message): + r""" + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + intent_mismatch_behavior (str): + How to behave when + configured.topologyCapability.supportedSLA would + not equal intent.topologyCapability after this + call. Check the IntentMismatchBehavior enum for + the list of possible values. + + This field is a member of `oneof`_ ``_intent_mismatch_behavior``. + interconnects (MutableSequence[google.cloud.compute_v1.types.InterconnectGroupsCreateMembersInterconnectInput]): + + template_interconnect (google.cloud.compute_v1.types.InterconnectGroupsCreateMembersInterconnectInput): + Parameters for the Interconnects to create. + + This field is a member of `oneof`_ ``_template_interconnect``. + """ + + class IntentMismatchBehavior(proto.Enum): + r"""How to behave when configured.topologyCapability.supportedSLA + would not equal intent.topologyCapability after this call. + + Values: + UNDEFINED_INTENT_MISMATCH_BEHAVIOR (0): + A value indicating that the enum field is not + set. + CREATE (385389820): + No description available. + REJECT (266102687): + No description available. + UNSPECIFIED (526786327): + No description available. + """ + UNDEFINED_INTENT_MISMATCH_BEHAVIOR = 0 + CREATE = 385389820 + REJECT = 266102687 + UNSPECIFIED = 526786327 + + intent_mismatch_behavior: str = proto.Field( + proto.STRING, + number=164408000, + optional=True, + ) + interconnects: MutableSequence[ + "InterconnectGroupsCreateMembersInterconnectInput" + ] = proto.RepeatedField( + proto.MESSAGE, + number=520187301, + message="InterconnectGroupsCreateMembersInterconnectInput", + ) + template_interconnect: "InterconnectGroupsCreateMembersInterconnectInput" = ( + proto.Field( + proto.MESSAGE, + number=224745523, + optional=True, + message="InterconnectGroupsCreateMembersInterconnectInput", + ) + ) + + +class InterconnectGroupsCreateMembersInterconnectInput(proto.Message): + r"""LINT.IfChange + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + admin_enabled (bool): + Administrative status of the interconnect. + When this is set to true, the Interconnect is + functional and can carry traffic. When set to + false, no packets can be carried over the + interconnect and no BGP routes are exchanged + over it. By default, the status is set to true. + + This field is a member of `oneof`_ ``_admin_enabled``. + customer_name (str): + Customer name, to put in the Letter of + Authorization as the party authorized to request + a crossconnect. - This field is a member of `oneof`_ ``_value``. + This field is a member of `oneof`_ ``_customer_name``. + description (str): + An optional description of this resource. + Provide this property when you create the + resource. + + This field is a member of `oneof`_ ``_description``. + facility (str): + A zone-free location to use for all + Interconnects created in this call, like + "iad-1234". + + This field is a member of `oneof`_ ``_facility``. + interconnect_type (str): + Type of interconnect, which can take one of the following + values: - PARTNER: A partner-managed interconnection shared + between customers though a partner. - DEDICATED: A dedicated + physical interconnection with the customer. Note that a + value IT_PRIVATE has been deprecated in favor of DEDICATED. + Check the InterconnectType enum for the list of possible + values. + + This field is a member of `oneof`_ ``_interconnect_type``. + link_type (str): + Type of link requested, which can take one of the following + values: - LINK_TYPE_ETHERNET_10G_LR: A 10G Ethernet with LR + optics - LINK_TYPE_ETHERNET_100G_LR: A 100G Ethernet with LR + optics. - LINK_TYPE_ETHERNET_400G_LR4: A 400G Ethernet with + LR4 optics. Note that this field indicates the speed of each + of the links in the bundle, not the speed of the entire + bundle. Check the LinkType enum for the list of possible + values. + + This field is a member of `oneof`_ ``_link_type``. + name (str): + Name of the Interconnects to be created. This must be + specified on the template and/or on each individual + interconnect. The name, if not empty, must be 1-63 + characters long, and comply with RFC1035. Specifically, any + nonempty name must be 1-63 characters long and match the + regular expression ``[a-z]([-a-z0-9]*[a-z0-9])?`` which + means the first character must be a lowercase letter, and + all following characters must be a dash, lowercase letter, + or digit, except the last character, which cannot be a dash. + + This field is a member of `oneof`_ ``_name``. + noc_contact_email (str): + Email address to contact the customer NOC for + operations and maintenance notifications + regarding this Interconnect. If specified, this + will be used for notifications in addition to + all other forms described, such as Cloud + Monitoring logs alerting and Cloud + Notifications. This field is required for users + who sign up for Cloud Interconnect using + workforce identity federation. + + This field is a member of `oneof`_ ``_noc_contact_email``. + remote_location (str): + Indicates that this is a Cross-Cloud + Interconnect. This field specifies the location + outside of Google's network that the + interconnect is connected to. + + This field is a member of `oneof`_ ``_remote_location``. + requested_features (MutableSequence[str]): + Optional. List of features requested for this Interconnect + connection, which can take one of the following values: - + IF_MACSEC If specified then the connection is created on + MACsec capable hardware ports. If not specified, the default + value is false, which allocates non-MACsec capable ports + first if available. This parameter can be provided only with + Interconnect INSERT. It isn't valid for Interconnect PATCH. + Check the RequestedFeatures enum for the list of possible + values. + requested_link_count (int): + Target number of physical links in the link + bundle, as requested by the customer. + + This field is a member of `oneof`_ ``_requested_link_count``. """ - class State(proto.Enum): - r"""The status of the current value when compared to the warning and - alarm levels for the receiving or transmitting transceiver. Possible - states include: - OK: The value has not crossed a warning threshold. - - LOW_WARNING: The value has crossed below the low warning - threshold. - HIGH_WARNING: The value has crossed above the high - warning threshold. - LOW_ALARM: The value has crossed below the low - alarm threshold. - HIGH_ALARM: The value has crossed above the high - alarm threshold. + class InterconnectType(proto.Enum): + r"""Type of interconnect, which can take one of the following values: - + PARTNER: A partner-managed interconnection shared between customers + though a partner. - DEDICATED: A dedicated physical interconnection + with the customer. Note that a value IT_PRIVATE has been deprecated + in favor of DEDICATED. Values: - UNDEFINED_STATE (0): + UNDEFINED_INTERCONNECT_TYPE (0): A value indicating that the enum field is not set. - HIGH_ALARM (305363284): - The value has crossed above the high alarm - threshold. - HIGH_WARNING (220984799): - The value of the current optical power has - crossed above the high warning threshold. - LOW_ALARM (316659046): - The value of the current optical power has - crossed below the low alarm threshold. - LOW_WARNING (338793841): - The value of the current optical power has - crossed below the low warning threshold. - OK (2524): - The value of the current optical power has - not crossed a warning threshold. + DEDICATED (258411983): + A dedicated physical interconnection with the + customer. + IT_PRIVATE (335677007): + [Deprecated] A private, physical interconnection with the + customer. + PARTNER (461924520): + A partner-managed interconnection shared + between customers via partner. """ - UNDEFINED_STATE = 0 - HIGH_ALARM = 305363284 - HIGH_WARNING = 220984799 - LOW_ALARM = 316659046 - LOW_WARNING = 338793841 - OK = 2524 + UNDEFINED_INTERCONNECT_TYPE = 0 + DEDICATED = 258411983 + IT_PRIVATE = 335677007 + PARTNER = 461924520 - state: str = proto.Field( + class LinkType(proto.Enum): + r"""Type of link requested, which can take one of the following values: + - LINK_TYPE_ETHERNET_10G_LR: A 10G Ethernet with LR optics - + LINK_TYPE_ETHERNET_100G_LR: A 100G Ethernet with LR optics. - + LINK_TYPE_ETHERNET_400G_LR4: A 400G Ethernet with LR4 optics. Note + that this field indicates the speed of each of the links in the + bundle, not the speed of the entire bundle. + + Values: + UNDEFINED_LINK_TYPE (0): + A value indicating that the enum field is not + set. + LINK_TYPE_ETHERNET_100G_LR (337672551): + 100G Ethernet, LR Optics. + LINK_TYPE_ETHERNET_10G_LR (236739749): + 10G Ethernet, LR Optics. [(rate_bps) = 10000000000]; + LINK_TYPE_ETHERNET_400G_LR4 (127023690): + 400G Ethernet, LR4 Optics. + """ + UNDEFINED_LINK_TYPE = 0 + LINK_TYPE_ETHERNET_100G_LR = 337672551 + LINK_TYPE_ETHERNET_10G_LR = 236739749 + LINK_TYPE_ETHERNET_400G_LR4 = 127023690 + + class RequestedFeatures(proto.Enum): + r""" + + Values: + UNDEFINED_REQUESTED_FEATURES (0): + A value indicating that the enum field is not + set. + IF_MACSEC (396279300): + Media Access Control security (MACsec) + """ + UNDEFINED_REQUESTED_FEATURES = 0 + IF_MACSEC = 396279300 + + admin_enabled: bool = proto.Field( + proto.BOOL, + number=445675089, + optional=True, + ) + customer_name: str = proto.Field( proto.STRING, - number=109757585, + number=3665484, optional=True, ) - value: float = proto.Field( - proto.FLOAT, - number=111972721, + description: str = proto.Field( + proto.STRING, + number=422937596, + optional=True, + ) + facility: str = proto.Field( + proto.STRING, + number=501116579, + optional=True, + ) + interconnect_type: str = proto.Field( + proto.STRING, + number=515165259, + optional=True, + ) + link_type: str = proto.Field( + proto.STRING, + number=523207775, + optional=True, + ) + name: str = proto.Field( + proto.STRING, + number=3373707, + optional=True, + ) + noc_contact_email: str = proto.Field( + proto.STRING, + number=14072832, + optional=True, + ) + remote_location: str = proto.Field( + proto.STRING, + number=324388750, + optional=True, + ) + requested_features: MutableSequence[str] = proto.RepeatedField( + proto.STRING, + number=461240814, + ) + requested_link_count: int = proto.Field( + proto.INT32, + number=45051387, optional=True, ) -class InterconnectDiagnosticsLinkStatus(proto.Message): +class InterconnectGroupsCreateMembersRequest(proto.Message): r""" .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields Attributes: - arp_caches (MutableSequence[google.cloud.compute_v1.types.InterconnectDiagnosticsARPEntry]): - A list of InterconnectDiagnostics.ARPEntry - objects, describing the ARP neighbor entries - seen on this link. This will be empty if the - link is bundled - circuit_id (str): - The unique ID for this link assigned during - turn up by Google. + request (google.cloud.compute_v1.types.InterconnectGroupsCreateMembers): - This field is a member of `oneof`_ ``_circuit_id``. - google_demarc (str): - The Demarc address assigned by Google and - provided in the LoA. + This field is a member of `oneof`_ ``_request``. + """ - This field is a member of `oneof`_ ``_google_demarc``. - lacp_status (google.cloud.compute_v1.types.InterconnectDiagnosticsLinkLACPStatus): + request: "InterconnectGroupsCreateMembers" = proto.Field( + proto.MESSAGE, + number=21951119, + optional=True, + message="InterconnectGroupsCreateMembers", + ) - This field is a member of `oneof`_ ``_lacp_status``. - macsec (google.cloud.compute_v1.types.InterconnectDiagnosticsMacsecStatus): - Describes the status of MACsec encryption on - this link. - This field is a member of `oneof`_ ``_macsec``. - operational_status (str): - The operational status of the link. - Check the OperationalStatus enum for the list of - possible values. +class InterconnectGroupsGetOperationalStatusResponse(proto.Message): + r"""Response for the + InterconnectGroupsGetOperationalStatusResponse. - This field is a member of `oneof`_ ``_operational_status``. - receiving_optical_power (google.cloud.compute_v1.types.InterconnectDiagnosticsLinkOpticalPower): - An InterconnectDiagnostics.LinkOpticalPower - object, describing the current value and status - of the received light level. - This field is a member of `oneof`_ ``_receiving_optical_power``. - transmitting_optical_power (google.cloud.compute_v1.types.InterconnectDiagnosticsLinkOpticalPower): - An InterconnectDiagnostics.LinkOpticalPower - object, describing the current value and status - of the transmitted light level. + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields - This field is a member of `oneof`_ ``_transmitting_optical_power``. + Attributes: + etag (str): + + This field is a member of `oneof`_ ``_etag``. + result (google.cloud.compute_v1.types.InterconnectGroupsOperationalStatus): + + This field is a member of `oneof`_ ``_result``. """ - class OperationalStatus(proto.Enum): - r"""The operational status of the link. + etag: str = proto.Field( + proto.STRING, + number=3123477, + optional=True, + ) + result: "InterconnectGroupsOperationalStatus" = proto.Field( + proto.MESSAGE, + number=139315229, + optional=True, + message="InterconnectGroupsOperationalStatus", + ) - Values: - UNDEFINED_OPERATIONAL_STATUS (0): - A value indicating that the enum field is not - set. - LINK_OPERATIONAL_STATUS_DOWN (281653885): - The interface is unable to communicate with - the remote end. - LINK_OPERATIONAL_STATUS_UP (305879862): - The interface has low level communication - with the remote end. - """ - UNDEFINED_OPERATIONAL_STATUS = 0 - LINK_OPERATIONAL_STATUS_DOWN = 281653885 - LINK_OPERATIONAL_STATUS_UP = 305879862 - arp_caches: MutableSequence[ - "InterconnectDiagnosticsARPEntry" - ] = proto.RepeatedField( +class InterconnectGroupsListResponse(proto.Message): + r""" + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + etag (str): + + This field is a member of `oneof`_ ``_etag``. + id (str): + [Output Only] Unique identifier for the resource; defined by + the server. + + This field is a member of `oneof`_ ``_id``. + items (MutableSequence[google.cloud.compute_v1.types.InterconnectGroup]): + A list of InterconnectGroup resources. + kind (str): + + This field is a member of `oneof`_ ``_kind``. + next_page_token (str): + [Output Only] This token allows you to get the next page of + results for list requests. If the number of results is + larger than maxResults, use the nextPageToken as a value for + the query parameter pageToken in the next list request. + Subsequent list requests will have their own nextPageToken + to continue paging through the results. + + This field is a member of `oneof`_ ``_next_page_token``. + self_link (str): + [Output Only] Server-defined URL for this resource. + + This field is a member of `oneof`_ ``_self_link``. + unreachables (MutableSequence[str]): + [Output Only] Unreachable resources. end_interface: + MixerListResponseWithEtagBuilder + warning (google.cloud.compute_v1.types.Warning): + [Output Only] Informational warning message. + + This field is a member of `oneof`_ ``_warning``. + """ + + @property + def raw_page(self): + return self + + etag: str = proto.Field( + proto.STRING, + number=3123477, + optional=True, + ) + id: str = proto.Field( + proto.STRING, + number=3355, + optional=True, + ) + items: MutableSequence["InterconnectGroup"] = proto.RepeatedField( proto.MESSAGE, - number=414591761, - message="InterconnectDiagnosticsARPEntry", + number=100526016, + message="InterconnectGroup", ) - circuit_id: str = proto.Field( + kind: str = proto.Field( proto.STRING, - number=225180977, + number=3292052, optional=True, ) - google_demarc: str = proto.Field( + next_page_token: str = proto.Field( proto.STRING, - number=51084, + number=79797525, optional=True, ) - lacp_status: "InterconnectDiagnosticsLinkLACPStatus" = proto.Field( + self_link: str = proto.Field( + proto.STRING, + number=456214797, + optional=True, + ) + unreachables: MutableSequence[str] = proto.RepeatedField( + proto.STRING, + number=243372063, + ) + warning: "Warning" = proto.Field( proto.MESSAGE, - number=361210415, + number=50704284, optional=True, - message="InterconnectDiagnosticsLinkLACPStatus", + message="Warning", ) - macsec: "InterconnectDiagnosticsMacsecStatus" = proto.Field( + + +class InterconnectGroupsOperationalStatus(proto.Message): + r"""Request to get the status of the interconnect group with + extra detail. + + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + configured (google.cloud.compute_v1.types.InterconnectGroupConfigured): + The configuration analysis, as returned by + Get. + + This field is a member of `oneof`_ ``_configured``. + group_status (str): + Summarizes the status of the group. + Check the GroupStatus enum for the list of + possible values. + + This field is a member of `oneof`_ ``_group_status``. + intent (google.cloud.compute_v1.types.InterconnectGroupIntent): + The intent of the resource, as returned by + Get. + + This field is a member of `oneof`_ ``_intent``. + interconnect_statuses (MutableSequence[google.cloud.compute_v1.types.InterconnectGroupsOperationalStatusInterconnectStatus]): + + operational (google.cloud.compute_v1.types.InterconnectGroupConfigured): + The operational state of the group, including + only active Interconnects. + + This field is a member of `oneof`_ ``_operational``. + """ + + class GroupStatus(proto.Enum): + r"""Summarizes the status of the group. + + Values: + UNDEFINED_GROUP_STATUS (0): + A value indicating that the enum field is not + set. + DEGRADED (396890926): + No description available. + FULLY_DOWN (255514647): + No description available. + FULLY_UP (504176464): + No description available. + GROUPS_STATUS_UNSPECIFIED (261932693): + No description available. + """ + UNDEFINED_GROUP_STATUS = 0 + DEGRADED = 396890926 + FULLY_DOWN = 255514647 + FULLY_UP = 504176464 + GROUPS_STATUS_UNSPECIFIED = 261932693 + + configured: "InterconnectGroupConfigured" = proto.Field( proto.MESSAGE, - number=528867490, + number=295631422, optional=True, - message="InterconnectDiagnosticsMacsecStatus", + message="InterconnectGroupConfigured", ) - operational_status: str = proto.Field( + group_status: str = proto.Field( proto.STRING, - number=201070847, + number=338778546, optional=True, ) - receiving_optical_power: "InterconnectDiagnosticsLinkOpticalPower" = proto.Field( + intent: "InterconnectGroupIntent" = proto.Field( proto.MESSAGE, - number=244717279, + number=426849948, optional=True, - message="InterconnectDiagnosticsLinkOpticalPower", + message="InterconnectGroupIntent", ) - transmitting_optical_power: "InterconnectDiagnosticsLinkOpticalPower" = proto.Field( + interconnect_statuses: MutableSequence[ + "InterconnectGroupsOperationalStatusInterconnectStatus" + ] = proto.RepeatedField( proto.MESSAGE, - number=459431197, + number=446756017, + message="InterconnectGroupsOperationalStatusInterconnectStatus", + ) + operational: "InterconnectGroupConfigured" = proto.Field( + proto.MESSAGE, + number=129704914, optional=True, - message="InterconnectDiagnosticsLinkOpticalPower", + message="InterconnectGroupConfigured", ) -class InterconnectDiagnosticsMacsecStatus(proto.Message): - r"""Describes the status of MACsec encryption on the link. +class InterconnectGroupsOperationalStatusInterconnectStatus(proto.Message): + r"""The status of one Interconnect in the group. The order is + arbitrary. + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields Attributes: - ckn (str): - Indicates the Connectivity Association Key - Name (CKN) currently being used if MACsec is - operational. + admin_enabled (bool): + Whether the Interconnect is enabled. - This field is a member of `oneof`_ ``_ckn``. - operational (bool): - Indicates whether or not MACsec is - operational on this link. + This field is a member of `oneof`_ ``_admin_enabled``. + diagnostics (google.cloud.compute_v1.types.InterconnectDiagnostics): + The diagnostics of the Interconnect, as + returned by the existing get-diagnostics method. - This field is a member of `oneof`_ ``_operational``. + This field is a member of `oneof`_ ``_diagnostics``. + interconnect (str): + The URL of the Interconnect being described. + + This field is a member of `oneof`_ ``_interconnect``. + is_active (str): + Whether this interconnect is participating in + the redundant configuration. Check the IsActive + enum for the list of possible values. + + This field is a member of `oneof`_ ``_is_active``. """ - ckn: str = proto.Field( + class IsActive(proto.Enum): + r"""Whether this interconnect is participating in the redundant + configuration. + + Values: + UNDEFINED_IS_ACTIVE (0): + A value indicating that the enum field is not + set. + ACTIVE (314733318): + No description available. + INACTIVE (270421099): + No description available. + IS_ACTIVE_UNSPECIFIED (274948243): + No description available. + """ + UNDEFINED_IS_ACTIVE = 0 + ACTIVE = 314733318 + INACTIVE = 270421099 + IS_ACTIVE_UNSPECIFIED = 274948243 + + admin_enabled: bool = proto.Field( + proto.BOOL, + number=445675089, + optional=True, + ) + diagnostics: "InterconnectDiagnostics" = proto.Field( + proto.MESSAGE, + number=333355436, + optional=True, + message="InterconnectDiagnostics", + ) + interconnect: str = proto.Field( proto.STRING, - number=98566, + number=224601230, optional=True, ) - operational: bool = proto.Field( - proto.BOOL, - number=129704914, + is_active: str = proto.Field( + proto.STRING, + number=114830267, optional=True, ) @@ -53122,6 +55997,15 @@ class License(proto.Message): .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields Attributes: + allowed_replacement_licenses (MutableSequence[str]): + Specifies licenseCodes of licenses that can replace this + license. Note: such replacements are allowed even if + removable_from_disk is false. + appendable_to_disk (bool): + If true, this license can be appended to an + existing disk's set of licenses. + + This field is a member of `oneof`_ ``_appendable_to_disk``. charges_use_fee (bool): [Output Only] Deprecated. This field no longer reflects whether a license charges a usage fee. @@ -53142,6 +56026,11 @@ class License(proto.Message): identifier is defined by the server. This field is a member of `oneof`_ ``_id``. + incompatible_licenses (MutableSequence[str]): + Specifies licenseCodes of licenses that are + incompatible with this license. If a license is + incompatible with this license, it cannot be + attached to the same disk or image. kind (str): [Output Only] Type of resource. Always compute#license for licenses. @@ -53152,11 +56041,40 @@ class License(proto.Message): images, snapshots, and disks. This field is a member of `oneof`_ ``_license_code``. + minimum_retention (google.cloud.compute_v1.types.Duration): + If set, this license will be unable to be removed or + replaced once attached to a disk until the minimum_retention + period has passed. + + This field is a member of `oneof`_ ``_minimum_retention``. + multi_tenant_only (bool): + If true, this license can only be used on VMs + on multi tenant nodes. + + This field is a member of `oneof`_ ``_multi_tenant_only``. name (str): Name of the resource. The name must be 1-63 characters long and comply with RFC1035. This field is a member of `oneof`_ ``_name``. + os_license (bool): + If true, indicates this is an OS license. + Only one OS license can be attached to a disk or + image at a time. + + This field is a member of `oneof`_ ``_os_license``. + removable_from_disk (bool): + If true, this license can be removed from a + disk's set of licenses, with no replacement + license needed. + + This field is a member of `oneof`_ ``_removable_from_disk``. + required_coattached_licenses (MutableSequence[str]): + Specifies the set of permissible coattached + licenseCodes of licenses that satisfy the + coattachment requirement of this license. At + least one license from the set must be attached + to the same disk or image as this license. resource_requirements (google.cloud.compute_v1.types.LicenseResourceRequirements): [Input Only] Deprecated. @@ -53165,6 +56083,16 @@ class License(proto.Message): [Output Only] Server-defined URL for the resource. This field is a member of `oneof`_ ``_self_link``. + self_link_with_id (str): + [Output Only] Server-defined URL for this resource with the + resource id. + + This field is a member of `oneof`_ ``_self_link_with_id``. + sole_tenant_only (bool): + If true, this license can only be used on VMs + on sole tenant nodes. + + This field is a member of `oneof`_ ``_sole_tenant_only``. transferable (bool): If false, licenses will not be copied from the source resource when creating an image from @@ -53172,8 +56100,21 @@ class License(proto.Message): disk. This field is a member of `oneof`_ ``_transferable``. + update_timestamp (str): + [Output Only] Last update timestamp in RFC3339 text format. + + This field is a member of `oneof`_ ``_update_timestamp``. """ + allowed_replacement_licenses: MutableSequence[str] = proto.RepeatedField( + proto.STRING, + number=195677718, + ) + appendable_to_disk: bool = proto.Field( + proto.BOOL, + number=16959254, + optional=True, + ) charges_use_fee: bool = proto.Field( proto.BOOL, number=372412622, @@ -53194,6 +56135,10 @@ class License(proto.Message): number=3355, optional=True, ) + incompatible_licenses: MutableSequence[str] = proto.RepeatedField( + proto.STRING, + number=334239768, + ) kind: str = proto.Field( proto.STRING, number=3292052, @@ -53204,11 +56149,36 @@ class License(proto.Message): number=1467179, optional=True, ) + minimum_retention: "Duration" = proto.Field( + proto.MESSAGE, + number=155398189, + optional=True, + message="Duration", + ) + multi_tenant_only: bool = proto.Field( + proto.BOOL, + number=274395163, + optional=True, + ) name: str = proto.Field( proto.STRING, number=3373707, optional=True, ) + os_license: bool = proto.Field( + proto.BOOL, + number=487986406, + optional=True, + ) + removable_from_disk: bool = proto.Field( + proto.BOOL, + number=25854638, + optional=True, + ) + required_coattached_licenses: MutableSequence[str] = proto.RepeatedField( + proto.STRING, + number=129195265, + ) resource_requirements: "LicenseResourceRequirements" = proto.Field( proto.MESSAGE, number=214292769, @@ -53220,11 +56190,26 @@ class License(proto.Message): number=456214797, optional=True, ) + self_link_with_id: str = proto.Field( + proto.STRING, + number=44520962, + optional=True, + ) + sole_tenant_only: bool = proto.Field( + proto.BOOL, + number=427525559, + optional=True, + ) transferable: bool = proto.Field( proto.BOOL, number=4349893, optional=True, ) + update_timestamp: str = proto.Field( + proto.STRING, + number=120894752, + optional=True, + ) class LicenseCode(proto.Message): @@ -55295,11 +58280,274 @@ class ListErrorsRegionInstanceGroupManagersRequest(proto.Message): the next page of results. This field is a member of `oneof`_ ``_page_token``. - project (str): - Project ID for this request. - region (str): - Name of the region scoping this request. This - should conform to RFC1035. + project (str): + Project ID for this request. + region (str): + Name of the region scoping this request. This + should conform to RFC1035. + return_partial_success (bool): + Opt-in for partial success behavior which + provides partial results in case of failure. The + default value is false. For example, when + partial success behavior is enabled, + aggregatedList for a single zone scope either + returns all resources in the zone or no + resources, with an error code. + + This field is a member of `oneof`_ ``_return_partial_success``. + """ + + filter: str = proto.Field( + proto.STRING, + number=336120696, + optional=True, + ) + instance_group_manager: str = proto.Field( + proto.STRING, + number=249363395, + ) + max_results: int = proto.Field( + proto.UINT32, + number=54715419, + optional=True, + ) + order_by: str = proto.Field( + proto.STRING, + number=160562920, + optional=True, + ) + page_token: str = proto.Field( + proto.STRING, + number=19994697, + optional=True, + ) + project: str = proto.Field( + proto.STRING, + number=227560217, + ) + region: str = proto.Field( + proto.STRING, + number=138946292, + ) + return_partial_success: bool = proto.Field( + proto.BOOL, + number=517198390, + optional=True, + ) + + +class ListExternalVpnGatewaysRequest(proto.Message): + r"""A request message for ExternalVpnGateways.List. See the + method description for details. + + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + filter (str): + A filter expression that filters resources listed in the + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. These two types of filter expressions cannot be + mixed in one request. If you want to use AIP-160, your + expression must specify the field name, an operator, and the + value that you want to use for filtering. The value must be + a string, a number, or a boolean. The operator must be + either ``=``, ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. + For example, if you are filtering Compute Engine instances, + you can exclude instances named ``example-instance`` by + specifying ``name != example-instance``. The ``:*`` + comparison can be used to test whether a key has been + defined. For example, to find all objects with ``owner`` + label use: ``labels.owner:*`` You can also filter nested + fields. For example, you could specify + ``scheduling.automaticRestart = false`` to include instances + only if they are not scheduled for automatic restarts. You + can use filtering on nested fields to filter based on + resource labels. To filter on multiple expressions, provide + each separate expression within parentheses. For example: + ``(scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")`` + By default, each expression is an ``AND`` expression. + However, you can include ``AND`` and ``OR`` expressions + explicitly. For example: + ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. You cannot combine constraints on + multiple fields using regular expressions. + + This field is a member of `oneof`_ ``_filter``. + max_results (int): + The maximum number of results per page that should be + returned. If the number of available results is larger than + ``maxResults``, Compute Engine returns a ``nextPageToken`` + that can be used to get the next page of results in + subsequent list requests. Acceptable values are ``0`` to + ``500``, inclusive. (Default: ``500``) + + This field is a member of `oneof`_ ``_max_results``. + order_by (str): + Sorts list results by a certain order. By default, results + are returned in alphanumerical order based on the resource + name. You can also sort results in descending order based on + the creation timestamp using + ``orderBy="creationTimestamp desc"``. This sorts results + based on the ``creationTimestamp`` field in reverse + chronological order (newest result first). Use this to sort + resources like operations so that the newest operation is + returned first. Currently, only sorting by ``name`` or + ``creationTimestamp desc`` is supported. + + This field is a member of `oneof`_ ``_order_by``. + page_token (str): + Specifies a page token to use. Set ``pageToken`` to the + ``nextPageToken`` returned by a previous list request to get + the next page of results. + + This field is a member of `oneof`_ ``_page_token``. + project (str): + Project ID for this request. + return_partial_success (bool): + Opt-in for partial success behavior which + provides partial results in case of failure. The + default value is false. For example, when + partial success behavior is enabled, + aggregatedList for a single zone scope either + returns all resources in the zone or no + resources, with an error code. + + This field is a member of `oneof`_ ``_return_partial_success``. + """ + + filter: str = proto.Field( + proto.STRING, + number=336120696, + optional=True, + ) + max_results: int = proto.Field( + proto.UINT32, + number=54715419, + optional=True, + ) + order_by: str = proto.Field( + proto.STRING, + number=160562920, + optional=True, + ) + page_token: str = proto.Field( + proto.STRING, + number=19994697, + optional=True, + ) + project: str = proto.Field( + proto.STRING, + number=227560217, + ) + return_partial_success: bool = proto.Field( + proto.BOOL, + number=517198390, + optional=True, + ) + + +class ListFirewallPoliciesRequest(proto.Message): + r"""A request message for FirewallPolicies.List. See the method + description for details. + + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + filter (str): + A filter expression that filters resources listed in the + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. These two types of filter expressions cannot be + mixed in one request. If you want to use AIP-160, your + expression must specify the field name, an operator, and the + value that you want to use for filtering. The value must be + a string, a number, or a boolean. The operator must be + either ``=``, ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. + For example, if you are filtering Compute Engine instances, + you can exclude instances named ``example-instance`` by + specifying ``name != example-instance``. The ``:*`` + comparison can be used to test whether a key has been + defined. For example, to find all objects with ``owner`` + label use: ``labels.owner:*`` You can also filter nested + fields. For example, you could specify + ``scheduling.automaticRestart = false`` to include instances + only if they are not scheduled for automatic restarts. You + can use filtering on nested fields to filter based on + resource labels. To filter on multiple expressions, provide + each separate expression within parentheses. For example: + ``(scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")`` + By default, each expression is an ``AND`` expression. + However, you can include ``AND`` and ``OR`` expressions + explicitly. For example: + ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. You cannot combine constraints on + multiple fields using regular expressions. + + This field is a member of `oneof`_ ``_filter``. + max_results (int): + The maximum number of results per page that should be + returned. If the number of available results is larger than + ``maxResults``, Compute Engine returns a ``nextPageToken`` + that can be used to get the next page of results in + subsequent list requests. Acceptable values are ``0`` to + ``500``, inclusive. (Default: ``500``) + + This field is a member of `oneof`_ ``_max_results``. + order_by (str): + Sorts list results by a certain order. By default, results + are returned in alphanumerical order based on the resource + name. You can also sort results in descending order based on + the creation timestamp using + ``orderBy="creationTimestamp desc"``. This sorts results + based on the ``creationTimestamp`` field in reverse + chronological order (newest result first). Use this to sort + resources like operations so that the newest operation is + returned first. Currently, only sorting by ``name`` or + ``creationTimestamp desc`` is supported. + + This field is a member of `oneof`_ ``_order_by``. + page_token (str): + Specifies a page token to use. Set ``pageToken`` to the + ``nextPageToken`` returned by a previous list request to get + the next page of results. + + This field is a member of `oneof`_ ``_page_token``. + parent_id (str): + Parent ID for this request. The ID can be either be + "folders/[FOLDER_ID]" if the parent is a folder or + "organizations/[ORGANIZATION_ID]" if the parent is an + organization. + + This field is a member of `oneof`_ ``_parent_id``. return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The @@ -55317,10 +58565,6 @@ class ListErrorsRegionInstanceGroupManagersRequest(proto.Message): number=336120696, optional=True, ) - instance_group_manager: str = proto.Field( - proto.STRING, - number=249363395, - ) max_results: int = proto.Field( proto.UINT32, number=54715419, @@ -55336,13 +58580,10 @@ class ListErrorsRegionInstanceGroupManagersRequest(proto.Message): number=19994697, optional=True, ) - project: str = proto.Field( - proto.STRING, - number=227560217, - ) - region: str = proto.Field( + parent_id: str = proto.Field( proto.STRING, - number=138946292, + number=459714768, + optional=True, ) return_partial_success: bool = proto.Field( proto.BOOL, @@ -55351,9 +58592,9 @@ class ListErrorsRegionInstanceGroupManagersRequest(proto.Message): ) -class ListExternalVpnGatewaysRequest(proto.Message): - r"""A request message for ExternalVpnGateways.List. See the - method description for details. +class ListFirewallsRequest(proto.Message): + r"""A request message for Firewalls.List. See the method + description for details. .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields @@ -55476,139 +58717,8 @@ class ListExternalVpnGatewaysRequest(proto.Message): ) -class ListFirewallPoliciesRequest(proto.Message): - r"""A request message for FirewallPolicies.List. See the method - description for details. - - - .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields - - Attributes: - filter (str): - A filter expression that filters resources listed in the - response. Most Compute resources support two types of filter - expressions: expressions that support regular expressions - and expressions that follow API improvement proposal - AIP-160. These two types of filter expressions cannot be - mixed in one request. If you want to use AIP-160, your - expression must specify the field name, an operator, and the - value that you want to use for filtering. The value must be - a string, a number, or a boolean. The operator must be - either ``=``, ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. - For example, if you are filtering Compute Engine instances, - you can exclude instances named ``example-instance`` by - specifying ``name != example-instance``. The ``:*`` - comparison can be used to test whether a key has been - defined. For example, to find all objects with ``owner`` - label use: ``labels.owner:*`` You can also filter nested - fields. For example, you could specify - ``scheduling.automaticRestart = false`` to include instances - only if they are not scheduled for automatic restarts. You - can use filtering on nested fields to filter based on - resource labels. To filter on multiple expressions, provide - each separate expression within parentheses. For example: - ``(scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")`` - By default, each expression is an ``AND`` expression. - However, you can include ``AND`` and ``OR`` expressions - explicitly. For example: - ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` - If you want to use a regular expression, use the ``eq`` - (equal) or ``ne`` (not equal) operator against a single - un-parenthesized expression with or without quotes or - against multiple parenthesized expressions. Examples: - ``fieldname eq unquoted literal`` - ``fieldname eq 'single quoted literal'`` - ``fieldname eq "double quoted literal"`` - ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The - literal value is interpreted as a regular expression using - Google RE2 library syntax. The literal value must match the - entire field. For example, to filter for instances that do - not end with name "instance", you would use - ``name ne .*instance``. You cannot combine constraints on - multiple fields using regular expressions. - - This field is a member of `oneof`_ ``_filter``. - max_results (int): - The maximum number of results per page that should be - returned. If the number of available results is larger than - ``maxResults``, Compute Engine returns a ``nextPageToken`` - that can be used to get the next page of results in - subsequent list requests. Acceptable values are ``0`` to - ``500``, inclusive. (Default: ``500``) - - This field is a member of `oneof`_ ``_max_results``. - order_by (str): - Sorts list results by a certain order. By default, results - are returned in alphanumerical order based on the resource - name. You can also sort results in descending order based on - the creation timestamp using - ``orderBy="creationTimestamp desc"``. This sorts results - based on the ``creationTimestamp`` field in reverse - chronological order (newest result first). Use this to sort - resources like operations so that the newest operation is - returned first. Currently, only sorting by ``name`` or - ``creationTimestamp desc`` is supported. - - This field is a member of `oneof`_ ``_order_by``. - page_token (str): - Specifies a page token to use. Set ``pageToken`` to the - ``nextPageToken`` returned by a previous list request to get - the next page of results. - - This field is a member of `oneof`_ ``_page_token``. - parent_id (str): - Parent ID for this request. The ID can be either be - "folders/[FOLDER_ID]" if the parent is a folder or - "organizations/[ORGANIZATION_ID]" if the parent is an - organization. - - This field is a member of `oneof`_ ``_parent_id``. - return_partial_success (bool): - Opt-in for partial success behavior which - provides partial results in case of failure. The - default value is false. For example, when - partial success behavior is enabled, - aggregatedList for a single zone scope either - returns all resources in the zone or no - resources, with an error code. - - This field is a member of `oneof`_ ``_return_partial_success``. - """ - - filter: str = proto.Field( - proto.STRING, - number=336120696, - optional=True, - ) - max_results: int = proto.Field( - proto.UINT32, - number=54715419, - optional=True, - ) - order_by: str = proto.Field( - proto.STRING, - number=160562920, - optional=True, - ) - page_token: str = proto.Field( - proto.STRING, - number=19994697, - optional=True, - ) - parent_id: str = proto.Field( - proto.STRING, - number=459714768, - optional=True, - ) - return_partial_success: bool = proto.Field( - proto.BOOL, - number=517198390, - optional=True, - ) - - -class ListFirewallsRequest(proto.Message): - r"""A request message for Firewalls.List. See the method +class ListForwardingRulesRequest(proto.Message): + r"""A request message for ForwardingRules.List. See the method description for details. @@ -55689,6 +58799,8 @@ class ListFirewallsRequest(proto.Message): This field is a member of `oneof`_ ``_page_token``. project (str): Project ID for this request. + region (str): + Name of the region scoping this request. return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The @@ -55725,6 +58837,10 @@ class ListFirewallsRequest(proto.Message): proto.STRING, number=227560217, ) + region: str = proto.Field( + proto.STRING, + number=138946292, + ) return_partial_success: bool = proto.Field( proto.BOOL, number=517198390, @@ -55732,8 +58848,8 @@ class ListFirewallsRequest(proto.Message): ) -class ListForwardingRulesRequest(proto.Message): - r"""A request message for ForwardingRules.List. See the method +class ListGlobalAddressesRequest(proto.Message): + r"""A request message for GlobalAddresses.List. See the method description for details. @@ -55814,8 +58930,6 @@ class ListForwardingRulesRequest(proto.Message): This field is a member of `oneof`_ ``_page_token``. project (str): Project ID for this request. - region (str): - Name of the region scoping this request. return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The @@ -55852,10 +58966,6 @@ class ListForwardingRulesRequest(proto.Message): proto.STRING, number=227560217, ) - region: str = proto.Field( - proto.STRING, - number=138946292, - ) return_partial_success: bool = proto.Field( proto.BOOL, number=517198390, @@ -55863,9 +58973,9 @@ class ListForwardingRulesRequest(proto.Message): ) -class ListGlobalAddressesRequest(proto.Message): - r"""A request message for GlobalAddresses.List. See the method - description for details. +class ListGlobalForwardingRulesRequest(proto.Message): + r"""A request message for GlobalForwardingRules.List. See the + method description for details. .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields @@ -55988,9 +59098,9 @@ class ListGlobalAddressesRequest(proto.Message): ) -class ListGlobalForwardingRulesRequest(proto.Message): - r"""A request message for GlobalForwardingRules.List. See the - method description for details. +class ListGlobalNetworkEndpointGroupsRequest(proto.Message): + r"""A request message for GlobalNetworkEndpointGroups.List. See + the method description for details. .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields @@ -56113,9 +59223,9 @@ class ListGlobalForwardingRulesRequest(proto.Message): ) -class ListGlobalNetworkEndpointGroupsRequest(proto.Message): - r"""A request message for GlobalNetworkEndpointGroups.List. See - the method description for details. +class ListGlobalOperationsRequest(proto.Message): + r"""A request message for GlobalOperations.List. See the method + description for details. .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields @@ -56238,9 +59348,9 @@ class ListGlobalNetworkEndpointGroupsRequest(proto.Message): ) -class ListGlobalOperationsRequest(proto.Message): - r"""A request message for GlobalOperations.List. See the method - description for details. +class ListGlobalOrganizationOperationsRequest(proto.Message): + r"""A request message for GlobalOrganizationOperations.List. See + the method description for details. .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields @@ -56318,8 +59428,10 @@ class ListGlobalOperationsRequest(proto.Message): the next page of results. This field is a member of `oneof`_ ``_page_token``. - project (str): - Project ID for this request. + parent_id (str): + Parent ID for this request. + + This field is a member of `oneof`_ ``_parent_id``. return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The @@ -56352,9 +59464,10 @@ class ListGlobalOperationsRequest(proto.Message): number=19994697, optional=True, ) - project: str = proto.Field( + parent_id: str = proto.Field( proto.STRING, - number=227560217, + number=459714768, + optional=True, ) return_partial_success: bool = proto.Field( proto.BOOL, @@ -56363,8 +59476,8 @@ class ListGlobalOperationsRequest(proto.Message): ) -class ListGlobalOrganizationOperationsRequest(proto.Message): - r"""A request message for GlobalOrganizationOperations.List. See +class ListGlobalPublicDelegatedPrefixesRequest(proto.Message): + r"""A request message for GlobalPublicDelegatedPrefixes.List. See the method description for details. @@ -56443,10 +59556,8 @@ class ListGlobalOrganizationOperationsRequest(proto.Message): the next page of results. This field is a member of `oneof`_ ``_page_token``. - parent_id (str): - Parent ID for this request. - - This field is a member of `oneof`_ ``_parent_id``. + project (str): + Project ID for this request. return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The @@ -56479,10 +59590,9 @@ class ListGlobalOrganizationOperationsRequest(proto.Message): number=19994697, optional=True, ) - parent_id: str = proto.Field( + project: str = proto.Field( proto.STRING, - number=459714768, - optional=True, + number=227560217, ) return_partial_success: bool = proto.Field( proto.BOOL, @@ -56491,9 +59601,9 @@ class ListGlobalOrganizationOperationsRequest(proto.Message): ) -class ListGlobalPublicDelegatedPrefixesRequest(proto.Message): - r"""A request message for GlobalPublicDelegatedPrefixes.List. See - the method description for details. +class ListHealthChecksRequest(proto.Message): + r"""A request message for HealthChecks.List. See the method + description for details. .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields @@ -56616,9 +59726,9 @@ class ListGlobalPublicDelegatedPrefixesRequest(proto.Message): ) -class ListHealthChecksRequest(proto.Message): - r"""A request message for HealthChecks.List. See the method - description for details. +class ListImagesRequest(proto.Message): + r"""A request message for Images.List. See the method description + for details. .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields @@ -56741,9 +59851,10 @@ class ListHealthChecksRequest(proto.Message): ) -class ListImagesRequest(proto.Message): - r"""A request message for Images.List. See the method description - for details. +class ListInstanceGroupManagerResizeRequestsRequest(proto.Message): + r"""A request message for + InstanceGroupManagerResizeRequests.List. See the method + description for details. .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields @@ -56793,6 +59904,9 @@ class ListImagesRequest(proto.Message): multiple fields using regular expressions. This field is a member of `oneof`_ ``_filter``. + instance_group_manager (str): + The name of the managed instance group. The + name should conform to RFC1035. max_results (int): The maximum number of results per page that should be returned. If the number of available results is larger than @@ -56833,6 +59947,10 @@ class ListImagesRequest(proto.Message): resources, with an error code. This field is a member of `oneof`_ ``_return_partial_success``. + zone (str): + The name of the zone where the managed + instance group is located. The name should + conform to RFC1035. """ filter: str = proto.Field( @@ -56840,6 +59958,10 @@ class ListImagesRequest(proto.Message): number=336120696, optional=True, ) + instance_group_manager: str = proto.Field( + proto.STRING, + number=249363395, + ) max_results: int = proto.Field( proto.UINT32, number=54715419, @@ -56864,12 +59986,15 @@ class ListImagesRequest(proto.Message): number=517198390, optional=True, ) + zone: str = proto.Field( + proto.STRING, + number=3744684, + ) -class ListInstanceGroupManagerResizeRequestsRequest(proto.Message): - r"""A request message for - InstanceGroupManagerResizeRequests.List. See the method - description for details. +class ListInstanceGroupManagersRequest(proto.Message): + r"""A request message for InstanceGroupManagers.List. See the + method description for details. .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields @@ -56919,9 +60044,6 @@ class ListInstanceGroupManagerResizeRequestsRequest(proto.Message): multiple fields using regular expressions. This field is a member of `oneof`_ ``_filter``. - instance_group_manager (str): - The name of the managed instance group. The - name should conform to RFC1035. max_results (int): The maximum number of results per page that should be returned. If the number of available results is larger than @@ -56964,8 +60086,7 @@ class ListInstanceGroupManagerResizeRequestsRequest(proto.Message): This field is a member of `oneof`_ ``_return_partial_success``. zone (str): The name of the zone where the managed - instance group is located. The name should - conform to RFC1035. + instance group is located. """ filter: str = proto.Field( @@ -56973,10 +60094,6 @@ class ListInstanceGroupManagerResizeRequestsRequest(proto.Message): number=336120696, optional=True, ) - instance_group_manager: str = proto.Field( - proto.STRING, - number=249363395, - ) max_results: int = proto.Field( proto.UINT32, number=54715419, @@ -57007,9 +60124,9 @@ class ListInstanceGroupManagerResizeRequestsRequest(proto.Message): ) -class ListInstanceGroupManagersRequest(proto.Message): - r"""A request message for InstanceGroupManagers.List. See the - method description for details. +class ListInstanceGroupsRequest(proto.Message): + r"""A request message for InstanceGroups.List. See the method + description for details. .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields @@ -57100,8 +60217,8 @@ class ListInstanceGroupManagersRequest(proto.Message): This field is a member of `oneof`_ ``_return_partial_success``. zone (str): - The name of the zone where the managed - instance group is located. + The name of the zone where the instance group + is located. """ filter: str = proto.Field( @@ -57139,8 +60256,8 @@ class ListInstanceGroupManagersRequest(proto.Message): ) -class ListInstanceGroupsRequest(proto.Message): - r"""A request message for InstanceGroups.List. See the method +class ListInstanceTemplatesRequest(proto.Message): + r"""A request message for InstanceTemplates.List. See the method description for details. @@ -57231,9 +60348,6 @@ class ListInstanceGroupsRequest(proto.Message): resources, with an error code. This field is a member of `oneof`_ ``_return_partial_success``. - zone (str): - The name of the zone where the instance group - is located. """ filter: str = proto.Field( @@ -57265,15 +60379,11 @@ class ListInstanceGroupsRequest(proto.Message): number=517198390, optional=True, ) - zone: str = proto.Field( - proto.STRING, - number=3744684, - ) -class ListInstanceTemplatesRequest(proto.Message): - r"""A request message for InstanceTemplates.List. See the method - description for details. +class ListInstancesInstanceGroupsRequest(proto.Message): + r"""A request message for InstanceGroups.ListInstances. See the + method description for details. .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields @@ -57323,6 +60433,11 @@ class ListInstanceTemplatesRequest(proto.Message): multiple fields using regular expressions. This field is a member of `oneof`_ ``_filter``. + instance_group (str): + The name of the instance group from which you + want to generate a list of included instances. + instance_groups_list_instances_request_resource (google.cloud.compute_v1.types.InstanceGroupsListInstancesRequest): + The body resource for this request max_results (int): The maximum number of results per page that should be returned. If the number of available results is larger than @@ -57363,6 +60478,9 @@ class ListInstanceTemplatesRequest(proto.Message): resources, with an error code. This field is a member of `oneof`_ ``_return_partial_success``. + zone (str): + The name of the zone where the instance group + is located. """ filter: str = proto.Field( @@ -57370,6 +60488,15 @@ class ListInstanceTemplatesRequest(proto.Message): number=336120696, optional=True, ) + instance_group: str = proto.Field( + proto.STRING, + number=81095253, + ) + instance_groups_list_instances_request_resource: "InstanceGroupsListInstancesRequest" = proto.Field( + proto.MESSAGE, + number=476255263, + message="InstanceGroupsListInstancesRequest", + ) max_results: int = proto.Field( proto.UINT32, number=54715419, @@ -57394,11 +60521,15 @@ class ListInstanceTemplatesRequest(proto.Message): number=517198390, optional=True, ) + zone: str = proto.Field( + proto.STRING, + number=3744684, + ) -class ListInstancesInstanceGroupsRequest(proto.Message): - r"""A request message for InstanceGroups.ListInstances. See the - method description for details. +class ListInstancesRegionInstanceGroupsRequest(proto.Message): + r"""A request message for RegionInstanceGroups.ListInstances. See + the method description for details. .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields @@ -57449,10 +60580,8 @@ class ListInstancesInstanceGroupsRequest(proto.Message): This field is a member of `oneof`_ ``_filter``. instance_group (str): - The name of the instance group from which you - want to generate a list of included instances. - instance_groups_list_instances_request_resource (google.cloud.compute_v1.types.InstanceGroupsListInstancesRequest): - The body resource for this request + Name of the regional instance group for which + we want to list the instances. max_results (int): The maximum number of results per page that should be returned. If the number of available results is larger than @@ -57483,6 +60612,10 @@ class ListInstancesInstanceGroupsRequest(proto.Message): This field is a member of `oneof`_ ``_page_token``. project (str): Project ID for this request. + region (str): + Name of the region scoping this request. + region_instance_groups_list_instances_request_resource (google.cloud.compute_v1.types.RegionInstanceGroupsListInstancesRequest): + The body resource for this request return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The @@ -57493,9 +60626,6 @@ class ListInstancesInstanceGroupsRequest(proto.Message): resources, with an error code. This field is a member of `oneof`_ ``_return_partial_success``. - zone (str): - The name of the zone where the instance group - is located. """ filter: str = proto.Field( @@ -57507,11 +60637,6 @@ class ListInstancesInstanceGroupsRequest(proto.Message): proto.STRING, number=81095253, ) - instance_groups_list_instances_request_resource: "InstanceGroupsListInstancesRequest" = proto.Field( - proto.MESSAGE, - number=476255263, - message="InstanceGroupsListInstancesRequest", - ) max_results: int = proto.Field( proto.UINT32, number=54715419, @@ -57531,20 +60656,25 @@ class ListInstancesInstanceGroupsRequest(proto.Message): proto.STRING, number=227560217, ) + region: str = proto.Field( + proto.STRING, + number=138946292, + ) + region_instance_groups_list_instances_request_resource: "RegionInstanceGroupsListInstancesRequest" = proto.Field( + proto.MESSAGE, + number=48239828, + message="RegionInstanceGroupsListInstancesRequest", + ) return_partial_success: bool = proto.Field( proto.BOOL, number=517198390, optional=True, ) - zone: str = proto.Field( - proto.STRING, - number=3744684, - ) -class ListInstancesRegionInstanceGroupsRequest(proto.Message): - r"""A request message for RegionInstanceGroups.ListInstances. See - the method description for details. +class ListInstancesRequest(proto.Message): + r"""A request message for Instances.List. See the method + description for details. .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields @@ -57594,9 +60724,6 @@ class ListInstancesRegionInstanceGroupsRequest(proto.Message): multiple fields using regular expressions. This field is a member of `oneof`_ ``_filter``. - instance_group (str): - Name of the regional instance group for which - we want to list the instances. max_results (int): The maximum number of results per page that should be returned. If the number of available results is larger than @@ -57627,10 +60754,6 @@ class ListInstancesRegionInstanceGroupsRequest(proto.Message): This field is a member of `oneof`_ ``_page_token``. project (str): Project ID for this request. - region (str): - Name of the region scoping this request. - region_instance_groups_list_instances_request_resource (google.cloud.compute_v1.types.RegionInstanceGroupsListInstancesRequest): - The body resource for this request return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The @@ -57641,6 +60764,8 @@ class ListInstancesRegionInstanceGroupsRequest(proto.Message): resources, with an error code. This field is a member of `oneof`_ ``_return_partial_success``. + zone (str): + The name of the zone for this request. """ filter: str = proto.Field( @@ -57648,10 +60773,6 @@ class ListInstancesRegionInstanceGroupsRequest(proto.Message): number=336120696, optional=True, ) - instance_group: str = proto.Field( - proto.STRING, - number=81095253, - ) max_results: int = proto.Field( proto.UINT32, number=54715419, @@ -57671,24 +60792,19 @@ class ListInstancesRegionInstanceGroupsRequest(proto.Message): proto.STRING, number=227560217, ) - region: str = proto.Field( - proto.STRING, - number=138946292, - ) - region_instance_groups_list_instances_request_resource: "RegionInstanceGroupsListInstancesRequest" = proto.Field( - proto.MESSAGE, - number=48239828, - message="RegionInstanceGroupsListInstancesRequest", - ) return_partial_success: bool = proto.Field( proto.BOOL, number=517198390, optional=True, ) + zone: str = proto.Field( + proto.STRING, + number=3744684, + ) -class ListInstancesRequest(proto.Message): - r"""A request message for Instances.List. See the method +class ListInstantSnapshotsRequest(proto.Message): + r"""A request message for InstantSnapshots.List. See the method description for details. @@ -57818,9 +60934,9 @@ class ListInstancesRequest(proto.Message): ) -class ListInstantSnapshotsRequest(proto.Message): - r"""A request message for InstantSnapshots.List. See the method - description for details. +class ListInterconnectAttachmentGroupsRequest(proto.Message): + r"""A request message for InterconnectAttachmentGroups.List. See + the method description for details. .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields @@ -57910,8 +61026,6 @@ class ListInstantSnapshotsRequest(proto.Message): resources, with an error code. This field is a member of `oneof`_ ``_return_partial_success``. - zone (str): - The name of the zone for this request. """ filter: str = proto.Field( @@ -57943,10 +61057,6 @@ class ListInstantSnapshotsRequest(proto.Message): number=517198390, optional=True, ) - zone: str = proto.Field( - proto.STRING, - number=3744684, - ) class ListInterconnectAttachmentsRequest(proto.Message): @@ -58080,6 +61190,131 @@ class ListInterconnectAttachmentsRequest(proto.Message): ) +class ListInterconnectGroupsRequest(proto.Message): + r"""A request message for InterconnectGroups.List. See the method + description for details. + + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + filter (str): + A filter expression that filters resources listed in the + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. These two types of filter expressions cannot be + mixed in one request. If you want to use AIP-160, your + expression must specify the field name, an operator, and the + value that you want to use for filtering. The value must be + a string, a number, or a boolean. The operator must be + either ``=``, ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. + For example, if you are filtering Compute Engine instances, + you can exclude instances named ``example-instance`` by + specifying ``name != example-instance``. The ``:*`` + comparison can be used to test whether a key has been + defined. For example, to find all objects with ``owner`` + label use: ``labels.owner:*`` You can also filter nested + fields. For example, you could specify + ``scheduling.automaticRestart = false`` to include instances + only if they are not scheduled for automatic restarts. You + can use filtering on nested fields to filter based on + resource labels. To filter on multiple expressions, provide + each separate expression within parentheses. For example: + ``(scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")`` + By default, each expression is an ``AND`` expression. + However, you can include ``AND`` and ``OR`` expressions + explicitly. For example: + ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. You cannot combine constraints on + multiple fields using regular expressions. + + This field is a member of `oneof`_ ``_filter``. + max_results (int): + The maximum number of results per page that should be + returned. If the number of available results is larger than + ``maxResults``, Compute Engine returns a ``nextPageToken`` + that can be used to get the next page of results in + subsequent list requests. Acceptable values are ``0`` to + ``500``, inclusive. (Default: ``500``) + + This field is a member of `oneof`_ ``_max_results``. + order_by (str): + Sorts list results by a certain order. By default, results + are returned in alphanumerical order based on the resource + name. You can also sort results in descending order based on + the creation timestamp using + ``orderBy="creationTimestamp desc"``. This sorts results + based on the ``creationTimestamp`` field in reverse + chronological order (newest result first). Use this to sort + resources like operations so that the newest operation is + returned first. Currently, only sorting by ``name`` or + ``creationTimestamp desc`` is supported. + + This field is a member of `oneof`_ ``_order_by``. + page_token (str): + Specifies a page token to use. Set ``pageToken`` to the + ``nextPageToken`` returned by a previous list request to get + the next page of results. + + This field is a member of `oneof`_ ``_page_token``. + project (str): + Project ID for this request. + return_partial_success (bool): + Opt-in for partial success behavior which + provides partial results in case of failure. The + default value is false. For example, when + partial success behavior is enabled, + aggregatedList for a single zone scope either + returns all resources in the zone or no + resources, with an error code. + + This field is a member of `oneof`_ ``_return_partial_success``. + """ + + filter: str = proto.Field( + proto.STRING, + number=336120696, + optional=True, + ) + max_results: int = proto.Field( + proto.UINT32, + number=54715419, + optional=True, + ) + order_by: str = proto.Field( + proto.STRING, + number=160562920, + optional=True, + ) + page_token: str = proto.Field( + proto.STRING, + number=19994697, + optional=True, + ) + project: str = proto.Field( + proto.STRING, + number=227560217, + ) + return_partial_success: bool = proto.Field( + proto.BOOL, + number=517198390, + optional=True, + ) + + class ListInterconnectLocationsRequest(proto.Message): r"""A request message for InterconnectLocations.List. See the method description for details. @@ -65102,6 +68337,146 @@ class ListReservationBlocksRequest(proto.Message): ) +class ListReservationSubBlocksRequest(proto.Message): + r"""A request message for ReservationSubBlocks.List. See the + method description for details. + + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + filter (str): + A filter expression that filters resources listed in the + response. Most Compute resources support two types of filter + expressions: expressions that support regular expressions + and expressions that follow API improvement proposal + AIP-160. These two types of filter expressions cannot be + mixed in one request. If you want to use AIP-160, your + expression must specify the field name, an operator, and the + value that you want to use for filtering. The value must be + a string, a number, or a boolean. The operator must be + either ``=``, ``!=``, ``>``, ``<``, ``<=``, ``>=`` or ``:``. + For example, if you are filtering Compute Engine instances, + you can exclude instances named ``example-instance`` by + specifying ``name != example-instance``. The ``:*`` + comparison can be used to test whether a key has been + defined. For example, to find all objects with ``owner`` + label use: ``labels.owner:*`` You can also filter nested + fields. For example, you could specify + ``scheduling.automaticRestart = false`` to include instances + only if they are not scheduled for automatic restarts. You + can use filtering on nested fields to filter based on + resource labels. To filter on multiple expressions, provide + each separate expression within parentheses. For example: + ``(scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")`` + By default, each expression is an ``AND`` expression. + However, you can include ``AND`` and ``OR`` expressions + explicitly. For example: + ``(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)`` + If you want to use a regular expression, use the ``eq`` + (equal) or ``ne`` (not equal) operator against a single + un-parenthesized expression with or without quotes or + against multiple parenthesized expressions. Examples: + ``fieldname eq unquoted literal`` + ``fieldname eq 'single quoted literal'`` + ``fieldname eq "double quoted literal"`` + ``(fieldname1 eq literal) (fieldname2 ne "literal")`` The + literal value is interpreted as a regular expression using + Google RE2 library syntax. The literal value must match the + entire field. For example, to filter for instances that do + not end with name "instance", you would use + ``name ne .*instance``. You cannot combine constraints on + multiple fields using regular expressions. + + This field is a member of `oneof`_ ``_filter``. + max_results (int): + The maximum number of results per page that should be + returned. If the number of available results is larger than + ``maxResults``, Compute Engine returns a ``nextPageToken`` + that can be used to get the next page of results in + subsequent list requests. Acceptable values are ``0`` to + ``500``, inclusive. (Default: ``500``) + + This field is a member of `oneof`_ ``_max_results``. + order_by (str): + Sorts list results by a certain order. By default, results + are returned in alphanumerical order based on the resource + name. You can also sort results in descending order based on + the creation timestamp using + ``orderBy="creationTimestamp desc"``. This sorts results + based on the ``creationTimestamp`` field in reverse + chronological order (newest result first). Use this to sort + resources like operations so that the newest operation is + returned first. Currently, only sorting by ``name`` or + ``creationTimestamp desc`` is supported. + + This field is a member of `oneof`_ ``_order_by``. + page_token (str): + Specifies a page token to use. Set ``pageToken`` to the + ``nextPageToken`` returned by a previous list request to get + the next page of results. + + This field is a member of `oneof`_ ``_page_token``. + parent_name (str): + The name of the parent reservation and parent block. In the + format of + reservations/{reservation_name}/reservationBlocks/{reservation_block_name} + project (str): + Project ID for this request. + return_partial_success (bool): + Opt-in for partial success behavior which + provides partial results in case of failure. The + default value is false. For example, when + partial success behavior is enabled, + aggregatedList for a single zone scope either + returns all resources in the zone or no + resources, with an error code. + + This field is a member of `oneof`_ ``_return_partial_success``. + zone (str): + Name of the zone for this request. Zone name + should conform to RFC1035. + """ + + filter: str = proto.Field( + proto.STRING, + number=336120696, + optional=True, + ) + max_results: int = proto.Field( + proto.UINT32, + number=54715419, + optional=True, + ) + order_by: str = proto.Field( + proto.STRING, + number=160562920, + optional=True, + ) + page_token: str = proto.Field( + proto.STRING, + number=19994697, + optional=True, + ) + parent_name: str = proto.Field( + proto.STRING, + number=478151936, + ) + project: str = proto.Field( + proto.STRING, + number=227560217, + ) + return_partial_success: bool = proto.Field( + proto.BOOL, + number=517198390, + optional=True, + ) + zone: str = proto.Field( + proto.STRING, + number=3744684, + ) + + class ListReservationsRequest(proto.Message): r"""A request message for Reservations.List. See the method description for details. @@ -69600,9 +72975,6 @@ class MachineType(proto.Message): [Output Only] Name of the resource. This field is a member of `oneof`_ ``_name``. - scratch_disks (MutableSequence[google.cloud.compute_v1.types.ScratchDisks]): - [Output Only] A list of extended scratch disks assigned to - the instance. self_link (str): [Output Only] Server-defined URL for the resource. @@ -69705,11 +73077,6 @@ class Architecture(proto.Enum): number=3373707, optional=True, ) - scratch_disks: MutableSequence["ScratchDisks"] = proto.RepeatedField( - proto.MESSAGE, - number=480778481, - message="ScratchDisks", - ) self_link: str = proto.Field( proto.STRING, number=456214797, @@ -71042,6 +74409,11 @@ class Network(proto.Message): projects/{project_id}/global/networkProfiles/{network_profile_name} This field is a member of `oneof`_ ``_network_profile``. + params (google.cloud.compute_v1.types.NetworkParams): + Input only. [Input Only] Additional params passed with the + request, but not persisted as part of resource payload. + + This field is a member of `oneof`_ ``_params``. peerings (MutableSequence[google.cloud.compute_v1.types.NetworkPeering]): [Output Only] A list of network peerings for the resource. routing_config (google.cloud.compute_v1.types.NetworkRoutingConfig): @@ -71153,6 +74525,12 @@ class NetworkFirewallPolicyEnforcementOrder(proto.Enum): number=173112472, optional=True, ) + params: "NetworkParams" = proto.Field( + proto.MESSAGE, + number=78313862, + optional=True, + message="NetworkParams", + ) peerings: MutableSequence["NetworkPeering"] = proto.RepeatedField( proto.MESSAGE, number=69883187, @@ -73358,6 +76736,30 @@ def raw_page(self): ) +class NetworkParams(proto.Message): + r"""Additional network parameters. + + Attributes: + resource_manager_tags (MutableMapping[str, str]): + Tag keys/values directly bound to this resource. Tag keys + and values have the same definition as resource manager + tags. The field is allowed for INSERT only. The keys/values + to set on the resource should be specified in either ID { : + } or Namespaced format { : }. For example the following are + valid inputs: \* {"tagKeys/333" : "tagValues/444", + "tagKeys/123" : "tagValues/456"} \* {"123/environment" : + "production", "345/abc" : "xyz"} Note: \* Invalid + combinations of ID & namespaced format is not supported. For + instance: {"123/environment" : "tagValues/444"} is invalid. + """ + + resource_manager_tags: MutableMapping[str, str] = proto.MapField( + proto.STRING, + proto.STRING, + number=377671164, + ) + + class NetworkPeering(proto.Message): r"""A network peering attached to a network resource. The message includes the peering name, peer network, peering state, and a @@ -79080,6 +82482,68 @@ class PatchInstanceSettingRequest(proto.Message): ) +class PatchInterconnectAttachmentGroupRequest(proto.Message): + r"""A request message for InterconnectAttachmentGroups.Patch. See + the method description for details. + + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + interconnect_attachment_group (str): + Name of the InterconnectAttachmentGroup + resource to patch. + interconnect_attachment_group_resource (google.cloud.compute_v1.types.InterconnectAttachmentGroup): + The body resource for this request + project (str): + Project ID for this request. + request_id (str): + An optional request ID to identify requests. Specify a + unique request ID so that if you must retry your request, + the server will know to ignore the request if it has already + been completed. For example, consider a situation where you + make an initial request and the request times out. If you + make the request again with the same request ID, the server + can check if original operation with the same request ID was + received, and if so, will ignore the second request. This + prevents clients from accidentally creating duplicate + commitments. The request ID must be a valid UUID with the + exception that zero UUID is not supported ( + 00000000-0000-0000-0000-000000000000). end_interface: + MixerMutationRequestBuilder + + This field is a member of `oneof`_ ``_request_id``. + update_mask (str): + The list of fields to update. + + This field is a member of `oneof`_ ``_update_mask``. + """ + + interconnect_attachment_group: str = proto.Field( + proto.STRING, + number=75905012, + ) + interconnect_attachment_group_resource: "InterconnectAttachmentGroup" = proto.Field( + proto.MESSAGE, + number=9990137, + message="InterconnectAttachmentGroup", + ) + project: str = proto.Field( + proto.STRING, + number=227560217, + ) + request_id: str = proto.Field( + proto.STRING, + number=37109963, + optional=True, + ) + update_mask: str = proto.Field( + proto.STRING, + number=500079778, + optional=True, + ) + + class PatchInterconnectAttachmentRequest(proto.Message): r"""A request message for InterconnectAttachments.Patch. See the method description for details. @@ -79140,6 +82604,68 @@ class PatchInterconnectAttachmentRequest(proto.Message): ) +class PatchInterconnectGroupRequest(proto.Message): + r"""A request message for InterconnectGroups.Patch. See the + method description for details. + + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + interconnect_group (str): + Name of the InterconnectGroup resource to + patch. + interconnect_group_resource (google.cloud.compute_v1.types.InterconnectGroup): + The body resource for this request + project (str): + Project ID for this request. + request_id (str): + An optional request ID to identify requests. Specify a + unique request ID so that if you must retry your request, + the server will know to ignore the request if it has already + been completed. For example, consider a situation where you + make an initial request and the request times out. If you + make the request again with the same request ID, the server + can check if original operation with the same request ID was + received, and if so, will ignore the second request. This + prevents clients from accidentally creating duplicate + commitments. The request ID must be a valid UUID with the + exception that zero UUID is not supported ( + 00000000-0000-0000-0000-000000000000). end_interface: + MixerMutationRequestBuilder + + This field is a member of `oneof`_ ``_request_id``. + update_mask (str): + The list of fields to update. + + This field is a member of `oneof`_ ``_update_mask``. + """ + + interconnect_group: str = proto.Field( + proto.STRING, + number=388651918, + ) + interconnect_group_resource: "InterconnectGroup" = proto.Field( + proto.MESSAGE, + number=85571999, + message="InterconnectGroup", + ) + project: str = proto.Field( + proto.STRING, + number=227560217, + ) + request_id: str = proto.Field( + proto.STRING, + number=37109963, + optional=True, + ) + update_mask: str = proto.Field( + proto.STRING, + number=500079778, + optional=True, + ) + + class PatchInterconnectRequest(proto.Message): r"""A request message for Interconnects.Patch. See the method description for details. @@ -83532,10 +87058,10 @@ class PublicDelegatedPrefix(proto.Message): public delegated prefix is being initialized and addresses cannot be created yet. - ``READY_TO_ANNOUNCE`` The public delegated prefix is a live migration prefix and is active. - - ``ANNOUNCED`` The public delegated prefix is active. - - ``DELETING`` The public delegated prefix is being - deprovsioned. Check the Status enum for the list of possible - values. + ``ANNOUNCED`` The public delegated prefix is announced and + ready to use. - ``DELETING`` The public delegated prefix is + being deprovsioned. Check the Status enum for the list of + possible values. This field is a member of `oneof`_ ``_status``. """ @@ -83592,15 +87118,16 @@ class Status(proto.Enum): prefix is being initialized and addresses cannot be created yet. - ``READY_TO_ANNOUNCE`` The public delegated prefix is a live migration prefix and is active. - ``ANNOUNCED`` The public delegated - prefix is active. - ``DELETING`` The public delegated prefix is - being deprovsioned. + prefix is announced and ready to use. - ``DELETING`` The public + delegated prefix is being deprovsioned. Values: UNDEFINED_STATUS (0): A value indicating that the enum field is not set. ANNOUNCED (365103355): - The public delegated prefix is active. + The public delegated prefix is announced and + ready to use. ANNOUNCED_TO_GOOGLE (454875705): The prefix is announced within Google network. @@ -87667,6 +91194,18 @@ class Reservation(proto.Message): [Output Only] Creation timestamp in RFC3339 text format. This field is a member of `oneof`_ ``_creation_timestamp``. + delete_after_duration (google.cloud.compute_v1.types.Duration): + Duration time relative to reservation + creation when Compute Engine will automatically + delete this resource. + + This field is a member of `oneof`_ ``_delete_after_duration``. + delete_at_time (str): + Absolute time in future when the reservation + will be auto-deleted by Compute Engine. + Timestamp is represented in RFC3339 text format. + + This field is a member of `oneof`_ ``_delete_at_time``. deployment_type (str): Specifies the deployment strategy for this reservation. Check the DeploymentType enum for @@ -87679,6 +91218,12 @@ class Reservation(proto.Message): resource. This field is a member of `oneof`_ ``_description``. + enable_emergent_maintenance (bool): + Indicates whether Compute Engine allows + unplanned maintenance for your VMs; for example, + to fix hardware errors. + + This field is a member of `oneof`_ ``_enable_emergent_maintenance``. id (int): [Output Only] The unique identifier for the resource. This identifier is defined by the server. @@ -87830,6 +91375,17 @@ class Status(proto.Enum): number=30525366, optional=True, ) + delete_after_duration: "Duration" = proto.Field( + proto.MESSAGE, + number=323997099, + optional=True, + message="Duration", + ) + delete_at_time: str = proto.Field( + proto.STRING, + number=83294405, + optional=True, + ) deployment_type: str = proto.Field( proto.STRING, number=396722292, @@ -87840,6 +91396,11 @@ class Status(proto.Enum): number=422937596, optional=True, ) + enable_emergent_maintenance: bool = proto.Field( + proto.BOOL, + number=353759497, + optional=True, + ) id: int = proto.Field( proto.UINT64, number=3355, @@ -88116,6 +91677,17 @@ class ReservationBlock(proto.Message): block. This field is a member of `oneof`_ ``_reservation_maintenance``. + reservation_sub_block_count (int): + [Output Only] The number of reservation subBlocks associated + with this reservation block. + + This field is a member of `oneof`_ ``_reservation_sub_block_count``. + reservation_sub_block_in_use_count (int): + [Output Only] The number of in-use reservation subBlocks + associated with this reservation block. If at least one VM + is running on a subBlock, it is considered in-use. + + This field is a member of `oneof`_ ``_reservation_sub_block_in_use_count``. self_link (str): [Output Only] Server-defined fully-qualified URL for this resource. @@ -88203,6 +91775,361 @@ class Status(proto.Enum): optional=True, message="GroupMaintenanceInfo", ) + reservation_sub_block_count: int = proto.Field( + proto.INT32, + number=330782955, + optional=True, + ) + reservation_sub_block_in_use_count: int = proto.Field( + proto.INT32, + number=186007137, + optional=True, + ) + self_link: str = proto.Field( + proto.STRING, + number=456214797, + optional=True, + ) + self_link_with_id: str = proto.Field( + proto.STRING, + number=44520962, + optional=True, + ) + status: str = proto.Field( + proto.STRING, + number=181260274, + optional=True, + ) + zone: str = proto.Field( + proto.STRING, + number=3744684, + optional=True, + ) + + +class ReservationBlockPhysicalTopology(proto.Message): + r""" + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + block (str): + The hash of the capacity block within the + cluster. + + This field is a member of `oneof`_ ``_block``. + cluster (str): + The cluster name of the reservation block. + + This field is a member of `oneof`_ ``_cluster``. + """ + + block: str = proto.Field( + proto.STRING, + number=93832333, + optional=True, + ) + cluster: str = proto.Field( + proto.STRING, + number=335221242, + optional=True, + ) + + +class ReservationBlocksGetResponse(proto.Message): + r""" + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + resource (google.cloud.compute_v1.types.ReservationBlock): + + This field is a member of `oneof`_ ``_resource``. + """ + + resource: "ReservationBlock" = proto.Field( + proto.MESSAGE, + number=195806222, + optional=True, + message="ReservationBlock", + ) + + +class ReservationBlocksListResponse(proto.Message): + r"""A list of reservation blocks under a single reservation. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + id (str): + Unique identifier for the resource; defined + by the server. + + This field is a member of `oneof`_ ``_id``. + items (MutableSequence[google.cloud.compute_v1.types.ReservationBlock]): + A list of reservation block resources. + kind (str): + Type of the resource. Always + compute#reservationBlock for a list of + reservation blocks. + + This field is a member of `oneof`_ ``_kind``. + next_page_token (str): + This token allows you to get the next page of + results for list requests. If the number of + results is larger than maxResults, use the + nextPageToken as a value for the query parameter + pageToken in the next list request. Subsequent + list requests will have their own nextPageToken + to continue paging through the results. + + This field is a member of `oneof`_ ``_next_page_token``. + self_link (str): + Server-defined URL for this resource. + + This field is a member of `oneof`_ ``_self_link``. + warning (google.cloud.compute_v1.types.Warning): + Informational warning message. + + This field is a member of `oneof`_ ``_warning``. + """ + + @property + def raw_page(self): + return self + + id: str = proto.Field( + proto.STRING, + number=3355, + optional=True, + ) + items: MutableSequence["ReservationBlock"] = proto.RepeatedField( + proto.MESSAGE, + number=100526016, + message="ReservationBlock", + ) + kind: str = proto.Field( + proto.STRING, + number=3292052, + optional=True, + ) + next_page_token: str = proto.Field( + proto.STRING, + number=79797525, + optional=True, + ) + self_link: str = proto.Field( + proto.STRING, + number=456214797, + optional=True, + ) + warning: "Warning" = proto.Field( + proto.MESSAGE, + number=50704284, + optional=True, + message="Warning", + ) + + +class ReservationList(proto.Message): + r""" + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + id (str): + [Output Only] The unique identifier for the resource. This + identifier is defined by the server. + + This field is a member of `oneof`_ ``_id``. + items (MutableSequence[google.cloud.compute_v1.types.Reservation]): + [Output Only] A list of Allocation resources. + kind (str): + [Output Only] Type of resource.Always + compute#reservationsList for listsof reservations + + This field is a member of `oneof`_ ``_kind``. + next_page_token (str): + [Output Only] This token allows you to get the next page of + results for list requests. If the number of results is + larger than maxResults, use the nextPageToken as a value for + the query parameter pageToken in the next list request. + Subsequent list requests will have their own nextPageToken + to continue paging through the results. + + This field is a member of `oneof`_ ``_next_page_token``. + self_link (str): + [Output Only] Server-defined URL for this resource. + + This field is a member of `oneof`_ ``_self_link``. + warning (google.cloud.compute_v1.types.Warning): + [Output Only] Informational warning message. + + This field is a member of `oneof`_ ``_warning``. + """ + + @property + def raw_page(self): + return self + + id: str = proto.Field( + proto.STRING, + number=3355, + optional=True, + ) + items: MutableSequence["Reservation"] = proto.RepeatedField( + proto.MESSAGE, + number=100526016, + message="Reservation", + ) + kind: str = proto.Field( + proto.STRING, + number=3292052, + optional=True, + ) + next_page_token: str = proto.Field( + proto.STRING, + number=79797525, + optional=True, + ) + self_link: str = proto.Field( + proto.STRING, + number=456214797, + optional=True, + ) + warning: "Warning" = proto.Field( + proto.MESSAGE, + number=50704284, + optional=True, + message="Warning", + ) + + +class ReservationSubBlock(proto.Message): + r"""Represents a reservation subBlock resource. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + count (int): + [Output Only] The number of hosts that are allocated in this + reservation subBlock. + + This field is a member of `oneof`_ ``_count``. + creation_timestamp (str): + [Output Only] Creation timestamp in RFC3339 text format. + + This field is a member of `oneof`_ ``_creation_timestamp``. + id (int): + [Output Only] The unique identifier for the resource. This + identifier is defined by the server. + + This field is a member of `oneof`_ ``_id``. + in_use_count (int): + [Output Only] The number of instances that are currently in + use on this reservation subBlock. + + This field is a member of `oneof`_ ``_in_use_count``. + kind (str): + [Output Only] Type of the resource. Always + compute#reservationSubBlock for reservation subBlocks. + + This field is a member of `oneof`_ ``_kind``. + name (str): + [Output Only] The name of this reservation subBlock + generated by Google Compute Engine. The name must be 1-63 + characters long, and comply with RFC1035 @pattern + `a-z `__? + + This field is a member of `oneof`_ ``_name``. + physical_topology (google.cloud.compute_v1.types.ReservationSubBlockPhysicalTopology): + [Output Only] The physical topology of the reservation + subBlock. + + This field is a member of `oneof`_ ``_physical_topology``. + self_link (str): + [Output Only] Server-defined fully-qualified URL for this + resource. + + This field is a member of `oneof`_ ``_self_link``. + self_link_with_id (str): + [Output Only] Server-defined URL for this resource with the + resource id. + + This field is a member of `oneof`_ ``_self_link_with_id``. + status (str): + [Output Only] Status of the reservation subBlock. Check the + Status enum for the list of possible values. + + This field is a member of `oneof`_ ``_status``. + zone (str): + [Output Only] Zone in which the reservation subBlock + resides. + + This field is a member of `oneof`_ ``_zone``. + """ + + class Status(proto.Enum): + r"""[Output Only] Status of the reservation subBlock. + + Values: + UNDEFINED_STATUS (0): + A value indicating that the enum field is not + set. + CREATING (455564985): + Resources are being allocated for the + reservation subBlock. + DELETING (528602024): + Reservation subBlock is currently being + deleted. + INVALID (530283991): + No description available. + READY (77848963): + Reservation subBlock has allocated all its + resources. + """ + UNDEFINED_STATUS = 0 + CREATING = 455564985 + DELETING = 528602024 + INVALID = 530283991 + READY = 77848963 + + count: int = proto.Field( + proto.INT32, + number=94851343, + optional=True, + ) + creation_timestamp: str = proto.Field( + proto.STRING, + number=30525366, + optional=True, + ) + id: int = proto.Field( + proto.UINT64, + number=3355, + optional=True, + ) + in_use_count: int = proto.Field( + proto.INT32, + number=493458877, + optional=True, + ) + kind: str = proto.Field( + proto.STRING, + number=3292052, + optional=True, + ) + name: str = proto.Field( + proto.STRING, + number=3373707, + optional=True, + ) + physical_topology: "ReservationSubBlockPhysicalTopology" = proto.Field( + proto.MESSAGE, + number=279778519, + optional=True, + message="ReservationSubBlockPhysicalTopology", + ) self_link: str = proto.Field( proto.STRING, number=456214797, @@ -88225,7 +92152,7 @@ class Status(proto.Enum): ) -class ReservationBlockPhysicalTopology(proto.Message): +class ReservationSubBlockPhysicalTopology(proto.Message): r""" .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields @@ -88237,9 +92164,14 @@ class ReservationBlockPhysicalTopology(proto.Message): This field is a member of `oneof`_ ``_block``. cluster (str): - The cluster name of the reservation block. + The cluster name of the reservation subBlock. This field is a member of `oneof`_ ``_cluster``. + sub_block (str): + The hash of the capacity sub-block within the + capacity block. + + This field is a member of `oneof`_ ``_sub_block``. """ block: str = proto.Field( @@ -88252,29 +92184,34 @@ class ReservationBlockPhysicalTopology(proto.Message): number=335221242, optional=True, ) + sub_block: str = proto.Field( + proto.STRING, + number=478033358, + optional=True, + ) -class ReservationBlocksGetResponse(proto.Message): +class ReservationSubBlocksGetResponse(proto.Message): r""" .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields Attributes: - resource (google.cloud.compute_v1.types.ReservationBlock): + resource (google.cloud.compute_v1.types.ReservationSubBlock): This field is a member of `oneof`_ ``_resource``. """ - resource: "ReservationBlock" = proto.Field( + resource: "ReservationSubBlock" = proto.Field( proto.MESSAGE, number=195806222, optional=True, - message="ReservationBlock", + message="ReservationSubBlock", ) -class ReservationBlocksListResponse(proto.Message): - r"""A list of reservation blocks under a single reservation. +class ReservationSubBlocksListResponse(proto.Message): + r"""A list of reservation subBlocks under a single reservation. .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields @@ -88284,12 +92221,12 @@ class ReservationBlocksListResponse(proto.Message): by the server. This field is a member of `oneof`_ ``_id``. - items (MutableSequence[google.cloud.compute_v1.types.ReservationBlock]): - A list of reservation block resources. + items (MutableSequence[google.cloud.compute_v1.types.ReservationSubBlock]): + A list of reservation subBlock resources. kind (str): Type of the resource. Always - compute#reservationBlock for a list of - reservation blocks. + compute#reservationSubBlock for a list of + reservation subBlocks. This field is a member of `oneof`_ ``_kind``. next_page_token (str): @@ -88321,84 +92258,10 @@ def raw_page(self): number=3355, optional=True, ) - items: MutableSequence["ReservationBlock"] = proto.RepeatedField( + items: MutableSequence["ReservationSubBlock"] = proto.RepeatedField( proto.MESSAGE, number=100526016, - message="ReservationBlock", - ) - kind: str = proto.Field( - proto.STRING, - number=3292052, - optional=True, - ) - next_page_token: str = proto.Field( - proto.STRING, - number=79797525, - optional=True, - ) - self_link: str = proto.Field( - proto.STRING, - number=456214797, - optional=True, - ) - warning: "Warning" = proto.Field( - proto.MESSAGE, - number=50704284, - optional=True, - message="Warning", - ) - - -class ReservationList(proto.Message): - r""" - - .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields - - Attributes: - id (str): - [Output Only] The unique identifier for the resource. This - identifier is defined by the server. - - This field is a member of `oneof`_ ``_id``. - items (MutableSequence[google.cloud.compute_v1.types.Reservation]): - [Output Only] A list of Allocation resources. - kind (str): - [Output Only] Type of resource.Always - compute#reservationsList for listsof reservations - - This field is a member of `oneof`_ ``_kind``. - next_page_token (str): - [Output Only] This token allows you to get the next page of - results for list requests. If the number of results is - larger than maxResults, use the nextPageToken as a value for - the query parameter pageToken in the next list request. - Subsequent list requests will have their own nextPageToken - to continue paging through the results. - - This field is a member of `oneof`_ ``_next_page_token``. - self_link (str): - [Output Only] Server-defined URL for this resource. - - This field is a member of `oneof`_ ``_self_link``. - warning (google.cloud.compute_v1.types.Warning): - [Output Only] Informational warning message. - - This field is a member of `oneof`_ ``_warning``. - """ - - @property - def raw_page(self): - return self - - id: str = proto.Field( - proto.STRING, - number=3355, - optional=True, - ) - items: MutableSequence["Reservation"] = proto.RepeatedField( - proto.MESSAGE, - number=100526016, - message="Reservation", + message="ReservationSubBlock", ) kind: str = proto.Field( proto.STRING, @@ -89140,6 +93003,9 @@ class ResourcePolicy(proto.Message): the Status enum for the list of possible values. This field is a member of `oneof`_ ``_status``. + workload_policy (google.cloud.compute_v1.types.ResourcePolicyWorkloadPolicy): + + This field is a member of `oneof`_ ``_workload_policy``. """ class Status(proto.Enum): @@ -89240,6 +93106,12 @@ class Status(proto.Enum): number=181260274, optional=True, ) + workload_policy: "ResourcePolicyWorkloadPolicy" = proto.Field( + proto.MESSAGE, + number=114721530, + optional=True, + message="ResourcePolicyWorkloadPolicy", + ) class ResourcePolicyAggregatedList(proto.Message): @@ -89399,6 +93271,11 @@ class ResourcePolicyGroupPlacementPolicy(proto.Message): possible values. This field is a member of `oneof`_ ``_collocation``. + gpu_topology (str): + Specifies the shape of the GPU slice, in + slice based GPU families eg. A4X. + + This field is a member of `oneof`_ ``_gpu_topology``. vm_count (int): Number of VMs in this placement group. Google does not recommend that you use this field @@ -89435,6 +93312,11 @@ class Collocation(proto.Enum): number=511156533, optional=True, ) + gpu_topology: str = proto.Field( + proto.STRING, + number=247948450, + optional=True, + ) vm_count: int = proto.Field( proto.INT32, number=261463431, @@ -89997,6 +93879,81 @@ class Day(proto.Enum): ) +class ResourcePolicyWorkloadPolicy(proto.Message): + r"""Represents the workload policy. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + accelerator_topology (str): + + This field is a member of `oneof`_ ``_accelerator_topology``. + max_topology_distance (str): + Check the MaxTopologyDistance enum for the + list of possible values. + + This field is a member of `oneof`_ ``_max_topology_distance``. + type_ (str): + Check the Type enum for the list of possible + values. + + This field is a member of `oneof`_ ``_type``. + """ + + class MaxTopologyDistance(proto.Enum): + r""" + + Values: + UNDEFINED_MAX_TOPOLOGY_DISTANCE (0): + A value indicating that the enum field is not + set. + BLOCK (63294573): + VMs must be provisioned in the same block. + CLUSTER (516333018): + VMs must be provisioned in the same cluster. + SUBBLOCK (316202573): + VMs must be provisioned in the same subblock. + """ + UNDEFINED_MAX_TOPOLOGY_DISTANCE = 0 + BLOCK = 63294573 + CLUSTER = 516333018 + SUBBLOCK = 316202573 + + class Type(proto.Enum): + r""" + + Values: + UNDEFINED_TYPE (0): + A value indicating that the enum field is not + set. + HIGH_AVAILABILITY (409487576): + VMs will be provisioned in such a way which + provides high availability. + HIGH_THROUGHPUT (146499815): + VMs will be provisioned in such a way which + provides high throughput. + """ + UNDEFINED_TYPE = 0 + HIGH_AVAILABILITY = 409487576 + HIGH_THROUGHPUT = 146499815 + + accelerator_topology: str = proto.Field( + proto.STRING, + number=389323203, + optional=True, + ) + max_topology_distance: str = proto.Field( + proto.STRING, + number=7521706, + optional=True, + ) + type_: str = proto.Field( + proto.STRING, + number=3575610, + optional=True, + ) + + class ResourceStatus(proto.Message): r"""Contains output only fields. Use this sub-message for actual values set on Instance attributes as compared to the value @@ -90452,6 +94409,11 @@ class Route(proto.Message): matching packets. This field is a member of `oneof`_ ``_next_hop_vpn_tunnel``. + params (google.cloud.compute_v1.types.RouteParams): + Input only. [Input Only] Additional params passed with the + request, but not persisted as part of resource payload. + + This field is a member of `oneof`_ ``_params``. priority (int): The priority of this route. Priority is used to break ties in cases where there is more than one matching route of @@ -90660,6 +94622,12 @@ class RouteType(proto.Enum): number=519844501, optional=True, ) + params: "RouteParams" = proto.Field( + proto.MESSAGE, + number=78313862, + optional=True, + message="RouteParams", + ) priority: int = proto.Field( proto.UINT32, number=445151652, @@ -90827,6 +94795,30 @@ def raw_page(self): ) +class RouteParams(proto.Message): + r"""Additional route parameters. + + Attributes: + resource_manager_tags (MutableMapping[str, str]): + Tag keys/values directly bound to this resource. Tag keys + and values have the same definition as resource manager + tags. The field is allowed for INSERT only. The keys/values + to set on the resource should be specified in either ID { : + } or Namespaced format { : }. For example the following are + valid inputs: \* {"tagKeys/333" : "tagValues/444", + "tagKeys/123" : "tagValues/456"} \* {"123/environment" : + "production", "345/abc" : "xyz"} Note: \* Invalid + combinations of ID & namespaced format is not supported. For + instance: {"123/environment" : "tagValues/444"} is invalid. + """ + + resource_manager_tags: MutableMapping[str, str] = proto.MapField( + proto.STRING, + proto.STRING, + number=377671164, + ) + + class RoutePolicy(proto.Message): r""" @@ -94489,25 +98481,6 @@ class SchedulingOnInstanceStopAction(proto.Message): ) -class ScratchDisks(proto.Message): - r""" - - .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields - - Attributes: - disk_gb (int): - Size of the scratch disk, defined in GB. - - This field is a member of `oneof`_ ``_disk_gb``. - """ - - disk_gb: int = proto.Field( - proto.INT32, - number=60990141, - optional=True, - ) - - class Screenshot(proto.Message): r"""An instance's screenshot. @@ -98345,30 +102318,155 @@ class SetIamPolicyDiskRequest(proto.Message): ) -class SetIamPolicyFirewallPolicyRequest(proto.Message): - r"""A request message for FirewallPolicies.SetIamPolicy. See the - method description for details. - - Attributes: - global_organization_set_policy_request_resource (google.cloud.compute_v1.types.GlobalOrganizationSetPolicyRequest): - The body resource for this request - resource (str): - Name or id of the resource for this request. - """ - - global_organization_set_policy_request_resource: "GlobalOrganizationSetPolicyRequest" = proto.Field( - proto.MESSAGE, - number=177408606, - message="GlobalOrganizationSetPolicyRequest", - ) - resource: str = proto.Field( - proto.STRING, - number=195806222, - ) - - -class SetIamPolicyImageRequest(proto.Message): - r"""A request message for Images.SetIamPolicy. See the method +class SetIamPolicyFirewallPolicyRequest(proto.Message): + r"""A request message for FirewallPolicies.SetIamPolicy. See the + method description for details. + + Attributes: + global_organization_set_policy_request_resource (google.cloud.compute_v1.types.GlobalOrganizationSetPolicyRequest): + The body resource for this request + resource (str): + Name or id of the resource for this request. + """ + + global_organization_set_policy_request_resource: "GlobalOrganizationSetPolicyRequest" = proto.Field( + proto.MESSAGE, + number=177408606, + message="GlobalOrganizationSetPolicyRequest", + ) + resource: str = proto.Field( + proto.STRING, + number=195806222, + ) + + +class SetIamPolicyImageRequest(proto.Message): + r"""A request message for Images.SetIamPolicy. See the method + description for details. + + Attributes: + global_set_policy_request_resource (google.cloud.compute_v1.types.GlobalSetPolicyRequest): + The body resource for this request + project (str): + Project ID for this request. + resource (str): + Name or id of the resource for this request. + """ + + global_set_policy_request_resource: "GlobalSetPolicyRequest" = proto.Field( + proto.MESSAGE, + number=337048498, + message="GlobalSetPolicyRequest", + ) + project: str = proto.Field( + proto.STRING, + number=227560217, + ) + resource: str = proto.Field( + proto.STRING, + number=195806222, + ) + + +class SetIamPolicyInstanceRequest(proto.Message): + r"""A request message for Instances.SetIamPolicy. See the method + description for details. + + Attributes: + project (str): + Project ID for this request. + resource (str): + Name or id of the resource for this request. + zone (str): + The name of the zone for this request. + zone_set_policy_request_resource (google.cloud.compute_v1.types.ZoneSetPolicyRequest): + The body resource for this request + """ + + project: str = proto.Field( + proto.STRING, + number=227560217, + ) + resource: str = proto.Field( + proto.STRING, + number=195806222, + ) + zone: str = proto.Field( + proto.STRING, + number=3744684, + ) + zone_set_policy_request_resource: "ZoneSetPolicyRequest" = proto.Field( + proto.MESSAGE, + number=382082107, + message="ZoneSetPolicyRequest", + ) + + +class SetIamPolicyInstanceTemplateRequest(proto.Message): + r"""A request message for InstanceTemplates.SetIamPolicy. See the + method description for details. + + Attributes: + global_set_policy_request_resource (google.cloud.compute_v1.types.GlobalSetPolicyRequest): + The body resource for this request + project (str): + Project ID for this request. + resource (str): + Name or id of the resource for this request. + """ + + global_set_policy_request_resource: "GlobalSetPolicyRequest" = proto.Field( + proto.MESSAGE, + number=337048498, + message="GlobalSetPolicyRequest", + ) + project: str = proto.Field( + proto.STRING, + number=227560217, + ) + resource: str = proto.Field( + proto.STRING, + number=195806222, + ) + + +class SetIamPolicyInstantSnapshotRequest(proto.Message): + r"""A request message for InstantSnapshots.SetIamPolicy. See the + method description for details. + + Attributes: + project (str): + Project ID for this request. + resource (str): + Name or id of the resource for this request. + zone (str): + The name of the zone for this request. + zone_set_policy_request_resource (google.cloud.compute_v1.types.ZoneSetPolicyRequest): + The body resource for this request + """ + + project: str = proto.Field( + proto.STRING, + number=227560217, + ) + resource: str = proto.Field( + proto.STRING, + number=195806222, + ) + zone: str = proto.Field( + proto.STRING, + number=3744684, + ) + zone_set_policy_request_resource: "ZoneSetPolicyRequest" = proto.Field( + proto.MESSAGE, + number=382082107, + message="ZoneSetPolicyRequest", + ) + + +class SetIamPolicyInterconnectAttachmentGroupRequest(proto.Message): + r"""A request message for + InterconnectAttachmentGroups.SetIamPolicy. See the method description for details. Attributes: @@ -98395,43 +102493,9 @@ class SetIamPolicyImageRequest(proto.Message): ) -class SetIamPolicyInstanceRequest(proto.Message): - r"""A request message for Instances.SetIamPolicy. See the method - description for details. - - Attributes: - project (str): - Project ID for this request. - resource (str): - Name or id of the resource for this request. - zone (str): - The name of the zone for this request. - zone_set_policy_request_resource (google.cloud.compute_v1.types.ZoneSetPolicyRequest): - The body resource for this request - """ - - project: str = proto.Field( - proto.STRING, - number=227560217, - ) - resource: str = proto.Field( - proto.STRING, - number=195806222, - ) - zone: str = proto.Field( - proto.STRING, - number=3744684, - ) - zone_set_policy_request_resource: "ZoneSetPolicyRequest" = proto.Field( - proto.MESSAGE, - number=382082107, - message="ZoneSetPolicyRequest", - ) - - -class SetIamPolicyInstanceTemplateRequest(proto.Message): - r"""A request message for InstanceTemplates.SetIamPolicy. See the - method description for details. +class SetIamPolicyInterconnectGroupRequest(proto.Message): + r"""A request message for InterconnectGroups.SetIamPolicy. See + the method description for details. Attributes: global_set_policy_request_resource (google.cloud.compute_v1.types.GlobalSetPolicyRequest): @@ -98457,40 +102521,6 @@ class SetIamPolicyInstanceTemplateRequest(proto.Message): ) -class SetIamPolicyInstantSnapshotRequest(proto.Message): - r"""A request message for InstantSnapshots.SetIamPolicy. See the - method description for details. - - Attributes: - project (str): - Project ID for this request. - resource (str): - Name or id of the resource for this request. - zone (str): - The name of the zone for this request. - zone_set_policy_request_resource (google.cloud.compute_v1.types.ZoneSetPolicyRequest): - The body resource for this request - """ - - project: str = proto.Field( - proto.STRING, - number=227560217, - ) - resource: str = proto.Field( - proto.STRING, - number=195806222, - ) - zone: str = proto.Field( - proto.STRING, - number=3744684, - ) - zone_set_policy_request_resource: "ZoneSetPolicyRequest" = proto.Field( - proto.MESSAGE, - number=382082107, - message="ZoneSetPolicyRequest", - ) - - class SetIamPolicyLicenseRequest(proto.Message): r"""A request message for Licenses.SetIamPolicy. See the method description for details. @@ -106698,6 +110728,11 @@ class Subnetwork(proto.Message): can be set only at resource creation time. This field is a member of `oneof`_ ``_network``. + params (google.cloud.compute_v1.types.SubnetworkParams): + Input only. [Input Only] Additional params passed with the + request, but not persisted as part of resource payload. + + This field is a member of `oneof`_ ``_params``. private_ip_google_access (bool): Whether the VMs in this subnet can access Google services without assigned external IP @@ -106774,6 +110809,14 @@ class Subnetwork(proto.Message): enum for the list of possible values. This field is a member of `oneof`_ ``_state``. + system_reserved_external_ipv6_ranges (MutableSequence[str]): + Output only. [Output Only] The array of external IPv6 + network ranges reserved from the subnetwork's external IPv6 + range for system use. + system_reserved_internal_ipv6_ranges (MutableSequence[str]): + Output only. [Output Only] The array of internal IPv6 + network ranges reserved from the subnetwork's internal IPv6 + range for system use. """ class Ipv6AccessType(proto.Enum): @@ -107051,6 +111094,12 @@ class State(proto.Enum): number=232872494, optional=True, ) + params: "SubnetworkParams" = proto.Field( + proto.MESSAGE, + number=78313862, + optional=True, + message="SubnetworkParams", + ) private_ip_google_access: bool = proto.Field( proto.BOOL, number=421491790, @@ -107103,6 +111152,14 @@ class State(proto.Enum): number=109757585, optional=True, ) + system_reserved_external_ipv6_ranges: MutableSequence[str] = proto.RepeatedField( + proto.STRING, + number=65324129, + ) + system_reserved_internal_ipv6_ranges: MutableSequence[str] = proto.RepeatedField( + proto.STRING, + number=432294995, + ) class SubnetworkAggregatedList(proto.Message): @@ -107402,6 +111459,30 @@ class Metadata(proto.Enum): ) +class SubnetworkParams(proto.Message): + r"""Additional subnetwork parameters. + + Attributes: + resource_manager_tags (MutableMapping[str, str]): + Tag keys/values directly bound to this resource. Tag keys + and values have the same definition as resource manager + tags. The field is allowed for INSERT only. The keys/values + to set on the resource should be specified in either ID { : + } or Namespaced format { : }. For example the following are + valid inputs: \* {"tagKeys/333" : "tagValues/444", + "tagKeys/123" : "tagValues/456"} \* {"123/environment" : + "production", "345/abc" : "xyz"} Note: \* Invalid + combinations of ID & namespaced format is not supported. For + instance: {"123/environment" : "tagValues/444"} is invalid. + """ + + resource_manager_tags: MutableMapping[str, str] = proto.MapField( + proto.STRING, + proto.STRING, + number=377671164, + ) + + class SubnetworkSecondaryRange(proto.Message): r"""Represents a secondary IP range of a subnetwork. @@ -107503,6 +111584,37 @@ class SubnetworksScopedList(proto.Message): ) +class SubnetworksScopedWarning(proto.Message): + r""" + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + scope_name (str): + Name of the scope containing this set of + Subnetworks. + + This field is a member of `oneof`_ ``_scope_name``. + warning (google.cloud.compute_v1.types.Warning): + An informational warning about unreachable + scope + + This field is a member of `oneof`_ ``_warning``. + """ + + scope_name: str = proto.Field( + proto.STRING, + number=345557398, + optional=True, + ) + warning: "Warning" = proto.Field( + proto.MESSAGE, + number=50704284, + optional=True, + message="Warning", + ) + + class SubnetworksSetPrivateIpGoogleAccessRequest(proto.Message): r""" @@ -111586,6 +115698,63 @@ class TestIamPermissionsInstantSnapshotRequest(proto.Message): ) +class TestIamPermissionsInterconnectAttachmentGroupRequest(proto.Message): + r"""A request message for + InterconnectAttachmentGroups.TestIamPermissions. See the method + description for details. + + Attributes: + project (str): + Project ID for this request. + resource (str): + Name or id of the resource for this request. + test_permissions_request_resource (google.cloud.compute_v1.types.TestPermissionsRequest): + The body resource for this request + """ + + project: str = proto.Field( + proto.STRING, + number=227560217, + ) + resource: str = proto.Field( + proto.STRING, + number=195806222, + ) + test_permissions_request_resource: "TestPermissionsRequest" = proto.Field( + proto.MESSAGE, + number=439214758, + message="TestPermissionsRequest", + ) + + +class TestIamPermissionsInterconnectGroupRequest(proto.Message): + r"""A request message for InterconnectGroups.TestIamPermissions. + See the method description for details. + + Attributes: + project (str): + Project ID for this request. + resource (str): + Name or id of the resource for this request. + test_permissions_request_resource (google.cloud.compute_v1.types.TestPermissionsRequest): + The body resource for this request + """ + + project: str = proto.Field( + proto.STRING, + number=227560217, + ) + resource: str = proto.Field( + proto.STRING, + number=195806222, + ) + test_permissions_request_resource: "TestPermissionsRequest" = proto.Field( + proto.MESSAGE, + number=439214758, + message="TestPermissionsRequest", + ) + + class TestIamPermissionsLicenseCodeRequest(proto.Message): r"""A request message for LicenseCodes.TestIamPermissions. See the method description for details. @@ -113019,6 +117188,70 @@ class MostDisruptiveAllowedAction(proto.Enum): ) +class UpdateLicenseRequest(proto.Message): + r"""A request message for Licenses.Update. See the method + description for details. + + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + license_ (str): + The license name for this request. + license_resource (google.cloud.compute_v1.types.License): + The body resource for this request + project (str): + Project ID for this request. + request_id (str): + An optional request ID to identify requests. + Specify a unique request ID so that if you must + retry your request, the server will know to + ignore the request if it has already been + completed. For example, consider a situation + where you make an initial request and the + request times out. If you make the request again + with the same request ID, the server can check + if original operation with the same request ID + was received, and if so, will ignore the second + request. This prevents clients from accidentally + creating duplicate commitments. The request ID + must be a valid UUID with the exception that + zero UUID is not supported ( + 00000000-0000-0000-0000-000000000000). + + This field is a member of `oneof`_ ``_request_id``. + update_mask (str): + update_mask indicates fields to be updated as part of this + request. + + This field is a member of `oneof`_ ``_update_mask``. + """ + + license_: str = proto.Field( + proto.STRING, + number=166757441, + ) + license_resource: "License" = proto.Field( + proto.MESSAGE, + number=437955148, + message="License", + ) + project: str = proto.Field( + proto.STRING, + number=227560217, + ) + request_id: str = proto.Field( + proto.STRING, + number=37109963, + optional=True, + ) + update_mask: str = proto.Field( + proto.STRING, + number=500079778, + optional=True, + ) + + class UpdateNetworkInterfaceInstanceRequest(proto.Message): r"""A request message for Instances.UpdateNetworkInterface. See the method description for details. @@ -115124,10 +119357,15 @@ class UsableSubnetworksAggregatedList(proto.Message): still should be used to get the next page of results. This field is a member of `oneof`_ ``_next_page_token``. + scoped_warnings (MutableSequence[google.cloud.compute_v1.types.SubnetworksScopedWarning]): + [Output Only] Informational warning messages for failures + encountered from scopes. self_link (str): [Output Only] Server-defined URL for this resource. This field is a member of `oneof`_ ``_self_link``. + unreachables (MutableSequence[str]): + [Output Only] Unreachable resources. warning (google.cloud.compute_v1.types.Warning): [Output Only] Informational warning message. @@ -115158,11 +119396,20 @@ def raw_page(self): number=79797525, optional=True, ) + scoped_warnings: MutableSequence["SubnetworksScopedWarning"] = proto.RepeatedField( + proto.MESSAGE, + number=215878438, + message="SubnetworksScopedWarning", + ) self_link: str = proto.Field( proto.STRING, number=456214797, optional=True, ) + unreachables: MutableSequence[str] = proto.RepeatedField( + proto.STRING, + number=243372063, + ) warning: "Warning" = proto.Field( proto.MESSAGE, number=50704284, diff --git a/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_disks_bulk_set_labels_sync.py b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_disks_bulk_set_labels_sync.py new file mode 100644 index 000000000000..4dfdae7d3b17 --- /dev/null +++ b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_disks_bulk_set_labels_sync.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for BulkSetLabels +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-compute + + +# [START compute_v1_generated_Disks_BulkSetLabels_sync] +# This snippet 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 as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import compute_v1 + + +def sample_bulk_set_labels(): + # Create a client + client = compute_v1.DisksClient() + + # Initialize request argument(s) + request = compute_v1.BulkSetLabelsDiskRequest( + project="project_value", + zone="zone_value", + ) + + # Make the request + response = client.bulk_set_labels(request=request) + + # Handle the response + print(response) + +# [END compute_v1_generated_Disks_BulkSetLabels_sync] diff --git a/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_interconnect_attachment_groups_delete_sync.py b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_interconnect_attachment_groups_delete_sync.py new file mode 100644 index 000000000000..c1286b66ee7f --- /dev/null +++ b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_interconnect_attachment_groups_delete_sync.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for Delete +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-compute + + +# [START compute_v1_generated_InterconnectAttachmentGroups_Delete_sync] +# This snippet 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 as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import compute_v1 + + +def sample_delete(): + # Create a client + client = compute_v1.InterconnectAttachmentGroupsClient() + + # Initialize request argument(s) + request = compute_v1.DeleteInterconnectAttachmentGroupRequest( + interconnect_attachment_group="interconnect_attachment_group_value", + project="project_value", + ) + + # Make the request + response = client.delete(request=request) + + # Handle the response + print(response) + +# [END compute_v1_generated_InterconnectAttachmentGroups_Delete_sync] diff --git a/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_interconnect_attachment_groups_get_iam_policy_sync.py b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_interconnect_attachment_groups_get_iam_policy_sync.py new file mode 100644 index 000000000000..a2216f1f12c3 --- /dev/null +++ b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_interconnect_attachment_groups_get_iam_policy_sync.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetIamPolicy +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-compute + + +# [START compute_v1_generated_InterconnectAttachmentGroups_GetIamPolicy_sync] +# This snippet 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 as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import compute_v1 + + +def sample_get_iam_policy(): + # Create a client + client = compute_v1.InterconnectAttachmentGroupsClient() + + # Initialize request argument(s) + request = compute_v1.GetIamPolicyInterconnectAttachmentGroupRequest( + project="project_value", + resource="resource_value", + ) + + # Make the request + response = client.get_iam_policy(request=request) + + # Handle the response + print(response) + +# [END compute_v1_generated_InterconnectAttachmentGroups_GetIamPolicy_sync] diff --git a/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_interconnect_attachment_groups_get_operational_status_sync.py b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_interconnect_attachment_groups_get_operational_status_sync.py new file mode 100644 index 000000000000..75a5fb1a0311 --- /dev/null +++ b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_interconnect_attachment_groups_get_operational_status_sync.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetOperationalStatus +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-compute + + +# [START compute_v1_generated_InterconnectAttachmentGroups_GetOperationalStatus_sync] +# This snippet 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 as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import compute_v1 + + +def sample_get_operational_status(): + # Create a client + client = compute_v1.InterconnectAttachmentGroupsClient() + + # Initialize request argument(s) + request = compute_v1.GetOperationalStatusInterconnectAttachmentGroupRequest( + interconnect_attachment_group="interconnect_attachment_group_value", + project="project_value", + ) + + # Make the request + response = client.get_operational_status(request=request) + + # Handle the response + print(response) + +# [END compute_v1_generated_InterconnectAttachmentGroups_GetOperationalStatus_sync] diff --git a/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_interconnect_attachment_groups_get_sync.py b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_interconnect_attachment_groups_get_sync.py new file mode 100644 index 000000000000..2b9e8e843130 --- /dev/null +++ b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_interconnect_attachment_groups_get_sync.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for Get +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-compute + + +# [START compute_v1_generated_InterconnectAttachmentGroups_Get_sync] +# This snippet 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 as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import compute_v1 + + +def sample_get(): + # Create a client + client = compute_v1.InterconnectAttachmentGroupsClient() + + # Initialize request argument(s) + request = compute_v1.GetInterconnectAttachmentGroupRequest( + interconnect_attachment_group="interconnect_attachment_group_value", + project="project_value", + ) + + # Make the request + response = client.get(request=request) + + # Handle the response + print(response) + +# [END compute_v1_generated_InterconnectAttachmentGroups_Get_sync] diff --git a/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_interconnect_attachment_groups_insert_sync.py b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_interconnect_attachment_groups_insert_sync.py new file mode 100644 index 000000000000..16fc242d2f8a --- /dev/null +++ b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_interconnect_attachment_groups_insert_sync.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for Insert +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-compute + + +# [START compute_v1_generated_InterconnectAttachmentGroups_Insert_sync] +# This snippet 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 as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import compute_v1 + + +def sample_insert(): + # Create a client + client = compute_v1.InterconnectAttachmentGroupsClient() + + # Initialize request argument(s) + request = compute_v1.InsertInterconnectAttachmentGroupRequest( + project="project_value", + ) + + # Make the request + response = client.insert(request=request) + + # Handle the response + print(response) + +# [END compute_v1_generated_InterconnectAttachmentGroups_Insert_sync] diff --git a/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_interconnect_attachment_groups_list_sync.py b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_interconnect_attachment_groups_list_sync.py new file mode 100644 index 000000000000..d7c05015e061 --- /dev/null +++ b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_interconnect_attachment_groups_list_sync.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for List +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-compute + + +# [START compute_v1_generated_InterconnectAttachmentGroups_List_sync] +# This snippet 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 as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import compute_v1 + + +def sample_list(): + # Create a client + client = compute_v1.InterconnectAttachmentGroupsClient() + + # Initialize request argument(s) + request = compute_v1.ListInterconnectAttachmentGroupsRequest( + project="project_value", + ) + + # Make the request + page_result = client.list(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END compute_v1_generated_InterconnectAttachmentGroups_List_sync] diff --git a/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_interconnect_attachment_groups_patch_sync.py b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_interconnect_attachment_groups_patch_sync.py new file mode 100644 index 000000000000..c966369890c7 --- /dev/null +++ b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_interconnect_attachment_groups_patch_sync.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for Patch +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-compute + + +# [START compute_v1_generated_InterconnectAttachmentGroups_Patch_sync] +# This snippet 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 as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import compute_v1 + + +def sample_patch(): + # Create a client + client = compute_v1.InterconnectAttachmentGroupsClient() + + # Initialize request argument(s) + request = compute_v1.PatchInterconnectAttachmentGroupRequest( + interconnect_attachment_group="interconnect_attachment_group_value", + project="project_value", + ) + + # Make the request + response = client.patch(request=request) + + # Handle the response + print(response) + +# [END compute_v1_generated_InterconnectAttachmentGroups_Patch_sync] diff --git a/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_interconnect_attachment_groups_set_iam_policy_sync.py b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_interconnect_attachment_groups_set_iam_policy_sync.py new file mode 100644 index 000000000000..48981a0be8a8 --- /dev/null +++ b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_interconnect_attachment_groups_set_iam_policy_sync.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for SetIamPolicy +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-compute + + +# [START compute_v1_generated_InterconnectAttachmentGroups_SetIamPolicy_sync] +# This snippet 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 as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import compute_v1 + + +def sample_set_iam_policy(): + # Create a client + client = compute_v1.InterconnectAttachmentGroupsClient() + + # Initialize request argument(s) + request = compute_v1.SetIamPolicyInterconnectAttachmentGroupRequest( + project="project_value", + resource="resource_value", + ) + + # Make the request + response = client.set_iam_policy(request=request) + + # Handle the response + print(response) + +# [END compute_v1_generated_InterconnectAttachmentGroups_SetIamPolicy_sync] diff --git a/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_interconnect_attachment_groups_test_iam_permissions_sync.py b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_interconnect_attachment_groups_test_iam_permissions_sync.py new file mode 100644 index 000000000000..46ffba3c4827 --- /dev/null +++ b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_interconnect_attachment_groups_test_iam_permissions_sync.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for TestIamPermissions +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-compute + + +# [START compute_v1_generated_InterconnectAttachmentGroups_TestIamPermissions_sync] +# This snippet 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 as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import compute_v1 + + +def sample_test_iam_permissions(): + # Create a client + client = compute_v1.InterconnectAttachmentGroupsClient() + + # Initialize request argument(s) + request = compute_v1.TestIamPermissionsInterconnectAttachmentGroupRequest( + project="project_value", + resource="resource_value", + ) + + # Make the request + response = client.test_iam_permissions(request=request) + + # Handle the response + print(response) + +# [END compute_v1_generated_InterconnectAttachmentGroups_TestIamPermissions_sync] diff --git a/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_interconnect_groups_create_members_sync.py b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_interconnect_groups_create_members_sync.py new file mode 100644 index 000000000000..9f5a089f6ba9 --- /dev/null +++ b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_interconnect_groups_create_members_sync.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateMembers +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-compute + + +# [START compute_v1_generated_InterconnectGroups_CreateMembers_sync] +# This snippet 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 as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import compute_v1 + + +def sample_create_members(): + # Create a client + client = compute_v1.InterconnectGroupsClient() + + # Initialize request argument(s) + request = compute_v1.CreateMembersInterconnectGroupRequest( + interconnect_group="interconnect_group_value", + project="project_value", + ) + + # Make the request + response = client.create_members(request=request) + + # Handle the response + print(response) + +# [END compute_v1_generated_InterconnectGroups_CreateMembers_sync] diff --git a/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_interconnect_groups_delete_sync.py b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_interconnect_groups_delete_sync.py new file mode 100644 index 000000000000..67a8058a71a7 --- /dev/null +++ b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_interconnect_groups_delete_sync.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for Delete +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-compute + + +# [START compute_v1_generated_InterconnectGroups_Delete_sync] +# This snippet 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 as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import compute_v1 + + +def sample_delete(): + # Create a client + client = compute_v1.InterconnectGroupsClient() + + # Initialize request argument(s) + request = compute_v1.DeleteInterconnectGroupRequest( + interconnect_group="interconnect_group_value", + project="project_value", + ) + + # Make the request + response = client.delete(request=request) + + # Handle the response + print(response) + +# [END compute_v1_generated_InterconnectGroups_Delete_sync] diff --git a/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_interconnect_groups_get_iam_policy_sync.py b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_interconnect_groups_get_iam_policy_sync.py new file mode 100644 index 000000000000..2ad9eaa60496 --- /dev/null +++ b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_interconnect_groups_get_iam_policy_sync.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetIamPolicy +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-compute + + +# [START compute_v1_generated_InterconnectGroups_GetIamPolicy_sync] +# This snippet 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 as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import compute_v1 + + +def sample_get_iam_policy(): + # Create a client + client = compute_v1.InterconnectGroupsClient() + + # Initialize request argument(s) + request = compute_v1.GetIamPolicyInterconnectGroupRequest( + project="project_value", + resource="resource_value", + ) + + # Make the request + response = client.get_iam_policy(request=request) + + # Handle the response + print(response) + +# [END compute_v1_generated_InterconnectGroups_GetIamPolicy_sync] diff --git a/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_interconnect_groups_get_operational_status_sync.py b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_interconnect_groups_get_operational_status_sync.py new file mode 100644 index 000000000000..136cda22b939 --- /dev/null +++ b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_interconnect_groups_get_operational_status_sync.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetOperationalStatus +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-compute + + +# [START compute_v1_generated_InterconnectGroups_GetOperationalStatus_sync] +# This snippet 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 as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import compute_v1 + + +def sample_get_operational_status(): + # Create a client + client = compute_v1.InterconnectGroupsClient() + + # Initialize request argument(s) + request = compute_v1.GetOperationalStatusInterconnectGroupRequest( + interconnect_group="interconnect_group_value", + project="project_value", + ) + + # Make the request + response = client.get_operational_status(request=request) + + # Handle the response + print(response) + +# [END compute_v1_generated_InterconnectGroups_GetOperationalStatus_sync] diff --git a/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_interconnect_groups_get_sync.py b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_interconnect_groups_get_sync.py new file mode 100644 index 000000000000..32b9f83dcbf3 --- /dev/null +++ b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_interconnect_groups_get_sync.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for Get +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-compute + + +# [START compute_v1_generated_InterconnectGroups_Get_sync] +# This snippet 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 as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import compute_v1 + + +def sample_get(): + # Create a client + client = compute_v1.InterconnectGroupsClient() + + # Initialize request argument(s) + request = compute_v1.GetInterconnectGroupRequest( + interconnect_group="interconnect_group_value", + project="project_value", + ) + + # Make the request + response = client.get(request=request) + + # Handle the response + print(response) + +# [END compute_v1_generated_InterconnectGroups_Get_sync] diff --git a/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_interconnect_groups_insert_sync.py b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_interconnect_groups_insert_sync.py new file mode 100644 index 000000000000..7a422da30cf8 --- /dev/null +++ b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_interconnect_groups_insert_sync.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for Insert +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-compute + + +# [START compute_v1_generated_InterconnectGroups_Insert_sync] +# This snippet 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 as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import compute_v1 + + +def sample_insert(): + # Create a client + client = compute_v1.InterconnectGroupsClient() + + # Initialize request argument(s) + request = compute_v1.InsertInterconnectGroupRequest( + project="project_value", + ) + + # Make the request + response = client.insert(request=request) + + # Handle the response + print(response) + +# [END compute_v1_generated_InterconnectGroups_Insert_sync] diff --git a/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_interconnect_groups_list_sync.py b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_interconnect_groups_list_sync.py new file mode 100644 index 000000000000..5447031ae7eb --- /dev/null +++ b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_interconnect_groups_list_sync.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for List +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-compute + + +# [START compute_v1_generated_InterconnectGroups_List_sync] +# This snippet 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 as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import compute_v1 + + +def sample_list(): + # Create a client + client = compute_v1.InterconnectGroupsClient() + + # Initialize request argument(s) + request = compute_v1.ListInterconnectGroupsRequest( + project="project_value", + ) + + # Make the request + page_result = client.list(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END compute_v1_generated_InterconnectGroups_List_sync] diff --git a/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_interconnect_groups_patch_sync.py b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_interconnect_groups_patch_sync.py new file mode 100644 index 000000000000..ce99f372fc5a --- /dev/null +++ b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_interconnect_groups_patch_sync.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for Patch +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-compute + + +# [START compute_v1_generated_InterconnectGroups_Patch_sync] +# This snippet 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 as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import compute_v1 + + +def sample_patch(): + # Create a client + client = compute_v1.InterconnectGroupsClient() + + # Initialize request argument(s) + request = compute_v1.PatchInterconnectGroupRequest( + interconnect_group="interconnect_group_value", + project="project_value", + ) + + # Make the request + response = client.patch(request=request) + + # Handle the response + print(response) + +# [END compute_v1_generated_InterconnectGroups_Patch_sync] diff --git a/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_interconnect_groups_set_iam_policy_sync.py b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_interconnect_groups_set_iam_policy_sync.py new file mode 100644 index 000000000000..ec7ad4841b04 --- /dev/null +++ b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_interconnect_groups_set_iam_policy_sync.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for SetIamPolicy +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-compute + + +# [START compute_v1_generated_InterconnectGroups_SetIamPolicy_sync] +# This snippet 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 as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import compute_v1 + + +def sample_set_iam_policy(): + # Create a client + client = compute_v1.InterconnectGroupsClient() + + # Initialize request argument(s) + request = compute_v1.SetIamPolicyInterconnectGroupRequest( + project="project_value", + resource="resource_value", + ) + + # Make the request + response = client.set_iam_policy(request=request) + + # Handle the response + print(response) + +# [END compute_v1_generated_InterconnectGroups_SetIamPolicy_sync] diff --git a/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_interconnect_groups_test_iam_permissions_sync.py b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_interconnect_groups_test_iam_permissions_sync.py new file mode 100644 index 000000000000..7a30e2c15583 --- /dev/null +++ b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_interconnect_groups_test_iam_permissions_sync.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for TestIamPermissions +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-compute + + +# [START compute_v1_generated_InterconnectGroups_TestIamPermissions_sync] +# This snippet 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 as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import compute_v1 + + +def sample_test_iam_permissions(): + # Create a client + client = compute_v1.InterconnectGroupsClient() + + # Initialize request argument(s) + request = compute_v1.TestIamPermissionsInterconnectGroupRequest( + project="project_value", + resource="resource_value", + ) + + # Make the request + response = client.test_iam_permissions(request=request) + + # Handle the response + print(response) + +# [END compute_v1_generated_InterconnectGroups_TestIamPermissions_sync] diff --git a/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_licenses_update_sync.py b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_licenses_update_sync.py new file mode 100644 index 000000000000..e75c00741468 --- /dev/null +++ b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_licenses_update_sync.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for Update +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-compute + + +# [START compute_v1_generated_Licenses_Update_sync] +# This snippet 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 as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import compute_v1 + + +def sample_update(): + # Create a client + client = compute_v1.LicensesClient() + + # Initialize request argument(s) + request = compute_v1.UpdateLicenseRequest( + license_="license__value", + project="project_value", + ) + + # Make the request + response = client.update(request=request) + + # Handle the response + print(response) + +# [END compute_v1_generated_Licenses_Update_sync] diff --git a/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_reservation_sub_blocks_get_sync.py b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_reservation_sub_blocks_get_sync.py new file mode 100644 index 000000000000..1287da40ed69 --- /dev/null +++ b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_reservation_sub_blocks_get_sync.py @@ -0,0 +1,55 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for Get +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-compute + + +# [START compute_v1_generated_ReservationSubBlocks_Get_sync] +# This snippet 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 as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import compute_v1 + + +def sample_get(): + # Create a client + client = compute_v1.ReservationSubBlocksClient() + + # Initialize request argument(s) + request = compute_v1.GetReservationSubBlockRequest( + parent_name="parent_name_value", + project="project_value", + reservation_sub_block="reservation_sub_block_value", + zone="zone_value", + ) + + # Make the request + response = client.get(request=request) + + # Handle the response + print(response) + +# [END compute_v1_generated_ReservationSubBlocks_Get_sync] diff --git a/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_reservation_sub_blocks_list_sync.py b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_reservation_sub_blocks_list_sync.py new file mode 100644 index 000000000000..d4cf38e08fbd --- /dev/null +++ b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_reservation_sub_blocks_list_sync.py @@ -0,0 +1,55 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for List +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-compute + + +# [START compute_v1_generated_ReservationSubBlocks_List_sync] +# This snippet 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 as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import compute_v1 + + +def sample_list(): + # Create a client + client = compute_v1.ReservationSubBlocksClient() + + # Initialize request argument(s) + request = compute_v1.ListReservationSubBlocksRequest( + parent_name="parent_name_value", + project="project_value", + zone="zone_value", + ) + + # Make the request + page_result = client.list(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END compute_v1_generated_ReservationSubBlocks_List_sync] diff --git a/packages/google-cloud-compute/samples/generated_samples/snippet_metadata_google.cloud.compute.v1.json b/packages/google-cloud-compute/samples/generated_samples/snippet_metadata_google.cloud.compute.v1.json index 2d34417e8b5e..410a22155f76 100644 --- a/packages/google-cloud-compute/samples/generated_samples/snippet_metadata_google.cloud.compute.v1.json +++ b/packages/google-cloud-compute/samples/generated_samples/snippet_metadata_google.cloud.compute.v1.json @@ -4391,6 +4391,94 @@ ], "title": "compute_v1_generated_disks_bulk_insert_sync.py" }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.compute_v1.DisksClient", + "shortName": "DisksClient" + }, + "fullName": "google.cloud.compute_v1.DisksClient.bulk_set_labels", + "method": { + "fullName": "google.cloud.compute.v1.Disks.BulkSetLabels", + "service": { + "fullName": "google.cloud.compute.v1.Disks", + "shortName": "Disks" + }, + "shortName": "BulkSetLabels" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.compute_v1.types.BulkSetLabelsDiskRequest" + }, + { + "name": "project", + "type": "str" + }, + { + "name": "zone", + "type": "str" + }, + { + "name": "bulk_zone_set_labels_request_resource", + "type": "google.cloud.compute_v1.types.BulkZoneSetLabelsRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "bulk_set_labels" + }, + "description": "Sample for BulkSetLabels", + "file": "compute_v1_generated_disks_bulk_set_labels_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "compute_v1_generated_Disks_BulkSetLabels_sync", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 46, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 49, + "start": 47, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "compute_v1_generated_disks_bulk_set_labels_sync.py" + }, { "canonical": true, "clientMethod": { @@ -22791,113 +22879,29 @@ "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.InterconnectAttachmentsClient", - "shortName": "InterconnectAttachmentsClient" + "fullName": "google.cloud.compute_v1.InterconnectAttachmentGroupsClient", + "shortName": "InterconnectAttachmentGroupsClient" }, - "fullName": "google.cloud.compute_v1.InterconnectAttachmentsClient.aggregated_list", + "fullName": "google.cloud.compute_v1.InterconnectAttachmentGroupsClient.delete", "method": { - "fullName": "google.cloud.compute.v1.InterconnectAttachments.AggregatedList", + "fullName": "google.cloud.compute.v1.InterconnectAttachmentGroups.Delete", "service": { - "fullName": "google.cloud.compute.v1.InterconnectAttachments", - "shortName": "InterconnectAttachments" - }, - "shortName": "AggregatedList" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.compute_v1.types.AggregatedListInterconnectAttachmentsRequest" - }, - { - "name": "project", - "type": "str" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, Union[str, bytes]]]" - } - ], - "resultType": "google.cloud.compute_v1.services.interconnect_attachments.pagers.AggregatedListPager", - "shortName": "aggregated_list" - }, - "description": "Sample for AggregatedList", - "file": "compute_v1_generated_interconnect_attachments_aggregated_list_sync.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_InterconnectAttachments_AggregatedList_sync", - "segments": [ - { - "end": 52, - "start": 27, - "type": "FULL" - }, - { - "end": 52, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 45, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 48, - "start": 46, - "type": "REQUEST_EXECUTION" - }, - { - "end": 53, - "start": 49, - "type": "RESPONSE_HANDLING" - } - ], - "title": "compute_v1_generated_interconnect_attachments_aggregated_list_sync.py" - }, - { - "canonical": true, - "clientMethod": { - "client": { - "fullName": "google.cloud.compute_v1.InterconnectAttachmentsClient", - "shortName": "InterconnectAttachmentsClient" - }, - "fullName": "google.cloud.compute_v1.InterconnectAttachmentsClient.delete", - "method": { - "fullName": "google.cloud.compute.v1.InterconnectAttachments.Delete", - "service": { - "fullName": "google.cloud.compute.v1.InterconnectAttachments", - "shortName": "InterconnectAttachments" + "fullName": "google.cloud.compute.v1.InterconnectAttachmentGroups", + "shortName": "InterconnectAttachmentGroups" }, "shortName": "Delete" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.DeleteInterconnectAttachmentRequest" + "type": "google.cloud.compute_v1.types.DeleteInterconnectAttachmentGroupRequest" }, { "name": "project", "type": "str" }, { - "name": "region", - "type": "str" - }, - { - "name": "interconnect_attachment", + "name": "interconnect_attachment_group", "type": "str" }, { @@ -22917,18 +22921,18 @@ "shortName": "delete" }, "description": "Sample for Delete", - "file": "compute_v1_generated_interconnect_attachments_delete_sync.py", + "file": "compute_v1_generated_interconnect_attachment_groups_delete_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_InterconnectAttachments_Delete_sync", + "regionTag": "compute_v1_generated_InterconnectAttachmentGroups_Delete_sync", "segments": [ { - "end": 53, + "end": 52, "start": 27, "type": "FULL" }, { - "end": 53, + "end": 52, "start": 27, "type": "SHORT" }, @@ -22938,144 +22942,52 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 47, + "end": 46, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 50, - "start": 48, + "end": 49, + "start": 47, "type": "REQUEST_EXECUTION" }, - { - "end": 54, - "start": 51, - "type": "RESPONSE_HANDLING" - } - ], - "title": "compute_v1_generated_interconnect_attachments_delete_sync.py" - }, - { - "canonical": true, - "clientMethod": { - "client": { - "fullName": "google.cloud.compute_v1.InterconnectAttachmentsClient", - "shortName": "InterconnectAttachmentsClient" - }, - "fullName": "google.cloud.compute_v1.InterconnectAttachmentsClient.get", - "method": { - "fullName": "google.cloud.compute.v1.InterconnectAttachments.Get", - "service": { - "fullName": "google.cloud.compute.v1.InterconnectAttachments", - "shortName": "InterconnectAttachments" - }, - "shortName": "Get" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.compute_v1.types.GetInterconnectAttachmentRequest" - }, - { - "name": "project", - "type": "str" - }, - { - "name": "region", - "type": "str" - }, - { - "name": "interconnect_attachment", - "type": "str" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, Union[str, bytes]]]" - } - ], - "resultType": "google.cloud.compute_v1.types.InterconnectAttachment", - "shortName": "get" - }, - "description": "Sample for Get", - "file": "compute_v1_generated_interconnect_attachments_get_sync.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_InterconnectAttachments_Get_sync", - "segments": [ { "end": 53, - "start": 27, - "type": "FULL" - }, - { - "end": 53, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 47, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 50, - "start": 48, - "type": "REQUEST_EXECUTION" - }, - { - "end": 54, - "start": 51, + "start": 50, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_interconnect_attachments_get_sync.py" + "title": "compute_v1_generated_interconnect_attachment_groups_delete_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.InterconnectAttachmentsClient", - "shortName": "InterconnectAttachmentsClient" + "fullName": "google.cloud.compute_v1.InterconnectAttachmentGroupsClient", + "shortName": "InterconnectAttachmentGroupsClient" }, - "fullName": "google.cloud.compute_v1.InterconnectAttachmentsClient.insert", + "fullName": "google.cloud.compute_v1.InterconnectAttachmentGroupsClient.get_iam_policy", "method": { - "fullName": "google.cloud.compute.v1.InterconnectAttachments.Insert", + "fullName": "google.cloud.compute.v1.InterconnectAttachmentGroups.GetIamPolicy", "service": { - "fullName": "google.cloud.compute.v1.InterconnectAttachments", - "shortName": "InterconnectAttachments" + "fullName": "google.cloud.compute.v1.InterconnectAttachmentGroups", + "shortName": "InterconnectAttachmentGroups" }, - "shortName": "Insert" + "shortName": "GetIamPolicy" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.InsertInterconnectAttachmentRequest" + "type": "google.cloud.compute_v1.types.GetIamPolicyInterconnectAttachmentGroupRequest" }, { "name": "project", "type": "str" }, { - "name": "region", + "name": "resource", "type": "str" }, - { - "name": "interconnect_attachment_resource", - "type": "google.cloud.compute_v1.types.InterconnectAttachment" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -23089,14 +23001,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "insert" + "resultType": "google.cloud.compute_v1.types.Policy", + "shortName": "get_iam_policy" }, - "description": "Sample for Insert", - "file": "compute_v1_generated_interconnect_attachments_insert_sync.py", + "description": "Sample for GetIamPolicy", + "file": "compute_v1_generated_interconnect_attachment_groups_get_iam_policy_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_InterconnectAttachments_Insert_sync", + "regionTag": "compute_v1_generated_InterconnectAttachmentGroups_GetIamPolicy_sync", "segments": [ { "end": 52, @@ -23129,35 +23041,35 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_interconnect_attachments_insert_sync.py" + "title": "compute_v1_generated_interconnect_attachment_groups_get_iam_policy_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.InterconnectAttachmentsClient", - "shortName": "InterconnectAttachmentsClient" + "fullName": "google.cloud.compute_v1.InterconnectAttachmentGroupsClient", + "shortName": "InterconnectAttachmentGroupsClient" }, - "fullName": "google.cloud.compute_v1.InterconnectAttachmentsClient.list", + "fullName": "google.cloud.compute_v1.InterconnectAttachmentGroupsClient.get_operational_status", "method": { - "fullName": "google.cloud.compute.v1.InterconnectAttachments.List", + "fullName": "google.cloud.compute.v1.InterconnectAttachmentGroups.GetOperationalStatus", "service": { - "fullName": "google.cloud.compute.v1.InterconnectAttachments", - "shortName": "InterconnectAttachments" + "fullName": "google.cloud.compute.v1.InterconnectAttachmentGroups", + "shortName": "InterconnectAttachmentGroups" }, - "shortName": "List" + "shortName": "GetOperationalStatus" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.ListInterconnectAttachmentsRequest" + "type": "google.cloud.compute_v1.types.GetOperationalStatusInterconnectAttachmentGroupRequest" }, { "name": "project", "type": "str" }, { - "name": "region", + "name": "interconnect_attachment_group", "type": "str" }, { @@ -23173,22 +23085,22 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.services.interconnect_attachments.pagers.ListPager", - "shortName": "list" + "resultType": "google.cloud.compute_v1.types.InterconnectAttachmentGroupsGetOperationalStatusResponse", + "shortName": "get_operational_status" }, - "description": "Sample for List", - "file": "compute_v1_generated_interconnect_attachments_list_sync.py", + "description": "Sample for GetOperationalStatus", + "file": "compute_v1_generated_interconnect_attachment_groups_get_operational_status_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_InterconnectAttachments_List_sync", + "regionTag": "compute_v1_generated_InterconnectAttachmentGroups_GetOperationalStatus_sync", "segments": [ { - "end": 53, + "end": 52, "start": 27, "type": "FULL" }, { - "end": 53, + "end": 52, "start": 27, "type": "SHORT" }, @@ -23208,50 +23120,42 @@ "type": "REQUEST_EXECUTION" }, { - "end": 54, + "end": 53, "start": 50, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_interconnect_attachments_list_sync.py" + "title": "compute_v1_generated_interconnect_attachment_groups_get_operational_status_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.InterconnectAttachmentsClient", - "shortName": "InterconnectAttachmentsClient" + "fullName": "google.cloud.compute_v1.InterconnectAttachmentGroupsClient", + "shortName": "InterconnectAttachmentGroupsClient" }, - "fullName": "google.cloud.compute_v1.InterconnectAttachmentsClient.patch", + "fullName": "google.cloud.compute_v1.InterconnectAttachmentGroupsClient.get", "method": { - "fullName": "google.cloud.compute.v1.InterconnectAttachments.Patch", + "fullName": "google.cloud.compute.v1.InterconnectAttachmentGroups.Get", "service": { - "fullName": "google.cloud.compute.v1.InterconnectAttachments", - "shortName": "InterconnectAttachments" + "fullName": "google.cloud.compute.v1.InterconnectAttachmentGroups", + "shortName": "InterconnectAttachmentGroups" }, - "shortName": "Patch" + "shortName": "Get" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.PatchInterconnectAttachmentRequest" + "type": "google.cloud.compute_v1.types.GetInterconnectAttachmentGroupRequest" }, { "name": "project", "type": "str" }, { - "name": "region", - "type": "str" - }, - { - "name": "interconnect_attachment", + "name": "interconnect_attachment_group", "type": "str" }, - { - "name": "interconnect_attachment_resource", - "type": "google.cloud.compute_v1.types.InterconnectAttachment" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -23265,22 +23169,22 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "patch" + "resultType": "google.cloud.compute_v1.types.InterconnectAttachmentGroup", + "shortName": "get" }, - "description": "Sample for Patch", - "file": "compute_v1_generated_interconnect_attachments_patch_sync.py", + "description": "Sample for Get", + "file": "compute_v1_generated_interconnect_attachment_groups_get_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_InterconnectAttachments_Patch_sync", + "regionTag": "compute_v1_generated_InterconnectAttachmentGroups_Get_sync", "segments": [ { - "end": 53, + "end": 52, "start": 27, "type": "FULL" }, { - "end": 53, + "end": 52, "start": 27, "type": "SHORT" }, @@ -23290,59 +23194,131 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 47, + "end": 46, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 50, - "start": 48, + "end": 49, + "start": 47, "type": "REQUEST_EXECUTION" }, { - "end": 54, - "start": 51, + "end": 53, + "start": 50, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_interconnect_attachments_patch_sync.py" + "title": "compute_v1_generated_interconnect_attachment_groups_get_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.InterconnectAttachmentsClient", - "shortName": "InterconnectAttachmentsClient" + "fullName": "google.cloud.compute_v1.InterconnectAttachmentGroupsClient", + "shortName": "InterconnectAttachmentGroupsClient" }, - "fullName": "google.cloud.compute_v1.InterconnectAttachmentsClient.set_labels", + "fullName": "google.cloud.compute_v1.InterconnectAttachmentGroupsClient.insert", "method": { - "fullName": "google.cloud.compute.v1.InterconnectAttachments.SetLabels", + "fullName": "google.cloud.compute.v1.InterconnectAttachmentGroups.Insert", "service": { - "fullName": "google.cloud.compute.v1.InterconnectAttachments", - "shortName": "InterconnectAttachments" + "fullName": "google.cloud.compute.v1.InterconnectAttachmentGroups", + "shortName": "InterconnectAttachmentGroups" }, - "shortName": "SetLabels" + "shortName": "Insert" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.SetLabelsInterconnectAttachmentRequest" + "type": "google.cloud.compute_v1.types.InsertInterconnectAttachmentGroupRequest" }, { "name": "project", "type": "str" }, { - "name": "region", - "type": "str" + "name": "interconnect_attachment_group_resource", + "type": "google.cloud.compute_v1.types.InterconnectAttachmentGroup" }, { - "name": "resource", - "type": "str" + "name": "retry", + "type": "google.api_core.retry.Retry" }, { - "name": "region_set_labels_request_resource", - "type": "google.cloud.compute_v1.types.RegionSetLabelsRequest" + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "insert" + }, + "description": "Sample for Insert", + "file": "compute_v1_generated_interconnect_attachment_groups_insert_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "compute_v1_generated_InterconnectAttachmentGroups_Insert_sync", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "compute_v1_generated_interconnect_attachment_groups_insert_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.compute_v1.InterconnectAttachmentGroupsClient", + "shortName": "InterconnectAttachmentGroupsClient" + }, + "fullName": "google.cloud.compute_v1.InterconnectAttachmentGroupsClient.list", + "method": { + "fullName": "google.cloud.compute.v1.InterconnectAttachmentGroups.List", + "service": { + "fullName": "google.cloud.compute.v1.InterconnectAttachmentGroups", + "shortName": "InterconnectAttachmentGroups" + }, + "shortName": "List" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.compute_v1.types.ListInterconnectAttachmentGroupsRequest" + }, + { + "name": "project", + "type": "str" }, { "name": "retry", @@ -23357,22 +23333,22 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "set_labels" + "resultType": "google.cloud.compute_v1.services.interconnect_attachment_groups.pagers.ListPager", + "shortName": "list" }, - "description": "Sample for SetLabels", - "file": "compute_v1_generated_interconnect_attachments_set_labels_sync.py", + "description": "Sample for List", + "file": "compute_v1_generated_interconnect_attachment_groups_list_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_InterconnectAttachments_SetLabels_sync", + "regionTag": "compute_v1_generated_InterconnectAttachmentGroups_List_sync", "segments": [ { - "end": 53, + "end": 52, "start": 27, "type": "FULL" }, { - "end": 53, + "end": 52, "start": 27, "type": "SHORT" }, @@ -23382,52 +23358,56 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 47, + "end": 45, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 50, - "start": 48, + "end": 48, + "start": 46, "type": "REQUEST_EXECUTION" }, { - "end": 54, - "start": 51, + "end": 53, + "start": 49, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_interconnect_attachments_set_labels_sync.py" + "title": "compute_v1_generated_interconnect_attachment_groups_list_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.InterconnectLocationsClient", - "shortName": "InterconnectLocationsClient" + "fullName": "google.cloud.compute_v1.InterconnectAttachmentGroupsClient", + "shortName": "InterconnectAttachmentGroupsClient" }, - "fullName": "google.cloud.compute_v1.InterconnectLocationsClient.get", + "fullName": "google.cloud.compute_v1.InterconnectAttachmentGroupsClient.patch", "method": { - "fullName": "google.cloud.compute.v1.InterconnectLocations.Get", + "fullName": "google.cloud.compute.v1.InterconnectAttachmentGroups.Patch", "service": { - "fullName": "google.cloud.compute.v1.InterconnectLocations", - "shortName": "InterconnectLocations" + "fullName": "google.cloud.compute.v1.InterconnectAttachmentGroups", + "shortName": "InterconnectAttachmentGroups" }, - "shortName": "Get" + "shortName": "Patch" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetInterconnectLocationRequest" + "type": "google.cloud.compute_v1.types.PatchInterconnectAttachmentGroupRequest" }, { "name": "project", "type": "str" }, { - "name": "interconnect_location", + "name": "interconnect_attachment_group", "type": "str" }, + { + "name": "interconnect_attachment_group_resource", + "type": "google.cloud.compute_v1.types.InterconnectAttachmentGroup" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -23441,14 +23421,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.InterconnectLocation", - "shortName": "get" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "patch" }, - "description": "Sample for Get", - "file": "compute_v1_generated_interconnect_locations_get_sync.py", + "description": "Sample for Patch", + "file": "compute_v1_generated_interconnect_attachment_groups_patch_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_InterconnectLocations_Get_sync", + "regionTag": "compute_v1_generated_InterconnectAttachmentGroups_Patch_sync", "segments": [ { "end": 52, @@ -23481,33 +23461,41 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_interconnect_locations_get_sync.py" + "title": "compute_v1_generated_interconnect_attachment_groups_patch_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.InterconnectLocationsClient", - "shortName": "InterconnectLocationsClient" + "fullName": "google.cloud.compute_v1.InterconnectAttachmentGroupsClient", + "shortName": "InterconnectAttachmentGroupsClient" }, - "fullName": "google.cloud.compute_v1.InterconnectLocationsClient.list", + "fullName": "google.cloud.compute_v1.InterconnectAttachmentGroupsClient.set_iam_policy", "method": { - "fullName": "google.cloud.compute.v1.InterconnectLocations.List", + "fullName": "google.cloud.compute.v1.InterconnectAttachmentGroups.SetIamPolicy", "service": { - "fullName": "google.cloud.compute.v1.InterconnectLocations", - "shortName": "InterconnectLocations" + "fullName": "google.cloud.compute.v1.InterconnectAttachmentGroups", + "shortName": "InterconnectAttachmentGroups" }, - "shortName": "List" + "shortName": "SetIamPolicy" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.ListInterconnectLocationsRequest" + "type": "google.cloud.compute_v1.types.SetIamPolicyInterconnectAttachmentGroupRequest" }, { "name": "project", "type": "str" }, + { + "name": "resource", + "type": "str" + }, + { + "name": "global_set_policy_request_resource", + "type": "google.cloud.compute_v1.types.GlobalSetPolicyRequest" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -23521,14 +23509,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.services.interconnect_locations.pagers.ListPager", - "shortName": "list" + "resultType": "google.cloud.compute_v1.types.Policy", + "shortName": "set_iam_policy" }, - "description": "Sample for List", - "file": "compute_v1_generated_interconnect_locations_list_sync.py", + "description": "Sample for SetIamPolicy", + "file": "compute_v1_generated_interconnect_attachment_groups_set_iam_policy_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_InterconnectLocations_List_sync", + "regionTag": "compute_v1_generated_InterconnectAttachmentGroups_SetIamPolicy_sync", "segments": [ { "end": 52, @@ -23546,52 +23534,56 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 45, + "end": 46, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 48, - "start": 46, + "end": 49, + "start": 47, "type": "REQUEST_EXECUTION" }, { "end": 53, - "start": 49, + "start": 50, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_interconnect_locations_list_sync.py" + "title": "compute_v1_generated_interconnect_attachment_groups_set_iam_policy_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.InterconnectRemoteLocationsClient", - "shortName": "InterconnectRemoteLocationsClient" + "fullName": "google.cloud.compute_v1.InterconnectAttachmentGroupsClient", + "shortName": "InterconnectAttachmentGroupsClient" }, - "fullName": "google.cloud.compute_v1.InterconnectRemoteLocationsClient.get", + "fullName": "google.cloud.compute_v1.InterconnectAttachmentGroupsClient.test_iam_permissions", "method": { - "fullName": "google.cloud.compute.v1.InterconnectRemoteLocations.Get", + "fullName": "google.cloud.compute.v1.InterconnectAttachmentGroups.TestIamPermissions", "service": { - "fullName": "google.cloud.compute.v1.InterconnectRemoteLocations", - "shortName": "InterconnectRemoteLocations" + "fullName": "google.cloud.compute.v1.InterconnectAttachmentGroups", + "shortName": "InterconnectAttachmentGroups" }, - "shortName": "Get" + "shortName": "TestIamPermissions" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetInterconnectRemoteLocationRequest" + "type": "google.cloud.compute_v1.types.TestIamPermissionsInterconnectAttachmentGroupRequest" }, { "name": "project", "type": "str" }, { - "name": "interconnect_remote_location", + "name": "resource", "type": "str" }, + { + "name": "test_permissions_request_resource", + "type": "google.cloud.compute_v1.types.TestPermissionsRequest" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -23605,14 +23597,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.InterconnectRemoteLocation", - "shortName": "get" + "resultType": "google.cloud.compute_v1.types.TestPermissionsResponse", + "shortName": "test_iam_permissions" }, - "description": "Sample for Get", - "file": "compute_v1_generated_interconnect_remote_locations_get_sync.py", + "description": "Sample for TestIamPermissions", + "file": "compute_v1_generated_interconnect_attachment_groups_test_iam_permissions_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_InterconnectRemoteLocations_Get_sync", + "regionTag": "compute_v1_generated_InterconnectAttachmentGroups_TestIamPermissions_sync", "segments": [ { "end": 52, @@ -23645,28 +23637,28 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_interconnect_remote_locations_get_sync.py" + "title": "compute_v1_generated_interconnect_attachment_groups_test_iam_permissions_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.InterconnectRemoteLocationsClient", - "shortName": "InterconnectRemoteLocationsClient" + "fullName": "google.cloud.compute_v1.InterconnectAttachmentsClient", + "shortName": "InterconnectAttachmentsClient" }, - "fullName": "google.cloud.compute_v1.InterconnectRemoteLocationsClient.list", + "fullName": "google.cloud.compute_v1.InterconnectAttachmentsClient.aggregated_list", "method": { - "fullName": "google.cloud.compute.v1.InterconnectRemoteLocations.List", + "fullName": "google.cloud.compute.v1.InterconnectAttachments.AggregatedList", "service": { - "fullName": "google.cloud.compute.v1.InterconnectRemoteLocations", - "shortName": "InterconnectRemoteLocations" + "fullName": "google.cloud.compute.v1.InterconnectAttachments", + "shortName": "InterconnectAttachments" }, - "shortName": "List" + "shortName": "AggregatedList" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.ListInterconnectRemoteLocationsRequest" + "type": "google.cloud.compute_v1.types.AggregatedListInterconnectAttachmentsRequest" }, { "name": "project", @@ -23685,14 +23677,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.services.interconnect_remote_locations.pagers.ListPager", - "shortName": "list" + "resultType": "google.cloud.compute_v1.services.interconnect_attachments.pagers.AggregatedListPager", + "shortName": "aggregated_list" }, - "description": "Sample for List", - "file": "compute_v1_generated_interconnect_remote_locations_list_sync.py", + "description": "Sample for AggregatedList", + "file": "compute_v1_generated_interconnect_attachments_aggregated_list_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_InterconnectRemoteLocations_List_sync", + "regionTag": "compute_v1_generated_InterconnectAttachments_AggregatedList_sync", "segments": [ { "end": 52, @@ -23725,35 +23717,39 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_interconnect_remote_locations_list_sync.py" + "title": "compute_v1_generated_interconnect_attachments_aggregated_list_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.InterconnectsClient", - "shortName": "InterconnectsClient" + "fullName": "google.cloud.compute_v1.InterconnectAttachmentsClient", + "shortName": "InterconnectAttachmentsClient" }, - "fullName": "google.cloud.compute_v1.InterconnectsClient.delete", + "fullName": "google.cloud.compute_v1.InterconnectAttachmentsClient.delete", "method": { - "fullName": "google.cloud.compute.v1.Interconnects.Delete", + "fullName": "google.cloud.compute.v1.InterconnectAttachments.Delete", "service": { - "fullName": "google.cloud.compute.v1.Interconnects", - "shortName": "Interconnects" + "fullName": "google.cloud.compute.v1.InterconnectAttachments", + "shortName": "InterconnectAttachments" }, "shortName": "Delete" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.DeleteInterconnectRequest" + "type": "google.cloud.compute_v1.types.DeleteInterconnectAttachmentRequest" }, { "name": "project", "type": "str" }, { - "name": "interconnect", + "name": "region", + "type": "str" + }, + { + "name": "interconnect_attachment", "type": "str" }, { @@ -23773,18 +23769,18 @@ "shortName": "delete" }, "description": "Sample for Delete", - "file": "compute_v1_generated_interconnects_delete_sync.py", + "file": "compute_v1_generated_interconnect_attachments_delete_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_Interconnects_Delete_sync", + "regionTag": "compute_v1_generated_InterconnectAttachments_Delete_sync", "segments": [ { - "end": 52, + "end": 53, "start": 27, "type": "FULL" }, { - "end": 52, + "end": 53, "start": 27, "type": "SHORT" }, @@ -23794,50 +23790,54 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 46, + "end": 47, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 49, - "start": 47, + "end": 50, + "start": 48, "type": "REQUEST_EXECUTION" }, { - "end": 53, - "start": 50, + "end": 54, + "start": 51, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_interconnects_delete_sync.py" + "title": "compute_v1_generated_interconnect_attachments_delete_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.InterconnectsClient", - "shortName": "InterconnectsClient" + "fullName": "google.cloud.compute_v1.InterconnectAttachmentsClient", + "shortName": "InterconnectAttachmentsClient" }, - "fullName": "google.cloud.compute_v1.InterconnectsClient.get_diagnostics", + "fullName": "google.cloud.compute_v1.InterconnectAttachmentsClient.get", "method": { - "fullName": "google.cloud.compute.v1.Interconnects.GetDiagnostics", + "fullName": "google.cloud.compute.v1.InterconnectAttachments.Get", "service": { - "fullName": "google.cloud.compute.v1.Interconnects", - "shortName": "Interconnects" + "fullName": "google.cloud.compute.v1.InterconnectAttachments", + "shortName": "InterconnectAttachments" }, - "shortName": "GetDiagnostics" + "shortName": "Get" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetDiagnosticsInterconnectRequest" + "type": "google.cloud.compute_v1.types.GetInterconnectAttachmentRequest" }, { "name": "project", "type": "str" }, { - "name": "interconnect", + "name": "region", + "type": "str" + }, + { + "name": "interconnect_attachment", "type": "str" }, { @@ -23853,22 +23853,22 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.InterconnectsGetDiagnosticsResponse", - "shortName": "get_diagnostics" + "resultType": "google.cloud.compute_v1.types.InterconnectAttachment", + "shortName": "get" }, - "description": "Sample for GetDiagnostics", - "file": "compute_v1_generated_interconnects_get_diagnostics_sync.py", + "description": "Sample for Get", + "file": "compute_v1_generated_interconnect_attachments_get_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_Interconnects_GetDiagnostics_sync", + "regionTag": "compute_v1_generated_InterconnectAttachments_Get_sync", "segments": [ { - "end": 52, + "end": 53, "start": 27, "type": "FULL" }, { - "end": 52, + "end": 53, "start": 27, "type": "SHORT" }, @@ -23878,52 +23878,56 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 46, + "end": 47, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 49, - "start": 47, + "end": 50, + "start": 48, "type": "REQUEST_EXECUTION" }, { - "end": 53, - "start": 50, + "end": 54, + "start": 51, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_interconnects_get_diagnostics_sync.py" + "title": "compute_v1_generated_interconnect_attachments_get_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.InterconnectsClient", - "shortName": "InterconnectsClient" + "fullName": "google.cloud.compute_v1.InterconnectAttachmentsClient", + "shortName": "InterconnectAttachmentsClient" }, - "fullName": "google.cloud.compute_v1.InterconnectsClient.get_macsec_config", + "fullName": "google.cloud.compute_v1.InterconnectAttachmentsClient.insert", "method": { - "fullName": "google.cloud.compute.v1.Interconnects.GetMacsecConfig", + "fullName": "google.cloud.compute.v1.InterconnectAttachments.Insert", "service": { - "fullName": "google.cloud.compute.v1.Interconnects", - "shortName": "Interconnects" + "fullName": "google.cloud.compute.v1.InterconnectAttachments", + "shortName": "InterconnectAttachments" }, - "shortName": "GetMacsecConfig" + "shortName": "Insert" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetMacsecConfigInterconnectRequest" + "type": "google.cloud.compute_v1.types.InsertInterconnectAttachmentRequest" }, { "name": "project", "type": "str" }, { - "name": "interconnect", + "name": "region", "type": "str" }, + { + "name": "interconnect_attachment_resource", + "type": "google.cloud.compute_v1.types.InterconnectAttachment" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -23937,14 +23941,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.InterconnectsGetMacsecConfigResponse", - "shortName": "get_macsec_config" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "insert" }, - "description": "Sample for GetMacsecConfig", - "file": "compute_v1_generated_interconnects_get_macsec_config_sync.py", + "description": "Sample for Insert", + "file": "compute_v1_generated_interconnect_attachments_insert_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_Interconnects_GetMacsecConfig_sync", + "regionTag": "compute_v1_generated_InterconnectAttachments_Insert_sync", "segments": [ { "end": 52, @@ -23977,35 +23981,35 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_interconnects_get_macsec_config_sync.py" + "title": "compute_v1_generated_interconnect_attachments_insert_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.InterconnectsClient", - "shortName": "InterconnectsClient" + "fullName": "google.cloud.compute_v1.InterconnectAttachmentsClient", + "shortName": "InterconnectAttachmentsClient" }, - "fullName": "google.cloud.compute_v1.InterconnectsClient.get", + "fullName": "google.cloud.compute_v1.InterconnectAttachmentsClient.list", "method": { - "fullName": "google.cloud.compute.v1.Interconnects.Get", + "fullName": "google.cloud.compute.v1.InterconnectAttachments.List", "service": { - "fullName": "google.cloud.compute.v1.Interconnects", - "shortName": "Interconnects" + "fullName": "google.cloud.compute.v1.InterconnectAttachments", + "shortName": "InterconnectAttachments" }, - "shortName": "Get" + "shortName": "List" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetInterconnectRequest" + "type": "google.cloud.compute_v1.types.ListInterconnectAttachmentsRequest" }, { "name": "project", "type": "str" }, { - "name": "interconnect", + "name": "region", "type": "str" }, { @@ -24021,22 +24025,22 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.Interconnect", - "shortName": "get" + "resultType": "google.cloud.compute_v1.services.interconnect_attachments.pagers.ListPager", + "shortName": "list" }, - "description": "Sample for Get", - "file": "compute_v1_generated_interconnects_get_sync.py", + "description": "Sample for List", + "file": "compute_v1_generated_interconnect_attachments_list_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_Interconnects_Get_sync", + "regionTag": "compute_v1_generated_InterconnectAttachments_List_sync", "segments": [ { - "end": 52, + "end": 53, "start": 27, "type": "FULL" }, { - "end": 52, + "end": 53, "start": 27, "type": "SHORT" }, @@ -24056,41 +24060,49 @@ "type": "REQUEST_EXECUTION" }, { - "end": 53, + "end": 54, "start": 50, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_interconnects_get_sync.py" + "title": "compute_v1_generated_interconnect_attachments_list_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.InterconnectsClient", - "shortName": "InterconnectsClient" + "fullName": "google.cloud.compute_v1.InterconnectAttachmentsClient", + "shortName": "InterconnectAttachmentsClient" }, - "fullName": "google.cloud.compute_v1.InterconnectsClient.insert", + "fullName": "google.cloud.compute_v1.InterconnectAttachmentsClient.patch", "method": { - "fullName": "google.cloud.compute.v1.Interconnects.Insert", + "fullName": "google.cloud.compute.v1.InterconnectAttachments.Patch", "service": { - "fullName": "google.cloud.compute.v1.Interconnects", - "shortName": "Interconnects" + "fullName": "google.cloud.compute.v1.InterconnectAttachments", + "shortName": "InterconnectAttachments" }, - "shortName": "Insert" + "shortName": "Patch" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.InsertInterconnectRequest" + "type": "google.cloud.compute_v1.types.PatchInterconnectAttachmentRequest" }, { "name": "project", "type": "str" }, { - "name": "interconnect_resource", - "type": "google.cloud.compute_v1.types.Interconnect" + "name": "region", + "type": "str" + }, + { + "name": "interconnect_attachment", + "type": "str" + }, + { + "name": "interconnect_attachment_resource", + "type": "google.cloud.compute_v1.types.InterconnectAttachment" }, { "name": "retry", @@ -24106,21 +24118,21 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "insert" + "shortName": "patch" }, - "description": "Sample for Insert", - "file": "compute_v1_generated_interconnects_insert_sync.py", + "description": "Sample for Patch", + "file": "compute_v1_generated_interconnect_attachments_patch_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_Interconnects_Insert_sync", + "regionTag": "compute_v1_generated_InterconnectAttachments_Patch_sync", "segments": [ { - "end": 51, + "end": 53, "start": 27, "type": "FULL" }, { - "end": 51, + "end": 53, "start": 27, "type": "SHORT" }, @@ -24130,48 +24142,60 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 45, + "end": 47, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 48, - "start": 46, + "end": 50, + "start": 48, "type": "REQUEST_EXECUTION" }, { - "end": 52, - "start": 49, + "end": 54, + "start": 51, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_interconnects_insert_sync.py" + "title": "compute_v1_generated_interconnect_attachments_patch_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.InterconnectsClient", - "shortName": "InterconnectsClient" + "fullName": "google.cloud.compute_v1.InterconnectAttachmentsClient", + "shortName": "InterconnectAttachmentsClient" }, - "fullName": "google.cloud.compute_v1.InterconnectsClient.list", + "fullName": "google.cloud.compute_v1.InterconnectAttachmentsClient.set_labels", "method": { - "fullName": "google.cloud.compute.v1.Interconnects.List", + "fullName": "google.cloud.compute.v1.InterconnectAttachments.SetLabels", "service": { - "fullName": "google.cloud.compute.v1.Interconnects", - "shortName": "Interconnects" + "fullName": "google.cloud.compute.v1.InterconnectAttachments", + "shortName": "InterconnectAttachments" }, - "shortName": "List" + "shortName": "SetLabels" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.ListInterconnectsRequest" + "type": "google.cloud.compute_v1.types.SetLabelsInterconnectAttachmentRequest" }, { "name": "project", "type": "str" }, + { + "name": "region", + "type": "str" + }, + { + "name": "resource", + "type": "str" + }, + { + "name": "region_set_labels_request_resource", + "type": "google.cloud.compute_v1.types.RegionSetLabelsRequest" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -24185,22 +24209,22 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.services.interconnects.pagers.ListPager", - "shortName": "list" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "set_labels" }, - "description": "Sample for List", - "file": "compute_v1_generated_interconnects_list_sync.py", + "description": "Sample for SetLabels", + "file": "compute_v1_generated_interconnect_attachments_set_labels_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_Interconnects_List_sync", + "regionTag": "compute_v1_generated_InterconnectAttachments_SetLabels_sync", "segments": [ { - "end": 52, + "end": 53, "start": 27, "type": "FULL" }, { - "end": 52, + "end": 53, "start": 27, "type": "SHORT" }, @@ -24210,55 +24234,55 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 45, + "end": 47, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 48, - "start": 46, + "end": 50, + "start": 48, "type": "REQUEST_EXECUTION" }, { - "end": 53, - "start": 49, + "end": 54, + "start": 51, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_interconnects_list_sync.py" + "title": "compute_v1_generated_interconnect_attachments_set_labels_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.InterconnectsClient", - "shortName": "InterconnectsClient" + "fullName": "google.cloud.compute_v1.InterconnectGroupsClient", + "shortName": "InterconnectGroupsClient" }, - "fullName": "google.cloud.compute_v1.InterconnectsClient.patch", + "fullName": "google.cloud.compute_v1.InterconnectGroupsClient.create_members", "method": { - "fullName": "google.cloud.compute.v1.Interconnects.Patch", + "fullName": "google.cloud.compute.v1.InterconnectGroups.CreateMembers", "service": { - "fullName": "google.cloud.compute.v1.Interconnects", - "shortName": "Interconnects" + "fullName": "google.cloud.compute.v1.InterconnectGroups", + "shortName": "InterconnectGroups" }, - "shortName": "Patch" + "shortName": "CreateMembers" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.PatchInterconnectRequest" + "type": "google.cloud.compute_v1.types.CreateMembersInterconnectGroupRequest" }, { "name": "project", "type": "str" }, { - "name": "interconnect", + "name": "interconnect_group", "type": "str" }, { - "name": "interconnect_resource", - "type": "google.cloud.compute_v1.types.Interconnect" + "name": "interconnect_groups_create_members_request_resource", + "type": "google.cloud.compute_v1.types.InterconnectGroupsCreateMembersRequest" }, { "name": "retry", @@ -24274,13 +24298,13 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "patch" + "shortName": "create_members" }, - "description": "Sample for Patch", - "file": "compute_v1_generated_interconnects_patch_sync.py", + "description": "Sample for CreateMembers", + "file": "compute_v1_generated_interconnect_groups_create_members_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_Interconnects_Patch_sync", + "regionTag": "compute_v1_generated_InterconnectGroups_CreateMembers_sync", "segments": [ { "end": 52, @@ -24313,41 +24337,37 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_interconnects_patch_sync.py" + "title": "compute_v1_generated_interconnect_groups_create_members_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.InterconnectsClient", - "shortName": "InterconnectsClient" + "fullName": "google.cloud.compute_v1.InterconnectGroupsClient", + "shortName": "InterconnectGroupsClient" }, - "fullName": "google.cloud.compute_v1.InterconnectsClient.set_labels", + "fullName": "google.cloud.compute_v1.InterconnectGroupsClient.delete", "method": { - "fullName": "google.cloud.compute.v1.Interconnects.SetLabels", + "fullName": "google.cloud.compute.v1.InterconnectGroups.Delete", "service": { - "fullName": "google.cloud.compute.v1.Interconnects", - "shortName": "Interconnects" + "fullName": "google.cloud.compute.v1.InterconnectGroups", + "shortName": "InterconnectGroups" }, - "shortName": "SetLabels" + "shortName": "Delete" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.SetLabelsInterconnectRequest" + "type": "google.cloud.compute_v1.types.DeleteInterconnectGroupRequest" }, { "name": "project", "type": "str" }, { - "name": "resource", + "name": "interconnect_group", "type": "str" }, - { - "name": "global_set_labels_request_resource", - "type": "google.cloud.compute_v1.types.GlobalSetLabelsRequest" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -24362,13 +24382,13 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "set_labels" + "shortName": "delete" }, - "description": "Sample for SetLabels", - "file": "compute_v1_generated_interconnects_set_labels_sync.py", + "description": "Sample for Delete", + "file": "compute_v1_generated_interconnect_groups_delete_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_Interconnects_SetLabels_sync", + "regionTag": "compute_v1_generated_InterconnectGroups_Delete_sync", "segments": [ { "end": 52, @@ -24401,35 +24421,35 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_interconnects_set_labels_sync.py" + "title": "compute_v1_generated_interconnect_groups_delete_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.LicenseCodesClient", - "shortName": "LicenseCodesClient" + "fullName": "google.cloud.compute_v1.InterconnectGroupsClient", + "shortName": "InterconnectGroupsClient" }, - "fullName": "google.cloud.compute_v1.LicenseCodesClient.get", + "fullName": "google.cloud.compute_v1.InterconnectGroupsClient.get_iam_policy", "method": { - "fullName": "google.cloud.compute.v1.LicenseCodes.Get", + "fullName": "google.cloud.compute.v1.InterconnectGroups.GetIamPolicy", "service": { - "fullName": "google.cloud.compute.v1.LicenseCodes", - "shortName": "LicenseCodes" + "fullName": "google.cloud.compute.v1.InterconnectGroups", + "shortName": "InterconnectGroups" }, - "shortName": "Get" + "shortName": "GetIamPolicy" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetLicenseCodeRequest" + "type": "google.cloud.compute_v1.types.GetIamPolicyInterconnectGroupRequest" }, { "name": "project", "type": "str" }, { - "name": "license_code", + "name": "resource", "type": "str" }, { @@ -24445,14 +24465,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.LicenseCode", - "shortName": "get" + "resultType": "google.cloud.compute_v1.types.Policy", + "shortName": "get_iam_policy" }, - "description": "Sample for Get", - "file": "compute_v1_generated_license_codes_get_sync.py", + "description": "Sample for GetIamPolicy", + "file": "compute_v1_generated_interconnect_groups_get_iam_policy_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_LicenseCodes_Get_sync", + "regionTag": "compute_v1_generated_InterconnectGroups_GetIamPolicy_sync", "segments": [ { "end": 52, @@ -24485,41 +24505,37 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_license_codes_get_sync.py" + "title": "compute_v1_generated_interconnect_groups_get_iam_policy_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.LicenseCodesClient", - "shortName": "LicenseCodesClient" + "fullName": "google.cloud.compute_v1.InterconnectGroupsClient", + "shortName": "InterconnectGroupsClient" }, - "fullName": "google.cloud.compute_v1.LicenseCodesClient.test_iam_permissions", + "fullName": "google.cloud.compute_v1.InterconnectGroupsClient.get_operational_status", "method": { - "fullName": "google.cloud.compute.v1.LicenseCodes.TestIamPermissions", + "fullName": "google.cloud.compute.v1.InterconnectGroups.GetOperationalStatus", "service": { - "fullName": "google.cloud.compute.v1.LicenseCodes", - "shortName": "LicenseCodes" + "fullName": "google.cloud.compute.v1.InterconnectGroups", + "shortName": "InterconnectGroups" }, - "shortName": "TestIamPermissions" + "shortName": "GetOperationalStatus" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.TestIamPermissionsLicenseCodeRequest" + "type": "google.cloud.compute_v1.types.GetOperationalStatusInterconnectGroupRequest" }, { "name": "project", "type": "str" }, { - "name": "resource", + "name": "interconnect_group", "type": "str" }, - { - "name": "test_permissions_request_resource", - "type": "google.cloud.compute_v1.types.TestPermissionsRequest" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -24533,14 +24549,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.TestPermissionsResponse", - "shortName": "test_iam_permissions" + "resultType": "google.cloud.compute_v1.types.InterconnectGroupsGetOperationalStatusResponse", + "shortName": "get_operational_status" }, - "description": "Sample for TestIamPermissions", - "file": "compute_v1_generated_license_codes_test_iam_permissions_sync.py", + "description": "Sample for GetOperationalStatus", + "file": "compute_v1_generated_interconnect_groups_get_operational_status_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_LicenseCodes_TestIamPermissions_sync", + "regionTag": "compute_v1_generated_InterconnectGroups_GetOperationalStatus_sync", "segments": [ { "end": 52, @@ -24573,35 +24589,35 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_license_codes_test_iam_permissions_sync.py" + "title": "compute_v1_generated_interconnect_groups_get_operational_status_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.LicensesClient", - "shortName": "LicensesClient" + "fullName": "google.cloud.compute_v1.InterconnectGroupsClient", + "shortName": "InterconnectGroupsClient" }, - "fullName": "google.cloud.compute_v1.LicensesClient.delete", + "fullName": "google.cloud.compute_v1.InterconnectGroupsClient.get", "method": { - "fullName": "google.cloud.compute.v1.Licenses.Delete", + "fullName": "google.cloud.compute.v1.InterconnectGroups.Get", "service": { - "fullName": "google.cloud.compute.v1.Licenses", - "shortName": "Licenses" + "fullName": "google.cloud.compute.v1.InterconnectGroups", + "shortName": "InterconnectGroups" }, - "shortName": "Delete" + "shortName": "Get" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.DeleteLicenseRequest" + "type": "google.cloud.compute_v1.types.GetInterconnectGroupRequest" }, { "name": "project", "type": "str" }, { - "name": "license_", + "name": "interconnect_group", "type": "str" }, { @@ -24617,14 +24633,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "delete" + "resultType": "google.cloud.compute_v1.types.InterconnectGroup", + "shortName": "get" }, - "description": "Sample for Delete", - "file": "compute_v1_generated_licenses_delete_sync.py", + "description": "Sample for Get", + "file": "compute_v1_generated_interconnect_groups_get_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_Licenses_Delete_sync", + "regionTag": "compute_v1_generated_InterconnectGroups_Get_sync", "segments": [ { "end": 52, @@ -24657,36 +24673,36 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_licenses_delete_sync.py" + "title": "compute_v1_generated_interconnect_groups_get_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.LicensesClient", - "shortName": "LicensesClient" + "fullName": "google.cloud.compute_v1.InterconnectGroupsClient", + "shortName": "InterconnectGroupsClient" }, - "fullName": "google.cloud.compute_v1.LicensesClient.get_iam_policy", + "fullName": "google.cloud.compute_v1.InterconnectGroupsClient.insert", "method": { - "fullName": "google.cloud.compute.v1.Licenses.GetIamPolicy", + "fullName": "google.cloud.compute.v1.InterconnectGroups.Insert", "service": { - "fullName": "google.cloud.compute.v1.Licenses", - "shortName": "Licenses" + "fullName": "google.cloud.compute.v1.InterconnectGroups", + "shortName": "InterconnectGroups" }, - "shortName": "GetIamPolicy" + "shortName": "Insert" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetIamPolicyLicenseRequest" + "type": "google.cloud.compute_v1.types.InsertInterconnectGroupRequest" }, { "name": "project", "type": "str" }, { - "name": "resource", - "type": "str" + "name": "interconnect_group_resource", + "type": "google.cloud.compute_v1.types.InterconnectGroup" }, { "name": "retry", @@ -24701,22 +24717,22 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.Policy", - "shortName": "get_iam_policy" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "insert" }, - "description": "Sample for GetIamPolicy", - "file": "compute_v1_generated_licenses_get_iam_policy_sync.py", + "description": "Sample for Insert", + "file": "compute_v1_generated_interconnect_groups_insert_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_Licenses_GetIamPolicy_sync", + "regionTag": "compute_v1_generated_InterconnectGroups_Insert_sync", "segments": [ { - "end": 52, + "end": 51, "start": 27, "type": "FULL" }, { - "end": 52, + "end": 51, "start": 27, "type": "SHORT" }, @@ -24726,52 +24742,48 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 46, + "end": 45, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 49, - "start": 47, + "end": 48, + "start": 46, "type": "REQUEST_EXECUTION" }, { - "end": 53, - "start": 50, + "end": 52, + "start": 49, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_licenses_get_iam_policy_sync.py" + "title": "compute_v1_generated_interconnect_groups_insert_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.LicensesClient", - "shortName": "LicensesClient" + "fullName": "google.cloud.compute_v1.InterconnectGroupsClient", + "shortName": "InterconnectGroupsClient" }, - "fullName": "google.cloud.compute_v1.LicensesClient.get", + "fullName": "google.cloud.compute_v1.InterconnectGroupsClient.list", "method": { - "fullName": "google.cloud.compute.v1.Licenses.Get", + "fullName": "google.cloud.compute.v1.InterconnectGroups.List", "service": { - "fullName": "google.cloud.compute.v1.Licenses", - "shortName": "Licenses" + "fullName": "google.cloud.compute.v1.InterconnectGroups", + "shortName": "InterconnectGroups" }, - "shortName": "Get" + "shortName": "List" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetLicenseRequest" + "type": "google.cloud.compute_v1.types.ListInterconnectGroupsRequest" }, { "name": "project", "type": "str" }, - { - "name": "license_", - "type": "str" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -24785,14 +24797,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.License", - "shortName": "get" + "resultType": "google.cloud.compute_v1.services.interconnect_groups.pagers.ListPager", + "shortName": "list" }, - "description": "Sample for Get", - "file": "compute_v1_generated_licenses_get_sync.py", + "description": "Sample for List", + "file": "compute_v1_generated_interconnect_groups_list_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_Licenses_Get_sync", + "regionTag": "compute_v1_generated_InterconnectGroups_List_sync", "segments": [ { "end": 52, @@ -24810,131 +24822,55 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 46, + "end": 45, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 49, - "start": 47, + "end": 48, + "start": 46, "type": "REQUEST_EXECUTION" }, { "end": 53, - "start": 50, + "start": 49, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_licenses_get_sync.py" + "title": "compute_v1_generated_interconnect_groups_list_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.LicensesClient", - "shortName": "LicensesClient" + "fullName": "google.cloud.compute_v1.InterconnectGroupsClient", + "shortName": "InterconnectGroupsClient" }, - "fullName": "google.cloud.compute_v1.LicensesClient.insert", + "fullName": "google.cloud.compute_v1.InterconnectGroupsClient.patch", "method": { - "fullName": "google.cloud.compute.v1.Licenses.Insert", + "fullName": "google.cloud.compute.v1.InterconnectGroups.Patch", "service": { - "fullName": "google.cloud.compute.v1.Licenses", - "shortName": "Licenses" + "fullName": "google.cloud.compute.v1.InterconnectGroups", + "shortName": "InterconnectGroups" }, - "shortName": "Insert" + "shortName": "Patch" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.InsertLicenseRequest" + "type": "google.cloud.compute_v1.types.PatchInterconnectGroupRequest" }, { "name": "project", "type": "str" }, { - "name": "license_resource", - "type": "google.cloud.compute_v1.types.License" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, Union[str, bytes]]]" - } - ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "insert" - }, - "description": "Sample for Insert", - "file": "compute_v1_generated_licenses_insert_sync.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_Licenses_Insert_sync", - "segments": [ - { - "end": 51, - "start": 27, - "type": "FULL" - }, - { - "end": 51, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 45, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 48, - "start": 46, - "type": "REQUEST_EXECUTION" - }, - { - "end": 52, - "start": 49, - "type": "RESPONSE_HANDLING" - } - ], - "title": "compute_v1_generated_licenses_insert_sync.py" - }, - { - "canonical": true, - "clientMethod": { - "client": { - "fullName": "google.cloud.compute_v1.LicensesClient", - "shortName": "LicensesClient" - }, - "fullName": "google.cloud.compute_v1.LicensesClient.list", - "method": { - "fullName": "google.cloud.compute.v1.Licenses.List", - "service": { - "fullName": "google.cloud.compute.v1.Licenses", - "shortName": "Licenses" - }, - "shortName": "List" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.compute_v1.types.ListLicensesRequest" + "name": "interconnect_group", + "type": "str" }, { - "name": "project", - "type": "str" + "name": "interconnect_group_resource", + "type": "google.cloud.compute_v1.types.InterconnectGroup" }, { "name": "retry", @@ -24949,14 +24885,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.services.licenses.pagers.ListPager", - "shortName": "list" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "patch" }, - "description": "Sample for List", - "file": "compute_v1_generated_licenses_list_sync.py", + "description": "Sample for Patch", + "file": "compute_v1_generated_interconnect_groups_patch_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_Licenses_List_sync", + "regionTag": "compute_v1_generated_InterconnectGroups_Patch_sync", "segments": [ { "end": 52, @@ -24974,43 +24910,43 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 45, + "end": 46, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 48, - "start": 46, + "end": 49, + "start": 47, "type": "REQUEST_EXECUTION" }, { "end": 53, - "start": 49, + "start": 50, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_licenses_list_sync.py" + "title": "compute_v1_generated_interconnect_groups_patch_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.LicensesClient", - "shortName": "LicensesClient" + "fullName": "google.cloud.compute_v1.InterconnectGroupsClient", + "shortName": "InterconnectGroupsClient" }, - "fullName": "google.cloud.compute_v1.LicensesClient.set_iam_policy", + "fullName": "google.cloud.compute_v1.InterconnectGroupsClient.set_iam_policy", "method": { - "fullName": "google.cloud.compute.v1.Licenses.SetIamPolicy", + "fullName": "google.cloud.compute.v1.InterconnectGroups.SetIamPolicy", "service": { - "fullName": "google.cloud.compute.v1.Licenses", - "shortName": "Licenses" + "fullName": "google.cloud.compute.v1.InterconnectGroups", + "shortName": "InterconnectGroups" }, "shortName": "SetIamPolicy" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.SetIamPolicyLicenseRequest" + "type": "google.cloud.compute_v1.types.SetIamPolicyInterconnectGroupRequest" }, { "name": "project", @@ -25041,10 +24977,10 @@ "shortName": "set_iam_policy" }, "description": "Sample for SetIamPolicy", - "file": "compute_v1_generated_licenses_set_iam_policy_sync.py", + "file": "compute_v1_generated_interconnect_groups_set_iam_policy_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_Licenses_SetIamPolicy_sync", + "regionTag": "compute_v1_generated_InterconnectGroups_SetIamPolicy_sync", "segments": [ { "end": 52, @@ -25077,28 +25013,28 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_licenses_set_iam_policy_sync.py" + "title": "compute_v1_generated_interconnect_groups_set_iam_policy_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.LicensesClient", - "shortName": "LicensesClient" + "fullName": "google.cloud.compute_v1.InterconnectGroupsClient", + "shortName": "InterconnectGroupsClient" }, - "fullName": "google.cloud.compute_v1.LicensesClient.test_iam_permissions", + "fullName": "google.cloud.compute_v1.InterconnectGroupsClient.test_iam_permissions", "method": { - "fullName": "google.cloud.compute.v1.Licenses.TestIamPermissions", + "fullName": "google.cloud.compute.v1.InterconnectGroups.TestIamPermissions", "service": { - "fullName": "google.cloud.compute.v1.Licenses", - "shortName": "Licenses" + "fullName": "google.cloud.compute.v1.InterconnectGroups", + "shortName": "InterconnectGroups" }, "shortName": "TestIamPermissions" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.TestIamPermissionsLicenseRequest" + "type": "google.cloud.compute_v1.types.TestIamPermissionsInterconnectGroupRequest" }, { "name": "project", @@ -25129,10 +25065,10 @@ "shortName": "test_iam_permissions" }, "description": "Sample for TestIamPermissions", - "file": "compute_v1_generated_licenses_test_iam_permissions_sync.py", + "file": "compute_v1_generated_interconnect_groups_test_iam_permissions_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_Licenses_TestIamPermissions_sync", + "regionTag": "compute_v1_generated_InterconnectGroups_TestIamPermissions_sync", "segments": [ { "end": 52, @@ -25165,35 +25101,35 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_licenses_test_iam_permissions_sync.py" + "title": "compute_v1_generated_interconnect_groups_test_iam_permissions_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.MachineImagesClient", - "shortName": "MachineImagesClient" + "fullName": "google.cloud.compute_v1.InterconnectLocationsClient", + "shortName": "InterconnectLocationsClient" }, - "fullName": "google.cloud.compute_v1.MachineImagesClient.delete", + "fullName": "google.cloud.compute_v1.InterconnectLocationsClient.get", "method": { - "fullName": "google.cloud.compute.v1.MachineImages.Delete", + "fullName": "google.cloud.compute.v1.InterconnectLocations.Get", "service": { - "fullName": "google.cloud.compute.v1.MachineImages", - "shortName": "MachineImages" + "fullName": "google.cloud.compute.v1.InterconnectLocations", + "shortName": "InterconnectLocations" }, - "shortName": "Delete" + "shortName": "Get" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.DeleteMachineImageRequest" + "type": "google.cloud.compute_v1.types.GetInterconnectLocationRequest" }, { "name": "project", "type": "str" }, { - "name": "machine_image", + "name": "interconnect_location", "type": "str" }, { @@ -25209,14 +25145,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "delete" + "resultType": "google.cloud.compute_v1.types.InterconnectLocation", + "shortName": "get" }, - "description": "Sample for Delete", - "file": "compute_v1_generated_machine_images_delete_sync.py", + "description": "Sample for Get", + "file": "compute_v1_generated_interconnect_locations_get_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_MachineImages_Delete_sync", + "regionTag": "compute_v1_generated_InterconnectLocations_Get_sync", "segments": [ { "end": 52, @@ -25249,37 +25185,33 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_machine_images_delete_sync.py" + "title": "compute_v1_generated_interconnect_locations_get_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.MachineImagesClient", - "shortName": "MachineImagesClient" + "fullName": "google.cloud.compute_v1.InterconnectLocationsClient", + "shortName": "InterconnectLocationsClient" }, - "fullName": "google.cloud.compute_v1.MachineImagesClient.get_iam_policy", + "fullName": "google.cloud.compute_v1.InterconnectLocationsClient.list", "method": { - "fullName": "google.cloud.compute.v1.MachineImages.GetIamPolicy", + "fullName": "google.cloud.compute.v1.InterconnectLocations.List", "service": { - "fullName": "google.cloud.compute.v1.MachineImages", - "shortName": "MachineImages" + "fullName": "google.cloud.compute.v1.InterconnectLocations", + "shortName": "InterconnectLocations" }, - "shortName": "GetIamPolicy" + "shortName": "List" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetIamPolicyMachineImageRequest" + "type": "google.cloud.compute_v1.types.ListInterconnectLocationsRequest" }, { "name": "project", "type": "str" }, - { - "name": "resource", - "type": "str" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -25293,14 +25225,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.Policy", - "shortName": "get_iam_policy" + "resultType": "google.cloud.compute_v1.services.interconnect_locations.pagers.ListPager", + "shortName": "list" }, - "description": "Sample for GetIamPolicy", - "file": "compute_v1_generated_machine_images_get_iam_policy_sync.py", + "description": "Sample for List", + "file": "compute_v1_generated_interconnect_locations_list_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_MachineImages_GetIamPolicy_sync", + "regionTag": "compute_v1_generated_InterconnectLocations_List_sync", "segments": [ { "end": 52, @@ -25318,50 +25250,50 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 46, + "end": 45, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 49, - "start": 47, + "end": 48, + "start": 46, "type": "REQUEST_EXECUTION" }, { "end": 53, - "start": 50, + "start": 49, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_machine_images_get_iam_policy_sync.py" + "title": "compute_v1_generated_interconnect_locations_list_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.MachineImagesClient", - "shortName": "MachineImagesClient" + "fullName": "google.cloud.compute_v1.InterconnectRemoteLocationsClient", + "shortName": "InterconnectRemoteLocationsClient" }, - "fullName": "google.cloud.compute_v1.MachineImagesClient.get", + "fullName": "google.cloud.compute_v1.InterconnectRemoteLocationsClient.get", "method": { - "fullName": "google.cloud.compute.v1.MachineImages.Get", + "fullName": "google.cloud.compute.v1.InterconnectRemoteLocations.Get", "service": { - "fullName": "google.cloud.compute.v1.MachineImages", - "shortName": "MachineImages" + "fullName": "google.cloud.compute.v1.InterconnectRemoteLocations", + "shortName": "InterconnectRemoteLocations" }, "shortName": "Get" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetMachineImageRequest" + "type": "google.cloud.compute_v1.types.GetInterconnectRemoteLocationRequest" }, { "name": "project", "type": "str" }, { - "name": "machine_image", + "name": "interconnect_remote_location", "type": "str" }, { @@ -25377,14 +25309,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.MachineImage", + "resultType": "google.cloud.compute_v1.types.InterconnectRemoteLocation", "shortName": "get" }, "description": "Sample for Get", - "file": "compute_v1_generated_machine_images_get_sync.py", + "file": "compute_v1_generated_interconnect_remote_locations_get_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_MachineImages_Get_sync", + "regionTag": "compute_v1_generated_InterconnectRemoteLocations_Get_sync", "segments": [ { "end": 52, @@ -25417,112 +25349,28 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_machine_images_get_sync.py" - }, - { - "canonical": true, - "clientMethod": { - "client": { - "fullName": "google.cloud.compute_v1.MachineImagesClient", - "shortName": "MachineImagesClient" - }, - "fullName": "google.cloud.compute_v1.MachineImagesClient.insert", - "method": { - "fullName": "google.cloud.compute.v1.MachineImages.Insert", - "service": { - "fullName": "google.cloud.compute.v1.MachineImages", - "shortName": "MachineImages" - }, - "shortName": "Insert" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.compute_v1.types.InsertMachineImageRequest" - }, - { - "name": "project", - "type": "str" - }, - { - "name": "machine_image_resource", - "type": "google.cloud.compute_v1.types.MachineImage" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, Union[str, bytes]]]" - } - ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "insert" - }, - "description": "Sample for Insert", - "file": "compute_v1_generated_machine_images_insert_sync.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_MachineImages_Insert_sync", - "segments": [ - { - "end": 51, - "start": 27, - "type": "FULL" - }, - { - "end": 51, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 45, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 48, - "start": 46, - "type": "REQUEST_EXECUTION" - }, - { - "end": 52, - "start": 49, - "type": "RESPONSE_HANDLING" - } - ], - "title": "compute_v1_generated_machine_images_insert_sync.py" + "title": "compute_v1_generated_interconnect_remote_locations_get_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.MachineImagesClient", - "shortName": "MachineImagesClient" + "fullName": "google.cloud.compute_v1.InterconnectRemoteLocationsClient", + "shortName": "InterconnectRemoteLocationsClient" }, - "fullName": "google.cloud.compute_v1.MachineImagesClient.list", + "fullName": "google.cloud.compute_v1.InterconnectRemoteLocationsClient.list", "method": { - "fullName": "google.cloud.compute.v1.MachineImages.List", + "fullName": "google.cloud.compute.v1.InterconnectRemoteLocations.List", "service": { - "fullName": "google.cloud.compute.v1.MachineImages", - "shortName": "MachineImages" + "fullName": "google.cloud.compute.v1.InterconnectRemoteLocations", + "shortName": "InterconnectRemoteLocations" }, "shortName": "List" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.ListMachineImagesRequest" + "type": "google.cloud.compute_v1.types.ListInterconnectRemoteLocationsRequest" }, { "name": "project", @@ -25541,14 +25389,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.services.machine_images.pagers.ListPager", + "resultType": "google.cloud.compute_v1.services.interconnect_remote_locations.pagers.ListPager", "shortName": "list" }, "description": "Sample for List", - "file": "compute_v1_generated_machine_images_list_sync.py", + "file": "compute_v1_generated_interconnect_remote_locations_list_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_MachineImages_List_sync", + "regionTag": "compute_v1_generated_InterconnectRemoteLocations_List_sync", "segments": [ { "end": 52, @@ -25581,41 +25429,37 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_machine_images_list_sync.py" + "title": "compute_v1_generated_interconnect_remote_locations_list_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.MachineImagesClient", - "shortName": "MachineImagesClient" + "fullName": "google.cloud.compute_v1.InterconnectsClient", + "shortName": "InterconnectsClient" }, - "fullName": "google.cloud.compute_v1.MachineImagesClient.set_iam_policy", + "fullName": "google.cloud.compute_v1.InterconnectsClient.delete", "method": { - "fullName": "google.cloud.compute.v1.MachineImages.SetIamPolicy", + "fullName": "google.cloud.compute.v1.Interconnects.Delete", "service": { - "fullName": "google.cloud.compute.v1.MachineImages", - "shortName": "MachineImages" + "fullName": "google.cloud.compute.v1.Interconnects", + "shortName": "Interconnects" }, - "shortName": "SetIamPolicy" + "shortName": "Delete" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.SetIamPolicyMachineImageRequest" + "type": "google.cloud.compute_v1.types.DeleteInterconnectRequest" }, { "name": "project", "type": "str" }, { - "name": "resource", + "name": "interconnect", "type": "str" }, - { - "name": "global_set_policy_request_resource", - "type": "google.cloud.compute_v1.types.GlobalSetPolicyRequest" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -25629,14 +25473,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.Policy", - "shortName": "set_iam_policy" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "delete" }, - "description": "Sample for SetIamPolicy", - "file": "compute_v1_generated_machine_images_set_iam_policy_sync.py", + "description": "Sample for Delete", + "file": "compute_v1_generated_interconnects_delete_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_MachineImages_SetIamPolicy_sync", + "regionTag": "compute_v1_generated_Interconnects_Delete_sync", "segments": [ { "end": 52, @@ -25669,41 +25513,37 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_machine_images_set_iam_policy_sync.py" + "title": "compute_v1_generated_interconnects_delete_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.MachineImagesClient", - "shortName": "MachineImagesClient" + "fullName": "google.cloud.compute_v1.InterconnectsClient", + "shortName": "InterconnectsClient" }, - "fullName": "google.cloud.compute_v1.MachineImagesClient.set_labels", + "fullName": "google.cloud.compute_v1.InterconnectsClient.get_diagnostics", "method": { - "fullName": "google.cloud.compute.v1.MachineImages.SetLabels", + "fullName": "google.cloud.compute.v1.Interconnects.GetDiagnostics", "service": { - "fullName": "google.cloud.compute.v1.MachineImages", - "shortName": "MachineImages" + "fullName": "google.cloud.compute.v1.Interconnects", + "shortName": "Interconnects" }, - "shortName": "SetLabels" + "shortName": "GetDiagnostics" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.SetLabelsMachineImageRequest" + "type": "google.cloud.compute_v1.types.GetDiagnosticsInterconnectRequest" }, { "name": "project", "type": "str" }, { - "name": "resource", + "name": "interconnect", "type": "str" }, - { - "name": "global_set_labels_request_resource", - "type": "google.cloud.compute_v1.types.GlobalSetLabelsRequest" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -25717,14 +25557,1966 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "set_labels" + "resultType": "google.cloud.compute_v1.types.InterconnectsGetDiagnosticsResponse", + "shortName": "get_diagnostics" }, - "description": "Sample for SetLabels", - "file": "compute_v1_generated_machine_images_set_labels_sync.py", + "description": "Sample for GetDiagnostics", + "file": "compute_v1_generated_interconnects_get_diagnostics_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_MachineImages_SetLabels_sync", + "regionTag": "compute_v1_generated_Interconnects_GetDiagnostics_sync", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 46, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 49, + "start": 47, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "compute_v1_generated_interconnects_get_diagnostics_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.compute_v1.InterconnectsClient", + "shortName": "InterconnectsClient" + }, + "fullName": "google.cloud.compute_v1.InterconnectsClient.get_macsec_config", + "method": { + "fullName": "google.cloud.compute.v1.Interconnects.GetMacsecConfig", + "service": { + "fullName": "google.cloud.compute.v1.Interconnects", + "shortName": "Interconnects" + }, + "shortName": "GetMacsecConfig" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.compute_v1.types.GetMacsecConfigInterconnectRequest" + }, + { + "name": "project", + "type": "str" + }, + { + "name": "interconnect", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.cloud.compute_v1.types.InterconnectsGetMacsecConfigResponse", + "shortName": "get_macsec_config" + }, + "description": "Sample for GetMacsecConfig", + "file": "compute_v1_generated_interconnects_get_macsec_config_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "compute_v1_generated_Interconnects_GetMacsecConfig_sync", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 46, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 49, + "start": 47, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "compute_v1_generated_interconnects_get_macsec_config_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.compute_v1.InterconnectsClient", + "shortName": "InterconnectsClient" + }, + "fullName": "google.cloud.compute_v1.InterconnectsClient.get", + "method": { + "fullName": "google.cloud.compute.v1.Interconnects.Get", + "service": { + "fullName": "google.cloud.compute.v1.Interconnects", + "shortName": "Interconnects" + }, + "shortName": "Get" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.compute_v1.types.GetInterconnectRequest" + }, + { + "name": "project", + "type": "str" + }, + { + "name": "interconnect", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.cloud.compute_v1.types.Interconnect", + "shortName": "get" + }, + "description": "Sample for Get", + "file": "compute_v1_generated_interconnects_get_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "compute_v1_generated_Interconnects_Get_sync", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 46, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 49, + "start": 47, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "compute_v1_generated_interconnects_get_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.compute_v1.InterconnectsClient", + "shortName": "InterconnectsClient" + }, + "fullName": "google.cloud.compute_v1.InterconnectsClient.insert", + "method": { + "fullName": "google.cloud.compute.v1.Interconnects.Insert", + "service": { + "fullName": "google.cloud.compute.v1.Interconnects", + "shortName": "Interconnects" + }, + "shortName": "Insert" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.compute_v1.types.InsertInterconnectRequest" + }, + { + "name": "project", + "type": "str" + }, + { + "name": "interconnect_resource", + "type": "google.cloud.compute_v1.types.Interconnect" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "insert" + }, + "description": "Sample for Insert", + "file": "compute_v1_generated_interconnects_insert_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "compute_v1_generated_Interconnects_Insert_sync", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "compute_v1_generated_interconnects_insert_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.compute_v1.InterconnectsClient", + "shortName": "InterconnectsClient" + }, + "fullName": "google.cloud.compute_v1.InterconnectsClient.list", + "method": { + "fullName": "google.cloud.compute.v1.Interconnects.List", + "service": { + "fullName": "google.cloud.compute.v1.Interconnects", + "shortName": "Interconnects" + }, + "shortName": "List" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.compute_v1.types.ListInterconnectsRequest" + }, + { + "name": "project", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.cloud.compute_v1.services.interconnects.pagers.ListPager", + "shortName": "list" + }, + "description": "Sample for List", + "file": "compute_v1_generated_interconnects_list_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "compute_v1_generated_Interconnects_List_sync", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "compute_v1_generated_interconnects_list_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.compute_v1.InterconnectsClient", + "shortName": "InterconnectsClient" + }, + "fullName": "google.cloud.compute_v1.InterconnectsClient.patch", + "method": { + "fullName": "google.cloud.compute.v1.Interconnects.Patch", + "service": { + "fullName": "google.cloud.compute.v1.Interconnects", + "shortName": "Interconnects" + }, + "shortName": "Patch" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.compute_v1.types.PatchInterconnectRequest" + }, + { + "name": "project", + "type": "str" + }, + { + "name": "interconnect", + "type": "str" + }, + { + "name": "interconnect_resource", + "type": "google.cloud.compute_v1.types.Interconnect" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "patch" + }, + "description": "Sample for Patch", + "file": "compute_v1_generated_interconnects_patch_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "compute_v1_generated_Interconnects_Patch_sync", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 46, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 49, + "start": 47, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "compute_v1_generated_interconnects_patch_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.compute_v1.InterconnectsClient", + "shortName": "InterconnectsClient" + }, + "fullName": "google.cloud.compute_v1.InterconnectsClient.set_labels", + "method": { + "fullName": "google.cloud.compute.v1.Interconnects.SetLabels", + "service": { + "fullName": "google.cloud.compute.v1.Interconnects", + "shortName": "Interconnects" + }, + "shortName": "SetLabels" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.compute_v1.types.SetLabelsInterconnectRequest" + }, + { + "name": "project", + "type": "str" + }, + { + "name": "resource", + "type": "str" + }, + { + "name": "global_set_labels_request_resource", + "type": "google.cloud.compute_v1.types.GlobalSetLabelsRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "set_labels" + }, + "description": "Sample for SetLabels", + "file": "compute_v1_generated_interconnects_set_labels_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "compute_v1_generated_Interconnects_SetLabels_sync", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 46, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 49, + "start": 47, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "compute_v1_generated_interconnects_set_labels_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.compute_v1.LicenseCodesClient", + "shortName": "LicenseCodesClient" + }, + "fullName": "google.cloud.compute_v1.LicenseCodesClient.get", + "method": { + "fullName": "google.cloud.compute.v1.LicenseCodes.Get", + "service": { + "fullName": "google.cloud.compute.v1.LicenseCodes", + "shortName": "LicenseCodes" + }, + "shortName": "Get" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.compute_v1.types.GetLicenseCodeRequest" + }, + { + "name": "project", + "type": "str" + }, + { + "name": "license_code", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.cloud.compute_v1.types.LicenseCode", + "shortName": "get" + }, + "description": "Sample for Get", + "file": "compute_v1_generated_license_codes_get_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "compute_v1_generated_LicenseCodes_Get_sync", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 46, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 49, + "start": 47, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "compute_v1_generated_license_codes_get_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.compute_v1.LicenseCodesClient", + "shortName": "LicenseCodesClient" + }, + "fullName": "google.cloud.compute_v1.LicenseCodesClient.test_iam_permissions", + "method": { + "fullName": "google.cloud.compute.v1.LicenseCodes.TestIamPermissions", + "service": { + "fullName": "google.cloud.compute.v1.LicenseCodes", + "shortName": "LicenseCodes" + }, + "shortName": "TestIamPermissions" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.compute_v1.types.TestIamPermissionsLicenseCodeRequest" + }, + { + "name": "project", + "type": "str" + }, + { + "name": "resource", + "type": "str" + }, + { + "name": "test_permissions_request_resource", + "type": "google.cloud.compute_v1.types.TestPermissionsRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.cloud.compute_v1.types.TestPermissionsResponse", + "shortName": "test_iam_permissions" + }, + "description": "Sample for TestIamPermissions", + "file": "compute_v1_generated_license_codes_test_iam_permissions_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "compute_v1_generated_LicenseCodes_TestIamPermissions_sync", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 46, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 49, + "start": 47, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "compute_v1_generated_license_codes_test_iam_permissions_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.compute_v1.LicensesClient", + "shortName": "LicensesClient" + }, + "fullName": "google.cloud.compute_v1.LicensesClient.delete", + "method": { + "fullName": "google.cloud.compute.v1.Licenses.Delete", + "service": { + "fullName": "google.cloud.compute.v1.Licenses", + "shortName": "Licenses" + }, + "shortName": "Delete" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.compute_v1.types.DeleteLicenseRequest" + }, + { + "name": "project", + "type": "str" + }, + { + "name": "license_", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "delete" + }, + "description": "Sample for Delete", + "file": "compute_v1_generated_licenses_delete_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "compute_v1_generated_Licenses_Delete_sync", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 46, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 49, + "start": 47, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "compute_v1_generated_licenses_delete_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.compute_v1.LicensesClient", + "shortName": "LicensesClient" + }, + "fullName": "google.cloud.compute_v1.LicensesClient.get_iam_policy", + "method": { + "fullName": "google.cloud.compute.v1.Licenses.GetIamPolicy", + "service": { + "fullName": "google.cloud.compute.v1.Licenses", + "shortName": "Licenses" + }, + "shortName": "GetIamPolicy" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.compute_v1.types.GetIamPolicyLicenseRequest" + }, + { + "name": "project", + "type": "str" + }, + { + "name": "resource", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.cloud.compute_v1.types.Policy", + "shortName": "get_iam_policy" + }, + "description": "Sample for GetIamPolicy", + "file": "compute_v1_generated_licenses_get_iam_policy_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "compute_v1_generated_Licenses_GetIamPolicy_sync", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 46, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 49, + "start": 47, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "compute_v1_generated_licenses_get_iam_policy_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.compute_v1.LicensesClient", + "shortName": "LicensesClient" + }, + "fullName": "google.cloud.compute_v1.LicensesClient.get", + "method": { + "fullName": "google.cloud.compute.v1.Licenses.Get", + "service": { + "fullName": "google.cloud.compute.v1.Licenses", + "shortName": "Licenses" + }, + "shortName": "Get" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.compute_v1.types.GetLicenseRequest" + }, + { + "name": "project", + "type": "str" + }, + { + "name": "license_", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.cloud.compute_v1.types.License", + "shortName": "get" + }, + "description": "Sample for Get", + "file": "compute_v1_generated_licenses_get_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "compute_v1_generated_Licenses_Get_sync", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 46, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 49, + "start": 47, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "compute_v1_generated_licenses_get_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.compute_v1.LicensesClient", + "shortName": "LicensesClient" + }, + "fullName": "google.cloud.compute_v1.LicensesClient.insert", + "method": { + "fullName": "google.cloud.compute.v1.Licenses.Insert", + "service": { + "fullName": "google.cloud.compute.v1.Licenses", + "shortName": "Licenses" + }, + "shortName": "Insert" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.compute_v1.types.InsertLicenseRequest" + }, + { + "name": "project", + "type": "str" + }, + { + "name": "license_resource", + "type": "google.cloud.compute_v1.types.License" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "insert" + }, + "description": "Sample for Insert", + "file": "compute_v1_generated_licenses_insert_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "compute_v1_generated_Licenses_Insert_sync", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "compute_v1_generated_licenses_insert_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.compute_v1.LicensesClient", + "shortName": "LicensesClient" + }, + "fullName": "google.cloud.compute_v1.LicensesClient.list", + "method": { + "fullName": "google.cloud.compute.v1.Licenses.List", + "service": { + "fullName": "google.cloud.compute.v1.Licenses", + "shortName": "Licenses" + }, + "shortName": "List" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.compute_v1.types.ListLicensesRequest" + }, + { + "name": "project", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.cloud.compute_v1.services.licenses.pagers.ListPager", + "shortName": "list" + }, + "description": "Sample for List", + "file": "compute_v1_generated_licenses_list_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "compute_v1_generated_Licenses_List_sync", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "compute_v1_generated_licenses_list_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.compute_v1.LicensesClient", + "shortName": "LicensesClient" + }, + "fullName": "google.cloud.compute_v1.LicensesClient.set_iam_policy", + "method": { + "fullName": "google.cloud.compute.v1.Licenses.SetIamPolicy", + "service": { + "fullName": "google.cloud.compute.v1.Licenses", + "shortName": "Licenses" + }, + "shortName": "SetIamPolicy" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.compute_v1.types.SetIamPolicyLicenseRequest" + }, + { + "name": "project", + "type": "str" + }, + { + "name": "resource", + "type": "str" + }, + { + "name": "global_set_policy_request_resource", + "type": "google.cloud.compute_v1.types.GlobalSetPolicyRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.cloud.compute_v1.types.Policy", + "shortName": "set_iam_policy" + }, + "description": "Sample for SetIamPolicy", + "file": "compute_v1_generated_licenses_set_iam_policy_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "compute_v1_generated_Licenses_SetIamPolicy_sync", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 46, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 49, + "start": 47, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "compute_v1_generated_licenses_set_iam_policy_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.compute_v1.LicensesClient", + "shortName": "LicensesClient" + }, + "fullName": "google.cloud.compute_v1.LicensesClient.test_iam_permissions", + "method": { + "fullName": "google.cloud.compute.v1.Licenses.TestIamPermissions", + "service": { + "fullName": "google.cloud.compute.v1.Licenses", + "shortName": "Licenses" + }, + "shortName": "TestIamPermissions" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.compute_v1.types.TestIamPermissionsLicenseRequest" + }, + { + "name": "project", + "type": "str" + }, + { + "name": "resource", + "type": "str" + }, + { + "name": "test_permissions_request_resource", + "type": "google.cloud.compute_v1.types.TestPermissionsRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.cloud.compute_v1.types.TestPermissionsResponse", + "shortName": "test_iam_permissions" + }, + "description": "Sample for TestIamPermissions", + "file": "compute_v1_generated_licenses_test_iam_permissions_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "compute_v1_generated_Licenses_TestIamPermissions_sync", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 46, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 49, + "start": 47, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "compute_v1_generated_licenses_test_iam_permissions_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.compute_v1.LicensesClient", + "shortName": "LicensesClient" + }, + "fullName": "google.cloud.compute_v1.LicensesClient.update", + "method": { + "fullName": "google.cloud.compute.v1.Licenses.Update", + "service": { + "fullName": "google.cloud.compute.v1.Licenses", + "shortName": "Licenses" + }, + "shortName": "Update" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.compute_v1.types.UpdateLicenseRequest" + }, + { + "name": "project", + "type": "str" + }, + { + "name": "license_", + "type": "str" + }, + { + "name": "license_resource", + "type": "google.cloud.compute_v1.types.License" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "update" + }, + "description": "Sample for Update", + "file": "compute_v1_generated_licenses_update_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "compute_v1_generated_Licenses_Update_sync", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 46, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 49, + "start": 47, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "compute_v1_generated_licenses_update_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.compute_v1.MachineImagesClient", + "shortName": "MachineImagesClient" + }, + "fullName": "google.cloud.compute_v1.MachineImagesClient.delete", + "method": { + "fullName": "google.cloud.compute.v1.MachineImages.Delete", + "service": { + "fullName": "google.cloud.compute.v1.MachineImages", + "shortName": "MachineImages" + }, + "shortName": "Delete" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.compute_v1.types.DeleteMachineImageRequest" + }, + { + "name": "project", + "type": "str" + }, + { + "name": "machine_image", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "delete" + }, + "description": "Sample for Delete", + "file": "compute_v1_generated_machine_images_delete_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "compute_v1_generated_MachineImages_Delete_sync", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 46, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 49, + "start": 47, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "compute_v1_generated_machine_images_delete_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.compute_v1.MachineImagesClient", + "shortName": "MachineImagesClient" + }, + "fullName": "google.cloud.compute_v1.MachineImagesClient.get_iam_policy", + "method": { + "fullName": "google.cloud.compute.v1.MachineImages.GetIamPolicy", + "service": { + "fullName": "google.cloud.compute.v1.MachineImages", + "shortName": "MachineImages" + }, + "shortName": "GetIamPolicy" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.compute_v1.types.GetIamPolicyMachineImageRequest" + }, + { + "name": "project", + "type": "str" + }, + { + "name": "resource", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.cloud.compute_v1.types.Policy", + "shortName": "get_iam_policy" + }, + "description": "Sample for GetIamPolicy", + "file": "compute_v1_generated_machine_images_get_iam_policy_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "compute_v1_generated_MachineImages_GetIamPolicy_sync", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 46, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 49, + "start": 47, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "compute_v1_generated_machine_images_get_iam_policy_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.compute_v1.MachineImagesClient", + "shortName": "MachineImagesClient" + }, + "fullName": "google.cloud.compute_v1.MachineImagesClient.get", + "method": { + "fullName": "google.cloud.compute.v1.MachineImages.Get", + "service": { + "fullName": "google.cloud.compute.v1.MachineImages", + "shortName": "MachineImages" + }, + "shortName": "Get" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.compute_v1.types.GetMachineImageRequest" + }, + { + "name": "project", + "type": "str" + }, + { + "name": "machine_image", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.cloud.compute_v1.types.MachineImage", + "shortName": "get" + }, + "description": "Sample for Get", + "file": "compute_v1_generated_machine_images_get_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "compute_v1_generated_MachineImages_Get_sync", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 46, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 49, + "start": 47, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "compute_v1_generated_machine_images_get_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.compute_v1.MachineImagesClient", + "shortName": "MachineImagesClient" + }, + "fullName": "google.cloud.compute_v1.MachineImagesClient.insert", + "method": { + "fullName": "google.cloud.compute.v1.MachineImages.Insert", + "service": { + "fullName": "google.cloud.compute.v1.MachineImages", + "shortName": "MachineImages" + }, + "shortName": "Insert" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.compute_v1.types.InsertMachineImageRequest" + }, + { + "name": "project", + "type": "str" + }, + { + "name": "machine_image_resource", + "type": "google.cloud.compute_v1.types.MachineImage" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "insert" + }, + "description": "Sample for Insert", + "file": "compute_v1_generated_machine_images_insert_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "compute_v1_generated_MachineImages_Insert_sync", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "compute_v1_generated_machine_images_insert_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.compute_v1.MachineImagesClient", + "shortName": "MachineImagesClient" + }, + "fullName": "google.cloud.compute_v1.MachineImagesClient.list", + "method": { + "fullName": "google.cloud.compute.v1.MachineImages.List", + "service": { + "fullName": "google.cloud.compute.v1.MachineImages", + "shortName": "MachineImages" + }, + "shortName": "List" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.compute_v1.types.ListMachineImagesRequest" + }, + { + "name": "project", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.cloud.compute_v1.services.machine_images.pagers.ListPager", + "shortName": "list" + }, + "description": "Sample for List", + "file": "compute_v1_generated_machine_images_list_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "compute_v1_generated_MachineImages_List_sync", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "compute_v1_generated_machine_images_list_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.compute_v1.MachineImagesClient", + "shortName": "MachineImagesClient" + }, + "fullName": "google.cloud.compute_v1.MachineImagesClient.set_iam_policy", + "method": { + "fullName": "google.cloud.compute.v1.MachineImages.SetIamPolicy", + "service": { + "fullName": "google.cloud.compute.v1.MachineImages", + "shortName": "MachineImages" + }, + "shortName": "SetIamPolicy" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.compute_v1.types.SetIamPolicyMachineImageRequest" + }, + { + "name": "project", + "type": "str" + }, + { + "name": "resource", + "type": "str" + }, + { + "name": "global_set_policy_request_resource", + "type": "google.cloud.compute_v1.types.GlobalSetPolicyRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.cloud.compute_v1.types.Policy", + "shortName": "set_iam_policy" + }, + "description": "Sample for SetIamPolicy", + "file": "compute_v1_generated_machine_images_set_iam_policy_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "compute_v1_generated_MachineImages_SetIamPolicy_sync", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 46, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 49, + "start": 47, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "compute_v1_generated_machine_images_set_iam_policy_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.compute_v1.MachineImagesClient", + "shortName": "MachineImagesClient" + }, + "fullName": "google.cloud.compute_v1.MachineImagesClient.set_labels", + "method": { + "fullName": "google.cloud.compute.v1.MachineImages.SetLabels", + "service": { + "fullName": "google.cloud.compute.v1.MachineImages", + "shortName": "MachineImages" + }, + "shortName": "SetLabels" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.compute_v1.types.SetLabelsMachineImageRequest" + }, + { + "name": "project", + "type": "str" + }, + { + "name": "resource", + "type": "str" + }, + { + "name": "global_set_labels_request_resource", + "type": "google.cloud.compute_v1.types.GlobalSetLabelsRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "set_labels" + }, + "description": "Sample for SetLabels", + "file": "compute_v1_generated_machine_images_set_labels_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "compute_v1_generated_MachineImages_SetLabels_sync", "segments": [ { "end": 52, @@ -26265,7 +28057,447 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_network_attachments_delete_sync.py" + "title": "compute_v1_generated_network_attachments_delete_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.compute_v1.NetworkAttachmentsClient", + "shortName": "NetworkAttachmentsClient" + }, + "fullName": "google.cloud.compute_v1.NetworkAttachmentsClient.get_iam_policy", + "method": { + "fullName": "google.cloud.compute.v1.NetworkAttachments.GetIamPolicy", + "service": { + "fullName": "google.cloud.compute.v1.NetworkAttachments", + "shortName": "NetworkAttachments" + }, + "shortName": "GetIamPolicy" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.compute_v1.types.GetIamPolicyNetworkAttachmentRequest" + }, + { + "name": "project", + "type": "str" + }, + { + "name": "region", + "type": "str" + }, + { + "name": "resource", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.cloud.compute_v1.types.Policy", + "shortName": "get_iam_policy" + }, + "description": "Sample for GetIamPolicy", + "file": "compute_v1_generated_network_attachments_get_iam_policy_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "compute_v1_generated_NetworkAttachments_GetIamPolicy_sync", + "segments": [ + { + "end": 53, + "start": 27, + "type": "FULL" + }, + { + "end": 53, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 47, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 50, + "start": 48, + "type": "REQUEST_EXECUTION" + }, + { + "end": 54, + "start": 51, + "type": "RESPONSE_HANDLING" + } + ], + "title": "compute_v1_generated_network_attachments_get_iam_policy_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.compute_v1.NetworkAttachmentsClient", + "shortName": "NetworkAttachmentsClient" + }, + "fullName": "google.cloud.compute_v1.NetworkAttachmentsClient.get", + "method": { + "fullName": "google.cloud.compute.v1.NetworkAttachments.Get", + "service": { + "fullName": "google.cloud.compute.v1.NetworkAttachments", + "shortName": "NetworkAttachments" + }, + "shortName": "Get" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.compute_v1.types.GetNetworkAttachmentRequest" + }, + { + "name": "project", + "type": "str" + }, + { + "name": "region", + "type": "str" + }, + { + "name": "network_attachment", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.cloud.compute_v1.types.NetworkAttachment", + "shortName": "get" + }, + "description": "Sample for Get", + "file": "compute_v1_generated_network_attachments_get_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "compute_v1_generated_NetworkAttachments_Get_sync", + "segments": [ + { + "end": 53, + "start": 27, + "type": "FULL" + }, + { + "end": 53, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 47, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 50, + "start": 48, + "type": "REQUEST_EXECUTION" + }, + { + "end": 54, + "start": 51, + "type": "RESPONSE_HANDLING" + } + ], + "title": "compute_v1_generated_network_attachments_get_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.compute_v1.NetworkAttachmentsClient", + "shortName": "NetworkAttachmentsClient" + }, + "fullName": "google.cloud.compute_v1.NetworkAttachmentsClient.insert", + "method": { + "fullName": "google.cloud.compute.v1.NetworkAttachments.Insert", + "service": { + "fullName": "google.cloud.compute.v1.NetworkAttachments", + "shortName": "NetworkAttachments" + }, + "shortName": "Insert" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.compute_v1.types.InsertNetworkAttachmentRequest" + }, + { + "name": "project", + "type": "str" + }, + { + "name": "region", + "type": "str" + }, + { + "name": "network_attachment_resource", + "type": "google.cloud.compute_v1.types.NetworkAttachment" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "insert" + }, + "description": "Sample for Insert", + "file": "compute_v1_generated_network_attachments_insert_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "compute_v1_generated_NetworkAttachments_Insert_sync", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 46, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 49, + "start": 47, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "compute_v1_generated_network_attachments_insert_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.compute_v1.NetworkAttachmentsClient", + "shortName": "NetworkAttachmentsClient" + }, + "fullName": "google.cloud.compute_v1.NetworkAttachmentsClient.list", + "method": { + "fullName": "google.cloud.compute.v1.NetworkAttachments.List", + "service": { + "fullName": "google.cloud.compute.v1.NetworkAttachments", + "shortName": "NetworkAttachments" + }, + "shortName": "List" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.compute_v1.types.ListNetworkAttachmentsRequest" + }, + { + "name": "project", + "type": "str" + }, + { + "name": "region", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.cloud.compute_v1.services.network_attachments.pagers.ListPager", + "shortName": "list" + }, + "description": "Sample for List", + "file": "compute_v1_generated_network_attachments_list_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "compute_v1_generated_NetworkAttachments_List_sync", + "segments": [ + { + "end": 53, + "start": 27, + "type": "FULL" + }, + { + "end": 53, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 46, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 49, + "start": 47, + "type": "REQUEST_EXECUTION" + }, + { + "end": 54, + "start": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "compute_v1_generated_network_attachments_list_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.compute_v1.NetworkAttachmentsClient", + "shortName": "NetworkAttachmentsClient" + }, + "fullName": "google.cloud.compute_v1.NetworkAttachmentsClient.patch", + "method": { + "fullName": "google.cloud.compute.v1.NetworkAttachments.Patch", + "service": { + "fullName": "google.cloud.compute.v1.NetworkAttachments", + "shortName": "NetworkAttachments" + }, + "shortName": "Patch" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.compute_v1.types.PatchNetworkAttachmentRequest" + }, + { + "name": "project", + "type": "str" + }, + { + "name": "region", + "type": "str" + }, + { + "name": "network_attachment", + "type": "str" + }, + { + "name": "network_attachment_resource", + "type": "google.cloud.compute_v1.types.NetworkAttachment" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "patch" + }, + "description": "Sample for Patch", + "file": "compute_v1_generated_network_attachments_patch_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "compute_v1_generated_NetworkAttachments_Patch_sync", + "segments": [ + { + "end": 53, + "start": 27, + "type": "FULL" + }, + { + "end": 53, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 47, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 50, + "start": 48, + "type": "REQUEST_EXECUTION" + }, + { + "end": 54, + "start": 51, + "type": "RESPONSE_HANDLING" + } + ], + "title": "compute_v1_generated_network_attachments_patch_sync.py" }, { "canonical": true, @@ -26274,19 +28506,19 @@ "fullName": "google.cloud.compute_v1.NetworkAttachmentsClient", "shortName": "NetworkAttachmentsClient" }, - "fullName": "google.cloud.compute_v1.NetworkAttachmentsClient.get_iam_policy", + "fullName": "google.cloud.compute_v1.NetworkAttachmentsClient.set_iam_policy", "method": { - "fullName": "google.cloud.compute.v1.NetworkAttachments.GetIamPolicy", + "fullName": "google.cloud.compute.v1.NetworkAttachments.SetIamPolicy", "service": { "fullName": "google.cloud.compute.v1.NetworkAttachments", "shortName": "NetworkAttachments" }, - "shortName": "GetIamPolicy" + "shortName": "SetIamPolicy" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetIamPolicyNetworkAttachmentRequest" + "type": "google.cloud.compute_v1.types.SetIamPolicyNetworkAttachmentRequest" }, { "name": "project", @@ -26300,6 +28532,10 @@ "name": "resource", "type": "str" }, + { + "name": "region_set_policy_request_resource", + "type": "google.cloud.compute_v1.types.RegionSetPolicyRequest" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -26314,13 +28550,13 @@ } ], "resultType": "google.cloud.compute_v1.types.Policy", - "shortName": "get_iam_policy" + "shortName": "set_iam_policy" }, - "description": "Sample for GetIamPolicy", - "file": "compute_v1_generated_network_attachments_get_iam_policy_sync.py", + "description": "Sample for SetIamPolicy", + "file": "compute_v1_generated_network_attachments_set_iam_policy_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_NetworkAttachments_GetIamPolicy_sync", + "regionTag": "compute_v1_generated_NetworkAttachments_SetIamPolicy_sync", "segments": [ { "end": 53, @@ -26353,7 +28589,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_network_attachments_get_iam_policy_sync.py" + "title": "compute_v1_generated_network_attachments_set_iam_policy_sync.py" }, { "canonical": true, @@ -26362,19 +28598,19 @@ "fullName": "google.cloud.compute_v1.NetworkAttachmentsClient", "shortName": "NetworkAttachmentsClient" }, - "fullName": "google.cloud.compute_v1.NetworkAttachmentsClient.get", + "fullName": "google.cloud.compute_v1.NetworkAttachmentsClient.test_iam_permissions", "method": { - "fullName": "google.cloud.compute.v1.NetworkAttachments.Get", + "fullName": "google.cloud.compute.v1.NetworkAttachments.TestIamPermissions", "service": { "fullName": "google.cloud.compute.v1.NetworkAttachments", "shortName": "NetworkAttachments" }, - "shortName": "Get" + "shortName": "TestIamPermissions" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetNetworkAttachmentRequest" + "type": "google.cloud.compute_v1.types.TestIamPermissionsNetworkAttachmentRequest" }, { "name": "project", @@ -26385,9 +28621,13 @@ "type": "str" }, { - "name": "network_attachment", + "name": "resource", "type": "str" }, + { + "name": "test_permissions_request_resource", + "type": "google.cloud.compute_v1.types.TestPermissionsRequest" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -26401,14 +28641,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.NetworkAttachment", - "shortName": "get" + "resultType": "google.cloud.compute_v1.types.TestPermissionsResponse", + "shortName": "test_iam_permissions" }, - "description": "Sample for Get", - "file": "compute_v1_generated_network_attachments_get_sync.py", + "description": "Sample for TestIamPermissions", + "file": "compute_v1_generated_network_attachments_test_iam_permissions_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_NetworkAttachments_Get_sync", + "regionTag": "compute_v1_generated_NetworkAttachments_TestIamPermissions_sync", "segments": [ { "end": 53, @@ -26441,41 +28681,33 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_network_attachments_get_sync.py" + "title": "compute_v1_generated_network_attachments_test_iam_permissions_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.NetworkAttachmentsClient", - "shortName": "NetworkAttachmentsClient" + "fullName": "google.cloud.compute_v1.NetworkEdgeSecurityServicesClient", + "shortName": "NetworkEdgeSecurityServicesClient" }, - "fullName": "google.cloud.compute_v1.NetworkAttachmentsClient.insert", + "fullName": "google.cloud.compute_v1.NetworkEdgeSecurityServicesClient.aggregated_list", "method": { - "fullName": "google.cloud.compute.v1.NetworkAttachments.Insert", + "fullName": "google.cloud.compute.v1.NetworkEdgeSecurityServices.AggregatedList", "service": { - "fullName": "google.cloud.compute.v1.NetworkAttachments", - "shortName": "NetworkAttachments" + "fullName": "google.cloud.compute.v1.NetworkEdgeSecurityServices", + "shortName": "NetworkEdgeSecurityServices" }, - "shortName": "Insert" + "shortName": "AggregatedList" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.InsertNetworkAttachmentRequest" + "type": "google.cloud.compute_v1.types.AggregatedListNetworkEdgeSecurityServicesRequest" }, { "name": "project", "type": "str" }, - { - "name": "region", - "type": "str" - }, - { - "name": "network_attachment_resource", - "type": "google.cloud.compute_v1.types.NetworkAttachment" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -26489,14 +28721,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "insert" + "resultType": "google.cloud.compute_v1.services.network_edge_security_services.pagers.AggregatedListPager", + "shortName": "aggregated_list" }, - "description": "Sample for Insert", - "file": "compute_v1_generated_network_attachments_insert_sync.py", + "description": "Sample for AggregatedList", + "file": "compute_v1_generated_network_edge_security_services_aggregated_list_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_NetworkAttachments_Insert_sync", + "regionTag": "compute_v1_generated_NetworkEdgeSecurityServices_AggregatedList_sync", "segments": [ { "end": 52, @@ -26514,43 +28746,43 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 46, + "end": 45, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 49, - "start": 47, + "end": 48, + "start": 46, "type": "REQUEST_EXECUTION" }, { "end": 53, - "start": 50, + "start": 49, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_network_attachments_insert_sync.py" + "title": "compute_v1_generated_network_edge_security_services_aggregated_list_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.NetworkAttachmentsClient", - "shortName": "NetworkAttachmentsClient" + "fullName": "google.cloud.compute_v1.NetworkEdgeSecurityServicesClient", + "shortName": "NetworkEdgeSecurityServicesClient" }, - "fullName": "google.cloud.compute_v1.NetworkAttachmentsClient.list", + "fullName": "google.cloud.compute_v1.NetworkEdgeSecurityServicesClient.delete", "method": { - "fullName": "google.cloud.compute.v1.NetworkAttachments.List", + "fullName": "google.cloud.compute.v1.NetworkEdgeSecurityServices.Delete", "service": { - "fullName": "google.cloud.compute.v1.NetworkAttachments", - "shortName": "NetworkAttachments" + "fullName": "google.cloud.compute.v1.NetworkEdgeSecurityServices", + "shortName": "NetworkEdgeSecurityServices" }, - "shortName": "List" + "shortName": "Delete" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.ListNetworkAttachmentsRequest" + "type": "google.cloud.compute_v1.types.DeleteNetworkEdgeSecurityServiceRequest" }, { "name": "project", @@ -26560,6 +28792,10 @@ "name": "region", "type": "str" }, + { + "name": "network_edge_security_service", + "type": "str" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -26573,14 +28809,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.services.network_attachments.pagers.ListPager", - "shortName": "list" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "delete" }, - "description": "Sample for List", - "file": "compute_v1_generated_network_attachments_list_sync.py", + "description": "Sample for Delete", + "file": "compute_v1_generated_network_edge_security_services_delete_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_NetworkAttachments_List_sync", + "regionTag": "compute_v1_generated_NetworkEdgeSecurityServices_Delete_sync", "segments": [ { "end": 53, @@ -26598,43 +28834,43 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 46, + "end": 47, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 49, - "start": 47, + "end": 50, + "start": 48, "type": "REQUEST_EXECUTION" }, { "end": 54, - "start": 50, + "start": 51, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_network_attachments_list_sync.py" + "title": "compute_v1_generated_network_edge_security_services_delete_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.NetworkAttachmentsClient", - "shortName": "NetworkAttachmentsClient" + "fullName": "google.cloud.compute_v1.NetworkEdgeSecurityServicesClient", + "shortName": "NetworkEdgeSecurityServicesClient" }, - "fullName": "google.cloud.compute_v1.NetworkAttachmentsClient.patch", + "fullName": "google.cloud.compute_v1.NetworkEdgeSecurityServicesClient.get", "method": { - "fullName": "google.cloud.compute.v1.NetworkAttachments.Patch", + "fullName": "google.cloud.compute.v1.NetworkEdgeSecurityServices.Get", "service": { - "fullName": "google.cloud.compute.v1.NetworkAttachments", - "shortName": "NetworkAttachments" + "fullName": "google.cloud.compute.v1.NetworkEdgeSecurityServices", + "shortName": "NetworkEdgeSecurityServices" }, - "shortName": "Patch" + "shortName": "Get" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.PatchNetworkAttachmentRequest" + "type": "google.cloud.compute_v1.types.GetNetworkEdgeSecurityServiceRequest" }, { "name": "project", @@ -26645,13 +28881,9 @@ "type": "str" }, { - "name": "network_attachment", + "name": "network_edge_security_service", "type": "str" }, - { - "name": "network_attachment_resource", - "type": "google.cloud.compute_v1.types.NetworkAttachment" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -26665,14 +28897,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "patch" + "resultType": "google.cloud.compute_v1.types.NetworkEdgeSecurityService", + "shortName": "get" }, - "description": "Sample for Patch", - "file": "compute_v1_generated_network_attachments_patch_sync.py", + "description": "Sample for Get", + "file": "compute_v1_generated_network_edge_security_services_get_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_NetworkAttachments_Patch_sync", + "regionTag": "compute_v1_generated_NetworkEdgeSecurityServices_Get_sync", "segments": [ { "end": 53, @@ -26705,28 +28937,28 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_network_attachments_patch_sync.py" + "title": "compute_v1_generated_network_edge_security_services_get_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.NetworkAttachmentsClient", - "shortName": "NetworkAttachmentsClient" + "fullName": "google.cloud.compute_v1.NetworkEdgeSecurityServicesClient", + "shortName": "NetworkEdgeSecurityServicesClient" }, - "fullName": "google.cloud.compute_v1.NetworkAttachmentsClient.set_iam_policy", + "fullName": "google.cloud.compute_v1.NetworkEdgeSecurityServicesClient.insert", "method": { - "fullName": "google.cloud.compute.v1.NetworkAttachments.SetIamPolicy", + "fullName": "google.cloud.compute.v1.NetworkEdgeSecurityServices.Insert", "service": { - "fullName": "google.cloud.compute.v1.NetworkAttachments", - "shortName": "NetworkAttachments" + "fullName": "google.cloud.compute.v1.NetworkEdgeSecurityServices", + "shortName": "NetworkEdgeSecurityServices" }, - "shortName": "SetIamPolicy" + "shortName": "Insert" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.SetIamPolicyNetworkAttachmentRequest" + "type": "google.cloud.compute_v1.types.InsertNetworkEdgeSecurityServiceRequest" }, { "name": "project", @@ -26737,12 +28969,8 @@ "type": "str" }, { - "name": "resource", - "type": "str" - }, - { - "name": "region_set_policy_request_resource", - "type": "google.cloud.compute_v1.types.RegionSetPolicyRequest" + "name": "network_edge_security_service_resource", + "type": "google.cloud.compute_v1.types.NetworkEdgeSecurityService" }, { "name": "retry", @@ -26757,22 +28985,22 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.Policy", - "shortName": "set_iam_policy" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "insert" }, - "description": "Sample for SetIamPolicy", - "file": "compute_v1_generated_network_attachments_set_iam_policy_sync.py", + "description": "Sample for Insert", + "file": "compute_v1_generated_network_edge_security_services_insert_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_NetworkAttachments_SetIamPolicy_sync", + "regionTag": "compute_v1_generated_NetworkEdgeSecurityServices_Insert_sync", "segments": [ { - "end": 53, + "end": 52, "start": 27, "type": "FULL" }, { - "end": 53, + "end": 52, "start": 27, "type": "SHORT" }, @@ -26782,43 +29010,43 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 47, + "end": 46, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 50, - "start": 48, + "end": 49, + "start": 47, "type": "REQUEST_EXECUTION" }, { - "end": 54, - "start": 51, + "end": 53, + "start": 50, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_network_attachments_set_iam_policy_sync.py" + "title": "compute_v1_generated_network_edge_security_services_insert_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.NetworkAttachmentsClient", - "shortName": "NetworkAttachmentsClient" + "fullName": "google.cloud.compute_v1.NetworkEdgeSecurityServicesClient", + "shortName": "NetworkEdgeSecurityServicesClient" }, - "fullName": "google.cloud.compute_v1.NetworkAttachmentsClient.test_iam_permissions", + "fullName": "google.cloud.compute_v1.NetworkEdgeSecurityServicesClient.patch", "method": { - "fullName": "google.cloud.compute.v1.NetworkAttachments.TestIamPermissions", + "fullName": "google.cloud.compute.v1.NetworkEdgeSecurityServices.Patch", "service": { - "fullName": "google.cloud.compute.v1.NetworkAttachments", - "shortName": "NetworkAttachments" + "fullName": "google.cloud.compute.v1.NetworkEdgeSecurityServices", + "shortName": "NetworkEdgeSecurityServices" }, - "shortName": "TestIamPermissions" + "shortName": "Patch" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.TestIamPermissionsNetworkAttachmentRequest" + "type": "google.cloud.compute_v1.types.PatchNetworkEdgeSecurityServiceRequest" }, { "name": "project", @@ -26829,12 +29057,12 @@ "type": "str" }, { - "name": "resource", + "name": "network_edge_security_service", "type": "str" }, { - "name": "test_permissions_request_resource", - "type": "google.cloud.compute_v1.types.TestPermissionsRequest" + "name": "network_edge_security_service_resource", + "type": "google.cloud.compute_v1.types.NetworkEdgeSecurityService" }, { "name": "retry", @@ -26849,14 +29077,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.TestPermissionsResponse", - "shortName": "test_iam_permissions" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "patch" }, - "description": "Sample for TestIamPermissions", - "file": "compute_v1_generated_network_attachments_test_iam_permissions_sync.py", + "description": "Sample for Patch", + "file": "compute_v1_generated_network_edge_security_services_patch_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_NetworkAttachments_TestIamPermissions_sync", + "regionTag": "compute_v1_generated_NetworkEdgeSecurityServices_Patch_sync", "segments": [ { "end": 53, @@ -26889,28 +29117,28 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_network_attachments_test_iam_permissions_sync.py" + "title": "compute_v1_generated_network_edge_security_services_patch_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.NetworkEdgeSecurityServicesClient", - "shortName": "NetworkEdgeSecurityServicesClient" + "fullName": "google.cloud.compute_v1.NetworkEndpointGroupsClient", + "shortName": "NetworkEndpointGroupsClient" }, - "fullName": "google.cloud.compute_v1.NetworkEdgeSecurityServicesClient.aggregated_list", + "fullName": "google.cloud.compute_v1.NetworkEndpointGroupsClient.aggregated_list", "method": { - "fullName": "google.cloud.compute.v1.NetworkEdgeSecurityServices.AggregatedList", + "fullName": "google.cloud.compute.v1.NetworkEndpointGroups.AggregatedList", "service": { - "fullName": "google.cloud.compute.v1.NetworkEdgeSecurityServices", - "shortName": "NetworkEdgeSecurityServices" + "fullName": "google.cloud.compute.v1.NetworkEndpointGroups", + "shortName": "NetworkEndpointGroups" }, "shortName": "AggregatedList" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.AggregatedListNetworkEdgeSecurityServicesRequest" + "type": "google.cloud.compute_v1.types.AggregatedListNetworkEndpointGroupsRequest" }, { "name": "project", @@ -26929,14 +29157,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.services.network_edge_security_services.pagers.AggregatedListPager", + "resultType": "google.cloud.compute_v1.services.network_endpoint_groups.pagers.AggregatedListPager", "shortName": "aggregated_list" }, "description": "Sample for AggregatedList", - "file": "compute_v1_generated_network_edge_security_services_aggregated_list_sync.py", + "file": "compute_v1_generated_network_endpoint_groups_aggregated_list_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_NetworkEdgeSecurityServices_AggregatedList_sync", + "regionTag": "compute_v1_generated_NetworkEndpointGroups_AggregatedList_sync", "segments": [ { "end": 52, @@ -26969,41 +29197,45 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_network_edge_security_services_aggregated_list_sync.py" + "title": "compute_v1_generated_network_endpoint_groups_aggregated_list_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.NetworkEdgeSecurityServicesClient", - "shortName": "NetworkEdgeSecurityServicesClient" + "fullName": "google.cloud.compute_v1.NetworkEndpointGroupsClient", + "shortName": "NetworkEndpointGroupsClient" }, - "fullName": "google.cloud.compute_v1.NetworkEdgeSecurityServicesClient.delete", + "fullName": "google.cloud.compute_v1.NetworkEndpointGroupsClient.attach_network_endpoints", "method": { - "fullName": "google.cloud.compute.v1.NetworkEdgeSecurityServices.Delete", + "fullName": "google.cloud.compute.v1.NetworkEndpointGroups.AttachNetworkEndpoints", "service": { - "fullName": "google.cloud.compute.v1.NetworkEdgeSecurityServices", - "shortName": "NetworkEdgeSecurityServices" + "fullName": "google.cloud.compute.v1.NetworkEndpointGroups", + "shortName": "NetworkEndpointGroups" }, - "shortName": "Delete" + "shortName": "AttachNetworkEndpoints" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.DeleteNetworkEdgeSecurityServiceRequest" + "type": "google.cloud.compute_v1.types.AttachNetworkEndpointsNetworkEndpointGroupRequest" }, { "name": "project", "type": "str" }, { - "name": "region", + "name": "zone", "type": "str" }, { - "name": "network_edge_security_service", + "name": "network_endpoint_group", "type": "str" }, + { + "name": "network_endpoint_groups_attach_endpoints_request_resource", + "type": "google.cloud.compute_v1.types.NetworkEndpointGroupsAttachEndpointsRequest" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -27018,13 +29250,13 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "delete" + "shortName": "attach_network_endpoints" }, - "description": "Sample for Delete", - "file": "compute_v1_generated_network_edge_security_services_delete_sync.py", + "description": "Sample for AttachNetworkEndpoints", + "file": "compute_v1_generated_network_endpoint_groups_attach_network_endpoints_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_NetworkEdgeSecurityServices_Delete_sync", + "regionTag": "compute_v1_generated_NetworkEndpointGroups_AttachNetworkEndpoints_sync", "segments": [ { "end": 53, @@ -27057,39 +29289,39 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_network_edge_security_services_delete_sync.py" + "title": "compute_v1_generated_network_endpoint_groups_attach_network_endpoints_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.NetworkEdgeSecurityServicesClient", - "shortName": "NetworkEdgeSecurityServicesClient" + "fullName": "google.cloud.compute_v1.NetworkEndpointGroupsClient", + "shortName": "NetworkEndpointGroupsClient" }, - "fullName": "google.cloud.compute_v1.NetworkEdgeSecurityServicesClient.get", + "fullName": "google.cloud.compute_v1.NetworkEndpointGroupsClient.delete", "method": { - "fullName": "google.cloud.compute.v1.NetworkEdgeSecurityServices.Get", + "fullName": "google.cloud.compute.v1.NetworkEndpointGroups.Delete", "service": { - "fullName": "google.cloud.compute.v1.NetworkEdgeSecurityServices", - "shortName": "NetworkEdgeSecurityServices" + "fullName": "google.cloud.compute.v1.NetworkEndpointGroups", + "shortName": "NetworkEndpointGroups" }, - "shortName": "Get" + "shortName": "Delete" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetNetworkEdgeSecurityServiceRequest" + "type": "google.cloud.compute_v1.types.DeleteNetworkEndpointGroupRequest" }, { "name": "project", "type": "str" }, { - "name": "region", + "name": "zone", "type": "str" }, { - "name": "network_edge_security_service", + "name": "network_endpoint_group", "type": "str" }, { @@ -27105,14 +29337,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.NetworkEdgeSecurityService", - "shortName": "get" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "delete" }, - "description": "Sample for Get", - "file": "compute_v1_generated_network_edge_security_services_get_sync.py", + "description": "Sample for Delete", + "file": "compute_v1_generated_network_endpoint_groups_delete_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_NetworkEdgeSecurityServices_Get_sync", + "regionTag": "compute_v1_generated_NetworkEndpointGroups_Delete_sync", "segments": [ { "end": 53, @@ -27145,40 +29377,44 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_network_edge_security_services_get_sync.py" + "title": "compute_v1_generated_network_endpoint_groups_delete_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.NetworkEdgeSecurityServicesClient", - "shortName": "NetworkEdgeSecurityServicesClient" + "fullName": "google.cloud.compute_v1.NetworkEndpointGroupsClient", + "shortName": "NetworkEndpointGroupsClient" }, - "fullName": "google.cloud.compute_v1.NetworkEdgeSecurityServicesClient.insert", + "fullName": "google.cloud.compute_v1.NetworkEndpointGroupsClient.detach_network_endpoints", "method": { - "fullName": "google.cloud.compute.v1.NetworkEdgeSecurityServices.Insert", + "fullName": "google.cloud.compute.v1.NetworkEndpointGroups.DetachNetworkEndpoints", "service": { - "fullName": "google.cloud.compute.v1.NetworkEdgeSecurityServices", - "shortName": "NetworkEdgeSecurityServices" + "fullName": "google.cloud.compute.v1.NetworkEndpointGroups", + "shortName": "NetworkEndpointGroups" }, - "shortName": "Insert" + "shortName": "DetachNetworkEndpoints" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.InsertNetworkEdgeSecurityServiceRequest" + "type": "google.cloud.compute_v1.types.DetachNetworkEndpointsNetworkEndpointGroupRequest" }, { "name": "project", "type": "str" }, { - "name": "region", + "name": "zone", "type": "str" }, { - "name": "network_edge_security_service_resource", - "type": "google.cloud.compute_v1.types.NetworkEdgeSecurityService" + "name": "network_endpoint_group", + "type": "str" + }, + { + "name": "network_endpoint_groups_detach_endpoints_request_resource", + "type": "google.cloud.compute_v1.types.NetworkEndpointGroupsDetachEndpointsRequest" }, { "name": "retry", @@ -27194,21 +29430,21 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "insert" + "shortName": "detach_network_endpoints" }, - "description": "Sample for Insert", - "file": "compute_v1_generated_network_edge_security_services_insert_sync.py", + "description": "Sample for DetachNetworkEndpoints", + "file": "compute_v1_generated_network_endpoint_groups_detach_network_endpoints_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_NetworkEdgeSecurityServices_Insert_sync", + "regionTag": "compute_v1_generated_NetworkEndpointGroups_DetachNetworkEndpoints_sync", "segments": [ { - "end": 52, + "end": 53, "start": 27, "type": "FULL" }, { - "end": 52, + "end": 53, "start": 27, "type": "SHORT" }, @@ -27218,60 +29454,56 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 46, + "end": 47, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 49, - "start": 47, + "end": 50, + "start": 48, "type": "REQUEST_EXECUTION" }, { - "end": 53, - "start": 50, + "end": 54, + "start": 51, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_network_edge_security_services_insert_sync.py" + "title": "compute_v1_generated_network_endpoint_groups_detach_network_endpoints_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.NetworkEdgeSecurityServicesClient", - "shortName": "NetworkEdgeSecurityServicesClient" + "fullName": "google.cloud.compute_v1.NetworkEndpointGroupsClient", + "shortName": "NetworkEndpointGroupsClient" }, - "fullName": "google.cloud.compute_v1.NetworkEdgeSecurityServicesClient.patch", + "fullName": "google.cloud.compute_v1.NetworkEndpointGroupsClient.get", "method": { - "fullName": "google.cloud.compute.v1.NetworkEdgeSecurityServices.Patch", + "fullName": "google.cloud.compute.v1.NetworkEndpointGroups.Get", "service": { - "fullName": "google.cloud.compute.v1.NetworkEdgeSecurityServices", - "shortName": "NetworkEdgeSecurityServices" + "fullName": "google.cloud.compute.v1.NetworkEndpointGroups", + "shortName": "NetworkEndpointGroups" }, - "shortName": "Patch" + "shortName": "Get" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.PatchNetworkEdgeSecurityServiceRequest" + "type": "google.cloud.compute_v1.types.GetNetworkEndpointGroupRequest" }, { "name": "project", "type": "str" }, { - "name": "region", + "name": "zone", "type": "str" }, { - "name": "network_edge_security_service", + "name": "network_endpoint_group", "type": "str" }, - { - "name": "network_edge_security_service_resource", - "type": "google.cloud.compute_v1.types.NetworkEdgeSecurityService" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -27285,14 +29517,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "patch" + "resultType": "google.cloud.compute_v1.types.NetworkEndpointGroup", + "shortName": "get" }, - "description": "Sample for Patch", - "file": "compute_v1_generated_network_edge_security_services_patch_sync.py", + "description": "Sample for Get", + "file": "compute_v1_generated_network_endpoint_groups_get_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_NetworkEdgeSecurityServices_Patch_sync", + "regionTag": "compute_v1_generated_NetworkEndpointGroups_Get_sync", "segments": [ { "end": 53, @@ -27325,7 +29557,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_network_edge_security_services_patch_sync.py" + "title": "compute_v1_generated_network_endpoint_groups_get_sync.py" }, { "canonical": true, @@ -27334,24 +29566,32 @@ "fullName": "google.cloud.compute_v1.NetworkEndpointGroupsClient", "shortName": "NetworkEndpointGroupsClient" }, - "fullName": "google.cloud.compute_v1.NetworkEndpointGroupsClient.aggregated_list", + "fullName": "google.cloud.compute_v1.NetworkEndpointGroupsClient.insert", "method": { - "fullName": "google.cloud.compute.v1.NetworkEndpointGroups.AggregatedList", + "fullName": "google.cloud.compute.v1.NetworkEndpointGroups.Insert", "service": { "fullName": "google.cloud.compute.v1.NetworkEndpointGroups", "shortName": "NetworkEndpointGroups" }, - "shortName": "AggregatedList" + "shortName": "Insert" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.AggregatedListNetworkEndpointGroupsRequest" + "type": "google.cloud.compute_v1.types.InsertNetworkEndpointGroupRequest" }, { "name": "project", "type": "str" }, + { + "name": "zone", + "type": "str" + }, + { + "name": "network_endpoint_group_resource", + "type": "google.cloud.compute_v1.types.NetworkEndpointGroup" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -27365,14 +29605,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.services.network_endpoint_groups.pagers.AggregatedListPager", - "shortName": "aggregated_list" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "insert" }, - "description": "Sample for AggregatedList", - "file": "compute_v1_generated_network_endpoint_groups_aggregated_list_sync.py", + "description": "Sample for Insert", + "file": "compute_v1_generated_network_endpoint_groups_insert_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_NetworkEndpointGroups_AggregatedList_sync", + "regionTag": "compute_v1_generated_NetworkEndpointGroups_Insert_sync", "segments": [ { "end": 52, @@ -27390,22 +29630,22 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 45, + "end": 46, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 48, - "start": 46, + "end": 49, + "start": 47, "type": "REQUEST_EXECUTION" }, { "end": 53, - "start": 49, + "start": 50, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_network_endpoint_groups_aggregated_list_sync.py" + "title": "compute_v1_generated_network_endpoint_groups_insert_sync.py" }, { "canonical": true, @@ -27414,19 +29654,19 @@ "fullName": "google.cloud.compute_v1.NetworkEndpointGroupsClient", "shortName": "NetworkEndpointGroupsClient" }, - "fullName": "google.cloud.compute_v1.NetworkEndpointGroupsClient.attach_network_endpoints", + "fullName": "google.cloud.compute_v1.NetworkEndpointGroupsClient.list_network_endpoints", "method": { - "fullName": "google.cloud.compute.v1.NetworkEndpointGroups.AttachNetworkEndpoints", + "fullName": "google.cloud.compute.v1.NetworkEndpointGroups.ListNetworkEndpoints", "service": { "fullName": "google.cloud.compute.v1.NetworkEndpointGroups", "shortName": "NetworkEndpointGroups" }, - "shortName": "AttachNetworkEndpoints" + "shortName": "ListNetworkEndpoints" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.AttachNetworkEndpointsNetworkEndpointGroupRequest" + "type": "google.cloud.compute_v1.types.ListNetworkEndpointsNetworkEndpointGroupsRequest" }, { "name": "project", @@ -27441,8 +29681,8 @@ "type": "str" }, { - "name": "network_endpoint_groups_attach_endpoints_request_resource", - "type": "google.cloud.compute_v1.types.NetworkEndpointGroupsAttachEndpointsRequest" + "name": "network_endpoint_groups_list_endpoints_request_resource", + "type": "google.cloud.compute_v1.types.NetworkEndpointGroupsListEndpointsRequest" }, { "name": "retry", @@ -27457,22 +29697,22 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "attach_network_endpoints" + "resultType": "google.cloud.compute_v1.services.network_endpoint_groups.pagers.ListNetworkEndpointsPager", + "shortName": "list_network_endpoints" }, - "description": "Sample for AttachNetworkEndpoints", - "file": "compute_v1_generated_network_endpoint_groups_attach_network_endpoints_sync.py", + "description": "Sample for ListNetworkEndpoints", + "file": "compute_v1_generated_network_endpoint_groups_list_network_endpoints_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_NetworkEndpointGroups_AttachNetworkEndpoints_sync", + "regionTag": "compute_v1_generated_NetworkEndpointGroups_ListNetworkEndpoints_sync", "segments": [ { - "end": 53, + "end": 54, "start": 27, "type": "FULL" }, { - "end": 53, + "end": 54, "start": 27, "type": "SHORT" }, @@ -27492,12 +29732,12 @@ "type": "REQUEST_EXECUTION" }, { - "end": 54, + "end": 55, "start": 51, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_network_endpoint_groups_attach_network_endpoints_sync.py" + "title": "compute_v1_generated_network_endpoint_groups_list_network_endpoints_sync.py" }, { "canonical": true, @@ -27506,19 +29746,19 @@ "fullName": "google.cloud.compute_v1.NetworkEndpointGroupsClient", "shortName": "NetworkEndpointGroupsClient" }, - "fullName": "google.cloud.compute_v1.NetworkEndpointGroupsClient.delete", + "fullName": "google.cloud.compute_v1.NetworkEndpointGroupsClient.list", "method": { - "fullName": "google.cloud.compute.v1.NetworkEndpointGroups.Delete", + "fullName": "google.cloud.compute.v1.NetworkEndpointGroups.List", "service": { "fullName": "google.cloud.compute.v1.NetworkEndpointGroups", "shortName": "NetworkEndpointGroups" }, - "shortName": "Delete" + "shortName": "List" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.DeleteNetworkEndpointGroupRequest" + "type": "google.cloud.compute_v1.types.ListNetworkEndpointGroupsRequest" }, { "name": "project", @@ -27528,10 +29768,6 @@ "name": "zone", "type": "str" }, - { - "name": "network_endpoint_group", - "type": "str" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -27545,14 +29781,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "delete" + "resultType": "google.cloud.compute_v1.services.network_endpoint_groups.pagers.ListPager", + "shortName": "list" }, - "description": "Sample for Delete", - "file": "compute_v1_generated_network_endpoint_groups_delete_sync.py", + "description": "Sample for List", + "file": "compute_v1_generated_network_endpoint_groups_list_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_NetworkEndpointGroups_Delete_sync", + "regionTag": "compute_v1_generated_NetworkEndpointGroups_List_sync", "segments": [ { "end": 53, @@ -27570,22 +29806,22 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 47, + "end": 46, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 50, - "start": 48, + "end": 49, + "start": 47, "type": "REQUEST_EXECUTION" }, { "end": 54, - "start": 51, + "start": 50, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_network_endpoint_groups_delete_sync.py" + "title": "compute_v1_generated_network_endpoint_groups_list_sync.py" }, { "canonical": true, @@ -27594,19 +29830,19 @@ "fullName": "google.cloud.compute_v1.NetworkEndpointGroupsClient", "shortName": "NetworkEndpointGroupsClient" }, - "fullName": "google.cloud.compute_v1.NetworkEndpointGroupsClient.detach_network_endpoints", + "fullName": "google.cloud.compute_v1.NetworkEndpointGroupsClient.test_iam_permissions", "method": { - "fullName": "google.cloud.compute.v1.NetworkEndpointGroups.DetachNetworkEndpoints", + "fullName": "google.cloud.compute.v1.NetworkEndpointGroups.TestIamPermissions", "service": { "fullName": "google.cloud.compute.v1.NetworkEndpointGroups", "shortName": "NetworkEndpointGroups" }, - "shortName": "DetachNetworkEndpoints" + "shortName": "TestIamPermissions" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.DetachNetworkEndpointsNetworkEndpointGroupRequest" + "type": "google.cloud.compute_v1.types.TestIamPermissionsNetworkEndpointGroupRequest" }, { "name": "project", @@ -27617,12 +29853,12 @@ "type": "str" }, { - "name": "network_endpoint_group", + "name": "resource", "type": "str" }, { - "name": "network_endpoint_groups_detach_endpoints_request_resource", - "type": "google.cloud.compute_v1.types.NetworkEndpointGroupsDetachEndpointsRequest" + "name": "test_permissions_request_resource", + "type": "google.cloud.compute_v1.types.TestPermissionsRequest" }, { "name": "retry", @@ -27637,14 +29873,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "detach_network_endpoints" + "resultType": "google.cloud.compute_v1.types.TestPermissionsResponse", + "shortName": "test_iam_permissions" }, - "description": "Sample for DetachNetworkEndpoints", - "file": "compute_v1_generated_network_endpoint_groups_detach_network_endpoints_sync.py", + "description": "Sample for TestIamPermissions", + "file": "compute_v1_generated_network_endpoint_groups_test_iam_permissions_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_NetworkEndpointGroups_DetachNetworkEndpoints_sync", + "regionTag": "compute_v1_generated_NetworkEndpointGroups_TestIamPermissions_sync", "segments": [ { "end": 53, @@ -27677,40 +29913,40 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_network_endpoint_groups_detach_network_endpoints_sync.py" + "title": "compute_v1_generated_network_endpoint_groups_test_iam_permissions_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.NetworkEndpointGroupsClient", - "shortName": "NetworkEndpointGroupsClient" + "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient", + "shortName": "NetworkFirewallPoliciesClient" }, - "fullName": "google.cloud.compute_v1.NetworkEndpointGroupsClient.get", + "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient.add_association", "method": { - "fullName": "google.cloud.compute.v1.NetworkEndpointGroups.Get", + "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies.AddAssociation", "service": { - "fullName": "google.cloud.compute.v1.NetworkEndpointGroups", - "shortName": "NetworkEndpointGroups" + "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies", + "shortName": "NetworkFirewallPolicies" }, - "shortName": "Get" + "shortName": "AddAssociation" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetNetworkEndpointGroupRequest" + "type": "google.cloud.compute_v1.types.AddAssociationNetworkFirewallPolicyRequest" }, { "name": "project", "type": "str" }, { - "name": "zone", + "name": "firewall_policy", "type": "str" }, { - "name": "network_endpoint_group", - "type": "str" + "name": "firewall_policy_association_resource", + "type": "google.cloud.compute_v1.types.FirewallPolicyAssociation" }, { "name": "retry", @@ -27725,22 +29961,22 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.NetworkEndpointGroup", - "shortName": "get" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "add_association" }, - "description": "Sample for Get", - "file": "compute_v1_generated_network_endpoint_groups_get_sync.py", + "description": "Sample for AddAssociation", + "file": "compute_v1_generated_network_firewall_policies_add_association_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_NetworkEndpointGroups_Get_sync", + "regionTag": "compute_v1_generated_NetworkFirewallPolicies_AddAssociation_sync", "segments": [ { - "end": 53, + "end": 52, "start": 27, "type": "FULL" }, { - "end": 53, + "end": 52, "start": 27, "type": "SHORT" }, @@ -27750,55 +29986,55 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 47, + "end": 46, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 50, - "start": 48, + "end": 49, + "start": 47, "type": "REQUEST_EXECUTION" }, { - "end": 54, - "start": 51, + "end": 53, + "start": 50, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_network_endpoint_groups_get_sync.py" + "title": "compute_v1_generated_network_firewall_policies_add_association_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.NetworkEndpointGroupsClient", - "shortName": "NetworkEndpointGroupsClient" + "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient", + "shortName": "NetworkFirewallPoliciesClient" }, - "fullName": "google.cloud.compute_v1.NetworkEndpointGroupsClient.insert", + "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient.add_packet_mirroring_rule", "method": { - "fullName": "google.cloud.compute.v1.NetworkEndpointGroups.Insert", + "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies.AddPacketMirroringRule", "service": { - "fullName": "google.cloud.compute.v1.NetworkEndpointGroups", - "shortName": "NetworkEndpointGroups" + "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies", + "shortName": "NetworkFirewallPolicies" }, - "shortName": "Insert" + "shortName": "AddPacketMirroringRule" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.InsertNetworkEndpointGroupRequest" + "type": "google.cloud.compute_v1.types.AddPacketMirroringRuleNetworkFirewallPolicyRequest" }, { "name": "project", "type": "str" }, { - "name": "zone", + "name": "firewall_policy", "type": "str" }, { - "name": "network_endpoint_group_resource", - "type": "google.cloud.compute_v1.types.NetworkEndpointGroup" + "name": "firewall_policy_rule_resource", + "type": "google.cloud.compute_v1.types.FirewallPolicyRule" }, { "name": "retry", @@ -27814,13 +30050,13 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "insert" + "shortName": "add_packet_mirroring_rule" }, - "description": "Sample for Insert", - "file": "compute_v1_generated_network_endpoint_groups_insert_sync.py", + "description": "Sample for AddPacketMirroringRule", + "file": "compute_v1_generated_network_firewall_policies_add_packet_mirroring_rule_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_NetworkEndpointGroups_Insert_sync", + "regionTag": "compute_v1_generated_NetworkFirewallPolicies_AddPacketMirroringRule_sync", "segments": [ { "end": 52, @@ -27853,44 +30089,40 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_network_endpoint_groups_insert_sync.py" + "title": "compute_v1_generated_network_firewall_policies_add_packet_mirroring_rule_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.NetworkEndpointGroupsClient", - "shortName": "NetworkEndpointGroupsClient" + "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient", + "shortName": "NetworkFirewallPoliciesClient" }, - "fullName": "google.cloud.compute_v1.NetworkEndpointGroupsClient.list_network_endpoints", + "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient.add_rule", "method": { - "fullName": "google.cloud.compute.v1.NetworkEndpointGroups.ListNetworkEndpoints", + "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies.AddRule", "service": { - "fullName": "google.cloud.compute.v1.NetworkEndpointGroups", - "shortName": "NetworkEndpointGroups" + "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies", + "shortName": "NetworkFirewallPolicies" }, - "shortName": "ListNetworkEndpoints" + "shortName": "AddRule" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.ListNetworkEndpointsNetworkEndpointGroupsRequest" + "type": "google.cloud.compute_v1.types.AddRuleNetworkFirewallPolicyRequest" }, { "name": "project", "type": "str" }, { - "name": "zone", - "type": "str" - }, - { - "name": "network_endpoint_group", + "name": "firewall_policy", "type": "str" }, { - "name": "network_endpoint_groups_list_endpoints_request_resource", - "type": "google.cloud.compute_v1.types.NetworkEndpointGroupsListEndpointsRequest" + "name": "firewall_policy_rule_resource", + "type": "google.cloud.compute_v1.types.FirewallPolicyRule" }, { "name": "retry", @@ -27905,22 +30137,22 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.services.network_endpoint_groups.pagers.ListNetworkEndpointsPager", - "shortName": "list_network_endpoints" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "add_rule" }, - "description": "Sample for ListNetworkEndpoints", - "file": "compute_v1_generated_network_endpoint_groups_list_network_endpoints_sync.py", + "description": "Sample for AddRule", + "file": "compute_v1_generated_network_firewall_policies_add_rule_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_NetworkEndpointGroups_ListNetworkEndpoints_sync", + "regionTag": "compute_v1_generated_NetworkFirewallPolicies_AddRule_sync", "segments": [ { - "end": 54, + "end": 52, "start": 27, "type": "FULL" }, { - "end": 54, + "end": 52, "start": 27, "type": "SHORT" }, @@ -27930,52 +30162,48 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 47, + "end": 46, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 50, - "start": 48, + "end": 49, + "start": 47, "type": "REQUEST_EXECUTION" }, { - "end": 55, - "start": 51, + "end": 53, + "start": 50, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_network_endpoint_groups_list_network_endpoints_sync.py" + "title": "compute_v1_generated_network_firewall_policies_add_rule_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.NetworkEndpointGroupsClient", - "shortName": "NetworkEndpointGroupsClient" + "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient", + "shortName": "NetworkFirewallPoliciesClient" }, - "fullName": "google.cloud.compute_v1.NetworkEndpointGroupsClient.list", + "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient.aggregated_list", "method": { - "fullName": "google.cloud.compute.v1.NetworkEndpointGroups.List", + "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies.AggregatedList", "service": { - "fullName": "google.cloud.compute.v1.NetworkEndpointGroups", - "shortName": "NetworkEndpointGroups" + "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies", + "shortName": "NetworkFirewallPolicies" }, - "shortName": "List" + "shortName": "AggregatedList" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.ListNetworkEndpointGroupsRequest" + "type": "google.cloud.compute_v1.types.AggregatedListNetworkFirewallPoliciesRequest" }, { "name": "project", "type": "str" }, - { - "name": "zone", - "type": "str" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -27989,22 +30217,22 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.services.network_endpoint_groups.pagers.ListPager", - "shortName": "list" + "resultType": "google.cloud.compute_v1.services.network_firewall_policies.pagers.AggregatedListPager", + "shortName": "aggregated_list" }, - "description": "Sample for List", - "file": "compute_v1_generated_network_endpoint_groups_list_sync.py", + "description": "Sample for AggregatedList", + "file": "compute_v1_generated_network_firewall_policies_aggregated_list_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_NetworkEndpointGroups_List_sync", + "regionTag": "compute_v1_generated_NetworkFirewallPolicies_AggregatedList_sync", "segments": [ { - "end": 53, + "end": 52, "start": 27, "type": "FULL" }, { - "end": 53, + "end": 52, "start": 27, "type": "SHORT" }, @@ -28014,60 +30242,52 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 46, + "end": 45, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 49, - "start": 47, + "end": 48, + "start": 46, "type": "REQUEST_EXECUTION" }, { - "end": 54, - "start": 50, + "end": 53, + "start": 49, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_network_endpoint_groups_list_sync.py" + "title": "compute_v1_generated_network_firewall_policies_aggregated_list_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.NetworkEndpointGroupsClient", - "shortName": "NetworkEndpointGroupsClient" + "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient", + "shortName": "NetworkFirewallPoliciesClient" }, - "fullName": "google.cloud.compute_v1.NetworkEndpointGroupsClient.test_iam_permissions", + "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient.clone_rules", "method": { - "fullName": "google.cloud.compute.v1.NetworkEndpointGroups.TestIamPermissions", + "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies.CloneRules", "service": { - "fullName": "google.cloud.compute.v1.NetworkEndpointGroups", - "shortName": "NetworkEndpointGroups" + "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies", + "shortName": "NetworkFirewallPolicies" }, - "shortName": "TestIamPermissions" + "shortName": "CloneRules" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.TestIamPermissionsNetworkEndpointGroupRequest" + "type": "google.cloud.compute_v1.types.CloneRulesNetworkFirewallPolicyRequest" }, { "name": "project", "type": "str" }, { - "name": "zone", - "type": "str" - }, - { - "name": "resource", + "name": "firewall_policy", "type": "str" }, - { - "name": "test_permissions_request_resource", - "type": "google.cloud.compute_v1.types.TestPermissionsRequest" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -28081,22 +30301,22 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.TestPermissionsResponse", - "shortName": "test_iam_permissions" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "clone_rules" }, - "description": "Sample for TestIamPermissions", - "file": "compute_v1_generated_network_endpoint_groups_test_iam_permissions_sync.py", + "description": "Sample for CloneRules", + "file": "compute_v1_generated_network_firewall_policies_clone_rules_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_NetworkEndpointGroups_TestIamPermissions_sync", + "regionTag": "compute_v1_generated_NetworkFirewallPolicies_CloneRules_sync", "segments": [ { - "end": 53, + "end": 52, "start": 27, "type": "FULL" }, { - "end": 53, + "end": 52, "start": 27, "type": "SHORT" }, @@ -28106,22 +30326,22 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 47, + "end": 46, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 50, - "start": 48, + "end": 49, + "start": 47, "type": "REQUEST_EXECUTION" }, { - "end": 54, - "start": 51, + "end": 53, + "start": 50, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_network_endpoint_groups_test_iam_permissions_sync.py" + "title": "compute_v1_generated_network_firewall_policies_clone_rules_sync.py" }, { "canonical": true, @@ -28130,19 +30350,19 @@ "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient", "shortName": "NetworkFirewallPoliciesClient" }, - "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient.add_association", + "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient.delete", "method": { - "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies.AddAssociation", + "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies.Delete", "service": { "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies", "shortName": "NetworkFirewallPolicies" }, - "shortName": "AddAssociation" + "shortName": "Delete" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.AddAssociationNetworkFirewallPolicyRequest" + "type": "google.cloud.compute_v1.types.DeleteNetworkFirewallPolicyRequest" }, { "name": "project", @@ -28152,10 +30372,6 @@ "name": "firewall_policy", "type": "str" }, - { - "name": "firewall_policy_association_resource", - "type": "google.cloud.compute_v1.types.FirewallPolicyAssociation" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -28170,13 +30386,13 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "add_association" + "shortName": "delete" }, - "description": "Sample for AddAssociation", - "file": "compute_v1_generated_network_firewall_policies_add_association_sync.py", + "description": "Sample for Delete", + "file": "compute_v1_generated_network_firewall_policies_delete_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_NetworkFirewallPolicies_AddAssociation_sync", + "regionTag": "compute_v1_generated_NetworkFirewallPolicies_Delete_sync", "segments": [ { "end": 52, @@ -28209,7 +30425,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_network_firewall_policies_add_association_sync.py" + "title": "compute_v1_generated_network_firewall_policies_delete_sync.py" }, { "canonical": true, @@ -28218,19 +30434,19 @@ "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient", "shortName": "NetworkFirewallPoliciesClient" }, - "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient.add_packet_mirroring_rule", + "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient.get_association", "method": { - "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies.AddPacketMirroringRule", + "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies.GetAssociation", "service": { "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies", "shortName": "NetworkFirewallPolicies" }, - "shortName": "AddPacketMirroringRule" + "shortName": "GetAssociation" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.AddPacketMirroringRuleNetworkFirewallPolicyRequest" + "type": "google.cloud.compute_v1.types.GetAssociationNetworkFirewallPolicyRequest" }, { "name": "project", @@ -28240,10 +30456,6 @@ "name": "firewall_policy", "type": "str" }, - { - "name": "firewall_policy_rule_resource", - "type": "google.cloud.compute_v1.types.FirewallPolicyRule" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -28257,14 +30469,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "add_packet_mirroring_rule" + "resultType": "google.cloud.compute_v1.types.FirewallPolicyAssociation", + "shortName": "get_association" }, - "description": "Sample for AddPacketMirroringRule", - "file": "compute_v1_generated_network_firewall_policies_add_packet_mirroring_rule_sync.py", + "description": "Sample for GetAssociation", + "file": "compute_v1_generated_network_firewall_policies_get_association_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_NetworkFirewallPolicies_AddPacketMirroringRule_sync", + "regionTag": "compute_v1_generated_NetworkFirewallPolicies_GetAssociation_sync", "segments": [ { "end": 52, @@ -28297,7 +30509,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_network_firewall_policies_add_packet_mirroring_rule_sync.py" + "title": "compute_v1_generated_network_firewall_policies_get_association_sync.py" }, { "canonical": true, @@ -28306,32 +30518,28 @@ "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient", "shortName": "NetworkFirewallPoliciesClient" }, - "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient.add_rule", + "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient.get_iam_policy", "method": { - "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies.AddRule", + "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies.GetIamPolicy", "service": { "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies", "shortName": "NetworkFirewallPolicies" }, - "shortName": "AddRule" + "shortName": "GetIamPolicy" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.AddRuleNetworkFirewallPolicyRequest" + "type": "google.cloud.compute_v1.types.GetIamPolicyNetworkFirewallPolicyRequest" }, { "name": "project", "type": "str" }, { - "name": "firewall_policy", + "name": "resource", "type": "str" }, - { - "name": "firewall_policy_rule_resource", - "type": "google.cloud.compute_v1.types.FirewallPolicyRule" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -28345,14 +30553,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "add_rule" + "resultType": "google.cloud.compute_v1.types.Policy", + "shortName": "get_iam_policy" }, - "description": "Sample for AddRule", - "file": "compute_v1_generated_network_firewall_policies_add_rule_sync.py", + "description": "Sample for GetIamPolicy", + "file": "compute_v1_generated_network_firewall_policies_get_iam_policy_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_NetworkFirewallPolicies_AddRule_sync", + "regionTag": "compute_v1_generated_NetworkFirewallPolicies_GetIamPolicy_sync", "segments": [ { "end": 52, @@ -28385,87 +30593,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_network_firewall_policies_add_rule_sync.py" - }, - { - "canonical": true, - "clientMethod": { - "client": { - "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient", - "shortName": "NetworkFirewallPoliciesClient" - }, - "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient.aggregated_list", - "method": { - "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies.AggregatedList", - "service": { - "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies", - "shortName": "NetworkFirewallPolicies" - }, - "shortName": "AggregatedList" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.compute_v1.types.AggregatedListNetworkFirewallPoliciesRequest" - }, - { - "name": "project", - "type": "str" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, Union[str, bytes]]]" - } - ], - "resultType": "google.cloud.compute_v1.services.network_firewall_policies.pagers.AggregatedListPager", - "shortName": "aggregated_list" - }, - "description": "Sample for AggregatedList", - "file": "compute_v1_generated_network_firewall_policies_aggregated_list_sync.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_NetworkFirewallPolicies_AggregatedList_sync", - "segments": [ - { - "end": 52, - "start": 27, - "type": "FULL" - }, - { - "end": 52, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 45, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 48, - "start": 46, - "type": "REQUEST_EXECUTION" - }, - { - "end": 53, - "start": 49, - "type": "RESPONSE_HANDLING" - } - ], - "title": "compute_v1_generated_network_firewall_policies_aggregated_list_sync.py" + "title": "compute_v1_generated_network_firewall_policies_get_iam_policy_sync.py" }, { "canonical": true, @@ -28474,19 +30602,19 @@ "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient", "shortName": "NetworkFirewallPoliciesClient" }, - "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient.clone_rules", + "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient.get_packet_mirroring_rule", "method": { - "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies.CloneRules", + "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies.GetPacketMirroringRule", "service": { "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies", "shortName": "NetworkFirewallPolicies" }, - "shortName": "CloneRules" + "shortName": "GetPacketMirroringRule" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.CloneRulesNetworkFirewallPolicyRequest" + "type": "google.cloud.compute_v1.types.GetPacketMirroringRuleNetworkFirewallPolicyRequest" }, { "name": "project", @@ -28509,14 +30637,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "clone_rules" + "resultType": "google.cloud.compute_v1.types.FirewallPolicyRule", + "shortName": "get_packet_mirroring_rule" }, - "description": "Sample for CloneRules", - "file": "compute_v1_generated_network_firewall_policies_clone_rules_sync.py", + "description": "Sample for GetPacketMirroringRule", + "file": "compute_v1_generated_network_firewall_policies_get_packet_mirroring_rule_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_NetworkFirewallPolicies_CloneRules_sync", + "regionTag": "compute_v1_generated_NetworkFirewallPolicies_GetPacketMirroringRule_sync", "segments": [ { "end": 52, @@ -28549,7 +30677,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_network_firewall_policies_clone_rules_sync.py" + "title": "compute_v1_generated_network_firewall_policies_get_packet_mirroring_rule_sync.py" }, { "canonical": true, @@ -28558,19 +30686,19 @@ "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient", "shortName": "NetworkFirewallPoliciesClient" }, - "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient.delete", + "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient.get_rule", "method": { - "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies.Delete", + "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies.GetRule", "service": { "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies", "shortName": "NetworkFirewallPolicies" }, - "shortName": "Delete" + "shortName": "GetRule" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.DeleteNetworkFirewallPolicyRequest" + "type": "google.cloud.compute_v1.types.GetRuleNetworkFirewallPolicyRequest" }, { "name": "project", @@ -28593,14 +30721,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "delete" + "resultType": "google.cloud.compute_v1.types.FirewallPolicyRule", + "shortName": "get_rule" }, - "description": "Sample for Delete", - "file": "compute_v1_generated_network_firewall_policies_delete_sync.py", + "description": "Sample for GetRule", + "file": "compute_v1_generated_network_firewall_policies_get_rule_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_NetworkFirewallPolicies_Delete_sync", + "regionTag": "compute_v1_generated_NetworkFirewallPolicies_GetRule_sync", "segments": [ { "end": 52, @@ -28633,7 +30761,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_network_firewall_policies_delete_sync.py" + "title": "compute_v1_generated_network_firewall_policies_get_rule_sync.py" }, { "canonical": true, @@ -28642,19 +30770,19 @@ "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient", "shortName": "NetworkFirewallPoliciesClient" }, - "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient.get_association", + "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient.get", "method": { - "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies.GetAssociation", + "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies.Get", "service": { "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies", "shortName": "NetworkFirewallPolicies" }, - "shortName": "GetAssociation" + "shortName": "Get" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetAssociationNetworkFirewallPolicyRequest" + "type": "google.cloud.compute_v1.types.GetNetworkFirewallPolicyRequest" }, { "name": "project", @@ -28677,14 +30805,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.FirewallPolicyAssociation", - "shortName": "get_association" + "resultType": "google.cloud.compute_v1.types.FirewallPolicy", + "shortName": "get" }, - "description": "Sample for GetAssociation", - "file": "compute_v1_generated_network_firewall_policies_get_association_sync.py", + "description": "Sample for Get", + "file": "compute_v1_generated_network_firewall_policies_get_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_NetworkFirewallPolicies_GetAssociation_sync", + "regionTag": "compute_v1_generated_NetworkFirewallPolicies_Get_sync", "segments": [ { "end": 52, @@ -28717,7 +30845,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_network_firewall_policies_get_association_sync.py" + "title": "compute_v1_generated_network_firewall_policies_get_sync.py" }, { "canonical": true, @@ -28726,27 +30854,27 @@ "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient", "shortName": "NetworkFirewallPoliciesClient" }, - "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient.get_iam_policy", + "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient.insert", "method": { - "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies.GetIamPolicy", + "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies.Insert", "service": { "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies", "shortName": "NetworkFirewallPolicies" }, - "shortName": "GetIamPolicy" + "shortName": "Insert" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetIamPolicyNetworkFirewallPolicyRequest" + "type": "google.cloud.compute_v1.types.InsertNetworkFirewallPolicyRequest" }, { "name": "project", "type": "str" }, { - "name": "resource", - "type": "str" + "name": "firewall_policy_resource", + "type": "google.cloud.compute_v1.types.FirewallPolicy" }, { "name": "retry", @@ -28761,22 +30889,22 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.Policy", - "shortName": "get_iam_policy" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "insert" }, - "description": "Sample for GetIamPolicy", - "file": "compute_v1_generated_network_firewall_policies_get_iam_policy_sync.py", + "description": "Sample for Insert", + "file": "compute_v1_generated_network_firewall_policies_insert_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_NetworkFirewallPolicies_GetIamPolicy_sync", + "regionTag": "compute_v1_generated_NetworkFirewallPolicies_Insert_sync", "segments": [ { - "end": 52, + "end": 51, "start": 27, "type": "FULL" }, { - "end": 52, + "end": 51, "start": 27, "type": "SHORT" }, @@ -28786,22 +30914,22 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 46, + "end": 45, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 49, - "start": 47, + "end": 48, + "start": 46, "type": "REQUEST_EXECUTION" }, { - "end": 53, - "start": 50, + "end": 52, + "start": 49, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_network_firewall_policies_get_iam_policy_sync.py" + "title": "compute_v1_generated_network_firewall_policies_insert_sync.py" }, { "canonical": true, @@ -28810,28 +30938,24 @@ "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient", "shortName": "NetworkFirewallPoliciesClient" }, - "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient.get_packet_mirroring_rule", + "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient.list", "method": { - "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies.GetPacketMirroringRule", + "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies.List", "service": { "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies", "shortName": "NetworkFirewallPolicies" }, - "shortName": "GetPacketMirroringRule" + "shortName": "List" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetPacketMirroringRuleNetworkFirewallPolicyRequest" + "type": "google.cloud.compute_v1.types.ListNetworkFirewallPoliciesRequest" }, { "name": "project", "type": "str" }, - { - "name": "firewall_policy", - "type": "str" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -28845,14 +30969,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.FirewallPolicyRule", - "shortName": "get_packet_mirroring_rule" + "resultType": "google.cloud.compute_v1.services.network_firewall_policies.pagers.ListPager", + "shortName": "list" }, - "description": "Sample for GetPacketMirroringRule", - "file": "compute_v1_generated_network_firewall_policies_get_packet_mirroring_rule_sync.py", + "description": "Sample for List", + "file": "compute_v1_generated_network_firewall_policies_list_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_NetworkFirewallPolicies_GetPacketMirroringRule_sync", + "regionTag": "compute_v1_generated_NetworkFirewallPolicies_List_sync", "segments": [ { "end": 52, @@ -28870,22 +30994,22 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 46, + "end": 45, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 49, - "start": 47, + "end": 48, + "start": 46, "type": "REQUEST_EXECUTION" }, { "end": 53, - "start": 50, + "start": 49, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_network_firewall_policies_get_packet_mirroring_rule_sync.py" + "title": "compute_v1_generated_network_firewall_policies_list_sync.py" }, { "canonical": true, @@ -28894,19 +31018,19 @@ "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient", "shortName": "NetworkFirewallPoliciesClient" }, - "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient.get_rule", + "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient.patch_packet_mirroring_rule", "method": { - "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies.GetRule", + "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies.PatchPacketMirroringRule", "service": { "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies", "shortName": "NetworkFirewallPolicies" }, - "shortName": "GetRule" + "shortName": "PatchPacketMirroringRule" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetRuleNetworkFirewallPolicyRequest" + "type": "google.cloud.compute_v1.types.PatchPacketMirroringRuleNetworkFirewallPolicyRequest" }, { "name": "project", @@ -28916,6 +31040,10 @@ "name": "firewall_policy", "type": "str" }, + { + "name": "firewall_policy_rule_resource", + "type": "google.cloud.compute_v1.types.FirewallPolicyRule" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -28929,14 +31057,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.FirewallPolicyRule", - "shortName": "get_rule" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "patch_packet_mirroring_rule" }, - "description": "Sample for GetRule", - "file": "compute_v1_generated_network_firewall_policies_get_rule_sync.py", + "description": "Sample for PatchPacketMirroringRule", + "file": "compute_v1_generated_network_firewall_policies_patch_packet_mirroring_rule_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_NetworkFirewallPolicies_GetRule_sync", + "regionTag": "compute_v1_generated_NetworkFirewallPolicies_PatchPacketMirroringRule_sync", "segments": [ { "end": 52, @@ -28969,7 +31097,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_network_firewall_policies_get_rule_sync.py" + "title": "compute_v1_generated_network_firewall_policies_patch_packet_mirroring_rule_sync.py" }, { "canonical": true, @@ -28978,19 +31106,19 @@ "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient", "shortName": "NetworkFirewallPoliciesClient" }, - "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient.get", + "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient.patch_rule", "method": { - "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies.Get", + "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies.PatchRule", "service": { "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies", "shortName": "NetworkFirewallPolicies" }, - "shortName": "Get" + "shortName": "PatchRule" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetNetworkFirewallPolicyRequest" + "type": "google.cloud.compute_v1.types.PatchRuleNetworkFirewallPolicyRequest" }, { "name": "project", @@ -29000,6 +31128,10 @@ "name": "firewall_policy", "type": "str" }, + { + "name": "firewall_policy_rule_resource", + "type": "google.cloud.compute_v1.types.FirewallPolicyRule" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -29013,14 +31145,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.FirewallPolicy", - "shortName": "get" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "patch_rule" }, - "description": "Sample for Get", - "file": "compute_v1_generated_network_firewall_policies_get_sync.py", + "description": "Sample for PatchRule", + "file": "compute_v1_generated_network_firewall_policies_patch_rule_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_NetworkFirewallPolicies_Get_sync", + "regionTag": "compute_v1_generated_NetworkFirewallPolicies_PatchRule_sync", "segments": [ { "end": 52, @@ -29053,7 +31185,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_network_firewall_policies_get_sync.py" + "title": "compute_v1_generated_network_firewall_policies_patch_rule_sync.py" }, { "canonical": true, @@ -29062,24 +31194,28 @@ "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient", "shortName": "NetworkFirewallPoliciesClient" }, - "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient.insert", + "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient.patch", "method": { - "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies.Insert", + "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies.Patch", "service": { "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies", "shortName": "NetworkFirewallPolicies" }, - "shortName": "Insert" + "shortName": "Patch" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.InsertNetworkFirewallPolicyRequest" + "type": "google.cloud.compute_v1.types.PatchNetworkFirewallPolicyRequest" }, { "name": "project", "type": "str" }, + { + "name": "firewall_policy", + "type": "str" + }, { "name": "firewall_policy_resource", "type": "google.cloud.compute_v1.types.FirewallPolicy" @@ -29098,21 +31234,21 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "insert" + "shortName": "patch" }, - "description": "Sample for Insert", - "file": "compute_v1_generated_network_firewall_policies_insert_sync.py", + "description": "Sample for Patch", + "file": "compute_v1_generated_network_firewall_policies_patch_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_NetworkFirewallPolicies_Insert_sync", + "regionTag": "compute_v1_generated_NetworkFirewallPolicies_Patch_sync", "segments": [ { - "end": 51, + "end": 52, "start": 27, "type": "FULL" }, { - "end": 51, + "end": 52, "start": 27, "type": "SHORT" }, @@ -29122,22 +31258,22 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 45, + "end": 46, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 48, - "start": 46, + "end": 49, + "start": 47, "type": "REQUEST_EXECUTION" }, { - "end": 52, - "start": 49, + "end": 53, + "start": 50, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_network_firewall_policies_insert_sync.py" + "title": "compute_v1_generated_network_firewall_policies_patch_sync.py" }, { "canonical": true, @@ -29146,24 +31282,28 @@ "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient", "shortName": "NetworkFirewallPoliciesClient" }, - "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient.list", + "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient.remove_association", "method": { - "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies.List", + "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies.RemoveAssociation", "service": { "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies", "shortName": "NetworkFirewallPolicies" }, - "shortName": "List" + "shortName": "RemoveAssociation" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.ListNetworkFirewallPoliciesRequest" + "type": "google.cloud.compute_v1.types.RemoveAssociationNetworkFirewallPolicyRequest" }, { "name": "project", "type": "str" }, + { + "name": "firewall_policy", + "type": "str" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -29177,14 +31317,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.services.network_firewall_policies.pagers.ListPager", - "shortName": "list" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "remove_association" }, - "description": "Sample for List", - "file": "compute_v1_generated_network_firewall_policies_list_sync.py", + "description": "Sample for RemoveAssociation", + "file": "compute_v1_generated_network_firewall_policies_remove_association_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_NetworkFirewallPolicies_List_sync", + "regionTag": "compute_v1_generated_NetworkFirewallPolicies_RemoveAssociation_sync", "segments": [ { "end": 52, @@ -29202,22 +31342,22 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 45, + "end": 46, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 48, - "start": 46, + "end": 49, + "start": 47, "type": "REQUEST_EXECUTION" }, { "end": 53, - "start": 49, + "start": 50, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_network_firewall_policies_list_sync.py" + "title": "compute_v1_generated_network_firewall_policies_remove_association_sync.py" }, { "canonical": true, @@ -29226,19 +31366,19 @@ "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient", "shortName": "NetworkFirewallPoliciesClient" }, - "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient.patch_packet_mirroring_rule", + "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient.remove_packet_mirroring_rule", "method": { - "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies.PatchPacketMirroringRule", + "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies.RemovePacketMirroringRule", "service": { "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies", "shortName": "NetworkFirewallPolicies" }, - "shortName": "PatchPacketMirroringRule" + "shortName": "RemovePacketMirroringRule" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.PatchPacketMirroringRuleNetworkFirewallPolicyRequest" + "type": "google.cloud.compute_v1.types.RemovePacketMirroringRuleNetworkFirewallPolicyRequest" }, { "name": "project", @@ -29248,10 +31388,6 @@ "name": "firewall_policy", "type": "str" }, - { - "name": "firewall_policy_rule_resource", - "type": "google.cloud.compute_v1.types.FirewallPolicyRule" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -29266,13 +31402,13 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "patch_packet_mirroring_rule" + "shortName": "remove_packet_mirroring_rule" }, - "description": "Sample for PatchPacketMirroringRule", - "file": "compute_v1_generated_network_firewall_policies_patch_packet_mirroring_rule_sync.py", + "description": "Sample for RemovePacketMirroringRule", + "file": "compute_v1_generated_network_firewall_policies_remove_packet_mirroring_rule_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_NetworkFirewallPolicies_PatchPacketMirroringRule_sync", + "regionTag": "compute_v1_generated_NetworkFirewallPolicies_RemovePacketMirroringRule_sync", "segments": [ { "end": 52, @@ -29305,7 +31441,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_network_firewall_policies_patch_packet_mirroring_rule_sync.py" + "title": "compute_v1_generated_network_firewall_policies_remove_packet_mirroring_rule_sync.py" }, { "canonical": true, @@ -29314,19 +31450,19 @@ "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient", "shortName": "NetworkFirewallPoliciesClient" }, - "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient.patch_rule", + "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient.remove_rule", "method": { - "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies.PatchRule", + "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies.RemoveRule", "service": { "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies", "shortName": "NetworkFirewallPolicies" }, - "shortName": "PatchRule" + "shortName": "RemoveRule" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.PatchRuleNetworkFirewallPolicyRequest" + "type": "google.cloud.compute_v1.types.RemoveRuleNetworkFirewallPolicyRequest" }, { "name": "project", @@ -29336,10 +31472,6 @@ "name": "firewall_policy", "type": "str" }, - { - "name": "firewall_policy_rule_resource", - "type": "google.cloud.compute_v1.types.FirewallPolicyRule" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -29354,13 +31486,13 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "patch_rule" + "shortName": "remove_rule" }, - "description": "Sample for PatchRule", - "file": "compute_v1_generated_network_firewall_policies_patch_rule_sync.py", + "description": "Sample for RemoveRule", + "file": "compute_v1_generated_network_firewall_policies_remove_rule_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_NetworkFirewallPolicies_PatchRule_sync", + "regionTag": "compute_v1_generated_NetworkFirewallPolicies_RemoveRule_sync", "segments": [ { "end": 52, @@ -29393,7 +31525,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_network_firewall_policies_patch_rule_sync.py" + "title": "compute_v1_generated_network_firewall_policies_remove_rule_sync.py" }, { "canonical": true, @@ -29402,31 +31534,31 @@ "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient", "shortName": "NetworkFirewallPoliciesClient" }, - "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient.patch", + "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient.set_iam_policy", "method": { - "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies.Patch", + "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies.SetIamPolicy", "service": { "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies", "shortName": "NetworkFirewallPolicies" }, - "shortName": "Patch" + "shortName": "SetIamPolicy" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.PatchNetworkFirewallPolicyRequest" + "type": "google.cloud.compute_v1.types.SetIamPolicyNetworkFirewallPolicyRequest" }, { "name": "project", "type": "str" }, { - "name": "firewall_policy", + "name": "resource", "type": "str" }, { - "name": "firewall_policy_resource", - "type": "google.cloud.compute_v1.types.FirewallPolicy" + "name": "global_set_policy_request_resource", + "type": "google.cloud.compute_v1.types.GlobalSetPolicyRequest" }, { "name": "retry", @@ -29441,14 +31573,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "patch" + "resultType": "google.cloud.compute_v1.types.Policy", + "shortName": "set_iam_policy" }, - "description": "Sample for Patch", - "file": "compute_v1_generated_network_firewall_policies_patch_sync.py", + "description": "Sample for SetIamPolicy", + "file": "compute_v1_generated_network_firewall_policies_set_iam_policy_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_NetworkFirewallPolicies_Patch_sync", + "regionTag": "compute_v1_generated_NetworkFirewallPolicies_SetIamPolicy_sync", "segments": [ { "end": 52, @@ -29481,7 +31613,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_network_firewall_policies_patch_sync.py" + "title": "compute_v1_generated_network_firewall_policies_set_iam_policy_sync.py" }, { "canonical": true, @@ -29490,28 +31622,32 @@ "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient", "shortName": "NetworkFirewallPoliciesClient" }, - "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient.remove_association", + "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient.test_iam_permissions", "method": { - "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies.RemoveAssociation", + "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies.TestIamPermissions", "service": { "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies", "shortName": "NetworkFirewallPolicies" }, - "shortName": "RemoveAssociation" + "shortName": "TestIamPermissions" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.RemoveAssociationNetworkFirewallPolicyRequest" + "type": "google.cloud.compute_v1.types.TestIamPermissionsNetworkFirewallPolicyRequest" }, { "name": "project", "type": "str" }, { - "name": "firewall_policy", + "name": "resource", "type": "str" }, + { + "name": "test_permissions_request_resource", + "type": "google.cloud.compute_v1.types.TestPermissionsRequest" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -29525,14 +31661,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "remove_association" + "resultType": "google.cloud.compute_v1.types.TestPermissionsResponse", + "shortName": "test_iam_permissions" }, - "description": "Sample for RemoveAssociation", - "file": "compute_v1_generated_network_firewall_policies_remove_association_sync.py", + "description": "Sample for TestIamPermissions", + "file": "compute_v1_generated_network_firewall_policies_test_iam_permissions_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_NetworkFirewallPolicies_RemoveAssociation_sync", + "regionTag": "compute_v1_generated_NetworkFirewallPolicies_TestIamPermissions_sync", "segments": [ { "end": 52, @@ -29565,35 +31701,35 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_network_firewall_policies_remove_association_sync.py" + "title": "compute_v1_generated_network_firewall_policies_test_iam_permissions_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient", - "shortName": "NetworkFirewallPoliciesClient" + "fullName": "google.cloud.compute_v1.NetworkProfilesClient", + "shortName": "NetworkProfilesClient" }, - "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient.remove_packet_mirroring_rule", + "fullName": "google.cloud.compute_v1.NetworkProfilesClient.get", "method": { - "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies.RemovePacketMirroringRule", + "fullName": "google.cloud.compute.v1.NetworkProfiles.Get", "service": { - "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies", - "shortName": "NetworkFirewallPolicies" + "fullName": "google.cloud.compute.v1.NetworkProfiles", + "shortName": "NetworkProfiles" }, - "shortName": "RemovePacketMirroringRule" + "shortName": "Get" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.RemovePacketMirroringRuleNetworkFirewallPolicyRequest" + "type": "google.cloud.compute_v1.types.GetNetworkProfileRequest" }, { "name": "project", "type": "str" }, { - "name": "firewall_policy", + "name": "network_profile", "type": "str" }, { @@ -29609,14 +31745,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "remove_packet_mirroring_rule" + "resultType": "google.cloud.compute_v1.types.NetworkProfile", + "shortName": "get" }, - "description": "Sample for RemovePacketMirroringRule", - "file": "compute_v1_generated_network_firewall_policies_remove_packet_mirroring_rule_sync.py", + "description": "Sample for Get", + "file": "compute_v1_generated_network_profiles_get_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_NetworkFirewallPolicies_RemovePacketMirroringRule_sync", + "regionTag": "compute_v1_generated_NetworkProfiles_Get_sync", "segments": [ { "end": 52, @@ -29649,37 +31785,33 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_network_firewall_policies_remove_packet_mirroring_rule_sync.py" + "title": "compute_v1_generated_network_profiles_get_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient", - "shortName": "NetworkFirewallPoliciesClient" + "fullName": "google.cloud.compute_v1.NetworkProfilesClient", + "shortName": "NetworkProfilesClient" }, - "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient.remove_rule", + "fullName": "google.cloud.compute_v1.NetworkProfilesClient.list", "method": { - "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies.RemoveRule", + "fullName": "google.cloud.compute.v1.NetworkProfiles.List", "service": { - "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies", - "shortName": "NetworkFirewallPolicies" + "fullName": "google.cloud.compute.v1.NetworkProfiles", + "shortName": "NetworkProfiles" }, - "shortName": "RemoveRule" + "shortName": "List" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.RemoveRuleNetworkFirewallPolicyRequest" + "type": "google.cloud.compute_v1.types.ListNetworkProfilesRequest" }, { "name": "project", "type": "str" }, - { - "name": "firewall_policy", - "type": "str" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -29693,14 +31825,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "remove_rule" + "resultType": "google.cloud.compute_v1.services.network_profiles.pagers.ListPager", + "shortName": "list" }, - "description": "Sample for RemoveRule", - "file": "compute_v1_generated_network_firewall_policies_remove_rule_sync.py", + "description": "Sample for List", + "file": "compute_v1_generated_network_profiles_list_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_NetworkFirewallPolicies_RemoveRule_sync", + "regionTag": "compute_v1_generated_NetworkProfiles_List_sync", "segments": [ { "end": 52, @@ -29718,55 +31850,55 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 46, + "end": 45, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 49, - "start": 47, + "end": 48, + "start": 46, "type": "REQUEST_EXECUTION" }, { "end": 53, - "start": 50, + "start": 49, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_network_firewall_policies_remove_rule_sync.py" + "title": "compute_v1_generated_network_profiles_list_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient", - "shortName": "NetworkFirewallPoliciesClient" + "fullName": "google.cloud.compute_v1.NetworksClient", + "shortName": "NetworksClient" }, - "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient.set_iam_policy", + "fullName": "google.cloud.compute_v1.NetworksClient.add_peering", "method": { - "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies.SetIamPolicy", + "fullName": "google.cloud.compute.v1.Networks.AddPeering", "service": { - "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies", - "shortName": "NetworkFirewallPolicies" + "fullName": "google.cloud.compute.v1.Networks", + "shortName": "Networks" }, - "shortName": "SetIamPolicy" + "shortName": "AddPeering" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.SetIamPolicyNetworkFirewallPolicyRequest" + "type": "google.cloud.compute_v1.types.AddPeeringNetworkRequest" }, { "name": "project", "type": "str" }, { - "name": "resource", + "name": "network", "type": "str" }, { - "name": "global_set_policy_request_resource", - "type": "google.cloud.compute_v1.types.GlobalSetPolicyRequest" + "name": "networks_add_peering_request_resource", + "type": "google.cloud.compute_v1.types.NetworksAddPeeringRequest" }, { "name": "retry", @@ -29781,14 +31913,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.Policy", - "shortName": "set_iam_policy" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "add_peering" }, - "description": "Sample for SetIamPolicy", - "file": "compute_v1_generated_network_firewall_policies_set_iam_policy_sync.py", + "description": "Sample for AddPeering", + "file": "compute_v1_generated_networks_add_peering_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_NetworkFirewallPolicies_SetIamPolicy_sync", + "regionTag": "compute_v1_generated_Networks_AddPeering_sync", "segments": [ { "end": 52, @@ -29821,40 +31953,120 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_network_firewall_policies_set_iam_policy_sync.py" + "title": "compute_v1_generated_networks_add_peering_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient", - "shortName": "NetworkFirewallPoliciesClient" + "fullName": "google.cloud.compute_v1.NetworksClient", + "shortName": "NetworksClient" }, - "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient.test_iam_permissions", + "fullName": "google.cloud.compute_v1.NetworksClient.delete", "method": { - "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies.TestIamPermissions", + "fullName": "google.cloud.compute.v1.Networks.Delete", "service": { - "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies", - "shortName": "NetworkFirewallPolicies" + "fullName": "google.cloud.compute.v1.Networks", + "shortName": "Networks" }, - "shortName": "TestIamPermissions" + "shortName": "Delete" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.TestIamPermissionsNetworkFirewallPolicyRequest" + "type": "google.cloud.compute_v1.types.DeleteNetworkRequest" }, { "name": "project", "type": "str" }, { - "name": "resource", + "name": "network", "type": "str" }, { - "name": "test_permissions_request_resource", - "type": "google.cloud.compute_v1.types.TestPermissionsRequest" + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "delete" + }, + "description": "Sample for Delete", + "file": "compute_v1_generated_networks_delete_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "compute_v1_generated_Networks_Delete_sync", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 46, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 49, + "start": 47, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "compute_v1_generated_networks_delete_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.compute_v1.NetworksClient", + "shortName": "NetworksClient" + }, + "fullName": "google.cloud.compute_v1.NetworksClient.get_effective_firewalls", + "method": { + "fullName": "google.cloud.compute.v1.Networks.GetEffectiveFirewalls", + "service": { + "fullName": "google.cloud.compute.v1.Networks", + "shortName": "Networks" + }, + "shortName": "GetEffectiveFirewalls" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.compute_v1.types.GetEffectiveFirewallsNetworkRequest" + }, + { + "name": "project", + "type": "str" + }, + { + "name": "network", + "type": "str" }, { "name": "retry", @@ -29869,14 +32081,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.TestPermissionsResponse", - "shortName": "test_iam_permissions" + "resultType": "google.cloud.compute_v1.types.NetworksGetEffectiveFirewallsResponse", + "shortName": "get_effective_firewalls" }, - "description": "Sample for TestIamPermissions", - "file": "compute_v1_generated_network_firewall_policies_test_iam_permissions_sync.py", + "description": "Sample for GetEffectiveFirewalls", + "file": "compute_v1_generated_networks_get_effective_firewalls_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_NetworkFirewallPolicies_TestIamPermissions_sync", + "regionTag": "compute_v1_generated_Networks_GetEffectiveFirewalls_sync", "segments": [ { "end": 52, @@ -29909,35 +32121,35 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_network_firewall_policies_test_iam_permissions_sync.py" + "title": "compute_v1_generated_networks_get_effective_firewalls_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.NetworkProfilesClient", - "shortName": "NetworkProfilesClient" + "fullName": "google.cloud.compute_v1.NetworksClient", + "shortName": "NetworksClient" }, - "fullName": "google.cloud.compute_v1.NetworkProfilesClient.get", + "fullName": "google.cloud.compute_v1.NetworksClient.get", "method": { - "fullName": "google.cloud.compute.v1.NetworkProfiles.Get", + "fullName": "google.cloud.compute.v1.Networks.Get", "service": { - "fullName": "google.cloud.compute.v1.NetworkProfiles", - "shortName": "NetworkProfiles" + "fullName": "google.cloud.compute.v1.Networks", + "shortName": "Networks" }, "shortName": "Get" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetNetworkProfileRequest" + "type": "google.cloud.compute_v1.types.GetNetworkRequest" }, { "name": "project", "type": "str" }, { - "name": "network_profile", + "name": "network", "type": "str" }, { @@ -29953,14 +32165,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.NetworkProfile", + "resultType": "google.cloud.compute_v1.types.Network", "shortName": "get" }, "description": "Sample for Get", - "file": "compute_v1_generated_network_profiles_get_sync.py", + "file": "compute_v1_generated_networks_get_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_NetworkProfiles_Get_sync", + "regionTag": "compute_v1_generated_Networks_Get_sync", "segments": [ { "end": 52, @@ -29993,33 +32205,37 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_network_profiles_get_sync.py" + "title": "compute_v1_generated_networks_get_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.NetworkProfilesClient", - "shortName": "NetworkProfilesClient" + "fullName": "google.cloud.compute_v1.NetworksClient", + "shortName": "NetworksClient" }, - "fullName": "google.cloud.compute_v1.NetworkProfilesClient.list", + "fullName": "google.cloud.compute_v1.NetworksClient.insert", "method": { - "fullName": "google.cloud.compute.v1.NetworkProfiles.List", + "fullName": "google.cloud.compute.v1.Networks.Insert", "service": { - "fullName": "google.cloud.compute.v1.NetworkProfiles", - "shortName": "NetworkProfiles" + "fullName": "google.cloud.compute.v1.Networks", + "shortName": "Networks" }, - "shortName": "List" + "shortName": "Insert" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.ListNetworkProfilesRequest" + "type": "google.cloud.compute_v1.types.InsertNetworkRequest" }, { "name": "project", "type": "str" }, + { + "name": "network_resource", + "type": "google.cloud.compute_v1.types.Network" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -30033,22 +32249,22 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.services.network_profiles.pagers.ListPager", - "shortName": "list" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "insert" }, - "description": "Sample for List", - "file": "compute_v1_generated_network_profiles_list_sync.py", + "description": "Sample for Insert", + "file": "compute_v1_generated_networks_insert_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_NetworkProfiles_List_sync", + "regionTag": "compute_v1_generated_Networks_Insert_sync", "segments": [ { - "end": 52, + "end": 51, "start": 27, "type": "FULL" }, { - "end": 52, + "end": 51, "start": 27, "type": "SHORT" }, @@ -30068,12 +32284,12 @@ "type": "REQUEST_EXECUTION" }, { - "end": 53, + "end": 52, "start": 49, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_network_profiles_list_sync.py" + "title": "compute_v1_generated_networks_insert_sync.py" }, { "canonical": true, @@ -30082,19 +32298,19 @@ "fullName": "google.cloud.compute_v1.NetworksClient", "shortName": "NetworksClient" }, - "fullName": "google.cloud.compute_v1.NetworksClient.add_peering", + "fullName": "google.cloud.compute_v1.NetworksClient.list_peering_routes", "method": { - "fullName": "google.cloud.compute.v1.Networks.AddPeering", + "fullName": "google.cloud.compute.v1.Networks.ListPeeringRoutes", "service": { "fullName": "google.cloud.compute.v1.Networks", "shortName": "Networks" }, - "shortName": "AddPeering" + "shortName": "ListPeeringRoutes" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.AddPeeringNetworkRequest" + "type": "google.cloud.compute_v1.types.ListPeeringRoutesNetworksRequest" }, { "name": "project", @@ -30104,10 +32320,6 @@ "name": "network", "type": "str" }, - { - "name": "networks_add_peering_request_resource", - "type": "google.cloud.compute_v1.types.NetworksAddPeeringRequest" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -30121,22 +32333,22 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "add_peering" + "resultType": "google.cloud.compute_v1.services.networks.pagers.ListPeeringRoutesPager", + "shortName": "list_peering_routes" }, - "description": "Sample for AddPeering", - "file": "compute_v1_generated_networks_add_peering_sync.py", + "description": "Sample for ListPeeringRoutes", + "file": "compute_v1_generated_networks_list_peering_routes_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_Networks_AddPeering_sync", + "regionTag": "compute_v1_generated_Networks_ListPeeringRoutes_sync", "segments": [ { - "end": 52, + "end": 53, "start": 27, "type": "FULL" }, { - "end": 52, + "end": 53, "start": 27, "type": "SHORT" }, @@ -30156,12 +32368,12 @@ "type": "REQUEST_EXECUTION" }, { - "end": 53, + "end": 54, "start": 50, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_networks_add_peering_sync.py" + "title": "compute_v1_generated_networks_list_peering_routes_sync.py" }, { "canonical": true, @@ -30170,28 +32382,24 @@ "fullName": "google.cloud.compute_v1.NetworksClient", "shortName": "NetworksClient" }, - "fullName": "google.cloud.compute_v1.NetworksClient.delete", + "fullName": "google.cloud.compute_v1.NetworksClient.list", "method": { - "fullName": "google.cloud.compute.v1.Networks.Delete", + "fullName": "google.cloud.compute.v1.Networks.List", "service": { "fullName": "google.cloud.compute.v1.Networks", "shortName": "Networks" }, - "shortName": "Delete" + "shortName": "List" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.DeleteNetworkRequest" + "type": "google.cloud.compute_v1.types.ListNetworksRequest" }, { "name": "project", "type": "str" }, - { - "name": "network", - "type": "str" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -30205,14 +32413,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "delete" + "resultType": "google.cloud.compute_v1.services.networks.pagers.ListPager", + "shortName": "list" }, - "description": "Sample for Delete", - "file": "compute_v1_generated_networks_delete_sync.py", + "description": "Sample for List", + "file": "compute_v1_generated_networks_list_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_Networks_Delete_sync", + "regionTag": "compute_v1_generated_Networks_List_sync", "segments": [ { "end": 52, @@ -30230,22 +32438,22 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 46, + "end": 45, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 49, - "start": 47, + "end": 48, + "start": 46, "type": "REQUEST_EXECUTION" }, { "end": 53, - "start": 50, + "start": 49, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_networks_delete_sync.py" + "title": "compute_v1_generated_networks_list_sync.py" }, { "canonical": true, @@ -30254,19 +32462,19 @@ "fullName": "google.cloud.compute_v1.NetworksClient", "shortName": "NetworksClient" }, - "fullName": "google.cloud.compute_v1.NetworksClient.get_effective_firewalls", + "fullName": "google.cloud.compute_v1.NetworksClient.patch", "method": { - "fullName": "google.cloud.compute.v1.Networks.GetEffectiveFirewalls", + "fullName": "google.cloud.compute.v1.Networks.Patch", "service": { "fullName": "google.cloud.compute.v1.Networks", "shortName": "Networks" }, - "shortName": "GetEffectiveFirewalls" + "shortName": "Patch" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetEffectiveFirewallsNetworkRequest" + "type": "google.cloud.compute_v1.types.PatchNetworkRequest" }, { "name": "project", @@ -30276,6 +32484,10 @@ "name": "network", "type": "str" }, + { + "name": "network_resource", + "type": "google.cloud.compute_v1.types.Network" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -30289,14 +32501,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.NetworksGetEffectiveFirewallsResponse", - "shortName": "get_effective_firewalls" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "patch" }, - "description": "Sample for GetEffectiveFirewalls", - "file": "compute_v1_generated_networks_get_effective_firewalls_sync.py", + "description": "Sample for Patch", + "file": "compute_v1_generated_networks_patch_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_Networks_GetEffectiveFirewalls_sync", + "regionTag": "compute_v1_generated_Networks_Patch_sync", "segments": [ { "end": 52, @@ -30329,7 +32541,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_networks_get_effective_firewalls_sync.py" + "title": "compute_v1_generated_networks_patch_sync.py" }, { "canonical": true, @@ -30338,19 +32550,19 @@ "fullName": "google.cloud.compute_v1.NetworksClient", "shortName": "NetworksClient" }, - "fullName": "google.cloud.compute_v1.NetworksClient.get", + "fullName": "google.cloud.compute_v1.NetworksClient.remove_peering", "method": { - "fullName": "google.cloud.compute.v1.Networks.Get", + "fullName": "google.cloud.compute.v1.Networks.RemovePeering", "service": { "fullName": "google.cloud.compute.v1.Networks", "shortName": "Networks" }, - "shortName": "Get" + "shortName": "RemovePeering" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetNetworkRequest" + "type": "google.cloud.compute_v1.types.RemovePeeringNetworkRequest" }, { "name": "project", @@ -30360,6 +32572,10 @@ "name": "network", "type": "str" }, + { + "name": "networks_remove_peering_request_resource", + "type": "google.cloud.compute_v1.types.NetworksRemovePeeringRequest" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -30373,14 +32589,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.Network", - "shortName": "get" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "remove_peering" }, - "description": "Sample for Get", - "file": "compute_v1_generated_networks_get_sync.py", + "description": "Sample for RemovePeering", + "file": "compute_v1_generated_networks_remove_peering_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_Networks_Get_sync", + "regionTag": "compute_v1_generated_Networks_RemovePeering_sync", "segments": [ { "end": 52, @@ -30413,7 +32629,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_networks_get_sync.py" + "title": "compute_v1_generated_networks_remove_peering_sync.py" }, { "canonical": true, @@ -30422,27 +32638,27 @@ "fullName": "google.cloud.compute_v1.NetworksClient", "shortName": "NetworksClient" }, - "fullName": "google.cloud.compute_v1.NetworksClient.insert", + "fullName": "google.cloud.compute_v1.NetworksClient.switch_to_custom_mode", "method": { - "fullName": "google.cloud.compute.v1.Networks.Insert", + "fullName": "google.cloud.compute.v1.Networks.SwitchToCustomMode", "service": { "fullName": "google.cloud.compute.v1.Networks", "shortName": "Networks" }, - "shortName": "Insert" + "shortName": "SwitchToCustomMode" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.InsertNetworkRequest" + "type": "google.cloud.compute_v1.types.SwitchToCustomModeNetworkRequest" }, { "name": "project", "type": "str" }, { - "name": "network_resource", - "type": "google.cloud.compute_v1.types.Network" + "name": "network", + "type": "str" }, { "name": "retry", @@ -30458,21 +32674,21 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "insert" + "shortName": "switch_to_custom_mode" }, - "description": "Sample for Insert", - "file": "compute_v1_generated_networks_insert_sync.py", + "description": "Sample for SwitchToCustomMode", + "file": "compute_v1_generated_networks_switch_to_custom_mode_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_Networks_Insert_sync", + "regionTag": "compute_v1_generated_Networks_SwitchToCustomMode_sync", "segments": [ { - "end": 51, + "end": 52, "start": 27, "type": "FULL" }, { - "end": 51, + "end": 52, "start": 27, "type": "SHORT" }, @@ -30482,22 +32698,22 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 45, + "end": 46, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 48, - "start": 46, + "end": 49, + "start": 47, "type": "REQUEST_EXECUTION" }, { - "end": 52, - "start": 49, + "end": 53, + "start": 50, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_networks_insert_sync.py" + "title": "compute_v1_generated_networks_switch_to_custom_mode_sync.py" }, { "canonical": true, @@ -30506,19 +32722,19 @@ "fullName": "google.cloud.compute_v1.NetworksClient", "shortName": "NetworksClient" }, - "fullName": "google.cloud.compute_v1.NetworksClient.list_peering_routes", + "fullName": "google.cloud.compute_v1.NetworksClient.update_peering", "method": { - "fullName": "google.cloud.compute.v1.Networks.ListPeeringRoutes", + "fullName": "google.cloud.compute.v1.Networks.UpdatePeering", "service": { "fullName": "google.cloud.compute.v1.Networks", "shortName": "Networks" }, - "shortName": "ListPeeringRoutes" + "shortName": "UpdatePeering" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.ListPeeringRoutesNetworksRequest" + "type": "google.cloud.compute_v1.types.UpdatePeeringNetworkRequest" }, { "name": "project", @@ -30528,6 +32744,10 @@ "name": "network", "type": "str" }, + { + "name": "networks_update_peering_request_resource", + "type": "google.cloud.compute_v1.types.NetworksUpdatePeeringRequest" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -30541,22 +32761,22 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.services.networks.pagers.ListPeeringRoutesPager", - "shortName": "list_peering_routes" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "update_peering" }, - "description": "Sample for ListPeeringRoutes", - "file": "compute_v1_generated_networks_list_peering_routes_sync.py", + "description": "Sample for UpdatePeering", + "file": "compute_v1_generated_networks_update_peering_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_Networks_ListPeeringRoutes_sync", + "regionTag": "compute_v1_generated_Networks_UpdatePeering_sync", "segments": [ { - "end": 53, + "end": 52, "start": 27, "type": "FULL" }, { - "end": 53, + "end": 52, "start": 27, "type": "SHORT" }, @@ -30576,38 +32796,50 @@ "type": "REQUEST_EXECUTION" }, { - "end": 54, + "end": 53, "start": 50, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_networks_list_peering_routes_sync.py" + "title": "compute_v1_generated_networks_update_peering_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.NetworksClient", - "shortName": "NetworksClient" + "fullName": "google.cloud.compute_v1.NodeGroupsClient", + "shortName": "NodeGroupsClient" }, - "fullName": "google.cloud.compute_v1.NetworksClient.list", + "fullName": "google.cloud.compute_v1.NodeGroupsClient.add_nodes", "method": { - "fullName": "google.cloud.compute.v1.Networks.List", + "fullName": "google.cloud.compute.v1.NodeGroups.AddNodes", "service": { - "fullName": "google.cloud.compute.v1.Networks", - "shortName": "Networks" + "fullName": "google.cloud.compute.v1.NodeGroups", + "shortName": "NodeGroups" }, - "shortName": "List" + "shortName": "AddNodes" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.ListNetworksRequest" + "type": "google.cloud.compute_v1.types.AddNodesNodeGroupRequest" }, { "name": "project", "type": "str" }, + { + "name": "zone", + "type": "str" + }, + { + "name": "node_group", + "type": "str" + }, + { + "name": "node_groups_add_nodes_request_resource", + "type": "google.cloud.compute_v1.types.NodeGroupsAddNodesRequest" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -30621,22 +32853,22 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.services.networks.pagers.ListPager", - "shortName": "list" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "add_nodes" }, - "description": "Sample for List", - "file": "compute_v1_generated_networks_list_sync.py", + "description": "Sample for AddNodes", + "file": "compute_v1_generated_node_groups_add_nodes_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_Networks_List_sync", + "regionTag": "compute_v1_generated_NodeGroups_AddNodes_sync", "segments": [ { - "end": 52, + "end": 53, "start": 27, "type": "FULL" }, { - "end": 52, + "end": 53, "start": 27, "type": "SHORT" }, @@ -30646,56 +32878,48 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 45, + "end": 47, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 48, - "start": 46, + "end": 50, + "start": 48, "type": "REQUEST_EXECUTION" }, { - "end": 53, - "start": 49, + "end": 54, + "start": 51, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_networks_list_sync.py" + "title": "compute_v1_generated_node_groups_add_nodes_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.NetworksClient", - "shortName": "NetworksClient" + "fullName": "google.cloud.compute_v1.NodeGroupsClient", + "shortName": "NodeGroupsClient" }, - "fullName": "google.cloud.compute_v1.NetworksClient.patch", + "fullName": "google.cloud.compute_v1.NodeGroupsClient.aggregated_list", "method": { - "fullName": "google.cloud.compute.v1.Networks.Patch", + "fullName": "google.cloud.compute.v1.NodeGroups.AggregatedList", "service": { - "fullName": "google.cloud.compute.v1.Networks", - "shortName": "Networks" + "fullName": "google.cloud.compute.v1.NodeGroups", + "shortName": "NodeGroups" }, - "shortName": "Patch" + "shortName": "AggregatedList" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.PatchNetworkRequest" + "type": "google.cloud.compute_v1.types.AggregatedListNodeGroupsRequest" }, { "name": "project", "type": "str" }, - { - "name": "network", - "type": "str" - }, - { - "name": "network_resource", - "type": "google.cloud.compute_v1.types.Network" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -30709,14 +32933,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "patch" + "resultType": "google.cloud.compute_v1.services.node_groups.pagers.AggregatedListPager", + "shortName": "aggregated_list" }, - "description": "Sample for Patch", - "file": "compute_v1_generated_networks_patch_sync.py", + "description": "Sample for AggregatedList", + "file": "compute_v1_generated_node_groups_aggregated_list_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_Networks_Patch_sync", + "regionTag": "compute_v1_generated_NodeGroups_AggregatedList_sync", "segments": [ { "end": 52, @@ -30734,55 +32958,59 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 46, + "end": 45, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 49, - "start": 47, + "end": 48, + "start": 46, "type": "REQUEST_EXECUTION" }, { "end": 53, - "start": 50, + "start": 49, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_networks_patch_sync.py" + "title": "compute_v1_generated_node_groups_aggregated_list_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.NetworksClient", - "shortName": "NetworksClient" + "fullName": "google.cloud.compute_v1.NodeGroupsClient", + "shortName": "NodeGroupsClient" }, - "fullName": "google.cloud.compute_v1.NetworksClient.remove_peering", + "fullName": "google.cloud.compute_v1.NodeGroupsClient.delete_nodes", "method": { - "fullName": "google.cloud.compute.v1.Networks.RemovePeering", + "fullName": "google.cloud.compute.v1.NodeGroups.DeleteNodes", "service": { - "fullName": "google.cloud.compute.v1.Networks", - "shortName": "Networks" + "fullName": "google.cloud.compute.v1.NodeGroups", + "shortName": "NodeGroups" }, - "shortName": "RemovePeering" + "shortName": "DeleteNodes" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.RemovePeeringNetworkRequest" + "type": "google.cloud.compute_v1.types.DeleteNodesNodeGroupRequest" }, { "name": "project", "type": "str" }, { - "name": "network", + "name": "zone", "type": "str" }, { - "name": "networks_remove_peering_request_resource", - "type": "google.cloud.compute_v1.types.NetworksRemovePeeringRequest" + "name": "node_group", + "type": "str" + }, + { + "name": "node_groups_delete_nodes_request_resource", + "type": "google.cloud.compute_v1.types.NodeGroupsDeleteNodesRequest" }, { "name": "retry", @@ -30798,21 +33026,21 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "remove_peering" + "shortName": "delete_nodes" }, - "description": "Sample for RemovePeering", - "file": "compute_v1_generated_networks_remove_peering_sync.py", + "description": "Sample for DeleteNodes", + "file": "compute_v1_generated_node_groups_delete_nodes_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_Networks_RemovePeering_sync", + "regionTag": "compute_v1_generated_NodeGroups_DeleteNodes_sync", "segments": [ { - "end": 52, + "end": 53, "start": 27, "type": "FULL" }, { - "end": 52, + "end": 53, "start": 27, "type": "SHORT" }, @@ -30822,50 +33050,54 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 46, + "end": 47, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 49, - "start": 47, + "end": 50, + "start": 48, "type": "REQUEST_EXECUTION" }, { - "end": 53, - "start": 50, + "end": 54, + "start": 51, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_networks_remove_peering_sync.py" + "title": "compute_v1_generated_node_groups_delete_nodes_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.NetworksClient", - "shortName": "NetworksClient" + "fullName": "google.cloud.compute_v1.NodeGroupsClient", + "shortName": "NodeGroupsClient" }, - "fullName": "google.cloud.compute_v1.NetworksClient.switch_to_custom_mode", + "fullName": "google.cloud.compute_v1.NodeGroupsClient.delete", "method": { - "fullName": "google.cloud.compute.v1.Networks.SwitchToCustomMode", + "fullName": "google.cloud.compute.v1.NodeGroups.Delete", "service": { - "fullName": "google.cloud.compute.v1.Networks", - "shortName": "Networks" + "fullName": "google.cloud.compute.v1.NodeGroups", + "shortName": "NodeGroups" }, - "shortName": "SwitchToCustomMode" + "shortName": "Delete" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.SwitchToCustomModeNetworkRequest" + "type": "google.cloud.compute_v1.types.DeleteNodeGroupRequest" }, { "name": "project", "type": "str" }, { - "name": "network", + "name": "zone", + "type": "str" + }, + { + "name": "node_group", "type": "str" }, { @@ -30882,21 +33114,21 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "switch_to_custom_mode" + "shortName": "delete" }, - "description": "Sample for SwitchToCustomMode", - "file": "compute_v1_generated_networks_switch_to_custom_mode_sync.py", + "description": "Sample for Delete", + "file": "compute_v1_generated_node_groups_delete_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_Networks_SwitchToCustomMode_sync", + "regionTag": "compute_v1_generated_NodeGroups_Delete_sync", "segments": [ { - "end": 52, + "end": 53, "start": 27, "type": "FULL" }, { - "end": 52, + "end": 53, "start": 27, "type": "SHORT" }, @@ -30906,55 +33138,55 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 46, + "end": 47, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 49, - "start": 47, + "end": 50, + "start": 48, "type": "REQUEST_EXECUTION" }, { - "end": 53, - "start": 50, + "end": 54, + "start": 51, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_networks_switch_to_custom_mode_sync.py" + "title": "compute_v1_generated_node_groups_delete_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.NetworksClient", - "shortName": "NetworksClient" + "fullName": "google.cloud.compute_v1.NodeGroupsClient", + "shortName": "NodeGroupsClient" }, - "fullName": "google.cloud.compute_v1.NetworksClient.update_peering", + "fullName": "google.cloud.compute_v1.NodeGroupsClient.get_iam_policy", "method": { - "fullName": "google.cloud.compute.v1.Networks.UpdatePeering", + "fullName": "google.cloud.compute.v1.NodeGroups.GetIamPolicy", "service": { - "fullName": "google.cloud.compute.v1.Networks", - "shortName": "Networks" + "fullName": "google.cloud.compute.v1.NodeGroups", + "shortName": "NodeGroups" }, - "shortName": "UpdatePeering" + "shortName": "GetIamPolicy" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.UpdatePeeringNetworkRequest" + "type": "google.cloud.compute_v1.types.GetIamPolicyNodeGroupRequest" }, { "name": "project", "type": "str" }, { - "name": "network", + "name": "zone", "type": "str" }, { - "name": "networks_update_peering_request_resource", - "type": "google.cloud.compute_v1.types.NetworksUpdatePeeringRequest" + "name": "resource", + "type": "str" }, { "name": "retry", @@ -30969,22 +33201,22 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "update_peering" + "resultType": "google.cloud.compute_v1.types.Policy", + "shortName": "get_iam_policy" }, - "description": "Sample for UpdatePeering", - "file": "compute_v1_generated_networks_update_peering_sync.py", + "description": "Sample for GetIamPolicy", + "file": "compute_v1_generated_node_groups_get_iam_policy_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_Networks_UpdatePeering_sync", + "regionTag": "compute_v1_generated_NodeGroups_GetIamPolicy_sync", "segments": [ { - "end": 52, + "end": 53, "start": 27, "type": "FULL" }, { - "end": 52, + "end": 53, "start": 27, "type": "SHORT" }, @@ -30994,22 +33226,22 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 46, + "end": 47, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 49, - "start": 47, + "end": 50, + "start": 48, "type": "REQUEST_EXECUTION" }, { - "end": 53, - "start": 50, + "end": 54, + "start": 51, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_networks_update_peering_sync.py" + "title": "compute_v1_generated_node_groups_get_iam_policy_sync.py" }, { "canonical": true, @@ -31018,19 +33250,19 @@ "fullName": "google.cloud.compute_v1.NodeGroupsClient", "shortName": "NodeGroupsClient" }, - "fullName": "google.cloud.compute_v1.NodeGroupsClient.add_nodes", + "fullName": "google.cloud.compute_v1.NodeGroupsClient.get", "method": { - "fullName": "google.cloud.compute.v1.NodeGroups.AddNodes", + "fullName": "google.cloud.compute.v1.NodeGroups.Get", "service": { "fullName": "google.cloud.compute.v1.NodeGroups", "shortName": "NodeGroups" }, - "shortName": "AddNodes" + "shortName": "Get" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.AddNodesNodeGroupRequest" + "type": "google.cloud.compute_v1.types.GetNodeGroupRequest" }, { "name": "project", @@ -31044,10 +33276,6 @@ "name": "node_group", "type": "str" }, - { - "name": "node_groups_add_nodes_request_resource", - "type": "google.cloud.compute_v1.types.NodeGroupsAddNodesRequest" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -31061,14 +33289,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "add_nodes" + "resultType": "google.cloud.compute_v1.types.NodeGroup", + "shortName": "get" }, - "description": "Sample for AddNodes", - "file": "compute_v1_generated_node_groups_add_nodes_sync.py", + "description": "Sample for Get", + "file": "compute_v1_generated_node_groups_get_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_NodeGroups_AddNodes_sync", + "regionTag": "compute_v1_generated_NodeGroups_Get_sync", "segments": [ { "end": 53, @@ -31101,7 +33329,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_node_groups_add_nodes_sync.py" + "title": "compute_v1_generated_node_groups_get_sync.py" }, { "canonical": true, @@ -31110,24 +33338,36 @@ "fullName": "google.cloud.compute_v1.NodeGroupsClient", "shortName": "NodeGroupsClient" }, - "fullName": "google.cloud.compute_v1.NodeGroupsClient.aggregated_list", + "fullName": "google.cloud.compute_v1.NodeGroupsClient.insert", "method": { - "fullName": "google.cloud.compute.v1.NodeGroups.AggregatedList", + "fullName": "google.cloud.compute.v1.NodeGroups.Insert", "service": { "fullName": "google.cloud.compute.v1.NodeGroups", "shortName": "NodeGroups" }, - "shortName": "AggregatedList" + "shortName": "Insert" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.AggregatedListNodeGroupsRequest" + "type": "google.cloud.compute_v1.types.InsertNodeGroupRequest" }, { "name": "project", "type": "str" }, + { + "name": "zone", + "type": "str" + }, + { + "name": "initial_node_count", + "type": "int" + }, + { + "name": "node_group_resource", + "type": "google.cloud.compute_v1.types.NodeGroup" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -31141,22 +33381,22 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.services.node_groups.pagers.AggregatedListPager", - "shortName": "aggregated_list" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "insert" }, - "description": "Sample for AggregatedList", - "file": "compute_v1_generated_node_groups_aggregated_list_sync.py", + "description": "Sample for Insert", + "file": "compute_v1_generated_node_groups_insert_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_NodeGroups_AggregatedList_sync", + "regionTag": "compute_v1_generated_NodeGroups_Insert_sync", "segments": [ { - "end": 52, + "end": 53, "start": 27, "type": "FULL" }, { - "end": 52, + "end": 53, "start": 27, "type": "SHORT" }, @@ -31166,22 +33406,22 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 45, + "end": 47, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 48, - "start": 46, + "end": 50, + "start": 48, "type": "REQUEST_EXECUTION" }, { - "end": 53, - "start": 49, + "end": 54, + "start": 51, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_node_groups_aggregated_list_sync.py" + "title": "compute_v1_generated_node_groups_insert_sync.py" }, { "canonical": true, @@ -31190,19 +33430,19 @@ "fullName": "google.cloud.compute_v1.NodeGroupsClient", "shortName": "NodeGroupsClient" }, - "fullName": "google.cloud.compute_v1.NodeGroupsClient.delete_nodes", + "fullName": "google.cloud.compute_v1.NodeGroupsClient.list_nodes", "method": { - "fullName": "google.cloud.compute.v1.NodeGroups.DeleteNodes", + "fullName": "google.cloud.compute.v1.NodeGroups.ListNodes", "service": { "fullName": "google.cloud.compute.v1.NodeGroups", "shortName": "NodeGroups" }, - "shortName": "DeleteNodes" + "shortName": "ListNodes" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.DeleteNodesNodeGroupRequest" + "type": "google.cloud.compute_v1.types.ListNodesNodeGroupsRequest" }, { "name": "project", @@ -31216,10 +33456,6 @@ "name": "node_group", "type": "str" }, - { - "name": "node_groups_delete_nodes_request_resource", - "type": "google.cloud.compute_v1.types.NodeGroupsDeleteNodesRequest" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -31233,22 +33469,22 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "delete_nodes" + "resultType": "google.cloud.compute_v1.services.node_groups.pagers.ListNodesPager", + "shortName": "list_nodes" }, - "description": "Sample for DeleteNodes", - "file": "compute_v1_generated_node_groups_delete_nodes_sync.py", + "description": "Sample for ListNodes", + "file": "compute_v1_generated_node_groups_list_nodes_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_NodeGroups_DeleteNodes_sync", + "regionTag": "compute_v1_generated_NodeGroups_ListNodes_sync", "segments": [ { - "end": 53, + "end": 54, "start": 27, "type": "FULL" }, { - "end": 53, + "end": 54, "start": 27, "type": "SHORT" }, @@ -31268,12 +33504,12 @@ "type": "REQUEST_EXECUTION" }, { - "end": 54, + "end": 55, "start": 51, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_node_groups_delete_nodes_sync.py" + "title": "compute_v1_generated_node_groups_list_nodes_sync.py" }, { "canonical": true, @@ -31282,19 +33518,19 @@ "fullName": "google.cloud.compute_v1.NodeGroupsClient", "shortName": "NodeGroupsClient" }, - "fullName": "google.cloud.compute_v1.NodeGroupsClient.delete", + "fullName": "google.cloud.compute_v1.NodeGroupsClient.list", "method": { - "fullName": "google.cloud.compute.v1.NodeGroups.Delete", + "fullName": "google.cloud.compute.v1.NodeGroups.List", "service": { "fullName": "google.cloud.compute.v1.NodeGroups", "shortName": "NodeGroups" }, - "shortName": "Delete" + "shortName": "List" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.DeleteNodeGroupRequest" + "type": "google.cloud.compute_v1.types.ListNodeGroupsRequest" }, { "name": "project", @@ -31304,10 +33540,6 @@ "name": "zone", "type": "str" }, - { - "name": "node_group", - "type": "str" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -31321,14 +33553,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "delete" + "resultType": "google.cloud.compute_v1.services.node_groups.pagers.ListPager", + "shortName": "list" }, - "description": "Sample for Delete", - "file": "compute_v1_generated_node_groups_delete_sync.py", + "description": "Sample for List", + "file": "compute_v1_generated_node_groups_list_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_NodeGroups_Delete_sync", + "regionTag": "compute_v1_generated_NodeGroups_List_sync", "segments": [ { "end": 53, @@ -31346,22 +33578,22 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 47, + "end": 46, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 50, - "start": 48, + "end": 49, + "start": 47, "type": "REQUEST_EXECUTION" }, { "end": 54, - "start": 51, + "start": 50, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_node_groups_delete_sync.py" + "title": "compute_v1_generated_node_groups_list_sync.py" }, { "canonical": true, @@ -31370,19 +33602,19 @@ "fullName": "google.cloud.compute_v1.NodeGroupsClient", "shortName": "NodeGroupsClient" }, - "fullName": "google.cloud.compute_v1.NodeGroupsClient.get_iam_policy", + "fullName": "google.cloud.compute_v1.NodeGroupsClient.patch", "method": { - "fullName": "google.cloud.compute.v1.NodeGroups.GetIamPolicy", + "fullName": "google.cloud.compute.v1.NodeGroups.Patch", "service": { "fullName": "google.cloud.compute.v1.NodeGroups", "shortName": "NodeGroups" }, - "shortName": "GetIamPolicy" + "shortName": "Patch" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetIamPolicyNodeGroupRequest" + "type": "google.cloud.compute_v1.types.PatchNodeGroupRequest" }, { "name": "project", @@ -31393,9 +33625,13 @@ "type": "str" }, { - "name": "resource", + "name": "node_group", "type": "str" }, + { + "name": "node_group_resource", + "type": "google.cloud.compute_v1.types.NodeGroup" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -31409,14 +33645,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.Policy", - "shortName": "get_iam_policy" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "patch" }, - "description": "Sample for GetIamPolicy", - "file": "compute_v1_generated_node_groups_get_iam_policy_sync.py", + "description": "Sample for Patch", + "file": "compute_v1_generated_node_groups_patch_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_NodeGroups_GetIamPolicy_sync", + "regionTag": "compute_v1_generated_NodeGroups_Patch_sync", "segments": [ { "end": 53, @@ -31449,7 +33685,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_node_groups_get_iam_policy_sync.py" + "title": "compute_v1_generated_node_groups_patch_sync.py" }, { "canonical": true, @@ -31458,19 +33694,19 @@ "fullName": "google.cloud.compute_v1.NodeGroupsClient", "shortName": "NodeGroupsClient" }, - "fullName": "google.cloud.compute_v1.NodeGroupsClient.get", + "fullName": "google.cloud.compute_v1.NodeGroupsClient.perform_maintenance", "method": { - "fullName": "google.cloud.compute.v1.NodeGroups.Get", + "fullName": "google.cloud.compute.v1.NodeGroups.PerformMaintenance", "service": { "fullName": "google.cloud.compute.v1.NodeGroups", "shortName": "NodeGroups" }, - "shortName": "Get" + "shortName": "PerformMaintenance" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetNodeGroupRequest" + "type": "google.cloud.compute_v1.types.PerformMaintenanceNodeGroupRequest" }, { "name": "project", @@ -31484,6 +33720,10 @@ "name": "node_group", "type": "str" }, + { + "name": "node_groups_perform_maintenance_request_resource", + "type": "google.cloud.compute_v1.types.NodeGroupsPerformMaintenanceRequest" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -31497,14 +33737,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.NodeGroup", - "shortName": "get" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "perform_maintenance" }, - "description": "Sample for Get", - "file": "compute_v1_generated_node_groups_get_sync.py", + "description": "Sample for PerformMaintenance", + "file": "compute_v1_generated_node_groups_perform_maintenance_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_NodeGroups_Get_sync", + "regionTag": "compute_v1_generated_NodeGroups_PerformMaintenance_sync", "segments": [ { "end": 53, @@ -31537,7 +33777,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_node_groups_get_sync.py" + "title": "compute_v1_generated_node_groups_perform_maintenance_sync.py" }, { "canonical": true, @@ -31546,19 +33786,19 @@ "fullName": "google.cloud.compute_v1.NodeGroupsClient", "shortName": "NodeGroupsClient" }, - "fullName": "google.cloud.compute_v1.NodeGroupsClient.insert", + "fullName": "google.cloud.compute_v1.NodeGroupsClient.set_iam_policy", "method": { - "fullName": "google.cloud.compute.v1.NodeGroups.Insert", + "fullName": "google.cloud.compute.v1.NodeGroups.SetIamPolicy", "service": { "fullName": "google.cloud.compute.v1.NodeGroups", "shortName": "NodeGroups" }, - "shortName": "Insert" + "shortName": "SetIamPolicy" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.InsertNodeGroupRequest" + "type": "google.cloud.compute_v1.types.SetIamPolicyNodeGroupRequest" }, { "name": "project", @@ -31569,12 +33809,12 @@ "type": "str" }, { - "name": "initial_node_count", - "type": "int" + "name": "resource", + "type": "str" }, { - "name": "node_group_resource", - "type": "google.cloud.compute_v1.types.NodeGroup" + "name": "zone_set_policy_request_resource", + "type": "google.cloud.compute_v1.types.ZoneSetPolicyRequest" }, { "name": "retry", @@ -31589,14 +33829,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "insert" + "resultType": "google.cloud.compute_v1.types.Policy", + "shortName": "set_iam_policy" }, - "description": "Sample for Insert", - "file": "compute_v1_generated_node_groups_insert_sync.py", + "description": "Sample for SetIamPolicy", + "file": "compute_v1_generated_node_groups_set_iam_policy_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_NodeGroups_Insert_sync", + "regionTag": "compute_v1_generated_NodeGroups_SetIamPolicy_sync", "segments": [ { "end": 53, @@ -31629,7 +33869,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_node_groups_insert_sync.py" + "title": "compute_v1_generated_node_groups_set_iam_policy_sync.py" }, { "canonical": true, @@ -31638,19 +33878,19 @@ "fullName": "google.cloud.compute_v1.NodeGroupsClient", "shortName": "NodeGroupsClient" }, - "fullName": "google.cloud.compute_v1.NodeGroupsClient.list_nodes", + "fullName": "google.cloud.compute_v1.NodeGroupsClient.set_node_template", "method": { - "fullName": "google.cloud.compute.v1.NodeGroups.ListNodes", + "fullName": "google.cloud.compute.v1.NodeGroups.SetNodeTemplate", "service": { "fullName": "google.cloud.compute.v1.NodeGroups", "shortName": "NodeGroups" }, - "shortName": "ListNodes" + "shortName": "SetNodeTemplate" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.ListNodesNodeGroupsRequest" + "type": "google.cloud.compute_v1.types.SetNodeTemplateNodeGroupRequest" }, { "name": "project", @@ -31664,6 +33904,10 @@ "name": "node_group", "type": "str" }, + { + "name": "node_groups_set_node_template_request_resource", + "type": "google.cloud.compute_v1.types.NodeGroupsSetNodeTemplateRequest" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -31677,22 +33921,22 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.services.node_groups.pagers.ListNodesPager", - "shortName": "list_nodes" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "set_node_template" }, - "description": "Sample for ListNodes", - "file": "compute_v1_generated_node_groups_list_nodes_sync.py", + "description": "Sample for SetNodeTemplate", + "file": "compute_v1_generated_node_groups_set_node_template_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_NodeGroups_ListNodes_sync", + "regionTag": "compute_v1_generated_NodeGroups_SetNodeTemplate_sync", "segments": [ { - "end": 54, + "end": 53, "start": 27, "type": "FULL" }, { - "end": 54, + "end": 53, "start": 27, "type": "SHORT" }, @@ -31712,12 +33956,12 @@ "type": "REQUEST_EXECUTION" }, { - "end": 55, + "end": 54, "start": 51, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_node_groups_list_nodes_sync.py" + "title": "compute_v1_generated_node_groups_set_node_template_sync.py" }, { "canonical": true, @@ -31726,19 +33970,19 @@ "fullName": "google.cloud.compute_v1.NodeGroupsClient", "shortName": "NodeGroupsClient" }, - "fullName": "google.cloud.compute_v1.NodeGroupsClient.list", + "fullName": "google.cloud.compute_v1.NodeGroupsClient.simulate_maintenance_event", "method": { - "fullName": "google.cloud.compute.v1.NodeGroups.List", + "fullName": "google.cloud.compute.v1.NodeGroups.SimulateMaintenanceEvent", "service": { "fullName": "google.cloud.compute.v1.NodeGroups", "shortName": "NodeGroups" }, - "shortName": "List" + "shortName": "SimulateMaintenanceEvent" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.ListNodeGroupsRequest" + "type": "google.cloud.compute_v1.types.SimulateMaintenanceEventNodeGroupRequest" }, { "name": "project", @@ -31748,6 +33992,14 @@ "name": "zone", "type": "str" }, + { + "name": "node_group", + "type": "str" + }, + { + "name": "node_groups_simulate_maintenance_event_request_resource", + "type": "google.cloud.compute_v1.types.NodeGroupsSimulateMaintenanceEventRequest" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -31761,14 +34013,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.services.node_groups.pagers.ListPager", - "shortName": "list" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "simulate_maintenance_event" }, - "description": "Sample for List", - "file": "compute_v1_generated_node_groups_list_sync.py", + "description": "Sample for SimulateMaintenanceEvent", + "file": "compute_v1_generated_node_groups_simulate_maintenance_event_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_NodeGroups_List_sync", + "regionTag": "compute_v1_generated_NodeGroups_SimulateMaintenanceEvent_sync", "segments": [ { "end": 53, @@ -31786,22 +34038,22 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 46, + "end": 47, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 49, - "start": 47, + "end": 50, + "start": 48, "type": "REQUEST_EXECUTION" }, { "end": 54, - "start": 50, + "start": 51, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_node_groups_list_sync.py" + "title": "compute_v1_generated_node_groups_simulate_maintenance_event_sync.py" }, { "canonical": true, @@ -31810,19 +34062,19 @@ "fullName": "google.cloud.compute_v1.NodeGroupsClient", "shortName": "NodeGroupsClient" }, - "fullName": "google.cloud.compute_v1.NodeGroupsClient.patch", + "fullName": "google.cloud.compute_v1.NodeGroupsClient.test_iam_permissions", "method": { - "fullName": "google.cloud.compute.v1.NodeGroups.Patch", + "fullName": "google.cloud.compute.v1.NodeGroups.TestIamPermissions", "service": { "fullName": "google.cloud.compute.v1.NodeGroups", "shortName": "NodeGroups" }, - "shortName": "Patch" + "shortName": "TestIamPermissions" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.PatchNodeGroupRequest" + "type": "google.cloud.compute_v1.types.TestIamPermissionsNodeGroupRequest" }, { "name": "project", @@ -31833,12 +34085,12 @@ "type": "str" }, { - "name": "node_group", + "name": "resource", "type": "str" }, { - "name": "node_group_resource", - "type": "google.cloud.compute_v1.types.NodeGroup" + "name": "test_permissions_request_resource", + "type": "google.cloud.compute_v1.types.TestPermissionsRequest" }, { "name": "retry", @@ -31853,14 +34105,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "patch" + "resultType": "google.cloud.compute_v1.types.TestPermissionsResponse", + "shortName": "test_iam_permissions" }, - "description": "Sample for Patch", - "file": "compute_v1_generated_node_groups_patch_sync.py", + "description": "Sample for TestIamPermissions", + "file": "compute_v1_generated_node_groups_test_iam_permissions_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_NodeGroups_Patch_sync", + "regionTag": "compute_v1_generated_NodeGroups_TestIamPermissions_sync", "segments": [ { "end": 53, @@ -31893,45 +34145,33 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_node_groups_patch_sync.py" + "title": "compute_v1_generated_node_groups_test_iam_permissions_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.NodeGroupsClient", - "shortName": "NodeGroupsClient" + "fullName": "google.cloud.compute_v1.NodeTemplatesClient", + "shortName": "NodeTemplatesClient" }, - "fullName": "google.cloud.compute_v1.NodeGroupsClient.perform_maintenance", + "fullName": "google.cloud.compute_v1.NodeTemplatesClient.aggregated_list", "method": { - "fullName": "google.cloud.compute.v1.NodeGroups.PerformMaintenance", + "fullName": "google.cloud.compute.v1.NodeTemplates.AggregatedList", "service": { - "fullName": "google.cloud.compute.v1.NodeGroups", - "shortName": "NodeGroups" + "fullName": "google.cloud.compute.v1.NodeTemplates", + "shortName": "NodeTemplates" }, - "shortName": "PerformMaintenance" + "shortName": "AggregatedList" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.PerformMaintenanceNodeGroupRequest" + "type": "google.cloud.compute_v1.types.AggregatedListNodeTemplatesRequest" }, { "name": "project", "type": "str" }, - { - "name": "zone", - "type": "str" - }, - { - "name": "node_group", - "type": "str" - }, - { - "name": "node_groups_perform_maintenance_request_resource", - "type": "google.cloud.compute_v1.types.NodeGroupsPerformMaintenanceRequest" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -31945,22 +34185,22 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "perform_maintenance" + "resultType": "google.cloud.compute_v1.services.node_templates.pagers.AggregatedListPager", + "shortName": "aggregated_list" }, - "description": "Sample for PerformMaintenance", - "file": "compute_v1_generated_node_groups_perform_maintenance_sync.py", + "description": "Sample for AggregatedList", + "file": "compute_v1_generated_node_templates_aggregated_list_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_NodeGroups_PerformMaintenance_sync", + "regionTag": "compute_v1_generated_NodeTemplates_AggregatedList_sync", "segments": [ { - "end": 53, + "end": 52, "start": 27, "type": "FULL" }, { - "end": 53, + "end": 52, "start": 27, "type": "SHORT" }, @@ -31970,60 +34210,56 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 47, + "end": 45, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 50, - "start": 48, + "end": 48, + "start": 46, "type": "REQUEST_EXECUTION" }, { - "end": 54, - "start": 51, + "end": 53, + "start": 49, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_node_groups_perform_maintenance_sync.py" + "title": "compute_v1_generated_node_templates_aggregated_list_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.NodeGroupsClient", - "shortName": "NodeGroupsClient" + "fullName": "google.cloud.compute_v1.NodeTemplatesClient", + "shortName": "NodeTemplatesClient" }, - "fullName": "google.cloud.compute_v1.NodeGroupsClient.set_iam_policy", + "fullName": "google.cloud.compute_v1.NodeTemplatesClient.delete", "method": { - "fullName": "google.cloud.compute.v1.NodeGroups.SetIamPolicy", + "fullName": "google.cloud.compute.v1.NodeTemplates.Delete", "service": { - "fullName": "google.cloud.compute.v1.NodeGroups", - "shortName": "NodeGroups" + "fullName": "google.cloud.compute.v1.NodeTemplates", + "shortName": "NodeTemplates" }, - "shortName": "SetIamPolicy" + "shortName": "Delete" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.SetIamPolicyNodeGroupRequest" + "type": "google.cloud.compute_v1.types.DeleteNodeTemplateRequest" }, { "name": "project", "type": "str" }, { - "name": "zone", + "name": "region", "type": "str" }, { - "name": "resource", + "name": "node_template", "type": "str" }, - { - "name": "zone_set_policy_request_resource", - "type": "google.cloud.compute_v1.types.ZoneSetPolicyRequest" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -32037,14 +34273,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.Policy", - "shortName": "set_iam_policy" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "delete" }, - "description": "Sample for SetIamPolicy", - "file": "compute_v1_generated_node_groups_set_iam_policy_sync.py", + "description": "Sample for Delete", + "file": "compute_v1_generated_node_templates_delete_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_NodeGroups_SetIamPolicy_sync", + "regionTag": "compute_v1_generated_NodeTemplates_Delete_sync", "segments": [ { "end": 53, @@ -32077,45 +34313,41 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_node_groups_set_iam_policy_sync.py" + "title": "compute_v1_generated_node_templates_delete_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.NodeGroupsClient", - "shortName": "NodeGroupsClient" + "fullName": "google.cloud.compute_v1.NodeTemplatesClient", + "shortName": "NodeTemplatesClient" }, - "fullName": "google.cloud.compute_v1.NodeGroupsClient.set_node_template", + "fullName": "google.cloud.compute_v1.NodeTemplatesClient.get_iam_policy", "method": { - "fullName": "google.cloud.compute.v1.NodeGroups.SetNodeTemplate", + "fullName": "google.cloud.compute.v1.NodeTemplates.GetIamPolicy", "service": { - "fullName": "google.cloud.compute.v1.NodeGroups", - "shortName": "NodeGroups" + "fullName": "google.cloud.compute.v1.NodeTemplates", + "shortName": "NodeTemplates" }, - "shortName": "SetNodeTemplate" + "shortName": "GetIamPolicy" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.SetNodeTemplateNodeGroupRequest" + "type": "google.cloud.compute_v1.types.GetIamPolicyNodeTemplateRequest" }, { "name": "project", "type": "str" }, { - "name": "zone", + "name": "region", "type": "str" }, { - "name": "node_group", + "name": "resource", "type": "str" }, - { - "name": "node_groups_set_node_template_request_resource", - "type": "google.cloud.compute_v1.types.NodeGroupsSetNodeTemplateRequest" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -32129,14 +34361,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "set_node_template" + "resultType": "google.cloud.compute_v1.types.Policy", + "shortName": "get_iam_policy" }, - "description": "Sample for SetNodeTemplate", - "file": "compute_v1_generated_node_groups_set_node_template_sync.py", + "description": "Sample for GetIamPolicy", + "file": "compute_v1_generated_node_templates_get_iam_policy_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_NodeGroups_SetNodeTemplate_sync", + "regionTag": "compute_v1_generated_NodeTemplates_GetIamPolicy_sync", "segments": [ { "end": 53, @@ -32169,45 +34401,41 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_node_groups_set_node_template_sync.py" + "title": "compute_v1_generated_node_templates_get_iam_policy_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.NodeGroupsClient", - "shortName": "NodeGroupsClient" + "fullName": "google.cloud.compute_v1.NodeTemplatesClient", + "shortName": "NodeTemplatesClient" }, - "fullName": "google.cloud.compute_v1.NodeGroupsClient.simulate_maintenance_event", + "fullName": "google.cloud.compute_v1.NodeTemplatesClient.get", "method": { - "fullName": "google.cloud.compute.v1.NodeGroups.SimulateMaintenanceEvent", + "fullName": "google.cloud.compute.v1.NodeTemplates.Get", "service": { - "fullName": "google.cloud.compute.v1.NodeGroups", - "shortName": "NodeGroups" + "fullName": "google.cloud.compute.v1.NodeTemplates", + "shortName": "NodeTemplates" }, - "shortName": "SimulateMaintenanceEvent" + "shortName": "Get" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.SimulateMaintenanceEventNodeGroupRequest" + "type": "google.cloud.compute_v1.types.GetNodeTemplateRequest" }, { "name": "project", "type": "str" }, { - "name": "zone", + "name": "region", "type": "str" }, { - "name": "node_group", + "name": "node_template", "type": "str" }, - { - "name": "node_groups_simulate_maintenance_event_request_resource", - "type": "google.cloud.compute_v1.types.NodeGroupsSimulateMaintenanceEventRequest" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -32221,14 +34449,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "simulate_maintenance_event" + "resultType": "google.cloud.compute_v1.types.NodeTemplate", + "shortName": "get" }, - "description": "Sample for SimulateMaintenanceEvent", - "file": "compute_v1_generated_node_groups_simulate_maintenance_event_sync.py", + "description": "Sample for Get", + "file": "compute_v1_generated_node_templates_get_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_NodeGroups_SimulateMaintenanceEvent_sync", + "regionTag": "compute_v1_generated_NodeTemplates_Get_sync", "segments": [ { "end": 53, @@ -32261,44 +34489,40 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_node_groups_simulate_maintenance_event_sync.py" + "title": "compute_v1_generated_node_templates_get_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.NodeGroupsClient", - "shortName": "NodeGroupsClient" + "fullName": "google.cloud.compute_v1.NodeTemplatesClient", + "shortName": "NodeTemplatesClient" }, - "fullName": "google.cloud.compute_v1.NodeGroupsClient.test_iam_permissions", + "fullName": "google.cloud.compute_v1.NodeTemplatesClient.insert", "method": { - "fullName": "google.cloud.compute.v1.NodeGroups.TestIamPermissions", + "fullName": "google.cloud.compute.v1.NodeTemplates.Insert", "service": { - "fullName": "google.cloud.compute.v1.NodeGroups", - "shortName": "NodeGroups" + "fullName": "google.cloud.compute.v1.NodeTemplates", + "shortName": "NodeTemplates" }, - "shortName": "TestIamPermissions" + "shortName": "Insert" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.TestIamPermissionsNodeGroupRequest" + "type": "google.cloud.compute_v1.types.InsertNodeTemplateRequest" }, { "name": "project", "type": "str" }, { - "name": "zone", - "type": "str" - }, - { - "name": "resource", + "name": "region", "type": "str" }, { - "name": "test_permissions_request_resource", - "type": "google.cloud.compute_v1.types.TestPermissionsRequest" + "name": "node_template_resource", + "type": "google.cloud.compute_v1.types.NodeTemplate" }, { "name": "retry", @@ -32313,22 +34537,22 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.TestPermissionsResponse", - "shortName": "test_iam_permissions" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "insert" }, - "description": "Sample for TestIamPermissions", - "file": "compute_v1_generated_node_groups_test_iam_permissions_sync.py", + "description": "Sample for Insert", + "file": "compute_v1_generated_node_templates_insert_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_NodeGroups_TestIamPermissions_sync", + "regionTag": "compute_v1_generated_NodeTemplates_Insert_sync", "segments": [ { - "end": 53, + "end": 52, "start": 27, "type": "FULL" }, { - "end": 53, + "end": 52, "start": 27, "type": "SHORT" }, @@ -32338,22 +34562,22 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 47, + "end": 46, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 50, - "start": 48, + "end": 49, + "start": 47, "type": "REQUEST_EXECUTION" }, { - "end": 54, - "start": 51, + "end": 53, + "start": 50, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_node_groups_test_iam_permissions_sync.py" + "title": "compute_v1_generated_node_templates_insert_sync.py" }, { "canonical": true, @@ -32362,24 +34586,28 @@ "fullName": "google.cloud.compute_v1.NodeTemplatesClient", "shortName": "NodeTemplatesClient" }, - "fullName": "google.cloud.compute_v1.NodeTemplatesClient.aggregated_list", + "fullName": "google.cloud.compute_v1.NodeTemplatesClient.list", "method": { - "fullName": "google.cloud.compute.v1.NodeTemplates.AggregatedList", + "fullName": "google.cloud.compute.v1.NodeTemplates.List", "service": { "fullName": "google.cloud.compute.v1.NodeTemplates", "shortName": "NodeTemplates" }, - "shortName": "AggregatedList" + "shortName": "List" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.AggregatedListNodeTemplatesRequest" + "type": "google.cloud.compute_v1.types.ListNodeTemplatesRequest" }, { "name": "project", "type": "str" }, + { + "name": "region", + "type": "str" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -32393,22 +34621,22 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.services.node_templates.pagers.AggregatedListPager", - "shortName": "aggregated_list" + "resultType": "google.cloud.compute_v1.services.node_templates.pagers.ListPager", + "shortName": "list" }, - "description": "Sample for AggregatedList", - "file": "compute_v1_generated_node_templates_aggregated_list_sync.py", + "description": "Sample for List", + "file": "compute_v1_generated_node_templates_list_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_NodeTemplates_AggregatedList_sync", + "regionTag": "compute_v1_generated_NodeTemplates_List_sync", "segments": [ { - "end": 52, + "end": 53, "start": 27, "type": "FULL" }, { - "end": 52, + "end": 53, "start": 27, "type": "SHORT" }, @@ -32418,22 +34646,22 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 45, + "end": 46, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 48, - "start": 46, + "end": 49, + "start": 47, "type": "REQUEST_EXECUTION" }, { - "end": 53, - "start": 49, + "end": 54, + "start": 50, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_node_templates_aggregated_list_sync.py" + "title": "compute_v1_generated_node_templates_list_sync.py" }, { "canonical": true, @@ -32442,19 +34670,19 @@ "fullName": "google.cloud.compute_v1.NodeTemplatesClient", "shortName": "NodeTemplatesClient" }, - "fullName": "google.cloud.compute_v1.NodeTemplatesClient.delete", + "fullName": "google.cloud.compute_v1.NodeTemplatesClient.set_iam_policy", "method": { - "fullName": "google.cloud.compute.v1.NodeTemplates.Delete", + "fullName": "google.cloud.compute.v1.NodeTemplates.SetIamPolicy", "service": { "fullName": "google.cloud.compute.v1.NodeTemplates", "shortName": "NodeTemplates" }, - "shortName": "Delete" + "shortName": "SetIamPolicy" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.DeleteNodeTemplateRequest" + "type": "google.cloud.compute_v1.types.SetIamPolicyNodeTemplateRequest" }, { "name": "project", @@ -32465,9 +34693,13 @@ "type": "str" }, { - "name": "node_template", + "name": "resource", "type": "str" }, + { + "name": "region_set_policy_request_resource", + "type": "google.cloud.compute_v1.types.RegionSetPolicyRequest" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -32481,14 +34713,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "delete" + "resultType": "google.cloud.compute_v1.types.Policy", + "shortName": "set_iam_policy" }, - "description": "Sample for Delete", - "file": "compute_v1_generated_node_templates_delete_sync.py", + "description": "Sample for SetIamPolicy", + "file": "compute_v1_generated_node_templates_set_iam_policy_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_NodeTemplates_Delete_sync", + "regionTag": "compute_v1_generated_NodeTemplates_SetIamPolicy_sync", "segments": [ { "end": 53, @@ -32521,7 +34753,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_node_templates_delete_sync.py" + "title": "compute_v1_generated_node_templates_set_iam_policy_sync.py" }, { "canonical": true, @@ -32530,19 +34762,19 @@ "fullName": "google.cloud.compute_v1.NodeTemplatesClient", "shortName": "NodeTemplatesClient" }, - "fullName": "google.cloud.compute_v1.NodeTemplatesClient.get_iam_policy", + "fullName": "google.cloud.compute_v1.NodeTemplatesClient.test_iam_permissions", "method": { - "fullName": "google.cloud.compute.v1.NodeTemplates.GetIamPolicy", + "fullName": "google.cloud.compute.v1.NodeTemplates.TestIamPermissions", "service": { "fullName": "google.cloud.compute.v1.NodeTemplates", "shortName": "NodeTemplates" }, - "shortName": "GetIamPolicy" + "shortName": "TestIamPermissions" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetIamPolicyNodeTemplateRequest" + "type": "google.cloud.compute_v1.types.TestIamPermissionsNodeTemplateRequest" }, { "name": "project", @@ -32556,6 +34788,10 @@ "name": "resource", "type": "str" }, + { + "name": "test_permissions_request_resource", + "type": "google.cloud.compute_v1.types.TestPermissionsRequest" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -32569,14 +34805,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.Policy", - "shortName": "get_iam_policy" + "resultType": "google.cloud.compute_v1.types.TestPermissionsResponse", + "shortName": "test_iam_permissions" }, - "description": "Sample for GetIamPolicy", - "file": "compute_v1_generated_node_templates_get_iam_policy_sync.py", + "description": "Sample for TestIamPermissions", + "file": "compute_v1_generated_node_templates_test_iam_permissions_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_NodeTemplates_GetIamPolicy_sync", + "regionTag": "compute_v1_generated_NodeTemplates_TestIamPermissions_sync", "segments": [ { "end": 53, @@ -32609,41 +34845,33 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_node_templates_get_iam_policy_sync.py" + "title": "compute_v1_generated_node_templates_test_iam_permissions_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.NodeTemplatesClient", - "shortName": "NodeTemplatesClient" + "fullName": "google.cloud.compute_v1.NodeTypesClient", + "shortName": "NodeTypesClient" }, - "fullName": "google.cloud.compute_v1.NodeTemplatesClient.get", + "fullName": "google.cloud.compute_v1.NodeTypesClient.aggregated_list", "method": { - "fullName": "google.cloud.compute.v1.NodeTemplates.Get", + "fullName": "google.cloud.compute.v1.NodeTypes.AggregatedList", "service": { - "fullName": "google.cloud.compute.v1.NodeTemplates", - "shortName": "NodeTemplates" + "fullName": "google.cloud.compute.v1.NodeTypes", + "shortName": "NodeTypes" }, - "shortName": "Get" + "shortName": "AggregatedList" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetNodeTemplateRequest" + "type": "google.cloud.compute_v1.types.AggregatedListNodeTypesRequest" }, { "name": "project", "type": "str" }, - { - "name": "region", - "type": "str" - }, - { - "name": "node_template", - "type": "str" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -32657,22 +34885,22 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.NodeTemplate", - "shortName": "get" + "resultType": "google.cloud.compute_v1.services.node_types.pagers.AggregatedListPager", + "shortName": "aggregated_list" }, - "description": "Sample for Get", - "file": "compute_v1_generated_node_templates_get_sync.py", + "description": "Sample for AggregatedList", + "file": "compute_v1_generated_node_types_aggregated_list_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_NodeTemplates_Get_sync", + "regionTag": "compute_v1_generated_NodeTypes_AggregatedList_sync", "segments": [ { - "end": 53, + "end": 52, "start": 27, "type": "FULL" }, { - "end": 53, + "end": 52, "start": 27, "type": "SHORT" }, @@ -32682,55 +34910,55 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 47, + "end": 45, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 50, - "start": 48, + "end": 48, + "start": 46, "type": "REQUEST_EXECUTION" }, { - "end": 54, - "start": 51, + "end": 53, + "start": 49, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_node_templates_get_sync.py" + "title": "compute_v1_generated_node_types_aggregated_list_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.NodeTemplatesClient", - "shortName": "NodeTemplatesClient" + "fullName": "google.cloud.compute_v1.NodeTypesClient", + "shortName": "NodeTypesClient" }, - "fullName": "google.cloud.compute_v1.NodeTemplatesClient.insert", + "fullName": "google.cloud.compute_v1.NodeTypesClient.get", "method": { - "fullName": "google.cloud.compute.v1.NodeTemplates.Insert", + "fullName": "google.cloud.compute.v1.NodeTypes.Get", "service": { - "fullName": "google.cloud.compute.v1.NodeTemplates", - "shortName": "NodeTemplates" + "fullName": "google.cloud.compute.v1.NodeTypes", + "shortName": "NodeTypes" }, - "shortName": "Insert" + "shortName": "Get" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.InsertNodeTemplateRequest" + "type": "google.cloud.compute_v1.types.GetNodeTypeRequest" }, { "name": "project", "type": "str" }, { - "name": "region", + "name": "zone", "type": "str" }, { - "name": "node_template_resource", - "type": "google.cloud.compute_v1.types.NodeTemplate" + "name": "node_type", + "type": "str" }, { "name": "retry", @@ -32745,22 +34973,22 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "insert" + "resultType": "google.cloud.compute_v1.types.NodeType", + "shortName": "get" }, - "description": "Sample for Insert", - "file": "compute_v1_generated_node_templates_insert_sync.py", + "description": "Sample for Get", + "file": "compute_v1_generated_node_types_get_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_NodeTemplates_Insert_sync", + "regionTag": "compute_v1_generated_NodeTypes_Get_sync", "segments": [ { - "end": 52, + "end": 53, "start": 27, "type": "FULL" }, { - "end": 52, + "end": 53, "start": 27, "type": "SHORT" }, @@ -32770,50 +34998,50 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 46, + "end": 47, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 49, - "start": 47, + "end": 50, + "start": 48, "type": "REQUEST_EXECUTION" }, { - "end": 53, - "start": 50, + "end": 54, + "start": 51, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_node_templates_insert_sync.py" + "title": "compute_v1_generated_node_types_get_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.NodeTemplatesClient", - "shortName": "NodeTemplatesClient" + "fullName": "google.cloud.compute_v1.NodeTypesClient", + "shortName": "NodeTypesClient" }, - "fullName": "google.cloud.compute_v1.NodeTemplatesClient.list", + "fullName": "google.cloud.compute_v1.NodeTypesClient.list", "method": { - "fullName": "google.cloud.compute.v1.NodeTemplates.List", + "fullName": "google.cloud.compute.v1.NodeTypes.List", "service": { - "fullName": "google.cloud.compute.v1.NodeTemplates", - "shortName": "NodeTemplates" + "fullName": "google.cloud.compute.v1.NodeTypes", + "shortName": "NodeTypes" }, "shortName": "List" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.ListNodeTemplatesRequest" + "type": "google.cloud.compute_v1.types.ListNodeTypesRequest" }, { "name": "project", "type": "str" }, { - "name": "region", + "name": "zone", "type": "str" }, { @@ -32829,14 +35057,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.services.node_templates.pagers.ListPager", + "resultType": "google.cloud.compute_v1.services.node_types.pagers.ListPager", "shortName": "list" }, "description": "Sample for List", - "file": "compute_v1_generated_node_templates_list_sync.py", + "file": "compute_v1_generated_node_types_list_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_NodeTemplates_List_sync", + "regionTag": "compute_v1_generated_NodeTypes_List_sync", "segments": [ { "end": 53, @@ -32869,45 +35097,33 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_node_templates_list_sync.py" + "title": "compute_v1_generated_node_types_list_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.NodeTemplatesClient", - "shortName": "NodeTemplatesClient" + "fullName": "google.cloud.compute_v1.PacketMirroringsClient", + "shortName": "PacketMirroringsClient" }, - "fullName": "google.cloud.compute_v1.NodeTemplatesClient.set_iam_policy", + "fullName": "google.cloud.compute_v1.PacketMirroringsClient.aggregated_list", "method": { - "fullName": "google.cloud.compute.v1.NodeTemplates.SetIamPolicy", + "fullName": "google.cloud.compute.v1.PacketMirrorings.AggregatedList", "service": { - "fullName": "google.cloud.compute.v1.NodeTemplates", - "shortName": "NodeTemplates" + "fullName": "google.cloud.compute.v1.PacketMirrorings", + "shortName": "PacketMirrorings" }, - "shortName": "SetIamPolicy" + "shortName": "AggregatedList" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.SetIamPolicyNodeTemplateRequest" + "type": "google.cloud.compute_v1.types.AggregatedListPacketMirroringsRequest" }, { "name": "project", "type": "str" }, - { - "name": "region", - "type": "str" - }, - { - "name": "resource", - "type": "str" - }, - { - "name": "region_set_policy_request_resource", - "type": "google.cloud.compute_v1.types.RegionSetPolicyRequest" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -32921,22 +35137,22 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.Policy", - "shortName": "set_iam_policy" + "resultType": "google.cloud.compute_v1.services.packet_mirrorings.pagers.AggregatedListPager", + "shortName": "aggregated_list" }, - "description": "Sample for SetIamPolicy", - "file": "compute_v1_generated_node_templates_set_iam_policy_sync.py", + "description": "Sample for AggregatedList", + "file": "compute_v1_generated_packet_mirrorings_aggregated_list_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_NodeTemplates_SetIamPolicy_sync", + "regionTag": "compute_v1_generated_PacketMirrorings_AggregatedList_sync", "segments": [ { - "end": 53, + "end": 52, "start": 27, "type": "FULL" }, { - "end": 53, + "end": 52, "start": 27, "type": "SHORT" }, @@ -32946,43 +35162,43 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 47, + "end": 45, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 50, - "start": 48, + "end": 48, + "start": 46, "type": "REQUEST_EXECUTION" }, { - "end": 54, - "start": 51, + "end": 53, + "start": 49, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_node_templates_set_iam_policy_sync.py" + "title": "compute_v1_generated_packet_mirrorings_aggregated_list_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.NodeTemplatesClient", - "shortName": "NodeTemplatesClient" + "fullName": "google.cloud.compute_v1.PacketMirroringsClient", + "shortName": "PacketMirroringsClient" }, - "fullName": "google.cloud.compute_v1.NodeTemplatesClient.test_iam_permissions", + "fullName": "google.cloud.compute_v1.PacketMirroringsClient.delete", "method": { - "fullName": "google.cloud.compute.v1.NodeTemplates.TestIamPermissions", + "fullName": "google.cloud.compute.v1.PacketMirrorings.Delete", "service": { - "fullName": "google.cloud.compute.v1.NodeTemplates", - "shortName": "NodeTemplates" + "fullName": "google.cloud.compute.v1.PacketMirrorings", + "shortName": "PacketMirrorings" }, - "shortName": "TestIamPermissions" + "shortName": "Delete" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.TestIamPermissionsNodeTemplateRequest" + "type": "google.cloud.compute_v1.types.DeletePacketMirroringRequest" }, { "name": "project", @@ -32993,13 +35209,9 @@ "type": "str" }, { - "name": "resource", + "name": "packet_mirroring", "type": "str" }, - { - "name": "test_permissions_request_resource", - "type": "google.cloud.compute_v1.types.TestPermissionsRequest" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -33013,14 +35225,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.TestPermissionsResponse", - "shortName": "test_iam_permissions" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "delete" }, - "description": "Sample for TestIamPermissions", - "file": "compute_v1_generated_node_templates_test_iam_permissions_sync.py", + "description": "Sample for Delete", + "file": "compute_v1_generated_packet_mirrorings_delete_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_NodeTemplates_TestIamPermissions_sync", + "regionTag": "compute_v1_generated_PacketMirrorings_Delete_sync", "segments": [ { "end": 53, @@ -33053,33 +35265,41 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_node_templates_test_iam_permissions_sync.py" + "title": "compute_v1_generated_packet_mirrorings_delete_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.NodeTypesClient", - "shortName": "NodeTypesClient" + "fullName": "google.cloud.compute_v1.PacketMirroringsClient", + "shortName": "PacketMirroringsClient" }, - "fullName": "google.cloud.compute_v1.NodeTypesClient.aggregated_list", + "fullName": "google.cloud.compute_v1.PacketMirroringsClient.get", "method": { - "fullName": "google.cloud.compute.v1.NodeTypes.AggregatedList", + "fullName": "google.cloud.compute.v1.PacketMirrorings.Get", "service": { - "fullName": "google.cloud.compute.v1.NodeTypes", - "shortName": "NodeTypes" + "fullName": "google.cloud.compute.v1.PacketMirrorings", + "shortName": "PacketMirrorings" }, - "shortName": "AggregatedList" + "shortName": "Get" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.AggregatedListNodeTypesRequest" + "type": "google.cloud.compute_v1.types.GetPacketMirroringRequest" }, { "name": "project", "type": "str" }, + { + "name": "region", + "type": "str" + }, + { + "name": "packet_mirroring", + "type": "str" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -33093,22 +35313,22 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.services.node_types.pagers.AggregatedListPager", - "shortName": "aggregated_list" + "resultType": "google.cloud.compute_v1.types.PacketMirroring", + "shortName": "get" }, - "description": "Sample for AggregatedList", - "file": "compute_v1_generated_node_types_aggregated_list_sync.py", + "description": "Sample for Get", + "file": "compute_v1_generated_packet_mirrorings_get_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_NodeTypes_AggregatedList_sync", + "regionTag": "compute_v1_generated_PacketMirrorings_Get_sync", "segments": [ { - "end": 52, + "end": 53, "start": 27, "type": "FULL" }, { - "end": 52, + "end": 53, "start": 27, "type": "SHORT" }, @@ -33118,55 +35338,55 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 45, + "end": 47, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 48, - "start": 46, + "end": 50, + "start": 48, "type": "REQUEST_EXECUTION" }, { - "end": 53, - "start": 49, + "end": 54, + "start": 51, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_node_types_aggregated_list_sync.py" + "title": "compute_v1_generated_packet_mirrorings_get_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.NodeTypesClient", - "shortName": "NodeTypesClient" + "fullName": "google.cloud.compute_v1.PacketMirroringsClient", + "shortName": "PacketMirroringsClient" }, - "fullName": "google.cloud.compute_v1.NodeTypesClient.get", + "fullName": "google.cloud.compute_v1.PacketMirroringsClient.insert", "method": { - "fullName": "google.cloud.compute.v1.NodeTypes.Get", + "fullName": "google.cloud.compute.v1.PacketMirrorings.Insert", "service": { - "fullName": "google.cloud.compute.v1.NodeTypes", - "shortName": "NodeTypes" + "fullName": "google.cloud.compute.v1.PacketMirrorings", + "shortName": "PacketMirrorings" }, - "shortName": "Get" + "shortName": "Insert" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetNodeTypeRequest" + "type": "google.cloud.compute_v1.types.InsertPacketMirroringRequest" }, { "name": "project", "type": "str" }, { - "name": "zone", + "name": "region", "type": "str" }, { - "name": "node_type", - "type": "str" + "name": "packet_mirroring_resource", + "type": "google.cloud.compute_v1.types.PacketMirroring" }, { "name": "retry", @@ -33181,22 +35401,22 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.NodeType", - "shortName": "get" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "insert" }, - "description": "Sample for Get", - "file": "compute_v1_generated_node_types_get_sync.py", + "description": "Sample for Insert", + "file": "compute_v1_generated_packet_mirrorings_insert_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_NodeTypes_Get_sync", + "regionTag": "compute_v1_generated_PacketMirrorings_Insert_sync", "segments": [ { - "end": 53, + "end": 52, "start": 27, "type": "FULL" }, { - "end": 53, + "end": 52, "start": 27, "type": "SHORT" }, @@ -33206,50 +35426,50 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 47, + "end": 46, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 50, - "start": 48, + "end": 49, + "start": 47, "type": "REQUEST_EXECUTION" }, { - "end": 54, - "start": 51, + "end": 53, + "start": 50, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_node_types_get_sync.py" + "title": "compute_v1_generated_packet_mirrorings_insert_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.NodeTypesClient", - "shortName": "NodeTypesClient" + "fullName": "google.cloud.compute_v1.PacketMirroringsClient", + "shortName": "PacketMirroringsClient" }, - "fullName": "google.cloud.compute_v1.NodeTypesClient.list", + "fullName": "google.cloud.compute_v1.PacketMirroringsClient.list", "method": { - "fullName": "google.cloud.compute.v1.NodeTypes.List", + "fullName": "google.cloud.compute.v1.PacketMirrorings.List", "service": { - "fullName": "google.cloud.compute.v1.NodeTypes", - "shortName": "NodeTypes" + "fullName": "google.cloud.compute.v1.PacketMirrorings", + "shortName": "PacketMirrorings" }, "shortName": "List" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.ListNodeTypesRequest" + "type": "google.cloud.compute_v1.types.ListPacketMirroringsRequest" }, { "name": "project", "type": "str" }, { - "name": "zone", + "name": "region", "type": "str" }, { @@ -33265,14 +35485,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.services.node_types.pagers.ListPager", + "resultType": "google.cloud.compute_v1.services.packet_mirrorings.pagers.ListPager", "shortName": "list" }, "description": "Sample for List", - "file": "compute_v1_generated_node_types_list_sync.py", + "file": "compute_v1_generated_packet_mirrorings_list_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_NodeTypes_List_sync", + "regionTag": "compute_v1_generated_PacketMirrorings_List_sync", "segments": [ { "end": 53, @@ -33305,7 +35525,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_node_types_list_sync.py" + "title": "compute_v1_generated_packet_mirrorings_list_sync.py" }, { "canonical": true, @@ -33314,24 +35534,36 @@ "fullName": "google.cloud.compute_v1.PacketMirroringsClient", "shortName": "PacketMirroringsClient" }, - "fullName": "google.cloud.compute_v1.PacketMirroringsClient.aggregated_list", + "fullName": "google.cloud.compute_v1.PacketMirroringsClient.patch", "method": { - "fullName": "google.cloud.compute.v1.PacketMirrorings.AggregatedList", + "fullName": "google.cloud.compute.v1.PacketMirrorings.Patch", "service": { "fullName": "google.cloud.compute.v1.PacketMirrorings", "shortName": "PacketMirrorings" }, - "shortName": "AggregatedList" + "shortName": "Patch" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.AggregatedListPacketMirroringsRequest" + "type": "google.cloud.compute_v1.types.PatchPacketMirroringRequest" }, { "name": "project", "type": "str" }, + { + "name": "region", + "type": "str" + }, + { + "name": "packet_mirroring", + "type": "str" + }, + { + "name": "packet_mirroring_resource", + "type": "google.cloud.compute_v1.types.PacketMirroring" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -33345,22 +35577,22 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.services.packet_mirrorings.pagers.AggregatedListPager", - "shortName": "aggregated_list" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "patch" }, - "description": "Sample for AggregatedList", - "file": "compute_v1_generated_packet_mirrorings_aggregated_list_sync.py", + "description": "Sample for Patch", + "file": "compute_v1_generated_packet_mirrorings_patch_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_PacketMirrorings_AggregatedList_sync", + "regionTag": "compute_v1_generated_PacketMirrorings_Patch_sync", "segments": [ { - "end": 52, + "end": 53, "start": 27, "type": "FULL" }, { - "end": 52, + "end": 53, "start": 27, "type": "SHORT" }, @@ -33370,22 +35602,22 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 45, + "end": 47, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 48, - "start": 46, + "end": 50, + "start": 48, "type": "REQUEST_EXECUTION" }, { - "end": 53, - "start": 49, + "end": 54, + "start": 51, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_packet_mirrorings_aggregated_list_sync.py" + "title": "compute_v1_generated_packet_mirrorings_patch_sync.py" }, { "canonical": true, @@ -33394,19 +35626,19 @@ "fullName": "google.cloud.compute_v1.PacketMirroringsClient", "shortName": "PacketMirroringsClient" }, - "fullName": "google.cloud.compute_v1.PacketMirroringsClient.delete", + "fullName": "google.cloud.compute_v1.PacketMirroringsClient.test_iam_permissions", "method": { - "fullName": "google.cloud.compute.v1.PacketMirrorings.Delete", + "fullName": "google.cloud.compute.v1.PacketMirrorings.TestIamPermissions", "service": { "fullName": "google.cloud.compute.v1.PacketMirrorings", "shortName": "PacketMirrorings" }, - "shortName": "Delete" + "shortName": "TestIamPermissions" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.DeletePacketMirroringRequest" + "type": "google.cloud.compute_v1.types.TestIamPermissionsPacketMirroringRequest" }, { "name": "project", @@ -33417,9 +35649,13 @@ "type": "str" }, { - "name": "packet_mirroring", + "name": "resource", "type": "str" }, + { + "name": "test_permissions_request_resource", + "type": "google.cloud.compute_v1.types.TestPermissionsRequest" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -33433,14 +35669,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "delete" + "resultType": "google.cloud.compute_v1.types.TestPermissionsResponse", + "shortName": "test_iam_permissions" }, - "description": "Sample for Delete", - "file": "compute_v1_generated_packet_mirrorings_delete_sync.py", + "description": "Sample for TestIamPermissions", + "file": "compute_v1_generated_packet_mirrorings_test_iam_permissions_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_PacketMirrorings_Delete_sync", + "regionTag": "compute_v1_generated_PacketMirrorings_TestIamPermissions_sync", "segments": [ { "end": 53, @@ -33473,41 +35709,33 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_packet_mirrorings_delete_sync.py" + "title": "compute_v1_generated_packet_mirrorings_test_iam_permissions_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.PacketMirroringsClient", - "shortName": "PacketMirroringsClient" + "fullName": "google.cloud.compute_v1.ProjectsClient", + "shortName": "ProjectsClient" }, - "fullName": "google.cloud.compute_v1.PacketMirroringsClient.get", + "fullName": "google.cloud.compute_v1.ProjectsClient.disable_xpn_host", "method": { - "fullName": "google.cloud.compute.v1.PacketMirrorings.Get", + "fullName": "google.cloud.compute.v1.Projects.DisableXpnHost", "service": { - "fullName": "google.cloud.compute.v1.PacketMirrorings", - "shortName": "PacketMirrorings" + "fullName": "google.cloud.compute.v1.Projects", + "shortName": "Projects" }, - "shortName": "Get" + "shortName": "DisableXpnHost" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetPacketMirroringRequest" + "type": "google.cloud.compute_v1.types.DisableXpnHostProjectRequest" }, { "name": "project", "type": "str" }, - { - "name": "region", - "type": "str" - }, - { - "name": "packet_mirroring", - "type": "str" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -33521,22 +35749,22 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.PacketMirroring", - "shortName": "get" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "disable_xpn_host" }, - "description": "Sample for Get", - "file": "compute_v1_generated_packet_mirrorings_get_sync.py", + "description": "Sample for DisableXpnHost", + "file": "compute_v1_generated_projects_disable_xpn_host_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_PacketMirrorings_Get_sync", + "regionTag": "compute_v1_generated_Projects_DisableXpnHost_sync", "segments": [ { - "end": 53, + "end": 51, "start": 27, "type": "FULL" }, { - "end": 53, + "end": 51, "start": 27, "type": "SHORT" }, @@ -33546,55 +35774,51 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 47, + "end": 45, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 50, - "start": 48, + "end": 48, + "start": 46, "type": "REQUEST_EXECUTION" }, { - "end": 54, - "start": 51, + "end": 52, + "start": 49, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_packet_mirrorings_get_sync.py" + "title": "compute_v1_generated_projects_disable_xpn_host_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.PacketMirroringsClient", - "shortName": "PacketMirroringsClient" + "fullName": "google.cloud.compute_v1.ProjectsClient", + "shortName": "ProjectsClient" }, - "fullName": "google.cloud.compute_v1.PacketMirroringsClient.insert", + "fullName": "google.cloud.compute_v1.ProjectsClient.disable_xpn_resource", "method": { - "fullName": "google.cloud.compute.v1.PacketMirrorings.Insert", + "fullName": "google.cloud.compute.v1.Projects.DisableXpnResource", "service": { - "fullName": "google.cloud.compute.v1.PacketMirrorings", - "shortName": "PacketMirrorings" + "fullName": "google.cloud.compute.v1.Projects", + "shortName": "Projects" }, - "shortName": "Insert" + "shortName": "DisableXpnResource" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.InsertPacketMirroringRequest" + "type": "google.cloud.compute_v1.types.DisableXpnResourceProjectRequest" }, { "name": "project", "type": "str" }, { - "name": "region", - "type": "str" - }, - { - "name": "packet_mirroring_resource", - "type": "google.cloud.compute_v1.types.PacketMirroring" + "name": "projects_disable_xpn_resource_request_resource", + "type": "google.cloud.compute_v1.types.ProjectsDisableXpnResourceRequest" }, { "name": "retry", @@ -33610,21 +35834,21 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "insert" + "shortName": "disable_xpn_resource" }, - "description": "Sample for Insert", - "file": "compute_v1_generated_packet_mirrorings_insert_sync.py", + "description": "Sample for DisableXpnResource", + "file": "compute_v1_generated_projects_disable_xpn_resource_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_PacketMirrorings_Insert_sync", + "regionTag": "compute_v1_generated_Projects_DisableXpnResource_sync", "segments": [ { - "end": 52, + "end": 51, "start": 27, "type": "FULL" }, { - "end": 52, + "end": 51, "start": 27, "type": "SHORT" }, @@ -33634,52 +35858,48 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 46, + "end": 45, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 49, - "start": 47, + "end": 48, + "start": 46, "type": "REQUEST_EXECUTION" }, { - "end": 53, - "start": 50, + "end": 52, + "start": 49, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_packet_mirrorings_insert_sync.py" + "title": "compute_v1_generated_projects_disable_xpn_resource_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.PacketMirroringsClient", - "shortName": "PacketMirroringsClient" + "fullName": "google.cloud.compute_v1.ProjectsClient", + "shortName": "ProjectsClient" }, - "fullName": "google.cloud.compute_v1.PacketMirroringsClient.list", + "fullName": "google.cloud.compute_v1.ProjectsClient.enable_xpn_host", "method": { - "fullName": "google.cloud.compute.v1.PacketMirrorings.List", + "fullName": "google.cloud.compute.v1.Projects.EnableXpnHost", "service": { - "fullName": "google.cloud.compute.v1.PacketMirrorings", - "shortName": "PacketMirrorings" + "fullName": "google.cloud.compute.v1.Projects", + "shortName": "Projects" }, - "shortName": "List" + "shortName": "EnableXpnHost" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.ListPacketMirroringsRequest" + "type": "google.cloud.compute_v1.types.EnableXpnHostProjectRequest" }, { "name": "project", "type": "str" }, - { - "name": "region", - "type": "str" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -33693,22 +35913,22 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.services.packet_mirrorings.pagers.ListPager", - "shortName": "list" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "enable_xpn_host" }, - "description": "Sample for List", - "file": "compute_v1_generated_packet_mirrorings_list_sync.py", + "description": "Sample for EnableXpnHost", + "file": "compute_v1_generated_projects_enable_xpn_host_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_PacketMirrorings_List_sync", + "regionTag": "compute_v1_generated_Projects_EnableXpnHost_sync", "segments": [ { - "end": 53, + "end": 51, "start": 27, "type": "FULL" }, { - "end": 53, + "end": 51, "start": 27, "type": "SHORT" }, @@ -33718,59 +35938,51 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 46, + "end": 45, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 49, - "start": 47, + "end": 48, + "start": 46, "type": "REQUEST_EXECUTION" }, { - "end": 54, - "start": 50, + "end": 52, + "start": 49, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_packet_mirrorings_list_sync.py" + "title": "compute_v1_generated_projects_enable_xpn_host_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.PacketMirroringsClient", - "shortName": "PacketMirroringsClient" + "fullName": "google.cloud.compute_v1.ProjectsClient", + "shortName": "ProjectsClient" }, - "fullName": "google.cloud.compute_v1.PacketMirroringsClient.patch", + "fullName": "google.cloud.compute_v1.ProjectsClient.enable_xpn_resource", "method": { - "fullName": "google.cloud.compute.v1.PacketMirrorings.Patch", + "fullName": "google.cloud.compute.v1.Projects.EnableXpnResource", "service": { - "fullName": "google.cloud.compute.v1.PacketMirrorings", - "shortName": "PacketMirrorings" + "fullName": "google.cloud.compute.v1.Projects", + "shortName": "Projects" }, - "shortName": "Patch" + "shortName": "EnableXpnResource" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.PatchPacketMirroringRequest" + "type": "google.cloud.compute_v1.types.EnableXpnResourceProjectRequest" }, { "name": "project", "type": "str" }, { - "name": "region", - "type": "str" - }, - { - "name": "packet_mirroring", - "type": "str" - }, - { - "name": "packet_mirroring_resource", - "type": "google.cloud.compute_v1.types.PacketMirroring" + "name": "projects_enable_xpn_resource_request_resource", + "type": "google.cloud.compute_v1.types.ProjectsEnableXpnResourceRequest" }, { "name": "retry", @@ -33786,21 +35998,21 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "patch" + "shortName": "enable_xpn_resource" }, - "description": "Sample for Patch", - "file": "compute_v1_generated_packet_mirrorings_patch_sync.py", + "description": "Sample for EnableXpnResource", + "file": "compute_v1_generated_projects_enable_xpn_resource_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_PacketMirrorings_Patch_sync", + "regionTag": "compute_v1_generated_Projects_EnableXpnResource_sync", "segments": [ { - "end": 53, + "end": 51, "start": 27, "type": "FULL" }, { - "end": 53, + "end": 51, "start": 27, "type": "SHORT" }, @@ -33810,59 +36022,127 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 47, + "end": 45, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 50, - "start": 48, + "end": 48, + "start": 46, "type": "REQUEST_EXECUTION" }, { - "end": 54, - "start": 51, + "end": 52, + "start": 49, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_packet_mirrorings_patch_sync.py" + "title": "compute_v1_generated_projects_enable_xpn_resource_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.PacketMirroringsClient", - "shortName": "PacketMirroringsClient" + "fullName": "google.cloud.compute_v1.ProjectsClient", + "shortName": "ProjectsClient" }, - "fullName": "google.cloud.compute_v1.PacketMirroringsClient.test_iam_permissions", + "fullName": "google.cloud.compute_v1.ProjectsClient.get_xpn_host", "method": { - "fullName": "google.cloud.compute.v1.PacketMirrorings.TestIamPermissions", + "fullName": "google.cloud.compute.v1.Projects.GetXpnHost", "service": { - "fullName": "google.cloud.compute.v1.PacketMirrorings", - "shortName": "PacketMirrorings" + "fullName": "google.cloud.compute.v1.Projects", + "shortName": "Projects" }, - "shortName": "TestIamPermissions" + "shortName": "GetXpnHost" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.TestIamPermissionsPacketMirroringRequest" + "type": "google.cloud.compute_v1.types.GetXpnHostProjectRequest" }, { "name": "project", "type": "str" }, { - "name": "region", - "type": "str" + "name": "retry", + "type": "google.api_core.retry.Retry" }, { - "name": "resource", - "type": "str" + "name": "timeout", + "type": "float" }, { - "name": "test_permissions_request_resource", - "type": "google.cloud.compute_v1.types.TestPermissionsRequest" + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.cloud.compute_v1.types.Project", + "shortName": "get_xpn_host" + }, + "description": "Sample for GetXpnHost", + "file": "compute_v1_generated_projects_get_xpn_host_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "compute_v1_generated_Projects_GetXpnHost_sync", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "compute_v1_generated_projects_get_xpn_host_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.compute_v1.ProjectsClient", + "shortName": "ProjectsClient" + }, + "fullName": "google.cloud.compute_v1.ProjectsClient.get_xpn_resources", + "method": { + "fullName": "google.cloud.compute.v1.Projects.GetXpnResources", + "service": { + "fullName": "google.cloud.compute.v1.Projects", + "shortName": "Projects" + }, + "shortName": "GetXpnResources" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.compute_v1.types.GetXpnResourcesProjectsRequest" + }, + { + "name": "project", + "type": "str" }, { "name": "retry", @@ -33877,22 +36157,22 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.TestPermissionsResponse", - "shortName": "test_iam_permissions" + "resultType": "google.cloud.compute_v1.services.projects.pagers.GetXpnResourcesPager", + "shortName": "get_xpn_resources" }, - "description": "Sample for TestIamPermissions", - "file": "compute_v1_generated_packet_mirrorings_test_iam_permissions_sync.py", + "description": "Sample for GetXpnResources", + "file": "compute_v1_generated_projects_get_xpn_resources_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_PacketMirrorings_TestIamPermissions_sync", + "regionTag": "compute_v1_generated_Projects_GetXpnResources_sync", "segments": [ { - "end": 53, + "end": 52, "start": 27, "type": "FULL" }, { - "end": 53, + "end": 52, "start": 27, "type": "SHORT" }, @@ -33902,22 +36182,22 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 47, + "end": 45, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 50, - "start": 48, + "end": 48, + "start": 46, "type": "REQUEST_EXECUTION" }, { - "end": 54, - "start": 51, + "end": 53, + "start": 49, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_packet_mirrorings_test_iam_permissions_sync.py" + "title": "compute_v1_generated_projects_get_xpn_resources_sync.py" }, { "canonical": true, @@ -33926,19 +36206,19 @@ "fullName": "google.cloud.compute_v1.ProjectsClient", "shortName": "ProjectsClient" }, - "fullName": "google.cloud.compute_v1.ProjectsClient.disable_xpn_host", + "fullName": "google.cloud.compute_v1.ProjectsClient.get", "method": { - "fullName": "google.cloud.compute.v1.Projects.DisableXpnHost", + "fullName": "google.cloud.compute.v1.Projects.Get", "service": { "fullName": "google.cloud.compute.v1.Projects", "shortName": "Projects" }, - "shortName": "DisableXpnHost" + "shortName": "Get" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.DisableXpnHostProjectRequest" + "type": "google.cloud.compute_v1.types.GetProjectRequest" }, { "name": "project", @@ -33957,14 +36237,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "disable_xpn_host" + "resultType": "google.cloud.compute_v1.types.Project", + "shortName": "get" }, - "description": "Sample for DisableXpnHost", - "file": "compute_v1_generated_projects_disable_xpn_host_sync.py", + "description": "Sample for Get", + "file": "compute_v1_generated_projects_get_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_Projects_DisableXpnHost_sync", + "regionTag": "compute_v1_generated_Projects_Get_sync", "segments": [ { "end": 51, @@ -33997,7 +36277,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_projects_disable_xpn_host_sync.py" + "title": "compute_v1_generated_projects_get_sync.py" }, { "canonical": true, @@ -34006,27 +36286,27 @@ "fullName": "google.cloud.compute_v1.ProjectsClient", "shortName": "ProjectsClient" }, - "fullName": "google.cloud.compute_v1.ProjectsClient.disable_xpn_resource", + "fullName": "google.cloud.compute_v1.ProjectsClient.list_xpn_hosts", "method": { - "fullName": "google.cloud.compute.v1.Projects.DisableXpnResource", + "fullName": "google.cloud.compute.v1.Projects.ListXpnHosts", "service": { "fullName": "google.cloud.compute.v1.Projects", "shortName": "Projects" }, - "shortName": "DisableXpnResource" + "shortName": "ListXpnHosts" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.DisableXpnResourceProjectRequest" + "type": "google.cloud.compute_v1.types.ListXpnHostsProjectsRequest" }, { "name": "project", "type": "str" }, { - "name": "projects_disable_xpn_resource_request_resource", - "type": "google.cloud.compute_v1.types.ProjectsDisableXpnResourceRequest" + "name": "projects_list_xpn_hosts_request_resource", + "type": "google.cloud.compute_v1.types.ProjectsListXpnHostsRequest" }, { "name": "retry", @@ -34041,22 +36321,22 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "disable_xpn_resource" + "resultType": "google.cloud.compute_v1.services.projects.pagers.ListXpnHostsPager", + "shortName": "list_xpn_hosts" }, - "description": "Sample for DisableXpnResource", - "file": "compute_v1_generated_projects_disable_xpn_resource_sync.py", + "description": "Sample for ListXpnHosts", + "file": "compute_v1_generated_projects_list_xpn_hosts_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_Projects_DisableXpnResource_sync", + "regionTag": "compute_v1_generated_Projects_ListXpnHosts_sync", "segments": [ { - "end": 51, + "end": 52, "start": 27, "type": "FULL" }, { - "end": 51, + "end": 52, "start": 27, "type": "SHORT" }, @@ -34076,12 +36356,12 @@ "type": "REQUEST_EXECUTION" }, { - "end": 52, + "end": 53, "start": 49, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_projects_disable_xpn_resource_sync.py" + "title": "compute_v1_generated_projects_list_xpn_hosts_sync.py" }, { "canonical": true, @@ -34090,24 +36370,28 @@ "fullName": "google.cloud.compute_v1.ProjectsClient", "shortName": "ProjectsClient" }, - "fullName": "google.cloud.compute_v1.ProjectsClient.enable_xpn_host", + "fullName": "google.cloud.compute_v1.ProjectsClient.move_disk", "method": { - "fullName": "google.cloud.compute.v1.Projects.EnableXpnHost", + "fullName": "google.cloud.compute.v1.Projects.MoveDisk", "service": { "fullName": "google.cloud.compute.v1.Projects", "shortName": "Projects" }, - "shortName": "EnableXpnHost" + "shortName": "MoveDisk" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.EnableXpnHostProjectRequest" + "type": "google.cloud.compute_v1.types.MoveDiskProjectRequest" }, { "name": "project", "type": "str" }, + { + "name": "disk_move_request_resource", + "type": "google.cloud.compute_v1.types.DiskMoveRequest" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -34122,13 +36406,13 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "enable_xpn_host" + "shortName": "move_disk" }, - "description": "Sample for EnableXpnHost", - "file": "compute_v1_generated_projects_enable_xpn_host_sync.py", + "description": "Sample for MoveDisk", + "file": "compute_v1_generated_projects_move_disk_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_Projects_EnableXpnHost_sync", + "regionTag": "compute_v1_generated_Projects_MoveDisk_sync", "segments": [ { "end": 51, @@ -34161,7 +36445,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_projects_enable_xpn_host_sync.py" + "title": "compute_v1_generated_projects_move_disk_sync.py" }, { "canonical": true, @@ -34170,27 +36454,27 @@ "fullName": "google.cloud.compute_v1.ProjectsClient", "shortName": "ProjectsClient" }, - "fullName": "google.cloud.compute_v1.ProjectsClient.enable_xpn_resource", + "fullName": "google.cloud.compute_v1.ProjectsClient.move_instance", "method": { - "fullName": "google.cloud.compute.v1.Projects.EnableXpnResource", + "fullName": "google.cloud.compute.v1.Projects.MoveInstance", "service": { "fullName": "google.cloud.compute.v1.Projects", "shortName": "Projects" }, - "shortName": "EnableXpnResource" + "shortName": "MoveInstance" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.EnableXpnResourceProjectRequest" + "type": "google.cloud.compute_v1.types.MoveInstanceProjectRequest" }, { "name": "project", "type": "str" }, { - "name": "projects_enable_xpn_resource_request_resource", - "type": "google.cloud.compute_v1.types.ProjectsEnableXpnResourceRequest" + "name": "instance_move_request_resource", + "type": "google.cloud.compute_v1.types.InstanceMoveRequest" }, { "name": "retry", @@ -34206,13 +36490,13 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "enable_xpn_resource" + "shortName": "move_instance" }, - "description": "Sample for EnableXpnResource", - "file": "compute_v1_generated_projects_enable_xpn_resource_sync.py", + "description": "Sample for MoveInstance", + "file": "compute_v1_generated_projects_move_instance_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_Projects_EnableXpnResource_sync", + "regionTag": "compute_v1_generated_Projects_MoveInstance_sync", "segments": [ { "end": 51, @@ -34245,7 +36529,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_projects_enable_xpn_resource_sync.py" + "title": "compute_v1_generated_projects_move_instance_sync.py" }, { "canonical": true, @@ -34254,24 +36538,28 @@ "fullName": "google.cloud.compute_v1.ProjectsClient", "shortName": "ProjectsClient" }, - "fullName": "google.cloud.compute_v1.ProjectsClient.get_xpn_host", + "fullName": "google.cloud.compute_v1.ProjectsClient.set_cloud_armor_tier", "method": { - "fullName": "google.cloud.compute.v1.Projects.GetXpnHost", + "fullName": "google.cloud.compute.v1.Projects.SetCloudArmorTier", "service": { "fullName": "google.cloud.compute.v1.Projects", "shortName": "Projects" }, - "shortName": "GetXpnHost" + "shortName": "SetCloudArmorTier" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetXpnHostProjectRequest" + "type": "google.cloud.compute_v1.types.SetCloudArmorTierProjectRequest" }, { "name": "project", "type": "str" }, + { + "name": "projects_set_cloud_armor_tier_request_resource", + "type": "google.cloud.compute_v1.types.ProjectsSetCloudArmorTierRequest" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -34285,14 +36573,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.Project", - "shortName": "get_xpn_host" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "set_cloud_armor_tier" }, - "description": "Sample for GetXpnHost", - "file": "compute_v1_generated_projects_get_xpn_host_sync.py", + "description": "Sample for SetCloudArmorTier", + "file": "compute_v1_generated_projects_set_cloud_armor_tier_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_Projects_GetXpnHost_sync", + "regionTag": "compute_v1_generated_Projects_SetCloudArmorTier_sync", "segments": [ { "end": 51, @@ -34325,7 +36613,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_projects_get_xpn_host_sync.py" + "title": "compute_v1_generated_projects_set_cloud_armor_tier_sync.py" }, { "canonical": true, @@ -34334,24 +36622,28 @@ "fullName": "google.cloud.compute_v1.ProjectsClient", "shortName": "ProjectsClient" }, - "fullName": "google.cloud.compute_v1.ProjectsClient.get_xpn_resources", + "fullName": "google.cloud.compute_v1.ProjectsClient.set_common_instance_metadata", "method": { - "fullName": "google.cloud.compute.v1.Projects.GetXpnResources", + "fullName": "google.cloud.compute.v1.Projects.SetCommonInstanceMetadata", "service": { "fullName": "google.cloud.compute.v1.Projects", "shortName": "Projects" }, - "shortName": "GetXpnResources" + "shortName": "SetCommonInstanceMetadata" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetXpnResourcesProjectsRequest" + "type": "google.cloud.compute_v1.types.SetCommonInstanceMetadataProjectRequest" }, { "name": "project", "type": "str" }, + { + "name": "metadata_resource", + "type": "google.cloud.compute_v1.types.Metadata" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -34365,22 +36657,22 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.services.projects.pagers.GetXpnResourcesPager", - "shortName": "get_xpn_resources" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "set_common_instance_metadata" }, - "description": "Sample for GetXpnResources", - "file": "compute_v1_generated_projects_get_xpn_resources_sync.py", + "description": "Sample for SetCommonInstanceMetadata", + "file": "compute_v1_generated_projects_set_common_instance_metadata_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_Projects_GetXpnResources_sync", + "regionTag": "compute_v1_generated_Projects_SetCommonInstanceMetadata_sync", "segments": [ { - "end": 52, + "end": 51, "start": 27, "type": "FULL" }, { - "end": 52, + "end": 51, "start": 27, "type": "SHORT" }, @@ -34400,12 +36692,12 @@ "type": "REQUEST_EXECUTION" }, { - "end": 53, + "end": 52, "start": 49, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_projects_get_xpn_resources_sync.py" + "title": "compute_v1_generated_projects_set_common_instance_metadata_sync.py" }, { "canonical": true, @@ -34414,24 +36706,28 @@ "fullName": "google.cloud.compute_v1.ProjectsClient", "shortName": "ProjectsClient" }, - "fullName": "google.cloud.compute_v1.ProjectsClient.get", + "fullName": "google.cloud.compute_v1.ProjectsClient.set_default_network_tier", "method": { - "fullName": "google.cloud.compute.v1.Projects.Get", + "fullName": "google.cloud.compute.v1.Projects.SetDefaultNetworkTier", "service": { "fullName": "google.cloud.compute.v1.Projects", "shortName": "Projects" }, - "shortName": "Get" + "shortName": "SetDefaultNetworkTier" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetProjectRequest" + "type": "google.cloud.compute_v1.types.SetDefaultNetworkTierProjectRequest" }, { "name": "project", "type": "str" }, + { + "name": "projects_set_default_network_tier_request_resource", + "type": "google.cloud.compute_v1.types.ProjectsSetDefaultNetworkTierRequest" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -34445,14 +36741,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.Project", - "shortName": "get" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "set_default_network_tier" }, - "description": "Sample for Get", - "file": "compute_v1_generated_projects_get_sync.py", + "description": "Sample for SetDefaultNetworkTier", + "file": "compute_v1_generated_projects_set_default_network_tier_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_Projects_Get_sync", + "regionTag": "compute_v1_generated_Projects_SetDefaultNetworkTier_sync", "segments": [ { "end": 51, @@ -34485,7 +36781,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_projects_get_sync.py" + "title": "compute_v1_generated_projects_set_default_network_tier_sync.py" }, { "canonical": true, @@ -34494,27 +36790,27 @@ "fullName": "google.cloud.compute_v1.ProjectsClient", "shortName": "ProjectsClient" }, - "fullName": "google.cloud.compute_v1.ProjectsClient.list_xpn_hosts", + "fullName": "google.cloud.compute_v1.ProjectsClient.set_usage_export_bucket", "method": { - "fullName": "google.cloud.compute.v1.Projects.ListXpnHosts", + "fullName": "google.cloud.compute.v1.Projects.SetUsageExportBucket", "service": { "fullName": "google.cloud.compute.v1.Projects", "shortName": "Projects" }, - "shortName": "ListXpnHosts" + "shortName": "SetUsageExportBucket" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.ListXpnHostsProjectsRequest" + "type": "google.cloud.compute_v1.types.SetUsageExportBucketProjectRequest" }, { "name": "project", "type": "str" }, { - "name": "projects_list_xpn_hosts_request_resource", - "type": "google.cloud.compute_v1.types.ProjectsListXpnHostsRequest" + "name": "usage_export_location_resource", + "type": "google.cloud.compute_v1.types.UsageExportLocation" }, { "name": "retry", @@ -34529,22 +36825,22 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.services.projects.pagers.ListXpnHostsPager", - "shortName": "list_xpn_hosts" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "set_usage_export_bucket" }, - "description": "Sample for ListXpnHosts", - "file": "compute_v1_generated_projects_list_xpn_hosts_sync.py", + "description": "Sample for SetUsageExportBucket", + "file": "compute_v1_generated_projects_set_usage_export_bucket_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_Projects_ListXpnHosts_sync", + "regionTag": "compute_v1_generated_Projects_SetUsageExportBucket_sync", "segments": [ { - "end": 52, + "end": 51, "start": 27, "type": "FULL" }, { - "end": 52, + "end": 51, "start": 27, "type": "SHORT" }, @@ -34564,41 +36860,41 @@ "type": "REQUEST_EXECUTION" }, { - "end": 53, + "end": 52, "start": 49, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_projects_list_xpn_hosts_sync.py" + "title": "compute_v1_generated_projects_set_usage_export_bucket_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.ProjectsClient", - "shortName": "ProjectsClient" + "fullName": "google.cloud.compute_v1.PublicAdvertisedPrefixesClient", + "shortName": "PublicAdvertisedPrefixesClient" }, - "fullName": "google.cloud.compute_v1.ProjectsClient.move_disk", + "fullName": "google.cloud.compute_v1.PublicAdvertisedPrefixesClient.announce", "method": { - "fullName": "google.cloud.compute.v1.Projects.MoveDisk", + "fullName": "google.cloud.compute.v1.PublicAdvertisedPrefixes.Announce", "service": { - "fullName": "google.cloud.compute.v1.Projects", - "shortName": "Projects" + "fullName": "google.cloud.compute.v1.PublicAdvertisedPrefixes", + "shortName": "PublicAdvertisedPrefixes" }, - "shortName": "MoveDisk" + "shortName": "Announce" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.MoveDiskProjectRequest" + "type": "google.cloud.compute_v1.types.AnnouncePublicAdvertisedPrefixeRequest" }, { "name": "project", "type": "str" }, { - "name": "disk_move_request_resource", - "type": "google.cloud.compute_v1.types.DiskMoveRequest" + "name": "public_advertised_prefix", + "type": "str" }, { "name": "retry", @@ -34614,21 +36910,21 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "move_disk" + "shortName": "announce" }, - "description": "Sample for MoveDisk", - "file": "compute_v1_generated_projects_move_disk_sync.py", + "description": "Sample for Announce", + "file": "compute_v1_generated_public_advertised_prefixes_announce_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_Projects_MoveDisk_sync", + "regionTag": "compute_v1_generated_PublicAdvertisedPrefixes_Announce_sync", "segments": [ { - "end": 51, + "end": 52, "start": 27, "type": "FULL" }, { - "end": 51, + "end": 52, "start": 27, "type": "SHORT" }, @@ -34638,51 +36934,51 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 45, + "end": 46, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 48, - "start": 46, + "end": 49, + "start": 47, "type": "REQUEST_EXECUTION" }, { - "end": 52, - "start": 49, + "end": 53, + "start": 50, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_projects_move_disk_sync.py" + "title": "compute_v1_generated_public_advertised_prefixes_announce_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.ProjectsClient", - "shortName": "ProjectsClient" + "fullName": "google.cloud.compute_v1.PublicAdvertisedPrefixesClient", + "shortName": "PublicAdvertisedPrefixesClient" }, - "fullName": "google.cloud.compute_v1.ProjectsClient.move_instance", + "fullName": "google.cloud.compute_v1.PublicAdvertisedPrefixesClient.delete", "method": { - "fullName": "google.cloud.compute.v1.Projects.MoveInstance", + "fullName": "google.cloud.compute.v1.PublicAdvertisedPrefixes.Delete", "service": { - "fullName": "google.cloud.compute.v1.Projects", - "shortName": "Projects" + "fullName": "google.cloud.compute.v1.PublicAdvertisedPrefixes", + "shortName": "PublicAdvertisedPrefixes" }, - "shortName": "MoveInstance" + "shortName": "Delete" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.MoveInstanceProjectRequest" + "type": "google.cloud.compute_v1.types.DeletePublicAdvertisedPrefixeRequest" }, { "name": "project", "type": "str" }, { - "name": "instance_move_request_resource", - "type": "google.cloud.compute_v1.types.InstanceMoveRequest" + "name": "public_advertised_prefix", + "type": "str" }, { "name": "retry", @@ -34698,21 +36994,21 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "move_instance" + "shortName": "delete" }, - "description": "Sample for MoveInstance", - "file": "compute_v1_generated_projects_move_instance_sync.py", + "description": "Sample for Delete", + "file": "compute_v1_generated_public_advertised_prefixes_delete_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_Projects_MoveInstance_sync", + "regionTag": "compute_v1_generated_PublicAdvertisedPrefixes_Delete_sync", "segments": [ { - "end": 51, + "end": 52, "start": 27, "type": "FULL" }, { - "end": 51, + "end": 52, "start": 27, "type": "SHORT" }, @@ -34722,51 +37018,51 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 45, + "end": 46, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 48, - "start": 46, + "end": 49, + "start": 47, "type": "REQUEST_EXECUTION" }, { - "end": 52, - "start": 49, + "end": 53, + "start": 50, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_projects_move_instance_sync.py" + "title": "compute_v1_generated_public_advertised_prefixes_delete_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.ProjectsClient", - "shortName": "ProjectsClient" + "fullName": "google.cloud.compute_v1.PublicAdvertisedPrefixesClient", + "shortName": "PublicAdvertisedPrefixesClient" }, - "fullName": "google.cloud.compute_v1.ProjectsClient.set_cloud_armor_tier", + "fullName": "google.cloud.compute_v1.PublicAdvertisedPrefixesClient.get", "method": { - "fullName": "google.cloud.compute.v1.Projects.SetCloudArmorTier", + "fullName": "google.cloud.compute.v1.PublicAdvertisedPrefixes.Get", "service": { - "fullName": "google.cloud.compute.v1.Projects", - "shortName": "Projects" + "fullName": "google.cloud.compute.v1.PublicAdvertisedPrefixes", + "shortName": "PublicAdvertisedPrefixes" }, - "shortName": "SetCloudArmorTier" + "shortName": "Get" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.SetCloudArmorTierProjectRequest" + "type": "google.cloud.compute_v1.types.GetPublicAdvertisedPrefixeRequest" }, { "name": "project", "type": "str" }, { - "name": "projects_set_cloud_armor_tier_request_resource", - "type": "google.cloud.compute_v1.types.ProjectsSetCloudArmorTierRequest" + "name": "public_advertised_prefix", + "type": "str" }, { "name": "retry", @@ -34781,22 +37077,22 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "set_cloud_armor_tier" + "resultType": "google.cloud.compute_v1.types.PublicAdvertisedPrefix", + "shortName": "get" }, - "description": "Sample for SetCloudArmorTier", - "file": "compute_v1_generated_projects_set_cloud_armor_tier_sync.py", + "description": "Sample for Get", + "file": "compute_v1_generated_public_advertised_prefixes_get_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_Projects_SetCloudArmorTier_sync", + "regionTag": "compute_v1_generated_PublicAdvertisedPrefixes_Get_sync", "segments": [ { - "end": 51, + "end": 52, "start": 27, "type": "FULL" }, { - "end": 51, + "end": 52, "start": 27, "type": "SHORT" }, @@ -34806,51 +37102,51 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 45, + "end": 46, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 48, - "start": 46, + "end": 49, + "start": 47, "type": "REQUEST_EXECUTION" }, { - "end": 52, - "start": 49, + "end": 53, + "start": 50, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_projects_set_cloud_armor_tier_sync.py" + "title": "compute_v1_generated_public_advertised_prefixes_get_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.ProjectsClient", - "shortName": "ProjectsClient" + "fullName": "google.cloud.compute_v1.PublicAdvertisedPrefixesClient", + "shortName": "PublicAdvertisedPrefixesClient" }, - "fullName": "google.cloud.compute_v1.ProjectsClient.set_common_instance_metadata", + "fullName": "google.cloud.compute_v1.PublicAdvertisedPrefixesClient.insert", "method": { - "fullName": "google.cloud.compute.v1.Projects.SetCommonInstanceMetadata", + "fullName": "google.cloud.compute.v1.PublicAdvertisedPrefixes.Insert", "service": { - "fullName": "google.cloud.compute.v1.Projects", - "shortName": "Projects" + "fullName": "google.cloud.compute.v1.PublicAdvertisedPrefixes", + "shortName": "PublicAdvertisedPrefixes" }, - "shortName": "SetCommonInstanceMetadata" + "shortName": "Insert" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.SetCommonInstanceMetadataProjectRequest" + "type": "google.cloud.compute_v1.types.InsertPublicAdvertisedPrefixeRequest" }, { "name": "project", "type": "str" }, { - "name": "metadata_resource", - "type": "google.cloud.compute_v1.types.Metadata" + "name": "public_advertised_prefix_resource", + "type": "google.cloud.compute_v1.types.PublicAdvertisedPrefix" }, { "name": "retry", @@ -34866,13 +37162,13 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "set_common_instance_metadata" + "shortName": "insert" }, - "description": "Sample for SetCommonInstanceMetadata", - "file": "compute_v1_generated_projects_set_common_instance_metadata_sync.py", + "description": "Sample for Insert", + "file": "compute_v1_generated_public_advertised_prefixes_insert_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_Projects_SetCommonInstanceMetadata_sync", + "regionTag": "compute_v1_generated_PublicAdvertisedPrefixes_Insert_sync", "segments": [ { "end": 51, @@ -34905,37 +37201,33 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_projects_set_common_instance_metadata_sync.py" + "title": "compute_v1_generated_public_advertised_prefixes_insert_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.ProjectsClient", - "shortName": "ProjectsClient" + "fullName": "google.cloud.compute_v1.PublicAdvertisedPrefixesClient", + "shortName": "PublicAdvertisedPrefixesClient" }, - "fullName": "google.cloud.compute_v1.ProjectsClient.set_default_network_tier", + "fullName": "google.cloud.compute_v1.PublicAdvertisedPrefixesClient.list", "method": { - "fullName": "google.cloud.compute.v1.Projects.SetDefaultNetworkTier", + "fullName": "google.cloud.compute.v1.PublicAdvertisedPrefixes.List", "service": { - "fullName": "google.cloud.compute.v1.Projects", - "shortName": "Projects" + "fullName": "google.cloud.compute.v1.PublicAdvertisedPrefixes", + "shortName": "PublicAdvertisedPrefixes" }, - "shortName": "SetDefaultNetworkTier" + "shortName": "List" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.SetDefaultNetworkTierProjectRequest" + "type": "google.cloud.compute_v1.types.ListPublicAdvertisedPrefixesRequest" }, { "name": "project", "type": "str" }, - { - "name": "projects_set_default_network_tier_request_resource", - "type": "google.cloud.compute_v1.types.ProjectsSetDefaultNetworkTierRequest" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -34949,22 +37241,22 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "set_default_network_tier" + "resultType": "google.cloud.compute_v1.services.public_advertised_prefixes.pagers.ListPager", + "shortName": "list" }, - "description": "Sample for SetDefaultNetworkTier", - "file": "compute_v1_generated_projects_set_default_network_tier_sync.py", + "description": "Sample for List", + "file": "compute_v1_generated_public_advertised_prefixes_list_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_Projects_SetDefaultNetworkTier_sync", + "regionTag": "compute_v1_generated_PublicAdvertisedPrefixes_List_sync", "segments": [ { - "end": 51, + "end": 52, "start": 27, "type": "FULL" }, { - "end": 51, + "end": 52, "start": 27, "type": "SHORT" }, @@ -34984,41 +37276,45 @@ "type": "REQUEST_EXECUTION" }, { - "end": 52, + "end": 53, "start": 49, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_projects_set_default_network_tier_sync.py" + "title": "compute_v1_generated_public_advertised_prefixes_list_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.ProjectsClient", - "shortName": "ProjectsClient" + "fullName": "google.cloud.compute_v1.PublicAdvertisedPrefixesClient", + "shortName": "PublicAdvertisedPrefixesClient" }, - "fullName": "google.cloud.compute_v1.ProjectsClient.set_usage_export_bucket", + "fullName": "google.cloud.compute_v1.PublicAdvertisedPrefixesClient.patch", "method": { - "fullName": "google.cloud.compute.v1.Projects.SetUsageExportBucket", + "fullName": "google.cloud.compute.v1.PublicAdvertisedPrefixes.Patch", "service": { - "fullName": "google.cloud.compute.v1.Projects", - "shortName": "Projects" + "fullName": "google.cloud.compute.v1.PublicAdvertisedPrefixes", + "shortName": "PublicAdvertisedPrefixes" }, - "shortName": "SetUsageExportBucket" + "shortName": "Patch" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.SetUsageExportBucketProjectRequest" + "type": "google.cloud.compute_v1.types.PatchPublicAdvertisedPrefixeRequest" }, { "name": "project", "type": "str" }, { - "name": "usage_export_location_resource", - "type": "google.cloud.compute_v1.types.UsageExportLocation" + "name": "public_advertised_prefix", + "type": "str" + }, + { + "name": "public_advertised_prefix_resource", + "type": "google.cloud.compute_v1.types.PublicAdvertisedPrefix" }, { "name": "retry", @@ -35034,21 +37330,21 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "set_usage_export_bucket" + "shortName": "patch" }, - "description": "Sample for SetUsageExportBucket", - "file": "compute_v1_generated_projects_set_usage_export_bucket_sync.py", + "description": "Sample for Patch", + "file": "compute_v1_generated_public_advertised_prefixes_patch_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_Projects_SetUsageExportBucket_sync", + "regionTag": "compute_v1_generated_PublicAdvertisedPrefixes_Patch_sync", "segments": [ { - "end": 51, + "end": 52, "start": 27, "type": "FULL" }, { - "end": 51, + "end": 52, "start": 27, "type": "SHORT" }, @@ -35058,22 +37354,22 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 45, + "end": 46, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 48, - "start": 46, + "end": 49, + "start": 47, "type": "REQUEST_EXECUTION" }, { - "end": 52, - "start": 49, + "end": 53, + "start": 50, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_projects_set_usage_export_bucket_sync.py" + "title": "compute_v1_generated_public_advertised_prefixes_patch_sync.py" }, { "canonical": true, @@ -35082,19 +37378,19 @@ "fullName": "google.cloud.compute_v1.PublicAdvertisedPrefixesClient", "shortName": "PublicAdvertisedPrefixesClient" }, - "fullName": "google.cloud.compute_v1.PublicAdvertisedPrefixesClient.announce", + "fullName": "google.cloud.compute_v1.PublicAdvertisedPrefixesClient.withdraw", "method": { - "fullName": "google.cloud.compute.v1.PublicAdvertisedPrefixes.Announce", + "fullName": "google.cloud.compute.v1.PublicAdvertisedPrefixes.Withdraw", "service": { "fullName": "google.cloud.compute.v1.PublicAdvertisedPrefixes", "shortName": "PublicAdvertisedPrefixes" }, - "shortName": "Announce" + "shortName": "Withdraw" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.AnnouncePublicAdvertisedPrefixeRequest" + "type": "google.cloud.compute_v1.types.WithdrawPublicAdvertisedPrefixeRequest" }, { "name": "project", @@ -35118,13 +37414,13 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "announce" + "shortName": "withdraw" }, - "description": "Sample for Announce", - "file": "compute_v1_generated_public_advertised_prefixes_announce_sync.py", + "description": "Sample for Withdraw", + "file": "compute_v1_generated_public_advertised_prefixes_withdraw_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_PublicAdvertisedPrefixes_Announce_sync", + "regionTag": "compute_v1_generated_PublicAdvertisedPrefixes_Withdraw_sync", "segments": [ { "end": 52, @@ -35157,37 +37453,33 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_public_advertised_prefixes_announce_sync.py" + "title": "compute_v1_generated_public_advertised_prefixes_withdraw_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.PublicAdvertisedPrefixesClient", - "shortName": "PublicAdvertisedPrefixesClient" + "fullName": "google.cloud.compute_v1.PublicDelegatedPrefixesClient", + "shortName": "PublicDelegatedPrefixesClient" }, - "fullName": "google.cloud.compute_v1.PublicAdvertisedPrefixesClient.delete", + "fullName": "google.cloud.compute_v1.PublicDelegatedPrefixesClient.aggregated_list", "method": { - "fullName": "google.cloud.compute.v1.PublicAdvertisedPrefixes.Delete", + "fullName": "google.cloud.compute.v1.PublicDelegatedPrefixes.AggregatedList", "service": { - "fullName": "google.cloud.compute.v1.PublicAdvertisedPrefixes", - "shortName": "PublicAdvertisedPrefixes" + "fullName": "google.cloud.compute.v1.PublicDelegatedPrefixes", + "shortName": "PublicDelegatedPrefixes" }, - "shortName": "Delete" + "shortName": "AggregatedList" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.DeletePublicAdvertisedPrefixeRequest" + "type": "google.cloud.compute_v1.types.AggregatedListPublicDelegatedPrefixesRequest" }, { "name": "project", "type": "str" }, - { - "name": "public_advertised_prefix", - "type": "str" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -35201,14 +37493,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "delete" + "resultType": "google.cloud.compute_v1.services.public_delegated_prefixes.pagers.AggregatedListPager", + "shortName": "aggregated_list" }, - "description": "Sample for Delete", - "file": "compute_v1_generated_public_advertised_prefixes_delete_sync.py", + "description": "Sample for AggregatedList", + "file": "compute_v1_generated_public_delegated_prefixes_aggregated_list_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_PublicAdvertisedPrefixes_Delete_sync", + "regionTag": "compute_v1_generated_PublicDelegatedPrefixes_AggregatedList_sync", "segments": [ { "end": 52, @@ -35226,50 +37518,54 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 46, + "end": 45, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 49, - "start": 47, + "end": 48, + "start": 46, "type": "REQUEST_EXECUTION" }, { "end": 53, - "start": 50, + "start": 49, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_public_advertised_prefixes_delete_sync.py" + "title": "compute_v1_generated_public_delegated_prefixes_aggregated_list_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.PublicAdvertisedPrefixesClient", - "shortName": "PublicAdvertisedPrefixesClient" + "fullName": "google.cloud.compute_v1.PublicDelegatedPrefixesClient", + "shortName": "PublicDelegatedPrefixesClient" }, - "fullName": "google.cloud.compute_v1.PublicAdvertisedPrefixesClient.get", + "fullName": "google.cloud.compute_v1.PublicDelegatedPrefixesClient.announce", "method": { - "fullName": "google.cloud.compute.v1.PublicAdvertisedPrefixes.Get", + "fullName": "google.cloud.compute.v1.PublicDelegatedPrefixes.Announce", "service": { - "fullName": "google.cloud.compute.v1.PublicAdvertisedPrefixes", - "shortName": "PublicAdvertisedPrefixes" + "fullName": "google.cloud.compute.v1.PublicDelegatedPrefixes", + "shortName": "PublicDelegatedPrefixes" }, - "shortName": "Get" + "shortName": "Announce" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetPublicAdvertisedPrefixeRequest" + "type": "google.cloud.compute_v1.types.AnnouncePublicDelegatedPrefixeRequest" }, { "name": "project", "type": "str" }, { - "name": "public_advertised_prefix", + "name": "region", + "type": "str" + }, + { + "name": "public_delegated_prefix", "type": "str" }, { @@ -35285,22 +37581,22 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.PublicAdvertisedPrefix", - "shortName": "get" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "announce" }, - "description": "Sample for Get", - "file": "compute_v1_generated_public_advertised_prefixes_get_sync.py", + "description": "Sample for Announce", + "file": "compute_v1_generated_public_delegated_prefixes_announce_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_PublicAdvertisedPrefixes_Get_sync", + "regionTag": "compute_v1_generated_PublicDelegatedPrefixes_Announce_sync", "segments": [ { - "end": 52, + "end": 53, "start": 27, "type": "FULL" }, { - "end": 52, + "end": 53, "start": 27, "type": "SHORT" }, @@ -35310,51 +37606,55 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 46, + "end": 47, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 49, - "start": 47, + "end": 50, + "start": 48, "type": "REQUEST_EXECUTION" }, { - "end": 53, - "start": 50, + "end": 54, + "start": 51, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_public_advertised_prefixes_get_sync.py" + "title": "compute_v1_generated_public_delegated_prefixes_announce_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.PublicAdvertisedPrefixesClient", - "shortName": "PublicAdvertisedPrefixesClient" + "fullName": "google.cloud.compute_v1.PublicDelegatedPrefixesClient", + "shortName": "PublicDelegatedPrefixesClient" }, - "fullName": "google.cloud.compute_v1.PublicAdvertisedPrefixesClient.insert", + "fullName": "google.cloud.compute_v1.PublicDelegatedPrefixesClient.delete", "method": { - "fullName": "google.cloud.compute.v1.PublicAdvertisedPrefixes.Insert", + "fullName": "google.cloud.compute.v1.PublicDelegatedPrefixes.Delete", "service": { - "fullName": "google.cloud.compute.v1.PublicAdvertisedPrefixes", - "shortName": "PublicAdvertisedPrefixes" + "fullName": "google.cloud.compute.v1.PublicDelegatedPrefixes", + "shortName": "PublicDelegatedPrefixes" }, - "shortName": "Insert" + "shortName": "Delete" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.InsertPublicAdvertisedPrefixeRequest" + "type": "google.cloud.compute_v1.types.DeletePublicDelegatedPrefixeRequest" }, { "name": "project", "type": "str" }, { - "name": "public_advertised_prefix_resource", - "type": "google.cloud.compute_v1.types.PublicAdvertisedPrefix" + "name": "region", + "type": "str" + }, + { + "name": "public_delegated_prefix", + "type": "str" }, { "name": "retry", @@ -35370,21 +37670,21 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "insert" + "shortName": "delete" }, - "description": "Sample for Insert", - "file": "compute_v1_generated_public_advertised_prefixes_insert_sync.py", + "description": "Sample for Delete", + "file": "compute_v1_generated_public_delegated_prefixes_delete_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_PublicAdvertisedPrefixes_Insert_sync", + "regionTag": "compute_v1_generated_PublicDelegatedPrefixes_Delete_sync", "segments": [ { - "end": 51, + "end": 53, "start": 27, "type": "FULL" }, { - "end": 51, + "end": 53, "start": 27, "type": "SHORT" }, @@ -35394,48 +37694,56 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 45, + "end": 47, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 48, - "start": 46, + "end": 50, + "start": 48, "type": "REQUEST_EXECUTION" }, { - "end": 52, - "start": 49, + "end": 54, + "start": 51, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_public_advertised_prefixes_insert_sync.py" + "title": "compute_v1_generated_public_delegated_prefixes_delete_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.PublicAdvertisedPrefixesClient", - "shortName": "PublicAdvertisedPrefixesClient" + "fullName": "google.cloud.compute_v1.PublicDelegatedPrefixesClient", + "shortName": "PublicDelegatedPrefixesClient" }, - "fullName": "google.cloud.compute_v1.PublicAdvertisedPrefixesClient.list", + "fullName": "google.cloud.compute_v1.PublicDelegatedPrefixesClient.get", "method": { - "fullName": "google.cloud.compute.v1.PublicAdvertisedPrefixes.List", + "fullName": "google.cloud.compute.v1.PublicDelegatedPrefixes.Get", "service": { - "fullName": "google.cloud.compute.v1.PublicAdvertisedPrefixes", - "shortName": "PublicAdvertisedPrefixes" + "fullName": "google.cloud.compute.v1.PublicDelegatedPrefixes", + "shortName": "PublicDelegatedPrefixes" }, - "shortName": "List" + "shortName": "Get" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.ListPublicAdvertisedPrefixesRequest" + "type": "google.cloud.compute_v1.types.GetPublicDelegatedPrefixeRequest" }, { "name": "project", "type": "str" }, + { + "name": "region", + "type": "str" + }, + { + "name": "public_delegated_prefix", + "type": "str" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -35449,22 +37757,22 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.services.public_advertised_prefixes.pagers.ListPager", - "shortName": "list" + "resultType": "google.cloud.compute_v1.types.PublicDelegatedPrefix", + "shortName": "get" }, - "description": "Sample for List", - "file": "compute_v1_generated_public_advertised_prefixes_list_sync.py", + "description": "Sample for Get", + "file": "compute_v1_generated_public_delegated_prefixes_get_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_PublicAdvertisedPrefixes_List_sync", + "regionTag": "compute_v1_generated_PublicDelegatedPrefixes_Get_sync", "segments": [ { - "end": 52, + "end": 53, "start": 27, "type": "FULL" }, { - "end": 52, + "end": 53, "start": 27, "type": "SHORT" }, @@ -35474,55 +37782,55 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 45, + "end": 47, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 48, - "start": 46, + "end": 50, + "start": 48, "type": "REQUEST_EXECUTION" }, { - "end": 53, - "start": 49, + "end": 54, + "start": 51, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_public_advertised_prefixes_list_sync.py" + "title": "compute_v1_generated_public_delegated_prefixes_get_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.PublicAdvertisedPrefixesClient", - "shortName": "PublicAdvertisedPrefixesClient" + "fullName": "google.cloud.compute_v1.PublicDelegatedPrefixesClient", + "shortName": "PublicDelegatedPrefixesClient" }, - "fullName": "google.cloud.compute_v1.PublicAdvertisedPrefixesClient.patch", + "fullName": "google.cloud.compute_v1.PublicDelegatedPrefixesClient.insert", "method": { - "fullName": "google.cloud.compute.v1.PublicAdvertisedPrefixes.Patch", + "fullName": "google.cloud.compute.v1.PublicDelegatedPrefixes.Insert", "service": { - "fullName": "google.cloud.compute.v1.PublicAdvertisedPrefixes", - "shortName": "PublicAdvertisedPrefixes" + "fullName": "google.cloud.compute.v1.PublicDelegatedPrefixes", + "shortName": "PublicDelegatedPrefixes" }, - "shortName": "Patch" + "shortName": "Insert" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.PatchPublicAdvertisedPrefixeRequest" + "type": "google.cloud.compute_v1.types.InsertPublicDelegatedPrefixeRequest" }, { "name": "project", "type": "str" }, { - "name": "public_advertised_prefix", + "name": "region", "type": "str" }, { - "name": "public_advertised_prefix_resource", - "type": "google.cloud.compute_v1.types.PublicAdvertisedPrefix" + "name": "public_delegated_prefix_resource", + "type": "google.cloud.compute_v1.types.PublicDelegatedPrefix" }, { "name": "retry", @@ -35538,13 +37846,13 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "patch" + "shortName": "insert" }, - "description": "Sample for Patch", - "file": "compute_v1_generated_public_advertised_prefixes_patch_sync.py", + "description": "Sample for Insert", + "file": "compute_v1_generated_public_delegated_prefixes_insert_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_PublicAdvertisedPrefixes_Patch_sync", + "regionTag": "compute_v1_generated_PublicDelegatedPrefixes_Insert_sync", "segments": [ { "end": 52, @@ -35577,35 +37885,35 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_public_advertised_prefixes_patch_sync.py" + "title": "compute_v1_generated_public_delegated_prefixes_insert_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.PublicAdvertisedPrefixesClient", - "shortName": "PublicAdvertisedPrefixesClient" + "fullName": "google.cloud.compute_v1.PublicDelegatedPrefixesClient", + "shortName": "PublicDelegatedPrefixesClient" }, - "fullName": "google.cloud.compute_v1.PublicAdvertisedPrefixesClient.withdraw", + "fullName": "google.cloud.compute_v1.PublicDelegatedPrefixesClient.list", "method": { - "fullName": "google.cloud.compute.v1.PublicAdvertisedPrefixes.Withdraw", + "fullName": "google.cloud.compute.v1.PublicDelegatedPrefixes.List", "service": { - "fullName": "google.cloud.compute.v1.PublicAdvertisedPrefixes", - "shortName": "PublicAdvertisedPrefixes" + "fullName": "google.cloud.compute.v1.PublicDelegatedPrefixes", + "shortName": "PublicDelegatedPrefixes" }, - "shortName": "Withdraw" + "shortName": "List" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.WithdrawPublicAdvertisedPrefixeRequest" + "type": "google.cloud.compute_v1.types.ListPublicDelegatedPrefixesRequest" }, { "name": "project", "type": "str" }, { - "name": "public_advertised_prefix", + "name": "region", "type": "str" }, { @@ -35621,22 +37929,22 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "withdraw" + "resultType": "google.cloud.compute_v1.services.public_delegated_prefixes.pagers.ListPager", + "shortName": "list" }, - "description": "Sample for Withdraw", - "file": "compute_v1_generated_public_advertised_prefixes_withdraw_sync.py", + "description": "Sample for List", + "file": "compute_v1_generated_public_delegated_prefixes_list_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_PublicAdvertisedPrefixes_Withdraw_sync", + "regionTag": "compute_v1_generated_PublicDelegatedPrefixes_List_sync", "segments": [ { - "end": 52, + "end": 53, "start": 27, "type": "FULL" }, { - "end": 52, + "end": 53, "start": 27, "type": "SHORT" }, @@ -35656,12 +37964,12 @@ "type": "REQUEST_EXECUTION" }, { - "end": 53, + "end": 54, "start": 50, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_public_advertised_prefixes_withdraw_sync.py" + "title": "compute_v1_generated_public_delegated_prefixes_list_sync.py" }, { "canonical": true, @@ -35670,24 +37978,36 @@ "fullName": "google.cloud.compute_v1.PublicDelegatedPrefixesClient", "shortName": "PublicDelegatedPrefixesClient" }, - "fullName": "google.cloud.compute_v1.PublicDelegatedPrefixesClient.aggregated_list", + "fullName": "google.cloud.compute_v1.PublicDelegatedPrefixesClient.patch", "method": { - "fullName": "google.cloud.compute.v1.PublicDelegatedPrefixes.AggregatedList", + "fullName": "google.cloud.compute.v1.PublicDelegatedPrefixes.Patch", "service": { "fullName": "google.cloud.compute.v1.PublicDelegatedPrefixes", "shortName": "PublicDelegatedPrefixes" }, - "shortName": "AggregatedList" + "shortName": "Patch" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.AggregatedListPublicDelegatedPrefixesRequest" + "type": "google.cloud.compute_v1.types.PatchPublicDelegatedPrefixeRequest" }, { "name": "project", "type": "str" }, + { + "name": "region", + "type": "str" + }, + { + "name": "public_delegated_prefix", + "type": "str" + }, + { + "name": "public_delegated_prefix_resource", + "type": "google.cloud.compute_v1.types.PublicDelegatedPrefix" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -35701,22 +38021,22 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.services.public_delegated_prefixes.pagers.AggregatedListPager", - "shortName": "aggregated_list" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "patch" }, - "description": "Sample for AggregatedList", - "file": "compute_v1_generated_public_delegated_prefixes_aggregated_list_sync.py", + "description": "Sample for Patch", + "file": "compute_v1_generated_public_delegated_prefixes_patch_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_PublicDelegatedPrefixes_AggregatedList_sync", + "regionTag": "compute_v1_generated_PublicDelegatedPrefixes_Patch_sync", "segments": [ { - "end": 52, + "end": 53, "start": 27, "type": "FULL" }, { - "end": 52, + "end": 53, "start": 27, "type": "SHORT" }, @@ -35726,22 +38046,22 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 45, + "end": 47, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 48, - "start": 46, + "end": 50, + "start": 48, "type": "REQUEST_EXECUTION" }, { - "end": 53, - "start": 49, + "end": 54, + "start": 51, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_public_delegated_prefixes_aggregated_list_sync.py" + "title": "compute_v1_generated_public_delegated_prefixes_patch_sync.py" }, { "canonical": true, @@ -35750,19 +38070,19 @@ "fullName": "google.cloud.compute_v1.PublicDelegatedPrefixesClient", "shortName": "PublicDelegatedPrefixesClient" }, - "fullName": "google.cloud.compute_v1.PublicDelegatedPrefixesClient.announce", + "fullName": "google.cloud.compute_v1.PublicDelegatedPrefixesClient.withdraw", "method": { - "fullName": "google.cloud.compute.v1.PublicDelegatedPrefixes.Announce", + "fullName": "google.cloud.compute.v1.PublicDelegatedPrefixes.Withdraw", "service": { "fullName": "google.cloud.compute.v1.PublicDelegatedPrefixes", "shortName": "PublicDelegatedPrefixes" }, - "shortName": "Announce" + "shortName": "Withdraw" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.AnnouncePublicDelegatedPrefixeRequest" + "type": "google.cloud.compute_v1.types.WithdrawPublicDelegatedPrefixeRequest" }, { "name": "project", @@ -35790,13 +38110,13 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "announce" + "shortName": "withdraw" }, - "description": "Sample for Announce", - "file": "compute_v1_generated_public_delegated_prefixes_announce_sync.py", + "description": "Sample for Withdraw", + "file": "compute_v1_generated_public_delegated_prefixes_withdraw_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_PublicDelegatedPrefixes_Announce_sync", + "regionTag": "compute_v1_generated_PublicDelegatedPrefixes_Withdraw_sync", "segments": [ { "end": 53, @@ -35829,28 +38149,28 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_public_delegated_prefixes_announce_sync.py" + "title": "compute_v1_generated_public_delegated_prefixes_withdraw_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.PublicDelegatedPrefixesClient", - "shortName": "PublicDelegatedPrefixesClient" + "fullName": "google.cloud.compute_v1.RegionAutoscalersClient", + "shortName": "RegionAutoscalersClient" }, - "fullName": "google.cloud.compute_v1.PublicDelegatedPrefixesClient.delete", + "fullName": "google.cloud.compute_v1.RegionAutoscalersClient.delete", "method": { - "fullName": "google.cloud.compute.v1.PublicDelegatedPrefixes.Delete", + "fullName": "google.cloud.compute.v1.RegionAutoscalers.Delete", "service": { - "fullName": "google.cloud.compute.v1.PublicDelegatedPrefixes", - "shortName": "PublicDelegatedPrefixes" + "fullName": "google.cloud.compute.v1.RegionAutoscalers", + "shortName": "RegionAutoscalers" }, "shortName": "Delete" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.DeletePublicDelegatedPrefixeRequest" + "type": "google.cloud.compute_v1.types.DeleteRegionAutoscalerRequest" }, { "name": "project", @@ -35861,7 +38181,7 @@ "type": "str" }, { - "name": "public_delegated_prefix", + "name": "autoscaler", "type": "str" }, { @@ -35881,10 +38201,10 @@ "shortName": "delete" }, "description": "Sample for Delete", - "file": "compute_v1_generated_public_delegated_prefixes_delete_sync.py", + "file": "compute_v1_generated_region_autoscalers_delete_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_PublicDelegatedPrefixes_Delete_sync", + "regionTag": "compute_v1_generated_RegionAutoscalers_Delete_sync", "segments": [ { "end": 53, @@ -35917,28 +38237,28 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_public_delegated_prefixes_delete_sync.py" + "title": "compute_v1_generated_region_autoscalers_delete_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.PublicDelegatedPrefixesClient", - "shortName": "PublicDelegatedPrefixesClient" + "fullName": "google.cloud.compute_v1.RegionAutoscalersClient", + "shortName": "RegionAutoscalersClient" }, - "fullName": "google.cloud.compute_v1.PublicDelegatedPrefixesClient.get", + "fullName": "google.cloud.compute_v1.RegionAutoscalersClient.get", "method": { - "fullName": "google.cloud.compute.v1.PublicDelegatedPrefixes.Get", + "fullName": "google.cloud.compute.v1.RegionAutoscalers.Get", "service": { - "fullName": "google.cloud.compute.v1.PublicDelegatedPrefixes", - "shortName": "PublicDelegatedPrefixes" + "fullName": "google.cloud.compute.v1.RegionAutoscalers", + "shortName": "RegionAutoscalers" }, "shortName": "Get" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetPublicDelegatedPrefixeRequest" + "type": "google.cloud.compute_v1.types.GetRegionAutoscalerRequest" }, { "name": "project", @@ -35949,7 +38269,7 @@ "type": "str" }, { - "name": "public_delegated_prefix", + "name": "autoscaler", "type": "str" }, { @@ -35965,14 +38285,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.PublicDelegatedPrefix", + "resultType": "google.cloud.compute_v1.types.Autoscaler", "shortName": "get" }, "description": "Sample for Get", - "file": "compute_v1_generated_public_delegated_prefixes_get_sync.py", + "file": "compute_v1_generated_region_autoscalers_get_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_PublicDelegatedPrefixes_Get_sync", + "regionTag": "compute_v1_generated_RegionAutoscalers_Get_sync", "segments": [ { "end": 53, @@ -36005,28 +38325,28 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_public_delegated_prefixes_get_sync.py" + "title": "compute_v1_generated_region_autoscalers_get_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.PublicDelegatedPrefixesClient", - "shortName": "PublicDelegatedPrefixesClient" + "fullName": "google.cloud.compute_v1.RegionAutoscalersClient", + "shortName": "RegionAutoscalersClient" }, - "fullName": "google.cloud.compute_v1.PublicDelegatedPrefixesClient.insert", + "fullName": "google.cloud.compute_v1.RegionAutoscalersClient.insert", "method": { - "fullName": "google.cloud.compute.v1.PublicDelegatedPrefixes.Insert", + "fullName": "google.cloud.compute.v1.RegionAutoscalers.Insert", "service": { - "fullName": "google.cloud.compute.v1.PublicDelegatedPrefixes", - "shortName": "PublicDelegatedPrefixes" + "fullName": "google.cloud.compute.v1.RegionAutoscalers", + "shortName": "RegionAutoscalers" }, "shortName": "Insert" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.InsertPublicDelegatedPrefixeRequest" + "type": "google.cloud.compute_v1.types.InsertRegionAutoscalerRequest" }, { "name": "project", @@ -36037,8 +38357,8 @@ "type": "str" }, { - "name": "public_delegated_prefix_resource", - "type": "google.cloud.compute_v1.types.PublicDelegatedPrefix" + "name": "autoscaler_resource", + "type": "google.cloud.compute_v1.types.Autoscaler" }, { "name": "retry", @@ -36057,10 +38377,10 @@ "shortName": "insert" }, "description": "Sample for Insert", - "file": "compute_v1_generated_public_delegated_prefixes_insert_sync.py", + "file": "compute_v1_generated_region_autoscalers_insert_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_PublicDelegatedPrefixes_Insert_sync", + "regionTag": "compute_v1_generated_RegionAutoscalers_Insert_sync", "segments": [ { "end": 52, @@ -36093,28 +38413,28 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_public_delegated_prefixes_insert_sync.py" + "title": "compute_v1_generated_region_autoscalers_insert_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.PublicDelegatedPrefixesClient", - "shortName": "PublicDelegatedPrefixesClient" + "fullName": "google.cloud.compute_v1.RegionAutoscalersClient", + "shortName": "RegionAutoscalersClient" }, - "fullName": "google.cloud.compute_v1.PublicDelegatedPrefixesClient.list", + "fullName": "google.cloud.compute_v1.RegionAutoscalersClient.list", "method": { - "fullName": "google.cloud.compute.v1.PublicDelegatedPrefixes.List", + "fullName": "google.cloud.compute.v1.RegionAutoscalers.List", "service": { - "fullName": "google.cloud.compute.v1.PublicDelegatedPrefixes", - "shortName": "PublicDelegatedPrefixes" + "fullName": "google.cloud.compute.v1.RegionAutoscalers", + "shortName": "RegionAutoscalers" }, "shortName": "List" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.ListPublicDelegatedPrefixesRequest" + "type": "google.cloud.compute_v1.types.ListRegionAutoscalersRequest" }, { "name": "project", @@ -36137,14 +38457,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.services.public_delegated_prefixes.pagers.ListPager", + "resultType": "google.cloud.compute_v1.services.region_autoscalers.pagers.ListPager", "shortName": "list" }, "description": "Sample for List", - "file": "compute_v1_generated_public_delegated_prefixes_list_sync.py", + "file": "compute_v1_generated_region_autoscalers_list_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_PublicDelegatedPrefixes_List_sync", + "regionTag": "compute_v1_generated_RegionAutoscalers_List_sync", "segments": [ { "end": 53, @@ -36177,28 +38497,28 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_public_delegated_prefixes_list_sync.py" + "title": "compute_v1_generated_region_autoscalers_list_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.PublicDelegatedPrefixesClient", - "shortName": "PublicDelegatedPrefixesClient" + "fullName": "google.cloud.compute_v1.RegionAutoscalersClient", + "shortName": "RegionAutoscalersClient" }, - "fullName": "google.cloud.compute_v1.PublicDelegatedPrefixesClient.patch", + "fullName": "google.cloud.compute_v1.RegionAutoscalersClient.patch", "method": { - "fullName": "google.cloud.compute.v1.PublicDelegatedPrefixes.Patch", + "fullName": "google.cloud.compute.v1.RegionAutoscalers.Patch", "service": { - "fullName": "google.cloud.compute.v1.PublicDelegatedPrefixes", - "shortName": "PublicDelegatedPrefixes" + "fullName": "google.cloud.compute.v1.RegionAutoscalers", + "shortName": "RegionAutoscalers" }, "shortName": "Patch" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.PatchPublicDelegatedPrefixeRequest" + "type": "google.cloud.compute_v1.types.PatchRegionAutoscalerRequest" }, { "name": "project", @@ -36209,12 +38529,8 @@ "type": "str" }, { - "name": "public_delegated_prefix", - "type": "str" - }, - { - "name": "public_delegated_prefix_resource", - "type": "google.cloud.compute_v1.types.PublicDelegatedPrefix" + "name": "autoscaler_resource", + "type": "google.cloud.compute_v1.types.Autoscaler" }, { "name": "retry", @@ -36233,18 +38549,18 @@ "shortName": "patch" }, "description": "Sample for Patch", - "file": "compute_v1_generated_public_delegated_prefixes_patch_sync.py", + "file": "compute_v1_generated_region_autoscalers_patch_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_PublicDelegatedPrefixes_Patch_sync", + "regionTag": "compute_v1_generated_RegionAutoscalers_Patch_sync", "segments": [ { - "end": 53, + "end": 52, "start": 27, "type": "FULL" }, { - "end": 53, + "end": 52, "start": 27, "type": "SHORT" }, @@ -36254,43 +38570,43 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 47, + "end": 46, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 50, - "start": 48, + "end": 49, + "start": 47, "type": "REQUEST_EXECUTION" }, { - "end": 54, - "start": 51, + "end": 53, + "start": 50, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_public_delegated_prefixes_patch_sync.py" + "title": "compute_v1_generated_region_autoscalers_patch_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.PublicDelegatedPrefixesClient", - "shortName": "PublicDelegatedPrefixesClient" + "fullName": "google.cloud.compute_v1.RegionAutoscalersClient", + "shortName": "RegionAutoscalersClient" }, - "fullName": "google.cloud.compute_v1.PublicDelegatedPrefixesClient.withdraw", + "fullName": "google.cloud.compute_v1.RegionAutoscalersClient.update", "method": { - "fullName": "google.cloud.compute.v1.PublicDelegatedPrefixes.Withdraw", + "fullName": "google.cloud.compute.v1.RegionAutoscalers.Update", "service": { - "fullName": "google.cloud.compute.v1.PublicDelegatedPrefixes", - "shortName": "PublicDelegatedPrefixes" + "fullName": "google.cloud.compute.v1.RegionAutoscalers", + "shortName": "RegionAutoscalers" }, - "shortName": "Withdraw" + "shortName": "Update" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.WithdrawPublicDelegatedPrefixeRequest" + "type": "google.cloud.compute_v1.types.UpdateRegionAutoscalerRequest" }, { "name": "project", @@ -36301,8 +38617,8 @@ "type": "str" }, { - "name": "public_delegated_prefix", - "type": "str" + "name": "autoscaler_resource", + "type": "google.cloud.compute_v1.types.Autoscaler" }, { "name": "retry", @@ -36318,21 +38634,21 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "withdraw" + "shortName": "update" }, - "description": "Sample for Withdraw", - "file": "compute_v1_generated_public_delegated_prefixes_withdraw_sync.py", + "description": "Sample for Update", + "file": "compute_v1_generated_region_autoscalers_update_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_PublicDelegatedPrefixes_Withdraw_sync", + "regionTag": "compute_v1_generated_RegionAutoscalers_Update_sync", "segments": [ { - "end": 53, + "end": 52, "start": 27, "type": "FULL" }, { - "end": 53, + "end": 52, "start": 27, "type": "SHORT" }, @@ -36342,43 +38658,43 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 47, + "end": 46, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 50, - "start": 48, + "end": 49, + "start": 47, "type": "REQUEST_EXECUTION" }, { - "end": 54, - "start": 51, + "end": 53, + "start": 50, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_public_delegated_prefixes_withdraw_sync.py" + "title": "compute_v1_generated_region_autoscalers_update_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionAutoscalersClient", - "shortName": "RegionAutoscalersClient" + "fullName": "google.cloud.compute_v1.RegionBackendServicesClient", + "shortName": "RegionBackendServicesClient" }, - "fullName": "google.cloud.compute_v1.RegionAutoscalersClient.delete", + "fullName": "google.cloud.compute_v1.RegionBackendServicesClient.delete", "method": { - "fullName": "google.cloud.compute.v1.RegionAutoscalers.Delete", + "fullName": "google.cloud.compute.v1.RegionBackendServices.Delete", "service": { - "fullName": "google.cloud.compute.v1.RegionAutoscalers", - "shortName": "RegionAutoscalers" + "fullName": "google.cloud.compute.v1.RegionBackendServices", + "shortName": "RegionBackendServices" }, "shortName": "Delete" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.DeleteRegionAutoscalerRequest" + "type": "google.cloud.compute_v1.types.DeleteRegionBackendServiceRequest" }, { "name": "project", @@ -36389,7 +38705,7 @@ "type": "str" }, { - "name": "autoscaler", + "name": "backend_service", "type": "str" }, { @@ -36409,10 +38725,10 @@ "shortName": "delete" }, "description": "Sample for Delete", - "file": "compute_v1_generated_region_autoscalers_delete_sync.py", + "file": "compute_v1_generated_region_backend_services_delete_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionAutoscalers_Delete_sync", + "regionTag": "compute_v1_generated_RegionBackendServices_Delete_sync", "segments": [ { "end": 53, @@ -36445,28 +38761,28 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_autoscalers_delete_sync.py" + "title": "compute_v1_generated_region_backend_services_delete_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionAutoscalersClient", - "shortName": "RegionAutoscalersClient" + "fullName": "google.cloud.compute_v1.RegionBackendServicesClient", + "shortName": "RegionBackendServicesClient" }, - "fullName": "google.cloud.compute_v1.RegionAutoscalersClient.get", + "fullName": "google.cloud.compute_v1.RegionBackendServicesClient.get_health", "method": { - "fullName": "google.cloud.compute.v1.RegionAutoscalers.Get", + "fullName": "google.cloud.compute.v1.RegionBackendServices.GetHealth", "service": { - "fullName": "google.cloud.compute.v1.RegionAutoscalers", - "shortName": "RegionAutoscalers" + "fullName": "google.cloud.compute.v1.RegionBackendServices", + "shortName": "RegionBackendServices" }, - "shortName": "Get" + "shortName": "GetHealth" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetRegionAutoscalerRequest" + "type": "google.cloud.compute_v1.types.GetHealthRegionBackendServiceRequest" }, { "name": "project", @@ -36477,9 +38793,13 @@ "type": "str" }, { - "name": "autoscaler", + "name": "backend_service", "type": "str" }, + { + "name": "resource_group_reference_resource", + "type": "google.cloud.compute_v1.types.ResourceGroupReference" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -36493,14 +38813,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.Autoscaler", - "shortName": "get" + "resultType": "google.cloud.compute_v1.types.BackendServiceGroupHealth", + "shortName": "get_health" }, - "description": "Sample for Get", - "file": "compute_v1_generated_region_autoscalers_get_sync.py", + "description": "Sample for GetHealth", + "file": "compute_v1_generated_region_backend_services_get_health_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionAutoscalers_Get_sync", + "regionTag": "compute_v1_generated_RegionBackendServices_GetHealth_sync", "segments": [ { "end": 53, @@ -36533,28 +38853,28 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_autoscalers_get_sync.py" + "title": "compute_v1_generated_region_backend_services_get_health_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionAutoscalersClient", - "shortName": "RegionAutoscalersClient" + "fullName": "google.cloud.compute_v1.RegionBackendServicesClient", + "shortName": "RegionBackendServicesClient" }, - "fullName": "google.cloud.compute_v1.RegionAutoscalersClient.insert", + "fullName": "google.cloud.compute_v1.RegionBackendServicesClient.get_iam_policy", "method": { - "fullName": "google.cloud.compute.v1.RegionAutoscalers.Insert", + "fullName": "google.cloud.compute.v1.RegionBackendServices.GetIamPolicy", "service": { - "fullName": "google.cloud.compute.v1.RegionAutoscalers", - "shortName": "RegionAutoscalers" + "fullName": "google.cloud.compute.v1.RegionBackendServices", + "shortName": "RegionBackendServices" }, - "shortName": "Insert" + "shortName": "GetIamPolicy" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.InsertRegionAutoscalerRequest" + "type": "google.cloud.compute_v1.types.GetIamPolicyRegionBackendServiceRequest" }, { "name": "project", @@ -36565,91 +38885,7 @@ "type": "str" }, { - "name": "autoscaler_resource", - "type": "google.cloud.compute_v1.types.Autoscaler" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, Union[str, bytes]]]" - } - ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "insert" - }, - "description": "Sample for Insert", - "file": "compute_v1_generated_region_autoscalers_insert_sync.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionAutoscalers_Insert_sync", - "segments": [ - { - "end": 52, - "start": 27, - "type": "FULL" - }, - { - "end": 52, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 46, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 49, - "start": 47, - "type": "REQUEST_EXECUTION" - }, - { - "end": 53, - "start": 50, - "type": "RESPONSE_HANDLING" - } - ], - "title": "compute_v1_generated_region_autoscalers_insert_sync.py" - }, - { - "canonical": true, - "clientMethod": { - "client": { - "fullName": "google.cloud.compute_v1.RegionAutoscalersClient", - "shortName": "RegionAutoscalersClient" - }, - "fullName": "google.cloud.compute_v1.RegionAutoscalersClient.list", - "method": { - "fullName": "google.cloud.compute.v1.RegionAutoscalers.List", - "service": { - "fullName": "google.cloud.compute.v1.RegionAutoscalers", - "shortName": "RegionAutoscalers" - }, - "shortName": "List" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.compute_v1.types.ListRegionAutoscalersRequest" - }, - { - "name": "project", - "type": "str" - }, - { - "name": "region", + "name": "resource", "type": "str" }, { @@ -36665,14 +38901,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.services.region_autoscalers.pagers.ListPager", - "shortName": "list" + "resultType": "google.cloud.compute_v1.types.Policy", + "shortName": "get_iam_policy" }, - "description": "Sample for List", - "file": "compute_v1_generated_region_autoscalers_list_sync.py", + "description": "Sample for GetIamPolicy", + "file": "compute_v1_generated_region_backend_services_get_iam_policy_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionAutoscalers_List_sync", + "regionTag": "compute_v1_generated_RegionBackendServices_GetIamPolicy_sync", "segments": [ { "end": 53, @@ -36690,43 +38926,43 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 46, + "end": 47, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 49, - "start": 47, + "end": 50, + "start": 48, "type": "REQUEST_EXECUTION" }, { "end": 54, - "start": 50, + "start": 51, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_autoscalers_list_sync.py" + "title": "compute_v1_generated_region_backend_services_get_iam_policy_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionAutoscalersClient", - "shortName": "RegionAutoscalersClient" + "fullName": "google.cloud.compute_v1.RegionBackendServicesClient", + "shortName": "RegionBackendServicesClient" }, - "fullName": "google.cloud.compute_v1.RegionAutoscalersClient.patch", + "fullName": "google.cloud.compute_v1.RegionBackendServicesClient.get", "method": { - "fullName": "google.cloud.compute.v1.RegionAutoscalers.Patch", + "fullName": "google.cloud.compute.v1.RegionBackendServices.Get", "service": { - "fullName": "google.cloud.compute.v1.RegionAutoscalers", - "shortName": "RegionAutoscalers" + "fullName": "google.cloud.compute.v1.RegionBackendServices", + "shortName": "RegionBackendServices" }, - "shortName": "Patch" + "shortName": "Get" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.PatchRegionAutoscalerRequest" + "type": "google.cloud.compute_v1.types.GetRegionBackendServiceRequest" }, { "name": "project", @@ -36737,8 +38973,8 @@ "type": "str" }, { - "name": "autoscaler_resource", - "type": "google.cloud.compute_v1.types.Autoscaler" + "name": "backend_service", + "type": "str" }, { "name": "retry", @@ -36753,22 +38989,22 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "patch" + "resultType": "google.cloud.compute_v1.types.BackendService", + "shortName": "get" }, - "description": "Sample for Patch", - "file": "compute_v1_generated_region_autoscalers_patch_sync.py", + "description": "Sample for Get", + "file": "compute_v1_generated_region_backend_services_get_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionAutoscalers_Patch_sync", + "regionTag": "compute_v1_generated_RegionBackendServices_Get_sync", "segments": [ { - "end": 52, + "end": 53, "start": 27, "type": "FULL" }, { - "end": 52, + "end": 53, "start": 27, "type": "SHORT" }, @@ -36778,43 +39014,43 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 46, + "end": 47, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 49, - "start": 47, + "end": 50, + "start": 48, "type": "REQUEST_EXECUTION" }, { - "end": 53, - "start": 50, + "end": 54, + "start": 51, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_autoscalers_patch_sync.py" + "title": "compute_v1_generated_region_backend_services_get_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionAutoscalersClient", - "shortName": "RegionAutoscalersClient" + "fullName": "google.cloud.compute_v1.RegionBackendServicesClient", + "shortName": "RegionBackendServicesClient" }, - "fullName": "google.cloud.compute_v1.RegionAutoscalersClient.update", + "fullName": "google.cloud.compute_v1.RegionBackendServicesClient.insert", "method": { - "fullName": "google.cloud.compute.v1.RegionAutoscalers.Update", + "fullName": "google.cloud.compute.v1.RegionBackendServices.Insert", "service": { - "fullName": "google.cloud.compute.v1.RegionAutoscalers", - "shortName": "RegionAutoscalers" + "fullName": "google.cloud.compute.v1.RegionBackendServices", + "shortName": "RegionBackendServices" }, - "shortName": "Update" + "shortName": "Insert" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.UpdateRegionAutoscalerRequest" + "type": "google.cloud.compute_v1.types.InsertRegionBackendServiceRequest" }, { "name": "project", @@ -36825,8 +39061,8 @@ "type": "str" }, { - "name": "autoscaler_resource", - "type": "google.cloud.compute_v1.types.Autoscaler" + "name": "backend_service_resource", + "type": "google.cloud.compute_v1.types.BackendService" }, { "name": "retry", @@ -36842,13 +39078,13 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "update" + "shortName": "insert" }, - "description": "Sample for Update", - "file": "compute_v1_generated_region_autoscalers_update_sync.py", + "description": "Sample for Insert", + "file": "compute_v1_generated_region_backend_services_insert_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionAutoscalers_Update_sync", + "regionTag": "compute_v1_generated_RegionBackendServices_Insert_sync", "segments": [ { "end": 52, @@ -36881,7 +39117,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_autoscalers_update_sync.py" + "title": "compute_v1_generated_region_backend_services_insert_sync.py" }, { "canonical": true, @@ -36890,19 +39126,19 @@ "fullName": "google.cloud.compute_v1.RegionBackendServicesClient", "shortName": "RegionBackendServicesClient" }, - "fullName": "google.cloud.compute_v1.RegionBackendServicesClient.delete", + "fullName": "google.cloud.compute_v1.RegionBackendServicesClient.list_usable", "method": { - "fullName": "google.cloud.compute.v1.RegionBackendServices.Delete", + "fullName": "google.cloud.compute.v1.RegionBackendServices.ListUsable", "service": { "fullName": "google.cloud.compute.v1.RegionBackendServices", "shortName": "RegionBackendServices" }, - "shortName": "Delete" + "shortName": "ListUsable" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.DeleteRegionBackendServiceRequest" + "type": "google.cloud.compute_v1.types.ListUsableRegionBackendServicesRequest" }, { "name": "project", @@ -36912,10 +39148,6 @@ "name": "region", "type": "str" }, - { - "name": "backend_service", - "type": "str" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -36929,14 +39161,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "delete" + "resultType": "google.cloud.compute_v1.services.region_backend_services.pagers.ListUsablePager", + "shortName": "list_usable" }, - "description": "Sample for Delete", - "file": "compute_v1_generated_region_backend_services_delete_sync.py", + "description": "Sample for ListUsable", + "file": "compute_v1_generated_region_backend_services_list_usable_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionBackendServices_Delete_sync", + "regionTag": "compute_v1_generated_RegionBackendServices_ListUsable_sync", "segments": [ { "end": 53, @@ -36954,22 +39186,22 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 47, + "end": 46, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 50, - "start": 48, + "end": 49, + "start": 47, "type": "REQUEST_EXECUTION" }, { "end": 54, - "start": 51, + "start": 50, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_backend_services_delete_sync.py" + "title": "compute_v1_generated_region_backend_services_list_usable_sync.py" }, { "canonical": true, @@ -36978,19 +39210,19 @@ "fullName": "google.cloud.compute_v1.RegionBackendServicesClient", "shortName": "RegionBackendServicesClient" }, - "fullName": "google.cloud.compute_v1.RegionBackendServicesClient.get_health", + "fullName": "google.cloud.compute_v1.RegionBackendServicesClient.list", "method": { - "fullName": "google.cloud.compute.v1.RegionBackendServices.GetHealth", + "fullName": "google.cloud.compute.v1.RegionBackendServices.List", "service": { "fullName": "google.cloud.compute.v1.RegionBackendServices", "shortName": "RegionBackendServices" }, - "shortName": "GetHealth" + "shortName": "List" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetHealthRegionBackendServiceRequest" + "type": "google.cloud.compute_v1.types.ListRegionBackendServicesRequest" }, { "name": "project", @@ -37000,14 +39232,6 @@ "name": "region", "type": "str" }, - { - "name": "backend_service", - "type": "str" - }, - { - "name": "resource_group_reference_resource", - "type": "google.cloud.compute_v1.types.ResourceGroupReference" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -37021,14 +39245,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.BackendServiceGroupHealth", - "shortName": "get_health" + "resultType": "google.cloud.compute_v1.services.region_backend_services.pagers.ListPager", + "shortName": "list" }, - "description": "Sample for GetHealth", - "file": "compute_v1_generated_region_backend_services_get_health_sync.py", + "description": "Sample for List", + "file": "compute_v1_generated_region_backend_services_list_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionBackendServices_GetHealth_sync", + "regionTag": "compute_v1_generated_RegionBackendServices_List_sync", "segments": [ { "end": 53, @@ -37046,22 +39270,22 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 47, + "end": 46, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 50, - "start": 48, + "end": 49, + "start": 47, "type": "REQUEST_EXECUTION" }, { "end": 54, - "start": 51, + "start": 50, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_backend_services_get_health_sync.py" + "title": "compute_v1_generated_region_backend_services_list_sync.py" }, { "canonical": true, @@ -37070,19 +39294,19 @@ "fullName": "google.cloud.compute_v1.RegionBackendServicesClient", "shortName": "RegionBackendServicesClient" }, - "fullName": "google.cloud.compute_v1.RegionBackendServicesClient.get_iam_policy", + "fullName": "google.cloud.compute_v1.RegionBackendServicesClient.patch", "method": { - "fullName": "google.cloud.compute.v1.RegionBackendServices.GetIamPolicy", + "fullName": "google.cloud.compute.v1.RegionBackendServices.Patch", "service": { "fullName": "google.cloud.compute.v1.RegionBackendServices", "shortName": "RegionBackendServices" }, - "shortName": "GetIamPolicy" + "shortName": "Patch" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetIamPolicyRegionBackendServiceRequest" + "type": "google.cloud.compute_v1.types.PatchRegionBackendServiceRequest" }, { "name": "project", @@ -37093,9 +39317,13 @@ "type": "str" }, { - "name": "resource", + "name": "backend_service", "type": "str" }, + { + "name": "backend_service_resource", + "type": "google.cloud.compute_v1.types.BackendService" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -37109,14 +39337,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.Policy", - "shortName": "get_iam_policy" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "patch" }, - "description": "Sample for GetIamPolicy", - "file": "compute_v1_generated_region_backend_services_get_iam_policy_sync.py", + "description": "Sample for Patch", + "file": "compute_v1_generated_region_backend_services_patch_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionBackendServices_GetIamPolicy_sync", + "regionTag": "compute_v1_generated_RegionBackendServices_Patch_sync", "segments": [ { "end": 53, @@ -37149,7 +39377,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_backend_services_get_iam_policy_sync.py" + "title": "compute_v1_generated_region_backend_services_patch_sync.py" }, { "canonical": true, @@ -37158,19 +39386,19 @@ "fullName": "google.cloud.compute_v1.RegionBackendServicesClient", "shortName": "RegionBackendServicesClient" }, - "fullName": "google.cloud.compute_v1.RegionBackendServicesClient.get", + "fullName": "google.cloud.compute_v1.RegionBackendServicesClient.set_iam_policy", "method": { - "fullName": "google.cloud.compute.v1.RegionBackendServices.Get", + "fullName": "google.cloud.compute.v1.RegionBackendServices.SetIamPolicy", "service": { "fullName": "google.cloud.compute.v1.RegionBackendServices", "shortName": "RegionBackendServices" }, - "shortName": "Get" + "shortName": "SetIamPolicy" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetRegionBackendServiceRequest" + "type": "google.cloud.compute_v1.types.SetIamPolicyRegionBackendServiceRequest" }, { "name": "project", @@ -37181,9 +39409,13 @@ "type": "str" }, { - "name": "backend_service", + "name": "resource", "type": "str" }, + { + "name": "region_set_policy_request_resource", + "type": "google.cloud.compute_v1.types.RegionSetPolicyRequest" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -37197,14 +39429,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.BackendService", - "shortName": "get" + "resultType": "google.cloud.compute_v1.types.Policy", + "shortName": "set_iam_policy" }, - "description": "Sample for Get", - "file": "compute_v1_generated_region_backend_services_get_sync.py", + "description": "Sample for SetIamPolicy", + "file": "compute_v1_generated_region_backend_services_set_iam_policy_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionBackendServices_Get_sync", + "regionTag": "compute_v1_generated_RegionBackendServices_SetIamPolicy_sync", "segments": [ { "end": 53, @@ -37237,7 +39469,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_backend_services_get_sync.py" + "title": "compute_v1_generated_region_backend_services_set_iam_policy_sync.py" }, { "canonical": true, @@ -37246,19 +39478,19 @@ "fullName": "google.cloud.compute_v1.RegionBackendServicesClient", "shortName": "RegionBackendServicesClient" }, - "fullName": "google.cloud.compute_v1.RegionBackendServicesClient.insert", + "fullName": "google.cloud.compute_v1.RegionBackendServicesClient.set_security_policy", "method": { - "fullName": "google.cloud.compute.v1.RegionBackendServices.Insert", + "fullName": "google.cloud.compute.v1.RegionBackendServices.SetSecurityPolicy", "service": { "fullName": "google.cloud.compute.v1.RegionBackendServices", "shortName": "RegionBackendServices" }, - "shortName": "Insert" + "shortName": "SetSecurityPolicy" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.InsertRegionBackendServiceRequest" + "type": "google.cloud.compute_v1.types.SetSecurityPolicyRegionBackendServiceRequest" }, { "name": "project", @@ -37269,8 +39501,12 @@ "type": "str" }, { - "name": "backend_service_resource", - "type": "google.cloud.compute_v1.types.BackendService" + "name": "backend_service", + "type": "str" + }, + { + "name": "security_policy_reference_resource", + "type": "google.cloud.compute_v1.types.SecurityPolicyReference" }, { "name": "retry", @@ -37286,21 +39522,21 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "insert" + "shortName": "set_security_policy" }, - "description": "Sample for Insert", - "file": "compute_v1_generated_region_backend_services_insert_sync.py", + "description": "Sample for SetSecurityPolicy", + "file": "compute_v1_generated_region_backend_services_set_security_policy_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionBackendServices_Insert_sync", + "regionTag": "compute_v1_generated_RegionBackendServices_SetSecurityPolicy_sync", "segments": [ { - "end": 52, + "end": 53, "start": 27, "type": "FULL" }, { - "end": 52, + "end": 53, "start": 27, "type": "SHORT" }, @@ -37310,22 +39546,22 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 46, + "end": 47, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 49, - "start": 47, + "end": 50, + "start": 48, "type": "REQUEST_EXECUTION" }, { - "end": 53, - "start": 50, + "end": 54, + "start": 51, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_backend_services_insert_sync.py" + "title": "compute_v1_generated_region_backend_services_set_security_policy_sync.py" }, { "canonical": true, @@ -37334,19 +39570,19 @@ "fullName": "google.cloud.compute_v1.RegionBackendServicesClient", "shortName": "RegionBackendServicesClient" }, - "fullName": "google.cloud.compute_v1.RegionBackendServicesClient.list_usable", + "fullName": "google.cloud.compute_v1.RegionBackendServicesClient.test_iam_permissions", "method": { - "fullName": "google.cloud.compute.v1.RegionBackendServices.ListUsable", + "fullName": "google.cloud.compute.v1.RegionBackendServices.TestIamPermissions", "service": { "fullName": "google.cloud.compute.v1.RegionBackendServices", "shortName": "RegionBackendServices" }, - "shortName": "ListUsable" + "shortName": "TestIamPermissions" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.ListUsableRegionBackendServicesRequest" + "type": "google.cloud.compute_v1.types.TestIamPermissionsRegionBackendServiceRequest" }, { "name": "project", @@ -37356,6 +39592,14 @@ "name": "region", "type": "str" }, + { + "name": "resource", + "type": "str" + }, + { + "name": "test_permissions_request_resource", + "type": "google.cloud.compute_v1.types.TestPermissionsRequest" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -37369,14 +39613,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.services.region_backend_services.pagers.ListUsablePager", - "shortName": "list_usable" + "resultType": "google.cloud.compute_v1.types.TestPermissionsResponse", + "shortName": "test_iam_permissions" }, - "description": "Sample for ListUsable", - "file": "compute_v1_generated_region_backend_services_list_usable_sync.py", + "description": "Sample for TestIamPermissions", + "file": "compute_v1_generated_region_backend_services_test_iam_permissions_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionBackendServices_ListUsable_sync", + "regionTag": "compute_v1_generated_RegionBackendServices_TestIamPermissions_sync", "segments": [ { "end": 53, @@ -37394,22 +39638,22 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 46, + "end": 47, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 49, - "start": 47, + "end": 50, + "start": 48, "type": "REQUEST_EXECUTION" }, { "end": 54, - "start": 50, + "start": 51, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_backend_services_list_usable_sync.py" + "title": "compute_v1_generated_region_backend_services_test_iam_permissions_sync.py" }, { "canonical": true, @@ -37418,19 +39662,19 @@ "fullName": "google.cloud.compute_v1.RegionBackendServicesClient", "shortName": "RegionBackendServicesClient" }, - "fullName": "google.cloud.compute_v1.RegionBackendServicesClient.list", + "fullName": "google.cloud.compute_v1.RegionBackendServicesClient.update", "method": { - "fullName": "google.cloud.compute.v1.RegionBackendServices.List", + "fullName": "google.cloud.compute.v1.RegionBackendServices.Update", "service": { "fullName": "google.cloud.compute.v1.RegionBackendServices", "shortName": "RegionBackendServices" }, - "shortName": "List" + "shortName": "Update" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.ListRegionBackendServicesRequest" + "type": "google.cloud.compute_v1.types.UpdateRegionBackendServiceRequest" }, { "name": "project", @@ -37440,6 +39684,14 @@ "name": "region", "type": "str" }, + { + "name": "backend_service", + "type": "str" + }, + { + "name": "backend_service_resource", + "type": "google.cloud.compute_v1.types.BackendService" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -37453,14 +39705,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.services.region_backend_services.pagers.ListPager", - "shortName": "list" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "update" }, - "description": "Sample for List", - "file": "compute_v1_generated_region_backend_services_list_sync.py", + "description": "Sample for Update", + "file": "compute_v1_generated_region_backend_services_update_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionBackendServices_List_sync", + "regionTag": "compute_v1_generated_RegionBackendServices_Update_sync", "segments": [ { "end": 53, @@ -37478,60 +39730,48 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 46, + "end": 47, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 49, - "start": 47, + "end": 50, + "start": 48, "type": "REQUEST_EXECUTION" }, { "end": 54, - "start": 50, + "start": 51, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_backend_services_list_sync.py" + "title": "compute_v1_generated_region_backend_services_update_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionBackendServicesClient", - "shortName": "RegionBackendServicesClient" + "fullName": "google.cloud.compute_v1.RegionCommitmentsClient", + "shortName": "RegionCommitmentsClient" }, - "fullName": "google.cloud.compute_v1.RegionBackendServicesClient.patch", + "fullName": "google.cloud.compute_v1.RegionCommitmentsClient.aggregated_list", "method": { - "fullName": "google.cloud.compute.v1.RegionBackendServices.Patch", + "fullName": "google.cloud.compute.v1.RegionCommitments.AggregatedList", "service": { - "fullName": "google.cloud.compute.v1.RegionBackendServices", - "shortName": "RegionBackendServices" + "fullName": "google.cloud.compute.v1.RegionCommitments", + "shortName": "RegionCommitments" }, - "shortName": "Patch" + "shortName": "AggregatedList" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.PatchRegionBackendServiceRequest" + "type": "google.cloud.compute_v1.types.AggregatedListRegionCommitmentsRequest" }, { "name": "project", "type": "str" }, - { - "name": "region", - "type": "str" - }, - { - "name": "backend_service", - "type": "str" - }, - { - "name": "backend_service_resource", - "type": "google.cloud.compute_v1.types.BackendService" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -37545,22 +39785,22 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "patch" + "resultType": "google.cloud.compute_v1.services.region_commitments.pagers.AggregatedListPager", + "shortName": "aggregated_list" }, - "description": "Sample for Patch", - "file": "compute_v1_generated_region_backend_services_patch_sync.py", + "description": "Sample for AggregatedList", + "file": "compute_v1_generated_region_commitments_aggregated_list_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionBackendServices_Patch_sync", + "regionTag": "compute_v1_generated_RegionCommitments_AggregatedList_sync", "segments": [ { - "end": 53, + "end": 52, "start": 27, "type": "FULL" }, { - "end": 53, + "end": 52, "start": 27, "type": "SHORT" }, @@ -37570,43 +39810,43 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 47, + "end": 45, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 50, - "start": 48, + "end": 48, + "start": 46, "type": "REQUEST_EXECUTION" }, { - "end": 54, - "start": 51, + "end": 53, + "start": 49, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_backend_services_patch_sync.py" + "title": "compute_v1_generated_region_commitments_aggregated_list_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionBackendServicesClient", - "shortName": "RegionBackendServicesClient" + "fullName": "google.cloud.compute_v1.RegionCommitmentsClient", + "shortName": "RegionCommitmentsClient" }, - "fullName": "google.cloud.compute_v1.RegionBackendServicesClient.set_iam_policy", + "fullName": "google.cloud.compute_v1.RegionCommitmentsClient.get", "method": { - "fullName": "google.cloud.compute.v1.RegionBackendServices.SetIamPolicy", + "fullName": "google.cloud.compute.v1.RegionCommitments.Get", "service": { - "fullName": "google.cloud.compute.v1.RegionBackendServices", - "shortName": "RegionBackendServices" + "fullName": "google.cloud.compute.v1.RegionCommitments", + "shortName": "RegionCommitments" }, - "shortName": "SetIamPolicy" + "shortName": "Get" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.SetIamPolicyRegionBackendServiceRequest" + "type": "google.cloud.compute_v1.types.GetRegionCommitmentRequest" }, { "name": "project", @@ -37617,13 +39857,9 @@ "type": "str" }, { - "name": "resource", + "name": "commitment", "type": "str" }, - { - "name": "region_set_policy_request_resource", - "type": "google.cloud.compute_v1.types.RegionSetPolicyRequest" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -37637,14 +39873,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.Policy", - "shortName": "set_iam_policy" + "resultType": "google.cloud.compute_v1.types.Commitment", + "shortName": "get" }, - "description": "Sample for SetIamPolicy", - "file": "compute_v1_generated_region_backend_services_set_iam_policy_sync.py", + "description": "Sample for Get", + "file": "compute_v1_generated_region_commitments_get_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionBackendServices_SetIamPolicy_sync", + "regionTag": "compute_v1_generated_RegionCommitments_Get_sync", "segments": [ { "end": 53, @@ -37677,28 +39913,28 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_backend_services_set_iam_policy_sync.py" + "title": "compute_v1_generated_region_commitments_get_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionBackendServicesClient", - "shortName": "RegionBackendServicesClient" + "fullName": "google.cloud.compute_v1.RegionCommitmentsClient", + "shortName": "RegionCommitmentsClient" }, - "fullName": "google.cloud.compute_v1.RegionBackendServicesClient.set_security_policy", + "fullName": "google.cloud.compute_v1.RegionCommitmentsClient.insert", "method": { - "fullName": "google.cloud.compute.v1.RegionBackendServices.SetSecurityPolicy", + "fullName": "google.cloud.compute.v1.RegionCommitments.Insert", "service": { - "fullName": "google.cloud.compute.v1.RegionBackendServices", - "shortName": "RegionBackendServices" + "fullName": "google.cloud.compute.v1.RegionCommitments", + "shortName": "RegionCommitments" }, - "shortName": "SetSecurityPolicy" + "shortName": "Insert" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.SetSecurityPolicyRegionBackendServiceRequest" + "type": "google.cloud.compute_v1.types.InsertRegionCommitmentRequest" }, { "name": "project", @@ -37709,12 +39945,8 @@ "type": "str" }, { - "name": "backend_service", - "type": "str" - }, - { - "name": "security_policy_reference_resource", - "type": "google.cloud.compute_v1.types.SecurityPolicyReference" + "name": "commitment_resource", + "type": "google.cloud.compute_v1.types.Commitment" }, { "name": "retry", @@ -37730,21 +39962,21 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "set_security_policy" + "shortName": "insert" }, - "description": "Sample for SetSecurityPolicy", - "file": "compute_v1_generated_region_backend_services_set_security_policy_sync.py", + "description": "Sample for Insert", + "file": "compute_v1_generated_region_commitments_insert_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionBackendServices_SetSecurityPolicy_sync", + "regionTag": "compute_v1_generated_RegionCommitments_Insert_sync", "segments": [ { - "end": 53, + "end": 52, "start": 27, "type": "FULL" }, { - "end": 53, + "end": 52, "start": 27, "type": "SHORT" }, @@ -37754,43 +39986,43 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 47, + "end": 46, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 50, - "start": 48, + "end": 49, + "start": 47, "type": "REQUEST_EXECUTION" }, { - "end": 54, - "start": 51, + "end": 53, + "start": 50, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_backend_services_set_security_policy_sync.py" + "title": "compute_v1_generated_region_commitments_insert_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionBackendServicesClient", - "shortName": "RegionBackendServicesClient" + "fullName": "google.cloud.compute_v1.RegionCommitmentsClient", + "shortName": "RegionCommitmentsClient" }, - "fullName": "google.cloud.compute_v1.RegionBackendServicesClient.test_iam_permissions", + "fullName": "google.cloud.compute_v1.RegionCommitmentsClient.list", "method": { - "fullName": "google.cloud.compute.v1.RegionBackendServices.TestIamPermissions", + "fullName": "google.cloud.compute.v1.RegionCommitments.List", "service": { - "fullName": "google.cloud.compute.v1.RegionBackendServices", - "shortName": "RegionBackendServices" + "fullName": "google.cloud.compute.v1.RegionCommitments", + "shortName": "RegionCommitments" }, - "shortName": "TestIamPermissions" + "shortName": "List" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.TestIamPermissionsRegionBackendServiceRequest" + "type": "google.cloud.compute_v1.types.ListRegionCommitmentsRequest" }, { "name": "project", @@ -37800,14 +40032,6 @@ "name": "region", "type": "str" }, - { - "name": "resource", - "type": "str" - }, - { - "name": "test_permissions_request_resource", - "type": "google.cloud.compute_v1.types.TestPermissionsRequest" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -37821,14 +40045,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.TestPermissionsResponse", - "shortName": "test_iam_permissions" + "resultType": "google.cloud.compute_v1.services.region_commitments.pagers.ListPager", + "shortName": "list" }, - "description": "Sample for TestIamPermissions", - "file": "compute_v1_generated_region_backend_services_test_iam_permissions_sync.py", + "description": "Sample for List", + "file": "compute_v1_generated_region_commitments_list_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionBackendServices_TestIamPermissions_sync", + "regionTag": "compute_v1_generated_RegionCommitments_List_sync", "segments": [ { "end": 53, @@ -37846,43 +40070,43 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 47, + "end": 46, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 50, - "start": 48, + "end": 49, + "start": 47, "type": "REQUEST_EXECUTION" }, { "end": 54, - "start": 51, + "start": 50, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_backend_services_test_iam_permissions_sync.py" + "title": "compute_v1_generated_region_commitments_list_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionBackendServicesClient", - "shortName": "RegionBackendServicesClient" + "fullName": "google.cloud.compute_v1.RegionCommitmentsClient", + "shortName": "RegionCommitmentsClient" }, - "fullName": "google.cloud.compute_v1.RegionBackendServicesClient.update", + "fullName": "google.cloud.compute_v1.RegionCommitmentsClient.update", "method": { - "fullName": "google.cloud.compute.v1.RegionBackendServices.Update", + "fullName": "google.cloud.compute.v1.RegionCommitments.Update", "service": { - "fullName": "google.cloud.compute.v1.RegionBackendServices", - "shortName": "RegionBackendServices" + "fullName": "google.cloud.compute.v1.RegionCommitments", + "shortName": "RegionCommitments" }, "shortName": "Update" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.UpdateRegionBackendServiceRequest" + "type": "google.cloud.compute_v1.types.UpdateRegionCommitmentRequest" }, { "name": "project", @@ -37893,12 +40117,12 @@ "type": "str" }, { - "name": "backend_service", + "name": "commitment", "type": "str" }, { - "name": "backend_service_resource", - "type": "google.cloud.compute_v1.types.BackendService" + "name": "commitment_resource", + "type": "google.cloud.compute_v1.types.Commitment" }, { "name": "retry", @@ -37917,10 +40141,10 @@ "shortName": "update" }, "description": "Sample for Update", - "file": "compute_v1_generated_region_backend_services_update_sync.py", + "file": "compute_v1_generated_region_commitments_update_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionBackendServices_Update_sync", + "regionTag": "compute_v1_generated_RegionCommitments_Update_sync", "segments": [ { "end": 53, @@ -37953,33 +40177,41 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_backend_services_update_sync.py" + "title": "compute_v1_generated_region_commitments_update_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionCommitmentsClient", - "shortName": "RegionCommitmentsClient" + "fullName": "google.cloud.compute_v1.RegionDiskTypesClient", + "shortName": "RegionDiskTypesClient" }, - "fullName": "google.cloud.compute_v1.RegionCommitmentsClient.aggregated_list", + "fullName": "google.cloud.compute_v1.RegionDiskTypesClient.get", "method": { - "fullName": "google.cloud.compute.v1.RegionCommitments.AggregatedList", + "fullName": "google.cloud.compute.v1.RegionDiskTypes.Get", "service": { - "fullName": "google.cloud.compute.v1.RegionCommitments", - "shortName": "RegionCommitments" + "fullName": "google.cloud.compute.v1.RegionDiskTypes", + "shortName": "RegionDiskTypes" }, - "shortName": "AggregatedList" + "shortName": "Get" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.AggregatedListRegionCommitmentsRequest" + "type": "google.cloud.compute_v1.types.GetRegionDiskTypeRequest" }, { "name": "project", "type": "str" }, + { + "name": "region", + "type": "str" + }, + { + "name": "disk_type", + "type": "str" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -37993,22 +40225,22 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.services.region_commitments.pagers.AggregatedListPager", - "shortName": "aggregated_list" + "resultType": "google.cloud.compute_v1.types.DiskType", + "shortName": "get" }, - "description": "Sample for AggregatedList", - "file": "compute_v1_generated_region_commitments_aggregated_list_sync.py", + "description": "Sample for Get", + "file": "compute_v1_generated_region_disk_types_get_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionCommitments_AggregatedList_sync", + "regionTag": "compute_v1_generated_RegionDiskTypes_Get_sync", "segments": [ { - "end": 52, + "end": 53, "start": 27, "type": "FULL" }, { - "end": 52, + "end": 53, "start": 27, "type": "SHORT" }, @@ -38018,43 +40250,43 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 45, + "end": 47, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 48, - "start": 46, + "end": 50, + "start": 48, "type": "REQUEST_EXECUTION" }, { - "end": 53, - "start": 49, + "end": 54, + "start": 51, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_commitments_aggregated_list_sync.py" + "title": "compute_v1_generated_region_disk_types_get_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionCommitmentsClient", - "shortName": "RegionCommitmentsClient" + "fullName": "google.cloud.compute_v1.RegionDiskTypesClient", + "shortName": "RegionDiskTypesClient" }, - "fullName": "google.cloud.compute_v1.RegionCommitmentsClient.get", + "fullName": "google.cloud.compute_v1.RegionDiskTypesClient.list", "method": { - "fullName": "google.cloud.compute.v1.RegionCommitments.Get", + "fullName": "google.cloud.compute.v1.RegionDiskTypes.List", "service": { - "fullName": "google.cloud.compute.v1.RegionCommitments", - "shortName": "RegionCommitments" + "fullName": "google.cloud.compute.v1.RegionDiskTypes", + "shortName": "RegionDiskTypes" }, - "shortName": "Get" + "shortName": "List" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetRegionCommitmentRequest" + "type": "google.cloud.compute_v1.types.ListRegionDiskTypesRequest" }, { "name": "project", @@ -38064,10 +40296,6 @@ "name": "region", "type": "str" }, - { - "name": "commitment", - "type": "str" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -38081,14 +40309,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.Commitment", - "shortName": "get" + "resultType": "google.cloud.compute_v1.services.region_disk_types.pagers.ListPager", + "shortName": "list" }, - "description": "Sample for Get", - "file": "compute_v1_generated_region_commitments_get_sync.py", + "description": "Sample for List", + "file": "compute_v1_generated_region_disk_types_list_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionCommitments_Get_sync", + "regionTag": "compute_v1_generated_RegionDiskTypes_List_sync", "segments": [ { "end": 53, @@ -38106,43 +40334,43 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 47, + "end": 46, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 50, - "start": 48, + "end": 49, + "start": 47, "type": "REQUEST_EXECUTION" }, { "end": 54, - "start": 51, + "start": 50, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_commitments_get_sync.py" + "title": "compute_v1_generated_region_disk_types_list_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionCommitmentsClient", - "shortName": "RegionCommitmentsClient" + "fullName": "google.cloud.compute_v1.RegionDisksClient", + "shortName": "RegionDisksClient" }, - "fullName": "google.cloud.compute_v1.RegionCommitmentsClient.insert", + "fullName": "google.cloud.compute_v1.RegionDisksClient.add_resource_policies", "method": { - "fullName": "google.cloud.compute.v1.RegionCommitments.Insert", + "fullName": "google.cloud.compute.v1.RegionDisks.AddResourcePolicies", "service": { - "fullName": "google.cloud.compute.v1.RegionCommitments", - "shortName": "RegionCommitments" + "fullName": "google.cloud.compute.v1.RegionDisks", + "shortName": "RegionDisks" }, - "shortName": "Insert" + "shortName": "AddResourcePolicies" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.InsertRegionCommitmentRequest" + "type": "google.cloud.compute_v1.types.AddResourcePoliciesRegionDiskRequest" }, { "name": "project", @@ -38153,8 +40381,12 @@ "type": "str" }, { - "name": "commitment_resource", - "type": "google.cloud.compute_v1.types.Commitment" + "name": "disk", + "type": "str" + }, + { + "name": "region_disks_add_resource_policies_request_resource", + "type": "google.cloud.compute_v1.types.RegionDisksAddResourcePoliciesRequest" }, { "name": "retry", @@ -38170,21 +40402,21 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "insert" + "shortName": "add_resource_policies" }, - "description": "Sample for Insert", - "file": "compute_v1_generated_region_commitments_insert_sync.py", + "description": "Sample for AddResourcePolicies", + "file": "compute_v1_generated_region_disks_add_resource_policies_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionCommitments_Insert_sync", + "regionTag": "compute_v1_generated_RegionDisks_AddResourcePolicies_sync", "segments": [ { - "end": 52, + "end": 53, "start": 27, "type": "FULL" }, { - "end": 52, + "end": 53, "start": 27, "type": "SHORT" }, @@ -38194,43 +40426,43 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 46, + "end": 47, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 49, - "start": 47, + "end": 50, + "start": 48, "type": "REQUEST_EXECUTION" }, { - "end": 53, - "start": 50, + "end": 54, + "start": 51, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_commitments_insert_sync.py" + "title": "compute_v1_generated_region_disks_add_resource_policies_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionCommitmentsClient", - "shortName": "RegionCommitmentsClient" + "fullName": "google.cloud.compute_v1.RegionDisksClient", + "shortName": "RegionDisksClient" }, - "fullName": "google.cloud.compute_v1.RegionCommitmentsClient.list", + "fullName": "google.cloud.compute_v1.RegionDisksClient.bulk_insert", "method": { - "fullName": "google.cloud.compute.v1.RegionCommitments.List", + "fullName": "google.cloud.compute.v1.RegionDisks.BulkInsert", "service": { - "fullName": "google.cloud.compute.v1.RegionCommitments", - "shortName": "RegionCommitments" + "fullName": "google.cloud.compute.v1.RegionDisks", + "shortName": "RegionDisks" }, - "shortName": "List" + "shortName": "BulkInsert" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.ListRegionCommitmentsRequest" + "type": "google.cloud.compute_v1.types.BulkInsertRegionDiskRequest" }, { "name": "project", @@ -38240,6 +40472,10 @@ "name": "region", "type": "str" }, + { + "name": "bulk_insert_disk_resource_resource", + "type": "google.cloud.compute_v1.types.BulkInsertDiskResource" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -38253,22 +40489,22 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.services.region_commitments.pagers.ListPager", - "shortName": "list" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "bulk_insert" }, - "description": "Sample for List", - "file": "compute_v1_generated_region_commitments_list_sync.py", + "description": "Sample for BulkInsert", + "file": "compute_v1_generated_region_disks_bulk_insert_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionCommitments_List_sync", + "regionTag": "compute_v1_generated_RegionDisks_BulkInsert_sync", "segments": [ { - "end": 53, + "end": 52, "start": 27, "type": "FULL" }, { - "end": 53, + "end": 52, "start": 27, "type": "SHORT" }, @@ -38288,33 +40524,33 @@ "type": "REQUEST_EXECUTION" }, { - "end": 54, + "end": 53, "start": 50, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_commitments_list_sync.py" + "title": "compute_v1_generated_region_disks_bulk_insert_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionCommitmentsClient", - "shortName": "RegionCommitmentsClient" + "fullName": "google.cloud.compute_v1.RegionDisksClient", + "shortName": "RegionDisksClient" }, - "fullName": "google.cloud.compute_v1.RegionCommitmentsClient.update", + "fullName": "google.cloud.compute_v1.RegionDisksClient.create_snapshot", "method": { - "fullName": "google.cloud.compute.v1.RegionCommitments.Update", + "fullName": "google.cloud.compute.v1.RegionDisks.CreateSnapshot", "service": { - "fullName": "google.cloud.compute.v1.RegionCommitments", - "shortName": "RegionCommitments" + "fullName": "google.cloud.compute.v1.RegionDisks", + "shortName": "RegionDisks" }, - "shortName": "Update" + "shortName": "CreateSnapshot" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.UpdateRegionCommitmentRequest" + "type": "google.cloud.compute_v1.types.CreateSnapshotRegionDiskRequest" }, { "name": "project", @@ -38325,12 +40561,12 @@ "type": "str" }, { - "name": "commitment", + "name": "disk", "type": "str" }, { - "name": "commitment_resource", - "type": "google.cloud.compute_v1.types.Commitment" + "name": "snapshot_resource", + "type": "google.cloud.compute_v1.types.Snapshot" }, { "name": "retry", @@ -38346,13 +40582,13 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "update" + "shortName": "create_snapshot" }, - "description": "Sample for Update", - "file": "compute_v1_generated_region_commitments_update_sync.py", + "description": "Sample for CreateSnapshot", + "file": "compute_v1_generated_region_disks_create_snapshot_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionCommitments_Update_sync", + "regionTag": "compute_v1_generated_RegionDisks_CreateSnapshot_sync", "segments": [ { "end": 53, @@ -38385,28 +40621,28 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_commitments_update_sync.py" + "title": "compute_v1_generated_region_disks_create_snapshot_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionDiskTypesClient", - "shortName": "RegionDiskTypesClient" + "fullName": "google.cloud.compute_v1.RegionDisksClient", + "shortName": "RegionDisksClient" }, - "fullName": "google.cloud.compute_v1.RegionDiskTypesClient.get", + "fullName": "google.cloud.compute_v1.RegionDisksClient.delete", "method": { - "fullName": "google.cloud.compute.v1.RegionDiskTypes.Get", + "fullName": "google.cloud.compute.v1.RegionDisks.Delete", "service": { - "fullName": "google.cloud.compute.v1.RegionDiskTypes", - "shortName": "RegionDiskTypes" + "fullName": "google.cloud.compute.v1.RegionDisks", + "shortName": "RegionDisks" }, - "shortName": "Get" + "shortName": "Delete" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetRegionDiskTypeRequest" + "type": "google.cloud.compute_v1.types.DeleteRegionDiskRequest" }, { "name": "project", @@ -38417,7 +40653,7 @@ "type": "str" }, { - "name": "disk_type", + "name": "disk", "type": "str" }, { @@ -38433,14 +40669,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.DiskType", - "shortName": "get" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "delete" }, - "description": "Sample for Get", - "file": "compute_v1_generated_region_disk_types_get_sync.py", + "description": "Sample for Delete", + "file": "compute_v1_generated_region_disks_delete_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionDiskTypes_Get_sync", + "regionTag": "compute_v1_generated_RegionDisks_Delete_sync", "segments": [ { "end": 53, @@ -38473,28 +40709,28 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_disk_types_get_sync.py" + "title": "compute_v1_generated_region_disks_delete_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionDiskTypesClient", - "shortName": "RegionDiskTypesClient" + "fullName": "google.cloud.compute_v1.RegionDisksClient", + "shortName": "RegionDisksClient" }, - "fullName": "google.cloud.compute_v1.RegionDiskTypesClient.list", + "fullName": "google.cloud.compute_v1.RegionDisksClient.get_iam_policy", "method": { - "fullName": "google.cloud.compute.v1.RegionDiskTypes.List", + "fullName": "google.cloud.compute.v1.RegionDisks.GetIamPolicy", "service": { - "fullName": "google.cloud.compute.v1.RegionDiskTypes", - "shortName": "RegionDiskTypes" + "fullName": "google.cloud.compute.v1.RegionDisks", + "shortName": "RegionDisks" }, - "shortName": "List" + "shortName": "GetIamPolicy" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.ListRegionDiskTypesRequest" + "type": "google.cloud.compute_v1.types.GetIamPolicyRegionDiskRequest" }, { "name": "project", @@ -38504,6 +40740,10 @@ "name": "region", "type": "str" }, + { + "name": "resource", + "type": "str" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -38517,14 +40757,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.services.region_disk_types.pagers.ListPager", - "shortName": "list" + "resultType": "google.cloud.compute_v1.types.Policy", + "shortName": "get_iam_policy" }, - "description": "Sample for List", - "file": "compute_v1_generated_region_disk_types_list_sync.py", + "description": "Sample for GetIamPolicy", + "file": "compute_v1_generated_region_disks_get_iam_policy_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionDiskTypes_List_sync", + "regionTag": "compute_v1_generated_RegionDisks_GetIamPolicy_sync", "segments": [ { "end": 53, @@ -38542,22 +40782,22 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 46, + "end": 47, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 49, - "start": 47, + "end": 50, + "start": 48, "type": "REQUEST_EXECUTION" }, { "end": 54, - "start": 50, + "start": 51, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_disk_types_list_sync.py" + "title": "compute_v1_generated_region_disks_get_iam_policy_sync.py" }, { "canonical": true, @@ -38566,19 +40806,19 @@ "fullName": "google.cloud.compute_v1.RegionDisksClient", "shortName": "RegionDisksClient" }, - "fullName": "google.cloud.compute_v1.RegionDisksClient.add_resource_policies", + "fullName": "google.cloud.compute_v1.RegionDisksClient.get", "method": { - "fullName": "google.cloud.compute.v1.RegionDisks.AddResourcePolicies", + "fullName": "google.cloud.compute.v1.RegionDisks.Get", "service": { "fullName": "google.cloud.compute.v1.RegionDisks", "shortName": "RegionDisks" }, - "shortName": "AddResourcePolicies" + "shortName": "Get" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.AddResourcePoliciesRegionDiskRequest" + "type": "google.cloud.compute_v1.types.GetRegionDiskRequest" }, { "name": "project", @@ -38592,10 +40832,6 @@ "name": "disk", "type": "str" }, - { - "name": "region_disks_add_resource_policies_request_resource", - "type": "google.cloud.compute_v1.types.RegionDisksAddResourcePoliciesRequest" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -38609,14 +40845,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "add_resource_policies" + "resultType": "google.cloud.compute_v1.types.Disk", + "shortName": "get" }, - "description": "Sample for AddResourcePolicies", - "file": "compute_v1_generated_region_disks_add_resource_policies_sync.py", + "description": "Sample for Get", + "file": "compute_v1_generated_region_disks_get_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionDisks_AddResourcePolicies_sync", + "regionTag": "compute_v1_generated_RegionDisks_Get_sync", "segments": [ { "end": 53, @@ -38649,7 +40885,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_disks_add_resource_policies_sync.py" + "title": "compute_v1_generated_region_disks_get_sync.py" }, { "canonical": true, @@ -38658,19 +40894,19 @@ "fullName": "google.cloud.compute_v1.RegionDisksClient", "shortName": "RegionDisksClient" }, - "fullName": "google.cloud.compute_v1.RegionDisksClient.bulk_insert", + "fullName": "google.cloud.compute_v1.RegionDisksClient.insert", "method": { - "fullName": "google.cloud.compute.v1.RegionDisks.BulkInsert", + "fullName": "google.cloud.compute.v1.RegionDisks.Insert", "service": { "fullName": "google.cloud.compute.v1.RegionDisks", "shortName": "RegionDisks" }, - "shortName": "BulkInsert" + "shortName": "Insert" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.BulkInsertRegionDiskRequest" + "type": "google.cloud.compute_v1.types.InsertRegionDiskRequest" }, { "name": "project", @@ -38681,8 +40917,8 @@ "type": "str" }, { - "name": "bulk_insert_disk_resource_resource", - "type": "google.cloud.compute_v1.types.BulkInsertDiskResource" + "name": "disk_resource", + "type": "google.cloud.compute_v1.types.Disk" }, { "name": "retry", @@ -38698,13 +40934,13 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "bulk_insert" + "shortName": "insert" }, - "description": "Sample for BulkInsert", - "file": "compute_v1_generated_region_disks_bulk_insert_sync.py", + "description": "Sample for Insert", + "file": "compute_v1_generated_region_disks_insert_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionDisks_BulkInsert_sync", + "regionTag": "compute_v1_generated_RegionDisks_Insert_sync", "segments": [ { "end": 52, @@ -38737,7 +40973,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_disks_bulk_insert_sync.py" + "title": "compute_v1_generated_region_disks_insert_sync.py" }, { "canonical": true, @@ -38746,19 +40982,19 @@ "fullName": "google.cloud.compute_v1.RegionDisksClient", "shortName": "RegionDisksClient" }, - "fullName": "google.cloud.compute_v1.RegionDisksClient.create_snapshot", + "fullName": "google.cloud.compute_v1.RegionDisksClient.list", "method": { - "fullName": "google.cloud.compute.v1.RegionDisks.CreateSnapshot", + "fullName": "google.cloud.compute.v1.RegionDisks.List", "service": { "fullName": "google.cloud.compute.v1.RegionDisks", "shortName": "RegionDisks" }, - "shortName": "CreateSnapshot" + "shortName": "List" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.CreateSnapshotRegionDiskRequest" + "type": "google.cloud.compute_v1.types.ListRegionDisksRequest" }, { "name": "project", @@ -38768,14 +41004,6 @@ "name": "region", "type": "str" }, - { - "name": "disk", - "type": "str" - }, - { - "name": "snapshot_resource", - "type": "google.cloud.compute_v1.types.Snapshot" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -38789,14 +41017,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "create_snapshot" + "resultType": "google.cloud.compute_v1.services.region_disks.pagers.ListPager", + "shortName": "list" }, - "description": "Sample for CreateSnapshot", - "file": "compute_v1_generated_region_disks_create_snapshot_sync.py", + "description": "Sample for List", + "file": "compute_v1_generated_region_disks_list_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionDisks_CreateSnapshot_sync", + "regionTag": "compute_v1_generated_RegionDisks_List_sync", "segments": [ { "end": 53, @@ -38814,22 +41042,22 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 47, + "end": 46, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 50, - "start": 48, + "end": 49, + "start": 47, "type": "REQUEST_EXECUTION" }, { "end": 54, - "start": 51, + "start": 50, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_disks_create_snapshot_sync.py" + "title": "compute_v1_generated_region_disks_list_sync.py" }, { "canonical": true, @@ -38838,19 +41066,19 @@ "fullName": "google.cloud.compute_v1.RegionDisksClient", "shortName": "RegionDisksClient" }, - "fullName": "google.cloud.compute_v1.RegionDisksClient.delete", + "fullName": "google.cloud.compute_v1.RegionDisksClient.remove_resource_policies", "method": { - "fullName": "google.cloud.compute.v1.RegionDisks.Delete", + "fullName": "google.cloud.compute.v1.RegionDisks.RemoveResourcePolicies", "service": { "fullName": "google.cloud.compute.v1.RegionDisks", "shortName": "RegionDisks" }, - "shortName": "Delete" + "shortName": "RemoveResourcePolicies" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.DeleteRegionDiskRequest" + "type": "google.cloud.compute_v1.types.RemoveResourcePoliciesRegionDiskRequest" }, { "name": "project", @@ -38865,92 +41093,8 @@ "type": "str" }, { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, Union[str, bytes]]]" - } - ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "delete" - }, - "description": "Sample for Delete", - "file": "compute_v1_generated_region_disks_delete_sync.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionDisks_Delete_sync", - "segments": [ - { - "end": 53, - "start": 27, - "type": "FULL" - }, - { - "end": 53, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 47, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 50, - "start": 48, - "type": "REQUEST_EXECUTION" - }, - { - "end": 54, - "start": 51, - "type": "RESPONSE_HANDLING" - } - ], - "title": "compute_v1_generated_region_disks_delete_sync.py" - }, - { - "canonical": true, - "clientMethod": { - "client": { - "fullName": "google.cloud.compute_v1.RegionDisksClient", - "shortName": "RegionDisksClient" - }, - "fullName": "google.cloud.compute_v1.RegionDisksClient.get_iam_policy", - "method": { - "fullName": "google.cloud.compute.v1.RegionDisks.GetIamPolicy", - "service": { - "fullName": "google.cloud.compute.v1.RegionDisks", - "shortName": "RegionDisks" - }, - "shortName": "GetIamPolicy" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.compute_v1.types.GetIamPolicyRegionDiskRequest" - }, - { - "name": "project", - "type": "str" - }, - { - "name": "region", - "type": "str" - }, - { - "name": "resource", - "type": "str" + "name": "region_disks_remove_resource_policies_request_resource", + "type": "google.cloud.compute_v1.types.RegionDisksRemoveResourcePoliciesRequest" }, { "name": "retry", @@ -38965,14 +41109,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.Policy", - "shortName": "get_iam_policy" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "remove_resource_policies" }, - "description": "Sample for GetIamPolicy", - "file": "compute_v1_generated_region_disks_get_iam_policy_sync.py", + "description": "Sample for RemoveResourcePolicies", + "file": "compute_v1_generated_region_disks_remove_resource_policies_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionDisks_GetIamPolicy_sync", + "regionTag": "compute_v1_generated_RegionDisks_RemoveResourcePolicies_sync", "segments": [ { "end": 53, @@ -39005,7 +41149,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_disks_get_iam_policy_sync.py" + "title": "compute_v1_generated_region_disks_remove_resource_policies_sync.py" }, { "canonical": true, @@ -39014,19 +41158,19 @@ "fullName": "google.cloud.compute_v1.RegionDisksClient", "shortName": "RegionDisksClient" }, - "fullName": "google.cloud.compute_v1.RegionDisksClient.get", + "fullName": "google.cloud.compute_v1.RegionDisksClient.resize", "method": { - "fullName": "google.cloud.compute.v1.RegionDisks.Get", + "fullName": "google.cloud.compute.v1.RegionDisks.Resize", "service": { "fullName": "google.cloud.compute.v1.RegionDisks", "shortName": "RegionDisks" }, - "shortName": "Get" + "shortName": "Resize" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetRegionDiskRequest" + "type": "google.cloud.compute_v1.types.ResizeRegionDiskRequest" }, { "name": "project", @@ -39040,6 +41184,10 @@ "name": "disk", "type": "str" }, + { + "name": "region_disks_resize_request_resource", + "type": "google.cloud.compute_v1.types.RegionDisksResizeRequest" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -39053,14 +41201,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.Disk", - "shortName": "get" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "resize" }, - "description": "Sample for Get", - "file": "compute_v1_generated_region_disks_get_sync.py", + "description": "Sample for Resize", + "file": "compute_v1_generated_region_disks_resize_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionDisks_Get_sync", + "regionTag": "compute_v1_generated_RegionDisks_Resize_sync", "segments": [ { "end": 53, @@ -39093,7 +41241,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_disks_get_sync.py" + "title": "compute_v1_generated_region_disks_resize_sync.py" }, { "canonical": true, @@ -39102,19 +41250,19 @@ "fullName": "google.cloud.compute_v1.RegionDisksClient", "shortName": "RegionDisksClient" }, - "fullName": "google.cloud.compute_v1.RegionDisksClient.insert", + "fullName": "google.cloud.compute_v1.RegionDisksClient.set_iam_policy", "method": { - "fullName": "google.cloud.compute.v1.RegionDisks.Insert", + "fullName": "google.cloud.compute.v1.RegionDisks.SetIamPolicy", "service": { "fullName": "google.cloud.compute.v1.RegionDisks", "shortName": "RegionDisks" }, - "shortName": "Insert" + "shortName": "SetIamPolicy" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.InsertRegionDiskRequest" + "type": "google.cloud.compute_v1.types.SetIamPolicyRegionDiskRequest" }, { "name": "project", @@ -39125,8 +41273,12 @@ "type": "str" }, { - "name": "disk_resource", - "type": "google.cloud.compute_v1.types.Disk" + "name": "resource", + "type": "str" + }, + { + "name": "region_set_policy_request_resource", + "type": "google.cloud.compute_v1.types.RegionSetPolicyRequest" }, { "name": "retry", @@ -39141,22 +41293,22 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "insert" + "resultType": "google.cloud.compute_v1.types.Policy", + "shortName": "set_iam_policy" }, - "description": "Sample for Insert", - "file": "compute_v1_generated_region_disks_insert_sync.py", + "description": "Sample for SetIamPolicy", + "file": "compute_v1_generated_region_disks_set_iam_policy_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionDisks_Insert_sync", + "regionTag": "compute_v1_generated_RegionDisks_SetIamPolicy_sync", "segments": [ { - "end": 52, + "end": 53, "start": 27, "type": "FULL" }, { - "end": 52, + "end": 53, "start": 27, "type": "SHORT" }, @@ -39166,22 +41318,22 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 46, + "end": 47, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 49, - "start": 47, + "end": 50, + "start": 48, "type": "REQUEST_EXECUTION" }, { - "end": 53, - "start": 50, + "end": 54, + "start": 51, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_disks_insert_sync.py" + "title": "compute_v1_generated_region_disks_set_iam_policy_sync.py" }, { "canonical": true, @@ -39190,19 +41342,19 @@ "fullName": "google.cloud.compute_v1.RegionDisksClient", "shortName": "RegionDisksClient" }, - "fullName": "google.cloud.compute_v1.RegionDisksClient.list", + "fullName": "google.cloud.compute_v1.RegionDisksClient.set_labels", "method": { - "fullName": "google.cloud.compute.v1.RegionDisks.List", + "fullName": "google.cloud.compute.v1.RegionDisks.SetLabels", "service": { "fullName": "google.cloud.compute.v1.RegionDisks", "shortName": "RegionDisks" }, - "shortName": "List" + "shortName": "SetLabels" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.ListRegionDisksRequest" + "type": "google.cloud.compute_v1.types.SetLabelsRegionDiskRequest" }, { "name": "project", @@ -39212,6 +41364,14 @@ "name": "region", "type": "str" }, + { + "name": "resource", + "type": "str" + }, + { + "name": "region_set_labels_request_resource", + "type": "google.cloud.compute_v1.types.RegionSetLabelsRequest" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -39225,14 +41385,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.services.region_disks.pagers.ListPager", - "shortName": "list" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "set_labels" }, - "description": "Sample for List", - "file": "compute_v1_generated_region_disks_list_sync.py", + "description": "Sample for SetLabels", + "file": "compute_v1_generated_region_disks_set_labels_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionDisks_List_sync", + "regionTag": "compute_v1_generated_RegionDisks_SetLabels_sync", "segments": [ { "end": 53, @@ -39250,22 +41410,22 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 46, + "end": 47, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 49, - "start": 47, + "end": 50, + "start": 48, "type": "REQUEST_EXECUTION" }, { "end": 54, - "start": 50, + "start": 51, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_disks_list_sync.py" + "title": "compute_v1_generated_region_disks_set_labels_sync.py" }, { "canonical": true, @@ -39274,19 +41434,19 @@ "fullName": "google.cloud.compute_v1.RegionDisksClient", "shortName": "RegionDisksClient" }, - "fullName": "google.cloud.compute_v1.RegionDisksClient.remove_resource_policies", + "fullName": "google.cloud.compute_v1.RegionDisksClient.start_async_replication", "method": { - "fullName": "google.cloud.compute.v1.RegionDisks.RemoveResourcePolicies", + "fullName": "google.cloud.compute.v1.RegionDisks.StartAsyncReplication", "service": { "fullName": "google.cloud.compute.v1.RegionDisks", "shortName": "RegionDisks" }, - "shortName": "RemoveResourcePolicies" + "shortName": "StartAsyncReplication" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.RemoveResourcePoliciesRegionDiskRequest" + "type": "google.cloud.compute_v1.types.StartAsyncReplicationRegionDiskRequest" }, { "name": "project", @@ -39301,8 +41461,8 @@ "type": "str" }, { - "name": "region_disks_remove_resource_policies_request_resource", - "type": "google.cloud.compute_v1.types.RegionDisksRemoveResourcePoliciesRequest" + "name": "region_disks_start_async_replication_request_resource", + "type": "google.cloud.compute_v1.types.RegionDisksStartAsyncReplicationRequest" }, { "name": "retry", @@ -39318,13 +41478,13 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "remove_resource_policies" + "shortName": "start_async_replication" }, - "description": "Sample for RemoveResourcePolicies", - "file": "compute_v1_generated_region_disks_remove_resource_policies_sync.py", + "description": "Sample for StartAsyncReplication", + "file": "compute_v1_generated_region_disks_start_async_replication_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionDisks_RemoveResourcePolicies_sync", + "regionTag": "compute_v1_generated_RegionDisks_StartAsyncReplication_sync", "segments": [ { "end": 53, @@ -39357,7 +41517,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_disks_remove_resource_policies_sync.py" + "title": "compute_v1_generated_region_disks_start_async_replication_sync.py" }, { "canonical": true, @@ -39366,19 +41526,19 @@ "fullName": "google.cloud.compute_v1.RegionDisksClient", "shortName": "RegionDisksClient" }, - "fullName": "google.cloud.compute_v1.RegionDisksClient.resize", + "fullName": "google.cloud.compute_v1.RegionDisksClient.stop_async_replication", "method": { - "fullName": "google.cloud.compute.v1.RegionDisks.Resize", + "fullName": "google.cloud.compute.v1.RegionDisks.StopAsyncReplication", "service": { "fullName": "google.cloud.compute.v1.RegionDisks", "shortName": "RegionDisks" }, - "shortName": "Resize" + "shortName": "StopAsyncReplication" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.ResizeRegionDiskRequest" + "type": "google.cloud.compute_v1.types.StopAsyncReplicationRegionDiskRequest" }, { "name": "project", @@ -39392,10 +41552,6 @@ "name": "disk", "type": "str" }, - { - "name": "region_disks_resize_request_resource", - "type": "google.cloud.compute_v1.types.RegionDisksResizeRequest" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -39410,13 +41566,13 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "resize" + "shortName": "stop_async_replication" }, - "description": "Sample for Resize", - "file": "compute_v1_generated_region_disks_resize_sync.py", + "description": "Sample for StopAsyncReplication", + "file": "compute_v1_generated_region_disks_stop_async_replication_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionDisks_Resize_sync", + "regionTag": "compute_v1_generated_RegionDisks_StopAsyncReplication_sync", "segments": [ { "end": 53, @@ -39449,7 +41605,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_disks_resize_sync.py" + "title": "compute_v1_generated_region_disks_stop_async_replication_sync.py" }, { "canonical": true, @@ -39458,19 +41614,107 @@ "fullName": "google.cloud.compute_v1.RegionDisksClient", "shortName": "RegionDisksClient" }, - "fullName": "google.cloud.compute_v1.RegionDisksClient.set_iam_policy", + "fullName": "google.cloud.compute_v1.RegionDisksClient.stop_group_async_replication", "method": { - "fullName": "google.cloud.compute.v1.RegionDisks.SetIamPolicy", + "fullName": "google.cloud.compute.v1.RegionDisks.StopGroupAsyncReplication", "service": { "fullName": "google.cloud.compute.v1.RegionDisks", "shortName": "RegionDisks" }, - "shortName": "SetIamPolicy" + "shortName": "StopGroupAsyncReplication" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.SetIamPolicyRegionDiskRequest" + "type": "google.cloud.compute_v1.types.StopGroupAsyncReplicationRegionDiskRequest" + }, + { + "name": "project", + "type": "str" + }, + { + "name": "region", + "type": "str" + }, + { + "name": "disks_stop_group_async_replication_resource_resource", + "type": "google.cloud.compute_v1.types.DisksStopGroupAsyncReplicationResource" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "stop_group_async_replication" + }, + "description": "Sample for StopGroupAsyncReplication", + "file": "compute_v1_generated_region_disks_stop_group_async_replication_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "compute_v1_generated_RegionDisks_StopGroupAsyncReplication_sync", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 46, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 49, + "start": 47, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "compute_v1_generated_region_disks_stop_group_async_replication_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.compute_v1.RegionDisksClient", + "shortName": "RegionDisksClient" + }, + "fullName": "google.cloud.compute_v1.RegionDisksClient.test_iam_permissions", + "method": { + "fullName": "google.cloud.compute.v1.RegionDisks.TestIamPermissions", + "service": { + "fullName": "google.cloud.compute.v1.RegionDisks", + "shortName": "RegionDisks" + }, + "shortName": "TestIamPermissions" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.compute_v1.types.TestIamPermissionsRegionDiskRequest" }, { "name": "project", @@ -39485,8 +41729,8 @@ "type": "str" }, { - "name": "region_set_policy_request_resource", - "type": "google.cloud.compute_v1.types.RegionSetPolicyRequest" + "name": "test_permissions_request_resource", + "type": "google.cloud.compute_v1.types.TestPermissionsRequest" }, { "name": "retry", @@ -39501,14 +41745,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.Policy", - "shortName": "set_iam_policy" + "resultType": "google.cloud.compute_v1.types.TestPermissionsResponse", + "shortName": "test_iam_permissions" }, - "description": "Sample for SetIamPolicy", - "file": "compute_v1_generated_region_disks_set_iam_policy_sync.py", + "description": "Sample for TestIamPermissions", + "file": "compute_v1_generated_region_disks_test_iam_permissions_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionDisks_SetIamPolicy_sync", + "regionTag": "compute_v1_generated_RegionDisks_TestIamPermissions_sync", "segments": [ { "end": 53, @@ -39541,7 +41785,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_disks_set_iam_policy_sync.py" + "title": "compute_v1_generated_region_disks_test_iam_permissions_sync.py" }, { "canonical": true, @@ -39550,19 +41794,19 @@ "fullName": "google.cloud.compute_v1.RegionDisksClient", "shortName": "RegionDisksClient" }, - "fullName": "google.cloud.compute_v1.RegionDisksClient.set_labels", + "fullName": "google.cloud.compute_v1.RegionDisksClient.update", "method": { - "fullName": "google.cloud.compute.v1.RegionDisks.SetLabels", + "fullName": "google.cloud.compute.v1.RegionDisks.Update", "service": { "fullName": "google.cloud.compute.v1.RegionDisks", "shortName": "RegionDisks" }, - "shortName": "SetLabels" + "shortName": "Update" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.SetLabelsRegionDiskRequest" + "type": "google.cloud.compute_v1.types.UpdateRegionDiskRequest" }, { "name": "project", @@ -39573,12 +41817,12 @@ "type": "str" }, { - "name": "resource", + "name": "disk", "type": "str" }, { - "name": "region_set_labels_request_resource", - "type": "google.cloud.compute_v1.types.RegionSetLabelsRequest" + "name": "disk_resource", + "type": "google.cloud.compute_v1.types.Disk" }, { "name": "retry", @@ -39594,13 +41838,13 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "set_labels" + "shortName": "update" }, - "description": "Sample for SetLabels", - "file": "compute_v1_generated_region_disks_set_labels_sync.py", + "description": "Sample for Update", + "file": "compute_v1_generated_region_disks_update_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionDisks_SetLabels_sync", + "regionTag": "compute_v1_generated_RegionDisks_Update_sync", "segments": [ { "end": 53, @@ -39633,28 +41877,28 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_disks_set_labels_sync.py" + "title": "compute_v1_generated_region_disks_update_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionDisksClient", - "shortName": "RegionDisksClient" + "fullName": "google.cloud.compute_v1.RegionHealthCheckServicesClient", + "shortName": "RegionHealthCheckServicesClient" }, - "fullName": "google.cloud.compute_v1.RegionDisksClient.start_async_replication", + "fullName": "google.cloud.compute_v1.RegionHealthCheckServicesClient.delete", "method": { - "fullName": "google.cloud.compute.v1.RegionDisks.StartAsyncReplication", + "fullName": "google.cloud.compute.v1.RegionHealthCheckServices.Delete", "service": { - "fullName": "google.cloud.compute.v1.RegionDisks", - "shortName": "RegionDisks" + "fullName": "google.cloud.compute.v1.RegionHealthCheckServices", + "shortName": "RegionHealthCheckServices" }, - "shortName": "StartAsyncReplication" + "shortName": "Delete" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.StartAsyncReplicationRegionDiskRequest" + "type": "google.cloud.compute_v1.types.DeleteRegionHealthCheckServiceRequest" }, { "name": "project", @@ -39665,13 +41909,9 @@ "type": "str" }, { - "name": "disk", + "name": "health_check_service", "type": "str" }, - { - "name": "region_disks_start_async_replication_request_resource", - "type": "google.cloud.compute_v1.types.RegionDisksStartAsyncReplicationRequest" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -39686,13 +41926,13 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "start_async_replication" + "shortName": "delete" }, - "description": "Sample for StartAsyncReplication", - "file": "compute_v1_generated_region_disks_start_async_replication_sync.py", + "description": "Sample for Delete", + "file": "compute_v1_generated_region_health_check_services_delete_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionDisks_StartAsyncReplication_sync", + "regionTag": "compute_v1_generated_RegionHealthCheckServices_Delete_sync", "segments": [ { "end": 53, @@ -39725,28 +41965,28 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_disks_start_async_replication_sync.py" + "title": "compute_v1_generated_region_health_check_services_delete_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionDisksClient", - "shortName": "RegionDisksClient" + "fullName": "google.cloud.compute_v1.RegionHealthCheckServicesClient", + "shortName": "RegionHealthCheckServicesClient" }, - "fullName": "google.cloud.compute_v1.RegionDisksClient.stop_async_replication", + "fullName": "google.cloud.compute_v1.RegionHealthCheckServicesClient.get", "method": { - "fullName": "google.cloud.compute.v1.RegionDisks.StopAsyncReplication", + "fullName": "google.cloud.compute.v1.RegionHealthCheckServices.Get", "service": { - "fullName": "google.cloud.compute.v1.RegionDisks", - "shortName": "RegionDisks" + "fullName": "google.cloud.compute.v1.RegionHealthCheckServices", + "shortName": "RegionHealthCheckServices" }, - "shortName": "StopAsyncReplication" + "shortName": "Get" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.StopAsyncReplicationRegionDiskRequest" + "type": "google.cloud.compute_v1.types.GetRegionHealthCheckServiceRequest" }, { "name": "project", @@ -39757,7 +41997,7 @@ "type": "str" }, { - "name": "disk", + "name": "health_check_service", "type": "str" }, { @@ -39773,14 +42013,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "stop_async_replication" + "resultType": "google.cloud.compute_v1.types.HealthCheckService", + "shortName": "get" }, - "description": "Sample for StopAsyncReplication", - "file": "compute_v1_generated_region_disks_stop_async_replication_sync.py", + "description": "Sample for Get", + "file": "compute_v1_generated_region_health_check_services_get_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionDisks_StopAsyncReplication_sync", + "regionTag": "compute_v1_generated_RegionHealthCheckServices_Get_sync", "segments": [ { "end": 53, @@ -39813,28 +42053,28 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_disks_stop_async_replication_sync.py" + "title": "compute_v1_generated_region_health_check_services_get_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionDisksClient", - "shortName": "RegionDisksClient" + "fullName": "google.cloud.compute_v1.RegionHealthCheckServicesClient", + "shortName": "RegionHealthCheckServicesClient" }, - "fullName": "google.cloud.compute_v1.RegionDisksClient.stop_group_async_replication", + "fullName": "google.cloud.compute_v1.RegionHealthCheckServicesClient.insert", "method": { - "fullName": "google.cloud.compute.v1.RegionDisks.StopGroupAsyncReplication", + "fullName": "google.cloud.compute.v1.RegionHealthCheckServices.Insert", "service": { - "fullName": "google.cloud.compute.v1.RegionDisks", - "shortName": "RegionDisks" + "fullName": "google.cloud.compute.v1.RegionHealthCheckServices", + "shortName": "RegionHealthCheckServices" }, - "shortName": "StopGroupAsyncReplication" + "shortName": "Insert" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.StopGroupAsyncReplicationRegionDiskRequest" + "type": "google.cloud.compute_v1.types.InsertRegionHealthCheckServiceRequest" }, { "name": "project", @@ -39845,8 +42085,8 @@ "type": "str" }, { - "name": "disks_stop_group_async_replication_resource_resource", - "type": "google.cloud.compute_v1.types.DisksStopGroupAsyncReplicationResource" + "name": "health_check_service_resource", + "type": "google.cloud.compute_v1.types.HealthCheckService" }, { "name": "retry", @@ -39862,13 +42102,13 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "stop_group_async_replication" + "shortName": "insert" }, - "description": "Sample for StopGroupAsyncReplication", - "file": "compute_v1_generated_region_disks_stop_group_async_replication_sync.py", + "description": "Sample for Insert", + "file": "compute_v1_generated_region_health_check_services_insert_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionDisks_StopGroupAsyncReplication_sync", + "regionTag": "compute_v1_generated_RegionHealthCheckServices_Insert_sync", "segments": [ { "end": 52, @@ -39901,28 +42141,28 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_disks_stop_group_async_replication_sync.py" + "title": "compute_v1_generated_region_health_check_services_insert_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionDisksClient", - "shortName": "RegionDisksClient" + "fullName": "google.cloud.compute_v1.RegionHealthCheckServicesClient", + "shortName": "RegionHealthCheckServicesClient" }, - "fullName": "google.cloud.compute_v1.RegionDisksClient.test_iam_permissions", + "fullName": "google.cloud.compute_v1.RegionHealthCheckServicesClient.list", "method": { - "fullName": "google.cloud.compute.v1.RegionDisks.TestIamPermissions", + "fullName": "google.cloud.compute.v1.RegionHealthCheckServices.List", "service": { - "fullName": "google.cloud.compute.v1.RegionDisks", - "shortName": "RegionDisks" + "fullName": "google.cloud.compute.v1.RegionHealthCheckServices", + "shortName": "RegionHealthCheckServices" }, - "shortName": "TestIamPermissions" + "shortName": "List" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.TestIamPermissionsRegionDiskRequest" + "type": "google.cloud.compute_v1.types.ListRegionHealthCheckServicesRequest" }, { "name": "project", @@ -39932,14 +42172,6 @@ "name": "region", "type": "str" }, - { - "name": "resource", - "type": "str" - }, - { - "name": "test_permissions_request_resource", - "type": "google.cloud.compute_v1.types.TestPermissionsRequest" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -39953,14 +42185,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.TestPermissionsResponse", - "shortName": "test_iam_permissions" + "resultType": "google.cloud.compute_v1.services.region_health_check_services.pagers.ListPager", + "shortName": "list" }, - "description": "Sample for TestIamPermissions", - "file": "compute_v1_generated_region_disks_test_iam_permissions_sync.py", + "description": "Sample for List", + "file": "compute_v1_generated_region_health_check_services_list_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionDisks_TestIamPermissions_sync", + "regionTag": "compute_v1_generated_RegionHealthCheckServices_List_sync", "segments": [ { "end": 53, @@ -39978,43 +42210,43 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 47, + "end": 46, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 50, - "start": 48, + "end": 49, + "start": 47, "type": "REQUEST_EXECUTION" }, { "end": 54, - "start": 51, + "start": 50, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_disks_test_iam_permissions_sync.py" + "title": "compute_v1_generated_region_health_check_services_list_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionDisksClient", - "shortName": "RegionDisksClient" + "fullName": "google.cloud.compute_v1.RegionHealthCheckServicesClient", + "shortName": "RegionHealthCheckServicesClient" }, - "fullName": "google.cloud.compute_v1.RegionDisksClient.update", + "fullName": "google.cloud.compute_v1.RegionHealthCheckServicesClient.patch", "method": { - "fullName": "google.cloud.compute.v1.RegionDisks.Update", + "fullName": "google.cloud.compute.v1.RegionHealthCheckServices.Patch", "service": { - "fullName": "google.cloud.compute.v1.RegionDisks", - "shortName": "RegionDisks" + "fullName": "google.cloud.compute.v1.RegionHealthCheckServices", + "shortName": "RegionHealthCheckServices" }, - "shortName": "Update" + "shortName": "Patch" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.UpdateRegionDiskRequest" + "type": "google.cloud.compute_v1.types.PatchRegionHealthCheckServiceRequest" }, { "name": "project", @@ -40025,12 +42257,12 @@ "type": "str" }, { - "name": "disk", + "name": "health_check_service", "type": "str" }, { - "name": "disk_resource", - "type": "google.cloud.compute_v1.types.Disk" + "name": "health_check_service_resource", + "type": "google.cloud.compute_v1.types.HealthCheckService" }, { "name": "retry", @@ -40046,13 +42278,13 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "update" + "shortName": "patch" }, - "description": "Sample for Update", - "file": "compute_v1_generated_region_disks_update_sync.py", + "description": "Sample for Patch", + "file": "compute_v1_generated_region_health_check_services_patch_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionDisks_Update_sync", + "regionTag": "compute_v1_generated_RegionHealthCheckServices_Patch_sync", "segments": [ { "end": 53, @@ -40085,28 +42317,28 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_disks_update_sync.py" + "title": "compute_v1_generated_region_health_check_services_patch_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionHealthCheckServicesClient", - "shortName": "RegionHealthCheckServicesClient" + "fullName": "google.cloud.compute_v1.RegionHealthChecksClient", + "shortName": "RegionHealthChecksClient" }, - "fullName": "google.cloud.compute_v1.RegionHealthCheckServicesClient.delete", + "fullName": "google.cloud.compute_v1.RegionHealthChecksClient.delete", "method": { - "fullName": "google.cloud.compute.v1.RegionHealthCheckServices.Delete", + "fullName": "google.cloud.compute.v1.RegionHealthChecks.Delete", "service": { - "fullName": "google.cloud.compute.v1.RegionHealthCheckServices", - "shortName": "RegionHealthCheckServices" + "fullName": "google.cloud.compute.v1.RegionHealthChecks", + "shortName": "RegionHealthChecks" }, "shortName": "Delete" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.DeleteRegionHealthCheckServiceRequest" + "type": "google.cloud.compute_v1.types.DeleteRegionHealthCheckRequest" }, { "name": "project", @@ -40117,7 +42349,7 @@ "type": "str" }, { - "name": "health_check_service", + "name": "health_check", "type": "str" }, { @@ -40137,10 +42369,10 @@ "shortName": "delete" }, "description": "Sample for Delete", - "file": "compute_v1_generated_region_health_check_services_delete_sync.py", + "file": "compute_v1_generated_region_health_checks_delete_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionHealthCheckServices_Delete_sync", + "regionTag": "compute_v1_generated_RegionHealthChecks_Delete_sync", "segments": [ { "end": 53, @@ -40173,28 +42405,28 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_health_check_services_delete_sync.py" + "title": "compute_v1_generated_region_health_checks_delete_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionHealthCheckServicesClient", - "shortName": "RegionHealthCheckServicesClient" + "fullName": "google.cloud.compute_v1.RegionHealthChecksClient", + "shortName": "RegionHealthChecksClient" }, - "fullName": "google.cloud.compute_v1.RegionHealthCheckServicesClient.get", + "fullName": "google.cloud.compute_v1.RegionHealthChecksClient.get", "method": { - "fullName": "google.cloud.compute.v1.RegionHealthCheckServices.Get", + "fullName": "google.cloud.compute.v1.RegionHealthChecks.Get", "service": { - "fullName": "google.cloud.compute.v1.RegionHealthCheckServices", - "shortName": "RegionHealthCheckServices" + "fullName": "google.cloud.compute.v1.RegionHealthChecks", + "shortName": "RegionHealthChecks" }, "shortName": "Get" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetRegionHealthCheckServiceRequest" + "type": "google.cloud.compute_v1.types.GetRegionHealthCheckRequest" }, { "name": "project", @@ -40205,7 +42437,7 @@ "type": "str" }, { - "name": "health_check_service", + "name": "health_check", "type": "str" }, { @@ -40221,14 +42453,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.HealthCheckService", + "resultType": "google.cloud.compute_v1.types.HealthCheck", "shortName": "get" }, "description": "Sample for Get", - "file": "compute_v1_generated_region_health_check_services_get_sync.py", + "file": "compute_v1_generated_region_health_checks_get_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionHealthCheckServices_Get_sync", + "regionTag": "compute_v1_generated_RegionHealthChecks_Get_sync", "segments": [ { "end": 53, @@ -40261,28 +42493,28 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_health_check_services_get_sync.py" + "title": "compute_v1_generated_region_health_checks_get_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionHealthCheckServicesClient", - "shortName": "RegionHealthCheckServicesClient" + "fullName": "google.cloud.compute_v1.RegionHealthChecksClient", + "shortName": "RegionHealthChecksClient" }, - "fullName": "google.cloud.compute_v1.RegionHealthCheckServicesClient.insert", + "fullName": "google.cloud.compute_v1.RegionHealthChecksClient.insert", "method": { - "fullName": "google.cloud.compute.v1.RegionHealthCheckServices.Insert", + "fullName": "google.cloud.compute.v1.RegionHealthChecks.Insert", "service": { - "fullName": "google.cloud.compute.v1.RegionHealthCheckServices", - "shortName": "RegionHealthCheckServices" + "fullName": "google.cloud.compute.v1.RegionHealthChecks", + "shortName": "RegionHealthChecks" }, "shortName": "Insert" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.InsertRegionHealthCheckServiceRequest" + "type": "google.cloud.compute_v1.types.InsertRegionHealthCheckRequest" }, { "name": "project", @@ -40293,8 +42525,8 @@ "type": "str" }, { - "name": "health_check_service_resource", - "type": "google.cloud.compute_v1.types.HealthCheckService" + "name": "health_check_resource", + "type": "google.cloud.compute_v1.types.HealthCheck" }, { "name": "retry", @@ -40313,10 +42545,10 @@ "shortName": "insert" }, "description": "Sample for Insert", - "file": "compute_v1_generated_region_health_check_services_insert_sync.py", + "file": "compute_v1_generated_region_health_checks_insert_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionHealthCheckServices_Insert_sync", + "regionTag": "compute_v1_generated_RegionHealthChecks_Insert_sync", "segments": [ { "end": 52, @@ -40349,28 +42581,28 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_health_check_services_insert_sync.py" + "title": "compute_v1_generated_region_health_checks_insert_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionHealthCheckServicesClient", - "shortName": "RegionHealthCheckServicesClient" + "fullName": "google.cloud.compute_v1.RegionHealthChecksClient", + "shortName": "RegionHealthChecksClient" }, - "fullName": "google.cloud.compute_v1.RegionHealthCheckServicesClient.list", + "fullName": "google.cloud.compute_v1.RegionHealthChecksClient.list", "method": { - "fullName": "google.cloud.compute.v1.RegionHealthCheckServices.List", + "fullName": "google.cloud.compute.v1.RegionHealthChecks.List", "service": { - "fullName": "google.cloud.compute.v1.RegionHealthCheckServices", - "shortName": "RegionHealthCheckServices" + "fullName": "google.cloud.compute.v1.RegionHealthChecks", + "shortName": "RegionHealthChecks" }, "shortName": "List" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.ListRegionHealthCheckServicesRequest" + "type": "google.cloud.compute_v1.types.ListRegionHealthChecksRequest" }, { "name": "project", @@ -40393,14 +42625,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.services.region_health_check_services.pagers.ListPager", + "resultType": "google.cloud.compute_v1.services.region_health_checks.pagers.ListPager", "shortName": "list" }, "description": "Sample for List", - "file": "compute_v1_generated_region_health_check_services_list_sync.py", + "file": "compute_v1_generated_region_health_checks_list_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionHealthCheckServices_List_sync", + "regionTag": "compute_v1_generated_RegionHealthChecks_List_sync", "segments": [ { "end": 53, @@ -40433,28 +42665,28 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_health_check_services_list_sync.py" + "title": "compute_v1_generated_region_health_checks_list_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionHealthCheckServicesClient", - "shortName": "RegionHealthCheckServicesClient" + "fullName": "google.cloud.compute_v1.RegionHealthChecksClient", + "shortName": "RegionHealthChecksClient" }, - "fullName": "google.cloud.compute_v1.RegionHealthCheckServicesClient.patch", + "fullName": "google.cloud.compute_v1.RegionHealthChecksClient.patch", "method": { - "fullName": "google.cloud.compute.v1.RegionHealthCheckServices.Patch", + "fullName": "google.cloud.compute.v1.RegionHealthChecks.Patch", "service": { - "fullName": "google.cloud.compute.v1.RegionHealthCheckServices", - "shortName": "RegionHealthCheckServices" + "fullName": "google.cloud.compute.v1.RegionHealthChecks", + "shortName": "RegionHealthChecks" }, "shortName": "Patch" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.PatchRegionHealthCheckServiceRequest" + "type": "google.cloud.compute_v1.types.PatchRegionHealthCheckRequest" }, { "name": "project", @@ -40465,12 +42697,12 @@ "type": "str" }, { - "name": "health_check_service", + "name": "health_check", "type": "str" }, { - "name": "health_check_service_resource", - "type": "google.cloud.compute_v1.types.HealthCheckService" + "name": "health_check_resource", + "type": "google.cloud.compute_v1.types.HealthCheck" }, { "name": "retry", @@ -40489,10 +42721,10 @@ "shortName": "patch" }, "description": "Sample for Patch", - "file": "compute_v1_generated_region_health_check_services_patch_sync.py", + "file": "compute_v1_generated_region_health_checks_patch_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionHealthCheckServices_Patch_sync", + "regionTag": "compute_v1_generated_RegionHealthChecks_Patch_sync", "segments": [ { "end": 53, @@ -40525,7 +42757,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_health_check_services_patch_sync.py" + "title": "compute_v1_generated_region_health_checks_patch_sync.py" }, { "canonical": true, @@ -40534,19 +42766,19 @@ "fullName": "google.cloud.compute_v1.RegionHealthChecksClient", "shortName": "RegionHealthChecksClient" }, - "fullName": "google.cloud.compute_v1.RegionHealthChecksClient.delete", + "fullName": "google.cloud.compute_v1.RegionHealthChecksClient.update", "method": { - "fullName": "google.cloud.compute.v1.RegionHealthChecks.Delete", + "fullName": "google.cloud.compute.v1.RegionHealthChecks.Update", "service": { "fullName": "google.cloud.compute.v1.RegionHealthChecks", "shortName": "RegionHealthChecks" }, - "shortName": "Delete" + "shortName": "Update" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.DeleteRegionHealthCheckRequest" + "type": "google.cloud.compute_v1.types.UpdateRegionHealthCheckRequest" }, { "name": "project", @@ -40560,6 +42792,10 @@ "name": "health_check", "type": "str" }, + { + "name": "health_check_resource", + "type": "google.cloud.compute_v1.types.HealthCheck" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -40574,13 +42810,13 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "delete" + "shortName": "update" }, - "description": "Sample for Delete", - "file": "compute_v1_generated_region_health_checks_delete_sync.py", + "description": "Sample for Update", + "file": "compute_v1_generated_region_health_checks_update_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionHealthChecks_Delete_sync", + "regionTag": "compute_v1_generated_RegionHealthChecks_Update_sync", "segments": [ { "end": 53, @@ -40613,28 +42849,28 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_health_checks_delete_sync.py" + "title": "compute_v1_generated_region_health_checks_update_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionHealthChecksClient", - "shortName": "RegionHealthChecksClient" + "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient", + "shortName": "RegionInstanceGroupManagersClient" }, - "fullName": "google.cloud.compute_v1.RegionHealthChecksClient.get", + "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient.abandon_instances", "method": { - "fullName": "google.cloud.compute.v1.RegionHealthChecks.Get", + "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers.AbandonInstances", "service": { - "fullName": "google.cloud.compute.v1.RegionHealthChecks", - "shortName": "RegionHealthChecks" + "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers", + "shortName": "RegionInstanceGroupManagers" }, - "shortName": "Get" + "shortName": "AbandonInstances" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetRegionHealthCheckRequest" + "type": "google.cloud.compute_v1.types.AbandonInstancesRegionInstanceGroupManagerRequest" }, { "name": "project", @@ -40645,9 +42881,13 @@ "type": "str" }, { - "name": "health_check", + "name": "instance_group_manager", "type": "str" }, + { + "name": "region_instance_group_managers_abandon_instances_request_resource", + "type": "google.cloud.compute_v1.types.RegionInstanceGroupManagersAbandonInstancesRequest" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -40661,14 +42901,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.HealthCheck", - "shortName": "get" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "abandon_instances" }, - "description": "Sample for Get", - "file": "compute_v1_generated_region_health_checks_get_sync.py", + "description": "Sample for AbandonInstances", + "file": "compute_v1_generated_region_instance_group_managers_abandon_instances_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionHealthChecks_Get_sync", + "regionTag": "compute_v1_generated_RegionInstanceGroupManagers_AbandonInstances_sync", "segments": [ { "end": 53, @@ -40701,28 +42941,28 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_health_checks_get_sync.py" + "title": "compute_v1_generated_region_instance_group_managers_abandon_instances_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionHealthChecksClient", - "shortName": "RegionHealthChecksClient" + "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient", + "shortName": "RegionInstanceGroupManagersClient" }, - "fullName": "google.cloud.compute_v1.RegionHealthChecksClient.insert", + "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient.apply_updates_to_instances", "method": { - "fullName": "google.cloud.compute.v1.RegionHealthChecks.Insert", + "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers.ApplyUpdatesToInstances", "service": { - "fullName": "google.cloud.compute.v1.RegionHealthChecks", - "shortName": "RegionHealthChecks" + "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers", + "shortName": "RegionInstanceGroupManagers" }, - "shortName": "Insert" + "shortName": "ApplyUpdatesToInstances" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.InsertRegionHealthCheckRequest" + "type": "google.cloud.compute_v1.types.ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest" }, { "name": "project", @@ -40733,8 +42973,12 @@ "type": "str" }, { - "name": "health_check_resource", - "type": "google.cloud.compute_v1.types.HealthCheck" + "name": "instance_group_manager", + "type": "str" + }, + { + "name": "region_instance_group_managers_apply_updates_request_resource", + "type": "google.cloud.compute_v1.types.RegionInstanceGroupManagersApplyUpdatesRequest" }, { "name": "retry", @@ -40750,21 +42994,21 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "insert" + "shortName": "apply_updates_to_instances" }, - "description": "Sample for Insert", - "file": "compute_v1_generated_region_health_checks_insert_sync.py", + "description": "Sample for ApplyUpdatesToInstances", + "file": "compute_v1_generated_region_instance_group_managers_apply_updates_to_instances_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionHealthChecks_Insert_sync", + "regionTag": "compute_v1_generated_RegionInstanceGroupManagers_ApplyUpdatesToInstances_sync", "segments": [ { - "end": 52, + "end": 53, "start": 27, "type": "FULL" }, { - "end": 52, + "end": 53, "start": 27, "type": "SHORT" }, @@ -40774,43 +43018,43 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 46, + "end": 47, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 49, - "start": 47, + "end": 50, + "start": 48, "type": "REQUEST_EXECUTION" }, { - "end": 53, - "start": 50, + "end": 54, + "start": 51, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_health_checks_insert_sync.py" + "title": "compute_v1_generated_region_instance_group_managers_apply_updates_to_instances_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionHealthChecksClient", - "shortName": "RegionHealthChecksClient" + "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient", + "shortName": "RegionInstanceGroupManagersClient" }, - "fullName": "google.cloud.compute_v1.RegionHealthChecksClient.list", + "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient.create_instances", "method": { - "fullName": "google.cloud.compute.v1.RegionHealthChecks.List", + "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers.CreateInstances", "service": { - "fullName": "google.cloud.compute.v1.RegionHealthChecks", - "shortName": "RegionHealthChecks" + "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers", + "shortName": "RegionInstanceGroupManagers" }, - "shortName": "List" + "shortName": "CreateInstances" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.ListRegionHealthChecksRequest" + "type": "google.cloud.compute_v1.types.CreateInstancesRegionInstanceGroupManagerRequest" }, { "name": "project", @@ -40820,6 +43064,14 @@ "name": "region", "type": "str" }, + { + "name": "instance_group_manager", + "type": "str" + }, + { + "name": "region_instance_group_managers_create_instances_request_resource", + "type": "google.cloud.compute_v1.types.RegionInstanceGroupManagersCreateInstancesRequest" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -40833,14 +43085,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.services.region_health_checks.pagers.ListPager", - "shortName": "list" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "create_instances" }, - "description": "Sample for List", - "file": "compute_v1_generated_region_health_checks_list_sync.py", + "description": "Sample for CreateInstances", + "file": "compute_v1_generated_region_instance_group_managers_create_instances_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionHealthChecks_List_sync", + "regionTag": "compute_v1_generated_RegionInstanceGroupManagers_CreateInstances_sync", "segments": [ { "end": 53, @@ -40858,43 +43110,43 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 46, + "end": 47, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 49, - "start": 47, + "end": 50, + "start": 48, "type": "REQUEST_EXECUTION" }, { "end": 54, - "start": 50, + "start": 51, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_health_checks_list_sync.py" + "title": "compute_v1_generated_region_instance_group_managers_create_instances_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionHealthChecksClient", - "shortName": "RegionHealthChecksClient" + "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient", + "shortName": "RegionInstanceGroupManagersClient" }, - "fullName": "google.cloud.compute_v1.RegionHealthChecksClient.patch", + "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient.delete_instances", "method": { - "fullName": "google.cloud.compute.v1.RegionHealthChecks.Patch", + "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers.DeleteInstances", "service": { - "fullName": "google.cloud.compute.v1.RegionHealthChecks", - "shortName": "RegionHealthChecks" + "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers", + "shortName": "RegionInstanceGroupManagers" }, - "shortName": "Patch" + "shortName": "DeleteInstances" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.PatchRegionHealthCheckRequest" + "type": "google.cloud.compute_v1.types.DeleteInstancesRegionInstanceGroupManagerRequest" }, { "name": "project", @@ -40905,12 +43157,12 @@ "type": "str" }, { - "name": "health_check", + "name": "instance_group_manager", "type": "str" }, { - "name": "health_check_resource", - "type": "google.cloud.compute_v1.types.HealthCheck" + "name": "region_instance_group_managers_delete_instances_request_resource", + "type": "google.cloud.compute_v1.types.RegionInstanceGroupManagersDeleteInstancesRequest" }, { "name": "retry", @@ -40926,13 +43178,13 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "patch" + "shortName": "delete_instances" }, - "description": "Sample for Patch", - "file": "compute_v1_generated_region_health_checks_patch_sync.py", + "description": "Sample for DeleteInstances", + "file": "compute_v1_generated_region_instance_group_managers_delete_instances_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionHealthChecks_Patch_sync", + "regionTag": "compute_v1_generated_RegionInstanceGroupManagers_DeleteInstances_sync", "segments": [ { "end": 53, @@ -40965,28 +43217,28 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_health_checks_patch_sync.py" + "title": "compute_v1_generated_region_instance_group_managers_delete_instances_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionHealthChecksClient", - "shortName": "RegionHealthChecksClient" + "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient", + "shortName": "RegionInstanceGroupManagersClient" }, - "fullName": "google.cloud.compute_v1.RegionHealthChecksClient.update", + "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient.delete_per_instance_configs", "method": { - "fullName": "google.cloud.compute.v1.RegionHealthChecks.Update", + "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers.DeletePerInstanceConfigs", "service": { - "fullName": "google.cloud.compute.v1.RegionHealthChecks", - "shortName": "RegionHealthChecks" + "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers", + "shortName": "RegionInstanceGroupManagers" }, - "shortName": "Update" + "shortName": "DeletePerInstanceConfigs" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.UpdateRegionHealthCheckRequest" + "type": "google.cloud.compute_v1.types.DeletePerInstanceConfigsRegionInstanceGroupManagerRequest" }, { "name": "project", @@ -40997,12 +43249,12 @@ "type": "str" }, { - "name": "health_check", + "name": "instance_group_manager", "type": "str" }, { - "name": "health_check_resource", - "type": "google.cloud.compute_v1.types.HealthCheck" + "name": "region_instance_group_manager_delete_instance_config_req_resource", + "type": "google.cloud.compute_v1.types.RegionInstanceGroupManagerDeleteInstanceConfigReq" }, { "name": "retry", @@ -41018,13 +43270,13 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "update" + "shortName": "delete_per_instance_configs" }, - "description": "Sample for Update", - "file": "compute_v1_generated_region_health_checks_update_sync.py", + "description": "Sample for DeletePerInstanceConfigs", + "file": "compute_v1_generated_region_instance_group_managers_delete_per_instance_configs_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionHealthChecks_Update_sync", + "regionTag": "compute_v1_generated_RegionInstanceGroupManagers_DeletePerInstanceConfigs_sync", "segments": [ { "end": 53, @@ -41057,7 +43309,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_health_checks_update_sync.py" + "title": "compute_v1_generated_region_instance_group_managers_delete_per_instance_configs_sync.py" }, { "canonical": true, @@ -41066,19 +43318,19 @@ "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient", "shortName": "RegionInstanceGroupManagersClient" }, - "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient.abandon_instances", + "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient.delete", "method": { - "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers.AbandonInstances", + "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers.Delete", "service": { "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers", "shortName": "RegionInstanceGroupManagers" }, - "shortName": "AbandonInstances" + "shortName": "Delete" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.AbandonInstancesRegionInstanceGroupManagerRequest" + "type": "google.cloud.compute_v1.types.DeleteRegionInstanceGroupManagerRequest" }, { "name": "project", @@ -41092,10 +43344,6 @@ "name": "instance_group_manager", "type": "str" }, - { - "name": "region_instance_group_managers_abandon_instances_request_resource", - "type": "google.cloud.compute_v1.types.RegionInstanceGroupManagersAbandonInstancesRequest" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -41110,13 +43358,13 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "abandon_instances" + "shortName": "delete" }, - "description": "Sample for AbandonInstances", - "file": "compute_v1_generated_region_instance_group_managers_abandon_instances_sync.py", + "description": "Sample for Delete", + "file": "compute_v1_generated_region_instance_group_managers_delete_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionInstanceGroupManagers_AbandonInstances_sync", + "regionTag": "compute_v1_generated_RegionInstanceGroupManagers_Delete_sync", "segments": [ { "end": 53, @@ -41149,7 +43397,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_instance_group_managers_abandon_instances_sync.py" + "title": "compute_v1_generated_region_instance_group_managers_delete_sync.py" }, { "canonical": true, @@ -41158,19 +43406,19 @@ "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient", "shortName": "RegionInstanceGroupManagersClient" }, - "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient.apply_updates_to_instances", + "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient.get", "method": { - "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers.ApplyUpdatesToInstances", + "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers.Get", "service": { "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers", "shortName": "RegionInstanceGroupManagers" }, - "shortName": "ApplyUpdatesToInstances" + "shortName": "Get" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest" + "type": "google.cloud.compute_v1.types.GetRegionInstanceGroupManagerRequest" }, { "name": "project", @@ -41184,10 +43432,6 @@ "name": "instance_group_manager", "type": "str" }, - { - "name": "region_instance_group_managers_apply_updates_request_resource", - "type": "google.cloud.compute_v1.types.RegionInstanceGroupManagersApplyUpdatesRequest" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -41201,14 +43445,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "apply_updates_to_instances" + "resultType": "google.cloud.compute_v1.types.InstanceGroupManager", + "shortName": "get" }, - "description": "Sample for ApplyUpdatesToInstances", - "file": "compute_v1_generated_region_instance_group_managers_apply_updates_to_instances_sync.py", + "description": "Sample for Get", + "file": "compute_v1_generated_region_instance_group_managers_get_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionInstanceGroupManagers_ApplyUpdatesToInstances_sync", + "regionTag": "compute_v1_generated_RegionInstanceGroupManagers_Get_sync", "segments": [ { "end": 53, @@ -41241,7 +43485,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_instance_group_managers_apply_updates_to_instances_sync.py" + "title": "compute_v1_generated_region_instance_group_managers_get_sync.py" }, { "canonical": true, @@ -41250,19 +43494,19 @@ "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient", "shortName": "RegionInstanceGroupManagersClient" }, - "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient.create_instances", + "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient.insert", "method": { - "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers.CreateInstances", + "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers.Insert", "service": { "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers", "shortName": "RegionInstanceGroupManagers" }, - "shortName": "CreateInstances" + "shortName": "Insert" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.CreateInstancesRegionInstanceGroupManagerRequest" + "type": "google.cloud.compute_v1.types.InsertRegionInstanceGroupManagerRequest" }, { "name": "project", @@ -41273,12 +43517,96 @@ "type": "str" }, { - "name": "instance_group_manager", + "name": "instance_group_manager_resource", + "type": "google.cloud.compute_v1.types.InstanceGroupManager" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "insert" + }, + "description": "Sample for Insert", + "file": "compute_v1_generated_region_instance_group_managers_insert_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "compute_v1_generated_RegionInstanceGroupManagers_Insert_sync", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 46, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 49, + "start": 47, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "compute_v1_generated_region_instance_group_managers_insert_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient", + "shortName": "RegionInstanceGroupManagersClient" + }, + "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient.list_errors", + "method": { + "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers.ListErrors", + "service": { + "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers", + "shortName": "RegionInstanceGroupManagers" + }, + "shortName": "ListErrors" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.compute_v1.types.ListErrorsRegionInstanceGroupManagersRequest" + }, + { + "name": "project", "type": "str" }, { - "name": "region_instance_group_managers_create_instances_request_resource", - "type": "google.cloud.compute_v1.types.RegionInstanceGroupManagersCreateInstancesRequest" + "name": "region", + "type": "str" + }, + { + "name": "instance_group_manager", + "type": "str" }, { "name": "retry", @@ -41293,22 +43621,22 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "create_instances" + "resultType": "google.cloud.compute_v1.services.region_instance_group_managers.pagers.ListErrorsPager", + "shortName": "list_errors" }, - "description": "Sample for CreateInstances", - "file": "compute_v1_generated_region_instance_group_managers_create_instances_sync.py", + "description": "Sample for ListErrors", + "file": "compute_v1_generated_region_instance_group_managers_list_errors_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionInstanceGroupManagers_CreateInstances_sync", + "regionTag": "compute_v1_generated_RegionInstanceGroupManagers_ListErrors_sync", "segments": [ { - "end": 53, + "end": 54, "start": 27, "type": "FULL" }, { - "end": 53, + "end": 54, "start": 27, "type": "SHORT" }, @@ -41328,12 +43656,12 @@ "type": "REQUEST_EXECUTION" }, { - "end": 54, + "end": 55, "start": 51, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_instance_group_managers_create_instances_sync.py" + "title": "compute_v1_generated_region_instance_group_managers_list_errors_sync.py" }, { "canonical": true, @@ -41342,19 +43670,19 @@ "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient", "shortName": "RegionInstanceGroupManagersClient" }, - "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient.delete_instances", + "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient.list_managed_instances", "method": { - "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers.DeleteInstances", + "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers.ListManagedInstances", "service": { "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers", "shortName": "RegionInstanceGroupManagers" }, - "shortName": "DeleteInstances" + "shortName": "ListManagedInstances" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.DeleteInstancesRegionInstanceGroupManagerRequest" + "type": "google.cloud.compute_v1.types.ListManagedInstancesRegionInstanceGroupManagersRequest" }, { "name": "project", @@ -41368,10 +43696,6 @@ "name": "instance_group_manager", "type": "str" }, - { - "name": "region_instance_group_managers_delete_instances_request_resource", - "type": "google.cloud.compute_v1.types.RegionInstanceGroupManagersDeleteInstancesRequest" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -41385,22 +43709,22 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "delete_instances" + "resultType": "google.cloud.compute_v1.services.region_instance_group_managers.pagers.ListManagedInstancesPager", + "shortName": "list_managed_instances" }, - "description": "Sample for DeleteInstances", - "file": "compute_v1_generated_region_instance_group_managers_delete_instances_sync.py", + "description": "Sample for ListManagedInstances", + "file": "compute_v1_generated_region_instance_group_managers_list_managed_instances_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionInstanceGroupManagers_DeleteInstances_sync", + "regionTag": "compute_v1_generated_RegionInstanceGroupManagers_ListManagedInstances_sync", "segments": [ { - "end": 53, + "end": 54, "start": 27, "type": "FULL" }, { - "end": 53, + "end": 54, "start": 27, "type": "SHORT" }, @@ -41420,12 +43744,12 @@ "type": "REQUEST_EXECUTION" }, { - "end": 54, + "end": 55, "start": 51, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_instance_group_managers_delete_instances_sync.py" + "title": "compute_v1_generated_region_instance_group_managers_list_managed_instances_sync.py" }, { "canonical": true, @@ -41434,19 +43758,19 @@ "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient", "shortName": "RegionInstanceGroupManagersClient" }, - "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient.delete_per_instance_configs", + "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient.list_per_instance_configs", "method": { - "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers.DeletePerInstanceConfigs", + "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers.ListPerInstanceConfigs", "service": { "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers", "shortName": "RegionInstanceGroupManagers" }, - "shortName": "DeletePerInstanceConfigs" + "shortName": "ListPerInstanceConfigs" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.DeletePerInstanceConfigsRegionInstanceGroupManagerRequest" + "type": "google.cloud.compute_v1.types.ListPerInstanceConfigsRegionInstanceGroupManagersRequest" }, { "name": "project", @@ -41460,10 +43784,6 @@ "name": "instance_group_manager", "type": "str" }, - { - "name": "region_instance_group_manager_delete_instance_config_req_resource", - "type": "google.cloud.compute_v1.types.RegionInstanceGroupManagerDeleteInstanceConfigReq" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -41477,22 +43797,22 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "delete_per_instance_configs" + "resultType": "google.cloud.compute_v1.services.region_instance_group_managers.pagers.ListPerInstanceConfigsPager", + "shortName": "list_per_instance_configs" }, - "description": "Sample for DeletePerInstanceConfigs", - "file": "compute_v1_generated_region_instance_group_managers_delete_per_instance_configs_sync.py", + "description": "Sample for ListPerInstanceConfigs", + "file": "compute_v1_generated_region_instance_group_managers_list_per_instance_configs_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionInstanceGroupManagers_DeletePerInstanceConfigs_sync", + "regionTag": "compute_v1_generated_RegionInstanceGroupManagers_ListPerInstanceConfigs_sync", "segments": [ { - "end": 53, + "end": 54, "start": 27, "type": "FULL" }, { - "end": 53, + "end": 54, "start": 27, "type": "SHORT" }, @@ -41512,12 +43832,12 @@ "type": "REQUEST_EXECUTION" }, { - "end": 54, + "end": 55, "start": 51, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_instance_group_managers_delete_per_instance_configs_sync.py" + "title": "compute_v1_generated_region_instance_group_managers_list_per_instance_configs_sync.py" }, { "canonical": true, @@ -41526,19 +43846,19 @@ "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient", "shortName": "RegionInstanceGroupManagersClient" }, - "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient.delete", + "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient.list", "method": { - "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers.Delete", + "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers.List", "service": { "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers", "shortName": "RegionInstanceGroupManagers" }, - "shortName": "Delete" + "shortName": "List" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.DeleteRegionInstanceGroupManagerRequest" + "type": "google.cloud.compute_v1.types.ListRegionInstanceGroupManagersRequest" }, { "name": "project", @@ -41548,10 +43868,6 @@ "name": "region", "type": "str" }, - { - "name": "instance_group_manager", - "type": "str" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -41565,14 +43881,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "delete" + "resultType": "google.cloud.compute_v1.services.region_instance_group_managers.pagers.ListPager", + "shortName": "list" }, - "description": "Sample for Delete", - "file": "compute_v1_generated_region_instance_group_managers_delete_sync.py", + "description": "Sample for List", + "file": "compute_v1_generated_region_instance_group_managers_list_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionInstanceGroupManagers_Delete_sync", + "regionTag": "compute_v1_generated_RegionInstanceGroupManagers_List_sync", "segments": [ { "end": 53, @@ -41590,22 +43906,22 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 47, + "end": 46, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 50, - "start": 48, + "end": 49, + "start": 47, "type": "REQUEST_EXECUTION" }, { "end": 54, - "start": 51, + "start": 50, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_instance_group_managers_delete_sync.py" + "title": "compute_v1_generated_region_instance_group_managers_list_sync.py" }, { "canonical": true, @@ -41614,19 +43930,19 @@ "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient", "shortName": "RegionInstanceGroupManagersClient" }, - "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient.get", + "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient.patch_per_instance_configs", "method": { - "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers.Get", + "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers.PatchPerInstanceConfigs", "service": { "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers", "shortName": "RegionInstanceGroupManagers" }, - "shortName": "Get" + "shortName": "PatchPerInstanceConfigs" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetRegionInstanceGroupManagerRequest" + "type": "google.cloud.compute_v1.types.PatchPerInstanceConfigsRegionInstanceGroupManagerRequest" }, { "name": "project", @@ -41640,6 +43956,10 @@ "name": "instance_group_manager", "type": "str" }, + { + "name": "region_instance_group_manager_patch_instance_config_req_resource", + "type": "google.cloud.compute_v1.types.RegionInstanceGroupManagerPatchInstanceConfigReq" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -41653,14 +43973,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.InstanceGroupManager", - "shortName": "get" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "patch_per_instance_configs" }, - "description": "Sample for Get", - "file": "compute_v1_generated_region_instance_group_managers_get_sync.py", + "description": "Sample for PatchPerInstanceConfigs", + "file": "compute_v1_generated_region_instance_group_managers_patch_per_instance_configs_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionInstanceGroupManagers_Get_sync", + "regionTag": "compute_v1_generated_RegionInstanceGroupManagers_PatchPerInstanceConfigs_sync", "segments": [ { "end": 53, @@ -41693,7 +44013,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_instance_group_managers_get_sync.py" + "title": "compute_v1_generated_region_instance_group_managers_patch_per_instance_configs_sync.py" }, { "canonical": true, @@ -41702,19 +44022,19 @@ "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient", "shortName": "RegionInstanceGroupManagersClient" }, - "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient.insert", + "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient.patch", "method": { - "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers.Insert", + "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers.Patch", "service": { "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers", "shortName": "RegionInstanceGroupManagers" }, - "shortName": "Insert" + "shortName": "Patch" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.InsertRegionInstanceGroupManagerRequest" + "type": "google.cloud.compute_v1.types.PatchRegionInstanceGroupManagerRequest" }, { "name": "project", @@ -41724,6 +44044,10 @@ "name": "region", "type": "str" }, + { + "name": "instance_group_manager", + "type": "str" + }, { "name": "instance_group_manager_resource", "type": "google.cloud.compute_v1.types.InstanceGroupManager" @@ -41742,21 +44066,21 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "insert" + "shortName": "patch" }, - "description": "Sample for Insert", - "file": "compute_v1_generated_region_instance_group_managers_insert_sync.py", + "description": "Sample for Patch", + "file": "compute_v1_generated_region_instance_group_managers_patch_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionInstanceGroupManagers_Insert_sync", + "regionTag": "compute_v1_generated_RegionInstanceGroupManagers_Patch_sync", "segments": [ { - "end": 52, + "end": 53, "start": 27, "type": "FULL" }, { - "end": 52, + "end": 53, "start": 27, "type": "SHORT" }, @@ -41766,22 +44090,22 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 46, + "end": 47, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 49, - "start": 47, + "end": 50, + "start": 48, "type": "REQUEST_EXECUTION" }, { - "end": 53, - "start": 50, + "end": 54, + "start": 51, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_instance_group_managers_insert_sync.py" + "title": "compute_v1_generated_region_instance_group_managers_patch_sync.py" }, { "canonical": true, @@ -41790,19 +44114,19 @@ "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient", "shortName": "RegionInstanceGroupManagersClient" }, - "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient.list_errors", + "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient.recreate_instances", "method": { - "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers.ListErrors", + "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers.RecreateInstances", "service": { "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers", "shortName": "RegionInstanceGroupManagers" }, - "shortName": "ListErrors" + "shortName": "RecreateInstances" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.ListErrorsRegionInstanceGroupManagersRequest" + "type": "google.cloud.compute_v1.types.RecreateInstancesRegionInstanceGroupManagerRequest" }, { "name": "project", @@ -41816,6 +44140,10 @@ "name": "instance_group_manager", "type": "str" }, + { + "name": "region_instance_group_managers_recreate_request_resource", + "type": "google.cloud.compute_v1.types.RegionInstanceGroupManagersRecreateRequest" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -41829,22 +44157,22 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.services.region_instance_group_managers.pagers.ListErrorsPager", - "shortName": "list_errors" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "recreate_instances" }, - "description": "Sample for ListErrors", - "file": "compute_v1_generated_region_instance_group_managers_list_errors_sync.py", + "description": "Sample for RecreateInstances", + "file": "compute_v1_generated_region_instance_group_managers_recreate_instances_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionInstanceGroupManagers_ListErrors_sync", + "regionTag": "compute_v1_generated_RegionInstanceGroupManagers_RecreateInstances_sync", "segments": [ { - "end": 54, + "end": 53, "start": 27, "type": "FULL" }, { - "end": 54, + "end": 53, "start": 27, "type": "SHORT" }, @@ -41864,12 +44192,12 @@ "type": "REQUEST_EXECUTION" }, { - "end": 55, + "end": 54, "start": 51, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_instance_group_managers_list_errors_sync.py" + "title": "compute_v1_generated_region_instance_group_managers_recreate_instances_sync.py" }, { "canonical": true, @@ -41878,19 +44206,19 @@ "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient", "shortName": "RegionInstanceGroupManagersClient" }, - "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient.list_managed_instances", + "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient.resize", "method": { - "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers.ListManagedInstances", + "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers.Resize", "service": { "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers", "shortName": "RegionInstanceGroupManagers" }, - "shortName": "ListManagedInstances" + "shortName": "Resize" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.ListManagedInstancesRegionInstanceGroupManagersRequest" + "type": "google.cloud.compute_v1.types.ResizeRegionInstanceGroupManagerRequest" }, { "name": "project", @@ -41904,6 +44232,10 @@ "name": "instance_group_manager", "type": "str" }, + { + "name": "size", + "type": "int" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -41917,14 +44249,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.services.region_instance_group_managers.pagers.ListManagedInstancesPager", - "shortName": "list_managed_instances" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "resize" }, - "description": "Sample for ListManagedInstances", - "file": "compute_v1_generated_region_instance_group_managers_list_managed_instances_sync.py", + "description": "Sample for Resize", + "file": "compute_v1_generated_region_instance_group_managers_resize_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionInstanceGroupManagers_ListManagedInstances_sync", + "regionTag": "compute_v1_generated_RegionInstanceGroupManagers_Resize_sync", "segments": [ { "end": 54, @@ -41942,22 +44274,22 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 47, + "end": 48, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 50, - "start": 48, + "end": 51, + "start": 49, "type": "REQUEST_EXECUTION" }, { "end": 55, - "start": 51, + "start": 52, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_instance_group_managers_list_managed_instances_sync.py" + "title": "compute_v1_generated_region_instance_group_managers_resize_sync.py" }, { "canonical": true, @@ -41966,19 +44298,19 @@ "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient", "shortName": "RegionInstanceGroupManagersClient" }, - "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient.list_per_instance_configs", + "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient.resume_instances", "method": { - "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers.ListPerInstanceConfigs", + "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers.ResumeInstances", "service": { "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers", "shortName": "RegionInstanceGroupManagers" }, - "shortName": "ListPerInstanceConfigs" + "shortName": "ResumeInstances" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.ListPerInstanceConfigsRegionInstanceGroupManagersRequest" + "type": "google.cloud.compute_v1.types.ResumeInstancesRegionInstanceGroupManagerRequest" }, { "name": "project", @@ -41992,6 +44324,10 @@ "name": "instance_group_manager", "type": "str" }, + { + "name": "region_instance_group_managers_resume_instances_request_resource", + "type": "google.cloud.compute_v1.types.RegionInstanceGroupManagersResumeInstancesRequest" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -42005,22 +44341,22 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.services.region_instance_group_managers.pagers.ListPerInstanceConfigsPager", - "shortName": "list_per_instance_configs" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "resume_instances" }, - "description": "Sample for ListPerInstanceConfigs", - "file": "compute_v1_generated_region_instance_group_managers_list_per_instance_configs_sync.py", + "description": "Sample for ResumeInstances", + "file": "compute_v1_generated_region_instance_group_managers_resume_instances_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionInstanceGroupManagers_ListPerInstanceConfigs_sync", + "regionTag": "compute_v1_generated_RegionInstanceGroupManagers_ResumeInstances_sync", "segments": [ { - "end": 54, + "end": 53, "start": 27, "type": "FULL" }, { - "end": 54, + "end": 53, "start": 27, "type": "SHORT" }, @@ -42040,12 +44376,12 @@ "type": "REQUEST_EXECUTION" }, { - "end": 55, + "end": 54, "start": 51, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_instance_group_managers_list_per_instance_configs_sync.py" + "title": "compute_v1_generated_region_instance_group_managers_resume_instances_sync.py" }, { "canonical": true, @@ -42054,19 +44390,19 @@ "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient", "shortName": "RegionInstanceGroupManagersClient" }, - "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient.list", + "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient.set_instance_template", "method": { - "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers.List", + "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers.SetInstanceTemplate", "service": { "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers", "shortName": "RegionInstanceGroupManagers" }, - "shortName": "List" + "shortName": "SetInstanceTemplate" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.ListRegionInstanceGroupManagersRequest" + "type": "google.cloud.compute_v1.types.SetInstanceTemplateRegionInstanceGroupManagerRequest" }, { "name": "project", @@ -42076,6 +44412,14 @@ "name": "region", "type": "str" }, + { + "name": "instance_group_manager", + "type": "str" + }, + { + "name": "region_instance_group_managers_set_template_request_resource", + "type": "google.cloud.compute_v1.types.RegionInstanceGroupManagersSetTemplateRequest" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -42089,14 +44433,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.services.region_instance_group_managers.pagers.ListPager", - "shortName": "list" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "set_instance_template" }, - "description": "Sample for List", - "file": "compute_v1_generated_region_instance_group_managers_list_sync.py", + "description": "Sample for SetInstanceTemplate", + "file": "compute_v1_generated_region_instance_group_managers_set_instance_template_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionInstanceGroupManagers_List_sync", + "regionTag": "compute_v1_generated_RegionInstanceGroupManagers_SetInstanceTemplate_sync", "segments": [ { "end": 53, @@ -42114,22 +44458,22 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 46, + "end": 47, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 49, - "start": 47, + "end": 50, + "start": 48, "type": "REQUEST_EXECUTION" }, { "end": 54, - "start": 50, + "start": 51, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_instance_group_managers_list_sync.py" + "title": "compute_v1_generated_region_instance_group_managers_set_instance_template_sync.py" }, { "canonical": true, @@ -42138,19 +44482,19 @@ "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient", "shortName": "RegionInstanceGroupManagersClient" }, - "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient.patch_per_instance_configs", + "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient.set_target_pools", "method": { - "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers.PatchPerInstanceConfigs", + "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers.SetTargetPools", "service": { "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers", "shortName": "RegionInstanceGroupManagers" }, - "shortName": "PatchPerInstanceConfigs" + "shortName": "SetTargetPools" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.PatchPerInstanceConfigsRegionInstanceGroupManagerRequest" + "type": "google.cloud.compute_v1.types.SetTargetPoolsRegionInstanceGroupManagerRequest" }, { "name": "project", @@ -42165,8 +44509,8 @@ "type": "str" }, { - "name": "region_instance_group_manager_patch_instance_config_req_resource", - "type": "google.cloud.compute_v1.types.RegionInstanceGroupManagerPatchInstanceConfigReq" + "name": "region_instance_group_managers_set_target_pools_request_resource", + "type": "google.cloud.compute_v1.types.RegionInstanceGroupManagersSetTargetPoolsRequest" }, { "name": "retry", @@ -42182,13 +44526,13 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "patch_per_instance_configs" + "shortName": "set_target_pools" }, - "description": "Sample for PatchPerInstanceConfigs", - "file": "compute_v1_generated_region_instance_group_managers_patch_per_instance_configs_sync.py", + "description": "Sample for SetTargetPools", + "file": "compute_v1_generated_region_instance_group_managers_set_target_pools_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionInstanceGroupManagers_PatchPerInstanceConfigs_sync", + "regionTag": "compute_v1_generated_RegionInstanceGroupManagers_SetTargetPools_sync", "segments": [ { "end": 53, @@ -42221,7 +44565,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_instance_group_managers_patch_per_instance_configs_sync.py" + "title": "compute_v1_generated_region_instance_group_managers_set_target_pools_sync.py" }, { "canonical": true, @@ -42230,19 +44574,19 @@ "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient", "shortName": "RegionInstanceGroupManagersClient" }, - "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient.patch", + "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient.start_instances", "method": { - "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers.Patch", + "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers.StartInstances", "service": { "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers", "shortName": "RegionInstanceGroupManagers" }, - "shortName": "Patch" + "shortName": "StartInstances" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.PatchRegionInstanceGroupManagerRequest" + "type": "google.cloud.compute_v1.types.StartInstancesRegionInstanceGroupManagerRequest" }, { "name": "project", @@ -42257,8 +44601,8 @@ "type": "str" }, { - "name": "instance_group_manager_resource", - "type": "google.cloud.compute_v1.types.InstanceGroupManager" + "name": "region_instance_group_managers_start_instances_request_resource", + "type": "google.cloud.compute_v1.types.RegionInstanceGroupManagersStartInstancesRequest" }, { "name": "retry", @@ -42274,13 +44618,13 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "patch" + "shortName": "start_instances" }, - "description": "Sample for Patch", - "file": "compute_v1_generated_region_instance_group_managers_patch_sync.py", + "description": "Sample for StartInstances", + "file": "compute_v1_generated_region_instance_group_managers_start_instances_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionInstanceGroupManagers_Patch_sync", + "regionTag": "compute_v1_generated_RegionInstanceGroupManagers_StartInstances_sync", "segments": [ { "end": 53, @@ -42313,7 +44657,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_instance_group_managers_patch_sync.py" + "title": "compute_v1_generated_region_instance_group_managers_start_instances_sync.py" }, { "canonical": true, @@ -42322,19 +44666,19 @@ "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient", "shortName": "RegionInstanceGroupManagersClient" }, - "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient.recreate_instances", + "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient.stop_instances", "method": { - "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers.RecreateInstances", + "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers.StopInstances", "service": { "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers", "shortName": "RegionInstanceGroupManagers" }, - "shortName": "RecreateInstances" + "shortName": "StopInstances" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.RecreateInstancesRegionInstanceGroupManagerRequest" + "type": "google.cloud.compute_v1.types.StopInstancesRegionInstanceGroupManagerRequest" }, { "name": "project", @@ -42349,8 +44693,8 @@ "type": "str" }, { - "name": "region_instance_group_managers_recreate_request_resource", - "type": "google.cloud.compute_v1.types.RegionInstanceGroupManagersRecreateRequest" + "name": "region_instance_group_managers_stop_instances_request_resource", + "type": "google.cloud.compute_v1.types.RegionInstanceGroupManagersStopInstancesRequest" }, { "name": "retry", @@ -42366,13 +44710,13 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "recreate_instances" + "shortName": "stop_instances" }, - "description": "Sample for RecreateInstances", - "file": "compute_v1_generated_region_instance_group_managers_recreate_instances_sync.py", + "description": "Sample for StopInstances", + "file": "compute_v1_generated_region_instance_group_managers_stop_instances_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionInstanceGroupManagers_RecreateInstances_sync", + "regionTag": "compute_v1_generated_RegionInstanceGroupManagers_StopInstances_sync", "segments": [ { "end": 53, @@ -42405,7 +44749,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_instance_group_managers_recreate_instances_sync.py" + "title": "compute_v1_generated_region_instance_group_managers_stop_instances_sync.py" }, { "canonical": true, @@ -42414,19 +44758,19 @@ "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient", "shortName": "RegionInstanceGroupManagersClient" }, - "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient.resize", + "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient.suspend_instances", "method": { - "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers.Resize", + "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers.SuspendInstances", "service": { "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers", "shortName": "RegionInstanceGroupManagers" }, - "shortName": "Resize" + "shortName": "SuspendInstances" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.ResizeRegionInstanceGroupManagerRequest" + "type": "google.cloud.compute_v1.types.SuspendInstancesRegionInstanceGroupManagerRequest" }, { "name": "project", @@ -42441,8 +44785,8 @@ "type": "str" }, { - "name": "size", - "type": "int" + "name": "region_instance_group_managers_suspend_instances_request_resource", + "type": "google.cloud.compute_v1.types.RegionInstanceGroupManagersSuspendInstancesRequest" }, { "name": "retry", @@ -42458,21 +44802,21 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "resize" + "shortName": "suspend_instances" }, - "description": "Sample for Resize", - "file": "compute_v1_generated_region_instance_group_managers_resize_sync.py", + "description": "Sample for SuspendInstances", + "file": "compute_v1_generated_region_instance_group_managers_suspend_instances_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionInstanceGroupManagers_Resize_sync", + "regionTag": "compute_v1_generated_RegionInstanceGroupManagers_SuspendInstances_sync", "segments": [ { - "end": 54, + "end": 53, "start": 27, "type": "FULL" }, { - "end": 54, + "end": 53, "start": 27, "type": "SHORT" }, @@ -42482,22 +44826,22 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 48, + "end": 47, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 51, - "start": 49, + "end": 50, + "start": 48, "type": "REQUEST_EXECUTION" }, { - "end": 55, - "start": 52, + "end": 54, + "start": 51, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_instance_group_managers_resize_sync.py" + "title": "compute_v1_generated_region_instance_group_managers_suspend_instances_sync.py" }, { "canonical": true, @@ -42506,19 +44850,19 @@ "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient", "shortName": "RegionInstanceGroupManagersClient" }, - "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient.resume_instances", + "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient.update_per_instance_configs", "method": { - "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers.ResumeInstances", + "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers.UpdatePerInstanceConfigs", "service": { "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers", "shortName": "RegionInstanceGroupManagers" }, - "shortName": "ResumeInstances" + "shortName": "UpdatePerInstanceConfigs" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.ResumeInstancesRegionInstanceGroupManagerRequest" + "type": "google.cloud.compute_v1.types.UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest" }, { "name": "project", @@ -42533,8 +44877,8 @@ "type": "str" }, { - "name": "region_instance_group_managers_resume_instances_request_resource", - "type": "google.cloud.compute_v1.types.RegionInstanceGroupManagersResumeInstancesRequest" + "name": "region_instance_group_manager_update_instance_config_req_resource", + "type": "google.cloud.compute_v1.types.RegionInstanceGroupManagerUpdateInstanceConfigReq" }, { "name": "retry", @@ -42550,13 +44894,13 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "resume_instances" + "shortName": "update_per_instance_configs" }, - "description": "Sample for ResumeInstances", - "file": "compute_v1_generated_region_instance_group_managers_resume_instances_sync.py", + "description": "Sample for UpdatePerInstanceConfigs", + "file": "compute_v1_generated_region_instance_group_managers_update_per_instance_configs_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionInstanceGroupManagers_ResumeInstances_sync", + "regionTag": "compute_v1_generated_RegionInstanceGroupManagers_UpdatePerInstanceConfigs_sync", "segments": [ { "end": 53, @@ -42589,28 +44933,28 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_instance_group_managers_resume_instances_sync.py" + "title": "compute_v1_generated_region_instance_group_managers_update_per_instance_configs_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient", - "shortName": "RegionInstanceGroupManagersClient" + "fullName": "google.cloud.compute_v1.RegionInstanceGroupsClient", + "shortName": "RegionInstanceGroupsClient" }, - "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient.set_instance_template", + "fullName": "google.cloud.compute_v1.RegionInstanceGroupsClient.get", "method": { - "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers.SetInstanceTemplate", + "fullName": "google.cloud.compute.v1.RegionInstanceGroups.Get", "service": { - "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers", - "shortName": "RegionInstanceGroupManagers" + "fullName": "google.cloud.compute.v1.RegionInstanceGroups", + "shortName": "RegionInstanceGroups" }, - "shortName": "SetInstanceTemplate" + "shortName": "Get" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.SetInstanceTemplateRegionInstanceGroupManagerRequest" + "type": "google.cloud.compute_v1.types.GetRegionInstanceGroupRequest" }, { "name": "project", @@ -42621,13 +44965,9 @@ "type": "str" }, { - "name": "instance_group_manager", + "name": "instance_group", "type": "str" }, - { - "name": "region_instance_group_managers_set_template_request_resource", - "type": "google.cloud.compute_v1.types.RegionInstanceGroupManagersSetTemplateRequest" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -42641,14 +44981,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "set_instance_template" + "resultType": "google.cloud.compute_v1.types.InstanceGroup", + "shortName": "get" }, - "description": "Sample for SetInstanceTemplate", - "file": "compute_v1_generated_region_instance_group_managers_set_instance_template_sync.py", + "description": "Sample for Get", + "file": "compute_v1_generated_region_instance_groups_get_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionInstanceGroupManagers_SetInstanceTemplate_sync", + "regionTag": "compute_v1_generated_RegionInstanceGroups_Get_sync", "segments": [ { "end": 53, @@ -42681,28 +45021,28 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_instance_group_managers_set_instance_template_sync.py" + "title": "compute_v1_generated_region_instance_groups_get_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient", - "shortName": "RegionInstanceGroupManagersClient" + "fullName": "google.cloud.compute_v1.RegionInstanceGroupsClient", + "shortName": "RegionInstanceGroupsClient" }, - "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient.set_target_pools", + "fullName": "google.cloud.compute_v1.RegionInstanceGroupsClient.list_instances", "method": { - "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers.SetTargetPools", + "fullName": "google.cloud.compute.v1.RegionInstanceGroups.ListInstances", "service": { - "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers", - "shortName": "RegionInstanceGroupManagers" + "fullName": "google.cloud.compute.v1.RegionInstanceGroups", + "shortName": "RegionInstanceGroups" }, - "shortName": "SetTargetPools" + "shortName": "ListInstances" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.SetTargetPoolsRegionInstanceGroupManagerRequest" + "type": "google.cloud.compute_v1.types.ListInstancesRegionInstanceGroupsRequest" }, { "name": "project", @@ -42713,12 +45053,12 @@ "type": "str" }, { - "name": "instance_group_manager", + "name": "instance_group", "type": "str" }, { - "name": "region_instance_group_managers_set_target_pools_request_resource", - "type": "google.cloud.compute_v1.types.RegionInstanceGroupManagersSetTargetPoolsRequest" + "name": "region_instance_groups_list_instances_request_resource", + "type": "google.cloud.compute_v1.types.RegionInstanceGroupsListInstancesRequest" }, { "name": "retry", @@ -42733,22 +45073,22 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "set_target_pools" + "resultType": "google.cloud.compute_v1.services.region_instance_groups.pagers.ListInstancesPager", + "shortName": "list_instances" }, - "description": "Sample for SetTargetPools", - "file": "compute_v1_generated_region_instance_group_managers_set_target_pools_sync.py", + "description": "Sample for ListInstances", + "file": "compute_v1_generated_region_instance_groups_list_instances_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionInstanceGroupManagers_SetTargetPools_sync", + "regionTag": "compute_v1_generated_RegionInstanceGroups_ListInstances_sync", "segments": [ { - "end": 53, + "end": 54, "start": 27, "type": "FULL" }, { - "end": 53, + "end": 54, "start": 27, "type": "SHORT" }, @@ -42768,33 +45108,33 @@ "type": "REQUEST_EXECUTION" }, { - "end": 54, + "end": 55, "start": 51, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_instance_group_managers_set_target_pools_sync.py" + "title": "compute_v1_generated_region_instance_groups_list_instances_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient", - "shortName": "RegionInstanceGroupManagersClient" + "fullName": "google.cloud.compute_v1.RegionInstanceGroupsClient", + "shortName": "RegionInstanceGroupsClient" }, - "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient.start_instances", + "fullName": "google.cloud.compute_v1.RegionInstanceGroupsClient.list", "method": { - "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers.StartInstances", + "fullName": "google.cloud.compute.v1.RegionInstanceGroups.List", "service": { - "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers", - "shortName": "RegionInstanceGroupManagers" + "fullName": "google.cloud.compute.v1.RegionInstanceGroups", + "shortName": "RegionInstanceGroups" }, - "shortName": "StartInstances" + "shortName": "List" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.StartInstancesRegionInstanceGroupManagerRequest" + "type": "google.cloud.compute_v1.types.ListRegionInstanceGroupsRequest" }, { "name": "project", @@ -42804,14 +45144,6 @@ "name": "region", "type": "str" }, - { - "name": "instance_group_manager", - "type": "str" - }, - { - "name": "region_instance_group_managers_start_instances_request_resource", - "type": "google.cloud.compute_v1.types.RegionInstanceGroupManagersStartInstancesRequest" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -42825,14 +45157,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "start_instances" + "resultType": "google.cloud.compute_v1.services.region_instance_groups.pagers.ListPager", + "shortName": "list" }, - "description": "Sample for StartInstances", - "file": "compute_v1_generated_region_instance_group_managers_start_instances_sync.py", + "description": "Sample for List", + "file": "compute_v1_generated_region_instance_groups_list_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionInstanceGroupManagers_StartInstances_sync", + "regionTag": "compute_v1_generated_RegionInstanceGroups_List_sync", "segments": [ { "end": 53, @@ -42850,43 +45182,43 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 47, + "end": 46, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 50, - "start": 48, + "end": 49, + "start": 47, "type": "REQUEST_EXECUTION" }, { "end": 54, - "start": 51, + "start": 50, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_instance_group_managers_start_instances_sync.py" + "title": "compute_v1_generated_region_instance_groups_list_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient", - "shortName": "RegionInstanceGroupManagersClient" + "fullName": "google.cloud.compute_v1.RegionInstanceGroupsClient", + "shortName": "RegionInstanceGroupsClient" }, - "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient.stop_instances", + "fullName": "google.cloud.compute_v1.RegionInstanceGroupsClient.set_named_ports", "method": { - "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers.StopInstances", + "fullName": "google.cloud.compute.v1.RegionInstanceGroups.SetNamedPorts", "service": { - "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers", - "shortName": "RegionInstanceGroupManagers" + "fullName": "google.cloud.compute.v1.RegionInstanceGroups", + "shortName": "RegionInstanceGroups" }, - "shortName": "StopInstances" + "shortName": "SetNamedPorts" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.StopInstancesRegionInstanceGroupManagerRequest" + "type": "google.cloud.compute_v1.types.SetNamedPortsRegionInstanceGroupRequest" }, { "name": "project", @@ -42897,12 +45229,12 @@ "type": "str" }, { - "name": "instance_group_manager", + "name": "instance_group", "type": "str" }, { - "name": "region_instance_group_managers_stop_instances_request_resource", - "type": "google.cloud.compute_v1.types.RegionInstanceGroupManagersStopInstancesRequest" + "name": "region_instance_groups_set_named_ports_request_resource", + "type": "google.cloud.compute_v1.types.RegionInstanceGroupsSetNamedPortsRequest" }, { "name": "retry", @@ -42918,13 +45250,13 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "stop_instances" + "shortName": "set_named_ports" }, - "description": "Sample for StopInstances", - "file": "compute_v1_generated_region_instance_group_managers_stop_instances_sync.py", + "description": "Sample for SetNamedPorts", + "file": "compute_v1_generated_region_instance_groups_set_named_ports_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionInstanceGroupManagers_StopInstances_sync", + "regionTag": "compute_v1_generated_RegionInstanceGroups_SetNamedPorts_sync", "segments": [ { "end": 53, @@ -42957,28 +45289,28 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_instance_group_managers_stop_instances_sync.py" + "title": "compute_v1_generated_region_instance_groups_set_named_ports_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient", - "shortName": "RegionInstanceGroupManagersClient" + "fullName": "google.cloud.compute_v1.RegionInstanceTemplatesClient", + "shortName": "RegionInstanceTemplatesClient" }, - "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient.suspend_instances", + "fullName": "google.cloud.compute_v1.RegionInstanceTemplatesClient.delete", "method": { - "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers.SuspendInstances", + "fullName": "google.cloud.compute.v1.RegionInstanceTemplates.Delete", "service": { - "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers", - "shortName": "RegionInstanceGroupManagers" + "fullName": "google.cloud.compute.v1.RegionInstanceTemplates", + "shortName": "RegionInstanceTemplates" }, - "shortName": "SuspendInstances" + "shortName": "Delete" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.SuspendInstancesRegionInstanceGroupManagerRequest" + "type": "google.cloud.compute_v1.types.DeleteRegionInstanceTemplateRequest" }, { "name": "project", @@ -42989,13 +45321,9 @@ "type": "str" }, { - "name": "instance_group_manager", + "name": "instance_template", "type": "str" }, - { - "name": "region_instance_group_managers_suspend_instances_request_resource", - "type": "google.cloud.compute_v1.types.RegionInstanceGroupManagersSuspendInstancesRequest" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -43010,13 +45338,13 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "suspend_instances" + "shortName": "delete" }, - "description": "Sample for SuspendInstances", - "file": "compute_v1_generated_region_instance_group_managers_suspend_instances_sync.py", + "description": "Sample for Delete", + "file": "compute_v1_generated_region_instance_templates_delete_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionInstanceGroupManagers_SuspendInstances_sync", + "regionTag": "compute_v1_generated_RegionInstanceTemplates_Delete_sync", "segments": [ { "end": 53, @@ -43049,28 +45377,28 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_instance_group_managers_suspend_instances_sync.py" + "title": "compute_v1_generated_region_instance_templates_delete_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient", - "shortName": "RegionInstanceGroupManagersClient" + "fullName": "google.cloud.compute_v1.RegionInstanceTemplatesClient", + "shortName": "RegionInstanceTemplatesClient" }, - "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient.update_per_instance_configs", + "fullName": "google.cloud.compute_v1.RegionInstanceTemplatesClient.get", "method": { - "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers.UpdatePerInstanceConfigs", + "fullName": "google.cloud.compute.v1.RegionInstanceTemplates.Get", "service": { - "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers", - "shortName": "RegionInstanceGroupManagers" + "fullName": "google.cloud.compute.v1.RegionInstanceTemplates", + "shortName": "RegionInstanceTemplates" }, - "shortName": "UpdatePerInstanceConfigs" + "shortName": "Get" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest" + "type": "google.cloud.compute_v1.types.GetRegionInstanceTemplateRequest" }, { "name": "project", @@ -43081,13 +45409,9 @@ "type": "str" }, { - "name": "instance_group_manager", + "name": "instance_template", "type": "str" }, - { - "name": "region_instance_group_manager_update_instance_config_req_resource", - "type": "google.cloud.compute_v1.types.RegionInstanceGroupManagerUpdateInstanceConfigReq" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -43101,14 +45425,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "update_per_instance_configs" + "resultType": "google.cloud.compute_v1.types.InstanceTemplate", + "shortName": "get" }, - "description": "Sample for UpdatePerInstanceConfigs", - "file": "compute_v1_generated_region_instance_group_managers_update_per_instance_configs_sync.py", + "description": "Sample for Get", + "file": "compute_v1_generated_region_instance_templates_get_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionInstanceGroupManagers_UpdatePerInstanceConfigs_sync", + "regionTag": "compute_v1_generated_RegionInstanceTemplates_Get_sync", "segments": [ { "end": 53, @@ -43141,28 +45465,28 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_instance_group_managers_update_per_instance_configs_sync.py" + "title": "compute_v1_generated_region_instance_templates_get_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionInstanceGroupsClient", - "shortName": "RegionInstanceGroupsClient" + "fullName": "google.cloud.compute_v1.RegionInstanceTemplatesClient", + "shortName": "RegionInstanceTemplatesClient" }, - "fullName": "google.cloud.compute_v1.RegionInstanceGroupsClient.get", + "fullName": "google.cloud.compute_v1.RegionInstanceTemplatesClient.insert", "method": { - "fullName": "google.cloud.compute.v1.RegionInstanceGroups.Get", + "fullName": "google.cloud.compute.v1.RegionInstanceTemplates.Insert", "service": { - "fullName": "google.cloud.compute.v1.RegionInstanceGroups", - "shortName": "RegionInstanceGroups" + "fullName": "google.cloud.compute.v1.RegionInstanceTemplates", + "shortName": "RegionInstanceTemplates" }, - "shortName": "Get" + "shortName": "Insert" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetRegionInstanceGroupRequest" + "type": "google.cloud.compute_v1.types.InsertRegionInstanceTemplateRequest" }, { "name": "project", @@ -43173,8 +45497,8 @@ "type": "str" }, { - "name": "instance_group", - "type": "str" + "name": "instance_template_resource", + "type": "google.cloud.compute_v1.types.InstanceTemplate" }, { "name": "retry", @@ -43189,22 +45513,22 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.InstanceGroup", - "shortName": "get" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "insert" }, - "description": "Sample for Get", - "file": "compute_v1_generated_region_instance_groups_get_sync.py", + "description": "Sample for Insert", + "file": "compute_v1_generated_region_instance_templates_insert_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionInstanceGroups_Get_sync", + "regionTag": "compute_v1_generated_RegionInstanceTemplates_Insert_sync", "segments": [ { - "end": 53, + "end": 52, "start": 27, "type": "FULL" }, { - "end": 53, + "end": 52, "start": 27, "type": "SHORT" }, @@ -43214,43 +45538,43 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 47, + "end": 46, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 50, - "start": 48, + "end": 49, + "start": 47, "type": "REQUEST_EXECUTION" }, { - "end": 54, - "start": 51, + "end": 53, + "start": 50, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_instance_groups_get_sync.py" + "title": "compute_v1_generated_region_instance_templates_insert_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionInstanceGroupsClient", - "shortName": "RegionInstanceGroupsClient" + "fullName": "google.cloud.compute_v1.RegionInstanceTemplatesClient", + "shortName": "RegionInstanceTemplatesClient" }, - "fullName": "google.cloud.compute_v1.RegionInstanceGroupsClient.list_instances", + "fullName": "google.cloud.compute_v1.RegionInstanceTemplatesClient.list", "method": { - "fullName": "google.cloud.compute.v1.RegionInstanceGroups.ListInstances", + "fullName": "google.cloud.compute.v1.RegionInstanceTemplates.List", "service": { - "fullName": "google.cloud.compute.v1.RegionInstanceGroups", - "shortName": "RegionInstanceGroups" + "fullName": "google.cloud.compute.v1.RegionInstanceTemplates", + "shortName": "RegionInstanceTemplates" }, - "shortName": "ListInstances" + "shortName": "List" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.ListInstancesRegionInstanceGroupsRequest" + "type": "google.cloud.compute_v1.types.ListRegionInstanceTemplatesRequest" }, { "name": "project", @@ -43260,14 +45584,6 @@ "name": "region", "type": "str" }, - { - "name": "instance_group", - "type": "str" - }, - { - "name": "region_instance_groups_list_instances_request_resource", - "type": "google.cloud.compute_v1.types.RegionInstanceGroupsListInstancesRequest" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -43281,22 +45597,22 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.services.region_instance_groups.pagers.ListInstancesPager", - "shortName": "list_instances" + "resultType": "google.cloud.compute_v1.services.region_instance_templates.pagers.ListPager", + "shortName": "list" }, - "description": "Sample for ListInstances", - "file": "compute_v1_generated_region_instance_groups_list_instances_sync.py", + "description": "Sample for List", + "file": "compute_v1_generated_region_instance_templates_list_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionInstanceGroups_ListInstances_sync", + "regionTag": "compute_v1_generated_RegionInstanceTemplates_List_sync", "segments": [ { - "end": 54, + "end": 53, "start": 27, "type": "FULL" }, { - "end": 54, + "end": 53, "start": 27, "type": "SHORT" }, @@ -43306,43 +45622,43 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 47, + "end": 46, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 50, - "start": 48, + "end": 49, + "start": 47, "type": "REQUEST_EXECUTION" }, { - "end": 55, - "start": 51, + "end": 54, + "start": 50, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_instance_groups_list_instances_sync.py" + "title": "compute_v1_generated_region_instance_templates_list_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionInstanceGroupsClient", - "shortName": "RegionInstanceGroupsClient" + "fullName": "google.cloud.compute_v1.RegionInstancesClient", + "shortName": "RegionInstancesClient" }, - "fullName": "google.cloud.compute_v1.RegionInstanceGroupsClient.list", + "fullName": "google.cloud.compute_v1.RegionInstancesClient.bulk_insert", "method": { - "fullName": "google.cloud.compute.v1.RegionInstanceGroups.List", + "fullName": "google.cloud.compute.v1.RegionInstances.BulkInsert", "service": { - "fullName": "google.cloud.compute.v1.RegionInstanceGroups", - "shortName": "RegionInstanceGroups" + "fullName": "google.cloud.compute.v1.RegionInstances", + "shortName": "RegionInstances" }, - "shortName": "List" + "shortName": "BulkInsert" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.ListRegionInstanceGroupsRequest" + "type": "google.cloud.compute_v1.types.BulkInsertRegionInstanceRequest" }, { "name": "project", @@ -43352,6 +45668,10 @@ "name": "region", "type": "str" }, + { + "name": "bulk_insert_instance_resource_resource", + "type": "google.cloud.compute_v1.types.BulkInsertInstanceResource" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -43365,22 +45685,22 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.services.region_instance_groups.pagers.ListPager", - "shortName": "list" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "bulk_insert" }, - "description": "Sample for List", - "file": "compute_v1_generated_region_instance_groups_list_sync.py", + "description": "Sample for BulkInsert", + "file": "compute_v1_generated_region_instances_bulk_insert_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionInstanceGroups_List_sync", + "regionTag": "compute_v1_generated_RegionInstances_BulkInsert_sync", "segments": [ { - "end": 53, + "end": 52, "start": 27, "type": "FULL" }, { - "end": 53, + "end": 52, "start": 27, "type": "SHORT" }, @@ -43400,33 +45720,33 @@ "type": "REQUEST_EXECUTION" }, { - "end": 54, + "end": 53, "start": 50, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_instance_groups_list_sync.py" + "title": "compute_v1_generated_region_instances_bulk_insert_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionInstanceGroupsClient", - "shortName": "RegionInstanceGroupsClient" + "fullName": "google.cloud.compute_v1.RegionInstantSnapshotsClient", + "shortName": "RegionInstantSnapshotsClient" }, - "fullName": "google.cloud.compute_v1.RegionInstanceGroupsClient.set_named_ports", + "fullName": "google.cloud.compute_v1.RegionInstantSnapshotsClient.delete", "method": { - "fullName": "google.cloud.compute.v1.RegionInstanceGroups.SetNamedPorts", + "fullName": "google.cloud.compute.v1.RegionInstantSnapshots.Delete", "service": { - "fullName": "google.cloud.compute.v1.RegionInstanceGroups", - "shortName": "RegionInstanceGroups" + "fullName": "google.cloud.compute.v1.RegionInstantSnapshots", + "shortName": "RegionInstantSnapshots" }, - "shortName": "SetNamedPorts" + "shortName": "Delete" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.SetNamedPortsRegionInstanceGroupRequest" + "type": "google.cloud.compute_v1.types.DeleteRegionInstantSnapshotRequest" }, { "name": "project", @@ -43437,13 +45757,9 @@ "type": "str" }, { - "name": "instance_group", + "name": "instant_snapshot", "type": "str" }, - { - "name": "region_instance_groups_set_named_ports_request_resource", - "type": "google.cloud.compute_v1.types.RegionInstanceGroupsSetNamedPortsRequest" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -43458,13 +45774,13 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "set_named_ports" + "shortName": "delete" }, - "description": "Sample for SetNamedPorts", - "file": "compute_v1_generated_region_instance_groups_set_named_ports_sync.py", + "description": "Sample for Delete", + "file": "compute_v1_generated_region_instant_snapshots_delete_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionInstanceGroups_SetNamedPorts_sync", + "regionTag": "compute_v1_generated_RegionInstantSnapshots_Delete_sync", "segments": [ { "end": 53, @@ -43497,28 +45813,28 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_instance_groups_set_named_ports_sync.py" + "title": "compute_v1_generated_region_instant_snapshots_delete_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionInstanceTemplatesClient", - "shortName": "RegionInstanceTemplatesClient" + "fullName": "google.cloud.compute_v1.RegionInstantSnapshotsClient", + "shortName": "RegionInstantSnapshotsClient" }, - "fullName": "google.cloud.compute_v1.RegionInstanceTemplatesClient.delete", + "fullName": "google.cloud.compute_v1.RegionInstantSnapshotsClient.get_iam_policy", "method": { - "fullName": "google.cloud.compute.v1.RegionInstanceTemplates.Delete", + "fullName": "google.cloud.compute.v1.RegionInstantSnapshots.GetIamPolicy", "service": { - "fullName": "google.cloud.compute.v1.RegionInstanceTemplates", - "shortName": "RegionInstanceTemplates" + "fullName": "google.cloud.compute.v1.RegionInstantSnapshots", + "shortName": "RegionInstantSnapshots" }, - "shortName": "Delete" + "shortName": "GetIamPolicy" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.DeleteRegionInstanceTemplateRequest" + "type": "google.cloud.compute_v1.types.GetIamPolicyRegionInstantSnapshotRequest" }, { "name": "project", @@ -43529,7 +45845,7 @@ "type": "str" }, { - "name": "instance_template", + "name": "resource", "type": "str" }, { @@ -43545,14 +45861,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "delete" + "resultType": "google.cloud.compute_v1.types.Policy", + "shortName": "get_iam_policy" }, - "description": "Sample for Delete", - "file": "compute_v1_generated_region_instance_templates_delete_sync.py", + "description": "Sample for GetIamPolicy", + "file": "compute_v1_generated_region_instant_snapshots_get_iam_policy_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionInstanceTemplates_Delete_sync", + "regionTag": "compute_v1_generated_RegionInstantSnapshots_GetIamPolicy_sync", "segments": [ { "end": 53, @@ -43585,28 +45901,28 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_instance_templates_delete_sync.py" + "title": "compute_v1_generated_region_instant_snapshots_get_iam_policy_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionInstanceTemplatesClient", - "shortName": "RegionInstanceTemplatesClient" + "fullName": "google.cloud.compute_v1.RegionInstantSnapshotsClient", + "shortName": "RegionInstantSnapshotsClient" }, - "fullName": "google.cloud.compute_v1.RegionInstanceTemplatesClient.get", + "fullName": "google.cloud.compute_v1.RegionInstantSnapshotsClient.get", "method": { - "fullName": "google.cloud.compute.v1.RegionInstanceTemplates.Get", + "fullName": "google.cloud.compute.v1.RegionInstantSnapshots.Get", "service": { - "fullName": "google.cloud.compute.v1.RegionInstanceTemplates", - "shortName": "RegionInstanceTemplates" + "fullName": "google.cloud.compute.v1.RegionInstantSnapshots", + "shortName": "RegionInstantSnapshots" }, "shortName": "Get" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetRegionInstanceTemplateRequest" + "type": "google.cloud.compute_v1.types.GetRegionInstantSnapshotRequest" }, { "name": "project", @@ -43617,7 +45933,7 @@ "type": "str" }, { - "name": "instance_template", + "name": "instant_snapshot", "type": "str" }, { @@ -43633,14 +45949,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.InstanceTemplate", + "resultType": "google.cloud.compute_v1.types.InstantSnapshot", "shortName": "get" }, "description": "Sample for Get", - "file": "compute_v1_generated_region_instance_templates_get_sync.py", + "file": "compute_v1_generated_region_instant_snapshots_get_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionInstanceTemplates_Get_sync", + "regionTag": "compute_v1_generated_RegionInstantSnapshots_Get_sync", "segments": [ { "end": 53, @@ -43673,28 +45989,28 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_instance_templates_get_sync.py" + "title": "compute_v1_generated_region_instant_snapshots_get_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionInstanceTemplatesClient", - "shortName": "RegionInstanceTemplatesClient" + "fullName": "google.cloud.compute_v1.RegionInstantSnapshotsClient", + "shortName": "RegionInstantSnapshotsClient" }, - "fullName": "google.cloud.compute_v1.RegionInstanceTemplatesClient.insert", + "fullName": "google.cloud.compute_v1.RegionInstantSnapshotsClient.insert", "method": { - "fullName": "google.cloud.compute.v1.RegionInstanceTemplates.Insert", + "fullName": "google.cloud.compute.v1.RegionInstantSnapshots.Insert", "service": { - "fullName": "google.cloud.compute.v1.RegionInstanceTemplates", - "shortName": "RegionInstanceTemplates" + "fullName": "google.cloud.compute.v1.RegionInstantSnapshots", + "shortName": "RegionInstantSnapshots" }, "shortName": "Insert" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.InsertRegionInstanceTemplateRequest" + "type": "google.cloud.compute_v1.types.InsertRegionInstantSnapshotRequest" }, { "name": "project", @@ -43705,8 +46021,8 @@ "type": "str" }, { - "name": "instance_template_resource", - "type": "google.cloud.compute_v1.types.InstanceTemplate" + "name": "instant_snapshot_resource", + "type": "google.cloud.compute_v1.types.InstantSnapshot" }, { "name": "retry", @@ -43725,10 +46041,10 @@ "shortName": "insert" }, "description": "Sample for Insert", - "file": "compute_v1_generated_region_instance_templates_insert_sync.py", + "file": "compute_v1_generated_region_instant_snapshots_insert_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionInstanceTemplates_Insert_sync", + "regionTag": "compute_v1_generated_RegionInstantSnapshots_Insert_sync", "segments": [ { "end": 52, @@ -43761,28 +46077,28 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_instance_templates_insert_sync.py" + "title": "compute_v1_generated_region_instant_snapshots_insert_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionInstanceTemplatesClient", - "shortName": "RegionInstanceTemplatesClient" + "fullName": "google.cloud.compute_v1.RegionInstantSnapshotsClient", + "shortName": "RegionInstantSnapshotsClient" }, - "fullName": "google.cloud.compute_v1.RegionInstanceTemplatesClient.list", + "fullName": "google.cloud.compute_v1.RegionInstantSnapshotsClient.list", "method": { - "fullName": "google.cloud.compute.v1.RegionInstanceTemplates.List", + "fullName": "google.cloud.compute.v1.RegionInstantSnapshots.List", "service": { - "fullName": "google.cloud.compute.v1.RegionInstanceTemplates", - "shortName": "RegionInstanceTemplates" + "fullName": "google.cloud.compute.v1.RegionInstantSnapshots", + "shortName": "RegionInstantSnapshots" }, "shortName": "List" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.ListRegionInstanceTemplatesRequest" + "type": "google.cloud.compute_v1.types.ListRegionInstantSnapshotsRequest" }, { "name": "project", @@ -43805,14 +46121,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.services.region_instance_templates.pagers.ListPager", + "resultType": "google.cloud.compute_v1.services.region_instant_snapshots.pagers.ListPager", "shortName": "list" }, "description": "Sample for List", - "file": "compute_v1_generated_region_instance_templates_list_sync.py", + "file": "compute_v1_generated_region_instant_snapshots_list_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionInstanceTemplates_List_sync", + "regionTag": "compute_v1_generated_RegionInstantSnapshots_List_sync", "segments": [ { "end": 53, @@ -43845,95 +46161,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_instance_templates_list_sync.py" - }, - { - "canonical": true, - "clientMethod": { - "client": { - "fullName": "google.cloud.compute_v1.RegionInstancesClient", - "shortName": "RegionInstancesClient" - }, - "fullName": "google.cloud.compute_v1.RegionInstancesClient.bulk_insert", - "method": { - "fullName": "google.cloud.compute.v1.RegionInstances.BulkInsert", - "service": { - "fullName": "google.cloud.compute.v1.RegionInstances", - "shortName": "RegionInstances" - }, - "shortName": "BulkInsert" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.compute_v1.types.BulkInsertRegionInstanceRequest" - }, - { - "name": "project", - "type": "str" - }, - { - "name": "region", - "type": "str" - }, - { - "name": "bulk_insert_instance_resource_resource", - "type": "google.cloud.compute_v1.types.BulkInsertInstanceResource" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, Union[str, bytes]]]" - } - ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "bulk_insert" - }, - "description": "Sample for BulkInsert", - "file": "compute_v1_generated_region_instances_bulk_insert_sync.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionInstances_BulkInsert_sync", - "segments": [ - { - "end": 52, - "start": 27, - "type": "FULL" - }, - { - "end": 52, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 46, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 49, - "start": 47, - "type": "REQUEST_EXECUTION" - }, - { - "end": 53, - "start": 50, - "type": "RESPONSE_HANDLING" - } - ], - "title": "compute_v1_generated_region_instances_bulk_insert_sync.py" + "title": "compute_v1_generated_region_instant_snapshots_list_sync.py" }, { "canonical": true, @@ -43942,19 +46170,19 @@ "fullName": "google.cloud.compute_v1.RegionInstantSnapshotsClient", "shortName": "RegionInstantSnapshotsClient" }, - "fullName": "google.cloud.compute_v1.RegionInstantSnapshotsClient.delete", + "fullName": "google.cloud.compute_v1.RegionInstantSnapshotsClient.set_iam_policy", "method": { - "fullName": "google.cloud.compute.v1.RegionInstantSnapshots.Delete", + "fullName": "google.cloud.compute.v1.RegionInstantSnapshots.SetIamPolicy", "service": { "fullName": "google.cloud.compute.v1.RegionInstantSnapshots", "shortName": "RegionInstantSnapshots" }, - "shortName": "Delete" + "shortName": "SetIamPolicy" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.DeleteRegionInstantSnapshotRequest" + "type": "google.cloud.compute_v1.types.SetIamPolicyRegionInstantSnapshotRequest" }, { "name": "project", @@ -43965,9 +46193,13 @@ "type": "str" }, { - "name": "instant_snapshot", + "name": "resource", "type": "str" }, + { + "name": "region_set_policy_request_resource", + "type": "google.cloud.compute_v1.types.RegionSetPolicyRequest" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -43981,14 +46213,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "delete" + "resultType": "google.cloud.compute_v1.types.Policy", + "shortName": "set_iam_policy" }, - "description": "Sample for Delete", - "file": "compute_v1_generated_region_instant_snapshots_delete_sync.py", + "description": "Sample for SetIamPolicy", + "file": "compute_v1_generated_region_instant_snapshots_set_iam_policy_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionInstantSnapshots_Delete_sync", + "regionTag": "compute_v1_generated_RegionInstantSnapshots_SetIamPolicy_sync", "segments": [ { "end": 53, @@ -44021,7 +46253,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_instant_snapshots_delete_sync.py" + "title": "compute_v1_generated_region_instant_snapshots_set_iam_policy_sync.py" }, { "canonical": true, @@ -44030,19 +46262,19 @@ "fullName": "google.cloud.compute_v1.RegionInstantSnapshotsClient", "shortName": "RegionInstantSnapshotsClient" }, - "fullName": "google.cloud.compute_v1.RegionInstantSnapshotsClient.get_iam_policy", + "fullName": "google.cloud.compute_v1.RegionInstantSnapshotsClient.set_labels", "method": { - "fullName": "google.cloud.compute.v1.RegionInstantSnapshots.GetIamPolicy", + "fullName": "google.cloud.compute.v1.RegionInstantSnapshots.SetLabels", "service": { "fullName": "google.cloud.compute.v1.RegionInstantSnapshots", "shortName": "RegionInstantSnapshots" }, - "shortName": "GetIamPolicy" + "shortName": "SetLabels" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetIamPolicyRegionInstantSnapshotRequest" + "type": "google.cloud.compute_v1.types.SetLabelsRegionInstantSnapshotRequest" }, { "name": "project", @@ -44056,6 +46288,10 @@ "name": "resource", "type": "str" }, + { + "name": "region_set_labels_request_resource", + "type": "google.cloud.compute_v1.types.RegionSetLabelsRequest" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -44069,14 +46305,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.Policy", - "shortName": "get_iam_policy" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "set_labels" }, - "description": "Sample for GetIamPolicy", - "file": "compute_v1_generated_region_instant_snapshots_get_iam_policy_sync.py", + "description": "Sample for SetLabels", + "file": "compute_v1_generated_region_instant_snapshots_set_labels_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionInstantSnapshots_GetIamPolicy_sync", + "regionTag": "compute_v1_generated_RegionInstantSnapshots_SetLabels_sync", "segments": [ { "end": 53, @@ -44109,7 +46345,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_instant_snapshots_get_iam_policy_sync.py" + "title": "compute_v1_generated_region_instant_snapshots_set_labels_sync.py" }, { "canonical": true, @@ -44118,19 +46354,19 @@ "fullName": "google.cloud.compute_v1.RegionInstantSnapshotsClient", "shortName": "RegionInstantSnapshotsClient" }, - "fullName": "google.cloud.compute_v1.RegionInstantSnapshotsClient.get", + "fullName": "google.cloud.compute_v1.RegionInstantSnapshotsClient.test_iam_permissions", "method": { - "fullName": "google.cloud.compute.v1.RegionInstantSnapshots.Get", + "fullName": "google.cloud.compute.v1.RegionInstantSnapshots.TestIamPermissions", "service": { "fullName": "google.cloud.compute.v1.RegionInstantSnapshots", "shortName": "RegionInstantSnapshots" }, - "shortName": "Get" + "shortName": "TestIamPermissions" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetRegionInstantSnapshotRequest" + "type": "google.cloud.compute_v1.types.TestIamPermissionsRegionInstantSnapshotRequest" }, { "name": "project", @@ -44141,9 +46377,13 @@ "type": "str" }, { - "name": "instant_snapshot", + "name": "resource", "type": "str" }, + { + "name": "test_permissions_request_resource", + "type": "google.cloud.compute_v1.types.TestPermissionsRequest" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -44157,14 +46397,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.InstantSnapshot", - "shortName": "get" + "resultType": "google.cloud.compute_v1.types.TestPermissionsResponse", + "shortName": "test_iam_permissions" }, - "description": "Sample for Get", - "file": "compute_v1_generated_region_instant_snapshots_get_sync.py", + "description": "Sample for TestIamPermissions", + "file": "compute_v1_generated_region_instant_snapshots_test_iam_permissions_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionInstantSnapshots_Get_sync", + "regionTag": "compute_v1_generated_RegionInstantSnapshots_TestIamPermissions_sync", "segments": [ { "end": 53, @@ -44197,28 +46437,28 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_instant_snapshots_get_sync.py" + "title": "compute_v1_generated_region_instant_snapshots_test_iam_permissions_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionInstantSnapshotsClient", - "shortName": "RegionInstantSnapshotsClient" + "fullName": "google.cloud.compute_v1.RegionNetworkEndpointGroupsClient", + "shortName": "RegionNetworkEndpointGroupsClient" }, - "fullName": "google.cloud.compute_v1.RegionInstantSnapshotsClient.insert", + "fullName": "google.cloud.compute_v1.RegionNetworkEndpointGroupsClient.attach_network_endpoints", "method": { - "fullName": "google.cloud.compute.v1.RegionInstantSnapshots.Insert", + "fullName": "google.cloud.compute.v1.RegionNetworkEndpointGroups.AttachNetworkEndpoints", "service": { - "fullName": "google.cloud.compute.v1.RegionInstantSnapshots", - "shortName": "RegionInstantSnapshots" + "fullName": "google.cloud.compute.v1.RegionNetworkEndpointGroups", + "shortName": "RegionNetworkEndpointGroups" }, - "shortName": "Insert" + "shortName": "AttachNetworkEndpoints" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.InsertRegionInstantSnapshotRequest" + "type": "google.cloud.compute_v1.types.AttachNetworkEndpointsRegionNetworkEndpointGroupRequest" }, { "name": "project", @@ -44229,8 +46469,12 @@ "type": "str" }, { - "name": "instant_snapshot_resource", - "type": "google.cloud.compute_v1.types.InstantSnapshot" + "name": "network_endpoint_group", + "type": "str" + }, + { + "name": "region_network_endpoint_groups_attach_endpoints_request_resource", + "type": "google.cloud.compute_v1.types.RegionNetworkEndpointGroupsAttachEndpointsRequest" }, { "name": "retry", @@ -44246,21 +46490,21 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "insert" + "shortName": "attach_network_endpoints" }, - "description": "Sample for Insert", - "file": "compute_v1_generated_region_instant_snapshots_insert_sync.py", + "description": "Sample for AttachNetworkEndpoints", + "file": "compute_v1_generated_region_network_endpoint_groups_attach_network_endpoints_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionInstantSnapshots_Insert_sync", + "regionTag": "compute_v1_generated_RegionNetworkEndpointGroups_AttachNetworkEndpoints_sync", "segments": [ { - "end": 52, + "end": 53, "start": 27, "type": "FULL" }, { - "end": 52, + "end": 53, "start": 27, "type": "SHORT" }, @@ -44270,43 +46514,43 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 46, + "end": 47, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 49, - "start": 47, + "end": 50, + "start": 48, "type": "REQUEST_EXECUTION" }, { - "end": 53, - "start": 50, + "end": 54, + "start": 51, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_instant_snapshots_insert_sync.py" + "title": "compute_v1_generated_region_network_endpoint_groups_attach_network_endpoints_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionInstantSnapshotsClient", - "shortName": "RegionInstantSnapshotsClient" + "fullName": "google.cloud.compute_v1.RegionNetworkEndpointGroupsClient", + "shortName": "RegionNetworkEndpointGroupsClient" }, - "fullName": "google.cloud.compute_v1.RegionInstantSnapshotsClient.list", + "fullName": "google.cloud.compute_v1.RegionNetworkEndpointGroupsClient.delete", "method": { - "fullName": "google.cloud.compute.v1.RegionInstantSnapshots.List", + "fullName": "google.cloud.compute.v1.RegionNetworkEndpointGroups.Delete", "service": { - "fullName": "google.cloud.compute.v1.RegionInstantSnapshots", - "shortName": "RegionInstantSnapshots" + "fullName": "google.cloud.compute.v1.RegionNetworkEndpointGroups", + "shortName": "RegionNetworkEndpointGroups" }, - "shortName": "List" + "shortName": "Delete" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.ListRegionInstantSnapshotsRequest" + "type": "google.cloud.compute_v1.types.DeleteRegionNetworkEndpointGroupRequest" }, { "name": "project", @@ -44316,6 +46560,10 @@ "name": "region", "type": "str" }, + { + "name": "network_endpoint_group", + "type": "str" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -44329,14 +46577,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.services.region_instant_snapshots.pagers.ListPager", - "shortName": "list" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "delete" }, - "description": "Sample for List", - "file": "compute_v1_generated_region_instant_snapshots_list_sync.py", + "description": "Sample for Delete", + "file": "compute_v1_generated_region_network_endpoint_groups_delete_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionInstantSnapshots_List_sync", + "regionTag": "compute_v1_generated_RegionNetworkEndpointGroups_Delete_sync", "segments": [ { "end": 53, @@ -44354,43 +46602,43 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 46, + "end": 47, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 49, - "start": 47, + "end": 50, + "start": 48, "type": "REQUEST_EXECUTION" }, { "end": 54, - "start": 50, + "start": 51, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_instant_snapshots_list_sync.py" + "title": "compute_v1_generated_region_network_endpoint_groups_delete_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionInstantSnapshotsClient", - "shortName": "RegionInstantSnapshotsClient" + "fullName": "google.cloud.compute_v1.RegionNetworkEndpointGroupsClient", + "shortName": "RegionNetworkEndpointGroupsClient" }, - "fullName": "google.cloud.compute_v1.RegionInstantSnapshotsClient.set_iam_policy", + "fullName": "google.cloud.compute_v1.RegionNetworkEndpointGroupsClient.detach_network_endpoints", "method": { - "fullName": "google.cloud.compute.v1.RegionInstantSnapshots.SetIamPolicy", + "fullName": "google.cloud.compute.v1.RegionNetworkEndpointGroups.DetachNetworkEndpoints", "service": { - "fullName": "google.cloud.compute.v1.RegionInstantSnapshots", - "shortName": "RegionInstantSnapshots" + "fullName": "google.cloud.compute.v1.RegionNetworkEndpointGroups", + "shortName": "RegionNetworkEndpointGroups" }, - "shortName": "SetIamPolicy" + "shortName": "DetachNetworkEndpoints" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.SetIamPolicyRegionInstantSnapshotRequest" + "type": "google.cloud.compute_v1.types.DetachNetworkEndpointsRegionNetworkEndpointGroupRequest" }, { "name": "project", @@ -44401,12 +46649,12 @@ "type": "str" }, { - "name": "resource", + "name": "network_endpoint_group", "type": "str" }, { - "name": "region_set_policy_request_resource", - "type": "google.cloud.compute_v1.types.RegionSetPolicyRequest" + "name": "region_network_endpoint_groups_detach_endpoints_request_resource", + "type": "google.cloud.compute_v1.types.RegionNetworkEndpointGroupsDetachEndpointsRequest" }, { "name": "retry", @@ -44421,14 +46669,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.Policy", - "shortName": "set_iam_policy" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "detach_network_endpoints" }, - "description": "Sample for SetIamPolicy", - "file": "compute_v1_generated_region_instant_snapshots_set_iam_policy_sync.py", + "description": "Sample for DetachNetworkEndpoints", + "file": "compute_v1_generated_region_network_endpoint_groups_detach_network_endpoints_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionInstantSnapshots_SetIamPolicy_sync", + "regionTag": "compute_v1_generated_RegionNetworkEndpointGroups_DetachNetworkEndpoints_sync", "segments": [ { "end": 53, @@ -44461,28 +46709,28 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_instant_snapshots_set_iam_policy_sync.py" + "title": "compute_v1_generated_region_network_endpoint_groups_detach_network_endpoints_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionInstantSnapshotsClient", - "shortName": "RegionInstantSnapshotsClient" + "fullName": "google.cloud.compute_v1.RegionNetworkEndpointGroupsClient", + "shortName": "RegionNetworkEndpointGroupsClient" }, - "fullName": "google.cloud.compute_v1.RegionInstantSnapshotsClient.set_labels", + "fullName": "google.cloud.compute_v1.RegionNetworkEndpointGroupsClient.get", "method": { - "fullName": "google.cloud.compute.v1.RegionInstantSnapshots.SetLabels", + "fullName": "google.cloud.compute.v1.RegionNetworkEndpointGroups.Get", "service": { - "fullName": "google.cloud.compute.v1.RegionInstantSnapshots", - "shortName": "RegionInstantSnapshots" + "fullName": "google.cloud.compute.v1.RegionNetworkEndpointGroups", + "shortName": "RegionNetworkEndpointGroups" }, - "shortName": "SetLabels" + "shortName": "Get" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.SetLabelsRegionInstantSnapshotRequest" + "type": "google.cloud.compute_v1.types.GetRegionNetworkEndpointGroupRequest" }, { "name": "project", @@ -44493,13 +46741,9 @@ "type": "str" }, { - "name": "resource", + "name": "network_endpoint_group", "type": "str" }, - { - "name": "region_set_labels_request_resource", - "type": "google.cloud.compute_v1.types.RegionSetLabelsRequest" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -44513,14 +46757,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "set_labels" + "resultType": "google.cloud.compute_v1.types.NetworkEndpointGroup", + "shortName": "get" }, - "description": "Sample for SetLabels", - "file": "compute_v1_generated_region_instant_snapshots_set_labels_sync.py", + "description": "Sample for Get", + "file": "compute_v1_generated_region_network_endpoint_groups_get_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionInstantSnapshots_SetLabels_sync", + "regionTag": "compute_v1_generated_RegionNetworkEndpointGroups_Get_sync", "segments": [ { "end": 53, @@ -44553,28 +46797,28 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_instant_snapshots_set_labels_sync.py" + "title": "compute_v1_generated_region_network_endpoint_groups_get_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionInstantSnapshotsClient", - "shortName": "RegionInstantSnapshotsClient" + "fullName": "google.cloud.compute_v1.RegionNetworkEndpointGroupsClient", + "shortName": "RegionNetworkEndpointGroupsClient" }, - "fullName": "google.cloud.compute_v1.RegionInstantSnapshotsClient.test_iam_permissions", + "fullName": "google.cloud.compute_v1.RegionNetworkEndpointGroupsClient.insert", "method": { - "fullName": "google.cloud.compute.v1.RegionInstantSnapshots.TestIamPermissions", + "fullName": "google.cloud.compute.v1.RegionNetworkEndpointGroups.Insert", "service": { - "fullName": "google.cloud.compute.v1.RegionInstantSnapshots", - "shortName": "RegionInstantSnapshots" + "fullName": "google.cloud.compute.v1.RegionNetworkEndpointGroups", + "shortName": "RegionNetworkEndpointGroups" }, - "shortName": "TestIamPermissions" + "shortName": "Insert" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.TestIamPermissionsRegionInstantSnapshotRequest" + "type": "google.cloud.compute_v1.types.InsertRegionNetworkEndpointGroupRequest" }, { "name": "project", @@ -44585,12 +46829,8 @@ "type": "str" }, { - "name": "resource", - "type": "str" - }, - { - "name": "test_permissions_request_resource", - "type": "google.cloud.compute_v1.types.TestPermissionsRequest" + "name": "network_endpoint_group_resource", + "type": "google.cloud.compute_v1.types.NetworkEndpointGroup" }, { "name": "retry", @@ -44605,22 +46845,22 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.TestPermissionsResponse", - "shortName": "test_iam_permissions" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "insert" }, - "description": "Sample for TestIamPermissions", - "file": "compute_v1_generated_region_instant_snapshots_test_iam_permissions_sync.py", + "description": "Sample for Insert", + "file": "compute_v1_generated_region_network_endpoint_groups_insert_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionInstantSnapshots_TestIamPermissions_sync", + "regionTag": "compute_v1_generated_RegionNetworkEndpointGroups_Insert_sync", "segments": [ { - "end": 53, + "end": 52, "start": 27, "type": "FULL" }, { - "end": 53, + "end": 52, "start": 27, "type": "SHORT" }, @@ -44630,22 +46870,22 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 47, + "end": 46, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 50, - "start": 48, + "end": 49, + "start": 47, "type": "REQUEST_EXECUTION" }, { - "end": 54, - "start": 51, + "end": 53, + "start": 50, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_instant_snapshots_test_iam_permissions_sync.py" + "title": "compute_v1_generated_region_network_endpoint_groups_insert_sync.py" }, { "canonical": true, @@ -44654,19 +46894,19 @@ "fullName": "google.cloud.compute_v1.RegionNetworkEndpointGroupsClient", "shortName": "RegionNetworkEndpointGroupsClient" }, - "fullName": "google.cloud.compute_v1.RegionNetworkEndpointGroupsClient.attach_network_endpoints", + "fullName": "google.cloud.compute_v1.RegionNetworkEndpointGroupsClient.list_network_endpoints", "method": { - "fullName": "google.cloud.compute.v1.RegionNetworkEndpointGroups.AttachNetworkEndpoints", + "fullName": "google.cloud.compute.v1.RegionNetworkEndpointGroups.ListNetworkEndpoints", "service": { "fullName": "google.cloud.compute.v1.RegionNetworkEndpointGroups", "shortName": "RegionNetworkEndpointGroups" }, - "shortName": "AttachNetworkEndpoints" + "shortName": "ListNetworkEndpoints" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.AttachNetworkEndpointsRegionNetworkEndpointGroupRequest" + "type": "google.cloud.compute_v1.types.ListNetworkEndpointsRegionNetworkEndpointGroupsRequest" }, { "name": "project", @@ -44680,10 +46920,6 @@ "name": "network_endpoint_group", "type": "str" }, - { - "name": "region_network_endpoint_groups_attach_endpoints_request_resource", - "type": "google.cloud.compute_v1.types.RegionNetworkEndpointGroupsAttachEndpointsRequest" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -44697,22 +46933,22 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "attach_network_endpoints" + "resultType": "google.cloud.compute_v1.services.region_network_endpoint_groups.pagers.ListNetworkEndpointsPager", + "shortName": "list_network_endpoints" }, - "description": "Sample for AttachNetworkEndpoints", - "file": "compute_v1_generated_region_network_endpoint_groups_attach_network_endpoints_sync.py", + "description": "Sample for ListNetworkEndpoints", + "file": "compute_v1_generated_region_network_endpoint_groups_list_network_endpoints_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionNetworkEndpointGroups_AttachNetworkEndpoints_sync", + "regionTag": "compute_v1_generated_RegionNetworkEndpointGroups_ListNetworkEndpoints_sync", "segments": [ { - "end": 53, + "end": 54, "start": 27, "type": "FULL" }, { - "end": 53, + "end": 54, "start": 27, "type": "SHORT" }, @@ -44732,12 +46968,12 @@ "type": "REQUEST_EXECUTION" }, { - "end": 54, + "end": 55, "start": 51, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_network_endpoint_groups_attach_network_endpoints_sync.py" + "title": "compute_v1_generated_region_network_endpoint_groups_list_network_endpoints_sync.py" }, { "canonical": true, @@ -44746,19 +46982,19 @@ "fullName": "google.cloud.compute_v1.RegionNetworkEndpointGroupsClient", "shortName": "RegionNetworkEndpointGroupsClient" }, - "fullName": "google.cloud.compute_v1.RegionNetworkEndpointGroupsClient.delete", + "fullName": "google.cloud.compute_v1.RegionNetworkEndpointGroupsClient.list", "method": { - "fullName": "google.cloud.compute.v1.RegionNetworkEndpointGroups.Delete", + "fullName": "google.cloud.compute.v1.RegionNetworkEndpointGroups.List", "service": { "fullName": "google.cloud.compute.v1.RegionNetworkEndpointGroups", "shortName": "RegionNetworkEndpointGroups" }, - "shortName": "Delete" + "shortName": "List" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.DeleteRegionNetworkEndpointGroupRequest" + "type": "google.cloud.compute_v1.types.ListRegionNetworkEndpointGroupsRequest" }, { "name": "project", @@ -44768,10 +47004,6 @@ "name": "region", "type": "str" }, - { - "name": "network_endpoint_group", - "type": "str" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -44785,14 +47017,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "delete" + "resultType": "google.cloud.compute_v1.services.region_network_endpoint_groups.pagers.ListPager", + "shortName": "list" }, - "description": "Sample for Delete", - "file": "compute_v1_generated_region_network_endpoint_groups_delete_sync.py", + "description": "Sample for List", + "file": "compute_v1_generated_region_network_endpoint_groups_list_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionNetworkEndpointGroups_Delete_sync", + "regionTag": "compute_v1_generated_RegionNetworkEndpointGroups_List_sync", "segments": [ { "end": 53, @@ -44810,43 +47042,43 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 47, + "end": 46, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 50, - "start": 48, + "end": 49, + "start": 47, "type": "REQUEST_EXECUTION" }, { "end": 54, - "start": 51, + "start": 50, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_network_endpoint_groups_delete_sync.py" + "title": "compute_v1_generated_region_network_endpoint_groups_list_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionNetworkEndpointGroupsClient", - "shortName": "RegionNetworkEndpointGroupsClient" + "fullName": "google.cloud.compute_v1.RegionNetworkFirewallPoliciesClient", + "shortName": "RegionNetworkFirewallPoliciesClient" }, - "fullName": "google.cloud.compute_v1.RegionNetworkEndpointGroupsClient.detach_network_endpoints", + "fullName": "google.cloud.compute_v1.RegionNetworkFirewallPoliciesClient.add_association", "method": { - "fullName": "google.cloud.compute.v1.RegionNetworkEndpointGroups.DetachNetworkEndpoints", + "fullName": "google.cloud.compute.v1.RegionNetworkFirewallPolicies.AddAssociation", "service": { - "fullName": "google.cloud.compute.v1.RegionNetworkEndpointGroups", - "shortName": "RegionNetworkEndpointGroups" + "fullName": "google.cloud.compute.v1.RegionNetworkFirewallPolicies", + "shortName": "RegionNetworkFirewallPolicies" }, - "shortName": "DetachNetworkEndpoints" + "shortName": "AddAssociation" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.DetachNetworkEndpointsRegionNetworkEndpointGroupRequest" + "type": "google.cloud.compute_v1.types.AddAssociationRegionNetworkFirewallPolicyRequest" }, { "name": "project", @@ -44857,12 +47089,12 @@ "type": "str" }, { - "name": "network_endpoint_group", + "name": "firewall_policy", "type": "str" }, { - "name": "region_network_endpoint_groups_detach_endpoints_request_resource", - "type": "google.cloud.compute_v1.types.RegionNetworkEndpointGroupsDetachEndpointsRequest" + "name": "firewall_policy_association_resource", + "type": "google.cloud.compute_v1.types.FirewallPolicyAssociation" }, { "name": "retry", @@ -44878,13 +47110,13 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "detach_network_endpoints" + "shortName": "add_association" }, - "description": "Sample for DetachNetworkEndpoints", - "file": "compute_v1_generated_region_network_endpoint_groups_detach_network_endpoints_sync.py", + "description": "Sample for AddAssociation", + "file": "compute_v1_generated_region_network_firewall_policies_add_association_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionNetworkEndpointGroups_DetachNetworkEndpoints_sync", + "regionTag": "compute_v1_generated_RegionNetworkFirewallPolicies_AddAssociation_sync", "segments": [ { "end": 53, @@ -44917,28 +47149,28 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_network_endpoint_groups_detach_network_endpoints_sync.py" + "title": "compute_v1_generated_region_network_firewall_policies_add_association_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionNetworkEndpointGroupsClient", - "shortName": "RegionNetworkEndpointGroupsClient" + "fullName": "google.cloud.compute_v1.RegionNetworkFirewallPoliciesClient", + "shortName": "RegionNetworkFirewallPoliciesClient" }, - "fullName": "google.cloud.compute_v1.RegionNetworkEndpointGroupsClient.get", + "fullName": "google.cloud.compute_v1.RegionNetworkFirewallPoliciesClient.add_rule", "method": { - "fullName": "google.cloud.compute.v1.RegionNetworkEndpointGroups.Get", + "fullName": "google.cloud.compute.v1.RegionNetworkFirewallPolicies.AddRule", "service": { - "fullName": "google.cloud.compute.v1.RegionNetworkEndpointGroups", - "shortName": "RegionNetworkEndpointGroups" + "fullName": "google.cloud.compute.v1.RegionNetworkFirewallPolicies", + "shortName": "RegionNetworkFirewallPolicies" }, - "shortName": "Get" + "shortName": "AddRule" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetRegionNetworkEndpointGroupRequest" + "type": "google.cloud.compute_v1.types.AddRuleRegionNetworkFirewallPolicyRequest" }, { "name": "project", @@ -44949,9 +47181,13 @@ "type": "str" }, { - "name": "network_endpoint_group", + "name": "firewall_policy", "type": "str" }, + { + "name": "firewall_policy_rule_resource", + "type": "google.cloud.compute_v1.types.FirewallPolicyRule" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -44965,14 +47201,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.NetworkEndpointGroup", - "shortName": "get" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "add_rule" }, - "description": "Sample for Get", - "file": "compute_v1_generated_region_network_endpoint_groups_get_sync.py", + "description": "Sample for AddRule", + "file": "compute_v1_generated_region_network_firewall_policies_add_rule_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionNetworkEndpointGroups_Get_sync", + "regionTag": "compute_v1_generated_RegionNetworkFirewallPolicies_AddRule_sync", "segments": [ { "end": 53, @@ -45005,28 +47241,28 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_network_endpoint_groups_get_sync.py" + "title": "compute_v1_generated_region_network_firewall_policies_add_rule_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionNetworkEndpointGroupsClient", - "shortName": "RegionNetworkEndpointGroupsClient" + "fullName": "google.cloud.compute_v1.RegionNetworkFirewallPoliciesClient", + "shortName": "RegionNetworkFirewallPoliciesClient" }, - "fullName": "google.cloud.compute_v1.RegionNetworkEndpointGroupsClient.insert", + "fullName": "google.cloud.compute_v1.RegionNetworkFirewallPoliciesClient.clone_rules", "method": { - "fullName": "google.cloud.compute.v1.RegionNetworkEndpointGroups.Insert", + "fullName": "google.cloud.compute.v1.RegionNetworkFirewallPolicies.CloneRules", "service": { - "fullName": "google.cloud.compute.v1.RegionNetworkEndpointGroups", - "shortName": "RegionNetworkEndpointGroups" + "fullName": "google.cloud.compute.v1.RegionNetworkFirewallPolicies", + "shortName": "RegionNetworkFirewallPolicies" }, - "shortName": "Insert" + "shortName": "CloneRules" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.InsertRegionNetworkEndpointGroupRequest" + "type": "google.cloud.compute_v1.types.CloneRulesRegionNetworkFirewallPolicyRequest" }, { "name": "project", @@ -45037,8 +47273,8 @@ "type": "str" }, { - "name": "network_endpoint_group_resource", - "type": "google.cloud.compute_v1.types.NetworkEndpointGroup" + "name": "firewall_policy", + "type": "str" }, { "name": "retry", @@ -45054,109 +47290,21 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "insert" + "shortName": "clone_rules" }, - "description": "Sample for Insert", - "file": "compute_v1_generated_region_network_endpoint_groups_insert_sync.py", + "description": "Sample for CloneRules", + "file": "compute_v1_generated_region_network_firewall_policies_clone_rules_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionNetworkEndpointGroups_Insert_sync", + "regionTag": "compute_v1_generated_RegionNetworkFirewallPolicies_CloneRules_sync", "segments": [ - { - "end": 52, - "start": 27, - "type": "FULL" - }, - { - "end": 52, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 46, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 49, - "start": 47, - "type": "REQUEST_EXECUTION" - }, { "end": 53, - "start": 50, - "type": "RESPONSE_HANDLING" - } - ], - "title": "compute_v1_generated_region_network_endpoint_groups_insert_sync.py" - }, - { - "canonical": true, - "clientMethod": { - "client": { - "fullName": "google.cloud.compute_v1.RegionNetworkEndpointGroupsClient", - "shortName": "RegionNetworkEndpointGroupsClient" - }, - "fullName": "google.cloud.compute_v1.RegionNetworkEndpointGroupsClient.list_network_endpoints", - "method": { - "fullName": "google.cloud.compute.v1.RegionNetworkEndpointGroups.ListNetworkEndpoints", - "service": { - "fullName": "google.cloud.compute.v1.RegionNetworkEndpointGroups", - "shortName": "RegionNetworkEndpointGroups" - }, - "shortName": "ListNetworkEndpoints" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.compute_v1.types.ListNetworkEndpointsRegionNetworkEndpointGroupsRequest" - }, - { - "name": "project", - "type": "str" - }, - { - "name": "region", - "type": "str" - }, - { - "name": "network_endpoint_group", - "type": "str" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, Union[str, bytes]]]" - } - ], - "resultType": "google.cloud.compute_v1.services.region_network_endpoint_groups.pagers.ListNetworkEndpointsPager", - "shortName": "list_network_endpoints" - }, - "description": "Sample for ListNetworkEndpoints", - "file": "compute_v1_generated_region_network_endpoint_groups_list_network_endpoints_sync.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionNetworkEndpointGroups_ListNetworkEndpoints_sync", - "segments": [ - { - "end": 54, "start": 27, "type": "FULL" }, { - "end": 54, + "end": 53, "start": 27, "type": "SHORT" }, @@ -45176,33 +47324,33 @@ "type": "REQUEST_EXECUTION" }, { - "end": 55, + "end": 54, "start": 51, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_network_endpoint_groups_list_network_endpoints_sync.py" + "title": "compute_v1_generated_region_network_firewall_policies_clone_rules_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionNetworkEndpointGroupsClient", - "shortName": "RegionNetworkEndpointGroupsClient" + "fullName": "google.cloud.compute_v1.RegionNetworkFirewallPoliciesClient", + "shortName": "RegionNetworkFirewallPoliciesClient" }, - "fullName": "google.cloud.compute_v1.RegionNetworkEndpointGroupsClient.list", + "fullName": "google.cloud.compute_v1.RegionNetworkFirewallPoliciesClient.delete", "method": { - "fullName": "google.cloud.compute.v1.RegionNetworkEndpointGroups.List", + "fullName": "google.cloud.compute.v1.RegionNetworkFirewallPolicies.Delete", "service": { - "fullName": "google.cloud.compute.v1.RegionNetworkEndpointGroups", - "shortName": "RegionNetworkEndpointGroups" + "fullName": "google.cloud.compute.v1.RegionNetworkFirewallPolicies", + "shortName": "RegionNetworkFirewallPolicies" }, - "shortName": "List" + "shortName": "Delete" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.ListRegionNetworkEndpointGroupsRequest" + "type": "google.cloud.compute_v1.types.DeleteRegionNetworkFirewallPolicyRequest" }, { "name": "project", @@ -45212,6 +47360,10 @@ "name": "region", "type": "str" }, + { + "name": "firewall_policy", + "type": "str" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -45225,14 +47377,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.services.region_network_endpoint_groups.pagers.ListPager", - "shortName": "list" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "delete" }, - "description": "Sample for List", - "file": "compute_v1_generated_region_network_endpoint_groups_list_sync.py", + "description": "Sample for Delete", + "file": "compute_v1_generated_region_network_firewall_policies_delete_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionNetworkEndpointGroups_List_sync", + "regionTag": "compute_v1_generated_RegionNetworkFirewallPolicies_Delete_sync", "segments": [ { "end": 53, @@ -45250,22 +47402,22 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 46, + "end": 47, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 49, - "start": 47, + "end": 50, + "start": 48, "type": "REQUEST_EXECUTION" }, { "end": 54, - "start": 50, + "start": 51, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_network_endpoint_groups_list_sync.py" + "title": "compute_v1_generated_region_network_firewall_policies_delete_sync.py" }, { "canonical": true, @@ -45274,19 +47426,19 @@ "fullName": "google.cloud.compute_v1.RegionNetworkFirewallPoliciesClient", "shortName": "RegionNetworkFirewallPoliciesClient" }, - "fullName": "google.cloud.compute_v1.RegionNetworkFirewallPoliciesClient.add_association", + "fullName": "google.cloud.compute_v1.RegionNetworkFirewallPoliciesClient.get_association", "method": { - "fullName": "google.cloud.compute.v1.RegionNetworkFirewallPolicies.AddAssociation", + "fullName": "google.cloud.compute.v1.RegionNetworkFirewallPolicies.GetAssociation", "service": { "fullName": "google.cloud.compute.v1.RegionNetworkFirewallPolicies", "shortName": "RegionNetworkFirewallPolicies" }, - "shortName": "AddAssociation" + "shortName": "GetAssociation" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.AddAssociationRegionNetworkFirewallPolicyRequest" + "type": "google.cloud.compute_v1.types.GetAssociationRegionNetworkFirewallPolicyRequest" }, { "name": "project", @@ -45300,10 +47452,6 @@ "name": "firewall_policy", "type": "str" }, - { - "name": "firewall_policy_association_resource", - "type": "google.cloud.compute_v1.types.FirewallPolicyAssociation" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -45317,14 +47465,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "add_association" + "resultType": "google.cloud.compute_v1.types.FirewallPolicyAssociation", + "shortName": "get_association" }, - "description": "Sample for AddAssociation", - "file": "compute_v1_generated_region_network_firewall_policies_add_association_sync.py", + "description": "Sample for GetAssociation", + "file": "compute_v1_generated_region_network_firewall_policies_get_association_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionNetworkFirewallPolicies_AddAssociation_sync", + "regionTag": "compute_v1_generated_RegionNetworkFirewallPolicies_GetAssociation_sync", "segments": [ { "end": 53, @@ -45357,7 +47505,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_network_firewall_policies_add_association_sync.py" + "title": "compute_v1_generated_region_network_firewall_policies_get_association_sync.py" }, { "canonical": true, @@ -45366,19 +47514,19 @@ "fullName": "google.cloud.compute_v1.RegionNetworkFirewallPoliciesClient", "shortName": "RegionNetworkFirewallPoliciesClient" }, - "fullName": "google.cloud.compute_v1.RegionNetworkFirewallPoliciesClient.add_rule", + "fullName": "google.cloud.compute_v1.RegionNetworkFirewallPoliciesClient.get_effective_firewalls", "method": { - "fullName": "google.cloud.compute.v1.RegionNetworkFirewallPolicies.AddRule", + "fullName": "google.cloud.compute.v1.RegionNetworkFirewallPolicies.GetEffectiveFirewalls", "service": { "fullName": "google.cloud.compute.v1.RegionNetworkFirewallPolicies", "shortName": "RegionNetworkFirewallPolicies" }, - "shortName": "AddRule" + "shortName": "GetEffectiveFirewalls" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.AddRuleRegionNetworkFirewallPolicyRequest" + "type": "google.cloud.compute_v1.types.GetEffectiveFirewallsRegionNetworkFirewallPolicyRequest" }, { "name": "project", @@ -45389,13 +47537,9 @@ "type": "str" }, { - "name": "firewall_policy", + "name": "network", "type": "str" }, - { - "name": "firewall_policy_rule_resource", - "type": "google.cloud.compute_v1.types.FirewallPolicyRule" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -45409,14 +47553,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "add_rule" + "resultType": "google.cloud.compute_v1.types.RegionNetworkFirewallPoliciesGetEffectiveFirewallsResponse", + "shortName": "get_effective_firewalls" }, - "description": "Sample for AddRule", - "file": "compute_v1_generated_region_network_firewall_policies_add_rule_sync.py", + "description": "Sample for GetEffectiveFirewalls", + "file": "compute_v1_generated_region_network_firewall_policies_get_effective_firewalls_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionNetworkFirewallPolicies_AddRule_sync", + "regionTag": "compute_v1_generated_RegionNetworkFirewallPolicies_GetEffectiveFirewalls_sync", "segments": [ { "end": 53, @@ -45449,7 +47593,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_network_firewall_policies_add_rule_sync.py" + "title": "compute_v1_generated_region_network_firewall_policies_get_effective_firewalls_sync.py" }, { "canonical": true, @@ -45458,19 +47602,19 @@ "fullName": "google.cloud.compute_v1.RegionNetworkFirewallPoliciesClient", "shortName": "RegionNetworkFirewallPoliciesClient" }, - "fullName": "google.cloud.compute_v1.RegionNetworkFirewallPoliciesClient.clone_rules", + "fullName": "google.cloud.compute_v1.RegionNetworkFirewallPoliciesClient.get_iam_policy", "method": { - "fullName": "google.cloud.compute.v1.RegionNetworkFirewallPolicies.CloneRules", + "fullName": "google.cloud.compute.v1.RegionNetworkFirewallPolicies.GetIamPolicy", "service": { "fullName": "google.cloud.compute.v1.RegionNetworkFirewallPolicies", "shortName": "RegionNetworkFirewallPolicies" }, - "shortName": "CloneRules" + "shortName": "GetIamPolicy" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.CloneRulesRegionNetworkFirewallPolicyRequest" + "type": "google.cloud.compute_v1.types.GetIamPolicyRegionNetworkFirewallPolicyRequest" }, { "name": "project", @@ -45481,7 +47625,7 @@ "type": "str" }, { - "name": "firewall_policy", + "name": "resource", "type": "str" }, { @@ -45497,14 +47641,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "clone_rules" + "resultType": "google.cloud.compute_v1.types.Policy", + "shortName": "get_iam_policy" }, - "description": "Sample for CloneRules", - "file": "compute_v1_generated_region_network_firewall_policies_clone_rules_sync.py", + "description": "Sample for GetIamPolicy", + "file": "compute_v1_generated_region_network_firewall_policies_get_iam_policy_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionNetworkFirewallPolicies_CloneRules_sync", + "regionTag": "compute_v1_generated_RegionNetworkFirewallPolicies_GetIamPolicy_sync", "segments": [ { "end": 53, @@ -45537,7 +47681,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_network_firewall_policies_clone_rules_sync.py" + "title": "compute_v1_generated_region_network_firewall_policies_get_iam_policy_sync.py" }, { "canonical": true, @@ -45546,19 +47690,19 @@ "fullName": "google.cloud.compute_v1.RegionNetworkFirewallPoliciesClient", "shortName": "RegionNetworkFirewallPoliciesClient" }, - "fullName": "google.cloud.compute_v1.RegionNetworkFirewallPoliciesClient.delete", + "fullName": "google.cloud.compute_v1.RegionNetworkFirewallPoliciesClient.get_rule", "method": { - "fullName": "google.cloud.compute.v1.RegionNetworkFirewallPolicies.Delete", + "fullName": "google.cloud.compute.v1.RegionNetworkFirewallPolicies.GetRule", "service": { "fullName": "google.cloud.compute.v1.RegionNetworkFirewallPolicies", "shortName": "RegionNetworkFirewallPolicies" }, - "shortName": "Delete" + "shortName": "GetRule" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.DeleteRegionNetworkFirewallPolicyRequest" + "type": "google.cloud.compute_v1.types.GetRuleRegionNetworkFirewallPolicyRequest" }, { "name": "project", @@ -45585,14 +47729,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "delete" + "resultType": "google.cloud.compute_v1.types.FirewallPolicyRule", + "shortName": "get_rule" }, - "description": "Sample for Delete", - "file": "compute_v1_generated_region_network_firewall_policies_delete_sync.py", + "description": "Sample for GetRule", + "file": "compute_v1_generated_region_network_firewall_policies_get_rule_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionNetworkFirewallPolicies_Delete_sync", + "regionTag": "compute_v1_generated_RegionNetworkFirewallPolicies_GetRule_sync", "segments": [ { "end": 53, @@ -45625,7 +47769,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_network_firewall_policies_delete_sync.py" + "title": "compute_v1_generated_region_network_firewall_policies_get_rule_sync.py" }, { "canonical": true, @@ -45634,19 +47778,19 @@ "fullName": "google.cloud.compute_v1.RegionNetworkFirewallPoliciesClient", "shortName": "RegionNetworkFirewallPoliciesClient" }, - "fullName": "google.cloud.compute_v1.RegionNetworkFirewallPoliciesClient.get_association", + "fullName": "google.cloud.compute_v1.RegionNetworkFirewallPoliciesClient.get", "method": { - "fullName": "google.cloud.compute.v1.RegionNetworkFirewallPolicies.GetAssociation", + "fullName": "google.cloud.compute.v1.RegionNetworkFirewallPolicies.Get", "service": { "fullName": "google.cloud.compute.v1.RegionNetworkFirewallPolicies", "shortName": "RegionNetworkFirewallPolicies" }, - "shortName": "GetAssociation" + "shortName": "Get" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetAssociationRegionNetworkFirewallPolicyRequest" + "type": "google.cloud.compute_v1.types.GetRegionNetworkFirewallPolicyRequest" }, { "name": "project", @@ -45673,14 +47817,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.FirewallPolicyAssociation", - "shortName": "get_association" + "resultType": "google.cloud.compute_v1.types.FirewallPolicy", + "shortName": "get" }, - "description": "Sample for GetAssociation", - "file": "compute_v1_generated_region_network_firewall_policies_get_association_sync.py", + "description": "Sample for Get", + "file": "compute_v1_generated_region_network_firewall_policies_get_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionNetworkFirewallPolicies_GetAssociation_sync", + "regionTag": "compute_v1_generated_RegionNetworkFirewallPolicies_Get_sync", "segments": [ { "end": 53, @@ -45713,7 +47857,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_network_firewall_policies_get_association_sync.py" + "title": "compute_v1_generated_region_network_firewall_policies_get_sync.py" }, { "canonical": true, @@ -45722,19 +47866,19 @@ "fullName": "google.cloud.compute_v1.RegionNetworkFirewallPoliciesClient", "shortName": "RegionNetworkFirewallPoliciesClient" }, - "fullName": "google.cloud.compute_v1.RegionNetworkFirewallPoliciesClient.get_effective_firewalls", + "fullName": "google.cloud.compute_v1.RegionNetworkFirewallPoliciesClient.insert", "method": { - "fullName": "google.cloud.compute.v1.RegionNetworkFirewallPolicies.GetEffectiveFirewalls", + "fullName": "google.cloud.compute.v1.RegionNetworkFirewallPolicies.Insert", "service": { "fullName": "google.cloud.compute.v1.RegionNetworkFirewallPolicies", "shortName": "RegionNetworkFirewallPolicies" }, - "shortName": "GetEffectiveFirewalls" + "shortName": "Insert" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetEffectiveFirewallsRegionNetworkFirewallPolicyRequest" + "type": "google.cloud.compute_v1.types.InsertRegionNetworkFirewallPolicyRequest" }, { "name": "project", @@ -45745,8 +47889,8 @@ "type": "str" }, { - "name": "network", - "type": "str" + "name": "firewall_policy_resource", + "type": "google.cloud.compute_v1.types.FirewallPolicy" }, { "name": "retry", @@ -45761,22 +47905,22 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.RegionNetworkFirewallPoliciesGetEffectiveFirewallsResponse", - "shortName": "get_effective_firewalls" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "insert" }, - "description": "Sample for GetEffectiveFirewalls", - "file": "compute_v1_generated_region_network_firewall_policies_get_effective_firewalls_sync.py", + "description": "Sample for Insert", + "file": "compute_v1_generated_region_network_firewall_policies_insert_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionNetworkFirewallPolicies_GetEffectiveFirewalls_sync", + "regionTag": "compute_v1_generated_RegionNetworkFirewallPolicies_Insert_sync", "segments": [ { - "end": 53, + "end": 52, "start": 27, "type": "FULL" }, { - "end": 53, + "end": 52, "start": 27, "type": "SHORT" }, @@ -45786,22 +47930,22 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 47, + "end": 46, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 50, - "start": 48, + "end": 49, + "start": 47, "type": "REQUEST_EXECUTION" }, { - "end": 54, - "start": 51, + "end": 53, + "start": 50, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_network_firewall_policies_get_effective_firewalls_sync.py" + "title": "compute_v1_generated_region_network_firewall_policies_insert_sync.py" }, { "canonical": true, @@ -45810,19 +47954,19 @@ "fullName": "google.cloud.compute_v1.RegionNetworkFirewallPoliciesClient", "shortName": "RegionNetworkFirewallPoliciesClient" }, - "fullName": "google.cloud.compute_v1.RegionNetworkFirewallPoliciesClient.get_iam_policy", + "fullName": "google.cloud.compute_v1.RegionNetworkFirewallPoliciesClient.list", "method": { - "fullName": "google.cloud.compute.v1.RegionNetworkFirewallPolicies.GetIamPolicy", + "fullName": "google.cloud.compute.v1.RegionNetworkFirewallPolicies.List", "service": { "fullName": "google.cloud.compute.v1.RegionNetworkFirewallPolicies", "shortName": "RegionNetworkFirewallPolicies" }, - "shortName": "GetIamPolicy" + "shortName": "List" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetIamPolicyRegionNetworkFirewallPolicyRequest" + "type": "google.cloud.compute_v1.types.ListRegionNetworkFirewallPoliciesRequest" }, { "name": "project", @@ -45832,10 +47976,6 @@ "name": "region", "type": "str" }, - { - "name": "resource", - "type": "str" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -45849,14 +47989,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.Policy", - "shortName": "get_iam_policy" + "resultType": "google.cloud.compute_v1.services.region_network_firewall_policies.pagers.ListPager", + "shortName": "list" }, - "description": "Sample for GetIamPolicy", - "file": "compute_v1_generated_region_network_firewall_policies_get_iam_policy_sync.py", + "description": "Sample for List", + "file": "compute_v1_generated_region_network_firewall_policies_list_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionNetworkFirewallPolicies_GetIamPolicy_sync", + "regionTag": "compute_v1_generated_RegionNetworkFirewallPolicies_List_sync", "segments": [ { "end": 53, @@ -45874,22 +48014,22 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 47, + "end": 46, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 50, - "start": 48, + "end": 49, + "start": 47, "type": "REQUEST_EXECUTION" }, { "end": 54, - "start": 51, + "start": 50, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_network_firewall_policies_get_iam_policy_sync.py" + "title": "compute_v1_generated_region_network_firewall_policies_list_sync.py" }, { "canonical": true, @@ -45898,19 +48038,19 @@ "fullName": "google.cloud.compute_v1.RegionNetworkFirewallPoliciesClient", "shortName": "RegionNetworkFirewallPoliciesClient" }, - "fullName": "google.cloud.compute_v1.RegionNetworkFirewallPoliciesClient.get_rule", + "fullName": "google.cloud.compute_v1.RegionNetworkFirewallPoliciesClient.patch_rule", "method": { - "fullName": "google.cloud.compute.v1.RegionNetworkFirewallPolicies.GetRule", + "fullName": "google.cloud.compute.v1.RegionNetworkFirewallPolicies.PatchRule", "service": { "fullName": "google.cloud.compute.v1.RegionNetworkFirewallPolicies", "shortName": "RegionNetworkFirewallPolicies" }, - "shortName": "GetRule" + "shortName": "PatchRule" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetRuleRegionNetworkFirewallPolicyRequest" + "type": "google.cloud.compute_v1.types.PatchRuleRegionNetworkFirewallPolicyRequest" }, { "name": "project", @@ -45924,6 +48064,10 @@ "name": "firewall_policy", "type": "str" }, + { + "name": "firewall_policy_rule_resource", + "type": "google.cloud.compute_v1.types.FirewallPolicyRule" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -45937,14 +48081,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.FirewallPolicyRule", - "shortName": "get_rule" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "patch_rule" }, - "description": "Sample for GetRule", - "file": "compute_v1_generated_region_network_firewall_policies_get_rule_sync.py", + "description": "Sample for PatchRule", + "file": "compute_v1_generated_region_network_firewall_policies_patch_rule_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionNetworkFirewallPolicies_GetRule_sync", + "regionTag": "compute_v1_generated_RegionNetworkFirewallPolicies_PatchRule_sync", "segments": [ { "end": 53, @@ -45977,7 +48121,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_network_firewall_policies_get_rule_sync.py" + "title": "compute_v1_generated_region_network_firewall_policies_patch_rule_sync.py" }, { "canonical": true, @@ -45986,19 +48130,19 @@ "fullName": "google.cloud.compute_v1.RegionNetworkFirewallPoliciesClient", "shortName": "RegionNetworkFirewallPoliciesClient" }, - "fullName": "google.cloud.compute_v1.RegionNetworkFirewallPoliciesClient.get", + "fullName": "google.cloud.compute_v1.RegionNetworkFirewallPoliciesClient.patch", "method": { - "fullName": "google.cloud.compute.v1.RegionNetworkFirewallPolicies.Get", + "fullName": "google.cloud.compute.v1.RegionNetworkFirewallPolicies.Patch", "service": { "fullName": "google.cloud.compute.v1.RegionNetworkFirewallPolicies", "shortName": "RegionNetworkFirewallPolicies" }, - "shortName": "Get" + "shortName": "Patch" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetRegionNetworkFirewallPolicyRequest" + "type": "google.cloud.compute_v1.types.PatchRegionNetworkFirewallPolicyRequest" }, { "name": "project", @@ -46012,6 +48156,10 @@ "name": "firewall_policy", "type": "str" }, + { + "name": "firewall_policy_resource", + "type": "google.cloud.compute_v1.types.FirewallPolicy" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -46025,14 +48173,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.FirewallPolicy", - "shortName": "get" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "patch" }, - "description": "Sample for Get", - "file": "compute_v1_generated_region_network_firewall_policies_get_sync.py", + "description": "Sample for Patch", + "file": "compute_v1_generated_region_network_firewall_policies_patch_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionNetworkFirewallPolicies_Get_sync", + "regionTag": "compute_v1_generated_RegionNetworkFirewallPolicies_Patch_sync", "segments": [ { "end": 53, @@ -46065,7 +48213,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_network_firewall_policies_get_sync.py" + "title": "compute_v1_generated_region_network_firewall_policies_patch_sync.py" }, { "canonical": true, @@ -46074,19 +48222,19 @@ "fullName": "google.cloud.compute_v1.RegionNetworkFirewallPoliciesClient", "shortName": "RegionNetworkFirewallPoliciesClient" }, - "fullName": "google.cloud.compute_v1.RegionNetworkFirewallPoliciesClient.insert", + "fullName": "google.cloud.compute_v1.RegionNetworkFirewallPoliciesClient.remove_association", "method": { - "fullName": "google.cloud.compute.v1.RegionNetworkFirewallPolicies.Insert", + "fullName": "google.cloud.compute.v1.RegionNetworkFirewallPolicies.RemoveAssociation", "service": { "fullName": "google.cloud.compute.v1.RegionNetworkFirewallPolicies", "shortName": "RegionNetworkFirewallPolicies" }, - "shortName": "Insert" + "shortName": "RemoveAssociation" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.InsertRegionNetworkFirewallPolicyRequest" + "type": "google.cloud.compute_v1.types.RemoveAssociationRegionNetworkFirewallPolicyRequest" }, { "name": "project", @@ -46097,8 +48245,8 @@ "type": "str" }, { - "name": "firewall_policy_resource", - "type": "google.cloud.compute_v1.types.FirewallPolicy" + "name": "firewall_policy", + "type": "str" }, { "name": "retry", @@ -46114,21 +48262,21 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "insert" + "shortName": "remove_association" }, - "description": "Sample for Insert", - "file": "compute_v1_generated_region_network_firewall_policies_insert_sync.py", + "description": "Sample for RemoveAssociation", + "file": "compute_v1_generated_region_network_firewall_policies_remove_association_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionNetworkFirewallPolicies_Insert_sync", + "regionTag": "compute_v1_generated_RegionNetworkFirewallPolicies_RemoveAssociation_sync", "segments": [ { - "end": 52, + "end": 53, "start": 27, "type": "FULL" }, { - "end": 52, + "end": 53, "start": 27, "type": "SHORT" }, @@ -46138,22 +48286,22 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 46, + "end": 47, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 49, - "start": 47, + "end": 50, + "start": 48, "type": "REQUEST_EXECUTION" }, { - "end": 53, - "start": 50, + "end": 54, + "start": 51, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_network_firewall_policies_insert_sync.py" + "title": "compute_v1_generated_region_network_firewall_policies_remove_association_sync.py" }, { "canonical": true, @@ -46162,19 +48310,19 @@ "fullName": "google.cloud.compute_v1.RegionNetworkFirewallPoliciesClient", "shortName": "RegionNetworkFirewallPoliciesClient" }, - "fullName": "google.cloud.compute_v1.RegionNetworkFirewallPoliciesClient.list", + "fullName": "google.cloud.compute_v1.RegionNetworkFirewallPoliciesClient.remove_rule", "method": { - "fullName": "google.cloud.compute.v1.RegionNetworkFirewallPolicies.List", + "fullName": "google.cloud.compute.v1.RegionNetworkFirewallPolicies.RemoveRule", "service": { "fullName": "google.cloud.compute.v1.RegionNetworkFirewallPolicies", "shortName": "RegionNetworkFirewallPolicies" }, - "shortName": "List" + "shortName": "RemoveRule" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.ListRegionNetworkFirewallPoliciesRequest" + "type": "google.cloud.compute_v1.types.RemoveRuleRegionNetworkFirewallPolicyRequest" }, { "name": "project", @@ -46184,6 +48332,10 @@ "name": "region", "type": "str" }, + { + "name": "firewall_policy", + "type": "str" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -46197,14 +48349,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.services.region_network_firewall_policies.pagers.ListPager", - "shortName": "list" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "remove_rule" }, - "description": "Sample for List", - "file": "compute_v1_generated_region_network_firewall_policies_list_sync.py", + "description": "Sample for RemoveRule", + "file": "compute_v1_generated_region_network_firewall_policies_remove_rule_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionNetworkFirewallPolicies_List_sync", + "regionTag": "compute_v1_generated_RegionNetworkFirewallPolicies_RemoveRule_sync", "segments": [ { "end": 53, @@ -46222,22 +48374,22 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 46, + "end": 47, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 49, - "start": 47, + "end": 50, + "start": 48, "type": "REQUEST_EXECUTION" }, { "end": 54, - "start": 50, + "start": 51, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_network_firewall_policies_list_sync.py" + "title": "compute_v1_generated_region_network_firewall_policies_remove_rule_sync.py" }, { "canonical": true, @@ -46246,19 +48398,19 @@ "fullName": "google.cloud.compute_v1.RegionNetworkFirewallPoliciesClient", "shortName": "RegionNetworkFirewallPoliciesClient" }, - "fullName": "google.cloud.compute_v1.RegionNetworkFirewallPoliciesClient.patch_rule", + "fullName": "google.cloud.compute_v1.RegionNetworkFirewallPoliciesClient.set_iam_policy", "method": { - "fullName": "google.cloud.compute.v1.RegionNetworkFirewallPolicies.PatchRule", + "fullName": "google.cloud.compute.v1.RegionNetworkFirewallPolicies.SetIamPolicy", "service": { "fullName": "google.cloud.compute.v1.RegionNetworkFirewallPolicies", "shortName": "RegionNetworkFirewallPolicies" }, - "shortName": "PatchRule" + "shortName": "SetIamPolicy" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.PatchRuleRegionNetworkFirewallPolicyRequest" + "type": "google.cloud.compute_v1.types.SetIamPolicyRegionNetworkFirewallPolicyRequest" }, { "name": "project", @@ -46269,12 +48421,12 @@ "type": "str" }, { - "name": "firewall_policy", + "name": "resource", "type": "str" }, { - "name": "firewall_policy_rule_resource", - "type": "google.cloud.compute_v1.types.FirewallPolicyRule" + "name": "region_set_policy_request_resource", + "type": "google.cloud.compute_v1.types.RegionSetPolicyRequest" }, { "name": "retry", @@ -46289,14 +48441,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "patch_rule" + "resultType": "google.cloud.compute_v1.types.Policy", + "shortName": "set_iam_policy" }, - "description": "Sample for PatchRule", - "file": "compute_v1_generated_region_network_firewall_policies_patch_rule_sync.py", + "description": "Sample for SetIamPolicy", + "file": "compute_v1_generated_region_network_firewall_policies_set_iam_policy_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionNetworkFirewallPolicies_PatchRule_sync", + "regionTag": "compute_v1_generated_RegionNetworkFirewallPolicies_SetIamPolicy_sync", "segments": [ { "end": 53, @@ -46329,7 +48481,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_network_firewall_policies_patch_rule_sync.py" + "title": "compute_v1_generated_region_network_firewall_policies_set_iam_policy_sync.py" }, { "canonical": true, @@ -46338,19 +48490,19 @@ "fullName": "google.cloud.compute_v1.RegionNetworkFirewallPoliciesClient", "shortName": "RegionNetworkFirewallPoliciesClient" }, - "fullName": "google.cloud.compute_v1.RegionNetworkFirewallPoliciesClient.patch", + "fullName": "google.cloud.compute_v1.RegionNetworkFirewallPoliciesClient.test_iam_permissions", "method": { - "fullName": "google.cloud.compute.v1.RegionNetworkFirewallPolicies.Patch", + "fullName": "google.cloud.compute.v1.RegionNetworkFirewallPolicies.TestIamPermissions", "service": { "fullName": "google.cloud.compute.v1.RegionNetworkFirewallPolicies", "shortName": "RegionNetworkFirewallPolicies" }, - "shortName": "Patch" + "shortName": "TestIamPermissions" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.PatchRegionNetworkFirewallPolicyRequest" + "type": "google.cloud.compute_v1.types.TestIamPermissionsRegionNetworkFirewallPolicyRequest" }, { "name": "project", @@ -46361,12 +48513,12 @@ "type": "str" }, { - "name": "firewall_policy", + "name": "resource", "type": "str" }, { - "name": "firewall_policy_resource", - "type": "google.cloud.compute_v1.types.FirewallPolicy" + "name": "test_permissions_request_resource", + "type": "google.cloud.compute_v1.types.TestPermissionsRequest" }, { "name": "retry", @@ -46381,14 +48533,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "patch" + "resultType": "google.cloud.compute_v1.types.TestPermissionsResponse", + "shortName": "test_iam_permissions" }, - "description": "Sample for Patch", - "file": "compute_v1_generated_region_network_firewall_policies_patch_sync.py", + "description": "Sample for TestIamPermissions", + "file": "compute_v1_generated_region_network_firewall_policies_test_iam_permissions_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionNetworkFirewallPolicies_Patch_sync", + "regionTag": "compute_v1_generated_RegionNetworkFirewallPolicies_TestIamPermissions_sync", "segments": [ { "end": 53, @@ -46421,28 +48573,28 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_network_firewall_policies_patch_sync.py" + "title": "compute_v1_generated_region_network_firewall_policies_test_iam_permissions_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionNetworkFirewallPoliciesClient", - "shortName": "RegionNetworkFirewallPoliciesClient" + "fullName": "google.cloud.compute_v1.RegionNotificationEndpointsClient", + "shortName": "RegionNotificationEndpointsClient" }, - "fullName": "google.cloud.compute_v1.RegionNetworkFirewallPoliciesClient.remove_association", + "fullName": "google.cloud.compute_v1.RegionNotificationEndpointsClient.delete", "method": { - "fullName": "google.cloud.compute.v1.RegionNetworkFirewallPolicies.RemoveAssociation", + "fullName": "google.cloud.compute.v1.RegionNotificationEndpoints.Delete", "service": { - "fullName": "google.cloud.compute.v1.RegionNetworkFirewallPolicies", - "shortName": "RegionNetworkFirewallPolicies" + "fullName": "google.cloud.compute.v1.RegionNotificationEndpoints", + "shortName": "RegionNotificationEndpoints" }, - "shortName": "RemoveAssociation" + "shortName": "Delete" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.RemoveAssociationRegionNetworkFirewallPolicyRequest" + "type": "google.cloud.compute_v1.types.DeleteRegionNotificationEndpointRequest" }, { "name": "project", @@ -46453,7 +48605,7 @@ "type": "str" }, { - "name": "firewall_policy", + "name": "notification_endpoint", "type": "str" }, { @@ -46470,13 +48622,13 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "remove_association" + "shortName": "delete" }, - "description": "Sample for RemoveAssociation", - "file": "compute_v1_generated_region_network_firewall_policies_remove_association_sync.py", + "description": "Sample for Delete", + "file": "compute_v1_generated_region_notification_endpoints_delete_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionNetworkFirewallPolicies_RemoveAssociation_sync", + "regionTag": "compute_v1_generated_RegionNotificationEndpoints_Delete_sync", "segments": [ { "end": 53, @@ -46509,28 +48661,28 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_network_firewall_policies_remove_association_sync.py" + "title": "compute_v1_generated_region_notification_endpoints_delete_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionNetworkFirewallPoliciesClient", - "shortName": "RegionNetworkFirewallPoliciesClient" + "fullName": "google.cloud.compute_v1.RegionNotificationEndpointsClient", + "shortName": "RegionNotificationEndpointsClient" }, - "fullName": "google.cloud.compute_v1.RegionNetworkFirewallPoliciesClient.remove_rule", + "fullName": "google.cloud.compute_v1.RegionNotificationEndpointsClient.get", "method": { - "fullName": "google.cloud.compute.v1.RegionNetworkFirewallPolicies.RemoveRule", + "fullName": "google.cloud.compute.v1.RegionNotificationEndpoints.Get", "service": { - "fullName": "google.cloud.compute.v1.RegionNetworkFirewallPolicies", - "shortName": "RegionNetworkFirewallPolicies" + "fullName": "google.cloud.compute.v1.RegionNotificationEndpoints", + "shortName": "RegionNotificationEndpoints" }, - "shortName": "RemoveRule" + "shortName": "Get" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.RemoveRuleRegionNetworkFirewallPolicyRequest" + "type": "google.cloud.compute_v1.types.GetRegionNotificationEndpointRequest" }, { "name": "project", @@ -46541,7 +48693,7 @@ "type": "str" }, { - "name": "firewall_policy", + "name": "notification_endpoint", "type": "str" }, { @@ -46557,14 +48709,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "remove_rule" + "resultType": "google.cloud.compute_v1.types.NotificationEndpoint", + "shortName": "get" }, - "description": "Sample for RemoveRule", - "file": "compute_v1_generated_region_network_firewall_policies_remove_rule_sync.py", + "description": "Sample for Get", + "file": "compute_v1_generated_region_notification_endpoints_get_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionNetworkFirewallPolicies_RemoveRule_sync", + "regionTag": "compute_v1_generated_RegionNotificationEndpoints_Get_sync", "segments": [ { "end": 53, @@ -46597,28 +48749,28 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_network_firewall_policies_remove_rule_sync.py" + "title": "compute_v1_generated_region_notification_endpoints_get_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionNetworkFirewallPoliciesClient", - "shortName": "RegionNetworkFirewallPoliciesClient" + "fullName": "google.cloud.compute_v1.RegionNotificationEndpointsClient", + "shortName": "RegionNotificationEndpointsClient" }, - "fullName": "google.cloud.compute_v1.RegionNetworkFirewallPoliciesClient.set_iam_policy", + "fullName": "google.cloud.compute_v1.RegionNotificationEndpointsClient.insert", "method": { - "fullName": "google.cloud.compute.v1.RegionNetworkFirewallPolicies.SetIamPolicy", + "fullName": "google.cloud.compute.v1.RegionNotificationEndpoints.Insert", "service": { - "fullName": "google.cloud.compute.v1.RegionNetworkFirewallPolicies", - "shortName": "RegionNetworkFirewallPolicies" + "fullName": "google.cloud.compute.v1.RegionNotificationEndpoints", + "shortName": "RegionNotificationEndpoints" }, - "shortName": "SetIamPolicy" + "shortName": "Insert" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.SetIamPolicyRegionNetworkFirewallPolicyRequest" + "type": "google.cloud.compute_v1.types.InsertRegionNotificationEndpointRequest" }, { "name": "project", @@ -46629,12 +48781,8 @@ "type": "str" }, { - "name": "resource", - "type": "str" - }, - { - "name": "region_set_policy_request_resource", - "type": "google.cloud.compute_v1.types.RegionSetPolicyRequest" + "name": "notification_endpoint_resource", + "type": "google.cloud.compute_v1.types.NotificationEndpoint" }, { "name": "retry", @@ -46649,22 +48797,22 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.Policy", - "shortName": "set_iam_policy" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "insert" }, - "description": "Sample for SetIamPolicy", - "file": "compute_v1_generated_region_network_firewall_policies_set_iam_policy_sync.py", + "description": "Sample for Insert", + "file": "compute_v1_generated_region_notification_endpoints_insert_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionNetworkFirewallPolicies_SetIamPolicy_sync", + "regionTag": "compute_v1_generated_RegionNotificationEndpoints_Insert_sync", "segments": [ { - "end": 53, + "end": 52, "start": 27, "type": "FULL" }, { - "end": 53, + "end": 52, "start": 27, "type": "SHORT" }, @@ -46674,43 +48822,43 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 47, + "end": 46, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 50, - "start": 48, + "end": 49, + "start": 47, "type": "REQUEST_EXECUTION" }, { - "end": 54, - "start": 51, + "end": 53, + "start": 50, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_network_firewall_policies_set_iam_policy_sync.py" + "title": "compute_v1_generated_region_notification_endpoints_insert_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionNetworkFirewallPoliciesClient", - "shortName": "RegionNetworkFirewallPoliciesClient" + "fullName": "google.cloud.compute_v1.RegionNotificationEndpointsClient", + "shortName": "RegionNotificationEndpointsClient" }, - "fullName": "google.cloud.compute_v1.RegionNetworkFirewallPoliciesClient.test_iam_permissions", + "fullName": "google.cloud.compute_v1.RegionNotificationEndpointsClient.list", "method": { - "fullName": "google.cloud.compute.v1.RegionNetworkFirewallPolicies.TestIamPermissions", + "fullName": "google.cloud.compute.v1.RegionNotificationEndpoints.List", "service": { - "fullName": "google.cloud.compute.v1.RegionNetworkFirewallPolicies", - "shortName": "RegionNetworkFirewallPolicies" + "fullName": "google.cloud.compute.v1.RegionNotificationEndpoints", + "shortName": "RegionNotificationEndpoints" }, - "shortName": "TestIamPermissions" + "shortName": "List" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.TestIamPermissionsRegionNetworkFirewallPolicyRequest" + "type": "google.cloud.compute_v1.types.ListRegionNotificationEndpointsRequest" }, { "name": "project", @@ -46720,14 +48868,6 @@ "name": "region", "type": "str" }, - { - "name": "resource", - "type": "str" - }, - { - "name": "test_permissions_request_resource", - "type": "google.cloud.compute_v1.types.TestPermissionsRequest" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -46741,14 +48881,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.TestPermissionsResponse", - "shortName": "test_iam_permissions" + "resultType": "google.cloud.compute_v1.services.region_notification_endpoints.pagers.ListPager", + "shortName": "list" }, - "description": "Sample for TestIamPermissions", - "file": "compute_v1_generated_region_network_firewall_policies_test_iam_permissions_sync.py", + "description": "Sample for List", + "file": "compute_v1_generated_region_notification_endpoints_list_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionNetworkFirewallPolicies_TestIamPermissions_sync", + "regionTag": "compute_v1_generated_RegionNotificationEndpoints_List_sync", "segments": [ { "end": 53, @@ -46766,43 +48906,43 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 47, + "end": 46, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 50, - "start": 48, + "end": 49, + "start": 47, "type": "REQUEST_EXECUTION" }, { "end": 54, - "start": 51, + "start": 50, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_network_firewall_policies_test_iam_permissions_sync.py" + "title": "compute_v1_generated_region_notification_endpoints_list_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionNotificationEndpointsClient", - "shortName": "RegionNotificationEndpointsClient" + "fullName": "google.cloud.compute_v1.RegionOperationsClient", + "shortName": "RegionOperationsClient" }, - "fullName": "google.cloud.compute_v1.RegionNotificationEndpointsClient.delete", + "fullName": "google.cloud.compute_v1.RegionOperationsClient.delete", "method": { - "fullName": "google.cloud.compute.v1.RegionNotificationEndpoints.Delete", + "fullName": "google.cloud.compute.v1.RegionOperations.Delete", "service": { - "fullName": "google.cloud.compute.v1.RegionNotificationEndpoints", - "shortName": "RegionNotificationEndpoints" + "fullName": "google.cloud.compute.v1.RegionOperations", + "shortName": "RegionOperations" }, "shortName": "Delete" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.DeleteRegionNotificationEndpointRequest" + "type": "google.cloud.compute_v1.types.DeleteRegionOperationRequest" }, { "name": "project", @@ -46813,7 +48953,7 @@ "type": "str" }, { - "name": "notification_endpoint", + "name": "operation", "type": "str" }, { @@ -46829,14 +48969,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", + "resultType": "google.cloud.compute_v1.types.DeleteRegionOperationResponse", "shortName": "delete" }, "description": "Sample for Delete", - "file": "compute_v1_generated_region_notification_endpoints_delete_sync.py", + "file": "compute_v1_generated_region_operations_delete_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionNotificationEndpoints_Delete_sync", + "regionTag": "compute_v1_generated_RegionOperations_Delete_sync", "segments": [ { "end": 53, @@ -46869,28 +49009,28 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_notification_endpoints_delete_sync.py" + "title": "compute_v1_generated_region_operations_delete_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionNotificationEndpointsClient", - "shortName": "RegionNotificationEndpointsClient" + "fullName": "google.cloud.compute_v1.RegionOperationsClient", + "shortName": "RegionOperationsClient" }, - "fullName": "google.cloud.compute_v1.RegionNotificationEndpointsClient.get", + "fullName": "google.cloud.compute_v1.RegionOperationsClient.get", "method": { - "fullName": "google.cloud.compute.v1.RegionNotificationEndpoints.Get", + "fullName": "google.cloud.compute.v1.RegionOperations.Get", "service": { - "fullName": "google.cloud.compute.v1.RegionNotificationEndpoints", - "shortName": "RegionNotificationEndpoints" + "fullName": "google.cloud.compute.v1.RegionOperations", + "shortName": "RegionOperations" }, "shortName": "Get" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetRegionNotificationEndpointRequest" + "type": "google.cloud.compute_v1.types.GetRegionOperationRequest" }, { "name": "project", @@ -46901,7 +49041,7 @@ "type": "str" }, { - "name": "notification_endpoint", + "name": "operation", "type": "str" }, { @@ -46917,14 +49057,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.NotificationEndpoint", + "resultType": "google.cloud.compute_v1.types.Operation", "shortName": "get" }, "description": "Sample for Get", - "file": "compute_v1_generated_region_notification_endpoints_get_sync.py", + "file": "compute_v1_generated_region_operations_get_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionNotificationEndpoints_Get_sync", + "regionTag": "compute_v1_generated_RegionOperations_Get_sync", "segments": [ { "end": 53, @@ -46957,28 +49097,28 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_notification_endpoints_get_sync.py" + "title": "compute_v1_generated_region_operations_get_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionNotificationEndpointsClient", - "shortName": "RegionNotificationEndpointsClient" + "fullName": "google.cloud.compute_v1.RegionOperationsClient", + "shortName": "RegionOperationsClient" }, - "fullName": "google.cloud.compute_v1.RegionNotificationEndpointsClient.insert", + "fullName": "google.cloud.compute_v1.RegionOperationsClient.list", "method": { - "fullName": "google.cloud.compute.v1.RegionNotificationEndpoints.Insert", + "fullName": "google.cloud.compute.v1.RegionOperations.List", "service": { - "fullName": "google.cloud.compute.v1.RegionNotificationEndpoints", - "shortName": "RegionNotificationEndpoints" + "fullName": "google.cloud.compute.v1.RegionOperations", + "shortName": "RegionOperations" }, - "shortName": "Insert" + "shortName": "List" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.InsertRegionNotificationEndpointRequest" + "type": "google.cloud.compute_v1.types.ListRegionOperationsRequest" }, { "name": "project", @@ -46988,10 +49128,6 @@ "name": "region", "type": "str" }, - { - "name": "notification_endpoint_resource", - "type": "google.cloud.compute_v1.types.NotificationEndpoint" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -47005,22 +49141,22 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "insert" + "resultType": "google.cloud.compute_v1.services.region_operations.pagers.ListPager", + "shortName": "list" }, - "description": "Sample for Insert", - "file": "compute_v1_generated_region_notification_endpoints_insert_sync.py", + "description": "Sample for List", + "file": "compute_v1_generated_region_operations_list_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionNotificationEndpoints_Insert_sync", + "regionTag": "compute_v1_generated_RegionOperations_List_sync", "segments": [ { - "end": 52, + "end": 53, "start": 27, "type": "FULL" }, { - "end": 52, + "end": 53, "start": 27, "type": "SHORT" }, @@ -47040,33 +49176,33 @@ "type": "REQUEST_EXECUTION" }, { - "end": 53, + "end": 54, "start": 50, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_notification_endpoints_insert_sync.py" + "title": "compute_v1_generated_region_operations_list_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionNotificationEndpointsClient", - "shortName": "RegionNotificationEndpointsClient" + "fullName": "google.cloud.compute_v1.RegionOperationsClient", + "shortName": "RegionOperationsClient" }, - "fullName": "google.cloud.compute_v1.RegionNotificationEndpointsClient.list", + "fullName": "google.cloud.compute_v1.RegionOperationsClient.wait", "method": { - "fullName": "google.cloud.compute.v1.RegionNotificationEndpoints.List", + "fullName": "google.cloud.compute.v1.RegionOperations.Wait", "service": { - "fullName": "google.cloud.compute.v1.RegionNotificationEndpoints", - "shortName": "RegionNotificationEndpoints" + "fullName": "google.cloud.compute.v1.RegionOperations", + "shortName": "RegionOperations" }, - "shortName": "List" + "shortName": "Wait" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.ListRegionNotificationEndpointsRequest" + "type": "google.cloud.compute_v1.types.WaitRegionOperationRequest" }, { "name": "project", @@ -47076,6 +49212,10 @@ "name": "region", "type": "str" }, + { + "name": "operation", + "type": "str" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -47089,14 +49229,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.services.region_notification_endpoints.pagers.ListPager", - "shortName": "list" + "resultType": "google.cloud.compute_v1.types.Operation", + "shortName": "wait" }, - "description": "Sample for List", - "file": "compute_v1_generated_region_notification_endpoints_list_sync.py", + "description": "Sample for Wait", + "file": "compute_v1_generated_region_operations_wait_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionNotificationEndpoints_List_sync", + "regionTag": "compute_v1_generated_RegionOperations_Wait_sync", "segments": [ { "end": 53, @@ -47114,43 +49254,43 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 46, + "end": 47, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 49, - "start": 47, + "end": 50, + "start": 48, "type": "REQUEST_EXECUTION" }, { "end": 54, - "start": 50, + "start": 51, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_notification_endpoints_list_sync.py" + "title": "compute_v1_generated_region_operations_wait_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionOperationsClient", - "shortName": "RegionOperationsClient" + "fullName": "google.cloud.compute_v1.RegionSecurityPoliciesClient", + "shortName": "RegionSecurityPoliciesClient" }, - "fullName": "google.cloud.compute_v1.RegionOperationsClient.delete", + "fullName": "google.cloud.compute_v1.RegionSecurityPoliciesClient.add_rule", "method": { - "fullName": "google.cloud.compute.v1.RegionOperations.Delete", + "fullName": "google.cloud.compute.v1.RegionSecurityPolicies.AddRule", "service": { - "fullName": "google.cloud.compute.v1.RegionOperations", - "shortName": "RegionOperations" + "fullName": "google.cloud.compute.v1.RegionSecurityPolicies", + "shortName": "RegionSecurityPolicies" }, - "shortName": "Delete" + "shortName": "AddRule" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.DeleteRegionOperationRequest" + "type": "google.cloud.compute_v1.types.AddRuleRegionSecurityPolicyRequest" }, { "name": "project", @@ -47161,9 +49301,13 @@ "type": "str" }, { - "name": "operation", + "name": "security_policy", "type": "str" }, + { + "name": "security_policy_rule_resource", + "type": "google.cloud.compute_v1.types.SecurityPolicyRule" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -47177,14 +49321,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.DeleteRegionOperationResponse", - "shortName": "delete" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "add_rule" }, - "description": "Sample for Delete", - "file": "compute_v1_generated_region_operations_delete_sync.py", + "description": "Sample for AddRule", + "file": "compute_v1_generated_region_security_policies_add_rule_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionOperations_Delete_sync", + "regionTag": "compute_v1_generated_RegionSecurityPolicies_AddRule_sync", "segments": [ { "end": 53, @@ -47217,28 +49361,28 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_operations_delete_sync.py" + "title": "compute_v1_generated_region_security_policies_add_rule_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionOperationsClient", - "shortName": "RegionOperationsClient" + "fullName": "google.cloud.compute_v1.RegionSecurityPoliciesClient", + "shortName": "RegionSecurityPoliciesClient" }, - "fullName": "google.cloud.compute_v1.RegionOperationsClient.get", + "fullName": "google.cloud.compute_v1.RegionSecurityPoliciesClient.delete", "method": { - "fullName": "google.cloud.compute.v1.RegionOperations.Get", + "fullName": "google.cloud.compute.v1.RegionSecurityPolicies.Delete", "service": { - "fullName": "google.cloud.compute.v1.RegionOperations", - "shortName": "RegionOperations" + "fullName": "google.cloud.compute.v1.RegionSecurityPolicies", + "shortName": "RegionSecurityPolicies" }, - "shortName": "Get" + "shortName": "Delete" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetRegionOperationRequest" + "type": "google.cloud.compute_v1.types.DeleteRegionSecurityPolicyRequest" }, { "name": "project", @@ -47249,7 +49393,7 @@ "type": "str" }, { - "name": "operation", + "name": "security_policy", "type": "str" }, { @@ -47265,14 +49409,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.Operation", - "shortName": "get" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "delete" }, - "description": "Sample for Get", - "file": "compute_v1_generated_region_operations_get_sync.py", + "description": "Sample for Delete", + "file": "compute_v1_generated_region_security_policies_delete_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionOperations_Get_sync", + "regionTag": "compute_v1_generated_RegionSecurityPolicies_Delete_sync", "segments": [ { "end": 53, @@ -47305,112 +49449,28 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_operations_get_sync.py" - }, - { - "canonical": true, - "clientMethod": { - "client": { - "fullName": "google.cloud.compute_v1.RegionOperationsClient", - "shortName": "RegionOperationsClient" - }, - "fullName": "google.cloud.compute_v1.RegionOperationsClient.list", - "method": { - "fullName": "google.cloud.compute.v1.RegionOperations.List", - "service": { - "fullName": "google.cloud.compute.v1.RegionOperations", - "shortName": "RegionOperations" - }, - "shortName": "List" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.compute_v1.types.ListRegionOperationsRequest" - }, - { - "name": "project", - "type": "str" - }, - { - "name": "region", - "type": "str" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, Union[str, bytes]]]" - } - ], - "resultType": "google.cloud.compute_v1.services.region_operations.pagers.ListPager", - "shortName": "list" - }, - "description": "Sample for List", - "file": "compute_v1_generated_region_operations_list_sync.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionOperations_List_sync", - "segments": [ - { - "end": 53, - "start": 27, - "type": "FULL" - }, - { - "end": 53, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 46, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 49, - "start": 47, - "type": "REQUEST_EXECUTION" - }, - { - "end": 54, - "start": 50, - "type": "RESPONSE_HANDLING" - } - ], - "title": "compute_v1_generated_region_operations_list_sync.py" + "title": "compute_v1_generated_region_security_policies_delete_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionOperationsClient", - "shortName": "RegionOperationsClient" + "fullName": "google.cloud.compute_v1.RegionSecurityPoliciesClient", + "shortName": "RegionSecurityPoliciesClient" }, - "fullName": "google.cloud.compute_v1.RegionOperationsClient.wait", + "fullName": "google.cloud.compute_v1.RegionSecurityPoliciesClient.get_rule", "method": { - "fullName": "google.cloud.compute.v1.RegionOperations.Wait", + "fullName": "google.cloud.compute.v1.RegionSecurityPolicies.GetRule", "service": { - "fullName": "google.cloud.compute.v1.RegionOperations", - "shortName": "RegionOperations" + "fullName": "google.cloud.compute.v1.RegionSecurityPolicies", + "shortName": "RegionSecurityPolicies" }, - "shortName": "Wait" + "shortName": "GetRule" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.WaitRegionOperationRequest" + "type": "google.cloud.compute_v1.types.GetRuleRegionSecurityPolicyRequest" }, { "name": "project", @@ -47421,7 +49481,7 @@ "type": "str" }, { - "name": "operation", + "name": "security_policy", "type": "str" }, { @@ -47437,14 +49497,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.Operation", - "shortName": "wait" + "resultType": "google.cloud.compute_v1.types.SecurityPolicyRule", + "shortName": "get_rule" }, - "description": "Sample for Wait", - "file": "compute_v1_generated_region_operations_wait_sync.py", + "description": "Sample for GetRule", + "file": "compute_v1_generated_region_security_policies_get_rule_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionOperations_Wait_sync", + "regionTag": "compute_v1_generated_RegionSecurityPolicies_GetRule_sync", "segments": [ { "end": 53, @@ -47477,7 +49537,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_operations_wait_sync.py" + "title": "compute_v1_generated_region_security_policies_get_rule_sync.py" }, { "canonical": true, @@ -47486,19 +49546,19 @@ "fullName": "google.cloud.compute_v1.RegionSecurityPoliciesClient", "shortName": "RegionSecurityPoliciesClient" }, - "fullName": "google.cloud.compute_v1.RegionSecurityPoliciesClient.add_rule", + "fullName": "google.cloud.compute_v1.RegionSecurityPoliciesClient.get", "method": { - "fullName": "google.cloud.compute.v1.RegionSecurityPolicies.AddRule", + "fullName": "google.cloud.compute.v1.RegionSecurityPolicies.Get", "service": { "fullName": "google.cloud.compute.v1.RegionSecurityPolicies", "shortName": "RegionSecurityPolicies" }, - "shortName": "AddRule" + "shortName": "Get" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.AddRuleRegionSecurityPolicyRequest" + "type": "google.cloud.compute_v1.types.GetRegionSecurityPolicyRequest" }, { "name": "project", @@ -47512,10 +49572,6 @@ "name": "security_policy", "type": "str" }, - { - "name": "security_policy_rule_resource", - "type": "google.cloud.compute_v1.types.SecurityPolicyRule" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -47529,14 +49585,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "add_rule" + "resultType": "google.cloud.compute_v1.types.SecurityPolicy", + "shortName": "get" }, - "description": "Sample for AddRule", - "file": "compute_v1_generated_region_security_policies_add_rule_sync.py", + "description": "Sample for Get", + "file": "compute_v1_generated_region_security_policies_get_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionSecurityPolicies_AddRule_sync", + "regionTag": "compute_v1_generated_RegionSecurityPolicies_Get_sync", "segments": [ { "end": 53, @@ -47569,7 +49625,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_security_policies_add_rule_sync.py" + "title": "compute_v1_generated_region_security_policies_get_sync.py" }, { "canonical": true, @@ -47578,19 +49634,19 @@ "fullName": "google.cloud.compute_v1.RegionSecurityPoliciesClient", "shortName": "RegionSecurityPoliciesClient" }, - "fullName": "google.cloud.compute_v1.RegionSecurityPoliciesClient.delete", + "fullName": "google.cloud.compute_v1.RegionSecurityPoliciesClient.insert", "method": { - "fullName": "google.cloud.compute.v1.RegionSecurityPolicies.Delete", + "fullName": "google.cloud.compute.v1.RegionSecurityPolicies.Insert", "service": { "fullName": "google.cloud.compute.v1.RegionSecurityPolicies", "shortName": "RegionSecurityPolicies" }, - "shortName": "Delete" + "shortName": "Insert" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.DeleteRegionSecurityPolicyRequest" + "type": "google.cloud.compute_v1.types.InsertRegionSecurityPolicyRequest" }, { "name": "project", @@ -47601,8 +49657,8 @@ "type": "str" }, { - "name": "security_policy", - "type": "str" + "name": "security_policy_resource", + "type": "google.cloud.compute_v1.types.SecurityPolicy" }, { "name": "retry", @@ -47618,21 +49674,21 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "delete" + "shortName": "insert" }, - "description": "Sample for Delete", - "file": "compute_v1_generated_region_security_policies_delete_sync.py", + "description": "Sample for Insert", + "file": "compute_v1_generated_region_security_policies_insert_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionSecurityPolicies_Delete_sync", + "regionTag": "compute_v1_generated_RegionSecurityPolicies_Insert_sync", "segments": [ { - "end": 53, + "end": 52, "start": 27, "type": "FULL" }, { - "end": 53, + "end": 52, "start": 27, "type": "SHORT" }, @@ -47642,22 +49698,22 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 47, + "end": 46, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 50, - "start": 48, + "end": 49, + "start": 47, "type": "REQUEST_EXECUTION" }, { - "end": 54, - "start": 51, + "end": 53, + "start": 50, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_security_policies_delete_sync.py" + "title": "compute_v1_generated_region_security_policies_insert_sync.py" }, { "canonical": true, @@ -47666,19 +49722,19 @@ "fullName": "google.cloud.compute_v1.RegionSecurityPoliciesClient", "shortName": "RegionSecurityPoliciesClient" }, - "fullName": "google.cloud.compute_v1.RegionSecurityPoliciesClient.get_rule", + "fullName": "google.cloud.compute_v1.RegionSecurityPoliciesClient.list", "method": { - "fullName": "google.cloud.compute.v1.RegionSecurityPolicies.GetRule", + "fullName": "google.cloud.compute.v1.RegionSecurityPolicies.List", "service": { "fullName": "google.cloud.compute.v1.RegionSecurityPolicies", "shortName": "RegionSecurityPolicies" }, - "shortName": "GetRule" + "shortName": "List" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetRuleRegionSecurityPolicyRequest" + "type": "google.cloud.compute_v1.types.ListRegionSecurityPoliciesRequest" }, { "name": "project", @@ -47688,10 +49744,6 @@ "name": "region", "type": "str" }, - { - "name": "security_policy", - "type": "str" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -47705,14 +49757,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.SecurityPolicyRule", - "shortName": "get_rule" + "resultType": "google.cloud.compute_v1.services.region_security_policies.pagers.ListPager", + "shortName": "list" }, - "description": "Sample for GetRule", - "file": "compute_v1_generated_region_security_policies_get_rule_sync.py", + "description": "Sample for List", + "file": "compute_v1_generated_region_security_policies_list_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionSecurityPolicies_GetRule_sync", + "regionTag": "compute_v1_generated_RegionSecurityPolicies_List_sync", "segments": [ { "end": 53, @@ -47730,22 +49782,22 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 47, + "end": 46, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 50, - "start": 48, + "end": 49, + "start": 47, "type": "REQUEST_EXECUTION" }, { "end": 54, - "start": 51, + "start": 50, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_security_policies_get_rule_sync.py" + "title": "compute_v1_generated_region_security_policies_list_sync.py" }, { "canonical": true, @@ -47754,19 +49806,19 @@ "fullName": "google.cloud.compute_v1.RegionSecurityPoliciesClient", "shortName": "RegionSecurityPoliciesClient" }, - "fullName": "google.cloud.compute_v1.RegionSecurityPoliciesClient.get", + "fullName": "google.cloud.compute_v1.RegionSecurityPoliciesClient.patch_rule", "method": { - "fullName": "google.cloud.compute.v1.RegionSecurityPolicies.Get", + "fullName": "google.cloud.compute.v1.RegionSecurityPolicies.PatchRule", "service": { "fullName": "google.cloud.compute.v1.RegionSecurityPolicies", "shortName": "RegionSecurityPolicies" }, - "shortName": "Get" + "shortName": "PatchRule" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetRegionSecurityPolicyRequest" + "type": "google.cloud.compute_v1.types.PatchRuleRegionSecurityPolicyRequest" }, { "name": "project", @@ -47780,6 +49832,10 @@ "name": "security_policy", "type": "str" }, + { + "name": "security_policy_rule_resource", + "type": "google.cloud.compute_v1.types.SecurityPolicyRule" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -47793,14 +49849,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.SecurityPolicy", - "shortName": "get" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "patch_rule" }, - "description": "Sample for Get", - "file": "compute_v1_generated_region_security_policies_get_sync.py", + "description": "Sample for PatchRule", + "file": "compute_v1_generated_region_security_policies_patch_rule_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionSecurityPolicies_Get_sync", + "regionTag": "compute_v1_generated_RegionSecurityPolicies_PatchRule_sync", "segments": [ { "end": 53, @@ -47833,7 +49889,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_security_policies_get_sync.py" + "title": "compute_v1_generated_region_security_policies_patch_rule_sync.py" }, { "canonical": true, @@ -47842,19 +49898,19 @@ "fullName": "google.cloud.compute_v1.RegionSecurityPoliciesClient", "shortName": "RegionSecurityPoliciesClient" }, - "fullName": "google.cloud.compute_v1.RegionSecurityPoliciesClient.insert", + "fullName": "google.cloud.compute_v1.RegionSecurityPoliciesClient.patch", "method": { - "fullName": "google.cloud.compute.v1.RegionSecurityPolicies.Insert", + "fullName": "google.cloud.compute.v1.RegionSecurityPolicies.Patch", "service": { "fullName": "google.cloud.compute.v1.RegionSecurityPolicies", "shortName": "RegionSecurityPolicies" }, - "shortName": "Insert" + "shortName": "Patch" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.InsertRegionSecurityPolicyRequest" + "type": "google.cloud.compute_v1.types.PatchRegionSecurityPolicyRequest" }, { "name": "project", @@ -47864,6 +49920,10 @@ "name": "region", "type": "str" }, + { + "name": "security_policy", + "type": "str" + }, { "name": "security_policy_resource", "type": "google.cloud.compute_v1.types.SecurityPolicy" @@ -47882,21 +49942,21 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "insert" + "shortName": "patch" }, - "description": "Sample for Insert", - "file": "compute_v1_generated_region_security_policies_insert_sync.py", + "description": "Sample for Patch", + "file": "compute_v1_generated_region_security_policies_patch_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionSecurityPolicies_Insert_sync", + "regionTag": "compute_v1_generated_RegionSecurityPolicies_Patch_sync", "segments": [ { - "end": 52, + "end": 53, "start": 27, "type": "FULL" }, { - "end": 52, + "end": 53, "start": 27, "type": "SHORT" }, @@ -47906,22 +49966,22 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 46, + "end": 47, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 49, - "start": 47, + "end": 50, + "start": 48, "type": "REQUEST_EXECUTION" }, { - "end": 53, - "start": 50, + "end": 54, + "start": 51, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_security_policies_insert_sync.py" + "title": "compute_v1_generated_region_security_policies_patch_sync.py" }, { "canonical": true, @@ -47930,19 +49990,19 @@ "fullName": "google.cloud.compute_v1.RegionSecurityPoliciesClient", "shortName": "RegionSecurityPoliciesClient" }, - "fullName": "google.cloud.compute_v1.RegionSecurityPoliciesClient.list", + "fullName": "google.cloud.compute_v1.RegionSecurityPoliciesClient.remove_rule", "method": { - "fullName": "google.cloud.compute.v1.RegionSecurityPolicies.List", + "fullName": "google.cloud.compute.v1.RegionSecurityPolicies.RemoveRule", "service": { "fullName": "google.cloud.compute.v1.RegionSecurityPolicies", "shortName": "RegionSecurityPolicies" }, - "shortName": "List" + "shortName": "RemoveRule" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.ListRegionSecurityPoliciesRequest" + "type": "google.cloud.compute_v1.types.RemoveRuleRegionSecurityPolicyRequest" }, { "name": "project", @@ -47952,6 +50012,10 @@ "name": "region", "type": "str" }, + { + "name": "security_policy", + "type": "str" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -47965,14 +50029,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.services.region_security_policies.pagers.ListPager", - "shortName": "list" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "remove_rule" }, - "description": "Sample for List", - "file": "compute_v1_generated_region_security_policies_list_sync.py", + "description": "Sample for RemoveRule", + "file": "compute_v1_generated_region_security_policies_remove_rule_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionSecurityPolicies_List_sync", + "regionTag": "compute_v1_generated_RegionSecurityPolicies_RemoveRule_sync", "segments": [ { "end": 53, @@ -47990,22 +50054,22 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 46, + "end": 47, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 49, - "start": 47, + "end": 50, + "start": 48, "type": "REQUEST_EXECUTION" }, { "end": 54, - "start": 50, + "start": 51, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_security_policies_list_sync.py" + "title": "compute_v1_generated_region_security_policies_remove_rule_sync.py" }, { "canonical": true, @@ -48014,19 +50078,19 @@ "fullName": "google.cloud.compute_v1.RegionSecurityPoliciesClient", "shortName": "RegionSecurityPoliciesClient" }, - "fullName": "google.cloud.compute_v1.RegionSecurityPoliciesClient.patch_rule", + "fullName": "google.cloud.compute_v1.RegionSecurityPoliciesClient.set_labels", "method": { - "fullName": "google.cloud.compute.v1.RegionSecurityPolicies.PatchRule", + "fullName": "google.cloud.compute.v1.RegionSecurityPolicies.SetLabels", "service": { "fullName": "google.cloud.compute.v1.RegionSecurityPolicies", "shortName": "RegionSecurityPolicies" }, - "shortName": "PatchRule" + "shortName": "SetLabels" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.PatchRuleRegionSecurityPolicyRequest" + "type": "google.cloud.compute_v1.types.SetLabelsRegionSecurityPolicyRequest" }, { "name": "project", @@ -48037,12 +50101,12 @@ "type": "str" }, { - "name": "security_policy", + "name": "resource", "type": "str" }, { - "name": "security_policy_rule_resource", - "type": "google.cloud.compute_v1.types.SecurityPolicyRule" + "name": "region_set_labels_request_resource", + "type": "google.cloud.compute_v1.types.RegionSetLabelsRequest" }, { "name": "retry", @@ -48058,13 +50122,13 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "patch_rule" + "shortName": "set_labels" }, - "description": "Sample for PatchRule", - "file": "compute_v1_generated_region_security_policies_patch_rule_sync.py", + "description": "Sample for SetLabels", + "file": "compute_v1_generated_region_security_policies_set_labels_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionSecurityPolicies_PatchRule_sync", + "regionTag": "compute_v1_generated_RegionSecurityPolicies_SetLabels_sync", "segments": [ { "end": 53, @@ -48097,28 +50161,28 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_security_policies_patch_rule_sync.py" + "title": "compute_v1_generated_region_security_policies_set_labels_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionSecurityPoliciesClient", - "shortName": "RegionSecurityPoliciesClient" + "fullName": "google.cloud.compute_v1.RegionSslCertificatesClient", + "shortName": "RegionSslCertificatesClient" }, - "fullName": "google.cloud.compute_v1.RegionSecurityPoliciesClient.patch", + "fullName": "google.cloud.compute_v1.RegionSslCertificatesClient.delete", "method": { - "fullName": "google.cloud.compute.v1.RegionSecurityPolicies.Patch", + "fullName": "google.cloud.compute.v1.RegionSslCertificates.Delete", "service": { - "fullName": "google.cloud.compute.v1.RegionSecurityPolicies", - "shortName": "RegionSecurityPolicies" + "fullName": "google.cloud.compute.v1.RegionSslCertificates", + "shortName": "RegionSslCertificates" }, - "shortName": "Patch" + "shortName": "Delete" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.PatchRegionSecurityPolicyRequest" + "type": "google.cloud.compute_v1.types.DeleteRegionSslCertificateRequest" }, { "name": "project", @@ -48129,13 +50193,9 @@ "type": "str" }, { - "name": "security_policy", + "name": "ssl_certificate", "type": "str" }, - { - "name": "security_policy_resource", - "type": "google.cloud.compute_v1.types.SecurityPolicy" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -48150,13 +50210,13 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "patch" + "shortName": "delete" }, - "description": "Sample for Patch", - "file": "compute_v1_generated_region_security_policies_patch_sync.py", + "description": "Sample for Delete", + "file": "compute_v1_generated_region_ssl_certificates_delete_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionSecurityPolicies_Patch_sync", + "regionTag": "compute_v1_generated_RegionSslCertificates_Delete_sync", "segments": [ { "end": 53, @@ -48189,28 +50249,28 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_security_policies_patch_sync.py" + "title": "compute_v1_generated_region_ssl_certificates_delete_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionSecurityPoliciesClient", - "shortName": "RegionSecurityPoliciesClient" + "fullName": "google.cloud.compute_v1.RegionSslCertificatesClient", + "shortName": "RegionSslCertificatesClient" }, - "fullName": "google.cloud.compute_v1.RegionSecurityPoliciesClient.remove_rule", + "fullName": "google.cloud.compute_v1.RegionSslCertificatesClient.get", "method": { - "fullName": "google.cloud.compute.v1.RegionSecurityPolicies.RemoveRule", + "fullName": "google.cloud.compute.v1.RegionSslCertificates.Get", "service": { - "fullName": "google.cloud.compute.v1.RegionSecurityPolicies", - "shortName": "RegionSecurityPolicies" + "fullName": "google.cloud.compute.v1.RegionSslCertificates", + "shortName": "RegionSslCertificates" }, - "shortName": "RemoveRule" + "shortName": "Get" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.RemoveRuleRegionSecurityPolicyRequest" + "type": "google.cloud.compute_v1.types.GetRegionSslCertificateRequest" }, { "name": "project", @@ -48221,7 +50281,7 @@ "type": "str" }, { - "name": "security_policy", + "name": "ssl_certificate", "type": "str" }, { @@ -48237,14 +50297,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "remove_rule" + "resultType": "google.cloud.compute_v1.types.SslCertificate", + "shortName": "get" }, - "description": "Sample for RemoveRule", - "file": "compute_v1_generated_region_security_policies_remove_rule_sync.py", + "description": "Sample for Get", + "file": "compute_v1_generated_region_ssl_certificates_get_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionSecurityPolicies_RemoveRule_sync", + "regionTag": "compute_v1_generated_RegionSslCertificates_Get_sync", "segments": [ { "end": 53, @@ -48277,28 +50337,28 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_security_policies_remove_rule_sync.py" + "title": "compute_v1_generated_region_ssl_certificates_get_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionSecurityPoliciesClient", - "shortName": "RegionSecurityPoliciesClient" + "fullName": "google.cloud.compute_v1.RegionSslCertificatesClient", + "shortName": "RegionSslCertificatesClient" }, - "fullName": "google.cloud.compute_v1.RegionSecurityPoliciesClient.set_labels", + "fullName": "google.cloud.compute_v1.RegionSslCertificatesClient.insert", "method": { - "fullName": "google.cloud.compute.v1.RegionSecurityPolicies.SetLabels", + "fullName": "google.cloud.compute.v1.RegionSslCertificates.Insert", "service": { - "fullName": "google.cloud.compute.v1.RegionSecurityPolicies", - "shortName": "RegionSecurityPolicies" + "fullName": "google.cloud.compute.v1.RegionSslCertificates", + "shortName": "RegionSslCertificates" }, - "shortName": "SetLabels" + "shortName": "Insert" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.SetLabelsRegionSecurityPolicyRequest" + "type": "google.cloud.compute_v1.types.InsertRegionSslCertificateRequest" }, { "name": "project", @@ -48309,12 +50369,8 @@ "type": "str" }, { - "name": "resource", - "type": "str" - }, - { - "name": "region_set_labels_request_resource", - "type": "google.cloud.compute_v1.types.RegionSetLabelsRequest" + "name": "ssl_certificate_resource", + "type": "google.cloud.compute_v1.types.SslCertificate" }, { "name": "retry", @@ -48330,21 +50386,21 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "set_labels" + "shortName": "insert" }, - "description": "Sample for SetLabels", - "file": "compute_v1_generated_region_security_policies_set_labels_sync.py", + "description": "Sample for Insert", + "file": "compute_v1_generated_region_ssl_certificates_insert_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionSecurityPolicies_SetLabels_sync", + "regionTag": "compute_v1_generated_RegionSslCertificates_Insert_sync", "segments": [ { - "end": 53, + "end": 52, "start": 27, "type": "FULL" }, { - "end": 53, + "end": 52, "start": 27, "type": "SHORT" }, @@ -48354,22 +50410,22 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 47, + "end": 46, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 50, - "start": 48, + "end": 49, + "start": 47, "type": "REQUEST_EXECUTION" }, { - "end": 54, - "start": 51, + "end": 53, + "start": 50, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_security_policies_set_labels_sync.py" + "title": "compute_v1_generated_region_ssl_certificates_insert_sync.py" }, { "canonical": true, @@ -48378,19 +50434,19 @@ "fullName": "google.cloud.compute_v1.RegionSslCertificatesClient", "shortName": "RegionSslCertificatesClient" }, - "fullName": "google.cloud.compute_v1.RegionSslCertificatesClient.delete", + "fullName": "google.cloud.compute_v1.RegionSslCertificatesClient.list", "method": { - "fullName": "google.cloud.compute.v1.RegionSslCertificates.Delete", + "fullName": "google.cloud.compute.v1.RegionSslCertificates.List", "service": { "fullName": "google.cloud.compute.v1.RegionSslCertificates", "shortName": "RegionSslCertificates" }, - "shortName": "Delete" + "shortName": "List" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.DeleteRegionSslCertificateRequest" + "type": "google.cloud.compute_v1.types.ListRegionSslCertificatesRequest" }, { "name": "project", @@ -48400,10 +50456,6 @@ "name": "region", "type": "str" }, - { - "name": "ssl_certificate", - "type": "str" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -48417,14 +50469,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "delete" + "resultType": "google.cloud.compute_v1.services.region_ssl_certificates.pagers.ListPager", + "shortName": "list" }, - "description": "Sample for Delete", - "file": "compute_v1_generated_region_ssl_certificates_delete_sync.py", + "description": "Sample for List", + "file": "compute_v1_generated_region_ssl_certificates_list_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionSslCertificates_Delete_sync", + "regionTag": "compute_v1_generated_RegionSslCertificates_List_sync", "segments": [ { "end": 53, @@ -48442,43 +50494,43 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 47, + "end": 46, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 50, - "start": 48, + "end": 49, + "start": 47, "type": "REQUEST_EXECUTION" }, { "end": 54, - "start": 51, + "start": 50, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_ssl_certificates_delete_sync.py" + "title": "compute_v1_generated_region_ssl_certificates_list_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionSslCertificatesClient", - "shortName": "RegionSslCertificatesClient" + "fullName": "google.cloud.compute_v1.RegionSslPoliciesClient", + "shortName": "RegionSslPoliciesClient" }, - "fullName": "google.cloud.compute_v1.RegionSslCertificatesClient.get", + "fullName": "google.cloud.compute_v1.RegionSslPoliciesClient.delete", "method": { - "fullName": "google.cloud.compute.v1.RegionSslCertificates.Get", + "fullName": "google.cloud.compute.v1.RegionSslPolicies.Delete", "service": { - "fullName": "google.cloud.compute.v1.RegionSslCertificates", - "shortName": "RegionSslCertificates" + "fullName": "google.cloud.compute.v1.RegionSslPolicies", + "shortName": "RegionSslPolicies" }, - "shortName": "Get" + "shortName": "Delete" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetRegionSslCertificateRequest" + "type": "google.cloud.compute_v1.types.DeleteRegionSslPolicyRequest" }, { "name": "project", @@ -48489,7 +50541,7 @@ "type": "str" }, { - "name": "ssl_certificate", + "name": "ssl_policy", "type": "str" }, { @@ -48505,14 +50557,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.SslCertificate", - "shortName": "get" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "delete" }, - "description": "Sample for Get", - "file": "compute_v1_generated_region_ssl_certificates_get_sync.py", + "description": "Sample for Delete", + "file": "compute_v1_generated_region_ssl_policies_delete_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionSslCertificates_Get_sync", + "regionTag": "compute_v1_generated_RegionSslPolicies_Delete_sync", "segments": [ { "end": 53, @@ -48545,28 +50597,28 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_ssl_certificates_get_sync.py" + "title": "compute_v1_generated_region_ssl_policies_delete_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionSslCertificatesClient", - "shortName": "RegionSslCertificatesClient" + "fullName": "google.cloud.compute_v1.RegionSslPoliciesClient", + "shortName": "RegionSslPoliciesClient" }, - "fullName": "google.cloud.compute_v1.RegionSslCertificatesClient.insert", + "fullName": "google.cloud.compute_v1.RegionSslPoliciesClient.get", "method": { - "fullName": "google.cloud.compute.v1.RegionSslCertificates.Insert", + "fullName": "google.cloud.compute.v1.RegionSslPolicies.Get", "service": { - "fullName": "google.cloud.compute.v1.RegionSslCertificates", - "shortName": "RegionSslCertificates" + "fullName": "google.cloud.compute.v1.RegionSslPolicies", + "shortName": "RegionSslPolicies" }, - "shortName": "Insert" + "shortName": "Get" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.InsertRegionSslCertificateRequest" + "type": "google.cloud.compute_v1.types.GetRegionSslPolicyRequest" }, { "name": "project", @@ -48577,8 +50629,8 @@ "type": "str" }, { - "name": "ssl_certificate_resource", - "type": "google.cloud.compute_v1.types.SslCertificate" + "name": "ssl_policy", + "type": "str" }, { "name": "retry", @@ -48593,22 +50645,22 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "insert" + "resultType": "google.cloud.compute_v1.types.SslPolicy", + "shortName": "get" }, - "description": "Sample for Insert", - "file": "compute_v1_generated_region_ssl_certificates_insert_sync.py", + "description": "Sample for Get", + "file": "compute_v1_generated_region_ssl_policies_get_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionSslCertificates_Insert_sync", + "regionTag": "compute_v1_generated_RegionSslPolicies_Get_sync", "segments": [ { - "end": 52, + "end": 53, "start": 27, "type": "FULL" }, { - "end": 52, + "end": 53, "start": 27, "type": "SHORT" }, @@ -48618,43 +50670,43 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 46, + "end": 47, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 49, - "start": 47, + "end": 50, + "start": 48, "type": "REQUEST_EXECUTION" }, { - "end": 53, - "start": 50, + "end": 54, + "start": 51, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_ssl_certificates_insert_sync.py" + "title": "compute_v1_generated_region_ssl_policies_get_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionSslCertificatesClient", - "shortName": "RegionSslCertificatesClient" + "fullName": "google.cloud.compute_v1.RegionSslPoliciesClient", + "shortName": "RegionSslPoliciesClient" }, - "fullName": "google.cloud.compute_v1.RegionSslCertificatesClient.list", + "fullName": "google.cloud.compute_v1.RegionSslPoliciesClient.insert", "method": { - "fullName": "google.cloud.compute.v1.RegionSslCertificates.List", + "fullName": "google.cloud.compute.v1.RegionSslPolicies.Insert", "service": { - "fullName": "google.cloud.compute.v1.RegionSslCertificates", - "shortName": "RegionSslCertificates" + "fullName": "google.cloud.compute.v1.RegionSslPolicies", + "shortName": "RegionSslPolicies" }, - "shortName": "List" + "shortName": "Insert" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.ListRegionSslCertificatesRequest" + "type": "google.cloud.compute_v1.types.InsertRegionSslPolicyRequest" }, { "name": "project", @@ -48664,6 +50716,10 @@ "name": "region", "type": "str" }, + { + "name": "ssl_policy_resource", + "type": "google.cloud.compute_v1.types.SslPolicy" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -48677,22 +50733,22 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.services.region_ssl_certificates.pagers.ListPager", - "shortName": "list" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "insert" }, - "description": "Sample for List", - "file": "compute_v1_generated_region_ssl_certificates_list_sync.py", + "description": "Sample for Insert", + "file": "compute_v1_generated_region_ssl_policies_insert_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionSslCertificates_List_sync", + "regionTag": "compute_v1_generated_RegionSslPolicies_Insert_sync", "segments": [ { - "end": 53, + "end": 52, "start": 27, "type": "FULL" }, { - "end": 53, + "end": 52, "start": 27, "type": "SHORT" }, @@ -48712,12 +50768,12 @@ "type": "REQUEST_EXECUTION" }, { - "end": 54, + "end": 53, "start": 50, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_ssl_certificates_list_sync.py" + "title": "compute_v1_generated_region_ssl_policies_insert_sync.py" }, { "canonical": true, @@ -48726,19 +50782,19 @@ "fullName": "google.cloud.compute_v1.RegionSslPoliciesClient", "shortName": "RegionSslPoliciesClient" }, - "fullName": "google.cloud.compute_v1.RegionSslPoliciesClient.delete", + "fullName": "google.cloud.compute_v1.RegionSslPoliciesClient.list_available_features", "method": { - "fullName": "google.cloud.compute.v1.RegionSslPolicies.Delete", + "fullName": "google.cloud.compute.v1.RegionSslPolicies.ListAvailableFeatures", "service": { "fullName": "google.cloud.compute.v1.RegionSslPolicies", "shortName": "RegionSslPolicies" }, - "shortName": "Delete" + "shortName": "ListAvailableFeatures" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.DeleteRegionSslPolicyRequest" + "type": "google.cloud.compute_v1.types.ListAvailableFeaturesRegionSslPoliciesRequest" }, { "name": "project", @@ -48748,10 +50804,6 @@ "name": "region", "type": "str" }, - { - "name": "ssl_policy", - "type": "str" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -48765,22 +50817,22 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "delete" + "resultType": "google.cloud.compute_v1.types.SslPoliciesListAvailableFeaturesResponse", + "shortName": "list_available_features" }, - "description": "Sample for Delete", - "file": "compute_v1_generated_region_ssl_policies_delete_sync.py", + "description": "Sample for ListAvailableFeatures", + "file": "compute_v1_generated_region_ssl_policies_list_available_features_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionSslPolicies_Delete_sync", + "regionTag": "compute_v1_generated_RegionSslPolicies_ListAvailableFeatures_sync", "segments": [ { - "end": 53, + "end": 52, "start": 27, "type": "FULL" }, { - "end": 53, + "end": 52, "start": 27, "type": "SHORT" }, @@ -48790,22 +50842,22 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 47, + "end": 46, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 50, - "start": 48, + "end": 49, + "start": 47, "type": "REQUEST_EXECUTION" }, { - "end": 54, - "start": 51, + "end": 53, + "start": 50, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_ssl_policies_delete_sync.py" + "title": "compute_v1_generated_region_ssl_policies_list_available_features_sync.py" }, { "canonical": true, @@ -48814,19 +50866,19 @@ "fullName": "google.cloud.compute_v1.RegionSslPoliciesClient", "shortName": "RegionSslPoliciesClient" }, - "fullName": "google.cloud.compute_v1.RegionSslPoliciesClient.get", + "fullName": "google.cloud.compute_v1.RegionSslPoliciesClient.list", "method": { - "fullName": "google.cloud.compute.v1.RegionSslPolicies.Get", + "fullName": "google.cloud.compute.v1.RegionSslPolicies.List", "service": { "fullName": "google.cloud.compute.v1.RegionSslPolicies", "shortName": "RegionSslPolicies" }, - "shortName": "Get" + "shortName": "List" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetRegionSslPolicyRequest" + "type": "google.cloud.compute_v1.types.ListRegionSslPoliciesRequest" }, { "name": "project", @@ -48836,10 +50888,6 @@ "name": "region", "type": "str" }, - { - "name": "ssl_policy", - "type": "str" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -48853,14 +50901,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.SslPolicy", - "shortName": "get" + "resultType": "google.cloud.compute_v1.services.region_ssl_policies.pagers.ListPager", + "shortName": "list" }, - "description": "Sample for Get", - "file": "compute_v1_generated_region_ssl_policies_get_sync.py", + "description": "Sample for List", + "file": "compute_v1_generated_region_ssl_policies_list_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionSslPolicies_Get_sync", + "regionTag": "compute_v1_generated_RegionSslPolicies_List_sync", "segments": [ { "end": 53, @@ -48878,22 +50926,22 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 47, + "end": 46, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 50, - "start": 48, + "end": 49, + "start": 47, "type": "REQUEST_EXECUTION" }, { "end": 54, - "start": 51, + "start": 50, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_ssl_policies_get_sync.py" + "title": "compute_v1_generated_region_ssl_policies_list_sync.py" }, { "canonical": true, @@ -48902,19 +50950,19 @@ "fullName": "google.cloud.compute_v1.RegionSslPoliciesClient", "shortName": "RegionSslPoliciesClient" }, - "fullName": "google.cloud.compute_v1.RegionSslPoliciesClient.insert", + "fullName": "google.cloud.compute_v1.RegionSslPoliciesClient.patch", "method": { - "fullName": "google.cloud.compute.v1.RegionSslPolicies.Insert", + "fullName": "google.cloud.compute.v1.RegionSslPolicies.Patch", "service": { "fullName": "google.cloud.compute.v1.RegionSslPolicies", "shortName": "RegionSslPolicies" }, - "shortName": "Insert" + "shortName": "Patch" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.InsertRegionSslPolicyRequest" + "type": "google.cloud.compute_v1.types.PatchRegionSslPolicyRequest" }, { "name": "project", @@ -48924,6 +50972,10 @@ "name": "region", "type": "str" }, + { + "name": "ssl_policy", + "type": "str" + }, { "name": "ssl_policy_resource", "type": "google.cloud.compute_v1.types.SslPolicy" @@ -48942,21 +50994,21 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "insert" + "shortName": "patch" }, - "description": "Sample for Insert", - "file": "compute_v1_generated_region_ssl_policies_insert_sync.py", + "description": "Sample for Patch", + "file": "compute_v1_generated_region_ssl_policies_patch_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionSslPolicies_Insert_sync", + "regionTag": "compute_v1_generated_RegionSslPolicies_Patch_sync", "segments": [ { - "end": 52, + "end": 53, "start": 27, "type": "FULL" }, { - "end": 52, + "end": 53, "start": 27, "type": "SHORT" }, @@ -48966,43 +51018,43 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 46, + "end": 47, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 49, - "start": 47, + "end": 50, + "start": 48, "type": "REQUEST_EXECUTION" }, { - "end": 53, - "start": 50, + "end": 54, + "start": 51, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_ssl_policies_insert_sync.py" + "title": "compute_v1_generated_region_ssl_policies_patch_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionSslPoliciesClient", - "shortName": "RegionSslPoliciesClient" + "fullName": "google.cloud.compute_v1.RegionTargetHttpProxiesClient", + "shortName": "RegionTargetHttpProxiesClient" }, - "fullName": "google.cloud.compute_v1.RegionSslPoliciesClient.list_available_features", + "fullName": "google.cloud.compute_v1.RegionTargetHttpProxiesClient.delete", "method": { - "fullName": "google.cloud.compute.v1.RegionSslPolicies.ListAvailableFeatures", + "fullName": "google.cloud.compute.v1.RegionTargetHttpProxies.Delete", "service": { - "fullName": "google.cloud.compute.v1.RegionSslPolicies", - "shortName": "RegionSslPolicies" + "fullName": "google.cloud.compute.v1.RegionTargetHttpProxies", + "shortName": "RegionTargetHttpProxies" }, - "shortName": "ListAvailableFeatures" + "shortName": "Delete" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.ListAvailableFeaturesRegionSslPoliciesRequest" + "type": "google.cloud.compute_v1.types.DeleteRegionTargetHttpProxyRequest" }, { "name": "project", @@ -49012,6 +51064,10 @@ "name": "region", "type": "str" }, + { + "name": "target_http_proxy", + "type": "str" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -49025,22 +51081,22 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.SslPoliciesListAvailableFeaturesResponse", - "shortName": "list_available_features" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "delete" }, - "description": "Sample for ListAvailableFeatures", - "file": "compute_v1_generated_region_ssl_policies_list_available_features_sync.py", + "description": "Sample for Delete", + "file": "compute_v1_generated_region_target_http_proxies_delete_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionSslPolicies_ListAvailableFeatures_sync", + "regionTag": "compute_v1_generated_RegionTargetHttpProxies_Delete_sync", "segments": [ { - "end": 52, + "end": 53, "start": 27, "type": "FULL" }, { - "end": 52, + "end": 53, "start": 27, "type": "SHORT" }, @@ -49050,43 +51106,43 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 46, + "end": 47, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 49, - "start": 47, + "end": 50, + "start": 48, "type": "REQUEST_EXECUTION" }, { - "end": 53, - "start": 50, + "end": 54, + "start": 51, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_ssl_policies_list_available_features_sync.py" + "title": "compute_v1_generated_region_target_http_proxies_delete_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionSslPoliciesClient", - "shortName": "RegionSslPoliciesClient" + "fullName": "google.cloud.compute_v1.RegionTargetHttpProxiesClient", + "shortName": "RegionTargetHttpProxiesClient" }, - "fullName": "google.cloud.compute_v1.RegionSslPoliciesClient.list", + "fullName": "google.cloud.compute_v1.RegionTargetHttpProxiesClient.get", "method": { - "fullName": "google.cloud.compute.v1.RegionSslPolicies.List", + "fullName": "google.cloud.compute.v1.RegionTargetHttpProxies.Get", "service": { - "fullName": "google.cloud.compute.v1.RegionSslPolicies", - "shortName": "RegionSslPolicies" + "fullName": "google.cloud.compute.v1.RegionTargetHttpProxies", + "shortName": "RegionTargetHttpProxies" }, - "shortName": "List" + "shortName": "Get" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.ListRegionSslPoliciesRequest" + "type": "google.cloud.compute_v1.types.GetRegionTargetHttpProxyRequest" }, { "name": "project", @@ -49096,6 +51152,10 @@ "name": "region", "type": "str" }, + { + "name": "target_http_proxy", + "type": "str" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -49109,14 +51169,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.services.region_ssl_policies.pagers.ListPager", - "shortName": "list" + "resultType": "google.cloud.compute_v1.types.TargetHttpProxy", + "shortName": "get" }, - "description": "Sample for List", - "file": "compute_v1_generated_region_ssl_policies_list_sync.py", + "description": "Sample for Get", + "file": "compute_v1_generated_region_target_http_proxies_get_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionSslPolicies_List_sync", + "regionTag": "compute_v1_generated_RegionTargetHttpProxies_Get_sync", "segments": [ { "end": 53, @@ -49134,43 +51194,43 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 46, + "end": 47, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 49, - "start": 47, + "end": 50, + "start": 48, "type": "REQUEST_EXECUTION" }, { "end": 54, - "start": 50, + "start": 51, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_ssl_policies_list_sync.py" + "title": "compute_v1_generated_region_target_http_proxies_get_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionSslPoliciesClient", - "shortName": "RegionSslPoliciesClient" + "fullName": "google.cloud.compute_v1.RegionTargetHttpProxiesClient", + "shortName": "RegionTargetHttpProxiesClient" }, - "fullName": "google.cloud.compute_v1.RegionSslPoliciesClient.patch", + "fullName": "google.cloud.compute_v1.RegionTargetHttpProxiesClient.insert", "method": { - "fullName": "google.cloud.compute.v1.RegionSslPolicies.Patch", + "fullName": "google.cloud.compute.v1.RegionTargetHttpProxies.Insert", "service": { - "fullName": "google.cloud.compute.v1.RegionSslPolicies", - "shortName": "RegionSslPolicies" + "fullName": "google.cloud.compute.v1.RegionTargetHttpProxies", + "shortName": "RegionTargetHttpProxies" }, - "shortName": "Patch" + "shortName": "Insert" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.PatchRegionSslPolicyRequest" + "type": "google.cloud.compute_v1.types.InsertRegionTargetHttpProxyRequest" }, { "name": "project", @@ -49181,12 +51241,8 @@ "type": "str" }, { - "name": "ssl_policy", - "type": "str" - }, - { - "name": "ssl_policy_resource", - "type": "google.cloud.compute_v1.types.SslPolicy" + "name": "target_http_proxy_resource", + "type": "google.cloud.compute_v1.types.TargetHttpProxy" }, { "name": "retry", @@ -49202,21 +51258,21 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "patch" + "shortName": "insert" }, - "description": "Sample for Patch", - "file": "compute_v1_generated_region_ssl_policies_patch_sync.py", + "description": "Sample for Insert", + "file": "compute_v1_generated_region_target_http_proxies_insert_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionSslPolicies_Patch_sync", + "regionTag": "compute_v1_generated_RegionTargetHttpProxies_Insert_sync", "segments": [ { - "end": 53, + "end": 52, "start": 27, "type": "FULL" }, { - "end": 53, + "end": 52, "start": 27, "type": "SHORT" }, @@ -49226,22 +51282,22 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 47, + "end": 46, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 50, - "start": 48, + "end": 49, + "start": 47, "type": "REQUEST_EXECUTION" }, { - "end": 54, - "start": 51, + "end": 53, + "start": 50, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_ssl_policies_patch_sync.py" + "title": "compute_v1_generated_region_target_http_proxies_insert_sync.py" }, { "canonical": true, @@ -49250,19 +51306,19 @@ "fullName": "google.cloud.compute_v1.RegionTargetHttpProxiesClient", "shortName": "RegionTargetHttpProxiesClient" }, - "fullName": "google.cloud.compute_v1.RegionTargetHttpProxiesClient.delete", + "fullName": "google.cloud.compute_v1.RegionTargetHttpProxiesClient.list", "method": { - "fullName": "google.cloud.compute.v1.RegionTargetHttpProxies.Delete", + "fullName": "google.cloud.compute.v1.RegionTargetHttpProxies.List", "service": { "fullName": "google.cloud.compute.v1.RegionTargetHttpProxies", "shortName": "RegionTargetHttpProxies" }, - "shortName": "Delete" + "shortName": "List" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.DeleteRegionTargetHttpProxyRequest" + "type": "google.cloud.compute_v1.types.ListRegionTargetHttpProxiesRequest" }, { "name": "project", @@ -49272,10 +51328,6 @@ "name": "region", "type": "str" }, - { - "name": "target_http_proxy", - "type": "str" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -49289,14 +51341,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "delete" + "resultType": "google.cloud.compute_v1.services.region_target_http_proxies.pagers.ListPager", + "shortName": "list" }, - "description": "Sample for Delete", - "file": "compute_v1_generated_region_target_http_proxies_delete_sync.py", + "description": "Sample for List", + "file": "compute_v1_generated_region_target_http_proxies_list_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionTargetHttpProxies_Delete_sync", + "regionTag": "compute_v1_generated_RegionTargetHttpProxies_List_sync", "segments": [ { "end": 53, @@ -49314,22 +51366,22 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 47, + "end": 46, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 50, - "start": 48, + "end": 49, + "start": 47, "type": "REQUEST_EXECUTION" }, { "end": 54, - "start": 51, + "start": 50, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_target_http_proxies_delete_sync.py" + "title": "compute_v1_generated_region_target_http_proxies_list_sync.py" }, { "canonical": true, @@ -49338,19 +51390,19 @@ "fullName": "google.cloud.compute_v1.RegionTargetHttpProxiesClient", "shortName": "RegionTargetHttpProxiesClient" }, - "fullName": "google.cloud.compute_v1.RegionTargetHttpProxiesClient.get", + "fullName": "google.cloud.compute_v1.RegionTargetHttpProxiesClient.set_url_map", "method": { - "fullName": "google.cloud.compute.v1.RegionTargetHttpProxies.Get", + "fullName": "google.cloud.compute.v1.RegionTargetHttpProxies.SetUrlMap", "service": { "fullName": "google.cloud.compute.v1.RegionTargetHttpProxies", "shortName": "RegionTargetHttpProxies" }, - "shortName": "Get" + "shortName": "SetUrlMap" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetRegionTargetHttpProxyRequest" + "type": "google.cloud.compute_v1.types.SetUrlMapRegionTargetHttpProxyRequest" }, { "name": "project", @@ -49364,6 +51416,10 @@ "name": "target_http_proxy", "type": "str" }, + { + "name": "url_map_reference_resource", + "type": "google.cloud.compute_v1.types.UrlMapReference" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -49377,14 +51433,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.TargetHttpProxy", - "shortName": "get" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "set_url_map" }, - "description": "Sample for Get", - "file": "compute_v1_generated_region_target_http_proxies_get_sync.py", + "description": "Sample for SetUrlMap", + "file": "compute_v1_generated_region_target_http_proxies_set_url_map_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionTargetHttpProxies_Get_sync", + "regionTag": "compute_v1_generated_RegionTargetHttpProxies_SetUrlMap_sync", "segments": [ { "end": 53, @@ -49417,28 +51473,28 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_target_http_proxies_get_sync.py" + "title": "compute_v1_generated_region_target_http_proxies_set_url_map_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionTargetHttpProxiesClient", - "shortName": "RegionTargetHttpProxiesClient" + "fullName": "google.cloud.compute_v1.RegionTargetHttpsProxiesClient", + "shortName": "RegionTargetHttpsProxiesClient" }, - "fullName": "google.cloud.compute_v1.RegionTargetHttpProxiesClient.insert", + "fullName": "google.cloud.compute_v1.RegionTargetHttpsProxiesClient.delete", "method": { - "fullName": "google.cloud.compute.v1.RegionTargetHttpProxies.Insert", + "fullName": "google.cloud.compute.v1.RegionTargetHttpsProxies.Delete", "service": { - "fullName": "google.cloud.compute.v1.RegionTargetHttpProxies", - "shortName": "RegionTargetHttpProxies" + "fullName": "google.cloud.compute.v1.RegionTargetHttpsProxies", + "shortName": "RegionTargetHttpsProxies" }, - "shortName": "Insert" + "shortName": "Delete" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.InsertRegionTargetHttpProxyRequest" + "type": "google.cloud.compute_v1.types.DeleteRegionTargetHttpsProxyRequest" }, { "name": "project", @@ -49449,91 +51505,7 @@ "type": "str" }, { - "name": "target_http_proxy_resource", - "type": "google.cloud.compute_v1.types.TargetHttpProxy" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, Union[str, bytes]]]" - } - ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "insert" - }, - "description": "Sample for Insert", - "file": "compute_v1_generated_region_target_http_proxies_insert_sync.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionTargetHttpProxies_Insert_sync", - "segments": [ - { - "end": 52, - "start": 27, - "type": "FULL" - }, - { - "end": 52, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 46, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 49, - "start": 47, - "type": "REQUEST_EXECUTION" - }, - { - "end": 53, - "start": 50, - "type": "RESPONSE_HANDLING" - } - ], - "title": "compute_v1_generated_region_target_http_proxies_insert_sync.py" - }, - { - "canonical": true, - "clientMethod": { - "client": { - "fullName": "google.cloud.compute_v1.RegionTargetHttpProxiesClient", - "shortName": "RegionTargetHttpProxiesClient" - }, - "fullName": "google.cloud.compute_v1.RegionTargetHttpProxiesClient.list", - "method": { - "fullName": "google.cloud.compute.v1.RegionTargetHttpProxies.List", - "service": { - "fullName": "google.cloud.compute.v1.RegionTargetHttpProxies", - "shortName": "RegionTargetHttpProxies" - }, - "shortName": "List" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.compute_v1.types.ListRegionTargetHttpProxiesRequest" - }, - { - "name": "project", - "type": "str" - }, - { - "name": "region", + "name": "target_https_proxy", "type": "str" }, { @@ -49549,14 +51521,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.services.region_target_http_proxies.pagers.ListPager", - "shortName": "list" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "delete" }, - "description": "Sample for List", - "file": "compute_v1_generated_region_target_http_proxies_list_sync.py", + "description": "Sample for Delete", + "file": "compute_v1_generated_region_target_https_proxies_delete_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionTargetHttpProxies_List_sync", + "regionTag": "compute_v1_generated_RegionTargetHttpsProxies_Delete_sync", "segments": [ { "end": 53, @@ -49574,43 +51546,43 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 46, + "end": 47, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 49, - "start": 47, + "end": 50, + "start": 48, "type": "REQUEST_EXECUTION" }, { "end": 54, - "start": 50, + "start": 51, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_target_http_proxies_list_sync.py" + "title": "compute_v1_generated_region_target_https_proxies_delete_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionTargetHttpProxiesClient", - "shortName": "RegionTargetHttpProxiesClient" + "fullName": "google.cloud.compute_v1.RegionTargetHttpsProxiesClient", + "shortName": "RegionTargetHttpsProxiesClient" }, - "fullName": "google.cloud.compute_v1.RegionTargetHttpProxiesClient.set_url_map", + "fullName": "google.cloud.compute_v1.RegionTargetHttpsProxiesClient.get", "method": { - "fullName": "google.cloud.compute.v1.RegionTargetHttpProxies.SetUrlMap", + "fullName": "google.cloud.compute.v1.RegionTargetHttpsProxies.Get", "service": { - "fullName": "google.cloud.compute.v1.RegionTargetHttpProxies", - "shortName": "RegionTargetHttpProxies" + "fullName": "google.cloud.compute.v1.RegionTargetHttpsProxies", + "shortName": "RegionTargetHttpsProxies" }, - "shortName": "SetUrlMap" + "shortName": "Get" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.SetUrlMapRegionTargetHttpProxyRequest" + "type": "google.cloud.compute_v1.types.GetRegionTargetHttpsProxyRequest" }, { "name": "project", @@ -49621,13 +51593,9 @@ "type": "str" }, { - "name": "target_http_proxy", + "name": "target_https_proxy", "type": "str" }, - { - "name": "url_map_reference_resource", - "type": "google.cloud.compute_v1.types.UrlMapReference" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -49641,14 +51609,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "set_url_map" + "resultType": "google.cloud.compute_v1.types.TargetHttpsProxy", + "shortName": "get" }, - "description": "Sample for SetUrlMap", - "file": "compute_v1_generated_region_target_http_proxies_set_url_map_sync.py", + "description": "Sample for Get", + "file": "compute_v1_generated_region_target_https_proxies_get_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionTargetHttpProxies_SetUrlMap_sync", + "regionTag": "compute_v1_generated_RegionTargetHttpsProxies_Get_sync", "segments": [ { "end": 53, @@ -49681,7 +51649,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_target_http_proxies_set_url_map_sync.py" + "title": "compute_v1_generated_region_target_https_proxies_get_sync.py" }, { "canonical": true, @@ -49690,19 +51658,19 @@ "fullName": "google.cloud.compute_v1.RegionTargetHttpsProxiesClient", "shortName": "RegionTargetHttpsProxiesClient" }, - "fullName": "google.cloud.compute_v1.RegionTargetHttpsProxiesClient.delete", + "fullName": "google.cloud.compute_v1.RegionTargetHttpsProxiesClient.insert", "method": { - "fullName": "google.cloud.compute.v1.RegionTargetHttpsProxies.Delete", + "fullName": "google.cloud.compute.v1.RegionTargetHttpsProxies.Insert", "service": { "fullName": "google.cloud.compute.v1.RegionTargetHttpsProxies", "shortName": "RegionTargetHttpsProxies" }, - "shortName": "Delete" + "shortName": "Insert" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.DeleteRegionTargetHttpsProxyRequest" + "type": "google.cloud.compute_v1.types.InsertRegionTargetHttpsProxyRequest" }, { "name": "project", @@ -49713,8 +51681,8 @@ "type": "str" }, { - "name": "target_https_proxy", - "type": "str" + "name": "target_https_proxy_resource", + "type": "google.cloud.compute_v1.types.TargetHttpsProxy" }, { "name": "retry", @@ -49730,21 +51698,21 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "delete" + "shortName": "insert" }, - "description": "Sample for Delete", - "file": "compute_v1_generated_region_target_https_proxies_delete_sync.py", + "description": "Sample for Insert", + "file": "compute_v1_generated_region_target_https_proxies_insert_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionTargetHttpsProxies_Delete_sync", + "regionTag": "compute_v1_generated_RegionTargetHttpsProxies_Insert_sync", "segments": [ { - "end": 53, + "end": 52, "start": 27, "type": "FULL" }, { - "end": 53, + "end": 52, "start": 27, "type": "SHORT" }, @@ -49754,22 +51722,22 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 47, + "end": 46, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 50, - "start": 48, + "end": 49, + "start": 47, "type": "REQUEST_EXECUTION" }, { - "end": 54, - "start": 51, + "end": 53, + "start": 50, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_target_https_proxies_delete_sync.py" + "title": "compute_v1_generated_region_target_https_proxies_insert_sync.py" }, { "canonical": true, @@ -49778,19 +51746,19 @@ "fullName": "google.cloud.compute_v1.RegionTargetHttpsProxiesClient", "shortName": "RegionTargetHttpsProxiesClient" }, - "fullName": "google.cloud.compute_v1.RegionTargetHttpsProxiesClient.get", + "fullName": "google.cloud.compute_v1.RegionTargetHttpsProxiesClient.list", "method": { - "fullName": "google.cloud.compute.v1.RegionTargetHttpsProxies.Get", + "fullName": "google.cloud.compute.v1.RegionTargetHttpsProxies.List", "service": { "fullName": "google.cloud.compute.v1.RegionTargetHttpsProxies", "shortName": "RegionTargetHttpsProxies" }, - "shortName": "Get" + "shortName": "List" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetRegionTargetHttpsProxyRequest" + "type": "google.cloud.compute_v1.types.ListRegionTargetHttpsProxiesRequest" }, { "name": "project", @@ -49800,10 +51768,6 @@ "name": "region", "type": "str" }, - { - "name": "target_https_proxy", - "type": "str" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -49817,14 +51781,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.TargetHttpsProxy", - "shortName": "get" + "resultType": "google.cloud.compute_v1.services.region_target_https_proxies.pagers.ListPager", + "shortName": "list" }, - "description": "Sample for Get", - "file": "compute_v1_generated_region_target_https_proxies_get_sync.py", + "description": "Sample for List", + "file": "compute_v1_generated_region_target_https_proxies_list_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionTargetHttpsProxies_Get_sync", + "regionTag": "compute_v1_generated_RegionTargetHttpsProxies_List_sync", "segments": [ { "end": 53, @@ -49842,22 +51806,22 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 47, + "end": 46, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 50, - "start": 48, + "end": 49, + "start": 47, "type": "REQUEST_EXECUTION" }, { "end": 54, - "start": 51, + "start": 50, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_target_https_proxies_get_sync.py" + "title": "compute_v1_generated_region_target_https_proxies_list_sync.py" }, { "canonical": true, @@ -49866,19 +51830,19 @@ "fullName": "google.cloud.compute_v1.RegionTargetHttpsProxiesClient", "shortName": "RegionTargetHttpsProxiesClient" }, - "fullName": "google.cloud.compute_v1.RegionTargetHttpsProxiesClient.insert", + "fullName": "google.cloud.compute_v1.RegionTargetHttpsProxiesClient.patch", "method": { - "fullName": "google.cloud.compute.v1.RegionTargetHttpsProxies.Insert", + "fullName": "google.cloud.compute.v1.RegionTargetHttpsProxies.Patch", "service": { "fullName": "google.cloud.compute.v1.RegionTargetHttpsProxies", "shortName": "RegionTargetHttpsProxies" }, - "shortName": "Insert" + "shortName": "Patch" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.InsertRegionTargetHttpsProxyRequest" + "type": "google.cloud.compute_v1.types.PatchRegionTargetHttpsProxyRequest" }, { "name": "project", @@ -49888,6 +51852,10 @@ "name": "region", "type": "str" }, + { + "name": "target_https_proxy", + "type": "str" + }, { "name": "target_https_proxy_resource", "type": "google.cloud.compute_v1.types.TargetHttpsProxy" @@ -49906,21 +51874,21 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "insert" + "shortName": "patch" }, - "description": "Sample for Insert", - "file": "compute_v1_generated_region_target_https_proxies_insert_sync.py", + "description": "Sample for Patch", + "file": "compute_v1_generated_region_target_https_proxies_patch_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionTargetHttpsProxies_Insert_sync", + "regionTag": "compute_v1_generated_RegionTargetHttpsProxies_Patch_sync", "segments": [ { - "end": 52, + "end": 53, "start": 27, "type": "FULL" }, { - "end": 52, + "end": 53, "start": 27, "type": "SHORT" }, @@ -49930,22 +51898,22 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 46, + "end": 47, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 49, - "start": 47, + "end": 50, + "start": 48, "type": "REQUEST_EXECUTION" }, { - "end": 53, - "start": 50, + "end": 54, + "start": 51, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_target_https_proxies_insert_sync.py" + "title": "compute_v1_generated_region_target_https_proxies_patch_sync.py" }, { "canonical": true, @@ -49954,19 +51922,19 @@ "fullName": "google.cloud.compute_v1.RegionTargetHttpsProxiesClient", "shortName": "RegionTargetHttpsProxiesClient" }, - "fullName": "google.cloud.compute_v1.RegionTargetHttpsProxiesClient.list", + "fullName": "google.cloud.compute_v1.RegionTargetHttpsProxiesClient.set_ssl_certificates", "method": { - "fullName": "google.cloud.compute.v1.RegionTargetHttpsProxies.List", + "fullName": "google.cloud.compute.v1.RegionTargetHttpsProxies.SetSslCertificates", "service": { "fullName": "google.cloud.compute.v1.RegionTargetHttpsProxies", "shortName": "RegionTargetHttpsProxies" }, - "shortName": "List" + "shortName": "SetSslCertificates" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.ListRegionTargetHttpsProxiesRequest" + "type": "google.cloud.compute_v1.types.SetSslCertificatesRegionTargetHttpsProxyRequest" }, { "name": "project", @@ -49976,6 +51944,14 @@ "name": "region", "type": "str" }, + { + "name": "target_https_proxy", + "type": "str" + }, + { + "name": "region_target_https_proxies_set_ssl_certificates_request_resource", + "type": "google.cloud.compute_v1.types.RegionTargetHttpsProxiesSetSslCertificatesRequest" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -49989,14 +51965,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.services.region_target_https_proxies.pagers.ListPager", - "shortName": "list" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "set_ssl_certificates" }, - "description": "Sample for List", - "file": "compute_v1_generated_region_target_https_proxies_list_sync.py", + "description": "Sample for SetSslCertificates", + "file": "compute_v1_generated_region_target_https_proxies_set_ssl_certificates_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionTargetHttpsProxies_List_sync", + "regionTag": "compute_v1_generated_RegionTargetHttpsProxies_SetSslCertificates_sync", "segments": [ { "end": 53, @@ -50014,22 +51990,22 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 46, + "end": 47, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 49, - "start": 47, + "end": 50, + "start": 48, "type": "REQUEST_EXECUTION" }, { "end": 54, - "start": 50, + "start": 51, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_target_https_proxies_list_sync.py" + "title": "compute_v1_generated_region_target_https_proxies_set_ssl_certificates_sync.py" }, { "canonical": true, @@ -50038,19 +52014,19 @@ "fullName": "google.cloud.compute_v1.RegionTargetHttpsProxiesClient", "shortName": "RegionTargetHttpsProxiesClient" }, - "fullName": "google.cloud.compute_v1.RegionTargetHttpsProxiesClient.patch", + "fullName": "google.cloud.compute_v1.RegionTargetHttpsProxiesClient.set_url_map", "method": { - "fullName": "google.cloud.compute.v1.RegionTargetHttpsProxies.Patch", + "fullName": "google.cloud.compute.v1.RegionTargetHttpsProxies.SetUrlMap", "service": { "fullName": "google.cloud.compute.v1.RegionTargetHttpsProxies", "shortName": "RegionTargetHttpsProxies" }, - "shortName": "Patch" + "shortName": "SetUrlMap" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.PatchRegionTargetHttpsProxyRequest" + "type": "google.cloud.compute_v1.types.SetUrlMapRegionTargetHttpsProxyRequest" }, { "name": "project", @@ -50065,8 +52041,8 @@ "type": "str" }, { - "name": "target_https_proxy_resource", - "type": "google.cloud.compute_v1.types.TargetHttpsProxy" + "name": "url_map_reference_resource", + "type": "google.cloud.compute_v1.types.UrlMapReference" }, { "name": "retry", @@ -50082,13 +52058,13 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "patch" + "shortName": "set_url_map" }, - "description": "Sample for Patch", - "file": "compute_v1_generated_region_target_https_proxies_patch_sync.py", + "description": "Sample for SetUrlMap", + "file": "compute_v1_generated_region_target_https_proxies_set_url_map_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionTargetHttpsProxies_Patch_sync", + "regionTag": "compute_v1_generated_RegionTargetHttpsProxies_SetUrlMap_sync", "segments": [ { "end": 53, @@ -50121,28 +52097,28 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_target_https_proxies_patch_sync.py" + "title": "compute_v1_generated_region_target_https_proxies_set_url_map_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionTargetHttpsProxiesClient", - "shortName": "RegionTargetHttpsProxiesClient" + "fullName": "google.cloud.compute_v1.RegionTargetTcpProxiesClient", + "shortName": "RegionTargetTcpProxiesClient" }, - "fullName": "google.cloud.compute_v1.RegionTargetHttpsProxiesClient.set_ssl_certificates", + "fullName": "google.cloud.compute_v1.RegionTargetTcpProxiesClient.delete", "method": { - "fullName": "google.cloud.compute.v1.RegionTargetHttpsProxies.SetSslCertificates", + "fullName": "google.cloud.compute.v1.RegionTargetTcpProxies.Delete", "service": { - "fullName": "google.cloud.compute.v1.RegionTargetHttpsProxies", - "shortName": "RegionTargetHttpsProxies" + "fullName": "google.cloud.compute.v1.RegionTargetTcpProxies", + "shortName": "RegionTargetTcpProxies" }, - "shortName": "SetSslCertificates" + "shortName": "Delete" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.SetSslCertificatesRegionTargetHttpsProxyRequest" + "type": "google.cloud.compute_v1.types.DeleteRegionTargetTcpProxyRequest" }, { "name": "project", @@ -50153,13 +52129,9 @@ "type": "str" }, { - "name": "target_https_proxy", + "name": "target_tcp_proxy", "type": "str" }, - { - "name": "region_target_https_proxies_set_ssl_certificates_request_resource", - "type": "google.cloud.compute_v1.types.RegionTargetHttpsProxiesSetSslCertificatesRequest" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -50174,13 +52146,13 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "set_ssl_certificates" + "shortName": "delete" }, - "description": "Sample for SetSslCertificates", - "file": "compute_v1_generated_region_target_https_proxies_set_ssl_certificates_sync.py", + "description": "Sample for Delete", + "file": "compute_v1_generated_region_target_tcp_proxies_delete_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionTargetHttpsProxies_SetSslCertificates_sync", + "regionTag": "compute_v1_generated_RegionTargetTcpProxies_Delete_sync", "segments": [ { "end": 53, @@ -50213,28 +52185,28 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_target_https_proxies_set_ssl_certificates_sync.py" + "title": "compute_v1_generated_region_target_tcp_proxies_delete_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionTargetHttpsProxiesClient", - "shortName": "RegionTargetHttpsProxiesClient" + "fullName": "google.cloud.compute_v1.RegionTargetTcpProxiesClient", + "shortName": "RegionTargetTcpProxiesClient" }, - "fullName": "google.cloud.compute_v1.RegionTargetHttpsProxiesClient.set_url_map", + "fullName": "google.cloud.compute_v1.RegionTargetTcpProxiesClient.get", "method": { - "fullName": "google.cloud.compute.v1.RegionTargetHttpsProxies.SetUrlMap", + "fullName": "google.cloud.compute.v1.RegionTargetTcpProxies.Get", "service": { - "fullName": "google.cloud.compute.v1.RegionTargetHttpsProxies", - "shortName": "RegionTargetHttpsProxies" + "fullName": "google.cloud.compute.v1.RegionTargetTcpProxies", + "shortName": "RegionTargetTcpProxies" }, - "shortName": "SetUrlMap" + "shortName": "Get" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.SetUrlMapRegionTargetHttpsProxyRequest" + "type": "google.cloud.compute_v1.types.GetRegionTargetTcpProxyRequest" }, { "name": "project", @@ -50245,13 +52217,9 @@ "type": "str" }, { - "name": "target_https_proxy", + "name": "target_tcp_proxy", "type": "str" }, - { - "name": "url_map_reference_resource", - "type": "google.cloud.compute_v1.types.UrlMapReference" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -50265,14 +52233,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "set_url_map" + "resultType": "google.cloud.compute_v1.types.TargetTcpProxy", + "shortName": "get" }, - "description": "Sample for SetUrlMap", - "file": "compute_v1_generated_region_target_https_proxies_set_url_map_sync.py", + "description": "Sample for Get", + "file": "compute_v1_generated_region_target_tcp_proxies_get_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionTargetHttpsProxies_SetUrlMap_sync", + "regionTag": "compute_v1_generated_RegionTargetTcpProxies_Get_sync", "segments": [ { "end": 53, @@ -50305,7 +52273,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_target_https_proxies_set_url_map_sync.py" + "title": "compute_v1_generated_region_target_tcp_proxies_get_sync.py" }, { "canonical": true, @@ -50314,19 +52282,19 @@ "fullName": "google.cloud.compute_v1.RegionTargetTcpProxiesClient", "shortName": "RegionTargetTcpProxiesClient" }, - "fullName": "google.cloud.compute_v1.RegionTargetTcpProxiesClient.delete", + "fullName": "google.cloud.compute_v1.RegionTargetTcpProxiesClient.insert", "method": { - "fullName": "google.cloud.compute.v1.RegionTargetTcpProxies.Delete", + "fullName": "google.cloud.compute.v1.RegionTargetTcpProxies.Insert", "service": { "fullName": "google.cloud.compute.v1.RegionTargetTcpProxies", "shortName": "RegionTargetTcpProxies" }, - "shortName": "Delete" + "shortName": "Insert" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.DeleteRegionTargetTcpProxyRequest" + "type": "google.cloud.compute_v1.types.InsertRegionTargetTcpProxyRequest" }, { "name": "project", @@ -50337,8 +52305,8 @@ "type": "str" }, { - "name": "target_tcp_proxy", - "type": "str" + "name": "target_tcp_proxy_resource", + "type": "google.cloud.compute_v1.types.TargetTcpProxy" }, { "name": "retry", @@ -50354,21 +52322,21 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "delete" + "shortName": "insert" }, - "description": "Sample for Delete", - "file": "compute_v1_generated_region_target_tcp_proxies_delete_sync.py", + "description": "Sample for Insert", + "file": "compute_v1_generated_region_target_tcp_proxies_insert_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionTargetTcpProxies_Delete_sync", + "regionTag": "compute_v1_generated_RegionTargetTcpProxies_Insert_sync", "segments": [ { - "end": 53, + "end": 52, "start": 27, "type": "FULL" }, { - "end": 53, + "end": 52, "start": 27, "type": "SHORT" }, @@ -50378,22 +52346,22 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 47, + "end": 46, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 50, - "start": 48, + "end": 49, + "start": 47, "type": "REQUEST_EXECUTION" }, { - "end": 54, - "start": 51, + "end": 53, + "start": 50, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_target_tcp_proxies_delete_sync.py" + "title": "compute_v1_generated_region_target_tcp_proxies_insert_sync.py" }, { "canonical": true, @@ -50402,19 +52370,19 @@ "fullName": "google.cloud.compute_v1.RegionTargetTcpProxiesClient", "shortName": "RegionTargetTcpProxiesClient" }, - "fullName": "google.cloud.compute_v1.RegionTargetTcpProxiesClient.get", + "fullName": "google.cloud.compute_v1.RegionTargetTcpProxiesClient.list", "method": { - "fullName": "google.cloud.compute.v1.RegionTargetTcpProxies.Get", + "fullName": "google.cloud.compute.v1.RegionTargetTcpProxies.List", "service": { "fullName": "google.cloud.compute.v1.RegionTargetTcpProxies", "shortName": "RegionTargetTcpProxies" }, - "shortName": "Get" + "shortName": "List" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetRegionTargetTcpProxyRequest" + "type": "google.cloud.compute_v1.types.ListRegionTargetTcpProxiesRequest" }, { "name": "project", @@ -50424,10 +52392,6 @@ "name": "region", "type": "str" }, - { - "name": "target_tcp_proxy", - "type": "str" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -50441,14 +52405,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.TargetTcpProxy", - "shortName": "get" + "resultType": "google.cloud.compute_v1.services.region_target_tcp_proxies.pagers.ListPager", + "shortName": "list" }, - "description": "Sample for Get", - "file": "compute_v1_generated_region_target_tcp_proxies_get_sync.py", + "description": "Sample for List", + "file": "compute_v1_generated_region_target_tcp_proxies_list_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionTargetTcpProxies_Get_sync", + "regionTag": "compute_v1_generated_RegionTargetTcpProxies_List_sync", "segments": [ { "end": 53, @@ -50466,43 +52430,43 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 47, + "end": 46, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 50, - "start": 48, + "end": 49, + "start": 47, "type": "REQUEST_EXECUTION" }, { "end": 54, - "start": 51, + "start": 50, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_target_tcp_proxies_get_sync.py" + "title": "compute_v1_generated_region_target_tcp_proxies_list_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionTargetTcpProxiesClient", - "shortName": "RegionTargetTcpProxiesClient" + "fullName": "google.cloud.compute_v1.RegionUrlMapsClient", + "shortName": "RegionUrlMapsClient" }, - "fullName": "google.cloud.compute_v1.RegionTargetTcpProxiesClient.insert", + "fullName": "google.cloud.compute_v1.RegionUrlMapsClient.delete", "method": { - "fullName": "google.cloud.compute.v1.RegionTargetTcpProxies.Insert", + "fullName": "google.cloud.compute.v1.RegionUrlMaps.Delete", "service": { - "fullName": "google.cloud.compute.v1.RegionTargetTcpProxies", - "shortName": "RegionTargetTcpProxies" + "fullName": "google.cloud.compute.v1.RegionUrlMaps", + "shortName": "RegionUrlMaps" }, - "shortName": "Insert" + "shortName": "Delete" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.InsertRegionTargetTcpProxyRequest" + "type": "google.cloud.compute_v1.types.DeleteRegionUrlMapRequest" }, { "name": "project", @@ -50513,8 +52477,8 @@ "type": "str" }, { - "name": "target_tcp_proxy_resource", - "type": "google.cloud.compute_v1.types.TargetTcpProxy" + "name": "url_map", + "type": "str" }, { "name": "retry", @@ -50530,21 +52494,21 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "insert" + "shortName": "delete" }, - "description": "Sample for Insert", - "file": "compute_v1_generated_region_target_tcp_proxies_insert_sync.py", + "description": "Sample for Delete", + "file": "compute_v1_generated_region_url_maps_delete_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionTargetTcpProxies_Insert_sync", + "regionTag": "compute_v1_generated_RegionUrlMaps_Delete_sync", "segments": [ { - "end": 52, + "end": 53, "start": 27, "type": "FULL" }, { - "end": 52, + "end": 53, "start": 27, "type": "SHORT" }, @@ -50554,43 +52518,43 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 46, + "end": 47, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 49, - "start": 47, + "end": 50, + "start": 48, "type": "REQUEST_EXECUTION" }, { - "end": 53, - "start": 50, + "end": 54, + "start": 51, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_target_tcp_proxies_insert_sync.py" + "title": "compute_v1_generated_region_url_maps_delete_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionTargetTcpProxiesClient", - "shortName": "RegionTargetTcpProxiesClient" + "fullName": "google.cloud.compute_v1.RegionUrlMapsClient", + "shortName": "RegionUrlMapsClient" }, - "fullName": "google.cloud.compute_v1.RegionTargetTcpProxiesClient.list", + "fullName": "google.cloud.compute_v1.RegionUrlMapsClient.get", "method": { - "fullName": "google.cloud.compute.v1.RegionTargetTcpProxies.List", + "fullName": "google.cloud.compute.v1.RegionUrlMaps.Get", "service": { - "fullName": "google.cloud.compute.v1.RegionTargetTcpProxies", - "shortName": "RegionTargetTcpProxies" + "fullName": "google.cloud.compute.v1.RegionUrlMaps", + "shortName": "RegionUrlMaps" }, - "shortName": "List" + "shortName": "Get" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.ListRegionTargetTcpProxiesRequest" + "type": "google.cloud.compute_v1.types.GetRegionUrlMapRequest" }, { "name": "project", @@ -50600,6 +52564,10 @@ "name": "region", "type": "str" }, + { + "name": "url_map", + "type": "str" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -50613,14 +52581,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.services.region_target_tcp_proxies.pagers.ListPager", - "shortName": "list" + "resultType": "google.cloud.compute_v1.types.UrlMap", + "shortName": "get" }, - "description": "Sample for List", - "file": "compute_v1_generated_region_target_tcp_proxies_list_sync.py", + "description": "Sample for Get", + "file": "compute_v1_generated_region_url_maps_get_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionTargetTcpProxies_List_sync", + "regionTag": "compute_v1_generated_RegionUrlMaps_Get_sync", "segments": [ { "end": 53, @@ -50638,22 +52606,22 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 46, + "end": 47, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 49, - "start": 47, + "end": 50, + "start": 48, "type": "REQUEST_EXECUTION" }, { "end": 54, - "start": 50, + "start": 51, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_target_tcp_proxies_list_sync.py" + "title": "compute_v1_generated_region_url_maps_get_sync.py" }, { "canonical": true, @@ -50662,19 +52630,19 @@ "fullName": "google.cloud.compute_v1.RegionUrlMapsClient", "shortName": "RegionUrlMapsClient" }, - "fullName": "google.cloud.compute_v1.RegionUrlMapsClient.delete", + "fullName": "google.cloud.compute_v1.RegionUrlMapsClient.insert", "method": { - "fullName": "google.cloud.compute.v1.RegionUrlMaps.Delete", + "fullName": "google.cloud.compute.v1.RegionUrlMaps.Insert", "service": { "fullName": "google.cloud.compute.v1.RegionUrlMaps", "shortName": "RegionUrlMaps" }, - "shortName": "Delete" + "shortName": "Insert" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.DeleteRegionUrlMapRequest" + "type": "google.cloud.compute_v1.types.InsertRegionUrlMapRequest" }, { "name": "project", @@ -50685,8 +52653,8 @@ "type": "str" }, { - "name": "url_map", - "type": "str" + "name": "url_map_resource", + "type": "google.cloud.compute_v1.types.UrlMap" }, { "name": "retry", @@ -50702,21 +52670,21 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "delete" + "shortName": "insert" }, - "description": "Sample for Delete", - "file": "compute_v1_generated_region_url_maps_delete_sync.py", + "description": "Sample for Insert", + "file": "compute_v1_generated_region_url_maps_insert_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionUrlMaps_Delete_sync", + "regionTag": "compute_v1_generated_RegionUrlMaps_Insert_sync", "segments": [ { - "end": 53, + "end": 52, "start": 27, "type": "FULL" }, { - "end": 53, + "end": 52, "start": 27, "type": "SHORT" }, @@ -50726,22 +52694,22 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 47, + "end": 46, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 50, - "start": 48, + "end": 49, + "start": 47, "type": "REQUEST_EXECUTION" }, { - "end": 54, - "start": 51, + "end": 53, + "start": 50, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_url_maps_delete_sync.py" + "title": "compute_v1_generated_region_url_maps_insert_sync.py" }, { "canonical": true, @@ -50750,19 +52718,19 @@ "fullName": "google.cloud.compute_v1.RegionUrlMapsClient", "shortName": "RegionUrlMapsClient" }, - "fullName": "google.cloud.compute_v1.RegionUrlMapsClient.get", + "fullName": "google.cloud.compute_v1.RegionUrlMapsClient.list", "method": { - "fullName": "google.cloud.compute.v1.RegionUrlMaps.Get", + "fullName": "google.cloud.compute.v1.RegionUrlMaps.List", "service": { "fullName": "google.cloud.compute.v1.RegionUrlMaps", "shortName": "RegionUrlMaps" }, - "shortName": "Get" + "shortName": "List" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetRegionUrlMapRequest" + "type": "google.cloud.compute_v1.types.ListRegionUrlMapsRequest" }, { "name": "project", @@ -50772,10 +52740,6 @@ "name": "region", "type": "str" }, - { - "name": "url_map", - "type": "str" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -50789,14 +52753,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.UrlMap", - "shortName": "get" + "resultType": "google.cloud.compute_v1.services.region_url_maps.pagers.ListPager", + "shortName": "list" }, - "description": "Sample for Get", - "file": "compute_v1_generated_region_url_maps_get_sync.py", + "description": "Sample for List", + "file": "compute_v1_generated_region_url_maps_list_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionUrlMaps_Get_sync", + "regionTag": "compute_v1_generated_RegionUrlMaps_List_sync", "segments": [ { "end": 53, @@ -50814,22 +52778,22 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 47, + "end": 46, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 50, - "start": 48, + "end": 49, + "start": 47, "type": "REQUEST_EXECUTION" }, { "end": 54, - "start": 51, + "start": 50, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_url_maps_get_sync.py" + "title": "compute_v1_generated_region_url_maps_list_sync.py" }, { "canonical": true, @@ -50838,19 +52802,19 @@ "fullName": "google.cloud.compute_v1.RegionUrlMapsClient", "shortName": "RegionUrlMapsClient" }, - "fullName": "google.cloud.compute_v1.RegionUrlMapsClient.insert", + "fullName": "google.cloud.compute_v1.RegionUrlMapsClient.patch", "method": { - "fullName": "google.cloud.compute.v1.RegionUrlMaps.Insert", + "fullName": "google.cloud.compute.v1.RegionUrlMaps.Patch", "service": { "fullName": "google.cloud.compute.v1.RegionUrlMaps", "shortName": "RegionUrlMaps" }, - "shortName": "Insert" + "shortName": "Patch" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.InsertRegionUrlMapRequest" + "type": "google.cloud.compute_v1.types.PatchRegionUrlMapRequest" }, { "name": "project", @@ -50860,6 +52824,10 @@ "name": "region", "type": "str" }, + { + "name": "url_map", + "type": "str" + }, { "name": "url_map_resource", "type": "google.cloud.compute_v1.types.UrlMap" @@ -50878,21 +52846,21 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "insert" + "shortName": "patch" }, - "description": "Sample for Insert", - "file": "compute_v1_generated_region_url_maps_insert_sync.py", + "description": "Sample for Patch", + "file": "compute_v1_generated_region_url_maps_patch_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionUrlMaps_Insert_sync", + "regionTag": "compute_v1_generated_RegionUrlMaps_Patch_sync", "segments": [ { - "end": 52, + "end": 53, "start": 27, "type": "FULL" }, { - "end": 52, + "end": 53, "start": 27, "type": "SHORT" }, @@ -50902,22 +52870,22 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 46, + "end": 47, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 49, - "start": 47, + "end": 50, + "start": 48, "type": "REQUEST_EXECUTION" }, { - "end": 53, - "start": 50, + "end": 54, + "start": 51, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_url_maps_insert_sync.py" + "title": "compute_v1_generated_region_url_maps_patch_sync.py" }, { "canonical": true, @@ -50926,19 +52894,19 @@ "fullName": "google.cloud.compute_v1.RegionUrlMapsClient", "shortName": "RegionUrlMapsClient" }, - "fullName": "google.cloud.compute_v1.RegionUrlMapsClient.list", + "fullName": "google.cloud.compute_v1.RegionUrlMapsClient.update", "method": { - "fullName": "google.cloud.compute.v1.RegionUrlMaps.List", + "fullName": "google.cloud.compute.v1.RegionUrlMaps.Update", "service": { "fullName": "google.cloud.compute.v1.RegionUrlMaps", "shortName": "RegionUrlMaps" }, - "shortName": "List" + "shortName": "Update" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.ListRegionUrlMapsRequest" + "type": "google.cloud.compute_v1.types.UpdateRegionUrlMapRequest" }, { "name": "project", @@ -50948,6 +52916,14 @@ "name": "region", "type": "str" }, + { + "name": "url_map", + "type": "str" + }, + { + "name": "url_map_resource", + "type": "google.cloud.compute_v1.types.UrlMap" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -50961,14 +52937,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.services.region_url_maps.pagers.ListPager", - "shortName": "list" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "update" }, - "description": "Sample for List", - "file": "compute_v1_generated_region_url_maps_list_sync.py", + "description": "Sample for Update", + "file": "compute_v1_generated_region_url_maps_update_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionUrlMaps_List_sync", + "regionTag": "compute_v1_generated_RegionUrlMaps_Update_sync", "segments": [ { "end": 53, @@ -50986,22 +52962,22 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 46, + "end": 47, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 49, - "start": 47, + "end": 50, + "start": 48, "type": "REQUEST_EXECUTION" }, { "end": 54, - "start": 50, + "start": 51, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_url_maps_list_sync.py" + "title": "compute_v1_generated_region_url_maps_update_sync.py" }, { "canonical": true, @@ -51010,19 +52986,19 @@ "fullName": "google.cloud.compute_v1.RegionUrlMapsClient", "shortName": "RegionUrlMapsClient" }, - "fullName": "google.cloud.compute_v1.RegionUrlMapsClient.patch", + "fullName": "google.cloud.compute_v1.RegionUrlMapsClient.validate", "method": { - "fullName": "google.cloud.compute.v1.RegionUrlMaps.Patch", + "fullName": "google.cloud.compute.v1.RegionUrlMaps.Validate", "service": { "fullName": "google.cloud.compute.v1.RegionUrlMaps", "shortName": "RegionUrlMaps" }, - "shortName": "Patch" + "shortName": "Validate" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.PatchRegionUrlMapRequest" + "type": "google.cloud.compute_v1.types.ValidateRegionUrlMapRequest" }, { "name": "project", @@ -51037,8 +53013,8 @@ "type": "str" }, { - "name": "url_map_resource", - "type": "google.cloud.compute_v1.types.UrlMap" + "name": "region_url_maps_validate_request_resource", + "type": "google.cloud.compute_v1.types.RegionUrlMapsValidateRequest" }, { "name": "retry", @@ -51053,14 +53029,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "patch" + "resultType": "google.cloud.compute_v1.types.UrlMapsValidateResponse", + "shortName": "validate" }, - "description": "Sample for Patch", - "file": "compute_v1_generated_region_url_maps_patch_sync.py", + "description": "Sample for Validate", + "file": "compute_v1_generated_region_url_maps_validate_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionUrlMaps_Patch_sync", + "regionTag": "compute_v1_generated_RegionUrlMaps_Validate_sync", "segments": [ { "end": 53, @@ -51093,28 +53069,28 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_url_maps_patch_sync.py" + "title": "compute_v1_generated_region_url_maps_validate_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionUrlMapsClient", - "shortName": "RegionUrlMapsClient" + "fullName": "google.cloud.compute_v1.RegionZonesClient", + "shortName": "RegionZonesClient" }, - "fullName": "google.cloud.compute_v1.RegionUrlMapsClient.update", + "fullName": "google.cloud.compute_v1.RegionZonesClient.list", "method": { - "fullName": "google.cloud.compute.v1.RegionUrlMaps.Update", + "fullName": "google.cloud.compute.v1.RegionZones.List", "service": { - "fullName": "google.cloud.compute.v1.RegionUrlMaps", - "shortName": "RegionUrlMaps" + "fullName": "google.cloud.compute.v1.RegionZones", + "shortName": "RegionZones" }, - "shortName": "Update" + "shortName": "List" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.UpdateRegionUrlMapRequest" + "type": "google.cloud.compute_v1.types.ListRegionZonesRequest" }, { "name": "project", @@ -51124,14 +53100,6 @@ "name": "region", "type": "str" }, - { - "name": "url_map", - "type": "str" - }, - { - "name": "url_map_resource", - "type": "google.cloud.compute_v1.types.UrlMap" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -51145,14 +53113,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "update" + "resultType": "google.cloud.compute_v1.services.region_zones.pagers.ListPager", + "shortName": "list" }, - "description": "Sample for Update", - "file": "compute_v1_generated_region_url_maps_update_sync.py", + "description": "Sample for List", + "file": "compute_v1_generated_region_zones_list_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionUrlMaps_Update_sync", + "regionTag": "compute_v1_generated_RegionZones_List_sync", "segments": [ { "end": 53, @@ -51170,43 +53138,43 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 47, + "end": 46, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 50, - "start": 48, + "end": 49, + "start": 47, "type": "REQUEST_EXECUTION" }, { "end": 54, - "start": 51, + "start": 50, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_url_maps_update_sync.py" + "title": "compute_v1_generated_region_zones_list_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionUrlMapsClient", - "shortName": "RegionUrlMapsClient" + "fullName": "google.cloud.compute_v1.RegionsClient", + "shortName": "RegionsClient" }, - "fullName": "google.cloud.compute_v1.RegionUrlMapsClient.validate", + "fullName": "google.cloud.compute_v1.RegionsClient.get", "method": { - "fullName": "google.cloud.compute.v1.RegionUrlMaps.Validate", + "fullName": "google.cloud.compute.v1.Regions.Get", "service": { - "fullName": "google.cloud.compute.v1.RegionUrlMaps", - "shortName": "RegionUrlMaps" + "fullName": "google.cloud.compute.v1.Regions", + "shortName": "Regions" }, - "shortName": "Validate" + "shortName": "Get" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.ValidateRegionUrlMapRequest" + "type": "google.cloud.compute_v1.types.GetRegionRequest" }, { "name": "project", @@ -51216,14 +53184,6 @@ "name": "region", "type": "str" }, - { - "name": "url_map", - "type": "str" - }, - { - "name": "region_url_maps_validate_request_resource", - "type": "google.cloud.compute_v1.types.RegionUrlMapsValidateRequest" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -51237,22 +53197,22 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.UrlMapsValidateResponse", - "shortName": "validate" + "resultType": "google.cloud.compute_v1.types.Region", + "shortName": "get" }, - "description": "Sample for Validate", - "file": "compute_v1_generated_region_url_maps_validate_sync.py", + "description": "Sample for Get", + "file": "compute_v1_generated_regions_get_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionUrlMaps_Validate_sync", + "regionTag": "compute_v1_generated_Regions_Get_sync", "segments": [ { - "end": 53, + "end": 52, "start": 27, "type": "FULL" }, { - "end": 53, + "end": 52, "start": 27, "type": "SHORT" }, @@ -51262,52 +53222,48 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 47, + "end": 46, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 50, - "start": 48, + "end": 49, + "start": 47, "type": "REQUEST_EXECUTION" }, { - "end": 54, - "start": 51, + "end": 53, + "start": 50, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_url_maps_validate_sync.py" + "title": "compute_v1_generated_regions_get_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionZonesClient", - "shortName": "RegionZonesClient" + "fullName": "google.cloud.compute_v1.RegionsClient", + "shortName": "RegionsClient" }, - "fullName": "google.cloud.compute_v1.RegionZonesClient.list", + "fullName": "google.cloud.compute_v1.RegionsClient.list", "method": { - "fullName": "google.cloud.compute.v1.RegionZones.List", + "fullName": "google.cloud.compute.v1.Regions.List", "service": { - "fullName": "google.cloud.compute.v1.RegionZones", - "shortName": "RegionZones" + "fullName": "google.cloud.compute.v1.Regions", + "shortName": "Regions" }, "shortName": "List" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.ListRegionZonesRequest" + "type": "google.cloud.compute_v1.types.ListRegionsRequest" }, { "name": "project", "type": "str" }, - { - "name": "region", - "type": "str" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -51321,22 +53277,22 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.services.region_zones.pagers.ListPager", + "resultType": "google.cloud.compute_v1.services.regions.pagers.ListPager", "shortName": "list" }, "description": "Sample for List", - "file": "compute_v1_generated_region_zones_list_sync.py", + "file": "compute_v1_generated_regions_list_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionZones_List_sync", + "regionTag": "compute_v1_generated_Regions_List_sync", "segments": [ { - "end": 53, + "end": 52, "start": 27, "type": "FULL" }, { - "end": 53, + "end": 52, "start": 27, "type": "SHORT" }, @@ -51346,50 +53302,58 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 46, + "end": 45, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 49, - "start": 47, + "end": 48, + "start": 46, "type": "REQUEST_EXECUTION" }, { - "end": 54, - "start": 50, + "end": 53, + "start": 49, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_zones_list_sync.py" + "title": "compute_v1_generated_regions_list_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionsClient", - "shortName": "RegionsClient" + "fullName": "google.cloud.compute_v1.ReservationBlocksClient", + "shortName": "ReservationBlocksClient" }, - "fullName": "google.cloud.compute_v1.RegionsClient.get", + "fullName": "google.cloud.compute_v1.ReservationBlocksClient.get", "method": { - "fullName": "google.cloud.compute.v1.Regions.Get", + "fullName": "google.cloud.compute.v1.ReservationBlocks.Get", "service": { - "fullName": "google.cloud.compute.v1.Regions", - "shortName": "Regions" + "fullName": "google.cloud.compute.v1.ReservationBlocks", + "shortName": "ReservationBlocks" }, "shortName": "Get" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetRegionRequest" + "type": "google.cloud.compute_v1.types.GetReservationBlockRequest" }, { "name": "project", "type": "str" }, { - "name": "region", + "name": "zone", + "type": "str" + }, + { + "name": "reservation", + "type": "str" + }, + { + "name": "reservation_block", "type": "str" }, { @@ -51405,22 +53369,22 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.Region", + "resultType": "google.cloud.compute_v1.types.ReservationBlocksGetResponse", "shortName": "get" }, "description": "Sample for Get", - "file": "compute_v1_generated_regions_get_sync.py", + "file": "compute_v1_generated_reservation_blocks_get_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_Regions_Get_sync", + "regionTag": "compute_v1_generated_ReservationBlocks_Get_sync", "segments": [ { - "end": 52, + "end": 54, "start": 27, "type": "FULL" }, { - "end": 52, + "end": 54, "start": 27, "type": "SHORT" }, @@ -51430,48 +53394,56 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 46, + "end": 48, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 49, - "start": 47, + "end": 51, + "start": 49, "type": "REQUEST_EXECUTION" }, { - "end": 53, - "start": 50, + "end": 55, + "start": 52, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_regions_get_sync.py" + "title": "compute_v1_generated_reservation_blocks_get_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionsClient", - "shortName": "RegionsClient" + "fullName": "google.cloud.compute_v1.ReservationBlocksClient", + "shortName": "ReservationBlocksClient" }, - "fullName": "google.cloud.compute_v1.RegionsClient.list", + "fullName": "google.cloud.compute_v1.ReservationBlocksClient.list", "method": { - "fullName": "google.cloud.compute.v1.Regions.List", + "fullName": "google.cloud.compute.v1.ReservationBlocks.List", "service": { - "fullName": "google.cloud.compute.v1.Regions", - "shortName": "Regions" + "fullName": "google.cloud.compute.v1.ReservationBlocks", + "shortName": "ReservationBlocks" }, "shortName": "List" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.ListRegionsRequest" + "type": "google.cloud.compute_v1.types.ListReservationBlocksRequest" }, { "name": "project", "type": "str" }, + { + "name": "zone", + "type": "str" + }, + { + "name": "reservation", + "type": "str" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -51485,22 +53457,22 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.services.regions.pagers.ListPager", + "resultType": "google.cloud.compute_v1.services.reservation_blocks.pagers.ListPager", "shortName": "list" }, "description": "Sample for List", - "file": "compute_v1_generated_regions_list_sync.py", + "file": "compute_v1_generated_reservation_blocks_list_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_Regions_List_sync", + "regionTag": "compute_v1_generated_ReservationBlocks_List_sync", "segments": [ { - "end": 52, + "end": 54, "start": 27, "type": "FULL" }, { - "end": 52, + "end": 54, "start": 27, "type": "SHORT" }, @@ -51510,22 +53482,22 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 45, + "end": 47, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 48, - "start": 46, + "end": 50, + "start": 48, "type": "REQUEST_EXECUTION" }, { - "end": 53, - "start": 49, + "end": 55, + "start": 51, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_regions_list_sync.py" + "title": "compute_v1_generated_reservation_blocks_list_sync.py" }, { "canonical": true, @@ -51534,19 +53506,19 @@ "fullName": "google.cloud.compute_v1.ReservationBlocksClient", "shortName": "ReservationBlocksClient" }, - "fullName": "google.cloud.compute_v1.ReservationBlocksClient.get", + "fullName": "google.cloud.compute_v1.ReservationBlocksClient.perform_maintenance", "method": { - "fullName": "google.cloud.compute.v1.ReservationBlocks.Get", + "fullName": "google.cloud.compute.v1.ReservationBlocks.PerformMaintenance", "service": { "fullName": "google.cloud.compute.v1.ReservationBlocks", "shortName": "ReservationBlocks" }, - "shortName": "Get" + "shortName": "PerformMaintenance" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetReservationBlockRequest" + "type": "google.cloud.compute_v1.types.PerformMaintenanceReservationBlockRequest" }, { "name": "project", @@ -51564,6 +53536,10 @@ "name": "reservation_block", "type": "str" }, + { + "name": "reservations_blocks_perform_maintenance_request_resource", + "type": "google.cloud.compute_v1.types.ReservationsBlocksPerformMaintenanceRequest" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -51577,14 +53553,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.types.ReservationBlocksGetResponse", - "shortName": "get" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "perform_maintenance" }, - "description": "Sample for Get", - "file": "compute_v1_generated_reservation_blocks_get_sync.py", + "description": "Sample for PerformMaintenance", + "file": "compute_v1_generated_reservation_blocks_perform_maintenance_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_ReservationBlocks_Get_sync", + "regionTag": "compute_v1_generated_ReservationBlocks_PerformMaintenance_sync", "segments": [ { "end": 54, @@ -51617,28 +53593,28 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_reservation_blocks_get_sync.py" + "title": "compute_v1_generated_reservation_blocks_perform_maintenance_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.ReservationBlocksClient", - "shortName": "ReservationBlocksClient" + "fullName": "google.cloud.compute_v1.ReservationSubBlocksClient", + "shortName": "ReservationSubBlocksClient" }, - "fullName": "google.cloud.compute_v1.ReservationBlocksClient.list", + "fullName": "google.cloud.compute_v1.ReservationSubBlocksClient.get", "method": { - "fullName": "google.cloud.compute.v1.ReservationBlocks.List", + "fullName": "google.cloud.compute.v1.ReservationSubBlocks.Get", "service": { - "fullName": "google.cloud.compute.v1.ReservationBlocks", - "shortName": "ReservationBlocks" + "fullName": "google.cloud.compute.v1.ReservationSubBlocks", + "shortName": "ReservationSubBlocks" }, - "shortName": "List" + "shortName": "Get" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.ListReservationBlocksRequest" + "type": "google.cloud.compute_v1.types.GetReservationSubBlockRequest" }, { "name": "project", @@ -51649,7 +53625,11 @@ "type": "str" }, { - "name": "reservation", + "name": "parent_name", + "type": "str" + }, + { + "name": "reservation_sub_block", "type": "str" }, { @@ -51665,14 +53645,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.compute_v1.services.reservation_blocks.pagers.ListPager", - "shortName": "list" + "resultType": "google.cloud.compute_v1.types.ReservationSubBlocksGetResponse", + "shortName": "get" }, - "description": "Sample for List", - "file": "compute_v1_generated_reservation_blocks_list_sync.py", + "description": "Sample for Get", + "file": "compute_v1_generated_reservation_sub_blocks_get_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_ReservationBlocks_List_sync", + "regionTag": "compute_v1_generated_ReservationSubBlocks_Get_sync", "segments": [ { "end": 54, @@ -51690,43 +53670,43 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 47, + "end": 48, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 50, - "start": 48, + "end": 51, + "start": 49, "type": "REQUEST_EXECUTION" }, { "end": 55, - "start": 51, + "start": 52, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_reservation_blocks_list_sync.py" + "title": "compute_v1_generated_reservation_sub_blocks_get_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.ReservationBlocksClient", - "shortName": "ReservationBlocksClient" + "fullName": "google.cloud.compute_v1.ReservationSubBlocksClient", + "shortName": "ReservationSubBlocksClient" }, - "fullName": "google.cloud.compute_v1.ReservationBlocksClient.perform_maintenance", + "fullName": "google.cloud.compute_v1.ReservationSubBlocksClient.list", "method": { - "fullName": "google.cloud.compute.v1.ReservationBlocks.PerformMaintenance", + "fullName": "google.cloud.compute.v1.ReservationSubBlocks.List", "service": { - "fullName": "google.cloud.compute.v1.ReservationBlocks", - "shortName": "ReservationBlocks" + "fullName": "google.cloud.compute.v1.ReservationSubBlocks", + "shortName": "ReservationSubBlocks" }, - "shortName": "PerformMaintenance" + "shortName": "List" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.PerformMaintenanceReservationBlockRequest" + "type": "google.cloud.compute_v1.types.ListReservationSubBlocksRequest" }, { "name": "project", @@ -51737,17 +53717,9 @@ "type": "str" }, { - "name": "reservation", - "type": "str" - }, - { - "name": "reservation_block", + "name": "parent_name", "type": "str" }, - { - "name": "reservations_blocks_perform_maintenance_request_resource", - "type": "google.cloud.compute_v1.types.ReservationsBlocksPerformMaintenanceRequest" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -51761,14 +53733,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "perform_maintenance" + "resultType": "google.cloud.compute_v1.services.reservation_sub_blocks.pagers.ListPager", + "shortName": "list" }, - "description": "Sample for PerformMaintenance", - "file": "compute_v1_generated_reservation_blocks_perform_maintenance_sync.py", + "description": "Sample for List", + "file": "compute_v1_generated_reservation_sub_blocks_list_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_ReservationBlocks_PerformMaintenance_sync", + "regionTag": "compute_v1_generated_ReservationSubBlocks_List_sync", "segments": [ { "end": 54, @@ -51786,22 +53758,22 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 48, + "end": 47, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 51, - "start": 49, + "end": 50, + "start": 48, "type": "REQUEST_EXECUTION" }, { "end": 55, - "start": 52, + "start": 51, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_reservation_blocks_perform_maintenance_sync.py" + "title": "compute_v1_generated_reservation_sub_blocks_list_sync.py" }, { "canonical": true, diff --git a/packages/google-cloud-compute/scripts/fixup_compute_v1_keywords.py b/packages/google-cloud-compute/scripts/fixup_compute_v1_keywords.py index 68d2e959cac0..b86afb68d3ee 100644 --- a/packages/google-cloud-compute/scripts/fixup_compute_v1_keywords.py +++ b/packages/google-cloud-compute/scripts/fixup_compute_v1_keywords.py @@ -57,9 +57,11 @@ class computeCallTransformer(cst.CSTTransformer): 'attach_disk': ('attached_disk_resource', 'instance', 'project', 'zone', 'force_attach', 'request_id', ), 'attach_network_endpoints': ('global_network_endpoint_groups_attach_endpoints_request_resource', 'network_endpoint_group', 'project', 'request_id', ), 'bulk_insert': ('bulk_insert_disk_resource_resource', 'project', 'zone', 'request_id', ), + 'bulk_set_labels': ('bulk_zone_set_labels_request_resource', 'project', 'zone', 'request_id', 'resource', ), 'cancel': ('instance_group_manager', 'project', 'resize_request', 'zone', 'request_id', ), 'clone_rules': ('firewall_policy', 'request_id', 'source_firewall_policy', ), 'create_instances': ('instance_group_manager', 'instance_group_managers_create_instances_request_resource', 'project', 'zone', 'request_id', ), + 'create_members': ('interconnect_group', 'interconnect_groups_create_members_request_resource', 'project', ), 'create_snapshot': ('disk', 'project', 'snapshot_resource', 'zone', 'guest_flush', 'request_id', ), 'delete': ('address', 'project', 'region', 'request_id', ), 'delete_access_config': ('access_config', 'instance', 'network_interface', 'project', 'zone', 'request_id', ), @@ -87,6 +89,7 @@ class computeCallTransformer(cst.CSTTransformer): 'get_macsec_config': ('interconnect', 'project', ), 'get_nat_ip_info': ('project', 'region', 'router', 'nat_name', ), 'get_nat_mapping_info': ('project', 'region', 'router', 'filter', 'max_results', 'nat_name', 'order_by', 'page_token', 'return_partial_success', ), + 'get_operational_status': ('interconnect_attachment_group', 'project', ), 'get_packet_mirroring_rule': ('firewall_policy', 'project', 'priority', ), 'get_route_policy': ('project', 'region', 'router', 'policy', ), 'get_router_status': ('project', 'region', 'router', ), diff --git a/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_backend_buckets.py b/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_backend_buckets.py index 425159c46581..b218715b424a 100644 --- a/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_backend_buckets.py +++ b/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_backend_buckets.py @@ -5614,6 +5614,7 @@ def test_get_rest_call_success(request_type): enable_cdn=True, id=205, kind="kind_value", + load_balancing_scheme="load_balancing_scheme_value", name="name_value", self_link="self_link_value", ) @@ -5641,6 +5642,7 @@ def test_get_rest_call_success(request_type): assert response.enable_cdn is True assert response.id == 205 assert response.kind == "kind_value" + assert response.load_balancing_scheme == "load_balancing_scheme_value" assert response.name == "name_value" assert response.self_link == "self_link_value" @@ -5914,6 +5916,7 @@ def test_insert_rest_call_success(request_type): "enable_cdn": True, "id": 205, "kind": "kind_value", + "load_balancing_scheme": "load_balancing_scheme_value", "name": "name_value", "self_link": "self_link_value", "used_by": [{"reference": "reference_value"}], @@ -6326,6 +6329,7 @@ def test_patch_rest_call_success(request_type): "enable_cdn": True, "id": 205, "kind": "kind_value", + "load_balancing_scheme": "load_balancing_scheme_value", "name": "name_value", "self_link": "self_link_value", "used_by": [{"reference": "reference_value"}], @@ -7310,6 +7314,7 @@ def test_update_rest_call_success(request_type): "enable_cdn": True, "id": 205, "kind": "kind_value", + "load_balancing_scheme": "load_balancing_scheme_value", "name": "name_value", "self_link": "self_link_value", "used_by": [{"reference": "reference_value"}], diff --git a/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_backend_services.py b/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_backend_services.py index 6b9bcad7f2d9..74a5f9e819ff 100644 --- a/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_backend_services.py +++ b/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_backend_services.py @@ -7539,7 +7539,13 @@ def test_insert_rest_call_success(request_type): "failover_ratio": 0.1494, }, "fingerprint": "fingerprint_value", - "ha_policy": {"fast_i_p_move": "fast_i_p_move_value"}, + "ha_policy": { + "fast_i_p_move": "fast_i_p_move_value", + "leader": { + "backend_group": "backend_group_value", + "network_endpoint": {"instance": "instance_value"}, + }, + }, "health_checks": ["health_checks_value1", "health_checks_value2"], "iap": { "enabled": True, @@ -8220,7 +8226,13 @@ def test_patch_rest_call_success(request_type): "failover_ratio": 0.1494, }, "fingerprint": "fingerprint_value", - "ha_policy": {"fast_i_p_move": "fast_i_p_move_value"}, + "ha_policy": { + "fast_i_p_move": "fast_i_p_move_value", + "leader": { + "backend_group": "backend_group_value", + "network_endpoint": {"instance": "instance_value"}, + }, + }, "health_checks": ["health_checks_value1", "health_checks_value2"], "iap": { "enabled": True, @@ -9586,7 +9598,13 @@ def test_update_rest_call_success(request_type): "failover_ratio": 0.1494, }, "fingerprint": "fingerprint_value", - "ha_policy": {"fast_i_p_move": "fast_i_p_move_value"}, + "ha_policy": { + "fast_i_p_move": "fast_i_p_move_value", + "leader": { + "backend_group": "backend_group_value", + "network_endpoint": {"instance": "instance_value"}, + }, + }, "health_checks": ["health_checks_value1", "health_checks_value2"], "iap": { "enabled": True, diff --git a/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_disks.py b/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_disks.py index e7afec8ca2da..9ff8c9cb776c 100644 --- a/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_disks.py +++ b/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_disks.py @@ -2021,6 +2021,454 @@ def test_bulk_insert_unary_rest_flattened_error(transport: str = "rest"): ) +def test_bulk_set_labels_rest_use_cached_wrapped_rpc(): + # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, + # instead of constructing them on each call + with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: + client = DisksClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Should wrap all calls on client creation + assert wrapper_fn.call_count > 0 + wrapper_fn.reset_mock() + + # Ensure method has been cached + assert client._transport.bulk_set_labels in client._transport._wrapped_methods + + # Replace cached wrapped function with mock + mock_rpc = mock.Mock() + mock_rpc.return_value.name = ( + "foo" # operation_request.operation in compute client(s) expect a string. + ) + client._transport._wrapped_methods[client._transport.bulk_set_labels] = mock_rpc + + request = {} + client.bulk_set_labels(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + # Operation methods build a cached wrapper on first rpc call + # subsequent calls should use the cached wrapper + wrapper_fn.reset_mock() + + client.bulk_set_labels(request) + + # Establish that a new wrapper was not created for this call + assert wrapper_fn.call_count == 0 + assert mock_rpc.call_count == 2 + + +def test_bulk_set_labels_rest_required_fields( + request_type=compute.BulkSetLabelsDiskRequest, +): + transport_class = transports.DisksRestTransport + + request_init = {} + request_init["project"] = "" + request_init["zone"] = "" + request = request_type(**request_init) + pb_request = request_type.pb(request) + jsonified_request = json.loads( + json_format.MessageToJson(pb_request, use_integers_for_enums=False) + ) + + # verify fields with default values are dropped + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).bulk_set_labels._get_unset_required_fields(jsonified_request) + jsonified_request.update(unset_fields) + + # verify required fields with default values are now present + + jsonified_request["project"] = "project_value" + jsonified_request["zone"] = "zone_value" + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).bulk_set_labels._get_unset_required_fields(jsonified_request) + # Check that path parameters and body parameters are not mixing in. + assert not set(unset_fields) - set( + ( + "request_id", + "resource", + ) + ) + jsonified_request.update(unset_fields) + + # verify required fields with non-default values are left alone + assert "project" in jsonified_request + assert jsonified_request["project"] == "project_value" + assert "zone" in jsonified_request + assert jsonified_request["zone"] == "zone_value" + + client = DisksClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + request = request_type(**request_init) + + # Designate an appropriate value for the returned response. + return_value = compute.Operation() + # Mock the http request call within the method and fake a response. + with mock.patch.object(Session, "request") as req: + # We need to mock transcode() because providing default values + # for required fields will fail the real version if the http_options + # expect actual values for those fields. + with mock.patch.object(path_template, "transcode") as transcode: + # A uri without fields and an empty body will force all the + # request fields to show up in the query_params. + pb_request = request_type.pb(request) + transcode_result = { + "uri": "v1/sample_method", + "method": "post", + "query_params": pb_request, + } + transcode_result["body"] = pb_request + transcode.return_value = transcode_result + + response_value = Response() + response_value.status_code = 200 + + # Convert return value to protobuf type + return_value = compute.Operation.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + response = client.bulk_set_labels(request) + + expected_params = [] + actual_params = req.call_args.kwargs["params"] + assert expected_params == actual_params + + +def test_bulk_set_labels_rest_unset_required_fields(): + transport = transports.DisksRestTransport( + credentials=ga_credentials.AnonymousCredentials + ) + + unset_fields = transport.bulk_set_labels._get_unset_required_fields({}) + assert set(unset_fields) == ( + set( + ( + "requestId", + "resource", + ) + ) + & set( + ( + "bulkZoneSetLabelsRequestResource", + "project", + "zone", + ) + ) + ) + + +def test_bulk_set_labels_rest_flattened(): + client = DisksClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = compute.Operation() + + # get arguments that satisfy an http rule for this method + sample_request = {"project": "sample1", "zone": "sample2"} + + # get truthy value for each flattened field + mock_args = dict( + project="project_value", + zone="zone_value", + bulk_zone_set_labels_request_resource=compute.BulkZoneSetLabelsRequest( + requests=[ + compute.BulkSetLabelsRequest( + label_fingerprint="label_fingerprint_value" + ) + ] + ), + ) + mock_args.update(sample_request) + + # Wrap the value into a proper Response obj + response_value = Response() + response_value.status_code = 200 + # Convert return value to protobuf type + return_value = compute.Operation.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + client.bulk_set_labels(**mock_args) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(req.mock_calls) == 1 + _, args, _ = req.mock_calls[0] + assert path_template.validate( + "%s/compute/v1/projects/{project}/zones/{zone}/disks/bulkSetLabels" + % client.transport._host, + args[1], + ) + + +def test_bulk_set_labels_rest_flattened_error(transport: str = "rest"): + client = DisksClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.bulk_set_labels( + compute.BulkSetLabelsDiskRequest(), + project="project_value", + zone="zone_value", + bulk_zone_set_labels_request_resource=compute.BulkZoneSetLabelsRequest( + requests=[ + compute.BulkSetLabelsRequest( + label_fingerprint="label_fingerprint_value" + ) + ] + ), + ) + + +def test_bulk_set_labels_unary_rest_use_cached_wrapped_rpc(): + # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, + # instead of constructing them on each call + with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: + client = DisksClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Should wrap all calls on client creation + assert wrapper_fn.call_count > 0 + wrapper_fn.reset_mock() + + # Ensure method has been cached + assert client._transport.bulk_set_labels in client._transport._wrapped_methods + + # Replace cached wrapped function with mock + mock_rpc = mock.Mock() + mock_rpc.return_value.name = ( + "foo" # operation_request.operation in compute client(s) expect a string. + ) + client._transport._wrapped_methods[client._transport.bulk_set_labels] = mock_rpc + + request = {} + client.bulk_set_labels_unary(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + # Operation methods build a cached wrapper on first rpc call + # subsequent calls should use the cached wrapper + wrapper_fn.reset_mock() + + client.bulk_set_labels_unary(request) + + # Establish that a new wrapper was not created for this call + assert wrapper_fn.call_count == 0 + assert mock_rpc.call_count == 2 + + +def test_bulk_set_labels_unary_rest_required_fields( + request_type=compute.BulkSetLabelsDiskRequest, +): + transport_class = transports.DisksRestTransport + + request_init = {} + request_init["project"] = "" + request_init["zone"] = "" + request = request_type(**request_init) + pb_request = request_type.pb(request) + jsonified_request = json.loads( + json_format.MessageToJson(pb_request, use_integers_for_enums=False) + ) + + # verify fields with default values are dropped + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).bulk_set_labels._get_unset_required_fields(jsonified_request) + jsonified_request.update(unset_fields) + + # verify required fields with default values are now present + + jsonified_request["project"] = "project_value" + jsonified_request["zone"] = "zone_value" + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).bulk_set_labels._get_unset_required_fields(jsonified_request) + # Check that path parameters and body parameters are not mixing in. + assert not set(unset_fields) - set( + ( + "request_id", + "resource", + ) + ) + jsonified_request.update(unset_fields) + + # verify required fields with non-default values are left alone + assert "project" in jsonified_request + assert jsonified_request["project"] == "project_value" + assert "zone" in jsonified_request + assert jsonified_request["zone"] == "zone_value" + + client = DisksClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + request = request_type(**request_init) + + # Designate an appropriate value for the returned response. + return_value = compute.Operation() + # Mock the http request call within the method and fake a response. + with mock.patch.object(Session, "request") as req: + # We need to mock transcode() because providing default values + # for required fields will fail the real version if the http_options + # expect actual values for those fields. + with mock.patch.object(path_template, "transcode") as transcode: + # A uri without fields and an empty body will force all the + # request fields to show up in the query_params. + pb_request = request_type.pb(request) + transcode_result = { + "uri": "v1/sample_method", + "method": "post", + "query_params": pb_request, + } + transcode_result["body"] = pb_request + transcode.return_value = transcode_result + + response_value = Response() + response_value.status_code = 200 + + # Convert return value to protobuf type + return_value = compute.Operation.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + response = client.bulk_set_labels_unary(request) + + expected_params = [] + actual_params = req.call_args.kwargs["params"] + assert expected_params == actual_params + + +def test_bulk_set_labels_unary_rest_unset_required_fields(): + transport = transports.DisksRestTransport( + credentials=ga_credentials.AnonymousCredentials + ) + + unset_fields = transport.bulk_set_labels._get_unset_required_fields({}) + assert set(unset_fields) == ( + set( + ( + "requestId", + "resource", + ) + ) + & set( + ( + "bulkZoneSetLabelsRequestResource", + "project", + "zone", + ) + ) + ) + + +def test_bulk_set_labels_unary_rest_flattened(): + client = DisksClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = compute.Operation() + + # get arguments that satisfy an http rule for this method + sample_request = {"project": "sample1", "zone": "sample2"} + + # get truthy value for each flattened field + mock_args = dict( + project="project_value", + zone="zone_value", + bulk_zone_set_labels_request_resource=compute.BulkZoneSetLabelsRequest( + requests=[ + compute.BulkSetLabelsRequest( + label_fingerprint="label_fingerprint_value" + ) + ] + ), + ) + mock_args.update(sample_request) + + # Wrap the value into a proper Response obj + response_value = Response() + response_value.status_code = 200 + # Convert return value to protobuf type + return_value = compute.Operation.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + client.bulk_set_labels_unary(**mock_args) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(req.mock_calls) == 1 + _, args, _ = req.mock_calls[0] + assert path_template.validate( + "%s/compute/v1/projects/{project}/zones/{zone}/disks/bulkSetLabels" + % client.transport._host, + args[1], + ) + + +def test_bulk_set_labels_unary_rest_flattened_error(transport: str = "rest"): + client = DisksClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.bulk_set_labels_unary( + compute.BulkSetLabelsDiskRequest(), + project="project_value", + zone="zone_value", + bulk_zone_set_labels_request_resource=compute.BulkZoneSetLabelsRequest( + requests=[ + compute.BulkSetLabelsRequest( + label_fingerprint="label_fingerprint_value" + ) + ] + ), + ) + + def test_create_snapshot_rest_use_cached_wrapped_rpc(): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call @@ -8090,6 +8538,253 @@ def test_bulk_insert_rest_interceptors(null_interceptor): post_with_metadata.assert_called_once() +def test_bulk_set_labels_rest_bad_request( + request_type=compute.BulkSetLabelsDiskRequest, +): + client = DisksClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + # send a request that will satisfy transcoding + request_init = {"project": "sample1", "zone": "sample2"} + request = request_type(**request_init) + + # Mock the http request call within the method and fake a BadRequest error. + with mock.patch.object(Session, "request") as req, pytest.raises( + core_exceptions.BadRequest + ): + # Wrap the value into a proper Response obj + response_value = mock.Mock() + json_return_value = "" + response_value.json = mock.Mock(return_value={}) + response_value.status_code = 400 + response_value.request = mock.Mock() + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + client.bulk_set_labels(request) + + +@pytest.mark.parametrize( + "request_type", + [ + compute.BulkSetLabelsDiskRequest, + dict, + ], +) +def test_bulk_set_labels_rest_call_success(request_type): + client = DisksClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + + # send a request that will satisfy transcoding + request_init = {"project": "sample1", "zone": "sample2"} + request_init["bulk_zone_set_labels_request_resource"] = { + "requests": [{"label_fingerprint": "label_fingerprint_value", "labels": {}}] + } + # The version of a generated dependency at test runtime may differ from the version used during generation. + # Delete any fields which are not present in the current runtime dependency + # See https://github.com/googleapis/gapic-generator-python/issues/1748 + + # Determine if the message type is proto-plus or protobuf + test_field = compute.BulkSetLabelsDiskRequest.meta.fields[ + "bulk_zone_set_labels_request_resource" + ] + + def get_message_fields(field): + # Given a field which is a message (composite type), return a list with + # all the fields of the message. + # If the field is not a composite type, return an empty list. + message_fields = [] + + if hasattr(field, "message") and field.message: + is_field_type_proto_plus_type = not hasattr(field.message, "DESCRIPTOR") + + if is_field_type_proto_plus_type: + message_fields = field.message.meta.fields.values() + # Add `# pragma: NO COVER` because there may not be any `*_pb2` field types + else: # pragma: NO COVER + message_fields = field.message.DESCRIPTOR.fields + return message_fields + + runtime_nested_fields = [ + (field.name, nested_field.name) + for field in get_message_fields(test_field) + for nested_field in get_message_fields(field) + ] + + subfields_not_in_runtime = [] + + # For each item in the sample request, create a list of sub fields which are not present at runtime + # Add `# pragma: NO COVER` because this test code will not run if all subfields are present at runtime + for field, value in request_init[ + "bulk_zone_set_labels_request_resource" + ].items(): # pragma: NO COVER + result = None + is_repeated = False + # For repeated fields + if isinstance(value, list) and len(value): + is_repeated = True + result = value[0] + # For fields where the type is another message + if isinstance(value, dict): + result = value + + if result and hasattr(result, "keys"): + for subfield in result.keys(): + if (field, subfield) not in runtime_nested_fields: + subfields_not_in_runtime.append( + { + "field": field, + "subfield": subfield, + "is_repeated": is_repeated, + } + ) + + # Remove fields from the sample request which are not present in the runtime version of the dependency + # Add `# pragma: NO COVER` because this test code will not run if all subfields are present at runtime + for subfield_to_delete in subfields_not_in_runtime: # pragma: NO COVER + field = subfield_to_delete.get("field") + field_repeated = subfield_to_delete.get("is_repeated") + subfield = subfield_to_delete.get("subfield") + if subfield: + if field_repeated: + for i in range( + 0, len(request_init["bulk_zone_set_labels_request_resource"][field]) + ): + del request_init["bulk_zone_set_labels_request_resource"][field][i][ + subfield + ] + else: + del request_init["bulk_zone_set_labels_request_resource"][field][ + subfield + ] + request = request_type(**request_init) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = compute.Operation( + client_operation_id="client_operation_id_value", + creation_timestamp="creation_timestamp_value", + description="description_value", + end_time="end_time_value", + http_error_message="http_error_message_value", + http_error_status_code=2374, + id=205, + insert_time="insert_time_value", + kind="kind_value", + name="name_value", + operation_group_id="operation_group_id_value", + operation_type="operation_type_value", + progress=885, + region="region_value", + self_link="self_link_value", + start_time="start_time_value", + status=compute.Operation.Status.DONE, + status_message="status_message_value", + target_id=947, + target_link="target_link_value", + user="user_value", + zone="zone_value", + ) + + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.status_code = 200 + + # Convert return value to protobuf type + return_value = compute.Operation.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + response_value.content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + response = client.bulk_set_labels(request) + + # Establish that the response is the type that we expect. + assert isinstance(response, extended_operation.ExtendedOperation) + assert response.client_operation_id == "client_operation_id_value" + assert response.creation_timestamp == "creation_timestamp_value" + assert response.description == "description_value" + assert response.end_time == "end_time_value" + assert response.http_error_message == "http_error_message_value" + assert response.http_error_status_code == 2374 + assert response.id == 205 + assert response.insert_time == "insert_time_value" + assert response.kind == "kind_value" + assert response.name == "name_value" + assert response.operation_group_id == "operation_group_id_value" + assert response.operation_type == "operation_type_value" + assert response.progress == 885 + assert response.region == "region_value" + assert response.self_link == "self_link_value" + assert response.start_time == "start_time_value" + assert response.status == compute.Operation.Status.DONE + assert response.status_message == "status_message_value" + assert response.target_id == 947 + assert response.target_link == "target_link_value" + assert response.user == "user_value" + assert response.zone == "zone_value" + + +@pytest.mark.parametrize("null_interceptor", [True, False]) +def test_bulk_set_labels_rest_interceptors(null_interceptor): + transport = transports.DisksRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + interceptor=None if null_interceptor else transports.DisksRestInterceptor(), + ) + client = DisksClient(transport=transport) + + with mock.patch.object( + type(client.transport._session), "request" + ) as req, mock.patch.object( + path_template, "transcode" + ) as transcode, mock.patch.object( + transports.DisksRestInterceptor, "post_bulk_set_labels" + ) as post, mock.patch.object( + transports.DisksRestInterceptor, "post_bulk_set_labels_with_metadata" + ) as post_with_metadata, mock.patch.object( + transports.DisksRestInterceptor, "pre_bulk_set_labels" + ) as pre: + pre.assert_not_called() + post.assert_not_called() + post_with_metadata.assert_not_called() + pb_message = compute.BulkSetLabelsDiskRequest.pb( + compute.BulkSetLabelsDiskRequest() + ) + transcode.return_value = { + "method": "post", + "uri": "my_uri", + "body": pb_message, + "query_params": pb_message, + } + + req.return_value = mock.Mock() + req.return_value.status_code = 200 + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + return_value = compute.Operation.to_json(compute.Operation()) + req.return_value.content = return_value + + request = compute.BulkSetLabelsDiskRequest() + metadata = [ + ("key", "val"), + ("cephalopod", "squid"), + ] + pre.return_value = request, metadata + post.return_value = compute.Operation() + post_with_metadata.return_value = compute.Operation(), metadata + + client.bulk_set_labels( + request, + metadata=[ + ("key", "val"), + ("cephalopod", "squid"), + ], + ) + + pre.assert_called_once() + post.assert_called_once() + post_with_metadata.assert_called_once() + + def test_create_snapshot_rest_bad_request( request_type=compute.CreateSnapshotDiskRequest, ): @@ -11505,6 +12200,26 @@ def test_bulk_insert_unary_empty_call_rest(): assert args[0] == request_msg +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_bulk_set_labels_unary_empty_call_rest(): + client = DisksClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object(type(client.transport.bulk_set_labels), "__call__") as call: + client.bulk_set_labels_unary(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = compute.BulkSetLabelsDiskRequest() + + assert args[0] == request_msg + + # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_create_snapshot_unary_empty_call_rest(): @@ -11840,6 +12555,7 @@ def test_disks_base_transport(): "add_resource_policies", "aggregated_list", "bulk_insert", + "bulk_set_labels", "create_snapshot", "delete", "get", @@ -12001,6 +12717,9 @@ def test_disks_client_transport_session_collision(transport_name): session1 = client1.transport.bulk_insert._session session2 = client2.transport.bulk_insert._session assert session1 != session2 + session1 = client1.transport.bulk_set_labels._session + session2 = client2.transport.bulk_set_labels._session + assert session1 != session2 session1 = client1.transport.create_snapshot._session session2 = client2.transport.create_snapshot._session assert session1 != session2 diff --git a/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_firewall_policies.py b/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_firewall_policies.py index aae657088bf5..a969a00a9b8f 100644 --- a/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_firewall_policies.py +++ b/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_firewall_policies.py @@ -6679,6 +6679,7 @@ def test_add_rule_rest_call_success(request_type): ], "dest_fqdns": ["dest_fqdns_value1", "dest_fqdns_value2"], "dest_ip_ranges": ["dest_ip_ranges_value1", "dest_ip_ranges_value2"], + "dest_network_type": "dest_network_type_value", "dest_region_codes": [ "dest_region_codes_value1", "dest_region_codes_value2", @@ -6699,6 +6700,8 @@ def test_add_rule_rest_call_success(request_type): ], "src_fqdns": ["src_fqdns_value1", "src_fqdns_value2"], "src_ip_ranges": ["src_ip_ranges_value1", "src_ip_ranges_value2"], + "src_network_type": "src_network_type_value", + "src_networks": ["src_networks_value1", "src_networks_value2"], "src_region_codes": ["src_region_codes_value1", "src_region_codes_value2"], "src_secure_tags": [{"name": "name_value", "state": "state_value"}], "src_threat_intelligences": [ @@ -7897,6 +7900,7 @@ def test_insert_rest_call_success(request_type): "dest_ip_ranges_value1", "dest_ip_ranges_value2", ], + "dest_network_type": "dest_network_type_value", "dest_region_codes": [ "dest_region_codes_value1", "dest_region_codes_value2", @@ -7917,6 +7921,8 @@ def test_insert_rest_call_success(request_type): ], "src_fqdns": ["src_fqdns_value1", "src_fqdns_value2"], "src_ip_ranges": ["src_ip_ranges_value1", "src_ip_ranges_value2"], + "src_network_type": "src_network_type_value", + "src_networks": ["src_networks_value1", "src_networks_value2"], "src_region_codes": [ "src_region_codes_value1", "src_region_codes_value2", @@ -8653,6 +8659,7 @@ def test_patch_rest_call_success(request_type): "dest_ip_ranges_value1", "dest_ip_ranges_value2", ], + "dest_network_type": "dest_network_type_value", "dest_region_codes": [ "dest_region_codes_value1", "dest_region_codes_value2", @@ -8673,6 +8680,8 @@ def test_patch_rest_call_success(request_type): ], "src_fqdns": ["src_fqdns_value1", "src_fqdns_value2"], "src_ip_ranges": ["src_ip_ranges_value1", "src_ip_ranges_value2"], + "src_network_type": "src_network_type_value", + "src_networks": ["src_networks_value1", "src_networks_value2"], "src_region_codes": [ "src_region_codes_value1", "src_region_codes_value2", @@ -8961,6 +8970,7 @@ def test_patch_rule_rest_call_success(request_type): ], "dest_fqdns": ["dest_fqdns_value1", "dest_fqdns_value2"], "dest_ip_ranges": ["dest_ip_ranges_value1", "dest_ip_ranges_value2"], + "dest_network_type": "dest_network_type_value", "dest_region_codes": [ "dest_region_codes_value1", "dest_region_codes_value2", @@ -8981,6 +8991,8 @@ def test_patch_rule_rest_call_success(request_type): ], "src_fqdns": ["src_fqdns_value1", "src_fqdns_value2"], "src_ip_ranges": ["src_ip_ranges_value1", "src_ip_ranges_value2"], + "src_network_type": "src_network_type_value", + "src_networks": ["src_networks_value1", "src_networks_value2"], "src_region_codes": ["src_region_codes_value1", "src_region_codes_value2"], "src_secure_tags": [{"name": "name_value", "state": "state_value"}], "src_threat_intelligences": [ diff --git a/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_firewalls.py b/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_firewalls.py index 0de6bf704ebb..1f6af26f2b8b 100644 --- a/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_firewalls.py +++ b/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_firewalls.py @@ -3432,6 +3432,7 @@ def test_insert_rest_call_success(request_type): "log_config": {"enable": True, "metadata": "metadata_value"}, "name": "name_value", "network": "network_value", + "params": {"resource_manager_tags": {}}, "priority": 898, "self_link": "self_link_value", "source_ranges": ["source_ranges_value1", "source_ranges_value2"], @@ -3829,6 +3830,7 @@ def test_patch_rest_call_success(request_type): "log_config": {"enable": True, "metadata": "metadata_value"}, "name": "name_value", "network": "network_value", + "params": {"resource_manager_tags": {}}, "priority": 898, "self_link": "self_link_value", "source_ranges": ["source_ranges_value1", "source_ranges_value2"], @@ -4099,6 +4101,7 @@ def test_update_rest_call_success(request_type): "log_config": {"enable": True, "metadata": "metadata_value"}, "name": "name_value", "network": "network_value", + "params": {"resource_manager_tags": {}}, "priority": 898, "self_link": "self_link_value", "source_ranges": ["source_ranges_value1", "source_ranges_value2"], diff --git a/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_forwarding_rules.py b/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_forwarding_rules.py index 832ba59bfee2..c472a5164c8b 100644 --- a/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_forwarding_rules.py +++ b/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_forwarding_rules.py @@ -4289,6 +4289,8 @@ def test_get_rest_call_success(request_type): base_forwarding_rule="base_forwarding_rule_value", creation_timestamp="creation_timestamp_value", description="description_value", + external_managed_backend_bucket_migration_state="external_managed_backend_bucket_migration_state_value", + external_managed_backend_bucket_migration_testing_percentage=0.6294000000000001, fingerprint="fingerprint_value", id=205, ip_collection="ip_collection_value", @@ -4307,6 +4309,7 @@ def test_get_rest_call_success(request_type): psc_connection_status="psc_connection_status_value", region="region_value", self_link="self_link_value", + self_link_with_id="self_link_with_id_value", service_label="service_label_value", service_name="service_name_value", source_ip_ranges=["source_ip_ranges_value"], @@ -4337,6 +4340,15 @@ def test_get_rest_call_success(request_type): assert response.base_forwarding_rule == "base_forwarding_rule_value" assert response.creation_timestamp == "creation_timestamp_value" assert response.description == "description_value" + assert ( + response.external_managed_backend_bucket_migration_state + == "external_managed_backend_bucket_migration_state_value" + ) + assert math.isclose( + response.external_managed_backend_bucket_migration_testing_percentage, + 0.6294000000000001, + rel_tol=1e-6, + ) assert response.fingerprint == "fingerprint_value" assert response.id == 205 assert response.ip_collection == "ip_collection_value" @@ -4355,6 +4367,7 @@ def test_get_rest_call_success(request_type): assert response.psc_connection_status == "psc_connection_status_value" assert response.region == "region_value" assert response.self_link == "self_link_value" + assert response.self_link_with_id == "self_link_with_id_value" assert response.service_label == "service_label_value" assert response.service_name == "service_name_value" assert response.source_ip_ranges == ["source_ip_ranges_value"] @@ -4471,6 +4484,8 @@ def test_insert_rest_call_success(request_type): "base_forwarding_rule": "base_forwarding_rule_value", "creation_timestamp": "creation_timestamp_value", "description": "description_value", + "external_managed_backend_bucket_migration_state": "external_managed_backend_bucket_migration_state_value", + "external_managed_backend_bucket_migration_testing_percentage": 0.6294000000000001, "fingerprint": "fingerprint_value", "id": 205, "ip_collection": "ip_collection_value", @@ -4496,6 +4511,7 @@ def test_insert_rest_call_success(request_type): "psc_connection_status": "psc_connection_status_value", "region": "region_value", "self_link": "self_link_value", + "self_link_with_id": "self_link_with_id_value", "service_directory_registrations": [ { "namespace": "namespace_value", @@ -4896,6 +4912,8 @@ def test_patch_rest_call_success(request_type): "base_forwarding_rule": "base_forwarding_rule_value", "creation_timestamp": "creation_timestamp_value", "description": "description_value", + "external_managed_backend_bucket_migration_state": "external_managed_backend_bucket_migration_state_value", + "external_managed_backend_bucket_migration_testing_percentage": 0.6294000000000001, "fingerprint": "fingerprint_value", "id": 205, "ip_collection": "ip_collection_value", @@ -4921,6 +4939,7 @@ def test_patch_rest_call_success(request_type): "psc_connection_status": "psc_connection_status_value", "region": "region_value", "self_link": "self_link_value", + "self_link_with_id": "self_link_with_id_value", "service_directory_registrations": [ { "namespace": "namespace_value", diff --git a/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_global_forwarding_rules.py b/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_global_forwarding_rules.py index ebfaa8e54391..a7402738bda4 100644 --- a/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_global_forwarding_rules.py +++ b/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_global_forwarding_rules.py @@ -3767,6 +3767,8 @@ def test_get_rest_call_success(request_type): base_forwarding_rule="base_forwarding_rule_value", creation_timestamp="creation_timestamp_value", description="description_value", + external_managed_backend_bucket_migration_state="external_managed_backend_bucket_migration_state_value", + external_managed_backend_bucket_migration_testing_percentage=0.6294000000000001, fingerprint="fingerprint_value", id=205, ip_collection="ip_collection_value", @@ -3785,6 +3787,7 @@ def test_get_rest_call_success(request_type): psc_connection_status="psc_connection_status_value", region="region_value", self_link="self_link_value", + self_link_with_id="self_link_with_id_value", service_label="service_label_value", service_name="service_name_value", source_ip_ranges=["source_ip_ranges_value"], @@ -3815,6 +3818,15 @@ def test_get_rest_call_success(request_type): assert response.base_forwarding_rule == "base_forwarding_rule_value" assert response.creation_timestamp == "creation_timestamp_value" assert response.description == "description_value" + assert ( + response.external_managed_backend_bucket_migration_state + == "external_managed_backend_bucket_migration_state_value" + ) + assert math.isclose( + response.external_managed_backend_bucket_migration_testing_percentage, + 0.6294000000000001, + rel_tol=1e-6, + ) assert response.fingerprint == "fingerprint_value" assert response.id == 205 assert response.ip_collection == "ip_collection_value" @@ -3833,6 +3845,7 @@ def test_get_rest_call_success(request_type): assert response.psc_connection_status == "psc_connection_status_value" assert response.region == "region_value" assert response.self_link == "self_link_value" + assert response.self_link_with_id == "self_link_with_id_value" assert response.service_label == "service_label_value" assert response.service_name == "service_name_value" assert response.source_ip_ranges == ["source_ip_ranges_value"] @@ -3951,6 +3964,8 @@ def test_insert_rest_call_success(request_type): "base_forwarding_rule": "base_forwarding_rule_value", "creation_timestamp": "creation_timestamp_value", "description": "description_value", + "external_managed_backend_bucket_migration_state": "external_managed_backend_bucket_migration_state_value", + "external_managed_backend_bucket_migration_testing_percentage": 0.6294000000000001, "fingerprint": "fingerprint_value", "id": 205, "ip_collection": "ip_collection_value", @@ -3976,6 +3991,7 @@ def test_insert_rest_call_success(request_type): "psc_connection_status": "psc_connection_status_value", "region": "region_value", "self_link": "self_link_value", + "self_link_with_id": "self_link_with_id_value", "service_directory_registrations": [ { "namespace": "namespace_value", @@ -4368,6 +4384,8 @@ def test_patch_rest_call_success(request_type): "base_forwarding_rule": "base_forwarding_rule_value", "creation_timestamp": "creation_timestamp_value", "description": "description_value", + "external_managed_backend_bucket_migration_state": "external_managed_backend_bucket_migration_state_value", + "external_managed_backend_bucket_migration_testing_percentage": 0.6294000000000001, "fingerprint": "fingerprint_value", "id": 205, "ip_collection": "ip_collection_value", @@ -4393,6 +4411,7 @@ def test_patch_rest_call_success(request_type): "psc_connection_status": "psc_connection_status_value", "region": "region_value", "self_link": "self_link_value", + "self_link_with_id": "self_link_with_id_value", "service_directory_registrations": [ { "namespace": "namespace_value", diff --git a/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_interconnect_attachment_groups.py b/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_interconnect_attachment_groups.py new file mode 100644 index 000000000000..f7e59307fb3e --- /dev/null +++ b/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_interconnect_attachment_groups.py @@ -0,0 +1,6047 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +import os + +# try/except added for compatibility with python < 3.8 +try: + from unittest import mock + from unittest.mock import AsyncMock # pragma: NO COVER +except ImportError: # pragma: NO COVER + import mock + +from collections.abc import AsyncIterable, Iterable +import json +import math + +from google.api_core import api_core_version +from google.protobuf import json_format +import grpc +from grpc.experimental import aio +from proto.marshal.rules import wrappers +from proto.marshal.rules.dates import DurationRule, TimestampRule +import pytest +from requests import PreparedRequest, Request, Response +from requests.sessions import Session + +try: + from google.auth.aio import credentials as ga_credentials_async + + HAS_GOOGLE_AUTH_AIO = True +except ImportError: # pragma: NO COVER + HAS_GOOGLE_AUTH_AIO = False + +from google.api_core import ( + future, + gapic_v1, + grpc_helpers, + grpc_helpers_async, + path_template, +) +from google.api_core import client_options +from google.api_core import exceptions as core_exceptions +from google.api_core import extended_operation # type: ignore +from google.api_core import retry as retries +import google.auth +from google.auth import credentials as ga_credentials +from google.auth.exceptions import MutualTLSChannelError +from google.oauth2 import service_account + +from google.cloud.compute_v1.services.interconnect_attachment_groups import ( + InterconnectAttachmentGroupsClient, + pagers, + transports, +) +from google.cloud.compute_v1.types import compute + +CRED_INFO_JSON = { + "credential_source": "/path/to/file", + "credential_type": "service account credentials", + "principal": "service-account@example.com", +} +CRED_INFO_STRING = json.dumps(CRED_INFO_JSON) + + +async def mock_async_gen(data, chunk_size=1): + for i in range(0, len(data)): # pragma: NO COVER + chunk = data[i : i + chunk_size] + yield chunk.encode("utf-8") + + +def client_cert_source_callback(): + return b"cert bytes", b"key bytes" + + +# TODO: use async auth anon credentials by default once the minimum version of google-auth is upgraded. +# See related issue: https://github.com/googleapis/gapic-generator-python/issues/2107. +def async_anonymous_credentials(): + if HAS_GOOGLE_AUTH_AIO: + return ga_credentials_async.AnonymousCredentials() + return ga_credentials.AnonymousCredentials() + + +# If default endpoint is localhost, then default mtls endpoint will be the same. +# This method modifies the default endpoint so the client can produce a different +# mtls endpoint for endpoint testing purposes. +def modify_default_endpoint(client): + return ( + "foo.googleapis.com" + if ("localhost" in client.DEFAULT_ENDPOINT) + else client.DEFAULT_ENDPOINT + ) + + +# If default endpoint template is localhost, then default mtls endpoint will be the same. +# This method modifies the default endpoint template so the client can produce a different +# mtls endpoint for endpoint testing purposes. +def modify_default_endpoint_template(client): + return ( + "test.{UNIVERSE_DOMAIN}" + if ("localhost" in client._DEFAULT_ENDPOINT_TEMPLATE) + else client._DEFAULT_ENDPOINT_TEMPLATE + ) + + +def test__get_default_mtls_endpoint(): + api_endpoint = "example.googleapis.com" + api_mtls_endpoint = "example.mtls.googleapis.com" + sandbox_endpoint = "example.sandbox.googleapis.com" + sandbox_mtls_endpoint = "example.mtls.sandbox.googleapis.com" + non_googleapi = "api.example.com" + + assert InterconnectAttachmentGroupsClient._get_default_mtls_endpoint(None) is None + assert ( + InterconnectAttachmentGroupsClient._get_default_mtls_endpoint(api_endpoint) + == api_mtls_endpoint + ) + assert ( + InterconnectAttachmentGroupsClient._get_default_mtls_endpoint(api_mtls_endpoint) + == api_mtls_endpoint + ) + assert ( + InterconnectAttachmentGroupsClient._get_default_mtls_endpoint(sandbox_endpoint) + == sandbox_mtls_endpoint + ) + assert ( + InterconnectAttachmentGroupsClient._get_default_mtls_endpoint( + sandbox_mtls_endpoint + ) + == sandbox_mtls_endpoint + ) + assert ( + InterconnectAttachmentGroupsClient._get_default_mtls_endpoint(non_googleapi) + == non_googleapi + ) + + +def test__read_environment_variables(): + assert InterconnectAttachmentGroupsClient._read_environment_variables() == ( + False, + "auto", + None, + ) + + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "true"}): + assert InterconnectAttachmentGroupsClient._read_environment_variables() == ( + True, + "auto", + None, + ) + + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "false"}): + assert InterconnectAttachmentGroupsClient._read_environment_variables() == ( + False, + "auto", + None, + ) + + with mock.patch.dict( + os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "Unsupported"} + ): + with pytest.raises(ValueError) as excinfo: + InterconnectAttachmentGroupsClient._read_environment_variables() + assert ( + str(excinfo.value) + == "Environment variable `GOOGLE_API_USE_CLIENT_CERTIFICATE` must be either `true` or `false`" + ) + + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): + assert InterconnectAttachmentGroupsClient._read_environment_variables() == ( + False, + "never", + None, + ) + + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}): + assert InterconnectAttachmentGroupsClient._read_environment_variables() == ( + False, + "always", + None, + ) + + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "auto"}): + assert InterconnectAttachmentGroupsClient._read_environment_variables() == ( + False, + "auto", + None, + ) + + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "Unsupported"}): + with pytest.raises(MutualTLSChannelError) as excinfo: + InterconnectAttachmentGroupsClient._read_environment_variables() + assert ( + str(excinfo.value) + == "Environment variable `GOOGLE_API_USE_MTLS_ENDPOINT` must be `never`, `auto` or `always`" + ) + + with mock.patch.dict(os.environ, {"GOOGLE_CLOUD_UNIVERSE_DOMAIN": "foo.com"}): + assert InterconnectAttachmentGroupsClient._read_environment_variables() == ( + False, + "auto", + "foo.com", + ) + + +def test__get_client_cert_source(): + mock_provided_cert_source = mock.Mock() + mock_default_cert_source = mock.Mock() + + assert ( + InterconnectAttachmentGroupsClient._get_client_cert_source(None, False) is None + ) + assert ( + InterconnectAttachmentGroupsClient._get_client_cert_source( + mock_provided_cert_source, False + ) + is None + ) + assert ( + InterconnectAttachmentGroupsClient._get_client_cert_source( + mock_provided_cert_source, True + ) + == mock_provided_cert_source + ) + + with mock.patch( + "google.auth.transport.mtls.has_default_client_cert_source", return_value=True + ): + with mock.patch( + "google.auth.transport.mtls.default_client_cert_source", + return_value=mock_default_cert_source, + ): + assert ( + InterconnectAttachmentGroupsClient._get_client_cert_source(None, True) + is mock_default_cert_source + ) + assert ( + InterconnectAttachmentGroupsClient._get_client_cert_source( + mock_provided_cert_source, "true" + ) + is mock_provided_cert_source + ) + + +@mock.patch.object( + InterconnectAttachmentGroupsClient, + "_DEFAULT_ENDPOINT_TEMPLATE", + modify_default_endpoint_template(InterconnectAttachmentGroupsClient), +) +def test__get_api_endpoint(): + api_override = "foo.com" + mock_client_cert_source = mock.Mock() + default_universe = InterconnectAttachmentGroupsClient._DEFAULT_UNIVERSE + default_endpoint = ( + InterconnectAttachmentGroupsClient._DEFAULT_ENDPOINT_TEMPLATE.format( + UNIVERSE_DOMAIN=default_universe + ) + ) + mock_universe = "bar.com" + mock_endpoint = ( + InterconnectAttachmentGroupsClient._DEFAULT_ENDPOINT_TEMPLATE.format( + UNIVERSE_DOMAIN=mock_universe + ) + ) + + assert ( + InterconnectAttachmentGroupsClient._get_api_endpoint( + api_override, mock_client_cert_source, default_universe, "always" + ) + == api_override + ) + assert ( + InterconnectAttachmentGroupsClient._get_api_endpoint( + None, mock_client_cert_source, default_universe, "auto" + ) + == InterconnectAttachmentGroupsClient.DEFAULT_MTLS_ENDPOINT + ) + assert ( + InterconnectAttachmentGroupsClient._get_api_endpoint( + None, None, default_universe, "auto" + ) + == default_endpoint + ) + assert ( + InterconnectAttachmentGroupsClient._get_api_endpoint( + None, None, default_universe, "always" + ) + == InterconnectAttachmentGroupsClient.DEFAULT_MTLS_ENDPOINT + ) + assert ( + InterconnectAttachmentGroupsClient._get_api_endpoint( + None, mock_client_cert_source, default_universe, "always" + ) + == InterconnectAttachmentGroupsClient.DEFAULT_MTLS_ENDPOINT + ) + assert ( + InterconnectAttachmentGroupsClient._get_api_endpoint( + None, None, mock_universe, "never" + ) + == mock_endpoint + ) + assert ( + InterconnectAttachmentGroupsClient._get_api_endpoint( + None, None, default_universe, "never" + ) + == default_endpoint + ) + + with pytest.raises(MutualTLSChannelError) as excinfo: + InterconnectAttachmentGroupsClient._get_api_endpoint( + None, mock_client_cert_source, mock_universe, "auto" + ) + assert ( + str(excinfo.value) + == "mTLS is not supported in any universe other than googleapis.com." + ) + + +def test__get_universe_domain(): + client_universe_domain = "foo.com" + universe_domain_env = "bar.com" + + assert ( + InterconnectAttachmentGroupsClient._get_universe_domain( + client_universe_domain, universe_domain_env + ) + == client_universe_domain + ) + assert ( + InterconnectAttachmentGroupsClient._get_universe_domain( + None, universe_domain_env + ) + == universe_domain_env + ) + assert ( + InterconnectAttachmentGroupsClient._get_universe_domain(None, None) + == InterconnectAttachmentGroupsClient._DEFAULT_UNIVERSE + ) + + with pytest.raises(ValueError) as excinfo: + InterconnectAttachmentGroupsClient._get_universe_domain("", None) + assert str(excinfo.value) == "Universe Domain cannot be an empty string." + + +@pytest.mark.parametrize( + "error_code,cred_info_json,show_cred_info", + [ + (401, CRED_INFO_JSON, True), + (403, CRED_INFO_JSON, True), + (404, CRED_INFO_JSON, True), + (500, CRED_INFO_JSON, False), + (401, None, False), + (403, None, False), + (404, None, False), + (500, None, False), + ], +) +def test__add_cred_info_for_auth_errors(error_code, cred_info_json, show_cred_info): + cred = mock.Mock(["get_cred_info"]) + cred.get_cred_info = mock.Mock(return_value=cred_info_json) + client = InterconnectAttachmentGroupsClient(credentials=cred) + client._transport._credentials = cred + + error = core_exceptions.GoogleAPICallError("message", details=["foo"]) + error.code = error_code + + client._add_cred_info_for_auth_errors(error) + if show_cred_info: + assert error.details == ["foo", CRED_INFO_STRING] + else: + assert error.details == ["foo"] + + +@pytest.mark.parametrize("error_code", [401, 403, 404, 500]) +def test__add_cred_info_for_auth_errors_no_get_cred_info(error_code): + cred = mock.Mock([]) + assert not hasattr(cred, "get_cred_info") + client = InterconnectAttachmentGroupsClient(credentials=cred) + client._transport._credentials = cred + + error = core_exceptions.GoogleAPICallError("message", details=[]) + error.code = error_code + + client._add_cred_info_for_auth_errors(error) + assert error.details == [] + + +@pytest.mark.parametrize( + "client_class,transport_name", + [ + (InterconnectAttachmentGroupsClient, "rest"), + ], +) +def test_interconnect_attachment_groups_client_from_service_account_info( + client_class, transport_name +): + creds = ga_credentials.AnonymousCredentials() + with mock.patch.object( + service_account.Credentials, "from_service_account_info" + ) as factory: + factory.return_value = creds + info = {"valid": True} + client = client_class.from_service_account_info(info, transport=transport_name) + assert client.transport._credentials == creds + assert isinstance(client, client_class) + + assert client.transport._host == ( + "compute.googleapis.com:443" + if transport_name in ["grpc", "grpc_asyncio"] + else "https://compute.googleapis.com" + ) + + +@pytest.mark.parametrize( + "transport_class,transport_name", + [ + (transports.InterconnectAttachmentGroupsRestTransport, "rest"), + ], +) +def test_interconnect_attachment_groups_client_service_account_always_use_jwt( + transport_class, transport_name +): + with mock.patch.object( + service_account.Credentials, "with_always_use_jwt_access", create=True + ) as use_jwt: + creds = service_account.Credentials(None, None, None) + transport = transport_class(credentials=creds, always_use_jwt_access=True) + use_jwt.assert_called_once_with(True) + + with mock.patch.object( + service_account.Credentials, "with_always_use_jwt_access", create=True + ) as use_jwt: + creds = service_account.Credentials(None, None, None) + transport = transport_class(credentials=creds, always_use_jwt_access=False) + use_jwt.assert_not_called() + + +@pytest.mark.parametrize( + "client_class,transport_name", + [ + (InterconnectAttachmentGroupsClient, "rest"), + ], +) +def test_interconnect_attachment_groups_client_from_service_account_file( + client_class, transport_name +): + creds = ga_credentials.AnonymousCredentials() + with mock.patch.object( + service_account.Credentials, "from_service_account_file" + ) as factory: + factory.return_value = creds + client = client_class.from_service_account_file( + "dummy/file/path.json", transport=transport_name + ) + assert client.transport._credentials == creds + assert isinstance(client, client_class) + + client = client_class.from_service_account_json( + "dummy/file/path.json", transport=transport_name + ) + assert client.transport._credentials == creds + assert isinstance(client, client_class) + + assert client.transport._host == ( + "compute.googleapis.com:443" + if transport_name in ["grpc", "grpc_asyncio"] + else "https://compute.googleapis.com" + ) + + +def test_interconnect_attachment_groups_client_get_transport_class(): + transport = InterconnectAttachmentGroupsClient.get_transport_class() + available_transports = [ + transports.InterconnectAttachmentGroupsRestTransport, + ] + assert transport in available_transports + + transport = InterconnectAttachmentGroupsClient.get_transport_class("rest") + assert transport == transports.InterconnectAttachmentGroupsRestTransport + + +@pytest.mark.parametrize( + "client_class,transport_class,transport_name", + [ + ( + InterconnectAttachmentGroupsClient, + transports.InterconnectAttachmentGroupsRestTransport, + "rest", + ), + ], +) +@mock.patch.object( + InterconnectAttachmentGroupsClient, + "_DEFAULT_ENDPOINT_TEMPLATE", + modify_default_endpoint_template(InterconnectAttachmentGroupsClient), +) +def test_interconnect_attachment_groups_client_client_options( + client_class, transport_class, transport_name +): + # Check that if channel is provided we won't create a new one. + with mock.patch.object( + InterconnectAttachmentGroupsClient, "get_transport_class" + ) as gtc: + transport = transport_class(credentials=ga_credentials.AnonymousCredentials()) + client = client_class(transport=transport) + gtc.assert_not_called() + + # Check that if channel is provided via str we will create a new one. + with mock.patch.object( + InterconnectAttachmentGroupsClient, "get_transport_class" + ) as gtc: + client = client_class(transport=transport_name) + gtc.assert_called() + + # Check the case api_endpoint is provided. + options = client_options.ClientOptions(api_endpoint="squid.clam.whelk") + with mock.patch.object(transport_class, "__init__") as patched: + patched.return_value = None + client = client_class(transport=transport_name, client_options=options) + patched.assert_called_once_with( + credentials=None, + credentials_file=None, + host="squid.clam.whelk", + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + api_audience=None, + ) + + # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is + # "never". + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): + with mock.patch.object(transport_class, "__init__") as patched: + patched.return_value = None + client = client_class(transport=transport_name) + patched.assert_called_once_with( + credentials=None, + credentials_file=None, + host=client._DEFAULT_ENDPOINT_TEMPLATE.format( + UNIVERSE_DOMAIN=client._DEFAULT_UNIVERSE + ), + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + api_audience=None, + ) + + # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is + # "always". + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}): + with mock.patch.object(transport_class, "__init__") as patched: + patched.return_value = None + client = client_class(transport=transport_name) + patched.assert_called_once_with( + credentials=None, + credentials_file=None, + host=client.DEFAULT_MTLS_ENDPOINT, + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + api_audience=None, + ) + + # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has + # unsupported value. + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "Unsupported"}): + with pytest.raises(MutualTLSChannelError) as excinfo: + client = client_class(transport=transport_name) + assert ( + str(excinfo.value) + == "Environment variable `GOOGLE_API_USE_MTLS_ENDPOINT` must be `never`, `auto` or `always`" + ) + + # Check the case GOOGLE_API_USE_CLIENT_CERTIFICATE has unsupported value. + with mock.patch.dict( + os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "Unsupported"} + ): + with pytest.raises(ValueError) as excinfo: + client = client_class(transport=transport_name) + assert ( + str(excinfo.value) + == "Environment variable `GOOGLE_API_USE_CLIENT_CERTIFICATE` must be either `true` or `false`" + ) + + # Check the case quota_project_id is provided + options = client_options.ClientOptions(quota_project_id="octopus") + with mock.patch.object(transport_class, "__init__") as patched: + patched.return_value = None + client = client_class(client_options=options, transport=transport_name) + patched.assert_called_once_with( + credentials=None, + credentials_file=None, + host=client._DEFAULT_ENDPOINT_TEMPLATE.format( + UNIVERSE_DOMAIN=client._DEFAULT_UNIVERSE + ), + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id="octopus", + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + with mock.patch.object(transport_class, "__init__") as patched: + patched.return_value = None + client = client_class(client_options=options, transport=transport_name) + patched.assert_called_once_with( + credentials=None, + credentials_file=None, + host=client._DEFAULT_ENDPOINT_TEMPLATE.format( + UNIVERSE_DOMAIN=client._DEFAULT_UNIVERSE + ), + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + api_audience="https://language.googleapis.com", + ) + + +@pytest.mark.parametrize( + "client_class,transport_class,transport_name,use_client_cert_env", + [ + ( + InterconnectAttachmentGroupsClient, + transports.InterconnectAttachmentGroupsRestTransport, + "rest", + "true", + ), + ( + InterconnectAttachmentGroupsClient, + transports.InterconnectAttachmentGroupsRestTransport, + "rest", + "false", + ), + ], +) +@mock.patch.object( + InterconnectAttachmentGroupsClient, + "_DEFAULT_ENDPOINT_TEMPLATE", + modify_default_endpoint_template(InterconnectAttachmentGroupsClient), +) +@mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "auto"}) +def test_interconnect_attachment_groups_client_mtls_env_auto( + client_class, transport_class, transport_name, use_client_cert_env +): + # This tests the endpoint autoswitch behavior. Endpoint is autoswitched to the default + # mtls endpoint, if GOOGLE_API_USE_CLIENT_CERTIFICATE is "true" and client cert exists. + + # Check the case client_cert_source is provided. Whether client cert is used depends on + # GOOGLE_API_USE_CLIENT_CERTIFICATE value. + with mock.patch.dict( + os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": use_client_cert_env} + ): + options = client_options.ClientOptions( + client_cert_source=client_cert_source_callback + ) + with mock.patch.object(transport_class, "__init__") as patched: + patched.return_value = None + client = client_class(client_options=options, transport=transport_name) + + if use_client_cert_env == "false": + expected_client_cert_source = None + expected_host = client._DEFAULT_ENDPOINT_TEMPLATE.format( + UNIVERSE_DOMAIN=client._DEFAULT_UNIVERSE + ) + else: + expected_client_cert_source = client_cert_source_callback + expected_host = client.DEFAULT_MTLS_ENDPOINT + + patched.assert_called_once_with( + credentials=None, + credentials_file=None, + host=expected_host, + scopes=None, + client_cert_source_for_mtls=expected_client_cert_source, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + api_audience=None, + ) + + # Check the case ADC client cert is provided. Whether client cert is used depends on + # GOOGLE_API_USE_CLIENT_CERTIFICATE value. + with mock.patch.dict( + os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": use_client_cert_env} + ): + with mock.patch.object(transport_class, "__init__") as patched: + with mock.patch( + "google.auth.transport.mtls.has_default_client_cert_source", + return_value=True, + ): + with mock.patch( + "google.auth.transport.mtls.default_client_cert_source", + return_value=client_cert_source_callback, + ): + if use_client_cert_env == "false": + expected_host = client._DEFAULT_ENDPOINT_TEMPLATE.format( + UNIVERSE_DOMAIN=client._DEFAULT_UNIVERSE + ) + expected_client_cert_source = None + else: + expected_host = client.DEFAULT_MTLS_ENDPOINT + expected_client_cert_source = client_cert_source_callback + + patched.return_value = None + client = client_class(transport=transport_name) + patched.assert_called_once_with( + credentials=None, + credentials_file=None, + host=expected_host, + scopes=None, + client_cert_source_for_mtls=expected_client_cert_source, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + api_audience=None, + ) + + # Check the case client_cert_source and ADC client cert are not provided. + with mock.patch.dict( + os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": use_client_cert_env} + ): + with mock.patch.object(transport_class, "__init__") as patched: + with mock.patch( + "google.auth.transport.mtls.has_default_client_cert_source", + return_value=False, + ): + patched.return_value = None + client = client_class(transport=transport_name) + patched.assert_called_once_with( + credentials=None, + credentials_file=None, + host=client._DEFAULT_ENDPOINT_TEMPLATE.format( + UNIVERSE_DOMAIN=client._DEFAULT_UNIVERSE + ), + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + api_audience=None, + ) + + +@pytest.mark.parametrize("client_class", [InterconnectAttachmentGroupsClient]) +@mock.patch.object( + InterconnectAttachmentGroupsClient, + "DEFAULT_ENDPOINT", + modify_default_endpoint(InterconnectAttachmentGroupsClient), +) +def test_interconnect_attachment_groups_client_get_mtls_endpoint_and_cert_source( + client_class, +): + mock_client_cert_source = mock.Mock() + + # Test the case GOOGLE_API_USE_CLIENT_CERTIFICATE is "true". + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "true"}): + mock_api_endpoint = "foo" + options = client_options.ClientOptions( + client_cert_source=mock_client_cert_source, api_endpoint=mock_api_endpoint + ) + api_endpoint, cert_source = client_class.get_mtls_endpoint_and_cert_source( + options + ) + assert api_endpoint == mock_api_endpoint + assert cert_source == mock_client_cert_source + + # Test the case GOOGLE_API_USE_CLIENT_CERTIFICATE is "false". + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "false"}): + mock_client_cert_source = mock.Mock() + mock_api_endpoint = "foo" + options = client_options.ClientOptions( + client_cert_source=mock_client_cert_source, api_endpoint=mock_api_endpoint + ) + api_endpoint, cert_source = client_class.get_mtls_endpoint_and_cert_source( + options + ) + assert api_endpoint == mock_api_endpoint + assert cert_source is None + + # Test the case GOOGLE_API_USE_MTLS_ENDPOINT is "never". + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): + api_endpoint, cert_source = client_class.get_mtls_endpoint_and_cert_source() + assert api_endpoint == client_class.DEFAULT_ENDPOINT + assert cert_source is None + + # Test the case GOOGLE_API_USE_MTLS_ENDPOINT is "always". + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}): + api_endpoint, cert_source = client_class.get_mtls_endpoint_and_cert_source() + assert api_endpoint == client_class.DEFAULT_MTLS_ENDPOINT + assert cert_source is None + + # Test the case GOOGLE_API_USE_MTLS_ENDPOINT is "auto" and default cert doesn't exist. + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "true"}): + with mock.patch( + "google.auth.transport.mtls.has_default_client_cert_source", + return_value=False, + ): + api_endpoint, cert_source = client_class.get_mtls_endpoint_and_cert_source() + assert api_endpoint == client_class.DEFAULT_ENDPOINT + assert cert_source is None + + # Test the case GOOGLE_API_USE_MTLS_ENDPOINT is "auto" and default cert exists. + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "true"}): + with mock.patch( + "google.auth.transport.mtls.has_default_client_cert_source", + return_value=True, + ): + with mock.patch( + "google.auth.transport.mtls.default_client_cert_source", + return_value=mock_client_cert_source, + ): + ( + api_endpoint, + cert_source, + ) = client_class.get_mtls_endpoint_and_cert_source() + assert api_endpoint == client_class.DEFAULT_MTLS_ENDPOINT + assert cert_source == mock_client_cert_source + + # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has + # unsupported value. + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "Unsupported"}): + with pytest.raises(MutualTLSChannelError) as excinfo: + client_class.get_mtls_endpoint_and_cert_source() + + assert ( + str(excinfo.value) + == "Environment variable `GOOGLE_API_USE_MTLS_ENDPOINT` must be `never`, `auto` or `always`" + ) + + # Check the case GOOGLE_API_USE_CLIENT_CERTIFICATE has unsupported value. + with mock.patch.dict( + os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "Unsupported"} + ): + with pytest.raises(ValueError) as excinfo: + client_class.get_mtls_endpoint_and_cert_source() + + assert ( + str(excinfo.value) + == "Environment variable `GOOGLE_API_USE_CLIENT_CERTIFICATE` must be either `true` or `false`" + ) + + +@pytest.mark.parametrize("client_class", [InterconnectAttachmentGroupsClient]) +@mock.patch.object( + InterconnectAttachmentGroupsClient, + "_DEFAULT_ENDPOINT_TEMPLATE", + modify_default_endpoint_template(InterconnectAttachmentGroupsClient), +) +def test_interconnect_attachment_groups_client_client_api_endpoint(client_class): + mock_client_cert_source = client_cert_source_callback + api_override = "foo.com" + default_universe = InterconnectAttachmentGroupsClient._DEFAULT_UNIVERSE + default_endpoint = ( + InterconnectAttachmentGroupsClient._DEFAULT_ENDPOINT_TEMPLATE.format( + UNIVERSE_DOMAIN=default_universe + ) + ) + mock_universe = "bar.com" + mock_endpoint = ( + InterconnectAttachmentGroupsClient._DEFAULT_ENDPOINT_TEMPLATE.format( + UNIVERSE_DOMAIN=mock_universe + ) + ) + + # If ClientOptions.api_endpoint is set and GOOGLE_API_USE_CLIENT_CERTIFICATE="true", + # use ClientOptions.api_endpoint as the api endpoint regardless. + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "true"}): + with mock.patch( + "google.auth.transport.requests.AuthorizedSession.configure_mtls_channel" + ): + options = client_options.ClientOptions( + client_cert_source=mock_client_cert_source, api_endpoint=api_override + ) + client = client_class( + client_options=options, + credentials=ga_credentials.AnonymousCredentials(), + ) + assert client.api_endpoint == api_override + + # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="never", + # use the _DEFAULT_ENDPOINT_TEMPLATE populated with GDU as the api endpoint. + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): + client = client_class(credentials=ga_credentials.AnonymousCredentials()) + assert client.api_endpoint == default_endpoint + + # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="always", + # use the DEFAULT_MTLS_ENDPOINT as the api endpoint. + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}): + client = client_class(credentials=ga_credentials.AnonymousCredentials()) + assert client.api_endpoint == client_class.DEFAULT_MTLS_ENDPOINT + + # If ClientOptions.api_endpoint is not set, GOOGLE_API_USE_MTLS_ENDPOINT="auto" (default), + # GOOGLE_API_USE_CLIENT_CERTIFICATE="false" (default), default cert source doesn't exist, + # and ClientOptions.universe_domain="bar.com", + # use the _DEFAULT_ENDPOINT_TEMPLATE populated with universe domain as the api endpoint. + options = client_options.ClientOptions() + universe_exists = hasattr(options, "universe_domain") + if universe_exists: + options = client_options.ClientOptions(universe_domain=mock_universe) + client = client_class( + client_options=options, credentials=ga_credentials.AnonymousCredentials() + ) + else: + client = client_class( + client_options=options, credentials=ga_credentials.AnonymousCredentials() + ) + assert client.api_endpoint == ( + mock_endpoint if universe_exists else default_endpoint + ) + assert client.universe_domain == ( + mock_universe if universe_exists else default_universe + ) + + # If ClientOptions does not have a universe domain attribute and GOOGLE_API_USE_MTLS_ENDPOINT="never", + # use the _DEFAULT_ENDPOINT_TEMPLATE populated with GDU as the api endpoint. + options = client_options.ClientOptions() + if hasattr(options, "universe_domain"): + delattr(options, "universe_domain") + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): + client = client_class( + client_options=options, credentials=ga_credentials.AnonymousCredentials() + ) + assert client.api_endpoint == default_endpoint + + +@pytest.mark.parametrize( + "client_class,transport_class,transport_name", + [ + ( + InterconnectAttachmentGroupsClient, + transports.InterconnectAttachmentGroupsRestTransport, + "rest", + ), + ], +) +def test_interconnect_attachment_groups_client_client_options_scopes( + client_class, transport_class, transport_name +): + # Check the case scopes are provided. + options = client_options.ClientOptions( + scopes=["1", "2"], + ) + with mock.patch.object(transport_class, "__init__") as patched: + patched.return_value = None + client = client_class(client_options=options, transport=transport_name) + patched.assert_called_once_with( + credentials=None, + credentials_file=None, + host=client._DEFAULT_ENDPOINT_TEMPLATE.format( + UNIVERSE_DOMAIN=client._DEFAULT_UNIVERSE + ), + scopes=["1", "2"], + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + api_audience=None, + ) + + +@pytest.mark.parametrize( + "client_class,transport_class,transport_name,grpc_helpers", + [ + ( + InterconnectAttachmentGroupsClient, + transports.InterconnectAttachmentGroupsRestTransport, + "rest", + None, + ), + ], +) +def test_interconnect_attachment_groups_client_client_options_credentials_file( + client_class, transport_class, transport_name, grpc_helpers +): + # Check the case credentials file is provided. + options = client_options.ClientOptions(credentials_file="credentials.json") + + with mock.patch.object(transport_class, "__init__") as patched: + patched.return_value = None + client = client_class(client_options=options, transport=transport_name) + patched.assert_called_once_with( + credentials=None, + credentials_file="credentials.json", + host=client._DEFAULT_ENDPOINT_TEMPLATE.format( + UNIVERSE_DOMAIN=client._DEFAULT_UNIVERSE + ), + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + api_audience=None, + ) + + +def test_delete_rest_use_cached_wrapped_rpc(): + # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, + # instead of constructing them on each call + with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Should wrap all calls on client creation + assert wrapper_fn.call_count > 0 + wrapper_fn.reset_mock() + + # Ensure method has been cached + assert client._transport.delete in client._transport._wrapped_methods + + # Replace cached wrapped function with mock + mock_rpc = mock.Mock() + mock_rpc.return_value.name = ( + "foo" # operation_request.operation in compute client(s) expect a string. + ) + client._transport._wrapped_methods[client._transport.delete] = mock_rpc + + request = {} + client.delete(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + # Operation methods build a cached wrapper on first rpc call + # subsequent calls should use the cached wrapper + wrapper_fn.reset_mock() + + client.delete(request) + + # Establish that a new wrapper was not created for this call + assert wrapper_fn.call_count == 0 + assert mock_rpc.call_count == 2 + + +def test_delete_rest_required_fields( + request_type=compute.DeleteInterconnectAttachmentGroupRequest, +): + transport_class = transports.InterconnectAttachmentGroupsRestTransport + + request_init = {} + request_init["interconnect_attachment_group"] = "" + request_init["project"] = "" + request = request_type(**request_init) + pb_request = request_type.pb(request) + jsonified_request = json.loads( + json_format.MessageToJson(pb_request, use_integers_for_enums=False) + ) + + # verify fields with default values are dropped + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).delete._get_unset_required_fields(jsonified_request) + jsonified_request.update(unset_fields) + + # verify required fields with default values are now present + + jsonified_request[ + "interconnectAttachmentGroup" + ] = "interconnect_attachment_group_value" + jsonified_request["project"] = "project_value" + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).delete._get_unset_required_fields(jsonified_request) + # Check that path parameters and body parameters are not mixing in. + assert not set(unset_fields) - set(("request_id",)) + jsonified_request.update(unset_fields) + + # verify required fields with non-default values are left alone + assert "interconnectAttachmentGroup" in jsonified_request + assert ( + jsonified_request["interconnectAttachmentGroup"] + == "interconnect_attachment_group_value" + ) + assert "project" in jsonified_request + assert jsonified_request["project"] == "project_value" + + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + request = request_type(**request_init) + + # Designate an appropriate value for the returned response. + return_value = compute.Operation() + # Mock the http request call within the method and fake a response. + with mock.patch.object(Session, "request") as req: + # We need to mock transcode() because providing default values + # for required fields will fail the real version if the http_options + # expect actual values for those fields. + with mock.patch.object(path_template, "transcode") as transcode: + # A uri without fields and an empty body will force all the + # request fields to show up in the query_params. + pb_request = request_type.pb(request) + transcode_result = { + "uri": "v1/sample_method", + "method": "delete", + "query_params": pb_request, + } + transcode.return_value = transcode_result + + response_value = Response() + response_value.status_code = 200 + + # Convert return value to protobuf type + return_value = compute.Operation.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + response = client.delete(request) + + expected_params = [] + actual_params = req.call_args.kwargs["params"] + assert expected_params == actual_params + + +def test_delete_rest_unset_required_fields(): + transport = transports.InterconnectAttachmentGroupsRestTransport( + credentials=ga_credentials.AnonymousCredentials + ) + + unset_fields = transport.delete._get_unset_required_fields({}) + assert set(unset_fields) == ( + set(("requestId",)) + & set( + ( + "interconnectAttachmentGroup", + "project", + ) + ) + ) + + +def test_delete_rest_flattened(): + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = compute.Operation() + + # get arguments that satisfy an http rule for this method + sample_request = { + "project": "sample1", + "interconnect_attachment_group": "sample2", + } + + # get truthy value for each flattened field + mock_args = dict( + project="project_value", + interconnect_attachment_group="interconnect_attachment_group_value", + ) + mock_args.update(sample_request) + + # Wrap the value into a proper Response obj + response_value = Response() + response_value.status_code = 200 + # Convert return value to protobuf type + return_value = compute.Operation.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + client.delete(**mock_args) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(req.mock_calls) == 1 + _, args, _ = req.mock_calls[0] + assert path_template.validate( + "%s/compute/v1/projects/{project}/global/interconnectAttachmentGroups/{interconnect_attachment_group}" + % client.transport._host, + args[1], + ) + + +def test_delete_rest_flattened_error(transport: str = "rest"): + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.delete( + compute.DeleteInterconnectAttachmentGroupRequest(), + project="project_value", + interconnect_attachment_group="interconnect_attachment_group_value", + ) + + +def test_delete_unary_rest_use_cached_wrapped_rpc(): + # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, + # instead of constructing them on each call + with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Should wrap all calls on client creation + assert wrapper_fn.call_count > 0 + wrapper_fn.reset_mock() + + # Ensure method has been cached + assert client._transport.delete in client._transport._wrapped_methods + + # Replace cached wrapped function with mock + mock_rpc = mock.Mock() + mock_rpc.return_value.name = ( + "foo" # operation_request.operation in compute client(s) expect a string. + ) + client._transport._wrapped_methods[client._transport.delete] = mock_rpc + + request = {} + client.delete_unary(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + # Operation methods build a cached wrapper on first rpc call + # subsequent calls should use the cached wrapper + wrapper_fn.reset_mock() + + client.delete_unary(request) + + # Establish that a new wrapper was not created for this call + assert wrapper_fn.call_count == 0 + assert mock_rpc.call_count == 2 + + +def test_delete_unary_rest_required_fields( + request_type=compute.DeleteInterconnectAttachmentGroupRequest, +): + transport_class = transports.InterconnectAttachmentGroupsRestTransport + + request_init = {} + request_init["interconnect_attachment_group"] = "" + request_init["project"] = "" + request = request_type(**request_init) + pb_request = request_type.pb(request) + jsonified_request = json.loads( + json_format.MessageToJson(pb_request, use_integers_for_enums=False) + ) + + # verify fields with default values are dropped + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).delete._get_unset_required_fields(jsonified_request) + jsonified_request.update(unset_fields) + + # verify required fields with default values are now present + + jsonified_request[ + "interconnectAttachmentGroup" + ] = "interconnect_attachment_group_value" + jsonified_request["project"] = "project_value" + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).delete._get_unset_required_fields(jsonified_request) + # Check that path parameters and body parameters are not mixing in. + assert not set(unset_fields) - set(("request_id",)) + jsonified_request.update(unset_fields) + + # verify required fields with non-default values are left alone + assert "interconnectAttachmentGroup" in jsonified_request + assert ( + jsonified_request["interconnectAttachmentGroup"] + == "interconnect_attachment_group_value" + ) + assert "project" in jsonified_request + assert jsonified_request["project"] == "project_value" + + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + request = request_type(**request_init) + + # Designate an appropriate value for the returned response. + return_value = compute.Operation() + # Mock the http request call within the method and fake a response. + with mock.patch.object(Session, "request") as req: + # We need to mock transcode() because providing default values + # for required fields will fail the real version if the http_options + # expect actual values for those fields. + with mock.patch.object(path_template, "transcode") as transcode: + # A uri without fields and an empty body will force all the + # request fields to show up in the query_params. + pb_request = request_type.pb(request) + transcode_result = { + "uri": "v1/sample_method", + "method": "delete", + "query_params": pb_request, + } + transcode.return_value = transcode_result + + response_value = Response() + response_value.status_code = 200 + + # Convert return value to protobuf type + return_value = compute.Operation.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + response = client.delete_unary(request) + + expected_params = [] + actual_params = req.call_args.kwargs["params"] + assert expected_params == actual_params + + +def test_delete_unary_rest_unset_required_fields(): + transport = transports.InterconnectAttachmentGroupsRestTransport( + credentials=ga_credentials.AnonymousCredentials + ) + + unset_fields = transport.delete._get_unset_required_fields({}) + assert set(unset_fields) == ( + set(("requestId",)) + & set( + ( + "interconnectAttachmentGroup", + "project", + ) + ) + ) + + +def test_delete_unary_rest_flattened(): + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = compute.Operation() + + # get arguments that satisfy an http rule for this method + sample_request = { + "project": "sample1", + "interconnect_attachment_group": "sample2", + } + + # get truthy value for each flattened field + mock_args = dict( + project="project_value", + interconnect_attachment_group="interconnect_attachment_group_value", + ) + mock_args.update(sample_request) + + # Wrap the value into a proper Response obj + response_value = Response() + response_value.status_code = 200 + # Convert return value to protobuf type + return_value = compute.Operation.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + client.delete_unary(**mock_args) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(req.mock_calls) == 1 + _, args, _ = req.mock_calls[0] + assert path_template.validate( + "%s/compute/v1/projects/{project}/global/interconnectAttachmentGroups/{interconnect_attachment_group}" + % client.transport._host, + args[1], + ) + + +def test_delete_unary_rest_flattened_error(transport: str = "rest"): + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.delete_unary( + compute.DeleteInterconnectAttachmentGroupRequest(), + project="project_value", + interconnect_attachment_group="interconnect_attachment_group_value", + ) + + +def test_get_rest_use_cached_wrapped_rpc(): + # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, + # instead of constructing them on each call + with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Should wrap all calls on client creation + assert wrapper_fn.call_count > 0 + wrapper_fn.reset_mock() + + # Ensure method has been cached + assert client._transport.get in client._transport._wrapped_methods + + # Replace cached wrapped function with mock + mock_rpc = mock.Mock() + mock_rpc.return_value.name = ( + "foo" # operation_request.operation in compute client(s) expect a string. + ) + client._transport._wrapped_methods[client._transport.get] = mock_rpc + + request = {} + client.get(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + client.get(request) + + # Establish that a new wrapper was not created for this call + assert wrapper_fn.call_count == 0 + assert mock_rpc.call_count == 2 + + +def test_get_rest_required_fields( + request_type=compute.GetInterconnectAttachmentGroupRequest, +): + transport_class = transports.InterconnectAttachmentGroupsRestTransport + + request_init = {} + request_init["interconnect_attachment_group"] = "" + request_init["project"] = "" + request = request_type(**request_init) + pb_request = request_type.pb(request) + jsonified_request = json.loads( + json_format.MessageToJson(pb_request, use_integers_for_enums=False) + ) + + # verify fields with default values are dropped + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).get._get_unset_required_fields(jsonified_request) + jsonified_request.update(unset_fields) + + # verify required fields with default values are now present + + jsonified_request[ + "interconnectAttachmentGroup" + ] = "interconnect_attachment_group_value" + jsonified_request["project"] = "project_value" + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).get._get_unset_required_fields(jsonified_request) + jsonified_request.update(unset_fields) + + # verify required fields with non-default values are left alone + assert "interconnectAttachmentGroup" in jsonified_request + assert ( + jsonified_request["interconnectAttachmentGroup"] + == "interconnect_attachment_group_value" + ) + assert "project" in jsonified_request + assert jsonified_request["project"] == "project_value" + + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + request = request_type(**request_init) + + # Designate an appropriate value for the returned response. + return_value = compute.InterconnectAttachmentGroup() + # Mock the http request call within the method and fake a response. + with mock.patch.object(Session, "request") as req: + # We need to mock transcode() because providing default values + # for required fields will fail the real version if the http_options + # expect actual values for those fields. + with mock.patch.object(path_template, "transcode") as transcode: + # A uri without fields and an empty body will force all the + # request fields to show up in the query_params. + pb_request = request_type.pb(request) + transcode_result = { + "uri": "v1/sample_method", + "method": "get", + "query_params": pb_request, + } + transcode.return_value = transcode_result + + response_value = Response() + response_value.status_code = 200 + + # Convert return value to protobuf type + return_value = compute.InterconnectAttachmentGroup.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + response = client.get(request) + + expected_params = [] + actual_params = req.call_args.kwargs["params"] + assert expected_params == actual_params + + +def test_get_rest_unset_required_fields(): + transport = transports.InterconnectAttachmentGroupsRestTransport( + credentials=ga_credentials.AnonymousCredentials + ) + + unset_fields = transport.get._get_unset_required_fields({}) + assert set(unset_fields) == ( + set(()) + & set( + ( + "interconnectAttachmentGroup", + "project", + ) + ) + ) + + +def test_get_rest_flattened(): + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = compute.InterconnectAttachmentGroup() + + # get arguments that satisfy an http rule for this method + sample_request = { + "project": "sample1", + "interconnect_attachment_group": "sample2", + } + + # get truthy value for each flattened field + mock_args = dict( + project="project_value", + interconnect_attachment_group="interconnect_attachment_group_value", + ) + mock_args.update(sample_request) + + # Wrap the value into a proper Response obj + response_value = Response() + response_value.status_code = 200 + # Convert return value to protobuf type + return_value = compute.InterconnectAttachmentGroup.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + client.get(**mock_args) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(req.mock_calls) == 1 + _, args, _ = req.mock_calls[0] + assert path_template.validate( + "%s/compute/v1/projects/{project}/global/interconnectAttachmentGroups/{interconnect_attachment_group}" + % client.transport._host, + args[1], + ) + + +def test_get_rest_flattened_error(transport: str = "rest"): + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.get( + compute.GetInterconnectAttachmentGroupRequest(), + project="project_value", + interconnect_attachment_group="interconnect_attachment_group_value", + ) + + +def test_get_iam_policy_rest_use_cached_wrapped_rpc(): + # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, + # instead of constructing them on each call + with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Should wrap all calls on client creation + assert wrapper_fn.call_count > 0 + wrapper_fn.reset_mock() + + # Ensure method has been cached + assert client._transport.get_iam_policy in client._transport._wrapped_methods + + # Replace cached wrapped function with mock + mock_rpc = mock.Mock() + mock_rpc.return_value.name = ( + "foo" # operation_request.operation in compute client(s) expect a string. + ) + client._transport._wrapped_methods[client._transport.get_iam_policy] = mock_rpc + + request = {} + client.get_iam_policy(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + client.get_iam_policy(request) + + # Establish that a new wrapper was not created for this call + assert wrapper_fn.call_count == 0 + assert mock_rpc.call_count == 2 + + +def test_get_iam_policy_rest_required_fields( + request_type=compute.GetIamPolicyInterconnectAttachmentGroupRequest, +): + transport_class = transports.InterconnectAttachmentGroupsRestTransport + + request_init = {} + request_init["project"] = "" + request_init["resource"] = "" + request = request_type(**request_init) + pb_request = request_type.pb(request) + jsonified_request = json.loads( + json_format.MessageToJson(pb_request, use_integers_for_enums=False) + ) + + # verify fields with default values are dropped + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).get_iam_policy._get_unset_required_fields(jsonified_request) + jsonified_request.update(unset_fields) + + # verify required fields with default values are now present + + jsonified_request["project"] = "project_value" + jsonified_request["resource"] = "resource_value" + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).get_iam_policy._get_unset_required_fields(jsonified_request) + # Check that path parameters and body parameters are not mixing in. + assert not set(unset_fields) - set(("options_requested_policy_version",)) + jsonified_request.update(unset_fields) + + # verify required fields with non-default values are left alone + assert "project" in jsonified_request + assert jsonified_request["project"] == "project_value" + assert "resource" in jsonified_request + assert jsonified_request["resource"] == "resource_value" + + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + request = request_type(**request_init) + + # Designate an appropriate value for the returned response. + return_value = compute.Policy() + # Mock the http request call within the method and fake a response. + with mock.patch.object(Session, "request") as req: + # We need to mock transcode() because providing default values + # for required fields will fail the real version if the http_options + # expect actual values for those fields. + with mock.patch.object(path_template, "transcode") as transcode: + # A uri without fields and an empty body will force all the + # request fields to show up in the query_params. + pb_request = request_type.pb(request) + transcode_result = { + "uri": "v1/sample_method", + "method": "get", + "query_params": pb_request, + } + transcode.return_value = transcode_result + + response_value = Response() + response_value.status_code = 200 + + # Convert return value to protobuf type + return_value = compute.Policy.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + response = client.get_iam_policy(request) + + expected_params = [] + actual_params = req.call_args.kwargs["params"] + assert expected_params == actual_params + + +def test_get_iam_policy_rest_unset_required_fields(): + transport = transports.InterconnectAttachmentGroupsRestTransport( + credentials=ga_credentials.AnonymousCredentials + ) + + unset_fields = transport.get_iam_policy._get_unset_required_fields({}) + assert set(unset_fields) == ( + set(("optionsRequestedPolicyVersion",)) + & set( + ( + "project", + "resource", + ) + ) + ) + + +def test_get_iam_policy_rest_flattened(): + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = compute.Policy() + + # get arguments that satisfy an http rule for this method + sample_request = {"project": "sample1", "resource": "sample2"} + + # get truthy value for each flattened field + mock_args = dict( + project="project_value", + resource="resource_value", + ) + mock_args.update(sample_request) + + # Wrap the value into a proper Response obj + response_value = Response() + response_value.status_code = 200 + # Convert return value to protobuf type + return_value = compute.Policy.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + client.get_iam_policy(**mock_args) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(req.mock_calls) == 1 + _, args, _ = req.mock_calls[0] + assert path_template.validate( + "%s/compute/v1/projects/{project}/global/interconnectAttachmentGroups/{resource}/getIamPolicy" + % client.transport._host, + args[1], + ) + + +def test_get_iam_policy_rest_flattened_error(transport: str = "rest"): + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.get_iam_policy( + compute.GetIamPolicyInterconnectAttachmentGroupRequest(), + project="project_value", + resource="resource_value", + ) + + +def test_get_operational_status_rest_use_cached_wrapped_rpc(): + # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, + # instead of constructing them on each call + with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Should wrap all calls on client creation + assert wrapper_fn.call_count > 0 + wrapper_fn.reset_mock() + + # Ensure method has been cached + assert ( + client._transport.get_operational_status + in client._transport._wrapped_methods + ) + + # Replace cached wrapped function with mock + mock_rpc = mock.Mock() + mock_rpc.return_value.name = ( + "foo" # operation_request.operation in compute client(s) expect a string. + ) + client._transport._wrapped_methods[ + client._transport.get_operational_status + ] = mock_rpc + + request = {} + client.get_operational_status(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + client.get_operational_status(request) + + # Establish that a new wrapper was not created for this call + assert wrapper_fn.call_count == 0 + assert mock_rpc.call_count == 2 + + +def test_get_operational_status_rest_required_fields( + request_type=compute.GetOperationalStatusInterconnectAttachmentGroupRequest, +): + transport_class = transports.InterconnectAttachmentGroupsRestTransport + + request_init = {} + request_init["interconnect_attachment_group"] = "" + request_init["project"] = "" + request = request_type(**request_init) + pb_request = request_type.pb(request) + jsonified_request = json.loads( + json_format.MessageToJson(pb_request, use_integers_for_enums=False) + ) + + # verify fields with default values are dropped + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).get_operational_status._get_unset_required_fields(jsonified_request) + jsonified_request.update(unset_fields) + + # verify required fields with default values are now present + + jsonified_request[ + "interconnectAttachmentGroup" + ] = "interconnect_attachment_group_value" + jsonified_request["project"] = "project_value" + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).get_operational_status._get_unset_required_fields(jsonified_request) + jsonified_request.update(unset_fields) + + # verify required fields with non-default values are left alone + assert "interconnectAttachmentGroup" in jsonified_request + assert ( + jsonified_request["interconnectAttachmentGroup"] + == "interconnect_attachment_group_value" + ) + assert "project" in jsonified_request + assert jsonified_request["project"] == "project_value" + + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + request = request_type(**request_init) + + # Designate an appropriate value for the returned response. + return_value = compute.InterconnectAttachmentGroupsGetOperationalStatusResponse() + # Mock the http request call within the method and fake a response. + with mock.patch.object(Session, "request") as req: + # We need to mock transcode() because providing default values + # for required fields will fail the real version if the http_options + # expect actual values for those fields. + with mock.patch.object(path_template, "transcode") as transcode: + # A uri without fields and an empty body will force all the + # request fields to show up in the query_params. + pb_request = request_type.pb(request) + transcode_result = { + "uri": "v1/sample_method", + "method": "get", + "query_params": pb_request, + } + transcode.return_value = transcode_result + + response_value = Response() + response_value.status_code = 200 + + # Convert return value to protobuf type + return_value = ( + compute.InterconnectAttachmentGroupsGetOperationalStatusResponse.pb( + return_value + ) + ) + json_return_value = json_format.MessageToJson(return_value) + + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + response = client.get_operational_status(request) + + expected_params = [] + actual_params = req.call_args.kwargs["params"] + assert expected_params == actual_params + + +def test_get_operational_status_rest_unset_required_fields(): + transport = transports.InterconnectAttachmentGroupsRestTransport( + credentials=ga_credentials.AnonymousCredentials + ) + + unset_fields = transport.get_operational_status._get_unset_required_fields({}) + assert set(unset_fields) == ( + set(()) + & set( + ( + "interconnectAttachmentGroup", + "project", + ) + ) + ) + + +def test_get_operational_status_rest_flattened(): + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = ( + compute.InterconnectAttachmentGroupsGetOperationalStatusResponse() + ) + + # get arguments that satisfy an http rule for this method + sample_request = { + "project": "sample1", + "interconnect_attachment_group": "sample2", + } + + # get truthy value for each flattened field + mock_args = dict( + project="project_value", + interconnect_attachment_group="interconnect_attachment_group_value", + ) + mock_args.update(sample_request) + + # Wrap the value into a proper Response obj + response_value = Response() + response_value.status_code = 200 + # Convert return value to protobuf type + return_value = ( + compute.InterconnectAttachmentGroupsGetOperationalStatusResponse.pb( + return_value + ) + ) + json_return_value = json_format.MessageToJson(return_value) + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + client.get_operational_status(**mock_args) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(req.mock_calls) == 1 + _, args, _ = req.mock_calls[0] + assert path_template.validate( + "%s/compute/v1/projects/{project}/global/interconnectAttachmentGroups/{interconnect_attachment_group}/getOperationalStatus" + % client.transport._host, + args[1], + ) + + +def test_get_operational_status_rest_flattened_error(transport: str = "rest"): + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.get_operational_status( + compute.GetOperationalStatusInterconnectAttachmentGroupRequest(), + project="project_value", + interconnect_attachment_group="interconnect_attachment_group_value", + ) + + +def test_insert_rest_use_cached_wrapped_rpc(): + # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, + # instead of constructing them on each call + with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Should wrap all calls on client creation + assert wrapper_fn.call_count > 0 + wrapper_fn.reset_mock() + + # Ensure method has been cached + assert client._transport.insert in client._transport._wrapped_methods + + # Replace cached wrapped function with mock + mock_rpc = mock.Mock() + mock_rpc.return_value.name = ( + "foo" # operation_request.operation in compute client(s) expect a string. + ) + client._transport._wrapped_methods[client._transport.insert] = mock_rpc + + request = {} + client.insert(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + # Operation methods build a cached wrapper on first rpc call + # subsequent calls should use the cached wrapper + wrapper_fn.reset_mock() + + client.insert(request) + + # Establish that a new wrapper was not created for this call + assert wrapper_fn.call_count == 0 + assert mock_rpc.call_count == 2 + + +def test_insert_rest_required_fields( + request_type=compute.InsertInterconnectAttachmentGroupRequest, +): + transport_class = transports.InterconnectAttachmentGroupsRestTransport + + request_init = {} + request_init["project"] = "" + request = request_type(**request_init) + pb_request = request_type.pb(request) + jsonified_request = json.loads( + json_format.MessageToJson(pb_request, use_integers_for_enums=False) + ) + + # verify fields with default values are dropped + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).insert._get_unset_required_fields(jsonified_request) + jsonified_request.update(unset_fields) + + # verify required fields with default values are now present + + jsonified_request["project"] = "project_value" + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).insert._get_unset_required_fields(jsonified_request) + # Check that path parameters and body parameters are not mixing in. + assert not set(unset_fields) - set(("request_id",)) + jsonified_request.update(unset_fields) + + # verify required fields with non-default values are left alone + assert "project" in jsonified_request + assert jsonified_request["project"] == "project_value" + + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + request = request_type(**request_init) + + # Designate an appropriate value for the returned response. + return_value = compute.Operation() + # Mock the http request call within the method and fake a response. + with mock.patch.object(Session, "request") as req: + # We need to mock transcode() because providing default values + # for required fields will fail the real version if the http_options + # expect actual values for those fields. + with mock.patch.object(path_template, "transcode") as transcode: + # A uri without fields and an empty body will force all the + # request fields to show up in the query_params. + pb_request = request_type.pb(request) + transcode_result = { + "uri": "v1/sample_method", + "method": "post", + "query_params": pb_request, + } + transcode_result["body"] = pb_request + transcode.return_value = transcode_result + + response_value = Response() + response_value.status_code = 200 + + # Convert return value to protobuf type + return_value = compute.Operation.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + response = client.insert(request) + + expected_params = [] + actual_params = req.call_args.kwargs["params"] + assert expected_params == actual_params + + +def test_insert_rest_unset_required_fields(): + transport = transports.InterconnectAttachmentGroupsRestTransport( + credentials=ga_credentials.AnonymousCredentials + ) + + unset_fields = transport.insert._get_unset_required_fields({}) + assert set(unset_fields) == ( + set(("requestId",)) + & set( + ( + "interconnectAttachmentGroupResource", + "project", + ) + ) + ) + + +def test_insert_rest_flattened(): + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = compute.Operation() + + # get arguments that satisfy an http rule for this method + sample_request = {"project": "sample1"} + + # get truthy value for each flattened field + mock_args = dict( + project="project_value", + interconnect_attachment_group_resource=compute.InterconnectAttachmentGroup( + attachments={ + "key_value": compute.InterconnectAttachmentGroupAttachment( + attachment="attachment_value" + ) + } + ), + ) + mock_args.update(sample_request) + + # Wrap the value into a proper Response obj + response_value = Response() + response_value.status_code = 200 + # Convert return value to protobuf type + return_value = compute.Operation.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + client.insert(**mock_args) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(req.mock_calls) == 1 + _, args, _ = req.mock_calls[0] + assert path_template.validate( + "%s/compute/v1/projects/{project}/global/interconnectAttachmentGroups" + % client.transport._host, + args[1], + ) + + +def test_insert_rest_flattened_error(transport: str = "rest"): + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.insert( + compute.InsertInterconnectAttachmentGroupRequest(), + project="project_value", + interconnect_attachment_group_resource=compute.InterconnectAttachmentGroup( + attachments={ + "key_value": compute.InterconnectAttachmentGroupAttachment( + attachment="attachment_value" + ) + } + ), + ) + + +def test_insert_unary_rest_use_cached_wrapped_rpc(): + # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, + # instead of constructing them on each call + with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Should wrap all calls on client creation + assert wrapper_fn.call_count > 0 + wrapper_fn.reset_mock() + + # Ensure method has been cached + assert client._transport.insert in client._transport._wrapped_methods + + # Replace cached wrapped function with mock + mock_rpc = mock.Mock() + mock_rpc.return_value.name = ( + "foo" # operation_request.operation in compute client(s) expect a string. + ) + client._transport._wrapped_methods[client._transport.insert] = mock_rpc + + request = {} + client.insert_unary(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + # Operation methods build a cached wrapper on first rpc call + # subsequent calls should use the cached wrapper + wrapper_fn.reset_mock() + + client.insert_unary(request) + + # Establish that a new wrapper was not created for this call + assert wrapper_fn.call_count == 0 + assert mock_rpc.call_count == 2 + + +def test_insert_unary_rest_required_fields( + request_type=compute.InsertInterconnectAttachmentGroupRequest, +): + transport_class = transports.InterconnectAttachmentGroupsRestTransport + + request_init = {} + request_init["project"] = "" + request = request_type(**request_init) + pb_request = request_type.pb(request) + jsonified_request = json.loads( + json_format.MessageToJson(pb_request, use_integers_for_enums=False) + ) + + # verify fields with default values are dropped + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).insert._get_unset_required_fields(jsonified_request) + jsonified_request.update(unset_fields) + + # verify required fields with default values are now present + + jsonified_request["project"] = "project_value" + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).insert._get_unset_required_fields(jsonified_request) + # Check that path parameters and body parameters are not mixing in. + assert not set(unset_fields) - set(("request_id",)) + jsonified_request.update(unset_fields) + + # verify required fields with non-default values are left alone + assert "project" in jsonified_request + assert jsonified_request["project"] == "project_value" + + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + request = request_type(**request_init) + + # Designate an appropriate value for the returned response. + return_value = compute.Operation() + # Mock the http request call within the method and fake a response. + with mock.patch.object(Session, "request") as req: + # We need to mock transcode() because providing default values + # for required fields will fail the real version if the http_options + # expect actual values for those fields. + with mock.patch.object(path_template, "transcode") as transcode: + # A uri without fields and an empty body will force all the + # request fields to show up in the query_params. + pb_request = request_type.pb(request) + transcode_result = { + "uri": "v1/sample_method", + "method": "post", + "query_params": pb_request, + } + transcode_result["body"] = pb_request + transcode.return_value = transcode_result + + response_value = Response() + response_value.status_code = 200 + + # Convert return value to protobuf type + return_value = compute.Operation.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + response = client.insert_unary(request) + + expected_params = [] + actual_params = req.call_args.kwargs["params"] + assert expected_params == actual_params + + +def test_insert_unary_rest_unset_required_fields(): + transport = transports.InterconnectAttachmentGroupsRestTransport( + credentials=ga_credentials.AnonymousCredentials + ) + + unset_fields = transport.insert._get_unset_required_fields({}) + assert set(unset_fields) == ( + set(("requestId",)) + & set( + ( + "interconnectAttachmentGroupResource", + "project", + ) + ) + ) + + +def test_insert_unary_rest_flattened(): + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = compute.Operation() + + # get arguments that satisfy an http rule for this method + sample_request = {"project": "sample1"} + + # get truthy value for each flattened field + mock_args = dict( + project="project_value", + interconnect_attachment_group_resource=compute.InterconnectAttachmentGroup( + attachments={ + "key_value": compute.InterconnectAttachmentGroupAttachment( + attachment="attachment_value" + ) + } + ), + ) + mock_args.update(sample_request) + + # Wrap the value into a proper Response obj + response_value = Response() + response_value.status_code = 200 + # Convert return value to protobuf type + return_value = compute.Operation.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + client.insert_unary(**mock_args) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(req.mock_calls) == 1 + _, args, _ = req.mock_calls[0] + assert path_template.validate( + "%s/compute/v1/projects/{project}/global/interconnectAttachmentGroups" + % client.transport._host, + args[1], + ) + + +def test_insert_unary_rest_flattened_error(transport: str = "rest"): + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.insert_unary( + compute.InsertInterconnectAttachmentGroupRequest(), + project="project_value", + interconnect_attachment_group_resource=compute.InterconnectAttachmentGroup( + attachments={ + "key_value": compute.InterconnectAttachmentGroupAttachment( + attachment="attachment_value" + ) + } + ), + ) + + +def test_list_rest_use_cached_wrapped_rpc(): + # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, + # instead of constructing them on each call + with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Should wrap all calls on client creation + assert wrapper_fn.call_count > 0 + wrapper_fn.reset_mock() + + # Ensure method has been cached + assert client._transport.list in client._transport._wrapped_methods + + # Replace cached wrapped function with mock + mock_rpc = mock.Mock() + mock_rpc.return_value.name = ( + "foo" # operation_request.operation in compute client(s) expect a string. + ) + client._transport._wrapped_methods[client._transport.list] = mock_rpc + + request = {} + client.list(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + client.list(request) + + # Establish that a new wrapper was not created for this call + assert wrapper_fn.call_count == 0 + assert mock_rpc.call_count == 2 + + +def test_list_rest_required_fields( + request_type=compute.ListInterconnectAttachmentGroupsRequest, +): + transport_class = transports.InterconnectAttachmentGroupsRestTransport + + request_init = {} + request_init["project"] = "" + request = request_type(**request_init) + pb_request = request_type.pb(request) + jsonified_request = json.loads( + json_format.MessageToJson(pb_request, use_integers_for_enums=False) + ) + + # verify fields with default values are dropped + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).list._get_unset_required_fields(jsonified_request) + jsonified_request.update(unset_fields) + + # verify required fields with default values are now present + + jsonified_request["project"] = "project_value" + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).list._get_unset_required_fields(jsonified_request) + # Check that path parameters and body parameters are not mixing in. + assert not set(unset_fields) - set( + ( + "filter", + "max_results", + "order_by", + "page_token", + "return_partial_success", + ) + ) + jsonified_request.update(unset_fields) + + # verify required fields with non-default values are left alone + assert "project" in jsonified_request + assert jsonified_request["project"] == "project_value" + + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + request = request_type(**request_init) + + # Designate an appropriate value for the returned response. + return_value = compute.InterconnectAttachmentGroupsListResponse() + # Mock the http request call within the method and fake a response. + with mock.patch.object(Session, "request") as req: + # We need to mock transcode() because providing default values + # for required fields will fail the real version if the http_options + # expect actual values for those fields. + with mock.patch.object(path_template, "transcode") as transcode: + # A uri without fields and an empty body will force all the + # request fields to show up in the query_params. + pb_request = request_type.pb(request) + transcode_result = { + "uri": "v1/sample_method", + "method": "get", + "query_params": pb_request, + } + transcode.return_value = transcode_result + + response_value = Response() + response_value.status_code = 200 + + # Convert return value to protobuf type + return_value = compute.InterconnectAttachmentGroupsListResponse.pb( + return_value + ) + json_return_value = json_format.MessageToJson(return_value) + + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + response = client.list(request) + + expected_params = [] + actual_params = req.call_args.kwargs["params"] + assert expected_params == actual_params + + +def test_list_rest_unset_required_fields(): + transport = transports.InterconnectAttachmentGroupsRestTransport( + credentials=ga_credentials.AnonymousCredentials + ) + + unset_fields = transport.list._get_unset_required_fields({}) + assert set(unset_fields) == ( + set( + ( + "filter", + "maxResults", + "orderBy", + "pageToken", + "returnPartialSuccess", + ) + ) + & set(("project",)) + ) + + +def test_list_rest_flattened(): + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = compute.InterconnectAttachmentGroupsListResponse() + + # get arguments that satisfy an http rule for this method + sample_request = {"project": "sample1"} + + # get truthy value for each flattened field + mock_args = dict( + project="project_value", + ) + mock_args.update(sample_request) + + # Wrap the value into a proper Response obj + response_value = Response() + response_value.status_code = 200 + # Convert return value to protobuf type + return_value = compute.InterconnectAttachmentGroupsListResponse.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + client.list(**mock_args) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(req.mock_calls) == 1 + _, args, _ = req.mock_calls[0] + assert path_template.validate( + "%s/compute/v1/projects/{project}/global/interconnectAttachmentGroups" + % client.transport._host, + args[1], + ) + + +def test_list_rest_flattened_error(transport: str = "rest"): + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.list( + compute.ListInterconnectAttachmentGroupsRequest(), + project="project_value", + ) + + +def test_list_rest_pager(transport: str = "rest"): + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(Session, "request") as req: + # TODO(kbandes): remove this mock unless there's a good reason for it. + # with mock.patch.object(path_template, 'transcode') as transcode: + # Set the response as a series of pages + response = ( + compute.InterconnectAttachmentGroupsListResponse( + items=[ + compute.InterconnectAttachmentGroup(), + compute.InterconnectAttachmentGroup(), + compute.InterconnectAttachmentGroup(), + ], + next_page_token="abc", + ), + compute.InterconnectAttachmentGroupsListResponse( + items=[], + next_page_token="def", + ), + compute.InterconnectAttachmentGroupsListResponse( + items=[ + compute.InterconnectAttachmentGroup(), + ], + next_page_token="ghi", + ), + compute.InterconnectAttachmentGroupsListResponse( + items=[ + compute.InterconnectAttachmentGroup(), + compute.InterconnectAttachmentGroup(), + ], + ), + ) + # Two responses for two calls + response = response + response + + # Wrap the values into proper Response objs + response = tuple( + compute.InterconnectAttachmentGroupsListResponse.to_json(x) + for x in response + ) + return_values = tuple(Response() for i in response) + for return_val, response_val in zip(return_values, response): + return_val._content = response_val.encode("UTF-8") + return_val.status_code = 200 + req.side_effect = return_values + + sample_request = {"project": "sample1"} + + pager = client.list(request=sample_request) + + results = list(pager) + assert len(results) == 6 + assert all(isinstance(i, compute.InterconnectAttachmentGroup) for i in results) + + pages = list(client.list(request=sample_request).pages) + for page_, token in zip(pages, ["abc", "def", "ghi", ""]): + assert page_.raw_page.next_page_token == token + + +def test_patch_rest_use_cached_wrapped_rpc(): + # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, + # instead of constructing them on each call + with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Should wrap all calls on client creation + assert wrapper_fn.call_count > 0 + wrapper_fn.reset_mock() + + # Ensure method has been cached + assert client._transport.patch in client._transport._wrapped_methods + + # Replace cached wrapped function with mock + mock_rpc = mock.Mock() + mock_rpc.return_value.name = ( + "foo" # operation_request.operation in compute client(s) expect a string. + ) + client._transport._wrapped_methods[client._transport.patch] = mock_rpc + + request = {} + client.patch(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + # Operation methods build a cached wrapper on first rpc call + # subsequent calls should use the cached wrapper + wrapper_fn.reset_mock() + + client.patch(request) + + # Establish that a new wrapper was not created for this call + assert wrapper_fn.call_count == 0 + assert mock_rpc.call_count == 2 + + +def test_patch_rest_required_fields( + request_type=compute.PatchInterconnectAttachmentGroupRequest, +): + transport_class = transports.InterconnectAttachmentGroupsRestTransport + + request_init = {} + request_init["interconnect_attachment_group"] = "" + request_init["project"] = "" + request = request_type(**request_init) + pb_request = request_type.pb(request) + jsonified_request = json.loads( + json_format.MessageToJson(pb_request, use_integers_for_enums=False) + ) + + # verify fields with default values are dropped + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).patch._get_unset_required_fields(jsonified_request) + jsonified_request.update(unset_fields) + + # verify required fields with default values are now present + + jsonified_request[ + "interconnectAttachmentGroup" + ] = "interconnect_attachment_group_value" + jsonified_request["project"] = "project_value" + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).patch._get_unset_required_fields(jsonified_request) + # Check that path parameters and body parameters are not mixing in. + assert not set(unset_fields) - set( + ( + "request_id", + "update_mask", + ) + ) + jsonified_request.update(unset_fields) + + # verify required fields with non-default values are left alone + assert "interconnectAttachmentGroup" in jsonified_request + assert ( + jsonified_request["interconnectAttachmentGroup"] + == "interconnect_attachment_group_value" + ) + assert "project" in jsonified_request + assert jsonified_request["project"] == "project_value" + + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + request = request_type(**request_init) + + # Designate an appropriate value for the returned response. + return_value = compute.Operation() + # Mock the http request call within the method and fake a response. + with mock.patch.object(Session, "request") as req: + # We need to mock transcode() because providing default values + # for required fields will fail the real version if the http_options + # expect actual values for those fields. + with mock.patch.object(path_template, "transcode") as transcode: + # A uri without fields and an empty body will force all the + # request fields to show up in the query_params. + pb_request = request_type.pb(request) + transcode_result = { + "uri": "v1/sample_method", + "method": "patch", + "query_params": pb_request, + } + transcode_result["body"] = pb_request + transcode.return_value = transcode_result + + response_value = Response() + response_value.status_code = 200 + + # Convert return value to protobuf type + return_value = compute.Operation.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + response = client.patch(request) + + expected_params = [] + actual_params = req.call_args.kwargs["params"] + assert expected_params == actual_params + + +def test_patch_rest_unset_required_fields(): + transport = transports.InterconnectAttachmentGroupsRestTransport( + credentials=ga_credentials.AnonymousCredentials + ) + + unset_fields = transport.patch._get_unset_required_fields({}) + assert set(unset_fields) == ( + set( + ( + "requestId", + "updateMask", + ) + ) + & set( + ( + "interconnectAttachmentGroup", + "interconnectAttachmentGroupResource", + "project", + ) + ) + ) + + +def test_patch_rest_flattened(): + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = compute.Operation() + + # get arguments that satisfy an http rule for this method + sample_request = { + "project": "sample1", + "interconnect_attachment_group": "sample2", + } + + # get truthy value for each flattened field + mock_args = dict( + project="project_value", + interconnect_attachment_group="interconnect_attachment_group_value", + interconnect_attachment_group_resource=compute.InterconnectAttachmentGroup( + attachments={ + "key_value": compute.InterconnectAttachmentGroupAttachment( + attachment="attachment_value" + ) + } + ), + ) + mock_args.update(sample_request) + + # Wrap the value into a proper Response obj + response_value = Response() + response_value.status_code = 200 + # Convert return value to protobuf type + return_value = compute.Operation.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + client.patch(**mock_args) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(req.mock_calls) == 1 + _, args, _ = req.mock_calls[0] + assert path_template.validate( + "%s/compute/v1/projects/{project}/global/interconnectAttachmentGroups/{interconnect_attachment_group}" + % client.transport._host, + args[1], + ) + + +def test_patch_rest_flattened_error(transport: str = "rest"): + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.patch( + compute.PatchInterconnectAttachmentGroupRequest(), + project="project_value", + interconnect_attachment_group="interconnect_attachment_group_value", + interconnect_attachment_group_resource=compute.InterconnectAttachmentGroup( + attachments={ + "key_value": compute.InterconnectAttachmentGroupAttachment( + attachment="attachment_value" + ) + } + ), + ) + + +def test_patch_unary_rest_use_cached_wrapped_rpc(): + # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, + # instead of constructing them on each call + with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Should wrap all calls on client creation + assert wrapper_fn.call_count > 0 + wrapper_fn.reset_mock() + + # Ensure method has been cached + assert client._transport.patch in client._transport._wrapped_methods + + # Replace cached wrapped function with mock + mock_rpc = mock.Mock() + mock_rpc.return_value.name = ( + "foo" # operation_request.operation in compute client(s) expect a string. + ) + client._transport._wrapped_methods[client._transport.patch] = mock_rpc + + request = {} + client.patch_unary(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + # Operation methods build a cached wrapper on first rpc call + # subsequent calls should use the cached wrapper + wrapper_fn.reset_mock() + + client.patch_unary(request) + + # Establish that a new wrapper was not created for this call + assert wrapper_fn.call_count == 0 + assert mock_rpc.call_count == 2 + + +def test_patch_unary_rest_required_fields( + request_type=compute.PatchInterconnectAttachmentGroupRequest, +): + transport_class = transports.InterconnectAttachmentGroupsRestTransport + + request_init = {} + request_init["interconnect_attachment_group"] = "" + request_init["project"] = "" + request = request_type(**request_init) + pb_request = request_type.pb(request) + jsonified_request = json.loads( + json_format.MessageToJson(pb_request, use_integers_for_enums=False) + ) + + # verify fields with default values are dropped + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).patch._get_unset_required_fields(jsonified_request) + jsonified_request.update(unset_fields) + + # verify required fields with default values are now present + + jsonified_request[ + "interconnectAttachmentGroup" + ] = "interconnect_attachment_group_value" + jsonified_request["project"] = "project_value" + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).patch._get_unset_required_fields(jsonified_request) + # Check that path parameters and body parameters are not mixing in. + assert not set(unset_fields) - set( + ( + "request_id", + "update_mask", + ) + ) + jsonified_request.update(unset_fields) + + # verify required fields with non-default values are left alone + assert "interconnectAttachmentGroup" in jsonified_request + assert ( + jsonified_request["interconnectAttachmentGroup"] + == "interconnect_attachment_group_value" + ) + assert "project" in jsonified_request + assert jsonified_request["project"] == "project_value" + + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + request = request_type(**request_init) + + # Designate an appropriate value for the returned response. + return_value = compute.Operation() + # Mock the http request call within the method and fake a response. + with mock.patch.object(Session, "request") as req: + # We need to mock transcode() because providing default values + # for required fields will fail the real version if the http_options + # expect actual values for those fields. + with mock.patch.object(path_template, "transcode") as transcode: + # A uri without fields and an empty body will force all the + # request fields to show up in the query_params. + pb_request = request_type.pb(request) + transcode_result = { + "uri": "v1/sample_method", + "method": "patch", + "query_params": pb_request, + } + transcode_result["body"] = pb_request + transcode.return_value = transcode_result + + response_value = Response() + response_value.status_code = 200 + + # Convert return value to protobuf type + return_value = compute.Operation.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + response = client.patch_unary(request) + + expected_params = [] + actual_params = req.call_args.kwargs["params"] + assert expected_params == actual_params + + +def test_patch_unary_rest_unset_required_fields(): + transport = transports.InterconnectAttachmentGroupsRestTransport( + credentials=ga_credentials.AnonymousCredentials + ) + + unset_fields = transport.patch._get_unset_required_fields({}) + assert set(unset_fields) == ( + set( + ( + "requestId", + "updateMask", + ) + ) + & set( + ( + "interconnectAttachmentGroup", + "interconnectAttachmentGroupResource", + "project", + ) + ) + ) + + +def test_patch_unary_rest_flattened(): + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = compute.Operation() + + # get arguments that satisfy an http rule for this method + sample_request = { + "project": "sample1", + "interconnect_attachment_group": "sample2", + } + + # get truthy value for each flattened field + mock_args = dict( + project="project_value", + interconnect_attachment_group="interconnect_attachment_group_value", + interconnect_attachment_group_resource=compute.InterconnectAttachmentGroup( + attachments={ + "key_value": compute.InterconnectAttachmentGroupAttachment( + attachment="attachment_value" + ) + } + ), + ) + mock_args.update(sample_request) + + # Wrap the value into a proper Response obj + response_value = Response() + response_value.status_code = 200 + # Convert return value to protobuf type + return_value = compute.Operation.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + client.patch_unary(**mock_args) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(req.mock_calls) == 1 + _, args, _ = req.mock_calls[0] + assert path_template.validate( + "%s/compute/v1/projects/{project}/global/interconnectAttachmentGroups/{interconnect_attachment_group}" + % client.transport._host, + args[1], + ) + + +def test_patch_unary_rest_flattened_error(transport: str = "rest"): + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.patch_unary( + compute.PatchInterconnectAttachmentGroupRequest(), + project="project_value", + interconnect_attachment_group="interconnect_attachment_group_value", + interconnect_attachment_group_resource=compute.InterconnectAttachmentGroup( + attachments={ + "key_value": compute.InterconnectAttachmentGroupAttachment( + attachment="attachment_value" + ) + } + ), + ) + + +def test_set_iam_policy_rest_use_cached_wrapped_rpc(): + # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, + # instead of constructing them on each call + with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Should wrap all calls on client creation + assert wrapper_fn.call_count > 0 + wrapper_fn.reset_mock() + + # Ensure method has been cached + assert client._transport.set_iam_policy in client._transport._wrapped_methods + + # Replace cached wrapped function with mock + mock_rpc = mock.Mock() + mock_rpc.return_value.name = ( + "foo" # operation_request.operation in compute client(s) expect a string. + ) + client._transport._wrapped_methods[client._transport.set_iam_policy] = mock_rpc + + request = {} + client.set_iam_policy(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + client.set_iam_policy(request) + + # Establish that a new wrapper was not created for this call + assert wrapper_fn.call_count == 0 + assert mock_rpc.call_count == 2 + + +def test_set_iam_policy_rest_required_fields( + request_type=compute.SetIamPolicyInterconnectAttachmentGroupRequest, +): + transport_class = transports.InterconnectAttachmentGroupsRestTransport + + request_init = {} + request_init["project"] = "" + request_init["resource"] = "" + request = request_type(**request_init) + pb_request = request_type.pb(request) + jsonified_request = json.loads( + json_format.MessageToJson(pb_request, use_integers_for_enums=False) + ) + + # verify fields with default values are dropped + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).set_iam_policy._get_unset_required_fields(jsonified_request) + jsonified_request.update(unset_fields) + + # verify required fields with default values are now present + + jsonified_request["project"] = "project_value" + jsonified_request["resource"] = "resource_value" + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).set_iam_policy._get_unset_required_fields(jsonified_request) + jsonified_request.update(unset_fields) + + # verify required fields with non-default values are left alone + assert "project" in jsonified_request + assert jsonified_request["project"] == "project_value" + assert "resource" in jsonified_request + assert jsonified_request["resource"] == "resource_value" + + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + request = request_type(**request_init) + + # Designate an appropriate value for the returned response. + return_value = compute.Policy() + # Mock the http request call within the method and fake a response. + with mock.patch.object(Session, "request") as req: + # We need to mock transcode() because providing default values + # for required fields will fail the real version if the http_options + # expect actual values for those fields. + with mock.patch.object(path_template, "transcode") as transcode: + # A uri without fields and an empty body will force all the + # request fields to show up in the query_params. + pb_request = request_type.pb(request) + transcode_result = { + "uri": "v1/sample_method", + "method": "post", + "query_params": pb_request, + } + transcode_result["body"] = pb_request + transcode.return_value = transcode_result + + response_value = Response() + response_value.status_code = 200 + + # Convert return value to protobuf type + return_value = compute.Policy.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + response = client.set_iam_policy(request) + + expected_params = [] + actual_params = req.call_args.kwargs["params"] + assert expected_params == actual_params + + +def test_set_iam_policy_rest_unset_required_fields(): + transport = transports.InterconnectAttachmentGroupsRestTransport( + credentials=ga_credentials.AnonymousCredentials + ) + + unset_fields = transport.set_iam_policy._get_unset_required_fields({}) + assert set(unset_fields) == ( + set(()) + & set( + ( + "globalSetPolicyRequestResource", + "project", + "resource", + ) + ) + ) + + +def test_set_iam_policy_rest_flattened(): + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = compute.Policy() + + # get arguments that satisfy an http rule for this method + sample_request = {"project": "sample1", "resource": "sample2"} + + # get truthy value for each flattened field + mock_args = dict( + project="project_value", + resource="resource_value", + global_set_policy_request_resource=compute.GlobalSetPolicyRequest( + bindings=[compute.Binding(binding_id="binding_id_value")] + ), + ) + mock_args.update(sample_request) + + # Wrap the value into a proper Response obj + response_value = Response() + response_value.status_code = 200 + # Convert return value to protobuf type + return_value = compute.Policy.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + client.set_iam_policy(**mock_args) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(req.mock_calls) == 1 + _, args, _ = req.mock_calls[0] + assert path_template.validate( + "%s/compute/v1/projects/{project}/global/interconnectAttachmentGroups/{resource}/setIamPolicy" + % client.transport._host, + args[1], + ) + + +def test_set_iam_policy_rest_flattened_error(transport: str = "rest"): + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.set_iam_policy( + compute.SetIamPolicyInterconnectAttachmentGroupRequest(), + project="project_value", + resource="resource_value", + global_set_policy_request_resource=compute.GlobalSetPolicyRequest( + bindings=[compute.Binding(binding_id="binding_id_value")] + ), + ) + + +def test_test_iam_permissions_rest_use_cached_wrapped_rpc(): + # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, + # instead of constructing them on each call + with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Should wrap all calls on client creation + assert wrapper_fn.call_count > 0 + wrapper_fn.reset_mock() + + # Ensure method has been cached + assert ( + client._transport.test_iam_permissions in client._transport._wrapped_methods + ) + + # Replace cached wrapped function with mock + mock_rpc = mock.Mock() + mock_rpc.return_value.name = ( + "foo" # operation_request.operation in compute client(s) expect a string. + ) + client._transport._wrapped_methods[ + client._transport.test_iam_permissions + ] = mock_rpc + + request = {} + client.test_iam_permissions(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + client.test_iam_permissions(request) + + # Establish that a new wrapper was not created for this call + assert wrapper_fn.call_count == 0 + assert mock_rpc.call_count == 2 + + +def test_test_iam_permissions_rest_required_fields( + request_type=compute.TestIamPermissionsInterconnectAttachmentGroupRequest, +): + transport_class = transports.InterconnectAttachmentGroupsRestTransport + + request_init = {} + request_init["project"] = "" + request_init["resource"] = "" + request = request_type(**request_init) + pb_request = request_type.pb(request) + jsonified_request = json.loads( + json_format.MessageToJson(pb_request, use_integers_for_enums=False) + ) + + # verify fields with default values are dropped + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).test_iam_permissions._get_unset_required_fields(jsonified_request) + jsonified_request.update(unset_fields) + + # verify required fields with default values are now present + + jsonified_request["project"] = "project_value" + jsonified_request["resource"] = "resource_value" + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).test_iam_permissions._get_unset_required_fields(jsonified_request) + jsonified_request.update(unset_fields) + + # verify required fields with non-default values are left alone + assert "project" in jsonified_request + assert jsonified_request["project"] == "project_value" + assert "resource" in jsonified_request + assert jsonified_request["resource"] == "resource_value" + + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + request = request_type(**request_init) + + # Designate an appropriate value for the returned response. + return_value = compute.TestPermissionsResponse() + # Mock the http request call within the method and fake a response. + with mock.patch.object(Session, "request") as req: + # We need to mock transcode() because providing default values + # for required fields will fail the real version if the http_options + # expect actual values for those fields. + with mock.patch.object(path_template, "transcode") as transcode: + # A uri without fields and an empty body will force all the + # request fields to show up in the query_params. + pb_request = request_type.pb(request) + transcode_result = { + "uri": "v1/sample_method", + "method": "post", + "query_params": pb_request, + } + transcode_result["body"] = pb_request + transcode.return_value = transcode_result + + response_value = Response() + response_value.status_code = 200 + + # Convert return value to protobuf type + return_value = compute.TestPermissionsResponse.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + response = client.test_iam_permissions(request) + + expected_params = [] + actual_params = req.call_args.kwargs["params"] + assert expected_params == actual_params + + +def test_test_iam_permissions_rest_unset_required_fields(): + transport = transports.InterconnectAttachmentGroupsRestTransport( + credentials=ga_credentials.AnonymousCredentials + ) + + unset_fields = transport.test_iam_permissions._get_unset_required_fields({}) + assert set(unset_fields) == ( + set(()) + & set( + ( + "project", + "resource", + "testPermissionsRequestResource", + ) + ) + ) + + +def test_test_iam_permissions_rest_flattened(): + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = compute.TestPermissionsResponse() + + # get arguments that satisfy an http rule for this method + sample_request = {"project": "sample1", "resource": "sample2"} + + # get truthy value for each flattened field + mock_args = dict( + project="project_value", + resource="resource_value", + test_permissions_request_resource=compute.TestPermissionsRequest( + permissions=["permissions_value"] + ), + ) + mock_args.update(sample_request) + + # Wrap the value into a proper Response obj + response_value = Response() + response_value.status_code = 200 + # Convert return value to protobuf type + return_value = compute.TestPermissionsResponse.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + client.test_iam_permissions(**mock_args) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(req.mock_calls) == 1 + _, args, _ = req.mock_calls[0] + assert path_template.validate( + "%s/compute/v1/projects/{project}/global/interconnectAttachmentGroups/{resource}/testIamPermissions" + % client.transport._host, + args[1], + ) + + +def test_test_iam_permissions_rest_flattened_error(transport: str = "rest"): + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.test_iam_permissions( + compute.TestIamPermissionsInterconnectAttachmentGroupRequest(), + project="project_value", + resource="resource_value", + test_permissions_request_resource=compute.TestPermissionsRequest( + permissions=["permissions_value"] + ), + ) + + +def test_credentials_transport_error(): + # It is an error to provide credentials and a transport instance. + transport = transports.InterconnectAttachmentGroupsRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + ) + with pytest.raises(ValueError): + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # It is an error to provide a credentials file and a transport instance. + transport = transports.InterconnectAttachmentGroupsRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + ) + with pytest.raises(ValueError): + client = InterconnectAttachmentGroupsClient( + client_options={"credentials_file": "credentials.json"}, + transport=transport, + ) + + # It is an error to provide an api_key and a transport instance. + transport = transports.InterconnectAttachmentGroupsRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + ) + options = client_options.ClientOptions() + options.api_key = "api_key" + with pytest.raises(ValueError): + client = InterconnectAttachmentGroupsClient( + client_options=options, + transport=transport, + ) + + # It is an error to provide an api_key and a credential. + options = client_options.ClientOptions() + options.api_key = "api_key" + with pytest.raises(ValueError): + client = InterconnectAttachmentGroupsClient( + client_options=options, credentials=ga_credentials.AnonymousCredentials() + ) + + # It is an error to provide scopes and a transport instance. + transport = transports.InterconnectAttachmentGroupsRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + ) + with pytest.raises(ValueError): + client = InterconnectAttachmentGroupsClient( + client_options={"scopes": ["1", "2"]}, + transport=transport, + ) + + +def test_transport_instance(): + # A client may be instantiated with a custom transport instance. + transport = transports.InterconnectAttachmentGroupsRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + ) + client = InterconnectAttachmentGroupsClient(transport=transport) + assert client.transport is transport + + +@pytest.mark.parametrize( + "transport_class", + [ + transports.InterconnectAttachmentGroupsRestTransport, + ], +) +def test_transport_adc(transport_class): + # Test default credentials are used if not provided. + with mock.patch.object(google.auth, "default") as adc: + adc.return_value = (ga_credentials.AnonymousCredentials(), None) + transport_class() + adc.assert_called_once() + + +def test_transport_kind_rest(): + transport = InterconnectAttachmentGroupsClient.get_transport_class("rest")( + credentials=ga_credentials.AnonymousCredentials() + ) + assert transport.kind == "rest" + + +def test_delete_rest_bad_request( + request_type=compute.DeleteInterconnectAttachmentGroupRequest, +): + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + # send a request that will satisfy transcoding + request_init = {"project": "sample1", "interconnect_attachment_group": "sample2"} + request = request_type(**request_init) + + # Mock the http request call within the method and fake a BadRequest error. + with mock.patch.object(Session, "request") as req, pytest.raises( + core_exceptions.BadRequest + ): + # Wrap the value into a proper Response obj + response_value = mock.Mock() + json_return_value = "" + response_value.json = mock.Mock(return_value={}) + response_value.status_code = 400 + response_value.request = mock.Mock() + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + client.delete(request) + + +@pytest.mark.parametrize( + "request_type", + [ + compute.DeleteInterconnectAttachmentGroupRequest, + dict, + ], +) +def test_delete_rest_call_success(request_type): + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + + # send a request that will satisfy transcoding + request_init = {"project": "sample1", "interconnect_attachment_group": "sample2"} + request = request_type(**request_init) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = compute.Operation( + client_operation_id="client_operation_id_value", + creation_timestamp="creation_timestamp_value", + description="description_value", + end_time="end_time_value", + http_error_message="http_error_message_value", + http_error_status_code=2374, + id=205, + insert_time="insert_time_value", + kind="kind_value", + name="name_value", + operation_group_id="operation_group_id_value", + operation_type="operation_type_value", + progress=885, + region="region_value", + self_link="self_link_value", + start_time="start_time_value", + status=compute.Operation.Status.DONE, + status_message="status_message_value", + target_id=947, + target_link="target_link_value", + user="user_value", + zone="zone_value", + ) + + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.status_code = 200 + + # Convert return value to protobuf type + return_value = compute.Operation.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + response_value.content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + response = client.delete(request) + + # Establish that the response is the type that we expect. + assert isinstance(response, extended_operation.ExtendedOperation) + assert response.client_operation_id == "client_operation_id_value" + assert response.creation_timestamp == "creation_timestamp_value" + assert response.description == "description_value" + assert response.end_time == "end_time_value" + assert response.http_error_message == "http_error_message_value" + assert response.http_error_status_code == 2374 + assert response.id == 205 + assert response.insert_time == "insert_time_value" + assert response.kind == "kind_value" + assert response.name == "name_value" + assert response.operation_group_id == "operation_group_id_value" + assert response.operation_type == "operation_type_value" + assert response.progress == 885 + assert response.region == "region_value" + assert response.self_link == "self_link_value" + assert response.start_time == "start_time_value" + assert response.status == compute.Operation.Status.DONE + assert response.status_message == "status_message_value" + assert response.target_id == 947 + assert response.target_link == "target_link_value" + assert response.user == "user_value" + assert response.zone == "zone_value" + + +@pytest.mark.parametrize("null_interceptor", [True, False]) +def test_delete_rest_interceptors(null_interceptor): + transport = transports.InterconnectAttachmentGroupsRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + interceptor=None + if null_interceptor + else transports.InterconnectAttachmentGroupsRestInterceptor(), + ) + client = InterconnectAttachmentGroupsClient(transport=transport) + + with mock.patch.object( + type(client.transport._session), "request" + ) as req, mock.patch.object( + path_template, "transcode" + ) as transcode, mock.patch.object( + transports.InterconnectAttachmentGroupsRestInterceptor, "post_delete" + ) as post, mock.patch.object( + transports.InterconnectAttachmentGroupsRestInterceptor, + "post_delete_with_metadata", + ) as post_with_metadata, mock.patch.object( + transports.InterconnectAttachmentGroupsRestInterceptor, "pre_delete" + ) as pre: + pre.assert_not_called() + post.assert_not_called() + post_with_metadata.assert_not_called() + pb_message = compute.DeleteInterconnectAttachmentGroupRequest.pb( + compute.DeleteInterconnectAttachmentGroupRequest() + ) + transcode.return_value = { + "method": "post", + "uri": "my_uri", + "body": pb_message, + "query_params": pb_message, + } + + req.return_value = mock.Mock() + req.return_value.status_code = 200 + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + return_value = compute.Operation.to_json(compute.Operation()) + req.return_value.content = return_value + + request = compute.DeleteInterconnectAttachmentGroupRequest() + metadata = [ + ("key", "val"), + ("cephalopod", "squid"), + ] + pre.return_value = request, metadata + post.return_value = compute.Operation() + post_with_metadata.return_value = compute.Operation(), metadata + + client.delete( + request, + metadata=[ + ("key", "val"), + ("cephalopod", "squid"), + ], + ) + + pre.assert_called_once() + post.assert_called_once() + post_with_metadata.assert_called_once() + + +def test_get_rest_bad_request( + request_type=compute.GetInterconnectAttachmentGroupRequest, +): + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + # send a request that will satisfy transcoding + request_init = {"project": "sample1", "interconnect_attachment_group": "sample2"} + request = request_type(**request_init) + + # Mock the http request call within the method and fake a BadRequest error. + with mock.patch.object(Session, "request") as req, pytest.raises( + core_exceptions.BadRequest + ): + # Wrap the value into a proper Response obj + response_value = mock.Mock() + json_return_value = "" + response_value.json = mock.Mock(return_value={}) + response_value.status_code = 400 + response_value.request = mock.Mock() + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + client.get(request) + + +@pytest.mark.parametrize( + "request_type", + [ + compute.GetInterconnectAttachmentGroupRequest, + dict, + ], +) +def test_get_rest_call_success(request_type): + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + + # send a request that will satisfy transcoding + request_init = {"project": "sample1", "interconnect_attachment_group": "sample2"} + request = request_type(**request_init) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = compute.InterconnectAttachmentGroup( + creation_timestamp="creation_timestamp_value", + description="description_value", + etag="etag_value", + id=205, + interconnect_group="interconnect_group_value", + kind="kind_value", + name="name_value", + self_link="self_link_value", + ) + + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.status_code = 200 + + # Convert return value to protobuf type + return_value = compute.InterconnectAttachmentGroup.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + response_value.content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + response = client.get(request) + + # Establish that the response is the type that we expect. + assert isinstance(response, compute.InterconnectAttachmentGroup) + assert response.creation_timestamp == "creation_timestamp_value" + assert response.description == "description_value" + assert response.etag == "etag_value" + assert response.id == 205 + assert response.interconnect_group == "interconnect_group_value" + assert response.kind == "kind_value" + assert response.name == "name_value" + assert response.self_link == "self_link_value" + + +@pytest.mark.parametrize("null_interceptor", [True, False]) +def test_get_rest_interceptors(null_interceptor): + transport = transports.InterconnectAttachmentGroupsRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + interceptor=None + if null_interceptor + else transports.InterconnectAttachmentGroupsRestInterceptor(), + ) + client = InterconnectAttachmentGroupsClient(transport=transport) + + with mock.patch.object( + type(client.transport._session), "request" + ) as req, mock.patch.object( + path_template, "transcode" + ) as transcode, mock.patch.object( + transports.InterconnectAttachmentGroupsRestInterceptor, "post_get" + ) as post, mock.patch.object( + transports.InterconnectAttachmentGroupsRestInterceptor, "post_get_with_metadata" + ) as post_with_metadata, mock.patch.object( + transports.InterconnectAttachmentGroupsRestInterceptor, "pre_get" + ) as pre: + pre.assert_not_called() + post.assert_not_called() + post_with_metadata.assert_not_called() + pb_message = compute.GetInterconnectAttachmentGroupRequest.pb( + compute.GetInterconnectAttachmentGroupRequest() + ) + transcode.return_value = { + "method": "post", + "uri": "my_uri", + "body": pb_message, + "query_params": pb_message, + } + + req.return_value = mock.Mock() + req.return_value.status_code = 200 + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + return_value = compute.InterconnectAttachmentGroup.to_json( + compute.InterconnectAttachmentGroup() + ) + req.return_value.content = return_value + + request = compute.GetInterconnectAttachmentGroupRequest() + metadata = [ + ("key", "val"), + ("cephalopod", "squid"), + ] + pre.return_value = request, metadata + post.return_value = compute.InterconnectAttachmentGroup() + post_with_metadata.return_value = ( + compute.InterconnectAttachmentGroup(), + metadata, + ) + + client.get( + request, + metadata=[ + ("key", "val"), + ("cephalopod", "squid"), + ], + ) + + pre.assert_called_once() + post.assert_called_once() + post_with_metadata.assert_called_once() + + +def test_get_iam_policy_rest_bad_request( + request_type=compute.GetIamPolicyInterconnectAttachmentGroupRequest, +): + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + # send a request that will satisfy transcoding + request_init = {"project": "sample1", "resource": "sample2"} + request = request_type(**request_init) + + # Mock the http request call within the method and fake a BadRequest error. + with mock.patch.object(Session, "request") as req, pytest.raises( + core_exceptions.BadRequest + ): + # Wrap the value into a proper Response obj + response_value = mock.Mock() + json_return_value = "" + response_value.json = mock.Mock(return_value={}) + response_value.status_code = 400 + response_value.request = mock.Mock() + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + client.get_iam_policy(request) + + +@pytest.mark.parametrize( + "request_type", + [ + compute.GetIamPolicyInterconnectAttachmentGroupRequest, + dict, + ], +) +def test_get_iam_policy_rest_call_success(request_type): + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + + # send a request that will satisfy transcoding + request_init = {"project": "sample1", "resource": "sample2"} + request = request_type(**request_init) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = compute.Policy( + etag="etag_value", + iam_owned=True, + version=774, + ) + + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.status_code = 200 + + # Convert return value to protobuf type + return_value = compute.Policy.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + response_value.content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + response = client.get_iam_policy(request) + + # Establish that the response is the type that we expect. + assert isinstance(response, compute.Policy) + assert response.etag == "etag_value" + assert response.iam_owned is True + assert response.version == 774 + + +@pytest.mark.parametrize("null_interceptor", [True, False]) +def test_get_iam_policy_rest_interceptors(null_interceptor): + transport = transports.InterconnectAttachmentGroupsRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + interceptor=None + if null_interceptor + else transports.InterconnectAttachmentGroupsRestInterceptor(), + ) + client = InterconnectAttachmentGroupsClient(transport=transport) + + with mock.patch.object( + type(client.transport._session), "request" + ) as req, mock.patch.object( + path_template, "transcode" + ) as transcode, mock.patch.object( + transports.InterconnectAttachmentGroupsRestInterceptor, "post_get_iam_policy" + ) as post, mock.patch.object( + transports.InterconnectAttachmentGroupsRestInterceptor, + "post_get_iam_policy_with_metadata", + ) as post_with_metadata, mock.patch.object( + transports.InterconnectAttachmentGroupsRestInterceptor, "pre_get_iam_policy" + ) as pre: + pre.assert_not_called() + post.assert_not_called() + post_with_metadata.assert_not_called() + pb_message = compute.GetIamPolicyInterconnectAttachmentGroupRequest.pb( + compute.GetIamPolicyInterconnectAttachmentGroupRequest() + ) + transcode.return_value = { + "method": "post", + "uri": "my_uri", + "body": pb_message, + "query_params": pb_message, + } + + req.return_value = mock.Mock() + req.return_value.status_code = 200 + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + return_value = compute.Policy.to_json(compute.Policy()) + req.return_value.content = return_value + + request = compute.GetIamPolicyInterconnectAttachmentGroupRequest() + metadata = [ + ("key", "val"), + ("cephalopod", "squid"), + ] + pre.return_value = request, metadata + post.return_value = compute.Policy() + post_with_metadata.return_value = compute.Policy(), metadata + + client.get_iam_policy( + request, + metadata=[ + ("key", "val"), + ("cephalopod", "squid"), + ], + ) + + pre.assert_called_once() + post.assert_called_once() + post_with_metadata.assert_called_once() + + +def test_get_operational_status_rest_bad_request( + request_type=compute.GetOperationalStatusInterconnectAttachmentGroupRequest, +): + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + # send a request that will satisfy transcoding + request_init = {"project": "sample1", "interconnect_attachment_group": "sample2"} + request = request_type(**request_init) + + # Mock the http request call within the method and fake a BadRequest error. + with mock.patch.object(Session, "request") as req, pytest.raises( + core_exceptions.BadRequest + ): + # Wrap the value into a proper Response obj + response_value = mock.Mock() + json_return_value = "" + response_value.json = mock.Mock(return_value={}) + response_value.status_code = 400 + response_value.request = mock.Mock() + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + client.get_operational_status(request) + + +@pytest.mark.parametrize( + "request_type", + [ + compute.GetOperationalStatusInterconnectAttachmentGroupRequest, + dict, + ], +) +def test_get_operational_status_rest_call_success(request_type): + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + + # send a request that will satisfy transcoding + request_init = {"project": "sample1", "interconnect_attachment_group": "sample2"} + request = request_type(**request_init) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = compute.InterconnectAttachmentGroupsGetOperationalStatusResponse( + etag="etag_value", + ) + + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.status_code = 200 + + # Convert return value to protobuf type + return_value = ( + compute.InterconnectAttachmentGroupsGetOperationalStatusResponse.pb( + return_value + ) + ) + json_return_value = json_format.MessageToJson(return_value) + response_value.content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + response = client.get_operational_status(request) + + # Establish that the response is the type that we expect. + assert isinstance( + response, compute.InterconnectAttachmentGroupsGetOperationalStatusResponse + ) + assert response.etag == "etag_value" + + +@pytest.mark.parametrize("null_interceptor", [True, False]) +def test_get_operational_status_rest_interceptors(null_interceptor): + transport = transports.InterconnectAttachmentGroupsRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + interceptor=None + if null_interceptor + else transports.InterconnectAttachmentGroupsRestInterceptor(), + ) + client = InterconnectAttachmentGroupsClient(transport=transport) + + with mock.patch.object( + type(client.transport._session), "request" + ) as req, mock.patch.object( + path_template, "transcode" + ) as transcode, mock.patch.object( + transports.InterconnectAttachmentGroupsRestInterceptor, + "post_get_operational_status", + ) as post, mock.patch.object( + transports.InterconnectAttachmentGroupsRestInterceptor, + "post_get_operational_status_with_metadata", + ) as post_with_metadata, mock.patch.object( + transports.InterconnectAttachmentGroupsRestInterceptor, + "pre_get_operational_status", + ) as pre: + pre.assert_not_called() + post.assert_not_called() + post_with_metadata.assert_not_called() + pb_message = compute.GetOperationalStatusInterconnectAttachmentGroupRequest.pb( + compute.GetOperationalStatusInterconnectAttachmentGroupRequest() + ) + transcode.return_value = { + "method": "post", + "uri": "my_uri", + "body": pb_message, + "query_params": pb_message, + } + + req.return_value = mock.Mock() + req.return_value.status_code = 200 + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + return_value = ( + compute.InterconnectAttachmentGroupsGetOperationalStatusResponse.to_json( + compute.InterconnectAttachmentGroupsGetOperationalStatusResponse() + ) + ) + req.return_value.content = return_value + + request = compute.GetOperationalStatusInterconnectAttachmentGroupRequest() + metadata = [ + ("key", "val"), + ("cephalopod", "squid"), + ] + pre.return_value = request, metadata + post.return_value = ( + compute.InterconnectAttachmentGroupsGetOperationalStatusResponse() + ) + post_with_metadata.return_value = ( + compute.InterconnectAttachmentGroupsGetOperationalStatusResponse(), + metadata, + ) + + client.get_operational_status( + request, + metadata=[ + ("key", "val"), + ("cephalopod", "squid"), + ], + ) + + pre.assert_called_once() + post.assert_called_once() + post_with_metadata.assert_called_once() + + +def test_insert_rest_bad_request( + request_type=compute.InsertInterconnectAttachmentGroupRequest, +): + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + # send a request that will satisfy transcoding + request_init = {"project": "sample1"} + request = request_type(**request_init) + + # Mock the http request call within the method and fake a BadRequest error. + with mock.patch.object(Session, "request") as req, pytest.raises( + core_exceptions.BadRequest + ): + # Wrap the value into a proper Response obj + response_value = mock.Mock() + json_return_value = "" + response_value.json = mock.Mock(return_value={}) + response_value.status_code = 400 + response_value.request = mock.Mock() + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + client.insert(request) + + +@pytest.mark.parametrize( + "request_type", + [ + compute.InsertInterconnectAttachmentGroupRequest, + dict, + ], +) +def test_insert_rest_call_success(request_type): + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + + # send a request that will satisfy transcoding + request_init = {"project": "sample1"} + request_init["interconnect_attachment_group_resource"] = { + "attachments": {}, + "configured": { + "availability_sla": { + "effective_sla": "effective_sla_value", + "intended_sla_blockers": [ + { + "attachments": ["attachments_value1", "attachments_value2"], + "blocker_type": "blocker_type_value", + "documentation_link": "documentation_link_value", + "explanation": "explanation_value", + "metros": ["metros_value1", "metros_value2"], + "regions": ["regions_value1", "regions_value2"], + "zones": ["zones_value1", "zones_value2"], + } + ], + } + }, + "creation_timestamp": "creation_timestamp_value", + "description": "description_value", + "etag": "etag_value", + "id": 205, + "intent": {"availability_sla": "availability_sla_value"}, + "interconnect_group": "interconnect_group_value", + "kind": "kind_value", + "logical_structure": { + "regions": [ + { + "metros": [ + { + "facilities": [ + { + "facility": "facility_value", + "zones": [ + { + "attachments": [ + "attachments_value1", + "attachments_value2", + ], + "zone": "zone_value", + } + ], + } + ], + "metro": "metro_value", + } + ], + "region": "region_value", + } + ] + }, + "name": "name_value", + "self_link": "self_link_value", + } + # The version of a generated dependency at test runtime may differ from the version used during generation. + # Delete any fields which are not present in the current runtime dependency + # See https://github.com/googleapis/gapic-generator-python/issues/1748 + + # Determine if the message type is proto-plus or protobuf + test_field = compute.InsertInterconnectAttachmentGroupRequest.meta.fields[ + "interconnect_attachment_group_resource" + ] + + def get_message_fields(field): + # Given a field which is a message (composite type), return a list with + # all the fields of the message. + # If the field is not a composite type, return an empty list. + message_fields = [] + + if hasattr(field, "message") and field.message: + is_field_type_proto_plus_type = not hasattr(field.message, "DESCRIPTOR") + + if is_field_type_proto_plus_type: + message_fields = field.message.meta.fields.values() + # Add `# pragma: NO COVER` because there may not be any `*_pb2` field types + else: # pragma: NO COVER + message_fields = field.message.DESCRIPTOR.fields + return message_fields + + runtime_nested_fields = [ + (field.name, nested_field.name) + for field in get_message_fields(test_field) + for nested_field in get_message_fields(field) + ] + + subfields_not_in_runtime = [] + + # For each item in the sample request, create a list of sub fields which are not present at runtime + # Add `# pragma: NO COVER` because this test code will not run if all subfields are present at runtime + for field, value in request_init[ + "interconnect_attachment_group_resource" + ].items(): # pragma: NO COVER + result = None + is_repeated = False + # For repeated fields + if isinstance(value, list) and len(value): + is_repeated = True + result = value[0] + # For fields where the type is another message + if isinstance(value, dict): + result = value + + if result and hasattr(result, "keys"): + for subfield in result.keys(): + if (field, subfield) not in runtime_nested_fields: + subfields_not_in_runtime.append( + { + "field": field, + "subfield": subfield, + "is_repeated": is_repeated, + } + ) + + # Remove fields from the sample request which are not present in the runtime version of the dependency + # Add `# pragma: NO COVER` because this test code will not run if all subfields are present at runtime + for subfield_to_delete in subfields_not_in_runtime: # pragma: NO COVER + field = subfield_to_delete.get("field") + field_repeated = subfield_to_delete.get("is_repeated") + subfield = subfield_to_delete.get("subfield") + if subfield: + if field_repeated: + for i in range( + 0, + len(request_init["interconnect_attachment_group_resource"][field]), + ): + del request_init["interconnect_attachment_group_resource"][field][ + i + ][subfield] + else: + del request_init["interconnect_attachment_group_resource"][field][ + subfield + ] + request = request_type(**request_init) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = compute.Operation( + client_operation_id="client_operation_id_value", + creation_timestamp="creation_timestamp_value", + description="description_value", + end_time="end_time_value", + http_error_message="http_error_message_value", + http_error_status_code=2374, + id=205, + insert_time="insert_time_value", + kind="kind_value", + name="name_value", + operation_group_id="operation_group_id_value", + operation_type="operation_type_value", + progress=885, + region="region_value", + self_link="self_link_value", + start_time="start_time_value", + status=compute.Operation.Status.DONE, + status_message="status_message_value", + target_id=947, + target_link="target_link_value", + user="user_value", + zone="zone_value", + ) + + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.status_code = 200 + + # Convert return value to protobuf type + return_value = compute.Operation.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + response_value.content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + response = client.insert(request) + + # Establish that the response is the type that we expect. + assert isinstance(response, extended_operation.ExtendedOperation) + assert response.client_operation_id == "client_operation_id_value" + assert response.creation_timestamp == "creation_timestamp_value" + assert response.description == "description_value" + assert response.end_time == "end_time_value" + assert response.http_error_message == "http_error_message_value" + assert response.http_error_status_code == 2374 + assert response.id == 205 + assert response.insert_time == "insert_time_value" + assert response.kind == "kind_value" + assert response.name == "name_value" + assert response.operation_group_id == "operation_group_id_value" + assert response.operation_type == "operation_type_value" + assert response.progress == 885 + assert response.region == "region_value" + assert response.self_link == "self_link_value" + assert response.start_time == "start_time_value" + assert response.status == compute.Operation.Status.DONE + assert response.status_message == "status_message_value" + assert response.target_id == 947 + assert response.target_link == "target_link_value" + assert response.user == "user_value" + assert response.zone == "zone_value" + + +@pytest.mark.parametrize("null_interceptor", [True, False]) +def test_insert_rest_interceptors(null_interceptor): + transport = transports.InterconnectAttachmentGroupsRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + interceptor=None + if null_interceptor + else transports.InterconnectAttachmentGroupsRestInterceptor(), + ) + client = InterconnectAttachmentGroupsClient(transport=transport) + + with mock.patch.object( + type(client.transport._session), "request" + ) as req, mock.patch.object( + path_template, "transcode" + ) as transcode, mock.patch.object( + transports.InterconnectAttachmentGroupsRestInterceptor, "post_insert" + ) as post, mock.patch.object( + transports.InterconnectAttachmentGroupsRestInterceptor, + "post_insert_with_metadata", + ) as post_with_metadata, mock.patch.object( + transports.InterconnectAttachmentGroupsRestInterceptor, "pre_insert" + ) as pre: + pre.assert_not_called() + post.assert_not_called() + post_with_metadata.assert_not_called() + pb_message = compute.InsertInterconnectAttachmentGroupRequest.pb( + compute.InsertInterconnectAttachmentGroupRequest() + ) + transcode.return_value = { + "method": "post", + "uri": "my_uri", + "body": pb_message, + "query_params": pb_message, + } + + req.return_value = mock.Mock() + req.return_value.status_code = 200 + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + return_value = compute.Operation.to_json(compute.Operation()) + req.return_value.content = return_value + + request = compute.InsertInterconnectAttachmentGroupRequest() + metadata = [ + ("key", "val"), + ("cephalopod", "squid"), + ] + pre.return_value = request, metadata + post.return_value = compute.Operation() + post_with_metadata.return_value = compute.Operation(), metadata + + client.insert( + request, + metadata=[ + ("key", "val"), + ("cephalopod", "squid"), + ], + ) + + pre.assert_called_once() + post.assert_called_once() + post_with_metadata.assert_called_once() + + +def test_list_rest_bad_request( + request_type=compute.ListInterconnectAttachmentGroupsRequest, +): + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + # send a request that will satisfy transcoding + request_init = {"project": "sample1"} + request = request_type(**request_init) + + # Mock the http request call within the method and fake a BadRequest error. + with mock.patch.object(Session, "request") as req, pytest.raises( + core_exceptions.BadRequest + ): + # Wrap the value into a proper Response obj + response_value = mock.Mock() + json_return_value = "" + response_value.json = mock.Mock(return_value={}) + response_value.status_code = 400 + response_value.request = mock.Mock() + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + client.list(request) + + +@pytest.mark.parametrize( + "request_type", + [ + compute.ListInterconnectAttachmentGroupsRequest, + dict, + ], +) +def test_list_rest_call_success(request_type): + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + + # send a request that will satisfy transcoding + request_init = {"project": "sample1"} + request = request_type(**request_init) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = compute.InterconnectAttachmentGroupsListResponse( + etag="etag_value", + id="id_value", + kind="kind_value", + next_page_token="next_page_token_value", + self_link="self_link_value", + unreachables=["unreachables_value"], + ) + + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.status_code = 200 + + # Convert return value to protobuf type + return_value = compute.InterconnectAttachmentGroupsListResponse.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + response_value.content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + response = client.list(request) + + # Establish that the response is the type that we expect. + assert isinstance(response, pagers.ListPager) + assert response.etag == "etag_value" + assert response.id == "id_value" + assert response.kind == "kind_value" + assert response.next_page_token == "next_page_token_value" + assert response.self_link == "self_link_value" + assert response.unreachables == ["unreachables_value"] + + +@pytest.mark.parametrize("null_interceptor", [True, False]) +def test_list_rest_interceptors(null_interceptor): + transport = transports.InterconnectAttachmentGroupsRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + interceptor=None + if null_interceptor + else transports.InterconnectAttachmentGroupsRestInterceptor(), + ) + client = InterconnectAttachmentGroupsClient(transport=transport) + + with mock.patch.object( + type(client.transport._session), "request" + ) as req, mock.patch.object( + path_template, "transcode" + ) as transcode, mock.patch.object( + transports.InterconnectAttachmentGroupsRestInterceptor, "post_list" + ) as post, mock.patch.object( + transports.InterconnectAttachmentGroupsRestInterceptor, + "post_list_with_metadata", + ) as post_with_metadata, mock.patch.object( + transports.InterconnectAttachmentGroupsRestInterceptor, "pre_list" + ) as pre: + pre.assert_not_called() + post.assert_not_called() + post_with_metadata.assert_not_called() + pb_message = compute.ListInterconnectAttachmentGroupsRequest.pb( + compute.ListInterconnectAttachmentGroupsRequest() + ) + transcode.return_value = { + "method": "post", + "uri": "my_uri", + "body": pb_message, + "query_params": pb_message, + } + + req.return_value = mock.Mock() + req.return_value.status_code = 200 + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + return_value = compute.InterconnectAttachmentGroupsListResponse.to_json( + compute.InterconnectAttachmentGroupsListResponse() + ) + req.return_value.content = return_value + + request = compute.ListInterconnectAttachmentGroupsRequest() + metadata = [ + ("key", "val"), + ("cephalopod", "squid"), + ] + pre.return_value = request, metadata + post.return_value = compute.InterconnectAttachmentGroupsListResponse() + post_with_metadata.return_value = ( + compute.InterconnectAttachmentGroupsListResponse(), + metadata, + ) + + client.list( + request, + metadata=[ + ("key", "val"), + ("cephalopod", "squid"), + ], + ) + + pre.assert_called_once() + post.assert_called_once() + post_with_metadata.assert_called_once() + + +def test_patch_rest_bad_request( + request_type=compute.PatchInterconnectAttachmentGroupRequest, +): + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + # send a request that will satisfy transcoding + request_init = {"project": "sample1", "interconnect_attachment_group": "sample2"} + request = request_type(**request_init) + + # Mock the http request call within the method and fake a BadRequest error. + with mock.patch.object(Session, "request") as req, pytest.raises( + core_exceptions.BadRequest + ): + # Wrap the value into a proper Response obj + response_value = mock.Mock() + json_return_value = "" + response_value.json = mock.Mock(return_value={}) + response_value.status_code = 400 + response_value.request = mock.Mock() + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + client.patch(request) + + +@pytest.mark.parametrize( + "request_type", + [ + compute.PatchInterconnectAttachmentGroupRequest, + dict, + ], +) +def test_patch_rest_call_success(request_type): + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + + # send a request that will satisfy transcoding + request_init = {"project": "sample1", "interconnect_attachment_group": "sample2"} + request_init["interconnect_attachment_group_resource"] = { + "attachments": {}, + "configured": { + "availability_sla": { + "effective_sla": "effective_sla_value", + "intended_sla_blockers": [ + { + "attachments": ["attachments_value1", "attachments_value2"], + "blocker_type": "blocker_type_value", + "documentation_link": "documentation_link_value", + "explanation": "explanation_value", + "metros": ["metros_value1", "metros_value2"], + "regions": ["regions_value1", "regions_value2"], + "zones": ["zones_value1", "zones_value2"], + } + ], + } + }, + "creation_timestamp": "creation_timestamp_value", + "description": "description_value", + "etag": "etag_value", + "id": 205, + "intent": {"availability_sla": "availability_sla_value"}, + "interconnect_group": "interconnect_group_value", + "kind": "kind_value", + "logical_structure": { + "regions": [ + { + "metros": [ + { + "facilities": [ + { + "facility": "facility_value", + "zones": [ + { + "attachments": [ + "attachments_value1", + "attachments_value2", + ], + "zone": "zone_value", + } + ], + } + ], + "metro": "metro_value", + } + ], + "region": "region_value", + } + ] + }, + "name": "name_value", + "self_link": "self_link_value", + } + # The version of a generated dependency at test runtime may differ from the version used during generation. + # Delete any fields which are not present in the current runtime dependency + # See https://github.com/googleapis/gapic-generator-python/issues/1748 + + # Determine if the message type is proto-plus or protobuf + test_field = compute.PatchInterconnectAttachmentGroupRequest.meta.fields[ + "interconnect_attachment_group_resource" + ] + + def get_message_fields(field): + # Given a field which is a message (composite type), return a list with + # all the fields of the message. + # If the field is not a composite type, return an empty list. + message_fields = [] + + if hasattr(field, "message") and field.message: + is_field_type_proto_plus_type = not hasattr(field.message, "DESCRIPTOR") + + if is_field_type_proto_plus_type: + message_fields = field.message.meta.fields.values() + # Add `# pragma: NO COVER` because there may not be any `*_pb2` field types + else: # pragma: NO COVER + message_fields = field.message.DESCRIPTOR.fields + return message_fields + + runtime_nested_fields = [ + (field.name, nested_field.name) + for field in get_message_fields(test_field) + for nested_field in get_message_fields(field) + ] + + subfields_not_in_runtime = [] + + # For each item in the sample request, create a list of sub fields which are not present at runtime + # Add `# pragma: NO COVER` because this test code will not run if all subfields are present at runtime + for field, value in request_init[ + "interconnect_attachment_group_resource" + ].items(): # pragma: NO COVER + result = None + is_repeated = False + # For repeated fields + if isinstance(value, list) and len(value): + is_repeated = True + result = value[0] + # For fields where the type is another message + if isinstance(value, dict): + result = value + + if result and hasattr(result, "keys"): + for subfield in result.keys(): + if (field, subfield) not in runtime_nested_fields: + subfields_not_in_runtime.append( + { + "field": field, + "subfield": subfield, + "is_repeated": is_repeated, + } + ) + + # Remove fields from the sample request which are not present in the runtime version of the dependency + # Add `# pragma: NO COVER` because this test code will not run if all subfields are present at runtime + for subfield_to_delete in subfields_not_in_runtime: # pragma: NO COVER + field = subfield_to_delete.get("field") + field_repeated = subfield_to_delete.get("is_repeated") + subfield = subfield_to_delete.get("subfield") + if subfield: + if field_repeated: + for i in range( + 0, + len(request_init["interconnect_attachment_group_resource"][field]), + ): + del request_init["interconnect_attachment_group_resource"][field][ + i + ][subfield] + else: + del request_init["interconnect_attachment_group_resource"][field][ + subfield + ] + request = request_type(**request_init) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = compute.Operation( + client_operation_id="client_operation_id_value", + creation_timestamp="creation_timestamp_value", + description="description_value", + end_time="end_time_value", + http_error_message="http_error_message_value", + http_error_status_code=2374, + id=205, + insert_time="insert_time_value", + kind="kind_value", + name="name_value", + operation_group_id="operation_group_id_value", + operation_type="operation_type_value", + progress=885, + region="region_value", + self_link="self_link_value", + start_time="start_time_value", + status=compute.Operation.Status.DONE, + status_message="status_message_value", + target_id=947, + target_link="target_link_value", + user="user_value", + zone="zone_value", + ) + + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.status_code = 200 + + # Convert return value to protobuf type + return_value = compute.Operation.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + response_value.content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + response = client.patch(request) + + # Establish that the response is the type that we expect. + assert isinstance(response, extended_operation.ExtendedOperation) + assert response.client_operation_id == "client_operation_id_value" + assert response.creation_timestamp == "creation_timestamp_value" + assert response.description == "description_value" + assert response.end_time == "end_time_value" + assert response.http_error_message == "http_error_message_value" + assert response.http_error_status_code == 2374 + assert response.id == 205 + assert response.insert_time == "insert_time_value" + assert response.kind == "kind_value" + assert response.name == "name_value" + assert response.operation_group_id == "operation_group_id_value" + assert response.operation_type == "operation_type_value" + assert response.progress == 885 + assert response.region == "region_value" + assert response.self_link == "self_link_value" + assert response.start_time == "start_time_value" + assert response.status == compute.Operation.Status.DONE + assert response.status_message == "status_message_value" + assert response.target_id == 947 + assert response.target_link == "target_link_value" + assert response.user == "user_value" + assert response.zone == "zone_value" + + +@pytest.mark.parametrize("null_interceptor", [True, False]) +def test_patch_rest_interceptors(null_interceptor): + transport = transports.InterconnectAttachmentGroupsRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + interceptor=None + if null_interceptor + else transports.InterconnectAttachmentGroupsRestInterceptor(), + ) + client = InterconnectAttachmentGroupsClient(transport=transport) + + with mock.patch.object( + type(client.transport._session), "request" + ) as req, mock.patch.object( + path_template, "transcode" + ) as transcode, mock.patch.object( + transports.InterconnectAttachmentGroupsRestInterceptor, "post_patch" + ) as post, mock.patch.object( + transports.InterconnectAttachmentGroupsRestInterceptor, + "post_patch_with_metadata", + ) as post_with_metadata, mock.patch.object( + transports.InterconnectAttachmentGroupsRestInterceptor, "pre_patch" + ) as pre: + pre.assert_not_called() + post.assert_not_called() + post_with_metadata.assert_not_called() + pb_message = compute.PatchInterconnectAttachmentGroupRequest.pb( + compute.PatchInterconnectAttachmentGroupRequest() + ) + transcode.return_value = { + "method": "post", + "uri": "my_uri", + "body": pb_message, + "query_params": pb_message, + } + + req.return_value = mock.Mock() + req.return_value.status_code = 200 + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + return_value = compute.Operation.to_json(compute.Operation()) + req.return_value.content = return_value + + request = compute.PatchInterconnectAttachmentGroupRequest() + metadata = [ + ("key", "val"), + ("cephalopod", "squid"), + ] + pre.return_value = request, metadata + post.return_value = compute.Operation() + post_with_metadata.return_value = compute.Operation(), metadata + + client.patch( + request, + metadata=[ + ("key", "val"), + ("cephalopod", "squid"), + ], + ) + + pre.assert_called_once() + post.assert_called_once() + post_with_metadata.assert_called_once() + + +def test_set_iam_policy_rest_bad_request( + request_type=compute.SetIamPolicyInterconnectAttachmentGroupRequest, +): + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + # send a request that will satisfy transcoding + request_init = {"project": "sample1", "resource": "sample2"} + request = request_type(**request_init) + + # Mock the http request call within the method and fake a BadRequest error. + with mock.patch.object(Session, "request") as req, pytest.raises( + core_exceptions.BadRequest + ): + # Wrap the value into a proper Response obj + response_value = mock.Mock() + json_return_value = "" + response_value.json = mock.Mock(return_value={}) + response_value.status_code = 400 + response_value.request = mock.Mock() + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + client.set_iam_policy(request) + + +@pytest.mark.parametrize( + "request_type", + [ + compute.SetIamPolicyInterconnectAttachmentGroupRequest, + dict, + ], +) +def test_set_iam_policy_rest_call_success(request_type): + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + + # send a request that will satisfy transcoding + request_init = {"project": "sample1", "resource": "sample2"} + request_init["global_set_policy_request_resource"] = { + "bindings": [ + { + "binding_id": "binding_id_value", + "condition": { + "description": "description_value", + "expression": "expression_value", + "location": "location_value", + "title": "title_value", + }, + "members": ["members_value1", "members_value2"], + "role": "role_value", + } + ], + "etag": "etag_value", + "policy": { + "audit_configs": [ + { + "audit_log_configs": [ + { + "exempted_members": [ + "exempted_members_value1", + "exempted_members_value2", + ], + "ignore_child_exemptions": True, + "log_type": "log_type_value", + } + ], + "exempted_members": [ + "exempted_members_value1", + "exempted_members_value2", + ], + "service": "service_value", + } + ], + "bindings": {}, + "etag": "etag_value", + "iam_owned": True, + "version": 774, + }, + } + # The version of a generated dependency at test runtime may differ from the version used during generation. + # Delete any fields which are not present in the current runtime dependency + # See https://github.com/googleapis/gapic-generator-python/issues/1748 + + # Determine if the message type is proto-plus or protobuf + test_field = compute.SetIamPolicyInterconnectAttachmentGroupRequest.meta.fields[ + "global_set_policy_request_resource" + ] + + def get_message_fields(field): + # Given a field which is a message (composite type), return a list with + # all the fields of the message. + # If the field is not a composite type, return an empty list. + message_fields = [] + + if hasattr(field, "message") and field.message: + is_field_type_proto_plus_type = not hasattr(field.message, "DESCRIPTOR") + + if is_field_type_proto_plus_type: + message_fields = field.message.meta.fields.values() + # Add `# pragma: NO COVER` because there may not be any `*_pb2` field types + else: # pragma: NO COVER + message_fields = field.message.DESCRIPTOR.fields + return message_fields + + runtime_nested_fields = [ + (field.name, nested_field.name) + for field in get_message_fields(test_field) + for nested_field in get_message_fields(field) + ] + + subfields_not_in_runtime = [] + + # For each item in the sample request, create a list of sub fields which are not present at runtime + # Add `# pragma: NO COVER` because this test code will not run if all subfields are present at runtime + for field, value in request_init[ + "global_set_policy_request_resource" + ].items(): # pragma: NO COVER + result = None + is_repeated = False + # For repeated fields + if isinstance(value, list) and len(value): + is_repeated = True + result = value[0] + # For fields where the type is another message + if isinstance(value, dict): + result = value + + if result and hasattr(result, "keys"): + for subfield in result.keys(): + if (field, subfield) not in runtime_nested_fields: + subfields_not_in_runtime.append( + { + "field": field, + "subfield": subfield, + "is_repeated": is_repeated, + } + ) + + # Remove fields from the sample request which are not present in the runtime version of the dependency + # Add `# pragma: NO COVER` because this test code will not run if all subfields are present at runtime + for subfield_to_delete in subfields_not_in_runtime: # pragma: NO COVER + field = subfield_to_delete.get("field") + field_repeated = subfield_to_delete.get("is_repeated") + subfield = subfield_to_delete.get("subfield") + if subfield: + if field_repeated: + for i in range( + 0, len(request_init["global_set_policy_request_resource"][field]) + ): + del request_init["global_set_policy_request_resource"][field][i][ + subfield + ] + else: + del request_init["global_set_policy_request_resource"][field][subfield] + request = request_type(**request_init) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = compute.Policy( + etag="etag_value", + iam_owned=True, + version=774, + ) + + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.status_code = 200 + + # Convert return value to protobuf type + return_value = compute.Policy.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + response_value.content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + response = client.set_iam_policy(request) + + # Establish that the response is the type that we expect. + assert isinstance(response, compute.Policy) + assert response.etag == "etag_value" + assert response.iam_owned is True + assert response.version == 774 + + +@pytest.mark.parametrize("null_interceptor", [True, False]) +def test_set_iam_policy_rest_interceptors(null_interceptor): + transport = transports.InterconnectAttachmentGroupsRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + interceptor=None + if null_interceptor + else transports.InterconnectAttachmentGroupsRestInterceptor(), + ) + client = InterconnectAttachmentGroupsClient(transport=transport) + + with mock.patch.object( + type(client.transport._session), "request" + ) as req, mock.patch.object( + path_template, "transcode" + ) as transcode, mock.patch.object( + transports.InterconnectAttachmentGroupsRestInterceptor, "post_set_iam_policy" + ) as post, mock.patch.object( + transports.InterconnectAttachmentGroupsRestInterceptor, + "post_set_iam_policy_with_metadata", + ) as post_with_metadata, mock.patch.object( + transports.InterconnectAttachmentGroupsRestInterceptor, "pre_set_iam_policy" + ) as pre: + pre.assert_not_called() + post.assert_not_called() + post_with_metadata.assert_not_called() + pb_message = compute.SetIamPolicyInterconnectAttachmentGroupRequest.pb( + compute.SetIamPolicyInterconnectAttachmentGroupRequest() + ) + transcode.return_value = { + "method": "post", + "uri": "my_uri", + "body": pb_message, + "query_params": pb_message, + } + + req.return_value = mock.Mock() + req.return_value.status_code = 200 + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + return_value = compute.Policy.to_json(compute.Policy()) + req.return_value.content = return_value + + request = compute.SetIamPolicyInterconnectAttachmentGroupRequest() + metadata = [ + ("key", "val"), + ("cephalopod", "squid"), + ] + pre.return_value = request, metadata + post.return_value = compute.Policy() + post_with_metadata.return_value = compute.Policy(), metadata + + client.set_iam_policy( + request, + metadata=[ + ("key", "val"), + ("cephalopod", "squid"), + ], + ) + + pre.assert_called_once() + post.assert_called_once() + post_with_metadata.assert_called_once() + + +def test_test_iam_permissions_rest_bad_request( + request_type=compute.TestIamPermissionsInterconnectAttachmentGroupRequest, +): + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + # send a request that will satisfy transcoding + request_init = {"project": "sample1", "resource": "sample2"} + request = request_type(**request_init) + + # Mock the http request call within the method and fake a BadRequest error. + with mock.patch.object(Session, "request") as req, pytest.raises( + core_exceptions.BadRequest + ): + # Wrap the value into a proper Response obj + response_value = mock.Mock() + json_return_value = "" + response_value.json = mock.Mock(return_value={}) + response_value.status_code = 400 + response_value.request = mock.Mock() + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + client.test_iam_permissions(request) + + +@pytest.mark.parametrize( + "request_type", + [ + compute.TestIamPermissionsInterconnectAttachmentGroupRequest, + dict, + ], +) +def test_test_iam_permissions_rest_call_success(request_type): + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + + # send a request that will satisfy transcoding + request_init = {"project": "sample1", "resource": "sample2"} + request_init["test_permissions_request_resource"] = { + "permissions": ["permissions_value1", "permissions_value2"] + } + # The version of a generated dependency at test runtime may differ from the version used during generation. + # Delete any fields which are not present in the current runtime dependency + # See https://github.com/googleapis/gapic-generator-python/issues/1748 + + # Determine if the message type is proto-plus or protobuf + test_field = ( + compute.TestIamPermissionsInterconnectAttachmentGroupRequest.meta.fields[ + "test_permissions_request_resource" + ] + ) + + def get_message_fields(field): + # Given a field which is a message (composite type), return a list with + # all the fields of the message. + # If the field is not a composite type, return an empty list. + message_fields = [] + + if hasattr(field, "message") and field.message: + is_field_type_proto_plus_type = not hasattr(field.message, "DESCRIPTOR") + + if is_field_type_proto_plus_type: + message_fields = field.message.meta.fields.values() + # Add `# pragma: NO COVER` because there may not be any `*_pb2` field types + else: # pragma: NO COVER + message_fields = field.message.DESCRIPTOR.fields + return message_fields + + runtime_nested_fields = [ + (field.name, nested_field.name) + for field in get_message_fields(test_field) + for nested_field in get_message_fields(field) + ] + + subfields_not_in_runtime = [] + + # For each item in the sample request, create a list of sub fields which are not present at runtime + # Add `# pragma: NO COVER` because this test code will not run if all subfields are present at runtime + for field, value in request_init[ + "test_permissions_request_resource" + ].items(): # pragma: NO COVER + result = None + is_repeated = False + # For repeated fields + if isinstance(value, list) and len(value): + is_repeated = True + result = value[0] + # For fields where the type is another message + if isinstance(value, dict): + result = value + + if result and hasattr(result, "keys"): + for subfield in result.keys(): + if (field, subfield) not in runtime_nested_fields: + subfields_not_in_runtime.append( + { + "field": field, + "subfield": subfield, + "is_repeated": is_repeated, + } + ) + + # Remove fields from the sample request which are not present in the runtime version of the dependency + # Add `# pragma: NO COVER` because this test code will not run if all subfields are present at runtime + for subfield_to_delete in subfields_not_in_runtime: # pragma: NO COVER + field = subfield_to_delete.get("field") + field_repeated = subfield_to_delete.get("is_repeated") + subfield = subfield_to_delete.get("subfield") + if subfield: + if field_repeated: + for i in range( + 0, len(request_init["test_permissions_request_resource"][field]) + ): + del request_init["test_permissions_request_resource"][field][i][ + subfield + ] + else: + del request_init["test_permissions_request_resource"][field][subfield] + request = request_type(**request_init) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = compute.TestPermissionsResponse( + permissions=["permissions_value"], + ) + + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.status_code = 200 + + # Convert return value to protobuf type + return_value = compute.TestPermissionsResponse.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + response_value.content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + response = client.test_iam_permissions(request) + + # Establish that the response is the type that we expect. + assert isinstance(response, compute.TestPermissionsResponse) + assert response.permissions == ["permissions_value"] + + +@pytest.mark.parametrize("null_interceptor", [True, False]) +def test_test_iam_permissions_rest_interceptors(null_interceptor): + transport = transports.InterconnectAttachmentGroupsRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + interceptor=None + if null_interceptor + else transports.InterconnectAttachmentGroupsRestInterceptor(), + ) + client = InterconnectAttachmentGroupsClient(transport=transport) + + with mock.patch.object( + type(client.transport._session), "request" + ) as req, mock.patch.object( + path_template, "transcode" + ) as transcode, mock.patch.object( + transports.InterconnectAttachmentGroupsRestInterceptor, + "post_test_iam_permissions", + ) as post, mock.patch.object( + transports.InterconnectAttachmentGroupsRestInterceptor, + "post_test_iam_permissions_with_metadata", + ) as post_with_metadata, mock.patch.object( + transports.InterconnectAttachmentGroupsRestInterceptor, + "pre_test_iam_permissions", + ) as pre: + pre.assert_not_called() + post.assert_not_called() + post_with_metadata.assert_not_called() + pb_message = compute.TestIamPermissionsInterconnectAttachmentGroupRequest.pb( + compute.TestIamPermissionsInterconnectAttachmentGroupRequest() + ) + transcode.return_value = { + "method": "post", + "uri": "my_uri", + "body": pb_message, + "query_params": pb_message, + } + + req.return_value = mock.Mock() + req.return_value.status_code = 200 + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + return_value = compute.TestPermissionsResponse.to_json( + compute.TestPermissionsResponse() + ) + req.return_value.content = return_value + + request = compute.TestIamPermissionsInterconnectAttachmentGroupRequest() + metadata = [ + ("key", "val"), + ("cephalopod", "squid"), + ] + pre.return_value = request, metadata + post.return_value = compute.TestPermissionsResponse() + post_with_metadata.return_value = compute.TestPermissionsResponse(), metadata + + client.test_iam_permissions( + request, + metadata=[ + ("key", "val"), + ("cephalopod", "squid"), + ], + ) + + pre.assert_called_once() + post.assert_called_once() + post_with_metadata.assert_called_once() + + +def test_initialize_client_w_rest(): + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + assert client is not None + + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_delete_unary_empty_call_rest(): + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object(type(client.transport.delete), "__call__") as call: + client.delete_unary(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = compute.DeleteInterconnectAttachmentGroupRequest() + + assert args[0] == request_msg + + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_get_empty_call_rest(): + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object(type(client.transport.get), "__call__") as call: + client.get(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = compute.GetInterconnectAttachmentGroupRequest() + + assert args[0] == request_msg + + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_get_iam_policy_empty_call_rest(): + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object(type(client.transport.get_iam_policy), "__call__") as call: + client.get_iam_policy(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = compute.GetIamPolicyInterconnectAttachmentGroupRequest() + + assert args[0] == request_msg + + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_get_operational_status_empty_call_rest(): + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object( + type(client.transport.get_operational_status), "__call__" + ) as call: + client.get_operational_status(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = compute.GetOperationalStatusInterconnectAttachmentGroupRequest() + + assert args[0] == request_msg + + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_insert_unary_empty_call_rest(): + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object(type(client.transport.insert), "__call__") as call: + client.insert_unary(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = compute.InsertInterconnectAttachmentGroupRequest() + + assert args[0] == request_msg + + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_list_empty_call_rest(): + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object(type(client.transport.list), "__call__") as call: + client.list(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = compute.ListInterconnectAttachmentGroupsRequest() + + assert args[0] == request_msg + + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_patch_unary_empty_call_rest(): + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object(type(client.transport.patch), "__call__") as call: + client.patch_unary(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = compute.PatchInterconnectAttachmentGroupRequest() + + assert args[0] == request_msg + + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_set_iam_policy_empty_call_rest(): + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object(type(client.transport.set_iam_policy), "__call__") as call: + client.set_iam_policy(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = compute.SetIamPolicyInterconnectAttachmentGroupRequest() + + assert args[0] == request_msg + + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_test_iam_permissions_empty_call_rest(): + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object( + type(client.transport.test_iam_permissions), "__call__" + ) as call: + client.test_iam_permissions(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = compute.TestIamPermissionsInterconnectAttachmentGroupRequest() + + assert args[0] == request_msg + + +def test_interconnect_attachment_groups_base_transport_error(): + # Passing both a credentials object and credentials_file should raise an error + with pytest.raises(core_exceptions.DuplicateCredentialArgs): + transport = transports.InterconnectAttachmentGroupsTransport( + credentials=ga_credentials.AnonymousCredentials(), + credentials_file="credentials.json", + ) + + +def test_interconnect_attachment_groups_base_transport(): + # Instantiate the base transport. + with mock.patch( + "google.cloud.compute_v1.services.interconnect_attachment_groups.transports.InterconnectAttachmentGroupsTransport.__init__" + ) as Transport: + Transport.return_value = None + transport = transports.InterconnectAttachmentGroupsTransport( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Every method on the transport should just blindly + # raise NotImplementedError. + methods = ( + "delete", + "get", + "get_iam_policy", + "get_operational_status", + "insert", + "list", + "patch", + "set_iam_policy", + "test_iam_permissions", + ) + for method in methods: + with pytest.raises(NotImplementedError): + getattr(transport, method)(request=object()) + + with pytest.raises(NotImplementedError): + transport.close() + + # Catch all for all remaining methods and properties + remainder = [ + "kind", + ] + for r in remainder: + with pytest.raises(NotImplementedError): + getattr(transport, r)() + + +def test_interconnect_attachment_groups_base_transport_with_credentials_file(): + # Instantiate the base transport with a credentials file + with mock.patch.object( + google.auth, "load_credentials_from_file", autospec=True + ) as load_creds, mock.patch( + "google.cloud.compute_v1.services.interconnect_attachment_groups.transports.InterconnectAttachmentGroupsTransport._prep_wrapped_messages" + ) as Transport: + Transport.return_value = None + load_creds.return_value = (ga_credentials.AnonymousCredentials(), None) + transport = transports.InterconnectAttachmentGroupsTransport( + credentials_file="credentials.json", + quota_project_id="octopus", + ) + load_creds.assert_called_once_with( + "credentials.json", + scopes=None, + default_scopes=( + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/cloud-platform", + ), + quota_project_id="octopus", + ) + + +def test_interconnect_attachment_groups_base_transport_with_adc(): + # Test the default credentials are used if credentials and credentials_file are None. + with mock.patch.object(google.auth, "default", autospec=True) as adc, mock.patch( + "google.cloud.compute_v1.services.interconnect_attachment_groups.transports.InterconnectAttachmentGroupsTransport._prep_wrapped_messages" + ) as Transport: + Transport.return_value = None + adc.return_value = (ga_credentials.AnonymousCredentials(), None) + transport = transports.InterconnectAttachmentGroupsTransport() + adc.assert_called_once() + + +def test_interconnect_attachment_groups_auth_adc(): + # If no credentials are provided, we should use ADC credentials. + with mock.patch.object(google.auth, "default", autospec=True) as adc: + adc.return_value = (ga_credentials.AnonymousCredentials(), None) + InterconnectAttachmentGroupsClient() + adc.assert_called_once_with( + scopes=None, + default_scopes=( + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/cloud-platform", + ), + quota_project_id=None, + ) + + +def test_interconnect_attachment_groups_http_transport_client_cert_source_for_mtls(): + cred = ga_credentials.AnonymousCredentials() + with mock.patch( + "google.auth.transport.requests.AuthorizedSession.configure_mtls_channel" + ) as mock_configure_mtls_channel: + transports.InterconnectAttachmentGroupsRestTransport( + credentials=cred, client_cert_source_for_mtls=client_cert_source_callback + ) + mock_configure_mtls_channel.assert_called_once_with(client_cert_source_callback) + + +@pytest.mark.parametrize( + "transport_name", + [ + "rest", + ], +) +def test_interconnect_attachment_groups_host_no_port(transport_name): + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + client_options=client_options.ClientOptions( + api_endpoint="compute.googleapis.com" + ), + transport=transport_name, + ) + assert client.transport._host == ( + "compute.googleapis.com:443" + if transport_name in ["grpc", "grpc_asyncio"] + else "https://compute.googleapis.com" + ) + + +@pytest.mark.parametrize( + "transport_name", + [ + "rest", + ], +) +def test_interconnect_attachment_groups_host_with_port(transport_name): + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + client_options=client_options.ClientOptions( + api_endpoint="compute.googleapis.com:8000" + ), + transport=transport_name, + ) + assert client.transport._host == ( + "compute.googleapis.com:8000" + if transport_name in ["grpc", "grpc_asyncio"] + else "https://compute.googleapis.com:8000" + ) + + +@pytest.mark.parametrize( + "transport_name", + [ + "rest", + ], +) +def test_interconnect_attachment_groups_client_transport_session_collision( + transport_name, +): + creds1 = ga_credentials.AnonymousCredentials() + creds2 = ga_credentials.AnonymousCredentials() + client1 = InterconnectAttachmentGroupsClient( + credentials=creds1, + transport=transport_name, + ) + client2 = InterconnectAttachmentGroupsClient( + credentials=creds2, + transport=transport_name, + ) + session1 = client1.transport.delete._session + session2 = client2.transport.delete._session + assert session1 != session2 + session1 = client1.transport.get._session + session2 = client2.transport.get._session + assert session1 != session2 + session1 = client1.transport.get_iam_policy._session + session2 = client2.transport.get_iam_policy._session + assert session1 != session2 + session1 = client1.transport.get_operational_status._session + session2 = client2.transport.get_operational_status._session + assert session1 != session2 + session1 = client1.transport.insert._session + session2 = client2.transport.insert._session + assert session1 != session2 + session1 = client1.transport.list._session + session2 = client2.transport.list._session + assert session1 != session2 + session1 = client1.transport.patch._session + session2 = client2.transport.patch._session + assert session1 != session2 + session1 = client1.transport.set_iam_policy._session + session2 = client2.transport.set_iam_policy._session + assert session1 != session2 + session1 = client1.transport.test_iam_permissions._session + session2 = client2.transport.test_iam_permissions._session + assert session1 != session2 + + +def test_common_billing_account_path(): + billing_account = "squid" + expected = "billingAccounts/{billing_account}".format( + billing_account=billing_account, + ) + actual = InterconnectAttachmentGroupsClient.common_billing_account_path( + billing_account + ) + assert expected == actual + + +def test_parse_common_billing_account_path(): + expected = { + "billing_account": "clam", + } + path = InterconnectAttachmentGroupsClient.common_billing_account_path(**expected) + + # Check that the path construction is reversible. + actual = InterconnectAttachmentGroupsClient.parse_common_billing_account_path(path) + assert expected == actual + + +def test_common_folder_path(): + folder = "whelk" + expected = "folders/{folder}".format( + folder=folder, + ) + actual = InterconnectAttachmentGroupsClient.common_folder_path(folder) + assert expected == actual + + +def test_parse_common_folder_path(): + expected = { + "folder": "octopus", + } + path = InterconnectAttachmentGroupsClient.common_folder_path(**expected) + + # Check that the path construction is reversible. + actual = InterconnectAttachmentGroupsClient.parse_common_folder_path(path) + assert expected == actual + + +def test_common_organization_path(): + organization = "oyster" + expected = "organizations/{organization}".format( + organization=organization, + ) + actual = InterconnectAttachmentGroupsClient.common_organization_path(organization) + assert expected == actual + + +def test_parse_common_organization_path(): + expected = { + "organization": "nudibranch", + } + path = InterconnectAttachmentGroupsClient.common_organization_path(**expected) + + # Check that the path construction is reversible. + actual = InterconnectAttachmentGroupsClient.parse_common_organization_path(path) + assert expected == actual + + +def test_common_project_path(): + project = "cuttlefish" + expected = "projects/{project}".format( + project=project, + ) + actual = InterconnectAttachmentGroupsClient.common_project_path(project) + assert expected == actual + + +def test_parse_common_project_path(): + expected = { + "project": "mussel", + } + path = InterconnectAttachmentGroupsClient.common_project_path(**expected) + + # Check that the path construction is reversible. + actual = InterconnectAttachmentGroupsClient.parse_common_project_path(path) + assert expected == actual + + +def test_common_location_path(): + project = "winkle" + location = "nautilus" + expected = "projects/{project}/locations/{location}".format( + project=project, + location=location, + ) + actual = InterconnectAttachmentGroupsClient.common_location_path(project, location) + assert expected == actual + + +def test_parse_common_location_path(): + expected = { + "project": "scallop", + "location": "abalone", + } + path = InterconnectAttachmentGroupsClient.common_location_path(**expected) + + # Check that the path construction is reversible. + actual = InterconnectAttachmentGroupsClient.parse_common_location_path(path) + assert expected == actual + + +def test_client_with_default_client_info(): + client_info = gapic_v1.client_info.ClientInfo() + + with mock.patch.object( + transports.InterconnectAttachmentGroupsTransport, "_prep_wrapped_messages" + ) as prep: + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + client_info=client_info, + ) + prep.assert_called_once_with(client_info) + + with mock.patch.object( + transports.InterconnectAttachmentGroupsTransport, "_prep_wrapped_messages" + ) as prep: + transport_class = InterconnectAttachmentGroupsClient.get_transport_class() + transport = transport_class( + credentials=ga_credentials.AnonymousCredentials(), + client_info=client_info, + ) + prep.assert_called_once_with(client_info) + + +def test_transport_close_rest(): + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + with mock.patch.object( + type(getattr(client.transport, "_session")), "close" + ) as close: + with client: + close.assert_not_called() + close.assert_called_once() + + +def test_client_ctx(): + transports = [ + "rest", + ] + for transport in transports: + client = InterconnectAttachmentGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), transport=transport + ) + # Test client calls underlying transport. + with mock.patch.object(type(client.transport), "close") as close: + close.assert_not_called() + with client: + pass + close.assert_called() + + +@pytest.mark.parametrize( + "client_class,transport_class", + [ + ( + InterconnectAttachmentGroupsClient, + transports.InterconnectAttachmentGroupsRestTransport, + ), + ], +) +def test_api_key_credentials(client_class, transport_class): + with mock.patch.object( + google.auth._default, "get_api_key_credentials", create=True + ) as get_api_key_credentials: + mock_cred = mock.Mock() + get_api_key_credentials.return_value = mock_cred + options = client_options.ClientOptions() + options.api_key = "api_key" + with mock.patch.object(transport_class, "__init__") as patched: + patched.return_value = None + client = client_class(client_options=options) + patched.assert_called_once_with( + credentials=mock_cred, + credentials_file=None, + host=client._DEFAULT_ENDPOINT_TEMPLATE.format( + UNIVERSE_DOMAIN=client._DEFAULT_UNIVERSE + ), + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + api_audience=None, + ) diff --git a/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_interconnect_attachments.py b/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_interconnect_attachments.py index 60a7d71f1fbd..d5882ce6a501 100644 --- a/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_interconnect_attachments.py +++ b/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_interconnect_attachments.py @@ -3932,6 +3932,7 @@ def test_get_rest_call_success(request_type): # Designate an appropriate value for the returned response. return_value = compute.InterconnectAttachment( admin_enabled=True, + attachment_group="attachment_group_value", bandwidth="bandwidth_value", candidate_ipv6_subnets=["candidate_ipv6_subnets_value"], candidate_subnets=["candidate_subnets_value"], @@ -3984,6 +3985,7 @@ def test_get_rest_call_success(request_type): # Establish that the response is the type that we expect. assert isinstance(response, compute.InterconnectAttachment) assert response.admin_enabled is True + assert response.attachment_group == "attachment_group_value" assert response.bandwidth == "bandwidth_value" assert response.candidate_ipv6_subnets == ["candidate_ipv6_subnets_value"] assert response.candidate_subnets == ["candidate_subnets_value"] @@ -4132,6 +4134,7 @@ def test_insert_rest_call_success(request_type): request_init = {"project": "sample1", "region": "sample2"} request_init["interconnect_attachment_resource"] = { "admin_enabled": True, + "attachment_group": "attachment_group_value", "bandwidth": "bandwidth_value", "candidate_ipv6_subnets": [ "candidate_ipv6_subnets_value1", @@ -4572,6 +4575,7 @@ def test_patch_rest_call_success(request_type): } request_init["interconnect_attachment_resource"] = { "admin_enabled": True, + "attachment_group": "attachment_group_value", "bandwidth": "bandwidth_value", "candidate_ipv6_subnets": [ "candidate_ipv6_subnets_value1", diff --git a/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_interconnect_groups.py b/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_interconnect_groups.py new file mode 100644 index 000000000000..92d837363c30 --- /dev/null +++ b/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_interconnect_groups.py @@ -0,0 +1,6642 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +import os + +# try/except added for compatibility with python < 3.8 +try: + from unittest import mock + from unittest.mock import AsyncMock # pragma: NO COVER +except ImportError: # pragma: NO COVER + import mock + +from collections.abc import AsyncIterable, Iterable +import json +import math + +from google.api_core import api_core_version +from google.protobuf import json_format +import grpc +from grpc.experimental import aio +from proto.marshal.rules import wrappers +from proto.marshal.rules.dates import DurationRule, TimestampRule +import pytest +from requests import PreparedRequest, Request, Response +from requests.sessions import Session + +try: + from google.auth.aio import credentials as ga_credentials_async + + HAS_GOOGLE_AUTH_AIO = True +except ImportError: # pragma: NO COVER + HAS_GOOGLE_AUTH_AIO = False + +from google.api_core import ( + future, + gapic_v1, + grpc_helpers, + grpc_helpers_async, + path_template, +) +from google.api_core import client_options +from google.api_core import exceptions as core_exceptions +from google.api_core import extended_operation # type: ignore +from google.api_core import retry as retries +import google.auth +from google.auth import credentials as ga_credentials +from google.auth.exceptions import MutualTLSChannelError +from google.oauth2 import service_account + +from google.cloud.compute_v1.services.interconnect_groups import ( + InterconnectGroupsClient, + pagers, + transports, +) +from google.cloud.compute_v1.types import compute + +CRED_INFO_JSON = { + "credential_source": "/path/to/file", + "credential_type": "service account credentials", + "principal": "service-account@example.com", +} +CRED_INFO_STRING = json.dumps(CRED_INFO_JSON) + + +async def mock_async_gen(data, chunk_size=1): + for i in range(0, len(data)): # pragma: NO COVER + chunk = data[i : i + chunk_size] + yield chunk.encode("utf-8") + + +def client_cert_source_callback(): + return b"cert bytes", b"key bytes" + + +# TODO: use async auth anon credentials by default once the minimum version of google-auth is upgraded. +# See related issue: https://github.com/googleapis/gapic-generator-python/issues/2107. +def async_anonymous_credentials(): + if HAS_GOOGLE_AUTH_AIO: + return ga_credentials_async.AnonymousCredentials() + return ga_credentials.AnonymousCredentials() + + +# If default endpoint is localhost, then default mtls endpoint will be the same. +# This method modifies the default endpoint so the client can produce a different +# mtls endpoint for endpoint testing purposes. +def modify_default_endpoint(client): + return ( + "foo.googleapis.com" + if ("localhost" in client.DEFAULT_ENDPOINT) + else client.DEFAULT_ENDPOINT + ) + + +# If default endpoint template is localhost, then default mtls endpoint will be the same. +# This method modifies the default endpoint template so the client can produce a different +# mtls endpoint for endpoint testing purposes. +def modify_default_endpoint_template(client): + return ( + "test.{UNIVERSE_DOMAIN}" + if ("localhost" in client._DEFAULT_ENDPOINT_TEMPLATE) + else client._DEFAULT_ENDPOINT_TEMPLATE + ) + + +def test__get_default_mtls_endpoint(): + api_endpoint = "example.googleapis.com" + api_mtls_endpoint = "example.mtls.googleapis.com" + sandbox_endpoint = "example.sandbox.googleapis.com" + sandbox_mtls_endpoint = "example.mtls.sandbox.googleapis.com" + non_googleapi = "api.example.com" + + assert InterconnectGroupsClient._get_default_mtls_endpoint(None) is None + assert ( + InterconnectGroupsClient._get_default_mtls_endpoint(api_endpoint) + == api_mtls_endpoint + ) + assert ( + InterconnectGroupsClient._get_default_mtls_endpoint(api_mtls_endpoint) + == api_mtls_endpoint + ) + assert ( + InterconnectGroupsClient._get_default_mtls_endpoint(sandbox_endpoint) + == sandbox_mtls_endpoint + ) + assert ( + InterconnectGroupsClient._get_default_mtls_endpoint(sandbox_mtls_endpoint) + == sandbox_mtls_endpoint + ) + assert ( + InterconnectGroupsClient._get_default_mtls_endpoint(non_googleapi) + == non_googleapi + ) + + +def test__read_environment_variables(): + assert InterconnectGroupsClient._read_environment_variables() == ( + False, + "auto", + None, + ) + + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "true"}): + assert InterconnectGroupsClient._read_environment_variables() == ( + True, + "auto", + None, + ) + + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "false"}): + assert InterconnectGroupsClient._read_environment_variables() == ( + False, + "auto", + None, + ) + + with mock.patch.dict( + os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "Unsupported"} + ): + with pytest.raises(ValueError) as excinfo: + InterconnectGroupsClient._read_environment_variables() + assert ( + str(excinfo.value) + == "Environment variable `GOOGLE_API_USE_CLIENT_CERTIFICATE` must be either `true` or `false`" + ) + + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): + assert InterconnectGroupsClient._read_environment_variables() == ( + False, + "never", + None, + ) + + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}): + assert InterconnectGroupsClient._read_environment_variables() == ( + False, + "always", + None, + ) + + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "auto"}): + assert InterconnectGroupsClient._read_environment_variables() == ( + False, + "auto", + None, + ) + + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "Unsupported"}): + with pytest.raises(MutualTLSChannelError) as excinfo: + InterconnectGroupsClient._read_environment_variables() + assert ( + str(excinfo.value) + == "Environment variable `GOOGLE_API_USE_MTLS_ENDPOINT` must be `never`, `auto` or `always`" + ) + + with mock.patch.dict(os.environ, {"GOOGLE_CLOUD_UNIVERSE_DOMAIN": "foo.com"}): + assert InterconnectGroupsClient._read_environment_variables() == ( + False, + "auto", + "foo.com", + ) + + +def test__get_client_cert_source(): + mock_provided_cert_source = mock.Mock() + mock_default_cert_source = mock.Mock() + + assert InterconnectGroupsClient._get_client_cert_source(None, False) is None + assert ( + InterconnectGroupsClient._get_client_cert_source( + mock_provided_cert_source, False + ) + is None + ) + assert ( + InterconnectGroupsClient._get_client_cert_source( + mock_provided_cert_source, True + ) + == mock_provided_cert_source + ) + + with mock.patch( + "google.auth.transport.mtls.has_default_client_cert_source", return_value=True + ): + with mock.patch( + "google.auth.transport.mtls.default_client_cert_source", + return_value=mock_default_cert_source, + ): + assert ( + InterconnectGroupsClient._get_client_cert_source(None, True) + is mock_default_cert_source + ) + assert ( + InterconnectGroupsClient._get_client_cert_source( + mock_provided_cert_source, "true" + ) + is mock_provided_cert_source + ) + + +@mock.patch.object( + InterconnectGroupsClient, + "_DEFAULT_ENDPOINT_TEMPLATE", + modify_default_endpoint_template(InterconnectGroupsClient), +) +def test__get_api_endpoint(): + api_override = "foo.com" + mock_client_cert_source = mock.Mock() + default_universe = InterconnectGroupsClient._DEFAULT_UNIVERSE + default_endpoint = InterconnectGroupsClient._DEFAULT_ENDPOINT_TEMPLATE.format( + UNIVERSE_DOMAIN=default_universe + ) + mock_universe = "bar.com" + mock_endpoint = InterconnectGroupsClient._DEFAULT_ENDPOINT_TEMPLATE.format( + UNIVERSE_DOMAIN=mock_universe + ) + + assert ( + InterconnectGroupsClient._get_api_endpoint( + api_override, mock_client_cert_source, default_universe, "always" + ) + == api_override + ) + assert ( + InterconnectGroupsClient._get_api_endpoint( + None, mock_client_cert_source, default_universe, "auto" + ) + == InterconnectGroupsClient.DEFAULT_MTLS_ENDPOINT + ) + assert ( + InterconnectGroupsClient._get_api_endpoint(None, None, default_universe, "auto") + == default_endpoint + ) + assert ( + InterconnectGroupsClient._get_api_endpoint( + None, None, default_universe, "always" + ) + == InterconnectGroupsClient.DEFAULT_MTLS_ENDPOINT + ) + assert ( + InterconnectGroupsClient._get_api_endpoint( + None, mock_client_cert_source, default_universe, "always" + ) + == InterconnectGroupsClient.DEFAULT_MTLS_ENDPOINT + ) + assert ( + InterconnectGroupsClient._get_api_endpoint(None, None, mock_universe, "never") + == mock_endpoint + ) + assert ( + InterconnectGroupsClient._get_api_endpoint( + None, None, default_universe, "never" + ) + == default_endpoint + ) + + with pytest.raises(MutualTLSChannelError) as excinfo: + InterconnectGroupsClient._get_api_endpoint( + None, mock_client_cert_source, mock_universe, "auto" + ) + assert ( + str(excinfo.value) + == "mTLS is not supported in any universe other than googleapis.com." + ) + + +def test__get_universe_domain(): + client_universe_domain = "foo.com" + universe_domain_env = "bar.com" + + assert ( + InterconnectGroupsClient._get_universe_domain( + client_universe_domain, universe_domain_env + ) + == client_universe_domain + ) + assert ( + InterconnectGroupsClient._get_universe_domain(None, universe_domain_env) + == universe_domain_env + ) + assert ( + InterconnectGroupsClient._get_universe_domain(None, None) + == InterconnectGroupsClient._DEFAULT_UNIVERSE + ) + + with pytest.raises(ValueError) as excinfo: + InterconnectGroupsClient._get_universe_domain("", None) + assert str(excinfo.value) == "Universe Domain cannot be an empty string." + + +@pytest.mark.parametrize( + "error_code,cred_info_json,show_cred_info", + [ + (401, CRED_INFO_JSON, True), + (403, CRED_INFO_JSON, True), + (404, CRED_INFO_JSON, True), + (500, CRED_INFO_JSON, False), + (401, None, False), + (403, None, False), + (404, None, False), + (500, None, False), + ], +) +def test__add_cred_info_for_auth_errors(error_code, cred_info_json, show_cred_info): + cred = mock.Mock(["get_cred_info"]) + cred.get_cred_info = mock.Mock(return_value=cred_info_json) + client = InterconnectGroupsClient(credentials=cred) + client._transport._credentials = cred + + error = core_exceptions.GoogleAPICallError("message", details=["foo"]) + error.code = error_code + + client._add_cred_info_for_auth_errors(error) + if show_cred_info: + assert error.details == ["foo", CRED_INFO_STRING] + else: + assert error.details == ["foo"] + + +@pytest.mark.parametrize("error_code", [401, 403, 404, 500]) +def test__add_cred_info_for_auth_errors_no_get_cred_info(error_code): + cred = mock.Mock([]) + assert not hasattr(cred, "get_cred_info") + client = InterconnectGroupsClient(credentials=cred) + client._transport._credentials = cred + + error = core_exceptions.GoogleAPICallError("message", details=[]) + error.code = error_code + + client._add_cred_info_for_auth_errors(error) + assert error.details == [] + + +@pytest.mark.parametrize( + "client_class,transport_name", + [ + (InterconnectGroupsClient, "rest"), + ], +) +def test_interconnect_groups_client_from_service_account_info( + client_class, transport_name +): + creds = ga_credentials.AnonymousCredentials() + with mock.patch.object( + service_account.Credentials, "from_service_account_info" + ) as factory: + factory.return_value = creds + info = {"valid": True} + client = client_class.from_service_account_info(info, transport=transport_name) + assert client.transport._credentials == creds + assert isinstance(client, client_class) + + assert client.transport._host == ( + "compute.googleapis.com:443" + if transport_name in ["grpc", "grpc_asyncio"] + else "https://compute.googleapis.com" + ) + + +@pytest.mark.parametrize( + "transport_class,transport_name", + [ + (transports.InterconnectGroupsRestTransport, "rest"), + ], +) +def test_interconnect_groups_client_service_account_always_use_jwt( + transport_class, transport_name +): + with mock.patch.object( + service_account.Credentials, "with_always_use_jwt_access", create=True + ) as use_jwt: + creds = service_account.Credentials(None, None, None) + transport = transport_class(credentials=creds, always_use_jwt_access=True) + use_jwt.assert_called_once_with(True) + + with mock.patch.object( + service_account.Credentials, "with_always_use_jwt_access", create=True + ) as use_jwt: + creds = service_account.Credentials(None, None, None) + transport = transport_class(credentials=creds, always_use_jwt_access=False) + use_jwt.assert_not_called() + + +@pytest.mark.parametrize( + "client_class,transport_name", + [ + (InterconnectGroupsClient, "rest"), + ], +) +def test_interconnect_groups_client_from_service_account_file( + client_class, transport_name +): + creds = ga_credentials.AnonymousCredentials() + with mock.patch.object( + service_account.Credentials, "from_service_account_file" + ) as factory: + factory.return_value = creds + client = client_class.from_service_account_file( + "dummy/file/path.json", transport=transport_name + ) + assert client.transport._credentials == creds + assert isinstance(client, client_class) + + client = client_class.from_service_account_json( + "dummy/file/path.json", transport=transport_name + ) + assert client.transport._credentials == creds + assert isinstance(client, client_class) + + assert client.transport._host == ( + "compute.googleapis.com:443" + if transport_name in ["grpc", "grpc_asyncio"] + else "https://compute.googleapis.com" + ) + + +def test_interconnect_groups_client_get_transport_class(): + transport = InterconnectGroupsClient.get_transport_class() + available_transports = [ + transports.InterconnectGroupsRestTransport, + ] + assert transport in available_transports + + transport = InterconnectGroupsClient.get_transport_class("rest") + assert transport == transports.InterconnectGroupsRestTransport + + +@pytest.mark.parametrize( + "client_class,transport_class,transport_name", + [ + (InterconnectGroupsClient, transports.InterconnectGroupsRestTransport, "rest"), + ], +) +@mock.patch.object( + InterconnectGroupsClient, + "_DEFAULT_ENDPOINT_TEMPLATE", + modify_default_endpoint_template(InterconnectGroupsClient), +) +def test_interconnect_groups_client_client_options( + client_class, transport_class, transport_name +): + # Check that if channel is provided we won't create a new one. + with mock.patch.object(InterconnectGroupsClient, "get_transport_class") as gtc: + transport = transport_class(credentials=ga_credentials.AnonymousCredentials()) + client = client_class(transport=transport) + gtc.assert_not_called() + + # Check that if channel is provided via str we will create a new one. + with mock.patch.object(InterconnectGroupsClient, "get_transport_class") as gtc: + client = client_class(transport=transport_name) + gtc.assert_called() + + # Check the case api_endpoint is provided. + options = client_options.ClientOptions(api_endpoint="squid.clam.whelk") + with mock.patch.object(transport_class, "__init__") as patched: + patched.return_value = None + client = client_class(transport=transport_name, client_options=options) + patched.assert_called_once_with( + credentials=None, + credentials_file=None, + host="squid.clam.whelk", + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + api_audience=None, + ) + + # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is + # "never". + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): + with mock.patch.object(transport_class, "__init__") as patched: + patched.return_value = None + client = client_class(transport=transport_name) + patched.assert_called_once_with( + credentials=None, + credentials_file=None, + host=client._DEFAULT_ENDPOINT_TEMPLATE.format( + UNIVERSE_DOMAIN=client._DEFAULT_UNIVERSE + ), + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + api_audience=None, + ) + + # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is + # "always". + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}): + with mock.patch.object(transport_class, "__init__") as patched: + patched.return_value = None + client = client_class(transport=transport_name) + patched.assert_called_once_with( + credentials=None, + credentials_file=None, + host=client.DEFAULT_MTLS_ENDPOINT, + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + api_audience=None, + ) + + # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has + # unsupported value. + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "Unsupported"}): + with pytest.raises(MutualTLSChannelError) as excinfo: + client = client_class(transport=transport_name) + assert ( + str(excinfo.value) + == "Environment variable `GOOGLE_API_USE_MTLS_ENDPOINT` must be `never`, `auto` or `always`" + ) + + # Check the case GOOGLE_API_USE_CLIENT_CERTIFICATE has unsupported value. + with mock.patch.dict( + os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "Unsupported"} + ): + with pytest.raises(ValueError) as excinfo: + client = client_class(transport=transport_name) + assert ( + str(excinfo.value) + == "Environment variable `GOOGLE_API_USE_CLIENT_CERTIFICATE` must be either `true` or `false`" + ) + + # Check the case quota_project_id is provided + options = client_options.ClientOptions(quota_project_id="octopus") + with mock.patch.object(transport_class, "__init__") as patched: + patched.return_value = None + client = client_class(client_options=options, transport=transport_name) + patched.assert_called_once_with( + credentials=None, + credentials_file=None, + host=client._DEFAULT_ENDPOINT_TEMPLATE.format( + UNIVERSE_DOMAIN=client._DEFAULT_UNIVERSE + ), + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id="octopus", + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + with mock.patch.object(transport_class, "__init__") as patched: + patched.return_value = None + client = client_class(client_options=options, transport=transport_name) + patched.assert_called_once_with( + credentials=None, + credentials_file=None, + host=client._DEFAULT_ENDPOINT_TEMPLATE.format( + UNIVERSE_DOMAIN=client._DEFAULT_UNIVERSE + ), + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + api_audience="https://language.googleapis.com", + ) + + +@pytest.mark.parametrize( + "client_class,transport_class,transport_name,use_client_cert_env", + [ + ( + InterconnectGroupsClient, + transports.InterconnectGroupsRestTransport, + "rest", + "true", + ), + ( + InterconnectGroupsClient, + transports.InterconnectGroupsRestTransport, + "rest", + "false", + ), + ], +) +@mock.patch.object( + InterconnectGroupsClient, + "_DEFAULT_ENDPOINT_TEMPLATE", + modify_default_endpoint_template(InterconnectGroupsClient), +) +@mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "auto"}) +def test_interconnect_groups_client_mtls_env_auto( + client_class, transport_class, transport_name, use_client_cert_env +): + # This tests the endpoint autoswitch behavior. Endpoint is autoswitched to the default + # mtls endpoint, if GOOGLE_API_USE_CLIENT_CERTIFICATE is "true" and client cert exists. + + # Check the case client_cert_source is provided. Whether client cert is used depends on + # GOOGLE_API_USE_CLIENT_CERTIFICATE value. + with mock.patch.dict( + os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": use_client_cert_env} + ): + options = client_options.ClientOptions( + client_cert_source=client_cert_source_callback + ) + with mock.patch.object(transport_class, "__init__") as patched: + patched.return_value = None + client = client_class(client_options=options, transport=transport_name) + + if use_client_cert_env == "false": + expected_client_cert_source = None + expected_host = client._DEFAULT_ENDPOINT_TEMPLATE.format( + UNIVERSE_DOMAIN=client._DEFAULT_UNIVERSE + ) + else: + expected_client_cert_source = client_cert_source_callback + expected_host = client.DEFAULT_MTLS_ENDPOINT + + patched.assert_called_once_with( + credentials=None, + credentials_file=None, + host=expected_host, + scopes=None, + client_cert_source_for_mtls=expected_client_cert_source, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + api_audience=None, + ) + + # Check the case ADC client cert is provided. Whether client cert is used depends on + # GOOGLE_API_USE_CLIENT_CERTIFICATE value. + with mock.patch.dict( + os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": use_client_cert_env} + ): + with mock.patch.object(transport_class, "__init__") as patched: + with mock.patch( + "google.auth.transport.mtls.has_default_client_cert_source", + return_value=True, + ): + with mock.patch( + "google.auth.transport.mtls.default_client_cert_source", + return_value=client_cert_source_callback, + ): + if use_client_cert_env == "false": + expected_host = client._DEFAULT_ENDPOINT_TEMPLATE.format( + UNIVERSE_DOMAIN=client._DEFAULT_UNIVERSE + ) + expected_client_cert_source = None + else: + expected_host = client.DEFAULT_MTLS_ENDPOINT + expected_client_cert_source = client_cert_source_callback + + patched.return_value = None + client = client_class(transport=transport_name) + patched.assert_called_once_with( + credentials=None, + credentials_file=None, + host=expected_host, + scopes=None, + client_cert_source_for_mtls=expected_client_cert_source, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + api_audience=None, + ) + + # Check the case client_cert_source and ADC client cert are not provided. + with mock.patch.dict( + os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": use_client_cert_env} + ): + with mock.patch.object(transport_class, "__init__") as patched: + with mock.patch( + "google.auth.transport.mtls.has_default_client_cert_source", + return_value=False, + ): + patched.return_value = None + client = client_class(transport=transport_name) + patched.assert_called_once_with( + credentials=None, + credentials_file=None, + host=client._DEFAULT_ENDPOINT_TEMPLATE.format( + UNIVERSE_DOMAIN=client._DEFAULT_UNIVERSE + ), + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + api_audience=None, + ) + + +@pytest.mark.parametrize("client_class", [InterconnectGroupsClient]) +@mock.patch.object( + InterconnectGroupsClient, + "DEFAULT_ENDPOINT", + modify_default_endpoint(InterconnectGroupsClient), +) +def test_interconnect_groups_client_get_mtls_endpoint_and_cert_source(client_class): + mock_client_cert_source = mock.Mock() + + # Test the case GOOGLE_API_USE_CLIENT_CERTIFICATE is "true". + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "true"}): + mock_api_endpoint = "foo" + options = client_options.ClientOptions( + client_cert_source=mock_client_cert_source, api_endpoint=mock_api_endpoint + ) + api_endpoint, cert_source = client_class.get_mtls_endpoint_and_cert_source( + options + ) + assert api_endpoint == mock_api_endpoint + assert cert_source == mock_client_cert_source + + # Test the case GOOGLE_API_USE_CLIENT_CERTIFICATE is "false". + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "false"}): + mock_client_cert_source = mock.Mock() + mock_api_endpoint = "foo" + options = client_options.ClientOptions( + client_cert_source=mock_client_cert_source, api_endpoint=mock_api_endpoint + ) + api_endpoint, cert_source = client_class.get_mtls_endpoint_and_cert_source( + options + ) + assert api_endpoint == mock_api_endpoint + assert cert_source is None + + # Test the case GOOGLE_API_USE_MTLS_ENDPOINT is "never". + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): + api_endpoint, cert_source = client_class.get_mtls_endpoint_and_cert_source() + assert api_endpoint == client_class.DEFAULT_ENDPOINT + assert cert_source is None + + # Test the case GOOGLE_API_USE_MTLS_ENDPOINT is "always". + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}): + api_endpoint, cert_source = client_class.get_mtls_endpoint_and_cert_source() + assert api_endpoint == client_class.DEFAULT_MTLS_ENDPOINT + assert cert_source is None + + # Test the case GOOGLE_API_USE_MTLS_ENDPOINT is "auto" and default cert doesn't exist. + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "true"}): + with mock.patch( + "google.auth.transport.mtls.has_default_client_cert_source", + return_value=False, + ): + api_endpoint, cert_source = client_class.get_mtls_endpoint_and_cert_source() + assert api_endpoint == client_class.DEFAULT_ENDPOINT + assert cert_source is None + + # Test the case GOOGLE_API_USE_MTLS_ENDPOINT is "auto" and default cert exists. + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "true"}): + with mock.patch( + "google.auth.transport.mtls.has_default_client_cert_source", + return_value=True, + ): + with mock.patch( + "google.auth.transport.mtls.default_client_cert_source", + return_value=mock_client_cert_source, + ): + ( + api_endpoint, + cert_source, + ) = client_class.get_mtls_endpoint_and_cert_source() + assert api_endpoint == client_class.DEFAULT_MTLS_ENDPOINT + assert cert_source == mock_client_cert_source + + # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has + # unsupported value. + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "Unsupported"}): + with pytest.raises(MutualTLSChannelError) as excinfo: + client_class.get_mtls_endpoint_and_cert_source() + + assert ( + str(excinfo.value) + == "Environment variable `GOOGLE_API_USE_MTLS_ENDPOINT` must be `never`, `auto` or `always`" + ) + + # Check the case GOOGLE_API_USE_CLIENT_CERTIFICATE has unsupported value. + with mock.patch.dict( + os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "Unsupported"} + ): + with pytest.raises(ValueError) as excinfo: + client_class.get_mtls_endpoint_and_cert_source() + + assert ( + str(excinfo.value) + == "Environment variable `GOOGLE_API_USE_CLIENT_CERTIFICATE` must be either `true` or `false`" + ) + + +@pytest.mark.parametrize("client_class", [InterconnectGroupsClient]) +@mock.patch.object( + InterconnectGroupsClient, + "_DEFAULT_ENDPOINT_TEMPLATE", + modify_default_endpoint_template(InterconnectGroupsClient), +) +def test_interconnect_groups_client_client_api_endpoint(client_class): + mock_client_cert_source = client_cert_source_callback + api_override = "foo.com" + default_universe = InterconnectGroupsClient._DEFAULT_UNIVERSE + default_endpoint = InterconnectGroupsClient._DEFAULT_ENDPOINT_TEMPLATE.format( + UNIVERSE_DOMAIN=default_universe + ) + mock_universe = "bar.com" + mock_endpoint = InterconnectGroupsClient._DEFAULT_ENDPOINT_TEMPLATE.format( + UNIVERSE_DOMAIN=mock_universe + ) + + # If ClientOptions.api_endpoint is set and GOOGLE_API_USE_CLIENT_CERTIFICATE="true", + # use ClientOptions.api_endpoint as the api endpoint regardless. + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "true"}): + with mock.patch( + "google.auth.transport.requests.AuthorizedSession.configure_mtls_channel" + ): + options = client_options.ClientOptions( + client_cert_source=mock_client_cert_source, api_endpoint=api_override + ) + client = client_class( + client_options=options, + credentials=ga_credentials.AnonymousCredentials(), + ) + assert client.api_endpoint == api_override + + # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="never", + # use the _DEFAULT_ENDPOINT_TEMPLATE populated with GDU as the api endpoint. + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): + client = client_class(credentials=ga_credentials.AnonymousCredentials()) + assert client.api_endpoint == default_endpoint + + # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="always", + # use the DEFAULT_MTLS_ENDPOINT as the api endpoint. + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}): + client = client_class(credentials=ga_credentials.AnonymousCredentials()) + assert client.api_endpoint == client_class.DEFAULT_MTLS_ENDPOINT + + # If ClientOptions.api_endpoint is not set, GOOGLE_API_USE_MTLS_ENDPOINT="auto" (default), + # GOOGLE_API_USE_CLIENT_CERTIFICATE="false" (default), default cert source doesn't exist, + # and ClientOptions.universe_domain="bar.com", + # use the _DEFAULT_ENDPOINT_TEMPLATE populated with universe domain as the api endpoint. + options = client_options.ClientOptions() + universe_exists = hasattr(options, "universe_domain") + if universe_exists: + options = client_options.ClientOptions(universe_domain=mock_universe) + client = client_class( + client_options=options, credentials=ga_credentials.AnonymousCredentials() + ) + else: + client = client_class( + client_options=options, credentials=ga_credentials.AnonymousCredentials() + ) + assert client.api_endpoint == ( + mock_endpoint if universe_exists else default_endpoint + ) + assert client.universe_domain == ( + mock_universe if universe_exists else default_universe + ) + + # If ClientOptions does not have a universe domain attribute and GOOGLE_API_USE_MTLS_ENDPOINT="never", + # use the _DEFAULT_ENDPOINT_TEMPLATE populated with GDU as the api endpoint. + options = client_options.ClientOptions() + if hasattr(options, "universe_domain"): + delattr(options, "universe_domain") + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): + client = client_class( + client_options=options, credentials=ga_credentials.AnonymousCredentials() + ) + assert client.api_endpoint == default_endpoint + + +@pytest.mark.parametrize( + "client_class,transport_class,transport_name", + [ + (InterconnectGroupsClient, transports.InterconnectGroupsRestTransport, "rest"), + ], +) +def test_interconnect_groups_client_client_options_scopes( + client_class, transport_class, transport_name +): + # Check the case scopes are provided. + options = client_options.ClientOptions( + scopes=["1", "2"], + ) + with mock.patch.object(transport_class, "__init__") as patched: + patched.return_value = None + client = client_class(client_options=options, transport=transport_name) + patched.assert_called_once_with( + credentials=None, + credentials_file=None, + host=client._DEFAULT_ENDPOINT_TEMPLATE.format( + UNIVERSE_DOMAIN=client._DEFAULT_UNIVERSE + ), + scopes=["1", "2"], + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + api_audience=None, + ) + + +@pytest.mark.parametrize( + "client_class,transport_class,transport_name,grpc_helpers", + [ + ( + InterconnectGroupsClient, + transports.InterconnectGroupsRestTransport, + "rest", + None, + ), + ], +) +def test_interconnect_groups_client_client_options_credentials_file( + client_class, transport_class, transport_name, grpc_helpers +): + # Check the case credentials file is provided. + options = client_options.ClientOptions(credentials_file="credentials.json") + + with mock.patch.object(transport_class, "__init__") as patched: + patched.return_value = None + client = client_class(client_options=options, transport=transport_name) + patched.assert_called_once_with( + credentials=None, + credentials_file="credentials.json", + host=client._DEFAULT_ENDPOINT_TEMPLATE.format( + UNIVERSE_DOMAIN=client._DEFAULT_UNIVERSE + ), + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + api_audience=None, + ) + + +def test_create_members_rest_use_cached_wrapped_rpc(): + # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, + # instead of constructing them on each call + with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Should wrap all calls on client creation + assert wrapper_fn.call_count > 0 + wrapper_fn.reset_mock() + + # Ensure method has been cached + assert client._transport.create_members in client._transport._wrapped_methods + + # Replace cached wrapped function with mock + mock_rpc = mock.Mock() + mock_rpc.return_value.name = ( + "foo" # operation_request.operation in compute client(s) expect a string. + ) + client._transport._wrapped_methods[client._transport.create_members] = mock_rpc + + request = {} + client.create_members(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + # Operation methods build a cached wrapper on first rpc call + # subsequent calls should use the cached wrapper + wrapper_fn.reset_mock() + + client.create_members(request) + + # Establish that a new wrapper was not created for this call + assert wrapper_fn.call_count == 0 + assert mock_rpc.call_count == 2 + + +def test_create_members_rest_required_fields( + request_type=compute.CreateMembersInterconnectGroupRequest, +): + transport_class = transports.InterconnectGroupsRestTransport + + request_init = {} + request_init["interconnect_group"] = "" + request_init["project"] = "" + request = request_type(**request_init) + pb_request = request_type.pb(request) + jsonified_request = json.loads( + json_format.MessageToJson(pb_request, use_integers_for_enums=False) + ) + + # verify fields with default values are dropped + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).create_members._get_unset_required_fields(jsonified_request) + jsonified_request.update(unset_fields) + + # verify required fields with default values are now present + + jsonified_request["interconnectGroup"] = "interconnect_group_value" + jsonified_request["project"] = "project_value" + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).create_members._get_unset_required_fields(jsonified_request) + jsonified_request.update(unset_fields) + + # verify required fields with non-default values are left alone + assert "interconnectGroup" in jsonified_request + assert jsonified_request["interconnectGroup"] == "interconnect_group_value" + assert "project" in jsonified_request + assert jsonified_request["project"] == "project_value" + + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + request = request_type(**request_init) + + # Designate an appropriate value for the returned response. + return_value = compute.Operation() + # Mock the http request call within the method and fake a response. + with mock.patch.object(Session, "request") as req: + # We need to mock transcode() because providing default values + # for required fields will fail the real version if the http_options + # expect actual values for those fields. + with mock.patch.object(path_template, "transcode") as transcode: + # A uri without fields and an empty body will force all the + # request fields to show up in the query_params. + pb_request = request_type.pb(request) + transcode_result = { + "uri": "v1/sample_method", + "method": "post", + "query_params": pb_request, + } + transcode_result["body"] = pb_request + transcode.return_value = transcode_result + + response_value = Response() + response_value.status_code = 200 + + # Convert return value to protobuf type + return_value = compute.Operation.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + response = client.create_members(request) + + expected_params = [] + actual_params = req.call_args.kwargs["params"] + assert expected_params == actual_params + + +def test_create_members_rest_unset_required_fields(): + transport = transports.InterconnectGroupsRestTransport( + credentials=ga_credentials.AnonymousCredentials + ) + + unset_fields = transport.create_members._get_unset_required_fields({}) + assert set(unset_fields) == ( + set(()) + & set( + ( + "interconnectGroup", + "interconnectGroupsCreateMembersRequestResource", + "project", + ) + ) + ) + + +def test_create_members_rest_flattened(): + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = compute.Operation() + + # get arguments that satisfy an http rule for this method + sample_request = {"project": "sample1", "interconnect_group": "sample2"} + + # get truthy value for each flattened field + mock_args = dict( + project="project_value", + interconnect_group="interconnect_group_value", + interconnect_groups_create_members_request_resource=compute.InterconnectGroupsCreateMembersRequest( + request=compute.InterconnectGroupsCreateMembers( + intent_mismatch_behavior="intent_mismatch_behavior_value" + ) + ), + ) + mock_args.update(sample_request) + + # Wrap the value into a proper Response obj + response_value = Response() + response_value.status_code = 200 + # Convert return value to protobuf type + return_value = compute.Operation.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + client.create_members(**mock_args) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(req.mock_calls) == 1 + _, args, _ = req.mock_calls[0] + assert path_template.validate( + "%s/compute/v1/projects/{project}/global/interconnectGroups/{interconnect_group}/createMembers" + % client.transport._host, + args[1], + ) + + +def test_create_members_rest_flattened_error(transport: str = "rest"): + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.create_members( + compute.CreateMembersInterconnectGroupRequest(), + project="project_value", + interconnect_group="interconnect_group_value", + interconnect_groups_create_members_request_resource=compute.InterconnectGroupsCreateMembersRequest( + request=compute.InterconnectGroupsCreateMembers( + intent_mismatch_behavior="intent_mismatch_behavior_value" + ) + ), + ) + + +def test_create_members_unary_rest_use_cached_wrapped_rpc(): + # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, + # instead of constructing them on each call + with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Should wrap all calls on client creation + assert wrapper_fn.call_count > 0 + wrapper_fn.reset_mock() + + # Ensure method has been cached + assert client._transport.create_members in client._transport._wrapped_methods + + # Replace cached wrapped function with mock + mock_rpc = mock.Mock() + mock_rpc.return_value.name = ( + "foo" # operation_request.operation in compute client(s) expect a string. + ) + client._transport._wrapped_methods[client._transport.create_members] = mock_rpc + + request = {} + client.create_members_unary(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + # Operation methods build a cached wrapper on first rpc call + # subsequent calls should use the cached wrapper + wrapper_fn.reset_mock() + + client.create_members_unary(request) + + # Establish that a new wrapper was not created for this call + assert wrapper_fn.call_count == 0 + assert mock_rpc.call_count == 2 + + +def test_create_members_unary_rest_required_fields( + request_type=compute.CreateMembersInterconnectGroupRequest, +): + transport_class = transports.InterconnectGroupsRestTransport + + request_init = {} + request_init["interconnect_group"] = "" + request_init["project"] = "" + request = request_type(**request_init) + pb_request = request_type.pb(request) + jsonified_request = json.loads( + json_format.MessageToJson(pb_request, use_integers_for_enums=False) + ) + + # verify fields with default values are dropped + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).create_members._get_unset_required_fields(jsonified_request) + jsonified_request.update(unset_fields) + + # verify required fields with default values are now present + + jsonified_request["interconnectGroup"] = "interconnect_group_value" + jsonified_request["project"] = "project_value" + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).create_members._get_unset_required_fields(jsonified_request) + jsonified_request.update(unset_fields) + + # verify required fields with non-default values are left alone + assert "interconnectGroup" in jsonified_request + assert jsonified_request["interconnectGroup"] == "interconnect_group_value" + assert "project" in jsonified_request + assert jsonified_request["project"] == "project_value" + + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + request = request_type(**request_init) + + # Designate an appropriate value for the returned response. + return_value = compute.Operation() + # Mock the http request call within the method and fake a response. + with mock.patch.object(Session, "request") as req: + # We need to mock transcode() because providing default values + # for required fields will fail the real version if the http_options + # expect actual values for those fields. + with mock.patch.object(path_template, "transcode") as transcode: + # A uri without fields and an empty body will force all the + # request fields to show up in the query_params. + pb_request = request_type.pb(request) + transcode_result = { + "uri": "v1/sample_method", + "method": "post", + "query_params": pb_request, + } + transcode_result["body"] = pb_request + transcode.return_value = transcode_result + + response_value = Response() + response_value.status_code = 200 + + # Convert return value to protobuf type + return_value = compute.Operation.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + response = client.create_members_unary(request) + + expected_params = [] + actual_params = req.call_args.kwargs["params"] + assert expected_params == actual_params + + +def test_create_members_unary_rest_unset_required_fields(): + transport = transports.InterconnectGroupsRestTransport( + credentials=ga_credentials.AnonymousCredentials + ) + + unset_fields = transport.create_members._get_unset_required_fields({}) + assert set(unset_fields) == ( + set(()) + & set( + ( + "interconnectGroup", + "interconnectGroupsCreateMembersRequestResource", + "project", + ) + ) + ) + + +def test_create_members_unary_rest_flattened(): + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = compute.Operation() + + # get arguments that satisfy an http rule for this method + sample_request = {"project": "sample1", "interconnect_group": "sample2"} + + # get truthy value for each flattened field + mock_args = dict( + project="project_value", + interconnect_group="interconnect_group_value", + interconnect_groups_create_members_request_resource=compute.InterconnectGroupsCreateMembersRequest( + request=compute.InterconnectGroupsCreateMembers( + intent_mismatch_behavior="intent_mismatch_behavior_value" + ) + ), + ) + mock_args.update(sample_request) + + # Wrap the value into a proper Response obj + response_value = Response() + response_value.status_code = 200 + # Convert return value to protobuf type + return_value = compute.Operation.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + client.create_members_unary(**mock_args) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(req.mock_calls) == 1 + _, args, _ = req.mock_calls[0] + assert path_template.validate( + "%s/compute/v1/projects/{project}/global/interconnectGroups/{interconnect_group}/createMembers" + % client.transport._host, + args[1], + ) + + +def test_create_members_unary_rest_flattened_error(transport: str = "rest"): + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.create_members_unary( + compute.CreateMembersInterconnectGroupRequest(), + project="project_value", + interconnect_group="interconnect_group_value", + interconnect_groups_create_members_request_resource=compute.InterconnectGroupsCreateMembersRequest( + request=compute.InterconnectGroupsCreateMembers( + intent_mismatch_behavior="intent_mismatch_behavior_value" + ) + ), + ) + + +def test_delete_rest_use_cached_wrapped_rpc(): + # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, + # instead of constructing them on each call + with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Should wrap all calls on client creation + assert wrapper_fn.call_count > 0 + wrapper_fn.reset_mock() + + # Ensure method has been cached + assert client._transport.delete in client._transport._wrapped_methods + + # Replace cached wrapped function with mock + mock_rpc = mock.Mock() + mock_rpc.return_value.name = ( + "foo" # operation_request.operation in compute client(s) expect a string. + ) + client._transport._wrapped_methods[client._transport.delete] = mock_rpc + + request = {} + client.delete(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + # Operation methods build a cached wrapper on first rpc call + # subsequent calls should use the cached wrapper + wrapper_fn.reset_mock() + + client.delete(request) + + # Establish that a new wrapper was not created for this call + assert wrapper_fn.call_count == 0 + assert mock_rpc.call_count == 2 + + +def test_delete_rest_required_fields( + request_type=compute.DeleteInterconnectGroupRequest, +): + transport_class = transports.InterconnectGroupsRestTransport + + request_init = {} + request_init["interconnect_group"] = "" + request_init["project"] = "" + request = request_type(**request_init) + pb_request = request_type.pb(request) + jsonified_request = json.loads( + json_format.MessageToJson(pb_request, use_integers_for_enums=False) + ) + + # verify fields with default values are dropped + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).delete._get_unset_required_fields(jsonified_request) + jsonified_request.update(unset_fields) + + # verify required fields with default values are now present + + jsonified_request["interconnectGroup"] = "interconnect_group_value" + jsonified_request["project"] = "project_value" + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).delete._get_unset_required_fields(jsonified_request) + # Check that path parameters and body parameters are not mixing in. + assert not set(unset_fields) - set(("request_id",)) + jsonified_request.update(unset_fields) + + # verify required fields with non-default values are left alone + assert "interconnectGroup" in jsonified_request + assert jsonified_request["interconnectGroup"] == "interconnect_group_value" + assert "project" in jsonified_request + assert jsonified_request["project"] == "project_value" + + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + request = request_type(**request_init) + + # Designate an appropriate value for the returned response. + return_value = compute.Operation() + # Mock the http request call within the method and fake a response. + with mock.patch.object(Session, "request") as req: + # We need to mock transcode() because providing default values + # for required fields will fail the real version if the http_options + # expect actual values for those fields. + with mock.patch.object(path_template, "transcode") as transcode: + # A uri without fields and an empty body will force all the + # request fields to show up in the query_params. + pb_request = request_type.pb(request) + transcode_result = { + "uri": "v1/sample_method", + "method": "delete", + "query_params": pb_request, + } + transcode.return_value = transcode_result + + response_value = Response() + response_value.status_code = 200 + + # Convert return value to protobuf type + return_value = compute.Operation.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + response = client.delete(request) + + expected_params = [] + actual_params = req.call_args.kwargs["params"] + assert expected_params == actual_params + + +def test_delete_rest_unset_required_fields(): + transport = transports.InterconnectGroupsRestTransport( + credentials=ga_credentials.AnonymousCredentials + ) + + unset_fields = transport.delete._get_unset_required_fields({}) + assert set(unset_fields) == ( + set(("requestId",)) + & set( + ( + "interconnectGroup", + "project", + ) + ) + ) + + +def test_delete_rest_flattened(): + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = compute.Operation() + + # get arguments that satisfy an http rule for this method + sample_request = {"project": "sample1", "interconnect_group": "sample2"} + + # get truthy value for each flattened field + mock_args = dict( + project="project_value", + interconnect_group="interconnect_group_value", + ) + mock_args.update(sample_request) + + # Wrap the value into a proper Response obj + response_value = Response() + response_value.status_code = 200 + # Convert return value to protobuf type + return_value = compute.Operation.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + client.delete(**mock_args) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(req.mock_calls) == 1 + _, args, _ = req.mock_calls[0] + assert path_template.validate( + "%s/compute/v1/projects/{project}/global/interconnectGroups/{interconnect_group}" + % client.transport._host, + args[1], + ) + + +def test_delete_rest_flattened_error(transport: str = "rest"): + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.delete( + compute.DeleteInterconnectGroupRequest(), + project="project_value", + interconnect_group="interconnect_group_value", + ) + + +def test_delete_unary_rest_use_cached_wrapped_rpc(): + # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, + # instead of constructing them on each call + with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Should wrap all calls on client creation + assert wrapper_fn.call_count > 0 + wrapper_fn.reset_mock() + + # Ensure method has been cached + assert client._transport.delete in client._transport._wrapped_methods + + # Replace cached wrapped function with mock + mock_rpc = mock.Mock() + mock_rpc.return_value.name = ( + "foo" # operation_request.operation in compute client(s) expect a string. + ) + client._transport._wrapped_methods[client._transport.delete] = mock_rpc + + request = {} + client.delete_unary(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + # Operation methods build a cached wrapper on first rpc call + # subsequent calls should use the cached wrapper + wrapper_fn.reset_mock() + + client.delete_unary(request) + + # Establish that a new wrapper was not created for this call + assert wrapper_fn.call_count == 0 + assert mock_rpc.call_count == 2 + + +def test_delete_unary_rest_required_fields( + request_type=compute.DeleteInterconnectGroupRequest, +): + transport_class = transports.InterconnectGroupsRestTransport + + request_init = {} + request_init["interconnect_group"] = "" + request_init["project"] = "" + request = request_type(**request_init) + pb_request = request_type.pb(request) + jsonified_request = json.loads( + json_format.MessageToJson(pb_request, use_integers_for_enums=False) + ) + + # verify fields with default values are dropped + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).delete._get_unset_required_fields(jsonified_request) + jsonified_request.update(unset_fields) + + # verify required fields with default values are now present + + jsonified_request["interconnectGroup"] = "interconnect_group_value" + jsonified_request["project"] = "project_value" + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).delete._get_unset_required_fields(jsonified_request) + # Check that path parameters and body parameters are not mixing in. + assert not set(unset_fields) - set(("request_id",)) + jsonified_request.update(unset_fields) + + # verify required fields with non-default values are left alone + assert "interconnectGroup" in jsonified_request + assert jsonified_request["interconnectGroup"] == "interconnect_group_value" + assert "project" in jsonified_request + assert jsonified_request["project"] == "project_value" + + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + request = request_type(**request_init) + + # Designate an appropriate value for the returned response. + return_value = compute.Operation() + # Mock the http request call within the method and fake a response. + with mock.patch.object(Session, "request") as req: + # We need to mock transcode() because providing default values + # for required fields will fail the real version if the http_options + # expect actual values for those fields. + with mock.patch.object(path_template, "transcode") as transcode: + # A uri without fields and an empty body will force all the + # request fields to show up in the query_params. + pb_request = request_type.pb(request) + transcode_result = { + "uri": "v1/sample_method", + "method": "delete", + "query_params": pb_request, + } + transcode.return_value = transcode_result + + response_value = Response() + response_value.status_code = 200 + + # Convert return value to protobuf type + return_value = compute.Operation.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + response = client.delete_unary(request) + + expected_params = [] + actual_params = req.call_args.kwargs["params"] + assert expected_params == actual_params + + +def test_delete_unary_rest_unset_required_fields(): + transport = transports.InterconnectGroupsRestTransport( + credentials=ga_credentials.AnonymousCredentials + ) + + unset_fields = transport.delete._get_unset_required_fields({}) + assert set(unset_fields) == ( + set(("requestId",)) + & set( + ( + "interconnectGroup", + "project", + ) + ) + ) + + +def test_delete_unary_rest_flattened(): + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = compute.Operation() + + # get arguments that satisfy an http rule for this method + sample_request = {"project": "sample1", "interconnect_group": "sample2"} + + # get truthy value for each flattened field + mock_args = dict( + project="project_value", + interconnect_group="interconnect_group_value", + ) + mock_args.update(sample_request) + + # Wrap the value into a proper Response obj + response_value = Response() + response_value.status_code = 200 + # Convert return value to protobuf type + return_value = compute.Operation.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + client.delete_unary(**mock_args) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(req.mock_calls) == 1 + _, args, _ = req.mock_calls[0] + assert path_template.validate( + "%s/compute/v1/projects/{project}/global/interconnectGroups/{interconnect_group}" + % client.transport._host, + args[1], + ) + + +def test_delete_unary_rest_flattened_error(transport: str = "rest"): + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.delete_unary( + compute.DeleteInterconnectGroupRequest(), + project="project_value", + interconnect_group="interconnect_group_value", + ) + + +def test_get_rest_use_cached_wrapped_rpc(): + # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, + # instead of constructing them on each call + with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Should wrap all calls on client creation + assert wrapper_fn.call_count > 0 + wrapper_fn.reset_mock() + + # Ensure method has been cached + assert client._transport.get in client._transport._wrapped_methods + + # Replace cached wrapped function with mock + mock_rpc = mock.Mock() + mock_rpc.return_value.name = ( + "foo" # operation_request.operation in compute client(s) expect a string. + ) + client._transport._wrapped_methods[client._transport.get] = mock_rpc + + request = {} + client.get(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + client.get(request) + + # Establish that a new wrapper was not created for this call + assert wrapper_fn.call_count == 0 + assert mock_rpc.call_count == 2 + + +def test_get_rest_required_fields(request_type=compute.GetInterconnectGroupRequest): + transport_class = transports.InterconnectGroupsRestTransport + + request_init = {} + request_init["interconnect_group"] = "" + request_init["project"] = "" + request = request_type(**request_init) + pb_request = request_type.pb(request) + jsonified_request = json.loads( + json_format.MessageToJson(pb_request, use_integers_for_enums=False) + ) + + # verify fields with default values are dropped + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).get._get_unset_required_fields(jsonified_request) + jsonified_request.update(unset_fields) + + # verify required fields with default values are now present + + jsonified_request["interconnectGroup"] = "interconnect_group_value" + jsonified_request["project"] = "project_value" + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).get._get_unset_required_fields(jsonified_request) + jsonified_request.update(unset_fields) + + # verify required fields with non-default values are left alone + assert "interconnectGroup" in jsonified_request + assert jsonified_request["interconnectGroup"] == "interconnect_group_value" + assert "project" in jsonified_request + assert jsonified_request["project"] == "project_value" + + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + request = request_type(**request_init) + + # Designate an appropriate value for the returned response. + return_value = compute.InterconnectGroup() + # Mock the http request call within the method and fake a response. + with mock.patch.object(Session, "request") as req: + # We need to mock transcode() because providing default values + # for required fields will fail the real version if the http_options + # expect actual values for those fields. + with mock.patch.object(path_template, "transcode") as transcode: + # A uri without fields and an empty body will force all the + # request fields to show up in the query_params. + pb_request = request_type.pb(request) + transcode_result = { + "uri": "v1/sample_method", + "method": "get", + "query_params": pb_request, + } + transcode.return_value = transcode_result + + response_value = Response() + response_value.status_code = 200 + + # Convert return value to protobuf type + return_value = compute.InterconnectGroup.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + response = client.get(request) + + expected_params = [] + actual_params = req.call_args.kwargs["params"] + assert expected_params == actual_params + + +def test_get_rest_unset_required_fields(): + transport = transports.InterconnectGroupsRestTransport( + credentials=ga_credentials.AnonymousCredentials + ) + + unset_fields = transport.get._get_unset_required_fields({}) + assert set(unset_fields) == ( + set(()) + & set( + ( + "interconnectGroup", + "project", + ) + ) + ) + + +def test_get_rest_flattened(): + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = compute.InterconnectGroup() + + # get arguments that satisfy an http rule for this method + sample_request = {"project": "sample1", "interconnect_group": "sample2"} + + # get truthy value for each flattened field + mock_args = dict( + project="project_value", + interconnect_group="interconnect_group_value", + ) + mock_args.update(sample_request) + + # Wrap the value into a proper Response obj + response_value = Response() + response_value.status_code = 200 + # Convert return value to protobuf type + return_value = compute.InterconnectGroup.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + client.get(**mock_args) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(req.mock_calls) == 1 + _, args, _ = req.mock_calls[0] + assert path_template.validate( + "%s/compute/v1/projects/{project}/global/interconnectGroups/{interconnect_group}" + % client.transport._host, + args[1], + ) + + +def test_get_rest_flattened_error(transport: str = "rest"): + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.get( + compute.GetInterconnectGroupRequest(), + project="project_value", + interconnect_group="interconnect_group_value", + ) + + +def test_get_iam_policy_rest_use_cached_wrapped_rpc(): + # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, + # instead of constructing them on each call + with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Should wrap all calls on client creation + assert wrapper_fn.call_count > 0 + wrapper_fn.reset_mock() + + # Ensure method has been cached + assert client._transport.get_iam_policy in client._transport._wrapped_methods + + # Replace cached wrapped function with mock + mock_rpc = mock.Mock() + mock_rpc.return_value.name = ( + "foo" # operation_request.operation in compute client(s) expect a string. + ) + client._transport._wrapped_methods[client._transport.get_iam_policy] = mock_rpc + + request = {} + client.get_iam_policy(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + client.get_iam_policy(request) + + # Establish that a new wrapper was not created for this call + assert wrapper_fn.call_count == 0 + assert mock_rpc.call_count == 2 + + +def test_get_iam_policy_rest_required_fields( + request_type=compute.GetIamPolicyInterconnectGroupRequest, +): + transport_class = transports.InterconnectGroupsRestTransport + + request_init = {} + request_init["project"] = "" + request_init["resource"] = "" + request = request_type(**request_init) + pb_request = request_type.pb(request) + jsonified_request = json.loads( + json_format.MessageToJson(pb_request, use_integers_for_enums=False) + ) + + # verify fields with default values are dropped + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).get_iam_policy._get_unset_required_fields(jsonified_request) + jsonified_request.update(unset_fields) + + # verify required fields with default values are now present + + jsonified_request["project"] = "project_value" + jsonified_request["resource"] = "resource_value" + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).get_iam_policy._get_unset_required_fields(jsonified_request) + # Check that path parameters and body parameters are not mixing in. + assert not set(unset_fields) - set(("options_requested_policy_version",)) + jsonified_request.update(unset_fields) + + # verify required fields with non-default values are left alone + assert "project" in jsonified_request + assert jsonified_request["project"] == "project_value" + assert "resource" in jsonified_request + assert jsonified_request["resource"] == "resource_value" + + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + request = request_type(**request_init) + + # Designate an appropriate value for the returned response. + return_value = compute.Policy() + # Mock the http request call within the method and fake a response. + with mock.patch.object(Session, "request") as req: + # We need to mock transcode() because providing default values + # for required fields will fail the real version if the http_options + # expect actual values for those fields. + with mock.patch.object(path_template, "transcode") as transcode: + # A uri without fields and an empty body will force all the + # request fields to show up in the query_params. + pb_request = request_type.pb(request) + transcode_result = { + "uri": "v1/sample_method", + "method": "get", + "query_params": pb_request, + } + transcode.return_value = transcode_result + + response_value = Response() + response_value.status_code = 200 + + # Convert return value to protobuf type + return_value = compute.Policy.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + response = client.get_iam_policy(request) + + expected_params = [] + actual_params = req.call_args.kwargs["params"] + assert expected_params == actual_params + + +def test_get_iam_policy_rest_unset_required_fields(): + transport = transports.InterconnectGroupsRestTransport( + credentials=ga_credentials.AnonymousCredentials + ) + + unset_fields = transport.get_iam_policy._get_unset_required_fields({}) + assert set(unset_fields) == ( + set(("optionsRequestedPolicyVersion",)) + & set( + ( + "project", + "resource", + ) + ) + ) + + +def test_get_iam_policy_rest_flattened(): + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = compute.Policy() + + # get arguments that satisfy an http rule for this method + sample_request = {"project": "sample1", "resource": "sample2"} + + # get truthy value for each flattened field + mock_args = dict( + project="project_value", + resource="resource_value", + ) + mock_args.update(sample_request) + + # Wrap the value into a proper Response obj + response_value = Response() + response_value.status_code = 200 + # Convert return value to protobuf type + return_value = compute.Policy.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + client.get_iam_policy(**mock_args) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(req.mock_calls) == 1 + _, args, _ = req.mock_calls[0] + assert path_template.validate( + "%s/compute/v1/projects/{project}/global/interconnectGroups/{resource}/getIamPolicy" + % client.transport._host, + args[1], + ) + + +def test_get_iam_policy_rest_flattened_error(transport: str = "rest"): + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.get_iam_policy( + compute.GetIamPolicyInterconnectGroupRequest(), + project="project_value", + resource="resource_value", + ) + + +def test_get_operational_status_rest_use_cached_wrapped_rpc(): + # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, + # instead of constructing them on each call + with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Should wrap all calls on client creation + assert wrapper_fn.call_count > 0 + wrapper_fn.reset_mock() + + # Ensure method has been cached + assert ( + client._transport.get_operational_status + in client._transport._wrapped_methods + ) + + # Replace cached wrapped function with mock + mock_rpc = mock.Mock() + mock_rpc.return_value.name = ( + "foo" # operation_request.operation in compute client(s) expect a string. + ) + client._transport._wrapped_methods[ + client._transport.get_operational_status + ] = mock_rpc + + request = {} + client.get_operational_status(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + client.get_operational_status(request) + + # Establish that a new wrapper was not created for this call + assert wrapper_fn.call_count == 0 + assert mock_rpc.call_count == 2 + + +def test_get_operational_status_rest_required_fields( + request_type=compute.GetOperationalStatusInterconnectGroupRequest, +): + transport_class = transports.InterconnectGroupsRestTransport + + request_init = {} + request_init["interconnect_group"] = "" + request_init["project"] = "" + request = request_type(**request_init) + pb_request = request_type.pb(request) + jsonified_request = json.loads( + json_format.MessageToJson(pb_request, use_integers_for_enums=False) + ) + + # verify fields with default values are dropped + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).get_operational_status._get_unset_required_fields(jsonified_request) + jsonified_request.update(unset_fields) + + # verify required fields with default values are now present + + jsonified_request["interconnectGroup"] = "interconnect_group_value" + jsonified_request["project"] = "project_value" + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).get_operational_status._get_unset_required_fields(jsonified_request) + jsonified_request.update(unset_fields) + + # verify required fields with non-default values are left alone + assert "interconnectGroup" in jsonified_request + assert jsonified_request["interconnectGroup"] == "interconnect_group_value" + assert "project" in jsonified_request + assert jsonified_request["project"] == "project_value" + + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + request = request_type(**request_init) + + # Designate an appropriate value for the returned response. + return_value = compute.InterconnectGroupsGetOperationalStatusResponse() + # Mock the http request call within the method and fake a response. + with mock.patch.object(Session, "request") as req: + # We need to mock transcode() because providing default values + # for required fields will fail the real version if the http_options + # expect actual values for those fields. + with mock.patch.object(path_template, "transcode") as transcode: + # A uri without fields and an empty body will force all the + # request fields to show up in the query_params. + pb_request = request_type.pb(request) + transcode_result = { + "uri": "v1/sample_method", + "method": "get", + "query_params": pb_request, + } + transcode.return_value = transcode_result + + response_value = Response() + response_value.status_code = 200 + + # Convert return value to protobuf type + return_value = compute.InterconnectGroupsGetOperationalStatusResponse.pb( + return_value + ) + json_return_value = json_format.MessageToJson(return_value) + + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + response = client.get_operational_status(request) + + expected_params = [] + actual_params = req.call_args.kwargs["params"] + assert expected_params == actual_params + + +def test_get_operational_status_rest_unset_required_fields(): + transport = transports.InterconnectGroupsRestTransport( + credentials=ga_credentials.AnonymousCredentials + ) + + unset_fields = transport.get_operational_status._get_unset_required_fields({}) + assert set(unset_fields) == ( + set(()) + & set( + ( + "interconnectGroup", + "project", + ) + ) + ) + + +def test_get_operational_status_rest_flattened(): + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = compute.InterconnectGroupsGetOperationalStatusResponse() + + # get arguments that satisfy an http rule for this method + sample_request = {"project": "sample1", "interconnect_group": "sample2"} + + # get truthy value for each flattened field + mock_args = dict( + project="project_value", + interconnect_group="interconnect_group_value", + ) + mock_args.update(sample_request) + + # Wrap the value into a proper Response obj + response_value = Response() + response_value.status_code = 200 + # Convert return value to protobuf type + return_value = compute.InterconnectGroupsGetOperationalStatusResponse.pb( + return_value + ) + json_return_value = json_format.MessageToJson(return_value) + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + client.get_operational_status(**mock_args) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(req.mock_calls) == 1 + _, args, _ = req.mock_calls[0] + assert path_template.validate( + "%s/compute/v1/projects/{project}/global/interconnectGroups/{interconnect_group}/getOperationalStatus" + % client.transport._host, + args[1], + ) + + +def test_get_operational_status_rest_flattened_error(transport: str = "rest"): + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.get_operational_status( + compute.GetOperationalStatusInterconnectGroupRequest(), + project="project_value", + interconnect_group="interconnect_group_value", + ) + + +def test_insert_rest_use_cached_wrapped_rpc(): + # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, + # instead of constructing them on each call + with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Should wrap all calls on client creation + assert wrapper_fn.call_count > 0 + wrapper_fn.reset_mock() + + # Ensure method has been cached + assert client._transport.insert in client._transport._wrapped_methods + + # Replace cached wrapped function with mock + mock_rpc = mock.Mock() + mock_rpc.return_value.name = ( + "foo" # operation_request.operation in compute client(s) expect a string. + ) + client._transport._wrapped_methods[client._transport.insert] = mock_rpc + + request = {} + client.insert(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + # Operation methods build a cached wrapper on first rpc call + # subsequent calls should use the cached wrapper + wrapper_fn.reset_mock() + + client.insert(request) + + # Establish that a new wrapper was not created for this call + assert wrapper_fn.call_count == 0 + assert mock_rpc.call_count == 2 + + +def test_insert_rest_required_fields( + request_type=compute.InsertInterconnectGroupRequest, +): + transport_class = transports.InterconnectGroupsRestTransport + + request_init = {} + request_init["project"] = "" + request = request_type(**request_init) + pb_request = request_type.pb(request) + jsonified_request = json.loads( + json_format.MessageToJson(pb_request, use_integers_for_enums=False) + ) + + # verify fields with default values are dropped + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).insert._get_unset_required_fields(jsonified_request) + jsonified_request.update(unset_fields) + + # verify required fields with default values are now present + + jsonified_request["project"] = "project_value" + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).insert._get_unset_required_fields(jsonified_request) + # Check that path parameters and body parameters are not mixing in. + assert not set(unset_fields) - set(("request_id",)) + jsonified_request.update(unset_fields) + + # verify required fields with non-default values are left alone + assert "project" in jsonified_request + assert jsonified_request["project"] == "project_value" + + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + request = request_type(**request_init) + + # Designate an appropriate value for the returned response. + return_value = compute.Operation() + # Mock the http request call within the method and fake a response. + with mock.patch.object(Session, "request") as req: + # We need to mock transcode() because providing default values + # for required fields will fail the real version if the http_options + # expect actual values for those fields. + with mock.patch.object(path_template, "transcode") as transcode: + # A uri without fields and an empty body will force all the + # request fields to show up in the query_params. + pb_request = request_type.pb(request) + transcode_result = { + "uri": "v1/sample_method", + "method": "post", + "query_params": pb_request, + } + transcode_result["body"] = pb_request + transcode.return_value = transcode_result + + response_value = Response() + response_value.status_code = 200 + + # Convert return value to protobuf type + return_value = compute.Operation.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + response = client.insert(request) + + expected_params = [] + actual_params = req.call_args.kwargs["params"] + assert expected_params == actual_params + + +def test_insert_rest_unset_required_fields(): + transport = transports.InterconnectGroupsRestTransport( + credentials=ga_credentials.AnonymousCredentials + ) + + unset_fields = transport.insert._get_unset_required_fields({}) + assert set(unset_fields) == ( + set(("requestId",)) + & set( + ( + "interconnectGroupResource", + "project", + ) + ) + ) + + +def test_insert_rest_flattened(): + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = compute.Operation() + + # get arguments that satisfy an http rule for this method + sample_request = {"project": "sample1"} + + # get truthy value for each flattened field + mock_args = dict( + project="project_value", + interconnect_group_resource=compute.InterconnectGroup( + configured=compute.InterconnectGroupConfigured( + topology_capability=compute.InterconnectGroupConfiguredTopologyCapability( + intended_capability_blockers=[ + compute.InterconnectGroupConfiguredTopologyCapabilityIntendedCapabilityBlockers( + blocker_type="blocker_type_value" + ) + ] + ) + ) + ), + ) + mock_args.update(sample_request) + + # Wrap the value into a proper Response obj + response_value = Response() + response_value.status_code = 200 + # Convert return value to protobuf type + return_value = compute.Operation.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + client.insert(**mock_args) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(req.mock_calls) == 1 + _, args, _ = req.mock_calls[0] + assert path_template.validate( + "%s/compute/v1/projects/{project}/global/interconnectGroups" + % client.transport._host, + args[1], + ) + + +def test_insert_rest_flattened_error(transport: str = "rest"): + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.insert( + compute.InsertInterconnectGroupRequest(), + project="project_value", + interconnect_group_resource=compute.InterconnectGroup( + configured=compute.InterconnectGroupConfigured( + topology_capability=compute.InterconnectGroupConfiguredTopologyCapability( + intended_capability_blockers=[ + compute.InterconnectGroupConfiguredTopologyCapabilityIntendedCapabilityBlockers( + blocker_type="blocker_type_value" + ) + ] + ) + ) + ), + ) + + +def test_insert_unary_rest_use_cached_wrapped_rpc(): + # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, + # instead of constructing them on each call + with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Should wrap all calls on client creation + assert wrapper_fn.call_count > 0 + wrapper_fn.reset_mock() + + # Ensure method has been cached + assert client._transport.insert in client._transport._wrapped_methods + + # Replace cached wrapped function with mock + mock_rpc = mock.Mock() + mock_rpc.return_value.name = ( + "foo" # operation_request.operation in compute client(s) expect a string. + ) + client._transport._wrapped_methods[client._transport.insert] = mock_rpc + + request = {} + client.insert_unary(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + # Operation methods build a cached wrapper on first rpc call + # subsequent calls should use the cached wrapper + wrapper_fn.reset_mock() + + client.insert_unary(request) + + # Establish that a new wrapper was not created for this call + assert wrapper_fn.call_count == 0 + assert mock_rpc.call_count == 2 + + +def test_insert_unary_rest_required_fields( + request_type=compute.InsertInterconnectGroupRequest, +): + transport_class = transports.InterconnectGroupsRestTransport + + request_init = {} + request_init["project"] = "" + request = request_type(**request_init) + pb_request = request_type.pb(request) + jsonified_request = json.loads( + json_format.MessageToJson(pb_request, use_integers_for_enums=False) + ) + + # verify fields with default values are dropped + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).insert._get_unset_required_fields(jsonified_request) + jsonified_request.update(unset_fields) + + # verify required fields with default values are now present + + jsonified_request["project"] = "project_value" + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).insert._get_unset_required_fields(jsonified_request) + # Check that path parameters and body parameters are not mixing in. + assert not set(unset_fields) - set(("request_id",)) + jsonified_request.update(unset_fields) + + # verify required fields with non-default values are left alone + assert "project" in jsonified_request + assert jsonified_request["project"] == "project_value" + + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + request = request_type(**request_init) + + # Designate an appropriate value for the returned response. + return_value = compute.Operation() + # Mock the http request call within the method and fake a response. + with mock.patch.object(Session, "request") as req: + # We need to mock transcode() because providing default values + # for required fields will fail the real version if the http_options + # expect actual values for those fields. + with mock.patch.object(path_template, "transcode") as transcode: + # A uri without fields and an empty body will force all the + # request fields to show up in the query_params. + pb_request = request_type.pb(request) + transcode_result = { + "uri": "v1/sample_method", + "method": "post", + "query_params": pb_request, + } + transcode_result["body"] = pb_request + transcode.return_value = transcode_result + + response_value = Response() + response_value.status_code = 200 + + # Convert return value to protobuf type + return_value = compute.Operation.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + response = client.insert_unary(request) + + expected_params = [] + actual_params = req.call_args.kwargs["params"] + assert expected_params == actual_params + + +def test_insert_unary_rest_unset_required_fields(): + transport = transports.InterconnectGroupsRestTransport( + credentials=ga_credentials.AnonymousCredentials + ) + + unset_fields = transport.insert._get_unset_required_fields({}) + assert set(unset_fields) == ( + set(("requestId",)) + & set( + ( + "interconnectGroupResource", + "project", + ) + ) + ) + + +def test_insert_unary_rest_flattened(): + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = compute.Operation() + + # get arguments that satisfy an http rule for this method + sample_request = {"project": "sample1"} + + # get truthy value for each flattened field + mock_args = dict( + project="project_value", + interconnect_group_resource=compute.InterconnectGroup( + configured=compute.InterconnectGroupConfigured( + topology_capability=compute.InterconnectGroupConfiguredTopologyCapability( + intended_capability_blockers=[ + compute.InterconnectGroupConfiguredTopologyCapabilityIntendedCapabilityBlockers( + blocker_type="blocker_type_value" + ) + ] + ) + ) + ), + ) + mock_args.update(sample_request) + + # Wrap the value into a proper Response obj + response_value = Response() + response_value.status_code = 200 + # Convert return value to protobuf type + return_value = compute.Operation.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + client.insert_unary(**mock_args) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(req.mock_calls) == 1 + _, args, _ = req.mock_calls[0] + assert path_template.validate( + "%s/compute/v1/projects/{project}/global/interconnectGroups" + % client.transport._host, + args[1], + ) + + +def test_insert_unary_rest_flattened_error(transport: str = "rest"): + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.insert_unary( + compute.InsertInterconnectGroupRequest(), + project="project_value", + interconnect_group_resource=compute.InterconnectGroup( + configured=compute.InterconnectGroupConfigured( + topology_capability=compute.InterconnectGroupConfiguredTopologyCapability( + intended_capability_blockers=[ + compute.InterconnectGroupConfiguredTopologyCapabilityIntendedCapabilityBlockers( + blocker_type="blocker_type_value" + ) + ] + ) + ) + ), + ) + + +def test_list_rest_use_cached_wrapped_rpc(): + # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, + # instead of constructing them on each call + with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Should wrap all calls on client creation + assert wrapper_fn.call_count > 0 + wrapper_fn.reset_mock() + + # Ensure method has been cached + assert client._transport.list in client._transport._wrapped_methods + + # Replace cached wrapped function with mock + mock_rpc = mock.Mock() + mock_rpc.return_value.name = ( + "foo" # operation_request.operation in compute client(s) expect a string. + ) + client._transport._wrapped_methods[client._transport.list] = mock_rpc + + request = {} + client.list(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + client.list(request) + + # Establish that a new wrapper was not created for this call + assert wrapper_fn.call_count == 0 + assert mock_rpc.call_count == 2 + + +def test_list_rest_required_fields(request_type=compute.ListInterconnectGroupsRequest): + transport_class = transports.InterconnectGroupsRestTransport + + request_init = {} + request_init["project"] = "" + request = request_type(**request_init) + pb_request = request_type.pb(request) + jsonified_request = json.loads( + json_format.MessageToJson(pb_request, use_integers_for_enums=False) + ) + + # verify fields with default values are dropped + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).list._get_unset_required_fields(jsonified_request) + jsonified_request.update(unset_fields) + + # verify required fields with default values are now present + + jsonified_request["project"] = "project_value" + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).list._get_unset_required_fields(jsonified_request) + # Check that path parameters and body parameters are not mixing in. + assert not set(unset_fields) - set( + ( + "filter", + "max_results", + "order_by", + "page_token", + "return_partial_success", + ) + ) + jsonified_request.update(unset_fields) + + # verify required fields with non-default values are left alone + assert "project" in jsonified_request + assert jsonified_request["project"] == "project_value" + + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + request = request_type(**request_init) + + # Designate an appropriate value for the returned response. + return_value = compute.InterconnectGroupsListResponse() + # Mock the http request call within the method and fake a response. + with mock.patch.object(Session, "request") as req: + # We need to mock transcode() because providing default values + # for required fields will fail the real version if the http_options + # expect actual values for those fields. + with mock.patch.object(path_template, "transcode") as transcode: + # A uri without fields and an empty body will force all the + # request fields to show up in the query_params. + pb_request = request_type.pb(request) + transcode_result = { + "uri": "v1/sample_method", + "method": "get", + "query_params": pb_request, + } + transcode.return_value = transcode_result + + response_value = Response() + response_value.status_code = 200 + + # Convert return value to protobuf type + return_value = compute.InterconnectGroupsListResponse.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + response = client.list(request) + + expected_params = [] + actual_params = req.call_args.kwargs["params"] + assert expected_params == actual_params + + +def test_list_rest_unset_required_fields(): + transport = transports.InterconnectGroupsRestTransport( + credentials=ga_credentials.AnonymousCredentials + ) + + unset_fields = transport.list._get_unset_required_fields({}) + assert set(unset_fields) == ( + set( + ( + "filter", + "maxResults", + "orderBy", + "pageToken", + "returnPartialSuccess", + ) + ) + & set(("project",)) + ) + + +def test_list_rest_flattened(): + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = compute.InterconnectGroupsListResponse() + + # get arguments that satisfy an http rule for this method + sample_request = {"project": "sample1"} + + # get truthy value for each flattened field + mock_args = dict( + project="project_value", + ) + mock_args.update(sample_request) + + # Wrap the value into a proper Response obj + response_value = Response() + response_value.status_code = 200 + # Convert return value to protobuf type + return_value = compute.InterconnectGroupsListResponse.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + client.list(**mock_args) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(req.mock_calls) == 1 + _, args, _ = req.mock_calls[0] + assert path_template.validate( + "%s/compute/v1/projects/{project}/global/interconnectGroups" + % client.transport._host, + args[1], + ) + + +def test_list_rest_flattened_error(transport: str = "rest"): + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.list( + compute.ListInterconnectGroupsRequest(), + project="project_value", + ) + + +def test_list_rest_pager(transport: str = "rest"): + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(Session, "request") as req: + # TODO(kbandes): remove this mock unless there's a good reason for it. + # with mock.patch.object(path_template, 'transcode') as transcode: + # Set the response as a series of pages + response = ( + compute.InterconnectGroupsListResponse( + items=[ + compute.InterconnectGroup(), + compute.InterconnectGroup(), + compute.InterconnectGroup(), + ], + next_page_token="abc", + ), + compute.InterconnectGroupsListResponse( + items=[], + next_page_token="def", + ), + compute.InterconnectGroupsListResponse( + items=[ + compute.InterconnectGroup(), + ], + next_page_token="ghi", + ), + compute.InterconnectGroupsListResponse( + items=[ + compute.InterconnectGroup(), + compute.InterconnectGroup(), + ], + ), + ) + # Two responses for two calls + response = response + response + + # Wrap the values into proper Response objs + response = tuple( + compute.InterconnectGroupsListResponse.to_json(x) for x in response + ) + return_values = tuple(Response() for i in response) + for return_val, response_val in zip(return_values, response): + return_val._content = response_val.encode("UTF-8") + return_val.status_code = 200 + req.side_effect = return_values + + sample_request = {"project": "sample1"} + + pager = client.list(request=sample_request) + + results = list(pager) + assert len(results) == 6 + assert all(isinstance(i, compute.InterconnectGroup) for i in results) + + pages = list(client.list(request=sample_request).pages) + for page_, token in zip(pages, ["abc", "def", "ghi", ""]): + assert page_.raw_page.next_page_token == token + + +def test_patch_rest_use_cached_wrapped_rpc(): + # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, + # instead of constructing them on each call + with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Should wrap all calls on client creation + assert wrapper_fn.call_count > 0 + wrapper_fn.reset_mock() + + # Ensure method has been cached + assert client._transport.patch in client._transport._wrapped_methods + + # Replace cached wrapped function with mock + mock_rpc = mock.Mock() + mock_rpc.return_value.name = ( + "foo" # operation_request.operation in compute client(s) expect a string. + ) + client._transport._wrapped_methods[client._transport.patch] = mock_rpc + + request = {} + client.patch(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + # Operation methods build a cached wrapper on first rpc call + # subsequent calls should use the cached wrapper + wrapper_fn.reset_mock() + + client.patch(request) + + # Establish that a new wrapper was not created for this call + assert wrapper_fn.call_count == 0 + assert mock_rpc.call_count == 2 + + +def test_patch_rest_required_fields(request_type=compute.PatchInterconnectGroupRequest): + transport_class = transports.InterconnectGroupsRestTransport + + request_init = {} + request_init["interconnect_group"] = "" + request_init["project"] = "" + request = request_type(**request_init) + pb_request = request_type.pb(request) + jsonified_request = json.loads( + json_format.MessageToJson(pb_request, use_integers_for_enums=False) + ) + + # verify fields with default values are dropped + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).patch._get_unset_required_fields(jsonified_request) + jsonified_request.update(unset_fields) + + # verify required fields with default values are now present + + jsonified_request["interconnectGroup"] = "interconnect_group_value" + jsonified_request["project"] = "project_value" + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).patch._get_unset_required_fields(jsonified_request) + # Check that path parameters and body parameters are not mixing in. + assert not set(unset_fields) - set( + ( + "request_id", + "update_mask", + ) + ) + jsonified_request.update(unset_fields) + + # verify required fields with non-default values are left alone + assert "interconnectGroup" in jsonified_request + assert jsonified_request["interconnectGroup"] == "interconnect_group_value" + assert "project" in jsonified_request + assert jsonified_request["project"] == "project_value" + + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + request = request_type(**request_init) + + # Designate an appropriate value for the returned response. + return_value = compute.Operation() + # Mock the http request call within the method and fake a response. + with mock.patch.object(Session, "request") as req: + # We need to mock transcode() because providing default values + # for required fields will fail the real version if the http_options + # expect actual values for those fields. + with mock.patch.object(path_template, "transcode") as transcode: + # A uri without fields and an empty body will force all the + # request fields to show up in the query_params. + pb_request = request_type.pb(request) + transcode_result = { + "uri": "v1/sample_method", + "method": "patch", + "query_params": pb_request, + } + transcode_result["body"] = pb_request + transcode.return_value = transcode_result + + response_value = Response() + response_value.status_code = 200 + + # Convert return value to protobuf type + return_value = compute.Operation.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + response = client.patch(request) + + expected_params = [] + actual_params = req.call_args.kwargs["params"] + assert expected_params == actual_params + + +def test_patch_rest_unset_required_fields(): + transport = transports.InterconnectGroupsRestTransport( + credentials=ga_credentials.AnonymousCredentials + ) + + unset_fields = transport.patch._get_unset_required_fields({}) + assert set(unset_fields) == ( + set( + ( + "requestId", + "updateMask", + ) + ) + & set( + ( + "interconnectGroup", + "interconnectGroupResource", + "project", + ) + ) + ) + + +def test_patch_rest_flattened(): + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = compute.Operation() + + # get arguments that satisfy an http rule for this method + sample_request = {"project": "sample1", "interconnect_group": "sample2"} + + # get truthy value for each flattened field + mock_args = dict( + project="project_value", + interconnect_group="interconnect_group_value", + interconnect_group_resource=compute.InterconnectGroup( + configured=compute.InterconnectGroupConfigured( + topology_capability=compute.InterconnectGroupConfiguredTopologyCapability( + intended_capability_blockers=[ + compute.InterconnectGroupConfiguredTopologyCapabilityIntendedCapabilityBlockers( + blocker_type="blocker_type_value" + ) + ] + ) + ) + ), + ) + mock_args.update(sample_request) + + # Wrap the value into a proper Response obj + response_value = Response() + response_value.status_code = 200 + # Convert return value to protobuf type + return_value = compute.Operation.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + client.patch(**mock_args) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(req.mock_calls) == 1 + _, args, _ = req.mock_calls[0] + assert path_template.validate( + "%s/compute/v1/projects/{project}/global/interconnectGroups/{interconnect_group}" + % client.transport._host, + args[1], + ) + + +def test_patch_rest_flattened_error(transport: str = "rest"): + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.patch( + compute.PatchInterconnectGroupRequest(), + project="project_value", + interconnect_group="interconnect_group_value", + interconnect_group_resource=compute.InterconnectGroup( + configured=compute.InterconnectGroupConfigured( + topology_capability=compute.InterconnectGroupConfiguredTopologyCapability( + intended_capability_blockers=[ + compute.InterconnectGroupConfiguredTopologyCapabilityIntendedCapabilityBlockers( + blocker_type="blocker_type_value" + ) + ] + ) + ) + ), + ) + + +def test_patch_unary_rest_use_cached_wrapped_rpc(): + # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, + # instead of constructing them on each call + with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Should wrap all calls on client creation + assert wrapper_fn.call_count > 0 + wrapper_fn.reset_mock() + + # Ensure method has been cached + assert client._transport.patch in client._transport._wrapped_methods + + # Replace cached wrapped function with mock + mock_rpc = mock.Mock() + mock_rpc.return_value.name = ( + "foo" # operation_request.operation in compute client(s) expect a string. + ) + client._transport._wrapped_methods[client._transport.patch] = mock_rpc + + request = {} + client.patch_unary(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + # Operation methods build a cached wrapper on first rpc call + # subsequent calls should use the cached wrapper + wrapper_fn.reset_mock() + + client.patch_unary(request) + + # Establish that a new wrapper was not created for this call + assert wrapper_fn.call_count == 0 + assert mock_rpc.call_count == 2 + + +def test_patch_unary_rest_required_fields( + request_type=compute.PatchInterconnectGroupRequest, +): + transport_class = transports.InterconnectGroupsRestTransport + + request_init = {} + request_init["interconnect_group"] = "" + request_init["project"] = "" + request = request_type(**request_init) + pb_request = request_type.pb(request) + jsonified_request = json.loads( + json_format.MessageToJson(pb_request, use_integers_for_enums=False) + ) + + # verify fields with default values are dropped + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).patch._get_unset_required_fields(jsonified_request) + jsonified_request.update(unset_fields) + + # verify required fields with default values are now present + + jsonified_request["interconnectGroup"] = "interconnect_group_value" + jsonified_request["project"] = "project_value" + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).patch._get_unset_required_fields(jsonified_request) + # Check that path parameters and body parameters are not mixing in. + assert not set(unset_fields) - set( + ( + "request_id", + "update_mask", + ) + ) + jsonified_request.update(unset_fields) + + # verify required fields with non-default values are left alone + assert "interconnectGroup" in jsonified_request + assert jsonified_request["interconnectGroup"] == "interconnect_group_value" + assert "project" in jsonified_request + assert jsonified_request["project"] == "project_value" + + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + request = request_type(**request_init) + + # Designate an appropriate value for the returned response. + return_value = compute.Operation() + # Mock the http request call within the method and fake a response. + with mock.patch.object(Session, "request") as req: + # We need to mock transcode() because providing default values + # for required fields will fail the real version if the http_options + # expect actual values for those fields. + with mock.patch.object(path_template, "transcode") as transcode: + # A uri without fields and an empty body will force all the + # request fields to show up in the query_params. + pb_request = request_type.pb(request) + transcode_result = { + "uri": "v1/sample_method", + "method": "patch", + "query_params": pb_request, + } + transcode_result["body"] = pb_request + transcode.return_value = transcode_result + + response_value = Response() + response_value.status_code = 200 + + # Convert return value to protobuf type + return_value = compute.Operation.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + response = client.patch_unary(request) + + expected_params = [] + actual_params = req.call_args.kwargs["params"] + assert expected_params == actual_params + + +def test_patch_unary_rest_unset_required_fields(): + transport = transports.InterconnectGroupsRestTransport( + credentials=ga_credentials.AnonymousCredentials + ) + + unset_fields = transport.patch._get_unset_required_fields({}) + assert set(unset_fields) == ( + set( + ( + "requestId", + "updateMask", + ) + ) + & set( + ( + "interconnectGroup", + "interconnectGroupResource", + "project", + ) + ) + ) + + +def test_patch_unary_rest_flattened(): + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = compute.Operation() + + # get arguments that satisfy an http rule for this method + sample_request = {"project": "sample1", "interconnect_group": "sample2"} + + # get truthy value for each flattened field + mock_args = dict( + project="project_value", + interconnect_group="interconnect_group_value", + interconnect_group_resource=compute.InterconnectGroup( + configured=compute.InterconnectGroupConfigured( + topology_capability=compute.InterconnectGroupConfiguredTopologyCapability( + intended_capability_blockers=[ + compute.InterconnectGroupConfiguredTopologyCapabilityIntendedCapabilityBlockers( + blocker_type="blocker_type_value" + ) + ] + ) + ) + ), + ) + mock_args.update(sample_request) + + # Wrap the value into a proper Response obj + response_value = Response() + response_value.status_code = 200 + # Convert return value to protobuf type + return_value = compute.Operation.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + client.patch_unary(**mock_args) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(req.mock_calls) == 1 + _, args, _ = req.mock_calls[0] + assert path_template.validate( + "%s/compute/v1/projects/{project}/global/interconnectGroups/{interconnect_group}" + % client.transport._host, + args[1], + ) + + +def test_patch_unary_rest_flattened_error(transport: str = "rest"): + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.patch_unary( + compute.PatchInterconnectGroupRequest(), + project="project_value", + interconnect_group="interconnect_group_value", + interconnect_group_resource=compute.InterconnectGroup( + configured=compute.InterconnectGroupConfigured( + topology_capability=compute.InterconnectGroupConfiguredTopologyCapability( + intended_capability_blockers=[ + compute.InterconnectGroupConfiguredTopologyCapabilityIntendedCapabilityBlockers( + blocker_type="blocker_type_value" + ) + ] + ) + ) + ), + ) + + +def test_set_iam_policy_rest_use_cached_wrapped_rpc(): + # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, + # instead of constructing them on each call + with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Should wrap all calls on client creation + assert wrapper_fn.call_count > 0 + wrapper_fn.reset_mock() + + # Ensure method has been cached + assert client._transport.set_iam_policy in client._transport._wrapped_methods + + # Replace cached wrapped function with mock + mock_rpc = mock.Mock() + mock_rpc.return_value.name = ( + "foo" # operation_request.operation in compute client(s) expect a string. + ) + client._transport._wrapped_methods[client._transport.set_iam_policy] = mock_rpc + + request = {} + client.set_iam_policy(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + client.set_iam_policy(request) + + # Establish that a new wrapper was not created for this call + assert wrapper_fn.call_count == 0 + assert mock_rpc.call_count == 2 + + +def test_set_iam_policy_rest_required_fields( + request_type=compute.SetIamPolicyInterconnectGroupRequest, +): + transport_class = transports.InterconnectGroupsRestTransport + + request_init = {} + request_init["project"] = "" + request_init["resource"] = "" + request = request_type(**request_init) + pb_request = request_type.pb(request) + jsonified_request = json.loads( + json_format.MessageToJson(pb_request, use_integers_for_enums=False) + ) + + # verify fields with default values are dropped + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).set_iam_policy._get_unset_required_fields(jsonified_request) + jsonified_request.update(unset_fields) + + # verify required fields with default values are now present + + jsonified_request["project"] = "project_value" + jsonified_request["resource"] = "resource_value" + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).set_iam_policy._get_unset_required_fields(jsonified_request) + jsonified_request.update(unset_fields) + + # verify required fields with non-default values are left alone + assert "project" in jsonified_request + assert jsonified_request["project"] == "project_value" + assert "resource" in jsonified_request + assert jsonified_request["resource"] == "resource_value" + + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + request = request_type(**request_init) + + # Designate an appropriate value for the returned response. + return_value = compute.Policy() + # Mock the http request call within the method and fake a response. + with mock.patch.object(Session, "request") as req: + # We need to mock transcode() because providing default values + # for required fields will fail the real version if the http_options + # expect actual values for those fields. + with mock.patch.object(path_template, "transcode") as transcode: + # A uri without fields and an empty body will force all the + # request fields to show up in the query_params. + pb_request = request_type.pb(request) + transcode_result = { + "uri": "v1/sample_method", + "method": "post", + "query_params": pb_request, + } + transcode_result["body"] = pb_request + transcode.return_value = transcode_result + + response_value = Response() + response_value.status_code = 200 + + # Convert return value to protobuf type + return_value = compute.Policy.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + response = client.set_iam_policy(request) + + expected_params = [] + actual_params = req.call_args.kwargs["params"] + assert expected_params == actual_params + + +def test_set_iam_policy_rest_unset_required_fields(): + transport = transports.InterconnectGroupsRestTransport( + credentials=ga_credentials.AnonymousCredentials + ) + + unset_fields = transport.set_iam_policy._get_unset_required_fields({}) + assert set(unset_fields) == ( + set(()) + & set( + ( + "globalSetPolicyRequestResource", + "project", + "resource", + ) + ) + ) + + +def test_set_iam_policy_rest_flattened(): + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = compute.Policy() + + # get arguments that satisfy an http rule for this method + sample_request = {"project": "sample1", "resource": "sample2"} + + # get truthy value for each flattened field + mock_args = dict( + project="project_value", + resource="resource_value", + global_set_policy_request_resource=compute.GlobalSetPolicyRequest( + bindings=[compute.Binding(binding_id="binding_id_value")] + ), + ) + mock_args.update(sample_request) + + # Wrap the value into a proper Response obj + response_value = Response() + response_value.status_code = 200 + # Convert return value to protobuf type + return_value = compute.Policy.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + client.set_iam_policy(**mock_args) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(req.mock_calls) == 1 + _, args, _ = req.mock_calls[0] + assert path_template.validate( + "%s/compute/v1/projects/{project}/global/interconnectGroups/{resource}/setIamPolicy" + % client.transport._host, + args[1], + ) + + +def test_set_iam_policy_rest_flattened_error(transport: str = "rest"): + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.set_iam_policy( + compute.SetIamPolicyInterconnectGroupRequest(), + project="project_value", + resource="resource_value", + global_set_policy_request_resource=compute.GlobalSetPolicyRequest( + bindings=[compute.Binding(binding_id="binding_id_value")] + ), + ) + + +def test_test_iam_permissions_rest_use_cached_wrapped_rpc(): + # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, + # instead of constructing them on each call + with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Should wrap all calls on client creation + assert wrapper_fn.call_count > 0 + wrapper_fn.reset_mock() + + # Ensure method has been cached + assert ( + client._transport.test_iam_permissions in client._transport._wrapped_methods + ) + + # Replace cached wrapped function with mock + mock_rpc = mock.Mock() + mock_rpc.return_value.name = ( + "foo" # operation_request.operation in compute client(s) expect a string. + ) + client._transport._wrapped_methods[ + client._transport.test_iam_permissions + ] = mock_rpc + + request = {} + client.test_iam_permissions(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + client.test_iam_permissions(request) + + # Establish that a new wrapper was not created for this call + assert wrapper_fn.call_count == 0 + assert mock_rpc.call_count == 2 + + +def test_test_iam_permissions_rest_required_fields( + request_type=compute.TestIamPermissionsInterconnectGroupRequest, +): + transport_class = transports.InterconnectGroupsRestTransport + + request_init = {} + request_init["project"] = "" + request_init["resource"] = "" + request = request_type(**request_init) + pb_request = request_type.pb(request) + jsonified_request = json.loads( + json_format.MessageToJson(pb_request, use_integers_for_enums=False) + ) + + # verify fields with default values are dropped + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).test_iam_permissions._get_unset_required_fields(jsonified_request) + jsonified_request.update(unset_fields) + + # verify required fields with default values are now present + + jsonified_request["project"] = "project_value" + jsonified_request["resource"] = "resource_value" + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).test_iam_permissions._get_unset_required_fields(jsonified_request) + jsonified_request.update(unset_fields) + + # verify required fields with non-default values are left alone + assert "project" in jsonified_request + assert jsonified_request["project"] == "project_value" + assert "resource" in jsonified_request + assert jsonified_request["resource"] == "resource_value" + + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + request = request_type(**request_init) + + # Designate an appropriate value for the returned response. + return_value = compute.TestPermissionsResponse() + # Mock the http request call within the method and fake a response. + with mock.patch.object(Session, "request") as req: + # We need to mock transcode() because providing default values + # for required fields will fail the real version if the http_options + # expect actual values for those fields. + with mock.patch.object(path_template, "transcode") as transcode: + # A uri without fields and an empty body will force all the + # request fields to show up in the query_params. + pb_request = request_type.pb(request) + transcode_result = { + "uri": "v1/sample_method", + "method": "post", + "query_params": pb_request, + } + transcode_result["body"] = pb_request + transcode.return_value = transcode_result + + response_value = Response() + response_value.status_code = 200 + + # Convert return value to protobuf type + return_value = compute.TestPermissionsResponse.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + response = client.test_iam_permissions(request) + + expected_params = [] + actual_params = req.call_args.kwargs["params"] + assert expected_params == actual_params + + +def test_test_iam_permissions_rest_unset_required_fields(): + transport = transports.InterconnectGroupsRestTransport( + credentials=ga_credentials.AnonymousCredentials + ) + + unset_fields = transport.test_iam_permissions._get_unset_required_fields({}) + assert set(unset_fields) == ( + set(()) + & set( + ( + "project", + "resource", + "testPermissionsRequestResource", + ) + ) + ) + + +def test_test_iam_permissions_rest_flattened(): + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = compute.TestPermissionsResponse() + + # get arguments that satisfy an http rule for this method + sample_request = {"project": "sample1", "resource": "sample2"} + + # get truthy value for each flattened field + mock_args = dict( + project="project_value", + resource="resource_value", + test_permissions_request_resource=compute.TestPermissionsRequest( + permissions=["permissions_value"] + ), + ) + mock_args.update(sample_request) + + # Wrap the value into a proper Response obj + response_value = Response() + response_value.status_code = 200 + # Convert return value to protobuf type + return_value = compute.TestPermissionsResponse.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + client.test_iam_permissions(**mock_args) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(req.mock_calls) == 1 + _, args, _ = req.mock_calls[0] + assert path_template.validate( + "%s/compute/v1/projects/{project}/global/interconnectGroups/{resource}/testIamPermissions" + % client.transport._host, + args[1], + ) + + +def test_test_iam_permissions_rest_flattened_error(transport: str = "rest"): + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.test_iam_permissions( + compute.TestIamPermissionsInterconnectGroupRequest(), + project="project_value", + resource="resource_value", + test_permissions_request_resource=compute.TestPermissionsRequest( + permissions=["permissions_value"] + ), + ) + + +def test_credentials_transport_error(): + # It is an error to provide credentials and a transport instance. + transport = transports.InterconnectGroupsRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + ) + with pytest.raises(ValueError): + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # It is an error to provide a credentials file and a transport instance. + transport = transports.InterconnectGroupsRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + ) + with pytest.raises(ValueError): + client = InterconnectGroupsClient( + client_options={"credentials_file": "credentials.json"}, + transport=transport, + ) + + # It is an error to provide an api_key and a transport instance. + transport = transports.InterconnectGroupsRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + ) + options = client_options.ClientOptions() + options.api_key = "api_key" + with pytest.raises(ValueError): + client = InterconnectGroupsClient( + client_options=options, + transport=transport, + ) + + # It is an error to provide an api_key and a credential. + options = client_options.ClientOptions() + options.api_key = "api_key" + with pytest.raises(ValueError): + client = InterconnectGroupsClient( + client_options=options, credentials=ga_credentials.AnonymousCredentials() + ) + + # It is an error to provide scopes and a transport instance. + transport = transports.InterconnectGroupsRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + ) + with pytest.raises(ValueError): + client = InterconnectGroupsClient( + client_options={"scopes": ["1", "2"]}, + transport=transport, + ) + + +def test_transport_instance(): + # A client may be instantiated with a custom transport instance. + transport = transports.InterconnectGroupsRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + ) + client = InterconnectGroupsClient(transport=transport) + assert client.transport is transport + + +@pytest.mark.parametrize( + "transport_class", + [ + transports.InterconnectGroupsRestTransport, + ], +) +def test_transport_adc(transport_class): + # Test default credentials are used if not provided. + with mock.patch.object(google.auth, "default") as adc: + adc.return_value = (ga_credentials.AnonymousCredentials(), None) + transport_class() + adc.assert_called_once() + + +def test_transport_kind_rest(): + transport = InterconnectGroupsClient.get_transport_class("rest")( + credentials=ga_credentials.AnonymousCredentials() + ) + assert transport.kind == "rest" + + +def test_create_members_rest_bad_request( + request_type=compute.CreateMembersInterconnectGroupRequest, +): + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + # send a request that will satisfy transcoding + request_init = {"project": "sample1", "interconnect_group": "sample2"} + request = request_type(**request_init) + + # Mock the http request call within the method and fake a BadRequest error. + with mock.patch.object(Session, "request") as req, pytest.raises( + core_exceptions.BadRequest + ): + # Wrap the value into a proper Response obj + response_value = mock.Mock() + json_return_value = "" + response_value.json = mock.Mock(return_value={}) + response_value.status_code = 400 + response_value.request = mock.Mock() + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + client.create_members(request) + + +@pytest.mark.parametrize( + "request_type", + [ + compute.CreateMembersInterconnectGroupRequest, + dict, + ], +) +def test_create_members_rest_call_success(request_type): + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + + # send a request that will satisfy transcoding + request_init = {"project": "sample1", "interconnect_group": "sample2"} + request_init["interconnect_groups_create_members_request_resource"] = { + "request": { + "intent_mismatch_behavior": "intent_mismatch_behavior_value", + "interconnects": [ + { + "admin_enabled": True, + "customer_name": "customer_name_value", + "description": "description_value", + "facility": "facility_value", + "interconnect_type": "interconnect_type_value", + "link_type": "link_type_value", + "name": "name_value", + "noc_contact_email": "noc_contact_email_value", + "remote_location": "remote_location_value", + "requested_features": [ + "requested_features_value1", + "requested_features_value2", + ], + "requested_link_count": 2151, + } + ], + "template_interconnect": {}, + } + } + # The version of a generated dependency at test runtime may differ from the version used during generation. + # Delete any fields which are not present in the current runtime dependency + # See https://github.com/googleapis/gapic-generator-python/issues/1748 + + # Determine if the message type is proto-plus or protobuf + test_field = compute.CreateMembersInterconnectGroupRequest.meta.fields[ + "interconnect_groups_create_members_request_resource" + ] + + def get_message_fields(field): + # Given a field which is a message (composite type), return a list with + # all the fields of the message. + # If the field is not a composite type, return an empty list. + message_fields = [] + + if hasattr(field, "message") and field.message: + is_field_type_proto_plus_type = not hasattr(field.message, "DESCRIPTOR") + + if is_field_type_proto_plus_type: + message_fields = field.message.meta.fields.values() + # Add `# pragma: NO COVER` because there may not be any `*_pb2` field types + else: # pragma: NO COVER + message_fields = field.message.DESCRIPTOR.fields + return message_fields + + runtime_nested_fields = [ + (field.name, nested_field.name) + for field in get_message_fields(test_field) + for nested_field in get_message_fields(field) + ] + + subfields_not_in_runtime = [] + + # For each item in the sample request, create a list of sub fields which are not present at runtime + # Add `# pragma: NO COVER` because this test code will not run if all subfields are present at runtime + for field, value in request_init[ + "interconnect_groups_create_members_request_resource" + ].items(): # pragma: NO COVER + result = None + is_repeated = False + # For repeated fields + if isinstance(value, list) and len(value): + is_repeated = True + result = value[0] + # For fields where the type is another message + if isinstance(value, dict): + result = value + + if result and hasattr(result, "keys"): + for subfield in result.keys(): + if (field, subfield) not in runtime_nested_fields: + subfields_not_in_runtime.append( + { + "field": field, + "subfield": subfield, + "is_repeated": is_repeated, + } + ) + + # Remove fields from the sample request which are not present in the runtime version of the dependency + # Add `# pragma: NO COVER` because this test code will not run if all subfields are present at runtime + for subfield_to_delete in subfields_not_in_runtime: # pragma: NO COVER + field = subfield_to_delete.get("field") + field_repeated = subfield_to_delete.get("is_repeated") + subfield = subfield_to_delete.get("subfield") + if subfield: + if field_repeated: + for i in range( + 0, + len( + request_init[ + "interconnect_groups_create_members_request_resource" + ][field] + ), + ): + del request_init[ + "interconnect_groups_create_members_request_resource" + ][field][i][subfield] + else: + del request_init["interconnect_groups_create_members_request_resource"][ + field + ][subfield] + request = request_type(**request_init) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = compute.Operation( + client_operation_id="client_operation_id_value", + creation_timestamp="creation_timestamp_value", + description="description_value", + end_time="end_time_value", + http_error_message="http_error_message_value", + http_error_status_code=2374, + id=205, + insert_time="insert_time_value", + kind="kind_value", + name="name_value", + operation_group_id="operation_group_id_value", + operation_type="operation_type_value", + progress=885, + region="region_value", + self_link="self_link_value", + start_time="start_time_value", + status=compute.Operation.Status.DONE, + status_message="status_message_value", + target_id=947, + target_link="target_link_value", + user="user_value", + zone="zone_value", + ) + + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.status_code = 200 + + # Convert return value to protobuf type + return_value = compute.Operation.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + response_value.content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + response = client.create_members(request) + + # Establish that the response is the type that we expect. + assert isinstance(response, extended_operation.ExtendedOperation) + assert response.client_operation_id == "client_operation_id_value" + assert response.creation_timestamp == "creation_timestamp_value" + assert response.description == "description_value" + assert response.end_time == "end_time_value" + assert response.http_error_message == "http_error_message_value" + assert response.http_error_status_code == 2374 + assert response.id == 205 + assert response.insert_time == "insert_time_value" + assert response.kind == "kind_value" + assert response.name == "name_value" + assert response.operation_group_id == "operation_group_id_value" + assert response.operation_type == "operation_type_value" + assert response.progress == 885 + assert response.region == "region_value" + assert response.self_link == "self_link_value" + assert response.start_time == "start_time_value" + assert response.status == compute.Operation.Status.DONE + assert response.status_message == "status_message_value" + assert response.target_id == 947 + assert response.target_link == "target_link_value" + assert response.user == "user_value" + assert response.zone == "zone_value" + + +@pytest.mark.parametrize("null_interceptor", [True, False]) +def test_create_members_rest_interceptors(null_interceptor): + transport = transports.InterconnectGroupsRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + interceptor=None + if null_interceptor + else transports.InterconnectGroupsRestInterceptor(), + ) + client = InterconnectGroupsClient(transport=transport) + + with mock.patch.object( + type(client.transport._session), "request" + ) as req, mock.patch.object( + path_template, "transcode" + ) as transcode, mock.patch.object( + transports.InterconnectGroupsRestInterceptor, "post_create_members" + ) as post, mock.patch.object( + transports.InterconnectGroupsRestInterceptor, + "post_create_members_with_metadata", + ) as post_with_metadata, mock.patch.object( + transports.InterconnectGroupsRestInterceptor, "pre_create_members" + ) as pre: + pre.assert_not_called() + post.assert_not_called() + post_with_metadata.assert_not_called() + pb_message = compute.CreateMembersInterconnectGroupRequest.pb( + compute.CreateMembersInterconnectGroupRequest() + ) + transcode.return_value = { + "method": "post", + "uri": "my_uri", + "body": pb_message, + "query_params": pb_message, + } + + req.return_value = mock.Mock() + req.return_value.status_code = 200 + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + return_value = compute.Operation.to_json(compute.Operation()) + req.return_value.content = return_value + + request = compute.CreateMembersInterconnectGroupRequest() + metadata = [ + ("key", "val"), + ("cephalopod", "squid"), + ] + pre.return_value = request, metadata + post.return_value = compute.Operation() + post_with_metadata.return_value = compute.Operation(), metadata + + client.create_members( + request, + metadata=[ + ("key", "val"), + ("cephalopod", "squid"), + ], + ) + + pre.assert_called_once() + post.assert_called_once() + post_with_metadata.assert_called_once() + + +def test_delete_rest_bad_request(request_type=compute.DeleteInterconnectGroupRequest): + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + # send a request that will satisfy transcoding + request_init = {"project": "sample1", "interconnect_group": "sample2"} + request = request_type(**request_init) + + # Mock the http request call within the method and fake a BadRequest error. + with mock.patch.object(Session, "request") as req, pytest.raises( + core_exceptions.BadRequest + ): + # Wrap the value into a proper Response obj + response_value = mock.Mock() + json_return_value = "" + response_value.json = mock.Mock(return_value={}) + response_value.status_code = 400 + response_value.request = mock.Mock() + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + client.delete(request) + + +@pytest.mark.parametrize( + "request_type", + [ + compute.DeleteInterconnectGroupRequest, + dict, + ], +) +def test_delete_rest_call_success(request_type): + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + + # send a request that will satisfy transcoding + request_init = {"project": "sample1", "interconnect_group": "sample2"} + request = request_type(**request_init) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = compute.Operation( + client_operation_id="client_operation_id_value", + creation_timestamp="creation_timestamp_value", + description="description_value", + end_time="end_time_value", + http_error_message="http_error_message_value", + http_error_status_code=2374, + id=205, + insert_time="insert_time_value", + kind="kind_value", + name="name_value", + operation_group_id="operation_group_id_value", + operation_type="operation_type_value", + progress=885, + region="region_value", + self_link="self_link_value", + start_time="start_time_value", + status=compute.Operation.Status.DONE, + status_message="status_message_value", + target_id=947, + target_link="target_link_value", + user="user_value", + zone="zone_value", + ) + + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.status_code = 200 + + # Convert return value to protobuf type + return_value = compute.Operation.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + response_value.content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + response = client.delete(request) + + # Establish that the response is the type that we expect. + assert isinstance(response, extended_operation.ExtendedOperation) + assert response.client_operation_id == "client_operation_id_value" + assert response.creation_timestamp == "creation_timestamp_value" + assert response.description == "description_value" + assert response.end_time == "end_time_value" + assert response.http_error_message == "http_error_message_value" + assert response.http_error_status_code == 2374 + assert response.id == 205 + assert response.insert_time == "insert_time_value" + assert response.kind == "kind_value" + assert response.name == "name_value" + assert response.operation_group_id == "operation_group_id_value" + assert response.operation_type == "operation_type_value" + assert response.progress == 885 + assert response.region == "region_value" + assert response.self_link == "self_link_value" + assert response.start_time == "start_time_value" + assert response.status == compute.Operation.Status.DONE + assert response.status_message == "status_message_value" + assert response.target_id == 947 + assert response.target_link == "target_link_value" + assert response.user == "user_value" + assert response.zone == "zone_value" + + +@pytest.mark.parametrize("null_interceptor", [True, False]) +def test_delete_rest_interceptors(null_interceptor): + transport = transports.InterconnectGroupsRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + interceptor=None + if null_interceptor + else transports.InterconnectGroupsRestInterceptor(), + ) + client = InterconnectGroupsClient(transport=transport) + + with mock.patch.object( + type(client.transport._session), "request" + ) as req, mock.patch.object( + path_template, "transcode" + ) as transcode, mock.patch.object( + transports.InterconnectGroupsRestInterceptor, "post_delete" + ) as post, mock.patch.object( + transports.InterconnectGroupsRestInterceptor, "post_delete_with_metadata" + ) as post_with_metadata, mock.patch.object( + transports.InterconnectGroupsRestInterceptor, "pre_delete" + ) as pre: + pre.assert_not_called() + post.assert_not_called() + post_with_metadata.assert_not_called() + pb_message = compute.DeleteInterconnectGroupRequest.pb( + compute.DeleteInterconnectGroupRequest() + ) + transcode.return_value = { + "method": "post", + "uri": "my_uri", + "body": pb_message, + "query_params": pb_message, + } + + req.return_value = mock.Mock() + req.return_value.status_code = 200 + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + return_value = compute.Operation.to_json(compute.Operation()) + req.return_value.content = return_value + + request = compute.DeleteInterconnectGroupRequest() + metadata = [ + ("key", "val"), + ("cephalopod", "squid"), + ] + pre.return_value = request, metadata + post.return_value = compute.Operation() + post_with_metadata.return_value = compute.Operation(), metadata + + client.delete( + request, + metadata=[ + ("key", "val"), + ("cephalopod", "squid"), + ], + ) + + pre.assert_called_once() + post.assert_called_once() + post_with_metadata.assert_called_once() + + +def test_get_rest_bad_request(request_type=compute.GetInterconnectGroupRequest): + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + # send a request that will satisfy transcoding + request_init = {"project": "sample1", "interconnect_group": "sample2"} + request = request_type(**request_init) + + # Mock the http request call within the method and fake a BadRequest error. + with mock.patch.object(Session, "request") as req, pytest.raises( + core_exceptions.BadRequest + ): + # Wrap the value into a proper Response obj + response_value = mock.Mock() + json_return_value = "" + response_value.json = mock.Mock(return_value={}) + response_value.status_code = 400 + response_value.request = mock.Mock() + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + client.get(request) + + +@pytest.mark.parametrize( + "request_type", + [ + compute.GetInterconnectGroupRequest, + dict, + ], +) +def test_get_rest_call_success(request_type): + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + + # send a request that will satisfy transcoding + request_init = {"project": "sample1", "interconnect_group": "sample2"} + request = request_type(**request_init) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = compute.InterconnectGroup( + creation_timestamp="creation_timestamp_value", + description="description_value", + etag="etag_value", + id=205, + kind="kind_value", + name="name_value", + self_link="self_link_value", + ) + + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.status_code = 200 + + # Convert return value to protobuf type + return_value = compute.InterconnectGroup.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + response_value.content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + response = client.get(request) + + # Establish that the response is the type that we expect. + assert isinstance(response, compute.InterconnectGroup) + assert response.creation_timestamp == "creation_timestamp_value" + assert response.description == "description_value" + assert response.etag == "etag_value" + assert response.id == 205 + assert response.kind == "kind_value" + assert response.name == "name_value" + assert response.self_link == "self_link_value" + + +@pytest.mark.parametrize("null_interceptor", [True, False]) +def test_get_rest_interceptors(null_interceptor): + transport = transports.InterconnectGroupsRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + interceptor=None + if null_interceptor + else transports.InterconnectGroupsRestInterceptor(), + ) + client = InterconnectGroupsClient(transport=transport) + + with mock.patch.object( + type(client.transport._session), "request" + ) as req, mock.patch.object( + path_template, "transcode" + ) as transcode, mock.patch.object( + transports.InterconnectGroupsRestInterceptor, "post_get" + ) as post, mock.patch.object( + transports.InterconnectGroupsRestInterceptor, "post_get_with_metadata" + ) as post_with_metadata, mock.patch.object( + transports.InterconnectGroupsRestInterceptor, "pre_get" + ) as pre: + pre.assert_not_called() + post.assert_not_called() + post_with_metadata.assert_not_called() + pb_message = compute.GetInterconnectGroupRequest.pb( + compute.GetInterconnectGroupRequest() + ) + transcode.return_value = { + "method": "post", + "uri": "my_uri", + "body": pb_message, + "query_params": pb_message, + } + + req.return_value = mock.Mock() + req.return_value.status_code = 200 + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + return_value = compute.InterconnectGroup.to_json(compute.InterconnectGroup()) + req.return_value.content = return_value + + request = compute.GetInterconnectGroupRequest() + metadata = [ + ("key", "val"), + ("cephalopod", "squid"), + ] + pre.return_value = request, metadata + post.return_value = compute.InterconnectGroup() + post_with_metadata.return_value = compute.InterconnectGroup(), metadata + + client.get( + request, + metadata=[ + ("key", "val"), + ("cephalopod", "squid"), + ], + ) + + pre.assert_called_once() + post.assert_called_once() + post_with_metadata.assert_called_once() + + +def test_get_iam_policy_rest_bad_request( + request_type=compute.GetIamPolicyInterconnectGroupRequest, +): + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + # send a request that will satisfy transcoding + request_init = {"project": "sample1", "resource": "sample2"} + request = request_type(**request_init) + + # Mock the http request call within the method and fake a BadRequest error. + with mock.patch.object(Session, "request") as req, pytest.raises( + core_exceptions.BadRequest + ): + # Wrap the value into a proper Response obj + response_value = mock.Mock() + json_return_value = "" + response_value.json = mock.Mock(return_value={}) + response_value.status_code = 400 + response_value.request = mock.Mock() + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + client.get_iam_policy(request) + + +@pytest.mark.parametrize( + "request_type", + [ + compute.GetIamPolicyInterconnectGroupRequest, + dict, + ], +) +def test_get_iam_policy_rest_call_success(request_type): + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + + # send a request that will satisfy transcoding + request_init = {"project": "sample1", "resource": "sample2"} + request = request_type(**request_init) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = compute.Policy( + etag="etag_value", + iam_owned=True, + version=774, + ) + + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.status_code = 200 + + # Convert return value to protobuf type + return_value = compute.Policy.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + response_value.content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + response = client.get_iam_policy(request) + + # Establish that the response is the type that we expect. + assert isinstance(response, compute.Policy) + assert response.etag == "etag_value" + assert response.iam_owned is True + assert response.version == 774 + + +@pytest.mark.parametrize("null_interceptor", [True, False]) +def test_get_iam_policy_rest_interceptors(null_interceptor): + transport = transports.InterconnectGroupsRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + interceptor=None + if null_interceptor + else transports.InterconnectGroupsRestInterceptor(), + ) + client = InterconnectGroupsClient(transport=transport) + + with mock.patch.object( + type(client.transport._session), "request" + ) as req, mock.patch.object( + path_template, "transcode" + ) as transcode, mock.patch.object( + transports.InterconnectGroupsRestInterceptor, "post_get_iam_policy" + ) as post, mock.patch.object( + transports.InterconnectGroupsRestInterceptor, + "post_get_iam_policy_with_metadata", + ) as post_with_metadata, mock.patch.object( + transports.InterconnectGroupsRestInterceptor, "pre_get_iam_policy" + ) as pre: + pre.assert_not_called() + post.assert_not_called() + post_with_metadata.assert_not_called() + pb_message = compute.GetIamPolicyInterconnectGroupRequest.pb( + compute.GetIamPolicyInterconnectGroupRequest() + ) + transcode.return_value = { + "method": "post", + "uri": "my_uri", + "body": pb_message, + "query_params": pb_message, + } + + req.return_value = mock.Mock() + req.return_value.status_code = 200 + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + return_value = compute.Policy.to_json(compute.Policy()) + req.return_value.content = return_value + + request = compute.GetIamPolicyInterconnectGroupRequest() + metadata = [ + ("key", "val"), + ("cephalopod", "squid"), + ] + pre.return_value = request, metadata + post.return_value = compute.Policy() + post_with_metadata.return_value = compute.Policy(), metadata + + client.get_iam_policy( + request, + metadata=[ + ("key", "val"), + ("cephalopod", "squid"), + ], + ) + + pre.assert_called_once() + post.assert_called_once() + post_with_metadata.assert_called_once() + + +def test_get_operational_status_rest_bad_request( + request_type=compute.GetOperationalStatusInterconnectGroupRequest, +): + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + # send a request that will satisfy transcoding + request_init = {"project": "sample1", "interconnect_group": "sample2"} + request = request_type(**request_init) + + # Mock the http request call within the method and fake a BadRequest error. + with mock.patch.object(Session, "request") as req, pytest.raises( + core_exceptions.BadRequest + ): + # Wrap the value into a proper Response obj + response_value = mock.Mock() + json_return_value = "" + response_value.json = mock.Mock(return_value={}) + response_value.status_code = 400 + response_value.request = mock.Mock() + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + client.get_operational_status(request) + + +@pytest.mark.parametrize( + "request_type", + [ + compute.GetOperationalStatusInterconnectGroupRequest, + dict, + ], +) +def test_get_operational_status_rest_call_success(request_type): + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + + # send a request that will satisfy transcoding + request_init = {"project": "sample1", "interconnect_group": "sample2"} + request = request_type(**request_init) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = compute.InterconnectGroupsGetOperationalStatusResponse( + etag="etag_value", + ) + + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.status_code = 200 + + # Convert return value to protobuf type + return_value = compute.InterconnectGroupsGetOperationalStatusResponse.pb( + return_value + ) + json_return_value = json_format.MessageToJson(return_value) + response_value.content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + response = client.get_operational_status(request) + + # Establish that the response is the type that we expect. + assert isinstance(response, compute.InterconnectGroupsGetOperationalStatusResponse) + assert response.etag == "etag_value" + + +@pytest.mark.parametrize("null_interceptor", [True, False]) +def test_get_operational_status_rest_interceptors(null_interceptor): + transport = transports.InterconnectGroupsRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + interceptor=None + if null_interceptor + else transports.InterconnectGroupsRestInterceptor(), + ) + client = InterconnectGroupsClient(transport=transport) + + with mock.patch.object( + type(client.transport._session), "request" + ) as req, mock.patch.object( + path_template, "transcode" + ) as transcode, mock.patch.object( + transports.InterconnectGroupsRestInterceptor, "post_get_operational_status" + ) as post, mock.patch.object( + transports.InterconnectGroupsRestInterceptor, + "post_get_operational_status_with_metadata", + ) as post_with_metadata, mock.patch.object( + transports.InterconnectGroupsRestInterceptor, "pre_get_operational_status" + ) as pre: + pre.assert_not_called() + post.assert_not_called() + post_with_metadata.assert_not_called() + pb_message = compute.GetOperationalStatusInterconnectGroupRequest.pb( + compute.GetOperationalStatusInterconnectGroupRequest() + ) + transcode.return_value = { + "method": "post", + "uri": "my_uri", + "body": pb_message, + "query_params": pb_message, + } + + req.return_value = mock.Mock() + req.return_value.status_code = 200 + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + return_value = compute.InterconnectGroupsGetOperationalStatusResponse.to_json( + compute.InterconnectGroupsGetOperationalStatusResponse() + ) + req.return_value.content = return_value + + request = compute.GetOperationalStatusInterconnectGroupRequest() + metadata = [ + ("key", "val"), + ("cephalopod", "squid"), + ] + pre.return_value = request, metadata + post.return_value = compute.InterconnectGroupsGetOperationalStatusResponse() + post_with_metadata.return_value = ( + compute.InterconnectGroupsGetOperationalStatusResponse(), + metadata, + ) + + client.get_operational_status( + request, + metadata=[ + ("key", "val"), + ("cephalopod", "squid"), + ], + ) + + pre.assert_called_once() + post.assert_called_once() + post_with_metadata.assert_called_once() + + +def test_insert_rest_bad_request(request_type=compute.InsertInterconnectGroupRequest): + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + # send a request that will satisfy transcoding + request_init = {"project": "sample1"} + request = request_type(**request_init) + + # Mock the http request call within the method and fake a BadRequest error. + with mock.patch.object(Session, "request") as req, pytest.raises( + core_exceptions.BadRequest + ): + # Wrap the value into a proper Response obj + response_value = mock.Mock() + json_return_value = "" + response_value.json = mock.Mock(return_value={}) + response_value.status_code = 400 + response_value.request = mock.Mock() + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + client.insert(request) + + +@pytest.mark.parametrize( + "request_type", + [ + compute.InsertInterconnectGroupRequest, + dict, + ], +) +def test_insert_rest_call_success(request_type): + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + + # send a request that will satisfy transcoding + request_init = {"project": "sample1"} + request_init["interconnect_group_resource"] = { + "configured": { + "topology_capability": { + "intended_capability_blockers": [ + { + "blocker_type": "blocker_type_value", + "documentation_link": "documentation_link_value", + "explanation": "explanation_value", + "facilities": ["facilities_value1", "facilities_value2"], + "interconnects": [ + "interconnects_value1", + "interconnects_value2", + ], + "metros": ["metros_value1", "metros_value2"], + "zones": ["zones_value1", "zones_value2"], + } + ], + "supported_sla": "supported_sla_value", + } + }, + "creation_timestamp": "creation_timestamp_value", + "description": "description_value", + "etag": "etag_value", + "id": 205, + "intent": {"topology_capability": "topology_capability_value"}, + "interconnects": {}, + "kind": "kind_value", + "name": "name_value", + "physical_structure": { + "metros": [ + { + "facilities": [ + { + "facility": "facility_value", + "zones": [ + { + "interconnects": [ + "interconnects_value1", + "interconnects_value2", + ], + "zone": "zone_value", + } + ], + } + ], + "metro": "metro_value", + } + ] + }, + "self_link": "self_link_value", + } + # The version of a generated dependency at test runtime may differ from the version used during generation. + # Delete any fields which are not present in the current runtime dependency + # See https://github.com/googleapis/gapic-generator-python/issues/1748 + + # Determine if the message type is proto-plus or protobuf + test_field = compute.InsertInterconnectGroupRequest.meta.fields[ + "interconnect_group_resource" + ] + + def get_message_fields(field): + # Given a field which is a message (composite type), return a list with + # all the fields of the message. + # If the field is not a composite type, return an empty list. + message_fields = [] + + if hasattr(field, "message") and field.message: + is_field_type_proto_plus_type = not hasattr(field.message, "DESCRIPTOR") + + if is_field_type_proto_plus_type: + message_fields = field.message.meta.fields.values() + # Add `# pragma: NO COVER` because there may not be any `*_pb2` field types + else: # pragma: NO COVER + message_fields = field.message.DESCRIPTOR.fields + return message_fields + + runtime_nested_fields = [ + (field.name, nested_field.name) + for field in get_message_fields(test_field) + for nested_field in get_message_fields(field) + ] + + subfields_not_in_runtime = [] + + # For each item in the sample request, create a list of sub fields which are not present at runtime + # Add `# pragma: NO COVER` because this test code will not run if all subfields are present at runtime + for field, value in request_init[ + "interconnect_group_resource" + ].items(): # pragma: NO COVER + result = None + is_repeated = False + # For repeated fields + if isinstance(value, list) and len(value): + is_repeated = True + result = value[0] + # For fields where the type is another message + if isinstance(value, dict): + result = value + + if result and hasattr(result, "keys"): + for subfield in result.keys(): + if (field, subfield) not in runtime_nested_fields: + subfields_not_in_runtime.append( + { + "field": field, + "subfield": subfield, + "is_repeated": is_repeated, + } + ) + + # Remove fields from the sample request which are not present in the runtime version of the dependency + # Add `# pragma: NO COVER` because this test code will not run if all subfields are present at runtime + for subfield_to_delete in subfields_not_in_runtime: # pragma: NO COVER + field = subfield_to_delete.get("field") + field_repeated = subfield_to_delete.get("is_repeated") + subfield = subfield_to_delete.get("subfield") + if subfield: + if field_repeated: + for i in range( + 0, len(request_init["interconnect_group_resource"][field]) + ): + del request_init["interconnect_group_resource"][field][i][subfield] + else: + del request_init["interconnect_group_resource"][field][subfield] + request = request_type(**request_init) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = compute.Operation( + client_operation_id="client_operation_id_value", + creation_timestamp="creation_timestamp_value", + description="description_value", + end_time="end_time_value", + http_error_message="http_error_message_value", + http_error_status_code=2374, + id=205, + insert_time="insert_time_value", + kind="kind_value", + name="name_value", + operation_group_id="operation_group_id_value", + operation_type="operation_type_value", + progress=885, + region="region_value", + self_link="self_link_value", + start_time="start_time_value", + status=compute.Operation.Status.DONE, + status_message="status_message_value", + target_id=947, + target_link="target_link_value", + user="user_value", + zone="zone_value", + ) + + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.status_code = 200 + + # Convert return value to protobuf type + return_value = compute.Operation.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + response_value.content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + response = client.insert(request) + + # Establish that the response is the type that we expect. + assert isinstance(response, extended_operation.ExtendedOperation) + assert response.client_operation_id == "client_operation_id_value" + assert response.creation_timestamp == "creation_timestamp_value" + assert response.description == "description_value" + assert response.end_time == "end_time_value" + assert response.http_error_message == "http_error_message_value" + assert response.http_error_status_code == 2374 + assert response.id == 205 + assert response.insert_time == "insert_time_value" + assert response.kind == "kind_value" + assert response.name == "name_value" + assert response.operation_group_id == "operation_group_id_value" + assert response.operation_type == "operation_type_value" + assert response.progress == 885 + assert response.region == "region_value" + assert response.self_link == "self_link_value" + assert response.start_time == "start_time_value" + assert response.status == compute.Operation.Status.DONE + assert response.status_message == "status_message_value" + assert response.target_id == 947 + assert response.target_link == "target_link_value" + assert response.user == "user_value" + assert response.zone == "zone_value" + + +@pytest.mark.parametrize("null_interceptor", [True, False]) +def test_insert_rest_interceptors(null_interceptor): + transport = transports.InterconnectGroupsRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + interceptor=None + if null_interceptor + else transports.InterconnectGroupsRestInterceptor(), + ) + client = InterconnectGroupsClient(transport=transport) + + with mock.patch.object( + type(client.transport._session), "request" + ) as req, mock.patch.object( + path_template, "transcode" + ) as transcode, mock.patch.object( + transports.InterconnectGroupsRestInterceptor, "post_insert" + ) as post, mock.patch.object( + transports.InterconnectGroupsRestInterceptor, "post_insert_with_metadata" + ) as post_with_metadata, mock.patch.object( + transports.InterconnectGroupsRestInterceptor, "pre_insert" + ) as pre: + pre.assert_not_called() + post.assert_not_called() + post_with_metadata.assert_not_called() + pb_message = compute.InsertInterconnectGroupRequest.pb( + compute.InsertInterconnectGroupRequest() + ) + transcode.return_value = { + "method": "post", + "uri": "my_uri", + "body": pb_message, + "query_params": pb_message, + } + + req.return_value = mock.Mock() + req.return_value.status_code = 200 + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + return_value = compute.Operation.to_json(compute.Operation()) + req.return_value.content = return_value + + request = compute.InsertInterconnectGroupRequest() + metadata = [ + ("key", "val"), + ("cephalopod", "squid"), + ] + pre.return_value = request, metadata + post.return_value = compute.Operation() + post_with_metadata.return_value = compute.Operation(), metadata + + client.insert( + request, + metadata=[ + ("key", "val"), + ("cephalopod", "squid"), + ], + ) + + pre.assert_called_once() + post.assert_called_once() + post_with_metadata.assert_called_once() + + +def test_list_rest_bad_request(request_type=compute.ListInterconnectGroupsRequest): + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + # send a request that will satisfy transcoding + request_init = {"project": "sample1"} + request = request_type(**request_init) + + # Mock the http request call within the method and fake a BadRequest error. + with mock.patch.object(Session, "request") as req, pytest.raises( + core_exceptions.BadRequest + ): + # Wrap the value into a proper Response obj + response_value = mock.Mock() + json_return_value = "" + response_value.json = mock.Mock(return_value={}) + response_value.status_code = 400 + response_value.request = mock.Mock() + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + client.list(request) + + +@pytest.mark.parametrize( + "request_type", + [ + compute.ListInterconnectGroupsRequest, + dict, + ], +) +def test_list_rest_call_success(request_type): + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + + # send a request that will satisfy transcoding + request_init = {"project": "sample1"} + request = request_type(**request_init) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = compute.InterconnectGroupsListResponse( + etag="etag_value", + id="id_value", + kind="kind_value", + next_page_token="next_page_token_value", + self_link="self_link_value", + unreachables=["unreachables_value"], + ) + + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.status_code = 200 + + # Convert return value to protobuf type + return_value = compute.InterconnectGroupsListResponse.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + response_value.content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + response = client.list(request) + + # Establish that the response is the type that we expect. + assert isinstance(response, pagers.ListPager) + assert response.etag == "etag_value" + assert response.id == "id_value" + assert response.kind == "kind_value" + assert response.next_page_token == "next_page_token_value" + assert response.self_link == "self_link_value" + assert response.unreachables == ["unreachables_value"] + + +@pytest.mark.parametrize("null_interceptor", [True, False]) +def test_list_rest_interceptors(null_interceptor): + transport = transports.InterconnectGroupsRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + interceptor=None + if null_interceptor + else transports.InterconnectGroupsRestInterceptor(), + ) + client = InterconnectGroupsClient(transport=transport) + + with mock.patch.object( + type(client.transport._session), "request" + ) as req, mock.patch.object( + path_template, "transcode" + ) as transcode, mock.patch.object( + transports.InterconnectGroupsRestInterceptor, "post_list" + ) as post, mock.patch.object( + transports.InterconnectGroupsRestInterceptor, "post_list_with_metadata" + ) as post_with_metadata, mock.patch.object( + transports.InterconnectGroupsRestInterceptor, "pre_list" + ) as pre: + pre.assert_not_called() + post.assert_not_called() + post_with_metadata.assert_not_called() + pb_message = compute.ListInterconnectGroupsRequest.pb( + compute.ListInterconnectGroupsRequest() + ) + transcode.return_value = { + "method": "post", + "uri": "my_uri", + "body": pb_message, + "query_params": pb_message, + } + + req.return_value = mock.Mock() + req.return_value.status_code = 200 + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + return_value = compute.InterconnectGroupsListResponse.to_json( + compute.InterconnectGroupsListResponse() + ) + req.return_value.content = return_value + + request = compute.ListInterconnectGroupsRequest() + metadata = [ + ("key", "val"), + ("cephalopod", "squid"), + ] + pre.return_value = request, metadata + post.return_value = compute.InterconnectGroupsListResponse() + post_with_metadata.return_value = ( + compute.InterconnectGroupsListResponse(), + metadata, + ) + + client.list( + request, + metadata=[ + ("key", "val"), + ("cephalopod", "squid"), + ], + ) + + pre.assert_called_once() + post.assert_called_once() + post_with_metadata.assert_called_once() + + +def test_patch_rest_bad_request(request_type=compute.PatchInterconnectGroupRequest): + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + # send a request that will satisfy transcoding + request_init = {"project": "sample1", "interconnect_group": "sample2"} + request = request_type(**request_init) + + # Mock the http request call within the method and fake a BadRequest error. + with mock.patch.object(Session, "request") as req, pytest.raises( + core_exceptions.BadRequest + ): + # Wrap the value into a proper Response obj + response_value = mock.Mock() + json_return_value = "" + response_value.json = mock.Mock(return_value={}) + response_value.status_code = 400 + response_value.request = mock.Mock() + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + client.patch(request) + + +@pytest.mark.parametrize( + "request_type", + [ + compute.PatchInterconnectGroupRequest, + dict, + ], +) +def test_patch_rest_call_success(request_type): + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + + # send a request that will satisfy transcoding + request_init = {"project": "sample1", "interconnect_group": "sample2"} + request_init["interconnect_group_resource"] = { + "configured": { + "topology_capability": { + "intended_capability_blockers": [ + { + "blocker_type": "blocker_type_value", + "documentation_link": "documentation_link_value", + "explanation": "explanation_value", + "facilities": ["facilities_value1", "facilities_value2"], + "interconnects": [ + "interconnects_value1", + "interconnects_value2", + ], + "metros": ["metros_value1", "metros_value2"], + "zones": ["zones_value1", "zones_value2"], + } + ], + "supported_sla": "supported_sla_value", + } + }, + "creation_timestamp": "creation_timestamp_value", + "description": "description_value", + "etag": "etag_value", + "id": 205, + "intent": {"topology_capability": "topology_capability_value"}, + "interconnects": {}, + "kind": "kind_value", + "name": "name_value", + "physical_structure": { + "metros": [ + { + "facilities": [ + { + "facility": "facility_value", + "zones": [ + { + "interconnects": [ + "interconnects_value1", + "interconnects_value2", + ], + "zone": "zone_value", + } + ], + } + ], + "metro": "metro_value", + } + ] + }, + "self_link": "self_link_value", + } + # The version of a generated dependency at test runtime may differ from the version used during generation. + # Delete any fields which are not present in the current runtime dependency + # See https://github.com/googleapis/gapic-generator-python/issues/1748 + + # Determine if the message type is proto-plus or protobuf + test_field = compute.PatchInterconnectGroupRequest.meta.fields[ + "interconnect_group_resource" + ] + + def get_message_fields(field): + # Given a field which is a message (composite type), return a list with + # all the fields of the message. + # If the field is not a composite type, return an empty list. + message_fields = [] + + if hasattr(field, "message") and field.message: + is_field_type_proto_plus_type = not hasattr(field.message, "DESCRIPTOR") + + if is_field_type_proto_plus_type: + message_fields = field.message.meta.fields.values() + # Add `# pragma: NO COVER` because there may not be any `*_pb2` field types + else: # pragma: NO COVER + message_fields = field.message.DESCRIPTOR.fields + return message_fields + + runtime_nested_fields = [ + (field.name, nested_field.name) + for field in get_message_fields(test_field) + for nested_field in get_message_fields(field) + ] + + subfields_not_in_runtime = [] + + # For each item in the sample request, create a list of sub fields which are not present at runtime + # Add `# pragma: NO COVER` because this test code will not run if all subfields are present at runtime + for field, value in request_init[ + "interconnect_group_resource" + ].items(): # pragma: NO COVER + result = None + is_repeated = False + # For repeated fields + if isinstance(value, list) and len(value): + is_repeated = True + result = value[0] + # For fields where the type is another message + if isinstance(value, dict): + result = value + + if result and hasattr(result, "keys"): + for subfield in result.keys(): + if (field, subfield) not in runtime_nested_fields: + subfields_not_in_runtime.append( + { + "field": field, + "subfield": subfield, + "is_repeated": is_repeated, + } + ) + + # Remove fields from the sample request which are not present in the runtime version of the dependency + # Add `# pragma: NO COVER` because this test code will not run if all subfields are present at runtime + for subfield_to_delete in subfields_not_in_runtime: # pragma: NO COVER + field = subfield_to_delete.get("field") + field_repeated = subfield_to_delete.get("is_repeated") + subfield = subfield_to_delete.get("subfield") + if subfield: + if field_repeated: + for i in range( + 0, len(request_init["interconnect_group_resource"][field]) + ): + del request_init["interconnect_group_resource"][field][i][subfield] + else: + del request_init["interconnect_group_resource"][field][subfield] + request = request_type(**request_init) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = compute.Operation( + client_operation_id="client_operation_id_value", + creation_timestamp="creation_timestamp_value", + description="description_value", + end_time="end_time_value", + http_error_message="http_error_message_value", + http_error_status_code=2374, + id=205, + insert_time="insert_time_value", + kind="kind_value", + name="name_value", + operation_group_id="operation_group_id_value", + operation_type="operation_type_value", + progress=885, + region="region_value", + self_link="self_link_value", + start_time="start_time_value", + status=compute.Operation.Status.DONE, + status_message="status_message_value", + target_id=947, + target_link="target_link_value", + user="user_value", + zone="zone_value", + ) + + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.status_code = 200 + + # Convert return value to protobuf type + return_value = compute.Operation.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + response_value.content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + response = client.patch(request) + + # Establish that the response is the type that we expect. + assert isinstance(response, extended_operation.ExtendedOperation) + assert response.client_operation_id == "client_operation_id_value" + assert response.creation_timestamp == "creation_timestamp_value" + assert response.description == "description_value" + assert response.end_time == "end_time_value" + assert response.http_error_message == "http_error_message_value" + assert response.http_error_status_code == 2374 + assert response.id == 205 + assert response.insert_time == "insert_time_value" + assert response.kind == "kind_value" + assert response.name == "name_value" + assert response.operation_group_id == "operation_group_id_value" + assert response.operation_type == "operation_type_value" + assert response.progress == 885 + assert response.region == "region_value" + assert response.self_link == "self_link_value" + assert response.start_time == "start_time_value" + assert response.status == compute.Operation.Status.DONE + assert response.status_message == "status_message_value" + assert response.target_id == 947 + assert response.target_link == "target_link_value" + assert response.user == "user_value" + assert response.zone == "zone_value" + + +@pytest.mark.parametrize("null_interceptor", [True, False]) +def test_patch_rest_interceptors(null_interceptor): + transport = transports.InterconnectGroupsRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + interceptor=None + if null_interceptor + else transports.InterconnectGroupsRestInterceptor(), + ) + client = InterconnectGroupsClient(transport=transport) + + with mock.patch.object( + type(client.transport._session), "request" + ) as req, mock.patch.object( + path_template, "transcode" + ) as transcode, mock.patch.object( + transports.InterconnectGroupsRestInterceptor, "post_patch" + ) as post, mock.patch.object( + transports.InterconnectGroupsRestInterceptor, "post_patch_with_metadata" + ) as post_with_metadata, mock.patch.object( + transports.InterconnectGroupsRestInterceptor, "pre_patch" + ) as pre: + pre.assert_not_called() + post.assert_not_called() + post_with_metadata.assert_not_called() + pb_message = compute.PatchInterconnectGroupRequest.pb( + compute.PatchInterconnectGroupRequest() + ) + transcode.return_value = { + "method": "post", + "uri": "my_uri", + "body": pb_message, + "query_params": pb_message, + } + + req.return_value = mock.Mock() + req.return_value.status_code = 200 + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + return_value = compute.Operation.to_json(compute.Operation()) + req.return_value.content = return_value + + request = compute.PatchInterconnectGroupRequest() + metadata = [ + ("key", "val"), + ("cephalopod", "squid"), + ] + pre.return_value = request, metadata + post.return_value = compute.Operation() + post_with_metadata.return_value = compute.Operation(), metadata + + client.patch( + request, + metadata=[ + ("key", "val"), + ("cephalopod", "squid"), + ], + ) + + pre.assert_called_once() + post.assert_called_once() + post_with_metadata.assert_called_once() + + +def test_set_iam_policy_rest_bad_request( + request_type=compute.SetIamPolicyInterconnectGroupRequest, +): + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + # send a request that will satisfy transcoding + request_init = {"project": "sample1", "resource": "sample2"} + request = request_type(**request_init) + + # Mock the http request call within the method and fake a BadRequest error. + with mock.patch.object(Session, "request") as req, pytest.raises( + core_exceptions.BadRequest + ): + # Wrap the value into a proper Response obj + response_value = mock.Mock() + json_return_value = "" + response_value.json = mock.Mock(return_value={}) + response_value.status_code = 400 + response_value.request = mock.Mock() + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + client.set_iam_policy(request) + + +@pytest.mark.parametrize( + "request_type", + [ + compute.SetIamPolicyInterconnectGroupRequest, + dict, + ], +) +def test_set_iam_policy_rest_call_success(request_type): + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + + # send a request that will satisfy transcoding + request_init = {"project": "sample1", "resource": "sample2"} + request_init["global_set_policy_request_resource"] = { + "bindings": [ + { + "binding_id": "binding_id_value", + "condition": { + "description": "description_value", + "expression": "expression_value", + "location": "location_value", + "title": "title_value", + }, + "members": ["members_value1", "members_value2"], + "role": "role_value", + } + ], + "etag": "etag_value", + "policy": { + "audit_configs": [ + { + "audit_log_configs": [ + { + "exempted_members": [ + "exempted_members_value1", + "exempted_members_value2", + ], + "ignore_child_exemptions": True, + "log_type": "log_type_value", + } + ], + "exempted_members": [ + "exempted_members_value1", + "exempted_members_value2", + ], + "service": "service_value", + } + ], + "bindings": {}, + "etag": "etag_value", + "iam_owned": True, + "version": 774, + }, + } + # The version of a generated dependency at test runtime may differ from the version used during generation. + # Delete any fields which are not present in the current runtime dependency + # See https://github.com/googleapis/gapic-generator-python/issues/1748 + + # Determine if the message type is proto-plus or protobuf + test_field = compute.SetIamPolicyInterconnectGroupRequest.meta.fields[ + "global_set_policy_request_resource" + ] + + def get_message_fields(field): + # Given a field which is a message (composite type), return a list with + # all the fields of the message. + # If the field is not a composite type, return an empty list. + message_fields = [] + + if hasattr(field, "message") and field.message: + is_field_type_proto_plus_type = not hasattr(field.message, "DESCRIPTOR") + + if is_field_type_proto_plus_type: + message_fields = field.message.meta.fields.values() + # Add `# pragma: NO COVER` because there may not be any `*_pb2` field types + else: # pragma: NO COVER + message_fields = field.message.DESCRIPTOR.fields + return message_fields + + runtime_nested_fields = [ + (field.name, nested_field.name) + for field in get_message_fields(test_field) + for nested_field in get_message_fields(field) + ] + + subfields_not_in_runtime = [] + + # For each item in the sample request, create a list of sub fields which are not present at runtime + # Add `# pragma: NO COVER` because this test code will not run if all subfields are present at runtime + for field, value in request_init[ + "global_set_policy_request_resource" + ].items(): # pragma: NO COVER + result = None + is_repeated = False + # For repeated fields + if isinstance(value, list) and len(value): + is_repeated = True + result = value[0] + # For fields where the type is another message + if isinstance(value, dict): + result = value + + if result and hasattr(result, "keys"): + for subfield in result.keys(): + if (field, subfield) not in runtime_nested_fields: + subfields_not_in_runtime.append( + { + "field": field, + "subfield": subfield, + "is_repeated": is_repeated, + } + ) + + # Remove fields from the sample request which are not present in the runtime version of the dependency + # Add `# pragma: NO COVER` because this test code will not run if all subfields are present at runtime + for subfield_to_delete in subfields_not_in_runtime: # pragma: NO COVER + field = subfield_to_delete.get("field") + field_repeated = subfield_to_delete.get("is_repeated") + subfield = subfield_to_delete.get("subfield") + if subfield: + if field_repeated: + for i in range( + 0, len(request_init["global_set_policy_request_resource"][field]) + ): + del request_init["global_set_policy_request_resource"][field][i][ + subfield + ] + else: + del request_init["global_set_policy_request_resource"][field][subfield] + request = request_type(**request_init) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = compute.Policy( + etag="etag_value", + iam_owned=True, + version=774, + ) + + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.status_code = 200 + + # Convert return value to protobuf type + return_value = compute.Policy.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + response_value.content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + response = client.set_iam_policy(request) + + # Establish that the response is the type that we expect. + assert isinstance(response, compute.Policy) + assert response.etag == "etag_value" + assert response.iam_owned is True + assert response.version == 774 + + +@pytest.mark.parametrize("null_interceptor", [True, False]) +def test_set_iam_policy_rest_interceptors(null_interceptor): + transport = transports.InterconnectGroupsRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + interceptor=None + if null_interceptor + else transports.InterconnectGroupsRestInterceptor(), + ) + client = InterconnectGroupsClient(transport=transport) + + with mock.patch.object( + type(client.transport._session), "request" + ) as req, mock.patch.object( + path_template, "transcode" + ) as transcode, mock.patch.object( + transports.InterconnectGroupsRestInterceptor, "post_set_iam_policy" + ) as post, mock.patch.object( + transports.InterconnectGroupsRestInterceptor, + "post_set_iam_policy_with_metadata", + ) as post_with_metadata, mock.patch.object( + transports.InterconnectGroupsRestInterceptor, "pre_set_iam_policy" + ) as pre: + pre.assert_not_called() + post.assert_not_called() + post_with_metadata.assert_not_called() + pb_message = compute.SetIamPolicyInterconnectGroupRequest.pb( + compute.SetIamPolicyInterconnectGroupRequest() + ) + transcode.return_value = { + "method": "post", + "uri": "my_uri", + "body": pb_message, + "query_params": pb_message, + } + + req.return_value = mock.Mock() + req.return_value.status_code = 200 + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + return_value = compute.Policy.to_json(compute.Policy()) + req.return_value.content = return_value + + request = compute.SetIamPolicyInterconnectGroupRequest() + metadata = [ + ("key", "val"), + ("cephalopod", "squid"), + ] + pre.return_value = request, metadata + post.return_value = compute.Policy() + post_with_metadata.return_value = compute.Policy(), metadata + + client.set_iam_policy( + request, + metadata=[ + ("key", "val"), + ("cephalopod", "squid"), + ], + ) + + pre.assert_called_once() + post.assert_called_once() + post_with_metadata.assert_called_once() + + +def test_test_iam_permissions_rest_bad_request( + request_type=compute.TestIamPermissionsInterconnectGroupRequest, +): + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + # send a request that will satisfy transcoding + request_init = {"project": "sample1", "resource": "sample2"} + request = request_type(**request_init) + + # Mock the http request call within the method and fake a BadRequest error. + with mock.patch.object(Session, "request") as req, pytest.raises( + core_exceptions.BadRequest + ): + # Wrap the value into a proper Response obj + response_value = mock.Mock() + json_return_value = "" + response_value.json = mock.Mock(return_value={}) + response_value.status_code = 400 + response_value.request = mock.Mock() + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + client.test_iam_permissions(request) + + +@pytest.mark.parametrize( + "request_type", + [ + compute.TestIamPermissionsInterconnectGroupRequest, + dict, + ], +) +def test_test_iam_permissions_rest_call_success(request_type): + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + + # send a request that will satisfy transcoding + request_init = {"project": "sample1", "resource": "sample2"} + request_init["test_permissions_request_resource"] = { + "permissions": ["permissions_value1", "permissions_value2"] + } + # The version of a generated dependency at test runtime may differ from the version used during generation. + # Delete any fields which are not present in the current runtime dependency + # See https://github.com/googleapis/gapic-generator-python/issues/1748 + + # Determine if the message type is proto-plus or protobuf + test_field = compute.TestIamPermissionsInterconnectGroupRequest.meta.fields[ + "test_permissions_request_resource" + ] + + def get_message_fields(field): + # Given a field which is a message (composite type), return a list with + # all the fields of the message. + # If the field is not a composite type, return an empty list. + message_fields = [] + + if hasattr(field, "message") and field.message: + is_field_type_proto_plus_type = not hasattr(field.message, "DESCRIPTOR") + + if is_field_type_proto_plus_type: + message_fields = field.message.meta.fields.values() + # Add `# pragma: NO COVER` because there may not be any `*_pb2` field types + else: # pragma: NO COVER + message_fields = field.message.DESCRIPTOR.fields + return message_fields + + runtime_nested_fields = [ + (field.name, nested_field.name) + for field in get_message_fields(test_field) + for nested_field in get_message_fields(field) + ] + + subfields_not_in_runtime = [] + + # For each item in the sample request, create a list of sub fields which are not present at runtime + # Add `# pragma: NO COVER` because this test code will not run if all subfields are present at runtime + for field, value in request_init[ + "test_permissions_request_resource" + ].items(): # pragma: NO COVER + result = None + is_repeated = False + # For repeated fields + if isinstance(value, list) and len(value): + is_repeated = True + result = value[0] + # For fields where the type is another message + if isinstance(value, dict): + result = value + + if result and hasattr(result, "keys"): + for subfield in result.keys(): + if (field, subfield) not in runtime_nested_fields: + subfields_not_in_runtime.append( + { + "field": field, + "subfield": subfield, + "is_repeated": is_repeated, + } + ) + + # Remove fields from the sample request which are not present in the runtime version of the dependency + # Add `# pragma: NO COVER` because this test code will not run if all subfields are present at runtime + for subfield_to_delete in subfields_not_in_runtime: # pragma: NO COVER + field = subfield_to_delete.get("field") + field_repeated = subfield_to_delete.get("is_repeated") + subfield = subfield_to_delete.get("subfield") + if subfield: + if field_repeated: + for i in range( + 0, len(request_init["test_permissions_request_resource"][field]) + ): + del request_init["test_permissions_request_resource"][field][i][ + subfield + ] + else: + del request_init["test_permissions_request_resource"][field][subfield] + request = request_type(**request_init) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = compute.TestPermissionsResponse( + permissions=["permissions_value"], + ) + + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.status_code = 200 + + # Convert return value to protobuf type + return_value = compute.TestPermissionsResponse.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + response_value.content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + response = client.test_iam_permissions(request) + + # Establish that the response is the type that we expect. + assert isinstance(response, compute.TestPermissionsResponse) + assert response.permissions == ["permissions_value"] + + +@pytest.mark.parametrize("null_interceptor", [True, False]) +def test_test_iam_permissions_rest_interceptors(null_interceptor): + transport = transports.InterconnectGroupsRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + interceptor=None + if null_interceptor + else transports.InterconnectGroupsRestInterceptor(), + ) + client = InterconnectGroupsClient(transport=transport) + + with mock.patch.object( + type(client.transport._session), "request" + ) as req, mock.patch.object( + path_template, "transcode" + ) as transcode, mock.patch.object( + transports.InterconnectGroupsRestInterceptor, "post_test_iam_permissions" + ) as post, mock.patch.object( + transports.InterconnectGroupsRestInterceptor, + "post_test_iam_permissions_with_metadata", + ) as post_with_metadata, mock.patch.object( + transports.InterconnectGroupsRestInterceptor, "pre_test_iam_permissions" + ) as pre: + pre.assert_not_called() + post.assert_not_called() + post_with_metadata.assert_not_called() + pb_message = compute.TestIamPermissionsInterconnectGroupRequest.pb( + compute.TestIamPermissionsInterconnectGroupRequest() + ) + transcode.return_value = { + "method": "post", + "uri": "my_uri", + "body": pb_message, + "query_params": pb_message, + } + + req.return_value = mock.Mock() + req.return_value.status_code = 200 + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + return_value = compute.TestPermissionsResponse.to_json( + compute.TestPermissionsResponse() + ) + req.return_value.content = return_value + + request = compute.TestIamPermissionsInterconnectGroupRequest() + metadata = [ + ("key", "val"), + ("cephalopod", "squid"), + ] + pre.return_value = request, metadata + post.return_value = compute.TestPermissionsResponse() + post_with_metadata.return_value = compute.TestPermissionsResponse(), metadata + + client.test_iam_permissions( + request, + metadata=[ + ("key", "val"), + ("cephalopod", "squid"), + ], + ) + + pre.assert_called_once() + post.assert_called_once() + post_with_metadata.assert_called_once() + + +def test_initialize_client_w_rest(): + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + assert client is not None + + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_create_members_unary_empty_call_rest(): + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object(type(client.transport.create_members), "__call__") as call: + client.create_members_unary(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = compute.CreateMembersInterconnectGroupRequest() + + assert args[0] == request_msg + + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_delete_unary_empty_call_rest(): + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object(type(client.transport.delete), "__call__") as call: + client.delete_unary(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = compute.DeleteInterconnectGroupRequest() + + assert args[0] == request_msg + + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_get_empty_call_rest(): + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object(type(client.transport.get), "__call__") as call: + client.get(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = compute.GetInterconnectGroupRequest() + + assert args[0] == request_msg + + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_get_iam_policy_empty_call_rest(): + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object(type(client.transport.get_iam_policy), "__call__") as call: + client.get_iam_policy(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = compute.GetIamPolicyInterconnectGroupRequest() + + assert args[0] == request_msg + + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_get_operational_status_empty_call_rest(): + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object( + type(client.transport.get_operational_status), "__call__" + ) as call: + client.get_operational_status(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = compute.GetOperationalStatusInterconnectGroupRequest() + + assert args[0] == request_msg + + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_insert_unary_empty_call_rest(): + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object(type(client.transport.insert), "__call__") as call: + client.insert_unary(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = compute.InsertInterconnectGroupRequest() + + assert args[0] == request_msg + + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_list_empty_call_rest(): + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object(type(client.transport.list), "__call__") as call: + client.list(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = compute.ListInterconnectGroupsRequest() + + assert args[0] == request_msg + + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_patch_unary_empty_call_rest(): + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object(type(client.transport.patch), "__call__") as call: + client.patch_unary(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = compute.PatchInterconnectGroupRequest() + + assert args[0] == request_msg + + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_set_iam_policy_empty_call_rest(): + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object(type(client.transport.set_iam_policy), "__call__") as call: + client.set_iam_policy(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = compute.SetIamPolicyInterconnectGroupRequest() + + assert args[0] == request_msg + + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_test_iam_permissions_empty_call_rest(): + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object( + type(client.transport.test_iam_permissions), "__call__" + ) as call: + client.test_iam_permissions(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = compute.TestIamPermissionsInterconnectGroupRequest() + + assert args[0] == request_msg + + +def test_interconnect_groups_base_transport_error(): + # Passing both a credentials object and credentials_file should raise an error + with pytest.raises(core_exceptions.DuplicateCredentialArgs): + transport = transports.InterconnectGroupsTransport( + credentials=ga_credentials.AnonymousCredentials(), + credentials_file="credentials.json", + ) + + +def test_interconnect_groups_base_transport(): + # Instantiate the base transport. + with mock.patch( + "google.cloud.compute_v1.services.interconnect_groups.transports.InterconnectGroupsTransport.__init__" + ) as Transport: + Transport.return_value = None + transport = transports.InterconnectGroupsTransport( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Every method on the transport should just blindly + # raise NotImplementedError. + methods = ( + "create_members", + "delete", + "get", + "get_iam_policy", + "get_operational_status", + "insert", + "list", + "patch", + "set_iam_policy", + "test_iam_permissions", + ) + for method in methods: + with pytest.raises(NotImplementedError): + getattr(transport, method)(request=object()) + + with pytest.raises(NotImplementedError): + transport.close() + + # Catch all for all remaining methods and properties + remainder = [ + "kind", + ] + for r in remainder: + with pytest.raises(NotImplementedError): + getattr(transport, r)() + + +def test_interconnect_groups_base_transport_with_credentials_file(): + # Instantiate the base transport with a credentials file + with mock.patch.object( + google.auth, "load_credentials_from_file", autospec=True + ) as load_creds, mock.patch( + "google.cloud.compute_v1.services.interconnect_groups.transports.InterconnectGroupsTransport._prep_wrapped_messages" + ) as Transport: + Transport.return_value = None + load_creds.return_value = (ga_credentials.AnonymousCredentials(), None) + transport = transports.InterconnectGroupsTransport( + credentials_file="credentials.json", + quota_project_id="octopus", + ) + load_creds.assert_called_once_with( + "credentials.json", + scopes=None, + default_scopes=( + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/cloud-platform", + ), + quota_project_id="octopus", + ) + + +def test_interconnect_groups_base_transport_with_adc(): + # Test the default credentials are used if credentials and credentials_file are None. + with mock.patch.object(google.auth, "default", autospec=True) as adc, mock.patch( + "google.cloud.compute_v1.services.interconnect_groups.transports.InterconnectGroupsTransport._prep_wrapped_messages" + ) as Transport: + Transport.return_value = None + adc.return_value = (ga_credentials.AnonymousCredentials(), None) + transport = transports.InterconnectGroupsTransport() + adc.assert_called_once() + + +def test_interconnect_groups_auth_adc(): + # If no credentials are provided, we should use ADC credentials. + with mock.patch.object(google.auth, "default", autospec=True) as adc: + adc.return_value = (ga_credentials.AnonymousCredentials(), None) + InterconnectGroupsClient() + adc.assert_called_once_with( + scopes=None, + default_scopes=( + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/cloud-platform", + ), + quota_project_id=None, + ) + + +def test_interconnect_groups_http_transport_client_cert_source_for_mtls(): + cred = ga_credentials.AnonymousCredentials() + with mock.patch( + "google.auth.transport.requests.AuthorizedSession.configure_mtls_channel" + ) as mock_configure_mtls_channel: + transports.InterconnectGroupsRestTransport( + credentials=cred, client_cert_source_for_mtls=client_cert_source_callback + ) + mock_configure_mtls_channel.assert_called_once_with(client_cert_source_callback) + + +@pytest.mark.parametrize( + "transport_name", + [ + "rest", + ], +) +def test_interconnect_groups_host_no_port(transport_name): + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + client_options=client_options.ClientOptions( + api_endpoint="compute.googleapis.com" + ), + transport=transport_name, + ) + assert client.transport._host == ( + "compute.googleapis.com:443" + if transport_name in ["grpc", "grpc_asyncio"] + else "https://compute.googleapis.com" + ) + + +@pytest.mark.parametrize( + "transport_name", + [ + "rest", + ], +) +def test_interconnect_groups_host_with_port(transport_name): + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + client_options=client_options.ClientOptions( + api_endpoint="compute.googleapis.com:8000" + ), + transport=transport_name, + ) + assert client.transport._host == ( + "compute.googleapis.com:8000" + if transport_name in ["grpc", "grpc_asyncio"] + else "https://compute.googleapis.com:8000" + ) + + +@pytest.mark.parametrize( + "transport_name", + [ + "rest", + ], +) +def test_interconnect_groups_client_transport_session_collision(transport_name): + creds1 = ga_credentials.AnonymousCredentials() + creds2 = ga_credentials.AnonymousCredentials() + client1 = InterconnectGroupsClient( + credentials=creds1, + transport=transport_name, + ) + client2 = InterconnectGroupsClient( + credentials=creds2, + transport=transport_name, + ) + session1 = client1.transport.create_members._session + session2 = client2.transport.create_members._session + assert session1 != session2 + session1 = client1.transport.delete._session + session2 = client2.transport.delete._session + assert session1 != session2 + session1 = client1.transport.get._session + session2 = client2.transport.get._session + assert session1 != session2 + session1 = client1.transport.get_iam_policy._session + session2 = client2.transport.get_iam_policy._session + assert session1 != session2 + session1 = client1.transport.get_operational_status._session + session2 = client2.transport.get_operational_status._session + assert session1 != session2 + session1 = client1.transport.insert._session + session2 = client2.transport.insert._session + assert session1 != session2 + session1 = client1.transport.list._session + session2 = client2.transport.list._session + assert session1 != session2 + session1 = client1.transport.patch._session + session2 = client2.transport.patch._session + assert session1 != session2 + session1 = client1.transport.set_iam_policy._session + session2 = client2.transport.set_iam_policy._session + assert session1 != session2 + session1 = client1.transport.test_iam_permissions._session + session2 = client2.transport.test_iam_permissions._session + assert session1 != session2 + + +def test_common_billing_account_path(): + billing_account = "squid" + expected = "billingAccounts/{billing_account}".format( + billing_account=billing_account, + ) + actual = InterconnectGroupsClient.common_billing_account_path(billing_account) + assert expected == actual + + +def test_parse_common_billing_account_path(): + expected = { + "billing_account": "clam", + } + path = InterconnectGroupsClient.common_billing_account_path(**expected) + + # Check that the path construction is reversible. + actual = InterconnectGroupsClient.parse_common_billing_account_path(path) + assert expected == actual + + +def test_common_folder_path(): + folder = "whelk" + expected = "folders/{folder}".format( + folder=folder, + ) + actual = InterconnectGroupsClient.common_folder_path(folder) + assert expected == actual + + +def test_parse_common_folder_path(): + expected = { + "folder": "octopus", + } + path = InterconnectGroupsClient.common_folder_path(**expected) + + # Check that the path construction is reversible. + actual = InterconnectGroupsClient.parse_common_folder_path(path) + assert expected == actual + + +def test_common_organization_path(): + organization = "oyster" + expected = "organizations/{organization}".format( + organization=organization, + ) + actual = InterconnectGroupsClient.common_organization_path(organization) + assert expected == actual + + +def test_parse_common_organization_path(): + expected = { + "organization": "nudibranch", + } + path = InterconnectGroupsClient.common_organization_path(**expected) + + # Check that the path construction is reversible. + actual = InterconnectGroupsClient.parse_common_organization_path(path) + assert expected == actual + + +def test_common_project_path(): + project = "cuttlefish" + expected = "projects/{project}".format( + project=project, + ) + actual = InterconnectGroupsClient.common_project_path(project) + assert expected == actual + + +def test_parse_common_project_path(): + expected = { + "project": "mussel", + } + path = InterconnectGroupsClient.common_project_path(**expected) + + # Check that the path construction is reversible. + actual = InterconnectGroupsClient.parse_common_project_path(path) + assert expected == actual + + +def test_common_location_path(): + project = "winkle" + location = "nautilus" + expected = "projects/{project}/locations/{location}".format( + project=project, + location=location, + ) + actual = InterconnectGroupsClient.common_location_path(project, location) + assert expected == actual + + +def test_parse_common_location_path(): + expected = { + "project": "scallop", + "location": "abalone", + } + path = InterconnectGroupsClient.common_location_path(**expected) + + # Check that the path construction is reversible. + actual = InterconnectGroupsClient.parse_common_location_path(path) + assert expected == actual + + +def test_client_with_default_client_info(): + client_info = gapic_v1.client_info.ClientInfo() + + with mock.patch.object( + transports.InterconnectGroupsTransport, "_prep_wrapped_messages" + ) as prep: + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), + client_info=client_info, + ) + prep.assert_called_once_with(client_info) + + with mock.patch.object( + transports.InterconnectGroupsTransport, "_prep_wrapped_messages" + ) as prep: + transport_class = InterconnectGroupsClient.get_transport_class() + transport = transport_class( + credentials=ga_credentials.AnonymousCredentials(), + client_info=client_info, + ) + prep.assert_called_once_with(client_info) + + +def test_transport_close_rest(): + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + with mock.patch.object( + type(getattr(client.transport, "_session")), "close" + ) as close: + with client: + close.assert_not_called() + close.assert_called_once() + + +def test_client_ctx(): + transports = [ + "rest", + ] + for transport in transports: + client = InterconnectGroupsClient( + credentials=ga_credentials.AnonymousCredentials(), transport=transport + ) + # Test client calls underlying transport. + with mock.patch.object(type(client.transport), "close") as close: + close.assert_not_called() + with client: + pass + close.assert_called() + + +@pytest.mark.parametrize( + "client_class,transport_class", + [ + (InterconnectGroupsClient, transports.InterconnectGroupsRestTransport), + ], +) +def test_api_key_credentials(client_class, transport_class): + with mock.patch.object( + google.auth._default, "get_api_key_credentials", create=True + ) as get_api_key_credentials: + mock_cred = mock.Mock() + get_api_key_credentials.return_value = mock_cred + options = client_options.ClientOptions() + options.api_key = "api_key" + with mock.patch.object(transport_class, "__init__") as patched: + patched.return_value = None + client = client_class(client_options=options) + patched.assert_called_once_with( + credentials=mock_cred, + credentials_file=None, + host=client._DEFAULT_ENDPOINT_TEMPLATE.format( + UNIVERSE_DOMAIN=client._DEFAULT_UNIVERSE + ), + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + api_audience=None, + ) diff --git a/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_interconnects.py b/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_interconnects.py index b1cbf2f6bb75..c4c192c2b299 100644 --- a/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_interconnects.py +++ b/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_interconnects.py @@ -3675,6 +3675,7 @@ def test_get_rest_call_success(request_type): google_reference_id="google_reference_id_value", id=205, interconnect_attachments=["interconnect_attachments_value"], + interconnect_groups=["interconnect_groups_value"], interconnect_type="interconnect_type_value", kind="kind_value", label_fingerprint="label_fingerprint_value", @@ -3717,6 +3718,7 @@ def test_get_rest_call_success(request_type): assert response.google_reference_id == "google_reference_id_value" assert response.id == 205 assert response.interconnect_attachments == ["interconnect_attachments_value"] + assert response.interconnect_groups == ["interconnect_groups_value"] assert response.interconnect_type == "interconnect_type_value" assert response.kind == "kind_value" assert response.label_fingerprint == "label_fingerprint_value" @@ -4132,6 +4134,10 @@ def test_insert_rest_call_success(request_type): "interconnect_attachments_value1", "interconnect_attachments_value2", ], + "interconnect_groups": [ + "interconnect_groups_value1", + "interconnect_groups_value2", + ], "interconnect_type": "interconnect_type_value", "kind": "kind_value", "label_fingerprint": "label_fingerprint_value", @@ -4565,6 +4571,10 @@ def test_patch_rest_call_success(request_type): "interconnect_attachments_value1", "interconnect_attachments_value2", ], + "interconnect_groups": [ + "interconnect_groups_value1", + "interconnect_groups_value2", + ], "interconnect_type": "interconnect_type_value", "kind": "kind_value", "label_fingerprint": "label_fingerprint_value", diff --git a/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_licenses.py b/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_licenses.py index 295a0855ff2a..fe824f7c9030 100644 --- a/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_licenses.py +++ b/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_licenses.py @@ -1888,7 +1888,9 @@ def test_insert_rest_flattened(): # get truthy value for each flattened field mock_args = dict( project="project_value", - license_resource=compute.License(charges_use_fee=True), + license_resource=compute.License( + allowed_replacement_licenses=["allowed_replacement_licenses_value"] + ), ) mock_args.update(sample_request) @@ -1926,7 +1928,9 @@ def test_insert_rest_flattened_error(transport: str = "rest"): client.insert( compute.InsertLicenseRequest(), project="project_value", - license_resource=compute.License(charges_use_fee=True), + license_resource=compute.License( + allowed_replacement_licenses=["allowed_replacement_licenses_value"] + ), ) @@ -2080,7 +2084,9 @@ def test_insert_unary_rest_flattened(): # get truthy value for each flattened field mock_args = dict( project="project_value", - license_resource=compute.License(charges_use_fee=True), + license_resource=compute.License( + allowed_replacement_licenses=["allowed_replacement_licenses_value"] + ), ) mock_args.update(sample_request) @@ -2118,7 +2124,9 @@ def test_insert_unary_rest_flattened_error(transport: str = "rest"): client.insert_unary( compute.InsertLicenseRequest(), project="project_value", - license_resource=compute.License(charges_use_fee=True), + license_resource=compute.License( + allowed_replacement_licenses=["allowed_replacement_licenses_value"] + ), ) @@ -2783,6 +2791,454 @@ def test_test_iam_permissions_rest_flattened_error(transport: str = "rest"): ) +def test_update_rest_use_cached_wrapped_rpc(): + # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, + # instead of constructing them on each call + with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: + client = LicensesClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Should wrap all calls on client creation + assert wrapper_fn.call_count > 0 + wrapper_fn.reset_mock() + + # Ensure method has been cached + assert client._transport.update in client._transport._wrapped_methods + + # Replace cached wrapped function with mock + mock_rpc = mock.Mock() + mock_rpc.return_value.name = ( + "foo" # operation_request.operation in compute client(s) expect a string. + ) + client._transport._wrapped_methods[client._transport.update] = mock_rpc + + request = {} + client.update(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + # Operation methods build a cached wrapper on first rpc call + # subsequent calls should use the cached wrapper + wrapper_fn.reset_mock() + + client.update(request) + + # Establish that a new wrapper was not created for this call + assert wrapper_fn.call_count == 0 + assert mock_rpc.call_count == 2 + + +def test_update_rest_required_fields(request_type=compute.UpdateLicenseRequest): + transport_class = transports.LicensesRestTransport + + request_init = {} + request_init["license_"] = "" + request_init["project"] = "" + request = request_type(**request_init) + pb_request = request_type.pb(request) + jsonified_request = json.loads( + json_format.MessageToJson(pb_request, use_integers_for_enums=False) + ) + + # verify fields with default values are dropped + assert "license" not in jsonified_request + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).update._get_unset_required_fields(jsonified_request) + jsonified_request.update(unset_fields) + + # verify required fields with default values are now present + assert "license" in jsonified_request + assert jsonified_request["license"] == request_init["license_"] + + jsonified_request["license"] = "license__value" + jsonified_request["project"] = "project_value" + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).update._get_unset_required_fields(jsonified_request) + # Check that path parameters and body parameters are not mixing in. + assert not set(unset_fields) - set( + ( + "license_", + "request_id", + "update_mask", + ) + ) + jsonified_request.update(unset_fields) + + # verify required fields with non-default values are left alone + assert "license" in jsonified_request + assert jsonified_request["license"] == "license__value" + assert "project" in jsonified_request + assert jsonified_request["project"] == "project_value" + + client = LicensesClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + request = request_type(**request_init) + + # Designate an appropriate value for the returned response. + return_value = compute.Operation() + # Mock the http request call within the method and fake a response. + with mock.patch.object(Session, "request") as req: + # We need to mock transcode() because providing default values + # for required fields will fail the real version if the http_options + # expect actual values for those fields. + with mock.patch.object(path_template, "transcode") as transcode: + # A uri without fields and an empty body will force all the + # request fields to show up in the query_params. + pb_request = request_type.pb(request) + transcode_result = { + "uri": "v1/sample_method", + "method": "patch", + "query_params": pb_request, + } + transcode_result["body"] = pb_request + transcode.return_value = transcode_result + + response_value = Response() + response_value.status_code = 200 + + # Convert return value to protobuf type + return_value = compute.Operation.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + response = client.update(request) + + expected_params = [ + ( + "license", + "", + ), + ] + actual_params = req.call_args.kwargs["params"] + assert expected_params == actual_params + + +def test_update_rest_unset_required_fields(): + transport = transports.LicensesRestTransport( + credentials=ga_credentials.AnonymousCredentials + ) + + unset_fields = transport.update._get_unset_required_fields({}) + assert set(unset_fields) == ( + set( + ( + "license", + "requestId", + "updateMask", + ) + ) + & set( + ( + "license", + "licenseResource", + "project", + ) + ) + ) + + +def test_update_rest_flattened(): + client = LicensesClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = compute.Operation() + + # get arguments that satisfy an http rule for this method + sample_request = {"project": "sample1", "license_": "sample2"} + + # get truthy value for each flattened field + mock_args = dict( + project="project_value", + license_="license__value", + license_resource=compute.License( + allowed_replacement_licenses=["allowed_replacement_licenses_value"] + ), + ) + mock_args.update(sample_request) + + # Wrap the value into a proper Response obj + response_value = Response() + response_value.status_code = 200 + # Convert return value to protobuf type + return_value = compute.Operation.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + client.update(**mock_args) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(req.mock_calls) == 1 + _, args, _ = req.mock_calls[0] + assert path_template.validate( + "%s/compute/v1/projects/{project}/global/licenses/{license_}" + % client.transport._host, + args[1], + ) + + +def test_update_rest_flattened_error(transport: str = "rest"): + client = LicensesClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.update( + compute.UpdateLicenseRequest(), + project="project_value", + license_="license__value", + license_resource=compute.License( + allowed_replacement_licenses=["allowed_replacement_licenses_value"] + ), + ) + + +def test_update_unary_rest_use_cached_wrapped_rpc(): + # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, + # instead of constructing them on each call + with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: + client = LicensesClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Should wrap all calls on client creation + assert wrapper_fn.call_count > 0 + wrapper_fn.reset_mock() + + # Ensure method has been cached + assert client._transport.update in client._transport._wrapped_methods + + # Replace cached wrapped function with mock + mock_rpc = mock.Mock() + mock_rpc.return_value.name = ( + "foo" # operation_request.operation in compute client(s) expect a string. + ) + client._transport._wrapped_methods[client._transport.update] = mock_rpc + + request = {} + client.update_unary(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + # Operation methods build a cached wrapper on first rpc call + # subsequent calls should use the cached wrapper + wrapper_fn.reset_mock() + + client.update_unary(request) + + # Establish that a new wrapper was not created for this call + assert wrapper_fn.call_count == 0 + assert mock_rpc.call_count == 2 + + +def test_update_unary_rest_required_fields(request_type=compute.UpdateLicenseRequest): + transport_class = transports.LicensesRestTransport + + request_init = {} + request_init["license_"] = "" + request_init["project"] = "" + request = request_type(**request_init) + pb_request = request_type.pb(request) + jsonified_request = json.loads( + json_format.MessageToJson(pb_request, use_integers_for_enums=False) + ) + + # verify fields with default values are dropped + assert "license" not in jsonified_request + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).update._get_unset_required_fields(jsonified_request) + jsonified_request.update(unset_fields) + + # verify required fields with default values are now present + assert "license" in jsonified_request + assert jsonified_request["license"] == request_init["license_"] + + jsonified_request["license"] = "license__value" + jsonified_request["project"] = "project_value" + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).update._get_unset_required_fields(jsonified_request) + # Check that path parameters and body parameters are not mixing in. + assert not set(unset_fields) - set( + ( + "license_", + "request_id", + "update_mask", + ) + ) + jsonified_request.update(unset_fields) + + # verify required fields with non-default values are left alone + assert "license" in jsonified_request + assert jsonified_request["license"] == "license__value" + assert "project" in jsonified_request + assert jsonified_request["project"] == "project_value" + + client = LicensesClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + request = request_type(**request_init) + + # Designate an appropriate value for the returned response. + return_value = compute.Operation() + # Mock the http request call within the method and fake a response. + with mock.patch.object(Session, "request") as req: + # We need to mock transcode() because providing default values + # for required fields will fail the real version if the http_options + # expect actual values for those fields. + with mock.patch.object(path_template, "transcode") as transcode: + # A uri without fields and an empty body will force all the + # request fields to show up in the query_params. + pb_request = request_type.pb(request) + transcode_result = { + "uri": "v1/sample_method", + "method": "patch", + "query_params": pb_request, + } + transcode_result["body"] = pb_request + transcode.return_value = transcode_result + + response_value = Response() + response_value.status_code = 200 + + # Convert return value to protobuf type + return_value = compute.Operation.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + response = client.update_unary(request) + + expected_params = [ + ( + "license", + "", + ), + ] + actual_params = req.call_args.kwargs["params"] + assert expected_params == actual_params + + +def test_update_unary_rest_unset_required_fields(): + transport = transports.LicensesRestTransport( + credentials=ga_credentials.AnonymousCredentials + ) + + unset_fields = transport.update._get_unset_required_fields({}) + assert set(unset_fields) == ( + set( + ( + "license", + "requestId", + "updateMask", + ) + ) + & set( + ( + "license", + "licenseResource", + "project", + ) + ) + ) + + +def test_update_unary_rest_flattened(): + client = LicensesClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = compute.Operation() + + # get arguments that satisfy an http rule for this method + sample_request = {"project": "sample1", "license_": "sample2"} + + # get truthy value for each flattened field + mock_args = dict( + project="project_value", + license_="license__value", + license_resource=compute.License( + allowed_replacement_licenses=["allowed_replacement_licenses_value"] + ), + ) + mock_args.update(sample_request) + + # Wrap the value into a proper Response obj + response_value = Response() + response_value.status_code = 200 + # Convert return value to protobuf type + return_value = compute.Operation.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + client.update_unary(**mock_args) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(req.mock_calls) == 1 + _, args, _ = req.mock_calls[0] + assert path_template.validate( + "%s/compute/v1/projects/{project}/global/licenses/{license_}" + % client.transport._host, + args[1], + ) + + +def test_update_unary_rest_flattened_error(transport: str = "rest"): + client = LicensesClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.update_unary( + compute.UpdateLicenseRequest(), + project="project_value", + license_="license__value", + license_resource=compute.License( + allowed_replacement_licenses=["allowed_replacement_licenses_value"] + ), + ) + + def test_credentials_transport_error(): # It is an error to provide credentials and a transport instance. transport = transports.LicensesRestTransport( @@ -3071,15 +3527,25 @@ def test_get_rest_call_success(request_type): with mock.patch.object(type(client.transport._session), "request") as req: # Designate an appropriate value for the returned response. return_value = compute.License( + allowed_replacement_licenses=["allowed_replacement_licenses_value"], + appendable_to_disk=True, charges_use_fee=True, creation_timestamp="creation_timestamp_value", description="description_value", id=205, + incompatible_licenses=["incompatible_licenses_value"], kind="kind_value", license_code=1245, + multi_tenant_only=True, name="name_value", + os_license=True, + removable_from_disk=True, + required_coattached_licenses=["required_coattached_licenses_value"], self_link="self_link_value", + self_link_with_id="self_link_with_id_value", + sole_tenant_only=True, transferable=True, + update_timestamp="update_timestamp_value", ) # Wrap the value into a proper Response obj @@ -3096,15 +3562,29 @@ def test_get_rest_call_success(request_type): # Establish that the response is the type that we expect. assert isinstance(response, compute.License) + assert response.allowed_replacement_licenses == [ + "allowed_replacement_licenses_value" + ] + assert response.appendable_to_disk is True assert response.charges_use_fee is True assert response.creation_timestamp == "creation_timestamp_value" assert response.description == "description_value" assert response.id == 205 + assert response.incompatible_licenses == ["incompatible_licenses_value"] assert response.kind == "kind_value" assert response.license_code == 1245 + assert response.multi_tenant_only is True assert response.name == "name_value" + assert response.os_license is True + assert response.removable_from_disk is True + assert response.required_coattached_licenses == [ + "required_coattached_licenses_value" + ] assert response.self_link == "self_link_value" + assert response.self_link_with_id == "self_link_with_id_value" + assert response.sole_tenant_only is True assert response.transferable is True + assert response.update_timestamp == "update_timestamp_value" @pytest.mark.parametrize("null_interceptor", [True, False]) @@ -3332,16 +3812,36 @@ def test_insert_rest_call_success(request_type): # send a request that will satisfy transcoding request_init = {"project": "sample1"} request_init["license_resource"] = { + "allowed_replacement_licenses": [ + "allowed_replacement_licenses_value1", + "allowed_replacement_licenses_value2", + ], + "appendable_to_disk": True, "charges_use_fee": True, "creation_timestamp": "creation_timestamp_value", "description": "description_value", "id": 205, + "incompatible_licenses": [ + "incompatible_licenses_value1", + "incompatible_licenses_value2", + ], "kind": "kind_value", "license_code": 1245, + "minimum_retention": {"nanos": 543, "seconds": 751}, + "multi_tenant_only": True, "name": "name_value", + "os_license": True, + "removable_from_disk": True, + "required_coattached_licenses": [ + "required_coattached_licenses_value1", + "required_coattached_licenses_value2", + ], "resource_requirements": {"min_guest_cpu_count": 2042, "min_memory_mb": 1386}, "self_link": "self_link_value", + "self_link_with_id": "self_link_with_id_value", + "sole_tenant_only": True, "transferable": True, + "update_timestamp": "update_timestamp_value", } # The version of a generated dependency at test runtime may differ from the version used during generation. # Delete any fields which are not present in the current runtime dependency @@ -4113,6 +4613,268 @@ def test_test_iam_permissions_rest_interceptors(null_interceptor): post_with_metadata.assert_called_once() +def test_update_rest_bad_request(request_type=compute.UpdateLicenseRequest): + client = LicensesClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + # send a request that will satisfy transcoding + request_init = {"project": "sample1", "license_": "sample2"} + request = request_type(**request_init) + + # Mock the http request call within the method and fake a BadRequest error. + with mock.patch.object(Session, "request") as req, pytest.raises( + core_exceptions.BadRequest + ): + # Wrap the value into a proper Response obj + response_value = mock.Mock() + json_return_value = "" + response_value.json = mock.Mock(return_value={}) + response_value.status_code = 400 + response_value.request = mock.Mock() + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + client.update(request) + + +@pytest.mark.parametrize( + "request_type", + [ + compute.UpdateLicenseRequest, + dict, + ], +) +def test_update_rest_call_success(request_type): + client = LicensesClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + + # send a request that will satisfy transcoding + request_init = {"project": "sample1", "license_": "sample2"} + request_init["license_resource"] = { + "allowed_replacement_licenses": [ + "allowed_replacement_licenses_value1", + "allowed_replacement_licenses_value2", + ], + "appendable_to_disk": True, + "charges_use_fee": True, + "creation_timestamp": "creation_timestamp_value", + "description": "description_value", + "id": 205, + "incompatible_licenses": [ + "incompatible_licenses_value1", + "incompatible_licenses_value2", + ], + "kind": "kind_value", + "license_code": 1245, + "minimum_retention": {"nanos": 543, "seconds": 751}, + "multi_tenant_only": True, + "name": "name_value", + "os_license": True, + "removable_from_disk": True, + "required_coattached_licenses": [ + "required_coattached_licenses_value1", + "required_coattached_licenses_value2", + ], + "resource_requirements": {"min_guest_cpu_count": 2042, "min_memory_mb": 1386}, + "self_link": "self_link_value", + "self_link_with_id": "self_link_with_id_value", + "sole_tenant_only": True, + "transferable": True, + "update_timestamp": "update_timestamp_value", + } + # The version of a generated dependency at test runtime may differ from the version used during generation. + # Delete any fields which are not present in the current runtime dependency + # See https://github.com/googleapis/gapic-generator-python/issues/1748 + + # Determine if the message type is proto-plus or protobuf + test_field = compute.UpdateLicenseRequest.meta.fields["license_resource"] + + def get_message_fields(field): + # Given a field which is a message (composite type), return a list with + # all the fields of the message. + # If the field is not a composite type, return an empty list. + message_fields = [] + + if hasattr(field, "message") and field.message: + is_field_type_proto_plus_type = not hasattr(field.message, "DESCRIPTOR") + + if is_field_type_proto_plus_type: + message_fields = field.message.meta.fields.values() + # Add `# pragma: NO COVER` because there may not be any `*_pb2` field types + else: # pragma: NO COVER + message_fields = field.message.DESCRIPTOR.fields + return message_fields + + runtime_nested_fields = [ + (field.name, nested_field.name) + for field in get_message_fields(test_field) + for nested_field in get_message_fields(field) + ] + + subfields_not_in_runtime = [] + + # For each item in the sample request, create a list of sub fields which are not present at runtime + # Add `# pragma: NO COVER` because this test code will not run if all subfields are present at runtime + for field, value in request_init["license_resource"].items(): # pragma: NO COVER + result = None + is_repeated = False + # For repeated fields + if isinstance(value, list) and len(value): + is_repeated = True + result = value[0] + # For fields where the type is another message + if isinstance(value, dict): + result = value + + if result and hasattr(result, "keys"): + for subfield in result.keys(): + if (field, subfield) not in runtime_nested_fields: + subfields_not_in_runtime.append( + { + "field": field, + "subfield": subfield, + "is_repeated": is_repeated, + } + ) + + # Remove fields from the sample request which are not present in the runtime version of the dependency + # Add `# pragma: NO COVER` because this test code will not run if all subfields are present at runtime + for subfield_to_delete in subfields_not_in_runtime: # pragma: NO COVER + field = subfield_to_delete.get("field") + field_repeated = subfield_to_delete.get("is_repeated") + subfield = subfield_to_delete.get("subfield") + if subfield: + if field_repeated: + for i in range(0, len(request_init["license_resource"][field])): + del request_init["license_resource"][field][i][subfield] + else: + del request_init["license_resource"][field][subfield] + request = request_type(**request_init) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = compute.Operation( + client_operation_id="client_operation_id_value", + creation_timestamp="creation_timestamp_value", + description="description_value", + end_time="end_time_value", + http_error_message="http_error_message_value", + http_error_status_code=2374, + id=205, + insert_time="insert_time_value", + kind="kind_value", + name="name_value", + operation_group_id="operation_group_id_value", + operation_type="operation_type_value", + progress=885, + region="region_value", + self_link="self_link_value", + start_time="start_time_value", + status=compute.Operation.Status.DONE, + status_message="status_message_value", + target_id=947, + target_link="target_link_value", + user="user_value", + zone="zone_value", + ) + + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.status_code = 200 + + # Convert return value to protobuf type + return_value = compute.Operation.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + response_value.content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + response = client.update(request) + + # Establish that the response is the type that we expect. + assert isinstance(response, extended_operation.ExtendedOperation) + assert response.client_operation_id == "client_operation_id_value" + assert response.creation_timestamp == "creation_timestamp_value" + assert response.description == "description_value" + assert response.end_time == "end_time_value" + assert response.http_error_message == "http_error_message_value" + assert response.http_error_status_code == 2374 + assert response.id == 205 + assert response.insert_time == "insert_time_value" + assert response.kind == "kind_value" + assert response.name == "name_value" + assert response.operation_group_id == "operation_group_id_value" + assert response.operation_type == "operation_type_value" + assert response.progress == 885 + assert response.region == "region_value" + assert response.self_link == "self_link_value" + assert response.start_time == "start_time_value" + assert response.status == compute.Operation.Status.DONE + assert response.status_message == "status_message_value" + assert response.target_id == 947 + assert response.target_link == "target_link_value" + assert response.user == "user_value" + assert response.zone == "zone_value" + + +@pytest.mark.parametrize("null_interceptor", [True, False]) +def test_update_rest_interceptors(null_interceptor): + transport = transports.LicensesRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + interceptor=None if null_interceptor else transports.LicensesRestInterceptor(), + ) + client = LicensesClient(transport=transport) + + with mock.patch.object( + type(client.transport._session), "request" + ) as req, mock.patch.object( + path_template, "transcode" + ) as transcode, mock.patch.object( + transports.LicensesRestInterceptor, "post_update" + ) as post, mock.patch.object( + transports.LicensesRestInterceptor, "post_update_with_metadata" + ) as post_with_metadata, mock.patch.object( + transports.LicensesRestInterceptor, "pre_update" + ) as pre: + pre.assert_not_called() + post.assert_not_called() + post_with_metadata.assert_not_called() + pb_message = compute.UpdateLicenseRequest.pb(compute.UpdateLicenseRequest()) + transcode.return_value = { + "method": "post", + "uri": "my_uri", + "body": pb_message, + "query_params": pb_message, + } + + req.return_value = mock.Mock() + req.return_value.status_code = 200 + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + return_value = compute.Operation.to_json(compute.Operation()) + req.return_value.content = return_value + + request = compute.UpdateLicenseRequest() + metadata = [ + ("key", "val"), + ("cephalopod", "squid"), + ] + pre.return_value = request, metadata + post.return_value = compute.Operation() + post_with_metadata.return_value = compute.Operation(), metadata + + client.update( + request, + metadata=[ + ("key", "val"), + ("cephalopod", "squid"), + ], + ) + + pre.assert_called_once() + post.assert_called_once() + post_with_metadata.assert_called_once() + + def test_initialize_client_w_rest(): client = LicensesClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" @@ -4262,6 +5024,26 @@ def test_test_iam_permissions_empty_call_rest(): assert args[0] == request_msg +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_update_unary_empty_call_rest(): + client = LicensesClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object(type(client.transport.update), "__call__") as call: + client.update_unary(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = compute.UpdateLicenseRequest() + + assert args[0] == request_msg + + def test_licenses_base_transport_error(): # Passing both a credentials object and credentials_file should raise an error with pytest.raises(core_exceptions.DuplicateCredentialArgs): @@ -4291,6 +5073,7 @@ def test_licenses_base_transport(): "list", "set_iam_policy", "test_iam_permissions", + "update", ) for method in methods: with pytest.raises(NotImplementedError): @@ -4449,6 +5232,9 @@ def test_licenses_client_transport_session_collision(transport_name): session1 = client1.transport.test_iam_permissions._session session2 = client2.transport.test_iam_permissions._session assert session1 != session2 + session1 = client1.transport.update._session + session2 = client2.transport.update._session + assert session1 != session2 def test_common_billing_account_path(): diff --git a/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_network_firewall_policies.py b/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_network_firewall_policies.py index d7af27020d28..88092f742c10 100644 --- a/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_network_firewall_policies.py +++ b/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_network_firewall_policies.py @@ -8412,6 +8412,7 @@ def test_add_packet_mirroring_rule_rest_call_success(request_type): ], "dest_fqdns": ["dest_fqdns_value1", "dest_fqdns_value2"], "dest_ip_ranges": ["dest_ip_ranges_value1", "dest_ip_ranges_value2"], + "dest_network_type": "dest_network_type_value", "dest_region_codes": [ "dest_region_codes_value1", "dest_region_codes_value2", @@ -8432,6 +8433,8 @@ def test_add_packet_mirroring_rule_rest_call_success(request_type): ], "src_fqdns": ["src_fqdns_value1", "src_fqdns_value2"], "src_ip_ranges": ["src_ip_ranges_value1", "src_ip_ranges_value2"], + "src_network_type": "src_network_type_value", + "src_networks": ["src_networks_value1", "src_networks_value2"], "src_region_codes": ["src_region_codes_value1", "src_region_codes_value2"], "src_secure_tags": [{"name": "name_value", "state": "state_value"}], "src_threat_intelligences": [ @@ -8712,6 +8715,7 @@ def test_add_rule_rest_call_success(request_type): ], "dest_fqdns": ["dest_fqdns_value1", "dest_fqdns_value2"], "dest_ip_ranges": ["dest_ip_ranges_value1", "dest_ip_ranges_value2"], + "dest_network_type": "dest_network_type_value", "dest_region_codes": [ "dest_region_codes_value1", "dest_region_codes_value2", @@ -8732,6 +8736,8 @@ def test_add_rule_rest_call_success(request_type): ], "src_fqdns": ["src_fqdns_value1", "src_fqdns_value2"], "src_ip_ranges": ["src_ip_ranges_value1", "src_ip_ranges_value2"], + "src_network_type": "src_network_type_value", + "src_networks": ["src_networks_value1", "src_networks_value2"], "src_region_codes": ["src_region_codes_value1", "src_region_codes_value2"], "src_secure_tags": [{"name": "name_value", "state": "state_value"}], "src_threat_intelligences": [ @@ -10234,6 +10240,7 @@ def test_insert_rest_call_success(request_type): "dest_ip_ranges_value1", "dest_ip_ranges_value2", ], + "dest_network_type": "dest_network_type_value", "dest_region_codes": [ "dest_region_codes_value1", "dest_region_codes_value2", @@ -10254,6 +10261,8 @@ def test_insert_rest_call_success(request_type): ], "src_fqdns": ["src_fqdns_value1", "src_fqdns_value2"], "src_ip_ranges": ["src_ip_ranges_value1", "src_ip_ranges_value2"], + "src_network_type": "src_network_type_value", + "src_networks": ["src_networks_value1", "src_networks_value2"], "src_region_codes": [ "src_region_codes_value1", "src_region_codes_value2", @@ -10690,6 +10699,7 @@ def test_patch_rest_call_success(request_type): "dest_ip_ranges_value1", "dest_ip_ranges_value2", ], + "dest_network_type": "dest_network_type_value", "dest_region_codes": [ "dest_region_codes_value1", "dest_region_codes_value2", @@ -10710,6 +10720,8 @@ def test_patch_rest_call_success(request_type): ], "src_fqdns": ["src_fqdns_value1", "src_fqdns_value2"], "src_ip_ranges": ["src_ip_ranges_value1", "src_ip_ranges_value2"], + "src_network_type": "src_network_type_value", + "src_networks": ["src_networks_value1", "src_networks_value2"], "src_region_codes": [ "src_region_codes_value1", "src_region_codes_value2", @@ -10998,6 +11010,7 @@ def test_patch_packet_mirroring_rule_rest_call_success(request_type): ], "dest_fqdns": ["dest_fqdns_value1", "dest_fqdns_value2"], "dest_ip_ranges": ["dest_ip_ranges_value1", "dest_ip_ranges_value2"], + "dest_network_type": "dest_network_type_value", "dest_region_codes": [ "dest_region_codes_value1", "dest_region_codes_value2", @@ -11018,6 +11031,8 @@ def test_patch_packet_mirroring_rule_rest_call_success(request_type): ], "src_fqdns": ["src_fqdns_value1", "src_fqdns_value2"], "src_ip_ranges": ["src_ip_ranges_value1", "src_ip_ranges_value2"], + "src_network_type": "src_network_type_value", + "src_networks": ["src_networks_value1", "src_networks_value2"], "src_region_codes": ["src_region_codes_value1", "src_region_codes_value2"], "src_secure_tags": [{"name": "name_value", "state": "state_value"}], "src_threat_intelligences": [ @@ -11300,6 +11315,7 @@ def test_patch_rule_rest_call_success(request_type): ], "dest_fqdns": ["dest_fqdns_value1", "dest_fqdns_value2"], "dest_ip_ranges": ["dest_ip_ranges_value1", "dest_ip_ranges_value2"], + "dest_network_type": "dest_network_type_value", "dest_region_codes": [ "dest_region_codes_value1", "dest_region_codes_value2", @@ -11320,6 +11336,8 @@ def test_patch_rule_rest_call_success(request_type): ], "src_fqdns": ["src_fqdns_value1", "src_fqdns_value2"], "src_ip_ranges": ["src_ip_ranges_value1", "src_ip_ranges_value2"], + "src_network_type": "src_network_type_value", + "src_networks": ["src_networks_value1", "src_networks_value2"], "src_region_codes": ["src_region_codes_value1", "src_region_codes_value2"], "src_secure_tags": [{"name": "name_value", "state": "state_value"}], "src_threat_intelligences": [ diff --git a/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_networks.py b/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_networks.py index ea0a4f4e2dfd..b1c9f8e2565f 100644 --- a/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_networks.py +++ b/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_networks.py @@ -5504,6 +5504,7 @@ def test_insert_rest_call_success(request_type): "name": "name_value", "network_firewall_policy_enforcement_order": "network_firewall_policy_enforcement_order_value", "network_profile": "network_profile_value", + "params": {"resource_manager_tags": {}}, "peerings": [ { "auto_create_routes": True, @@ -6037,6 +6038,7 @@ def test_patch_rest_call_success(request_type): "name": "name_value", "network_firewall_policy_enforcement_order": "network_firewall_policy_enforcement_order_value", "network_profile": "network_profile_value", + "params": {"resource_manager_tags": {}}, "peerings": [ { "auto_create_routes": True, diff --git a/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_region_backend_services.py b/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_region_backend_services.py index 76eddec54c4f..429df0c54a94 100644 --- a/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_region_backend_services.py +++ b/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_region_backend_services.py @@ -5664,7 +5664,13 @@ def test_insert_rest_call_success(request_type): "failover_ratio": 0.1494, }, "fingerprint": "fingerprint_value", - "ha_policy": {"fast_i_p_move": "fast_i_p_move_value"}, + "ha_policy": { + "fast_i_p_move": "fast_i_p_move_value", + "leader": { + "backend_group": "backend_group_value", + "network_endpoint": {"instance": "instance_value"}, + }, + }, "health_checks": ["health_checks_value1", "health_checks_value2"], "iap": { "enabled": True, @@ -6354,7 +6360,13 @@ def test_patch_rest_call_success(request_type): "failover_ratio": 0.1494, }, "fingerprint": "fingerprint_value", - "ha_policy": {"fast_i_p_move": "fast_i_p_move_value"}, + "ha_policy": { + "fast_i_p_move": "fast_i_p_move_value", + "leader": { + "backend_group": "backend_group_value", + "network_endpoint": {"instance": "instance_value"}, + }, + }, "health_checks": ["health_checks_value1", "health_checks_value2"], "iap": { "enabled": True, @@ -7491,7 +7503,13 @@ def test_update_rest_call_success(request_type): "failover_ratio": 0.1494, }, "fingerprint": "fingerprint_value", - "ha_policy": {"fast_i_p_move": "fast_i_p_move_value"}, + "ha_policy": { + "fast_i_p_move": "fast_i_p_move_value", + "leader": { + "backend_group": "backend_group_value", + "network_endpoint": {"instance": "instance_value"}, + }, + }, "health_checks": ["health_checks_value1", "health_checks_value2"], "iap": { "enabled": True, diff --git a/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_region_commitments.py b/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_region_commitments.py index 8ac09ff4b95e..7250fb14eab8 100644 --- a/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_region_commitments.py +++ b/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_region_commitments.py @@ -3040,8 +3040,11 @@ def test_insert_rest_call_success(request_type): }, "commitment": "commitment_value", "creation_timestamp": "creation_timestamp_value", + "delete_after_duration": {"nanos": 543, "seconds": 751}, + "delete_at_time": "delete_at_time_value", "deployment_type": "deployment_type_value", "description": "description_value", + "enable_emergent_maintenance": True, "id": 205, "kind": "kind_value", "linked_commitments": [ @@ -3527,8 +3530,11 @@ def test_update_rest_call_success(request_type): }, "commitment": "commitment_value", "creation_timestamp": "creation_timestamp_value", + "delete_after_duration": {"nanos": 543, "seconds": 751}, + "delete_at_time": "delete_at_time_value", "deployment_type": "deployment_type_value", "description": "description_value", + "enable_emergent_maintenance": True, "id": 205, "kind": "kind_value", "linked_commitments": [ diff --git a/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_region_network_firewall_policies.py b/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_region_network_firewall_policies.py index 3e99eabec062..be049aadf98c 100644 --- a/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_region_network_firewall_policies.py +++ b/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_region_network_firewall_policies.py @@ -7146,6 +7146,7 @@ def test_add_rule_rest_call_success(request_type): ], "dest_fqdns": ["dest_fqdns_value1", "dest_fqdns_value2"], "dest_ip_ranges": ["dest_ip_ranges_value1", "dest_ip_ranges_value2"], + "dest_network_type": "dest_network_type_value", "dest_region_codes": [ "dest_region_codes_value1", "dest_region_codes_value2", @@ -7166,6 +7167,8 @@ def test_add_rule_rest_call_success(request_type): ], "src_fqdns": ["src_fqdns_value1", "src_fqdns_value2"], "src_ip_ranges": ["src_ip_ranges_value1", "src_ip_ranges_value2"], + "src_network_type": "src_network_type_value", + "src_networks": ["src_networks_value1", "src_networks_value2"], "src_region_codes": ["src_region_codes_value1", "src_region_codes_value2"], "src_secure_tags": [{"name": "name_value", "state": "state_value"}], "src_threat_intelligences": [ @@ -8563,6 +8566,7 @@ def test_insert_rest_call_success(request_type): "dest_ip_ranges_value1", "dest_ip_ranges_value2", ], + "dest_network_type": "dest_network_type_value", "dest_region_codes": [ "dest_region_codes_value1", "dest_region_codes_value2", @@ -8583,6 +8587,8 @@ def test_insert_rest_call_success(request_type): ], "src_fqdns": ["src_fqdns_value1", "src_fqdns_value2"], "src_ip_ranges": ["src_ip_ranges_value1", "src_ip_ranges_value2"], + "src_network_type": "src_network_type_value", + "src_networks": ["src_networks_value1", "src_networks_value2"], "src_region_codes": [ "src_region_codes_value1", "src_region_codes_value2", @@ -9033,6 +9039,7 @@ def test_patch_rest_call_success(request_type): "dest_ip_ranges_value1", "dest_ip_ranges_value2", ], + "dest_network_type": "dest_network_type_value", "dest_region_codes": [ "dest_region_codes_value1", "dest_region_codes_value2", @@ -9053,6 +9060,8 @@ def test_patch_rest_call_success(request_type): ], "src_fqdns": ["src_fqdns_value1", "src_fqdns_value2"], "src_ip_ranges": ["src_ip_ranges_value1", "src_ip_ranges_value2"], + "src_network_type": "src_network_type_value", + "src_networks": ["src_networks_value1", "src_networks_value2"], "src_region_codes": [ "src_region_codes_value1", "src_region_codes_value2", @@ -9350,6 +9359,7 @@ def test_patch_rule_rest_call_success(request_type): ], "dest_fqdns": ["dest_fqdns_value1", "dest_fqdns_value2"], "dest_ip_ranges": ["dest_ip_ranges_value1", "dest_ip_ranges_value2"], + "dest_network_type": "dest_network_type_value", "dest_region_codes": [ "dest_region_codes_value1", "dest_region_codes_value2", @@ -9370,6 +9380,8 @@ def test_patch_rule_rest_call_success(request_type): ], "src_fqdns": ["src_fqdns_value1", "src_fqdns_value2"], "src_ip_ranges": ["src_ip_ranges_value1", "src_ip_ranges_value2"], + "src_network_type": "src_network_type_value", + "src_networks": ["src_networks_value1", "src_networks_value2"], "src_region_codes": ["src_region_codes_value1", "src_region_codes_value2"], "src_secure_tags": [{"name": "name_value", "state": "state_value"}], "src_threat_intelligences": [ diff --git a/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_reservation_sub_blocks.py b/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_reservation_sub_blocks.py new file mode 100644 index 000000000000..eace9b176255 --- /dev/null +++ b/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_reservation_sub_blocks.py @@ -0,0 +1,2243 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +import os + +# try/except added for compatibility with python < 3.8 +try: + from unittest import mock + from unittest.mock import AsyncMock # pragma: NO COVER +except ImportError: # pragma: NO COVER + import mock + +from collections.abc import AsyncIterable, Iterable +import json +import math + +from google.api_core import api_core_version +from google.protobuf import json_format +import grpc +from grpc.experimental import aio +from proto.marshal.rules import wrappers +from proto.marshal.rules.dates import DurationRule, TimestampRule +import pytest +from requests import PreparedRequest, Request, Response +from requests.sessions import Session + +try: + from google.auth.aio import credentials as ga_credentials_async + + HAS_GOOGLE_AUTH_AIO = True +except ImportError: # pragma: NO COVER + HAS_GOOGLE_AUTH_AIO = False + +from google.api_core import gapic_v1, grpc_helpers, grpc_helpers_async, path_template +from google.api_core import client_options +from google.api_core import exceptions as core_exceptions +from google.api_core import retry as retries +import google.auth +from google.auth import credentials as ga_credentials +from google.auth.exceptions import MutualTLSChannelError +from google.oauth2 import service_account + +from google.cloud.compute_v1.services.reservation_sub_blocks import ( + ReservationSubBlocksClient, + pagers, + transports, +) +from google.cloud.compute_v1.types import compute + +CRED_INFO_JSON = { + "credential_source": "/path/to/file", + "credential_type": "service account credentials", + "principal": "service-account@example.com", +} +CRED_INFO_STRING = json.dumps(CRED_INFO_JSON) + + +async def mock_async_gen(data, chunk_size=1): + for i in range(0, len(data)): # pragma: NO COVER + chunk = data[i : i + chunk_size] + yield chunk.encode("utf-8") + + +def client_cert_source_callback(): + return b"cert bytes", b"key bytes" + + +# TODO: use async auth anon credentials by default once the minimum version of google-auth is upgraded. +# See related issue: https://github.com/googleapis/gapic-generator-python/issues/2107. +def async_anonymous_credentials(): + if HAS_GOOGLE_AUTH_AIO: + return ga_credentials_async.AnonymousCredentials() + return ga_credentials.AnonymousCredentials() + + +# If default endpoint is localhost, then default mtls endpoint will be the same. +# This method modifies the default endpoint so the client can produce a different +# mtls endpoint for endpoint testing purposes. +def modify_default_endpoint(client): + return ( + "foo.googleapis.com" + if ("localhost" in client.DEFAULT_ENDPOINT) + else client.DEFAULT_ENDPOINT + ) + + +# If default endpoint template is localhost, then default mtls endpoint will be the same. +# This method modifies the default endpoint template so the client can produce a different +# mtls endpoint for endpoint testing purposes. +def modify_default_endpoint_template(client): + return ( + "test.{UNIVERSE_DOMAIN}" + if ("localhost" in client._DEFAULT_ENDPOINT_TEMPLATE) + else client._DEFAULT_ENDPOINT_TEMPLATE + ) + + +def test__get_default_mtls_endpoint(): + api_endpoint = "example.googleapis.com" + api_mtls_endpoint = "example.mtls.googleapis.com" + sandbox_endpoint = "example.sandbox.googleapis.com" + sandbox_mtls_endpoint = "example.mtls.sandbox.googleapis.com" + non_googleapi = "api.example.com" + + assert ReservationSubBlocksClient._get_default_mtls_endpoint(None) is None + assert ( + ReservationSubBlocksClient._get_default_mtls_endpoint(api_endpoint) + == api_mtls_endpoint + ) + assert ( + ReservationSubBlocksClient._get_default_mtls_endpoint(api_mtls_endpoint) + == api_mtls_endpoint + ) + assert ( + ReservationSubBlocksClient._get_default_mtls_endpoint(sandbox_endpoint) + == sandbox_mtls_endpoint + ) + assert ( + ReservationSubBlocksClient._get_default_mtls_endpoint(sandbox_mtls_endpoint) + == sandbox_mtls_endpoint + ) + assert ( + ReservationSubBlocksClient._get_default_mtls_endpoint(non_googleapi) + == non_googleapi + ) + + +def test__read_environment_variables(): + assert ReservationSubBlocksClient._read_environment_variables() == ( + False, + "auto", + None, + ) + + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "true"}): + assert ReservationSubBlocksClient._read_environment_variables() == ( + True, + "auto", + None, + ) + + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "false"}): + assert ReservationSubBlocksClient._read_environment_variables() == ( + False, + "auto", + None, + ) + + with mock.patch.dict( + os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "Unsupported"} + ): + with pytest.raises(ValueError) as excinfo: + ReservationSubBlocksClient._read_environment_variables() + assert ( + str(excinfo.value) + == "Environment variable `GOOGLE_API_USE_CLIENT_CERTIFICATE` must be either `true` or `false`" + ) + + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): + assert ReservationSubBlocksClient._read_environment_variables() == ( + False, + "never", + None, + ) + + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}): + assert ReservationSubBlocksClient._read_environment_variables() == ( + False, + "always", + None, + ) + + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "auto"}): + assert ReservationSubBlocksClient._read_environment_variables() == ( + False, + "auto", + None, + ) + + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "Unsupported"}): + with pytest.raises(MutualTLSChannelError) as excinfo: + ReservationSubBlocksClient._read_environment_variables() + assert ( + str(excinfo.value) + == "Environment variable `GOOGLE_API_USE_MTLS_ENDPOINT` must be `never`, `auto` or `always`" + ) + + with mock.patch.dict(os.environ, {"GOOGLE_CLOUD_UNIVERSE_DOMAIN": "foo.com"}): + assert ReservationSubBlocksClient._read_environment_variables() == ( + False, + "auto", + "foo.com", + ) + + +def test__get_client_cert_source(): + mock_provided_cert_source = mock.Mock() + mock_default_cert_source = mock.Mock() + + assert ReservationSubBlocksClient._get_client_cert_source(None, False) is None + assert ( + ReservationSubBlocksClient._get_client_cert_source( + mock_provided_cert_source, False + ) + is None + ) + assert ( + ReservationSubBlocksClient._get_client_cert_source( + mock_provided_cert_source, True + ) + == mock_provided_cert_source + ) + + with mock.patch( + "google.auth.transport.mtls.has_default_client_cert_source", return_value=True + ): + with mock.patch( + "google.auth.transport.mtls.default_client_cert_source", + return_value=mock_default_cert_source, + ): + assert ( + ReservationSubBlocksClient._get_client_cert_source(None, True) + is mock_default_cert_source + ) + assert ( + ReservationSubBlocksClient._get_client_cert_source( + mock_provided_cert_source, "true" + ) + is mock_provided_cert_source + ) + + +@mock.patch.object( + ReservationSubBlocksClient, + "_DEFAULT_ENDPOINT_TEMPLATE", + modify_default_endpoint_template(ReservationSubBlocksClient), +) +def test__get_api_endpoint(): + api_override = "foo.com" + mock_client_cert_source = mock.Mock() + default_universe = ReservationSubBlocksClient._DEFAULT_UNIVERSE + default_endpoint = ReservationSubBlocksClient._DEFAULT_ENDPOINT_TEMPLATE.format( + UNIVERSE_DOMAIN=default_universe + ) + mock_universe = "bar.com" + mock_endpoint = ReservationSubBlocksClient._DEFAULT_ENDPOINT_TEMPLATE.format( + UNIVERSE_DOMAIN=mock_universe + ) + + assert ( + ReservationSubBlocksClient._get_api_endpoint( + api_override, mock_client_cert_source, default_universe, "always" + ) + == api_override + ) + assert ( + ReservationSubBlocksClient._get_api_endpoint( + None, mock_client_cert_source, default_universe, "auto" + ) + == ReservationSubBlocksClient.DEFAULT_MTLS_ENDPOINT + ) + assert ( + ReservationSubBlocksClient._get_api_endpoint( + None, None, default_universe, "auto" + ) + == default_endpoint + ) + assert ( + ReservationSubBlocksClient._get_api_endpoint( + None, None, default_universe, "always" + ) + == ReservationSubBlocksClient.DEFAULT_MTLS_ENDPOINT + ) + assert ( + ReservationSubBlocksClient._get_api_endpoint( + None, mock_client_cert_source, default_universe, "always" + ) + == ReservationSubBlocksClient.DEFAULT_MTLS_ENDPOINT + ) + assert ( + ReservationSubBlocksClient._get_api_endpoint(None, None, mock_universe, "never") + == mock_endpoint + ) + assert ( + ReservationSubBlocksClient._get_api_endpoint( + None, None, default_universe, "never" + ) + == default_endpoint + ) + + with pytest.raises(MutualTLSChannelError) as excinfo: + ReservationSubBlocksClient._get_api_endpoint( + None, mock_client_cert_source, mock_universe, "auto" + ) + assert ( + str(excinfo.value) + == "mTLS is not supported in any universe other than googleapis.com." + ) + + +def test__get_universe_domain(): + client_universe_domain = "foo.com" + universe_domain_env = "bar.com" + + assert ( + ReservationSubBlocksClient._get_universe_domain( + client_universe_domain, universe_domain_env + ) + == client_universe_domain + ) + assert ( + ReservationSubBlocksClient._get_universe_domain(None, universe_domain_env) + == universe_domain_env + ) + assert ( + ReservationSubBlocksClient._get_universe_domain(None, None) + == ReservationSubBlocksClient._DEFAULT_UNIVERSE + ) + + with pytest.raises(ValueError) as excinfo: + ReservationSubBlocksClient._get_universe_domain("", None) + assert str(excinfo.value) == "Universe Domain cannot be an empty string." + + +@pytest.mark.parametrize( + "error_code,cred_info_json,show_cred_info", + [ + (401, CRED_INFO_JSON, True), + (403, CRED_INFO_JSON, True), + (404, CRED_INFO_JSON, True), + (500, CRED_INFO_JSON, False), + (401, None, False), + (403, None, False), + (404, None, False), + (500, None, False), + ], +) +def test__add_cred_info_for_auth_errors(error_code, cred_info_json, show_cred_info): + cred = mock.Mock(["get_cred_info"]) + cred.get_cred_info = mock.Mock(return_value=cred_info_json) + client = ReservationSubBlocksClient(credentials=cred) + client._transport._credentials = cred + + error = core_exceptions.GoogleAPICallError("message", details=["foo"]) + error.code = error_code + + client._add_cred_info_for_auth_errors(error) + if show_cred_info: + assert error.details == ["foo", CRED_INFO_STRING] + else: + assert error.details == ["foo"] + + +@pytest.mark.parametrize("error_code", [401, 403, 404, 500]) +def test__add_cred_info_for_auth_errors_no_get_cred_info(error_code): + cred = mock.Mock([]) + assert not hasattr(cred, "get_cred_info") + client = ReservationSubBlocksClient(credentials=cred) + client._transport._credentials = cred + + error = core_exceptions.GoogleAPICallError("message", details=[]) + error.code = error_code + + client._add_cred_info_for_auth_errors(error) + assert error.details == [] + + +@pytest.mark.parametrize( + "client_class,transport_name", + [ + (ReservationSubBlocksClient, "rest"), + ], +) +def test_reservation_sub_blocks_client_from_service_account_info( + client_class, transport_name +): + creds = ga_credentials.AnonymousCredentials() + with mock.patch.object( + service_account.Credentials, "from_service_account_info" + ) as factory: + factory.return_value = creds + info = {"valid": True} + client = client_class.from_service_account_info(info, transport=transport_name) + assert client.transport._credentials == creds + assert isinstance(client, client_class) + + assert client.transport._host == ( + "compute.googleapis.com:443" + if transport_name in ["grpc", "grpc_asyncio"] + else "https://compute.googleapis.com" + ) + + +@pytest.mark.parametrize( + "transport_class,transport_name", + [ + (transports.ReservationSubBlocksRestTransport, "rest"), + ], +) +def test_reservation_sub_blocks_client_service_account_always_use_jwt( + transport_class, transport_name +): + with mock.patch.object( + service_account.Credentials, "with_always_use_jwt_access", create=True + ) as use_jwt: + creds = service_account.Credentials(None, None, None) + transport = transport_class(credentials=creds, always_use_jwt_access=True) + use_jwt.assert_called_once_with(True) + + with mock.patch.object( + service_account.Credentials, "with_always_use_jwt_access", create=True + ) as use_jwt: + creds = service_account.Credentials(None, None, None) + transport = transport_class(credentials=creds, always_use_jwt_access=False) + use_jwt.assert_not_called() + + +@pytest.mark.parametrize( + "client_class,transport_name", + [ + (ReservationSubBlocksClient, "rest"), + ], +) +def test_reservation_sub_blocks_client_from_service_account_file( + client_class, transport_name +): + creds = ga_credentials.AnonymousCredentials() + with mock.patch.object( + service_account.Credentials, "from_service_account_file" + ) as factory: + factory.return_value = creds + client = client_class.from_service_account_file( + "dummy/file/path.json", transport=transport_name + ) + assert client.transport._credentials == creds + assert isinstance(client, client_class) + + client = client_class.from_service_account_json( + "dummy/file/path.json", transport=transport_name + ) + assert client.transport._credentials == creds + assert isinstance(client, client_class) + + assert client.transport._host == ( + "compute.googleapis.com:443" + if transport_name in ["grpc", "grpc_asyncio"] + else "https://compute.googleapis.com" + ) + + +def test_reservation_sub_blocks_client_get_transport_class(): + transport = ReservationSubBlocksClient.get_transport_class() + available_transports = [ + transports.ReservationSubBlocksRestTransport, + ] + assert transport in available_transports + + transport = ReservationSubBlocksClient.get_transport_class("rest") + assert transport == transports.ReservationSubBlocksRestTransport + + +@pytest.mark.parametrize( + "client_class,transport_class,transport_name", + [ + ( + ReservationSubBlocksClient, + transports.ReservationSubBlocksRestTransport, + "rest", + ), + ], +) +@mock.patch.object( + ReservationSubBlocksClient, + "_DEFAULT_ENDPOINT_TEMPLATE", + modify_default_endpoint_template(ReservationSubBlocksClient), +) +def test_reservation_sub_blocks_client_client_options( + client_class, transport_class, transport_name +): + # Check that if channel is provided we won't create a new one. + with mock.patch.object(ReservationSubBlocksClient, "get_transport_class") as gtc: + transport = transport_class(credentials=ga_credentials.AnonymousCredentials()) + client = client_class(transport=transport) + gtc.assert_not_called() + + # Check that if channel is provided via str we will create a new one. + with mock.patch.object(ReservationSubBlocksClient, "get_transport_class") as gtc: + client = client_class(transport=transport_name) + gtc.assert_called() + + # Check the case api_endpoint is provided. + options = client_options.ClientOptions(api_endpoint="squid.clam.whelk") + with mock.patch.object(transport_class, "__init__") as patched: + patched.return_value = None + client = client_class(transport=transport_name, client_options=options) + patched.assert_called_once_with( + credentials=None, + credentials_file=None, + host="squid.clam.whelk", + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + api_audience=None, + ) + + # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is + # "never". + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): + with mock.patch.object(transport_class, "__init__") as patched: + patched.return_value = None + client = client_class(transport=transport_name) + patched.assert_called_once_with( + credentials=None, + credentials_file=None, + host=client._DEFAULT_ENDPOINT_TEMPLATE.format( + UNIVERSE_DOMAIN=client._DEFAULT_UNIVERSE + ), + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + api_audience=None, + ) + + # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is + # "always". + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}): + with mock.patch.object(transport_class, "__init__") as patched: + patched.return_value = None + client = client_class(transport=transport_name) + patched.assert_called_once_with( + credentials=None, + credentials_file=None, + host=client.DEFAULT_MTLS_ENDPOINT, + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + api_audience=None, + ) + + # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has + # unsupported value. + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "Unsupported"}): + with pytest.raises(MutualTLSChannelError) as excinfo: + client = client_class(transport=transport_name) + assert ( + str(excinfo.value) + == "Environment variable `GOOGLE_API_USE_MTLS_ENDPOINT` must be `never`, `auto` or `always`" + ) + + # Check the case GOOGLE_API_USE_CLIENT_CERTIFICATE has unsupported value. + with mock.patch.dict( + os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "Unsupported"} + ): + with pytest.raises(ValueError) as excinfo: + client = client_class(transport=transport_name) + assert ( + str(excinfo.value) + == "Environment variable `GOOGLE_API_USE_CLIENT_CERTIFICATE` must be either `true` or `false`" + ) + + # Check the case quota_project_id is provided + options = client_options.ClientOptions(quota_project_id="octopus") + with mock.patch.object(transport_class, "__init__") as patched: + patched.return_value = None + client = client_class(client_options=options, transport=transport_name) + patched.assert_called_once_with( + credentials=None, + credentials_file=None, + host=client._DEFAULT_ENDPOINT_TEMPLATE.format( + UNIVERSE_DOMAIN=client._DEFAULT_UNIVERSE + ), + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id="octopus", + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + with mock.patch.object(transport_class, "__init__") as patched: + patched.return_value = None + client = client_class(client_options=options, transport=transport_name) + patched.assert_called_once_with( + credentials=None, + credentials_file=None, + host=client._DEFAULT_ENDPOINT_TEMPLATE.format( + UNIVERSE_DOMAIN=client._DEFAULT_UNIVERSE + ), + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + api_audience="https://language.googleapis.com", + ) + + +@pytest.mark.parametrize( + "client_class,transport_class,transport_name,use_client_cert_env", + [ + ( + ReservationSubBlocksClient, + transports.ReservationSubBlocksRestTransport, + "rest", + "true", + ), + ( + ReservationSubBlocksClient, + transports.ReservationSubBlocksRestTransport, + "rest", + "false", + ), + ], +) +@mock.patch.object( + ReservationSubBlocksClient, + "_DEFAULT_ENDPOINT_TEMPLATE", + modify_default_endpoint_template(ReservationSubBlocksClient), +) +@mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "auto"}) +def test_reservation_sub_blocks_client_mtls_env_auto( + client_class, transport_class, transport_name, use_client_cert_env +): + # This tests the endpoint autoswitch behavior. Endpoint is autoswitched to the default + # mtls endpoint, if GOOGLE_API_USE_CLIENT_CERTIFICATE is "true" and client cert exists. + + # Check the case client_cert_source is provided. Whether client cert is used depends on + # GOOGLE_API_USE_CLIENT_CERTIFICATE value. + with mock.patch.dict( + os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": use_client_cert_env} + ): + options = client_options.ClientOptions( + client_cert_source=client_cert_source_callback + ) + with mock.patch.object(transport_class, "__init__") as patched: + patched.return_value = None + client = client_class(client_options=options, transport=transport_name) + + if use_client_cert_env == "false": + expected_client_cert_source = None + expected_host = client._DEFAULT_ENDPOINT_TEMPLATE.format( + UNIVERSE_DOMAIN=client._DEFAULT_UNIVERSE + ) + else: + expected_client_cert_source = client_cert_source_callback + expected_host = client.DEFAULT_MTLS_ENDPOINT + + patched.assert_called_once_with( + credentials=None, + credentials_file=None, + host=expected_host, + scopes=None, + client_cert_source_for_mtls=expected_client_cert_source, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + api_audience=None, + ) + + # Check the case ADC client cert is provided. Whether client cert is used depends on + # GOOGLE_API_USE_CLIENT_CERTIFICATE value. + with mock.patch.dict( + os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": use_client_cert_env} + ): + with mock.patch.object(transport_class, "__init__") as patched: + with mock.patch( + "google.auth.transport.mtls.has_default_client_cert_source", + return_value=True, + ): + with mock.patch( + "google.auth.transport.mtls.default_client_cert_source", + return_value=client_cert_source_callback, + ): + if use_client_cert_env == "false": + expected_host = client._DEFAULT_ENDPOINT_TEMPLATE.format( + UNIVERSE_DOMAIN=client._DEFAULT_UNIVERSE + ) + expected_client_cert_source = None + else: + expected_host = client.DEFAULT_MTLS_ENDPOINT + expected_client_cert_source = client_cert_source_callback + + patched.return_value = None + client = client_class(transport=transport_name) + patched.assert_called_once_with( + credentials=None, + credentials_file=None, + host=expected_host, + scopes=None, + client_cert_source_for_mtls=expected_client_cert_source, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + api_audience=None, + ) + + # Check the case client_cert_source and ADC client cert are not provided. + with mock.patch.dict( + os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": use_client_cert_env} + ): + with mock.patch.object(transport_class, "__init__") as patched: + with mock.patch( + "google.auth.transport.mtls.has_default_client_cert_source", + return_value=False, + ): + patched.return_value = None + client = client_class(transport=transport_name) + patched.assert_called_once_with( + credentials=None, + credentials_file=None, + host=client._DEFAULT_ENDPOINT_TEMPLATE.format( + UNIVERSE_DOMAIN=client._DEFAULT_UNIVERSE + ), + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + api_audience=None, + ) + + +@pytest.mark.parametrize("client_class", [ReservationSubBlocksClient]) +@mock.patch.object( + ReservationSubBlocksClient, + "DEFAULT_ENDPOINT", + modify_default_endpoint(ReservationSubBlocksClient), +) +def test_reservation_sub_blocks_client_get_mtls_endpoint_and_cert_source(client_class): + mock_client_cert_source = mock.Mock() + + # Test the case GOOGLE_API_USE_CLIENT_CERTIFICATE is "true". + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "true"}): + mock_api_endpoint = "foo" + options = client_options.ClientOptions( + client_cert_source=mock_client_cert_source, api_endpoint=mock_api_endpoint + ) + api_endpoint, cert_source = client_class.get_mtls_endpoint_and_cert_source( + options + ) + assert api_endpoint == mock_api_endpoint + assert cert_source == mock_client_cert_source + + # Test the case GOOGLE_API_USE_CLIENT_CERTIFICATE is "false". + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "false"}): + mock_client_cert_source = mock.Mock() + mock_api_endpoint = "foo" + options = client_options.ClientOptions( + client_cert_source=mock_client_cert_source, api_endpoint=mock_api_endpoint + ) + api_endpoint, cert_source = client_class.get_mtls_endpoint_and_cert_source( + options + ) + assert api_endpoint == mock_api_endpoint + assert cert_source is None + + # Test the case GOOGLE_API_USE_MTLS_ENDPOINT is "never". + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): + api_endpoint, cert_source = client_class.get_mtls_endpoint_and_cert_source() + assert api_endpoint == client_class.DEFAULT_ENDPOINT + assert cert_source is None + + # Test the case GOOGLE_API_USE_MTLS_ENDPOINT is "always". + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}): + api_endpoint, cert_source = client_class.get_mtls_endpoint_and_cert_source() + assert api_endpoint == client_class.DEFAULT_MTLS_ENDPOINT + assert cert_source is None + + # Test the case GOOGLE_API_USE_MTLS_ENDPOINT is "auto" and default cert doesn't exist. + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "true"}): + with mock.patch( + "google.auth.transport.mtls.has_default_client_cert_source", + return_value=False, + ): + api_endpoint, cert_source = client_class.get_mtls_endpoint_and_cert_source() + assert api_endpoint == client_class.DEFAULT_ENDPOINT + assert cert_source is None + + # Test the case GOOGLE_API_USE_MTLS_ENDPOINT is "auto" and default cert exists. + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "true"}): + with mock.patch( + "google.auth.transport.mtls.has_default_client_cert_source", + return_value=True, + ): + with mock.patch( + "google.auth.transport.mtls.default_client_cert_source", + return_value=mock_client_cert_source, + ): + ( + api_endpoint, + cert_source, + ) = client_class.get_mtls_endpoint_and_cert_source() + assert api_endpoint == client_class.DEFAULT_MTLS_ENDPOINT + assert cert_source == mock_client_cert_source + + # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has + # unsupported value. + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "Unsupported"}): + with pytest.raises(MutualTLSChannelError) as excinfo: + client_class.get_mtls_endpoint_and_cert_source() + + assert ( + str(excinfo.value) + == "Environment variable `GOOGLE_API_USE_MTLS_ENDPOINT` must be `never`, `auto` or `always`" + ) + + # Check the case GOOGLE_API_USE_CLIENT_CERTIFICATE has unsupported value. + with mock.patch.dict( + os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "Unsupported"} + ): + with pytest.raises(ValueError) as excinfo: + client_class.get_mtls_endpoint_and_cert_source() + + assert ( + str(excinfo.value) + == "Environment variable `GOOGLE_API_USE_CLIENT_CERTIFICATE` must be either `true` or `false`" + ) + + +@pytest.mark.parametrize("client_class", [ReservationSubBlocksClient]) +@mock.patch.object( + ReservationSubBlocksClient, + "_DEFAULT_ENDPOINT_TEMPLATE", + modify_default_endpoint_template(ReservationSubBlocksClient), +) +def test_reservation_sub_blocks_client_client_api_endpoint(client_class): + mock_client_cert_source = client_cert_source_callback + api_override = "foo.com" + default_universe = ReservationSubBlocksClient._DEFAULT_UNIVERSE + default_endpoint = ReservationSubBlocksClient._DEFAULT_ENDPOINT_TEMPLATE.format( + UNIVERSE_DOMAIN=default_universe + ) + mock_universe = "bar.com" + mock_endpoint = ReservationSubBlocksClient._DEFAULT_ENDPOINT_TEMPLATE.format( + UNIVERSE_DOMAIN=mock_universe + ) + + # If ClientOptions.api_endpoint is set and GOOGLE_API_USE_CLIENT_CERTIFICATE="true", + # use ClientOptions.api_endpoint as the api endpoint regardless. + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "true"}): + with mock.patch( + "google.auth.transport.requests.AuthorizedSession.configure_mtls_channel" + ): + options = client_options.ClientOptions( + client_cert_source=mock_client_cert_source, api_endpoint=api_override + ) + client = client_class( + client_options=options, + credentials=ga_credentials.AnonymousCredentials(), + ) + assert client.api_endpoint == api_override + + # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="never", + # use the _DEFAULT_ENDPOINT_TEMPLATE populated with GDU as the api endpoint. + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): + client = client_class(credentials=ga_credentials.AnonymousCredentials()) + assert client.api_endpoint == default_endpoint + + # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="always", + # use the DEFAULT_MTLS_ENDPOINT as the api endpoint. + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}): + client = client_class(credentials=ga_credentials.AnonymousCredentials()) + assert client.api_endpoint == client_class.DEFAULT_MTLS_ENDPOINT + + # If ClientOptions.api_endpoint is not set, GOOGLE_API_USE_MTLS_ENDPOINT="auto" (default), + # GOOGLE_API_USE_CLIENT_CERTIFICATE="false" (default), default cert source doesn't exist, + # and ClientOptions.universe_domain="bar.com", + # use the _DEFAULT_ENDPOINT_TEMPLATE populated with universe domain as the api endpoint. + options = client_options.ClientOptions() + universe_exists = hasattr(options, "universe_domain") + if universe_exists: + options = client_options.ClientOptions(universe_domain=mock_universe) + client = client_class( + client_options=options, credentials=ga_credentials.AnonymousCredentials() + ) + else: + client = client_class( + client_options=options, credentials=ga_credentials.AnonymousCredentials() + ) + assert client.api_endpoint == ( + mock_endpoint if universe_exists else default_endpoint + ) + assert client.universe_domain == ( + mock_universe if universe_exists else default_universe + ) + + # If ClientOptions does not have a universe domain attribute and GOOGLE_API_USE_MTLS_ENDPOINT="never", + # use the _DEFAULT_ENDPOINT_TEMPLATE populated with GDU as the api endpoint. + options = client_options.ClientOptions() + if hasattr(options, "universe_domain"): + delattr(options, "universe_domain") + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): + client = client_class( + client_options=options, credentials=ga_credentials.AnonymousCredentials() + ) + assert client.api_endpoint == default_endpoint + + +@pytest.mark.parametrize( + "client_class,transport_class,transport_name", + [ + ( + ReservationSubBlocksClient, + transports.ReservationSubBlocksRestTransport, + "rest", + ), + ], +) +def test_reservation_sub_blocks_client_client_options_scopes( + client_class, transport_class, transport_name +): + # Check the case scopes are provided. + options = client_options.ClientOptions( + scopes=["1", "2"], + ) + with mock.patch.object(transport_class, "__init__") as patched: + patched.return_value = None + client = client_class(client_options=options, transport=transport_name) + patched.assert_called_once_with( + credentials=None, + credentials_file=None, + host=client._DEFAULT_ENDPOINT_TEMPLATE.format( + UNIVERSE_DOMAIN=client._DEFAULT_UNIVERSE + ), + scopes=["1", "2"], + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + api_audience=None, + ) + + +@pytest.mark.parametrize( + "client_class,transport_class,transport_name,grpc_helpers", + [ + ( + ReservationSubBlocksClient, + transports.ReservationSubBlocksRestTransport, + "rest", + None, + ), + ], +) +def test_reservation_sub_blocks_client_client_options_credentials_file( + client_class, transport_class, transport_name, grpc_helpers +): + # Check the case credentials file is provided. + options = client_options.ClientOptions(credentials_file="credentials.json") + + with mock.patch.object(transport_class, "__init__") as patched: + patched.return_value = None + client = client_class(client_options=options, transport=transport_name) + patched.assert_called_once_with( + credentials=None, + credentials_file="credentials.json", + host=client._DEFAULT_ENDPOINT_TEMPLATE.format( + UNIVERSE_DOMAIN=client._DEFAULT_UNIVERSE + ), + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + api_audience=None, + ) + + +def test_get_rest_use_cached_wrapped_rpc(): + # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, + # instead of constructing them on each call + with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: + client = ReservationSubBlocksClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Should wrap all calls on client creation + assert wrapper_fn.call_count > 0 + wrapper_fn.reset_mock() + + # Ensure method has been cached + assert client._transport.get in client._transport._wrapped_methods + + # Replace cached wrapped function with mock + mock_rpc = mock.Mock() + mock_rpc.return_value.name = ( + "foo" # operation_request.operation in compute client(s) expect a string. + ) + client._transport._wrapped_methods[client._transport.get] = mock_rpc + + request = {} + client.get(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + client.get(request) + + # Establish that a new wrapper was not created for this call + assert wrapper_fn.call_count == 0 + assert mock_rpc.call_count == 2 + + +def test_get_rest_required_fields(request_type=compute.GetReservationSubBlockRequest): + transport_class = transports.ReservationSubBlocksRestTransport + + request_init = {} + request_init["parent_name"] = "" + request_init["project"] = "" + request_init["reservation_sub_block"] = "" + request_init["zone"] = "" + request = request_type(**request_init) + pb_request = request_type.pb(request) + jsonified_request = json.loads( + json_format.MessageToJson(pb_request, use_integers_for_enums=False) + ) + + # verify fields with default values are dropped + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).get._get_unset_required_fields(jsonified_request) + jsonified_request.update(unset_fields) + + # verify required fields with default values are now present + + jsonified_request["parentName"] = "parent_name_value" + jsonified_request["project"] = "project_value" + jsonified_request["reservationSubBlock"] = "reservation_sub_block_value" + jsonified_request["zone"] = "zone_value" + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).get._get_unset_required_fields(jsonified_request) + jsonified_request.update(unset_fields) + + # verify required fields with non-default values are left alone + assert "parentName" in jsonified_request + assert jsonified_request["parentName"] == "parent_name_value" + assert "project" in jsonified_request + assert jsonified_request["project"] == "project_value" + assert "reservationSubBlock" in jsonified_request + assert jsonified_request["reservationSubBlock"] == "reservation_sub_block_value" + assert "zone" in jsonified_request + assert jsonified_request["zone"] == "zone_value" + + client = ReservationSubBlocksClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + request = request_type(**request_init) + + # Designate an appropriate value for the returned response. + return_value = compute.ReservationSubBlocksGetResponse() + # Mock the http request call within the method and fake a response. + with mock.patch.object(Session, "request") as req: + # We need to mock transcode() because providing default values + # for required fields will fail the real version if the http_options + # expect actual values for those fields. + with mock.patch.object(path_template, "transcode") as transcode: + # A uri without fields and an empty body will force all the + # request fields to show up in the query_params. + pb_request = request_type.pb(request) + transcode_result = { + "uri": "v1/sample_method", + "method": "get", + "query_params": pb_request, + } + transcode.return_value = transcode_result + + response_value = Response() + response_value.status_code = 200 + + # Convert return value to protobuf type + return_value = compute.ReservationSubBlocksGetResponse.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + response = client.get(request) + + expected_params = [] + actual_params = req.call_args.kwargs["params"] + assert expected_params == actual_params + + +def test_get_rest_unset_required_fields(): + transport = transports.ReservationSubBlocksRestTransport( + credentials=ga_credentials.AnonymousCredentials + ) + + unset_fields = transport.get._get_unset_required_fields({}) + assert set(unset_fields) == ( + set(()) + & set( + ( + "parentName", + "project", + "reservationSubBlock", + "zone", + ) + ) + ) + + +def test_get_rest_flattened(): + client = ReservationSubBlocksClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = compute.ReservationSubBlocksGetResponse() + + # get arguments that satisfy an http rule for this method + sample_request = { + "project": "sample1", + "zone": "sample2", + "parent_name": "sample3", + "reservation_sub_block": "sample4", + } + + # get truthy value for each flattened field + mock_args = dict( + project="project_value", + zone="zone_value", + parent_name="parent_name_value", + reservation_sub_block="reservation_sub_block_value", + ) + mock_args.update(sample_request) + + # Wrap the value into a proper Response obj + response_value = Response() + response_value.status_code = 200 + # Convert return value to protobuf type + return_value = compute.ReservationSubBlocksGetResponse.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + client.get(**mock_args) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(req.mock_calls) == 1 + _, args, _ = req.mock_calls[0] + assert path_template.validate( + "%s/compute/v1/projects/{project}/zones/{zone}/{parent_name}/reservationSubBlocks/{reservation_sub_block}" + % client.transport._host, + args[1], + ) + + +def test_get_rest_flattened_error(transport: str = "rest"): + client = ReservationSubBlocksClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.get( + compute.GetReservationSubBlockRequest(), + project="project_value", + zone="zone_value", + parent_name="parent_name_value", + reservation_sub_block="reservation_sub_block_value", + ) + + +def test_list_rest_use_cached_wrapped_rpc(): + # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, + # instead of constructing them on each call + with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: + client = ReservationSubBlocksClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Should wrap all calls on client creation + assert wrapper_fn.call_count > 0 + wrapper_fn.reset_mock() + + # Ensure method has been cached + assert client._transport.list in client._transport._wrapped_methods + + # Replace cached wrapped function with mock + mock_rpc = mock.Mock() + mock_rpc.return_value.name = ( + "foo" # operation_request.operation in compute client(s) expect a string. + ) + client._transport._wrapped_methods[client._transport.list] = mock_rpc + + request = {} + client.list(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + client.list(request) + + # Establish that a new wrapper was not created for this call + assert wrapper_fn.call_count == 0 + assert mock_rpc.call_count == 2 + + +def test_list_rest_required_fields( + request_type=compute.ListReservationSubBlocksRequest, +): + transport_class = transports.ReservationSubBlocksRestTransport + + request_init = {} + request_init["parent_name"] = "" + request_init["project"] = "" + request_init["zone"] = "" + request = request_type(**request_init) + pb_request = request_type.pb(request) + jsonified_request = json.loads( + json_format.MessageToJson(pb_request, use_integers_for_enums=False) + ) + + # verify fields with default values are dropped + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).list._get_unset_required_fields(jsonified_request) + jsonified_request.update(unset_fields) + + # verify required fields with default values are now present + + jsonified_request["parentName"] = "parent_name_value" + jsonified_request["project"] = "project_value" + jsonified_request["zone"] = "zone_value" + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).list._get_unset_required_fields(jsonified_request) + # Check that path parameters and body parameters are not mixing in. + assert not set(unset_fields) - set( + ( + "filter", + "max_results", + "order_by", + "page_token", + "return_partial_success", + ) + ) + jsonified_request.update(unset_fields) + + # verify required fields with non-default values are left alone + assert "parentName" in jsonified_request + assert jsonified_request["parentName"] == "parent_name_value" + assert "project" in jsonified_request + assert jsonified_request["project"] == "project_value" + assert "zone" in jsonified_request + assert jsonified_request["zone"] == "zone_value" + + client = ReservationSubBlocksClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + request = request_type(**request_init) + + # Designate an appropriate value for the returned response. + return_value = compute.ReservationSubBlocksListResponse() + # Mock the http request call within the method and fake a response. + with mock.patch.object(Session, "request") as req: + # We need to mock transcode() because providing default values + # for required fields will fail the real version if the http_options + # expect actual values for those fields. + with mock.patch.object(path_template, "transcode") as transcode: + # A uri without fields and an empty body will force all the + # request fields to show up in the query_params. + pb_request = request_type.pb(request) + transcode_result = { + "uri": "v1/sample_method", + "method": "get", + "query_params": pb_request, + } + transcode.return_value = transcode_result + + response_value = Response() + response_value.status_code = 200 + + # Convert return value to protobuf type + return_value = compute.ReservationSubBlocksListResponse.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + response = client.list(request) + + expected_params = [] + actual_params = req.call_args.kwargs["params"] + assert expected_params == actual_params + + +def test_list_rest_unset_required_fields(): + transport = transports.ReservationSubBlocksRestTransport( + credentials=ga_credentials.AnonymousCredentials + ) + + unset_fields = transport.list._get_unset_required_fields({}) + assert set(unset_fields) == ( + set( + ( + "filter", + "maxResults", + "orderBy", + "pageToken", + "returnPartialSuccess", + ) + ) + & set( + ( + "parentName", + "project", + "zone", + ) + ) + ) + + +def test_list_rest_flattened(): + client = ReservationSubBlocksClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = compute.ReservationSubBlocksListResponse() + + # get arguments that satisfy an http rule for this method + sample_request = { + "project": "sample1", + "zone": "sample2", + "parent_name": "sample3", + } + + # get truthy value for each flattened field + mock_args = dict( + project="project_value", + zone="zone_value", + parent_name="parent_name_value", + ) + mock_args.update(sample_request) + + # Wrap the value into a proper Response obj + response_value = Response() + response_value.status_code = 200 + # Convert return value to protobuf type + return_value = compute.ReservationSubBlocksListResponse.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + client.list(**mock_args) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(req.mock_calls) == 1 + _, args, _ = req.mock_calls[0] + assert path_template.validate( + "%s/compute/v1/projects/{project}/zones/{zone}/{parent_name}/reservationSubBlocks" + % client.transport._host, + args[1], + ) + + +def test_list_rest_flattened_error(transport: str = "rest"): + client = ReservationSubBlocksClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.list( + compute.ListReservationSubBlocksRequest(), + project="project_value", + zone="zone_value", + parent_name="parent_name_value", + ) + + +def test_list_rest_pager(transport: str = "rest"): + client = ReservationSubBlocksClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(Session, "request") as req: + # TODO(kbandes): remove this mock unless there's a good reason for it. + # with mock.patch.object(path_template, 'transcode') as transcode: + # Set the response as a series of pages + response = ( + compute.ReservationSubBlocksListResponse( + items=[ + compute.ReservationSubBlock(), + compute.ReservationSubBlock(), + compute.ReservationSubBlock(), + ], + next_page_token="abc", + ), + compute.ReservationSubBlocksListResponse( + items=[], + next_page_token="def", + ), + compute.ReservationSubBlocksListResponse( + items=[ + compute.ReservationSubBlock(), + ], + next_page_token="ghi", + ), + compute.ReservationSubBlocksListResponse( + items=[ + compute.ReservationSubBlock(), + compute.ReservationSubBlock(), + ], + ), + ) + # Two responses for two calls + response = response + response + + # Wrap the values into proper Response objs + response = tuple( + compute.ReservationSubBlocksListResponse.to_json(x) for x in response + ) + return_values = tuple(Response() for i in response) + for return_val, response_val in zip(return_values, response): + return_val._content = response_val.encode("UTF-8") + return_val.status_code = 200 + req.side_effect = return_values + + sample_request = { + "project": "sample1", + "zone": "sample2", + "parent_name": "sample3", + } + + pager = client.list(request=sample_request) + + results = list(pager) + assert len(results) == 6 + assert all(isinstance(i, compute.ReservationSubBlock) for i in results) + + pages = list(client.list(request=sample_request).pages) + for page_, token in zip(pages, ["abc", "def", "ghi", ""]): + assert page_.raw_page.next_page_token == token + + +def test_credentials_transport_error(): + # It is an error to provide credentials and a transport instance. + transport = transports.ReservationSubBlocksRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + ) + with pytest.raises(ValueError): + client = ReservationSubBlocksClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # It is an error to provide a credentials file and a transport instance. + transport = transports.ReservationSubBlocksRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + ) + with pytest.raises(ValueError): + client = ReservationSubBlocksClient( + client_options={"credentials_file": "credentials.json"}, + transport=transport, + ) + + # It is an error to provide an api_key and a transport instance. + transport = transports.ReservationSubBlocksRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + ) + options = client_options.ClientOptions() + options.api_key = "api_key" + with pytest.raises(ValueError): + client = ReservationSubBlocksClient( + client_options=options, + transport=transport, + ) + + # It is an error to provide an api_key and a credential. + options = client_options.ClientOptions() + options.api_key = "api_key" + with pytest.raises(ValueError): + client = ReservationSubBlocksClient( + client_options=options, credentials=ga_credentials.AnonymousCredentials() + ) + + # It is an error to provide scopes and a transport instance. + transport = transports.ReservationSubBlocksRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + ) + with pytest.raises(ValueError): + client = ReservationSubBlocksClient( + client_options={"scopes": ["1", "2"]}, + transport=transport, + ) + + +def test_transport_instance(): + # A client may be instantiated with a custom transport instance. + transport = transports.ReservationSubBlocksRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + ) + client = ReservationSubBlocksClient(transport=transport) + assert client.transport is transport + + +@pytest.mark.parametrize( + "transport_class", + [ + transports.ReservationSubBlocksRestTransport, + ], +) +def test_transport_adc(transport_class): + # Test default credentials are used if not provided. + with mock.patch.object(google.auth, "default") as adc: + adc.return_value = (ga_credentials.AnonymousCredentials(), None) + transport_class() + adc.assert_called_once() + + +def test_transport_kind_rest(): + transport = ReservationSubBlocksClient.get_transport_class("rest")( + credentials=ga_credentials.AnonymousCredentials() + ) + assert transport.kind == "rest" + + +def test_get_rest_bad_request(request_type=compute.GetReservationSubBlockRequest): + client = ReservationSubBlocksClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + # send a request that will satisfy transcoding + request_init = { + "project": "sample1", + "zone": "sample2", + "parent_name": "sample3", + "reservation_sub_block": "sample4", + } + request = request_type(**request_init) + + # Mock the http request call within the method and fake a BadRequest error. + with mock.patch.object(Session, "request") as req, pytest.raises( + core_exceptions.BadRequest + ): + # Wrap the value into a proper Response obj + response_value = mock.Mock() + json_return_value = "" + response_value.json = mock.Mock(return_value={}) + response_value.status_code = 400 + response_value.request = mock.Mock() + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + client.get(request) + + +@pytest.mark.parametrize( + "request_type", + [ + compute.GetReservationSubBlockRequest, + dict, + ], +) +def test_get_rest_call_success(request_type): + client = ReservationSubBlocksClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + + # send a request that will satisfy transcoding + request_init = { + "project": "sample1", + "zone": "sample2", + "parent_name": "sample3", + "reservation_sub_block": "sample4", + } + request = request_type(**request_init) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = compute.ReservationSubBlocksGetResponse() + + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.status_code = 200 + + # Convert return value to protobuf type + return_value = compute.ReservationSubBlocksGetResponse.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + response_value.content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + response = client.get(request) + + # Establish that the response is the type that we expect. + assert isinstance(response, compute.ReservationSubBlocksGetResponse) + + +@pytest.mark.parametrize("null_interceptor", [True, False]) +def test_get_rest_interceptors(null_interceptor): + transport = transports.ReservationSubBlocksRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + interceptor=None + if null_interceptor + else transports.ReservationSubBlocksRestInterceptor(), + ) + client = ReservationSubBlocksClient(transport=transport) + + with mock.patch.object( + type(client.transport._session), "request" + ) as req, mock.patch.object( + path_template, "transcode" + ) as transcode, mock.patch.object( + transports.ReservationSubBlocksRestInterceptor, "post_get" + ) as post, mock.patch.object( + transports.ReservationSubBlocksRestInterceptor, "post_get_with_metadata" + ) as post_with_metadata, mock.patch.object( + transports.ReservationSubBlocksRestInterceptor, "pre_get" + ) as pre: + pre.assert_not_called() + post.assert_not_called() + post_with_metadata.assert_not_called() + pb_message = compute.GetReservationSubBlockRequest.pb( + compute.GetReservationSubBlockRequest() + ) + transcode.return_value = { + "method": "post", + "uri": "my_uri", + "body": pb_message, + "query_params": pb_message, + } + + req.return_value = mock.Mock() + req.return_value.status_code = 200 + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + return_value = compute.ReservationSubBlocksGetResponse.to_json( + compute.ReservationSubBlocksGetResponse() + ) + req.return_value.content = return_value + + request = compute.GetReservationSubBlockRequest() + metadata = [ + ("key", "val"), + ("cephalopod", "squid"), + ] + pre.return_value = request, metadata + post.return_value = compute.ReservationSubBlocksGetResponse() + post_with_metadata.return_value = ( + compute.ReservationSubBlocksGetResponse(), + metadata, + ) + + client.get( + request, + metadata=[ + ("key", "val"), + ("cephalopod", "squid"), + ], + ) + + pre.assert_called_once() + post.assert_called_once() + post_with_metadata.assert_called_once() + + +def test_list_rest_bad_request(request_type=compute.ListReservationSubBlocksRequest): + client = ReservationSubBlocksClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + # send a request that will satisfy transcoding + request_init = {"project": "sample1", "zone": "sample2", "parent_name": "sample3"} + request = request_type(**request_init) + + # Mock the http request call within the method and fake a BadRequest error. + with mock.patch.object(Session, "request") as req, pytest.raises( + core_exceptions.BadRequest + ): + # Wrap the value into a proper Response obj + response_value = mock.Mock() + json_return_value = "" + response_value.json = mock.Mock(return_value={}) + response_value.status_code = 400 + response_value.request = mock.Mock() + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + client.list(request) + + +@pytest.mark.parametrize( + "request_type", + [ + compute.ListReservationSubBlocksRequest, + dict, + ], +) +def test_list_rest_call_success(request_type): + client = ReservationSubBlocksClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + + # send a request that will satisfy transcoding + request_init = {"project": "sample1", "zone": "sample2", "parent_name": "sample3"} + request = request_type(**request_init) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = compute.ReservationSubBlocksListResponse( + id="id_value", + kind="kind_value", + next_page_token="next_page_token_value", + self_link="self_link_value", + ) + + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.status_code = 200 + + # Convert return value to protobuf type + return_value = compute.ReservationSubBlocksListResponse.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + response_value.content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + response = client.list(request) + + # Establish that the response is the type that we expect. + assert isinstance(response, pagers.ListPager) + assert response.id == "id_value" + assert response.kind == "kind_value" + assert response.next_page_token == "next_page_token_value" + assert response.self_link == "self_link_value" + + +@pytest.mark.parametrize("null_interceptor", [True, False]) +def test_list_rest_interceptors(null_interceptor): + transport = transports.ReservationSubBlocksRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + interceptor=None + if null_interceptor + else transports.ReservationSubBlocksRestInterceptor(), + ) + client = ReservationSubBlocksClient(transport=transport) + + with mock.patch.object( + type(client.transport._session), "request" + ) as req, mock.patch.object( + path_template, "transcode" + ) as transcode, mock.patch.object( + transports.ReservationSubBlocksRestInterceptor, "post_list" + ) as post, mock.patch.object( + transports.ReservationSubBlocksRestInterceptor, "post_list_with_metadata" + ) as post_with_metadata, mock.patch.object( + transports.ReservationSubBlocksRestInterceptor, "pre_list" + ) as pre: + pre.assert_not_called() + post.assert_not_called() + post_with_metadata.assert_not_called() + pb_message = compute.ListReservationSubBlocksRequest.pb( + compute.ListReservationSubBlocksRequest() + ) + transcode.return_value = { + "method": "post", + "uri": "my_uri", + "body": pb_message, + "query_params": pb_message, + } + + req.return_value = mock.Mock() + req.return_value.status_code = 200 + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + return_value = compute.ReservationSubBlocksListResponse.to_json( + compute.ReservationSubBlocksListResponse() + ) + req.return_value.content = return_value + + request = compute.ListReservationSubBlocksRequest() + metadata = [ + ("key", "val"), + ("cephalopod", "squid"), + ] + pre.return_value = request, metadata + post.return_value = compute.ReservationSubBlocksListResponse() + post_with_metadata.return_value = ( + compute.ReservationSubBlocksListResponse(), + metadata, + ) + + client.list( + request, + metadata=[ + ("key", "val"), + ("cephalopod", "squid"), + ], + ) + + pre.assert_called_once() + post.assert_called_once() + post_with_metadata.assert_called_once() + + +def test_initialize_client_w_rest(): + client = ReservationSubBlocksClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + assert client is not None + + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_get_empty_call_rest(): + client = ReservationSubBlocksClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object(type(client.transport.get), "__call__") as call: + client.get(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = compute.GetReservationSubBlockRequest() + + assert args[0] == request_msg + + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_list_empty_call_rest(): + client = ReservationSubBlocksClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object(type(client.transport.list), "__call__") as call: + client.list(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = compute.ListReservationSubBlocksRequest() + + assert args[0] == request_msg + + +def test_reservation_sub_blocks_base_transport_error(): + # Passing both a credentials object and credentials_file should raise an error + with pytest.raises(core_exceptions.DuplicateCredentialArgs): + transport = transports.ReservationSubBlocksTransport( + credentials=ga_credentials.AnonymousCredentials(), + credentials_file="credentials.json", + ) + + +def test_reservation_sub_blocks_base_transport(): + # Instantiate the base transport. + with mock.patch( + "google.cloud.compute_v1.services.reservation_sub_blocks.transports.ReservationSubBlocksTransport.__init__" + ) as Transport: + Transport.return_value = None + transport = transports.ReservationSubBlocksTransport( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Every method on the transport should just blindly + # raise NotImplementedError. + methods = ( + "get", + "list", + ) + for method in methods: + with pytest.raises(NotImplementedError): + getattr(transport, method)(request=object()) + + with pytest.raises(NotImplementedError): + transport.close() + + # Catch all for all remaining methods and properties + remainder = [ + "kind", + ] + for r in remainder: + with pytest.raises(NotImplementedError): + getattr(transport, r)() + + +def test_reservation_sub_blocks_base_transport_with_credentials_file(): + # Instantiate the base transport with a credentials file + with mock.patch.object( + google.auth, "load_credentials_from_file", autospec=True + ) as load_creds, mock.patch( + "google.cloud.compute_v1.services.reservation_sub_blocks.transports.ReservationSubBlocksTransport._prep_wrapped_messages" + ) as Transport: + Transport.return_value = None + load_creds.return_value = (ga_credentials.AnonymousCredentials(), None) + transport = transports.ReservationSubBlocksTransport( + credentials_file="credentials.json", + quota_project_id="octopus", + ) + load_creds.assert_called_once_with( + "credentials.json", + scopes=None, + default_scopes=( + "https://www.googleapis.com/auth/compute.readonly", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/cloud-platform", + ), + quota_project_id="octopus", + ) + + +def test_reservation_sub_blocks_base_transport_with_adc(): + # Test the default credentials are used if credentials and credentials_file are None. + with mock.patch.object(google.auth, "default", autospec=True) as adc, mock.patch( + "google.cloud.compute_v1.services.reservation_sub_blocks.transports.ReservationSubBlocksTransport._prep_wrapped_messages" + ) as Transport: + Transport.return_value = None + adc.return_value = (ga_credentials.AnonymousCredentials(), None) + transport = transports.ReservationSubBlocksTransport() + adc.assert_called_once() + + +def test_reservation_sub_blocks_auth_adc(): + # If no credentials are provided, we should use ADC credentials. + with mock.patch.object(google.auth, "default", autospec=True) as adc: + adc.return_value = (ga_credentials.AnonymousCredentials(), None) + ReservationSubBlocksClient() + adc.assert_called_once_with( + scopes=None, + default_scopes=( + "https://www.googleapis.com/auth/compute.readonly", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/cloud-platform", + ), + quota_project_id=None, + ) + + +def test_reservation_sub_blocks_http_transport_client_cert_source_for_mtls(): + cred = ga_credentials.AnonymousCredentials() + with mock.patch( + "google.auth.transport.requests.AuthorizedSession.configure_mtls_channel" + ) as mock_configure_mtls_channel: + transports.ReservationSubBlocksRestTransport( + credentials=cred, client_cert_source_for_mtls=client_cert_source_callback + ) + mock_configure_mtls_channel.assert_called_once_with(client_cert_source_callback) + + +@pytest.mark.parametrize( + "transport_name", + [ + "rest", + ], +) +def test_reservation_sub_blocks_host_no_port(transport_name): + client = ReservationSubBlocksClient( + credentials=ga_credentials.AnonymousCredentials(), + client_options=client_options.ClientOptions( + api_endpoint="compute.googleapis.com" + ), + transport=transport_name, + ) + assert client.transport._host == ( + "compute.googleapis.com:443" + if transport_name in ["grpc", "grpc_asyncio"] + else "https://compute.googleapis.com" + ) + + +@pytest.mark.parametrize( + "transport_name", + [ + "rest", + ], +) +def test_reservation_sub_blocks_host_with_port(transport_name): + client = ReservationSubBlocksClient( + credentials=ga_credentials.AnonymousCredentials(), + client_options=client_options.ClientOptions( + api_endpoint="compute.googleapis.com:8000" + ), + transport=transport_name, + ) + assert client.transport._host == ( + "compute.googleapis.com:8000" + if transport_name in ["grpc", "grpc_asyncio"] + else "https://compute.googleapis.com:8000" + ) + + +@pytest.mark.parametrize( + "transport_name", + [ + "rest", + ], +) +def test_reservation_sub_blocks_client_transport_session_collision(transport_name): + creds1 = ga_credentials.AnonymousCredentials() + creds2 = ga_credentials.AnonymousCredentials() + client1 = ReservationSubBlocksClient( + credentials=creds1, + transport=transport_name, + ) + client2 = ReservationSubBlocksClient( + credentials=creds2, + transport=transport_name, + ) + session1 = client1.transport.get._session + session2 = client2.transport.get._session + assert session1 != session2 + session1 = client1.transport.list._session + session2 = client2.transport.list._session + assert session1 != session2 + + +def test_common_billing_account_path(): + billing_account = "squid" + expected = "billingAccounts/{billing_account}".format( + billing_account=billing_account, + ) + actual = ReservationSubBlocksClient.common_billing_account_path(billing_account) + assert expected == actual + + +def test_parse_common_billing_account_path(): + expected = { + "billing_account": "clam", + } + path = ReservationSubBlocksClient.common_billing_account_path(**expected) + + # Check that the path construction is reversible. + actual = ReservationSubBlocksClient.parse_common_billing_account_path(path) + assert expected == actual + + +def test_common_folder_path(): + folder = "whelk" + expected = "folders/{folder}".format( + folder=folder, + ) + actual = ReservationSubBlocksClient.common_folder_path(folder) + assert expected == actual + + +def test_parse_common_folder_path(): + expected = { + "folder": "octopus", + } + path = ReservationSubBlocksClient.common_folder_path(**expected) + + # Check that the path construction is reversible. + actual = ReservationSubBlocksClient.parse_common_folder_path(path) + assert expected == actual + + +def test_common_organization_path(): + organization = "oyster" + expected = "organizations/{organization}".format( + organization=organization, + ) + actual = ReservationSubBlocksClient.common_organization_path(organization) + assert expected == actual + + +def test_parse_common_organization_path(): + expected = { + "organization": "nudibranch", + } + path = ReservationSubBlocksClient.common_organization_path(**expected) + + # Check that the path construction is reversible. + actual = ReservationSubBlocksClient.parse_common_organization_path(path) + assert expected == actual + + +def test_common_project_path(): + project = "cuttlefish" + expected = "projects/{project}".format( + project=project, + ) + actual = ReservationSubBlocksClient.common_project_path(project) + assert expected == actual + + +def test_parse_common_project_path(): + expected = { + "project": "mussel", + } + path = ReservationSubBlocksClient.common_project_path(**expected) + + # Check that the path construction is reversible. + actual = ReservationSubBlocksClient.parse_common_project_path(path) + assert expected == actual + + +def test_common_location_path(): + project = "winkle" + location = "nautilus" + expected = "projects/{project}/locations/{location}".format( + project=project, + location=location, + ) + actual = ReservationSubBlocksClient.common_location_path(project, location) + assert expected == actual + + +def test_parse_common_location_path(): + expected = { + "project": "scallop", + "location": "abalone", + } + path = ReservationSubBlocksClient.common_location_path(**expected) + + # Check that the path construction is reversible. + actual = ReservationSubBlocksClient.parse_common_location_path(path) + assert expected == actual + + +def test_client_with_default_client_info(): + client_info = gapic_v1.client_info.ClientInfo() + + with mock.patch.object( + transports.ReservationSubBlocksTransport, "_prep_wrapped_messages" + ) as prep: + client = ReservationSubBlocksClient( + credentials=ga_credentials.AnonymousCredentials(), + client_info=client_info, + ) + prep.assert_called_once_with(client_info) + + with mock.patch.object( + transports.ReservationSubBlocksTransport, "_prep_wrapped_messages" + ) as prep: + transport_class = ReservationSubBlocksClient.get_transport_class() + transport = transport_class( + credentials=ga_credentials.AnonymousCredentials(), + client_info=client_info, + ) + prep.assert_called_once_with(client_info) + + +def test_transport_close_rest(): + client = ReservationSubBlocksClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + with mock.patch.object( + type(getattr(client.transport, "_session")), "close" + ) as close: + with client: + close.assert_not_called() + close.assert_called_once() + + +def test_client_ctx(): + transports = [ + "rest", + ] + for transport in transports: + client = ReservationSubBlocksClient( + credentials=ga_credentials.AnonymousCredentials(), transport=transport + ) + # Test client calls underlying transport. + with mock.patch.object(type(client.transport), "close") as close: + close.assert_not_called() + with client: + pass + close.assert_called() + + +@pytest.mark.parametrize( + "client_class,transport_class", + [ + (ReservationSubBlocksClient, transports.ReservationSubBlocksRestTransport), + ], +) +def test_api_key_credentials(client_class, transport_class): + with mock.patch.object( + google.auth._default, "get_api_key_credentials", create=True + ) as get_api_key_credentials: + mock_cred = mock.Mock() + get_api_key_credentials.return_value = mock_cred + options = client_options.ClientOptions() + options.api_key = "api_key" + with mock.patch.object(transport_class, "__init__") as patched: + patched.return_value = None + client = client_class(client_options=options) + patched.assert_called_once_with( + credentials=mock_cred, + credentials_file=None, + host=client._DEFAULT_ENDPOINT_TEMPLATE.format( + UNIVERSE_DOMAIN=client._DEFAULT_UNIVERSE + ), + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + api_audience=None, + ) diff --git a/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_reservations.py b/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_reservations.py index c773cdbb0e4d..aadacb548882 100644 --- a/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_reservations.py +++ b/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_reservations.py @@ -4963,8 +4963,10 @@ def test_get_rest_call_success(request_type): return_value = compute.Reservation( commitment="commitment_value", creation_timestamp="creation_timestamp_value", + delete_at_time="delete_at_time_value", deployment_type="deployment_type_value", description="description_value", + enable_emergent_maintenance=True, id=205, kind="kind_value", linked_commitments=["linked_commitments_value"], @@ -4992,8 +4994,10 @@ def test_get_rest_call_success(request_type): assert isinstance(response, compute.Reservation) assert response.commitment == "commitment_value" assert response.creation_timestamp == "creation_timestamp_value" + assert response.delete_at_time == "delete_at_time_value" assert response.deployment_type == "deployment_type_value" assert response.description == "description_value" + assert response.enable_emergent_maintenance is True assert response.id == 205 assert response.kind == "kind_value" assert response.linked_commitments == ["linked_commitments_value"] @@ -5249,8 +5253,11 @@ def test_insert_rest_call_success(request_type): }, "commitment": "commitment_value", "creation_timestamp": "creation_timestamp_value", + "delete_after_duration": {"nanos": 543, "seconds": 751}, + "delete_at_time": "delete_at_time_value", "deployment_type": "deployment_type_value", "description": "description_value", + "enable_emergent_maintenance": True, "id": 205, "kind": "kind_value", "linked_commitments": [ @@ -6644,8 +6651,11 @@ def test_update_rest_call_success(request_type): }, "commitment": "commitment_value", "creation_timestamp": "creation_timestamp_value", + "delete_after_duration": {"nanos": 543, "seconds": 751}, + "delete_at_time": "delete_at_time_value", "deployment_type": "deployment_type_value", "description": "description_value", + "enable_emergent_maintenance": True, "id": 205, "kind": "kind_value", "linked_commitments": [ diff --git a/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_resource_policies.py b/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_resource_policies.py index 9135d9faa01a..57bfd916925e 100644 --- a/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_resource_policies.py +++ b/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_resource_policies.py @@ -4350,6 +4350,7 @@ def test_insert_rest_call_success(request_type): "group_placement_policy": { "availability_domain_count": 2650, "collocation": "collocation_value", + "gpu_topology": "gpu_topology_value", "vm_count": 875, }, "id": 205, @@ -4407,6 +4408,11 @@ def test_insert_rest_call_success(request_type): }, }, "status": "status_value", + "workload_policy": { + "accelerator_topology": "accelerator_topology_value", + "max_topology_distance": "max_topology_distance_value", + "type_": "type__value", + }, } # The version of a generated dependency at test runtime may differ from the version used during generation. # Delete any fields which are not present in the current runtime dependency @@ -4794,6 +4800,7 @@ def test_patch_rest_call_success(request_type): "group_placement_policy": { "availability_domain_count": 2650, "collocation": "collocation_value", + "gpu_topology": "gpu_topology_value", "vm_count": 875, }, "id": 205, @@ -4851,6 +4858,11 @@ def test_patch_rest_call_success(request_type): }, }, "status": "status_value", + "workload_policy": { + "accelerator_topology": "accelerator_topology_value", + "max_topology_distance": "max_topology_distance_value", + "type_": "type__value", + }, } # The version of a generated dependency at test runtime may differ from the version used during generation. # Delete any fields which are not present in the current runtime dependency diff --git a/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_routes.py b/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_routes.py index 97cb64314724..d931c8c9112d 100644 --- a/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_routes.py +++ b/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_routes.py @@ -2606,6 +2606,7 @@ def test_insert_rest_call_success(request_type): "next_hop_origin": "next_hop_origin_value", "next_hop_peering": "next_hop_peering_value", "next_hop_vpn_tunnel": "next_hop_vpn_tunnel_value", + "params": {"resource_manager_tags": {}}, "priority": 898, "route_status": "route_status_value", "route_type": "route_type_value", diff --git a/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_subnetworks.py b/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_subnetworks.py index 4df749d006f5..2c7da091db6e 100644 --- a/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_subnetworks.py +++ b/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_subnetworks.py @@ -5442,6 +5442,12 @@ def test_get_rest_call_success(request_type): self_link="self_link_value", stack_type="stack_type_value", state="state_value", + system_reserved_external_ipv6_ranges=[ + "system_reserved_external_ipv6_ranges_value" + ], + system_reserved_internal_ipv6_ranges=[ + "system_reserved_internal_ipv6_ranges_value" + ], ) # Wrap the value into a proper Response obj @@ -5483,6 +5489,12 @@ def test_get_rest_call_success(request_type): assert response.self_link == "self_link_value" assert response.stack_type == "stack_type_value" assert response.state == "state_value" + assert response.system_reserved_external_ipv6_ranges == [ + "system_reserved_external_ipv6_ranges_value" + ] + assert response.system_reserved_internal_ipv6_ranges == [ + "system_reserved_internal_ipv6_ranges_value" + ] @pytest.mark.parametrize("null_interceptor", [True, False]) @@ -5738,6 +5750,7 @@ def test_insert_rest_call_success(request_type): }, "name": "name_value", "network": "network_value", + "params": {"resource_manager_tags": {}}, "private_ip_google_access": True, "private_ipv6_google_access": "private_ipv6_google_access_value", "purpose": "purpose_value", @@ -5754,6 +5767,14 @@ def test_insert_rest_call_success(request_type): "self_link": "self_link_value", "stack_type": "stack_type_value", "state": "state_value", + "system_reserved_external_ipv6_ranges": [ + "system_reserved_external_ipv6_ranges_value1", + "system_reserved_external_ipv6_ranges_value2", + ], + "system_reserved_internal_ipv6_ranges": [ + "system_reserved_internal_ipv6_ranges_value1", + "system_reserved_internal_ipv6_ranges_value2", + ], } # The version of a generated dependency at test runtime may differ from the version used during generation. # Delete any fields which are not present in the current runtime dependency @@ -6130,6 +6151,7 @@ def test_list_usable_rest_call_success(request_type): kind="kind_value", next_page_token="next_page_token_value", self_link="self_link_value", + unreachables=["unreachables_value"], ) # Wrap the value into a proper Response obj @@ -6150,6 +6172,7 @@ def test_list_usable_rest_call_success(request_type): assert response.kind == "kind_value" assert response.next_page_token == "next_page_token_value" assert response.self_link == "self_link_value" + assert response.unreachables == ["unreachables_value"] @pytest.mark.parametrize("null_interceptor", [True, False]) @@ -6281,6 +6304,7 @@ def test_patch_rest_call_success(request_type): }, "name": "name_value", "network": "network_value", + "params": {"resource_manager_tags": {}}, "private_ip_google_access": True, "private_ipv6_google_access": "private_ipv6_google_access_value", "purpose": "purpose_value", @@ -6297,6 +6321,14 @@ def test_patch_rest_call_success(request_type): "self_link": "self_link_value", "stack_type": "stack_type_value", "state": "state_value", + "system_reserved_external_ipv6_ranges": [ + "system_reserved_external_ipv6_ranges_value1", + "system_reserved_external_ipv6_ranges_value2", + ], + "system_reserved_internal_ipv6_ranges": [ + "system_reserved_internal_ipv6_ranges_value1", + "system_reserved_internal_ipv6_ranges_value2", + ], } # The version of a generated dependency at test runtime may differ from the version used during generation. # Delete any fields which are not present in the current runtime dependency