diff --git a/packages/google-cloud-compute/docs/compute_v1/instant_snapshots.rst b/packages/google-cloud-compute/docs/compute_v1/instant_snapshots.rst new file mode 100644 index 000000000000..4e6d8c6a0aae --- /dev/null +++ b/packages/google-cloud-compute/docs/compute_v1/instant_snapshots.rst @@ -0,0 +1,10 @@ +InstantSnapshots +---------------------------------- + +.. automodule:: google.cloud.compute_v1.services.instant_snapshots + :members: + :inherited-members: + +.. automodule:: google.cloud.compute_v1.services.instant_snapshots.pagers + :members: + :inherited-members: diff --git a/packages/google-cloud-compute/docs/compute_v1/region_instant_snapshots.rst b/packages/google-cloud-compute/docs/compute_v1/region_instant_snapshots.rst new file mode 100644 index 000000000000..1f9f298bb305 --- /dev/null +++ b/packages/google-cloud-compute/docs/compute_v1/region_instant_snapshots.rst @@ -0,0 +1,10 @@ +RegionInstantSnapshots +---------------------------------------- + +.. automodule:: google.cloud.compute_v1.services.region_instant_snapshots + :members: + :inherited-members: + +.. automodule:: google.cloud.compute_v1.services.region_instant_snapshots.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 28a6e7a0237d..afd320f55e0f 100644 --- a/packages/google-cloud-compute/docs/compute_v1/services_.rst +++ b/packages/google-cloud-compute/docs/compute_v1/services_.rst @@ -27,6 +27,7 @@ Services for Google Cloud Compute v1 API instance_groups instances instance_templates + instant_snapshots interconnect_attachments interconnect_locations interconnect_remote_locations @@ -58,6 +59,7 @@ Services for Google Cloud Compute v1 API region_instance_groups region_instances region_instance_templates + region_instant_snapshots region_network_endpoint_groups region_network_firewall_policies region_notification_endpoints diff --git a/packages/google-cloud-compute/google/cloud/compute/__init__.py b/packages/google-cloud-compute/google/cloud/compute/__init__.py index 04311406b2b1..8a33fbe92258 100644 --- a/packages/google-cloud-compute/google/cloud/compute/__init__.py +++ b/packages/google-cloud-compute/google/cloud/compute/__init__.py @@ -70,6 +70,9 @@ InstanceTemplatesClient, ) from google.cloud.compute_v1.services.instances.client import InstancesClient +from google.cloud.compute_v1.services.instant_snapshots.client import ( + InstantSnapshotsClient, +) from google.cloud.compute_v1.services.interconnect_attachments.client import ( InterconnectAttachmentsClient, ) @@ -141,6 +144,9 @@ from google.cloud.compute_v1.services.region_instances.client import ( RegionInstancesClient, ) +from google.cloud.compute_v1.services.region_instant_snapshots.client import ( + RegionInstantSnapshotsClient, +) from google.cloud.compute_v1.services.region_network_endpoint_groups.client import ( RegionNetworkEndpointGroupsClient, ) @@ -269,6 +275,7 @@ AggregatedListInstanceGroupsRequest, AggregatedListInstancesRequest, AggregatedListInstanceTemplatesRequest, + AggregatedListInstantSnapshotsRequest, AggregatedListInterconnectAttachmentsRequest, AggregatedListMachineTypesRequest, AggregatedListNetworkAttachmentsRequest, @@ -418,6 +425,7 @@ DeleteInstancesInstanceGroupManagerRequest, DeleteInstancesRegionInstanceGroupManagerRequest, DeleteInstanceTemplateRequest, + DeleteInstantSnapshotRequest, DeleteInterconnectAttachmentRequest, DeleteInterconnectRequest, DeleteLicenseRequest, @@ -442,6 +450,7 @@ DeleteRegionHealthCheckServiceRequest, DeleteRegionInstanceGroupManagerRequest, DeleteRegionInstanceTemplateRequest, + DeleteRegionInstantSnapshotRequest, DeleteRegionNetworkEndpointGroupRequest, DeleteRegionNetworkFirewallPolicyRequest, DeleteRegionNotificationEndpointRequest, @@ -581,6 +590,7 @@ GetIamPolicyImageRequest, GetIamPolicyInstanceRequest, GetIamPolicyInstanceTemplateRequest, + GetIamPolicyInstantSnapshotRequest, GetIamPolicyLicenseRequest, GetIamPolicyMachineImageRequest, GetIamPolicyNetworkAttachmentRequest, @@ -589,6 +599,7 @@ GetIamPolicyNodeTemplateRequest, GetIamPolicyRegionBackendServiceRequest, GetIamPolicyRegionDiskRequest, + GetIamPolicyRegionInstantSnapshotRequest, GetIamPolicyRegionNetworkFirewallPolicyRequest, GetIamPolicyReservationRequest, GetIamPolicyResourcePolicyRequest, @@ -601,6 +612,7 @@ GetInstanceGroupRequest, GetInstanceRequest, GetInstanceTemplateRequest, + GetInstantSnapshotRequest, GetInterconnectAttachmentRequest, GetInterconnectLocationRequest, GetInterconnectRemoteLocationRequest, @@ -634,6 +646,7 @@ GetRegionInstanceGroupManagerRequest, GetRegionInstanceGroupRequest, GetRegionInstanceTemplateRequest, + GetRegionInstantSnapshotRequest, GetRegionNetworkEndpointGroupRequest, GetRegionNetworkFirewallPolicyRequest, GetRegionNotificationEndpointRequest, @@ -745,6 +758,7 @@ InsertInstanceGroupRequest, InsertInstanceRequest, InsertInstanceTemplateRequest, + InsertInstantSnapshotRequest, InsertInterconnectAttachmentRequest, InsertInterconnectRequest, InsertLicenseRequest, @@ -767,6 +781,7 @@ InsertRegionHealthCheckServiceRequest, InsertRegionInstanceGroupManagerRequest, InsertRegionInstanceTemplateRequest, + InsertRegionInstantSnapshotRequest, InsertRegionNetworkEndpointGroupRequest, InsertRegionNetworkFirewallPolicyRequest, InsertRegionNotificationEndpointRequest, @@ -868,6 +883,11 @@ InstanceTemplateList, InstanceTemplatesScopedList, InstanceWithNamedPorts, + InstantSnapshot, + InstantSnapshotAggregatedList, + InstantSnapshotList, + InstantSnapshotResourceStatus, + InstantSnapshotsScopedList, Int64RangeMatch, Interconnect, InterconnectAttachment, @@ -939,6 +959,7 @@ ListInstancesRegionInstanceGroupsRequest, ListInstancesRequest, ListInstanceTemplatesRequest, + ListInstantSnapshotsRequest, ListInterconnectAttachmentsRequest, ListInterconnectLocationsRequest, ListInterconnectRemoteLocationsRequest, @@ -977,6 +998,7 @@ ListRegionInstanceGroupManagersRequest, ListRegionInstanceGroupsRequest, ListRegionInstanceTemplatesRequest, + ListRegionInstantSnapshotsRequest, ListRegionNetworkEndpointGroupsRequest, ListRegionNetworkFirewallPoliciesRequest, ListRegionNotificationEndpointsRequest, @@ -1187,6 +1209,7 @@ ProjectsEnableXpnResourceRequest, ProjectsGetXpnResources, ProjectsListXpnHostsRequest, + ProjectsSetCloudArmorTierRequest, ProjectsSetDefaultNetworkTierRequest, PublicAdvertisedPrefix, PublicAdvertisedPrefixList, @@ -1368,6 +1391,7 @@ SetBackupTargetPoolRequest, SetCertificateMapTargetHttpsProxyRequest, SetCertificateMapTargetSslProxyRequest, + SetCloudArmorTierProjectRequest, SetCommonInstanceMetadataOperationMetadata, SetCommonInstanceMetadataOperationMetadataPerLocationOperationInfo, SetCommonInstanceMetadataProjectRequest, @@ -1383,6 +1407,7 @@ SetIamPolicyImageRequest, SetIamPolicyInstanceRequest, SetIamPolicyInstanceTemplateRequest, + SetIamPolicyInstantSnapshotRequest, SetIamPolicyLicenseRequest, SetIamPolicyMachineImageRequest, SetIamPolicyNetworkAttachmentRequest, @@ -1391,6 +1416,7 @@ SetIamPolicyNodeTemplateRequest, SetIamPolicyRegionBackendServiceRequest, SetIamPolicyRegionDiskRequest, + SetIamPolicyRegionInstantSnapshotRequest, SetIamPolicyRegionNetworkFirewallPolicyRequest, SetIamPolicyReservationRequest, SetIamPolicyResourcePolicyRequest, @@ -1407,9 +1433,11 @@ SetLabelsGlobalForwardingRuleRequest, SetLabelsImageRequest, SetLabelsInstanceRequest, + SetLabelsInstantSnapshotRequest, SetLabelsInterconnectAttachmentRequest, SetLabelsInterconnectRequest, SetLabelsRegionDiskRequest, + SetLabelsRegionInstantSnapshotRequest, SetLabelsSecurityPolicyRequest, SetLabelsSnapshotRequest, SetLabelsTargetVpnGatewayRequest, @@ -1559,6 +1587,7 @@ TestIamPermissionsImageRequest, TestIamPermissionsInstanceRequest, TestIamPermissionsInstanceTemplateRequest, + TestIamPermissionsInstantSnapshotRequest, TestIamPermissionsLicenseCodeRequest, TestIamPermissionsLicenseRequest, TestIamPermissionsMachineImageRequest, @@ -1570,6 +1599,7 @@ TestIamPermissionsPacketMirroringRequest, TestIamPermissionsRegionBackendServiceRequest, TestIamPermissionsRegionDiskRequest, + TestIamPermissionsRegionInstantSnapshotRequest, TestIamPermissionsRegionNetworkFirewallPolicyRequest, TestIamPermissionsReservationRequest, TestIamPermissionsResourcePolicyRequest, @@ -1682,6 +1712,7 @@ "InstanceGroupsClient", "InstancesClient", "InstanceTemplatesClient", + "InstantSnapshotsClient", "InterconnectAttachmentsClient", "InterconnectLocationsClient", "InterconnectRemoteLocationsClient", @@ -1713,6 +1744,7 @@ "RegionInstanceGroupsClient", "RegionInstancesClient", "RegionInstanceTemplatesClient", + "RegionInstantSnapshotsClient", "RegionNetworkEndpointGroupsClient", "RegionNetworkFirewallPoliciesClient", "RegionNotificationEndpointsClient", @@ -1796,6 +1828,7 @@ "AggregatedListInstanceGroupsRequest", "AggregatedListInstancesRequest", "AggregatedListInstanceTemplatesRequest", + "AggregatedListInstantSnapshotsRequest", "AggregatedListInterconnectAttachmentsRequest", "AggregatedListMachineTypesRequest", "AggregatedListNetworkAttachmentsRequest", @@ -1945,6 +1978,7 @@ "DeleteInstancesInstanceGroupManagerRequest", "DeleteInstancesRegionInstanceGroupManagerRequest", "DeleteInstanceTemplateRequest", + "DeleteInstantSnapshotRequest", "DeleteInterconnectAttachmentRequest", "DeleteInterconnectRequest", "DeleteLicenseRequest", @@ -1969,6 +2003,7 @@ "DeleteRegionHealthCheckServiceRequest", "DeleteRegionInstanceGroupManagerRequest", "DeleteRegionInstanceTemplateRequest", + "DeleteRegionInstantSnapshotRequest", "DeleteRegionNetworkEndpointGroupRequest", "DeleteRegionNetworkFirewallPolicyRequest", "DeleteRegionNotificationEndpointRequest", @@ -2108,6 +2143,7 @@ "GetIamPolicyImageRequest", "GetIamPolicyInstanceRequest", "GetIamPolicyInstanceTemplateRequest", + "GetIamPolicyInstantSnapshotRequest", "GetIamPolicyLicenseRequest", "GetIamPolicyMachineImageRequest", "GetIamPolicyNetworkAttachmentRequest", @@ -2116,6 +2152,7 @@ "GetIamPolicyNodeTemplateRequest", "GetIamPolicyRegionBackendServiceRequest", "GetIamPolicyRegionDiskRequest", + "GetIamPolicyRegionInstantSnapshotRequest", "GetIamPolicyRegionNetworkFirewallPolicyRequest", "GetIamPolicyReservationRequest", "GetIamPolicyResourcePolicyRequest", @@ -2128,6 +2165,7 @@ "GetInstanceGroupRequest", "GetInstanceRequest", "GetInstanceTemplateRequest", + "GetInstantSnapshotRequest", "GetInterconnectAttachmentRequest", "GetInterconnectLocationRequest", "GetInterconnectRemoteLocationRequest", @@ -2161,6 +2199,7 @@ "GetRegionInstanceGroupManagerRequest", "GetRegionInstanceGroupRequest", "GetRegionInstanceTemplateRequest", + "GetRegionInstantSnapshotRequest", "GetRegionNetworkEndpointGroupRequest", "GetRegionNetworkFirewallPolicyRequest", "GetRegionNotificationEndpointRequest", @@ -2272,6 +2311,7 @@ "InsertInstanceGroupRequest", "InsertInstanceRequest", "InsertInstanceTemplateRequest", + "InsertInstantSnapshotRequest", "InsertInterconnectAttachmentRequest", "InsertInterconnectRequest", "InsertLicenseRequest", @@ -2294,6 +2334,7 @@ "InsertRegionHealthCheckServiceRequest", "InsertRegionInstanceGroupManagerRequest", "InsertRegionInstanceTemplateRequest", + "InsertRegionInstantSnapshotRequest", "InsertRegionNetworkEndpointGroupRequest", "InsertRegionNetworkFirewallPolicyRequest", "InsertRegionNotificationEndpointRequest", @@ -2395,6 +2436,11 @@ "InstanceTemplateList", "InstanceTemplatesScopedList", "InstanceWithNamedPorts", + "InstantSnapshot", + "InstantSnapshotAggregatedList", + "InstantSnapshotList", + "InstantSnapshotResourceStatus", + "InstantSnapshotsScopedList", "Int64RangeMatch", "Interconnect", "InterconnectAttachment", @@ -2466,6 +2512,7 @@ "ListInstancesRegionInstanceGroupsRequest", "ListInstancesRequest", "ListInstanceTemplatesRequest", + "ListInstantSnapshotsRequest", "ListInterconnectAttachmentsRequest", "ListInterconnectLocationsRequest", "ListInterconnectRemoteLocationsRequest", @@ -2504,6 +2551,7 @@ "ListRegionInstanceGroupManagersRequest", "ListRegionInstanceGroupsRequest", "ListRegionInstanceTemplatesRequest", + "ListRegionInstantSnapshotsRequest", "ListRegionNetworkEndpointGroupsRequest", "ListRegionNetworkFirewallPoliciesRequest", "ListRegionNotificationEndpointsRequest", @@ -2714,6 +2762,7 @@ "ProjectsEnableXpnResourceRequest", "ProjectsGetXpnResources", "ProjectsListXpnHostsRequest", + "ProjectsSetCloudArmorTierRequest", "ProjectsSetDefaultNetworkTierRequest", "PublicAdvertisedPrefix", "PublicAdvertisedPrefixList", @@ -2895,6 +2944,7 @@ "SetBackupTargetPoolRequest", "SetCertificateMapTargetHttpsProxyRequest", "SetCertificateMapTargetSslProxyRequest", + "SetCloudArmorTierProjectRequest", "SetCommonInstanceMetadataOperationMetadata", "SetCommonInstanceMetadataOperationMetadataPerLocationOperationInfo", "SetCommonInstanceMetadataProjectRequest", @@ -2910,6 +2960,7 @@ "SetIamPolicyImageRequest", "SetIamPolicyInstanceRequest", "SetIamPolicyInstanceTemplateRequest", + "SetIamPolicyInstantSnapshotRequest", "SetIamPolicyLicenseRequest", "SetIamPolicyMachineImageRequest", "SetIamPolicyNetworkAttachmentRequest", @@ -2918,6 +2969,7 @@ "SetIamPolicyNodeTemplateRequest", "SetIamPolicyRegionBackendServiceRequest", "SetIamPolicyRegionDiskRequest", + "SetIamPolicyRegionInstantSnapshotRequest", "SetIamPolicyRegionNetworkFirewallPolicyRequest", "SetIamPolicyReservationRequest", "SetIamPolicyResourcePolicyRequest", @@ -2934,9 +2986,11 @@ "SetLabelsGlobalForwardingRuleRequest", "SetLabelsImageRequest", "SetLabelsInstanceRequest", + "SetLabelsInstantSnapshotRequest", "SetLabelsInterconnectAttachmentRequest", "SetLabelsInterconnectRequest", "SetLabelsRegionDiskRequest", + "SetLabelsRegionInstantSnapshotRequest", "SetLabelsSecurityPolicyRequest", "SetLabelsSnapshotRequest", "SetLabelsTargetVpnGatewayRequest", @@ -3086,6 +3140,7 @@ "TestIamPermissionsImageRequest", "TestIamPermissionsInstanceRequest", "TestIamPermissionsInstanceTemplateRequest", + "TestIamPermissionsInstantSnapshotRequest", "TestIamPermissionsLicenseCodeRequest", "TestIamPermissionsLicenseRequest", "TestIamPermissionsMachineImageRequest", @@ -3097,6 +3152,7 @@ "TestIamPermissionsPacketMirroringRequest", "TestIamPermissionsRegionBackendServiceRequest", "TestIamPermissionsRegionDiskRequest", + "TestIamPermissionsRegionInstantSnapshotRequest", "TestIamPermissionsRegionNetworkFirewallPolicyRequest", "TestIamPermissionsReservationRequest", "TestIamPermissionsResourcePolicyRequest", diff --git a/packages/google-cloud-compute/google/cloud/compute/gapic_version.py b/packages/google-cloud-compute/google/cloud/compute/gapic_version.py index 3293978284a9..360a0d13ebdd 100644 --- a/packages/google-cloud-compute/google/cloud/compute/gapic_version.py +++ b/packages/google-cloud-compute/google/cloud/compute/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "1.17.0" # {x-release-please-version} +__version__ = "0.0.0" # {x-release-please-version} 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 673511504a88..54195181c84b 100644 --- a/packages/google-cloud-compute/google/cloud/compute_v1/__init__.py +++ b/packages/google-cloud-compute/google/cloud/compute_v1/__init__.py @@ -44,6 +44,7 @@ from .services.instance_groups import InstanceGroupsClient from .services.instance_templates import InstanceTemplatesClient from .services.instances import InstancesClient +from .services.instant_snapshots import InstantSnapshotsClient from .services.interconnect_attachments import InterconnectAttachmentsClient from .services.interconnect_locations import InterconnectLocationsClient from .services.interconnect_remote_locations import InterconnectRemoteLocationsClient @@ -75,6 +76,7 @@ from .services.region_instance_groups import RegionInstanceGroupsClient from .services.region_instance_templates import RegionInstanceTemplatesClient from .services.region_instances import RegionInstancesClient +from .services.region_instant_snapshots import RegionInstantSnapshotsClient from .services.region_network_endpoint_groups import RegionNetworkEndpointGroupsClient from .services.region_network_firewall_policies import ( RegionNetworkFirewallPoliciesClient, @@ -161,6 +163,7 @@ AggregatedListInstanceGroupsRequest, AggregatedListInstancesRequest, AggregatedListInstanceTemplatesRequest, + AggregatedListInstantSnapshotsRequest, AggregatedListInterconnectAttachmentsRequest, AggregatedListMachineTypesRequest, AggregatedListNetworkAttachmentsRequest, @@ -310,6 +313,7 @@ DeleteInstancesInstanceGroupManagerRequest, DeleteInstancesRegionInstanceGroupManagerRequest, DeleteInstanceTemplateRequest, + DeleteInstantSnapshotRequest, DeleteInterconnectAttachmentRequest, DeleteInterconnectRequest, DeleteLicenseRequest, @@ -334,6 +338,7 @@ DeleteRegionHealthCheckServiceRequest, DeleteRegionInstanceGroupManagerRequest, DeleteRegionInstanceTemplateRequest, + DeleteRegionInstantSnapshotRequest, DeleteRegionNetworkEndpointGroupRequest, DeleteRegionNetworkFirewallPolicyRequest, DeleteRegionNotificationEndpointRequest, @@ -473,6 +478,7 @@ GetIamPolicyImageRequest, GetIamPolicyInstanceRequest, GetIamPolicyInstanceTemplateRequest, + GetIamPolicyInstantSnapshotRequest, GetIamPolicyLicenseRequest, GetIamPolicyMachineImageRequest, GetIamPolicyNetworkAttachmentRequest, @@ -481,6 +487,7 @@ GetIamPolicyNodeTemplateRequest, GetIamPolicyRegionBackendServiceRequest, GetIamPolicyRegionDiskRequest, + GetIamPolicyRegionInstantSnapshotRequest, GetIamPolicyRegionNetworkFirewallPolicyRequest, GetIamPolicyReservationRequest, GetIamPolicyResourcePolicyRequest, @@ -493,6 +500,7 @@ GetInstanceGroupRequest, GetInstanceRequest, GetInstanceTemplateRequest, + GetInstantSnapshotRequest, GetInterconnectAttachmentRequest, GetInterconnectLocationRequest, GetInterconnectRemoteLocationRequest, @@ -526,6 +534,7 @@ GetRegionInstanceGroupManagerRequest, GetRegionInstanceGroupRequest, GetRegionInstanceTemplateRequest, + GetRegionInstantSnapshotRequest, GetRegionNetworkEndpointGroupRequest, GetRegionNetworkFirewallPolicyRequest, GetRegionNotificationEndpointRequest, @@ -637,6 +646,7 @@ InsertInstanceGroupRequest, InsertInstanceRequest, InsertInstanceTemplateRequest, + InsertInstantSnapshotRequest, InsertInterconnectAttachmentRequest, InsertInterconnectRequest, InsertLicenseRequest, @@ -659,6 +669,7 @@ InsertRegionHealthCheckServiceRequest, InsertRegionInstanceGroupManagerRequest, InsertRegionInstanceTemplateRequest, + InsertRegionInstantSnapshotRequest, InsertRegionNetworkEndpointGroupRequest, InsertRegionNetworkFirewallPolicyRequest, InsertRegionNotificationEndpointRequest, @@ -760,6 +771,11 @@ InstanceTemplateList, InstanceTemplatesScopedList, InstanceWithNamedPorts, + InstantSnapshot, + InstantSnapshotAggregatedList, + InstantSnapshotList, + InstantSnapshotResourceStatus, + InstantSnapshotsScopedList, Int64RangeMatch, Interconnect, InterconnectAttachment, @@ -831,6 +847,7 @@ ListInstancesRegionInstanceGroupsRequest, ListInstancesRequest, ListInstanceTemplatesRequest, + ListInstantSnapshotsRequest, ListInterconnectAttachmentsRequest, ListInterconnectLocationsRequest, ListInterconnectRemoteLocationsRequest, @@ -869,6 +886,7 @@ ListRegionInstanceGroupManagersRequest, ListRegionInstanceGroupsRequest, ListRegionInstanceTemplatesRequest, + ListRegionInstantSnapshotsRequest, ListRegionNetworkEndpointGroupsRequest, ListRegionNetworkFirewallPoliciesRequest, ListRegionNotificationEndpointsRequest, @@ -1079,6 +1097,7 @@ ProjectsEnableXpnResourceRequest, ProjectsGetXpnResources, ProjectsListXpnHostsRequest, + ProjectsSetCloudArmorTierRequest, ProjectsSetDefaultNetworkTierRequest, PublicAdvertisedPrefix, PublicAdvertisedPrefixList, @@ -1260,6 +1279,7 @@ SetBackupTargetPoolRequest, SetCertificateMapTargetHttpsProxyRequest, SetCertificateMapTargetSslProxyRequest, + SetCloudArmorTierProjectRequest, SetCommonInstanceMetadataOperationMetadata, SetCommonInstanceMetadataOperationMetadataPerLocationOperationInfo, SetCommonInstanceMetadataProjectRequest, @@ -1275,6 +1295,7 @@ SetIamPolicyImageRequest, SetIamPolicyInstanceRequest, SetIamPolicyInstanceTemplateRequest, + SetIamPolicyInstantSnapshotRequest, SetIamPolicyLicenseRequest, SetIamPolicyMachineImageRequest, SetIamPolicyNetworkAttachmentRequest, @@ -1283,6 +1304,7 @@ SetIamPolicyNodeTemplateRequest, SetIamPolicyRegionBackendServiceRequest, SetIamPolicyRegionDiskRequest, + SetIamPolicyRegionInstantSnapshotRequest, SetIamPolicyRegionNetworkFirewallPolicyRequest, SetIamPolicyReservationRequest, SetIamPolicyResourcePolicyRequest, @@ -1299,9 +1321,11 @@ SetLabelsGlobalForwardingRuleRequest, SetLabelsImageRequest, SetLabelsInstanceRequest, + SetLabelsInstantSnapshotRequest, SetLabelsInterconnectAttachmentRequest, SetLabelsInterconnectRequest, SetLabelsRegionDiskRequest, + SetLabelsRegionInstantSnapshotRequest, SetLabelsSecurityPolicyRequest, SetLabelsSnapshotRequest, SetLabelsTargetVpnGatewayRequest, @@ -1451,6 +1475,7 @@ TestIamPermissionsImageRequest, TestIamPermissionsInstanceRequest, TestIamPermissionsInstanceTemplateRequest, + TestIamPermissionsInstantSnapshotRequest, TestIamPermissionsLicenseCodeRequest, TestIamPermissionsLicenseRequest, TestIamPermissionsMachineImageRequest, @@ -1462,6 +1487,7 @@ TestIamPermissionsPacketMirroringRequest, TestIamPermissionsRegionBackendServiceRequest, TestIamPermissionsRegionDiskRequest, + TestIamPermissionsRegionInstantSnapshotRequest, TestIamPermissionsRegionNetworkFirewallPolicyRequest, TestIamPermissionsReservationRequest, TestIamPermissionsResourcePolicyRequest, @@ -1599,6 +1625,7 @@ "AggregatedListInstanceGroupsRequest", "AggregatedListInstanceTemplatesRequest", "AggregatedListInstancesRequest", + "AggregatedListInstantSnapshotsRequest", "AggregatedListInterconnectAttachmentsRequest", "AggregatedListMachineTypesRequest", "AggregatedListNetworkAttachmentsRequest", @@ -1750,6 +1777,7 @@ "DeleteInstanceTemplateRequest", "DeleteInstancesInstanceGroupManagerRequest", "DeleteInstancesRegionInstanceGroupManagerRequest", + "DeleteInstantSnapshotRequest", "DeleteInterconnectAttachmentRequest", "DeleteInterconnectRequest", "DeleteLicenseRequest", @@ -1774,6 +1802,7 @@ "DeleteRegionHealthCheckServiceRequest", "DeleteRegionInstanceGroupManagerRequest", "DeleteRegionInstanceTemplateRequest", + "DeleteRegionInstantSnapshotRequest", "DeleteRegionNetworkEndpointGroupRequest", "DeleteRegionNetworkFirewallPolicyRequest", "DeleteRegionNotificationEndpointRequest", @@ -1920,6 +1949,7 @@ "GetIamPolicyImageRequest", "GetIamPolicyInstanceRequest", "GetIamPolicyInstanceTemplateRequest", + "GetIamPolicyInstantSnapshotRequest", "GetIamPolicyLicenseRequest", "GetIamPolicyMachineImageRequest", "GetIamPolicyNetworkAttachmentRequest", @@ -1928,6 +1958,7 @@ "GetIamPolicyNodeTemplateRequest", "GetIamPolicyRegionBackendServiceRequest", "GetIamPolicyRegionDiskRequest", + "GetIamPolicyRegionInstantSnapshotRequest", "GetIamPolicyRegionNetworkFirewallPolicyRequest", "GetIamPolicyReservationRequest", "GetIamPolicyResourcePolicyRequest", @@ -1940,6 +1971,7 @@ "GetInstanceGroupRequest", "GetInstanceRequest", "GetInstanceTemplateRequest", + "GetInstantSnapshotRequest", "GetInterconnectAttachmentRequest", "GetInterconnectLocationRequest", "GetInterconnectRemoteLocationRequest", @@ -1973,6 +2005,7 @@ "GetRegionInstanceGroupManagerRequest", "GetRegionInstanceGroupRequest", "GetRegionInstanceTemplateRequest", + "GetRegionInstantSnapshotRequest", "GetRegionNetworkEndpointGroupRequest", "GetRegionNetworkFirewallPolicyRequest", "GetRegionNotificationEndpointRequest", @@ -2092,6 +2125,7 @@ "InsertInstanceGroupRequest", "InsertInstanceRequest", "InsertInstanceTemplateRequest", + "InsertInstantSnapshotRequest", "InsertInterconnectAttachmentRequest", "InsertInterconnectRequest", "InsertLicenseRequest", @@ -2114,6 +2148,7 @@ "InsertRegionHealthCheckServiceRequest", "InsertRegionInstanceGroupManagerRequest", "InsertRegionInstanceTemplateRequest", + "InsertRegionInstantSnapshotRequest", "InsertRegionNetworkEndpointGroupRequest", "InsertRegionNetworkFirewallPolicyRequest", "InsertRegionNotificationEndpointRequest", @@ -2219,6 +2254,12 @@ "InstancesSetSecurityPolicyRequest", "InstancesSetServiceAccountRequest", "InstancesStartWithEncryptionKeyRequest", + "InstantSnapshot", + "InstantSnapshotAggregatedList", + "InstantSnapshotList", + "InstantSnapshotResourceStatus", + "InstantSnapshotsClient", + "InstantSnapshotsScopedList", "Int64RangeMatch", "Interconnect", "InterconnectAttachment", @@ -2296,6 +2337,7 @@ "ListInstancesInstanceGroupsRequest", "ListInstancesRegionInstanceGroupsRequest", "ListInstancesRequest", + "ListInstantSnapshotsRequest", "ListInterconnectAttachmentsRequest", "ListInterconnectLocationsRequest", "ListInterconnectRemoteLocationsRequest", @@ -2334,6 +2376,7 @@ "ListRegionInstanceGroupManagersRequest", "ListRegionInstanceGroupsRequest", "ListRegionInstanceTemplatesRequest", + "ListRegionInstantSnapshotsRequest", "ListRegionNetworkEndpointGroupsRequest", "ListRegionNetworkFirewallPoliciesRequest", "ListRegionNotificationEndpointsRequest", @@ -2556,6 +2599,7 @@ "ProjectsEnableXpnResourceRequest", "ProjectsGetXpnResources", "ProjectsListXpnHostsRequest", + "ProjectsSetCloudArmorTierRequest", "ProjectsSetDefaultNetworkTierRequest", "PublicAdvertisedPrefix", "PublicAdvertisedPrefixList", @@ -2610,6 +2654,7 @@ "RegionInstanceGroupsSetNamedPortsRequest", "RegionInstanceTemplatesClient", "RegionInstancesClient", + "RegionInstantSnapshotsClient", "RegionList", "RegionNetworkEndpointGroupsAttachEndpointsRequest", "RegionNetworkEndpointGroupsClient", @@ -2770,6 +2815,7 @@ "SetBackupTargetPoolRequest", "SetCertificateMapTargetHttpsProxyRequest", "SetCertificateMapTargetSslProxyRequest", + "SetCloudArmorTierProjectRequest", "SetCommonInstanceMetadataOperationMetadata", "SetCommonInstanceMetadataOperationMetadataPerLocationOperationInfo", "SetCommonInstanceMetadataProjectRequest", @@ -2785,6 +2831,7 @@ "SetIamPolicyImageRequest", "SetIamPolicyInstanceRequest", "SetIamPolicyInstanceTemplateRequest", + "SetIamPolicyInstantSnapshotRequest", "SetIamPolicyLicenseRequest", "SetIamPolicyMachineImageRequest", "SetIamPolicyNetworkAttachmentRequest", @@ -2793,6 +2840,7 @@ "SetIamPolicyNodeTemplateRequest", "SetIamPolicyRegionBackendServiceRequest", "SetIamPolicyRegionDiskRequest", + "SetIamPolicyRegionInstantSnapshotRequest", "SetIamPolicyRegionNetworkFirewallPolicyRequest", "SetIamPolicyReservationRequest", "SetIamPolicyResourcePolicyRequest", @@ -2809,9 +2857,11 @@ "SetLabelsGlobalForwardingRuleRequest", "SetLabelsImageRequest", "SetLabelsInstanceRequest", + "SetLabelsInstantSnapshotRequest", "SetLabelsInterconnectAttachmentRequest", "SetLabelsInterconnectRequest", "SetLabelsRegionDiskRequest", + "SetLabelsRegionInstantSnapshotRequest", "SetLabelsSecurityPolicyRequest", "SetLabelsSnapshotRequest", "SetLabelsTargetVpnGatewayRequest", @@ -2973,6 +3023,7 @@ "TestIamPermissionsImageRequest", "TestIamPermissionsInstanceRequest", "TestIamPermissionsInstanceTemplateRequest", + "TestIamPermissionsInstantSnapshotRequest", "TestIamPermissionsLicenseCodeRequest", "TestIamPermissionsLicenseRequest", "TestIamPermissionsMachineImageRequest", @@ -2984,6 +3035,7 @@ "TestIamPermissionsPacketMirroringRequest", "TestIamPermissionsRegionBackendServiceRequest", "TestIamPermissionsRegionDiskRequest", + "TestIamPermissionsRegionInstantSnapshotRequest", "TestIamPermissionsRegionNetworkFirewallPolicyRequest", "TestIamPermissionsReservationRequest", "TestIamPermissionsResourcePolicyRequest", 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 979286888983..494060e6d6df 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 @@ -1426,6 +1426,60 @@ } } }, + "InstantSnapshots": { + "clients": { + "rest": { + "libraryClient": "InstantSnapshotsClient", + "rpcs": { + "AggregatedList": { + "methods": [ + "aggregated_list" + ] + }, + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "GetIamPolicy": { + "methods": [ + "get_iam_policy" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "List": { + "methods": [ + "list" + ] + }, + "SetIamPolicy": { + "methods": [ + "set_iam_policy" + ] + }, + "SetLabels": { + "methods": [ + "set_labels" + ] + }, + "TestIamPermissions": { + "methods": [ + "test_iam_permissions" + ] + } + } + } + } + }, "InterconnectAttachments": { "clients": { "rest": { @@ -2234,6 +2288,11 @@ "move_instance" ] }, + "SetCloudArmorTier": { + "methods": [ + "set_cloud_armor_tier" + ] + }, "SetCommonInstanceMetadata": { "methods": [ "set_common_instance_metadata" @@ -2850,6 +2909,55 @@ } } }, + "RegionInstantSnapshots": { + "clients": { + "rest": { + "libraryClient": "RegionInstantSnapshotsClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "GetIamPolicy": { + "methods": [ + "get_iam_policy" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "List": { + "methods": [ + "list" + ] + }, + "SetIamPolicy": { + "methods": [ + "set_iam_policy" + ] + }, + "SetLabels": { + "methods": [ + "set_labels" + ] + }, + "TestIamPermissions": { + "methods": [ + "test_iam_permissions" + ] + } + } + } + } + }, "RegionNetworkEndpointGroups": { "clients": { "rest": { diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/gapic_version.py b/packages/google-cloud-compute/google/cloud/compute_v1/gapic_version.py index 3293978284a9..360a0d13ebdd 100644 --- a/packages/google-cloud-compute/google/cloud/compute_v1/gapic_version.py +++ b/packages/google-cloud-compute/google/cloud/compute_v1/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "1.17.0" # {x-release-please-version} +__version__ = "0.0.0" # {x-release-please-version} diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/accelerator_types/client.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/accelerator_types/client.py index 3735b663571b..0ac3a9c5d5db 100644 --- a/packages/google-cloud-compute/google/cloud/compute_v1/services/accelerator_types/client.py +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/accelerator_types/client.py @@ -656,7 +656,9 @@ def aggregated_list( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.AggregatedListPager: - r"""Retrieves an aggregated list of accelerator types. + r"""Retrieves an aggregated list of accelerator types. To prevent + failure, Google recommends that you set the + ``returnPartialSuccess`` parameter to ``true``. .. code-block:: python diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/addresses/client.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/addresses/client.py index b5e7781bf7a8..cb427e8e4c8d 100644 --- a/packages/google-cloud-compute/google/cloud/compute_v1/services/addresses/client.py +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/addresses/client.py @@ -649,7 +649,9 @@ def aggregated_list( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.AggregatedListPager: - r"""Retrieves an aggregated list of addresses. + r"""Retrieves an aggregated list of addresses. To prevent failure, + Google recommends that you set the ``returnPartialSuccess`` + parameter to ``true``. .. code-block:: python diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/autoscalers/client.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/autoscalers/client.py index 85cbf293a316..309717ee4976 100644 --- a/packages/google-cloud-compute/google/cloud/compute_v1/services/autoscalers/client.py +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/autoscalers/client.py @@ -649,7 +649,9 @@ def aggregated_list( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.AggregatedListPager: - r"""Retrieves an aggregated list of autoscalers. + r"""Retrieves an aggregated list of autoscalers. To prevent failure, + Google recommends that you set the ``returnPartialSuccess`` + parameter to ``true``. .. code-block:: python diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/backend_services/client.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/backend_services/client.py index 22a4340224b2..aeb0ff2edb11 100644 --- a/packages/google-cloud-compute/google/cloud/compute_v1/services/backend_services/client.py +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/backend_services/client.py @@ -946,8 +946,10 @@ def aggregated_list( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.AggregatedListPager: - r"""Retrieves the list of all BackendService resources, - regional and global, available to the specified project. + r"""Retrieves the list of all BackendService resources, regional and + global, available to the specified project. To prevent failure, + Google recommends that you set the ``returnPartialSuccess`` + parameter to ``true``. .. code-block:: python diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/disk_types/client.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/disk_types/client.py index c61cf219674d..d8e5871284a6 100644 --- a/packages/google-cloud-compute/google/cloud/compute_v1/services/disk_types/client.py +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/disk_types/client.py @@ -646,7 +646,9 @@ def aggregated_list( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.AggregatedListPager: - r"""Retrieves an aggregated list of disk types. + r"""Retrieves an aggregated list of disk types. To prevent failure, + Google recommends that you set the ``returnPartialSuccess`` + parameter to ``true``. .. code-block:: python 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 7443414d61b4..85a6419ab474 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 @@ -966,7 +966,9 @@ def aggregated_list( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.AggregatedListPager: - r"""Retrieves an aggregated list of persistent disks. + r"""Retrieves an aggregated list of persistent disks. To prevent + failure, Google recommends that you set the + ``returnPartialSuccess`` parameter to ``true``. .. code-block:: python diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/forwarding_rules/client.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/forwarding_rules/client.py index fb432f48e942..de0a54146b87 100644 --- a/packages/google-cloud-compute/google/cloud/compute_v1/services/forwarding_rules/client.py +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/forwarding_rules/client.py @@ -656,7 +656,9 @@ def aggregated_list( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.AggregatedListPager: - r"""Retrieves an aggregated list of forwarding rules. + r"""Retrieves an aggregated list of forwarding rules. To prevent + failure, Google recommends that you set the + ``returnPartialSuccess`` parameter to ``true``. .. code-block:: python diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/global_operations/client.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/global_operations/client.py index 5085c273e064..9535c4ea0633 100644 --- a/packages/google-cloud-compute/google/cloud/compute_v1/services/global_operations/client.py +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/global_operations/client.py @@ -653,7 +653,9 @@ def aggregated_list( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.AggregatedListPager: - r"""Retrieves an aggregated list of all operations. + r"""Retrieves an aggregated list of all operations. To prevent + failure, Google recommends that you set the + ``returnPartialSuccess`` parameter to ``true``. .. code-block:: python diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/health_checks/client.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/health_checks/client.py index 781e26fe8e45..8b03d11327a9 100644 --- a/packages/google-cloud-compute/google/cloud/compute_v1/services/health_checks/client.py +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/health_checks/client.py @@ -651,8 +651,10 @@ def aggregated_list( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.AggregatedListPager: - r"""Retrieves the list of all HealthCheck resources, - regional and global, available to the specified project. + r"""Retrieves the list of all HealthCheck resources, regional and + global, available to the specified project. To prevent failure, + Google recommends that you set the ``returnPartialSuccess`` + parameter to ``true``. .. code-block:: python diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/instance_group_managers/client.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/instance_group_managers/client.py index 40920361bd7d..fb00b7f18ebc 100644 --- a/packages/google-cloud-compute/google/cloud/compute_v1/services/instance_group_managers/client.py +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/instance_group_managers/client.py @@ -1019,8 +1019,9 @@ def aggregated_list( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.AggregatedListPager: - r"""Retrieves the list of managed instance groups and - groups them by zone. + r"""Retrieves the list of managed instance groups and groups them by + zone. To prevent failure, Google recommends that you set the + ``returnPartialSuccess`` parameter to ``true``. .. code-block:: python diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/instance_groups/client.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/instance_groups/client.py index 28089fbd3665..42276b137836 100644 --- a/packages/google-cloud-compute/google/cloud/compute_v1/services/instance_groups/client.py +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/instance_groups/client.py @@ -989,8 +989,9 @@ def aggregated_list( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.AggregatedListPager: - r"""Retrieves the list of instance groups and sorts them - by zone. + r"""Retrieves the list of instance groups and sorts them by zone. To + prevent failure, Google recommends that you set the + ``returnPartialSuccess`` parameter to ``true``. .. code-block:: python diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/instance_templates/client.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/instance_templates/client.py index 62fd9879214d..da861a207500 100644 --- a/packages/google-cloud-compute/google/cloud/compute_v1/services/instance_templates/client.py +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/instance_templates/client.py @@ -656,9 +656,10 @@ def aggregated_list( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.AggregatedListPager: - r"""Retrieves the list of all InstanceTemplates - resources, regional and global, available to the - specified project. + r"""Retrieves the list of all InstanceTemplates resources, regional + and global, available to the specified project. To prevent + failure, Google recommends that you set the + ``returnPartialSuccess`` parameter to ``true``. .. code-block:: python diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/instances/client.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/instances/client.py index 23da6a6daf34..4db20b4bb141 100644 --- a/packages/google-cloud-compute/google/cloud/compute_v1/services/instances/client.py +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/instances/client.py @@ -1299,11 +1299,12 @@ def aggregated_list( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.AggregatedListPager: - r"""Retrieves an aggregated list of all of the instances - in your project across all regions and zones. The - performance of this method degrades when a filter is - specified on a project that has a very large number of - instances. + r"""Retrieves an aggregated list of all of the instances in your + project across all regions and zones. The performance of this + method degrades when a filter is specified on a project that has + a very large number of instances. To prevent failure, Google + recommends that you set the ``returnPartialSuccess`` parameter + to ``true``. .. code-block:: python diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/instant_snapshots/__init__.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/instant_snapshots/__init__.py new file mode 100644 index 000000000000..160c5f1f5779 --- /dev/null +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/instant_snapshots/__init__.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 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 InstantSnapshotsClient + +__all__ = ("InstantSnapshotsClient",) diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/instant_snapshots/client.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/instant_snapshots/client.py new file mode 100644 index 000000000000..acd0d7b732b1 --- /dev/null +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/instant_snapshots/client.py @@ -0,0 +1,2420 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 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 +import os +import re +from typing import ( + 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 + +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 + +from google.api_core import extended_operation # type: ignore + +from google.cloud.compute_v1.services.instant_snapshots import pagers +from google.cloud.compute_v1.types import compute + +from .transports.base import DEFAULT_CLIENT_INFO, InstantSnapshotsTransport +from .transports.rest import InstantSnapshotsRestTransport + + +class InstantSnapshotsClientMeta(type): + """Metaclass for the InstantSnapshots 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[InstantSnapshotsTransport]] + _transport_registry["rest"] = InstantSnapshotsRestTransport + + def get_transport_class( + cls, + label: Optional[str] = None, + ) -> Type[InstantSnapshotsTransport]: + """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 InstantSnapshotsClient(metaclass=InstantSnapshotsClientMeta): + """The InstantSnapshots 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: + InstantSnapshotsClient: 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: + InstantSnapshotsClient: 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) -> InstantSnapshotsTransport: + """Returns the transport used by the client instance. + + Returns: + InstantSnapshotsTransport: 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 = InstantSnapshotsClient._DEFAULT_UNIVERSE + if universe_domain != _default_universe: + raise MutualTLSChannelError( + f"mTLS is not supported in any universe other than {_default_universe}." + ) + api_endpoint = InstantSnapshotsClient.DEFAULT_MTLS_ENDPOINT + else: + api_endpoint = InstantSnapshotsClient._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 = InstantSnapshotsClient._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 + + @staticmethod + def _compare_universes( + client_universe: str, credentials: ga_credentials.Credentials + ) -> bool: + """Returns True iff the universe domains used by the client and credentials match. + + Args: + client_universe (str): The universe domain configured via the client options. + credentials (ga_credentials.Credentials): The credentials being used in the client. + + Returns: + bool: True iff client_universe matches the universe in credentials. + + Raises: + ValueError: when client_universe does not match the universe in credentials. + """ + + default_universe = InstantSnapshotsClient._DEFAULT_UNIVERSE + credentials_universe = getattr(credentials, "universe_domain", default_universe) + + if client_universe != credentials_universe: + raise ValueError( + "The configured universe domain " + f"({client_universe}) does not match the universe domain " + f"found in the credentials ({credentials_universe}). " + "If you haven't configured the universe domain explicitly, " + f"`{default_universe}` is the default." + ) + return True + + 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. + """ + self._is_universe_domain_valid = ( + self._is_universe_domain_valid + or InstantSnapshotsClient._compare_universes( + self.universe_domain, self.transport._credentials + ) + ) + return self._is_universe_domain_valid + + @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, InstantSnapshotsTransport]] = None, + client_options: Optional[Union[client_options_lib.ClientOptions, dict]] = None, + client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, + ) -> None: + """Instantiates the instant snapshots 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 (Union[str, InstantSnapshotsTransport]): The + transport to use. 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, + ) = InstantSnapshotsClient._read_environment_variables() + self._client_cert_source = InstantSnapshotsClient._get_client_cert_source( + self._client_options.client_cert_source, self._use_client_cert + ) + self._universe_domain = InstantSnapshotsClient._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 + + 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, InstantSnapshotsTransport) + if transport_provided: + # transport is a InstantSnapshotsTransport 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(InstantSnapshotsTransport, transport) + self._api_endpoint = self._transport.host + + self._api_endpoint = ( + self._api_endpoint + or InstantSnapshotsClient._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 = type(self).get_transport_class(cast(str, transport)) + self._transport = Transport( + 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, + ) + + def aggregated_list( + self, + request: Optional[ + Union[compute.AggregatedListInstantSnapshotsRequest, dict] + ] = None, + *, + project: Optional[str] = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, str]] = (), + ) -> pagers.AggregatedListPager: + r"""Retrieves an aggregated list of instantSnapshots. To prevent + failure, Google recommends that you set the + ``returnPartialSuccess`` parameter to ``true``. + + .. 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_aggregated_list(): + # Create a client + client = compute_v1.InstantSnapshotsClient() + + # Initialize request argument(s) + request = compute_v1.AggregatedListInstantSnapshotsRequest( + project="project_value", + ) + + # Make the request + page_result = client.aggregated_list(request=request) + + # Handle the response + for response in page_result: + print(response) + + Args: + request (Union[google.cloud.compute_v1.types.AggregatedListInstantSnapshotsRequest, dict]): + The request object. A request message for + InstantSnapshots.AggregatedList. 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, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.compute_v1.services.instant_snapshots.pagers.AggregatedListPager: + 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. + has_flattened_params = any([project]) + 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." + ) + + # Minor optimization to avoid making a copy if the user passes + # in a compute.AggregatedListInstantSnapshotsRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance(request, compute.AggregatedListInstantSnapshotsRequest): + request = compute.AggregatedListInstantSnapshotsRequest(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.aggregated_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.AggregatedListPager( + method=rpc, + request=request, + response=response, + metadata=metadata, + ) + + # Done; return the response. + return response + + def delete_unary( + self, + request: Optional[Union[compute.DeleteInstantSnapshotRequest, dict]] = None, + *, + project: Optional[str] = None, + zone: Optional[str] = None, + instant_snapshot: Optional[str] = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, str]] = (), + ) -> compute.Operation: + r"""Deletes the specified InstantSnapshot resource. Keep + in mind that deleting a single instantSnapshot might not + necessarily delete all the data on that instantSnapshot. + If any data on the instantSnapshot that is marked for + deletion is needed for subsequent instantSnapshots, the + data will be moved to the next corresponding + instantSnapshot. For more information, see Deleting + instantSnapshots. + + .. 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.InstantSnapshotsClient() + + # Initialize request argument(s) + request = compute_v1.DeleteInstantSnapshotRequest( + instant_snapshot="instant_snapshot_value", + project="project_value", + zone="zone_value", + ) + + # Make the request + response = client.delete(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.compute_v1.types.DeleteInstantSnapshotRequest, dict]): + The request object. A request message for + InstantSnapshots.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. + 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. + instant_snapshot (str): + Name of the InstantSnapshot resource + to delete. + + This corresponds to the ``instant_snapshot`` 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, str]]): Strings which should be + sent along with the request as metadata. + + 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. + has_flattened_params = any([project, zone, instant_snapshot]) + 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." + ) + + # Minor optimization to avoid making a copy if the user passes + # in a compute.DeleteInstantSnapshotRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance(request, compute.DeleteInstantSnapshotRequest): + request = compute.DeleteInstantSnapshotRequest(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 instant_snapshot is not None: + request.instant_snapshot = instant_snapshot + + # 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), + ("zone", request.zone), + ("instant_snapshot", request.instant_snapshot), + ) + ), + ) + + # 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.DeleteInstantSnapshotRequest, dict]] = None, + *, + project: Optional[str] = None, + zone: Optional[str] = None, + instant_snapshot: Optional[str] = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, str]] = (), + ) -> extended_operation.ExtendedOperation: + r"""Deletes the specified InstantSnapshot resource. Keep + in mind that deleting a single instantSnapshot might not + necessarily delete all the data on that instantSnapshot. + If any data on the instantSnapshot that is marked for + deletion is needed for subsequent instantSnapshots, the + data will be moved to the next corresponding + instantSnapshot. For more information, see Deleting + instantSnapshots. + + .. 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.InstantSnapshotsClient() + + # Initialize request argument(s) + request = compute_v1.DeleteInstantSnapshotRequest( + instant_snapshot="instant_snapshot_value", + project="project_value", + zone="zone_value", + ) + + # Make the request + response = client.delete(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.compute_v1.types.DeleteInstantSnapshotRequest, dict]): + The request object. A request message for + InstantSnapshots.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. + 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. + instant_snapshot (str): + Name of the InstantSnapshot resource + to delete. + + This corresponds to the ``instant_snapshot`` 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, str]]): Strings which should be + sent along with the request as metadata. + + 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. + has_flattened_params = any([project, zone, instant_snapshot]) + 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." + ) + + # Minor optimization to avoid making a copy if the user passes + # in a compute.DeleteInstantSnapshotRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance(request, compute.DeleteInstantSnapshotRequest): + request = compute.DeleteInstantSnapshotRequest(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 instant_snapshot is not None: + request.instant_snapshot = instant_snapshot + + # 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), + ("zone", request.zone), + ("instant_snapshot", request.instant_snapshot), + ) + ), + ) + + # 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 get( + self, + request: Optional[Union[compute.GetInstantSnapshotRequest, dict]] = None, + *, + project: Optional[str] = None, + zone: Optional[str] = None, + instant_snapshot: Optional[str] = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, str]] = (), + ) -> compute.InstantSnapshot: + r"""Returns the specified InstantSnapshot resource in the + specified zone. + + .. 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.InstantSnapshotsClient() + + # Initialize request argument(s) + request = compute_v1.GetInstantSnapshotRequest( + instant_snapshot="instant_snapshot_value", + project="project_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.GetInstantSnapshotRequest, dict]): + The request object. A request message for + InstantSnapshots.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): + 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. + instant_snapshot (str): + Name of the InstantSnapshot resource + to return. + + This corresponds to the ``instant_snapshot`` 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, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.compute_v1.types.InstantSnapshot: + Represents a InstantSnapshot + resource. You can use instant snapshots + to create disk rollback points quickly.. + + """ + # 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. + has_flattened_params = any([project, zone, instant_snapshot]) + 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." + ) + + # Minor optimization to avoid making a copy if the user passes + # in a compute.GetInstantSnapshotRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance(request, compute.GetInstantSnapshotRequest): + request = compute.GetInstantSnapshotRequest(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 instant_snapshot is not None: + request.instant_snapshot = instant_snapshot + + # 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), + ("instant_snapshot", request.instant_snapshot), + ) + ), + ) + + # 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.GetIamPolicyInstantSnapshotRequest, dict] + ] = None, + *, + project: Optional[str] = None, + zone: 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, str]] = (), + ) -> 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.InstantSnapshotsClient() + + # Initialize request argument(s) + request = compute_v1.GetIamPolicyInstantSnapshotRequest( + project="project_value", + resource="resource_value", + zone="zone_value", + ) + + # Make the request + response = client.get_iam_policy(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.compute_v1.types.GetIamPolicyInstantSnapshotRequest, dict]): + The request object. A request message for + InstantSnapshots.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. + 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. + 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, str]]): Strings which should be + sent along with the request as metadata. + + 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. + has_flattened_params = any([project, zone, resource]) + 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." + ) + + # Minor optimization to avoid making a copy if the user passes + # in a compute.GetIamPolicyInstantSnapshotRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance(request, compute.GetIamPolicyInstantSnapshotRequest): + request = compute.GetIamPolicyInstantSnapshotRequest(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 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), + ("zone", request.zone), + ("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 insert_unary( + self, + request: Optional[Union[compute.InsertInstantSnapshotRequest, dict]] = None, + *, + project: Optional[str] = None, + zone: Optional[str] = None, + instant_snapshot_resource: Optional[compute.InstantSnapshot] = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, str]] = (), + ) -> compute.Operation: + r"""Creates an instant snapshot in the specified zone. + + .. 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.InstantSnapshotsClient() + + # Initialize request argument(s) + request = compute_v1.InsertInstantSnapshotRequest( + project="project_value", + zone="zone_value", + ) + + # Make the request + response = client.insert(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.compute_v1.types.InsertInstantSnapshotRequest, dict]): + The request object. A request message for + InstantSnapshots.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. + zone (str): + 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. + instant_snapshot_resource (google.cloud.compute_v1.types.InstantSnapshot): + The body resource for this request + This corresponds to the ``instant_snapshot_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, str]]): Strings which should be + sent along with the request as metadata. + + 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. + has_flattened_params = any([project, zone, instant_snapshot_resource]) + 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." + ) + + # Minor optimization to avoid making a copy if the user passes + # in a compute.InsertInstantSnapshotRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance(request, compute.InsertInstantSnapshotRequest): + request = compute.InsertInstantSnapshotRequest(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 instant_snapshot_resource is not None: + request.instant_snapshot_resource = instant_snapshot_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), + ("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 insert( + self, + request: Optional[Union[compute.InsertInstantSnapshotRequest, dict]] = None, + *, + project: Optional[str] = None, + zone: Optional[str] = None, + instant_snapshot_resource: Optional[compute.InstantSnapshot] = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, str]] = (), + ) -> extended_operation.ExtendedOperation: + r"""Creates an instant snapshot in the specified zone. + + .. 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.InstantSnapshotsClient() + + # Initialize request argument(s) + request = compute_v1.InsertInstantSnapshotRequest( + project="project_value", + zone="zone_value", + ) + + # Make the request + response = client.insert(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.compute_v1.types.InsertInstantSnapshotRequest, dict]): + The request object. A request message for + InstantSnapshots.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. + zone (str): + 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. + instant_snapshot_resource (google.cloud.compute_v1.types.InstantSnapshot): + The body resource for this request + This corresponds to the ``instant_snapshot_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, str]]): Strings which should be + sent along with the request as metadata. + + 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. + has_flattened_params = any([project, zone, instant_snapshot_resource]) + 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." + ) + + # Minor optimization to avoid making a copy if the user passes + # in a compute.InsertInstantSnapshotRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance(request, compute.InsertInstantSnapshotRequest): + request = compute.InsertInstantSnapshotRequest(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 instant_snapshot_resource is not None: + request.instant_snapshot_resource = instant_snapshot_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), + ("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 list( + self, + request: Optional[Union[compute.ListInstantSnapshotsRequest, dict]] = None, + *, + project: Optional[str] = None, + zone: Optional[str] = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, str]] = (), + ) -> pagers.ListPager: + r"""Retrieves the list of InstantSnapshot resources + contained within the specified zone. + + .. 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.InstantSnapshotsClient() + + # Initialize request argument(s) + request = compute_v1.ListInstantSnapshotsRequest( + 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.ListInstantSnapshotsRequest, dict]): + The request object. A request message for + InstantSnapshots.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): + 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. + 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, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.compute_v1.services.instant_snapshots.pagers.ListPager: + Contains a list of InstantSnapshot + resources. + 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. + has_flattened_params = any([project, zone]) + 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." + ) + + # Minor optimization to avoid making a copy if the user passes + # in a compute.ListInstantSnapshotsRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance(request, compute.ListInstantSnapshotsRequest): + request = compute.ListInstantSnapshotsRequest(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 + + # 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), + ) + ), + ) + + # 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, + metadata=metadata, + ) + + # Done; return the response. + return response + + def set_iam_policy( + self, + request: Optional[ + Union[compute.SetIamPolicyInstantSnapshotRequest, dict] + ] = None, + *, + project: Optional[str] = None, + zone: Optional[str] = None, + resource: Optional[str] = None, + zone_set_policy_request_resource: Optional[compute.ZoneSetPolicyRequest] = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, str]] = (), + ) -> 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.InstantSnapshotsClient() + + # Initialize request argument(s) + request = compute_v1.SetIamPolicyInstantSnapshotRequest( + project="project_value", + resource="resource_value", + zone="zone_value", + ) + + # Make the request + response = client.set_iam_policy(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.compute_v1.types.SetIamPolicyInstantSnapshotRequest, dict]): + The request object. A request message for + InstantSnapshots.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. + 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. + 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. + zone_set_policy_request_resource (google.cloud.compute_v1.types.ZoneSetPolicyRequest): + The body resource for this request + This corresponds to the ``zone_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, str]]): Strings which should be + sent along with the request as metadata. + + 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. + has_flattened_params = any( + [project, zone, resource, zone_set_policy_request_resource] + ) + 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." + ) + + # Minor optimization to avoid making a copy if the user passes + # in a compute.SetIamPolicyInstantSnapshotRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance(request, compute.SetIamPolicyInstantSnapshotRequest): + request = compute.SetIamPolicyInstantSnapshotRequest(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 resource is not None: + request.resource = resource + if zone_set_policy_request_resource is not None: + request.zone_set_policy_request_resource = ( + zone_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), + ("zone", request.zone), + ("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 set_labels_unary( + self, + request: Optional[Union[compute.SetLabelsInstantSnapshotRequest, dict]] = None, + *, + project: Optional[str] = None, + zone: Optional[str] = None, + resource: Optional[str] = None, + zone_set_labels_request_resource: Optional[compute.ZoneSetLabelsRequest] = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, str]] = (), + ) -> compute.Operation: + r"""Sets the labels on a instantSnapshot in the given + zone. 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_set_labels(): + # Create a client + client = compute_v1.InstantSnapshotsClient() + + # Initialize request argument(s) + request = compute_v1.SetLabelsInstantSnapshotRequest( + project="project_value", + resource="resource_value", + zone="zone_value", + ) + + # Make the request + response = client.set_labels(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.compute_v1.types.SetLabelsInstantSnapshotRequest, dict]): + The request object. A request message for + InstantSnapshots.SetLabels. 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. + 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. + zone_set_labels_request_resource (google.cloud.compute_v1.types.ZoneSetLabelsRequest): + The body resource for this request + This corresponds to the ``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, str]]): Strings which should be + sent along with the request as metadata. + + 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. + has_flattened_params = any( + [project, zone, resource, zone_set_labels_request_resource] + ) + 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." + ) + + # Minor optimization to avoid making a copy if the user passes + # in a compute.SetLabelsInstantSnapshotRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance(request, compute.SetLabelsInstantSnapshotRequest): + request = compute.SetLabelsInstantSnapshotRequest(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 resource is not None: + request.resource = resource + if zone_set_labels_request_resource is not None: + request.zone_set_labels_request_resource = ( + 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.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), + ("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 set_labels( + self, + request: Optional[Union[compute.SetLabelsInstantSnapshotRequest, dict]] = None, + *, + project: Optional[str] = None, + zone: Optional[str] = None, + resource: Optional[str] = None, + zone_set_labels_request_resource: Optional[compute.ZoneSetLabelsRequest] = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, str]] = (), + ) -> extended_operation.ExtendedOperation: + r"""Sets the labels on a instantSnapshot in the given + zone. 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_set_labels(): + # Create a client + client = compute_v1.InstantSnapshotsClient() + + # Initialize request argument(s) + request = compute_v1.SetLabelsInstantSnapshotRequest( + project="project_value", + resource="resource_value", + zone="zone_value", + ) + + # Make the request + response = client.set_labels(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.compute_v1.types.SetLabelsInstantSnapshotRequest, dict]): + The request object. A request message for + InstantSnapshots.SetLabels. 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. + 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. + zone_set_labels_request_resource (google.cloud.compute_v1.types.ZoneSetLabelsRequest): + The body resource for this request + This corresponds to the ``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, str]]): Strings which should be + sent along with the request as metadata. + + 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. + has_flattened_params = any( + [project, zone, resource, zone_set_labels_request_resource] + ) + 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." + ) + + # Minor optimization to avoid making a copy if the user passes + # in a compute.SetLabelsInstantSnapshotRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance(request, compute.SetLabelsInstantSnapshotRequest): + request = compute.SetLabelsInstantSnapshotRequest(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 resource is not None: + request.resource = resource + if zone_set_labels_request_resource is not None: + request.zone_set_labels_request_resource = ( + 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.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), + ("resource", request.resource), + ) + ), + ) + + # 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 test_iam_permissions( + self, + request: Optional[ + Union[compute.TestIamPermissionsInstantSnapshotRequest, dict] + ] = None, + *, + project: Optional[str] = None, + zone: 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, str]] = (), + ) -> 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.InstantSnapshotsClient() + + # Initialize request argument(s) + request = compute_v1.TestIamPermissionsInstantSnapshotRequest( + project="project_value", + resource="resource_value", + zone="zone_value", + ) + + # Make the request + response = client.test_iam_permissions(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.compute_v1.types.TestIamPermissionsInstantSnapshotRequest, dict]): + The request object. A request message for + InstantSnapshots.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. + 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. + 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, str]]): Strings which should be + sent along with the request as metadata. + + 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. + has_flattened_params = any( + [project, zone, resource, test_permissions_request_resource] + ) + 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." + ) + + # Minor optimization to avoid making a copy if the user passes + # in a compute.TestIamPermissionsInstantSnapshotRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance(request, compute.TestIamPermissionsInstantSnapshotRequest): + request = compute.TestIamPermissionsInstantSnapshotRequest(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 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), + ("zone", request.zone), + ("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) -> "InstantSnapshotsClient": + 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__ +) + + +__all__ = ("InstantSnapshotsClient",) diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/instant_snapshots/pagers.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/instant_snapshots/pagers.py new file mode 100644 index 000000000000..025459ae0acc --- /dev/null +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/instant_snapshots/pagers.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 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, +) + +from google.cloud.compute_v1.types import compute + + +class AggregatedListPager: + """A pager for iterating through ``aggregated_list`` requests. + + This class thinly wraps an initial + :class:`google.cloud.compute_v1.types.InstantSnapshotAggregatedList` object, and + provides an ``__iter__`` method to iterate through its + ``items`` field. + + If there are more pages, the ``__iter__`` method will make additional + ``AggregatedList`` requests and continue to iterate + through the ``items`` field on the + corresponding responses. + + All the usual :class:`google.cloud.compute_v1.types.InstantSnapshotAggregatedList` + 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.InstantSnapshotAggregatedList], + request: compute.AggregatedListInstantSnapshotsRequest, + response: compute.InstantSnapshotAggregatedList, + *, + metadata: Sequence[Tuple[str, str]] = () + ): + """Instantiate the pager. + + Args: + method (Callable): The method that was originally called, and + which instantiated this pager. + request (google.cloud.compute_v1.types.AggregatedListInstantSnapshotsRequest): + The initial request object. + response (google.cloud.compute_v1.types.InstantSnapshotAggregatedList): + The initial response object. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + """ + self._method = method + self._request = compute.AggregatedListInstantSnapshotsRequest(request) + self._response = response + self._metadata = metadata + + def __getattr__(self, name: str) -> Any: + return getattr(self._response, name) + + @property + def pages(self) -> Iterator[compute.InstantSnapshotAggregatedList]: + yield self._response + while self._response.next_page_token: + self._request.page_token = self._response.next_page_token + self._response = self._method(self._request, metadata=self._metadata) + yield self._response + + def __iter__(self) -> Iterator[Tuple[str, compute.InstantSnapshotsScopedList]]: + for page in self.pages: + yield from page.items.items() + + def get(self, key: str) -> Optional[compute.InstantSnapshotsScopedList]: + return self._response.items.get(key) + + def __repr__(self) -> str: + return "{0}<{1!r}>".format(self.__class__.__name__, self._response) + + +class ListPager: + """A pager for iterating through ``list`` requests. + + This class thinly wraps an initial + :class:`google.cloud.compute_v1.types.InstantSnapshotList` 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.InstantSnapshotList` + 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.InstantSnapshotList], + request: compute.ListInstantSnapshotsRequest, + response: compute.InstantSnapshotList, + *, + metadata: Sequence[Tuple[str, str]] = () + ): + """Instantiate the pager. + + Args: + method (Callable): The method that was originally called, and + which instantiated this pager. + request (google.cloud.compute_v1.types.ListInstantSnapshotsRequest): + The initial request object. + response (google.cloud.compute_v1.types.InstantSnapshotList): + The initial response object. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + """ + self._method = method + self._request = compute.ListInstantSnapshotsRequest(request) + self._response = response + self._metadata = metadata + + def __getattr__(self, name: str) -> Any: + return getattr(self._response, name) + + @property + def pages(self) -> Iterator[compute.InstantSnapshotList]: + yield self._response + while self._response.next_page_token: + self._request.page_token = self._response.next_page_token + self._response = self._method(self._request, metadata=self._metadata) + yield self._response + + def __iter__(self) -> Iterator[compute.InstantSnapshot]: + 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/instant_snapshots/transports/__init__.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/instant_snapshots/transports/__init__.py new file mode 100644 index 000000000000..9e7b836b2fd7 --- /dev/null +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/instant_snapshots/transports/__init__.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 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 InstantSnapshotsTransport +from .rest import InstantSnapshotsRestInterceptor, InstantSnapshotsRestTransport + +# Compile a registry of transports. +_transport_registry = OrderedDict() # type: Dict[str, Type[InstantSnapshotsTransport]] +_transport_registry["rest"] = InstantSnapshotsRestTransport + +__all__ = ( + "InstantSnapshotsTransport", + "InstantSnapshotsRestTransport", + "InstantSnapshotsRestInterceptor", +) diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/instant_snapshots/transports/base.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/instant_snapshots/transports/base.py new file mode 100644 index 000000000000..db901869fbab --- /dev/null +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/instant_snapshots/transports/base.py @@ -0,0 +1,293 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 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 + +from google.cloud.compute_v1 import gapic_version as package_version +from google.cloud.compute_v1.services import zone_operations +from google.cloud.compute_v1.types import compute + +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) + + +class InstantSnapshotsTransport(abc.ABC): + """Abstract transport class for InstantSnapshots.""" + + 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 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: + 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.aggregated_list: gapic_v1.method.wrap_method( + self.aggregated_list, + 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.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.set_iam_policy: gapic_v1.method.wrap_method( + self.set_iam_policy, + default_timeout=None, + client_info=client_info, + ), + self.set_labels: gapic_v1.method.wrap_method( + self.set_labels, + 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 aggregated_list( + self, + ) -> Callable[ + [compute.AggregatedListInstantSnapshotsRequest], + Union[ + compute.InstantSnapshotAggregatedList, + Awaitable[compute.InstantSnapshotAggregatedList], + ], + ]: + raise NotImplementedError() + + @property + def delete( + self, + ) -> Callable[ + [compute.DeleteInstantSnapshotRequest], + Union[compute.Operation, Awaitable[compute.Operation]], + ]: + raise NotImplementedError() + + @property + def get( + self, + ) -> Callable[ + [compute.GetInstantSnapshotRequest], + Union[compute.InstantSnapshot, Awaitable[compute.InstantSnapshot]], + ]: + raise NotImplementedError() + + @property + def get_iam_policy( + self, + ) -> Callable[ + [compute.GetIamPolicyInstantSnapshotRequest], + Union[compute.Policy, Awaitable[compute.Policy]], + ]: + raise NotImplementedError() + + @property + def insert( + self, + ) -> Callable[ + [compute.InsertInstantSnapshotRequest], + Union[compute.Operation, Awaitable[compute.Operation]], + ]: + raise NotImplementedError() + + @property + def list( + self, + ) -> Callable[ + [compute.ListInstantSnapshotsRequest], + Union[compute.InstantSnapshotList, Awaitable[compute.InstantSnapshotList]], + ]: + raise NotImplementedError() + + @property + def set_iam_policy( + self, + ) -> Callable[ + [compute.SetIamPolicyInstantSnapshotRequest], + Union[compute.Policy, Awaitable[compute.Policy]], + ]: + raise NotImplementedError() + + @property + def set_labels( + self, + ) -> Callable[ + [compute.SetLabelsInstantSnapshotRequest], + Union[compute.Operation, Awaitable[compute.Operation]], + ]: + raise NotImplementedError() + + @property + def test_iam_permissions( + self, + ) -> Callable[ + [compute.TestIamPermissionsInstantSnapshotRequest], + Union[ + compute.TestPermissionsResponse, Awaitable[compute.TestPermissionsResponse] + ], + ]: + raise NotImplementedError() + + @property + def kind(self) -> str: + raise NotImplementedError() + + @property + def _zone_operations_client(self) -> zone_operations.ZoneOperationsClient: + ex_op_service = self._extended_operations_services.get("zone_operations") + if not ex_op_service: + ex_op_service = zone_operations.ZoneOperationsClient( + credentials=self._credentials, + transport=self.kind, + ) + self._extended_operations_services["zone_operations"] = ex_op_service + + return ex_op_service + + +__all__ = ("InstantSnapshotsTransport",) diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/instant_snapshots/transports/rest.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/instant_snapshots/transports/rest.py new file mode 100644 index 000000000000..c7a8242608ba --- /dev/null +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/instant_snapshots/transports/rest.py @@ -0,0 +1,1430 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 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 re +from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple, Union +import warnings + +from google.api_core import gapic_v1, path_template, rest_helpers, rest_streaming +from google.api_core import exceptions as core_exceptions +from google.api_core import retry as retries +from google.auth import credentials as ga_credentials # type: ignore +from google.auth.transport.grpc import SslCredentials # type: ignore +from google.auth.transport.requests import AuthorizedSession # type: ignore +from google.protobuf import json_format +import grpc # type: ignore +from requests import __version__ as requests_version + +try: + OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault, None] +except AttributeError: # pragma: NO COVER + OptionalRetry = Union[retries.Retry, object, None] # type: ignore + + +from google.cloud.compute_v1.types import compute + +from .base import DEFAULT_CLIENT_INFO as BASE_DEFAULT_CLIENT_INFO +from .base import InstantSnapshotsTransport + +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=BASE_DEFAULT_CLIENT_INFO.gapic_version, + grpc_version=None, + rest_version=requests_version, +) + + +class InstantSnapshotsRestInterceptor: + """Interceptor for InstantSnapshots. + + 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 InstantSnapshotsRestTransport. + + .. code-block:: python + class MyCustomInstantSnapshotsInterceptor(InstantSnapshotsRestInterceptor): + def pre_aggregated_list(self, request, metadata): + logging.log(f"Received request: {request}") + return request, metadata + + def post_aggregated_list(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_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_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_set_labels(self, request, metadata): + logging.log(f"Received request: {request}") + return request, metadata + + def post_set_labels(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 = InstantSnapshotsRestTransport(interceptor=MyCustomInstantSnapshotsInterceptor()) + client = InstantSnapshotsClient(transport=transport) + + + """ + + def pre_aggregated_list( + self, + request: compute.AggregatedListInstantSnapshotsRequest, + metadata: Sequence[Tuple[str, str]], + ) -> Tuple[ + compute.AggregatedListInstantSnapshotsRequest, Sequence[Tuple[str, str]] + ]: + """Pre-rpc interceptor for aggregated_list + + Override in a subclass to manipulate the request or metadata + before they are sent to the InstantSnapshots server. + """ + return request, metadata + + def post_aggregated_list( + self, response: compute.InstantSnapshotAggregatedList + ) -> compute.InstantSnapshotAggregatedList: + """Post-rpc interceptor for aggregated_list + + Override in a subclass to manipulate the response + after it is returned by the InstantSnapshots server but before + it is returned to user code. + """ + return response + + def pre_delete( + self, + request: compute.DeleteInstantSnapshotRequest, + metadata: Sequence[Tuple[str, str]], + ) -> Tuple[compute.DeleteInstantSnapshotRequest, Sequence[Tuple[str, str]]]: + """Pre-rpc interceptor for delete + + Override in a subclass to manipulate the request or metadata + before they are sent to the InstantSnapshots server. + """ + return request, metadata + + def post_delete(self, response: compute.Operation) -> compute.Operation: + """Post-rpc interceptor for delete + + Override in a subclass to manipulate the response + after it is returned by the InstantSnapshots server but before + it is returned to user code. + """ + return response + + def pre_get( + self, + request: compute.GetInstantSnapshotRequest, + metadata: Sequence[Tuple[str, str]], + ) -> Tuple[compute.GetInstantSnapshotRequest, Sequence[Tuple[str, str]]]: + """Pre-rpc interceptor for get + + Override in a subclass to manipulate the request or metadata + before they are sent to the InstantSnapshots server. + """ + return request, metadata + + def post_get(self, response: compute.InstantSnapshot) -> compute.InstantSnapshot: + """Post-rpc interceptor for get + + Override in a subclass to manipulate the response + after it is returned by the InstantSnapshots server but before + it is returned to user code. + """ + return response + + def pre_get_iam_policy( + self, + request: compute.GetIamPolicyInstantSnapshotRequest, + metadata: Sequence[Tuple[str, str]], + ) -> Tuple[compute.GetIamPolicyInstantSnapshotRequest, Sequence[Tuple[str, str]]]: + """Pre-rpc interceptor for get_iam_policy + + Override in a subclass to manipulate the request or metadata + before they are sent to the InstantSnapshots server. + """ + return request, metadata + + def post_get_iam_policy(self, response: compute.Policy) -> compute.Policy: + """Post-rpc interceptor for get_iam_policy + + Override in a subclass to manipulate the response + after it is returned by the InstantSnapshots server but before + it is returned to user code. + """ + return response + + def pre_insert( + self, + request: compute.InsertInstantSnapshotRequest, + metadata: Sequence[Tuple[str, str]], + ) -> Tuple[compute.InsertInstantSnapshotRequest, Sequence[Tuple[str, str]]]: + """Pre-rpc interceptor for insert + + Override in a subclass to manipulate the request or metadata + before they are sent to the InstantSnapshots server. + """ + return request, metadata + + def post_insert(self, response: compute.Operation) -> compute.Operation: + """Post-rpc interceptor for insert + + Override in a subclass to manipulate the response + after it is returned by the InstantSnapshots server but before + it is returned to user code. + """ + return response + + def pre_list( + self, + request: compute.ListInstantSnapshotsRequest, + metadata: Sequence[Tuple[str, str]], + ) -> Tuple[compute.ListInstantSnapshotsRequest, Sequence[Tuple[str, str]]]: + """Pre-rpc interceptor for list + + Override in a subclass to manipulate the request or metadata + before they are sent to the InstantSnapshots server. + """ + return request, metadata + + def post_list( + self, response: compute.InstantSnapshotList + ) -> compute.InstantSnapshotList: + """Post-rpc interceptor for list + + Override in a subclass to manipulate the response + after it is returned by the InstantSnapshots server but before + it is returned to user code. + """ + return response + + def pre_set_iam_policy( + self, + request: compute.SetIamPolicyInstantSnapshotRequest, + metadata: Sequence[Tuple[str, str]], + ) -> Tuple[compute.SetIamPolicyInstantSnapshotRequest, Sequence[Tuple[str, str]]]: + """Pre-rpc interceptor for set_iam_policy + + Override in a subclass to manipulate the request or metadata + before they are sent to the InstantSnapshots server. + """ + return request, metadata + + def post_set_iam_policy(self, response: compute.Policy) -> compute.Policy: + """Post-rpc interceptor for set_iam_policy + + Override in a subclass to manipulate the response + after it is returned by the InstantSnapshots server but before + it is returned to user code. + """ + return response + + def pre_set_labels( + self, + request: compute.SetLabelsInstantSnapshotRequest, + metadata: Sequence[Tuple[str, str]], + ) -> Tuple[compute.SetLabelsInstantSnapshotRequest, Sequence[Tuple[str, str]]]: + """Pre-rpc interceptor for set_labels + + Override in a subclass to manipulate the request or metadata + before they are sent to the InstantSnapshots server. + """ + return request, metadata + + def post_set_labels(self, response: compute.Operation) -> compute.Operation: + """Post-rpc interceptor for set_labels + + Override in a subclass to manipulate the response + after it is returned by the InstantSnapshots server but before + it is returned to user code. + """ + return response + + def pre_test_iam_permissions( + self, + request: compute.TestIamPermissionsInstantSnapshotRequest, + metadata: Sequence[Tuple[str, str]], + ) -> Tuple[ + compute.TestIamPermissionsInstantSnapshotRequest, Sequence[Tuple[str, str]] + ]: + """Pre-rpc interceptor for test_iam_permissions + + Override in a subclass to manipulate the request or metadata + before they are sent to the InstantSnapshots server. + """ + return request, metadata + + def post_test_iam_permissions( + self, response: compute.TestPermissionsResponse + ) -> compute.TestPermissionsResponse: + """Post-rpc interceptor for test_iam_permissions + + Override in a subclass to manipulate the response + after it is returned by the InstantSnapshots server but before + it is returned to user code. + """ + return response + + +@dataclasses.dataclass +class InstantSnapshotsRestStub: + _session: AuthorizedSession + _host: str + _interceptor: InstantSnapshotsRestInterceptor + + +class InstantSnapshotsRestTransport(InstantSnapshotsTransport): + """REST backend transport for InstantSnapshots. + + The InstantSnapshots 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 + + NOTE: This REST transport functionality is currently in a beta + state (preview). We welcome your feedback via an issue in this + library's source repository. Thank you! + """ + + 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[InstantSnapshotsRestInterceptor] = 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 + 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, + ) + 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 InstantSnapshotsRestInterceptor() + self._prep_wrapped_messages(client_info) + + class _AggregatedList(InstantSnapshotsRestStub): + def __hash__(self): + return hash("AggregatedList") + + __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 + } + + def __call__( + self, + request: compute.AggregatedListInstantSnapshotsRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> compute.InstantSnapshotAggregatedList: + r"""Call the aggregated list method over HTTP. + + Args: + request (~.compute.AggregatedListInstantSnapshotsRequest): + The request object. A request message for + InstantSnapshots.AggregatedList. 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, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + ~.compute.InstantSnapshotAggregatedList: + + """ + + http_options: List[Dict[str, str]] = [ + { + "method": "get", + "uri": "/compute/v1/projects/{project}/aggregated/instantSnapshots", + }, + ] + request, metadata = self._interceptor.pre_aggregated_list(request, metadata) + pb_request = compute.AggregatedListInstantSnapshotsRequest.pb(request) + transcoded_request = path_template.transcode(http_options, pb_request) + + uri = transcoded_request["uri"] + method = transcoded_request["method"] + + # Jsonify the query params + query_params = json.loads( + json_format.MessageToJson( + transcoded_request["query_params"], + use_integers_for_enums=False, + ) + ) + query_params.update(self._get_unset_required_fields(query_params)) + + # Send the request + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = getattr(self._session, method)( + "{host}{uri}".format(host=self._host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + ) + + # 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.InstantSnapshotAggregatedList() + pb_resp = compute.InstantSnapshotAggregatedList.pb(resp) + + json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True) + resp = self._interceptor.post_aggregated_list(resp) + return resp + + class _Delete(InstantSnapshotsRestStub): + def __hash__(self): + return hash("Delete") + + __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 + } + + def __call__( + self, + request: compute.DeleteInstantSnapshotRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> compute.Operation: + r"""Call the delete method over HTTP. + + Args: + request (~.compute.DeleteInstantSnapshotRequest): + The request object. A request message for + InstantSnapshots.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, str]]): Strings which should be + sent along with the request as metadata. + + 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: List[Dict[str, str]] = [ + { + "method": "delete", + "uri": "/compute/v1/projects/{project}/zones/{zone}/instantSnapshots/{instant_snapshot}", + }, + ] + request, metadata = self._interceptor.pre_delete(request, metadata) + pb_request = compute.DeleteInstantSnapshotRequest.pb(request) + transcoded_request = path_template.transcode(http_options, pb_request) + + uri = transcoded_request["uri"] + method = transcoded_request["method"] + + # Jsonify the query params + query_params = json.loads( + json_format.MessageToJson( + transcoded_request["query_params"], + use_integers_for_enums=False, + ) + ) + query_params.update(self._get_unset_required_fields(query_params)) + + # Send the request + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = getattr(self._session, method)( + "{host}{uri}".format(host=self._host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + ) + + # 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) + return resp + + class _Get(InstantSnapshotsRestStub): + def __hash__(self): + return hash("Get") + + __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 + } + + def __call__( + self, + request: compute.GetInstantSnapshotRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> compute.InstantSnapshot: + r"""Call the get method over HTTP. + + Args: + request (~.compute.GetInstantSnapshotRequest): + The request object. A request message for + InstantSnapshots.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, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + ~.compute.InstantSnapshot: + Represents a InstantSnapshot + resource. You can use instant snapshots + to create disk rollback points quickly.. + + """ + + http_options: List[Dict[str, str]] = [ + { + "method": "get", + "uri": "/compute/v1/projects/{project}/zones/{zone}/instantSnapshots/{instant_snapshot}", + }, + ] + request, metadata = self._interceptor.pre_get(request, metadata) + pb_request = compute.GetInstantSnapshotRequest.pb(request) + transcoded_request = path_template.transcode(http_options, pb_request) + + uri = transcoded_request["uri"] + method = transcoded_request["method"] + + # Jsonify the query params + query_params = json.loads( + json_format.MessageToJson( + transcoded_request["query_params"], + use_integers_for_enums=False, + ) + ) + query_params.update(self._get_unset_required_fields(query_params)) + + # Send the request + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = getattr(self._session, method)( + "{host}{uri}".format(host=self._host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + ) + + # 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.InstantSnapshot() + pb_resp = compute.InstantSnapshot.pb(resp) + + json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True) + resp = self._interceptor.post_get(resp) + return resp + + class _GetIamPolicy(InstantSnapshotsRestStub): + def __hash__(self): + return hash("GetIamPolicy") + + __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 + } + + def __call__( + self, + request: compute.GetIamPolicyInstantSnapshotRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> compute.Policy: + r"""Call the get iam policy method over HTTP. + + Args: + request (~.compute.GetIamPolicyInstantSnapshotRequest): + The request object. A request message for + InstantSnapshots.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, str]]): Strings which should be + sent along with the request as metadata. + + 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: List[Dict[str, str]] = [ + { + "method": "get", + "uri": "/compute/v1/projects/{project}/zones/{zone}/instantSnapshots/{resource}/getIamPolicy", + }, + ] + request, metadata = self._interceptor.pre_get_iam_policy(request, metadata) + pb_request = compute.GetIamPolicyInstantSnapshotRequest.pb(request) + transcoded_request = path_template.transcode(http_options, pb_request) + + uri = transcoded_request["uri"] + method = transcoded_request["method"] + + # Jsonify the query params + query_params = json.loads( + json_format.MessageToJson( + transcoded_request["query_params"], + use_integers_for_enums=False, + ) + ) + query_params.update(self._get_unset_required_fields(query_params)) + + # Send the request + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = getattr(self._session, method)( + "{host}{uri}".format(host=self._host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + ) + + # 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) + return resp + + class _Insert(InstantSnapshotsRestStub): + def __hash__(self): + return hash("Insert") + + __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 + } + + def __call__( + self, + request: compute.InsertInstantSnapshotRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> compute.Operation: + r"""Call the insert method over HTTP. + + Args: + request (~.compute.InsertInstantSnapshotRequest): + The request object. A request message for + InstantSnapshots.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, str]]): Strings which should be + sent along with the request as metadata. + + 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: List[Dict[str, str]] = [ + { + "method": "post", + "uri": "/compute/v1/projects/{project}/zones/{zone}/instantSnapshots", + "body": "instant_snapshot_resource", + }, + ] + request, metadata = self._interceptor.pre_insert(request, metadata) + pb_request = compute.InsertInstantSnapshotRequest.pb(request) + transcoded_request = path_template.transcode(http_options, pb_request) + + # Jsonify the request body + + body = json_format.MessageToJson( + transcoded_request["body"], use_integers_for_enums=False + ) + uri = transcoded_request["uri"] + method = transcoded_request["method"] + + # Jsonify the query params + query_params = json.loads( + json_format.MessageToJson( + transcoded_request["query_params"], + use_integers_for_enums=False, + ) + ) + query_params.update(self._get_unset_required_fields(query_params)) + + # Send the request + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = getattr(self._session, method)( + "{host}{uri}".format(host=self._host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + data=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) + return resp + + class _List(InstantSnapshotsRestStub): + def __hash__(self): + return hash("List") + + __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 + } + + def __call__( + self, + request: compute.ListInstantSnapshotsRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> compute.InstantSnapshotList: + r"""Call the list method over HTTP. + + Args: + request (~.compute.ListInstantSnapshotsRequest): + The request object. A request message for + InstantSnapshots.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, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + ~.compute.InstantSnapshotList: + Contains a list of InstantSnapshot + resources. + + """ + + http_options: List[Dict[str, str]] = [ + { + "method": "get", + "uri": "/compute/v1/projects/{project}/zones/{zone}/instantSnapshots", + }, + ] + request, metadata = self._interceptor.pre_list(request, metadata) + pb_request = compute.ListInstantSnapshotsRequest.pb(request) + transcoded_request = path_template.transcode(http_options, pb_request) + + uri = transcoded_request["uri"] + method = transcoded_request["method"] + + # Jsonify the query params + query_params = json.loads( + json_format.MessageToJson( + transcoded_request["query_params"], + use_integers_for_enums=False, + ) + ) + query_params.update(self._get_unset_required_fields(query_params)) + + # Send the request + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = getattr(self._session, method)( + "{host}{uri}".format(host=self._host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + ) + + # 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.InstantSnapshotList() + pb_resp = compute.InstantSnapshotList.pb(resp) + + json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True) + resp = self._interceptor.post_list(resp) + return resp + + class _SetIamPolicy(InstantSnapshotsRestStub): + def __hash__(self): + return hash("SetIamPolicy") + + __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 + } + + def __call__( + self, + request: compute.SetIamPolicyInstantSnapshotRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> compute.Policy: + r"""Call the set iam policy method over HTTP. + + Args: + request (~.compute.SetIamPolicyInstantSnapshotRequest): + The request object. A request message for + InstantSnapshots.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, str]]): Strings which should be + sent along with the request as metadata. + + 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: List[Dict[str, str]] = [ + { + "method": "post", + "uri": "/compute/v1/projects/{project}/zones/{zone}/instantSnapshots/{resource}/setIamPolicy", + "body": "zone_set_policy_request_resource", + }, + ] + request, metadata = self._interceptor.pre_set_iam_policy(request, metadata) + pb_request = compute.SetIamPolicyInstantSnapshotRequest.pb(request) + transcoded_request = path_template.transcode(http_options, pb_request) + + # Jsonify the request body + + body = json_format.MessageToJson( + transcoded_request["body"], use_integers_for_enums=False + ) + uri = transcoded_request["uri"] + method = transcoded_request["method"] + + # Jsonify the query params + query_params = json.loads( + json_format.MessageToJson( + transcoded_request["query_params"], + use_integers_for_enums=False, + ) + ) + query_params.update(self._get_unset_required_fields(query_params)) + + # Send the request + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = getattr(self._session, method)( + "{host}{uri}".format(host=self._host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + data=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) + return resp + + class _SetLabels(InstantSnapshotsRestStub): + def __hash__(self): + return hash("SetLabels") + + __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 + } + + def __call__( + self, + request: compute.SetLabelsInstantSnapshotRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> compute.Operation: + r"""Call the set labels method over HTTP. + + Args: + request (~.compute.SetLabelsInstantSnapshotRequest): + The request object. A request message for + InstantSnapshots.SetLabels. 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, str]]): Strings which should be + sent along with the request as metadata. + + 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: List[Dict[str, str]] = [ + { + "method": "post", + "uri": "/compute/v1/projects/{project}/zones/{zone}/instantSnapshots/{resource}/setLabels", + "body": "zone_set_labels_request_resource", + }, + ] + request, metadata = self._interceptor.pre_set_labels(request, metadata) + pb_request = compute.SetLabelsInstantSnapshotRequest.pb(request) + transcoded_request = path_template.transcode(http_options, pb_request) + + # Jsonify the request body + + body = json_format.MessageToJson( + transcoded_request["body"], use_integers_for_enums=False + ) + uri = transcoded_request["uri"] + method = transcoded_request["method"] + + # Jsonify the query params + query_params = json.loads( + json_format.MessageToJson( + transcoded_request["query_params"], + use_integers_for_enums=False, + ) + ) + query_params.update(self._get_unset_required_fields(query_params)) + + # Send the request + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = getattr(self._session, method)( + "{host}{uri}".format(host=self._host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + data=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_set_labels(resp) + return resp + + class _TestIamPermissions(InstantSnapshotsRestStub): + def __hash__(self): + return hash("TestIamPermissions") + + __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 + } + + def __call__( + self, + request: compute.TestIamPermissionsInstantSnapshotRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> compute.TestPermissionsResponse: + r"""Call the test iam permissions method over HTTP. + + Args: + request (~.compute.TestIamPermissionsInstantSnapshotRequest): + The request object. A request message for + InstantSnapshots.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, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + ~.compute.TestPermissionsResponse: + + """ + + http_options: List[Dict[str, str]] = [ + { + "method": "post", + "uri": "/compute/v1/projects/{project}/zones/{zone}/instantSnapshots/{resource}/testIamPermissions", + "body": "test_permissions_request_resource", + }, + ] + request, metadata = self._interceptor.pre_test_iam_permissions( + request, metadata + ) + pb_request = compute.TestIamPermissionsInstantSnapshotRequest.pb(request) + transcoded_request = path_template.transcode(http_options, pb_request) + + # Jsonify the request body + + body = json_format.MessageToJson( + transcoded_request["body"], use_integers_for_enums=False + ) + uri = transcoded_request["uri"] + method = transcoded_request["method"] + + # Jsonify the query params + query_params = json.loads( + json_format.MessageToJson( + transcoded_request["query_params"], + use_integers_for_enums=False, + ) + ) + query_params.update(self._get_unset_required_fields(query_params)) + + # Send the request + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = getattr(self._session, method)( + "{host}{uri}".format(host=self._host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + data=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) + return resp + + @property + def aggregated_list( + self, + ) -> Callable[ + [compute.AggregatedListInstantSnapshotsRequest], + compute.InstantSnapshotAggregatedList, + ]: + # 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._AggregatedList(self._session, self._host, self._interceptor) # type: ignore + + @property + def delete( + self, + ) -> Callable[[compute.DeleteInstantSnapshotRequest], 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.GetInstantSnapshotRequest], compute.InstantSnapshot]: + # 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.GetIamPolicyInstantSnapshotRequest], 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 insert( + self, + ) -> Callable[[compute.InsertInstantSnapshotRequest], 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.ListInstantSnapshotsRequest], compute.InstantSnapshotList]: + # 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 set_iam_policy( + self, + ) -> Callable[[compute.SetIamPolicyInstantSnapshotRequest], 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 set_labels( + self, + ) -> Callable[[compute.SetLabelsInstantSnapshotRequest], 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._SetLabels(self._session, self._host, self._interceptor) # type: ignore + + @property + def test_iam_permissions( + self, + ) -> Callable[ + [compute.TestIamPermissionsInstantSnapshotRequest], + 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__ = ("InstantSnapshotsRestTransport",) diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/interconnect_attachments/client.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/interconnect_attachments/client.py index 125e75d9c5fa..92fb0848adea 100644 --- a/packages/google-cloud-compute/google/cloud/compute_v1/services/interconnect_attachments/client.py +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/interconnect_attachments/client.py @@ -660,8 +660,9 @@ def aggregated_list( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.AggregatedListPager: - r"""Retrieves an aggregated list of interconnect - attachments. + r"""Retrieves an aggregated list of interconnect attachments. To + prevent failure, Google recommends that you set the + ``returnPartialSuccess`` parameter to ``true``. .. code-block:: python diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/machine_types/client.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/machine_types/client.py index fbd004d0c150..fb1370462996 100644 --- a/packages/google-cloud-compute/google/cloud/compute_v1/services/machine_types/client.py +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/machine_types/client.py @@ -648,7 +648,9 @@ def aggregated_list( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.AggregatedListPager: - r"""Retrieves an aggregated list of machine types. + r"""Retrieves an aggregated list of machine types. To prevent + failure, Google recommends that you set the + ``returnPartialSuccess`` parameter to ``true``. .. code-block:: python diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/network_attachments/client.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/network_attachments/client.py index 97a04f801a1c..0707b05fd3b9 100644 --- a/packages/google-cloud-compute/google/cloud/compute_v1/services/network_attachments/client.py +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/network_attachments/client.py @@ -656,9 +656,10 @@ def aggregated_list( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.AggregatedListPager: - r"""Retrieves the list of all NetworkAttachment - resources, regional and global, available to the - specified project. + r"""Retrieves the list of all NetworkAttachment resources, regional + and global, available to the specified project. To prevent + failure, Google recommends that you set the + ``returnPartialSuccess`` parameter to ``true``. .. code-block:: python diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/network_edge_security_services/client.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/network_edge_security_services/client.py index aa69ed1fe1a6..109d975eabf1 100644 --- a/packages/google-cloud-compute/google/cloud/compute_v1/services/network_edge_security_services/client.py +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/network_edge_security_services/client.py @@ -662,8 +662,10 @@ def aggregated_list( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.AggregatedListPager: - r"""Retrieves the list of all NetworkEdgeSecurityService - resources available to the specified project. + r"""Retrieves the list of all NetworkEdgeSecurityService resources + available to the specified project. To prevent failure, Google + recommends that you set the ``returnPartialSuccess`` parameter + to ``true``. .. code-block:: python diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/network_endpoint_groups/client.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/network_endpoint_groups/client.py index 95a62a29ec77..1ce118044ee1 100644 --- a/packages/google-cloud-compute/google/cloud/compute_v1/services/network_endpoint_groups/client.py +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/network_endpoint_groups/client.py @@ -658,8 +658,9 @@ def aggregated_list( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.AggregatedListPager: - r"""Retrieves the list of network endpoint groups and - sorts them by zone. + r"""Retrieves the list of network endpoint groups and sorts them by + zone. To prevent failure, Google recommends that you set the + ``returnPartialSuccess`` parameter to ``true``. .. code-block:: python diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/node_groups/client.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/node_groups/client.py index 37e2da3f716a..41386d6e3971 100644 --- a/packages/google-cloud-compute/google/cloud/compute_v1/services/node_groups/client.py +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/node_groups/client.py @@ -962,9 +962,10 @@ def aggregated_list( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.AggregatedListPager: - r"""Retrieves an aggregated list of node groups. Note: - use nodeGroups.listNodes for more details about each - group. + r"""Retrieves an aggregated list of node groups. Note: use + nodeGroups.listNodes for more details about each group. To + prevent failure, Google recommends that you set the + ``returnPartialSuccess`` parameter to ``true``. .. code-block:: python diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/node_templates/client.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/node_templates/client.py index 0faf00d15c89..d993dfb9a9a5 100644 --- a/packages/google-cloud-compute/google/cloud/compute_v1/services/node_templates/client.py +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/node_templates/client.py @@ -654,7 +654,9 @@ def aggregated_list( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.AggregatedListPager: - r"""Retrieves an aggregated list of node templates. + r"""Retrieves an aggregated list of node templates. To prevent + failure, Google recommends that you set the + ``returnPartialSuccess`` parameter to ``true``. .. code-block:: python diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/node_types/client.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/node_types/client.py index b328813df2ea..4223d8b5538b 100644 --- a/packages/google-cloud-compute/google/cloud/compute_v1/services/node_types/client.py +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/node_types/client.py @@ -646,7 +646,9 @@ def aggregated_list( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.AggregatedListPager: - r"""Retrieves an aggregated list of node types. + r"""Retrieves an aggregated list of node types. To prevent failure, + Google recommends that you set the ``returnPartialSuccess`` + parameter to ``true``. .. code-block:: python diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/packet_mirrorings/client.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/packet_mirrorings/client.py index c417b7497277..fc72b7e923ce 100644 --- a/packages/google-cloud-compute/google/cloud/compute_v1/services/packet_mirrorings/client.py +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/packet_mirrorings/client.py @@ -656,7 +656,9 @@ def aggregated_list( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.AggregatedListPager: - r"""Retrieves an aggregated list of packetMirrorings. + r"""Retrieves an aggregated list of packetMirrorings. To prevent + failure, Google recommends that you set the + ``returnPartialSuccess`` parameter to ``true``. .. code-block:: python diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/projects/client.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/projects/client.py index 29a7e90fee60..ca161846f30f 100644 --- a/packages/google-cloud-compute/google/cloud/compute_v1/services/projects/client.py +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/projects/client.py @@ -2608,6 +2608,274 @@ def error_code(self): # Done; return the response. return response + def set_cloud_armor_tier_unary( + self, + request: Optional[Union[compute.SetCloudArmorTierProjectRequest, dict]] = None, + *, + project: Optional[str] = None, + projects_set_cloud_armor_tier_request_resource: Optional[ + compute.ProjectsSetCloudArmorTierRequest + ] = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, str]] = (), + ) -> compute.Operation: + r"""Sets the Cloud Armor tier of the project. To set + ENTERPRISE or above the billing account of the project + must be subscribed to Cloud Armor Enterprise. See + Subscribing to Cloud Armor Enterprise for more + information. + + .. 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_cloud_armor_tier(): + # Create a client + client = compute_v1.ProjectsClient() + + # Initialize request argument(s) + request = compute_v1.SetCloudArmorTierProjectRequest( + project="project_value", + ) + + # Make the request + response = client.set_cloud_armor_tier(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.compute_v1.types.SetCloudArmorTierProjectRequest, dict]): + The request object. A request message for + Projects.SetCloudArmorTier. 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. + projects_set_cloud_armor_tier_request_resource (google.cloud.compute_v1.types.ProjectsSetCloudArmorTierRequest): + The body resource for this request + This corresponds to the ``projects_set_cloud_armor_tier_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, str]]): Strings which should be + sent along with the request as metadata. + + 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. + has_flattened_params = any( + [project, projects_set_cloud_armor_tier_request_resource] + ) + 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." + ) + + # Minor optimization to avoid making a copy if the user passes + # in a compute.SetCloudArmorTierProjectRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance(request, compute.SetCloudArmorTierProjectRequest): + request = compute.SetCloudArmorTierProjectRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if project is not None: + request.project = project + if projects_set_cloud_armor_tier_request_resource is not None: + request.projects_set_cloud_armor_tier_request_resource = ( + projects_set_cloud_armor_tier_request_resource + ) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.set_cloud_armor_tier] + + # 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 set_cloud_armor_tier( + self, + request: Optional[Union[compute.SetCloudArmorTierProjectRequest, dict]] = None, + *, + project: Optional[str] = None, + projects_set_cloud_armor_tier_request_resource: Optional[ + compute.ProjectsSetCloudArmorTierRequest + ] = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, str]] = (), + ) -> extended_operation.ExtendedOperation: + r"""Sets the Cloud Armor tier of the project. To set + ENTERPRISE or above the billing account of the project + must be subscribed to Cloud Armor Enterprise. See + Subscribing to Cloud Armor Enterprise for more + information. + + .. 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_cloud_armor_tier(): + # Create a client + client = compute_v1.ProjectsClient() + + # Initialize request argument(s) + request = compute_v1.SetCloudArmorTierProjectRequest( + project="project_value", + ) + + # Make the request + response = client.set_cloud_armor_tier(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.compute_v1.types.SetCloudArmorTierProjectRequest, dict]): + The request object. A request message for + Projects.SetCloudArmorTier. 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. + projects_set_cloud_armor_tier_request_resource (google.cloud.compute_v1.types.ProjectsSetCloudArmorTierRequest): + The body resource for this request + This corresponds to the ``projects_set_cloud_armor_tier_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, str]]): Strings which should be + sent along with the request as metadata. + + 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. + has_flattened_params = any( + [project, projects_set_cloud_armor_tier_request_resource] + ) + 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." + ) + + # Minor optimization to avoid making a copy if the user passes + # in a compute.SetCloudArmorTierProjectRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance(request, compute.SetCloudArmorTierProjectRequest): + request = compute.SetCloudArmorTierProjectRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if project is not None: + request.project = project + if projects_set_cloud_armor_tier_request_resource is not None: + request.projects_set_cloud_armor_tier_request_resource = ( + projects_set_cloud_armor_tier_request_resource + ) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.set_cloud_armor_tier] + + # 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 set_common_instance_metadata_unary( self, request: Optional[ diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/projects/transports/base.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/projects/transports/base.py index 24e05fc016d1..7f0f71642c09 100644 --- a/packages/google-cloud-compute/google/cloud/compute_v1/services/projects/transports/base.py +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/projects/transports/base.py @@ -181,6 +181,11 @@ def _prep_wrapped_messages(self, client_info): default_timeout=None, client_info=client_info, ), + self.set_cloud_armor_tier: gapic_v1.method.wrap_method( + self.set_cloud_armor_tier, + default_timeout=None, + client_info=client_info, + ), self.set_common_instance_metadata: gapic_v1.method.wrap_method( self.set_common_instance_metadata, default_timeout=None, @@ -298,6 +303,15 @@ def move_instance( ]: raise NotImplementedError() + @property + def set_cloud_armor_tier( + self, + ) -> Callable[ + [compute.SetCloudArmorTierProjectRequest], + Union[compute.Operation, Awaitable[compute.Operation]], + ]: + raise NotImplementedError() + @property def set_common_instance_metadata( self, diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/projects/transports/rest.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/projects/transports/rest.py index 7d5c3d245079..fdd962a68bd1 100644 --- a/packages/google-cloud-compute/google/cloud/compute_v1/services/projects/transports/rest.py +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/projects/transports/rest.py @@ -143,6 +143,14 @@ def post_move_instance(self, response): logging.log(f"Received response: {response}") return response + def pre_set_cloud_armor_tier(self, request, metadata): + logging.log(f"Received request: {request}") + return request, metadata + + def post_set_cloud_armor_tier(self, response): + logging.log(f"Received response: {response}") + return response + def pre_set_common_instance_metadata(self, request, metadata): logging.log(f"Received request: {request}") return request, metadata @@ -387,6 +395,29 @@ def post_move_instance(self, response: compute.Operation) -> compute.Operation: """ return response + def pre_set_cloud_armor_tier( + self, + request: compute.SetCloudArmorTierProjectRequest, + metadata: Sequence[Tuple[str, str]], + ) -> Tuple[compute.SetCloudArmorTierProjectRequest, Sequence[Tuple[str, str]]]: + """Pre-rpc interceptor for set_cloud_armor_tier + + Override in a subclass to manipulate the request or metadata + before they are sent to the Projects server. + """ + return request, metadata + + def post_set_cloud_armor_tier( + self, response: compute.Operation + ) -> compute.Operation: + """Post-rpc interceptor for set_cloud_armor_tier + + Override in a subclass to manipulate the response + after it is returned by the Projects server but before + it is returned to user code. + """ + return response + def pre_set_common_instance_metadata( self, request: compute.SetCommonInstanceMetadataProjectRequest, @@ -1566,6 +1597,117 @@ def __call__( resp = self._interceptor.post_move_instance(resp) return resp + class _SetCloudArmorTier(ProjectsRestStub): + def __hash__(self): + return hash("SetCloudArmorTier") + + __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 + } + + def __call__( + self, + request: compute.SetCloudArmorTierProjectRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> compute.Operation: + r"""Call the set cloud armor tier method over HTTP. + + Args: + request (~.compute.SetCloudArmorTierProjectRequest): + The request object. A request message for + Projects.SetCloudArmorTier. 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, str]]): Strings which should be + sent along with the request as metadata. + + 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: List[Dict[str, str]] = [ + { + "method": "post", + "uri": "/compute/v1/projects/{project}/setCloudArmorTier", + "body": "projects_set_cloud_armor_tier_request_resource", + }, + ] + request, metadata = self._interceptor.pre_set_cloud_armor_tier( + request, metadata + ) + pb_request = compute.SetCloudArmorTierProjectRequest.pb(request) + transcoded_request = path_template.transcode(http_options, pb_request) + + # Jsonify the request body + + body = json_format.MessageToJson( + transcoded_request["body"], use_integers_for_enums=False + ) + uri = transcoded_request["uri"] + method = transcoded_request["method"] + + # Jsonify the query params + query_params = json.loads( + json_format.MessageToJson( + transcoded_request["query_params"], + use_integers_for_enums=False, + ) + ) + query_params.update(self._get_unset_required_fields(query_params)) + + # Send the request + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = getattr(self._session, method)( + "{host}{uri}".format(host=self._host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + data=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_set_cloud_armor_tier(resp) + return resp + class _SetCommonInstanceMetadata(ProjectsRestStub): def __hash__(self): return hash("SetCommonInstanceMetadata") @@ -1980,6 +2122,14 @@ def move_instance( # In C++ this would require a dynamic_cast return self._MoveInstance(self._session, self._host, self._interceptor) # type: ignore + @property + def set_cloud_armor_tier( + self, + ) -> Callable[[compute.SetCloudArmorTierProjectRequest], 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._SetCloudArmorTier(self._session, self._host, self._interceptor) # type: ignore + @property def set_common_instance_metadata( self, diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/public_delegated_prefixes/client.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/public_delegated_prefixes/client.py index 4bf12ee9f949..a471f0620d85 100644 --- a/packages/google-cloud-compute/google/cloud/compute_v1/services/public_delegated_prefixes/client.py +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/public_delegated_prefixes/client.py @@ -660,8 +660,9 @@ def aggregated_list( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.AggregatedListPager: - r"""Lists all PublicDelegatedPrefix resources owned by - the specific project across all scopes. + r"""Lists all PublicDelegatedPrefix resources owned by the specific + project across all scopes. To prevent failure, Google recommends + that you set the ``returnPartialSuccess`` parameter to ``true``. .. code-block:: python diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/region_commitments/client.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/region_commitments/client.py index 5cda7a766979..7e5f58457006 100644 --- a/packages/google-cloud-compute/google/cloud/compute_v1/services/region_commitments/client.py +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/region_commitments/client.py @@ -656,8 +656,9 @@ def aggregated_list( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.AggregatedListPager: - r"""Retrieves an aggregated list of commitments by - region. + r"""Retrieves an aggregated list of commitments by region. To + prevent failure, Google recommends that you set the + ``returnPartialSuccess`` parameter to ``true``. .. code-block:: python diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/region_instant_snapshots/__init__.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/region_instant_snapshots/__init__.py new file mode 100644 index 000000000000..79d797e8ab83 --- /dev/null +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/region_instant_snapshots/__init__.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 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 RegionInstantSnapshotsClient + +__all__ = ("RegionInstantSnapshotsClient",) diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/region_instant_snapshots/client.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/region_instant_snapshots/client.py new file mode 100644 index 000000000000..e969431f27cd --- /dev/null +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/region_instant_snapshots/client.py @@ -0,0 +1,2321 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 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 +import os +import re +from typing import ( + 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 + +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 + +from google.api_core import extended_operation # type: ignore + +from google.cloud.compute_v1.services.region_instant_snapshots import pagers +from google.cloud.compute_v1.types import compute + +from .transports.base import DEFAULT_CLIENT_INFO, RegionInstantSnapshotsTransport +from .transports.rest import RegionInstantSnapshotsRestTransport + + +class RegionInstantSnapshotsClientMeta(type): + """Metaclass for the RegionInstantSnapshots 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[RegionInstantSnapshotsTransport]] + _transport_registry["rest"] = RegionInstantSnapshotsRestTransport + + def get_transport_class( + cls, + label: Optional[str] = None, + ) -> Type[RegionInstantSnapshotsTransport]: + """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 RegionInstantSnapshotsClient(metaclass=RegionInstantSnapshotsClientMeta): + """The RegionInstantSnapshots 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: + RegionInstantSnapshotsClient: 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: + RegionInstantSnapshotsClient: 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) -> RegionInstantSnapshotsTransport: + """Returns the transport used by the client instance. + + Returns: + RegionInstantSnapshotsTransport: 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 = RegionInstantSnapshotsClient._DEFAULT_UNIVERSE + if universe_domain != _default_universe: + raise MutualTLSChannelError( + f"mTLS is not supported in any universe other than {_default_universe}." + ) + api_endpoint = RegionInstantSnapshotsClient.DEFAULT_MTLS_ENDPOINT + else: + api_endpoint = ( + RegionInstantSnapshotsClient._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 = RegionInstantSnapshotsClient._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 + + @staticmethod + def _compare_universes( + client_universe: str, credentials: ga_credentials.Credentials + ) -> bool: + """Returns True iff the universe domains used by the client and credentials match. + + Args: + client_universe (str): The universe domain configured via the client options. + credentials (ga_credentials.Credentials): The credentials being used in the client. + + Returns: + bool: True iff client_universe matches the universe in credentials. + + Raises: + ValueError: when client_universe does not match the universe in credentials. + """ + + default_universe = RegionInstantSnapshotsClient._DEFAULT_UNIVERSE + credentials_universe = getattr(credentials, "universe_domain", default_universe) + + if client_universe != credentials_universe: + raise ValueError( + "The configured universe domain " + f"({client_universe}) does not match the universe domain " + f"found in the credentials ({credentials_universe}). " + "If you haven't configured the universe domain explicitly, " + f"`{default_universe}` is the default." + ) + return True + + 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. + """ + self._is_universe_domain_valid = ( + self._is_universe_domain_valid + or RegionInstantSnapshotsClient._compare_universes( + self.universe_domain, self.transport._credentials + ) + ) + return self._is_universe_domain_valid + + @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, RegionInstantSnapshotsTransport]] = None, + client_options: Optional[Union[client_options_lib.ClientOptions, dict]] = None, + client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, + ) -> None: + """Instantiates the region instant snapshots 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 (Union[str, RegionInstantSnapshotsTransport]): The + transport to use. 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, + ) = RegionInstantSnapshotsClient._read_environment_variables() + self._client_cert_source = RegionInstantSnapshotsClient._get_client_cert_source( + self._client_options.client_cert_source, self._use_client_cert + ) + self._universe_domain = RegionInstantSnapshotsClient._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 + + 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, RegionInstantSnapshotsTransport) + if transport_provided: + # transport is a RegionInstantSnapshotsTransport 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(RegionInstantSnapshotsTransport, transport) + self._api_endpoint = self._transport.host + + self._api_endpoint = ( + self._api_endpoint + or RegionInstantSnapshotsClient._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 = type(self).get_transport_class(cast(str, transport)) + self._transport = Transport( + 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, + ) + + def delete_unary( + self, + request: Optional[ + Union[compute.DeleteRegionInstantSnapshotRequest, dict] + ] = None, + *, + project: Optional[str] = None, + region: Optional[str] = None, + instant_snapshot: Optional[str] = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, str]] = (), + ) -> compute.Operation: + r"""Deletes the specified InstantSnapshot resource. Keep + in mind that deleting a single instantSnapshot might not + necessarily delete all the data on that instantSnapshot. + If any data on the instantSnapshot that is marked for + deletion is needed for subsequent instantSnapshots, the + data will be moved to the next corresponding + instantSnapshot. For more information, see Deleting + instantSnapshots. + + .. 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.RegionInstantSnapshotsClient() + + # Initialize request argument(s) + request = compute_v1.DeleteRegionInstantSnapshotRequest( + instant_snapshot="instant_snapshot_value", + project="project_value", + region="region_value", + ) + + # Make the request + response = client.delete(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.compute_v1.types.DeleteRegionInstantSnapshotRequest, dict]): + The request object. A request message for + RegionInstantSnapshots.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. + region (str): + The name of the region for this + request. + + This corresponds to the ``region`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + instant_snapshot (str): + Name of the InstantSnapshot resource + to delete. + + This corresponds to the ``instant_snapshot`` 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, str]]): Strings which should be + sent along with the request as metadata. + + 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. + has_flattened_params = any([project, region, instant_snapshot]) + 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." + ) + + # Minor optimization to avoid making a copy if the user passes + # in a compute.DeleteRegionInstantSnapshotRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance(request, compute.DeleteRegionInstantSnapshotRequest): + request = compute.DeleteRegionInstantSnapshotRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if project is not None: + request.project = project + if region is not None: + request.region = region + if instant_snapshot is not None: + request.instant_snapshot = instant_snapshot + + # 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), + ("region", request.region), + ("instant_snapshot", request.instant_snapshot), + ) + ), + ) + + # 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.DeleteRegionInstantSnapshotRequest, dict] + ] = None, + *, + project: Optional[str] = None, + region: Optional[str] = None, + instant_snapshot: Optional[str] = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, str]] = (), + ) -> extended_operation.ExtendedOperation: + r"""Deletes the specified InstantSnapshot resource. Keep + in mind that deleting a single instantSnapshot might not + necessarily delete all the data on that instantSnapshot. + If any data on the instantSnapshot that is marked for + deletion is needed for subsequent instantSnapshots, the + data will be moved to the next corresponding + instantSnapshot. For more information, see Deleting + instantSnapshots. + + .. 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.RegionInstantSnapshotsClient() + + # Initialize request argument(s) + request = compute_v1.DeleteRegionInstantSnapshotRequest( + instant_snapshot="instant_snapshot_value", + project="project_value", + region="region_value", + ) + + # Make the request + response = client.delete(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.compute_v1.types.DeleteRegionInstantSnapshotRequest, dict]): + The request object. A request message for + RegionInstantSnapshots.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. + region (str): + The name of the region for this + request. + + This corresponds to the ``region`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + instant_snapshot (str): + Name of the InstantSnapshot resource + to delete. + + This corresponds to the ``instant_snapshot`` 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, str]]): Strings which should be + sent along with the request as metadata. + + 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. + has_flattened_params = any([project, region, instant_snapshot]) + 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." + ) + + # Minor optimization to avoid making a copy if the user passes + # in a compute.DeleteRegionInstantSnapshotRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance(request, compute.DeleteRegionInstantSnapshotRequest): + request = compute.DeleteRegionInstantSnapshotRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if project is not None: + request.project = project + if region is not None: + request.region = region + if instant_snapshot is not None: + request.instant_snapshot = instant_snapshot + + # 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), + ("region", request.region), + ("instant_snapshot", request.instant_snapshot), + ) + ), + ) + + # Validate the universe domain. + self._validate_universe_domain() + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + operation_service = self._transport._region_operations_client + operation_request = compute.GetRegionOperationRequest() + operation_request.project = request.project + operation_request.region = request.region + 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.GetRegionInstantSnapshotRequest, dict]] = None, + *, + project: Optional[str] = None, + region: Optional[str] = None, + instant_snapshot: Optional[str] = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, str]] = (), + ) -> compute.InstantSnapshot: + r"""Returns the specified InstantSnapshot resource in the + specified region. + + .. 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.RegionInstantSnapshotsClient() + + # Initialize request argument(s) + request = compute_v1.GetRegionInstantSnapshotRequest( + instant_snapshot="instant_snapshot_value", + project="project_value", + region="region_value", + ) + + # Make the request + response = client.get(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.compute_v1.types.GetRegionInstantSnapshotRequest, dict]): + The request object. A request message for + RegionInstantSnapshots.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. + region (str): + The name of the region for this + request. + + This corresponds to the ``region`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + instant_snapshot (str): + Name of the InstantSnapshot resource + to return. + + This corresponds to the ``instant_snapshot`` 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, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.compute_v1.types.InstantSnapshot: + Represents a InstantSnapshot + resource. You can use instant snapshots + to create disk rollback points quickly.. + + """ + # 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. + has_flattened_params = any([project, region, instant_snapshot]) + 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." + ) + + # Minor optimization to avoid making a copy if the user passes + # in a compute.GetRegionInstantSnapshotRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance(request, compute.GetRegionInstantSnapshotRequest): + request = compute.GetRegionInstantSnapshotRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if project is not None: + request.project = project + if region is not None: + request.region = region + if instant_snapshot is not None: + request.instant_snapshot = instant_snapshot + + # 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), + ("region", request.region), + ("instant_snapshot", request.instant_snapshot), + ) + ), + ) + + # 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.GetIamPolicyRegionInstantSnapshotRequest, dict] + ] = None, + *, + project: Optional[str] = None, + region: 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, str]] = (), + ) -> 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.RegionInstantSnapshotsClient() + + # Initialize request argument(s) + request = compute_v1.GetIamPolicyRegionInstantSnapshotRequest( + project="project_value", + region="region_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.GetIamPolicyRegionInstantSnapshotRequest, dict]): + The request object. A request message for + RegionInstantSnapshots.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. + region (str): + The name of the region for this + request. + + This corresponds to the ``region`` 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, str]]): Strings which should be + sent along with the request as metadata. + + 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. + has_flattened_params = any([project, region, resource]) + 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." + ) + + # Minor optimization to avoid making a copy if the user passes + # in a compute.GetIamPolicyRegionInstantSnapshotRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance(request, compute.GetIamPolicyRegionInstantSnapshotRequest): + request = compute.GetIamPolicyRegionInstantSnapshotRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if project is not None: + request.project = project + if region is not None: + request.region = region + 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), + ("region", request.region), + ("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 insert_unary( + self, + request: Optional[ + Union[compute.InsertRegionInstantSnapshotRequest, dict] + ] = None, + *, + project: Optional[str] = None, + region: Optional[str] = None, + instant_snapshot_resource: Optional[compute.InstantSnapshot] = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, str]] = (), + ) -> compute.Operation: + r"""Creates an instant snapshot in the specified region. + + .. 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.RegionInstantSnapshotsClient() + + # Initialize request argument(s) + request = compute_v1.InsertRegionInstantSnapshotRequest( + project="project_value", + region="region_value", + ) + + # Make the request + response = client.insert(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.compute_v1.types.InsertRegionInstantSnapshotRequest, dict]): + The request object. A request message for + RegionInstantSnapshots.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. + region (str): + Name of the region for this request. + This corresponds to the ``region`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + instant_snapshot_resource (google.cloud.compute_v1.types.InstantSnapshot): + The body resource for this request + This corresponds to the ``instant_snapshot_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, str]]): Strings which should be + sent along with the request as metadata. + + 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. + has_flattened_params = any([project, region, instant_snapshot_resource]) + 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." + ) + + # Minor optimization to avoid making a copy if the user passes + # in a compute.InsertRegionInstantSnapshotRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance(request, compute.InsertRegionInstantSnapshotRequest): + request = compute.InsertRegionInstantSnapshotRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if project is not None: + request.project = project + if region is not None: + request.region = region + if instant_snapshot_resource is not None: + request.instant_snapshot_resource = instant_snapshot_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), + ("region", request.region), + ) + ), + ) + + # 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.InsertRegionInstantSnapshotRequest, dict] + ] = None, + *, + project: Optional[str] = None, + region: Optional[str] = None, + instant_snapshot_resource: Optional[compute.InstantSnapshot] = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, str]] = (), + ) -> extended_operation.ExtendedOperation: + r"""Creates an instant snapshot in the specified region. + + .. 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.RegionInstantSnapshotsClient() + + # Initialize request argument(s) + request = compute_v1.InsertRegionInstantSnapshotRequest( + project="project_value", + region="region_value", + ) + + # Make the request + response = client.insert(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.compute_v1.types.InsertRegionInstantSnapshotRequest, dict]): + The request object. A request message for + RegionInstantSnapshots.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. + region (str): + Name of the region for this request. + This corresponds to the ``region`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + instant_snapshot_resource (google.cloud.compute_v1.types.InstantSnapshot): + The body resource for this request + This corresponds to the ``instant_snapshot_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, str]]): Strings which should be + sent along with the request as metadata. + + 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. + has_flattened_params = any([project, region, instant_snapshot_resource]) + 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." + ) + + # Minor optimization to avoid making a copy if the user passes + # in a compute.InsertRegionInstantSnapshotRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance(request, compute.InsertRegionInstantSnapshotRequest): + request = compute.InsertRegionInstantSnapshotRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if project is not None: + request.project = project + if region is not None: + request.region = region + if instant_snapshot_resource is not None: + request.instant_snapshot_resource = instant_snapshot_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), + ("region", request.region), + ) + ), + ) + + # Validate the universe domain. + self._validate_universe_domain() + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + operation_service = self._transport._region_operations_client + operation_request = compute.GetRegionOperationRequest() + operation_request.project = request.project + operation_request.region = request.region + 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.ListRegionInstantSnapshotsRequest, dict] + ] = None, + *, + project: Optional[str] = None, + region: Optional[str] = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, str]] = (), + ) -> pagers.ListPager: + r"""Retrieves the list of InstantSnapshot resources + contained within the specified region. + + .. 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.RegionInstantSnapshotsClient() + + # Initialize request argument(s) + request = compute_v1.ListRegionInstantSnapshotsRequest( + project="project_value", + region="region_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.ListRegionInstantSnapshotsRequest, dict]): + The request object. A request message for + RegionInstantSnapshots.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. + region (str): + The name of the region for this + request. + + This corresponds to the ``region`` 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, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.compute_v1.services.region_instant_snapshots.pagers.ListPager: + Contains a list of InstantSnapshot + resources. + 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. + has_flattened_params = any([project, region]) + 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." + ) + + # Minor optimization to avoid making a copy if the user passes + # in a compute.ListRegionInstantSnapshotsRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance(request, compute.ListRegionInstantSnapshotsRequest): + request = compute.ListRegionInstantSnapshotsRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if project is not None: + request.project = project + if region is not None: + request.region = region + + # 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), + ("region", request.region), + ) + ), + ) + + # 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, + metadata=metadata, + ) + + # Done; return the response. + return response + + def set_iam_policy( + self, + request: Optional[ + Union[compute.SetIamPolicyRegionInstantSnapshotRequest, dict] + ] = None, + *, + project: Optional[str] = None, + region: Optional[str] = None, + resource: Optional[str] = None, + region_set_policy_request_resource: Optional[ + compute.RegionSetPolicyRequest + ] = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, str]] = (), + ) -> 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.RegionInstantSnapshotsClient() + + # Initialize request argument(s) + request = compute_v1.SetIamPolicyRegionInstantSnapshotRequest( + project="project_value", + region="region_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.SetIamPolicyRegionInstantSnapshotRequest, dict]): + The request object. A request message for + RegionInstantSnapshots.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. + region (str): + The name of the region for this + request. + + This corresponds to the ``region`` 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. + region_set_policy_request_resource (google.cloud.compute_v1.types.RegionSetPolicyRequest): + The body resource for this request + This corresponds to the ``region_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, str]]): Strings which should be + sent along with the request as metadata. + + 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. + has_flattened_params = any( + [project, region, resource, region_set_policy_request_resource] + ) + 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." + ) + + # Minor optimization to avoid making a copy if the user passes + # in a compute.SetIamPolicyRegionInstantSnapshotRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance(request, compute.SetIamPolicyRegionInstantSnapshotRequest): + request = compute.SetIamPolicyRegionInstantSnapshotRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if project is not None: + request.project = project + if region is not None: + request.region = region + if resource is not None: + request.resource = resource + if region_set_policy_request_resource is not None: + request.region_set_policy_request_resource = ( + region_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), + ("region", request.region), + ("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 set_labels_unary( + self, + request: Optional[ + Union[compute.SetLabelsRegionInstantSnapshotRequest, dict] + ] = None, + *, + project: Optional[str] = None, + region: Optional[str] = None, + resource: Optional[str] = None, + region_set_labels_request_resource: Optional[ + compute.RegionSetLabelsRequest + ] = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, str]] = (), + ) -> compute.Operation: + r"""Sets the labels on a instantSnapshot in the given + region. 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_set_labels(): + # Create a client + client = compute_v1.RegionInstantSnapshotsClient() + + # Initialize request argument(s) + request = compute_v1.SetLabelsRegionInstantSnapshotRequest( + project="project_value", + region="region_value", + resource="resource_value", + ) + + # Make the request + response = client.set_labels(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.compute_v1.types.SetLabelsRegionInstantSnapshotRequest, dict]): + The request object. A request message for + RegionInstantSnapshots.SetLabels. 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. + region (str): + The region for this request. + This corresponds to the ``region`` 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. + region_set_labels_request_resource (google.cloud.compute_v1.types.RegionSetLabelsRequest): + The body resource for this request + This corresponds to the ``region_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, str]]): Strings which should be + sent along with the request as metadata. + + 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. + has_flattened_params = any( + [project, region, resource, region_set_labels_request_resource] + ) + 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." + ) + + # Minor optimization to avoid making a copy if the user passes + # in a compute.SetLabelsRegionInstantSnapshotRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance(request, compute.SetLabelsRegionInstantSnapshotRequest): + request = compute.SetLabelsRegionInstantSnapshotRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if project is not None: + request.project = project + if region is not None: + request.region = region + if resource is not None: + request.resource = resource + if region_set_labels_request_resource is not None: + request.region_set_labels_request_resource = ( + region_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.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), + ("region", request.region), + ("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 set_labels( + self, + request: Optional[ + Union[compute.SetLabelsRegionInstantSnapshotRequest, dict] + ] = None, + *, + project: Optional[str] = None, + region: Optional[str] = None, + resource: Optional[str] = None, + region_set_labels_request_resource: Optional[ + compute.RegionSetLabelsRequest + ] = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, str]] = (), + ) -> extended_operation.ExtendedOperation: + r"""Sets the labels on a instantSnapshot in the given + region. 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_set_labels(): + # Create a client + client = compute_v1.RegionInstantSnapshotsClient() + + # Initialize request argument(s) + request = compute_v1.SetLabelsRegionInstantSnapshotRequest( + project="project_value", + region="region_value", + resource="resource_value", + ) + + # Make the request + response = client.set_labels(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.compute_v1.types.SetLabelsRegionInstantSnapshotRequest, dict]): + The request object. A request message for + RegionInstantSnapshots.SetLabels. 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. + region (str): + The region for this request. + This corresponds to the ``region`` 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. + region_set_labels_request_resource (google.cloud.compute_v1.types.RegionSetLabelsRequest): + The body resource for this request + This corresponds to the ``region_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, str]]): Strings which should be + sent along with the request as metadata. + + 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. + has_flattened_params = any( + [project, region, resource, region_set_labels_request_resource] + ) + 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." + ) + + # Minor optimization to avoid making a copy if the user passes + # in a compute.SetLabelsRegionInstantSnapshotRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance(request, compute.SetLabelsRegionInstantSnapshotRequest): + request = compute.SetLabelsRegionInstantSnapshotRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if project is not None: + request.project = project + if region is not None: + request.region = region + if resource is not None: + request.resource = resource + if region_set_labels_request_resource is not None: + request.region_set_labels_request_resource = ( + region_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.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), + ("region", request.region), + ("resource", request.resource), + ) + ), + ) + + # Validate the universe domain. + self._validate_universe_domain() + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + operation_service = self._transport._region_operations_client + operation_request = compute.GetRegionOperationRequest() + operation_request.project = request.project + operation_request.region = request.region + 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 test_iam_permissions( + self, + request: Optional[ + Union[compute.TestIamPermissionsRegionInstantSnapshotRequest, dict] + ] = None, + *, + project: Optional[str] = None, + region: 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, str]] = (), + ) -> 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.RegionInstantSnapshotsClient() + + # Initialize request argument(s) + request = compute_v1.TestIamPermissionsRegionInstantSnapshotRequest( + project="project_value", + region="region_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.TestIamPermissionsRegionInstantSnapshotRequest, dict]): + The request object. A request message for + RegionInstantSnapshots.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. + region (str): + The name of the region for this + request. + + This corresponds to the ``region`` 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, str]]): Strings which should be + sent along with the request as metadata. + + 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. + has_flattened_params = any( + [project, region, resource, test_permissions_request_resource] + ) + 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." + ) + + # Minor optimization to avoid making a copy if the user passes + # in a compute.TestIamPermissionsRegionInstantSnapshotRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance( + request, compute.TestIamPermissionsRegionInstantSnapshotRequest + ): + request = compute.TestIamPermissionsRegionInstantSnapshotRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if project is not None: + request.project = project + if region is not None: + request.region = region + 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), + ("region", request.region), + ("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) -> "RegionInstantSnapshotsClient": + 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__ +) + + +__all__ = ("RegionInstantSnapshotsClient",) diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/region_instant_snapshots/pagers.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/region_instant_snapshots/pagers.py new file mode 100644 index 000000000000..e6e0043153bc --- /dev/null +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/region_instant_snapshots/pagers.py @@ -0,0 +1,89 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 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, +) + +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.InstantSnapshotList` 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.InstantSnapshotList` + 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.InstantSnapshotList], + request: compute.ListRegionInstantSnapshotsRequest, + response: compute.InstantSnapshotList, + *, + metadata: Sequence[Tuple[str, str]] = () + ): + """Instantiate the pager. + + Args: + method (Callable): The method that was originally called, and + which instantiated this pager. + request (google.cloud.compute_v1.types.ListRegionInstantSnapshotsRequest): + The initial request object. + response (google.cloud.compute_v1.types.InstantSnapshotList): + The initial response object. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + """ + self._method = method + self._request = compute.ListRegionInstantSnapshotsRequest(request) + self._response = response + self._metadata = metadata + + def __getattr__(self, name: str) -> Any: + return getattr(self._response, name) + + @property + def pages(self) -> Iterator[compute.InstantSnapshotList]: + yield self._response + while self._response.next_page_token: + self._request.page_token = self._response.next_page_token + self._response = self._method(self._request, metadata=self._metadata) + yield self._response + + def __iter__(self) -> Iterator[compute.InstantSnapshot]: + 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/region_instant_snapshots/transports/__init__.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/region_instant_snapshots/transports/__init__.py new file mode 100644 index 000000000000..5bac4216e1b9 --- /dev/null +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/region_instant_snapshots/transports/__init__.py @@ -0,0 +1,35 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 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 RegionInstantSnapshotsTransport +from .rest import ( + RegionInstantSnapshotsRestInterceptor, + RegionInstantSnapshotsRestTransport, +) + +# Compile a registry of transports. +_transport_registry = ( + OrderedDict() +) # type: Dict[str, Type[RegionInstantSnapshotsTransport]] +_transport_registry["rest"] = RegionInstantSnapshotsRestTransport + +__all__ = ( + "RegionInstantSnapshotsTransport", + "RegionInstantSnapshotsRestTransport", + "RegionInstantSnapshotsRestInterceptor", +) diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/region_instant_snapshots/transports/base.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/region_instant_snapshots/transports/base.py new file mode 100644 index 000000000000..198a469fe672 --- /dev/null +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/region_instant_snapshots/transports/base.py @@ -0,0 +1,276 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 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 + +from google.cloud.compute_v1 import gapic_version as package_version +from google.cloud.compute_v1.services import region_operations +from google.cloud.compute_v1.types import compute + +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) + + +class RegionInstantSnapshotsTransport(abc.ABC): + """Abstract transport class for RegionInstantSnapshots.""" + + 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 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: + 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.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.set_iam_policy: gapic_v1.method.wrap_method( + self.set_iam_policy, + default_timeout=None, + client_info=client_info, + ), + self.set_labels: gapic_v1.method.wrap_method( + self.set_labels, + 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.DeleteRegionInstantSnapshotRequest], + Union[compute.Operation, Awaitable[compute.Operation]], + ]: + raise NotImplementedError() + + @property + def get( + self, + ) -> Callable[ + [compute.GetRegionInstantSnapshotRequest], + Union[compute.InstantSnapshot, Awaitable[compute.InstantSnapshot]], + ]: + raise NotImplementedError() + + @property + def get_iam_policy( + self, + ) -> Callable[ + [compute.GetIamPolicyRegionInstantSnapshotRequest], + Union[compute.Policy, Awaitable[compute.Policy]], + ]: + raise NotImplementedError() + + @property + def insert( + self, + ) -> Callable[ + [compute.InsertRegionInstantSnapshotRequest], + Union[compute.Operation, Awaitable[compute.Operation]], + ]: + raise NotImplementedError() + + @property + def list( + self, + ) -> Callable[ + [compute.ListRegionInstantSnapshotsRequest], + Union[compute.InstantSnapshotList, Awaitable[compute.InstantSnapshotList]], + ]: + raise NotImplementedError() + + @property + def set_iam_policy( + self, + ) -> Callable[ + [compute.SetIamPolicyRegionInstantSnapshotRequest], + Union[compute.Policy, Awaitable[compute.Policy]], + ]: + raise NotImplementedError() + + @property + def set_labels( + self, + ) -> Callable[ + [compute.SetLabelsRegionInstantSnapshotRequest], + Union[compute.Operation, Awaitable[compute.Operation]], + ]: + raise NotImplementedError() + + @property + def test_iam_permissions( + self, + ) -> Callable[ + [compute.TestIamPermissionsRegionInstantSnapshotRequest], + Union[ + compute.TestPermissionsResponse, Awaitable[compute.TestPermissionsResponse] + ], + ]: + raise NotImplementedError() + + @property + def kind(self) -> str: + raise NotImplementedError() + + @property + def _region_operations_client(self) -> region_operations.RegionOperationsClient: + ex_op_service = self._extended_operations_services.get("region_operations") + if not ex_op_service: + ex_op_service = region_operations.RegionOperationsClient( + credentials=self._credentials, + transport=self.kind, + ) + self._extended_operations_services["region_operations"] = ex_op_service + + return ex_op_service + + +__all__ = ("RegionInstantSnapshotsTransport",) diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/region_instant_snapshots/transports/rest.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/region_instant_snapshots/transports/rest.py new file mode 100644 index 000000000000..f7c7aa88e56c --- /dev/null +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/region_instant_snapshots/transports/rest.py @@ -0,0 +1,1312 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 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 re +from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple, Union +import warnings + +from google.api_core import gapic_v1, path_template, rest_helpers, rest_streaming +from google.api_core import exceptions as core_exceptions +from google.api_core import retry as retries +from google.auth import credentials as ga_credentials # type: ignore +from google.auth.transport.grpc import SslCredentials # type: ignore +from google.auth.transport.requests import AuthorizedSession # type: ignore +from google.protobuf import json_format +import grpc # type: ignore +from requests import __version__ as requests_version + +try: + OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault, None] +except AttributeError: # pragma: NO COVER + OptionalRetry = Union[retries.Retry, object, None] # type: ignore + + +from google.cloud.compute_v1.types import compute + +from .base import DEFAULT_CLIENT_INFO as BASE_DEFAULT_CLIENT_INFO +from .base import RegionInstantSnapshotsTransport + +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=BASE_DEFAULT_CLIENT_INFO.gapic_version, + grpc_version=None, + rest_version=requests_version, +) + + +class RegionInstantSnapshotsRestInterceptor: + """Interceptor for RegionInstantSnapshots. + + 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 RegionInstantSnapshotsRestTransport. + + .. code-block:: python + class MyCustomRegionInstantSnapshotsInterceptor(RegionInstantSnapshotsRestInterceptor): + 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_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_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_set_labels(self, request, metadata): + logging.log(f"Received request: {request}") + return request, metadata + + def post_set_labels(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 = RegionInstantSnapshotsRestTransport(interceptor=MyCustomRegionInstantSnapshotsInterceptor()) + client = RegionInstantSnapshotsClient(transport=transport) + + + """ + + def pre_delete( + self, + request: compute.DeleteRegionInstantSnapshotRequest, + metadata: Sequence[Tuple[str, str]], + ) -> Tuple[compute.DeleteRegionInstantSnapshotRequest, Sequence[Tuple[str, str]]]: + """Pre-rpc interceptor for delete + + Override in a subclass to manipulate the request or metadata + before they are sent to the RegionInstantSnapshots server. + """ + return request, metadata + + def post_delete(self, response: compute.Operation) -> compute.Operation: + """Post-rpc interceptor for delete + + Override in a subclass to manipulate the response + after it is returned by the RegionInstantSnapshots server but before + it is returned to user code. + """ + return response + + def pre_get( + self, + request: compute.GetRegionInstantSnapshotRequest, + metadata: Sequence[Tuple[str, str]], + ) -> Tuple[compute.GetRegionInstantSnapshotRequest, Sequence[Tuple[str, str]]]: + """Pre-rpc interceptor for get + + Override in a subclass to manipulate the request or metadata + before they are sent to the RegionInstantSnapshots server. + """ + return request, metadata + + def post_get(self, response: compute.InstantSnapshot) -> compute.InstantSnapshot: + """Post-rpc interceptor for get + + Override in a subclass to manipulate the response + after it is returned by the RegionInstantSnapshots server but before + it is returned to user code. + """ + return response + + def pre_get_iam_policy( + self, + request: compute.GetIamPolicyRegionInstantSnapshotRequest, + metadata: Sequence[Tuple[str, str]], + ) -> Tuple[ + compute.GetIamPolicyRegionInstantSnapshotRequest, Sequence[Tuple[str, str]] + ]: + """Pre-rpc interceptor for get_iam_policy + + Override in a subclass to manipulate the request or metadata + before they are sent to the RegionInstantSnapshots server. + """ + return request, metadata + + def post_get_iam_policy(self, response: compute.Policy) -> compute.Policy: + """Post-rpc interceptor for get_iam_policy + + Override in a subclass to manipulate the response + after it is returned by the RegionInstantSnapshots server but before + it is returned to user code. + """ + return response + + def pre_insert( + self, + request: compute.InsertRegionInstantSnapshotRequest, + metadata: Sequence[Tuple[str, str]], + ) -> Tuple[compute.InsertRegionInstantSnapshotRequest, Sequence[Tuple[str, str]]]: + """Pre-rpc interceptor for insert + + Override in a subclass to manipulate the request or metadata + before they are sent to the RegionInstantSnapshots server. + """ + return request, metadata + + def post_insert(self, response: compute.Operation) -> compute.Operation: + """Post-rpc interceptor for insert + + Override in a subclass to manipulate the response + after it is returned by the RegionInstantSnapshots server but before + it is returned to user code. + """ + return response + + def pre_list( + self, + request: compute.ListRegionInstantSnapshotsRequest, + metadata: Sequence[Tuple[str, str]], + ) -> Tuple[compute.ListRegionInstantSnapshotsRequest, Sequence[Tuple[str, str]]]: + """Pre-rpc interceptor for list + + Override in a subclass to manipulate the request or metadata + before they are sent to the RegionInstantSnapshots server. + """ + return request, metadata + + def post_list( + self, response: compute.InstantSnapshotList + ) -> compute.InstantSnapshotList: + """Post-rpc interceptor for list + + Override in a subclass to manipulate the response + after it is returned by the RegionInstantSnapshots server but before + it is returned to user code. + """ + return response + + def pre_set_iam_policy( + self, + request: compute.SetIamPolicyRegionInstantSnapshotRequest, + metadata: Sequence[Tuple[str, str]], + ) -> Tuple[ + compute.SetIamPolicyRegionInstantSnapshotRequest, Sequence[Tuple[str, str]] + ]: + """Pre-rpc interceptor for set_iam_policy + + Override in a subclass to manipulate the request or metadata + before they are sent to the RegionInstantSnapshots server. + """ + return request, metadata + + def post_set_iam_policy(self, response: compute.Policy) -> compute.Policy: + """Post-rpc interceptor for set_iam_policy + + Override in a subclass to manipulate the response + after it is returned by the RegionInstantSnapshots server but before + it is returned to user code. + """ + return response + + def pre_set_labels( + self, + request: compute.SetLabelsRegionInstantSnapshotRequest, + metadata: Sequence[Tuple[str, str]], + ) -> Tuple[ + compute.SetLabelsRegionInstantSnapshotRequest, Sequence[Tuple[str, str]] + ]: + """Pre-rpc interceptor for set_labels + + Override in a subclass to manipulate the request or metadata + before they are sent to the RegionInstantSnapshots server. + """ + return request, metadata + + def post_set_labels(self, response: compute.Operation) -> compute.Operation: + """Post-rpc interceptor for set_labels + + Override in a subclass to manipulate the response + after it is returned by the RegionInstantSnapshots server but before + it is returned to user code. + """ + return response + + def pre_test_iam_permissions( + self, + request: compute.TestIamPermissionsRegionInstantSnapshotRequest, + metadata: Sequence[Tuple[str, str]], + ) -> Tuple[ + compute.TestIamPermissionsRegionInstantSnapshotRequest, + Sequence[Tuple[str, str]], + ]: + """Pre-rpc interceptor for test_iam_permissions + + Override in a subclass to manipulate the request or metadata + before they are sent to the RegionInstantSnapshots server. + """ + return request, metadata + + def post_test_iam_permissions( + self, response: compute.TestPermissionsResponse + ) -> compute.TestPermissionsResponse: + """Post-rpc interceptor for test_iam_permissions + + Override in a subclass to manipulate the response + after it is returned by the RegionInstantSnapshots server but before + it is returned to user code. + """ + return response + + +@dataclasses.dataclass +class RegionInstantSnapshotsRestStub: + _session: AuthorizedSession + _host: str + _interceptor: RegionInstantSnapshotsRestInterceptor + + +class RegionInstantSnapshotsRestTransport(RegionInstantSnapshotsTransport): + """REST backend transport for RegionInstantSnapshots. + + The RegionInstantSnapshots 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 + + NOTE: This REST transport functionality is currently in a beta + state (preview). We welcome your feedback via an issue in this + library's source repository. Thank you! + """ + + 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[RegionInstantSnapshotsRestInterceptor] = 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 + 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, + ) + 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 RegionInstantSnapshotsRestInterceptor() + self._prep_wrapped_messages(client_info) + + class _Delete(RegionInstantSnapshotsRestStub): + def __hash__(self): + return hash("Delete") + + __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 + } + + def __call__( + self, + request: compute.DeleteRegionInstantSnapshotRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> compute.Operation: + r"""Call the delete method over HTTP. + + Args: + request (~.compute.DeleteRegionInstantSnapshotRequest): + The request object. A request message for + RegionInstantSnapshots.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, str]]): Strings which should be + sent along with the request as metadata. + + 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: List[Dict[str, str]] = [ + { + "method": "delete", + "uri": "/compute/v1/projects/{project}/regions/{region}/instantSnapshots/{instant_snapshot}", + }, + ] + request, metadata = self._interceptor.pre_delete(request, metadata) + pb_request = compute.DeleteRegionInstantSnapshotRequest.pb(request) + transcoded_request = path_template.transcode(http_options, pb_request) + + uri = transcoded_request["uri"] + method = transcoded_request["method"] + + # Jsonify the query params + query_params = json.loads( + json_format.MessageToJson( + transcoded_request["query_params"], + use_integers_for_enums=False, + ) + ) + query_params.update(self._get_unset_required_fields(query_params)) + + # Send the request + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = getattr(self._session, method)( + "{host}{uri}".format(host=self._host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + ) + + # 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) + return resp + + class _Get(RegionInstantSnapshotsRestStub): + def __hash__(self): + return hash("Get") + + __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 + } + + def __call__( + self, + request: compute.GetRegionInstantSnapshotRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> compute.InstantSnapshot: + r"""Call the get method over HTTP. + + Args: + request (~.compute.GetRegionInstantSnapshotRequest): + The request object. A request message for + RegionInstantSnapshots.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, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + ~.compute.InstantSnapshot: + Represents a InstantSnapshot + resource. You can use instant snapshots + to create disk rollback points quickly.. + + """ + + http_options: List[Dict[str, str]] = [ + { + "method": "get", + "uri": "/compute/v1/projects/{project}/regions/{region}/instantSnapshots/{instant_snapshot}", + }, + ] + request, metadata = self._interceptor.pre_get(request, metadata) + pb_request = compute.GetRegionInstantSnapshotRequest.pb(request) + transcoded_request = path_template.transcode(http_options, pb_request) + + uri = transcoded_request["uri"] + method = transcoded_request["method"] + + # Jsonify the query params + query_params = json.loads( + json_format.MessageToJson( + transcoded_request["query_params"], + use_integers_for_enums=False, + ) + ) + query_params.update(self._get_unset_required_fields(query_params)) + + # Send the request + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = getattr(self._session, method)( + "{host}{uri}".format(host=self._host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + ) + + # 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.InstantSnapshot() + pb_resp = compute.InstantSnapshot.pb(resp) + + json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True) + resp = self._interceptor.post_get(resp) + return resp + + class _GetIamPolicy(RegionInstantSnapshotsRestStub): + def __hash__(self): + return hash("GetIamPolicy") + + __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 + } + + def __call__( + self, + request: compute.GetIamPolicyRegionInstantSnapshotRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> compute.Policy: + r"""Call the get iam policy method over HTTP. + + Args: + request (~.compute.GetIamPolicyRegionInstantSnapshotRequest): + The request object. A request message for + RegionInstantSnapshots.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, str]]): Strings which should be + sent along with the request as metadata. + + 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: List[Dict[str, str]] = [ + { + "method": "get", + "uri": "/compute/v1/projects/{project}/regions/{region}/instantSnapshots/{resource}/getIamPolicy", + }, + ] + request, metadata = self._interceptor.pre_get_iam_policy(request, metadata) + pb_request = compute.GetIamPolicyRegionInstantSnapshotRequest.pb(request) + transcoded_request = path_template.transcode(http_options, pb_request) + + uri = transcoded_request["uri"] + method = transcoded_request["method"] + + # Jsonify the query params + query_params = json.loads( + json_format.MessageToJson( + transcoded_request["query_params"], + use_integers_for_enums=False, + ) + ) + query_params.update(self._get_unset_required_fields(query_params)) + + # Send the request + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = getattr(self._session, method)( + "{host}{uri}".format(host=self._host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + ) + + # 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) + return resp + + class _Insert(RegionInstantSnapshotsRestStub): + def __hash__(self): + return hash("Insert") + + __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 + } + + def __call__( + self, + request: compute.InsertRegionInstantSnapshotRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> compute.Operation: + r"""Call the insert method over HTTP. + + Args: + request (~.compute.InsertRegionInstantSnapshotRequest): + The request object. A request message for + RegionInstantSnapshots.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, str]]): Strings which should be + sent along with the request as metadata. + + 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: List[Dict[str, str]] = [ + { + "method": "post", + "uri": "/compute/v1/projects/{project}/regions/{region}/instantSnapshots", + "body": "instant_snapshot_resource", + }, + ] + request, metadata = self._interceptor.pre_insert(request, metadata) + pb_request = compute.InsertRegionInstantSnapshotRequest.pb(request) + transcoded_request = path_template.transcode(http_options, pb_request) + + # Jsonify the request body + + body = json_format.MessageToJson( + transcoded_request["body"], use_integers_for_enums=False + ) + uri = transcoded_request["uri"] + method = transcoded_request["method"] + + # Jsonify the query params + query_params = json.loads( + json_format.MessageToJson( + transcoded_request["query_params"], + use_integers_for_enums=False, + ) + ) + query_params.update(self._get_unset_required_fields(query_params)) + + # Send the request + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = getattr(self._session, method)( + "{host}{uri}".format(host=self._host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + data=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) + return resp + + class _List(RegionInstantSnapshotsRestStub): + def __hash__(self): + return hash("List") + + __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 + } + + def __call__( + self, + request: compute.ListRegionInstantSnapshotsRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> compute.InstantSnapshotList: + r"""Call the list method over HTTP. + + Args: + request (~.compute.ListRegionInstantSnapshotsRequest): + The request object. A request message for + RegionInstantSnapshots.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, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + ~.compute.InstantSnapshotList: + Contains a list of InstantSnapshot + resources. + + """ + + http_options: List[Dict[str, str]] = [ + { + "method": "get", + "uri": "/compute/v1/projects/{project}/regions/{region}/instantSnapshots", + }, + ] + request, metadata = self._interceptor.pre_list(request, metadata) + pb_request = compute.ListRegionInstantSnapshotsRequest.pb(request) + transcoded_request = path_template.transcode(http_options, pb_request) + + uri = transcoded_request["uri"] + method = transcoded_request["method"] + + # Jsonify the query params + query_params = json.loads( + json_format.MessageToJson( + transcoded_request["query_params"], + use_integers_for_enums=False, + ) + ) + query_params.update(self._get_unset_required_fields(query_params)) + + # Send the request + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = getattr(self._session, method)( + "{host}{uri}".format(host=self._host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + ) + + # 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.InstantSnapshotList() + pb_resp = compute.InstantSnapshotList.pb(resp) + + json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True) + resp = self._interceptor.post_list(resp) + return resp + + class _SetIamPolicy(RegionInstantSnapshotsRestStub): + def __hash__(self): + return hash("SetIamPolicy") + + __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 + } + + def __call__( + self, + request: compute.SetIamPolicyRegionInstantSnapshotRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> compute.Policy: + r"""Call the set iam policy method over HTTP. + + Args: + request (~.compute.SetIamPolicyRegionInstantSnapshotRequest): + The request object. A request message for + RegionInstantSnapshots.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, str]]): Strings which should be + sent along with the request as metadata. + + 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: List[Dict[str, str]] = [ + { + "method": "post", + "uri": "/compute/v1/projects/{project}/regions/{region}/instantSnapshots/{resource}/setIamPolicy", + "body": "region_set_policy_request_resource", + }, + ] + request, metadata = self._interceptor.pre_set_iam_policy(request, metadata) + pb_request = compute.SetIamPolicyRegionInstantSnapshotRequest.pb(request) + transcoded_request = path_template.transcode(http_options, pb_request) + + # Jsonify the request body + + body = json_format.MessageToJson( + transcoded_request["body"], use_integers_for_enums=False + ) + uri = transcoded_request["uri"] + method = transcoded_request["method"] + + # Jsonify the query params + query_params = json.loads( + json_format.MessageToJson( + transcoded_request["query_params"], + use_integers_for_enums=False, + ) + ) + query_params.update(self._get_unset_required_fields(query_params)) + + # Send the request + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = getattr(self._session, method)( + "{host}{uri}".format(host=self._host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + data=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) + return resp + + class _SetLabels(RegionInstantSnapshotsRestStub): + def __hash__(self): + return hash("SetLabels") + + __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 + } + + def __call__( + self, + request: compute.SetLabelsRegionInstantSnapshotRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> compute.Operation: + r"""Call the set labels method over HTTP. + + Args: + request (~.compute.SetLabelsRegionInstantSnapshotRequest): + The request object. A request message for + RegionInstantSnapshots.SetLabels. 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, str]]): Strings which should be + sent along with the request as metadata. + + 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: List[Dict[str, str]] = [ + { + "method": "post", + "uri": "/compute/v1/projects/{project}/regions/{region}/instantSnapshots/{resource}/setLabels", + "body": "region_set_labels_request_resource", + }, + ] + request, metadata = self._interceptor.pre_set_labels(request, metadata) + pb_request = compute.SetLabelsRegionInstantSnapshotRequest.pb(request) + transcoded_request = path_template.transcode(http_options, pb_request) + + # Jsonify the request body + + body = json_format.MessageToJson( + transcoded_request["body"], use_integers_for_enums=False + ) + uri = transcoded_request["uri"] + method = transcoded_request["method"] + + # Jsonify the query params + query_params = json.loads( + json_format.MessageToJson( + transcoded_request["query_params"], + use_integers_for_enums=False, + ) + ) + query_params.update(self._get_unset_required_fields(query_params)) + + # Send the request + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = getattr(self._session, method)( + "{host}{uri}".format(host=self._host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + data=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_set_labels(resp) + return resp + + class _TestIamPermissions(RegionInstantSnapshotsRestStub): + def __hash__(self): + return hash("TestIamPermissions") + + __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 + } + + def __call__( + self, + request: compute.TestIamPermissionsRegionInstantSnapshotRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> compute.TestPermissionsResponse: + r"""Call the test iam permissions method over HTTP. + + Args: + request (~.compute.TestIamPermissionsRegionInstantSnapshotRequest): + The request object. A request message for + RegionInstantSnapshots.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, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + ~.compute.TestPermissionsResponse: + + """ + + http_options: List[Dict[str, str]] = [ + { + "method": "post", + "uri": "/compute/v1/projects/{project}/regions/{region}/instantSnapshots/{resource}/testIamPermissions", + "body": "test_permissions_request_resource", + }, + ] + request, metadata = self._interceptor.pre_test_iam_permissions( + request, metadata + ) + pb_request = compute.TestIamPermissionsRegionInstantSnapshotRequest.pb( + request + ) + transcoded_request = path_template.transcode(http_options, pb_request) + + # Jsonify the request body + + body = json_format.MessageToJson( + transcoded_request["body"], use_integers_for_enums=False + ) + uri = transcoded_request["uri"] + method = transcoded_request["method"] + + # Jsonify the query params + query_params = json.loads( + json_format.MessageToJson( + transcoded_request["query_params"], + use_integers_for_enums=False, + ) + ) + query_params.update(self._get_unset_required_fields(query_params)) + + # Send the request + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = getattr(self._session, method)( + "{host}{uri}".format(host=self._host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + data=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) + return resp + + @property + def delete( + self, + ) -> Callable[[compute.DeleteRegionInstantSnapshotRequest], 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.GetRegionInstantSnapshotRequest], compute.InstantSnapshot]: + # 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.GetIamPolicyRegionInstantSnapshotRequest], 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 insert( + self, + ) -> Callable[[compute.InsertRegionInstantSnapshotRequest], 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.ListRegionInstantSnapshotsRequest], compute.InstantSnapshotList + ]: + # 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 set_iam_policy( + self, + ) -> Callable[[compute.SetIamPolicyRegionInstantSnapshotRequest], 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 set_labels( + self, + ) -> Callable[[compute.SetLabelsRegionInstantSnapshotRequest], 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._SetLabels(self._session, self._host, self._interceptor) # type: ignore + + @property + def test_iam_permissions( + self, + ) -> Callable[ + [compute.TestIamPermissionsRegionInstantSnapshotRequest], + 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__ = ("RegionInstantSnapshotsRestTransport",) diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/reservations/client.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/reservations/client.py index 3a6ee2026a2f..1f531e23d520 100644 --- a/packages/google-cloud-compute/google/cloud/compute_v1/services/reservations/client.py +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/reservations/client.py @@ -651,7 +651,9 @@ def aggregated_list( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.AggregatedListPager: - r"""Retrieves an aggregated list of reservations. + r"""Retrieves an aggregated list of reservations. To prevent + failure, Google recommends that you set the + ``returnPartialSuccess`` parameter to ``true``. .. code-block:: python diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/resource_policies/client.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/resource_policies/client.py index e9a8c172d28f..f5ce218d96b8 100644 --- a/packages/google-cloud-compute/google/cloud/compute_v1/services/resource_policies/client.py +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/resource_policies/client.py @@ -656,7 +656,9 @@ def aggregated_list( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.AggregatedListPager: - r"""Retrieves an aggregated list of resource policies. + r"""Retrieves an aggregated list of resource policies. To prevent + failure, Google recommends that you set the + ``returnPartialSuccess`` parameter to ``true``. .. code-block:: python diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/routers/client.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/routers/client.py index 6e68c9808d22..6b6f03118df1 100644 --- a/packages/google-cloud-compute/google/cloud/compute_v1/services/routers/client.py +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/routers/client.py @@ -649,7 +649,9 @@ def aggregated_list( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.AggregatedListPager: - r"""Retrieves an aggregated list of routers. + r"""Retrieves an aggregated list of routers. To prevent failure, + Google recommends that you set the ``returnPartialSuccess`` + parameter to ``true``. .. code-block:: python diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/security_policies/client.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/security_policies/client.py index 10ae8c259a27..9a179672ebc9 100644 --- a/packages/google-cloud-compute/google/cloud/compute_v1/services/security_policies/client.py +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/security_policies/client.py @@ -940,8 +940,10 @@ def aggregated_list( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.AggregatedListPager: - r"""Retrieves the list of all SecurityPolicy resources, - regional and global, available to the specified project. + r"""Retrieves the list of all SecurityPolicy resources, regional and + global, available to the specified project. To prevent failure, + Google recommends that you set the ``returnPartialSuccess`` + parameter to ``true``. .. code-block:: python diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/service_attachments/client.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/service_attachments/client.py index ad1a72a321c9..aaca939daa68 100644 --- a/packages/google-cloud-compute/google/cloud/compute_v1/services/service_attachments/client.py +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/service_attachments/client.py @@ -656,9 +656,10 @@ def aggregated_list( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.AggregatedListPager: - r"""Retrieves the list of all ServiceAttachment - resources, regional and global, available to the - specified project. + r"""Retrieves the list of all ServiceAttachment resources, regional + and global, available to the specified project. To prevent + failure, Google recommends that you set the + ``returnPartialSuccess`` parameter to ``true``. .. code-block:: python diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/ssl_certificates/client.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/ssl_certificates/client.py index 5f509cad70f0..e51ad150498d 100644 --- a/packages/google-cloud-compute/google/cloud/compute_v1/services/ssl_certificates/client.py +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/ssl_certificates/client.py @@ -656,8 +656,10 @@ def aggregated_list( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.AggregatedListPager: - r"""Retrieves the list of all SslCertificate resources, - regional and global, available to the specified project. + r"""Retrieves the list of all SslCertificate resources, regional and + global, available to the specified project. To prevent failure, + Google recommends that you set the ``returnPartialSuccess`` + parameter to ``true``. .. code-block:: python diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/ssl_policies/client.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/ssl_policies/client.py index 3b0bef738566..93b1f5bb3449 100644 --- a/packages/google-cloud-compute/google/cloud/compute_v1/services/ssl_policies/client.py +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/ssl_policies/client.py @@ -649,8 +649,10 @@ def aggregated_list( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.AggregatedListPager: - r"""Retrieves the list of all SslPolicy resources, - regional and global, available to the specified project. + r"""Retrieves the list of all SslPolicy resources, regional and + global, available to the specified project. To prevent failure, + Google recommends that you set the ``returnPartialSuccess`` + parameter to ``true``. .. code-block:: python diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/subnetworks/client.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/subnetworks/client.py index 928f68fc11dc..c26e735f3cd6 100644 --- a/packages/google-cloud-compute/google/cloud/compute_v1/services/subnetworks/client.py +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/subnetworks/client.py @@ -649,7 +649,9 @@ def aggregated_list( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.AggregatedListPager: - r"""Retrieves an aggregated list of subnetworks. + r"""Retrieves an aggregated list of subnetworks. To prevent failure, + Google recommends that you set the ``returnPartialSuccess`` + parameter to ``true``. .. code-block:: python diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/target_http_proxies/client.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/target_http_proxies/client.py index b95fc1a0b048..646e1b3d8e20 100644 --- a/packages/google-cloud-compute/google/cloud/compute_v1/services/target_http_proxies/client.py +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/target_http_proxies/client.py @@ -656,8 +656,10 @@ def aggregated_list( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.AggregatedListPager: - r"""Retrieves the list of all TargetHttpProxy resources, - regional and global, available to the specified project. + r"""Retrieves the list of all TargetHttpProxy resources, regional + and global, available to the specified project. To prevent + failure, Google recommends that you set the + ``returnPartialSuccess`` parameter to ``true``. .. code-block:: python diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/target_https_proxies/client.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/target_https_proxies/client.py index 07311f0958b1..0ece65f2cee9 100644 --- a/packages/google-cloud-compute/google/cloud/compute_v1/services/target_https_proxies/client.py +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/target_https_proxies/client.py @@ -656,8 +656,10 @@ def aggregated_list( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.AggregatedListPager: - r"""Retrieves the list of all TargetHttpsProxy resources, - regional and global, available to the specified project. + r"""Retrieves the list of all TargetHttpsProxy resources, regional + and global, available to the specified project. To prevent + failure, Google recommends that you set the + ``returnPartialSuccess`` parameter to ``true``. .. code-block:: python diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/target_instances/client.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/target_instances/client.py index 7e36eb483f8e..07e12ad2da9e 100644 --- a/packages/google-cloud-compute/google/cloud/compute_v1/services/target_instances/client.py +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/target_instances/client.py @@ -656,7 +656,9 @@ def aggregated_list( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.AggregatedListPager: - r"""Retrieves an aggregated list of target instances. + r"""Retrieves an aggregated list of target instances. To prevent + failure, Google recommends that you set the + ``returnPartialSuccess`` parameter to ``true``. .. code-block:: python diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/target_pools/client.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/target_pools/client.py index 25e929b62269..3f532256e266 100644 --- a/packages/google-cloud-compute/google/cloud/compute_v1/services/target_pools/client.py +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/target_pools/client.py @@ -1293,7 +1293,9 @@ def aggregated_list( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.AggregatedListPager: - r"""Retrieves an aggregated list of target pools. + r"""Retrieves an aggregated list of target pools. To prevent + failure, Google recommends that you set the + ``returnPartialSuccess`` parameter to ``true``. .. code-block:: python diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/target_tcp_proxies/client.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/target_tcp_proxies/client.py index 23d6f365d728..2519a4fc4fad 100644 --- a/packages/google-cloud-compute/google/cloud/compute_v1/services/target_tcp_proxies/client.py +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/target_tcp_proxies/client.py @@ -656,8 +656,10 @@ def aggregated_list( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.AggregatedListPager: - r"""Retrieves the list of all TargetTcpProxy resources, - regional and global, available to the specified project. + r"""Retrieves the list of all TargetTcpProxy resources, regional and + global, available to the specified project. To prevent failure, + Google recommends that you set the ``returnPartialSuccess`` + parameter to ``true``. .. code-block:: python diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/target_vpn_gateways/client.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/target_vpn_gateways/client.py index 6928fe665006..03e6a0f1e87c 100644 --- a/packages/google-cloud-compute/google/cloud/compute_v1/services/target_vpn_gateways/client.py +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/target_vpn_gateways/client.py @@ -656,7 +656,9 @@ def aggregated_list( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.AggregatedListPager: - r"""Retrieves an aggregated list of target VPN gateways. + r"""Retrieves an aggregated list of target VPN gateways. To prevent + failure, Google recommends that you set the + ``returnPartialSuccess`` parameter to ``true``. .. code-block:: python diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/url_maps/client.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/url_maps/client.py index e114fcb6a05f..4532a8dd8d93 100644 --- a/packages/google-cloud-compute/google/cloud/compute_v1/services/url_maps/client.py +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/url_maps/client.py @@ -649,8 +649,10 @@ def aggregated_list( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.AggregatedListPager: - r"""Retrieves the list of all UrlMap resources, regional - and global, available to the specified project. + r"""Retrieves the list of all UrlMap resources, regional and global, + available to the specified project. To prevent failure, Google + recommends that you set the ``returnPartialSuccess`` parameter + to ``true``. .. code-block:: python diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/vpn_gateways/client.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/vpn_gateways/client.py index 05ea67388990..4054ba4e3707 100644 --- a/packages/google-cloud-compute/google/cloud/compute_v1/services/vpn_gateways/client.py +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/vpn_gateways/client.py @@ -649,7 +649,9 @@ def aggregated_list( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.AggregatedListPager: - r"""Retrieves an aggregated list of VPN gateways. + r"""Retrieves an aggregated list of VPN gateways. To prevent + failure, Google recommends that you set the + ``returnPartialSuccess`` parameter to ``true``. .. code-block:: python diff --git a/packages/google-cloud-compute/google/cloud/compute_v1/services/vpn_tunnels/client.py b/packages/google-cloud-compute/google/cloud/compute_v1/services/vpn_tunnels/client.py index 748a1a5ffad6..faa6b2755e23 100644 --- a/packages/google-cloud-compute/google/cloud/compute_v1/services/vpn_tunnels/client.py +++ b/packages/google-cloud-compute/google/cloud/compute_v1/services/vpn_tunnels/client.py @@ -649,7 +649,9 @@ def aggregated_list( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.AggregatedListPager: - r"""Retrieves an aggregated list of VPN tunnels. + r"""Retrieves an aggregated list of VPN tunnels. To prevent failure, + Google recommends that you set the ``returnPartialSuccess`` + parameter to ``true``. .. code-block:: python 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 f340df05c708..2907d172c7a0 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 @@ -60,6 +60,7 @@ AggregatedListInstanceGroupsRequest, AggregatedListInstancesRequest, AggregatedListInstanceTemplatesRequest, + AggregatedListInstantSnapshotsRequest, AggregatedListInterconnectAttachmentsRequest, AggregatedListMachineTypesRequest, AggregatedListNetworkAttachmentsRequest, @@ -209,6 +210,7 @@ DeleteInstancesInstanceGroupManagerRequest, DeleteInstancesRegionInstanceGroupManagerRequest, DeleteInstanceTemplateRequest, + DeleteInstantSnapshotRequest, DeleteInterconnectAttachmentRequest, DeleteInterconnectRequest, DeleteLicenseRequest, @@ -233,6 +235,7 @@ DeleteRegionHealthCheckServiceRequest, DeleteRegionInstanceGroupManagerRequest, DeleteRegionInstanceTemplateRequest, + DeleteRegionInstantSnapshotRequest, DeleteRegionNetworkEndpointGroupRequest, DeleteRegionNetworkFirewallPolicyRequest, DeleteRegionNotificationEndpointRequest, @@ -372,6 +375,7 @@ GetIamPolicyImageRequest, GetIamPolicyInstanceRequest, GetIamPolicyInstanceTemplateRequest, + GetIamPolicyInstantSnapshotRequest, GetIamPolicyLicenseRequest, GetIamPolicyMachineImageRequest, GetIamPolicyNetworkAttachmentRequest, @@ -380,6 +384,7 @@ GetIamPolicyNodeTemplateRequest, GetIamPolicyRegionBackendServiceRequest, GetIamPolicyRegionDiskRequest, + GetIamPolicyRegionInstantSnapshotRequest, GetIamPolicyRegionNetworkFirewallPolicyRequest, GetIamPolicyReservationRequest, GetIamPolicyResourcePolicyRequest, @@ -392,6 +397,7 @@ GetInstanceGroupRequest, GetInstanceRequest, GetInstanceTemplateRequest, + GetInstantSnapshotRequest, GetInterconnectAttachmentRequest, GetInterconnectLocationRequest, GetInterconnectRemoteLocationRequest, @@ -425,6 +431,7 @@ GetRegionInstanceGroupManagerRequest, GetRegionInstanceGroupRequest, GetRegionInstanceTemplateRequest, + GetRegionInstantSnapshotRequest, GetRegionNetworkEndpointGroupRequest, GetRegionNetworkFirewallPolicyRequest, GetRegionNotificationEndpointRequest, @@ -536,6 +543,7 @@ InsertInstanceGroupRequest, InsertInstanceRequest, InsertInstanceTemplateRequest, + InsertInstantSnapshotRequest, InsertInterconnectAttachmentRequest, InsertInterconnectRequest, InsertLicenseRequest, @@ -558,6 +566,7 @@ InsertRegionHealthCheckServiceRequest, InsertRegionInstanceGroupManagerRequest, InsertRegionInstanceTemplateRequest, + InsertRegionInstantSnapshotRequest, InsertRegionNetworkEndpointGroupRequest, InsertRegionNetworkFirewallPolicyRequest, InsertRegionNotificationEndpointRequest, @@ -659,6 +668,11 @@ InstanceTemplateList, InstanceTemplatesScopedList, InstanceWithNamedPorts, + InstantSnapshot, + InstantSnapshotAggregatedList, + InstantSnapshotList, + InstantSnapshotResourceStatus, + InstantSnapshotsScopedList, Int64RangeMatch, Interconnect, InterconnectAttachment, @@ -730,6 +744,7 @@ ListInstancesRegionInstanceGroupsRequest, ListInstancesRequest, ListInstanceTemplatesRequest, + ListInstantSnapshotsRequest, ListInterconnectAttachmentsRequest, ListInterconnectLocationsRequest, ListInterconnectRemoteLocationsRequest, @@ -768,6 +783,7 @@ ListRegionInstanceGroupManagersRequest, ListRegionInstanceGroupsRequest, ListRegionInstanceTemplatesRequest, + ListRegionInstantSnapshotsRequest, ListRegionNetworkEndpointGroupsRequest, ListRegionNetworkFirewallPoliciesRequest, ListRegionNotificationEndpointsRequest, @@ -978,6 +994,7 @@ ProjectsEnableXpnResourceRequest, ProjectsGetXpnResources, ProjectsListXpnHostsRequest, + ProjectsSetCloudArmorTierRequest, ProjectsSetDefaultNetworkTierRequest, PublicAdvertisedPrefix, PublicAdvertisedPrefixList, @@ -1159,6 +1176,7 @@ SetBackupTargetPoolRequest, SetCertificateMapTargetHttpsProxyRequest, SetCertificateMapTargetSslProxyRequest, + SetCloudArmorTierProjectRequest, SetCommonInstanceMetadataOperationMetadata, SetCommonInstanceMetadataOperationMetadataPerLocationOperationInfo, SetCommonInstanceMetadataProjectRequest, @@ -1174,6 +1192,7 @@ SetIamPolicyImageRequest, SetIamPolicyInstanceRequest, SetIamPolicyInstanceTemplateRequest, + SetIamPolicyInstantSnapshotRequest, SetIamPolicyLicenseRequest, SetIamPolicyMachineImageRequest, SetIamPolicyNetworkAttachmentRequest, @@ -1182,6 +1201,7 @@ SetIamPolicyNodeTemplateRequest, SetIamPolicyRegionBackendServiceRequest, SetIamPolicyRegionDiskRequest, + SetIamPolicyRegionInstantSnapshotRequest, SetIamPolicyRegionNetworkFirewallPolicyRequest, SetIamPolicyReservationRequest, SetIamPolicyResourcePolicyRequest, @@ -1198,9 +1218,11 @@ SetLabelsGlobalForwardingRuleRequest, SetLabelsImageRequest, SetLabelsInstanceRequest, + SetLabelsInstantSnapshotRequest, SetLabelsInterconnectAttachmentRequest, SetLabelsInterconnectRequest, SetLabelsRegionDiskRequest, + SetLabelsRegionInstantSnapshotRequest, SetLabelsSecurityPolicyRequest, SetLabelsSnapshotRequest, SetLabelsTargetVpnGatewayRequest, @@ -1350,6 +1372,7 @@ TestIamPermissionsImageRequest, TestIamPermissionsInstanceRequest, TestIamPermissionsInstanceTemplateRequest, + TestIamPermissionsInstantSnapshotRequest, TestIamPermissionsLicenseCodeRequest, TestIamPermissionsLicenseRequest, TestIamPermissionsMachineImageRequest, @@ -1361,6 +1384,7 @@ TestIamPermissionsPacketMirroringRequest, TestIamPermissionsRegionBackendServiceRequest, TestIamPermissionsRegionDiskRequest, + TestIamPermissionsRegionInstantSnapshotRequest, TestIamPermissionsRegionNetworkFirewallPolicyRequest, TestIamPermissionsReservationRequest, TestIamPermissionsResourcePolicyRequest, @@ -1495,6 +1519,7 @@ "AggregatedListInstanceGroupsRequest", "AggregatedListInstancesRequest", "AggregatedListInstanceTemplatesRequest", + "AggregatedListInstantSnapshotsRequest", "AggregatedListInterconnectAttachmentsRequest", "AggregatedListMachineTypesRequest", "AggregatedListNetworkAttachmentsRequest", @@ -1644,6 +1669,7 @@ "DeleteInstancesInstanceGroupManagerRequest", "DeleteInstancesRegionInstanceGroupManagerRequest", "DeleteInstanceTemplateRequest", + "DeleteInstantSnapshotRequest", "DeleteInterconnectAttachmentRequest", "DeleteInterconnectRequest", "DeleteLicenseRequest", @@ -1668,6 +1694,7 @@ "DeleteRegionHealthCheckServiceRequest", "DeleteRegionInstanceGroupManagerRequest", "DeleteRegionInstanceTemplateRequest", + "DeleteRegionInstantSnapshotRequest", "DeleteRegionNetworkEndpointGroupRequest", "DeleteRegionNetworkFirewallPolicyRequest", "DeleteRegionNotificationEndpointRequest", @@ -1807,6 +1834,7 @@ "GetIamPolicyImageRequest", "GetIamPolicyInstanceRequest", "GetIamPolicyInstanceTemplateRequest", + "GetIamPolicyInstantSnapshotRequest", "GetIamPolicyLicenseRequest", "GetIamPolicyMachineImageRequest", "GetIamPolicyNetworkAttachmentRequest", @@ -1815,6 +1843,7 @@ "GetIamPolicyNodeTemplateRequest", "GetIamPolicyRegionBackendServiceRequest", "GetIamPolicyRegionDiskRequest", + "GetIamPolicyRegionInstantSnapshotRequest", "GetIamPolicyRegionNetworkFirewallPolicyRequest", "GetIamPolicyReservationRequest", "GetIamPolicyResourcePolicyRequest", @@ -1827,6 +1856,7 @@ "GetInstanceGroupRequest", "GetInstanceRequest", "GetInstanceTemplateRequest", + "GetInstantSnapshotRequest", "GetInterconnectAttachmentRequest", "GetInterconnectLocationRequest", "GetInterconnectRemoteLocationRequest", @@ -1860,6 +1890,7 @@ "GetRegionInstanceGroupManagerRequest", "GetRegionInstanceGroupRequest", "GetRegionInstanceTemplateRequest", + "GetRegionInstantSnapshotRequest", "GetRegionNetworkEndpointGroupRequest", "GetRegionNetworkFirewallPolicyRequest", "GetRegionNotificationEndpointRequest", @@ -1971,6 +2002,7 @@ "InsertInstanceGroupRequest", "InsertInstanceRequest", "InsertInstanceTemplateRequest", + "InsertInstantSnapshotRequest", "InsertInterconnectAttachmentRequest", "InsertInterconnectRequest", "InsertLicenseRequest", @@ -1993,6 +2025,7 @@ "InsertRegionHealthCheckServiceRequest", "InsertRegionInstanceGroupManagerRequest", "InsertRegionInstanceTemplateRequest", + "InsertRegionInstantSnapshotRequest", "InsertRegionNetworkEndpointGroupRequest", "InsertRegionNetworkFirewallPolicyRequest", "InsertRegionNotificationEndpointRequest", @@ -2094,6 +2127,11 @@ "InstanceTemplateList", "InstanceTemplatesScopedList", "InstanceWithNamedPorts", + "InstantSnapshot", + "InstantSnapshotAggregatedList", + "InstantSnapshotList", + "InstantSnapshotResourceStatus", + "InstantSnapshotsScopedList", "Int64RangeMatch", "Interconnect", "InterconnectAttachment", @@ -2165,6 +2203,7 @@ "ListInstancesRegionInstanceGroupsRequest", "ListInstancesRequest", "ListInstanceTemplatesRequest", + "ListInstantSnapshotsRequest", "ListInterconnectAttachmentsRequest", "ListInterconnectLocationsRequest", "ListInterconnectRemoteLocationsRequest", @@ -2203,6 +2242,7 @@ "ListRegionInstanceGroupManagersRequest", "ListRegionInstanceGroupsRequest", "ListRegionInstanceTemplatesRequest", + "ListRegionInstantSnapshotsRequest", "ListRegionNetworkEndpointGroupsRequest", "ListRegionNetworkFirewallPoliciesRequest", "ListRegionNotificationEndpointsRequest", @@ -2413,6 +2453,7 @@ "ProjectsEnableXpnResourceRequest", "ProjectsGetXpnResources", "ProjectsListXpnHostsRequest", + "ProjectsSetCloudArmorTierRequest", "ProjectsSetDefaultNetworkTierRequest", "PublicAdvertisedPrefix", "PublicAdvertisedPrefixList", @@ -2594,6 +2635,7 @@ "SetBackupTargetPoolRequest", "SetCertificateMapTargetHttpsProxyRequest", "SetCertificateMapTargetSslProxyRequest", + "SetCloudArmorTierProjectRequest", "SetCommonInstanceMetadataOperationMetadata", "SetCommonInstanceMetadataOperationMetadataPerLocationOperationInfo", "SetCommonInstanceMetadataProjectRequest", @@ -2609,6 +2651,7 @@ "SetIamPolicyImageRequest", "SetIamPolicyInstanceRequest", "SetIamPolicyInstanceTemplateRequest", + "SetIamPolicyInstantSnapshotRequest", "SetIamPolicyLicenseRequest", "SetIamPolicyMachineImageRequest", "SetIamPolicyNetworkAttachmentRequest", @@ -2617,6 +2660,7 @@ "SetIamPolicyNodeTemplateRequest", "SetIamPolicyRegionBackendServiceRequest", "SetIamPolicyRegionDiskRequest", + "SetIamPolicyRegionInstantSnapshotRequest", "SetIamPolicyRegionNetworkFirewallPolicyRequest", "SetIamPolicyReservationRequest", "SetIamPolicyResourcePolicyRequest", @@ -2633,9 +2677,11 @@ "SetLabelsGlobalForwardingRuleRequest", "SetLabelsImageRequest", "SetLabelsInstanceRequest", + "SetLabelsInstantSnapshotRequest", "SetLabelsInterconnectAttachmentRequest", "SetLabelsInterconnectRequest", "SetLabelsRegionDiskRequest", + "SetLabelsRegionInstantSnapshotRequest", "SetLabelsSecurityPolicyRequest", "SetLabelsSnapshotRequest", "SetLabelsTargetVpnGatewayRequest", @@ -2785,6 +2831,7 @@ "TestIamPermissionsImageRequest", "TestIamPermissionsInstanceRequest", "TestIamPermissionsInstanceTemplateRequest", + "TestIamPermissionsInstantSnapshotRequest", "TestIamPermissionsLicenseCodeRequest", "TestIamPermissionsLicenseRequest", "TestIamPermissionsMachineImageRequest", @@ -2796,6 +2843,7 @@ "TestIamPermissionsPacketMirroringRequest", "TestIamPermissionsRegionBackendServiceRequest", "TestIamPermissionsRegionDiskRequest", + "TestIamPermissionsRegionInstantSnapshotRequest", "TestIamPermissionsRegionNetworkFirewallPolicyRequest", "TestIamPermissionsReservationRequest", "TestIamPermissionsResourcePolicyRequest", 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 0ffe9bf52bab..9628f25f7a45 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 @@ -70,6 +70,7 @@ "AggregatedListInstanceGroupsRequest", "AggregatedListInstanceTemplatesRequest", "AggregatedListInstancesRequest", + "AggregatedListInstantSnapshotsRequest", "AggregatedListInterconnectAttachmentsRequest", "AggregatedListMachineTypesRequest", "AggregatedListNetworkAttachmentsRequest", @@ -218,6 +219,7 @@ "DeleteInstanceTemplateRequest", "DeleteInstancesInstanceGroupManagerRequest", "DeleteInstancesRegionInstanceGroupManagerRequest", + "DeleteInstantSnapshotRequest", "DeleteInterconnectAttachmentRequest", "DeleteInterconnectRequest", "DeleteLicenseRequest", @@ -242,6 +244,7 @@ "DeleteRegionHealthCheckServiceRequest", "DeleteRegionInstanceGroupManagerRequest", "DeleteRegionInstanceTemplateRequest", + "DeleteRegionInstantSnapshotRequest", "DeleteRegionNetworkEndpointGroupRequest", "DeleteRegionNetworkFirewallPolicyRequest", "DeleteRegionNotificationEndpointRequest", @@ -382,6 +385,7 @@ "GetIamPolicyImageRequest", "GetIamPolicyInstanceRequest", "GetIamPolicyInstanceTemplateRequest", + "GetIamPolicyInstantSnapshotRequest", "GetIamPolicyLicenseRequest", "GetIamPolicyMachineImageRequest", "GetIamPolicyNetworkAttachmentRequest", @@ -390,6 +394,7 @@ "GetIamPolicyNodeTemplateRequest", "GetIamPolicyRegionBackendServiceRequest", "GetIamPolicyRegionDiskRequest", + "GetIamPolicyRegionInstantSnapshotRequest", "GetIamPolicyRegionNetworkFirewallPolicyRequest", "GetIamPolicyReservationRequest", "GetIamPolicyResourcePolicyRequest", @@ -402,6 +407,7 @@ "GetInstanceGroupRequest", "GetInstanceRequest", "GetInstanceTemplateRequest", + "GetInstantSnapshotRequest", "GetInterconnectAttachmentRequest", "GetInterconnectLocationRequest", "GetInterconnectRemoteLocationRequest", @@ -435,6 +441,7 @@ "GetRegionInstanceGroupManagerRequest", "GetRegionInstanceGroupRequest", "GetRegionInstanceTemplateRequest", + "GetRegionInstantSnapshotRequest", "GetRegionNetworkEndpointGroupRequest", "GetRegionNetworkFirewallPolicyRequest", "GetRegionNotificationEndpointRequest", @@ -545,6 +552,7 @@ "InsertInstanceGroupRequest", "InsertInstanceRequest", "InsertInstanceTemplateRequest", + "InsertInstantSnapshotRequest", "InsertInterconnectAttachmentRequest", "InsertInterconnectRequest", "InsertLicenseRequest", @@ -567,6 +575,7 @@ "InsertRegionHealthCheckServiceRequest", "InsertRegionInstanceGroupManagerRequest", "InsertRegionInstanceTemplateRequest", + "InsertRegionInstantSnapshotRequest", "InsertRegionNetworkEndpointGroupRequest", "InsertRegionNetworkFirewallPolicyRequest", "InsertRegionNotificationEndpointRequest", @@ -668,6 +677,11 @@ "InstancesSetSecurityPolicyRequest", "InstancesSetServiceAccountRequest", "InstancesStartWithEncryptionKeyRequest", + "InstantSnapshot", + "InstantSnapshotAggregatedList", + "InstantSnapshotList", + "InstantSnapshotResourceStatus", + "InstantSnapshotsScopedList", "Int64RangeMatch", "Interconnect", "InterconnectAttachment", @@ -739,6 +753,7 @@ "ListInstancesInstanceGroupsRequest", "ListInstancesRegionInstanceGroupsRequest", "ListInstancesRequest", + "ListInstantSnapshotsRequest", "ListInterconnectAttachmentsRequest", "ListInterconnectLocationsRequest", "ListInterconnectRemoteLocationsRequest", @@ -777,6 +792,7 @@ "ListRegionInstanceGroupManagersRequest", "ListRegionInstanceGroupsRequest", "ListRegionInstanceTemplatesRequest", + "ListRegionInstantSnapshotsRequest", "ListRegionNetworkEndpointGroupsRequest", "ListRegionNetworkFirewallPoliciesRequest", "ListRegionNotificationEndpointsRequest", @@ -987,6 +1003,7 @@ "ProjectsEnableXpnResourceRequest", "ProjectsGetXpnResources", "ProjectsListXpnHostsRequest", + "ProjectsSetCloudArmorTierRequest", "ProjectsSetDefaultNetworkTierRequest", "PublicAdvertisedPrefix", "PublicAdvertisedPrefixList", @@ -1169,6 +1186,7 @@ "SetBackupTargetPoolRequest", "SetCertificateMapTargetHttpsProxyRequest", "SetCertificateMapTargetSslProxyRequest", + "SetCloudArmorTierProjectRequest", "SetCommonInstanceMetadataOperationMetadata", "SetCommonInstanceMetadataOperationMetadataPerLocationOperationInfo", "SetCommonInstanceMetadataProjectRequest", @@ -1184,6 +1202,7 @@ "SetIamPolicyImageRequest", "SetIamPolicyInstanceRequest", "SetIamPolicyInstanceTemplateRequest", + "SetIamPolicyInstantSnapshotRequest", "SetIamPolicyLicenseRequest", "SetIamPolicyMachineImageRequest", "SetIamPolicyNetworkAttachmentRequest", @@ -1192,6 +1211,7 @@ "SetIamPolicyNodeTemplateRequest", "SetIamPolicyRegionBackendServiceRequest", "SetIamPolicyRegionDiskRequest", + "SetIamPolicyRegionInstantSnapshotRequest", "SetIamPolicyRegionNetworkFirewallPolicyRequest", "SetIamPolicyReservationRequest", "SetIamPolicyResourcePolicyRequest", @@ -1208,9 +1228,11 @@ "SetLabelsGlobalForwardingRuleRequest", "SetLabelsImageRequest", "SetLabelsInstanceRequest", + "SetLabelsInstantSnapshotRequest", "SetLabelsInterconnectAttachmentRequest", "SetLabelsInterconnectRequest", "SetLabelsRegionDiskRequest", + "SetLabelsRegionInstantSnapshotRequest", "SetLabelsSecurityPolicyRequest", "SetLabelsSnapshotRequest", "SetLabelsTargetVpnGatewayRequest", @@ -1359,6 +1381,7 @@ "TestIamPermissionsImageRequest", "TestIamPermissionsInstanceRequest", "TestIamPermissionsInstanceTemplateRequest", + "TestIamPermissionsInstantSnapshotRequest", "TestIamPermissionsLicenseCodeRequest", "TestIamPermissionsLicenseRequest", "TestIamPermissionsMachineImageRequest", @@ -1370,6 +1393,7 @@ "TestIamPermissionsPacketMirroringRequest", "TestIamPermissionsRegionBackendServiceRequest", "TestIamPermissionsRegionDiskRequest", + "TestIamPermissionsRegionInstantSnapshotRequest", "TestIamPermissionsRegionNetworkFirewallPolicyRequest", "TestIamPermissionsReservationRequest", "TestIamPermissionsResourcePolicyRequest", @@ -4162,7 +4186,11 @@ class AggregatedListAcceleratorTypesRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. service_project_number (int): @@ -4312,7 +4340,11 @@ class AggregatedListAddressesRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. service_project_number (int): @@ -4462,7 +4494,11 @@ class AggregatedListAutoscalersRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. service_project_number (int): @@ -4612,7 +4648,11 @@ class AggregatedListBackendServicesRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. service_project_number (int): @@ -4762,7 +4802,11 @@ class AggregatedListDiskTypesRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. service_project_number (int): @@ -4912,7 +4956,11 @@ class AggregatedListDisksRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. service_project_number (int): @@ -5062,7 +5110,11 @@ class AggregatedListForwardingRulesRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. service_project_number (int): @@ -5212,7 +5264,11 @@ class AggregatedListGlobalOperationsRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. service_project_number (int): @@ -5362,7 +5418,11 @@ class AggregatedListHealthChecksRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. service_project_number (int): @@ -5512,7 +5572,11 @@ class AggregatedListInstanceGroupManagersRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. service_project_number (int): @@ -5662,7 +5726,11 @@ class AggregatedListInstanceGroupsRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. service_project_number (int): @@ -5812,7 +5880,11 @@ class AggregatedListInstanceTemplatesRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. service_project_number (int): @@ -5962,7 +6034,11 @@ class AggregatedListInstancesRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. service_project_number (int): @@ -6014,9 +6090,9 @@ class AggregatedListInstancesRequest(proto.Message): ) -class AggregatedListInterconnectAttachmentsRequest(proto.Message): - r"""A request message for InterconnectAttachments.AggregatedList. - See the method description for details. +class AggregatedListInstantSnapshotsRequest(proto.Message): + r"""A request message for InstantSnapshots.AggregatedList. See + the method description for details. .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields @@ -6112,7 +6188,11 @@ class AggregatedListInterconnectAttachmentsRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. service_project_number (int): @@ -6164,9 +6244,9 @@ class AggregatedListInterconnectAttachmentsRequest(proto.Message): ) -class AggregatedListMachineTypesRequest(proto.Message): - r"""A request message for MachineTypes.AggregatedList. See the - method description for details. +class AggregatedListInterconnectAttachmentsRequest(proto.Message): + r"""A request message for InterconnectAttachments.AggregatedList. + See the method description for details. .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields @@ -6262,7 +6342,11 @@ class AggregatedListMachineTypesRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. service_project_number (int): @@ -6314,9 +6398,9 @@ class AggregatedListMachineTypesRequest(proto.Message): ) -class AggregatedListNetworkAttachmentsRequest(proto.Message): - r"""A request message for NetworkAttachments.AggregatedList. See - the method description for details. +class AggregatedListMachineTypesRequest(proto.Message): + r"""A request message for MachineTypes.AggregatedList. See the + method description for details. .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields @@ -6412,7 +6496,11 @@ class AggregatedListNetworkAttachmentsRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. service_project_number (int): @@ -6464,10 +6552,9 @@ class AggregatedListNetworkAttachmentsRequest(proto.Message): ) -class AggregatedListNetworkEdgeSecurityServicesRequest(proto.Message): - r"""A request message for - NetworkEdgeSecurityServices.AggregatedList. See the method - description for details. +class AggregatedListNetworkAttachmentsRequest(proto.Message): + r"""A request message for NetworkAttachments.AggregatedList. See + the method description for details. .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields @@ -6559,11 +6646,15 @@ class AggregatedListNetworkEdgeSecurityServicesRequest(proto.Message): This field is a member of `oneof`_ ``_page_token``. project (str): - Name of the project scoping this request. + 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. + 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``. service_project_number (int): @@ -6615,9 +6706,10 @@ class AggregatedListNetworkEdgeSecurityServicesRequest(proto.Message): ) -class AggregatedListNetworkEndpointGroupsRequest(proto.Message): - r"""A request message for NetworkEndpointGroups.AggregatedList. - See the method description for details. +class AggregatedListNetworkEdgeSecurityServicesRequest(proto.Message): + r"""A request message for + NetworkEdgeSecurityServices.AggregatedList. See the method + description for details. .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields @@ -6709,11 +6801,15 @@ class AggregatedListNetworkEndpointGroupsRequest(proto.Message): This field is a member of `oneof`_ ``_page_token``. project (str): - Project ID for this request. + Name of the project scoping 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. + 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``. service_project_number (int): @@ -6765,9 +6861,9 @@ class AggregatedListNetworkEndpointGroupsRequest(proto.Message): ) -class AggregatedListNodeGroupsRequest(proto.Message): - r"""A request message for NodeGroups.AggregatedList. See the - method description for details. +class AggregatedListNetworkEndpointGroupsRequest(proto.Message): + r"""A request message for NetworkEndpointGroups.AggregatedList. + See the method description for details. .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields @@ -6863,7 +6959,11 @@ class AggregatedListNodeGroupsRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. service_project_number (int): @@ -6915,8 +7015,8 @@ class AggregatedListNodeGroupsRequest(proto.Message): ) -class AggregatedListNodeTemplatesRequest(proto.Message): - r"""A request message for NodeTemplates.AggregatedList. See the +class AggregatedListNodeGroupsRequest(proto.Message): + r"""A request message for NodeGroups.AggregatedList. See the method description for details. @@ -7013,7 +7113,11 @@ class AggregatedListNodeTemplatesRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. service_project_number (int): @@ -7065,8 +7169,8 @@ class AggregatedListNodeTemplatesRequest(proto.Message): ) -class AggregatedListNodeTypesRequest(proto.Message): - r"""A request message for NodeTypes.AggregatedList. See the +class AggregatedListNodeTemplatesRequest(proto.Message): + r"""A request message for NodeTemplates.AggregatedList. See the method description for details. @@ -7163,7 +7267,11 @@ class AggregatedListNodeTypesRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. service_project_number (int): @@ -7215,9 +7323,9 @@ class AggregatedListNodeTypesRequest(proto.Message): ) -class AggregatedListPacketMirroringsRequest(proto.Message): - r"""A request message for PacketMirrorings.AggregatedList. See - the method description for details. +class AggregatedListNodeTypesRequest(proto.Message): + r"""A request message for NodeTypes.AggregatedList. See the + method description for details. .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields @@ -7313,7 +7421,11 @@ class AggregatedListPacketMirroringsRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. service_project_number (int): @@ -7365,158 +7477,8 @@ class AggregatedListPacketMirroringsRequest(proto.Message): ) -class AggregatedListPublicDelegatedPrefixesRequest(proto.Message): - r"""A request message for PublicDelegatedPrefixes.AggregatedList. - 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``. - include_all_scopes (bool): - Indicates whether every visible scope for - each scope type (zone, region, global) should be - included in the response. For new resource types - added after this field, the flag has no effect - as new resource types will always include every - visible scope for each scope type in response. - For resource types which predate this field, if - this flag is omitted or false, only scopes of - the scope types where the resource type is - expected to be found will be included. - - This field is a member of `oneof`_ ``_include_all_scopes``. - 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): - Name of the project scoping 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. - - This field is a member of `oneof`_ ``_return_partial_success``. - service_project_number (int): - The Shared VPC service project id or service - project number for which aggregated list request - is invoked for subnetworks list-usable api. - - This field is a member of `oneof`_ ``_service_project_number``. - """ - - filter: str = proto.Field( - proto.STRING, - number=336120696, - optional=True, - ) - include_all_scopes: bool = proto.Field( - proto.BOOL, - number=391327988, - 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, - ) - service_project_number: int = proto.Field( - proto.INT64, - number=316757497, - optional=True, - ) - - -class AggregatedListRegionCommitmentsRequest(proto.Message): - r"""A request message for RegionCommitments.AggregatedList. See +class AggregatedListPacketMirroringsRequest(proto.Message): + r"""A request message for PacketMirrorings.AggregatedList. See the method description for details. @@ -7613,7 +7575,11 @@ class AggregatedListRegionCommitmentsRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. service_project_number (int): @@ -7665,9 +7631,9 @@ class AggregatedListRegionCommitmentsRequest(proto.Message): ) -class AggregatedListReservationsRequest(proto.Message): - r"""A request message for Reservations.AggregatedList. See the - method description for details. +class AggregatedListPublicDelegatedPrefixesRequest(proto.Message): + r"""A request message for PublicDelegatedPrefixes.AggregatedList. + See the method description for details. .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields @@ -7759,11 +7725,15 @@ class AggregatedListReservationsRequest(proto.Message): This field is a member of `oneof`_ ``_page_token``. project (str): - Project ID for this request. + Name of the project scoping 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. + 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``. service_project_number (int): @@ -7815,8 +7785,8 @@ class AggregatedListReservationsRequest(proto.Message): ) -class AggregatedListResourcePoliciesRequest(proto.Message): - r"""A request message for ResourcePolicies.AggregatedList. See +class AggregatedListRegionCommitmentsRequest(proto.Message): + r"""A request message for RegionCommitments.AggregatedList. See the method description for details. @@ -7913,7 +7883,11 @@ class AggregatedListResourcePoliciesRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. service_project_number (int): @@ -7965,9 +7939,9 @@ class AggregatedListResourcePoliciesRequest(proto.Message): ) -class AggregatedListRoutersRequest(proto.Message): - r"""A request message for Routers.AggregatedList. See the method - description for details. +class AggregatedListReservationsRequest(proto.Message): + r"""A request message for Reservations.AggregatedList. See the + method description for details. .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields @@ -8063,7 +8037,11 @@ class AggregatedListRoutersRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. service_project_number (int): @@ -8115,8 +8093,8 @@ class AggregatedListRoutersRequest(proto.Message): ) -class AggregatedListSecurityPoliciesRequest(proto.Message): - r"""A request message for SecurityPolicies.AggregatedList. See +class AggregatedListResourcePoliciesRequest(proto.Message): + r"""A request message for ResourcePolicies.AggregatedList. See the method description for details. @@ -8209,11 +8187,15 @@ class AggregatedListSecurityPoliciesRequest(proto.Message): This field is a member of `oneof`_ ``_page_token``. project (str): - Name of the project scoping this request. + 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. + 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``. service_project_number (int): @@ -8265,9 +8247,9 @@ class AggregatedListSecurityPoliciesRequest(proto.Message): ) -class AggregatedListServiceAttachmentsRequest(proto.Message): - r"""A request message for ServiceAttachments.AggregatedList. See - the method description for details. +class AggregatedListRoutersRequest(proto.Message): + r"""A request message for Routers.AggregatedList. See the method + description for details. .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields @@ -8359,11 +8341,15 @@ class AggregatedListServiceAttachmentsRequest(proto.Message): This field is a member of `oneof`_ ``_page_token``. project (str): - Name of the project scoping this request. + 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. + 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``. service_project_number (int): @@ -8415,9 +8401,9 @@ class AggregatedListServiceAttachmentsRequest(proto.Message): ) -class AggregatedListSslCertificatesRequest(proto.Message): - r"""A request message for SslCertificates.AggregatedList. See the - method description for details. +class AggregatedListSecurityPoliciesRequest(proto.Message): + r"""A request message for SecurityPolicies.AggregatedList. See + the method description for details. .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields @@ -8513,7 +8499,11 @@ class AggregatedListSslCertificatesRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. service_project_number (int): @@ -8565,9 +8555,9 @@ class AggregatedListSslCertificatesRequest(proto.Message): ) -class AggregatedListSslPoliciesRequest(proto.Message): - r"""A request message for SslPolicies.AggregatedList. See the - method description for details. +class AggregatedListServiceAttachmentsRequest(proto.Message): + r"""A request message for ServiceAttachments.AggregatedList. See + the method description for details. .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields @@ -8663,7 +8653,11 @@ class AggregatedListSslPoliciesRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. service_project_number (int): @@ -8715,8 +8709,8 @@ class AggregatedListSslPoliciesRequest(proto.Message): ) -class AggregatedListSubnetworksRequest(proto.Message): - r"""A request message for Subnetworks.AggregatedList. See the +class AggregatedListSslCertificatesRequest(proto.Message): + r"""A request message for SslCertificates.AggregatedList. See the method description for details. @@ -8809,11 +8803,323 @@ class AggregatedListSubnetworksRequest(proto.Message): This field is a member of `oneof`_ ``_page_token``. project (str): - Project ID for this request. + Name of the project scoping 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. + 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``. + service_project_number (int): + The Shared VPC service project id or service + project number for which aggregated list request + is invoked for subnetworks list-usable api. + + This field is a member of `oneof`_ ``_service_project_number``. + """ + + filter: str = proto.Field( + proto.STRING, + number=336120696, + optional=True, + ) + include_all_scopes: bool = proto.Field( + proto.BOOL, + number=391327988, + 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, + ) + service_project_number: int = proto.Field( + proto.INT64, + number=316757497, + optional=True, + ) + + +class AggregatedListSslPoliciesRequest(proto.Message): + r"""A request message for SslPolicies.AggregatedList. 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``. + include_all_scopes (bool): + Indicates whether every visible scope for + each scope type (zone, region, global) should be + included in the response. For new resource types + added after this field, the flag has no effect + as new resource types will always include every + visible scope for each scope type in response. + For resource types which predate this field, if + this flag is omitted or false, only scopes of + the scope types where the resource type is + expected to be found will be included. + + This field is a member of `oneof`_ ``_include_all_scopes``. + 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): + Name of the project scoping 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``. + service_project_number (int): + The Shared VPC service project id or service + project number for which aggregated list request + is invoked for subnetworks list-usable api. + + This field is a member of `oneof`_ ``_service_project_number``. + """ + + filter: str = proto.Field( + proto.STRING, + number=336120696, + optional=True, + ) + include_all_scopes: bool = proto.Field( + proto.BOOL, + number=391327988, + 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, + ) + service_project_number: int = proto.Field( + proto.INT64, + number=316757497, + optional=True, + ) + + +class AggregatedListSubnetworksRequest(proto.Message): + r"""A request message for Subnetworks.AggregatedList. 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``. + include_all_scopes (bool): + Indicates whether every visible scope for + each scope type (zone, region, global) should be + included in the response. For new resource types + added after this field, the flag has no effect + as new resource types will always include every + visible scope for each scope type in response. + For resource types which predate this field, if + this flag is omitted or false, only scopes of + the scope types where the resource type is + expected to be found will be included. + + This field is a member of `oneof`_ ``_include_all_scopes``. + 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``. service_project_number (int): @@ -8963,7 +9269,11 @@ class AggregatedListTargetHttpProxiesRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. service_project_number (int): @@ -9113,7 +9423,11 @@ class AggregatedListTargetHttpsProxiesRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. service_project_number (int): @@ -9263,7 +9577,11 @@ class AggregatedListTargetInstancesRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. service_project_number (int): @@ -9413,7 +9731,11 @@ class AggregatedListTargetPoolsRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. service_project_number (int): @@ -9563,7 +9885,11 @@ class AggregatedListTargetTcpProxiesRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. service_project_number (int): @@ -9713,7 +10039,11 @@ class AggregatedListTargetVpnGatewaysRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. service_project_number (int): @@ -9863,7 +10193,11 @@ class AggregatedListUrlMapsRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. service_project_number (int): @@ -10013,7 +10347,11 @@ class AggregatedListVpnGatewaysRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. service_project_number (int): @@ -10163,7 +10501,11 @@ class AggregatedListVpnTunnelsRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. service_project_number (int): @@ -11545,7 +11887,7 @@ class AttachedDiskInitializeParams(proto.Message): Indicates how much throughput to provision for the disk. This sets the number of throughput mb per second that the disk can handle. Values - must be between 1 and 7,124. + must greater than or equal to 1. This field is a member of `oneof`_ ``_provisioned_throughput``. replica_zones (MutableSequence[str]): @@ -13177,6 +13519,21 @@ class Backend(proto.Message): For usage guidelines, see Utilization balancing mode. This field is a member of `oneof`_ ``_max_utilization``. + preference (str): + This field indicates whether this backend + should be fully utilized before sending traffic + to backends with default preference. The + possible values are: - PREFERRED: Backends with + this preference level will be filled up to their + capacity limits first, based on RTT. - DEFAULT: + If preferred backends don't have enough + capacity, backends in this layer would be used + and traffic would be assigned based on the load + balancing algorithm you use. This is the default + Check the Preference enum for the list of + possible values. + + This field is a member of `oneof`_ ``_preference``. """ class BalancingMode(proto.Enum): @@ -13209,6 +13566,33 @@ class BalancingMode(proto.Enum): RATE = 2508000 UTILIZATION = 157008386 + class Preference(proto.Enum): + r"""This field indicates whether this backend should be fully + utilized before sending traffic to backends with default + preference. The possible values are: - PREFERRED: Backends with + this preference level will be filled up to their capacity limits + first, based on RTT. - DEFAULT: If preferred backends don't have + enough capacity, backends in this layer would be used and + traffic would be assigned based on the load balancing algorithm + you use. This is the default + + Values: + UNDEFINED_PREFERENCE (0): + A value indicating that the enum field is not + set. + DEFAULT (115302945): + No preference. + PREFERENCE_UNSPECIFIED (496219571): + If preference is unspecified, we set it to + the DEFAULT value + PREFERRED (418847841): + Traffic will be sent to this backend first. + """ + UNDEFINED_PREFERENCE = 0 + DEFAULT = 115302945 + PREFERENCE_UNSPECIFIED = 496219571 + PREFERRED = 418847841 + balancing_mode: str = proto.Field( proto.STRING, number=430286217, @@ -13269,6 +13653,11 @@ class BalancingMode(proto.Enum): number=148192199, optional=True, ) + preference: str = proto.Field( + proto.STRING, + number=150781147, + optional=True, + ) class BackendBucket(proto.Message): @@ -14201,6 +14590,13 @@ class BackendService(proto.Message): URLs of networkservices.ServiceBinding resources. Can only be set if load balancing scheme is INTERNAL_SELF_MANAGED. If set, lists of backends and health checks must be both empty. + service_lb_policy (str): + URL to networkservices.ServiceLbPolicy resource. Can only be + set if load balancing scheme is EXTERNAL, EXTERNAL_MANAGED, + INTERNAL_MANAGED or INTERNAL_SELF_MANAGED and the scope is + global. + + This field is a member of `oneof`_ ``_service_lb_policy``. session_affinity (str): Type of session affinity to use. The default is NONE. Only NONE and HEADER_FIELD are supported when the backend service @@ -14688,6 +15084,11 @@ class SessionAffinity(proto.Enum): proto.STRING, number=133581016, ) + service_lb_policy: str = proto.Field( + proto.STRING, + number=94848785, + optional=True, + ) session_affinity: str = proto.Field( proto.STRING, number=463888561, @@ -19937,6 +20338,60 @@ class DeleteInstancesRegionInstanceGroupManagerRequest(proto.Message): ) +class DeleteInstantSnapshotRequest(proto.Message): + r"""A request message for InstantSnapshots.Delete. See the method + description for details. + + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + instant_snapshot (str): + Name of the InstantSnapshot 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). + + This field is a member of `oneof`_ ``_request_id``. + zone (str): + The name of the zone for this request. + """ + + instant_snapshot: str = proto.Field( + proto.STRING, + number=391638626, + ) + project: str = proto.Field( + proto.STRING, + number=227560217, + ) + request_id: str = proto.Field( + proto.STRING, + number=37109963, + optional=True, + ) + zone: str = proto.Field( + proto.STRING, + number=3744684, + ) + + class DeleteInterconnectAttachmentRequest(proto.Message): r"""A request message for InterconnectAttachments.Delete. See the method description for details. @@ -21163,6 +21618,60 @@ class DeleteRegionInstanceTemplateRequest(proto.Message): ) +class DeleteRegionInstantSnapshotRequest(proto.Message): + r"""A request message for RegionInstantSnapshots.Delete. See the + method description for details. + + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + instant_snapshot (str): + Name of the InstantSnapshot resource to + delete. + project (str): + Project ID for this request. + region (str): + The name of the region 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``. + """ + + instant_snapshot: str = proto.Field( + proto.STRING, + number=391638626, + ) + project: str = proto.Field( + proto.STRING, + number=227560217, + ) + region: str = proto.Field( + proto.STRING, + number=138946292, + ) + request_id: str = proto.Field( + proto.STRING, + number=37109963, + optional=True, + ) + + class DeleteRegionNetworkEndpointGroupRequest(proto.Message): r"""A request message for RegionNetworkEndpointGroups.Delete. See the method description for details. @@ -23619,7 +24128,7 @@ class Disk(proto.Message): Indicates how much throughput to provision for the disk. This sets the number of throughput mb per second that the disk can handle. Values - must be between 1 and 7,124. + must be greater than or equal to 1. This field is a member of `oneof`_ ``_provisioned_throughput``. region (str): @@ -23735,6 +24244,27 @@ class Disk(proto.Message): identify the exact version of the image that was used. This field is a member of `oneof`_ ``_source_image_id``. + source_instant_snapshot (str): + The source instant snapshot used to create + this disk. You can provide this as a partial or + full URL to the resource. For example, the + following are valid values: - + https://www.googleapis.com/compute/v1/projects/project/zones/zone + /instantSnapshots/instantSnapshot - + projects/project/zones/zone/instantSnapshots/instantSnapshot + - zones/zone/instantSnapshots/instantSnapshot + + This field is a member of `oneof`_ ``_source_instant_snapshot``. + source_instant_snapshot_id (str): + [Output Only] The unique ID of the instant snapshot used to + create this disk. This value identifies the exact instant + snapshot that was used to create this persistent disk. For + example, if you created the persistent disk from an instant + snapshot that was later deleted and recreated under the same + name, the source instant snapshot ID would identify the + exact version of the instant snapshot that was used. + + This field is a member of `oneof`_ ``_source_instant_snapshot_id``. source_snapshot (str): The source snapshot used to create this disk. You can provide this as a partial or full URL to @@ -24047,6 +24577,16 @@ class Status(proto.Enum): number=55328291, optional=True, ) + source_instant_snapshot: str = proto.Field( + proto.STRING, + number=219202054, + optional=True, + ) + source_instant_snapshot_id: str = proto.Field( + proto.STRING, + number=287582708, + optional=True, + ) source_snapshot: str = proto.Field( proto.STRING, number=126061928, @@ -25972,6 +26512,18 @@ class ExternalVpnGatewayInterface(proto.Message): Engine. This field is a member of `oneof`_ ``_ip_address``. + ipv6_address (str): + IPv6 address of the interface in the external + VPN gateway. This IPv6 address can be either + from your on-premise gateway or another Cloud + provider's VPN gateway, it cannot be an IP + address from Google Compute Engine. Must specify + an IPv6 address (not IPV4-mapped) using any + format described in RFC 4291 (e.g. + 2001:db8:0:0:2d9:51:0:0). The output format is + RFC 5952 format (e.g. 2001:db8::2d9:51:0:0). + + This field is a member of `oneof`_ ``_ipv6_address``. """ id: int = proto.Field( @@ -25984,6 +26536,11 @@ class ExternalVpnGatewayInterface(proto.Message): number=406272220, optional=True, ) + ipv6_address: str = proto.Field( + proto.STRING, + number=341563804, + optional=True, + ) class ExternalVpnGatewayList(proto.Message): @@ -29446,6 +30003,45 @@ class GetIamPolicyInstanceTemplateRequest(proto.Message): ) +class GetIamPolicyInstantSnapshotRequest(proto.Message): + r"""A request message for InstantSnapshots.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 GetIamPolicyLicenseRequest(proto.Message): r"""A request message for Licenses.GetIamPolicy. See the method description for details. @@ -29740,6 +30336,45 @@ class GetIamPolicyRegionDiskRequest(proto.Message): ) +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 @@ -30121,6 +30756,34 @@ class GetInstanceTemplateRequest(proto.Message): ) +class GetInstantSnapshotRequest(proto.Message): + r"""A request message for InstantSnapshots.Get. See the method + description for details. + + Attributes: + instant_snapshot (str): + Name of the InstantSnapshot resource to + return. + project (str): + Project ID for this request. + zone (str): + The name of the zone for this request. + """ + + instant_snapshot: str = proto.Field( + proto.STRING, + number=391638626, + ) + project: str = proto.Field( + proto.STRING, + number=227560217, + ) + zone: str = proto.Field( + proto.STRING, + number=3744684, + ) + + class GetInterconnectAttachmentRequest(proto.Message): r"""A request message for InterconnectAttachments.Get. See the method description for details. @@ -30463,7 +31126,11 @@ class GetNatMappingInfoRoutersRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. router (str): @@ -31092,6 +31759,34 @@ class GetRegionInstanceTemplateRequest(proto.Message): ) +class GetRegionInstantSnapshotRequest(proto.Message): + r"""A request message for RegionInstantSnapshots.Get. See the + method description for details. + + Attributes: + instant_snapshot (str): + Name of the InstantSnapshot resource to + return. + project (str): + Project ID for this request. + region (str): + The name of the region for this request. + """ + + instant_snapshot: str = proto.Field( + proto.STRING, + number=391638626, + ) + project: str = proto.Field( + proto.STRING, + number=227560217, + ) + region: str = proto.Field( + proto.STRING, + number=138946292, + ) + + class GetRegionNetworkEndpointGroupRequest(proto.Message): r"""A request message for RegionNetworkEndpointGroups.Get. See the method description for details. @@ -32399,7 +33094,11 @@ class GetXpnResourcesProjectsRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. """ @@ -37179,6 +37878,60 @@ class InsertInstanceTemplateRequest(proto.Message): ) +class InsertInstantSnapshotRequest(proto.Message): + r"""A request message for InstantSnapshots.Insert. See the method + description for details. + + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + instant_snapshot_resource (google.cloud.compute_v1.types.InstantSnapshot): + 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``. + zone (str): + Name of the zone for this request. + """ + + instant_snapshot_resource: "InstantSnapshot" = proto.Field( + proto.MESSAGE, + number=383915339, + message="InstantSnapshot", + ) + project: str = proto.Field( + proto.STRING, + number=227560217, + ) + request_id: str = proto.Field( + proto.STRING, + number=37109963, + optional=True, + ) + zone: str = proto.Field( + proto.STRING, + number=3744684, + ) + + class InsertInterconnectAttachmentRequest(proto.Message): r"""A request message for InterconnectAttachments.Insert. See the method description for details. @@ -38375,22 +39128,20 @@ class InsertRegionInstanceTemplateRequest(proto.Message): ) -class InsertRegionNetworkEndpointGroupRequest(proto.Message): - r"""A request message for RegionNetworkEndpointGroups.Insert. See - the method description for details. +class InsertRegionInstantSnapshotRequest(proto.Message): + r"""A request message for RegionInstantSnapshots.Insert. See the + method description for details. .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields Attributes: - network_endpoint_group_resource (google.cloud.compute_v1.types.NetworkEndpointGroup): + instant_snapshot_resource (google.cloud.compute_v1.types.InstantSnapshot): The body resource for this request project (str): Project ID for this request. region (str): - The name of the region where you want to - create the network endpoint group. It should - comply with RFC1035. + Name of the region for this request. request_id (str): An optional request ID to identify requests. Specify a unique request ID so that if you must @@ -38411,10 +39162,10 @@ class InsertRegionNetworkEndpointGroupRequest(proto.Message): This field is a member of `oneof`_ ``_request_id``. """ - network_endpoint_group_resource: "NetworkEndpointGroup" = proto.Field( + instant_snapshot_resource: "InstantSnapshot" = proto.Field( proto.MESSAGE, - number=525788839, - message="NetworkEndpointGroup", + number=383915339, + message="InstantSnapshot", ) project: str = proto.Field( proto.STRING, @@ -38431,20 +39182,22 @@ class InsertRegionNetworkEndpointGroupRequest(proto.Message): ) -class InsertRegionNetworkFirewallPolicyRequest(proto.Message): - r"""A request message for RegionNetworkFirewallPolicies.Insert. - See the method description for details. +class InsertRegionNetworkEndpointGroupRequest(proto.Message): + r"""A request message for RegionNetworkEndpointGroups.Insert. See + the method description for details. .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields Attributes: - firewall_policy_resource (google.cloud.compute_v1.types.FirewallPolicy): + network_endpoint_group_resource (google.cloud.compute_v1.types.NetworkEndpointGroup): The body resource for this request project (str): Project ID for this request. region (str): - Name of the region scoping this request. + The name of the region where you want to + create the network endpoint group. It should + comply with RFC1035. request_id (str): An optional request ID to identify requests. Specify a unique request ID so that if you must @@ -38465,10 +39218,10 @@ class InsertRegionNetworkFirewallPolicyRequest(proto.Message): This field is a member of `oneof`_ ``_request_id``. """ - firewall_policy_resource: "FirewallPolicy" = proto.Field( + network_endpoint_group_resource: "NetworkEndpointGroup" = proto.Field( proto.MESSAGE, - number=495049532, - message="FirewallPolicy", + number=525788839, + message="NetworkEndpointGroup", ) project: str = proto.Field( proto.STRING, @@ -38485,15 +39238,15 @@ class InsertRegionNetworkFirewallPolicyRequest(proto.Message): ) -class InsertRegionNotificationEndpointRequest(proto.Message): - r"""A request message for RegionNotificationEndpoints.Insert. See - the method description for details. +class InsertRegionNetworkFirewallPolicyRequest(proto.Message): + r"""A request message for RegionNetworkFirewallPolicies.Insert. + See the method description for details. .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields Attributes: - notification_endpoint_resource (google.cloud.compute_v1.types.NotificationEndpoint): + firewall_policy_resource (google.cloud.compute_v1.types.FirewallPolicy): The body resource for this request project (str): Project ID for this request. @@ -38519,10 +39272,10 @@ class InsertRegionNotificationEndpointRequest(proto.Message): This field is a member of `oneof`_ ``_request_id``. """ - notification_endpoint_resource: "NotificationEndpoint" = proto.Field( + firewall_policy_resource: "FirewallPolicy" = proto.Field( proto.MESSAGE, - number=338459940, - message="NotificationEndpoint", + number=495049532, + message="FirewallPolicy", ) project: str = proto.Field( proto.STRING, @@ -38539,77 +39292,16 @@ class InsertRegionNotificationEndpointRequest(proto.Message): ) -class InsertRegionSecurityPolicyRequest(proto.Message): - r"""A request message for RegionSecurityPolicies.Insert. See the - method description for details. +class InsertRegionNotificationEndpointRequest(proto.Message): + r"""A request message for RegionNotificationEndpoints.Insert. See + the method description for details. .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields Attributes: - project (str): - Project ID for this request. - region (str): - Name of the region scoping 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``. - security_policy_resource (google.cloud.compute_v1.types.SecurityPolicy): + notification_endpoint_resource (google.cloud.compute_v1.types.NotificationEndpoint): The body resource for this request - validate_only (bool): - If true, the request will not be committed. - - This field is a member of `oneof`_ ``_validate_only``. - """ - - project: str = proto.Field( - proto.STRING, - number=227560217, - ) - region: str = proto.Field( - proto.STRING, - number=138946292, - ) - request_id: str = proto.Field( - proto.STRING, - number=37109963, - optional=True, - ) - security_policy_resource: "SecurityPolicy" = proto.Field( - proto.MESSAGE, - number=216159612, - message="SecurityPolicy", - ) - validate_only: bool = proto.Field( - proto.BOOL, - number=242744629, - optional=True, - ) - - -class InsertRegionSslCertificateRequest(proto.Message): - r"""A request message for RegionSslCertificates.Insert. See the - method description for details. - - - .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields - - Attributes: project (str): Project ID for this request. region (str): @@ -38632,64 +39324,13 @@ class InsertRegionSslCertificateRequest(proto.Message): 00000000-0000-0000-0000-000000000000). This field is a member of `oneof`_ ``_request_id``. - ssl_certificate_resource (google.cloud.compute_v1.types.SslCertificate): - The body resource for this request """ - project: str = proto.Field( - proto.STRING, - number=227560217, - ) - region: str = proto.Field( - proto.STRING, - number=138946292, - ) - request_id: str = proto.Field( - proto.STRING, - number=37109963, - optional=True, - ) - ssl_certificate_resource: "SslCertificate" = proto.Field( + notification_endpoint_resource: "NotificationEndpoint" = proto.Field( proto.MESSAGE, - number=180709897, - message="SslCertificate", + number=338459940, + message="NotificationEndpoint", ) - - -class InsertRegionSslPolicyRequest(proto.Message): - r"""A request message for RegionSslPolicies.Insert. See the - method description for details. - - - .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields - - Attributes: - project (str): - Project ID for this request. - region (str): - Name of the region scoping 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``. - ssl_policy_resource (google.cloud.compute_v1.types.SslPolicy): - The body resource for this request - """ - project: str = proto.Field( proto.STRING, number=227560217, @@ -38703,15 +39344,10 @@ class InsertRegionSslPolicyRequest(proto.Message): number=37109963, optional=True, ) - ssl_policy_resource: "SslPolicy" = proto.Field( - proto.MESSAGE, - number=274891848, - message="SslPolicy", - ) -class InsertRegionTargetHttpProxyRequest(proto.Message): - r"""A request message for RegionTargetHttpProxies.Insert. See the +class InsertRegionSecurityPolicyRequest(proto.Message): + r"""A request message for RegionSecurityPolicies.Insert. See the method description for details. @@ -38740,8 +39376,12 @@ class InsertRegionTargetHttpProxyRequest(proto.Message): 00000000-0000-0000-0000-000000000000). This field is a member of `oneof`_ ``_request_id``. - target_http_proxy_resource (google.cloud.compute_v1.types.TargetHttpProxy): + security_policy_resource (google.cloud.compute_v1.types.SecurityPolicy): The body resource for this request + validate_only (bool): + If true, the request will not be committed. + + This field is a member of `oneof`_ ``_validate_only``. """ project: str = proto.Field( @@ -38757,69 +39397,20 @@ class InsertRegionTargetHttpProxyRequest(proto.Message): number=37109963, optional=True, ) - target_http_proxy_resource: "TargetHttpProxy" = proto.Field( + security_policy_resource: "SecurityPolicy" = proto.Field( proto.MESSAGE, - number=24696744, - message="TargetHttpProxy", - ) - - -class InsertRegionTargetHttpsProxyRequest(proto.Message): - r"""A request message for RegionTargetHttpsProxies.Insert. See - the method description for details. - - - .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields - - Attributes: - project (str): - Project ID for this request. - region (str): - Name of the region scoping 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``. - target_https_proxy_resource (google.cloud.compute_v1.types.TargetHttpsProxy): - The body resource for this request - """ - - project: str = proto.Field( - proto.STRING, - number=227560217, - ) - region: str = proto.Field( - proto.STRING, - number=138946292, + number=216159612, + message="SecurityPolicy", ) - request_id: str = proto.Field( - proto.STRING, - number=37109963, + validate_only: bool = proto.Field( + proto.BOOL, + number=242744629, optional=True, ) - target_https_proxy_resource: "TargetHttpsProxy" = proto.Field( - proto.MESSAGE, - number=433657473, - message="TargetHttpsProxy", - ) -class InsertRegionTargetTcpProxyRequest(proto.Message): - r"""A request message for RegionTargetTcpProxies.Insert. See the +class InsertRegionSslCertificateRequest(proto.Message): + r"""A request message for RegionSslCertificates.Insert. See the method description for details. @@ -38848,7 +39439,7 @@ class InsertRegionTargetTcpProxyRequest(proto.Message): 00000000-0000-0000-0000-000000000000). This field is a member of `oneof`_ ``_request_id``. - target_tcp_proxy_resource (google.cloud.compute_v1.types.TargetTcpProxy): + ssl_certificate_resource (google.cloud.compute_v1.types.SslCertificate): The body resource for this request """ @@ -38865,16 +39456,16 @@ class InsertRegionTargetTcpProxyRequest(proto.Message): number=37109963, optional=True, ) - target_tcp_proxy_resource: "TargetTcpProxy" = proto.Field( + ssl_certificate_resource: "SslCertificate" = proto.Field( proto.MESSAGE, - number=145913931, - message="TargetTcpProxy", + number=180709897, + message="SslCertificate", ) -class InsertRegionUrlMapRequest(proto.Message): - r"""A request message for RegionUrlMaps.Insert. See the method - description for details. +class InsertRegionSslPolicyRequest(proto.Message): + r"""A request message for RegionSslPolicies.Insert. See the + method description for details. .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields @@ -38885,11 +39476,24 @@ class InsertRegionUrlMapRequest(proto.Message): region (str): Name of the region scoping this request. request_id (str): - begin_interface: MixerMutationRequestBuilder Request ID to - support idempotency. + 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``. - url_map_resource (google.cloud.compute_v1.types.UrlMap): + ssl_policy_resource (google.cloud.compute_v1.types.SslPolicy): The body resource for this request """ @@ -38906,16 +39510,16 @@ class InsertRegionUrlMapRequest(proto.Message): number=37109963, optional=True, ) - url_map_resource: "UrlMap" = proto.Field( + ssl_policy_resource: "SslPolicy" = proto.Field( proto.MESSAGE, - number=168675425, - message="UrlMap", + number=274891848, + message="SslPolicy", ) -class InsertReservationRequest(proto.Message): - r"""A request message for Reservations.Insert. See the method - description for details. +class InsertRegionTargetHttpProxyRequest(proto.Message): + r"""A request message for RegionTargetHttpProxies.Insert. See the + method description for details. .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields @@ -38923,6 +39527,8 @@ class InsertReservationRequest(proto.Message): Attributes: project (str): Project ID for this request. + region (str): + Name of the region scoping this request. request_id (str): An optional request ID to identify requests. Specify a unique request ID so that if you must @@ -38941,35 +39547,33 @@ class InsertReservationRequest(proto.Message): 00000000-0000-0000-0000-000000000000). This field is a member of `oneof`_ ``_request_id``. - reservation_resource (google.cloud.compute_v1.types.Reservation): + target_http_proxy_resource (google.cloud.compute_v1.types.TargetHttpProxy): The body resource for this request - zone (str): - Name of the zone for this request. """ project: str = proto.Field( proto.STRING, number=227560217, ) + region: str = proto.Field( + proto.STRING, + number=138946292, + ) request_id: str = proto.Field( proto.STRING, number=37109963, optional=True, ) - reservation_resource: "Reservation" = proto.Field( + target_http_proxy_resource: "TargetHttpProxy" = proto.Field( proto.MESSAGE, - number=285030177, - message="Reservation", - ) - zone: str = proto.Field( - proto.STRING, - number=3744684, + number=24696744, + message="TargetHttpProxy", ) -class InsertResourcePolicyRequest(proto.Message): - r"""A request message for ResourcePolicies.Insert. See the method - description for details. +class InsertRegionTargetHttpsProxyRequest(proto.Message): + r"""A request message for RegionTargetHttpsProxies.Insert. See + the method description for details. .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields @@ -38978,7 +39582,7 @@ class InsertResourcePolicyRequest(proto.Message): project (str): Project ID for this request. region (str): - Name of the region for this request. + Name of the region scoping this request. request_id (str): An optional request ID to identify requests. Specify a unique request ID so that if you must @@ -38997,7 +39601,7 @@ class InsertResourcePolicyRequest(proto.Message): 00000000-0000-0000-0000-000000000000). This field is a member of `oneof`_ ``_request_id``. - resource_policy_resource (google.cloud.compute_v1.types.ResourcePolicy): + target_https_proxy_resource (google.cloud.compute_v1.types.TargetHttpsProxy): The body resource for this request """ @@ -39014,16 +39618,16 @@ class InsertResourcePolicyRequest(proto.Message): number=37109963, optional=True, ) - resource_policy_resource: "ResourcePolicy" = proto.Field( + target_https_proxy_resource: "TargetHttpsProxy" = proto.Field( proto.MESSAGE, - number=76826186, - message="ResourcePolicy", + number=433657473, + message="TargetHttpsProxy", ) -class InsertRouteRequest(proto.Message): - r"""A request message for Routes.Insert. See the method - description for details. +class InsertRegionTargetTcpProxyRequest(proto.Message): + r"""A request message for RegionTargetTcpProxies.Insert. See the + method description for details. .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields @@ -39031,6 +39635,8 @@ class InsertRouteRequest(proto.Message): Attributes: project (str): Project ID for this request. + region (str): + Name of the region scoping this request. request_id (str): An optional request ID to identify requests. Specify a unique request ID so that if you must @@ -39049,7 +39655,7 @@ class InsertRouteRequest(proto.Message): 00000000-0000-0000-0000-000000000000). This field is a member of `oneof`_ ``_request_id``. - route_resource (google.cloud.compute_v1.types.Route): + target_tcp_proxy_resource (google.cloud.compute_v1.types.TargetTcpProxy): The body resource for this request """ @@ -39057,20 +39663,24 @@ class InsertRouteRequest(proto.Message): proto.STRING, number=227560217, ) + region: str = proto.Field( + proto.STRING, + number=138946292, + ) request_id: str = proto.Field( proto.STRING, number=37109963, optional=True, ) - route_resource: "Route" = proto.Field( + target_tcp_proxy_resource: "TargetTcpProxy" = proto.Field( proto.MESSAGE, - number=225428804, - message="Route", + number=145913931, + message="TargetTcpProxy", ) -class InsertRouterRequest(proto.Message): - r"""A request message for Routers.Insert. See the method +class InsertRegionUrlMapRequest(proto.Message): + r"""A request message for RegionUrlMaps.Insert. See the method description for details. @@ -39080,26 +39690,13 @@ class InsertRouterRequest(proto.Message): project (str): Project ID for this request. region (str): - Name of the region for this request. + Name of the region scoping 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). + begin_interface: MixerMutationRequestBuilder Request ID to + support idempotency. This field is a member of `oneof`_ ``_request_id``. - router_resource (google.cloud.compute_v1.types.Router): + url_map_resource (google.cloud.compute_v1.types.UrlMap): The body resource for this request """ @@ -39116,15 +39713,15 @@ class InsertRouterRequest(proto.Message): number=37109963, optional=True, ) - router_resource: "Router" = proto.Field( + url_map_resource: "UrlMap" = proto.Field( proto.MESSAGE, - number=155222084, - message="Router", + number=168675425, + message="UrlMap", ) -class InsertSecurityPolicyRequest(proto.Message): - r"""A request message for SecurityPolicies.Insert. See the method +class InsertReservationRequest(proto.Message): + r"""A request message for Reservations.Insert. See the method description for details. @@ -39151,12 +39748,10 @@ class InsertSecurityPolicyRequest(proto.Message): 00000000-0000-0000-0000-000000000000). This field is a member of `oneof`_ ``_request_id``. - security_policy_resource (google.cloud.compute_v1.types.SecurityPolicy): + reservation_resource (google.cloud.compute_v1.types.Reservation): The body resource for this request - validate_only (bool): - If true, the request will not be committed. - - This field is a member of `oneof`_ ``_validate_only``. + zone (str): + Name of the zone for this request. """ project: str = proto.Field( @@ -39168,21 +39763,20 @@ class InsertSecurityPolicyRequest(proto.Message): number=37109963, optional=True, ) - security_policy_resource: "SecurityPolicy" = proto.Field( + reservation_resource: "Reservation" = proto.Field( proto.MESSAGE, - number=216159612, - message="SecurityPolicy", + number=285030177, + message="Reservation", ) - validate_only: bool = proto.Field( - proto.BOOL, - number=242744629, - optional=True, + zone: str = proto.Field( + proto.STRING, + number=3744684, ) -class InsertServiceAttachmentRequest(proto.Message): - r"""A request message for ServiceAttachments.Insert. See the - method description for details. +class InsertResourcePolicyRequest(proto.Message): + r"""A request message for ResourcePolicies.Insert. See the method + description for details. .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields @@ -39191,7 +39785,7 @@ class InsertServiceAttachmentRequest(proto.Message): project (str): Project ID for this request. region (str): - Name of the region of this request. + Name of the region for this request. request_id (str): An optional request ID to identify requests. Specify a unique request ID so that if you must @@ -39210,7 +39804,7 @@ class InsertServiceAttachmentRequest(proto.Message): 00000000-0000-0000-0000-000000000000). This field is a member of `oneof`_ ``_request_id``. - service_attachment_resource (google.cloud.compute_v1.types.ServiceAttachment): + resource_policy_resource (google.cloud.compute_v1.types.ResourcePolicy): The body resource for this request """ @@ -39227,15 +39821,15 @@ class InsertServiceAttachmentRequest(proto.Message): number=37109963, optional=True, ) - service_attachment_resource: "ServiceAttachment" = proto.Field( + resource_policy_resource: "ResourcePolicy" = proto.Field( proto.MESSAGE, - number=472980256, - message="ServiceAttachment", + number=76826186, + message="ResourcePolicy", ) -class InsertSnapshotRequest(proto.Message): - r"""A request message for Snapshots.Insert. See the method +class InsertRouteRequest(proto.Message): + r"""A request message for Routes.Insert. See the method description for details. @@ -39262,7 +39856,7 @@ class InsertSnapshotRequest(proto.Message): 00000000-0000-0000-0000-000000000000). This field is a member of `oneof`_ ``_request_id``. - snapshot_resource (google.cloud.compute_v1.types.Snapshot): + route_resource (google.cloud.compute_v1.types.Route): The body resource for this request """ @@ -39275,15 +39869,15 @@ class InsertSnapshotRequest(proto.Message): number=37109963, optional=True, ) - snapshot_resource: "Snapshot" = proto.Field( + route_resource: "Route" = proto.Field( proto.MESSAGE, - number=481319977, - message="Snapshot", + number=225428804, + message="Route", ) -class InsertSslCertificateRequest(proto.Message): - r"""A request message for SslCertificates.Insert. See the method +class InsertRouterRequest(proto.Message): + r"""A request message for Routers.Insert. See the method description for details. @@ -39292,6 +39886,8 @@ class InsertSslCertificateRequest(proto.Message): Attributes: project (str): Project ID for this request. + region (str): + Name of the region for this request. request_id (str): An optional request ID to identify requests. Specify a unique request ID so that if you must @@ -39310,7 +39906,7 @@ class InsertSslCertificateRequest(proto.Message): 00000000-0000-0000-0000-000000000000). This field is a member of `oneof`_ ``_request_id``. - ssl_certificate_resource (google.cloud.compute_v1.types.SslCertificate): + router_resource (google.cloud.compute_v1.types.Router): The body resource for this request """ @@ -39318,20 +39914,24 @@ class InsertSslCertificateRequest(proto.Message): proto.STRING, number=227560217, ) + region: str = proto.Field( + proto.STRING, + number=138946292, + ) request_id: str = proto.Field( proto.STRING, number=37109963, optional=True, ) - ssl_certificate_resource: "SslCertificate" = proto.Field( + router_resource: "Router" = proto.Field( proto.MESSAGE, - number=180709897, - message="SslCertificate", + number=155222084, + message="Router", ) -class InsertSslPolicyRequest(proto.Message): - r"""A request message for SslPolicies.Insert. See the method +class InsertSecurityPolicyRequest(proto.Message): + r"""A request message for SecurityPolicies.Insert. See the method description for details. @@ -39358,8 +39958,12 @@ class InsertSslPolicyRequest(proto.Message): 00000000-0000-0000-0000-000000000000). This field is a member of `oneof`_ ``_request_id``. - ssl_policy_resource (google.cloud.compute_v1.types.SslPolicy): + security_policy_resource (google.cloud.compute_v1.types.SecurityPolicy): The body resource for this request + validate_only (bool): + If true, the request will not be committed. + + This field is a member of `oneof`_ ``_validate_only``. """ project: str = proto.Field( @@ -39371,16 +39975,21 @@ class InsertSslPolicyRequest(proto.Message): number=37109963, optional=True, ) - ssl_policy_resource: "SslPolicy" = proto.Field( + security_policy_resource: "SecurityPolicy" = proto.Field( proto.MESSAGE, - number=274891848, - message="SslPolicy", + number=216159612, + message="SecurityPolicy", + ) + validate_only: bool = proto.Field( + proto.BOOL, + number=242744629, + optional=True, ) -class InsertSubnetworkRequest(proto.Message): - r"""A request message for Subnetworks.Insert. See the method - description for details. +class InsertServiceAttachmentRequest(proto.Message): + r"""A request message for ServiceAttachments.Insert. See the + method description for details. .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields @@ -39389,7 +39998,7 @@ class InsertSubnetworkRequest(proto.Message): project (str): Project ID for this request. region (str): - Name of the region scoping this request. + Name of the region of this request. request_id (str): An optional request ID to identify requests. Specify a unique request ID so that if you must @@ -39408,7 +40017,7 @@ class InsertSubnetworkRequest(proto.Message): 00000000-0000-0000-0000-000000000000). This field is a member of `oneof`_ ``_request_id``. - subnetwork_resource (google.cloud.compute_v1.types.Subnetwork): + service_attachment_resource (google.cloud.compute_v1.types.ServiceAttachment): The body resource for this request """ @@ -39425,16 +40034,16 @@ class InsertSubnetworkRequest(proto.Message): number=37109963, optional=True, ) - subnetwork_resource: "Subnetwork" = proto.Field( + service_attachment_resource: "ServiceAttachment" = proto.Field( proto.MESSAGE, - number=42233151, - message="Subnetwork", + number=472980256, + message="ServiceAttachment", ) -class InsertTargetGrpcProxyRequest(proto.Message): - r"""A request message for TargetGrpcProxies.Insert. See the - method description for details. +class InsertSnapshotRequest(proto.Message): + r"""A request message for Snapshots.Insert. See the method + description for details. .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields @@ -39460,7 +40069,7 @@ class InsertTargetGrpcProxyRequest(proto.Message): 00000000-0000-0000-0000-000000000000). This field is a member of `oneof`_ ``_request_id``. - target_grpc_proxy_resource (google.cloud.compute_v1.types.TargetGrpcProxy): + snapshot_resource (google.cloud.compute_v1.types.Snapshot): The body resource for this request """ @@ -39473,16 +40082,214 @@ class InsertTargetGrpcProxyRequest(proto.Message): number=37109963, optional=True, ) - target_grpc_proxy_resource: "TargetGrpcProxy" = proto.Field( + snapshot_resource: "Snapshot" = proto.Field( proto.MESSAGE, - number=328922450, - message="TargetGrpcProxy", + number=481319977, + message="Snapshot", ) -class InsertTargetHttpProxyRequest(proto.Message): - r"""A request message for TargetHttpProxies.Insert. See the - method description for details. +class InsertSslCertificateRequest(proto.Message): + r"""A request message for SslCertificates.Insert. See the method + description for details. + + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + 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``. + ssl_certificate_resource (google.cloud.compute_v1.types.SslCertificate): + The body resource for this request + """ + + project: str = proto.Field( + proto.STRING, + number=227560217, + ) + request_id: str = proto.Field( + proto.STRING, + number=37109963, + optional=True, + ) + ssl_certificate_resource: "SslCertificate" = proto.Field( + proto.MESSAGE, + number=180709897, + message="SslCertificate", + ) + + +class InsertSslPolicyRequest(proto.Message): + r"""A request message for SslPolicies.Insert. See the method + description for details. + + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + 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``. + ssl_policy_resource (google.cloud.compute_v1.types.SslPolicy): + The body resource for this request + """ + + project: str = proto.Field( + proto.STRING, + number=227560217, + ) + request_id: str = proto.Field( + proto.STRING, + number=37109963, + optional=True, + ) + ssl_policy_resource: "SslPolicy" = proto.Field( + proto.MESSAGE, + number=274891848, + message="SslPolicy", + ) + + +class InsertSubnetworkRequest(proto.Message): + r"""A request message for Subnetworks.Insert. See the method + description for details. + + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + project (str): + Project ID for this request. + region (str): + Name of the region scoping 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``. + subnetwork_resource (google.cloud.compute_v1.types.Subnetwork): + The body resource for this request + """ + + project: str = proto.Field( + proto.STRING, + number=227560217, + ) + region: str = proto.Field( + proto.STRING, + number=138946292, + ) + request_id: str = proto.Field( + proto.STRING, + number=37109963, + optional=True, + ) + subnetwork_resource: "Subnetwork" = proto.Field( + proto.MESSAGE, + number=42233151, + message="Subnetwork", + ) + + +class InsertTargetGrpcProxyRequest(proto.Message): + r"""A request message for TargetGrpcProxies.Insert. See the + method description for details. + + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + 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``. + target_grpc_proxy_resource (google.cloud.compute_v1.types.TargetGrpcProxy): + The body resource for this request + """ + + project: str = proto.Field( + proto.STRING, + number=227560217, + ) + request_id: str = proto.Field( + proto.STRING, + number=37109963, + optional=True, + ) + target_grpc_proxy_resource: "TargetGrpcProxy" = proto.Field( + proto.MESSAGE, + number=328922450, + message="TargetGrpcProxy", + ) + + +class InsertTargetHttpProxyRequest(proto.Message): + r"""A request message for TargetHttpProxies.Insert. See the + method description for details. .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields @@ -41759,6 +42566,17 @@ class InstanceGroupManagerInstanceLifecyclePolicy(proto.Message): .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields Attributes: + default_action_on_failure (str): + The action that a MIG performs on a failed or an unhealthy + VM. A VM is marked as unhealthy when the application running + on that VM fails a health check. Valid values are - REPAIR + (default): MIG automatically repairs a failed or an + unhealthy VM by recreating it. For more information, see + About repairing VMs in a MIG. - DO_NOTHING: MIG does not + repair a failed or an unhealthy VM. Check the + DefaultActionOnFailure enum for the list of possible values. + + This field is a member of `oneof`_ ``_default_action_on_failure``. force_update_on_repair (str): A bit indicating whether to forcefully apply the group's latest configuration when repairing @@ -41775,6 +42593,30 @@ class InstanceGroupManagerInstanceLifecyclePolicy(proto.Message): This field is a member of `oneof`_ ``_force_update_on_repair``. """ + class DefaultActionOnFailure(proto.Enum): + r"""The action that a MIG performs on a failed or an unhealthy VM. A VM + is marked as unhealthy when the application running on that VM fails + a health check. Valid values are - REPAIR (default): MIG + automatically repairs a failed or an unhealthy VM by recreating it. + For more information, see About repairing VMs in a MIG. - + DO_NOTHING: MIG does not repair a failed or an unhealthy VM. + + Values: + UNDEFINED_DEFAULT_ACTION_ON_FAILURE (0): + A value indicating that the enum field is not + set. + DO_NOTHING (451307513): + MIG does not repair a failed or an unhealthy + VM. + REPAIR (266277773): + (Default) MIG automatically repairs a failed + or an unhealthy VM by recreating it. For more + information, see About repairing VMs in a MIG. + """ + UNDEFINED_DEFAULT_ACTION_ON_FAILURE = 0 + DO_NOTHING = 451307513 + REPAIR = 266277773 + class ForceUpdateOnRepair(proto.Enum): r"""A bit indicating whether to forcefully apply the group's latest configuration when repairing a VM. Valid options are: - @@ -41797,6 +42639,11 @@ class ForceUpdateOnRepair(proto.Enum): NO = 2497 YES = 87751 + default_action_on_failure: str = proto.Field( + proto.STRING, + number=61383253, + optional=True, + ) force_update_on_repair: str = proto.Field( proto.STRING, number=356302027, @@ -44589,6 +45436,489 @@ class InstancesStartWithEncryptionKeyRequest(proto.Message): ) +class InstantSnapshot(proto.Message): + r"""Represents a InstantSnapshot resource. You can use instant + snapshots to create disk rollback points quickly.. + + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + architecture (str): + [Output Only] The architecture of the instant snapshot. + Valid values are ARM64 or X86_64. Check the Architecture + enum for the list of possible values. + + This field is a member of `oneof`_ ``_architecture``. + 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``. + disk_size_gb (int): + [Output Only] Size of the source disk, specified in GB. + + This field is a member of `oneof`_ ``_disk_size_gb``. + 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``. + kind (str): + [Output Only] Type of the resource. Always + compute#instantSnapshot for InstantSnapshot resources. + + This field is a member of `oneof`_ ``_kind``. + label_fingerprint (str): + A fingerprint for the labels being applied to + this InstantSnapshot, which is essentially a + hash of the labels set used for optimistic + locking. The fingerprint is initially generated + by Compute Engine and changes after every + request to modify or update labels. You must + always provide an up-to-date fingerprint hash in + order to update or change labels, otherwise the + request will fail with error 412 + conditionNotMet. To see the latest fingerprint, + make a get() request to retrieve a + InstantSnapshot. + + This field is a member of `oneof`_ ``_label_fingerprint``. + labels (MutableMapping[str, str]): + Labels to apply to this InstantSnapshot. + These can be later modified by the setLabels + method. Label values may be empty. + 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``. + region (str): + [Output Only] URL of the region where the instant snapshot + resides. You must specify this field as part of the HTTP + request URL. It is not settable as a field in the request + body. + + This field is a member of `oneof`_ ``_region``. + resource_status (google.cloud.compute_v1.types.InstantSnapshotResourceStatus): + [Output Only] Status information for the instant snapshot + resource. + + This field is a member of `oneof`_ ``_resource_status``. + satisfies_pzi (bool): + Output only. Reserved for future use. + + This field is a member of `oneof`_ ``_satisfies_pzi``. + satisfies_pzs (bool): + [Output Only] Reserved for future use. + + This field is a member of `oneof`_ ``_satisfies_pzs``. + self_link (str): + [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's + resource id. + + This field is a member of `oneof`_ ``_self_link_with_id``. + source_disk (str): + URL of the source disk used to create this + instant snapshot. Note that the source disk must + be in the same zone/region as the instant + snapshot to be created. This can be a full or + valid partial URL. For example, the following + are valid values: - + https://www.googleapis.com/compute/v1/projects/project/zones/zone + /disks/disk - + https://www.googleapis.com/compute/v1/projects/project/regions/region + /disks/disk - + projects/project/zones/zone/disks/disk - + projects/project/regions/region/disks/disk - + zones/zone/disks/disk - + regions/region/disks/disk + + This field is a member of `oneof`_ ``_source_disk``. + source_disk_id (str): + [Output Only] The ID value of the disk used to create this + InstantSnapshot. This value may be used to determine whether + the InstantSnapshot was taken from the current or a previous + instance of a given disk name. + + This field is a member of `oneof`_ ``_source_disk_id``. + status (str): + [Output Only] The status of the instantSnapshot. This can be + CREATING, DELETING, FAILED, or READY. Check the Status enum + for the list of possible values. + + This field is a member of `oneof`_ ``_status``. + zone (str): + [Output Only] URL of the zone where the instant snapshot + resides. You must specify this field as part of the HTTP + request URL. It is not settable as a field in the request + body. + + This field is a member of `oneof`_ ``_zone``. + """ + + class Architecture(proto.Enum): + r"""[Output Only] The architecture of the instant snapshot. Valid values + are ARM64 or X86_64. + + Values: + UNDEFINED_ARCHITECTURE (0): + A value indicating that the enum field is not + set. + ARCHITECTURE_UNSPECIFIED (394750507): + Default value indicating Architecture is not + set. + ARM64 (62547450): + Machines with architecture ARM64 + X86_64 (425300551): + Machines with architecture X86_64 + """ + UNDEFINED_ARCHITECTURE = 0 + ARCHITECTURE_UNSPECIFIED = 394750507 + ARM64 = 62547450 + X86_64 = 425300551 + + class Status(proto.Enum): + r"""[Output Only] The status of the instantSnapshot. This can be + CREATING, DELETING, FAILED, or READY. + + Values: + UNDEFINED_STATUS (0): + A value indicating that the enum field is not + set. + CREATING (455564985): + InstantSnapshot creation is in progress. + DELETING (528602024): + InstantSnapshot is currently being deleted. + FAILED (455706685): + InstantSnapshot creation failed. + READY (77848963): + InstantSnapshot has been created + successfully. + """ + UNDEFINED_STATUS = 0 + CREATING = 455564985 + DELETING = 528602024 + FAILED = 455706685 + READY = 77848963 + + architecture: str = proto.Field( + proto.STRING, + number=302803283, + optional=True, + ) + creation_timestamp: str = proto.Field( + proto.STRING, + number=30525366, + optional=True, + ) + description: str = proto.Field( + proto.STRING, + number=422937596, + optional=True, + ) + disk_size_gb: int = proto.Field( + proto.INT64, + number=316263735, + optional=True, + ) + id: int = proto.Field( + proto.UINT64, + number=3355, + optional=True, + ) + kind: str = proto.Field( + proto.STRING, + number=3292052, + optional=True, + ) + label_fingerprint: str = proto.Field( + proto.STRING, + number=178124825, + optional=True, + ) + labels: MutableMapping[str, str] = proto.MapField( + proto.STRING, + proto.STRING, + number=500195327, + ) + name: str = proto.Field( + proto.STRING, + number=3373707, + optional=True, + ) + region: str = proto.Field( + proto.STRING, + number=138946292, + optional=True, + ) + resource_status: "InstantSnapshotResourceStatus" = proto.Field( + proto.MESSAGE, + number=249429315, + optional=True, + message="InstantSnapshotResourceStatus", + ) + satisfies_pzi: bool = proto.Field( + proto.BOOL, + number=480964257, + optional=True, + ) + satisfies_pzs: bool = proto.Field( + proto.BOOL, + number=480964267, + 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, + ) + source_disk: str = proto.Field( + proto.STRING, + number=451753793, + optional=True, + ) + source_disk_id: str = proto.Field( + proto.STRING, + number=454190809, + optional=True, + ) + status: str = proto.Field( + proto.STRING, + number=181260274, + optional=True, + ) + zone: str = proto.Field( + proto.STRING, + number=3744684, + optional=True, + ) + + +class InstantSnapshotAggregatedList(proto.Message): + r""" + + .. _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 (MutableMapping[str, google.cloud.compute_v1.types.InstantSnapshotsScopedList]): + A list of InstantSnapshotsScopedList + resources. + kind (str): + [Output Only] Type of resource. Always + compute#instantSnapshotAggregatedList for aggregated lists + of instantSnapshots. + + 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. + 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: MutableMapping[str, "InstantSnapshotsScopedList"] = proto.MapField( + proto.STRING, + proto.MESSAGE, + number=100526016, + message="InstantSnapshotsScopedList", + ) + 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 InstantSnapshotList(proto.Message): + r"""Contains a list of InstantSnapshot resources. + + .. _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.InstantSnapshot]): + A list of InstantSnapshot resources. + kind (str): + Type of resource. + + 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["InstantSnapshot"] = proto.RepeatedField( + proto.MESSAGE, + number=100526016, + message="InstantSnapshot", + ) + 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 InstantSnapshotResourceStatus(proto.Message): + r""" + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + storage_size_bytes (int): + [Output Only] The storage size of this instant snapshot. + + This field is a member of `oneof`_ ``_storage_size_bytes``. + """ + + storage_size_bytes: int = proto.Field( + proto.INT64, + number=387548913, + optional=True, + ) + + +class InstantSnapshotsScopedList(proto.Message): + r""" + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + instant_snapshots (MutableSequence[google.cloud.compute_v1.types.InstantSnapshot]): + [Output Only] A list of instantSnapshots contained in this + scope. + warning (google.cloud.compute_v1.types.Warning): + [Output Only] Informational warning which replaces the list + of instantSnapshots when the list is empty. + + This field is a member of `oneof`_ ``_warning``. + """ + + instant_snapshots: MutableSequence["InstantSnapshot"] = proto.RepeatedField( + proto.MESSAGE, + number=329637457, + message="InstantSnapshot", + ) + warning: "Warning" = proto.Field( + proto.MESSAGE, + number=50704284, + optional=True, + message="Warning", + ) + + class Int64RangeMatch(proto.Message): r"""HttpRouteRuleMatch criteria for field values that must stay within the specified integer range. @@ -48806,7 +50136,11 @@ class ListAcceleratorTypesRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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): @@ -48935,9 +50269,166 @@ class ListAddressesRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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, + ) + region: str = proto.Field( + proto.STRING, + number=138946292, + ) + return_partial_success: bool = proto.Field( + proto.BOOL, + number=517198390, + optional=True, + ) + + +class ListAssociationsFirewallPolicyRequest(proto.Message): + r"""A request message for FirewallPolicies.ListAssociations. See + the method description for details. + + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + target_resource (str): + The target resource to list associations. It + is an organization, or a folder. + + This field is a member of `oneof`_ ``_target_resource``. + """ + + target_resource: str = proto.Field( + proto.STRING, + number=467318524, + optional=True, + ) + + +class ListAutoscalersRequest(proto.Message): + r"""A request message for Autoscalers.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``. + zone (str): + Name of the zone for this request. """ filter: str = proto.Field( @@ -48964,41 +50455,20 @@ class ListAddressesRequest(proto.Message): 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 ListAssociationsFirewallPolicyRequest(proto.Message): - r"""A request message for FirewallPolicies.ListAssociations. See - the method description for details. - - - .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields - - Attributes: - target_resource (str): - The target resource to list associations. It - is an organization, or a folder. - - This field is a member of `oneof`_ ``_target_resource``. - """ - - target_resource: str = proto.Field( + zone: str = proto.Field( proto.STRING, - number=467318524, - optional=True, + number=3744684, ) -class ListAutoscalersRequest(proto.Message): - r"""A request message for Autoscalers.List. See the method +class ListAvailableFeaturesRegionSslPoliciesRequest(proto.Message): + r"""A request message for + RegionSslPolicies.ListAvailableFeatures. See the method description for details. @@ -49079,14 +50549,18 @@ class ListAutoscalersRequest(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 - default value is false. + 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. """ filter: str = proto.Field( @@ -49113,21 +50587,20 @@ class ListAutoscalersRequest(proto.Message): proto.STRING, number=227560217, ) + region: str = proto.Field( + proto.STRING, + number=138946292, + ) return_partial_success: bool = proto.Field( proto.BOOL, number=517198390, optional=True, ) - zone: str = proto.Field( - proto.STRING, - number=3744684, - ) -class ListAvailableFeaturesRegionSslPoliciesRequest(proto.Message): - r"""A request message for - RegionSslPolicies.ListAvailableFeatures. See the method - description for details. +class ListAvailableFeaturesSslPoliciesRequest(proto.Message): + r"""A request message for SslPolicies.ListAvailableFeatures. See + the method description for details. .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields @@ -49207,12 +50680,14 @@ class ListAvailableFeaturesRegionSslPoliciesRequest(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 - default value is false. + 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``. """ @@ -49241,10 +50716,6 @@ class ListAvailableFeaturesRegionSslPoliciesRequest(proto.Message): proto.STRING, number=227560217, ) - region: str = proto.Field( - proto.STRING, - number=138946292, - ) return_partial_success: bool = proto.Field( proto.BOOL, number=517198390, @@ -49252,9 +50723,9 @@ class ListAvailableFeaturesRegionSslPoliciesRequest(proto.Message): ) -class ListAvailableFeaturesSslPoliciesRequest(proto.Message): - r"""A request message for SslPolicies.ListAvailableFeatures. See - the method description for details. +class ListBackendBucketsRequest(proto.Message): + r"""A request message for BackendBuckets.List. See the method + description for details. .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields @@ -49337,7 +50808,11 @@ class ListAvailableFeaturesSslPoliciesRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. """ @@ -49373,8 +50848,8 @@ class ListAvailableFeaturesSslPoliciesRequest(proto.Message): ) -class ListBackendBucketsRequest(proto.Message): - r"""A request message for BackendBuckets.List. See the method +class ListBackendServicesRequest(proto.Message): + r"""A request message for BackendServices.List. See the method description for details. @@ -49458,7 +50933,11 @@ class ListBackendBucketsRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. """ @@ -49494,8 +50973,8 @@ class ListBackendBucketsRequest(proto.Message): ) -class ListBackendServicesRequest(proto.Message): - r"""A request message for BackendServices.List. See the method +class ListDiskTypesRequest(proto.Message): + r"""A request message for DiskTypes.List. See the method description for details. @@ -49579,9 +51058,15 @@ class ListBackendServicesRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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): + The name of the zone for this request. """ filter: str = proto.Field( @@ -49613,11 +51098,15 @@ class ListBackendServicesRequest(proto.Message): number=517198390, optional=True, ) + zone: str = proto.Field( + proto.STRING, + number=3744684, + ) -class ListDiskTypesRequest(proto.Message): - r"""A request message for DiskTypes.List. See the method - description for details. +class ListDisksRequest(proto.Message): + r"""A request message for Disks.List. See the method description + for details. .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields @@ -49700,7 +51189,11 @@ class ListDiskTypesRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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): @@ -49742,9 +51235,9 @@ class ListDiskTypesRequest(proto.Message): ) -class ListDisksRequest(proto.Message): - r"""A request message for Disks.List. See the method description - for details. +class ListErrorsInstanceGroupManagersRequest(proto.Message): + r"""A request message for InstanceGroupManagers.ListErrors. See + the method description for details. .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields @@ -49794,6 +51287,11 @@ class ListDisksRequest(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. It must be a string + that meets the requirements in RFC1035, or an unsigned long + integer: must match regexp pattern: + (?:`a-z `__?)|1-9{0,19}. max_results (int): The maximum number of results per page that should be returned. If the number of available results is larger than @@ -49827,11 +51325,17 @@ class ListDisksRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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): - The name of the zone for this request. + The name of the zone where the managed + instance group is located. It should conform to + RFC1035. """ filter: str = proto.Field( @@ -49839,6 +51343,10 @@ class ListDisksRequest(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, @@ -49869,9 +51377,9 @@ class ListDisksRequest(proto.Message): ) -class ListErrorsInstanceGroupManagersRequest(proto.Message): - r"""A request message for InstanceGroupManagers.ListErrors. See - the method description for details. +class ListErrorsRegionInstanceGroupManagersRequest(proto.Message): + r"""A request message for RegionInstanceGroupManagers.ListErrors. + See the method description for details. .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields @@ -49956,16 +51464,19 @@ class ListErrorsInstanceGroupManagersRequest(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. 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. + 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): - The name of the zone where the managed - instance group is located. It should conform to - RFC1035. """ filter: str = proto.Field( @@ -49996,20 +51507,20 @@ class ListErrorsInstanceGroupManagersRequest(proto.Message): proto.STRING, number=227560217, ) + region: str = proto.Field( + proto.STRING, + number=138946292, + ) return_partial_success: bool = proto.Field( proto.BOOL, number=517198390, optional=True, ) - zone: str = proto.Field( - proto.STRING, - number=3744684, - ) -class ListErrorsRegionInstanceGroupManagersRequest(proto.Message): - r"""A request message for RegionInstanceGroupManagers.ListErrors. - See the method description for details. +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 @@ -50059,11 +51570,6 @@ class ListErrorsRegionInstanceGroupManagersRequest(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. It must be a string - that meets the requirements in RFC1035, or an unsigned long - integer: must match regexp pattern: - (?:`a-z `__?)|1-9{0,19}. max_results (int): The maximum number of results per page that should be returned. If the number of available results is larger than @@ -50094,13 +51600,14 @@ class ListErrorsRegionInstanceGroupManagersRequest(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. 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. + 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``. """ @@ -50110,10 +51617,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, @@ -50133,10 +51636,6 @@ class ListErrorsRegionInstanceGroupManagersRequest(proto.Message): proto.STRING, number=227560217, ) - region: str = proto.Field( - proto.STRING, - number=138946292, - ) return_partial_success: bool = proto.Field( proto.BOOL, number=517198390, @@ -50144,9 +51643,9 @@ class ListErrorsRegionInstanceGroupManagersRequest(proto.Message): ) -class ListExternalVpnGatewaysRequest(proto.Message): - r"""A request message for ExternalVpnGateways.List. See the - method description for details. +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 @@ -50224,12 +51723,21 @@ class ListExternalVpnGatewaysRequest(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. 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. + 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``. """ @@ -50254,9 +51762,10 @@ class ListExternalVpnGatewaysRequest(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, @@ -50265,8 +51774,8 @@ class ListExternalVpnGatewaysRequest(proto.Message): ) -class ListFirewallPoliciesRequest(proto.Message): - r"""A request message for FirewallPolicies.List. See the method +class ListFirewallsRequest(proto.Message): + r"""A request message for Firewalls.List. See the method description for details. @@ -50345,17 +51854,16 @@ class ListFirewallPoliciesRequest(proto.Message): 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``. + 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. + 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``. """ @@ -50380,10 +51888,9 @@ class ListFirewallPoliciesRequest(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, @@ -50392,8 +51899,8 @@ class ListFirewallPoliciesRequest(proto.Message): ) -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. @@ -50474,10 +51981,16 @@ 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 - default value is false. + 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``. """ @@ -50506,6 +52019,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, @@ -50513,8 +52030,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. @@ -50595,12 +52112,14 @@ 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 - default value is false. + 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``. """ @@ -50629,10 +52148,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, @@ -50640,9 +52155,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 @@ -50725,7 +52240,11 @@ class ListGlobalAddressesRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. """ @@ -50761,9 +52280,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 @@ -50846,7 +52365,11 @@ class ListGlobalForwardingRulesRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. """ @@ -50882,9 +52405,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 @@ -50967,7 +52490,11 @@ class ListGlobalNetworkEndpointGroupsRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. """ @@ -51003,9 +52530,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 @@ -51083,12 +52610,18 @@ 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 - default value is false. + 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``. """ @@ -51113,9 +52646,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, @@ -51124,8 +52658,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. @@ -51204,14 +52738,16 @@ 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 - default value is false. + 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``. """ @@ -51236,10 +52772,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, @@ -51248,9 +52783,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 @@ -51333,7 +52868,11 @@ class ListGlobalPublicDelegatedPrefixesRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. """ @@ -51369,9 +52908,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 @@ -51454,7 +52993,11 @@ class ListHealthChecksRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. """ @@ -51490,9 +53033,9 @@ class ListHealthChecksRequest(proto.Message): ) -class ListImagesRequest(proto.Message): - r"""A request message for Images.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 @@ -51575,9 +53118,16 @@ class ListImagesRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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): + The name of the zone where the managed + instance group is located. """ filter: str = proto.Field( @@ -51609,11 +53159,15 @@ class ListImagesRequest(proto.Message): number=517198390, optional=True, ) + zone: str = proto.Field( + proto.STRING, + number=3744684, + ) -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 @@ -51696,12 +53250,16 @@ class ListInstanceGroupManagersRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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): - 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( @@ -51739,8 +53297,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. @@ -51824,12 +53382,13 @@ class ListInstanceGroupsRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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): - The name of the zone where the instance group - is located. """ filter: str = proto.Field( @@ -51861,15 +53420,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 @@ -51919,6 +53474,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 @@ -51952,9 +53512,16 @@ class ListInstanceTemplatesRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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): + The name of the zone where the instance group + is located. """ filter: str = proto.Field( @@ -51962,6 +53529,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, @@ -51986,11 +53562,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 @@ -52041,10 +53621,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 @@ -52075,15 +53653,20 @@ 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 - default value is false. + 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): - The name of the zone where the instance group - is located. """ filter: str = proto.Field( @@ -52095,11 +53678,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, @@ -52119,20 +53697,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 @@ -52182,9 +53765,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 @@ -52215,16 +53795,18 @@ 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 - default value is false. + 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): + The name of the zone for this request. """ filter: str = proto.Field( @@ -52232,10 +53814,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, @@ -52255,24 +53833,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. @@ -52356,7 +53929,11 @@ class ListInstancesRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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): @@ -52485,7 +54062,11 @@ class ListInterconnectAttachmentsRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. """ @@ -52610,7 +54191,11 @@ class ListInterconnectLocationsRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. """ @@ -52731,7 +54316,11 @@ class ListInterconnectRemoteLocationsRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. """ @@ -52852,7 +54441,11 @@ class ListInterconnectsRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. """ @@ -52973,7 +54566,11 @@ class ListLicensesRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. """ @@ -53094,7 +54691,11 @@ class ListMachineImagesRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. """ @@ -53215,7 +54816,11 @@ class ListMachineTypesRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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): @@ -53345,7 +54950,11 @@ class ListManagedInstancesInstanceGroupManagersRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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): @@ -53482,7 +55091,11 @@ class ListManagedInstancesRegionInstanceGroupManagersRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. """ @@ -53613,7 +55226,11 @@ class ListNetworkAttachmentsRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. """ @@ -53738,7 +55355,11 @@ class ListNetworkEndpointGroupsRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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): @@ -53873,7 +55494,11 @@ class ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. """ @@ -54006,7 +55631,11 @@ class ListNetworkEndpointsNetworkEndpointGroupsRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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): @@ -54154,7 +55783,11 @@ class ListNetworkEndpointsRegionNetworkEndpointGroupsRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. """ @@ -54283,7 +55916,11 @@ class ListNetworkFirewallPoliciesRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. """ @@ -54404,7 +56041,11 @@ class ListNetworksRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. """ @@ -54525,7 +56166,11 @@ class ListNodeGroupsRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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): @@ -54654,7 +56299,11 @@ class ListNodeTemplatesRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. """ @@ -54779,7 +56428,11 @@ class ListNodeTypesRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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): @@ -54909,7 +56562,11 @@ class ListNodesNodeGroupsRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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): @@ -55042,7 +56699,11 @@ class ListPacketMirroringsRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. """ @@ -55186,7 +56847,11 @@ class ListPeeringRoutesNetworksRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. """ @@ -55346,7 +57011,11 @@ class ListPerInstanceConfigsInstanceGroupManagersRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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): @@ -55486,7 +57155,11 @@ class ListPerInstanceConfigsRegionInstanceGroupManagersRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. """ @@ -55616,7 +57289,11 @@ class ListPreconfiguredExpressionSetsSecurityPoliciesRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. """ @@ -55737,7 +57414,138 @@ class ListPublicAdvertisedPrefixesRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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 ListPublicDelegatedPrefixesRequest(proto.Message): + r"""A request message for PublicDelegatedPrefixes.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. + region (str): + Name of the region of 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``. """ @@ -55766,6 +57574,10 @@ class ListPublicAdvertisedPrefixesRequest(proto.Message): proto.STRING, number=227560217, ) + region: str = proto.Field( + proto.STRING, + number=138946292, + ) return_partial_success: bool = proto.Field( proto.BOOL, number=517198390, @@ -55773,9 +57585,9 @@ class ListPublicAdvertisedPrefixesRequest(proto.Message): ) -class ListPublicDelegatedPrefixesRequest(proto.Message): - r"""A request message for PublicDelegatedPrefixes.List. See the - method description for details. +class ListReferrersInstancesRequest(proto.Message): + r"""A request message for Instances.ListReferrers. See the method + description for details. .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields @@ -55825,6 +57637,10 @@ class ListPublicDelegatedPrefixesRequest(proto.Message): multiple fields using regular expressions. This field is a member of `oneof`_ ``_filter``. + instance (str): + Name of the target instance scoping this + request, or '-' if the request should span over + all instances in the container. max_results (int): The maximum number of results per page that should be returned. If the number of available results is larger than @@ -55855,14 +57671,18 @@ class ListPublicDelegatedPrefixesRequest(proto.Message): This field is a member of `oneof`_ ``_page_token``. project (str): Project ID for this request. - region (str): - Name of the region of 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. + 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): + The name of the zone for this request. """ filter: str = proto.Field( @@ -55870,6 +57690,10 @@ class ListPublicDelegatedPrefixesRequest(proto.Message): number=336120696, optional=True, ) + instance: str = proto.Field( + proto.STRING, + number=18257045, + ) max_results: int = proto.Field( proto.UINT32, number=54715419, @@ -55889,19 +57713,19 @@ class ListPublicDelegatedPrefixesRequest(proto.Message): proto.STRING, number=227560217, ) - region: str = proto.Field( - proto.STRING, - number=138946292, - ) return_partial_success: bool = proto.Field( proto.BOOL, number=517198390, optional=True, ) + zone: str = proto.Field( + proto.STRING, + number=3744684, + ) -class ListReferrersInstancesRequest(proto.Message): - r"""A request message for Instances.ListReferrers. See the method +class ListRegionAutoscalersRequest(proto.Message): + r"""A request message for RegionAutoscalers.List. See the method description for details. @@ -55952,10 +57776,6 @@ class ListReferrersInstancesRequest(proto.Message): multiple fields using regular expressions. This field is a member of `oneof`_ ``_filter``. - instance (str): - Name of the target instance scoping this - request, or '-' if the request should span over - all instances in the container. max_results (int): The maximum number of results per page that should be returned. If the number of available results is larger than @@ -55986,14 +57806,18 @@ class ListReferrersInstancesRequest(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 - default value is false. + 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): - The name of the zone for this request. """ filter: str = proto.Field( @@ -56001,10 +57825,6 @@ class ListReferrersInstancesRequest(proto.Message): number=336120696, optional=True, ) - instance: str = proto.Field( - proto.STRING, - number=18257045, - ) max_results: int = proto.Field( proto.UINT32, number=54715419, @@ -56024,20 +57844,20 @@ class ListReferrersInstancesRequest(proto.Message): proto.STRING, number=227560217, ) + region: str = proto.Field( + proto.STRING, + number=138946292, + ) return_partial_success: bool = proto.Field( proto.BOOL, number=517198390, optional=True, ) - zone: str = proto.Field( - proto.STRING, - number=3744684, - ) -class ListRegionAutoscalersRequest(proto.Message): - r"""A request message for RegionAutoscalers.List. See the method - description for details. +class ListRegionBackendServicesRequest(proto.Message): + r"""A request message for RegionBackendServices.List. See the + method description for details. .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields @@ -56122,7 +57942,11 @@ class ListRegionAutoscalersRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. """ @@ -56162,9 +57986,9 @@ class ListRegionAutoscalersRequest(proto.Message): ) -class ListRegionBackendServicesRequest(proto.Message): - r"""A request message for RegionBackendServices.List. See the - method description for details. +class ListRegionCommitmentsRequest(proto.Message): + r"""A request message for RegionCommitments.List. See the method + description for details. .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields @@ -56245,11 +58069,15 @@ class ListRegionBackendServicesRequest(proto.Message): project (str): Project ID for this request. region (str): - Name of the region scoping this request. + Name of the region 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. + 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``. """ @@ -56289,8 +58117,8 @@ class ListRegionBackendServicesRequest(proto.Message): ) -class ListRegionCommitmentsRequest(proto.Message): - r"""A request message for RegionCommitments.List. See the method +class ListRegionDiskTypesRequest(proto.Message): + r"""A request message for RegionDiskTypes.List. See the method description for details. @@ -56372,11 +58200,15 @@ class ListRegionCommitmentsRequest(proto.Message): project (str): Project ID for this request. region (str): - Name of the region for this request. + The name of the region 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. + 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``. """ @@ -56416,8 +58248,8 @@ class ListRegionCommitmentsRequest(proto.Message): ) -class ListRegionDiskTypesRequest(proto.Message): - r"""A request message for RegionDiskTypes.List. See the method +class ListRegionDisksRequest(proto.Message): + r"""A request message for RegionDisks.List. See the method description for details. @@ -56499,11 +58331,15 @@ class ListRegionDiskTypesRequest(proto.Message): project (str): Project ID for this request. region (str): - The name of the region for this request. + Name of the region 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. + 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``. """ @@ -56543,9 +58379,9 @@ class ListRegionDiskTypesRequest(proto.Message): ) -class ListRegionDisksRequest(proto.Message): - r"""A request message for RegionDisks.List. See the method - description for details. +class ListRegionHealthCheckServicesRequest(proto.Message): + r"""A request message for RegionHealthCheckServices.List. See the + method description for details. .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields @@ -56626,11 +58462,15 @@ class ListRegionDisksRequest(proto.Message): project (str): Project ID for this request. region (str): - Name of the region for this request. + 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 - default value is false. + 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``. """ @@ -56670,9 +58510,9 @@ class ListRegionDisksRequest(proto.Message): ) -class ListRegionHealthCheckServicesRequest(proto.Message): - r"""A request message for RegionHealthCheckServices.List. See the - method description for details. +class ListRegionHealthChecksRequest(proto.Message): + r"""A request message for RegionHealthChecks.List. See the method + description for details. .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields @@ -56757,7 +58597,11 @@ class ListRegionHealthCheckServicesRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. """ @@ -56797,9 +58641,9 @@ class ListRegionHealthCheckServicesRequest(proto.Message): ) -class ListRegionHealthChecksRequest(proto.Message): - r"""A request message for RegionHealthChecks.List. See the method - description for details. +class ListRegionInstanceGroupManagersRequest(proto.Message): + r"""A request message for RegionInstanceGroupManagers.List. See + the method description for details. .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields @@ -56884,7 +58728,11 @@ class ListRegionHealthChecksRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. """ @@ -56924,9 +58772,9 @@ class ListRegionHealthChecksRequest(proto.Message): ) -class ListRegionInstanceGroupManagersRequest(proto.Message): - r"""A request message for RegionInstanceGroupManagers.List. See - the method description for details. +class ListRegionInstanceGroupsRequest(proto.Message): + r"""A request message for RegionInstanceGroups.List. See the + method description for details. .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields @@ -57011,7 +58859,11 @@ class ListRegionInstanceGroupManagersRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. """ @@ -57051,8 +58903,8 @@ class ListRegionInstanceGroupManagersRequest(proto.Message): ) -class ListRegionInstanceGroupsRequest(proto.Message): - r"""A request message for RegionInstanceGroups.List. See the +class ListRegionInstanceTemplatesRequest(proto.Message): + r"""A request message for RegionInstanceTemplates.List. See the method description for details. @@ -57134,11 +58986,15 @@ class ListRegionInstanceGroupsRequest(proto.Message): project (str): Project ID for this request. region (str): - Name of the region scoping this request. + The name of the regions 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. + 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``. """ @@ -57178,8 +59034,8 @@ class ListRegionInstanceGroupsRequest(proto.Message): ) -class ListRegionInstanceTemplatesRequest(proto.Message): - r"""A request message for RegionInstanceTemplates.List. See the +class ListRegionInstantSnapshotsRequest(proto.Message): + r"""A request message for RegionInstantSnapshots.List. See the method description for details. @@ -57261,11 +59117,15 @@ class ListRegionInstanceTemplatesRequest(proto.Message): project (str): Project ID for this request. region (str): - The name of the regions for this request. + The name of the region 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. + 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``. """ @@ -57394,7 +59254,11 @@ class ListRegionNetworkEndpointGroupsRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. """ @@ -57521,7 +59385,11 @@ class ListRegionNetworkFirewallPoliciesRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. """ @@ -57648,7 +59516,11 @@ class ListRegionNotificationEndpointsRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. """ @@ -57775,7 +59647,11 @@ class ListRegionOperationsRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. """ @@ -57902,7 +59778,11 @@ class ListRegionSecurityPoliciesRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. """ @@ -58029,7 +59909,11 @@ class ListRegionSslCertificatesRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. """ @@ -58156,7 +60040,11 @@ class ListRegionSslPoliciesRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. """ @@ -58283,7 +60171,11 @@ class ListRegionTargetHttpProxiesRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. """ @@ -58410,7 +60302,11 @@ class ListRegionTargetHttpsProxiesRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. """ @@ -58537,7 +60433,11 @@ class ListRegionTargetTcpProxiesRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. """ @@ -58664,7 +60564,11 @@ class ListRegionUrlMapsRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. """ @@ -58791,7 +60695,11 @@ class ListRegionZonesRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. """ @@ -58916,7 +60824,11 @@ class ListRegionsRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. """ @@ -59037,7 +60949,11 @@ class ListReservationsRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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): @@ -59166,7 +61082,11 @@ class ListResourcePoliciesRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. """ @@ -59293,7 +61213,11 @@ class ListRoutersRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. """ @@ -59418,7 +61342,11 @@ class ListRoutesRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. """ @@ -59539,7 +61467,11 @@ class ListSecurityPoliciesRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. """ @@ -59662,7 +61594,11 @@ class ListServiceAttachmentsRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. """ @@ -59787,7 +61723,11 @@ class ListSnapshotsRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. """ @@ -59908,7 +61848,11 @@ class ListSslCertificatesRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. """ @@ -60029,7 +61973,11 @@ class ListSslPoliciesRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. """ @@ -60152,7 +62100,11 @@ class ListSubnetworksRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. """ @@ -60277,7 +62229,11 @@ class ListTargetGrpcProxiesRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. """ @@ -60398,7 +62354,11 @@ class ListTargetHttpProxiesRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. """ @@ -60519,7 +62479,11 @@ class ListTargetHttpsProxiesRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. """ @@ -60640,7 +62604,11 @@ class ListTargetInstancesRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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): @@ -60769,7 +62737,11 @@ class ListTargetPoolsRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. """ @@ -60894,7 +62866,11 @@ class ListTargetSslProxiesRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. """ @@ -61015,7 +62991,11 @@ class ListTargetTcpProxiesRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. """ @@ -61138,7 +63118,11 @@ class ListTargetVpnGatewaysRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. """ @@ -61263,7 +63247,11 @@ class ListUrlMapsRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. """ @@ -61384,7 +63372,11 @@ class ListUsableBackendServicesRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. """ @@ -61509,7 +63501,11 @@ class ListUsableRegionBackendServicesRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. """ @@ -61634,7 +63630,11 @@ class ListUsableSubnetworksRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. """ @@ -61757,7 +63757,11 @@ class ListVpnGatewaysRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. """ @@ -61884,7 +63888,11 @@ class ListVpnTunnelsRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. """ @@ -62011,7 +64019,11 @@ class ListXpnHostsProjectsRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. """ @@ -62139,7 +64151,11 @@ class ListZoneOperationsRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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): @@ -62266,7 +64282,11 @@ class ListZonesRequest(proto.Message): return_partial_success (bool): Opt-in for partial success behavior which provides partial results in case of failure. The - default value is false. + 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``. """ @@ -74111,6 +76131,14 @@ class Project(proto.Message): .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields Attributes: + cloud_armor_tier (str): + [Output Only] The Cloud Armor tier for this project. It can + be one of the following values: CA_STANDARD, + CA_ENTERPRISE_PAYGO. If this field is not specified, it is + assumed to be CA_STANDARD. Check the CloudArmorTier enum for + the list of possible values. + + This field is a member of `oneof`_ ``_cloud_armor_tier``. common_instance_metadata (google.cloud.compute_v1.types.Metadata): Metadata key/value pairs available to all instances contained in this project. See Custom @@ -74189,6 +76217,27 @@ class Project(proto.Message): This field is a member of `oneof`_ ``_xpn_project_status``. """ + class CloudArmorTier(proto.Enum): + r"""[Output Only] The Cloud Armor tier for this project. It can be one + of the following values: CA_STANDARD, CA_ENTERPRISE_PAYGO. If this + field is not specified, it is assumed to be CA_STANDARD. + + Values: + UNDEFINED_CLOUD_ARMOR_TIER (0): + A value indicating that the enum field is not + set. + CA_ENTERPRISE_ANNUAL (219921116): + Enterprise tier protection billed annually. + CA_ENTERPRISE_PAYGO (453530323): + Enterprise tier protection billed monthly. + CA_STANDARD (13156734): + Standard protection. + """ + UNDEFINED_CLOUD_ARMOR_TIER = 0 + CA_ENTERPRISE_ANNUAL = 219921116 + CA_ENTERPRISE_PAYGO = 453530323 + CA_STANDARD = 13156734 + class DefaultNetworkTier(proto.Enum): r"""This signifies the default network tier used for configuring resources of the project and can only take the following values: @@ -74258,6 +76307,11 @@ class XpnProjectStatus(proto.Enum): HOST = 2223528 UNSPECIFIED_XPN_PROJECT_STATUS = 340393257 + cloud_armor_tier: str = proto.Field( + proto.STRING, + number=4427052, + optional=True, + ) common_instance_metadata: "Metadata" = proto.Field( proto.MESSAGE, number=185794117, @@ -74441,6 +76495,46 @@ class ProjectsListXpnHostsRequest(proto.Message): ) +class ProjectsSetCloudArmorTierRequest(proto.Message): + r""" + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + cloud_armor_tier (str): + Managed protection tier to be set. + Check the CloudArmorTier enum for the list of + possible values. + + This field is a member of `oneof`_ ``_cloud_armor_tier``. + """ + + class CloudArmorTier(proto.Enum): + r"""Managed protection tier to be set. + + Values: + UNDEFINED_CLOUD_ARMOR_TIER (0): + A value indicating that the enum field is not + set. + CA_ENTERPRISE_ANNUAL (219921116): + Enterprise tier protection billed annually. + CA_ENTERPRISE_PAYGO (453530323): + Enterprise tier protection billed monthly. + CA_STANDARD (13156734): + Standard protection. + """ + UNDEFINED_CLOUD_ARMOR_TIER = 0 + CA_ENTERPRISE_ANNUAL = 219921116 + CA_ENTERPRISE_PAYGO = 453530323 + CA_STANDARD = 13156734 + + cloud_armor_tier: str = proto.Field( + proto.STRING, + number=4427052, + optional=True, + ) + + class ProjectsSetDefaultNetworkTierRequest(proto.Message): r""" @@ -87281,6 +89375,54 @@ class SetCertificateMapTargetSslProxyRequest(proto.Message): ) +class SetCloudArmorTierProjectRequest(proto.Message): + r"""A request message for Projects.SetCloudArmorTier. See the + method description for details. + + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + project (str): + Project ID for this request. + projects_set_cloud_armor_tier_request_resource (google.cloud.compute_v1.types.ProjectsSetCloudArmorTierRequest): + The body resource 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``. + """ + + project: str = proto.Field( + proto.STRING, + number=227560217, + ) + projects_set_cloud_armor_tier_request_resource: "ProjectsSetCloudArmorTierRequest" = proto.Field( + proto.MESSAGE, + number=77053391, + message="ProjectsSetCloudArmorTierRequest", + ) + request_id: str = proto.Field( + proto.STRING, + number=37109963, + optional=True, + ) + + class SetCommonInstanceMetadataOperationMetadata(proto.Message): r""" @@ -87917,6 +90059,40 @@ 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. @@ -88137,9 +90313,43 @@ class SetIamPolicyRegionBackendServiceRequest(proto.Message): ) -class SetIamPolicyRegionDiskRequest(proto.Message): - r"""A request message for RegionDisks.SetIamPolicy. See the - method description for details. +class SetIamPolicyRegionDiskRequest(proto.Message): + r"""A request message for RegionDisks.SetIamPolicy. See the + method description for details. + + Attributes: + project (str): + Project ID for this request. + region (str): + The name of the region for this request. + region_set_policy_request_resource (google.cloud.compute_v1.types.RegionSetPolicyRequest): + The body resource for this request + resource (str): + Name or id of the resource for this request. + """ + + project: str = proto.Field( + proto.STRING, + number=227560217, + ) + region: str = proto.Field( + proto.STRING, + number=138946292, + ) + region_set_policy_request_resource: "RegionSetPolicyRequest" = proto.Field( + proto.MESSAGE, + number=276489091, + message="RegionSetPolicyRequest", + ) + resource: str = proto.Field( + proto.STRING, + number=195806222, + ) + + +class SetIamPolicyRegionInstantSnapshotRequest(proto.Message): + r"""A request message for RegionInstantSnapshots.SetIamPolicy. + See the method description for details. Attributes: project (str): @@ -88701,64 +90911,272 @@ class SetLabelsForwardingRuleRequest(proto.Message): ) -class SetLabelsGlobalAddressRequest(proto.Message): - r"""A request message for GlobalAddresses.SetLabels. See the - method description for details. - - Attributes: - global_set_labels_request_resource (google.cloud.compute_v1.types.GlobalSetLabelsRequest): - 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_labels_request_resource: "GlobalSetLabelsRequest" = proto.Field( - proto.MESSAGE, - number=319917189, - message="GlobalSetLabelsRequest", - ) - project: str = proto.Field( - proto.STRING, - number=227560217, - ) - resource: str = proto.Field( - proto.STRING, - number=195806222, - ) - - -class SetLabelsGlobalForwardingRuleRequest(proto.Message): - r"""A request message for GlobalForwardingRules.SetLabels. See - the method description for details. - - Attributes: - global_set_labels_request_resource (google.cloud.compute_v1.types.GlobalSetLabelsRequest): - 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_labels_request_resource: "GlobalSetLabelsRequest" = proto.Field( - proto.MESSAGE, - number=319917189, - message="GlobalSetLabelsRequest", - ) - project: str = proto.Field( - proto.STRING, - number=227560217, - ) - resource: str = proto.Field( - proto.STRING, - number=195806222, - ) - - -class SetLabelsImageRequest(proto.Message): - r"""A request message for Images.SetLabels. See the method +class SetLabelsGlobalAddressRequest(proto.Message): + r"""A request message for GlobalAddresses.SetLabels. See the + method description for details. + + Attributes: + global_set_labels_request_resource (google.cloud.compute_v1.types.GlobalSetLabelsRequest): + 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_labels_request_resource: "GlobalSetLabelsRequest" = proto.Field( + proto.MESSAGE, + number=319917189, + message="GlobalSetLabelsRequest", + ) + project: str = proto.Field( + proto.STRING, + number=227560217, + ) + resource: str = proto.Field( + proto.STRING, + number=195806222, + ) + + +class SetLabelsGlobalForwardingRuleRequest(proto.Message): + r"""A request message for GlobalForwardingRules.SetLabels. See + the method description for details. + + Attributes: + global_set_labels_request_resource (google.cloud.compute_v1.types.GlobalSetLabelsRequest): + 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_labels_request_resource: "GlobalSetLabelsRequest" = proto.Field( + proto.MESSAGE, + number=319917189, + message="GlobalSetLabelsRequest", + ) + project: str = proto.Field( + proto.STRING, + number=227560217, + ) + resource: str = proto.Field( + proto.STRING, + number=195806222, + ) + + +class SetLabelsImageRequest(proto.Message): + r"""A request message for Images.SetLabels. See the method + description for details. + + Attributes: + global_set_labels_request_resource (google.cloud.compute_v1.types.GlobalSetLabelsRequest): + 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_labels_request_resource: "GlobalSetLabelsRequest" = proto.Field( + proto.MESSAGE, + number=319917189, + message="GlobalSetLabelsRequest", + ) + project: str = proto.Field( + proto.STRING, + number=227560217, + ) + resource: str = proto.Field( + proto.STRING, + number=195806222, + ) + + +class SetLabelsInstanceRequest(proto.Message): + r"""A request message for Instances.SetLabels. See the method + description for details. + + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + instance (str): + Name of the instance scoping this request. + instances_set_labels_request_resource (google.cloud.compute_v1.types.InstancesSetLabelsRequest): + 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``. + zone (str): + The name of the zone for this request. + """ + + instance: str = proto.Field( + proto.STRING, + number=18257045, + ) + instances_set_labels_request_resource: "InstancesSetLabelsRequest" = proto.Field( + proto.MESSAGE, + number=207749344, + message="InstancesSetLabelsRequest", + ) + project: str = proto.Field( + proto.STRING, + number=227560217, + ) + request_id: str = proto.Field( + proto.STRING, + number=37109963, + optional=True, + ) + zone: str = proto.Field( + proto.STRING, + number=3744684, + ) + + +class SetLabelsInstantSnapshotRequest(proto.Message): + r"""A request message for InstantSnapshots.SetLabels. See the + method description for details. + + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + 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. + zone (str): + The name of the zone for this request. + zone_set_labels_request_resource (google.cloud.compute_v1.types.ZoneSetLabelsRequest): + The body resource for this request + """ + + 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, + ) + zone: str = proto.Field( + proto.STRING, + number=3744684, + ) + zone_set_labels_request_resource: "ZoneSetLabelsRequest" = proto.Field( + proto.MESSAGE, + number=364950798, + message="ZoneSetLabelsRequest", + ) + + +class SetLabelsInterconnectAttachmentRequest(proto.Message): + r"""A request message for InterconnectAttachments.SetLabels. See + the method description for details. + + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + project (str): + Project ID for this request. + region (str): + The region for this request. + region_set_labels_request_resource (google.cloud.compute_v1.types.RegionSetLabelsRequest): + The body resource 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. + """ + + project: str = proto.Field( + proto.STRING, + number=227560217, + ) + region: str = proto.Field( + proto.STRING, + number=138946292, + ) + region_set_labels_request_resource: "RegionSetLabelsRequest" = proto.Field( + proto.MESSAGE, + number=259357782, + message="RegionSetLabelsRequest", + ) + request_id: str = proto.Field( + proto.STRING, + number=37109963, + optional=True, + ) + resource: str = proto.Field( + proto.STRING, + number=195806222, + ) + + +class SetLabelsInterconnectRequest(proto.Message): + r"""A request message for Interconnects.SetLabels. See the method description for details. Attributes: @@ -88785,71 +91203,11 @@ class SetLabelsImageRequest(proto.Message): ) -class SetLabelsInstanceRequest(proto.Message): - r"""A request message for Instances.SetLabels. See the method +class SetLabelsRegionDiskRequest(proto.Message): + r"""A request message for RegionDisks.SetLabels. See the method description for details. - .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields - - Attributes: - instance (str): - Name of the instance scoping this request. - instances_set_labels_request_resource (google.cloud.compute_v1.types.InstancesSetLabelsRequest): - 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``. - zone (str): - The name of the zone for this request. - """ - - instance: str = proto.Field( - proto.STRING, - number=18257045, - ) - instances_set_labels_request_resource: "InstancesSetLabelsRequest" = proto.Field( - proto.MESSAGE, - number=207749344, - message="InstancesSetLabelsRequest", - ) - project: str = proto.Field( - proto.STRING, - number=227560217, - ) - request_id: str = proto.Field( - proto.STRING, - number=37109963, - optional=True, - ) - zone: str = proto.Field( - proto.STRING, - number=3744684, - ) - - -class SetLabelsInterconnectAttachmentRequest(proto.Message): - r"""A request message for InterconnectAttachments.SetLabels. See - the method description for details. - - .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields Attributes: @@ -88905,37 +91263,9 @@ class SetLabelsInterconnectAttachmentRequest(proto.Message): ) -class SetLabelsInterconnectRequest(proto.Message): - r"""A request message for Interconnects.SetLabels. See the method - description for details. - - Attributes: - global_set_labels_request_resource (google.cloud.compute_v1.types.GlobalSetLabelsRequest): - 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_labels_request_resource: "GlobalSetLabelsRequest" = proto.Field( - proto.MESSAGE, - number=319917189, - message="GlobalSetLabelsRequest", - ) - project: str = proto.Field( - proto.STRING, - number=227560217, - ) - resource: str = proto.Field( - proto.STRING, - number=195806222, - ) - - -class SetLabelsRegionDiskRequest(proto.Message): - r"""A request message for RegionDisks.SetLabels. See the method - description for details. +class SetLabelsRegionInstantSnapshotRequest(proto.Message): + r"""A request message for RegionInstantSnapshots.SetLabels. See + the method description for details. .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields @@ -91844,6 +94174,32 @@ class Snapshot(proto.Message): of a given disk name. This field is a member of `oneof`_ ``_source_disk_id``. + source_instant_snapshot (str): + The source instant snapshot used to create + this snapshot. You can provide this as a partial + or full URL to the resource. For example, the + following are valid values: - + https://www.googleapis.com/compute/v1/projects/project/zones/zone + /instantSnapshots/instantSnapshot - + projects/project/zones/zone/instantSnapshots/instantSnapshot + - zones/zone/instantSnapshots/instantSnapshot + + This field is a member of `oneof`_ ``_source_instant_snapshot``. + source_instant_snapshot_encryption_key (google.cloud.compute_v1.types.CustomerEncryptionKey): + Customer provided encryption key when + creating Snapshot from Instant Snapshot. + + This field is a member of `oneof`_ ``_source_instant_snapshot_encryption_key``. + source_instant_snapshot_id (str): + [Output Only] The unique ID of the instant snapshot used to + create this snapshot. This value identifies the exact + instant snapshot that was used to create this persistent + disk. For example, if you created the persistent disk from + an instant snapshot that was later deleted and recreated + under the same name, the source instant snapshot ID would + identify the exact instant snapshot that was used. + + This field is a member of `oneof`_ ``_source_instant_snapshot_id``. source_snapshot_schedule_policy (str): [Output Only] URL of the resource policy which created this scheduled snapshot. @@ -92099,6 +94455,22 @@ class StorageBytesStatus(proto.Enum): number=454190809, optional=True, ) + source_instant_snapshot: str = proto.Field( + proto.STRING, + number=219202054, + optional=True, + ) + source_instant_snapshot_encryption_key: "CustomerEncryptionKey" = proto.Field( + proto.MESSAGE, + number=436536060, + optional=True, + message="CustomerEncryptionKey", + ) + source_instant_snapshot_id: str = proto.Field( + proto.STRING, + number=287582708, + optional=True, + ) source_snapshot_schedule_policy: str = proto.Field( proto.STRING, number=235756291, @@ -98931,6 +101303,40 @@ class TestIamPermissionsInstanceTemplateRequest(proto.Message): ) +class TestIamPermissionsInstantSnapshotRequest(proto.Message): + r"""A request message for InstantSnapshots.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 + zone (str): + The name of the zone 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", + ) + zone: str = proto.Field( + proto.STRING, + number=3744684, + ) + + class TestIamPermissionsLicenseCodeRequest(proto.Message): r"""A request message for LicenseCodes.TestIamPermissions. See the method description for details. @@ -99284,6 +101690,41 @@ class TestIamPermissionsRegionDiskRequest(proto.Message): ) +class TestIamPermissionsRegionInstantSnapshotRequest(proto.Message): + r"""A request message for + RegionInstantSnapshots.TestIamPermissions. See the method + description for details. + + Attributes: + 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. + test_permissions_request_resource (google.cloud.compute_v1.types.TestPermissionsRequest): + The body resource for this request + """ + + project: str = proto.Field( + proto.STRING, + number=227560217, + ) + region: str = proto.Field( + proto.STRING, + number=138946292, + ) + resource: str = proto.Field( + proto.STRING, + number=195806222, + ) + test_permissions_request_resource: "TestPermissionsRequest" = proto.Field( + proto.MESSAGE, + number=439214758, + message="TestPermissionsRequest", + ) + + class TestIamPermissionsRegionNetworkFirewallPolicyRequest(proto.Message): r"""A request message for RegionNetworkFirewallPolicies.TestIamPermissions. See the method @@ -102679,6 +105120,13 @@ class VpnGateway(proto.Message): resource. This field is a member of `oneof`_ ``_description``. + gateway_ip_version (str): + The IP family of the gateway IPs for the + HA-VPN gateway interfaces. If not specified, + IPV4 will be used. Check the GatewayIpVersion + enum for the list of possible values. + + This field is a member of `oneof`_ ``_gateway_ip_version``. id (int): [Output Only] The unique identifier for the resource. This identifier is defined by the server. @@ -102746,6 +105194,25 @@ class VpnGateway(proto.Message): this VPN gateway. """ + class GatewayIpVersion(proto.Enum): + r"""The IP family of the gateway IPs for the HA-VPN gateway + interfaces. If not specified, IPV4 will be used. + + Values: + UNDEFINED_GATEWAY_IP_VERSION (0): + A value indicating that the enum field is not + set. + IPV4 (2254341): + Every HA-VPN gateway interface is configured + with an IPv4 address. + IPV6 (2254343): + Every HA-VPN gateway interface is configured + with an IPv6 address. + """ + UNDEFINED_GATEWAY_IP_VERSION = 0 + IPV4 = 2254341 + IPV6 = 2254343 + class StackType(proto.Enum): r"""The stack type for this VPN gateway to identify the IP protocols that are enabled. Possible values are: IPV4_ONLY, IPV4_IPV6. If not @@ -102775,6 +105242,11 @@ class StackType(proto.Enum): number=422937596, optional=True, ) + gateway_ip_version: str = proto.Field( + proto.STRING, + number=65074843, + optional=True, + ) id: int = proto.Field( proto.UINT64, number=3355, @@ -103211,6 +105683,13 @@ class VpnGatewayVpnGatewayInterface(proto.Message): regional external IP address. This field is a member of `oneof`_ ``_ip_address``. + ipv6_address (str): + [Output Only] IPv6 address for this VPN interface associated + with the VPN gateway. The IPv6 address must be a regional + external IPv6 address. The format is RFC 5952 format (e.g. + 2001:db8::2d9:51:0:0). + + This field is a member of `oneof`_ ``_ipv6_address``. """ id: int = proto.Field( @@ -103228,6 +105707,11 @@ class VpnGatewayVpnGatewayInterface(proto.Message): number=406272220, optional=True, ) + ipv6_address: str = proto.Field( + proto.STRING, + number=341563804, + optional=True, + ) class VpnGatewaysGetStatusResponse(proto.Message): diff --git a/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_instant_snapshots_aggregated_list_sync.py b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_instant_snapshots_aggregated_list_sync.py new file mode 100644 index 000000000000..073027fa297e --- /dev/null +++ b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_instant_snapshots_aggregated_list_sync.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 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 AggregatedList +# 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_InstantSnapshots_AggregatedList_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_aggregated_list(): + # Create a client + client = compute_v1.InstantSnapshotsClient() + + # Initialize request argument(s) + request = compute_v1.AggregatedListInstantSnapshotsRequest( + project="project_value", + ) + + # Make the request + page_result = client.aggregated_list(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END compute_v1_generated_InstantSnapshots_AggregatedList_sync] diff --git a/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_instant_snapshots_delete_sync.py b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_instant_snapshots_delete_sync.py new file mode 100644 index 000000000000..0fbf0ad239e9 --- /dev/null +++ b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_instant_snapshots_delete_sync.py @@ -0,0 +1,54 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 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_InstantSnapshots_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.InstantSnapshotsClient() + + # Initialize request argument(s) + request = compute_v1.DeleteInstantSnapshotRequest( + instant_snapshot="instant_snapshot_value", + project="project_value", + zone="zone_value", + ) + + # Make the request + response = client.delete(request=request) + + # Handle the response + print(response) + +# [END compute_v1_generated_InstantSnapshots_Delete_sync] diff --git a/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_instant_snapshots_get_iam_policy_sync.py b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_instant_snapshots_get_iam_policy_sync.py new file mode 100644 index 000000000000..b9ef0c3e988b --- /dev/null +++ b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_instant_snapshots_get_iam_policy_sync.py @@ -0,0 +1,54 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 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_InstantSnapshots_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.InstantSnapshotsClient() + + # Initialize request argument(s) + request = compute_v1.GetIamPolicyInstantSnapshotRequest( + project="project_value", + resource="resource_value", + zone="zone_value", + ) + + # Make the request + response = client.get_iam_policy(request=request) + + # Handle the response + print(response) + +# [END compute_v1_generated_InstantSnapshots_GetIamPolicy_sync] diff --git a/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_instant_snapshots_get_sync.py b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_instant_snapshots_get_sync.py new file mode 100644 index 000000000000..bf4d6c377b86 --- /dev/null +++ b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_instant_snapshots_get_sync.py @@ -0,0 +1,54 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 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_InstantSnapshots_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.InstantSnapshotsClient() + + # Initialize request argument(s) + request = compute_v1.GetInstantSnapshotRequest( + instant_snapshot="instant_snapshot_value", + project="project_value", + zone="zone_value", + ) + + # Make the request + response = client.get(request=request) + + # Handle the response + print(response) + +# [END compute_v1_generated_InstantSnapshots_Get_sync] diff --git a/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_instant_snapshots_insert_sync.py b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_instant_snapshots_insert_sync.py new file mode 100644 index 000000000000..c5fdf026eae5 --- /dev/null +++ b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_instant_snapshots_insert_sync.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 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_InstantSnapshots_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.InstantSnapshotsClient() + + # Initialize request argument(s) + request = compute_v1.InsertInstantSnapshotRequest( + project="project_value", + zone="zone_value", + ) + + # Make the request + response = client.insert(request=request) + + # Handle the response + print(response) + +# [END compute_v1_generated_InstantSnapshots_Insert_sync] diff --git a/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_instant_snapshots_list_sync.py b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_instant_snapshots_list_sync.py new file mode 100644 index 000000000000..5a3795581611 --- /dev/null +++ b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_instant_snapshots_list_sync.py @@ -0,0 +1,54 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 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_InstantSnapshots_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.InstantSnapshotsClient() + + # Initialize request argument(s) + request = compute_v1.ListInstantSnapshotsRequest( + 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_InstantSnapshots_List_sync] diff --git a/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_instant_snapshots_set_iam_policy_sync.py b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_instant_snapshots_set_iam_policy_sync.py new file mode 100644 index 000000000000..2db69872943b --- /dev/null +++ b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_instant_snapshots_set_iam_policy_sync.py @@ -0,0 +1,54 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 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_InstantSnapshots_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.InstantSnapshotsClient() + + # Initialize request argument(s) + request = compute_v1.SetIamPolicyInstantSnapshotRequest( + project="project_value", + resource="resource_value", + zone="zone_value", + ) + + # Make the request + response = client.set_iam_policy(request=request) + + # Handle the response + print(response) + +# [END compute_v1_generated_InstantSnapshots_SetIamPolicy_sync] diff --git a/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_instant_snapshots_set_labels_sync.py b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_instant_snapshots_set_labels_sync.py new file mode 100644 index 000000000000..cdb1e4d76d4a --- /dev/null +++ b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_instant_snapshots_set_labels_sync.py @@ -0,0 +1,54 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 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 SetLabels +# 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_InstantSnapshots_SetLabels_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_labels(): + # Create a client + client = compute_v1.InstantSnapshotsClient() + + # Initialize request argument(s) + request = compute_v1.SetLabelsInstantSnapshotRequest( + project="project_value", + resource="resource_value", + zone="zone_value", + ) + + # Make the request + response = client.set_labels(request=request) + + # Handle the response + print(response) + +# [END compute_v1_generated_InstantSnapshots_SetLabels_sync] diff --git a/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_instant_snapshots_test_iam_permissions_sync.py b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_instant_snapshots_test_iam_permissions_sync.py new file mode 100644 index 000000000000..5bd9b59cc6dd --- /dev/null +++ b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_instant_snapshots_test_iam_permissions_sync.py @@ -0,0 +1,54 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 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_InstantSnapshots_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.InstantSnapshotsClient() + + # Initialize request argument(s) + request = compute_v1.TestIamPermissionsInstantSnapshotRequest( + project="project_value", + resource="resource_value", + zone="zone_value", + ) + + # Make the request + response = client.test_iam_permissions(request=request) + + # Handle the response + print(response) + +# [END compute_v1_generated_InstantSnapshots_TestIamPermissions_sync] diff --git a/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_projects_set_cloud_armor_tier_sync.py b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_projects_set_cloud_armor_tier_sync.py new file mode 100644 index 000000000000..fe6da35b3d0f --- /dev/null +++ b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_projects_set_cloud_armor_tier_sync.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 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 SetCloudArmorTier +# 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_Projects_SetCloudArmorTier_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_cloud_armor_tier(): + # Create a client + client = compute_v1.ProjectsClient() + + # Initialize request argument(s) + request = compute_v1.SetCloudArmorTierProjectRequest( + project="project_value", + ) + + # Make the request + response = client.set_cloud_armor_tier(request=request) + + # Handle the response + print(response) + +# [END compute_v1_generated_Projects_SetCloudArmorTier_sync] diff --git a/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_region_instant_snapshots_delete_sync.py b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_region_instant_snapshots_delete_sync.py new file mode 100644 index 000000000000..9787dda15315 --- /dev/null +++ b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_region_instant_snapshots_delete_sync.py @@ -0,0 +1,54 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 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_RegionInstantSnapshots_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.RegionInstantSnapshotsClient() + + # Initialize request argument(s) + request = compute_v1.DeleteRegionInstantSnapshotRequest( + instant_snapshot="instant_snapshot_value", + project="project_value", + region="region_value", + ) + + # Make the request + response = client.delete(request=request) + + # Handle the response + print(response) + +# [END compute_v1_generated_RegionInstantSnapshots_Delete_sync] diff --git a/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_region_instant_snapshots_get_iam_policy_sync.py b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_region_instant_snapshots_get_iam_policy_sync.py new file mode 100644 index 000000000000..64df66d6f11f --- /dev/null +++ b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_region_instant_snapshots_get_iam_policy_sync.py @@ -0,0 +1,54 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 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_RegionInstantSnapshots_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.RegionInstantSnapshotsClient() + + # Initialize request argument(s) + request = compute_v1.GetIamPolicyRegionInstantSnapshotRequest( + project="project_value", + region="region_value", + resource="resource_value", + ) + + # Make the request + response = client.get_iam_policy(request=request) + + # Handle the response + print(response) + +# [END compute_v1_generated_RegionInstantSnapshots_GetIamPolicy_sync] diff --git a/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_region_instant_snapshots_get_sync.py b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_region_instant_snapshots_get_sync.py new file mode 100644 index 000000000000..560d1fcade8d --- /dev/null +++ b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_region_instant_snapshots_get_sync.py @@ -0,0 +1,54 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 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_RegionInstantSnapshots_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.RegionInstantSnapshotsClient() + + # Initialize request argument(s) + request = compute_v1.GetRegionInstantSnapshotRequest( + instant_snapshot="instant_snapshot_value", + project="project_value", + region="region_value", + ) + + # Make the request + response = client.get(request=request) + + # Handle the response + print(response) + +# [END compute_v1_generated_RegionInstantSnapshots_Get_sync] diff --git a/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_region_instant_snapshots_insert_sync.py b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_region_instant_snapshots_insert_sync.py new file mode 100644 index 000000000000..ecf7009989f7 --- /dev/null +++ b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_region_instant_snapshots_insert_sync.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 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_RegionInstantSnapshots_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.RegionInstantSnapshotsClient() + + # Initialize request argument(s) + request = compute_v1.InsertRegionInstantSnapshotRequest( + project="project_value", + region="region_value", + ) + + # Make the request + response = client.insert(request=request) + + # Handle the response + print(response) + +# [END compute_v1_generated_RegionInstantSnapshots_Insert_sync] diff --git a/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_region_instant_snapshots_list_sync.py b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_region_instant_snapshots_list_sync.py new file mode 100644 index 000000000000..822242b41402 --- /dev/null +++ b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_region_instant_snapshots_list_sync.py @@ -0,0 +1,54 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 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_RegionInstantSnapshots_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.RegionInstantSnapshotsClient() + + # Initialize request argument(s) + request = compute_v1.ListRegionInstantSnapshotsRequest( + project="project_value", + region="region_value", + ) + + # Make the request + page_result = client.list(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END compute_v1_generated_RegionInstantSnapshots_List_sync] diff --git a/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_region_instant_snapshots_set_iam_policy_sync.py b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_region_instant_snapshots_set_iam_policy_sync.py new file mode 100644 index 000000000000..b6d980346d7e --- /dev/null +++ b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_region_instant_snapshots_set_iam_policy_sync.py @@ -0,0 +1,54 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 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_RegionInstantSnapshots_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.RegionInstantSnapshotsClient() + + # Initialize request argument(s) + request = compute_v1.SetIamPolicyRegionInstantSnapshotRequest( + project="project_value", + region="region_value", + resource="resource_value", + ) + + # Make the request + response = client.set_iam_policy(request=request) + + # Handle the response + print(response) + +# [END compute_v1_generated_RegionInstantSnapshots_SetIamPolicy_sync] diff --git a/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_region_instant_snapshots_set_labels_sync.py b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_region_instant_snapshots_set_labels_sync.py new file mode 100644 index 000000000000..5dacc2bac29c --- /dev/null +++ b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_region_instant_snapshots_set_labels_sync.py @@ -0,0 +1,54 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 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 SetLabels +# 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_RegionInstantSnapshots_SetLabels_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_labels(): + # Create a client + client = compute_v1.RegionInstantSnapshotsClient() + + # Initialize request argument(s) + request = compute_v1.SetLabelsRegionInstantSnapshotRequest( + project="project_value", + region="region_value", + resource="resource_value", + ) + + # Make the request + response = client.set_labels(request=request) + + # Handle the response + print(response) + +# [END compute_v1_generated_RegionInstantSnapshots_SetLabels_sync] diff --git a/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_region_instant_snapshots_test_iam_permissions_sync.py b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_region_instant_snapshots_test_iam_permissions_sync.py new file mode 100644 index 000000000000..60dfe07333bb --- /dev/null +++ b/packages/google-cloud-compute/samples/generated_samples/compute_v1_generated_region_instant_snapshots_test_iam_permissions_sync.py @@ -0,0 +1,54 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 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_RegionInstantSnapshots_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.RegionInstantSnapshotsClient() + + # Initialize request argument(s) + request = compute_v1.TestIamPermissionsRegionInstantSnapshotRequest( + project="project_value", + region="region_value", + resource="resource_value", + ) + + # Make the request + response = client.test_iam_permissions(request=request) + + # Handle the response + print(response) + +# [END compute_v1_generated_RegionInstantSnapshots_TestIamPermissions_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 9b1c11b50594..f0398983b011 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 @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-compute", - "version": "1.17.0" + "version": "0.1.0" }, "snippets": [ { @@ -20911,22 +20911,22 @@ "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.InterconnectAttachmentsClient", - "shortName": "InterconnectAttachmentsClient" + "fullName": "google.cloud.compute_v1.InstantSnapshotsClient", + "shortName": "InstantSnapshotsClient" }, - "fullName": "google.cloud.compute_v1.InterconnectAttachmentsClient.aggregated_list", + "fullName": "google.cloud.compute_v1.InstantSnapshotsClient.aggregated_list", "method": { - "fullName": "google.cloud.compute.v1.InterconnectAttachments.AggregatedList", + "fullName": "google.cloud.compute.v1.InstantSnapshots.AggregatedList", "service": { - "fullName": "google.cloud.compute.v1.InterconnectAttachments", - "shortName": "InterconnectAttachments" + "fullName": "google.cloud.compute.v1.InstantSnapshots", + "shortName": "InstantSnapshots" }, "shortName": "AggregatedList" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.AggregatedListInterconnectAttachmentsRequest" + "type": "google.cloud.compute_v1.types.AggregatedListInstantSnapshotsRequest" }, { "name": "project", @@ -20945,14 +20945,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.cloud.compute_v1.services.interconnect_attachments.pagers.AggregatedListPager", + "resultType": "google.cloud.compute_v1.services.instant_snapshots.pagers.AggregatedListPager", "shortName": "aggregated_list" }, "description": "Sample for AggregatedList", - "file": "compute_v1_generated_interconnect_attachments_aggregated_list_sync.py", + "file": "compute_v1_generated_instant_snapshots_aggregated_list_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_InterconnectAttachments_AggregatedList_sync", + "regionTag": "compute_v1_generated_InstantSnapshots_AggregatedList_sync", "segments": [ { "end": 52, @@ -20985,39 +20985,39 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_interconnect_attachments_aggregated_list_sync.py" + "title": "compute_v1_generated_instant_snapshots_aggregated_list_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.InterconnectAttachmentsClient", - "shortName": "InterconnectAttachmentsClient" + "fullName": "google.cloud.compute_v1.InstantSnapshotsClient", + "shortName": "InstantSnapshotsClient" }, - "fullName": "google.cloud.compute_v1.InterconnectAttachmentsClient.delete", + "fullName": "google.cloud.compute_v1.InstantSnapshotsClient.delete", "method": { - "fullName": "google.cloud.compute.v1.InterconnectAttachments.Delete", + "fullName": "google.cloud.compute.v1.InstantSnapshots.Delete", "service": { - "fullName": "google.cloud.compute.v1.InterconnectAttachments", - "shortName": "InterconnectAttachments" + "fullName": "google.cloud.compute.v1.InstantSnapshots", + "shortName": "InstantSnapshots" }, "shortName": "Delete" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.DeleteInterconnectAttachmentRequest" + "type": "google.cloud.compute_v1.types.DeleteInstantSnapshotRequest" }, { "name": "project", "type": "str" }, { - "name": "region", + "name": "zone", "type": "str" }, { - "name": "interconnect_attachment", + "name": "instant_snapshot", "type": "str" }, { @@ -21037,10 +21037,10 @@ "shortName": "delete" }, "description": "Sample for Delete", - "file": "compute_v1_generated_interconnect_attachments_delete_sync.py", + "file": "compute_v1_generated_instant_snapshots_delete_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_InterconnectAttachments_Delete_sync", + "regionTag": "compute_v1_generated_InstantSnapshots_Delete_sync", "segments": [ { "end": 53, @@ -21073,39 +21073,39 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_interconnect_attachments_delete_sync.py" + "title": "compute_v1_generated_instant_snapshots_delete_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.InterconnectAttachmentsClient", - "shortName": "InterconnectAttachmentsClient" + "fullName": "google.cloud.compute_v1.InstantSnapshotsClient", + "shortName": "InstantSnapshotsClient" }, - "fullName": "google.cloud.compute_v1.InterconnectAttachmentsClient.get", + "fullName": "google.cloud.compute_v1.InstantSnapshotsClient.get_iam_policy", "method": { - "fullName": "google.cloud.compute.v1.InterconnectAttachments.Get", + "fullName": "google.cloud.compute.v1.InstantSnapshots.GetIamPolicy", "service": { - "fullName": "google.cloud.compute.v1.InterconnectAttachments", - "shortName": "InterconnectAttachments" + "fullName": "google.cloud.compute.v1.InstantSnapshots", + "shortName": "InstantSnapshots" }, - "shortName": "Get" + "shortName": "GetIamPolicy" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetInterconnectAttachmentRequest" + "type": "google.cloud.compute_v1.types.GetIamPolicyInstantSnapshotRequest" }, { "name": "project", "type": "str" }, { - "name": "region", + "name": "zone", "type": "str" }, { - "name": "interconnect_attachment", + "name": "resource", "type": "str" }, { @@ -21121,14 +21121,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.cloud.compute_v1.types.InterconnectAttachment", - "shortName": "get" + "resultType": "google.cloud.compute_v1.types.Policy", + "shortName": "get_iam_policy" }, - "description": "Sample for Get", - "file": "compute_v1_generated_interconnect_attachments_get_sync.py", + "description": "Sample for GetIamPolicy", + "file": "compute_v1_generated_instant_snapshots_get_iam_policy_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_InterconnectAttachments_Get_sync", + "regionTag": "compute_v1_generated_InstantSnapshots_GetIamPolicy_sync", "segments": [ { "end": 53, @@ -21161,40 +21161,40 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_interconnect_attachments_get_sync.py" + "title": "compute_v1_generated_instant_snapshots_get_iam_policy_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.InterconnectAttachmentsClient", - "shortName": "InterconnectAttachmentsClient" + "fullName": "google.cloud.compute_v1.InstantSnapshotsClient", + "shortName": "InstantSnapshotsClient" }, - "fullName": "google.cloud.compute_v1.InterconnectAttachmentsClient.insert", + "fullName": "google.cloud.compute_v1.InstantSnapshotsClient.get", "method": { - "fullName": "google.cloud.compute.v1.InterconnectAttachments.Insert", + "fullName": "google.cloud.compute.v1.InstantSnapshots.Get", "service": { - "fullName": "google.cloud.compute.v1.InterconnectAttachments", - "shortName": "InterconnectAttachments" + "fullName": "google.cloud.compute.v1.InstantSnapshots", + "shortName": "InstantSnapshots" }, - "shortName": "Insert" + "shortName": "Get" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.InsertInterconnectAttachmentRequest" + "type": "google.cloud.compute_v1.types.GetInstantSnapshotRequest" }, { "name": "project", "type": "str" }, { - "name": "region", + "name": "zone", "type": "str" }, { - "name": "interconnect_attachment_resource", - "type": "google.cloud.compute_v1.types.InterconnectAttachment" + "name": "instant_snapshot", + "type": "str" }, { "name": "retry", @@ -21209,22 +21209,22 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "insert" + "resultType": "google.cloud.compute_v1.types.InstantSnapshot", + "shortName": "get" }, - "description": "Sample for Insert", - "file": "compute_v1_generated_interconnect_attachments_insert_sync.py", + "description": "Sample for Get", + "file": "compute_v1_generated_instant_snapshots_get_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_InterconnectAttachments_Insert_sync", + "regionTag": "compute_v1_generated_InstantSnapshots_Get_sync", "segments": [ { - "end": 52, + "end": 53, "start": 27, "type": "FULL" }, { - "end": 52, + "end": 53, "start": 27, "type": "SHORT" }, @@ -21234,52 +21234,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_interconnect_attachments_insert_sync.py" + "title": "compute_v1_generated_instant_snapshots_get_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.InterconnectAttachmentsClient", - "shortName": "InterconnectAttachmentsClient" + "fullName": "google.cloud.compute_v1.InstantSnapshotsClient", + "shortName": "InstantSnapshotsClient" }, - "fullName": "google.cloud.compute_v1.InterconnectAttachmentsClient.list", + "fullName": "google.cloud.compute_v1.InstantSnapshotsClient.insert", "method": { - "fullName": "google.cloud.compute.v1.InterconnectAttachments.List", + "fullName": "google.cloud.compute.v1.InstantSnapshots.Insert", "service": { - "fullName": "google.cloud.compute.v1.InterconnectAttachments", - "shortName": "InterconnectAttachments" + "fullName": "google.cloud.compute.v1.InstantSnapshots", + "shortName": "InstantSnapshots" }, - "shortName": "List" + "shortName": "Insert" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.ListInterconnectAttachmentsRequest" + "type": "google.cloud.compute_v1.types.InsertInstantSnapshotRequest" }, { "name": "project", "type": "str" }, { - "name": "region", + "name": "zone", "type": "str" }, + { + "name": "instant_snapshot_resource", + "type": "google.cloud.compute_v1.types.InstantSnapshot" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -21293,22 +21297,22 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.cloud.compute_v1.services.interconnect_attachments.pagers.ListPager", - "shortName": "list" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "insert" }, - "description": "Sample for List", - "file": "compute_v1_generated_interconnect_attachments_list_sync.py", + "description": "Sample for Insert", + "file": "compute_v1_generated_instant_snapshots_insert_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_InterconnectAttachments_List_sync", + "regionTag": "compute_v1_generated_InstantSnapshots_Insert_sync", "segments": [ { - "end": 53, + "end": 52, "start": 27, "type": "FULL" }, { - "end": 53, + "end": 52, "start": 27, "type": "SHORT" }, @@ -21328,50 +21332,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_instant_snapshots_insert_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.InterconnectAttachmentsClient", - "shortName": "InterconnectAttachmentsClient" + "fullName": "google.cloud.compute_v1.InstantSnapshotsClient", + "shortName": "InstantSnapshotsClient" }, - "fullName": "google.cloud.compute_v1.InterconnectAttachmentsClient.patch", + "fullName": "google.cloud.compute_v1.InstantSnapshotsClient.list", "method": { - "fullName": "google.cloud.compute.v1.InterconnectAttachments.Patch", + "fullName": "google.cloud.compute.v1.InstantSnapshots.List", "service": { - "fullName": "google.cloud.compute.v1.InterconnectAttachments", - "shortName": "InterconnectAttachments" + "fullName": "google.cloud.compute.v1.InstantSnapshots", + "shortName": "InstantSnapshots" }, - "shortName": "Patch" + "shortName": "List" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.PatchInterconnectAttachmentRequest" + "type": "google.cloud.compute_v1.types.ListInstantSnapshotsRequest" }, { "name": "project", "type": "str" }, { - "name": "region", - "type": "str" - }, - { - "name": "interconnect_attachment", + "name": "zone", "type": "str" }, - { - "name": "interconnect_attachment_resource", - "type": "google.cloud.compute_v1.types.InterconnectAttachment" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -21385,14 +21381,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "patch" + "resultType": "google.cloud.compute_v1.services.instant_snapshots.pagers.ListPager", + "shortName": "list" }, - "description": "Sample for Patch", - "file": "compute_v1_generated_interconnect_attachments_patch_sync.py", + "description": "Sample for List", + "file": "compute_v1_generated_instant_snapshots_list_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_InterconnectAttachments_Patch_sync", + "regionTag": "compute_v1_generated_InstantSnapshots_List_sync", "segments": [ { "end": 53, @@ -21410,50 +21406,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, + "start": 50, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_interconnect_attachments_patch_sync.py" + "title": "compute_v1_generated_instant_snapshots_list_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.InterconnectAttachmentsClient", - "shortName": "InterconnectAttachmentsClient" + "fullName": "google.cloud.compute_v1.InstantSnapshotsClient", + "shortName": "InstantSnapshotsClient" }, - "fullName": "google.cloud.compute_v1.InterconnectAttachmentsClient.set_labels", + "fullName": "google.cloud.compute_v1.InstantSnapshotsClient.set_iam_policy", "method": { - "fullName": "google.cloud.compute.v1.InterconnectAttachments.SetLabels", + "fullName": "google.cloud.compute.v1.InstantSnapshots.SetIamPolicy", "service": { - "fullName": "google.cloud.compute.v1.InterconnectAttachments", - "shortName": "InterconnectAttachments" + "fullName": "google.cloud.compute.v1.InstantSnapshots", + "shortName": "InstantSnapshots" }, - "shortName": "SetLabels" + "shortName": "SetIamPolicy" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.SetLabelsInterconnectAttachmentRequest" + "type": "google.cloud.compute_v1.types.SetIamPolicyInstantSnapshotRequest" }, { "name": "project", "type": "str" }, { - "name": "region", + "name": "zone", "type": "str" }, { @@ -21461,8 +21457,8 @@ "type": "str" }, { - "name": "region_set_labels_request_resource", - "type": "google.cloud.compute_v1.types.RegionSetLabelsRequest" + "name": "zone_set_policy_request_resource", + "type": "google.cloud.compute_v1.types.ZoneSetPolicyRequest" }, { "name": "retry", @@ -21477,14 +21473,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "set_labels" + "resultType": "google.cloud.compute_v1.types.Policy", + "shortName": "set_iam_policy" }, - "description": "Sample for SetLabels", - "file": "compute_v1_generated_interconnect_attachments_set_labels_sync.py", + "description": "Sample for SetIamPolicy", + "file": "compute_v1_generated_instant_snapshots_set_iam_policy_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_InterconnectAttachments_SetLabels_sync", + "regionTag": "compute_v1_generated_InstantSnapshots_SetIamPolicy_sync", "segments": [ { "end": 53, @@ -21517,116 +21513,44 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_interconnect_attachments_set_labels_sync.py" + "title": "compute_v1_generated_instant_snapshots_set_iam_policy_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.InterconnectLocationsClient", - "shortName": "InterconnectLocationsClient" + "fullName": "google.cloud.compute_v1.InstantSnapshotsClient", + "shortName": "InstantSnapshotsClient" }, - "fullName": "google.cloud.compute_v1.InterconnectLocationsClient.get", + "fullName": "google.cloud.compute_v1.InstantSnapshotsClient.set_labels", "method": { - "fullName": "google.cloud.compute.v1.InterconnectLocations.Get", + "fullName": "google.cloud.compute.v1.InstantSnapshots.SetLabels", "service": { - "fullName": "google.cloud.compute.v1.InterconnectLocations", - "shortName": "InterconnectLocations" + "fullName": "google.cloud.compute.v1.InstantSnapshots", + "shortName": "InstantSnapshots" }, - "shortName": "Get" + "shortName": "SetLabels" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetInterconnectLocationRequest" + "type": "google.cloud.compute_v1.types.SetLabelsInstantSnapshotRequest" }, { "name": "project", "type": "str" }, { - "name": "interconnect_location", + "name": "zone", "type": "str" }, { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.cloud.compute_v1.types.InterconnectLocation", - "shortName": "get" - }, - "description": "Sample for Get", - "file": "compute_v1_generated_interconnect_locations_get_sync.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_InterconnectLocations_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_interconnect_locations_get_sync.py" - }, - { - "canonical": true, - "clientMethod": { - "client": { - "fullName": "google.cloud.compute_v1.InterconnectLocationsClient", - "shortName": "InterconnectLocationsClient" - }, - "fullName": "google.cloud.compute_v1.InterconnectLocationsClient.list", - "method": { - "fullName": "google.cloud.compute.v1.InterconnectLocations.List", - "service": { - "fullName": "google.cloud.compute.v1.InterconnectLocations", - "shortName": "InterconnectLocations" - }, - "shortName": "List" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.compute_v1.types.ListInterconnectLocationsRequest" + "name": "resource", + "type": "str" }, { - "name": "project", - "type": "str" + "name": "zone_set_labels_request_resource", + "type": "google.cloud.compute_v1.types.ZoneSetLabelsRequest" }, { "name": "retry", @@ -21641,22 +21565,22 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.cloud.compute_v1.services.interconnect_locations.pagers.ListPager", - "shortName": "list" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "set_labels" }, - "description": "Sample for List", - "file": "compute_v1_generated_interconnect_locations_list_sync.py", + "description": "Sample for SetLabels", + "file": "compute_v1_generated_instant_snapshots_set_labels_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_InterconnectLocations_List_sync", + "regionTag": "compute_v1_generated_InstantSnapshots_SetLabels_sync", "segments": [ { - "end": 52, + "end": 53, "start": 27, "type": "FULL" }, { - "end": 52, + "end": 53, "start": 27, "type": "SHORT" }, @@ -21666,52 +21590,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": 53, - "start": 49, + "end": 54, + "start": 51, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_interconnect_locations_list_sync.py" + "title": "compute_v1_generated_instant_snapshots_set_labels_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.InterconnectRemoteLocationsClient", - "shortName": "InterconnectRemoteLocationsClient" + "fullName": "google.cloud.compute_v1.InstantSnapshotsClient", + "shortName": "InstantSnapshotsClient" }, - "fullName": "google.cloud.compute_v1.InterconnectRemoteLocationsClient.get", + "fullName": "google.cloud.compute_v1.InstantSnapshotsClient.test_iam_permissions", "method": { - "fullName": "google.cloud.compute.v1.InterconnectRemoteLocations.Get", + "fullName": "google.cloud.compute.v1.InstantSnapshots.TestIamPermissions", "service": { - "fullName": "google.cloud.compute.v1.InterconnectRemoteLocations", - "shortName": "InterconnectRemoteLocations" + "fullName": "google.cloud.compute.v1.InstantSnapshots", + "shortName": "InstantSnapshots" }, - "shortName": "Get" + "shortName": "TestIamPermissions" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetInterconnectRemoteLocationRequest" + "type": "google.cloud.compute_v1.types.TestIamPermissionsInstantSnapshotRequest" }, { "name": "project", "type": "str" }, { - "name": "interconnect_remote_location", + "name": "zone", + "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" @@ -21725,22 +21657,22 @@ "type": "Sequence[Tuple[str, str]" } ], - "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_instant_snapshots_test_iam_permissions_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_InterconnectRemoteLocations_Get_sync", + "regionTag": "compute_v1_generated_InstantSnapshots_TestIamPermissions_sync", "segments": [ { - "end": 52, + "end": 53, "start": 27, "type": "FULL" }, { - "end": 52, + "end": 53, "start": 27, "type": "SHORT" }, @@ -21750,43 +21682,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_interconnect_remote_locations_get_sync.py" + "title": "compute_v1_generated_instant_snapshots_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", @@ -21805,14 +21737,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "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, @@ -21845,35 +21777,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" }, { @@ -21893,18 +21829,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" }, @@ -21914,50 +21850,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" }, { @@ -21973,22 +21913,22 @@ "type": "Sequence[Tuple[str, str]" } ], - "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" }, @@ -21998,52 +21938,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" @@ -22057,14 +22001,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "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, @@ -22097,35 +22041,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" }, { @@ -22141,22 +22085,22 @@ "type": "Sequence[Tuple[str, str]" } ], - "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" }, @@ -22176,41 +22120,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", @@ -22226,21 +22178,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" }, @@ -22250,48 +22202,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" @@ -22305,22 +22269,22 @@ "type": "Sequence[Tuple[str, str]" } ], - "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" }, @@ -22330,56 +22294,52 @@ "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.InterconnectLocationsClient", + "shortName": "InterconnectLocationsClient" }, - "fullName": "google.cloud.compute_v1.InterconnectsClient.patch", + "fullName": "google.cloud.compute_v1.InterconnectLocationsClient.get", "method": { - "fullName": "google.cloud.compute.v1.Interconnects.Patch", + "fullName": "google.cloud.compute.v1.InterconnectLocations.Get", "service": { - "fullName": "google.cloud.compute.v1.Interconnects", - "shortName": "Interconnects" + "fullName": "google.cloud.compute.v1.InterconnectLocations", + "shortName": "InterconnectLocations" }, - "shortName": "Patch" + "shortName": "Get" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.PatchInterconnectRequest" + "type": "google.cloud.compute_v1.types.GetInterconnectLocationRequest" }, { "name": "project", "type": "str" }, { - "name": "interconnect", + "name": "interconnect_location", "type": "str" }, - { - "name": "interconnect_resource", - "type": "google.cloud.compute_v1.types.Interconnect" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -22393,14 +22353,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "patch" + "resultType": "google.cloud.compute_v1.types.InterconnectLocation", + "shortName": "get" }, - "description": "Sample for Patch", - "file": "compute_v1_generated_interconnects_patch_sync.py", + "description": "Sample for Get", + "file": "compute_v1_generated_interconnect_locations_get_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_Interconnects_Patch_sync", + "regionTag": "compute_v1_generated_InterconnectLocations_Get_sync", "segments": [ { "end": 52, @@ -22433,41 +22393,33 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_interconnects_patch_sync.py" + "title": "compute_v1_generated_interconnect_locations_get_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.InterconnectsClient", - "shortName": "InterconnectsClient" + "fullName": "google.cloud.compute_v1.InterconnectLocationsClient", + "shortName": "InterconnectLocationsClient" }, - "fullName": "google.cloud.compute_v1.InterconnectsClient.set_labels", + "fullName": "google.cloud.compute_v1.InterconnectLocationsClient.list", "method": { - "fullName": "google.cloud.compute.v1.Interconnects.SetLabels", + "fullName": "google.cloud.compute.v1.InterconnectLocations.List", "service": { - "fullName": "google.cloud.compute.v1.Interconnects", - "shortName": "Interconnects" + "fullName": "google.cloud.compute.v1.InterconnectLocations", + "shortName": "InterconnectLocations" }, - "shortName": "SetLabels" + "shortName": "List" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.SetLabelsInterconnectRequest" + "type": "google.cloud.compute_v1.types.ListInterconnectLocationsRequest" }, { "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" @@ -22481,14 +22433,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "set_labels" + "resultType": "google.cloud.compute_v1.services.interconnect_locations.pagers.ListPager", + "shortName": "list" }, - "description": "Sample for SetLabels", - "file": "compute_v1_generated_interconnects_set_labels_sync.py", + "description": "Sample for List", + "file": "compute_v1_generated_interconnect_locations_list_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_Interconnects_SetLabels_sync", + "regionTag": "compute_v1_generated_InterconnectLocations_List_sync", "segments": [ { "end": 52, @@ -22506,50 +22458,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_interconnects_set_labels_sync.py" + "title": "compute_v1_generated_interconnect_locations_list_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.LicenseCodesClient", - "shortName": "LicenseCodesClient" + "fullName": "google.cloud.compute_v1.InterconnectRemoteLocationsClient", + "shortName": "InterconnectRemoteLocationsClient" }, - "fullName": "google.cloud.compute_v1.LicenseCodesClient.get", + "fullName": "google.cloud.compute_v1.InterconnectRemoteLocationsClient.get", "method": { - "fullName": "google.cloud.compute.v1.LicenseCodes.Get", + "fullName": "google.cloud.compute.v1.InterconnectRemoteLocations.Get", "service": { - "fullName": "google.cloud.compute.v1.LicenseCodes", - "shortName": "LicenseCodes" + "fullName": "google.cloud.compute.v1.InterconnectRemoteLocations", + "shortName": "InterconnectRemoteLocations" }, "shortName": "Get" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetLicenseCodeRequest" + "type": "google.cloud.compute_v1.types.GetInterconnectRemoteLocationRequest" }, { "name": "project", "type": "str" }, { - "name": "license_code", + "name": "interconnect_remote_location", "type": "str" }, { @@ -22565,14 +22517,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.cloud.compute_v1.types.LicenseCode", + "resultType": "google.cloud.compute_v1.types.InterconnectRemoteLocation", "shortName": "get" }, "description": "Sample for Get", - "file": "compute_v1_generated_license_codes_get_sync.py", + "file": "compute_v1_generated_interconnect_remote_locations_get_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_LicenseCodes_Get_sync", + "regionTag": "compute_v1_generated_InterconnectRemoteLocations_Get_sync", "segments": [ { "end": 52, @@ -22605,40 +22557,116 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_license_codes_get_sync.py" + "title": "compute_v1_generated_interconnect_remote_locations_get_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.LicenseCodesClient", - "shortName": "LicenseCodesClient" + "fullName": "google.cloud.compute_v1.InterconnectRemoteLocationsClient", + "shortName": "InterconnectRemoteLocationsClient" }, - "fullName": "google.cloud.compute_v1.LicenseCodesClient.test_iam_permissions", + "fullName": "google.cloud.compute_v1.InterconnectRemoteLocationsClient.list", "method": { - "fullName": "google.cloud.compute.v1.LicenseCodes.TestIamPermissions", + "fullName": "google.cloud.compute.v1.InterconnectRemoteLocations.List", "service": { - "fullName": "google.cloud.compute.v1.LicenseCodes", - "shortName": "LicenseCodes" + "fullName": "google.cloud.compute.v1.InterconnectRemoteLocations", + "shortName": "InterconnectRemoteLocations" }, - "shortName": "TestIamPermissions" + "shortName": "List" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.TestIamPermissionsLicenseCodeRequest" + "type": "google.cloud.compute_v1.types.ListInterconnectRemoteLocationsRequest" }, { "name": "project", "type": "str" }, { - "name": "resource", + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.compute_v1.services.interconnect_remote_locations.pagers.ListPager", + "shortName": "list" + }, + "description": "Sample for List", + "file": "compute_v1_generated_interconnect_remote_locations_list_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "compute_v1_generated_InterconnectRemoteLocations_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_interconnect_remote_locations_list_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.compute_v1.InterconnectsClient", + "shortName": "InterconnectsClient" + }, + "fullName": "google.cloud.compute_v1.InterconnectsClient.delete", + "method": { + "fullName": "google.cloud.compute.v1.Interconnects.Delete", + "service": { + "fullName": "google.cloud.compute.v1.Interconnects", + "shortName": "Interconnects" + }, + "shortName": "Delete" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.compute_v1.types.DeleteInterconnectRequest" + }, + { + "name": "project", "type": "str" }, { - "name": "test_permissions_request_resource", - "type": "google.cloud.compute_v1.types.TestPermissionsRequest" + "name": "interconnect", + "type": "str" }, { "name": "retry", @@ -22653,14 +22681,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "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_license_codes_test_iam_permissions_sync.py", + "description": "Sample for Delete", + "file": "compute_v1_generated_interconnects_delete_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_LicenseCodes_TestIamPermissions_sync", + "regionTag": "compute_v1_generated_Interconnects_Delete_sync", "segments": [ { "end": 52, @@ -22693,35 +22721,35 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_license_codes_test_iam_permissions_sync.py" + "title": "compute_v1_generated_interconnects_delete_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.LicensesClient", - "shortName": "LicensesClient" + "fullName": "google.cloud.compute_v1.InterconnectsClient", + "shortName": "InterconnectsClient" }, - "fullName": "google.cloud.compute_v1.LicensesClient.delete", + "fullName": "google.cloud.compute_v1.InterconnectsClient.get_diagnostics", "method": { - "fullName": "google.cloud.compute.v1.Licenses.Delete", + "fullName": "google.cloud.compute.v1.Interconnects.GetDiagnostics", "service": { - "fullName": "google.cloud.compute.v1.Licenses", - "shortName": "Licenses" + "fullName": "google.cloud.compute.v1.Interconnects", + "shortName": "Interconnects" }, - "shortName": "Delete" + "shortName": "GetDiagnostics" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.DeleteLicenseRequest" + "type": "google.cloud.compute_v1.types.GetDiagnosticsInterconnectRequest" }, { "name": "project", "type": "str" }, { - "name": "license_", + "name": "interconnect", "type": "str" }, { @@ -22737,14 +22765,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "delete" + "resultType": "google.cloud.compute_v1.types.InterconnectsGetDiagnosticsResponse", + "shortName": "get_diagnostics" }, - "description": "Sample for Delete", - "file": "compute_v1_generated_licenses_delete_sync.py", + "description": "Sample for GetDiagnostics", + "file": "compute_v1_generated_interconnects_get_diagnostics_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_Licenses_Delete_sync", + "regionTag": "compute_v1_generated_Interconnects_GetDiagnostics_sync", "segments": [ { "end": 52, @@ -22777,35 +22805,35 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_licenses_delete_sync.py" + "title": "compute_v1_generated_interconnects_get_diagnostics_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.LicensesClient", - "shortName": "LicensesClient" + "fullName": "google.cloud.compute_v1.InterconnectsClient", + "shortName": "InterconnectsClient" }, - "fullName": "google.cloud.compute_v1.LicensesClient.get_iam_policy", + "fullName": "google.cloud.compute_v1.InterconnectsClient.get_macsec_config", "method": { - "fullName": "google.cloud.compute.v1.Licenses.GetIamPolicy", + "fullName": "google.cloud.compute.v1.Interconnects.GetMacsecConfig", "service": { - "fullName": "google.cloud.compute.v1.Licenses", - "shortName": "Licenses" + "fullName": "google.cloud.compute.v1.Interconnects", + "shortName": "Interconnects" }, - "shortName": "GetIamPolicy" + "shortName": "GetMacsecConfig" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetIamPolicyLicenseRequest" + "type": "google.cloud.compute_v1.types.GetMacsecConfigInterconnectRequest" }, { "name": "project", "type": "str" }, { - "name": "resource", + "name": "interconnect", "type": "str" }, { @@ -22821,14 +22849,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.cloud.compute_v1.types.Policy", - "shortName": "get_iam_policy" + "resultType": "google.cloud.compute_v1.types.InterconnectsGetMacsecConfigResponse", + "shortName": "get_macsec_config" }, - "description": "Sample for GetIamPolicy", - "file": "compute_v1_generated_licenses_get_iam_policy_sync.py", + "description": "Sample for GetMacsecConfig", + "file": "compute_v1_generated_interconnects_get_macsec_config_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_Licenses_GetIamPolicy_sync", + "regionTag": "compute_v1_generated_Interconnects_GetMacsecConfig_sync", "segments": [ { "end": 52, @@ -22861,35 +22889,35 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_licenses_get_iam_policy_sync.py" + "title": "compute_v1_generated_interconnects_get_macsec_config_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.LicensesClient", - "shortName": "LicensesClient" + "fullName": "google.cloud.compute_v1.InterconnectsClient", + "shortName": "InterconnectsClient" }, - "fullName": "google.cloud.compute_v1.LicensesClient.get", + "fullName": "google.cloud.compute_v1.InterconnectsClient.get", "method": { - "fullName": "google.cloud.compute.v1.Licenses.Get", + "fullName": "google.cloud.compute.v1.Interconnects.Get", "service": { - "fullName": "google.cloud.compute.v1.Licenses", - "shortName": "Licenses" + "fullName": "google.cloud.compute.v1.Interconnects", + "shortName": "Interconnects" }, "shortName": "Get" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetLicenseRequest" + "type": "google.cloud.compute_v1.types.GetInterconnectRequest" }, { "name": "project", "type": "str" }, { - "name": "license_", + "name": "interconnect", "type": "str" }, { @@ -22905,14 +22933,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.cloud.compute_v1.types.License", + "resultType": "google.cloud.compute_v1.types.Interconnect", "shortName": "get" }, "description": "Sample for Get", - "file": "compute_v1_generated_licenses_get_sync.py", + "file": "compute_v1_generated_interconnects_get_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_Licenses_Get_sync", + "regionTag": "compute_v1_generated_Interconnects_Get_sync", "segments": [ { "end": 52, @@ -22945,36 +22973,36 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_licenses_get_sync.py" + "title": "compute_v1_generated_interconnects_get_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.LicensesClient", - "shortName": "LicensesClient" + "fullName": "google.cloud.compute_v1.InterconnectsClient", + "shortName": "InterconnectsClient" }, - "fullName": "google.cloud.compute_v1.LicensesClient.insert", + "fullName": "google.cloud.compute_v1.InterconnectsClient.insert", "method": { - "fullName": "google.cloud.compute.v1.Licenses.Insert", + "fullName": "google.cloud.compute.v1.Interconnects.Insert", "service": { - "fullName": "google.cloud.compute.v1.Licenses", - "shortName": "Licenses" + "fullName": "google.cloud.compute.v1.Interconnects", + "shortName": "Interconnects" }, "shortName": "Insert" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.InsertLicenseRequest" + "type": "google.cloud.compute_v1.types.InsertInterconnectRequest" }, { "name": "project", "type": "str" }, { - "name": "license_resource", - "type": "google.cloud.compute_v1.types.License" + "name": "interconnect_resource", + "type": "google.cloud.compute_v1.types.Interconnect" }, { "name": "retry", @@ -22993,10 +23021,10 @@ "shortName": "insert" }, "description": "Sample for Insert", - "file": "compute_v1_generated_licenses_insert_sync.py", + "file": "compute_v1_generated_interconnects_insert_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_Licenses_Insert_sync", + "regionTag": "compute_v1_generated_Interconnects_Insert_sync", "segments": [ { "end": 51, @@ -23029,28 +23057,28 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_licenses_insert_sync.py" + "title": "compute_v1_generated_interconnects_insert_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.LicensesClient", - "shortName": "LicensesClient" + "fullName": "google.cloud.compute_v1.InterconnectsClient", + "shortName": "InterconnectsClient" }, - "fullName": "google.cloud.compute_v1.LicensesClient.list", + "fullName": "google.cloud.compute_v1.InterconnectsClient.list", "method": { - "fullName": "google.cloud.compute.v1.Licenses.List", + "fullName": "google.cloud.compute.v1.Interconnects.List", "service": { - "fullName": "google.cloud.compute.v1.Licenses", - "shortName": "Licenses" + "fullName": "google.cloud.compute.v1.Interconnects", + "shortName": "Interconnects" }, "shortName": "List" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.ListLicensesRequest" + "type": "google.cloud.compute_v1.types.ListInterconnectsRequest" }, { "name": "project", @@ -23069,14 +23097,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.cloud.compute_v1.services.licenses.pagers.ListPager", + "resultType": "google.cloud.compute_v1.services.interconnects.pagers.ListPager", "shortName": "list" }, "description": "Sample for List", - "file": "compute_v1_generated_licenses_list_sync.py", + "file": "compute_v1_generated_interconnects_list_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_Licenses_List_sync", + "regionTag": "compute_v1_generated_Interconnects_List_sync", "segments": [ { "end": 52, @@ -23109,40 +23137,40 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_licenses_list_sync.py" + "title": "compute_v1_generated_interconnects_list_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.LicensesClient", - "shortName": "LicensesClient" + "fullName": "google.cloud.compute_v1.InterconnectsClient", + "shortName": "InterconnectsClient" }, - "fullName": "google.cloud.compute_v1.LicensesClient.set_iam_policy", + "fullName": "google.cloud.compute_v1.InterconnectsClient.patch", "method": { - "fullName": "google.cloud.compute.v1.Licenses.SetIamPolicy", + "fullName": "google.cloud.compute.v1.Interconnects.Patch", "service": { - "fullName": "google.cloud.compute.v1.Licenses", - "shortName": "Licenses" + "fullName": "google.cloud.compute.v1.Interconnects", + "shortName": "Interconnects" }, - "shortName": "SetIamPolicy" + "shortName": "Patch" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.SetIamPolicyLicenseRequest" + "type": "google.cloud.compute_v1.types.PatchInterconnectRequest" }, { "name": "project", "type": "str" }, { - "name": "resource", + "name": "interconnect", "type": "str" }, { - "name": "global_set_policy_request_resource", - "type": "google.cloud.compute_v1.types.GlobalSetPolicyRequest" + "name": "interconnect_resource", + "type": "google.cloud.compute_v1.types.Interconnect" }, { "name": "retry", @@ -23157,14 +23185,778 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.cloud.compute_v1.types.Policy", - "shortName": "set_iam_policy" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "patch" }, - "description": "Sample for SetIamPolicy", - "file": "compute_v1_generated_licenses_set_iam_policy_sync.py", + "description": "Sample for Patch", + "file": "compute_v1_generated_interconnects_patch_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_Licenses_SetIamPolicy_sync", + "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, str]" + } + ], + "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, str]" + } + ], + "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, str]" + } + ], + "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, str]" + } + ], + "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, str]" + } + ], + "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, str]" + } + ], + "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, str]" + } + ], + "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, str]" + } + ], + "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, str]" + } + ], + "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, @@ -23369,7 +24161,427 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_machine_images_delete_sync.py" + "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, str]" + } + ], + "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, str]" + } + ], + "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, str]" + } + ], + "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, str]" + } + ], + "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, str]" + } + ], + "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, @@ -23378,19 +24590,19 @@ "fullName": "google.cloud.compute_v1.MachineImagesClient", "shortName": "MachineImagesClient" }, - "fullName": "google.cloud.compute_v1.MachineImagesClient.get_iam_policy", + "fullName": "google.cloud.compute_v1.MachineImagesClient.test_iam_permissions", "method": { - "fullName": "google.cloud.compute.v1.MachineImages.GetIamPolicy", + "fullName": "google.cloud.compute.v1.MachineImages.TestIamPermissions", "service": { "fullName": "google.cloud.compute.v1.MachineImages", "shortName": "MachineImages" }, - "shortName": "GetIamPolicy" + "shortName": "TestIamPermissions" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetIamPolicyMachineImageRequest" + "type": "google.cloud.compute_v1.types.TestIamPermissionsMachineImageRequest" }, { "name": "project", @@ -23400,6 +24612,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" @@ -23413,14 +24629,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "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_machine_images_get_iam_policy_sync.py", + "description": "Sample for TestIamPermissions", + "file": "compute_v1_generated_machine_images_test_iam_permissions_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_MachineImages_GetIamPolicy_sync", + "regionTag": "compute_v1_generated_MachineImages_TestIamPermissions_sync", "segments": [ { "end": 52, @@ -23453,37 +24669,33 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_machine_images_get_iam_policy_sync.py" + "title": "compute_v1_generated_machine_images_test_iam_permissions_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.MachineImagesClient", - "shortName": "MachineImagesClient" + "fullName": "google.cloud.compute_v1.MachineTypesClient", + "shortName": "MachineTypesClient" }, - "fullName": "google.cloud.compute_v1.MachineImagesClient.get", + "fullName": "google.cloud.compute_v1.MachineTypesClient.aggregated_list", "method": { - "fullName": "google.cloud.compute.v1.MachineImages.Get", + "fullName": "google.cloud.compute.v1.MachineTypes.AggregatedList", "service": { - "fullName": "google.cloud.compute.v1.MachineImages", - "shortName": "MachineImages" + "fullName": "google.cloud.compute.v1.MachineTypes", + "shortName": "MachineTypes" }, - "shortName": "Get" + "shortName": "AggregatedList" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetMachineImageRequest" + "type": "google.cloud.compute_v1.types.AggregatedListMachineTypesRequest" }, { "name": "project", "type": "str" }, - { - "name": "machine_image", - "type": "str" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -23497,14 +24709,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.cloud.compute_v1.types.MachineImage", - "shortName": "get" + "resultType": "google.cloud.compute_v1.services.machine_types.pagers.AggregatedListPager", + "shortName": "aggregated_list" }, - "description": "Sample for Get", - "file": "compute_v1_generated_machine_images_get_sync.py", + "description": "Sample for AggregatedList", + "file": "compute_v1_generated_machine_types_aggregated_list_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_MachineImages_Get_sync", + "regionTag": "compute_v1_generated_MachineTypes_AggregatedList_sync", "segments": [ { "end": 52, @@ -23522,51 +24734,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_machine_images_get_sync.py" + "title": "compute_v1_generated_machine_types_aggregated_list_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.MachineImagesClient", - "shortName": "MachineImagesClient" + "fullName": "google.cloud.compute_v1.MachineTypesClient", + "shortName": "MachineTypesClient" }, - "fullName": "google.cloud.compute_v1.MachineImagesClient.insert", + "fullName": "google.cloud.compute_v1.MachineTypesClient.get", "method": { - "fullName": "google.cloud.compute.v1.MachineImages.Insert", + "fullName": "google.cloud.compute.v1.MachineTypes.Get", "service": { - "fullName": "google.cloud.compute.v1.MachineImages", - "shortName": "MachineImages" + "fullName": "google.cloud.compute.v1.MachineTypes", + "shortName": "MachineTypes" }, - "shortName": "Insert" + "shortName": "Get" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.InsertMachineImageRequest" + "type": "google.cloud.compute_v1.types.GetMachineTypeRequest" }, { "name": "project", "type": "str" }, { - "name": "machine_image_resource", - "type": "google.cloud.compute_v1.types.MachineImage" + "name": "zone", + "type": "str" + }, + { + "name": "machine_type", + "type": "str" }, { "name": "retry", @@ -23581,22 +24797,22 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "insert" + "resultType": "google.cloud.compute_v1.types.MachineType", + "shortName": "get" }, - "description": "Sample for Insert", - "file": "compute_v1_generated_machine_images_insert_sync.py", + "description": "Sample for Get", + "file": "compute_v1_generated_machine_types_get_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_MachineImages_Insert_sync", + "regionTag": "compute_v1_generated_MachineTypes_Get_sync", "segments": [ { - "end": 51, + "end": 53, "start": 27, "type": "FULL" }, { - "end": 51, + "end": 53, "start": 27, "type": "SHORT" }, @@ -23606,48 +24822,52 @@ "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_machine_images_insert_sync.py" + "title": "compute_v1_generated_machine_types_get_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.MachineImagesClient", - "shortName": "MachineImagesClient" + "fullName": "google.cloud.compute_v1.MachineTypesClient", + "shortName": "MachineTypesClient" }, - "fullName": "google.cloud.compute_v1.MachineImagesClient.list", + "fullName": "google.cloud.compute_v1.MachineTypesClient.list", "method": { - "fullName": "google.cloud.compute.v1.MachineImages.List", + "fullName": "google.cloud.compute.v1.MachineTypes.List", "service": { - "fullName": "google.cloud.compute.v1.MachineImages", - "shortName": "MachineImages" + "fullName": "google.cloud.compute.v1.MachineTypes", + "shortName": "MachineTypes" }, "shortName": "List" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.ListMachineImagesRequest" + "type": "google.cloud.compute_v1.types.ListMachineTypesRequest" }, { "name": "project", "type": "str" }, + { + "name": "zone", + "type": "str" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -23661,22 +24881,22 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.cloud.compute_v1.services.machine_images.pagers.ListPager", + "resultType": "google.cloud.compute_v1.services.machine_types.pagers.ListPager", "shortName": "list" }, "description": "Sample for List", - "file": "compute_v1_generated_machine_images_list_sync.py", + "file": "compute_v1_generated_machine_types_list_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_MachineImages_List_sync", + "regionTag": "compute_v1_generated_MachineTypes_List_sync", "segments": [ { - "end": 52, + "end": 53, "start": 27, "type": "FULL" }, { - "end": 52, + "end": 53, "start": 27, "type": "SHORT" }, @@ -23686,56 +24906,48 @@ "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_machine_images_list_sync.py" + "title": "compute_v1_generated_machine_types_list_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.MachineImagesClient", - "shortName": "MachineImagesClient" + "fullName": "google.cloud.compute_v1.NetworkAttachmentsClient", + "shortName": "NetworkAttachmentsClient" }, - "fullName": "google.cloud.compute_v1.MachineImagesClient.set_iam_policy", + "fullName": "google.cloud.compute_v1.NetworkAttachmentsClient.aggregated_list", "method": { - "fullName": "google.cloud.compute.v1.MachineImages.SetIamPolicy", + "fullName": "google.cloud.compute.v1.NetworkAttachments.AggregatedList", "service": { - "fullName": "google.cloud.compute.v1.MachineImages", - "shortName": "MachineImages" + "fullName": "google.cloud.compute.v1.NetworkAttachments", + "shortName": "NetworkAttachments" }, - "shortName": "SetIamPolicy" + "shortName": "AggregatedList" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.SetIamPolicyMachineImageRequest" + "type": "google.cloud.compute_v1.types.AggregatedListNetworkAttachmentsRequest" }, { "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" @@ -23749,14 +24961,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.cloud.compute_v1.types.Policy", - "shortName": "set_iam_policy" + "resultType": "google.cloud.compute_v1.services.network_attachments.pagers.AggregatedListPager", + "shortName": "aggregated_list" }, - "description": "Sample for SetIamPolicy", - "file": "compute_v1_generated_machine_images_set_iam_policy_sync.py", + "description": "Sample for AggregatedList", + "file": "compute_v1_generated_network_attachments_aggregated_list_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_MachineImages_SetIamPolicy_sync", + "regionTag": "compute_v1_generated_NetworkAttachments_AggregatedList_sync", "segments": [ { "end": 52, @@ -23774,55 +24986,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_machine_images_set_iam_policy_sync.py" + "title": "compute_v1_generated_network_attachments_aggregated_list_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.MachineImagesClient", - "shortName": "MachineImagesClient" + "fullName": "google.cloud.compute_v1.NetworkAttachmentsClient", + "shortName": "NetworkAttachmentsClient" }, - "fullName": "google.cloud.compute_v1.MachineImagesClient.test_iam_permissions", + "fullName": "google.cloud.compute_v1.NetworkAttachmentsClient.delete", "method": { - "fullName": "google.cloud.compute.v1.MachineImages.TestIamPermissions", + "fullName": "google.cloud.compute.v1.NetworkAttachments.Delete", "service": { - "fullName": "google.cloud.compute.v1.MachineImages", - "shortName": "MachineImages" + "fullName": "google.cloud.compute.v1.NetworkAttachments", + "shortName": "NetworkAttachments" }, - "shortName": "TestIamPermissions" + "shortName": "Delete" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.TestIamPermissionsMachineImageRequest" + "type": "google.cloud.compute_v1.types.DeleteNetworkAttachmentRequest" }, { "name": "project", "type": "str" }, { - "name": "resource", + "name": "region", "type": "str" }, { - "name": "test_permissions_request_resource", - "type": "google.cloud.compute_v1.types.TestPermissionsRequest" + "name": "network_attachment", + "type": "str" }, { "name": "retry", @@ -23837,22 +25049,22 @@ "type": "Sequence[Tuple[str, str]" } ], - "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_machine_images_test_iam_permissions_sync.py", + "description": "Sample for Delete", + "file": "compute_v1_generated_network_attachments_delete_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_MachineImages_TestIamPermissions_sync", + "regionTag": "compute_v1_generated_NetworkAttachments_Delete_sync", "segments": [ { - "end": 52, + "end": 53, "start": 27, "type": "FULL" }, { - "end": 52, + "end": 53, "start": 27, "type": "SHORT" }, @@ -23862,48 +25074,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_machine_images_test_iam_permissions_sync.py" + "title": "compute_v1_generated_network_attachments_delete_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.MachineTypesClient", - "shortName": "MachineTypesClient" + "fullName": "google.cloud.compute_v1.NetworkAttachmentsClient", + "shortName": "NetworkAttachmentsClient" }, - "fullName": "google.cloud.compute_v1.MachineTypesClient.aggregated_list", + "fullName": "google.cloud.compute_v1.NetworkAttachmentsClient.get_iam_policy", "method": { - "fullName": "google.cloud.compute.v1.MachineTypes.AggregatedList", + "fullName": "google.cloud.compute.v1.NetworkAttachments.GetIamPolicy", "service": { - "fullName": "google.cloud.compute.v1.MachineTypes", - "shortName": "MachineTypes" + "fullName": "google.cloud.compute.v1.NetworkAttachments", + "shortName": "NetworkAttachments" }, - "shortName": "AggregatedList" + "shortName": "GetIamPolicy" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.AggregatedListMachineTypesRequest" + "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" @@ -23917,22 +25137,22 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.cloud.compute_v1.services.machine_types.pagers.AggregatedListPager", - "shortName": "aggregated_list" + "resultType": "google.cloud.compute_v1.types.Policy", + "shortName": "get_iam_policy" }, - "description": "Sample for AggregatedList", - "file": "compute_v1_generated_machine_types_aggregated_list_sync.py", + "description": "Sample for GetIamPolicy", + "file": "compute_v1_generated_network_attachments_get_iam_policy_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_MachineTypes_AggregatedList_sync", + "regionTag": "compute_v1_generated_NetworkAttachments_GetIamPolicy_sync", "segments": [ { - "end": 52, + "end": 53, "start": 27, "type": "FULL" }, { - "end": 52, + "end": 53, "start": 27, "type": "SHORT" }, @@ -23942,54 +25162,54 @@ "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_machine_types_aggregated_list_sync.py" + "title": "compute_v1_generated_network_attachments_get_iam_policy_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.MachineTypesClient", - "shortName": "MachineTypesClient" + "fullName": "google.cloud.compute_v1.NetworkAttachmentsClient", + "shortName": "NetworkAttachmentsClient" }, - "fullName": "google.cloud.compute_v1.MachineTypesClient.get", + "fullName": "google.cloud.compute_v1.NetworkAttachmentsClient.get", "method": { - "fullName": "google.cloud.compute.v1.MachineTypes.Get", + "fullName": "google.cloud.compute.v1.NetworkAttachments.Get", "service": { - "fullName": "google.cloud.compute.v1.MachineTypes", - "shortName": "MachineTypes" + "fullName": "google.cloud.compute.v1.NetworkAttachments", + "shortName": "NetworkAttachments" }, "shortName": "Get" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetMachineTypeRequest" + "type": "google.cloud.compute_v1.types.GetNetworkAttachmentRequest" }, { "name": "project", "type": "str" }, { - "name": "zone", + "name": "region", "type": "str" }, { - "name": "machine_type", + "name": "network_attachment", "type": "str" }, { @@ -24005,14 +25225,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.cloud.compute_v1.types.MachineType", + "resultType": "google.cloud.compute_v1.types.NetworkAttachment", "shortName": "get" }, "description": "Sample for Get", - "file": "compute_v1_generated_machine_types_get_sync.py", + "file": "compute_v1_generated_network_attachments_get_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_MachineTypes_Get_sync", + "regionTag": "compute_v1_generated_NetworkAttachments_Get_sync", "segments": [ { "end": 53, @@ -24045,37 +25265,41 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_machine_types_get_sync.py" + "title": "compute_v1_generated_network_attachments_get_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.MachineTypesClient", - "shortName": "MachineTypesClient" + "fullName": "google.cloud.compute_v1.NetworkAttachmentsClient", + "shortName": "NetworkAttachmentsClient" }, - "fullName": "google.cloud.compute_v1.MachineTypesClient.list", + "fullName": "google.cloud.compute_v1.NetworkAttachmentsClient.insert", "method": { - "fullName": "google.cloud.compute.v1.MachineTypes.List", + "fullName": "google.cloud.compute.v1.NetworkAttachments.Insert", "service": { - "fullName": "google.cloud.compute.v1.MachineTypes", - "shortName": "MachineTypes" + "fullName": "google.cloud.compute.v1.NetworkAttachments", + "shortName": "NetworkAttachments" }, - "shortName": "List" + "shortName": "Insert" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.ListMachineTypesRequest" + "type": "google.cloud.compute_v1.types.InsertNetworkAttachmentRequest" }, { "name": "project", "type": "str" }, { - "name": "zone", + "name": "region", "type": "str" }, + { + "name": "network_attachment_resource", + "type": "google.cloud.compute_v1.types.NetworkAttachment" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -24089,22 +25313,22 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.cloud.compute_v1.services.machine_types.pagers.ListPager", - "shortName": "list" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "insert" }, - "description": "Sample for List", - "file": "compute_v1_generated_machine_types_list_sync.py", + "description": "Sample for Insert", + "file": "compute_v1_generated_network_attachments_insert_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_MachineTypes_List_sync", + "regionTag": "compute_v1_generated_NetworkAttachments_Insert_sync", "segments": [ { - "end": 53, + "end": 52, "start": 27, "type": "FULL" }, { - "end": 53, + "end": 52, "start": 27, "type": "SHORT" }, @@ -24124,12 +25348,12 @@ "type": "REQUEST_EXECUTION" }, { - "end": 54, + "end": 53, "start": 50, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_machine_types_list_sync.py" + "title": "compute_v1_generated_network_attachments_insert_sync.py" }, { "canonical": true, @@ -24138,24 +25362,28 @@ "fullName": "google.cloud.compute_v1.NetworkAttachmentsClient", "shortName": "NetworkAttachmentsClient" }, - "fullName": "google.cloud.compute_v1.NetworkAttachmentsClient.aggregated_list", + "fullName": "google.cloud.compute_v1.NetworkAttachmentsClient.list", "method": { - "fullName": "google.cloud.compute.v1.NetworkAttachments.AggregatedList", + "fullName": "google.cloud.compute.v1.NetworkAttachments.List", "service": { "fullName": "google.cloud.compute.v1.NetworkAttachments", "shortName": "NetworkAttachments" }, - "shortName": "AggregatedList" + "shortName": "List" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.AggregatedListNetworkAttachmentsRequest" + "type": "google.cloud.compute_v1.types.ListNetworkAttachmentsRequest" }, { "name": "project", "type": "str" }, + { + "name": "region", + "type": "str" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -24169,22 +25397,22 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.cloud.compute_v1.services.network_attachments.pagers.AggregatedListPager", - "shortName": "aggregated_list" + "resultType": "google.cloud.compute_v1.services.network_attachments.pagers.ListPager", + "shortName": "list" }, - "description": "Sample for AggregatedList", - "file": "compute_v1_generated_network_attachments_aggregated_list_sync.py", + "description": "Sample for List", + "file": "compute_v1_generated_network_attachments_list_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_NetworkAttachments_AggregatedList_sync", + "regionTag": "compute_v1_generated_NetworkAttachments_List_sync", "segments": [ { - "end": 52, + "end": 53, "start": 27, "type": "FULL" }, { - "end": 52, + "end": 53, "start": 27, "type": "SHORT" }, @@ -24194,22 +25422,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_network_attachments_aggregated_list_sync.py" + "title": "compute_v1_generated_network_attachments_list_sync.py" }, { "canonical": true, @@ -24218,19 +25446,19 @@ "fullName": "google.cloud.compute_v1.NetworkAttachmentsClient", "shortName": "NetworkAttachmentsClient" }, - "fullName": "google.cloud.compute_v1.NetworkAttachmentsClient.delete", + "fullName": "google.cloud.compute_v1.NetworkAttachmentsClient.patch", "method": { - "fullName": "google.cloud.compute.v1.NetworkAttachments.Delete", + "fullName": "google.cloud.compute.v1.NetworkAttachments.Patch", "service": { "fullName": "google.cloud.compute.v1.NetworkAttachments", "shortName": "NetworkAttachments" }, - "shortName": "Delete" + "shortName": "Patch" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.DeleteNetworkAttachmentRequest" + "type": "google.cloud.compute_v1.types.PatchNetworkAttachmentRequest" }, { "name": "project", @@ -24244,6 +25472,10 @@ "name": "network_attachment", "type": "str" }, + { + "name": "network_attachment_resource", + "type": "google.cloud.compute_v1.types.NetworkAttachment" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -24258,13 +25490,13 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "delete" + "shortName": "patch" }, - "description": "Sample for Delete", - "file": "compute_v1_generated_network_attachments_delete_sync.py", + "description": "Sample for Patch", + "file": "compute_v1_generated_network_attachments_patch_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_NetworkAttachments_Delete_sync", + "regionTag": "compute_v1_generated_NetworkAttachments_Patch_sync", "segments": [ { "end": 53, @@ -24297,7 +25529,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_network_attachments_delete_sync.py" + "title": "compute_v1_generated_network_attachments_patch_sync.py" }, { "canonical": true, @@ -24306,19 +25538,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", @@ -24332,6 +25564,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" @@ -24346,13 +25582,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, @@ -24385,7 +25621,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, @@ -24394,19 +25630,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", @@ -24417,9 +25653,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" @@ -24433,14 +25673,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "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, @@ -24473,41 +25713,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" @@ -24521,14 +25753,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "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, @@ -24546,43 +25778,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", @@ -24592,6 +25824,10 @@ "name": "region", "type": "str" }, + { + "name": "network_edge_security_service", + "type": "str" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -24605,14 +25841,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "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, @@ -24630,43 +25866,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", @@ -24677,13 +25913,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" @@ -24697,14 +25929,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "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, @@ -24737,28 +25969,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", @@ -24769,12 +26001,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", @@ -24789,22 +26017,22 @@ "type": "Sequence[Tuple[str, str]" } ], - "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" }, @@ -24814,43 +26042,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", @@ -24861,12 +26089,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", @@ -24881,14 +26109,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "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, @@ -24921,28 +26149,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", @@ -24961,14 +26189,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "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, @@ -25001,41 +26229,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" @@ -25050,13 +26282,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, @@ -25089,39 +26321,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" }, { @@ -25137,14 +26369,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "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, @@ -25177,132 +26409,44 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_network_edge_security_services_get_sync.py" - }, - { - "canonical": true, - "clientMethod": { - "client": { - "fullName": "google.cloud.compute_v1.NetworkEdgeSecurityServicesClient", - "shortName": "NetworkEdgeSecurityServicesClient" - }, - "fullName": "google.cloud.compute_v1.NetworkEdgeSecurityServicesClient.insert", - "method": { - "fullName": "google.cloud.compute.v1.NetworkEdgeSecurityServices.Insert", - "service": { - "fullName": "google.cloud.compute.v1.NetworkEdgeSecurityServices", - "shortName": "NetworkEdgeSecurityServices" - }, - "shortName": "Insert" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.compute_v1.types.InsertNetworkEdgeSecurityServiceRequest" - }, - { - "name": "project", - "type": "str" - }, - { - "name": "region", - "type": "str" - }, - { - "name": "network_edge_security_service_resource", - "type": "google.cloud.compute_v1.types.NetworkEdgeSecurityService" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, str]" - } - ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "insert" - }, - "description": "Sample for Insert", - "file": "compute_v1_generated_network_edge_security_services_insert_sync.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_NetworkEdgeSecurityServices_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_edge_security_services_insert_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.patch", + "fullName": "google.cloud.compute_v1.NetworkEndpointGroupsClient.detach_network_endpoints", "method": { - "fullName": "google.cloud.compute.v1.NetworkEdgeSecurityServices.Patch", + "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": "Patch" + "shortName": "DetachNetworkEndpoints" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.PatchNetworkEdgeSecurityServiceRequest" + "type": "google.cloud.compute_v1.types.DetachNetworkEndpointsNetworkEndpointGroupRequest" }, { "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": "network_endpoint_groups_detach_endpoints_request_resource", + "type": "google.cloud.compute_v1.types.NetworkEndpointGroupsDetachEndpointsRequest" }, { "name": "retry", @@ -25318,13 +26462,13 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "patch" + "shortName": "detach_network_endpoints" }, - "description": "Sample for Patch", - "file": "compute_v1_generated_network_edge_security_services_patch_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_Patch_sync", + "regionTag": "compute_v1_generated_NetworkEndpointGroups_DetachNetworkEndpoints_sync", "segments": [ { "end": 53, @@ -25357,7 +26501,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_network_edge_security_services_patch_sync.py" + "title": "compute_v1_generated_network_endpoint_groups_detach_network_endpoints_sync.py" }, { "canonical": true, @@ -25366,24 +26510,32 @@ "fullName": "google.cloud.compute_v1.NetworkEndpointGroupsClient", "shortName": "NetworkEndpointGroupsClient" }, - "fullName": "google.cloud.compute_v1.NetworkEndpointGroupsClient.aggregated_list", + "fullName": "google.cloud.compute_v1.NetworkEndpointGroupsClient.get", "method": { - "fullName": "google.cloud.compute.v1.NetworkEndpointGroups.AggregatedList", + "fullName": "google.cloud.compute.v1.NetworkEndpointGroups.Get", "service": { "fullName": "google.cloud.compute.v1.NetworkEndpointGroups", "shortName": "NetworkEndpointGroups" }, - "shortName": "AggregatedList" + "shortName": "Get" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.AggregatedListNetworkEndpointGroupsRequest" + "type": "google.cloud.compute_v1.types.GetNetworkEndpointGroupRequest" }, { "name": "project", "type": "str" }, + { + "name": "zone", + "type": "str" + }, + { + "name": "network_endpoint_group", + "type": "str" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -25397,22 +26549,22 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.cloud.compute_v1.services.network_endpoint_groups.pagers.AggregatedListPager", - "shortName": "aggregated_list" + "resultType": "google.cloud.compute_v1.types.NetworkEndpointGroup", + "shortName": "get" }, - "description": "Sample for AggregatedList", - "file": "compute_v1_generated_network_endpoint_groups_aggregated_list_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_NetworkEndpointGroups_AggregatedList_sync", + "regionTag": "compute_v1_generated_NetworkEndpointGroups_Get_sync", "segments": [ { - "end": 52, + "end": 53, "start": 27, "type": "FULL" }, { - "end": 52, + "end": 53, "start": 27, "type": "SHORT" }, @@ -25422,22 +26574,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_network_endpoint_groups_aggregated_list_sync.py" + "title": "compute_v1_generated_network_endpoint_groups_get_sync.py" }, { "canonical": true, @@ -25446,19 +26598,19 @@ "fullName": "google.cloud.compute_v1.NetworkEndpointGroupsClient", "shortName": "NetworkEndpointGroupsClient" }, - "fullName": "google.cloud.compute_v1.NetworkEndpointGroupsClient.attach_network_endpoints", + "fullName": "google.cloud.compute_v1.NetworkEndpointGroupsClient.insert", "method": { - "fullName": "google.cloud.compute.v1.NetworkEndpointGroups.AttachNetworkEndpoints", + "fullName": "google.cloud.compute.v1.NetworkEndpointGroups.Insert", "service": { "fullName": "google.cloud.compute.v1.NetworkEndpointGroups", "shortName": "NetworkEndpointGroups" }, - "shortName": "AttachNetworkEndpoints" + "shortName": "Insert" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.AttachNetworkEndpointsNetworkEndpointGroupRequest" + "type": "google.cloud.compute_v1.types.InsertNetworkEndpointGroupRequest" }, { "name": "project", @@ -25469,12 +26621,8 @@ "type": "str" }, { - "name": "network_endpoint_group", - "type": "str" - }, - { - "name": "network_endpoint_groups_attach_endpoints_request_resource", - "type": "google.cloud.compute_v1.types.NetworkEndpointGroupsAttachEndpointsRequest" + "name": "network_endpoint_group_resource", + "type": "google.cloud.compute_v1.types.NetworkEndpointGroup" }, { "name": "retry", @@ -25490,21 +26638,21 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "attach_network_endpoints" + "shortName": "insert" }, - "description": "Sample for AttachNetworkEndpoints", - "file": "compute_v1_generated_network_endpoint_groups_attach_network_endpoints_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_AttachNetworkEndpoints_sync", + "regionTag": "compute_v1_generated_NetworkEndpointGroups_Insert_sync", "segments": [ { - "end": 53, + "end": 52, "start": 27, "type": "FULL" }, { - "end": 53, + "end": 52, "start": 27, "type": "SHORT" }, @@ -25514,22 +26662,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_attach_network_endpoints_sync.py" + "title": "compute_v1_generated_network_endpoint_groups_insert_sync.py" }, { "canonical": true, @@ -25538,19 +26686,19 @@ "fullName": "google.cloud.compute_v1.NetworkEndpointGroupsClient", "shortName": "NetworkEndpointGroupsClient" }, - "fullName": "google.cloud.compute_v1.NetworkEndpointGroupsClient.delete", + "fullName": "google.cloud.compute_v1.NetworkEndpointGroupsClient.list_network_endpoints", "method": { - "fullName": "google.cloud.compute.v1.NetworkEndpointGroups.Delete", + "fullName": "google.cloud.compute.v1.NetworkEndpointGroups.ListNetworkEndpoints", "service": { "fullName": "google.cloud.compute.v1.NetworkEndpointGroups", "shortName": "NetworkEndpointGroups" }, - "shortName": "Delete" + "shortName": "ListNetworkEndpoints" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.DeleteNetworkEndpointGroupRequest" + "type": "google.cloud.compute_v1.types.ListNetworkEndpointsNetworkEndpointGroupsRequest" }, { "name": "project", @@ -25564,6 +26712,10 @@ "name": "network_endpoint_group", "type": "str" }, + { + "name": "network_endpoint_groups_list_endpoints_request_resource", + "type": "google.cloud.compute_v1.types.NetworkEndpointGroupsListEndpointsRequest" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -25577,22 +26729,22 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "delete" + "resultType": "google.cloud.compute_v1.services.network_endpoint_groups.pagers.ListNetworkEndpointsPager", + "shortName": "list_network_endpoints" }, - "description": "Sample for Delete", - "file": "compute_v1_generated_network_endpoint_groups_delete_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_Delete_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" }, @@ -25612,12 +26764,12 @@ "type": "REQUEST_EXECUTION" }, { - "end": 54, + "end": 55, "start": 51, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_network_endpoint_groups_delete_sync.py" + "title": "compute_v1_generated_network_endpoint_groups_list_network_endpoints_sync.py" }, { "canonical": true, @@ -25626,19 +26778,19 @@ "fullName": "google.cloud.compute_v1.NetworkEndpointGroupsClient", "shortName": "NetworkEndpointGroupsClient" }, - "fullName": "google.cloud.compute_v1.NetworkEndpointGroupsClient.detach_network_endpoints", + "fullName": "google.cloud.compute_v1.NetworkEndpointGroupsClient.list", "method": { - "fullName": "google.cloud.compute.v1.NetworkEndpointGroups.DetachNetworkEndpoints", + "fullName": "google.cloud.compute.v1.NetworkEndpointGroups.List", "service": { "fullName": "google.cloud.compute.v1.NetworkEndpointGroups", "shortName": "NetworkEndpointGroups" }, - "shortName": "DetachNetworkEndpoints" + "shortName": "List" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.DetachNetworkEndpointsNetworkEndpointGroupRequest" + "type": "google.cloud.compute_v1.types.ListNetworkEndpointGroupsRequest" }, { "name": "project", @@ -25648,14 +26800,6 @@ "name": "zone", "type": "str" }, - { - "name": "network_endpoint_group", - "type": "str" - }, - { - "name": "network_endpoint_groups_detach_endpoints_request_resource", - "type": "google.cloud.compute_v1.types.NetworkEndpointGroupsDetachEndpointsRequest" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -25669,14 +26813,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "detach_network_endpoints" + "resultType": "google.cloud.compute_v1.services.network_endpoint_groups.pagers.ListPager", + "shortName": "list" }, - "description": "Sample for DetachNetworkEndpoints", - "file": "compute_v1_generated_network_endpoint_groups_detach_network_endpoints_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_DetachNetworkEndpoints_sync", + "regionTag": "compute_v1_generated_NetworkEndpointGroups_List_sync", "segments": [ { "end": 53, @@ -25694,22 +26838,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_detach_network_endpoints_sync.py" + "title": "compute_v1_generated_network_endpoint_groups_list_sync.py" }, { "canonical": true, @@ -25718,19 +26862,19 @@ "fullName": "google.cloud.compute_v1.NetworkEndpointGroupsClient", "shortName": "NetworkEndpointGroupsClient" }, - "fullName": "google.cloud.compute_v1.NetworkEndpointGroupsClient.get", + "fullName": "google.cloud.compute_v1.NetworkEndpointGroupsClient.test_iam_permissions", "method": { - "fullName": "google.cloud.compute.v1.NetworkEndpointGroups.Get", + "fullName": "google.cloud.compute.v1.NetworkEndpointGroups.TestIamPermissions", "service": { "fullName": "google.cloud.compute.v1.NetworkEndpointGroups", "shortName": "NetworkEndpointGroups" }, - "shortName": "Get" + "shortName": "TestIamPermissions" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetNetworkEndpointGroupRequest" + "type": "google.cloud.compute_v1.types.TestIamPermissionsNetworkEndpointGroupRequest" }, { "name": "project", @@ -25741,9 +26885,13 @@ "type": "str" }, { - "name": "network_endpoint_group", + "name": "resource", "type": "str" }, + { + "name": "test_permissions_request_resource", + "type": "google.cloud.compute_v1.types.TestPermissionsRequest" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -25757,14 +26905,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.cloud.compute_v1.types.NetworkEndpointGroup", - "shortName": "get" + "resultType": "google.cloud.compute_v1.types.TestPermissionsResponse", + "shortName": "test_iam_permissions" }, - "description": "Sample for Get", - "file": "compute_v1_generated_network_endpoint_groups_get_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_Get_sync", + "regionTag": "compute_v1_generated_NetworkEndpointGroups_TestIamPermissions_sync", "segments": [ { "end": 53, @@ -25797,40 +26945,40 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_network_endpoint_groups_get_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.insert", + "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient.add_association", "method": { - "fullName": "google.cloud.compute.v1.NetworkEndpointGroups.Insert", + "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": "Insert" + "shortName": "AddAssociation" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.InsertNetworkEndpointGroupRequest" + "type": "google.cloud.compute_v1.types.AddAssociationNetworkFirewallPolicyRequest" }, { "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_association_resource", + "type": "google.cloud.compute_v1.types.FirewallPolicyAssociation" }, { "name": "retry", @@ -25846,13 +26994,13 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "insert" + "shortName": "add_association" }, - "description": "Sample for Insert", - "file": "compute_v1_generated_network_endpoint_groups_insert_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_Insert_sync", + "regionTag": "compute_v1_generated_NetworkFirewallPolicies_AddAssociation_sync", "segments": [ { "end": 52, @@ -25885,44 +27033,40 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_network_endpoint_groups_insert_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.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", @@ -25937,22 +27081,22 @@ "type": "Sequence[Tuple[str, str]" } ], - "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" }, @@ -25962,50 +27106,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": 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.clone_rules", "method": { - "fullName": "google.cloud.compute.v1.NetworkEndpointGroups.List", + "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": "List" + "shortName": "CloneRules" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.ListNetworkEndpointGroupsRequest" + "type": "google.cloud.compute_v1.types.CloneRulesNetworkFirewallPolicyRequest" }, { "name": "project", "type": "str" }, { - "name": "zone", + "name": "firewall_policy", "type": "str" }, { @@ -26021,22 +27165,22 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.cloud.compute_v1.services.network_endpoint_groups.pagers.ListPager", - "shortName": "list" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "clone_rules" }, - "description": "Sample for List", - "file": "compute_v1_generated_network_endpoint_groups_list_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_List_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" }, @@ -26056,50 +27200,42 @@ "type": "REQUEST_EXECUTION" }, { - "end": 54, + "end": 53, "start": 50, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_network_endpoint_groups_list_sync.py" + "title": "compute_v1_generated_network_firewall_policies_clone_rules_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.delete", "method": { - "fullName": "google.cloud.compute.v1.NetworkEndpointGroups.TestIamPermissions", + "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies.Delete", "service": { - "fullName": "google.cloud.compute.v1.NetworkEndpointGroups", - "shortName": "NetworkEndpointGroups" + "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies", + "shortName": "NetworkFirewallPolicies" }, - "shortName": "TestIamPermissions" + "shortName": "Delete" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.TestIamPermissionsNetworkEndpointGroupRequest" + "type": "google.cloud.compute_v1.types.DeleteNetworkFirewallPolicyRequest" }, { "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" @@ -26113,22 +27249,22 @@ "type": "Sequence[Tuple[str, str]" } ], - "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_network_endpoint_groups_test_iam_permissions_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_NetworkEndpointGroups_TestIamPermissions_sync", + "regionTag": "compute_v1_generated_NetworkFirewallPolicies_Delete_sync", "segments": [ { - "end": 53, + "end": 52, "start": 27, "type": "FULL" }, { - "end": 53, + "end": 52, "start": 27, "type": "SHORT" }, @@ -26138,22 +27274,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_delete_sync.py" }, { "canonical": true, @@ -26162,19 +27298,19 @@ "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient", "shortName": "NetworkFirewallPoliciesClient" }, - "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient.add_association", + "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient.get_association", "method": { - "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies.AddAssociation", + "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies.GetAssociation", "service": { "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies", "shortName": "NetworkFirewallPolicies" }, - "shortName": "AddAssociation" + "shortName": "GetAssociation" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.AddAssociationNetworkFirewallPolicyRequest" + "type": "google.cloud.compute_v1.types.GetAssociationNetworkFirewallPolicyRequest" }, { "name": "project", @@ -26184,10 +27320,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" @@ -26201,14 +27333,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "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_network_firewall_policies_add_association_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_AddAssociation_sync", + "regionTag": "compute_v1_generated_NetworkFirewallPolicies_GetAssociation_sync", "segments": [ { "end": 52, @@ -26241,7 +27373,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_network_firewall_policies_add_association_sync.py" + "title": "compute_v1_generated_network_firewall_policies_get_association_sync.py" }, { "canonical": true, @@ -26250,32 +27382,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" @@ -26289,14 +27417,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "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, @@ -26329,7 +27457,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_network_firewall_policies_add_rule_sync.py" + "title": "compute_v1_generated_network_firewall_policies_get_iam_policy_sync.py" }, { "canonical": true, @@ -26338,19 +27466,19 @@ "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient", "shortName": "NetworkFirewallPoliciesClient" }, - "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient.clone_rules", + "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient.get_rule", "method": { - "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies.CloneRules", + "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies.GetRule", "service": { "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies", "shortName": "NetworkFirewallPolicies" }, - "shortName": "CloneRules" + "shortName": "GetRule" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.CloneRulesNetworkFirewallPolicyRequest" + "type": "google.cloud.compute_v1.types.GetRuleNetworkFirewallPolicyRequest" }, { "name": "project", @@ -26373,14 +27501,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "clone_rules" + "resultType": "google.cloud.compute_v1.types.FirewallPolicyRule", + "shortName": "get_rule" }, - "description": "Sample for CloneRules", - "file": "compute_v1_generated_network_firewall_policies_clone_rules_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_CloneRules_sync", + "regionTag": "compute_v1_generated_NetworkFirewallPolicies_GetRule_sync", "segments": [ { "end": 52, @@ -26413,7 +27541,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_network_firewall_policies_clone_rules_sync.py" + "title": "compute_v1_generated_network_firewall_policies_get_rule_sync.py" }, { "canonical": true, @@ -26422,19 +27550,19 @@ "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient", "shortName": "NetworkFirewallPoliciesClient" }, - "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient.delete", + "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient.get", "method": { - "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies.Delete", + "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies.Get", "service": { "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies", "shortName": "NetworkFirewallPolicies" }, - "shortName": "Delete" + "shortName": "Get" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.DeleteNetworkFirewallPolicyRequest" + "type": "google.cloud.compute_v1.types.GetNetworkFirewallPolicyRequest" }, { "name": "project", @@ -26457,14 +27585,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "delete" + "resultType": "google.cloud.compute_v1.types.FirewallPolicy", + "shortName": "get" }, - "description": "Sample for Delete", - "file": "compute_v1_generated_network_firewall_policies_delete_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_Delete_sync", + "regionTag": "compute_v1_generated_NetworkFirewallPolicies_Get_sync", "segments": [ { "end": 52, @@ -26497,7 +27625,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_network_firewall_policies_delete_sync.py" + "title": "compute_v1_generated_network_firewall_policies_get_sync.py" }, { "canonical": true, @@ -26506,26 +27634,106 @@ "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient", "shortName": "NetworkFirewallPoliciesClient" }, - "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient.get_association", + "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient.insert", "method": { - "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies.GetAssociation", + "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies.Insert", "service": { "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies", "shortName": "NetworkFirewallPolicies" }, - "shortName": "GetAssociation" + "shortName": "Insert" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetAssociationNetworkFirewallPolicyRequest" + "type": "google.cloud.compute_v1.types.InsertNetworkFirewallPolicyRequest" }, { "name": "project", "type": "str" }, { - "name": "firewall_policy", + "name": "firewall_policy_resource", + "type": "google.cloud.compute_v1.types.FirewallPolicy" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "insert" + }, + "description": "Sample for Insert", + "file": "compute_v1_generated_network_firewall_policies_insert_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "compute_v1_generated_NetworkFirewallPolicies_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_network_firewall_policies_insert_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient", + "shortName": "NetworkFirewallPoliciesClient" + }, + "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient.list", + "method": { + "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies.List", + "service": { + "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies", + "shortName": "NetworkFirewallPolicies" + }, + "shortName": "List" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.compute_v1.types.ListNetworkFirewallPoliciesRequest" + }, + { + "name": "project", "type": "str" }, { @@ -26541,14 +27749,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.cloud.compute_v1.types.FirewallPolicyAssociation", - "shortName": "get_association" + "resultType": "google.cloud.compute_v1.services.network_firewall_policies.pagers.ListPager", + "shortName": "list" }, - "description": "Sample for GetAssociation", - "file": "compute_v1_generated_network_firewall_policies_get_association_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_GetAssociation_sync", + "regionTag": "compute_v1_generated_NetworkFirewallPolicies_List_sync", "segments": [ { "end": 52, @@ -26566,22 +27774,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_association_sync.py" + "title": "compute_v1_generated_network_firewall_policies_list_sync.py" }, { "canonical": true, @@ -26590,28 +27798,32 @@ "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient", "shortName": "NetworkFirewallPoliciesClient" }, - "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient.get_iam_policy", + "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient.patch_rule", "method": { - "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies.GetIamPolicy", + "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies.PatchRule", "service": { "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies", "shortName": "NetworkFirewallPolicies" }, - "shortName": "GetIamPolicy" + "shortName": "PatchRule" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetIamPolicyNetworkFirewallPolicyRequest" + "type": "google.cloud.compute_v1.types.PatchRuleNetworkFirewallPolicyRequest" }, { "name": "project", "type": "str" }, { - "name": "resource", + "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" @@ -26625,14 +27837,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.cloud.compute_v1.types.Policy", - "shortName": "get_iam_policy" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "patch_rule" }, - "description": "Sample for GetIamPolicy", - "file": "compute_v1_generated_network_firewall_policies_get_iam_policy_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_GetIamPolicy_sync", + "regionTag": "compute_v1_generated_NetworkFirewallPolicies_PatchRule_sync", "segments": [ { "end": 52, @@ -26665,7 +27877,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_network_firewall_policies_get_iam_policy_sync.py" + "title": "compute_v1_generated_network_firewall_policies_patch_rule_sync.py" }, { "canonical": true, @@ -26674,19 +27886,19 @@ "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient", "shortName": "NetworkFirewallPoliciesClient" }, - "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient.get_rule", + "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient.patch", "method": { - "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies.GetRule", + "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies.Patch", "service": { "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies", "shortName": "NetworkFirewallPolicies" }, - "shortName": "GetRule" + "shortName": "Patch" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetRuleNetworkFirewallPolicyRequest" + "type": "google.cloud.compute_v1.types.PatchNetworkFirewallPolicyRequest" }, { "name": "project", @@ -26696,6 +27908,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" @@ -26709,14 +27925,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.cloud.compute_v1.types.FirewallPolicyRule", - "shortName": "get_rule" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "patch" }, - "description": "Sample for GetRule", - "file": "compute_v1_generated_network_firewall_policies_get_rule_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_GetRule_sync", + "regionTag": "compute_v1_generated_NetworkFirewallPolicies_Patch_sync", "segments": [ { "end": 52, @@ -26749,7 +27965,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_network_firewall_policies_get_rule_sync.py" + "title": "compute_v1_generated_network_firewall_policies_patch_sync.py" }, { "canonical": true, @@ -26758,19 +27974,19 @@ "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient", "shortName": "NetworkFirewallPoliciesClient" }, - "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient.get", + "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient.remove_association", "method": { - "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies.Get", + "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies.RemoveAssociation", "service": { "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies", "shortName": "NetworkFirewallPolicies" }, - "shortName": "Get" + "shortName": "RemoveAssociation" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetNetworkFirewallPolicyRequest" + "type": "google.cloud.compute_v1.types.RemoveAssociationNetworkFirewallPolicyRequest" }, { "name": "project", @@ -26793,14 +28009,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.cloud.compute_v1.types.FirewallPolicy", - "shortName": "get" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "remove_association" }, - "description": "Sample for Get", - "file": "compute_v1_generated_network_firewall_policies_get_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_Get_sync", + "regionTag": "compute_v1_generated_NetworkFirewallPolicies_RemoveAssociation_sync", "segments": [ { "end": 52, @@ -26833,7 +28049,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_network_firewall_policies_get_sync.py" + "title": "compute_v1_generated_network_firewall_policies_remove_association_sync.py" }, { "canonical": true, @@ -26842,27 +28058,27 @@ "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient", "shortName": "NetworkFirewallPoliciesClient" }, - "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient.insert", + "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient.remove_rule", "method": { - "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies.Insert", + "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies.RemoveRule", "service": { "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies", "shortName": "NetworkFirewallPolicies" }, - "shortName": "Insert" + "shortName": "RemoveRule" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.InsertNetworkFirewallPolicyRequest" + "type": "google.cloud.compute_v1.types.RemoveRuleNetworkFirewallPolicyRequest" }, { "name": "project", "type": "str" }, { - "name": "firewall_policy_resource", - "type": "google.cloud.compute_v1.types.FirewallPolicy" + "name": "firewall_policy", + "type": "str" }, { "name": "retry", @@ -26878,21 +28094,21 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "insert" + "shortName": "remove_rule" }, - "description": "Sample for Insert", - "file": "compute_v1_generated_network_firewall_policies_insert_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_Insert_sync", + "regionTag": "compute_v1_generated_NetworkFirewallPolicies_RemoveRule_sync", "segments": [ { - "end": 51, + "end": 52, "start": 27, "type": "FULL" }, { - "end": 51, + "end": 52, "start": 27, "type": "SHORT" }, @@ -26902,22 +28118,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_remove_rule_sync.py" }, { "canonical": true, @@ -26926,24 +28142,32 @@ "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient", "shortName": "NetworkFirewallPoliciesClient" }, - "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient.list", + "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient.set_iam_policy", "method": { - "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies.List", + "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies.SetIamPolicy", "service": { "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies", "shortName": "NetworkFirewallPolicies" }, - "shortName": "List" + "shortName": "SetIamPolicy" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.ListNetworkFirewallPoliciesRequest" + "type": "google.cloud.compute_v1.types.SetIamPolicyNetworkFirewallPolicyRequest" }, { "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" @@ -26957,14 +28181,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.cloud.compute_v1.services.network_firewall_policies.pagers.ListPager", - "shortName": "list" + "resultType": "google.cloud.compute_v1.types.Policy", + "shortName": "set_iam_policy" }, - "description": "Sample for List", - "file": "compute_v1_generated_network_firewall_policies_list_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_List_sync", + "regionTag": "compute_v1_generated_NetworkFirewallPolicies_SetIamPolicy_sync", "segments": [ { "end": 52, @@ -26982,22 +28206,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_set_iam_policy_sync.py" }, { "canonical": true, @@ -27006,31 +28230,31 @@ "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient", "shortName": "NetworkFirewallPoliciesClient" }, - "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient.patch_rule", + "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient.test_iam_permissions", "method": { - "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies.PatchRule", + "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies.TestIamPermissions", "service": { "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies", "shortName": "NetworkFirewallPolicies" }, - "shortName": "PatchRule" + "shortName": "TestIamPermissions" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.PatchRuleNetworkFirewallPolicyRequest" + "type": "google.cloud.compute_v1.types.TestIamPermissionsNetworkFirewallPolicyRequest" }, { "name": "project", "type": "str" }, { - "name": "firewall_policy", + "name": "resource", "type": "str" }, { - "name": "firewall_policy_rule_resource", - "type": "google.cloud.compute_v1.types.FirewallPolicyRule" + "name": "test_permissions_request_resource", + "type": "google.cloud.compute_v1.types.TestPermissionsRequest" }, { "name": "retry", @@ -27045,14 +28269,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "patch_rule" + "resultType": "google.cloud.compute_v1.types.TestPermissionsResponse", + "shortName": "test_iam_permissions" }, - "description": "Sample for PatchRule", - "file": "compute_v1_generated_network_firewall_policies_patch_rule_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_PatchRule_sync", + "regionTag": "compute_v1_generated_NetworkFirewallPolicies_TestIamPermissions_sync", "segments": [ { "end": 52, @@ -27085,40 +28309,40 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_network_firewall_policies_patch_rule_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.NetworksClient", + "shortName": "NetworksClient" }, - "fullName": "google.cloud.compute_v1.NetworkFirewallPoliciesClient.patch", + "fullName": "google.cloud.compute_v1.NetworksClient.add_peering", "method": { - "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies.Patch", + "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": "Patch" + "shortName": "AddPeering" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.PatchNetworkFirewallPolicyRequest" + "type": "google.cloud.compute_v1.types.AddPeeringNetworkRequest" }, { "name": "project", "type": "str" }, { - "name": "firewall_policy", + "name": "network", "type": "str" }, { - "name": "firewall_policy_resource", - "type": "google.cloud.compute_v1.types.FirewallPolicy" + "name": "networks_add_peering_request_resource", + "type": "google.cloud.compute_v1.types.NetworksAddPeeringRequest" }, { "name": "retry", @@ -27134,13 +28358,13 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "patch" + "shortName": "add_peering" }, - "description": "Sample for Patch", - "file": "compute_v1_generated_network_firewall_policies_patch_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_Patch_sync", + "regionTag": "compute_v1_generated_Networks_AddPeering_sync", "segments": [ { "end": 52, @@ -27173,35 +28397,35 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_network_firewall_policies_patch_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.remove_association", + "fullName": "google.cloud.compute_v1.NetworksClient.delete", "method": { - "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies.RemoveAssociation", + "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": "RemoveAssociation" + "shortName": "Delete" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.RemoveAssociationNetworkFirewallPolicyRequest" + "type": "google.cloud.compute_v1.types.DeleteNetworkRequest" }, { "name": "project", "type": "str" }, { - "name": "firewall_policy", + "name": "network", "type": "str" }, { @@ -27218,13 +28442,13 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "remove_association" + "shortName": "delete" }, - "description": "Sample for RemoveAssociation", - "file": "compute_v1_generated_network_firewall_policies_remove_association_sync.py", + "description": "Sample for Delete", + "file": "compute_v1_generated_networks_delete_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_NetworkFirewallPolicies_RemoveAssociation_sync", + "regionTag": "compute_v1_generated_Networks_Delete_sync", "segments": [ { "end": 52, @@ -27257,35 +28481,35 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_network_firewall_policies_remove_association_sync.py" + "title": "compute_v1_generated_networks_delete_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.remove_rule", + "fullName": "google.cloud.compute_v1.NetworksClient.get_effective_firewalls", "method": { - "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies.RemoveRule", + "fullName": "google.cloud.compute.v1.Networks.GetEffectiveFirewalls", "service": { - "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies", - "shortName": "NetworkFirewallPolicies" + "fullName": "google.cloud.compute.v1.Networks", + "shortName": "Networks" }, - "shortName": "RemoveRule" + "shortName": "GetEffectiveFirewalls" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.RemoveRuleNetworkFirewallPolicyRequest" + "type": "google.cloud.compute_v1.types.GetEffectiveFirewallsNetworkRequest" }, { "name": "project", "type": "str" }, { - "name": "firewall_policy", + "name": "network", "type": "str" }, { @@ -27301,14 +28525,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "remove_rule" + "resultType": "google.cloud.compute_v1.types.NetworksGetEffectiveFirewallsResponse", + "shortName": "get_effective_firewalls" }, - "description": "Sample for RemoveRule", - "file": "compute_v1_generated_network_firewall_policies_remove_rule_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_RemoveRule_sync", + "regionTag": "compute_v1_generated_Networks_GetEffectiveFirewalls_sync", "segments": [ { "end": 52, @@ -27341,41 +28565,37 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_network_firewall_policies_remove_rule_sync.py" + "title": "compute_v1_generated_networks_get_effective_firewalls_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.get", "method": { - "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies.SetIamPolicy", + "fullName": "google.cloud.compute.v1.Networks.Get", "service": { - "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies", - "shortName": "NetworkFirewallPolicies" + "fullName": "google.cloud.compute.v1.Networks", + "shortName": "Networks" }, - "shortName": "SetIamPolicy" + "shortName": "Get" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.SetIamPolicyNetworkFirewallPolicyRequest" + "type": "google.cloud.compute_v1.types.GetNetworkRequest" }, { "name": "project", "type": "str" }, { - "name": "resource", + "name": "network", "type": "str" }, - { - "name": "global_set_policy_request_resource", - "type": "google.cloud.compute_v1.types.GlobalSetPolicyRequest" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -27389,14 +28609,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.cloud.compute_v1.types.Policy", - "shortName": "set_iam_policy" + "resultType": "google.cloud.compute_v1.types.Network", + "shortName": "get" }, - "description": "Sample for SetIamPolicy", - "file": "compute_v1_generated_network_firewall_policies_set_iam_policy_sync.py", + "description": "Sample for Get", + "file": "compute_v1_generated_networks_get_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_NetworkFirewallPolicies_SetIamPolicy_sync", + "regionTag": "compute_v1_generated_Networks_Get_sync", "segments": [ { "end": 52, @@ -27429,40 +28649,36 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_network_firewall_policies_set_iam_policy_sync.py" + "title": "compute_v1_generated_networks_get_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.insert", "method": { - "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies.TestIamPermissions", + "fullName": "google.cloud.compute.v1.Networks.Insert", "service": { - "fullName": "google.cloud.compute.v1.NetworkFirewallPolicies", - "shortName": "NetworkFirewallPolicies" + "fullName": "google.cloud.compute.v1.Networks", + "shortName": "Networks" }, - "shortName": "TestIamPermissions" + "shortName": "Insert" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.TestIamPermissionsNetworkFirewallPolicyRequest" + "type": "google.cloud.compute_v1.types.InsertNetworkRequest" }, { "name": "project", "type": "str" }, { - "name": "resource", - "type": "str" - }, - { - "name": "test_permissions_request_resource", - "type": "google.cloud.compute_v1.types.TestPermissionsRequest" + "name": "network_resource", + "type": "google.cloud.compute_v1.types.Network" }, { "name": "retry", @@ -27477,22 +28693,22 @@ "type": "Sequence[Tuple[str, str]" } ], - "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_network_firewall_policies_test_iam_permissions_sync.py", + "description": "Sample for Insert", + "file": "compute_v1_generated_networks_insert_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_NetworkFirewallPolicies_TestIamPermissions_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" }, @@ -27502,22 +28718,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_test_iam_permissions_sync.py" + "title": "compute_v1_generated_networks_insert_sync.py" }, { "canonical": true, @@ -27526,19 +28742,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", @@ -27548,10 +28764,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" @@ -27565,22 +28777,22 @@ "type": "Sequence[Tuple[str, str]" } ], - "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" }, @@ -27600,12 +28812,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, @@ -27614,28 +28826,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" @@ -27649,14 +28857,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "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, @@ -27674,22 +28882,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, @@ -27698,19 +28906,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", @@ -27720,6 +28928,10 @@ "name": "network", "type": "str" }, + { + "name": "network_resource", + "type": "google.cloud.compute_v1.types.Network" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -27733,14 +28945,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "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, @@ -27773,7 +28985,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_networks_get_effective_firewalls_sync.py" + "title": "compute_v1_generated_networks_patch_sync.py" }, { "canonical": true, @@ -27782,19 +28994,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", @@ -27804,6 +29016,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" @@ -27817,14 +29033,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "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, @@ -27857,7 +29073,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_networks_get_sync.py" + "title": "compute_v1_generated_networks_remove_peering_sync.py" }, { "canonical": true, @@ -27866,27 +29082,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", @@ -27902,21 +29118,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" }, @@ -27926,22 +29142,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, @@ -27950,19 +29166,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", @@ -27972,6 +29188,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" @@ -27985,22 +29205,22 @@ "type": "Sequence[Tuple[str, str]" } ], - "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" }, @@ -28020,38 +29240,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" @@ -28065,22 +29297,22 @@ "type": "Sequence[Tuple[str, str]" } ], - "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" }, @@ -28090,56 +29322,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" @@ -28153,14 +29377,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "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, @@ -28178,55 +29402,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", @@ -28242,21 +29470,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" }, @@ -28266,50 +29494,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" }, { @@ -28326,21 +29558,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" }, @@ -28350,55 +29582,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", @@ -28413,22 +29645,22 @@ "type": "Sequence[Tuple[str, str]" } ], - "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" }, @@ -28438,22 +29670,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, @@ -28462,19 +29694,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", @@ -28488,10 +29720,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" @@ -28505,14 +29733,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "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, @@ -28545,7 +29773,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, @@ -28554,24 +29782,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" @@ -28585,22 +29825,22 @@ "type": "Sequence[Tuple[str, str]" } ], - "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" }, @@ -28610,22 +29850,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, @@ -28634,19 +29874,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", @@ -28660,10 +29900,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" @@ -28677,22 +29913,22 @@ "type": "Sequence[Tuple[str, str]" } ], - "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" }, @@ -28712,12 +29948,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, @@ -28726,19 +29962,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", @@ -28748,10 +29984,6 @@ "name": "zone", "type": "str" }, - { - "name": "node_group", - "type": "str" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -28765,14 +29997,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "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, @@ -28790,22 +30022,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, @@ -28814,19 +30046,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", @@ -28837,9 +30069,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" @@ -28853,14 +30089,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "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, @@ -28893,7 +30129,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, @@ -28902,19 +30138,19 @@ "fullName": "google.cloud.compute_v1.NodeGroupsClient", "shortName": "NodeGroupsClient" }, - "fullName": "google.cloud.compute_v1.NodeGroupsClient.get", + "fullName": "google.cloud.compute_v1.NodeGroupsClient.set_iam_policy", "method": { - "fullName": "google.cloud.compute.v1.NodeGroups.Get", + "fullName": "google.cloud.compute.v1.NodeGroups.SetIamPolicy", "service": { "fullName": "google.cloud.compute.v1.NodeGroups", "shortName": "NodeGroups" }, - "shortName": "Get" + "shortName": "SetIamPolicy" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetNodeGroupRequest" + "type": "google.cloud.compute_v1.types.SetIamPolicyNodeGroupRequest" }, { "name": "project", @@ -28925,9 +30161,13 @@ "type": "str" }, { - "name": "node_group", + "name": "resource", "type": "str" }, + { + "name": "zone_set_policy_request_resource", + "type": "google.cloud.compute_v1.types.ZoneSetPolicyRequest" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -28941,14 +30181,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.cloud.compute_v1.types.NodeGroup", - "shortName": "get" + "resultType": "google.cloud.compute_v1.types.Policy", + "shortName": "set_iam_policy" }, - "description": "Sample for Get", - "file": "compute_v1_generated_node_groups_get_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_Get_sync", + "regionTag": "compute_v1_generated_NodeGroups_SetIamPolicy_sync", "segments": [ { "end": 53, @@ -28981,7 +30221,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_node_groups_get_sync.py" + "title": "compute_v1_generated_node_groups_set_iam_policy_sync.py" }, { "canonical": true, @@ -28990,19 +30230,19 @@ "fullName": "google.cloud.compute_v1.NodeGroupsClient", "shortName": "NodeGroupsClient" }, - "fullName": "google.cloud.compute_v1.NodeGroupsClient.insert", + "fullName": "google.cloud.compute_v1.NodeGroupsClient.set_node_template", "method": { - "fullName": "google.cloud.compute.v1.NodeGroups.Insert", + "fullName": "google.cloud.compute.v1.NodeGroups.SetNodeTemplate", "service": { "fullName": "google.cloud.compute.v1.NodeGroups", "shortName": "NodeGroups" }, - "shortName": "Insert" + "shortName": "SetNodeTemplate" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.InsertNodeGroupRequest" + "type": "google.cloud.compute_v1.types.SetNodeTemplateNodeGroupRequest" }, { "name": "project", @@ -29013,12 +30253,12 @@ "type": "str" }, { - "name": "initial_node_count", - "type": "int" + "name": "node_group", + "type": "str" }, { - "name": "node_group_resource", - "type": "google.cloud.compute_v1.types.NodeGroup" + "name": "node_groups_set_node_template_request_resource", + "type": "google.cloud.compute_v1.types.NodeGroupsSetNodeTemplateRequest" }, { "name": "retry", @@ -29034,13 +30274,13 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "insert" + "shortName": "set_node_template" }, - "description": "Sample for Insert", - "file": "compute_v1_generated_node_groups_insert_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_Insert_sync", + "regionTag": "compute_v1_generated_NodeGroups_SetNodeTemplate_sync", "segments": [ { "end": 53, @@ -29073,7 +30313,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_node_groups_insert_sync.py" + "title": "compute_v1_generated_node_groups_set_node_template_sync.py" }, { "canonical": true, @@ -29082,19 +30322,19 @@ "fullName": "google.cloud.compute_v1.NodeGroupsClient", "shortName": "NodeGroupsClient" }, - "fullName": "google.cloud.compute_v1.NodeGroupsClient.list_nodes", + "fullName": "google.cloud.compute_v1.NodeGroupsClient.simulate_maintenance_event", "method": { - "fullName": "google.cloud.compute.v1.NodeGroups.ListNodes", + "fullName": "google.cloud.compute.v1.NodeGroups.SimulateMaintenanceEvent", "service": { "fullName": "google.cloud.compute.v1.NodeGroups", "shortName": "NodeGroups" }, - "shortName": "ListNodes" + "shortName": "SimulateMaintenanceEvent" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.ListNodesNodeGroupsRequest" + "type": "google.cloud.compute_v1.types.SimulateMaintenanceEventNodeGroupRequest" }, { "name": "project", @@ -29108,6 +30348,10 @@ "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" @@ -29121,22 +30365,22 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.cloud.compute_v1.services.node_groups.pagers.ListNodesPager", - "shortName": "list_nodes" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "simulate_maintenance_event" }, - "description": "Sample for ListNodes", - "file": "compute_v1_generated_node_groups_list_nodes_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_ListNodes_sync", + "regionTag": "compute_v1_generated_NodeGroups_SimulateMaintenanceEvent_sync", "segments": [ { - "end": 54, + "end": 53, "start": 27, "type": "FULL" }, { - "end": 54, + "end": 53, "start": 27, "type": "SHORT" }, @@ -29156,12 +30400,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_simulate_maintenance_event_sync.py" }, { "canonical": true, @@ -29170,19 +30414,19 @@ "fullName": "google.cloud.compute_v1.NodeGroupsClient", "shortName": "NodeGroupsClient" }, - "fullName": "google.cloud.compute_v1.NodeGroupsClient.list", + "fullName": "google.cloud.compute_v1.NodeGroupsClient.test_iam_permissions", "method": { - "fullName": "google.cloud.compute.v1.NodeGroups.List", + "fullName": "google.cloud.compute.v1.NodeGroups.TestIamPermissions", "service": { "fullName": "google.cloud.compute.v1.NodeGroups", "shortName": "NodeGroups" }, - "shortName": "List" + "shortName": "TestIamPermissions" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.ListNodeGroupsRequest" + "type": "google.cloud.compute_v1.types.TestIamPermissionsNodeGroupRequest" }, { "name": "project", @@ -29192,6 +30436,14 @@ "name": "zone", "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" @@ -29205,14 +30457,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.cloud.compute_v1.services.node_groups.pagers.ListPager", - "shortName": "list" + "resultType": "google.cloud.compute_v1.types.TestPermissionsResponse", + "shortName": "test_iam_permissions" }, - "description": "Sample for List", - "file": "compute_v1_generated_node_groups_list_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_List_sync", + "regionTag": "compute_v1_generated_NodeGroups_TestIamPermissions_sync", "segments": [ { "end": 53, @@ -29230,60 +30482,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_node_groups_list_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.patch", + "fullName": "google.cloud.compute_v1.NodeTemplatesClient.aggregated_list", "method": { - "fullName": "google.cloud.compute.v1.NodeGroups.Patch", + "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": "Patch" + "shortName": "AggregatedList" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.PatchNodeGroupRequest" + "type": "google.cloud.compute_v1.types.AggregatedListNodeTemplatesRequest" }, { "name": "project", "type": "str" }, - { - "name": "zone", - "type": "str" - }, - { - "name": "node_group", - "type": "str" - }, - { - "name": "node_group_resource", - "type": "google.cloud.compute_v1.types.NodeGroup" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -29297,22 +30537,22 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "patch" + "resultType": "google.cloud.compute_v1.services.node_templates.pagers.AggregatedListPager", + "shortName": "aggregated_list" }, - "description": "Sample for Patch", - "file": "compute_v1_generated_node_groups_patch_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_Patch_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" }, @@ -29322,60 +30562,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_patch_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" @@ -29389,14 +30625,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "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, @@ -29429,45 +30665,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" @@ -29481,14 +30713,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "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, @@ -29521,45 +30753,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" @@ -29573,14 +30801,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "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, @@ -29613,44 +30841,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", @@ -29665,22 +30889,22 @@ "type": "Sequence[Tuple[str, str]" } ], - "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" }, @@ -29690,22 +30914,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, @@ -29714,24 +30938,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" @@ -29745,22 +30973,22 @@ "type": "Sequence[Tuple[str, str]" } ], - "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" }, @@ -29770,22 +30998,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, @@ -29794,19 +31022,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", @@ -29817,9 +31045,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" @@ -29833,14 +31065,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "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, @@ -29873,7 +31105,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, @@ -29882,19 +31114,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", @@ -29908,6 +31140,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" @@ -29921,14 +31157,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "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, @@ -29961,41 +31197,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" @@ -30009,22 +31237,22 @@ "type": "Sequence[Tuple[str, str]" } ], - "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" }, @@ -30034,55 +31262,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", @@ -30097,22 +31325,22 @@ "type": "Sequence[Tuple[str, str]" } ], - "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" }, @@ -30122,50 +31350,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" }, { @@ -30181,14 +31409,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "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, @@ -30221,45 +31449,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" @@ -30273,22 +31489,22 @@ "type": "Sequence[Tuple[str, str]" } ], - "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" }, @@ -30298,43 +31514,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", @@ -30345,13 +31561,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" @@ -30365,14 +31577,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "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, @@ -30405,33 +31617,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" @@ -30445,22 +31665,22 @@ "type": "Sequence[Tuple[str, str]" } ], - "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" }, @@ -30470,55 +31690,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", @@ -30533,22 +31753,22 @@ "type": "Sequence[Tuple[str, str]" } ], - "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" }, @@ -30558,50 +31778,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" }, { @@ -30617,14 +31837,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "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, @@ -30657,7 +31877,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_node_types_list_sync.py" + "title": "compute_v1_generated_packet_mirrorings_list_sync.py" }, { "canonical": true, @@ -30666,24 +31886,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" @@ -30697,22 +31929,22 @@ "type": "Sequence[Tuple[str, str]" } ], - "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" }, @@ -30722,22 +31954,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, @@ -30746,19 +31978,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", @@ -30769,9 +32001,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" @@ -30785,14 +32021,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "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, @@ -30825,41 +32061,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" @@ -30873,22 +32101,22 @@ "type": "Sequence[Tuple[str, str]" } ], - "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" }, @@ -30898,55 +32126,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", @@ -30962,21 +32186,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" }, @@ -30986,52 +32210,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" @@ -31045,22 +32265,22 @@ "type": "Sequence[Tuple[str, str]" } ], - "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" }, @@ -31070,59 +32290,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", @@ -31138,21 +32350,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" }, @@ -31162,59 +32374,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, str]" + } + ], + "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", @@ -31229,22 +32509,22 @@ "type": "Sequence[Tuple[str, str]" } ], - "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" }, @@ -31254,22 +32534,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, @@ -31278,19 +32558,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", @@ -31309,14 +32589,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "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, @@ -31349,7 +32629,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_projects_disable_xpn_host_sync.py" + "title": "compute_v1_generated_projects_get_sync.py" }, { "canonical": true, @@ -31358,27 +32638,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", @@ -31393,22 +32673,22 @@ "type": "Sequence[Tuple[str, str]" } ], - "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" }, @@ -31428,12 +32708,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, @@ -31442,24 +32722,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" @@ -31474,13 +32758,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, @@ -31513,7 +32797,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, @@ -31522,27 +32806,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", @@ -31558,13 +32842,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, @@ -31597,7 +32881,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, @@ -31606,24 +32890,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" @@ -31637,14 +32925,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "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, @@ -31677,7 +32965,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, @@ -31686,24 +32974,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" @@ -31717,22 +33009,22 @@ "type": "Sequence[Tuple[str, str]" } ], - "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" }, @@ -31752,12 +33044,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, @@ -31766,24 +33058,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" @@ -31797,14 +33093,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "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, @@ -31837,7 +33133,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, @@ -31846,27 +33142,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", @@ -31881,22 +33177,22 @@ "type": "Sequence[Tuple[str, str]" } ], - "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" }, @@ -31916,41 +33212,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", @@ -31966,21 +33262,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" }, @@ -31990,51 +33286,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", @@ -32050,21 +33346,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" }, @@ -32074,51 +33370,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_common_instance_metadata", + "fullName": "google.cloud.compute_v1.PublicAdvertisedPrefixesClient.get", "method": { - "fullName": "google.cloud.compute.v1.Projects.SetCommonInstanceMetadata", + "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": "SetCommonInstanceMetadata" + "shortName": "Get" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.SetCommonInstanceMetadataProjectRequest" + "type": "google.cloud.compute_v1.types.GetPublicAdvertisedPrefixeRequest" }, { "name": "project", "type": "str" }, { - "name": "metadata_resource", - "type": "google.cloud.compute_v1.types.Metadata" + "name": "public_advertised_prefix", + "type": "str" }, { "name": "retry", @@ -32133,22 +33429,22 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "set_common_instance_metadata" + "resultType": "google.cloud.compute_v1.types.PublicAdvertisedPrefix", + "shortName": "get" }, - "description": "Sample for SetCommonInstanceMetadata", - "file": "compute_v1_generated_projects_set_common_instance_metadata_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_SetCommonInstanceMetadata_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" }, @@ -32158,51 +33454,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_common_instance_metadata_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_default_network_tier", + "fullName": "google.cloud.compute_v1.PublicAdvertisedPrefixesClient.insert", "method": { - "fullName": "google.cloud.compute.v1.Projects.SetDefaultNetworkTier", + "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": "SetDefaultNetworkTier" + "shortName": "Insert" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.SetDefaultNetworkTierProjectRequest" + "type": "google.cloud.compute_v1.types.InsertPublicAdvertisedPrefixeRequest" }, { "name": "project", "type": "str" }, { - "name": "projects_set_default_network_tier_request_resource", - "type": "google.cloud.compute_v1.types.ProjectsSetDefaultNetworkTierRequest" + "name": "public_advertised_prefix_resource", + "type": "google.cloud.compute_v1.types.PublicAdvertisedPrefix" }, { "name": "retry", @@ -32218,13 +33514,13 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "set_default_network_tier" + "shortName": "insert" }, - "description": "Sample for SetDefaultNetworkTier", - "file": "compute_v1_generated_projects_set_default_network_tier_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_SetDefaultNetworkTier_sync", + "regionTag": "compute_v1_generated_PublicAdvertisedPrefixes_Insert_sync", "segments": [ { "end": 51, @@ -32257,37 +33553,33 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_projects_set_default_network_tier_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_usage_export_bucket", + "fullName": "google.cloud.compute_v1.PublicAdvertisedPrefixesClient.list", "method": { - "fullName": "google.cloud.compute.v1.Projects.SetUsageExportBucket", + "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": "SetUsageExportBucket" + "shortName": "List" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.SetUsageExportBucketProjectRequest" + "type": "google.cloud.compute_v1.types.ListPublicAdvertisedPrefixesRequest" }, { "name": "project", "type": "str" }, - { - "name": "usage_export_location_resource", - "type": "google.cloud.compute_v1.types.UsageExportLocation" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -32301,22 +33593,22 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "set_usage_export_bucket" + "resultType": "google.cloud.compute_v1.services.public_advertised_prefixes.pagers.ListPager", + "shortName": "list" }, - "description": "Sample for SetUsageExportBucket", - "file": "compute_v1_generated_projects_set_usage_export_bucket_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_SetUsageExportBucket_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" }, @@ -32336,12 +33628,12 @@ "type": "REQUEST_EXECUTION" }, { - "end": 52, + "end": 53, "start": 49, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_projects_set_usage_export_bucket_sync.py" + "title": "compute_v1_generated_public_advertised_prefixes_list_sync.py" }, { "canonical": true, @@ -32350,19 +33642,19 @@ "fullName": "google.cloud.compute_v1.PublicAdvertisedPrefixesClient", "shortName": "PublicAdvertisedPrefixesClient" }, - "fullName": "google.cloud.compute_v1.PublicAdvertisedPrefixesClient.announce", + "fullName": "google.cloud.compute_v1.PublicAdvertisedPrefixesClient.patch", "method": { - "fullName": "google.cloud.compute.v1.PublicAdvertisedPrefixes.Announce", + "fullName": "google.cloud.compute.v1.PublicAdvertisedPrefixes.Patch", "service": { "fullName": "google.cloud.compute.v1.PublicAdvertisedPrefixes", "shortName": "PublicAdvertisedPrefixes" }, - "shortName": "Announce" + "shortName": "Patch" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.AnnouncePublicAdvertisedPrefixeRequest" + "type": "google.cloud.compute_v1.types.PatchPublicAdvertisedPrefixeRequest" }, { "name": "project", @@ -32372,6 +33664,10 @@ "name": "public_advertised_prefix", "type": "str" }, + { + "name": "public_advertised_prefix_resource", + "type": "google.cloud.compute_v1.types.PublicAdvertisedPrefix" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -32386,13 +33682,13 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "announce" + "shortName": "patch" }, - "description": "Sample for Announce", - "file": "compute_v1_generated_public_advertised_prefixes_announce_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_PublicAdvertisedPrefixes_Announce_sync", + "regionTag": "compute_v1_generated_PublicAdvertisedPrefixes_Patch_sync", "segments": [ { "end": 52, @@ -32425,7 +33721,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_public_advertised_prefixes_announce_sync.py" + "title": "compute_v1_generated_public_advertised_prefixes_patch_sync.py" }, { "canonical": true, @@ -32434,19 +33730,19 @@ "fullName": "google.cloud.compute_v1.PublicAdvertisedPrefixesClient", "shortName": "PublicAdvertisedPrefixesClient" }, - "fullName": "google.cloud.compute_v1.PublicAdvertisedPrefixesClient.delete", + "fullName": "google.cloud.compute_v1.PublicAdvertisedPrefixesClient.withdraw", "method": { - "fullName": "google.cloud.compute.v1.PublicAdvertisedPrefixes.Delete", + "fullName": "google.cloud.compute.v1.PublicAdvertisedPrefixes.Withdraw", "service": { "fullName": "google.cloud.compute.v1.PublicAdvertisedPrefixes", "shortName": "PublicAdvertisedPrefixes" }, - "shortName": "Delete" + "shortName": "Withdraw" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.DeletePublicAdvertisedPrefixeRequest" + "type": "google.cloud.compute_v1.types.WithdrawPublicAdvertisedPrefixeRequest" }, { "name": "project", @@ -32470,13 +33766,13 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "delete" + "shortName": "withdraw" }, - "description": "Sample for Delete", - "file": "compute_v1_generated_public_advertised_prefixes_delete_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_Delete_sync", + "regionTag": "compute_v1_generated_PublicAdvertisedPrefixes_Withdraw_sync", "segments": [ { "end": 52, @@ -32509,37 +33805,33 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_public_advertised_prefixes_delete_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.get", + "fullName": "google.cloud.compute_v1.PublicDelegatedPrefixesClient.aggregated_list", "method": { - "fullName": "google.cloud.compute.v1.PublicAdvertisedPrefixes.Get", + "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": "Get" + "shortName": "AggregatedList" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetPublicAdvertisedPrefixeRequest" + "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" @@ -32553,14 +33845,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.cloud.compute_v1.types.PublicAdvertisedPrefix", - "shortName": "get" + "resultType": "google.cloud.compute_v1.services.public_delegated_prefixes.pagers.AggregatedListPager", + "shortName": "aggregated_list" }, - "description": "Sample for Get", - "file": "compute_v1_generated_public_advertised_prefixes_get_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_Get_sync", + "regionTag": "compute_v1_generated_PublicDelegatedPrefixes_AggregatedList_sync", "segments": [ { "end": 52, @@ -32578,51 +33870,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_public_advertised_prefixes_get_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.insert", + "fullName": "google.cloud.compute_v1.PublicDelegatedPrefixesClient.announce", "method": { - "fullName": "google.cloud.compute.v1.PublicAdvertisedPrefixes.Insert", + "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": "Insert" + "shortName": "Announce" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.InsertPublicAdvertisedPrefixeRequest" + "type": "google.cloud.compute_v1.types.AnnouncePublicDelegatedPrefixeRequest" }, { "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", @@ -32638,21 +33934,21 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "insert" + "shortName": "announce" }, - "description": "Sample for Insert", - "file": "compute_v1_generated_public_advertised_prefixes_insert_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_Insert_sync", + "regionTag": "compute_v1_generated_PublicDelegatedPrefixes_Announce_sync", "segments": [ { - "end": 51, + "end": 53, "start": 27, "type": "FULL" }, { - "end": 51, + "end": 53, "start": 27, "type": "SHORT" }, @@ -32662,48 +33958,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_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.list", + "fullName": "google.cloud.compute_v1.PublicDelegatedPrefixesClient.delete", "method": { - "fullName": "google.cloud.compute.v1.PublicAdvertisedPrefixes.List", + "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": "List" + "shortName": "Delete" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.ListPublicAdvertisedPrefixesRequest" + "type": "google.cloud.compute_v1.types.DeletePublicDelegatedPrefixeRequest" }, { "name": "project", "type": "str" }, + { + "name": "region", + "type": "str" + }, + { + "name": "public_delegated_prefix", + "type": "str" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -32717,22 +34021,22 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.cloud.compute_v1.services.public_advertised_prefixes.pagers.ListPager", - "shortName": "list" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "delete" }, - "description": "Sample for List", - "file": "compute_v1_generated_public_advertised_prefixes_list_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_List_sync", + "regionTag": "compute_v1_generated_PublicDelegatedPrefixes_Delete_sync", "segments": [ { - "end": 52, + "end": 53, "start": 27, "type": "FULL" }, { - "end": 52, + "end": 53, "start": 27, "type": "SHORT" }, @@ -32742,55 +34046,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_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.patch", + "fullName": "google.cloud.compute_v1.PublicDelegatedPrefixesClient.get", "method": { - "fullName": "google.cloud.compute.v1.PublicAdvertisedPrefixes.Patch", + "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": "Patch" + "shortName": "Get" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.PatchPublicAdvertisedPrefixeRequest" + "type": "google.cloud.compute_v1.types.GetPublicDelegatedPrefixeRequest" }, { "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", + "type": "str" }, { "name": "retry", @@ -32805,22 +34109,22 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "patch" + "resultType": "google.cloud.compute_v1.types.PublicDelegatedPrefix", + "shortName": "get" }, - "description": "Sample for Patch", - "file": "compute_v1_generated_public_advertised_prefixes_patch_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_Patch_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" }, @@ -32830,52 +34134,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_public_advertised_prefixes_patch_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.withdraw", + "fullName": "google.cloud.compute_v1.PublicDelegatedPrefixesClient.insert", "method": { - "fullName": "google.cloud.compute.v1.PublicAdvertisedPrefixes.Withdraw", + "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": "Withdraw" + "shortName": "Insert" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.WithdrawPublicAdvertisedPrefixeRequest" + "type": "google.cloud.compute_v1.types.InsertPublicDelegatedPrefixeRequest" }, { "name": "project", "type": "str" }, { - "name": "public_advertised_prefix", + "name": "region", "type": "str" }, + { + "name": "public_delegated_prefix_resource", + "type": "google.cloud.compute_v1.types.PublicDelegatedPrefix" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -32890,13 +34198,13 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "withdraw" + "shortName": "insert" }, - "description": "Sample for Withdraw", - "file": "compute_v1_generated_public_advertised_prefixes_withdraw_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_Withdraw_sync", + "regionTag": "compute_v1_generated_PublicDelegatedPrefixes_Insert_sync", "segments": [ { "end": 52, @@ -32929,7 +34237,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_public_advertised_prefixes_withdraw_sync.py" + "title": "compute_v1_generated_public_delegated_prefixes_insert_sync.py" }, { "canonical": true, @@ -32938,24 +34246,28 @@ "fullName": "google.cloud.compute_v1.PublicDelegatedPrefixesClient", "shortName": "PublicDelegatedPrefixesClient" }, - "fullName": "google.cloud.compute_v1.PublicDelegatedPrefixesClient.aggregated_list", + "fullName": "google.cloud.compute_v1.PublicDelegatedPrefixesClient.list", "method": { - "fullName": "google.cloud.compute.v1.PublicDelegatedPrefixes.AggregatedList", + "fullName": "google.cloud.compute.v1.PublicDelegatedPrefixes.List", "service": { "fullName": "google.cloud.compute.v1.PublicDelegatedPrefixes", "shortName": "PublicDelegatedPrefixes" }, - "shortName": "AggregatedList" + "shortName": "List" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.AggregatedListPublicDelegatedPrefixesRequest" + "type": "google.cloud.compute_v1.types.ListPublicDelegatedPrefixesRequest" }, { "name": "project", "type": "str" }, + { + "name": "region", + "type": "str" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -32969,22 +34281,22 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.cloud.compute_v1.services.public_delegated_prefixes.pagers.AggregatedListPager", - "shortName": "aggregated_list" + "resultType": "google.cloud.compute_v1.services.public_delegated_prefixes.pagers.ListPager", + "shortName": "list" }, - "description": "Sample for AggregatedList", - "file": "compute_v1_generated_public_delegated_prefixes_aggregated_list_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_PublicDelegatedPrefixes_AggregatedList_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" }, @@ -32994,22 +34306,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_public_delegated_prefixes_aggregated_list_sync.py" + "title": "compute_v1_generated_public_delegated_prefixes_list_sync.py" }, { "canonical": true, @@ -33018,19 +34330,19 @@ "fullName": "google.cloud.compute_v1.PublicDelegatedPrefixesClient", "shortName": "PublicDelegatedPrefixesClient" }, - "fullName": "google.cloud.compute_v1.PublicDelegatedPrefixesClient.announce", + "fullName": "google.cloud.compute_v1.PublicDelegatedPrefixesClient.patch", "method": { - "fullName": "google.cloud.compute.v1.PublicDelegatedPrefixes.Announce", + "fullName": "google.cloud.compute.v1.PublicDelegatedPrefixes.Patch", "service": { "fullName": "google.cloud.compute.v1.PublicDelegatedPrefixes", "shortName": "PublicDelegatedPrefixes" }, - "shortName": "Announce" + "shortName": "Patch" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.AnnouncePublicDelegatedPrefixeRequest" + "type": "google.cloud.compute_v1.types.PatchPublicDelegatedPrefixeRequest" }, { "name": "project", @@ -33044,6 +34356,10 @@ "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" @@ -33058,13 +34374,13 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "announce" + "shortName": "patch" }, - "description": "Sample for Announce", - "file": "compute_v1_generated_public_delegated_prefixes_announce_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_Announce_sync", + "regionTag": "compute_v1_generated_PublicDelegatedPrefixes_Patch_sync", "segments": [ { "end": 53, @@ -33097,7 +34413,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_public_delegated_prefixes_announce_sync.py" + "title": "compute_v1_generated_public_delegated_prefixes_patch_sync.py" }, { "canonical": true, @@ -33106,19 +34422,19 @@ "fullName": "google.cloud.compute_v1.PublicDelegatedPrefixesClient", "shortName": "PublicDelegatedPrefixesClient" }, - "fullName": "google.cloud.compute_v1.PublicDelegatedPrefixesClient.delete", + "fullName": "google.cloud.compute_v1.PublicDelegatedPrefixesClient.withdraw", "method": { - "fullName": "google.cloud.compute.v1.PublicDelegatedPrefixes.Delete", + "fullName": "google.cloud.compute.v1.PublicDelegatedPrefixes.Withdraw", "service": { "fullName": "google.cloud.compute.v1.PublicDelegatedPrefixes", "shortName": "PublicDelegatedPrefixes" }, - "shortName": "Delete" + "shortName": "Withdraw" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.DeletePublicDelegatedPrefixeRequest" + "type": "google.cloud.compute_v1.types.WithdrawPublicDelegatedPrefixeRequest" }, { "name": "project", @@ -33146,13 +34462,101 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "withdraw" + }, + "description": "Sample for Withdraw", + "file": "compute_v1_generated_public_delegated_prefixes_withdraw_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "compute_v1_generated_PublicDelegatedPrefixes_Withdraw_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_public_delegated_prefixes_withdraw_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.compute_v1.RegionAutoscalersClient", + "shortName": "RegionAutoscalersClient" + }, + "fullName": "google.cloud.compute_v1.RegionAutoscalersClient.delete", + "method": { + "fullName": "google.cloud.compute.v1.RegionAutoscalers.Delete", + "service": { + "fullName": "google.cloud.compute.v1.RegionAutoscalers", + "shortName": "RegionAutoscalers" + }, + "shortName": "Delete" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.compute_v1.types.DeleteRegionAutoscalerRequest" + }, + { + "name": "project", + "type": "str" + }, + { + "name": "region", + "type": "str" + }, + { + "name": "autoscaler", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.extended_operation.ExtendedOperation", "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, @@ -33185,28 +34589,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", @@ -33217,7 +34621,7 @@ "type": "str" }, { - "name": "public_delegated_prefix", + "name": "autoscaler", "type": "str" }, { @@ -33233,14 +34637,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "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, @@ -33273,28 +34677,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", @@ -33305,8 +34709,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", @@ -33325,10 +34729,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, @@ -33361,28 +34765,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", @@ -33405,14 +34809,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "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, @@ -33445,28 +34849,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", @@ -33477,12 +34881,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", @@ -33501,18 +34901,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" }, @@ -33522,43 +34922,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", @@ -33569,8 +34969,8 @@ "type": "str" }, { - "name": "public_delegated_prefix", - "type": "str" + "name": "autoscaler_resource", + "type": "google.cloud.compute_v1.types.Autoscaler" }, { "name": "retry", @@ -33586,21 +34986,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" }, @@ -33610,43 +35010,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", @@ -33657,7 +35057,7 @@ "type": "str" }, { - "name": "autoscaler", + "name": "backend_service", "type": "str" }, { @@ -33677,10 +35077,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, @@ -33713,28 +35113,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", @@ -33745,9 +35145,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" @@ -33761,14 +35165,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "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, @@ -33801,28 +35205,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", @@ -33833,8 +35237,8 @@ "type": "str" }, { - "name": "autoscaler_resource", - "type": "google.cloud.compute_v1.types.Autoscaler" + "name": "resource", + "type": "str" }, { "name": "retry", @@ -33849,22 +35253,22 @@ "type": "Sequence[Tuple[str, str]" } ], - "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_region_autoscalers_insert_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_Insert_sync", + "regionTag": "compute_v1_generated_RegionBackendServices_GetIamPolicy_sync", "segments": [ { - "end": 52, + "end": 53, "start": 27, "type": "FULL" }, { - "end": 52, + "end": 53, "start": 27, "type": "SHORT" }, @@ -33874,43 +35278,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_insert_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.list", + "fullName": "google.cloud.compute_v1.RegionBackendServicesClient.get", "method": { - "fullName": "google.cloud.compute.v1.RegionAutoscalers.List", + "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": "List" + "shortName": "Get" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.ListRegionAutoscalersRequest" + "type": "google.cloud.compute_v1.types.GetRegionBackendServiceRequest" }, { "name": "project", @@ -33920,6 +35324,10 @@ "name": "region", "type": "str" }, + { + "name": "backend_service", + "type": "str" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -33933,14 +35341,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.cloud.compute_v1.services.region_autoscalers.pagers.ListPager", - "shortName": "list" + "resultType": "google.cloud.compute_v1.types.BackendService", + "shortName": "get" }, - "description": "Sample for List", - "file": "compute_v1_generated_region_autoscalers_list_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_List_sync", + "regionTag": "compute_v1_generated_RegionBackendServices_Get_sync", "segments": [ { "end": 53, @@ -33958,43 +35366,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_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.insert", "method": { - "fullName": "google.cloud.compute.v1.RegionAutoscalers.Patch", + "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": "Patch" + "shortName": "Insert" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.PatchRegionAutoscalerRequest" + "type": "google.cloud.compute_v1.types.InsertRegionBackendServiceRequest" }, { "name": "project", @@ -34005,8 +35413,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", @@ -34022,13 +35430,13 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "patch" + "shortName": "insert" }, - "description": "Sample for Patch", - "file": "compute_v1_generated_region_autoscalers_patch_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_Patch_sync", + "regionTag": "compute_v1_generated_RegionBackendServices_Insert_sync", "segments": [ { "end": 52, @@ -34061,28 +35469,28 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_autoscalers_patch_sync.py" + "title": "compute_v1_generated_region_backend_services_insert_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.list_usable", "method": { - "fullName": "google.cloud.compute.v1.RegionAutoscalers.Update", + "fullName": "google.cloud.compute.v1.RegionBackendServices.ListUsable", "service": { - "fullName": "google.cloud.compute.v1.RegionAutoscalers", - "shortName": "RegionAutoscalers" + "fullName": "google.cloud.compute.v1.RegionBackendServices", + "shortName": "RegionBackendServices" }, - "shortName": "Update" + "shortName": "ListUsable" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.UpdateRegionAutoscalerRequest" + "type": "google.cloud.compute_v1.types.ListUsableRegionBackendServicesRequest" }, { "name": "project", @@ -34092,10 +35500,6 @@ "name": "region", "type": "str" }, - { - "name": "autoscaler_resource", - "type": "google.cloud.compute_v1.types.Autoscaler" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -34109,22 +35513,22 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "update" + "resultType": "google.cloud.compute_v1.services.region_backend_services.pagers.ListUsablePager", + "shortName": "list_usable" }, - "description": "Sample for Update", - "file": "compute_v1_generated_region_autoscalers_update_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_RegionAutoscalers_Update_sync", + "regionTag": "compute_v1_generated_RegionBackendServices_ListUsable_sync", "segments": [ { - "end": 52, + "end": 53, "start": 27, "type": "FULL" }, { - "end": 52, + "end": 53, "start": 27, "type": "SHORT" }, @@ -34144,12 +35548,12 @@ "type": "REQUEST_EXECUTION" }, { - "end": 53, + "end": 54, "start": 50, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_autoscalers_update_sync.py" + "title": "compute_v1_generated_region_backend_services_list_usable_sync.py" }, { "canonical": true, @@ -34158,19 +35562,19 @@ "fullName": "google.cloud.compute_v1.RegionBackendServicesClient", "shortName": "RegionBackendServicesClient" }, - "fullName": "google.cloud.compute_v1.RegionBackendServicesClient.delete", + "fullName": "google.cloud.compute_v1.RegionBackendServicesClient.list", "method": { - "fullName": "google.cloud.compute.v1.RegionBackendServices.Delete", + "fullName": "google.cloud.compute.v1.RegionBackendServices.List", "service": { "fullName": "google.cloud.compute.v1.RegionBackendServices", "shortName": "RegionBackendServices" }, - "shortName": "Delete" + "shortName": "List" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.DeleteRegionBackendServiceRequest" + "type": "google.cloud.compute_v1.types.ListRegionBackendServicesRequest" }, { "name": "project", @@ -34180,10 +35584,6 @@ "name": "region", "type": "str" }, - { - "name": "backend_service", - "type": "str" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -34197,14 +35597,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "delete" + "resultType": "google.cloud.compute_v1.services.region_backend_services.pagers.ListPager", + "shortName": "list" }, - "description": "Sample for Delete", - "file": "compute_v1_generated_region_backend_services_delete_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_Delete_sync", + "regionTag": "compute_v1_generated_RegionBackendServices_List_sync", "segments": [ { "end": 53, @@ -34222,22 +35622,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_sync.py" }, { "canonical": true, @@ -34246,19 +35646,19 @@ "fullName": "google.cloud.compute_v1.RegionBackendServicesClient", "shortName": "RegionBackendServicesClient" }, - "fullName": "google.cloud.compute_v1.RegionBackendServicesClient.get_health", + "fullName": "google.cloud.compute_v1.RegionBackendServicesClient.patch", "method": { - "fullName": "google.cloud.compute.v1.RegionBackendServices.GetHealth", + "fullName": "google.cloud.compute.v1.RegionBackendServices.Patch", "service": { "fullName": "google.cloud.compute.v1.RegionBackendServices", "shortName": "RegionBackendServices" }, - "shortName": "GetHealth" + "shortName": "Patch" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetHealthRegionBackendServiceRequest" + "type": "google.cloud.compute_v1.types.PatchRegionBackendServiceRequest" }, { "name": "project", @@ -34273,8 +35673,8 @@ "type": "str" }, { - "name": "resource_group_reference_resource", - "type": "google.cloud.compute_v1.types.ResourceGroupReference" + "name": "backend_service_resource", + "type": "google.cloud.compute_v1.types.BackendService" }, { "name": "retry", @@ -34289,14 +35689,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.cloud.compute_v1.types.BackendServiceGroupHealth", - "shortName": "get_health" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "patch" }, - "description": "Sample for GetHealth", - "file": "compute_v1_generated_region_backend_services_get_health_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_GetHealth_sync", + "regionTag": "compute_v1_generated_RegionBackendServices_Patch_sync", "segments": [ { "end": 53, @@ -34329,7 +35729,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_backend_services_get_health_sync.py" + "title": "compute_v1_generated_region_backend_services_patch_sync.py" }, { "canonical": true, @@ -34338,19 +35738,19 @@ "fullName": "google.cloud.compute_v1.RegionBackendServicesClient", "shortName": "RegionBackendServicesClient" }, - "fullName": "google.cloud.compute_v1.RegionBackendServicesClient.get_iam_policy", + "fullName": "google.cloud.compute_v1.RegionBackendServicesClient.set_iam_policy", "method": { - "fullName": "google.cloud.compute.v1.RegionBackendServices.GetIamPolicy", + "fullName": "google.cloud.compute.v1.RegionBackendServices.SetIamPolicy", "service": { "fullName": "google.cloud.compute.v1.RegionBackendServices", "shortName": "RegionBackendServices" }, - "shortName": "GetIamPolicy" + "shortName": "SetIamPolicy" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetIamPolicyRegionBackendServiceRequest" + "type": "google.cloud.compute_v1.types.SetIamPolicyRegionBackendServiceRequest" }, { "name": "project", @@ -34364,6 +35764,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" @@ -34378,13 +35782,13 @@ } ], "resultType": "google.cloud.compute_v1.types.Policy", - "shortName": "get_iam_policy" + "shortName": "set_iam_policy" }, - "description": "Sample for GetIamPolicy", - "file": "compute_v1_generated_region_backend_services_get_iam_policy_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_GetIamPolicy_sync", + "regionTag": "compute_v1_generated_RegionBackendServices_SetIamPolicy_sync", "segments": [ { "end": 53, @@ -34417,7 +35821,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_backend_services_get_iam_policy_sync.py" + "title": "compute_v1_generated_region_backend_services_set_iam_policy_sync.py" }, { "canonical": true, @@ -34426,19 +35830,19 @@ "fullName": "google.cloud.compute_v1.RegionBackendServicesClient", "shortName": "RegionBackendServicesClient" }, - "fullName": "google.cloud.compute_v1.RegionBackendServicesClient.get", + "fullName": "google.cloud.compute_v1.RegionBackendServicesClient.set_security_policy", "method": { - "fullName": "google.cloud.compute.v1.RegionBackendServices.Get", + "fullName": "google.cloud.compute.v1.RegionBackendServices.SetSecurityPolicy", "service": { "fullName": "google.cloud.compute.v1.RegionBackendServices", "shortName": "RegionBackendServices" }, - "shortName": "Get" + "shortName": "SetSecurityPolicy" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetRegionBackendServiceRequest" + "type": "google.cloud.compute_v1.types.SetSecurityPolicyRegionBackendServiceRequest" }, { "name": "project", @@ -34452,6 +35856,10 @@ "name": "backend_service", "type": "str" }, + { + "name": "security_policy_reference_resource", + "type": "google.cloud.compute_v1.types.SecurityPolicyReference" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -34465,14 +35873,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.cloud.compute_v1.types.BackendService", - "shortName": "get" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "set_security_policy" }, - "description": "Sample for Get", - "file": "compute_v1_generated_region_backend_services_get_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_Get_sync", + "regionTag": "compute_v1_generated_RegionBackendServices_SetSecurityPolicy_sync", "segments": [ { "end": 53, @@ -34505,7 +35913,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_backend_services_get_sync.py" + "title": "compute_v1_generated_region_backend_services_set_security_policy_sync.py" }, { "canonical": true, @@ -34514,19 +35922,19 @@ "fullName": "google.cloud.compute_v1.RegionBackendServicesClient", "shortName": "RegionBackendServicesClient" }, - "fullName": "google.cloud.compute_v1.RegionBackendServicesClient.insert", + "fullName": "google.cloud.compute_v1.RegionBackendServicesClient.test_iam_permissions", "method": { - "fullName": "google.cloud.compute.v1.RegionBackendServices.Insert", + "fullName": "google.cloud.compute.v1.RegionBackendServices.TestIamPermissions", "service": { "fullName": "google.cloud.compute.v1.RegionBackendServices", "shortName": "RegionBackendServices" }, - "shortName": "Insert" + "shortName": "TestIamPermissions" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.InsertRegionBackendServiceRequest" + "type": "google.cloud.compute_v1.types.TestIamPermissionsRegionBackendServiceRequest" }, { "name": "project", @@ -34537,8 +35945,12 @@ "type": "str" }, { - "name": "backend_service_resource", - "type": "google.cloud.compute_v1.types.BackendService" + "name": "resource", + "type": "str" + }, + { + "name": "test_permissions_request_resource", + "type": "google.cloud.compute_v1.types.TestPermissionsRequest" }, { "name": "retry", @@ -34553,22 +35965,22 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "insert" + "resultType": "google.cloud.compute_v1.types.TestPermissionsResponse", + "shortName": "test_iam_permissions" }, - "description": "Sample for Insert", - "file": "compute_v1_generated_region_backend_services_insert_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_Insert_sync", + "regionTag": "compute_v1_generated_RegionBackendServices_TestIamPermissions_sync", "segments": [ { - "end": 52, + "end": 53, "start": 27, "type": "FULL" }, { - "end": 52, + "end": 53, "start": 27, "type": "SHORT" }, @@ -34578,22 +35990,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_test_iam_permissions_sync.py" }, { "canonical": true, @@ -34602,19 +36014,19 @@ "fullName": "google.cloud.compute_v1.RegionBackendServicesClient", "shortName": "RegionBackendServicesClient" }, - "fullName": "google.cloud.compute_v1.RegionBackendServicesClient.list_usable", + "fullName": "google.cloud.compute_v1.RegionBackendServicesClient.update", "method": { - "fullName": "google.cloud.compute.v1.RegionBackendServices.ListUsable", + "fullName": "google.cloud.compute.v1.RegionBackendServices.Update", "service": { "fullName": "google.cloud.compute.v1.RegionBackendServices", "shortName": "RegionBackendServices" }, - "shortName": "ListUsable" + "shortName": "Update" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.ListUsableRegionBackendServicesRequest" + "type": "google.cloud.compute_v1.types.UpdateRegionBackendServiceRequest" }, { "name": "project", @@ -34624,6 +36036,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" @@ -34637,14 +36057,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.cloud.compute_v1.services.region_backend_services.pagers.ListUsablePager", - "shortName": "list_usable" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "update" }, - "description": "Sample for ListUsable", - "file": "compute_v1_generated_region_backend_services_list_usable_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_ListUsable_sync", + "regionTag": "compute_v1_generated_RegionBackendServices_Update_sync", "segments": [ { "end": 53, @@ -34662,52 +36082,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_usable_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.list", + "fullName": "google.cloud.compute_v1.RegionCommitmentsClient.aggregated_list", "method": { - "fullName": "google.cloud.compute.v1.RegionBackendServices.List", + "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": "List" + "shortName": "AggregatedList" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.ListRegionBackendServicesRequest" + "type": "google.cloud.compute_v1.types.AggregatedListRegionCommitmentsRequest" }, { "name": "project", "type": "str" }, - { - "name": "region", - "type": "str" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -34721,22 +36137,22 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.cloud.compute_v1.services.region_backend_services.pagers.ListPager", - "shortName": "list" + "resultType": "google.cloud.compute_v1.services.region_commitments.pagers.AggregatedListPager", + "shortName": "aggregated_list" }, - "description": "Sample for List", - "file": "compute_v1_generated_region_backend_services_list_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_List_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" }, @@ -34746,43 +36162,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": 54, - "start": 50, + "end": 53, + "start": 49, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_backend_services_list_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.patch", + "fullName": "google.cloud.compute_v1.RegionCommitmentsClient.get", "method": { - "fullName": "google.cloud.compute.v1.RegionBackendServices.Patch", + "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": "Patch" + "shortName": "Get" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.PatchRegionBackendServiceRequest" + "type": "google.cloud.compute_v1.types.GetRegionCommitmentRequest" }, { "name": "project", @@ -34793,13 +36209,9 @@ "type": "str" }, { - "name": "backend_service", + "name": "commitment", "type": "str" }, - { - "name": "backend_service_resource", - "type": "google.cloud.compute_v1.types.BackendService" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -34813,14 +36225,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "patch" + "resultType": "google.cloud.compute_v1.types.Commitment", + "shortName": "get" }, - "description": "Sample for Patch", - "file": "compute_v1_generated_region_backend_services_patch_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_Patch_sync", + "regionTag": "compute_v1_generated_RegionCommitments_Get_sync", "segments": [ { "end": 53, @@ -34853,28 +36265,28 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_backend_services_patch_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_iam_policy", + "fullName": "google.cloud.compute_v1.RegionCommitmentsClient.insert", "method": { - "fullName": "google.cloud.compute.v1.RegionBackendServices.SetIamPolicy", + "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": "SetIamPolicy" + "shortName": "Insert" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.SetIamPolicyRegionBackendServiceRequest" + "type": "google.cloud.compute_v1.types.InsertRegionCommitmentRequest" }, { "name": "project", @@ -34885,12 +36297,8 @@ "type": "str" }, { - "name": "resource", - "type": "str" - }, - { - "name": "region_set_policy_request_resource", - "type": "google.cloud.compute_v1.types.RegionSetPolicyRequest" + "name": "commitment_resource", + "type": "google.cloud.compute_v1.types.Commitment" }, { "name": "retry", @@ -34905,22 +36313,22 @@ "type": "Sequence[Tuple[str, str]" } ], - "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_backend_services_set_iam_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_SetIamPolicy_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" }, @@ -34930,43 +36338,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_iam_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.set_security_policy", + "fullName": "google.cloud.compute_v1.RegionCommitmentsClient.list", "method": { - "fullName": "google.cloud.compute.v1.RegionBackendServices.SetSecurityPolicy", + "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": "SetSecurityPolicy" + "shortName": "List" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.SetSecurityPolicyRegionBackendServiceRequest" + "type": "google.cloud.compute_v1.types.ListRegionCommitmentsRequest" }, { "name": "project", @@ -34976,14 +36384,6 @@ "name": "region", "type": "str" }, - { - "name": "backend_service", - "type": "str" - }, - { - "name": "security_policy_reference_resource", - "type": "google.cloud.compute_v1.types.SecurityPolicyReference" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -34997,14 +36397,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "set_security_policy" + "resultType": "google.cloud.compute_v1.services.region_commitments.pagers.ListPager", + "shortName": "list" }, - "description": "Sample for SetSecurityPolicy", - "file": "compute_v1_generated_region_backend_services_set_security_policy_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_SetSecurityPolicy_sync", + "regionTag": "compute_v1_generated_RegionCommitments_List_sync", "segments": [ { "end": 53, @@ -35022,43 +36422,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_set_security_policy_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.test_iam_permissions", + "fullName": "google.cloud.compute_v1.RegionCommitmentsClient.update", "method": { - "fullName": "google.cloud.compute.v1.RegionBackendServices.TestIamPermissions", + "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": "TestIamPermissions" + "shortName": "Update" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.TestIamPermissionsRegionBackendServiceRequest" + "type": "google.cloud.compute_v1.types.UpdateRegionCommitmentRequest" }, { "name": "project", @@ -35069,12 +36469,12 @@ "type": "str" }, { - "name": "resource", + "name": "commitment", "type": "str" }, { - "name": "test_permissions_request_resource", - "type": "google.cloud.compute_v1.types.TestPermissionsRequest" + "name": "commitment_resource", + "type": "google.cloud.compute_v1.types.Commitment" }, { "name": "retry", @@ -35089,14 +36489,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.cloud.compute_v1.types.TestPermissionsResponse", - "shortName": "test_iam_permissions" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "update" }, - "description": "Sample for TestIamPermissions", - "file": "compute_v1_generated_region_backend_services_test_iam_permissions_sync.py", + "description": "Sample for Update", + "file": "compute_v1_generated_region_commitments_update_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionBackendServices_TestIamPermissions_sync", + "regionTag": "compute_v1_generated_RegionCommitments_Update_sync", "segments": [ { "end": 53, @@ -35129,28 +36529,28 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_backend_services_test_iam_permissions_sync.py" + "title": "compute_v1_generated_region_commitments_update_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionBackendServicesClient", - "shortName": "RegionBackendServicesClient" + "fullName": "google.cloud.compute_v1.RegionDiskTypesClient", + "shortName": "RegionDiskTypesClient" }, - "fullName": "google.cloud.compute_v1.RegionBackendServicesClient.update", + "fullName": "google.cloud.compute_v1.RegionDiskTypesClient.get", "method": { - "fullName": "google.cloud.compute.v1.RegionBackendServices.Update", + "fullName": "google.cloud.compute.v1.RegionDiskTypes.Get", "service": { - "fullName": "google.cloud.compute.v1.RegionBackendServices", - "shortName": "RegionBackendServices" + "fullName": "google.cloud.compute.v1.RegionDiskTypes", + "shortName": "RegionDiskTypes" }, - "shortName": "Update" + "shortName": "Get" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.UpdateRegionBackendServiceRequest" + "type": "google.cloud.compute_v1.types.GetRegionDiskTypeRequest" }, { "name": "project", @@ -35161,13 +36561,9 @@ "type": "str" }, { - "name": "backend_service", + "name": "disk_type", "type": "str" }, - { - "name": "backend_service_resource", - "type": "google.cloud.compute_v1.types.BackendService" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -35181,14 +36577,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "update" + "resultType": "google.cloud.compute_v1.types.DiskType", + "shortName": "get" }, - "description": "Sample for Update", - "file": "compute_v1_generated_region_backend_services_update_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_RegionBackendServices_Update_sync", + "regionTag": "compute_v1_generated_RegionDiskTypes_Get_sync", "segments": [ { "end": 53, @@ -35221,33 +36617,37 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_backend_services_update_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.aggregated_list", + "fullName": "google.cloud.compute_v1.RegionDiskTypesClient.list", "method": { - "fullName": "google.cloud.compute.v1.RegionCommitments.AggregatedList", + "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": "AggregatedList" + "shortName": "List" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.AggregatedListRegionCommitmentsRequest" + "type": "google.cloud.compute_v1.types.ListRegionDiskTypesRequest" }, { "name": "project", "type": "str" }, + { + "name": "region", + "type": "str" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -35261,22 +36661,22 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.cloud.compute_v1.services.region_commitments.pagers.AggregatedListPager", - "shortName": "aggregated_list" + "resultType": "google.cloud.compute_v1.services.region_disk_types.pagers.ListPager", + "shortName": "list" }, - "description": "Sample for AggregatedList", - "file": "compute_v1_generated_region_commitments_aggregated_list_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_AggregatedList_sync", + "regionTag": "compute_v1_generated_RegionDiskTypes_List_sync", "segments": [ { - "end": 52, + "end": 53, "start": 27, "type": "FULL" }, { - "end": 52, + "end": 53, "start": 27, "type": "SHORT" }, @@ -35286,43 +36686,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, + "end": 54, + "start": 50, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_commitments_aggregated_list_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.get", + "fullName": "google.cloud.compute_v1.RegionDisksClient.add_resource_policies", "method": { - "fullName": "google.cloud.compute.v1.RegionCommitments.Get", + "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": "Get" + "shortName": "AddResourcePolicies" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetRegionCommitmentRequest" + "type": "google.cloud.compute_v1.types.AddResourcePoliciesRegionDiskRequest" }, { "name": "project", @@ -35333,9 +36733,13 @@ "type": "str" }, { - "name": "commitment", + "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" @@ -35349,14 +36753,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.cloud.compute_v1.types.Commitment", - "shortName": "get" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "add_resource_policies" }, - "description": "Sample for Get", - "file": "compute_v1_generated_region_commitments_get_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_Get_sync", + "regionTag": "compute_v1_generated_RegionDisks_AddResourcePolicies_sync", "segments": [ { "end": 53, @@ -35389,28 +36793,28 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_commitments_get_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.insert", + "fullName": "google.cloud.compute_v1.RegionDisksClient.bulk_insert", "method": { - "fullName": "google.cloud.compute.v1.RegionCommitments.Insert", + "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": "Insert" + "shortName": "BulkInsert" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.InsertRegionCommitmentRequest" + "type": "google.cloud.compute_v1.types.BulkInsertRegionDiskRequest" }, { "name": "project", @@ -35421,8 +36825,8 @@ "type": "str" }, { - "name": "commitment_resource", - "type": "google.cloud.compute_v1.types.Commitment" + "name": "bulk_insert_disk_resource_resource", + "type": "google.cloud.compute_v1.types.BulkInsertDiskResource" }, { "name": "retry", @@ -35438,13 +36842,13 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "insert" + "shortName": "bulk_insert" }, - "description": "Sample for Insert", - "file": "compute_v1_generated_region_commitments_insert_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_Insert_sync", + "regionTag": "compute_v1_generated_RegionDisks_BulkInsert_sync", "segments": [ { "end": 52, @@ -35477,28 +36881,28 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_commitments_insert_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.list", + "fullName": "google.cloud.compute_v1.RegionDisksClient.create_snapshot", "method": { - "fullName": "google.cloud.compute.v1.RegionCommitments.List", + "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": "List" + "shortName": "CreateSnapshot" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.ListRegionCommitmentsRequest" + "type": "google.cloud.compute_v1.types.CreateSnapshotRegionDiskRequest" }, { "name": "project", @@ -35508,6 +36912,14 @@ "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" @@ -35521,14 +36933,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.cloud.compute_v1.services.region_commitments.pagers.ListPager", - "shortName": "list" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "create_snapshot" }, - "description": "Sample for List", - "file": "compute_v1_generated_region_commitments_list_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_List_sync", + "regionTag": "compute_v1_generated_RegionDisks_CreateSnapshot_sync", "segments": [ { "end": 53, @@ -35546,43 +36958,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_commitments_list_sync.py" + "title": "compute_v1_generated_region_disks_create_snapshot_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.delete", "method": { - "fullName": "google.cloud.compute.v1.RegionCommitments.Update", + "fullName": "google.cloud.compute.v1.RegionDisks.Delete", "service": { - "fullName": "google.cloud.compute.v1.RegionCommitments", - "shortName": "RegionCommitments" + "fullName": "google.cloud.compute.v1.RegionDisks", + "shortName": "RegionDisks" }, - "shortName": "Update" + "shortName": "Delete" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.UpdateRegionCommitmentRequest" + "type": "google.cloud.compute_v1.types.DeleteRegionDiskRequest" }, { "name": "project", @@ -35593,13 +37005,9 @@ "type": "str" }, { - "name": "commitment", + "name": "disk", "type": "str" }, - { - "name": "commitment_resource", - "type": "google.cloud.compute_v1.types.Commitment" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -35614,13 +37022,13 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "update" + "shortName": "delete" }, - "description": "Sample for Update", - "file": "compute_v1_generated_region_commitments_update_sync.py", + "description": "Sample for Delete", + "file": "compute_v1_generated_region_disks_delete_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionCommitments_Update_sync", + "regionTag": "compute_v1_generated_RegionDisks_Delete_sync", "segments": [ { "end": 53, @@ -35653,28 +37061,28 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_commitments_update_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.get", + "fullName": "google.cloud.compute_v1.RegionDisksClient.get_iam_policy", "method": { - "fullName": "google.cloud.compute.v1.RegionDiskTypes.Get", + "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": "Get" + "shortName": "GetIamPolicy" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetRegionDiskTypeRequest" + "type": "google.cloud.compute_v1.types.GetIamPolicyRegionDiskRequest" }, { "name": "project", @@ -35685,7 +37093,7 @@ "type": "str" }, { - "name": "disk_type", + "name": "resource", "type": "str" }, { @@ -35701,14 +37109,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.cloud.compute_v1.types.DiskType", - "shortName": "get" + "resultType": "google.cloud.compute_v1.types.Policy", + "shortName": "get_iam_policy" }, - "description": "Sample for Get", - "file": "compute_v1_generated_region_disk_types_get_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_Get_sync", + "regionTag": "compute_v1_generated_RegionDisks_GetIamPolicy_sync", "segments": [ { "end": 53, @@ -35741,28 +37149,28 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_disk_types_get_sync.py" + "title": "compute_v1_generated_region_disks_get_iam_policy_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", "method": { - "fullName": "google.cloud.compute.v1.RegionDiskTypes.List", + "fullName": "google.cloud.compute.v1.RegionDisks.Get", "service": { - "fullName": "google.cloud.compute.v1.RegionDiskTypes", - "shortName": "RegionDiskTypes" + "fullName": "google.cloud.compute.v1.RegionDisks", + "shortName": "RegionDisks" }, - "shortName": "List" + "shortName": "Get" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.ListRegionDiskTypesRequest" + "type": "google.cloud.compute_v1.types.GetRegionDiskRequest" }, { "name": "project", @@ -35772,6 +37180,10 @@ "name": "region", "type": "str" }, + { + "name": "disk", + "type": "str" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -35785,14 +37197,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.cloud.compute_v1.services.region_disk_types.pagers.ListPager", - "shortName": "list" + "resultType": "google.cloud.compute_v1.types.Disk", + "shortName": "get" }, - "description": "Sample for List", - "file": "compute_v1_generated_region_disk_types_list_sync.py", + "description": "Sample for Get", + "file": "compute_v1_generated_region_disks_get_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionDiskTypes_List_sync", + "regionTag": "compute_v1_generated_RegionDisks_Get_sync", "segments": [ { "end": 53, @@ -35810,22 +37222,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_sync.py" }, { "canonical": true, @@ -35834,19 +37246,19 @@ "fullName": "google.cloud.compute_v1.RegionDisksClient", "shortName": "RegionDisksClient" }, - "fullName": "google.cloud.compute_v1.RegionDisksClient.add_resource_policies", + "fullName": "google.cloud.compute_v1.RegionDisksClient.insert", "method": { - "fullName": "google.cloud.compute.v1.RegionDisks.AddResourcePolicies", + "fullName": "google.cloud.compute.v1.RegionDisks.Insert", "service": { "fullName": "google.cloud.compute.v1.RegionDisks", "shortName": "RegionDisks" }, - "shortName": "AddResourcePolicies" + "shortName": "Insert" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.AddResourcePoliciesRegionDiskRequest" + "type": "google.cloud.compute_v1.types.InsertRegionDiskRequest" }, { "name": "project", @@ -35857,12 +37269,8 @@ "type": "str" }, { - "name": "disk", - "type": "str" - }, - { - "name": "region_disks_add_resource_policies_request_resource", - "type": "google.cloud.compute_v1.types.RegionDisksAddResourcePoliciesRequest" + "name": "disk_resource", + "type": "google.cloud.compute_v1.types.Disk" }, { "name": "retry", @@ -35878,21 +37286,21 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "add_resource_policies" + "shortName": "insert" }, - "description": "Sample for AddResourcePolicies", - "file": "compute_v1_generated_region_disks_add_resource_policies_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_AddResourcePolicies_sync", + "regionTag": "compute_v1_generated_RegionDisks_Insert_sync", "segments": [ { - "end": 53, + "end": 52, "start": 27, "type": "FULL" }, { - "end": 53, + "end": 52, "start": 27, "type": "SHORT" }, @@ -35902,22 +37310,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_disks_add_resource_policies_sync.py" + "title": "compute_v1_generated_region_disks_insert_sync.py" }, { "canonical": true, @@ -35926,19 +37334,19 @@ "fullName": "google.cloud.compute_v1.RegionDisksClient", "shortName": "RegionDisksClient" }, - "fullName": "google.cloud.compute_v1.RegionDisksClient.bulk_insert", + "fullName": "google.cloud.compute_v1.RegionDisksClient.list", "method": { - "fullName": "google.cloud.compute.v1.RegionDisks.BulkInsert", + "fullName": "google.cloud.compute.v1.RegionDisks.List", "service": { "fullName": "google.cloud.compute.v1.RegionDisks", "shortName": "RegionDisks" }, - "shortName": "BulkInsert" + "shortName": "List" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.BulkInsertRegionDiskRequest" + "type": "google.cloud.compute_v1.types.ListRegionDisksRequest" }, { "name": "project", @@ -35948,10 +37356,6 @@ "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" @@ -35965,22 +37369,22 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "bulk_insert" + "resultType": "google.cloud.compute_v1.services.region_disks.pagers.ListPager", + "shortName": "list" }, - "description": "Sample for BulkInsert", - "file": "compute_v1_generated_region_disks_bulk_insert_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_BulkInsert_sync", + "regionTag": "compute_v1_generated_RegionDisks_List_sync", "segments": [ { - "end": 52, + "end": 53, "start": 27, "type": "FULL" }, { - "end": 52, + "end": 53, "start": 27, "type": "SHORT" }, @@ -36000,12 +37404,12 @@ "type": "REQUEST_EXECUTION" }, { - "end": 53, + "end": 54, "start": 50, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_disks_bulk_insert_sync.py" + "title": "compute_v1_generated_region_disks_list_sync.py" }, { "canonical": true, @@ -36014,19 +37418,19 @@ "fullName": "google.cloud.compute_v1.RegionDisksClient", "shortName": "RegionDisksClient" }, - "fullName": "google.cloud.compute_v1.RegionDisksClient.create_snapshot", + "fullName": "google.cloud.compute_v1.RegionDisksClient.remove_resource_policies", "method": { - "fullName": "google.cloud.compute.v1.RegionDisks.CreateSnapshot", + "fullName": "google.cloud.compute.v1.RegionDisks.RemoveResourcePolicies", "service": { "fullName": "google.cloud.compute.v1.RegionDisks", "shortName": "RegionDisks" }, - "shortName": "CreateSnapshot" + "shortName": "RemoveResourcePolicies" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.CreateSnapshotRegionDiskRequest" + "type": "google.cloud.compute_v1.types.RemoveResourcePoliciesRegionDiskRequest" }, { "name": "project", @@ -36041,8 +37445,8 @@ "type": "str" }, { - "name": "snapshot_resource", - "type": "google.cloud.compute_v1.types.Snapshot" + "name": "region_disks_remove_resource_policies_request_resource", + "type": "google.cloud.compute_v1.types.RegionDisksRemoveResourcePoliciesRequest" }, { "name": "retry", @@ -36058,13 +37462,13 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "create_snapshot" + "shortName": "remove_resource_policies" }, - "description": "Sample for CreateSnapshot", - "file": "compute_v1_generated_region_disks_create_snapshot_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_CreateSnapshot_sync", + "regionTag": "compute_v1_generated_RegionDisks_RemoveResourcePolicies_sync", "segments": [ { "end": 53, @@ -36097,7 +37501,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_disks_create_snapshot_sync.py" + "title": "compute_v1_generated_region_disks_remove_resource_policies_sync.py" }, { "canonical": true, @@ -36106,19 +37510,19 @@ "fullName": "google.cloud.compute_v1.RegionDisksClient", "shortName": "RegionDisksClient" }, - "fullName": "google.cloud.compute_v1.RegionDisksClient.delete", + "fullName": "google.cloud.compute_v1.RegionDisksClient.resize", "method": { - "fullName": "google.cloud.compute.v1.RegionDisks.Delete", + "fullName": "google.cloud.compute.v1.RegionDisks.Resize", "service": { "fullName": "google.cloud.compute.v1.RegionDisks", "shortName": "RegionDisks" }, - "shortName": "Delete" + "shortName": "Resize" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.DeleteRegionDiskRequest" + "type": "google.cloud.compute_v1.types.ResizeRegionDiskRequest" }, { "name": "project", @@ -36132,6 +37536,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" @@ -36146,13 +37554,13 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "delete" + "shortName": "resize" }, - "description": "Sample for Delete", - "file": "compute_v1_generated_region_disks_delete_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_Delete_sync", + "regionTag": "compute_v1_generated_RegionDisks_Resize_sync", "segments": [ { "end": 53, @@ -36185,7 +37593,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_disks_delete_sync.py" + "title": "compute_v1_generated_region_disks_resize_sync.py" }, { "canonical": true, @@ -36194,19 +37602,19 @@ "fullName": "google.cloud.compute_v1.RegionDisksClient", "shortName": "RegionDisksClient" }, - "fullName": "google.cloud.compute_v1.RegionDisksClient.get_iam_policy", + "fullName": "google.cloud.compute_v1.RegionDisksClient.set_iam_policy", "method": { - "fullName": "google.cloud.compute.v1.RegionDisks.GetIamPolicy", + "fullName": "google.cloud.compute.v1.RegionDisks.SetIamPolicy", "service": { "fullName": "google.cloud.compute.v1.RegionDisks", "shortName": "RegionDisks" }, - "shortName": "GetIamPolicy" + "shortName": "SetIamPolicy" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetIamPolicyRegionDiskRequest" + "type": "google.cloud.compute_v1.types.SetIamPolicyRegionDiskRequest" }, { "name": "project", @@ -36220,6 +37628,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" @@ -36234,13 +37646,13 @@ } ], "resultType": "google.cloud.compute_v1.types.Policy", - "shortName": "get_iam_policy" + "shortName": "set_iam_policy" }, - "description": "Sample for GetIamPolicy", - "file": "compute_v1_generated_region_disks_get_iam_policy_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_GetIamPolicy_sync", + "regionTag": "compute_v1_generated_RegionDisks_SetIamPolicy_sync", "segments": [ { "end": 53, @@ -36273,7 +37685,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_disks_get_iam_policy_sync.py" + "title": "compute_v1_generated_region_disks_set_iam_policy_sync.py" }, { "canonical": true, @@ -36282,19 +37694,19 @@ "fullName": "google.cloud.compute_v1.RegionDisksClient", "shortName": "RegionDisksClient" }, - "fullName": "google.cloud.compute_v1.RegionDisksClient.get", + "fullName": "google.cloud.compute_v1.RegionDisksClient.set_labels", "method": { - "fullName": "google.cloud.compute.v1.RegionDisks.Get", + "fullName": "google.cloud.compute.v1.RegionDisks.SetLabels", "service": { "fullName": "google.cloud.compute.v1.RegionDisks", "shortName": "RegionDisks" }, - "shortName": "Get" + "shortName": "SetLabels" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetRegionDiskRequest" + "type": "google.cloud.compute_v1.types.SetLabelsRegionDiskRequest" }, { "name": "project", @@ -36305,9 +37717,13 @@ "type": "str" }, { - "name": "disk", + "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" @@ -36321,14 +37737,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.cloud.compute_v1.types.Disk", - "shortName": "get" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "set_labels" }, - "description": "Sample for Get", - "file": "compute_v1_generated_region_disks_get_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_Get_sync", + "regionTag": "compute_v1_generated_RegionDisks_SetLabels_sync", "segments": [ { "end": 53, @@ -36361,7 +37777,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_disks_get_sync.py" + "title": "compute_v1_generated_region_disks_set_labels_sync.py" }, { "canonical": true, @@ -36370,19 +37786,19 @@ "fullName": "google.cloud.compute_v1.RegionDisksClient", "shortName": "RegionDisksClient" }, - "fullName": "google.cloud.compute_v1.RegionDisksClient.insert", + "fullName": "google.cloud.compute_v1.RegionDisksClient.start_async_replication", "method": { - "fullName": "google.cloud.compute.v1.RegionDisks.Insert", + "fullName": "google.cloud.compute.v1.RegionDisks.StartAsyncReplication", "service": { "fullName": "google.cloud.compute.v1.RegionDisks", "shortName": "RegionDisks" }, - "shortName": "Insert" + "shortName": "StartAsyncReplication" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.InsertRegionDiskRequest" + "type": "google.cloud.compute_v1.types.StartAsyncReplicationRegionDiskRequest" }, { "name": "project", @@ -36393,8 +37809,12 @@ "type": "str" }, { - "name": "disk_resource", - "type": "google.cloud.compute_v1.types.Disk" + "name": "disk", + "type": "str" + }, + { + "name": "region_disks_start_async_replication_request_resource", + "type": "google.cloud.compute_v1.types.RegionDisksStartAsyncReplicationRequest" }, { "name": "retry", @@ -36410,21 +37830,21 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "insert" + "shortName": "start_async_replication" }, - "description": "Sample for Insert", - "file": "compute_v1_generated_region_disks_insert_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_Insert_sync", + "regionTag": "compute_v1_generated_RegionDisks_StartAsyncReplication_sync", "segments": [ { - "end": 52, + "end": 53, "start": 27, "type": "FULL" }, { - "end": 52, + "end": 53, "start": 27, "type": "SHORT" }, @@ -36434,22 +37854,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_start_async_replication_sync.py" }, { "canonical": true, @@ -36458,19 +37878,19 @@ "fullName": "google.cloud.compute_v1.RegionDisksClient", "shortName": "RegionDisksClient" }, - "fullName": "google.cloud.compute_v1.RegionDisksClient.list", + "fullName": "google.cloud.compute_v1.RegionDisksClient.stop_async_replication", "method": { - "fullName": "google.cloud.compute.v1.RegionDisks.List", + "fullName": "google.cloud.compute.v1.RegionDisks.StopAsyncReplication", "service": { "fullName": "google.cloud.compute.v1.RegionDisks", "shortName": "RegionDisks" }, - "shortName": "List" + "shortName": "StopAsyncReplication" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.ListRegionDisksRequest" + "type": "google.cloud.compute_v1.types.StopAsyncReplicationRegionDiskRequest" }, { "name": "project", @@ -36480,6 +37900,10 @@ "name": "region", "type": "str" }, + { + "name": "disk", + "type": "str" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -36493,14 +37917,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.cloud.compute_v1.services.region_disks.pagers.ListPager", - "shortName": "list" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "stop_async_replication" }, - "description": "Sample for List", - "file": "compute_v1_generated_region_disks_list_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_List_sync", + "regionTag": "compute_v1_generated_RegionDisks_StopAsyncReplication_sync", "segments": [ { "end": 53, @@ -36517,6 +37941,94 @@ "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_stop_async_replication_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.compute_v1.RegionDisksClient", + "shortName": "RegionDisksClient" + }, + "fullName": "google.cloud.compute_v1.RegionDisksClient.stop_group_async_replication", + "method": { + "fullName": "google.cloud.compute.v1.RegionDisks.StopGroupAsyncReplication", + "service": { + "fullName": "google.cloud.compute.v1.RegionDisks", + "shortName": "RegionDisks" + }, + "shortName": "StopGroupAsyncReplication" + }, + "parameters": [ + { + "name": "request", + "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, str]" + } + ], + "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, @@ -36528,12 +38040,12 @@ "type": "REQUEST_EXECUTION" }, { - "end": 54, + "end": 53, "start": 50, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_disks_list_sync.py" + "title": "compute_v1_generated_region_disks_stop_group_async_replication_sync.py" }, { "canonical": true, @@ -36542,19 +38054,19 @@ "fullName": "google.cloud.compute_v1.RegionDisksClient", "shortName": "RegionDisksClient" }, - "fullName": "google.cloud.compute_v1.RegionDisksClient.remove_resource_policies", + "fullName": "google.cloud.compute_v1.RegionDisksClient.test_iam_permissions", "method": { - "fullName": "google.cloud.compute.v1.RegionDisks.RemoveResourcePolicies", + "fullName": "google.cloud.compute.v1.RegionDisks.TestIamPermissions", "service": { "fullName": "google.cloud.compute.v1.RegionDisks", "shortName": "RegionDisks" }, - "shortName": "RemoveResourcePolicies" + "shortName": "TestIamPermissions" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.RemoveResourcePoliciesRegionDiskRequest" + "type": "google.cloud.compute_v1.types.TestIamPermissionsRegionDiskRequest" }, { "name": "project", @@ -36565,12 +38077,12 @@ "type": "str" }, { - "name": "disk", + "name": "resource", "type": "str" }, { - "name": "region_disks_remove_resource_policies_request_resource", - "type": "google.cloud.compute_v1.types.RegionDisksRemoveResourcePoliciesRequest" + "name": "test_permissions_request_resource", + "type": "google.cloud.compute_v1.types.TestPermissionsRequest" }, { "name": "retry", @@ -36585,14 +38097,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "remove_resource_policies" + "resultType": "google.cloud.compute_v1.types.TestPermissionsResponse", + "shortName": "test_iam_permissions" }, - "description": "Sample for RemoveResourcePolicies", - "file": "compute_v1_generated_region_disks_remove_resource_policies_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_RemoveResourcePolicies_sync", + "regionTag": "compute_v1_generated_RegionDisks_TestIamPermissions_sync", "segments": [ { "end": 53, @@ -36625,7 +38137,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_disks_remove_resource_policies_sync.py" + "title": "compute_v1_generated_region_disks_test_iam_permissions_sync.py" }, { "canonical": true, @@ -36634,19 +38146,19 @@ "fullName": "google.cloud.compute_v1.RegionDisksClient", "shortName": "RegionDisksClient" }, - "fullName": "google.cloud.compute_v1.RegionDisksClient.resize", + "fullName": "google.cloud.compute_v1.RegionDisksClient.update", "method": { - "fullName": "google.cloud.compute.v1.RegionDisks.Resize", + "fullName": "google.cloud.compute.v1.RegionDisks.Update", "service": { "fullName": "google.cloud.compute.v1.RegionDisks", "shortName": "RegionDisks" }, - "shortName": "Resize" + "shortName": "Update" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.ResizeRegionDiskRequest" + "type": "google.cloud.compute_v1.types.UpdateRegionDiskRequest" }, { "name": "project", @@ -36661,8 +38173,8 @@ "type": "str" }, { - "name": "region_disks_resize_request_resource", - "type": "google.cloud.compute_v1.types.RegionDisksResizeRequest" + "name": "disk_resource", + "type": "google.cloud.compute_v1.types.Disk" }, { "name": "retry", @@ -36678,13 +38190,13 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "resize" + "shortName": "update" }, - "description": "Sample for Resize", - "file": "compute_v1_generated_region_disks_resize_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_Resize_sync", + "regionTag": "compute_v1_generated_RegionDisks_Update_sync", "segments": [ { "end": 53, @@ -36717,28 +38229,28 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_disks_resize_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.set_iam_policy", + "fullName": "google.cloud.compute_v1.RegionHealthCheckServicesClient.delete", "method": { - "fullName": "google.cloud.compute.v1.RegionDisks.SetIamPolicy", + "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": "SetIamPolicy" + "shortName": "Delete" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.SetIamPolicyRegionDiskRequest" + "type": "google.cloud.compute_v1.types.DeleteRegionHealthCheckServiceRequest" }, { "name": "project", @@ -36749,13 +38261,9 @@ "type": "str" }, { - "name": "resource", + "name": "health_check_service", "type": "str" }, - { - "name": "region_set_policy_request_resource", - "type": "google.cloud.compute_v1.types.RegionSetPolicyRequest" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -36769,14 +38277,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "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_region_disks_set_iam_policy_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_SetIamPolicy_sync", + "regionTag": "compute_v1_generated_RegionHealthCheckServices_Delete_sync", "segments": [ { "end": 53, @@ -36809,28 +38317,28 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_disks_set_iam_policy_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.set_labels", + "fullName": "google.cloud.compute_v1.RegionHealthCheckServicesClient.get", "method": { - "fullName": "google.cloud.compute.v1.RegionDisks.SetLabels", + "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": "SetLabels" + "shortName": "Get" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.SetLabelsRegionDiskRequest" + "type": "google.cloud.compute_v1.types.GetRegionHealthCheckServiceRequest" }, { "name": "project", @@ -36841,13 +38349,9 @@ "type": "str" }, { - "name": "resource", + "name": "health_check_service", "type": "str" }, - { - "name": "region_set_labels_request_resource", - "type": "google.cloud.compute_v1.types.RegionSetLabelsRequest" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -36861,14 +38365,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "set_labels" + "resultType": "google.cloud.compute_v1.types.HealthCheckService", + "shortName": "get" }, - "description": "Sample for SetLabels", - "file": "compute_v1_generated_region_disks_set_labels_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_SetLabels_sync", + "regionTag": "compute_v1_generated_RegionHealthCheckServices_Get_sync", "segments": [ { "end": 53, @@ -36901,28 +38405,28 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_disks_set_labels_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.start_async_replication", + "fullName": "google.cloud.compute_v1.RegionHealthCheckServicesClient.insert", "method": { - "fullName": "google.cloud.compute.v1.RegionDisks.StartAsyncReplication", + "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": "StartAsyncReplication" + "shortName": "Insert" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.StartAsyncReplicationRegionDiskRequest" + "type": "google.cloud.compute_v1.types.InsertRegionHealthCheckServiceRequest" }, { "name": "project", @@ -36933,12 +38437,8 @@ "type": "str" }, { - "name": "disk", - "type": "str" - }, - { - "name": "region_disks_start_async_replication_request_resource", - "type": "google.cloud.compute_v1.types.RegionDisksStartAsyncReplicationRequest" + "name": "health_check_service_resource", + "type": "google.cloud.compute_v1.types.HealthCheckService" }, { "name": "retry", @@ -36954,21 +38454,21 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "start_async_replication" + "shortName": "insert" }, - "description": "Sample for StartAsyncReplication", - "file": "compute_v1_generated_region_disks_start_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_StartAsyncReplication_sync", + "regionTag": "compute_v1_generated_RegionHealthCheckServices_Insert_sync", "segments": [ { - "end": 53, + "end": 52, "start": 27, "type": "FULL" }, { - "end": 53, + "end": 52, "start": 27, "type": "SHORT" }, @@ -36978,43 +38478,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_disks_start_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.stop_async_replication", + "fullName": "google.cloud.compute_v1.RegionHealthCheckServicesClient.list", "method": { - "fullName": "google.cloud.compute.v1.RegionDisks.StopAsyncReplication", + "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": "StopAsyncReplication" + "shortName": "List" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.StopAsyncReplicationRegionDiskRequest" + "type": "google.cloud.compute_v1.types.ListRegionHealthCheckServicesRequest" }, { "name": "project", @@ -37024,10 +38524,6 @@ "name": "region", "type": "str" }, - { - "name": "disk", - "type": "str" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -37041,14 +38537,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "stop_async_replication" + "resultType": "google.cloud.compute_v1.services.region_health_check_services.pagers.ListPager", + "shortName": "list" }, - "description": "Sample for StopAsyncReplication", - "file": "compute_v1_generated_region_disks_stop_async_replication_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_StopAsyncReplication_sync", + "regionTag": "compute_v1_generated_RegionHealthCheckServices_List_sync", "segments": [ { "end": 53, @@ -37066,43 +38562,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_stop_async_replication_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.stop_group_async_replication", + "fullName": "google.cloud.compute_v1.RegionHealthCheckServicesClient.patch", "method": { - "fullName": "google.cloud.compute.v1.RegionDisks.StopGroupAsyncReplication", + "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": "StopGroupAsyncReplication" + "shortName": "Patch" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.StopGroupAsyncReplicationRegionDiskRequest" + "type": "google.cloud.compute_v1.types.PatchRegionHealthCheckServiceRequest" }, { "name": "project", @@ -37113,8 +38609,12 @@ "type": "str" }, { - "name": "disks_stop_group_async_replication_resource_resource", - "type": "google.cloud.compute_v1.types.DisksStopGroupAsyncReplicationResource" + "name": "health_check_service", + "type": "str" + }, + { + "name": "health_check_service_resource", + "type": "google.cloud.compute_v1.types.HealthCheckService" }, { "name": "retry", @@ -37130,21 +38630,21 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "stop_group_async_replication" + "shortName": "patch" }, - "description": "Sample for StopGroupAsyncReplication", - "file": "compute_v1_generated_region_disks_stop_group_async_replication_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_StopGroupAsyncReplication_sync", + "regionTag": "compute_v1_generated_RegionHealthCheckServices_Patch_sync", "segments": [ { - "end": 52, + "end": 53, "start": 27, "type": "FULL" }, { - "end": 52, + "end": 53, "start": 27, "type": "SHORT" }, @@ -37154,43 +38654,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_disks_stop_group_async_replication_sync.py" + "title": "compute_v1_generated_region_health_check_services_patch_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionDisksClient", - "shortName": "RegionDisksClient" + "fullName": "google.cloud.compute_v1.RegionHealthChecksClient", + "shortName": "RegionHealthChecksClient" }, - "fullName": "google.cloud.compute_v1.RegionDisksClient.test_iam_permissions", + "fullName": "google.cloud.compute_v1.RegionHealthChecksClient.delete", "method": { - "fullName": "google.cloud.compute.v1.RegionDisks.TestIamPermissions", + "fullName": "google.cloud.compute.v1.RegionHealthChecks.Delete", "service": { - "fullName": "google.cloud.compute.v1.RegionDisks", - "shortName": "RegionDisks" + "fullName": "google.cloud.compute.v1.RegionHealthChecks", + "shortName": "RegionHealthChecks" }, - "shortName": "TestIamPermissions" + "shortName": "Delete" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.TestIamPermissionsRegionDiskRequest" + "type": "google.cloud.compute_v1.types.DeleteRegionHealthCheckRequest" }, { "name": "project", @@ -37201,13 +38701,9 @@ "type": "str" }, { - "name": "resource", + "name": "health_check", "type": "str" }, - { - "name": "test_permissions_request_resource", - "type": "google.cloud.compute_v1.types.TestPermissionsRequest" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -37221,14 +38717,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "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_region_disks_test_iam_permissions_sync.py", + "description": "Sample for Delete", + "file": "compute_v1_generated_region_health_checks_delete_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionDisks_TestIamPermissions_sync", + "regionTag": "compute_v1_generated_RegionHealthChecks_Delete_sync", "segments": [ { "end": 53, @@ -37261,28 +38757,28 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_disks_test_iam_permissions_sync.py" + "title": "compute_v1_generated_region_health_checks_delete_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionDisksClient", - "shortName": "RegionDisksClient" + "fullName": "google.cloud.compute_v1.RegionHealthChecksClient", + "shortName": "RegionHealthChecksClient" }, - "fullName": "google.cloud.compute_v1.RegionDisksClient.update", + "fullName": "google.cloud.compute_v1.RegionHealthChecksClient.get", "method": { - "fullName": "google.cloud.compute.v1.RegionDisks.Update", + "fullName": "google.cloud.compute.v1.RegionHealthChecks.Get", "service": { - "fullName": "google.cloud.compute.v1.RegionDisks", - "shortName": "RegionDisks" + "fullName": "google.cloud.compute.v1.RegionHealthChecks", + "shortName": "RegionHealthChecks" }, - "shortName": "Update" + "shortName": "Get" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.UpdateRegionDiskRequest" + "type": "google.cloud.compute_v1.types.GetRegionHealthCheckRequest" }, { "name": "project", @@ -37293,13 +38789,9 @@ "type": "str" }, { - "name": "disk", + "name": "health_check", "type": "str" }, - { - "name": "disk_resource", - "type": "google.cloud.compute_v1.types.Disk" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -37313,14 +38805,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "update" + "resultType": "google.cloud.compute_v1.types.HealthCheck", + "shortName": "get" }, - "description": "Sample for Update", - "file": "compute_v1_generated_region_disks_update_sync.py", + "description": "Sample for Get", + "file": "compute_v1_generated_region_health_checks_get_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionDisks_Update_sync", + "regionTag": "compute_v1_generated_RegionHealthChecks_Get_sync", "segments": [ { "end": 53, @@ -37353,28 +38845,28 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_disks_update_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.delete", + "fullName": "google.cloud.compute_v1.RegionHealthChecksClient.insert", "method": { - "fullName": "google.cloud.compute.v1.RegionHealthCheckServices.Delete", + "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": "Delete" + "shortName": "Insert" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.DeleteRegionHealthCheckServiceRequest" + "type": "google.cloud.compute_v1.types.InsertRegionHealthCheckRequest" }, { "name": "project", @@ -37385,8 +38877,8 @@ "type": "str" }, { - "name": "health_check_service", - "type": "str" + "name": "health_check_resource", + "type": "google.cloud.compute_v1.types.HealthCheck" }, { "name": "retry", @@ -37402,21 +38894,21 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "delete" + "shortName": "insert" }, - "description": "Sample for Delete", - "file": "compute_v1_generated_region_health_check_services_delete_sync.py", + "description": "Sample for Insert", + "file": "compute_v1_generated_region_health_checks_insert_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionHealthCheckServices_Delete_sync", + "regionTag": "compute_v1_generated_RegionHealthChecks_Insert_sync", "segments": [ { - "end": 53, + "end": 52, "start": 27, "type": "FULL" }, { - "end": 53, + "end": 52, "start": 27, "type": "SHORT" }, @@ -37426,43 +38918,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_health_check_services_delete_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.get", + "fullName": "google.cloud.compute_v1.RegionHealthChecksClient.list", "method": { - "fullName": "google.cloud.compute.v1.RegionHealthCheckServices.Get", + "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": "Get" + "shortName": "List" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetRegionHealthCheckServiceRequest" + "type": "google.cloud.compute_v1.types.ListRegionHealthChecksRequest" }, { "name": "project", @@ -37472,10 +38964,6 @@ "name": "region", "type": "str" }, - { - "name": "health_check_service", - "type": "str" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -37489,14 +38977,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.cloud.compute_v1.types.HealthCheckService", - "shortName": "get" + "resultType": "google.cloud.compute_v1.services.region_health_checks.pagers.ListPager", + "shortName": "list" }, - "description": "Sample for Get", - "file": "compute_v1_generated_region_health_check_services_get_sync.py", + "description": "Sample for List", + "file": "compute_v1_generated_region_health_checks_list_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionHealthCheckServices_Get_sync", + "regionTag": "compute_v1_generated_RegionHealthChecks_List_sync", "segments": [ { "end": 53, @@ -37514,43 +39002,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_health_check_services_get_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.insert", + "fullName": "google.cloud.compute_v1.RegionHealthChecksClient.patch", "method": { - "fullName": "google.cloud.compute.v1.RegionHealthCheckServices.Insert", + "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": "Insert" + "shortName": "Patch" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.InsertRegionHealthCheckServiceRequest" + "type": "google.cloud.compute_v1.types.PatchRegionHealthCheckRequest" }, { "name": "project", @@ -37561,8 +39049,12 @@ "type": "str" }, { - "name": "health_check_service_resource", - "type": "google.cloud.compute_v1.types.HealthCheckService" + "name": "health_check", + "type": "str" + }, + { + "name": "health_check_resource", + "type": "google.cloud.compute_v1.types.HealthCheck" }, { "name": "retry", @@ -37578,21 +39070,21 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "insert" + "shortName": "patch" }, - "description": "Sample for Insert", - "file": "compute_v1_generated_region_health_check_services_insert_sync.py", + "description": "Sample for Patch", + "file": "compute_v1_generated_region_health_checks_patch_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionHealthCheckServices_Insert_sync", + "regionTag": "compute_v1_generated_RegionHealthChecks_Patch_sync", "segments": [ { - "end": 52, + "end": 53, "start": 27, "type": "FULL" }, { - "end": 52, + "end": 53, "start": 27, "type": "SHORT" }, @@ -37602,43 +39094,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_check_services_insert_sync.py" + "title": "compute_v1_generated_region_health_checks_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.list", + "fullName": "google.cloud.compute_v1.RegionHealthChecksClient.update", "method": { - "fullName": "google.cloud.compute.v1.RegionHealthCheckServices.List", + "fullName": "google.cloud.compute.v1.RegionHealthChecks.Update", "service": { - "fullName": "google.cloud.compute.v1.RegionHealthCheckServices", - "shortName": "RegionHealthCheckServices" + "fullName": "google.cloud.compute.v1.RegionHealthChecks", + "shortName": "RegionHealthChecks" }, - "shortName": "List" + "shortName": "Update" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.ListRegionHealthCheckServicesRequest" + "type": "google.cloud.compute_v1.types.UpdateRegionHealthCheckRequest" }, { "name": "project", @@ -37648,6 +39140,14 @@ "name": "region", "type": "str" }, + { + "name": "health_check", + "type": "str" + }, + { + "name": "health_check_resource", + "type": "google.cloud.compute_v1.types.HealthCheck" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -37661,14 +39161,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.cloud.compute_v1.services.region_health_check_services.pagers.ListPager", - "shortName": "list" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "update" }, - "description": "Sample for List", - "file": "compute_v1_generated_region_health_check_services_list_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_RegionHealthCheckServices_List_sync", + "regionTag": "compute_v1_generated_RegionHealthChecks_Update_sync", "segments": [ { "end": 53, @@ -37686,43 +39186,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_check_services_list_sync.py" + "title": "compute_v1_generated_region_health_checks_update_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionHealthCheckServicesClient", - "shortName": "RegionHealthCheckServicesClient" + "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient", + "shortName": "RegionInstanceGroupManagersClient" }, - "fullName": "google.cloud.compute_v1.RegionHealthCheckServicesClient.patch", + "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient.abandon_instances", "method": { - "fullName": "google.cloud.compute.v1.RegionHealthCheckServices.Patch", + "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers.AbandonInstances", "service": { - "fullName": "google.cloud.compute.v1.RegionHealthCheckServices", - "shortName": "RegionHealthCheckServices" + "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers", + "shortName": "RegionInstanceGroupManagers" }, - "shortName": "Patch" + "shortName": "AbandonInstances" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.PatchRegionHealthCheckServiceRequest" + "type": "google.cloud.compute_v1.types.AbandonInstancesRegionInstanceGroupManagerRequest" }, { "name": "project", @@ -37733,12 +39233,12 @@ "type": "str" }, { - "name": "health_check_service", + "name": "instance_group_manager", "type": "str" }, { - "name": "health_check_service_resource", - "type": "google.cloud.compute_v1.types.HealthCheckService" + "name": "region_instance_group_managers_abandon_instances_request_resource", + "type": "google.cloud.compute_v1.types.RegionInstanceGroupManagersAbandonInstancesRequest" }, { "name": "retry", @@ -37754,13 +39254,13 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "patch" + "shortName": "abandon_instances" }, - "description": "Sample for Patch", - "file": "compute_v1_generated_region_health_check_services_patch_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_RegionHealthCheckServices_Patch_sync", + "regionTag": "compute_v1_generated_RegionInstanceGroupManagers_AbandonInstances_sync", "segments": [ { "end": 53, @@ -37793,28 +39293,28 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_health_check_services_patch_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.delete", + "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient.apply_updates_to_instances", "method": { - "fullName": "google.cloud.compute.v1.RegionHealthChecks.Delete", + "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": "Delete" + "shortName": "ApplyUpdatesToInstances" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.DeleteRegionHealthCheckRequest" + "type": "google.cloud.compute_v1.types.ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest" }, { "name": "project", @@ -37825,9 +39325,13 @@ "type": "str" }, { - "name": "health_check", + "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" @@ -37842,13 +39346,13 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "delete" + "shortName": "apply_updates_to_instances" }, - "description": "Sample for Delete", - "file": "compute_v1_generated_region_health_checks_delete_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_Delete_sync", + "regionTag": "compute_v1_generated_RegionInstanceGroupManagers_ApplyUpdatesToInstances_sync", "segments": [ { "end": 53, @@ -37881,28 +39385,28 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_health_checks_delete_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.get", + "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient.create_instances", "method": { - "fullName": "google.cloud.compute.v1.RegionHealthChecks.Get", + "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": "Get" + "shortName": "CreateInstances" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetRegionHealthCheckRequest" + "type": "google.cloud.compute_v1.types.CreateInstancesRegionInstanceGroupManagerRequest" }, { "name": "project", @@ -37913,9 +39417,13 @@ "type": "str" }, { - "name": "health_check", + "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" @@ -37929,14 +39437,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.cloud.compute_v1.types.HealthCheck", - "shortName": "get" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "create_instances" }, - "description": "Sample for Get", - "file": "compute_v1_generated_region_health_checks_get_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_Get_sync", + "regionTag": "compute_v1_generated_RegionInstanceGroupManagers_CreateInstances_sync", "segments": [ { "end": 53, @@ -37969,28 +39477,28 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_health_checks_get_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.insert", + "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient.delete_instances", "method": { - "fullName": "google.cloud.compute.v1.RegionHealthChecks.Insert", + "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": "Insert" + "shortName": "DeleteInstances" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.InsertRegionHealthCheckRequest" + "type": "google.cloud.compute_v1.types.DeleteInstancesRegionInstanceGroupManagerRequest" }, { "name": "project", @@ -38001,8 +39509,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_delete_instances_request_resource", + "type": "google.cloud.compute_v1.types.RegionInstanceGroupManagersDeleteInstancesRequest" }, { "name": "retry", @@ -38018,21 +39530,21 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "insert" + "shortName": "delete_instances" }, - "description": "Sample for Insert", - "file": "compute_v1_generated_region_health_checks_insert_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_Insert_sync", + "regionTag": "compute_v1_generated_RegionInstanceGroupManagers_DeleteInstances_sync", "segments": [ { - "end": 52, + "end": 53, "start": 27, "type": "FULL" }, { - "end": 52, + "end": 53, "start": 27, "type": "SHORT" }, @@ -38042,43 +39554,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_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.list", + "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient.delete_per_instance_configs", "method": { - "fullName": "google.cloud.compute.v1.RegionHealthChecks.List", + "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": "List" + "shortName": "DeletePerInstanceConfigs" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.ListRegionHealthChecksRequest" + "type": "google.cloud.compute_v1.types.DeletePerInstanceConfigsRegionInstanceGroupManagerRequest" }, { "name": "project", @@ -38088,6 +39600,14 @@ "name": "region", "type": "str" }, + { + "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" @@ -38101,14 +39621,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.cloud.compute_v1.services.region_health_checks.pagers.ListPager", - "shortName": "list" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "delete_per_instance_configs" }, - "description": "Sample for List", - "file": "compute_v1_generated_region_health_checks_list_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_List_sync", + "regionTag": "compute_v1_generated_RegionInstanceGroupManagers_DeletePerInstanceConfigs_sync", "segments": [ { "end": 53, @@ -38126,43 +39646,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_delete_per_instance_configs_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", "method": { - "fullName": "google.cloud.compute.v1.RegionHealthChecks.Patch", + "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers.Delete", "service": { - "fullName": "google.cloud.compute.v1.RegionHealthChecks", - "shortName": "RegionHealthChecks" + "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers", + "shortName": "RegionInstanceGroupManagers" }, - "shortName": "Patch" + "shortName": "Delete" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.PatchRegionHealthCheckRequest" + "type": "google.cloud.compute_v1.types.DeleteRegionInstanceGroupManagerRequest" }, { "name": "project", @@ -38173,13 +39693,9 @@ "type": "str" }, { - "name": "health_check", + "name": "instance_group_manager", "type": "str" }, - { - "name": "health_check_resource", - "type": "google.cloud.compute_v1.types.HealthCheck" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -38194,13 +39710,13 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "patch" + "shortName": "delete" }, - "description": "Sample for Patch", - "file": "compute_v1_generated_region_health_checks_patch_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_RegionHealthChecks_Patch_sync", + "regionTag": "compute_v1_generated_RegionInstanceGroupManagers_Delete_sync", "segments": [ { "end": 53, @@ -38233,28 +39749,28 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_health_checks_patch_sync.py" + "title": "compute_v1_generated_region_instance_group_managers_delete_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.get", "method": { - "fullName": "google.cloud.compute.v1.RegionHealthChecks.Update", + "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers.Get", "service": { - "fullName": "google.cloud.compute.v1.RegionHealthChecks", - "shortName": "RegionHealthChecks" + "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers", + "shortName": "RegionInstanceGroupManagers" }, - "shortName": "Update" + "shortName": "Get" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.UpdateRegionHealthCheckRequest" + "type": "google.cloud.compute_v1.types.GetRegionInstanceGroupManagerRequest" }, { "name": "project", @@ -38265,13 +39781,9 @@ "type": "str" }, { - "name": "health_check", + "name": "instance_group_manager", "type": "str" }, - { - "name": "health_check_resource", - "type": "google.cloud.compute_v1.types.HealthCheck" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -38285,14 +39797,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "update" + "resultType": "google.cloud.compute_v1.types.InstanceGroupManager", + "shortName": "get" }, - "description": "Sample for Update", - "file": "compute_v1_generated_region_health_checks_update_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_RegionHealthChecks_Update_sync", + "regionTag": "compute_v1_generated_RegionInstanceGroupManagers_Get_sync", "segments": [ { "end": 53, @@ -38325,7 +39837,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_health_checks_update_sync.py" + "title": "compute_v1_generated_region_instance_group_managers_get_sync.py" }, { "canonical": true, @@ -38334,19 +39846,19 @@ "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient", "shortName": "RegionInstanceGroupManagersClient" }, - "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient.abandon_instances", + "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient.insert", "method": { - "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers.AbandonInstances", + "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers.Insert", "service": { "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers", "shortName": "RegionInstanceGroupManagers" }, - "shortName": "AbandonInstances" + "shortName": "Insert" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.AbandonInstancesRegionInstanceGroupManagerRequest" + "type": "google.cloud.compute_v1.types.InsertRegionInstanceGroupManagerRequest" }, { "name": "project", @@ -38357,12 +39869,8 @@ "type": "str" }, { - "name": "instance_group_manager", - "type": "str" - }, - { - "name": "region_instance_group_managers_abandon_instances_request_resource", - "type": "google.cloud.compute_v1.types.RegionInstanceGroupManagersAbandonInstancesRequest" + "name": "instance_group_manager_resource", + "type": "google.cloud.compute_v1.types.InstanceGroupManager" }, { "name": "retry", @@ -38378,21 +39886,21 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "abandon_instances" + "shortName": "insert" }, - "description": "Sample for AbandonInstances", - "file": "compute_v1_generated_region_instance_group_managers_abandon_instances_sync.py", + "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_AbandonInstances_sync", + "regionTag": "compute_v1_generated_RegionInstanceGroupManagers_Insert_sync", "segments": [ { - "end": 53, + "end": 52, "start": 27, "type": "FULL" }, { - "end": 53, + "end": 52, "start": 27, "type": "SHORT" }, @@ -38402,22 +39910,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_instance_group_managers_abandon_instances_sync.py" + "title": "compute_v1_generated_region_instance_group_managers_insert_sync.py" }, { "canonical": true, @@ -38426,19 +39934,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.list_errors", "method": { - "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers.ApplyUpdatesToInstances", + "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers.ListErrors", "service": { "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers", "shortName": "RegionInstanceGroupManagers" }, - "shortName": "ApplyUpdatesToInstances" + "shortName": "ListErrors" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest" + "type": "google.cloud.compute_v1.types.ListErrorsRegionInstanceGroupManagersRequest" }, { "name": "project", @@ -38452,10 +39960,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" @@ -38469,22 +39973,22 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "apply_updates_to_instances" + "resultType": "google.cloud.compute_v1.services.region_instance_group_managers.pagers.ListErrorsPager", + "shortName": "list_errors" }, - "description": "Sample for ApplyUpdatesToInstances", - "file": "compute_v1_generated_region_instance_group_managers_apply_updates_to_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_ApplyUpdatesToInstances_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" }, @@ -38504,12 +40008,12 @@ "type": "REQUEST_EXECUTION" }, { - "end": 54, + "end": 55, "start": 51, "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_list_errors_sync.py" }, { "canonical": true, @@ -38518,19 +40022,19 @@ "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient", "shortName": "RegionInstanceGroupManagersClient" }, - "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient.create_instances", + "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient.list_managed_instances", "method": { - "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers.CreateInstances", + "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers.ListManagedInstances", "service": { "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers", "shortName": "RegionInstanceGroupManagers" }, - "shortName": "CreateInstances" + "shortName": "ListManagedInstances" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.CreateInstancesRegionInstanceGroupManagerRequest" + "type": "google.cloud.compute_v1.types.ListManagedInstancesRegionInstanceGroupManagersRequest" }, { "name": "project", @@ -38544,10 +40048,6 @@ "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" @@ -38561,22 +40061,22 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "create_instances" + "resultType": "google.cloud.compute_v1.services.region_instance_group_managers.pagers.ListManagedInstancesPager", + "shortName": "list_managed_instances" }, - "description": "Sample for CreateInstances", - "file": "compute_v1_generated_region_instance_group_managers_create_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_CreateInstances_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" }, @@ -38596,12 +40096,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_managed_instances_sync.py" }, { "canonical": true, @@ -38610,19 +40110,19 @@ "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient", "shortName": "RegionInstanceGroupManagersClient" }, - "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient.delete_instances", + "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient.list_per_instance_configs", "method": { - "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers.DeleteInstances", + "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers.ListPerInstanceConfigs", "service": { "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers", "shortName": "RegionInstanceGroupManagers" }, - "shortName": "DeleteInstances" + "shortName": "ListPerInstanceConfigs" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.DeleteInstancesRegionInstanceGroupManagerRequest" + "type": "google.cloud.compute_v1.types.ListPerInstanceConfigsRegionInstanceGroupManagersRequest" }, { "name": "project", @@ -38637,8 +40137,88 @@ "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" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.compute_v1.services.region_instance_group_managers.pagers.ListPerInstanceConfigsPager", + "shortName": "list_per_instance_configs" + }, + "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_ListPerInstanceConfigs_sync", + "segments": [ + { + "end": 54, + "start": 27, + "type": "FULL" + }, + { + "end": 54, + "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": 55, + "start": 51, + "type": "RESPONSE_HANDLING" + } + ], + "title": "compute_v1_generated_region_instance_group_managers_list_per_instance_configs_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient", + "shortName": "RegionInstanceGroupManagersClient" + }, + "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient.list", + "method": { + "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers.List", + "service": { + "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers", + "shortName": "RegionInstanceGroupManagers" + }, + "shortName": "List" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.compute_v1.types.ListRegionInstanceGroupManagersRequest" + }, + { + "name": "project", + "type": "str" + }, + { + "name": "region", + "type": "str" }, { "name": "retry", @@ -38653,14 +40233,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "delete_instances" + "resultType": "google.cloud.compute_v1.services.region_instance_group_managers.pagers.ListPager", + "shortName": "list" }, - "description": "Sample for DeleteInstances", - "file": "compute_v1_generated_region_instance_group_managers_delete_instances_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_DeleteInstances_sync", + "regionTag": "compute_v1_generated_RegionInstanceGroupManagers_List_sync", "segments": [ { "end": 53, @@ -38678,22 +40258,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_instances_sync.py" + "title": "compute_v1_generated_region_instance_group_managers_list_sync.py" }, { "canonical": true, @@ -38702,19 +40282,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.patch_per_instance_configs", "method": { - "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers.DeletePerInstanceConfigs", + "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers.PatchPerInstanceConfigs", "service": { "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers", "shortName": "RegionInstanceGroupManagers" }, - "shortName": "DeletePerInstanceConfigs" + "shortName": "PatchPerInstanceConfigs" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.DeletePerInstanceConfigsRegionInstanceGroupManagerRequest" + "type": "google.cloud.compute_v1.types.PatchPerInstanceConfigsRegionInstanceGroupManagerRequest" }, { "name": "project", @@ -38729,8 +40309,8 @@ "type": "str" }, { - "name": "region_instance_group_manager_delete_instance_config_req_resource", - "type": "google.cloud.compute_v1.types.RegionInstanceGroupManagerDeleteInstanceConfigReq" + "name": "region_instance_group_manager_patch_instance_config_req_resource", + "type": "google.cloud.compute_v1.types.RegionInstanceGroupManagerPatchInstanceConfigReq" }, { "name": "retry", @@ -38746,13 +40326,13 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "delete_per_instance_configs" + "shortName": "patch_per_instance_configs" }, - "description": "Sample for DeletePerInstanceConfigs", - "file": "compute_v1_generated_region_instance_group_managers_delete_per_instance_configs_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_DeletePerInstanceConfigs_sync", + "regionTag": "compute_v1_generated_RegionInstanceGroupManagers_PatchPerInstanceConfigs_sync", "segments": [ { "end": 53, @@ -38785,7 +40365,7 @@ "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_patch_per_instance_configs_sync.py" }, { "canonical": true, @@ -38794,19 +40374,19 @@ "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient", "shortName": "RegionInstanceGroupManagersClient" }, - "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient.delete", + "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient.patch", "method": { - "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers.Delete", + "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers.Patch", "service": { "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers", "shortName": "RegionInstanceGroupManagers" }, - "shortName": "Delete" + "shortName": "Patch" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.DeleteRegionInstanceGroupManagerRequest" + "type": "google.cloud.compute_v1.types.PatchRegionInstanceGroupManagerRequest" }, { "name": "project", @@ -38820,6 +40400,10 @@ "name": "instance_group_manager", "type": "str" }, + { + "name": "instance_group_manager_resource", + "type": "google.cloud.compute_v1.types.InstanceGroupManager" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -38834,13 +40418,13 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "delete" + "shortName": "patch" }, - "description": "Sample for Delete", - "file": "compute_v1_generated_region_instance_group_managers_delete_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_Delete_sync", + "regionTag": "compute_v1_generated_RegionInstanceGroupManagers_Patch_sync", "segments": [ { "end": 53, @@ -38873,7 +40457,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_instance_group_managers_delete_sync.py" + "title": "compute_v1_generated_region_instance_group_managers_patch_sync.py" }, { "canonical": true, @@ -38882,19 +40466,19 @@ "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient", "shortName": "RegionInstanceGroupManagersClient" }, - "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient.get", + "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient.recreate_instances", "method": { - "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers.Get", + "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers.RecreateInstances", "service": { "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers", "shortName": "RegionInstanceGroupManagers" }, - "shortName": "Get" + "shortName": "RecreateInstances" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetRegionInstanceGroupManagerRequest" + "type": "google.cloud.compute_v1.types.RecreateInstancesRegionInstanceGroupManagerRequest" }, { "name": "project", @@ -38908,6 +40492,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" @@ -38921,14 +40509,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.cloud.compute_v1.types.InstanceGroupManager", - "shortName": "get" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "recreate_instances" }, - "description": "Sample for Get", - "file": "compute_v1_generated_region_instance_group_managers_get_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_Get_sync", + "regionTag": "compute_v1_generated_RegionInstanceGroupManagers_RecreateInstances_sync", "segments": [ { "end": 53, @@ -38961,7 +40549,7 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_instance_group_managers_get_sync.py" + "title": "compute_v1_generated_region_instance_group_managers_recreate_instances_sync.py" }, { "canonical": true, @@ -38970,19 +40558,19 @@ "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient", "shortName": "RegionInstanceGroupManagersClient" }, - "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient.insert", + "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient.resize", "method": { - "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers.Insert", + "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers.Resize", "service": { "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers", "shortName": "RegionInstanceGroupManagers" }, - "shortName": "Insert" + "shortName": "Resize" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.InsertRegionInstanceGroupManagerRequest" + "type": "google.cloud.compute_v1.types.ResizeRegionInstanceGroupManagerRequest" }, { "name": "project", @@ -38993,8 +40581,12 @@ "type": "str" }, { - "name": "instance_group_manager_resource", - "type": "google.cloud.compute_v1.types.InstanceGroupManager" + "name": "instance_group_manager", + "type": "str" + }, + { + "name": "size", + "type": "int" }, { "name": "retry", @@ -39010,21 +40602,21 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "insert" + "shortName": "resize" }, - "description": "Sample for Insert", - "file": "compute_v1_generated_region_instance_group_managers_insert_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_Insert_sync", + "regionTag": "compute_v1_generated_RegionInstanceGroupManagers_Resize_sync", "segments": [ { - "end": 52, + "end": 54, "start": 27, "type": "FULL" }, { - "end": 52, + "end": 54, "start": 27, "type": "SHORT" }, @@ -39034,22 +40626,22 @@ "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_region_instance_group_managers_insert_sync.py" + "title": "compute_v1_generated_region_instance_group_managers_resize_sync.py" }, { "canonical": true, @@ -39058,19 +40650,19 @@ "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient", "shortName": "RegionInstanceGroupManagersClient" }, - "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient.list_errors", + "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient.set_instance_template", "method": { - "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers.ListErrors", + "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers.SetInstanceTemplate", "service": { "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers", "shortName": "RegionInstanceGroupManagers" }, - "shortName": "ListErrors" + "shortName": "SetInstanceTemplate" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.ListErrorsRegionInstanceGroupManagersRequest" + "type": "google.cloud.compute_v1.types.SetInstanceTemplateRegionInstanceGroupManagerRequest" }, { "name": "project", @@ -39084,6 +40676,10 @@ "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" @@ -39097,22 +40693,22 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.cloud.compute_v1.services.region_instance_group_managers.pagers.ListErrorsPager", - "shortName": "list_errors" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "set_instance_template" }, - "description": "Sample for ListErrors", - "file": "compute_v1_generated_region_instance_group_managers_list_errors_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_ListErrors_sync", + "regionTag": "compute_v1_generated_RegionInstanceGroupManagers_SetInstanceTemplate_sync", "segments": [ { - "end": 54, + "end": 53, "start": 27, "type": "FULL" }, { - "end": 54, + "end": 53, "start": 27, "type": "SHORT" }, @@ -39132,12 +40728,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_set_instance_template_sync.py" }, { "canonical": true, @@ -39146,19 +40742,19 @@ "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient", "shortName": "RegionInstanceGroupManagersClient" }, - "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient.list_managed_instances", + "fullName": "google.cloud.compute_v1.RegionInstanceGroupManagersClient.set_target_pools", "method": { - "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers.ListManagedInstances", + "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers.SetTargetPools", "service": { "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers", "shortName": "RegionInstanceGroupManagers" }, - "shortName": "ListManagedInstances" + "shortName": "SetTargetPools" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.ListManagedInstancesRegionInstanceGroupManagersRequest" + "type": "google.cloud.compute_v1.types.SetTargetPoolsRegionInstanceGroupManagerRequest" }, { "name": "project", @@ -39172,6 +40768,10 @@ "name": "instance_group_manager", "type": "str" }, + { + "name": "region_instance_group_managers_set_target_pools_request_resource", + "type": "google.cloud.compute_v1.types.RegionInstanceGroupManagersSetTargetPoolsRequest" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -39185,22 +40785,22 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.cloud.compute_v1.services.region_instance_group_managers.pagers.ListManagedInstancesPager", - "shortName": "list_managed_instances" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "set_target_pools" }, - "description": "Sample for ListManagedInstances", - "file": "compute_v1_generated_region_instance_group_managers_list_managed_instances_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_ListManagedInstances_sync", + "regionTag": "compute_v1_generated_RegionInstanceGroupManagers_SetTargetPools_sync", "segments": [ { - "end": 54, + "end": 53, "start": 27, "type": "FULL" }, { - "end": 54, + "end": 53, "start": 27, "type": "SHORT" }, @@ -39220,12 +40820,12 @@ "type": "REQUEST_EXECUTION" }, { - "end": 55, + "end": 54, "start": 51, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_instance_group_managers_list_managed_instances_sync.py" + "title": "compute_v1_generated_region_instance_group_managers_set_target_pools_sync.py" }, { "canonical": true, @@ -39234,19 +40834,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.update_per_instance_configs", "method": { - "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers.ListPerInstanceConfigs", + "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers.UpdatePerInstanceConfigs", "service": { "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers", "shortName": "RegionInstanceGroupManagers" }, - "shortName": "ListPerInstanceConfigs" + "shortName": "UpdatePerInstanceConfigs" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.ListPerInstanceConfigsRegionInstanceGroupManagersRequest" + "type": "google.cloud.compute_v1.types.UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest" }, { "name": "project", @@ -39260,6 +40860,10 @@ "name": "instance_group_manager", "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" @@ -39273,22 +40877,22 @@ "type": "Sequence[Tuple[str, str]" } ], - "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": "update_per_instance_configs" }, - "description": "Sample for ListPerInstanceConfigs", - "file": "compute_v1_generated_region_instance_group_managers_list_per_instance_configs_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_ListPerInstanceConfigs_sync", + "regionTag": "compute_v1_generated_RegionInstanceGroupManagers_UpdatePerInstanceConfigs_sync", "segments": [ { - "end": 54, + "end": 53, "start": 27, "type": "FULL" }, { - "end": 54, + "end": 53, "start": 27, "type": "SHORT" }, @@ -39308,33 +40912,33 @@ "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_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.list", + "fullName": "google.cloud.compute_v1.RegionInstanceGroupsClient.get", "method": { - "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers.List", + "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": "List" + "shortName": "Get" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.ListRegionInstanceGroupManagersRequest" + "type": "google.cloud.compute_v1.types.GetRegionInstanceGroupRequest" }, { "name": "project", @@ -39344,6 +40948,10 @@ "name": "region", "type": "str" }, + { + "name": "instance_group", + "type": "str" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -39357,14 +40965,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.cloud.compute_v1.services.region_instance_group_managers.pagers.ListPager", - "shortName": "list" + "resultType": "google.cloud.compute_v1.types.InstanceGroup", + "shortName": "get" }, - "description": "Sample for List", - "file": "compute_v1_generated_region_instance_group_managers_list_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_List_sync", + "regionTag": "compute_v1_generated_RegionInstanceGroups_Get_sync", "segments": [ { "end": 53, @@ -39382,43 +40990,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_instance_group_managers_list_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.patch_per_instance_configs", + "fullName": "google.cloud.compute_v1.RegionInstanceGroupsClient.list_instances", "method": { - "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers.PatchPerInstanceConfigs", + "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": "PatchPerInstanceConfigs" + "shortName": "ListInstances" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.PatchPerInstanceConfigsRegionInstanceGroupManagerRequest" + "type": "google.cloud.compute_v1.types.ListInstancesRegionInstanceGroupsRequest" }, { "name": "project", @@ -39429,12 +41037,12 @@ "type": "str" }, { - "name": "instance_group_manager", + "name": "instance_group", "type": "str" }, { - "name": "region_instance_group_manager_patch_instance_config_req_resource", - "type": "google.cloud.compute_v1.types.RegionInstanceGroupManagerPatchInstanceConfigReq" + "name": "region_instance_groups_list_instances_request_resource", + "type": "google.cloud.compute_v1.types.RegionInstanceGroupsListInstancesRequest" }, { "name": "retry", @@ -39449,22 +41057,22 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "patch_per_instance_configs" + "resultType": "google.cloud.compute_v1.services.region_instance_groups.pagers.ListInstancesPager", + "shortName": "list_instances" }, - "description": "Sample for PatchPerInstanceConfigs", - "file": "compute_v1_generated_region_instance_group_managers_patch_per_instance_configs_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_PatchPerInstanceConfigs_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" }, @@ -39484,33 +41092,33 @@ "type": "REQUEST_EXECUTION" }, { - "end": 54, + "end": 55, "start": 51, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_instance_group_managers_patch_per_instance_configs_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.patch", + "fullName": "google.cloud.compute_v1.RegionInstanceGroupsClient.list", "method": { - "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers.Patch", + "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": "Patch" + "shortName": "List" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.PatchRegionInstanceGroupManagerRequest" + "type": "google.cloud.compute_v1.types.ListRegionInstanceGroupsRequest" }, { "name": "project", @@ -39520,14 +41128,6 @@ "name": "region", "type": "str" }, - { - "name": "instance_group_manager", - "type": "str" - }, - { - "name": "instance_group_manager_resource", - "type": "google.cloud.compute_v1.types.InstanceGroupManager" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -39541,14 +41141,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "patch" + "resultType": "google.cloud.compute_v1.services.region_instance_groups.pagers.ListPager", + "shortName": "list" }, - "description": "Sample for Patch", - "file": "compute_v1_generated_region_instance_group_managers_patch_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_Patch_sync", + "regionTag": "compute_v1_generated_RegionInstanceGroups_List_sync", "segments": [ { "end": 53, @@ -39566,43 +41166,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_patch_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.recreate_instances", + "fullName": "google.cloud.compute_v1.RegionInstanceGroupsClient.set_named_ports", "method": { - "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers.RecreateInstances", + "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": "RecreateInstances" + "shortName": "SetNamedPorts" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.RecreateInstancesRegionInstanceGroupManagerRequest" + "type": "google.cloud.compute_v1.types.SetNamedPortsRegionInstanceGroupRequest" }, { "name": "project", @@ -39613,12 +41213,12 @@ "type": "str" }, { - "name": "instance_group_manager", + "name": "instance_group", "type": "str" }, { - "name": "region_instance_group_managers_recreate_request_resource", - "type": "google.cloud.compute_v1.types.RegionInstanceGroupManagersRecreateRequest" + "name": "region_instance_groups_set_named_ports_request_resource", + "type": "google.cloud.compute_v1.types.RegionInstanceGroupsSetNamedPortsRequest" }, { "name": "retry", @@ -39634,13 +41234,13 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "recreate_instances" + "shortName": "set_named_ports" }, - "description": "Sample for RecreateInstances", - "file": "compute_v1_generated_region_instance_group_managers_recreate_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_RecreateInstances_sync", + "regionTag": "compute_v1_generated_RegionInstanceGroups_SetNamedPorts_sync", "segments": [ { "end": 53, @@ -39673,28 +41273,28 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_instance_group_managers_recreate_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.resize", + "fullName": "google.cloud.compute_v1.RegionInstanceTemplatesClient.delete", "method": { - "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers.Resize", + "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": "Resize" + "shortName": "Delete" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.ResizeRegionInstanceGroupManagerRequest" + "type": "google.cloud.compute_v1.types.DeleteRegionInstanceTemplateRequest" }, { "name": "project", @@ -39705,13 +41305,9 @@ "type": "str" }, { - "name": "instance_group_manager", + "name": "instance_template", "type": "str" }, - { - "name": "size", - "type": "int" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -39726,21 +41322,21 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "resize" + "shortName": "delete" }, - "description": "Sample for Resize", - "file": "compute_v1_generated_region_instance_group_managers_resize_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_Resize_sync", + "regionTag": "compute_v1_generated_RegionInstanceTemplates_Delete_sync", "segments": [ { - "end": 54, + "end": 53, "start": 27, "type": "FULL" }, { - "end": 54, + "end": 53, "start": 27, "type": "SHORT" }, @@ -39750,43 +41346,43 @@ "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_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.set_instance_template", + "fullName": "google.cloud.compute_v1.RegionInstanceTemplatesClient.get", "method": { - "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers.SetInstanceTemplate", + "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": "SetInstanceTemplate" + "shortName": "Get" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.SetInstanceTemplateRegionInstanceGroupManagerRequest" + "type": "google.cloud.compute_v1.types.GetRegionInstanceTemplateRequest" }, { "name": "project", @@ -39797,13 +41393,9 @@ "type": "str" }, { - "name": "instance_group_manager", + "name": "instance_template", "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" @@ -39817,14 +41409,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "set_instance_template" + "resultType": "google.cloud.compute_v1.types.InstanceTemplate", + "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_templates_get_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionInstanceGroupManagers_SetInstanceTemplate_sync", + "regionTag": "compute_v1_generated_RegionInstanceTemplates_Get_sync", "segments": [ { "end": 53, @@ -39857,28 +41449,28 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_instance_group_managers_set_instance_template_sync.py" + "title": "compute_v1_generated_region_instance_templates_get_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.set_target_pools", + "fullName": "google.cloud.compute_v1.RegionInstanceTemplatesClient.insert", "method": { - "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers.SetTargetPools", + "fullName": "google.cloud.compute.v1.RegionInstanceTemplates.Insert", "service": { - "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers", - "shortName": "RegionInstanceGroupManagers" + "fullName": "google.cloud.compute.v1.RegionInstanceTemplates", + "shortName": "RegionInstanceTemplates" }, - "shortName": "SetTargetPools" + "shortName": "Insert" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.SetTargetPoolsRegionInstanceGroupManagerRequest" + "type": "google.cloud.compute_v1.types.InsertRegionInstanceTemplateRequest" }, { "name": "project", @@ -39889,12 +41481,8 @@ "type": "str" }, { - "name": "instance_group_manager", - "type": "str" - }, - { - "name": "region_instance_group_managers_set_target_pools_request_resource", - "type": "google.cloud.compute_v1.types.RegionInstanceGroupManagersSetTargetPoolsRequest" + "name": "instance_template_resource", + "type": "google.cloud.compute_v1.types.InstanceTemplate" }, { "name": "retry", @@ -39910,21 +41498,21 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "set_target_pools" + "shortName": "insert" }, - "description": "Sample for SetTargetPools", - "file": "compute_v1_generated_region_instance_group_managers_set_target_pools_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_RegionInstanceGroupManagers_SetTargetPools_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" }, @@ -39934,43 +41522,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_group_managers_set_target_pools_sync.py" + "title": "compute_v1_generated_region_instance_templates_insert_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.list", "method": { - "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers.UpdatePerInstanceConfigs", + "fullName": "google.cloud.compute.v1.RegionInstanceTemplates.List", "service": { - "fullName": "google.cloud.compute.v1.RegionInstanceGroupManagers", - "shortName": "RegionInstanceGroupManagers" + "fullName": "google.cloud.compute.v1.RegionInstanceTemplates", + "shortName": "RegionInstanceTemplates" }, - "shortName": "UpdatePerInstanceConfigs" + "shortName": "List" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest" + "type": "google.cloud.compute_v1.types.ListRegionInstanceTemplatesRequest" }, { "name": "project", @@ -39980,14 +41568,6 @@ "name": "region", "type": "str" }, - { - "name": "instance_group_manager", - "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" @@ -40001,14 +41581,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "update_per_instance_configs" + "resultType": "google.cloud.compute_v1.services.region_instance_templates.pagers.ListPager", + "shortName": "list" }, - "description": "Sample for UpdatePerInstanceConfigs", - "file": "compute_v1_generated_region_instance_group_managers_update_per_instance_configs_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_RegionInstanceGroupManagers_UpdatePerInstanceConfigs_sync", + "regionTag": "compute_v1_generated_RegionInstanceTemplates_List_sync", "segments": [ { "end": 53, @@ -40026,43 +41606,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_update_per_instance_configs_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.get", + "fullName": "google.cloud.compute_v1.RegionInstancesClient.bulk_insert", "method": { - "fullName": "google.cloud.compute.v1.RegionInstanceGroups.Get", + "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": "Get" + "shortName": "BulkInsert" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetRegionInstanceGroupRequest" + "type": "google.cloud.compute_v1.types.BulkInsertRegionInstanceRequest" }, { "name": "project", @@ -40073,8 +41653,8 @@ "type": "str" }, { - "name": "instance_group", - "type": "str" + "name": "bulk_insert_instance_resource_resource", + "type": "google.cloud.compute_v1.types.BulkInsertInstanceResource" }, { "name": "retry", @@ -40089,22 +41669,22 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.cloud.compute_v1.types.InstanceGroup", - "shortName": "get" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "bulk_insert" }, - "description": "Sample for Get", - "file": "compute_v1_generated_region_instance_groups_get_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_Get_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" }, @@ -40114,43 +41694,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_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.list_instances", + "fullName": "google.cloud.compute_v1.RegionInstantSnapshotsClient.delete", "method": { - "fullName": "google.cloud.compute.v1.RegionInstanceGroups.ListInstances", + "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": "ListInstances" + "shortName": "Delete" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.ListInstancesRegionInstanceGroupsRequest" + "type": "google.cloud.compute_v1.types.DeleteRegionInstantSnapshotRequest" }, { "name": "project", @@ -40161,13 +41741,9 @@ "type": "str" }, { - "name": "instance_group", + "name": "instant_snapshot", "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" @@ -40181,22 +41757,22 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.cloud.compute_v1.services.region_instance_groups.pagers.ListInstancesPager", - "shortName": "list_instances" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "delete" }, - "description": "Sample for ListInstances", - "file": "compute_v1_generated_region_instance_groups_list_instances_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_ListInstances_sync", + "regionTag": "compute_v1_generated_RegionInstantSnapshots_Delete_sync", "segments": [ { - "end": 54, + "end": 53, "start": 27, "type": "FULL" }, { - "end": 54, + "end": 53, "start": 27, "type": "SHORT" }, @@ -40216,33 +41792,33 @@ "type": "REQUEST_EXECUTION" }, { - "end": 55, + "end": 54, "start": 51, "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_instance_groups_list_instances_sync.py" + "title": "compute_v1_generated_region_instant_snapshots_delete_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.list", + "fullName": "google.cloud.compute_v1.RegionInstantSnapshotsClient.get_iam_policy", "method": { - "fullName": "google.cloud.compute.v1.RegionInstanceGroups.List", + "fullName": "google.cloud.compute.v1.RegionInstantSnapshots.GetIamPolicy", "service": { - "fullName": "google.cloud.compute.v1.RegionInstanceGroups", - "shortName": "RegionInstanceGroups" + "fullName": "google.cloud.compute.v1.RegionInstantSnapshots", + "shortName": "RegionInstantSnapshots" }, - "shortName": "List" + "shortName": "GetIamPolicy" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.ListRegionInstanceGroupsRequest" + "type": "google.cloud.compute_v1.types.GetIamPolicyRegionInstantSnapshotRequest" }, { "name": "project", @@ -40252,6 +41828,10 @@ "name": "region", "type": "str" }, + { + "name": "resource", + "type": "str" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -40265,14 +41845,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.cloud.compute_v1.services.region_instance_groups.pagers.ListPager", - "shortName": "list" + "resultType": "google.cloud.compute_v1.types.Policy", + "shortName": "get_iam_policy" }, - "description": "Sample for List", - "file": "compute_v1_generated_region_instance_groups_list_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_RegionInstanceGroups_List_sync", + "regionTag": "compute_v1_generated_RegionInstantSnapshots_GetIamPolicy_sync", "segments": [ { "end": 53, @@ -40290,43 +41870,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_instance_groups_list_sync.py" + "title": "compute_v1_generated_region_instant_snapshots_get_iam_policy_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.get", "method": { - "fullName": "google.cloud.compute.v1.RegionInstanceGroups.SetNamedPorts", + "fullName": "google.cloud.compute.v1.RegionInstantSnapshots.Get", "service": { - "fullName": "google.cloud.compute.v1.RegionInstanceGroups", - "shortName": "RegionInstanceGroups" + "fullName": "google.cloud.compute.v1.RegionInstantSnapshots", + "shortName": "RegionInstantSnapshots" }, - "shortName": "SetNamedPorts" + "shortName": "Get" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.SetNamedPortsRegionInstanceGroupRequest" + "type": "google.cloud.compute_v1.types.GetRegionInstantSnapshotRequest" }, { "name": "project", @@ -40337,13 +41917,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" @@ -40357,14 +41933,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "set_named_ports" + "resultType": "google.cloud.compute_v1.types.InstantSnapshot", + "shortName": "get" }, - "description": "Sample for SetNamedPorts", - "file": "compute_v1_generated_region_instance_groups_set_named_ports_sync.py", + "description": "Sample for Get", + "file": "compute_v1_generated_region_instant_snapshots_get_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionInstanceGroups_SetNamedPorts_sync", + "regionTag": "compute_v1_generated_RegionInstantSnapshots_Get_sync", "segments": [ { "end": 53, @@ -40397,28 +41973,28 @@ "type": "RESPONSE_HANDLING" } ], - "title": "compute_v1_generated_region_instance_groups_set_named_ports_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.delete", + "fullName": "google.cloud.compute_v1.RegionInstantSnapshotsClient.insert", "method": { - "fullName": "google.cloud.compute.v1.RegionInstanceTemplates.Delete", + "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": "Delete" + "shortName": "Insert" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.DeleteRegionInstanceTemplateRequest" + "type": "google.cloud.compute_v1.types.InsertRegionInstantSnapshotRequest" }, { "name": "project", @@ -40429,8 +42005,8 @@ "type": "str" }, { - "name": "instance_template", - "type": "str" + "name": "instant_snapshot_resource", + "type": "google.cloud.compute_v1.types.InstantSnapshot" }, { "name": "retry", @@ -40446,21 +42022,21 @@ } ], "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "delete" + "shortName": "insert" }, - "description": "Sample for Delete", - "file": "compute_v1_generated_region_instance_templates_delete_sync.py", + "description": "Sample for Insert", + "file": "compute_v1_generated_region_instant_snapshots_insert_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionInstanceTemplates_Delete_sync", + "regionTag": "compute_v1_generated_RegionInstantSnapshots_Insert_sync", "segments": [ { - "end": 53, + "end": 52, "start": 27, "type": "FULL" }, { - "end": 53, + "end": 52, "start": 27, "type": "SHORT" }, @@ -40470,43 +42046,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_templates_delete_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.get", + "fullName": "google.cloud.compute_v1.RegionInstantSnapshotsClient.list", "method": { - "fullName": "google.cloud.compute.v1.RegionInstanceTemplates.Get", + "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": "Get" + "shortName": "List" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.GetRegionInstanceTemplateRequest" + "type": "google.cloud.compute_v1.types.ListRegionInstantSnapshotsRequest" }, { "name": "project", @@ -40516,10 +42092,6 @@ "name": "region", "type": "str" }, - { - "name": "instance_template", - "type": "str" - }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -40533,14 +42105,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.cloud.compute_v1.types.InstanceTemplate", - "shortName": "get" + "resultType": "google.cloud.compute_v1.services.region_instant_snapshots.pagers.ListPager", + "shortName": "list" }, - "description": "Sample for Get", - "file": "compute_v1_generated_region_instance_templates_get_sync.py", + "description": "Sample for List", + "file": "compute_v1_generated_region_instant_snapshots_list_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "compute_v1_generated_RegionInstanceTemplates_Get_sync", + "regionTag": "compute_v1_generated_RegionInstantSnapshots_List_sync", "segments": [ { "end": 53, @@ -40558,43 +42130,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_templates_get_sync.py" + "title": "compute_v1_generated_region_instant_snapshots_list_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.set_iam_policy", "method": { - "fullName": "google.cloud.compute.v1.RegionInstanceTemplates.Insert", + "fullName": "google.cloud.compute.v1.RegionInstantSnapshots.SetIamPolicy", "service": { - "fullName": "google.cloud.compute.v1.RegionInstanceTemplates", - "shortName": "RegionInstanceTemplates" + "fullName": "google.cloud.compute.v1.RegionInstantSnapshots", + "shortName": "RegionInstantSnapshots" }, - "shortName": "Insert" + "shortName": "SetIamPolicy" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.InsertRegionInstanceTemplateRequest" + "type": "google.cloud.compute_v1.types.SetIamPolicyRegionInstantSnapshotRequest" }, { "name": "project", @@ -40605,8 +42177,12 @@ "type": "str" }, { - "name": "instance_template_resource", - "type": "google.cloud.compute_v1.types.InstanceTemplate" + "name": "resource", + "type": "str" + }, + { + "name": "region_set_policy_request_resource", + "type": "google.cloud.compute_v1.types.RegionSetPolicyRequest" }, { "name": "retry", @@ -40621,22 +42197,22 @@ "type": "Sequence[Tuple[str, str]" } ], - "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_instance_templates_insert_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_RegionInstanceTemplates_Insert_sync", + "regionTag": "compute_v1_generated_RegionInstantSnapshots_SetIamPolicy_sync", "segments": [ { - "end": 52, + "end": 53, "start": 27, "type": "FULL" }, { - "end": 52, + "end": 53, "start": 27, "type": "SHORT" }, @@ -40646,43 +42222,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_instance_templates_insert_sync.py" + "title": "compute_v1_generated_region_instant_snapshots_set_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.list", + "fullName": "google.cloud.compute_v1.RegionInstantSnapshotsClient.set_labels", "method": { - "fullName": "google.cloud.compute.v1.RegionInstanceTemplates.List", + "fullName": "google.cloud.compute.v1.RegionInstantSnapshots.SetLabels", "service": { - "fullName": "google.cloud.compute.v1.RegionInstanceTemplates", - "shortName": "RegionInstanceTemplates" + "fullName": "google.cloud.compute.v1.RegionInstantSnapshots", + "shortName": "RegionInstantSnapshots" }, - "shortName": "List" + "shortName": "SetLabels" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.ListRegionInstanceTemplatesRequest" + "type": "google.cloud.compute_v1.types.SetLabelsRegionInstantSnapshotRequest" }, { "name": "project", @@ -40692,6 +42268,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" @@ -40705,14 +42289,14 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.cloud.compute_v1.services.region_instance_templates.pagers.ListPager", - "shortName": "list" + "resultType": "google.api_core.extended_operation.ExtendedOperation", + "shortName": "set_labels" }, - "description": "Sample for List", - "file": "compute_v1_generated_region_instance_templates_list_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_RegionInstanceTemplates_List_sync", + "regionTag": "compute_v1_generated_RegionInstantSnapshots_SetLabels_sync", "segments": [ { "end": 53, @@ -40730,43 +42314,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_instance_templates_list_sync.py" + "title": "compute_v1_generated_region_instant_snapshots_set_labels_sync.py" }, { "canonical": true, "clientMethod": { "client": { - "fullName": "google.cloud.compute_v1.RegionInstancesClient", - "shortName": "RegionInstancesClient" + "fullName": "google.cloud.compute_v1.RegionInstantSnapshotsClient", + "shortName": "RegionInstantSnapshotsClient" }, - "fullName": "google.cloud.compute_v1.RegionInstancesClient.bulk_insert", + "fullName": "google.cloud.compute_v1.RegionInstantSnapshotsClient.test_iam_permissions", "method": { - "fullName": "google.cloud.compute.v1.RegionInstances.BulkInsert", + "fullName": "google.cloud.compute.v1.RegionInstantSnapshots.TestIamPermissions", "service": { - "fullName": "google.cloud.compute.v1.RegionInstances", - "shortName": "RegionInstances" + "fullName": "google.cloud.compute.v1.RegionInstantSnapshots", + "shortName": "RegionInstantSnapshots" }, - "shortName": "BulkInsert" + "shortName": "TestIamPermissions" }, "parameters": [ { "name": "request", - "type": "google.cloud.compute_v1.types.BulkInsertRegionInstanceRequest" + "type": "google.cloud.compute_v1.types.TestIamPermissionsRegionInstantSnapshotRequest" }, { "name": "project", @@ -40777,8 +42361,12 @@ "type": "str" }, { - "name": "bulk_insert_instance_resource_resource", - "type": "google.cloud.compute_v1.types.BulkInsertInstanceResource" + "name": "resource", + "type": "str" + }, + { + "name": "test_permissions_request_resource", + "type": "google.cloud.compute_v1.types.TestPermissionsRequest" }, { "name": "retry", @@ -40793,22 +42381,22 @@ "type": "Sequence[Tuple[str, str]" } ], - "resultType": "google.api_core.extended_operation.ExtendedOperation", - "shortName": "bulk_insert" + "resultType": "google.cloud.compute_v1.types.TestPermissionsResponse", + "shortName": "test_iam_permissions" }, - "description": "Sample for BulkInsert", - "file": "compute_v1_generated_region_instances_bulk_insert_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_RegionInstances_BulkInsert_sync", + "regionTag": "compute_v1_generated_RegionInstantSnapshots_TestIamPermissions_sync", "segments": [ { - "end": 52, + "end": 53, "start": 27, "type": "FULL" }, { - "end": 52, + "end": 53, "start": 27, "type": "SHORT" }, @@ -40818,22 +42406,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_instances_bulk_insert_sync.py" + "title": "compute_v1_generated_region_instant_snapshots_test_iam_permissions_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 16da1fc79eef..95f5e409788b 100644 --- a/packages/google-cloud-compute/scripts/fixup_compute_v1_keywords.py +++ b/packages/google-cloud-compute/scripts/fixup_compute_v1_keywords.py @@ -131,6 +131,7 @@ class computeCallTransformer(cst.CSTTransformer): 'set_backend_service': ('project', 'target_ssl_proxies_set_backend_service_request_resource', 'target_ssl_proxy', 'request_id', ), 'set_backup': ('project', 'region', 'target_pool', 'target_reference_resource', 'failover_ratio', 'request_id', ), 'set_certificate_map': ('project', 'target_https_proxies_set_certificate_map_request_resource', 'target_https_proxy', 'request_id', ), + 'set_cloud_armor_tier': ('project', 'projects_set_cloud_armor_tier_request_resource', 'request_id', ), 'set_common_instance_metadata': ('metadata_resource', 'project', 'request_id', ), 'set_default_network_tier': ('project', 'projects_set_default_network_tier_request_resource', 'request_id', ), 'set_deletion_protection': ('project', 'resource', 'zone', 'deletion_protection', 'request_id', ), diff --git a/packages/google-cloud-compute/setup.py b/packages/google-cloud-compute/setup.py index e1c94199e81f..842a06af1508 100644 --- a/packages/google-cloud-compute/setup.py +++ b/packages/google-cloud-compute/setup.py @@ -40,7 +40,9 @@ dependencies = [ "google-api-core[grpc] >= 1.34.1, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*", - "google-auth >= 2.14.1, <3.0.0dev", + # Exclude incompatible versions of `google-auth` + # See https://github.com/googleapis/google-cloud-python/issues/12364 + "google-auth >= 2.14.1, <3.0.0dev,!=2.24.0,!=2.25.0", "proto-plus >= 1.22.3, <2.0.0dev", "protobuf>=3.19.5,<5.0.0dev,!=3.20.0,!=3.20.1,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5", ] 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 00577a93de11..82739903868f 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 @@ -3464,6 +3464,7 @@ def test_get_rest(request_type): security_policy="security_policy_value", self_link="self_link_value", service_bindings=["service_bindings_value"], + service_lb_policy="service_lb_policy_value", session_affinity="session_affinity_value", timeout_sec=1185, ) @@ -3504,6 +3505,7 @@ def test_get_rest(request_type): assert response.security_policy == "security_policy_value" assert response.self_link == "self_link_value" assert response.service_bindings == ["service_bindings_value"] + assert response.service_lb_policy == "service_lb_policy_value" assert response.session_affinity == "session_affinity_value" assert response.timeout_sec == 1185 @@ -4428,6 +4430,7 @@ def test_insert_rest(request_type): "max_rate_per_endpoint": 0.22310000000000002, "max_rate_per_instance": 0.22190000000000001, "max_utilization": 0.1633, + "preference": "preference_value", } ], "cdn_policy": { @@ -4569,6 +4572,7 @@ def test_insert_rest(request_type): }, "self_link": "self_link_value", "service_bindings": ["service_bindings_value1", "service_bindings_value2"], + "service_lb_policy": "service_lb_policy_value", "session_affinity": "session_affinity_value", "subsetting": {"policy": "policy_value"}, "timeout_sec": 1185, @@ -4983,6 +4987,7 @@ def test_insert_unary_rest(request_type): "max_rate_per_endpoint": 0.22310000000000002, "max_rate_per_instance": 0.22190000000000001, "max_utilization": 0.1633, + "preference": "preference_value", } ], "cdn_policy": { @@ -5124,6 +5129,7 @@ def test_insert_unary_rest(request_type): }, "self_link": "self_link_value", "service_bindings": ["service_bindings_value1", "service_bindings_value2"], + "service_lb_policy": "service_lb_policy_value", "session_affinity": "session_affinity_value", "subsetting": {"policy": "policy_value"}, "timeout_sec": 1185, @@ -6214,6 +6220,7 @@ def test_patch_rest(request_type): "max_rate_per_endpoint": 0.22310000000000002, "max_rate_per_instance": 0.22190000000000001, "max_utilization": 0.1633, + "preference": "preference_value", } ], "cdn_policy": { @@ -6355,6 +6362,7 @@ def test_patch_rest(request_type): }, "self_link": "self_link_value", "service_bindings": ["service_bindings_value1", "service_bindings_value2"], + "service_lb_policy": "service_lb_policy_value", "session_affinity": "session_affinity_value", "subsetting": {"policy": "policy_value"}, "timeout_sec": 1185, @@ -6776,6 +6784,7 @@ def test_patch_unary_rest(request_type): "max_rate_per_endpoint": 0.22310000000000002, "max_rate_per_instance": 0.22190000000000001, "max_utilization": 0.1633, + "preference": "preference_value", } ], "cdn_policy": { @@ -6917,6 +6926,7 @@ def test_patch_unary_rest(request_type): }, "self_link": "self_link_value", "service_bindings": ["service_bindings_value1", "service_bindings_value2"], + "service_lb_policy": "service_lb_policy_value", "session_affinity": "session_affinity_value", "subsetting": {"policy": "policy_value"}, "timeout_sec": 1185, @@ -9723,6 +9733,7 @@ def test_update_rest(request_type): "max_rate_per_endpoint": 0.22310000000000002, "max_rate_per_instance": 0.22190000000000001, "max_utilization": 0.1633, + "preference": "preference_value", } ], "cdn_policy": { @@ -9864,6 +9875,7 @@ def test_update_rest(request_type): }, "self_link": "self_link_value", "service_bindings": ["service_bindings_value1", "service_bindings_value2"], + "service_lb_policy": "service_lb_policy_value", "session_affinity": "session_affinity_value", "subsetting": {"policy": "policy_value"}, "timeout_sec": 1185, @@ -10285,6 +10297,7 @@ def test_update_unary_rest(request_type): "max_rate_per_endpoint": 0.22310000000000002, "max_rate_per_instance": 0.22190000000000001, "max_utilization": 0.1633, + "preference": "preference_value", } ], "cdn_policy": { @@ -10426,6 +10439,7 @@ def test_update_unary_rest(request_type): }, "self_link": "self_link_value", "service_bindings": ["service_bindings_value1", "service_bindings_value2"], + "service_lb_policy": "service_lb_policy_value", "session_affinity": "session_affinity_value", "subsetting": {"policy": "policy_value"}, "timeout_sec": 1185, 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 9d605f7e72ba..090d41684e09 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 @@ -2924,6 +2924,9 @@ def test_create_snapshot_rest(request_type): "source_disk_encryption_key": {}, "source_disk_for_recovery_checkpoint": "source_disk_for_recovery_checkpoint_value", "source_disk_id": "source_disk_id_value", + "source_instant_snapshot": "source_instant_snapshot_value", + "source_instant_snapshot_encryption_key": {}, + "source_instant_snapshot_id": "source_instant_snapshot_id_value", "source_snapshot_schedule_policy": "source_snapshot_schedule_policy_value", "source_snapshot_schedule_policy_id": "source_snapshot_schedule_policy_id_value", "status": "status_value", @@ -3374,6 +3377,9 @@ def test_create_snapshot_unary_rest(request_type): "source_disk_encryption_key": {}, "source_disk_for_recovery_checkpoint": "source_disk_for_recovery_checkpoint_value", "source_disk_id": "source_disk_id_value", + "source_instant_snapshot": "source_instant_snapshot_value", + "source_instant_snapshot_encryption_key": {}, + "source_instant_snapshot_id": "source_instant_snapshot_id_value", "source_snapshot_schedule_policy": "source_snapshot_schedule_policy_value", "source_snapshot_schedule_policy_id": "source_snapshot_schedule_policy_id_value", "status": "status_value", @@ -4430,6 +4436,8 @@ def test_get_rest(request_type): source_disk_id="source_disk_id_value", source_image="source_image_value", source_image_id="source_image_id_value", + source_instant_snapshot="source_instant_snapshot_value", + source_instant_snapshot_id="source_instant_snapshot_id_value", source_snapshot="source_snapshot_value", source_snapshot_id="source_snapshot_id_value", source_storage_object="source_storage_object_value", @@ -4488,6 +4496,8 @@ def test_get_rest(request_type): assert response.source_disk_id == "source_disk_id_value" assert response.source_image == "source_image_value" assert response.source_image_id == "source_image_id_value" + assert response.source_instant_snapshot == "source_instant_snapshot_value" + assert response.source_instant_snapshot_id == "source_instant_snapshot_id_value" assert response.source_snapshot == "source_snapshot_value" assert response.source_snapshot_id == "source_snapshot_id_value" assert response.source_storage_object == "source_storage_object_value" @@ -5099,6 +5109,8 @@ def test_insert_rest(request_type): "source_image": "source_image_value", "source_image_encryption_key": {}, "source_image_id": "source_image_id_value", + "source_instant_snapshot": "source_instant_snapshot_value", + "source_instant_snapshot_id": "source_instant_snapshot_id_value", "source_snapshot": "source_snapshot_value", "source_snapshot_encryption_key": {}, "source_snapshot_id": "source_snapshot_id_value", @@ -5559,6 +5571,8 @@ def test_insert_unary_rest(request_type): "source_image": "source_image_value", "source_image_encryption_key": {}, "source_image_id": "source_image_id_value", + "source_instant_snapshot": "source_instant_snapshot_value", + "source_instant_snapshot_id": "source_instant_snapshot_id_value", "source_snapshot": "source_snapshot_value", "source_snapshot_encryption_key": {}, "source_snapshot_id": "source_snapshot_id_value", @@ -11851,6 +11865,8 @@ def test_update_rest(request_type): "source_image": "source_image_value", "source_image_encryption_key": {}, "source_image_id": "source_image_id_value", + "source_instant_snapshot": "source_instant_snapshot_value", + "source_instant_snapshot_id": "source_instant_snapshot_id_value", "source_snapshot": "source_snapshot_value", "source_snapshot_encryption_key": {}, "source_snapshot_id": "source_snapshot_id_value", @@ -12320,6 +12336,8 @@ def test_update_unary_rest(request_type): "source_image": "source_image_value", "source_image_encryption_key": {}, "source_image_id": "source_image_id_value", + "source_instant_snapshot": "source_instant_snapshot_value", + "source_instant_snapshot_id": "source_instant_snapshot_id_value", "source_snapshot": "source_snapshot_value", "source_snapshot_encryption_key": {}, "source_snapshot_id": "source_snapshot_id_value", diff --git a/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_external_vpn_gateways.py b/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_external_vpn_gateways.py index 4f88f53d0c2a..3b42ba1c9d04 100644 --- a/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_external_vpn_gateways.py +++ b/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_external_vpn_gateways.py @@ -1939,7 +1939,13 @@ def test_insert_rest(request_type): "creation_timestamp": "creation_timestamp_value", "description": "description_value", "id": 205, - "interfaces": [{"id": 205, "ip_address": "ip_address_value"}], + "interfaces": [ + { + "id": 205, + "ip_address": "ip_address_value", + "ipv6_address": "ipv6_address_value", + } + ], "kind": "kind_value", "label_fingerprint": "label_fingerprint_value", "labels": {}, @@ -2350,7 +2356,13 @@ def test_insert_unary_rest(request_type): "creation_timestamp": "creation_timestamp_value", "description": "description_value", "id": 205, - "interfaces": [{"id": 205, "ip_address": "ip_address_value"}], + "interfaces": [ + { + "id": 205, + "ip_address": "ip_address_value", + "ipv6_address": "ipv6_address_value", + } + ], "kind": "kind_value", "label_fingerprint": "label_fingerprint_value", "labels": {}, diff --git a/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_instance_group_managers.py b/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_instance_group_managers.py index 936289629808..9c54eb09de48 100644 --- a/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_instance_group_managers.py +++ b/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_instance_group_managers.py @@ -6700,7 +6700,8 @@ def test_insert_rest(request_type): "id": 205, "instance_group": "instance_group_value", "instance_lifecycle_policy": { - "force_update_on_repair": "force_update_on_repair_value" + "default_action_on_failure": "default_action_on_failure_value", + "force_update_on_repair": "force_update_on_repair_value", }, "instance_template": "instance_template_value", "kind": "kind_value", @@ -7190,7 +7191,8 @@ def test_insert_unary_rest(request_type): "id": 205, "instance_group": "instance_group_value", "instance_lifecycle_policy": { - "force_update_on_repair": "force_update_on_repair_value" + "default_action_on_failure": "default_action_on_failure_value", + "force_update_on_repair": "force_update_on_repair_value", }, "instance_template": "instance_template_value", "kind": "kind_value", @@ -9184,7 +9186,8 @@ def test_patch_rest(request_type): "id": 205, "instance_group": "instance_group_value", "instance_lifecycle_policy": { - "force_update_on_repair": "force_update_on_repair_value" + "default_action_on_failure": "default_action_on_failure_value", + "force_update_on_repair": "force_update_on_repair_value", }, "instance_template": "instance_template_value", "kind": "kind_value", @@ -9693,7 +9696,8 @@ def test_patch_unary_rest(request_type): "id": 205, "instance_group": "instance_group_value", "instance_lifecycle_policy": { - "force_update_on_repair": "force_update_on_repair_value" + "default_action_on_failure": "default_action_on_failure_value", + "force_update_on_repair": "force_update_on_repair_value", }, "instance_template": "instance_template_value", "kind": "kind_value", diff --git a/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_instant_snapshots.py b/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_instant_snapshots.py new file mode 100644 index 000000000000..fc2871c3f617 --- /dev/null +++ b/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_instant_snapshots.py @@ -0,0 +1,5945 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 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 Iterable +import json +import math + +from google.api_core import ( + future, + gapic_v1, + grpc_helpers, + grpc_helpers_async, + path_template, +) +from google.api_core import api_core_version, client_options +from google.api_core import exceptions as core_exceptions +from google.api_core import extended_operation # type: ignore +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.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 + +from google.cloud.compute_v1.services.instant_snapshots import ( + InstantSnapshotsClient, + pagers, + transports, +) +from google.cloud.compute_v1.types import compute + + +def client_cert_source_callback(): + return b"cert bytes", b"key bytes" + + +# 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 InstantSnapshotsClient._get_default_mtls_endpoint(None) is None + assert ( + InstantSnapshotsClient._get_default_mtls_endpoint(api_endpoint) + == api_mtls_endpoint + ) + assert ( + InstantSnapshotsClient._get_default_mtls_endpoint(api_mtls_endpoint) + == api_mtls_endpoint + ) + assert ( + InstantSnapshotsClient._get_default_mtls_endpoint(sandbox_endpoint) + == sandbox_mtls_endpoint + ) + assert ( + InstantSnapshotsClient._get_default_mtls_endpoint(sandbox_mtls_endpoint) + == sandbox_mtls_endpoint + ) + assert ( + InstantSnapshotsClient._get_default_mtls_endpoint(non_googleapi) + == non_googleapi + ) + + +def test__read_environment_variables(): + assert InstantSnapshotsClient._read_environment_variables() == (False, "auto", None) + + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "true"}): + assert InstantSnapshotsClient._read_environment_variables() == ( + True, + "auto", + None, + ) + + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "false"}): + assert InstantSnapshotsClient._read_environment_variables() == ( + False, + "auto", + None, + ) + + with mock.patch.dict( + os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "Unsupported"} + ): + with pytest.raises(ValueError) as excinfo: + InstantSnapshotsClient._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 InstantSnapshotsClient._read_environment_variables() == ( + False, + "never", + None, + ) + + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}): + assert InstantSnapshotsClient._read_environment_variables() == ( + False, + "always", + None, + ) + + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "auto"}): + assert InstantSnapshotsClient._read_environment_variables() == ( + False, + "auto", + None, + ) + + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "Unsupported"}): + with pytest.raises(MutualTLSChannelError) as excinfo: + InstantSnapshotsClient._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 InstantSnapshotsClient._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 InstantSnapshotsClient._get_client_cert_source(None, False) is None + assert ( + InstantSnapshotsClient._get_client_cert_source(mock_provided_cert_source, False) + is None + ) + assert ( + InstantSnapshotsClient._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 ( + InstantSnapshotsClient._get_client_cert_source(None, True) + is mock_default_cert_source + ) + assert ( + InstantSnapshotsClient._get_client_cert_source( + mock_provided_cert_source, "true" + ) + is mock_provided_cert_source + ) + + +@mock.patch.object( + InstantSnapshotsClient, + "_DEFAULT_ENDPOINT_TEMPLATE", + modify_default_endpoint_template(InstantSnapshotsClient), +) +def test__get_api_endpoint(): + api_override = "foo.com" + mock_client_cert_source = mock.Mock() + default_universe = InstantSnapshotsClient._DEFAULT_UNIVERSE + default_endpoint = InstantSnapshotsClient._DEFAULT_ENDPOINT_TEMPLATE.format( + UNIVERSE_DOMAIN=default_universe + ) + mock_universe = "bar.com" + mock_endpoint = InstantSnapshotsClient._DEFAULT_ENDPOINT_TEMPLATE.format( + UNIVERSE_DOMAIN=mock_universe + ) + + assert ( + InstantSnapshotsClient._get_api_endpoint( + api_override, mock_client_cert_source, default_universe, "always" + ) + == api_override + ) + assert ( + InstantSnapshotsClient._get_api_endpoint( + None, mock_client_cert_source, default_universe, "auto" + ) + == InstantSnapshotsClient.DEFAULT_MTLS_ENDPOINT + ) + assert ( + InstantSnapshotsClient._get_api_endpoint(None, None, default_universe, "auto") + == default_endpoint + ) + assert ( + InstantSnapshotsClient._get_api_endpoint(None, None, default_universe, "always") + == InstantSnapshotsClient.DEFAULT_MTLS_ENDPOINT + ) + assert ( + InstantSnapshotsClient._get_api_endpoint( + None, mock_client_cert_source, default_universe, "always" + ) + == InstantSnapshotsClient.DEFAULT_MTLS_ENDPOINT + ) + assert ( + InstantSnapshotsClient._get_api_endpoint(None, None, mock_universe, "never") + == mock_endpoint + ) + assert ( + InstantSnapshotsClient._get_api_endpoint(None, None, default_universe, "never") + == default_endpoint + ) + + with pytest.raises(MutualTLSChannelError) as excinfo: + InstantSnapshotsClient._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 ( + InstantSnapshotsClient._get_universe_domain( + client_universe_domain, universe_domain_env + ) + == client_universe_domain + ) + assert ( + InstantSnapshotsClient._get_universe_domain(None, universe_domain_env) + == universe_domain_env + ) + assert ( + InstantSnapshotsClient._get_universe_domain(None, None) + == InstantSnapshotsClient._DEFAULT_UNIVERSE + ) + + with pytest.raises(ValueError) as excinfo: + InstantSnapshotsClient._get_universe_domain("", None) + assert str(excinfo.value) == "Universe Domain cannot be an empty string." + + +@pytest.mark.parametrize( + "client_class,transport_class,transport_name", + [ + (InstantSnapshotsClient, transports.InstantSnapshotsRestTransport, "rest"), + ], +) +def test__validate_universe_domain(client_class, transport_class, transport_name): + client = client_class( + transport=transport_class(credentials=ga_credentials.AnonymousCredentials()) + ) + assert client._validate_universe_domain() == True + + # Test the case when universe is already validated. + assert client._validate_universe_domain() == True + + if transport_name == "grpc": + # Test the case where credentials are provided by the + # `local_channel_credentials`. The default universes in both match. + channel = grpc.secure_channel( + "http://localhost/", grpc.local_channel_credentials() + ) + client = client_class(transport=transport_class(channel=channel)) + assert client._validate_universe_domain() == True + + # Test the case where credentials do not exist: e.g. a transport is provided + # with no credentials. Validation should still succeed because there is no + # mismatch with non-existent credentials. + channel = grpc.secure_channel( + "http://localhost/", grpc.local_channel_credentials() + ) + transport = transport_class(channel=channel) + transport._credentials = None + client = client_class(transport=transport) + assert client._validate_universe_domain() == True + + # TODO: This is needed to cater for older versions of google-auth + # Make this test unconditional once the minimum supported version of + # google-auth becomes 2.23.0 or higher. + google_auth_major, google_auth_minor = [ + int(part) for part in google.auth.__version__.split(".")[0:2] + ] + if google_auth_major > 2 or (google_auth_major == 2 and google_auth_minor >= 23): + credentials = ga_credentials.AnonymousCredentials() + credentials._universe_domain = "foo.com" + # Test the case when there is a universe mismatch from the credentials. + client = client_class(transport=transport_class(credentials=credentials)) + with pytest.raises(ValueError) as excinfo: + client._validate_universe_domain() + assert ( + str(excinfo.value) + == "The configured universe domain (googleapis.com) does not match the universe domain found in the credentials (foo.com). If you haven't configured the universe domain explicitly, `googleapis.com` is the default." + ) + + # Test the case when there is a universe mismatch from the client. + # + # TODO: Make this test unconditional once the minimum supported version of + # google-api-core becomes 2.15.0 or higher. + api_core_major, api_core_minor = [ + int(part) for part in api_core_version.__version__.split(".")[0:2] + ] + if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15): + client = client_class( + client_options={"universe_domain": "bar.com"}, + transport=transport_class( + credentials=ga_credentials.AnonymousCredentials(), + ), + ) + with pytest.raises(ValueError) as excinfo: + client._validate_universe_domain() + assert ( + str(excinfo.value) + == "The configured universe domain (bar.com) does not match the universe domain found in the credentials (googleapis.com). If you haven't configured the universe domain explicitly, `googleapis.com` is the default." + ) + + # Test that ValueError is raised if universe_domain is provided via client options and credentials is None + with pytest.raises(ValueError): + client._compare_universes("foo.bar", None) + + +@pytest.mark.parametrize( + "client_class,transport_name", + [ + (InstantSnapshotsClient, "rest"), + ], +) +def test_instant_snapshots_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.InstantSnapshotsRestTransport, "rest"), + ], +) +def test_instant_snapshots_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", + [ + (InstantSnapshotsClient, "rest"), + ], +) +def test_instant_snapshots_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_instant_snapshots_client_get_transport_class(): + transport = InstantSnapshotsClient.get_transport_class() + available_transports = [ + transports.InstantSnapshotsRestTransport, + ] + assert transport in available_transports + + transport = InstantSnapshotsClient.get_transport_class("rest") + assert transport == transports.InstantSnapshotsRestTransport + + +@pytest.mark.parametrize( + "client_class,transport_class,transport_name", + [ + (InstantSnapshotsClient, transports.InstantSnapshotsRestTransport, "rest"), + ], +) +@mock.patch.object( + InstantSnapshotsClient, + "_DEFAULT_ENDPOINT_TEMPLATE", + modify_default_endpoint_template(InstantSnapshotsClient), +) +def test_instant_snapshots_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(InstantSnapshotsClient, "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(InstantSnapshotsClient, "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", + [ + ( + InstantSnapshotsClient, + transports.InstantSnapshotsRestTransport, + "rest", + "true", + ), + ( + InstantSnapshotsClient, + transports.InstantSnapshotsRestTransport, + "rest", + "false", + ), + ], +) +@mock.patch.object( + InstantSnapshotsClient, + "_DEFAULT_ENDPOINT_TEMPLATE", + modify_default_endpoint_template(InstantSnapshotsClient), +) +@mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "auto"}) +def test_instant_snapshots_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", [InstantSnapshotsClient]) +@mock.patch.object( + InstantSnapshotsClient, + "DEFAULT_ENDPOINT", + modify_default_endpoint(InstantSnapshotsClient), +) +def test_instant_snapshots_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", [InstantSnapshotsClient]) +@mock.patch.object( + InstantSnapshotsClient, + "_DEFAULT_ENDPOINT_TEMPLATE", + modify_default_endpoint_template(InstantSnapshotsClient), +) +def test_instant_snapshots_client_client_api_endpoint(client_class): + mock_client_cert_source = client_cert_source_callback + api_override = "foo.com" + default_universe = InstantSnapshotsClient._DEFAULT_UNIVERSE + default_endpoint = InstantSnapshotsClient._DEFAULT_ENDPOINT_TEMPLATE.format( + UNIVERSE_DOMAIN=default_universe + ) + mock_universe = "bar.com" + mock_endpoint = InstantSnapshotsClient._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", + [ + (InstantSnapshotsClient, transports.InstantSnapshotsRestTransport, "rest"), + ], +) +def test_instant_snapshots_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", + [ + ( + InstantSnapshotsClient, + transports.InstantSnapshotsRestTransport, + "rest", + None, + ), + ], +) +def test_instant_snapshots_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, + ) + + +@pytest.mark.parametrize( + "request_type", + [ + compute.AggregatedListInstantSnapshotsRequest, + dict, + ], +) +def test_aggregated_list_rest(request_type): + client = InstantSnapshotsClient( + 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.InstantSnapshotAggregatedList( + 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 = Response() + response_value.status_code = 200 + # Convert return value to protobuf type + return_value = compute.InstantSnapshotAggregatedList.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 + response = client.aggregated_list(request) + + # Establish that the response is the type that we expect. + assert isinstance(response, pagers.AggregatedListPager) + 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"] + + +def test_aggregated_list_rest_required_fields( + request_type=compute.AggregatedListInstantSnapshotsRequest, +): + transport_class = transports.InstantSnapshotsRestTransport + + 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() + ).aggregated_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() + ).aggregated_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", + "include_all_scopes", + "max_results", + "order_by", + "page_token", + "return_partial_success", + "service_project_number", + ) + ) + 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 = InstantSnapshotsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + request = request_type(**request_init) + + # Designate an appropriate value for the returned response. + return_value = compute.InstantSnapshotAggregatedList() + # 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.InstantSnapshotAggregatedList.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 + + response = client.aggregated_list(request) + + expected_params = [] + actual_params = req.call_args.kwargs["params"] + assert expected_params == actual_params + + +def test_aggregated_list_rest_unset_required_fields(): + transport = transports.InstantSnapshotsRestTransport( + credentials=ga_credentials.AnonymousCredentials + ) + + unset_fields = transport.aggregated_list._get_unset_required_fields({}) + assert set(unset_fields) == ( + set( + ( + "filter", + "includeAllScopes", + "maxResults", + "orderBy", + "pageToken", + "returnPartialSuccess", + "serviceProjectNumber", + ) + ) + & set(("project",)) + ) + + +@pytest.mark.parametrize("null_interceptor", [True, False]) +def test_aggregated_list_rest_interceptors(null_interceptor): + transport = transports.InstantSnapshotsRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + interceptor=None + if null_interceptor + else transports.InstantSnapshotsRestInterceptor(), + ) + client = InstantSnapshotsClient(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.InstantSnapshotsRestInterceptor, "post_aggregated_list" + ) as post, mock.patch.object( + transports.InstantSnapshotsRestInterceptor, "pre_aggregated_list" + ) as pre: + pre.assert_not_called() + post.assert_not_called() + pb_message = compute.AggregatedListInstantSnapshotsRequest.pb( + compute.AggregatedListInstantSnapshotsRequest() + ) + transcode.return_value = { + "method": "post", + "uri": "my_uri", + "body": pb_message, + "query_params": pb_message, + } + + req.return_value = Response() + req.return_value.status_code = 200 + req.return_value.request = PreparedRequest() + req.return_value._content = compute.InstantSnapshotAggregatedList.to_json( + compute.InstantSnapshotAggregatedList() + ) + + request = compute.AggregatedListInstantSnapshotsRequest() + metadata = [ + ("key", "val"), + ("cephalopod", "squid"), + ] + pre.return_value = request, metadata + post.return_value = compute.InstantSnapshotAggregatedList() + + client.aggregated_list( + request, + metadata=[ + ("key", "val"), + ("cephalopod", "squid"), + ], + ) + + pre.assert_called_once() + post.assert_called_once() + + +def test_aggregated_list_rest_bad_request( + transport: str = "rest", request_type=compute.AggregatedListInstantSnapshotsRequest +): + client = InstantSnapshotsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # 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 = Response() + response_value.status_code = 400 + response_value.request = Request() + req.return_value = response_value + client.aggregated_list(request) + + +def test_aggregated_list_rest_flattened(): + client = InstantSnapshotsClient( + 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.InstantSnapshotAggregatedList() + + # 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.InstantSnapshotAggregatedList.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 + + client.aggregated_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}/aggregated/instantSnapshots" + % client.transport._host, + args[1], + ) + + +def test_aggregated_list_rest_flattened_error(transport: str = "rest"): + client = InstantSnapshotsClient( + 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.aggregated_list( + compute.AggregatedListInstantSnapshotsRequest(), + project="project_value", + ) + + +def test_aggregated_list_rest_pager(transport: str = "rest"): + client = InstantSnapshotsClient( + 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.InstantSnapshotAggregatedList( + items={ + "a": compute.InstantSnapshotsScopedList(), + "b": compute.InstantSnapshotsScopedList(), + "c": compute.InstantSnapshotsScopedList(), + }, + next_page_token="abc", + ), + compute.InstantSnapshotAggregatedList( + items={}, + next_page_token="def", + ), + compute.InstantSnapshotAggregatedList( + items={ + "g": compute.InstantSnapshotsScopedList(), + }, + next_page_token="ghi", + ), + compute.InstantSnapshotAggregatedList( + items={ + "h": compute.InstantSnapshotsScopedList(), + "i": compute.InstantSnapshotsScopedList(), + }, + ), + ) + # Two responses for two calls + response = response + response + + # Wrap the values into proper Response objs + response = tuple( + compute.InstantSnapshotAggregatedList.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.aggregated_list(request=sample_request) + + assert isinstance(pager.get("a"), compute.InstantSnapshotsScopedList) + assert pager.get("h") is None + + results = list(pager) + assert len(results) == 6 + assert all(isinstance(i, tuple) for i in results) + for result in results: + assert isinstance(result, tuple) + assert tuple(type(t) for t in result) == ( + str, + compute.InstantSnapshotsScopedList, + ) + + assert pager.get("a") is None + assert isinstance(pager.get("h"), compute.InstantSnapshotsScopedList) + + pages = list(client.aggregated_list(request=sample_request).pages) + for page_, token in zip(pages, ["abc", "def", "ghi", ""]): + assert page_.raw_page.next_page_token == token + + +@pytest.mark.parametrize( + "request_type", + [ + compute.DeleteInstantSnapshotRequest, + dict, + ], +) +def test_delete_rest(request_type): + client = InstantSnapshotsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # send a request that will satisfy transcoding + request_init = { + "project": "sample1", + "zone": "sample2", + "instant_snapshot": "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.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 = 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 + 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" + + +def test_delete_rest_required_fields(request_type=compute.DeleteInstantSnapshotRequest): + transport_class = transports.InstantSnapshotsRestTransport + + request_init = {} + request_init["instant_snapshot"] = "" + 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() + ).delete._get_unset_required_fields(jsonified_request) + jsonified_request.update(unset_fields) + + # verify required fields with default values are now present + + jsonified_request["instantSnapshot"] = "instant_snapshot_value" + jsonified_request["project"] = "project_value" + jsonified_request["zone"] = "zone_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 "instantSnapshot" in jsonified_request + assert jsonified_request["instantSnapshot"] == "instant_snapshot_value" + assert "project" in jsonified_request + assert jsonified_request["project"] == "project_value" + assert "zone" in jsonified_request + assert jsonified_request["zone"] == "zone_value" + + client = InstantSnapshotsClient( + 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 + + 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.InstantSnapshotsRestTransport( + credentials=ga_credentials.AnonymousCredentials + ) + + unset_fields = transport.delete._get_unset_required_fields({}) + assert set(unset_fields) == ( + set(("requestId",)) + & set( + ( + "instantSnapshot", + "project", + "zone", + ) + ) + ) + + +@pytest.mark.parametrize("null_interceptor", [True, False]) +def test_delete_rest_interceptors(null_interceptor): + transport = transports.InstantSnapshotsRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + interceptor=None + if null_interceptor + else transports.InstantSnapshotsRestInterceptor(), + ) + client = InstantSnapshotsClient(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.InstantSnapshotsRestInterceptor, "post_delete" + ) as post, mock.patch.object( + transports.InstantSnapshotsRestInterceptor, "pre_delete" + ) as pre: + pre.assert_not_called() + post.assert_not_called() + pb_message = compute.DeleteInstantSnapshotRequest.pb( + compute.DeleteInstantSnapshotRequest() + ) + transcode.return_value = { + "method": "post", + "uri": "my_uri", + "body": pb_message, + "query_params": pb_message, + } + + req.return_value = Response() + req.return_value.status_code = 200 + req.return_value.request = PreparedRequest() + req.return_value._content = compute.Operation.to_json(compute.Operation()) + + request = compute.DeleteInstantSnapshotRequest() + metadata = [ + ("key", "val"), + ("cephalopod", "squid"), + ] + pre.return_value = request, metadata + post.return_value = compute.Operation() + + client.delete( + request, + metadata=[ + ("key", "val"), + ("cephalopod", "squid"), + ], + ) + + pre.assert_called_once() + post.assert_called_once() + + +def test_delete_rest_bad_request( + transport: str = "rest", request_type=compute.DeleteInstantSnapshotRequest +): + client = InstantSnapshotsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # send a request that will satisfy transcoding + request_init = { + "project": "sample1", + "zone": "sample2", + "instant_snapshot": "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 = Response() + response_value.status_code = 400 + response_value.request = Request() + req.return_value = response_value + client.delete(request) + + +def test_delete_rest_flattened(): + client = InstantSnapshotsClient( + 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", + "instant_snapshot": "sample3", + } + + # get truthy value for each flattened field + mock_args = dict( + project="project_value", + zone="zone_value", + instant_snapshot="instant_snapshot_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 + + 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}/zones/{zone}/instantSnapshots/{instant_snapshot}" + % client.transport._host, + args[1], + ) + + +def test_delete_rest_flattened_error(transport: str = "rest"): + client = InstantSnapshotsClient( + 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.DeleteInstantSnapshotRequest(), + project="project_value", + zone="zone_value", + instant_snapshot="instant_snapshot_value", + ) + + +def test_delete_rest_error(): + client = InstantSnapshotsClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + + +@pytest.mark.parametrize( + "request_type", + [ + compute.DeleteInstantSnapshotRequest, + dict, + ], +) +def test_delete_unary_rest(request_type): + client = InstantSnapshotsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # send a request that will satisfy transcoding + request_init = { + "project": "sample1", + "zone": "sample2", + "instant_snapshot": "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.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 = 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 + response = client.delete_unary(request) + + # Establish that the response is the type that we expect. + assert isinstance(response, compute.Operation) + + +def test_delete_unary_rest_required_fields( + request_type=compute.DeleteInstantSnapshotRequest, +): + transport_class = transports.InstantSnapshotsRestTransport + + request_init = {} + request_init["instant_snapshot"] = "" + 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() + ).delete._get_unset_required_fields(jsonified_request) + jsonified_request.update(unset_fields) + + # verify required fields with default values are now present + + jsonified_request["instantSnapshot"] = "instant_snapshot_value" + jsonified_request["project"] = "project_value" + jsonified_request["zone"] = "zone_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 "instantSnapshot" in jsonified_request + assert jsonified_request["instantSnapshot"] == "instant_snapshot_value" + assert "project" in jsonified_request + assert jsonified_request["project"] == "project_value" + assert "zone" in jsonified_request + assert jsonified_request["zone"] == "zone_value" + + client = InstantSnapshotsClient( + 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 + + 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.InstantSnapshotsRestTransport( + credentials=ga_credentials.AnonymousCredentials + ) + + unset_fields = transport.delete._get_unset_required_fields({}) + assert set(unset_fields) == ( + set(("requestId",)) + & set( + ( + "instantSnapshot", + "project", + "zone", + ) + ) + ) + + +@pytest.mark.parametrize("null_interceptor", [True, False]) +def test_delete_unary_rest_interceptors(null_interceptor): + transport = transports.InstantSnapshotsRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + interceptor=None + if null_interceptor + else transports.InstantSnapshotsRestInterceptor(), + ) + client = InstantSnapshotsClient(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.InstantSnapshotsRestInterceptor, "post_delete" + ) as post, mock.patch.object( + transports.InstantSnapshotsRestInterceptor, "pre_delete" + ) as pre: + pre.assert_not_called() + post.assert_not_called() + pb_message = compute.DeleteInstantSnapshotRequest.pb( + compute.DeleteInstantSnapshotRequest() + ) + transcode.return_value = { + "method": "post", + "uri": "my_uri", + "body": pb_message, + "query_params": pb_message, + } + + req.return_value = Response() + req.return_value.status_code = 200 + req.return_value.request = PreparedRequest() + req.return_value._content = compute.Operation.to_json(compute.Operation()) + + request = compute.DeleteInstantSnapshotRequest() + metadata = [ + ("key", "val"), + ("cephalopod", "squid"), + ] + pre.return_value = request, metadata + post.return_value = compute.Operation() + + client.delete_unary( + request, + metadata=[ + ("key", "val"), + ("cephalopod", "squid"), + ], + ) + + pre.assert_called_once() + post.assert_called_once() + + +def test_delete_unary_rest_bad_request( + transport: str = "rest", request_type=compute.DeleteInstantSnapshotRequest +): + client = InstantSnapshotsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # send a request that will satisfy transcoding + request_init = { + "project": "sample1", + "zone": "sample2", + "instant_snapshot": "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 = Response() + response_value.status_code = 400 + response_value.request = Request() + req.return_value = response_value + client.delete_unary(request) + + +def test_delete_unary_rest_flattened(): + client = InstantSnapshotsClient( + 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", + "instant_snapshot": "sample3", + } + + # get truthy value for each flattened field + mock_args = dict( + project="project_value", + zone="zone_value", + instant_snapshot="instant_snapshot_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 + + 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}/zones/{zone}/instantSnapshots/{instant_snapshot}" + % client.transport._host, + args[1], + ) + + +def test_delete_unary_rest_flattened_error(transport: str = "rest"): + client = InstantSnapshotsClient( + 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.DeleteInstantSnapshotRequest(), + project="project_value", + zone="zone_value", + instant_snapshot="instant_snapshot_value", + ) + + +def test_delete_unary_rest_error(): + client = InstantSnapshotsClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + + +@pytest.mark.parametrize( + "request_type", + [ + compute.GetInstantSnapshotRequest, + dict, + ], +) +def test_get_rest(request_type): + client = InstantSnapshotsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # send a request that will satisfy transcoding + request_init = { + "project": "sample1", + "zone": "sample2", + "instant_snapshot": "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.InstantSnapshot( + architecture="architecture_value", + creation_timestamp="creation_timestamp_value", + description="description_value", + disk_size_gb=1261, + id=205, + kind="kind_value", + label_fingerprint="label_fingerprint_value", + name="name_value", + region="region_value", + satisfies_pzi=True, + satisfies_pzs=True, + self_link="self_link_value", + self_link_with_id="self_link_with_id_value", + source_disk="source_disk_value", + source_disk_id="source_disk_id_value", + status="status_value", + zone="zone_value", + ) + + # 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.InstantSnapshot.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 + response = client.get(request) + + # Establish that the response is the type that we expect. + assert isinstance(response, compute.InstantSnapshot) + assert response.architecture == "architecture_value" + assert response.creation_timestamp == "creation_timestamp_value" + assert response.description == "description_value" + assert response.disk_size_gb == 1261 + assert response.id == 205 + assert response.kind == "kind_value" + assert response.label_fingerprint == "label_fingerprint_value" + assert response.name == "name_value" + assert response.region == "region_value" + assert response.satisfies_pzi is True + assert response.satisfies_pzs is True + assert response.self_link == "self_link_value" + assert response.self_link_with_id == "self_link_with_id_value" + assert response.source_disk == "source_disk_value" + assert response.source_disk_id == "source_disk_id_value" + assert response.status == "status_value" + assert response.zone == "zone_value" + + +def test_get_rest_required_fields(request_type=compute.GetInstantSnapshotRequest): + transport_class = transports.InstantSnapshotsRestTransport + + request_init = {} + request_init["instant_snapshot"] = "" + 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() + ).get._get_unset_required_fields(jsonified_request) + jsonified_request.update(unset_fields) + + # verify required fields with default values are now present + + jsonified_request["instantSnapshot"] = "instant_snapshot_value" + jsonified_request["project"] = "project_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 "instantSnapshot" in jsonified_request + assert jsonified_request["instantSnapshot"] == "instant_snapshot_value" + assert "project" in jsonified_request + assert jsonified_request["project"] == "project_value" + assert "zone" in jsonified_request + assert jsonified_request["zone"] == "zone_value" + + client = InstantSnapshotsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + request = request_type(**request_init) + + # Designate an appropriate value for the returned response. + return_value = compute.InstantSnapshot() + # 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.InstantSnapshot.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 + + 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.InstantSnapshotsRestTransport( + credentials=ga_credentials.AnonymousCredentials + ) + + unset_fields = transport.get._get_unset_required_fields({}) + assert set(unset_fields) == ( + set(()) + & set( + ( + "instantSnapshot", + "project", + "zone", + ) + ) + ) + + +@pytest.mark.parametrize("null_interceptor", [True, False]) +def test_get_rest_interceptors(null_interceptor): + transport = transports.InstantSnapshotsRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + interceptor=None + if null_interceptor + else transports.InstantSnapshotsRestInterceptor(), + ) + client = InstantSnapshotsClient(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.InstantSnapshotsRestInterceptor, "post_get" + ) as post, mock.patch.object( + transports.InstantSnapshotsRestInterceptor, "pre_get" + ) as pre: + pre.assert_not_called() + post.assert_not_called() + pb_message = compute.GetInstantSnapshotRequest.pb( + compute.GetInstantSnapshotRequest() + ) + transcode.return_value = { + "method": "post", + "uri": "my_uri", + "body": pb_message, + "query_params": pb_message, + } + + req.return_value = Response() + req.return_value.status_code = 200 + req.return_value.request = PreparedRequest() + req.return_value._content = compute.InstantSnapshot.to_json( + compute.InstantSnapshot() + ) + + request = compute.GetInstantSnapshotRequest() + metadata = [ + ("key", "val"), + ("cephalopod", "squid"), + ] + pre.return_value = request, metadata + post.return_value = compute.InstantSnapshot() + + client.get( + request, + metadata=[ + ("key", "val"), + ("cephalopod", "squid"), + ], + ) + + pre.assert_called_once() + post.assert_called_once() + + +def test_get_rest_bad_request( + transport: str = "rest", request_type=compute.GetInstantSnapshotRequest +): + client = InstantSnapshotsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # send a request that will satisfy transcoding + request_init = { + "project": "sample1", + "zone": "sample2", + "instant_snapshot": "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 = Response() + response_value.status_code = 400 + response_value.request = Request() + req.return_value = response_value + client.get(request) + + +def test_get_rest_flattened(): + client = InstantSnapshotsClient( + 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.InstantSnapshot() + + # get arguments that satisfy an http rule for this method + sample_request = { + "project": "sample1", + "zone": "sample2", + "instant_snapshot": "sample3", + } + + # get truthy value for each flattened field + mock_args = dict( + project="project_value", + zone="zone_value", + instant_snapshot="instant_snapshot_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.InstantSnapshot.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 + + 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}/instantSnapshots/{instant_snapshot}" + % client.transport._host, + args[1], + ) + + +def test_get_rest_flattened_error(transport: str = "rest"): + client = InstantSnapshotsClient( + 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.GetInstantSnapshotRequest(), + project="project_value", + zone="zone_value", + instant_snapshot="instant_snapshot_value", + ) + + +def test_get_rest_error(): + client = InstantSnapshotsClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + + +@pytest.mark.parametrize( + "request_type", + [ + compute.GetIamPolicyInstantSnapshotRequest, + dict, + ], +) +def test_get_iam_policy_rest(request_type): + client = InstantSnapshotsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # send a request that will satisfy transcoding + request_init = {"project": "sample1", "zone": "sample2", "resource": "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.Policy( + etag="etag_value", + iam_owned=True, + version=774, + ) + + # 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 + 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 + + +def test_get_iam_policy_rest_required_fields( + request_type=compute.GetIamPolicyInstantSnapshotRequest, +): + transport_class = transports.InstantSnapshotsRestTransport + + request_init = {} + request_init["project"] = "" + request_init["resource"] = "" + 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_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" + jsonified_request["zone"] = "zone_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" + assert "zone" in jsonified_request + assert jsonified_request["zone"] == "zone_value" + + client = InstantSnapshotsClient( + 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 + + 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.InstantSnapshotsRestTransport( + credentials=ga_credentials.AnonymousCredentials + ) + + unset_fields = transport.get_iam_policy._get_unset_required_fields({}) + assert set(unset_fields) == ( + set(("optionsRequestedPolicyVersion",)) + & set( + ( + "project", + "resource", + "zone", + ) + ) + ) + + +@pytest.mark.parametrize("null_interceptor", [True, False]) +def test_get_iam_policy_rest_interceptors(null_interceptor): + transport = transports.InstantSnapshotsRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + interceptor=None + if null_interceptor + else transports.InstantSnapshotsRestInterceptor(), + ) + client = InstantSnapshotsClient(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.InstantSnapshotsRestInterceptor, "post_get_iam_policy" + ) as post, mock.patch.object( + transports.InstantSnapshotsRestInterceptor, "pre_get_iam_policy" + ) as pre: + pre.assert_not_called() + post.assert_not_called() + pb_message = compute.GetIamPolicyInstantSnapshotRequest.pb( + compute.GetIamPolicyInstantSnapshotRequest() + ) + transcode.return_value = { + "method": "post", + "uri": "my_uri", + "body": pb_message, + "query_params": pb_message, + } + + req.return_value = Response() + req.return_value.status_code = 200 + req.return_value.request = PreparedRequest() + req.return_value._content = compute.Policy.to_json(compute.Policy()) + + request = compute.GetIamPolicyInstantSnapshotRequest() + metadata = [ + ("key", "val"), + ("cephalopod", "squid"), + ] + pre.return_value = request, metadata + post.return_value = compute.Policy() + + client.get_iam_policy( + request, + metadata=[ + ("key", "val"), + ("cephalopod", "squid"), + ], + ) + + pre.assert_called_once() + post.assert_called_once() + + +def test_get_iam_policy_rest_bad_request( + transport: str = "rest", request_type=compute.GetIamPolicyInstantSnapshotRequest +): + client = InstantSnapshotsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # send a request that will satisfy transcoding + request_init = {"project": "sample1", "zone": "sample2", "resource": "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 = Response() + response_value.status_code = 400 + response_value.request = Request() + req.return_value = response_value + client.get_iam_policy(request) + + +def test_get_iam_policy_rest_flattened(): + client = InstantSnapshotsClient( + 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", + "zone": "sample2", + "resource": "sample3", + } + + # get truthy value for each flattened field + mock_args = dict( + project="project_value", + zone="zone_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 + + 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}/zones/{zone}/instantSnapshots/{resource}/getIamPolicy" + % client.transport._host, + args[1], + ) + + +def test_get_iam_policy_rest_flattened_error(transport: str = "rest"): + client = InstantSnapshotsClient( + 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.GetIamPolicyInstantSnapshotRequest(), + project="project_value", + zone="zone_value", + resource="resource_value", + ) + + +def test_get_iam_policy_rest_error(): + client = InstantSnapshotsClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + + +@pytest.mark.parametrize( + "request_type", + [ + compute.InsertInstantSnapshotRequest, + dict, + ], +) +def test_insert_rest(request_type): + client = InstantSnapshotsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # send a request that will satisfy transcoding + request_init = {"project": "sample1", "zone": "sample2"} + request_init["instant_snapshot_resource"] = { + "architecture": "architecture_value", + "creation_timestamp": "creation_timestamp_value", + "description": "description_value", + "disk_size_gb": 1261, + "id": 205, + "kind": "kind_value", + "label_fingerprint": "label_fingerprint_value", + "labels": {}, + "name": "name_value", + "region": "region_value", + "resource_status": {"storage_size_bytes": 1941}, + "satisfies_pzi": True, + "satisfies_pzs": True, + "self_link": "self_link_value", + "self_link_with_id": "self_link_with_id_value", + "source_disk": "source_disk_value", + "source_disk_id": "source_disk_id_value", + "status": "status_value", + "zone": "zone_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.InsertInstantSnapshotRequest.meta.fields[ + "instant_snapshot_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[ + "instant_snapshot_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["instant_snapshot_resource"][field]) + ): + del request_init["instant_snapshot_resource"][field][i][subfield] + else: + del request_init["instant_snapshot_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 = 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 + 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" + + +def test_insert_rest_required_fields(request_type=compute.InsertInstantSnapshotRequest): + transport_class = transports.InstantSnapshotsRestTransport + + 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() + ).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" + jsonified_request["zone"] = "zone_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" + assert "zone" in jsonified_request + assert jsonified_request["zone"] == "zone_value" + + client = InstantSnapshotsClient( + 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 + + 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.InstantSnapshotsRestTransport( + credentials=ga_credentials.AnonymousCredentials + ) + + unset_fields = transport.insert._get_unset_required_fields({}) + assert set(unset_fields) == ( + set(("requestId",)) + & set( + ( + "instantSnapshotResource", + "project", + "zone", + ) + ) + ) + + +@pytest.mark.parametrize("null_interceptor", [True, False]) +def test_insert_rest_interceptors(null_interceptor): + transport = transports.InstantSnapshotsRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + interceptor=None + if null_interceptor + else transports.InstantSnapshotsRestInterceptor(), + ) + client = InstantSnapshotsClient(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.InstantSnapshotsRestInterceptor, "post_insert" + ) as post, mock.patch.object( + transports.InstantSnapshotsRestInterceptor, "pre_insert" + ) as pre: + pre.assert_not_called() + post.assert_not_called() + pb_message = compute.InsertInstantSnapshotRequest.pb( + compute.InsertInstantSnapshotRequest() + ) + transcode.return_value = { + "method": "post", + "uri": "my_uri", + "body": pb_message, + "query_params": pb_message, + } + + req.return_value = Response() + req.return_value.status_code = 200 + req.return_value.request = PreparedRequest() + req.return_value._content = compute.Operation.to_json(compute.Operation()) + + request = compute.InsertInstantSnapshotRequest() + metadata = [ + ("key", "val"), + ("cephalopod", "squid"), + ] + pre.return_value = request, metadata + post.return_value = compute.Operation() + + client.insert( + request, + metadata=[ + ("key", "val"), + ("cephalopod", "squid"), + ], + ) + + pre.assert_called_once() + post.assert_called_once() + + +def test_insert_rest_bad_request( + transport: str = "rest", request_type=compute.InsertInstantSnapshotRequest +): + client = InstantSnapshotsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # 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 = Response() + response_value.status_code = 400 + response_value.request = Request() + req.return_value = response_value + client.insert(request) + + +def test_insert_rest_flattened(): + client = InstantSnapshotsClient( + 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", + instant_snapshot_resource=compute.InstantSnapshot( + architecture="architecture_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 + + 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}/zones/{zone}/instantSnapshots" + % client.transport._host, + args[1], + ) + + +def test_insert_rest_flattened_error(transport: str = "rest"): + client = InstantSnapshotsClient( + 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.InsertInstantSnapshotRequest(), + project="project_value", + zone="zone_value", + instant_snapshot_resource=compute.InstantSnapshot( + architecture="architecture_value" + ), + ) + + +def test_insert_rest_error(): + client = InstantSnapshotsClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + + +@pytest.mark.parametrize( + "request_type", + [ + compute.InsertInstantSnapshotRequest, + dict, + ], +) +def test_insert_unary_rest(request_type): + client = InstantSnapshotsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # send a request that will satisfy transcoding + request_init = {"project": "sample1", "zone": "sample2"} + request_init["instant_snapshot_resource"] = { + "architecture": "architecture_value", + "creation_timestamp": "creation_timestamp_value", + "description": "description_value", + "disk_size_gb": 1261, + "id": 205, + "kind": "kind_value", + "label_fingerprint": "label_fingerprint_value", + "labels": {}, + "name": "name_value", + "region": "region_value", + "resource_status": {"storage_size_bytes": 1941}, + "satisfies_pzi": True, + "satisfies_pzs": True, + "self_link": "self_link_value", + "self_link_with_id": "self_link_with_id_value", + "source_disk": "source_disk_value", + "source_disk_id": "source_disk_id_value", + "status": "status_value", + "zone": "zone_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.InsertInstantSnapshotRequest.meta.fields[ + "instant_snapshot_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[ + "instant_snapshot_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["instant_snapshot_resource"][field]) + ): + del request_init["instant_snapshot_resource"][field][i][subfield] + else: + del request_init["instant_snapshot_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 = 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 + response = client.insert_unary(request) + + # Establish that the response is the type that we expect. + assert isinstance(response, compute.Operation) + + +def test_insert_unary_rest_required_fields( + request_type=compute.InsertInstantSnapshotRequest, +): + transport_class = transports.InstantSnapshotsRestTransport + + 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() + ).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" + jsonified_request["zone"] = "zone_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" + assert "zone" in jsonified_request + assert jsonified_request["zone"] == "zone_value" + + client = InstantSnapshotsClient( + 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 + + 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.InstantSnapshotsRestTransport( + credentials=ga_credentials.AnonymousCredentials + ) + + unset_fields = transport.insert._get_unset_required_fields({}) + assert set(unset_fields) == ( + set(("requestId",)) + & set( + ( + "instantSnapshotResource", + "project", + "zone", + ) + ) + ) + + +@pytest.mark.parametrize("null_interceptor", [True, False]) +def test_insert_unary_rest_interceptors(null_interceptor): + transport = transports.InstantSnapshotsRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + interceptor=None + if null_interceptor + else transports.InstantSnapshotsRestInterceptor(), + ) + client = InstantSnapshotsClient(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.InstantSnapshotsRestInterceptor, "post_insert" + ) as post, mock.patch.object( + transports.InstantSnapshotsRestInterceptor, "pre_insert" + ) as pre: + pre.assert_not_called() + post.assert_not_called() + pb_message = compute.InsertInstantSnapshotRequest.pb( + compute.InsertInstantSnapshotRequest() + ) + transcode.return_value = { + "method": "post", + "uri": "my_uri", + "body": pb_message, + "query_params": pb_message, + } + + req.return_value = Response() + req.return_value.status_code = 200 + req.return_value.request = PreparedRequest() + req.return_value._content = compute.Operation.to_json(compute.Operation()) + + request = compute.InsertInstantSnapshotRequest() + metadata = [ + ("key", "val"), + ("cephalopod", "squid"), + ] + pre.return_value = request, metadata + post.return_value = compute.Operation() + + client.insert_unary( + request, + metadata=[ + ("key", "val"), + ("cephalopod", "squid"), + ], + ) + + pre.assert_called_once() + post.assert_called_once() + + +def test_insert_unary_rest_bad_request( + transport: str = "rest", request_type=compute.InsertInstantSnapshotRequest +): + client = InstantSnapshotsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # 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 = Response() + response_value.status_code = 400 + response_value.request = Request() + req.return_value = response_value + client.insert_unary(request) + + +def test_insert_unary_rest_flattened(): + client = InstantSnapshotsClient( + 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", + instant_snapshot_resource=compute.InstantSnapshot( + architecture="architecture_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 + + 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}/zones/{zone}/instantSnapshots" + % client.transport._host, + args[1], + ) + + +def test_insert_unary_rest_flattened_error(transport: str = "rest"): + client = InstantSnapshotsClient( + 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.InsertInstantSnapshotRequest(), + project="project_value", + zone="zone_value", + instant_snapshot_resource=compute.InstantSnapshot( + architecture="architecture_value" + ), + ) + + +def test_insert_unary_rest_error(): + client = InstantSnapshotsClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + + +@pytest.mark.parametrize( + "request_type", + [ + compute.ListInstantSnapshotsRequest, + dict, + ], +) +def test_list_rest(request_type): + client = InstantSnapshotsClient( + 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 response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = compute.InstantSnapshotList( + 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 = Response() + response_value.status_code = 200 + # Convert return value to protobuf type + return_value = compute.InstantSnapshotList.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 + 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" + + +def test_list_rest_required_fields(request_type=compute.ListInstantSnapshotsRequest): + transport_class = transports.InstantSnapshotsRestTransport + + 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() + ).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" + 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 "project" in jsonified_request + assert jsonified_request["project"] == "project_value" + assert "zone" in jsonified_request + assert jsonified_request["zone"] == "zone_value" + + client = InstantSnapshotsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + request = request_type(**request_init) + + # Designate an appropriate value for the returned response. + return_value = compute.InstantSnapshotList() + # 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.InstantSnapshotList.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 + + 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.InstantSnapshotsRestTransport( + credentials=ga_credentials.AnonymousCredentials + ) + + unset_fields = transport.list._get_unset_required_fields({}) + assert set(unset_fields) == ( + set( + ( + "filter", + "maxResults", + "orderBy", + "pageToken", + "returnPartialSuccess", + ) + ) + & set( + ( + "project", + "zone", + ) + ) + ) + + +@pytest.mark.parametrize("null_interceptor", [True, False]) +def test_list_rest_interceptors(null_interceptor): + transport = transports.InstantSnapshotsRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + interceptor=None + if null_interceptor + else transports.InstantSnapshotsRestInterceptor(), + ) + client = InstantSnapshotsClient(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.InstantSnapshotsRestInterceptor, "post_list" + ) as post, mock.patch.object( + transports.InstantSnapshotsRestInterceptor, "pre_list" + ) as pre: + pre.assert_not_called() + post.assert_not_called() + pb_message = compute.ListInstantSnapshotsRequest.pb( + compute.ListInstantSnapshotsRequest() + ) + transcode.return_value = { + "method": "post", + "uri": "my_uri", + "body": pb_message, + "query_params": pb_message, + } + + req.return_value = Response() + req.return_value.status_code = 200 + req.return_value.request = PreparedRequest() + req.return_value._content = compute.InstantSnapshotList.to_json( + compute.InstantSnapshotList() + ) + + request = compute.ListInstantSnapshotsRequest() + metadata = [ + ("key", "val"), + ("cephalopod", "squid"), + ] + pre.return_value = request, metadata + post.return_value = compute.InstantSnapshotList() + + client.list( + request, + metadata=[ + ("key", "val"), + ("cephalopod", "squid"), + ], + ) + + pre.assert_called_once() + post.assert_called_once() + + +def test_list_rest_bad_request( + transport: str = "rest", request_type=compute.ListInstantSnapshotsRequest +): + client = InstantSnapshotsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # 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 = Response() + response_value.status_code = 400 + response_value.request = Request() + req.return_value = response_value + client.list(request) + + +def test_list_rest_flattened(): + client = InstantSnapshotsClient( + 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.InstantSnapshotList() + + # 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", + ) + 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.InstantSnapshotList.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 + + 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}/instantSnapshots" + % client.transport._host, + args[1], + ) + + +def test_list_rest_flattened_error(transport: str = "rest"): + client = InstantSnapshotsClient( + 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.ListInstantSnapshotsRequest(), + project="project_value", + zone="zone_value", + ) + + +def test_list_rest_pager(transport: str = "rest"): + client = InstantSnapshotsClient( + 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.InstantSnapshotList( + items=[ + compute.InstantSnapshot(), + compute.InstantSnapshot(), + compute.InstantSnapshot(), + ], + next_page_token="abc", + ), + compute.InstantSnapshotList( + items=[], + next_page_token="def", + ), + compute.InstantSnapshotList( + items=[ + compute.InstantSnapshot(), + ], + next_page_token="ghi", + ), + compute.InstantSnapshotList( + items=[ + compute.InstantSnapshot(), + compute.InstantSnapshot(), + ], + ), + ) + # Two responses for two calls + response = response + response + + # Wrap the values into proper Response objs + response = tuple(compute.InstantSnapshotList.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"} + + pager = client.list(request=sample_request) + + results = list(pager) + assert len(results) == 6 + assert all(isinstance(i, compute.InstantSnapshot) 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 + + +@pytest.mark.parametrize( + "request_type", + [ + compute.SetIamPolicyInstantSnapshotRequest, + dict, + ], +) +def test_set_iam_policy_rest(request_type): + client = InstantSnapshotsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # send a request that will satisfy transcoding + request_init = {"project": "sample1", "zone": "sample2", "resource": "sample3"} + request_init["zone_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, + "rules": [ + { + "action": "action_value", + "conditions": [ + { + "iam": "iam_value", + "op": "op_value", + "svc": "svc_value", + "sys": "sys_value", + "values": ["values_value1", "values_value2"], + } + ], + "description": "description_value", + "ins": ["ins_value1", "ins_value2"], + "log_configs": [ + { + "cloud_audit": { + "authorization_logging_options": { + "permission_type": "permission_type_value" + }, + "log_name": "log_name_value", + }, + "counter": { + "custom_fields": [ + {"name": "name_value", "value": "value_value"} + ], + "field": "field_value", + "metric": "metric_value", + }, + "data_access": {"log_mode": "log_mode_value"}, + } + ], + "not_ins": ["not_ins_value1", "not_ins_value2"], + "permissions": ["permissions_value1", "permissions_value2"], + } + ], + "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.SetIamPolicyInstantSnapshotRequest.meta.fields[ + "zone_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[ + "zone_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["zone_set_policy_request_resource"][field]) + ): + del request_init["zone_set_policy_request_resource"][field][i][ + subfield + ] + else: + del request_init["zone_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 = 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 + 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 + + +def test_set_iam_policy_rest_required_fields( + request_type=compute.SetIamPolicyInstantSnapshotRequest, +): + transport_class = transports.InstantSnapshotsRestTransport + + request_init = {} + request_init["project"] = "" + request_init["resource"] = "" + 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() + ).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" + jsonified_request["zone"] = "zone_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" + assert "zone" in jsonified_request + assert jsonified_request["zone"] == "zone_value" + + client = InstantSnapshotsClient( + 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 + + 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.InstantSnapshotsRestTransport( + credentials=ga_credentials.AnonymousCredentials + ) + + unset_fields = transport.set_iam_policy._get_unset_required_fields({}) + assert set(unset_fields) == ( + set(()) + & set( + ( + "project", + "resource", + "zone", + "zoneSetPolicyRequestResource", + ) + ) + ) + + +@pytest.mark.parametrize("null_interceptor", [True, False]) +def test_set_iam_policy_rest_interceptors(null_interceptor): + transport = transports.InstantSnapshotsRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + interceptor=None + if null_interceptor + else transports.InstantSnapshotsRestInterceptor(), + ) + client = InstantSnapshotsClient(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.InstantSnapshotsRestInterceptor, "post_set_iam_policy" + ) as post, mock.patch.object( + transports.InstantSnapshotsRestInterceptor, "pre_set_iam_policy" + ) as pre: + pre.assert_not_called() + post.assert_not_called() + pb_message = compute.SetIamPolicyInstantSnapshotRequest.pb( + compute.SetIamPolicyInstantSnapshotRequest() + ) + transcode.return_value = { + "method": "post", + "uri": "my_uri", + "body": pb_message, + "query_params": pb_message, + } + + req.return_value = Response() + req.return_value.status_code = 200 + req.return_value.request = PreparedRequest() + req.return_value._content = compute.Policy.to_json(compute.Policy()) + + request = compute.SetIamPolicyInstantSnapshotRequest() + metadata = [ + ("key", "val"), + ("cephalopod", "squid"), + ] + pre.return_value = request, metadata + post.return_value = compute.Policy() + + client.set_iam_policy( + request, + metadata=[ + ("key", "val"), + ("cephalopod", "squid"), + ], + ) + + pre.assert_called_once() + post.assert_called_once() + + +def test_set_iam_policy_rest_bad_request( + transport: str = "rest", request_type=compute.SetIamPolicyInstantSnapshotRequest +): + client = InstantSnapshotsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # send a request that will satisfy transcoding + request_init = {"project": "sample1", "zone": "sample2", "resource": "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 = Response() + response_value.status_code = 400 + response_value.request = Request() + req.return_value = response_value + client.set_iam_policy(request) + + +def test_set_iam_policy_rest_flattened(): + client = InstantSnapshotsClient( + 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", + "zone": "sample2", + "resource": "sample3", + } + + # get truthy value for each flattened field + mock_args = dict( + project="project_value", + zone="zone_value", + resource="resource_value", + zone_set_policy_request_resource=compute.ZoneSetPolicyRequest( + 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 + + 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}/zones/{zone}/instantSnapshots/{resource}/setIamPolicy" + % client.transport._host, + args[1], + ) + + +def test_set_iam_policy_rest_flattened_error(transport: str = "rest"): + client = InstantSnapshotsClient( + 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.SetIamPolicyInstantSnapshotRequest(), + project="project_value", + zone="zone_value", + resource="resource_value", + zone_set_policy_request_resource=compute.ZoneSetPolicyRequest( + bindings=[compute.Binding(binding_id="binding_id_value")] + ), + ) + + +def test_set_iam_policy_rest_error(): + client = InstantSnapshotsClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + + +@pytest.mark.parametrize( + "request_type", + [ + compute.SetLabelsInstantSnapshotRequest, + dict, + ], +) +def test_set_labels_rest(request_type): + client = InstantSnapshotsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # send a request that will satisfy transcoding + request_init = {"project": "sample1", "zone": "sample2", "resource": "sample3"} + request_init["zone_set_labels_request_resource"] = { + "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.SetLabelsInstantSnapshotRequest.meta.fields[ + "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[ + "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["zone_set_labels_request_resource"][field]) + ): + del request_init["zone_set_labels_request_resource"][field][i][ + subfield + ] + else: + del request_init["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 = 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 + response = client.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" + + +def test_set_labels_rest_required_fields( + request_type=compute.SetLabelsInstantSnapshotRequest, +): + transport_class = transports.InstantSnapshotsRestTransport + + request_init = {} + request_init["project"] = "" + request_init["resource"] = "" + 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() + ).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["resource"] = "resource_value" + jsonified_request["zone"] = "zone_value" + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).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",)) + 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" + assert "zone" in jsonified_request + assert jsonified_request["zone"] == "zone_value" + + client = InstantSnapshotsClient( + 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 + + response = client.set_labels(request) + + expected_params = [] + actual_params = req.call_args.kwargs["params"] + assert expected_params == actual_params + + +def test_set_labels_rest_unset_required_fields(): + transport = transports.InstantSnapshotsRestTransport( + credentials=ga_credentials.AnonymousCredentials + ) + + unset_fields = transport.set_labels._get_unset_required_fields({}) + assert set(unset_fields) == ( + set(("requestId",)) + & set( + ( + "project", + "resource", + "zone", + "zoneSetLabelsRequestResource", + ) + ) + ) + + +@pytest.mark.parametrize("null_interceptor", [True, False]) +def test_set_labels_rest_interceptors(null_interceptor): + transport = transports.InstantSnapshotsRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + interceptor=None + if null_interceptor + else transports.InstantSnapshotsRestInterceptor(), + ) + client = InstantSnapshotsClient(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.InstantSnapshotsRestInterceptor, "post_set_labels" + ) as post, mock.patch.object( + transports.InstantSnapshotsRestInterceptor, "pre_set_labels" + ) as pre: + pre.assert_not_called() + post.assert_not_called() + pb_message = compute.SetLabelsInstantSnapshotRequest.pb( + compute.SetLabelsInstantSnapshotRequest() + ) + transcode.return_value = { + "method": "post", + "uri": "my_uri", + "body": pb_message, + "query_params": pb_message, + } + + req.return_value = Response() + req.return_value.status_code = 200 + req.return_value.request = PreparedRequest() + req.return_value._content = compute.Operation.to_json(compute.Operation()) + + request = compute.SetLabelsInstantSnapshotRequest() + metadata = [ + ("key", "val"), + ("cephalopod", "squid"), + ] + pre.return_value = request, metadata + post.return_value = compute.Operation() + + client.set_labels( + request, + metadata=[ + ("key", "val"), + ("cephalopod", "squid"), + ], + ) + + pre.assert_called_once() + post.assert_called_once() + + +def test_set_labels_rest_bad_request( + transport: str = "rest", request_type=compute.SetLabelsInstantSnapshotRequest +): + client = InstantSnapshotsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # send a request that will satisfy transcoding + request_init = {"project": "sample1", "zone": "sample2", "resource": "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 = Response() + response_value.status_code = 400 + response_value.request = Request() + req.return_value = response_value + client.set_labels(request) + + +def test_set_labels_rest_flattened(): + client = InstantSnapshotsClient( + 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", + "resource": "sample3", + } + + # get truthy value for each flattened field + mock_args = dict( + project="project_value", + zone="zone_value", + resource="resource_value", + zone_set_labels_request_resource=compute.ZoneSetLabelsRequest( + 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 + + client.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}/instantSnapshots/{resource}/setLabels" + % client.transport._host, + args[1], + ) + + +def test_set_labels_rest_flattened_error(transport: str = "rest"): + client = InstantSnapshotsClient( + 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_labels( + compute.SetLabelsInstantSnapshotRequest(), + project="project_value", + zone="zone_value", + resource="resource_value", + zone_set_labels_request_resource=compute.ZoneSetLabelsRequest( + label_fingerprint="label_fingerprint_value" + ), + ) + + +def test_set_labels_rest_error(): + client = InstantSnapshotsClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + + +@pytest.mark.parametrize( + "request_type", + [ + compute.SetLabelsInstantSnapshotRequest, + dict, + ], +) +def test_set_labels_unary_rest(request_type): + client = InstantSnapshotsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # send a request that will satisfy transcoding + request_init = {"project": "sample1", "zone": "sample2", "resource": "sample3"} + request_init["zone_set_labels_request_resource"] = { + "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.SetLabelsInstantSnapshotRequest.meta.fields[ + "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[ + "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["zone_set_labels_request_resource"][field]) + ): + del request_init["zone_set_labels_request_resource"][field][i][ + subfield + ] + else: + del request_init["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 = 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 + response = client.set_labels_unary(request) + + # Establish that the response is the type that we expect. + assert isinstance(response, compute.Operation) + + +def test_set_labels_unary_rest_required_fields( + request_type=compute.SetLabelsInstantSnapshotRequest, +): + transport_class = transports.InstantSnapshotsRestTransport + + request_init = {} + request_init["project"] = "" + request_init["resource"] = "" + 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() + ).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["resource"] = "resource_value" + jsonified_request["zone"] = "zone_value" + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).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",)) + 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" + assert "zone" in jsonified_request + assert jsonified_request["zone"] == "zone_value" + + client = InstantSnapshotsClient( + 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 + + response = client.set_labels_unary(request) + + expected_params = [] + actual_params = req.call_args.kwargs["params"] + assert expected_params == actual_params + + +def test_set_labels_unary_rest_unset_required_fields(): + transport = transports.InstantSnapshotsRestTransport( + credentials=ga_credentials.AnonymousCredentials + ) + + unset_fields = transport.set_labels._get_unset_required_fields({}) + assert set(unset_fields) == ( + set(("requestId",)) + & set( + ( + "project", + "resource", + "zone", + "zoneSetLabelsRequestResource", + ) + ) + ) + + +@pytest.mark.parametrize("null_interceptor", [True, False]) +def test_set_labels_unary_rest_interceptors(null_interceptor): + transport = transports.InstantSnapshotsRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + interceptor=None + if null_interceptor + else transports.InstantSnapshotsRestInterceptor(), + ) + client = InstantSnapshotsClient(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.InstantSnapshotsRestInterceptor, "post_set_labels" + ) as post, mock.patch.object( + transports.InstantSnapshotsRestInterceptor, "pre_set_labels" + ) as pre: + pre.assert_not_called() + post.assert_not_called() + pb_message = compute.SetLabelsInstantSnapshotRequest.pb( + compute.SetLabelsInstantSnapshotRequest() + ) + transcode.return_value = { + "method": "post", + "uri": "my_uri", + "body": pb_message, + "query_params": pb_message, + } + + req.return_value = Response() + req.return_value.status_code = 200 + req.return_value.request = PreparedRequest() + req.return_value._content = compute.Operation.to_json(compute.Operation()) + + request = compute.SetLabelsInstantSnapshotRequest() + metadata = [ + ("key", "val"), + ("cephalopod", "squid"), + ] + pre.return_value = request, metadata + post.return_value = compute.Operation() + + client.set_labels_unary( + request, + metadata=[ + ("key", "val"), + ("cephalopod", "squid"), + ], + ) + + pre.assert_called_once() + post.assert_called_once() + + +def test_set_labels_unary_rest_bad_request( + transport: str = "rest", request_type=compute.SetLabelsInstantSnapshotRequest +): + client = InstantSnapshotsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # send a request that will satisfy transcoding + request_init = {"project": "sample1", "zone": "sample2", "resource": "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 = Response() + response_value.status_code = 400 + response_value.request = Request() + req.return_value = response_value + client.set_labels_unary(request) + + +def test_set_labels_unary_rest_flattened(): + client = InstantSnapshotsClient( + 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", + "resource": "sample3", + } + + # get truthy value for each flattened field + mock_args = dict( + project="project_value", + zone="zone_value", + resource="resource_value", + zone_set_labels_request_resource=compute.ZoneSetLabelsRequest( + 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 + + client.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}/instantSnapshots/{resource}/setLabels" + % client.transport._host, + args[1], + ) + + +def test_set_labels_unary_rest_flattened_error(transport: str = "rest"): + client = InstantSnapshotsClient( + 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_labels_unary( + compute.SetLabelsInstantSnapshotRequest(), + project="project_value", + zone="zone_value", + resource="resource_value", + zone_set_labels_request_resource=compute.ZoneSetLabelsRequest( + label_fingerprint="label_fingerprint_value" + ), + ) + + +def test_set_labels_unary_rest_error(): + client = InstantSnapshotsClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + + +@pytest.mark.parametrize( + "request_type", + [ + compute.TestIamPermissionsInstantSnapshotRequest, + dict, + ], +) +def test_test_iam_permissions_rest(request_type): + client = InstantSnapshotsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # send a request that will satisfy transcoding + request_init = {"project": "sample1", "zone": "sample2", "resource": "sample3"} + 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.TestIamPermissionsInstantSnapshotRequest.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 = 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 + 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"] + + +def test_test_iam_permissions_rest_required_fields( + request_type=compute.TestIamPermissionsInstantSnapshotRequest, +): + transport_class = transports.InstantSnapshotsRestTransport + + request_init = {} + request_init["project"] = "" + request_init["resource"] = "" + 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() + ).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" + jsonified_request["zone"] = "zone_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" + assert "zone" in jsonified_request + assert jsonified_request["zone"] == "zone_value" + + client = InstantSnapshotsClient( + 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 + + 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.InstantSnapshotsRestTransport( + credentials=ga_credentials.AnonymousCredentials + ) + + unset_fields = transport.test_iam_permissions._get_unset_required_fields({}) + assert set(unset_fields) == ( + set(()) + & set( + ( + "project", + "resource", + "testPermissionsRequestResource", + "zone", + ) + ) + ) + + +@pytest.mark.parametrize("null_interceptor", [True, False]) +def test_test_iam_permissions_rest_interceptors(null_interceptor): + transport = transports.InstantSnapshotsRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + interceptor=None + if null_interceptor + else transports.InstantSnapshotsRestInterceptor(), + ) + client = InstantSnapshotsClient(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.InstantSnapshotsRestInterceptor, "post_test_iam_permissions" + ) as post, mock.patch.object( + transports.InstantSnapshotsRestInterceptor, "pre_test_iam_permissions" + ) as pre: + pre.assert_not_called() + post.assert_not_called() + pb_message = compute.TestIamPermissionsInstantSnapshotRequest.pb( + compute.TestIamPermissionsInstantSnapshotRequest() + ) + transcode.return_value = { + "method": "post", + "uri": "my_uri", + "body": pb_message, + "query_params": pb_message, + } + + req.return_value = Response() + req.return_value.status_code = 200 + req.return_value.request = PreparedRequest() + req.return_value._content = compute.TestPermissionsResponse.to_json( + compute.TestPermissionsResponse() + ) + + request = compute.TestIamPermissionsInstantSnapshotRequest() + metadata = [ + ("key", "val"), + ("cephalopod", "squid"), + ] + pre.return_value = request, metadata + post.return_value = compute.TestPermissionsResponse() + + client.test_iam_permissions( + request, + metadata=[ + ("key", "val"), + ("cephalopod", "squid"), + ], + ) + + pre.assert_called_once() + post.assert_called_once() + + +def test_test_iam_permissions_rest_bad_request( + transport: str = "rest", + request_type=compute.TestIamPermissionsInstantSnapshotRequest, +): + client = InstantSnapshotsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # send a request that will satisfy transcoding + request_init = {"project": "sample1", "zone": "sample2", "resource": "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 = Response() + response_value.status_code = 400 + response_value.request = Request() + req.return_value = response_value + client.test_iam_permissions(request) + + +def test_test_iam_permissions_rest_flattened(): + client = InstantSnapshotsClient( + 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", + "zone": "sample2", + "resource": "sample3", + } + + # get truthy value for each flattened field + mock_args = dict( + project="project_value", + zone="zone_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 + + 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}/zones/{zone}/instantSnapshots/{resource}/testIamPermissions" + % client.transport._host, + args[1], + ) + + +def test_test_iam_permissions_rest_flattened_error(transport: str = "rest"): + client = InstantSnapshotsClient( + 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.TestIamPermissionsInstantSnapshotRequest(), + project="project_value", + zone="zone_value", + resource="resource_value", + test_permissions_request_resource=compute.TestPermissionsRequest( + permissions=["permissions_value"] + ), + ) + + +def test_test_iam_permissions_rest_error(): + client = InstantSnapshotsClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + + +def test_credentials_transport_error(): + # It is an error to provide credentials and a transport instance. + transport = transports.InstantSnapshotsRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + ) + with pytest.raises(ValueError): + client = InstantSnapshotsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # It is an error to provide a credentials file and a transport instance. + transport = transports.InstantSnapshotsRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + ) + with pytest.raises(ValueError): + client = InstantSnapshotsClient( + client_options={"credentials_file": "credentials.json"}, + transport=transport, + ) + + # It is an error to provide an api_key and a transport instance. + transport = transports.InstantSnapshotsRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + ) + options = client_options.ClientOptions() + options.api_key = "api_key" + with pytest.raises(ValueError): + client = InstantSnapshotsClient( + 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 = InstantSnapshotsClient( + client_options=options, credentials=ga_credentials.AnonymousCredentials() + ) + + # It is an error to provide scopes and a transport instance. + transport = transports.InstantSnapshotsRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + ) + with pytest.raises(ValueError): + client = InstantSnapshotsClient( + client_options={"scopes": ["1", "2"]}, + transport=transport, + ) + + +def test_transport_instance(): + # A client may be instantiated with a custom transport instance. + transport = transports.InstantSnapshotsRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + ) + client = InstantSnapshotsClient(transport=transport) + assert client.transport is transport + + +@pytest.mark.parametrize( + "transport_class", + [ + transports.InstantSnapshotsRestTransport, + ], +) +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() + + +@pytest.mark.parametrize( + "transport_name", + [ + "rest", + ], +) +def test_transport_kind(transport_name): + transport = InstantSnapshotsClient.get_transport_class(transport_name)( + credentials=ga_credentials.AnonymousCredentials(), + ) + assert transport.kind == transport_name + + +def test_instant_snapshots_base_transport_error(): + # Passing both a credentials object and credentials_file should raise an error + with pytest.raises(core_exceptions.DuplicateCredentialArgs): + transport = transports.InstantSnapshotsTransport( + credentials=ga_credentials.AnonymousCredentials(), + credentials_file="credentials.json", + ) + + +def test_instant_snapshots_base_transport(): + # Instantiate the base transport. + with mock.patch( + "google.cloud.compute_v1.services.instant_snapshots.transports.InstantSnapshotsTransport.__init__" + ) as Transport: + Transport.return_value = None + transport = transports.InstantSnapshotsTransport( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Every method on the transport should just blindly + # raise NotImplementedError. + methods = ( + "aggregated_list", + "delete", + "get", + "get_iam_policy", + "insert", + "list", + "set_iam_policy", + "set_labels", + "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_instant_snapshots_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.instant_snapshots.transports.InstantSnapshotsTransport._prep_wrapped_messages" + ) as Transport: + Transport.return_value = None + load_creds.return_value = (ga_credentials.AnonymousCredentials(), None) + transport = transports.InstantSnapshotsTransport( + 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_instant_snapshots_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.instant_snapshots.transports.InstantSnapshotsTransport._prep_wrapped_messages" + ) as Transport: + Transport.return_value = None + adc.return_value = (ga_credentials.AnonymousCredentials(), None) + transport = transports.InstantSnapshotsTransport() + adc.assert_called_once() + + +def test_instant_snapshots_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) + InstantSnapshotsClient() + 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_instant_snapshots_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.InstantSnapshotsRestTransport( + 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_instant_snapshots_host_no_port(transport_name): + client = InstantSnapshotsClient( + 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_instant_snapshots_host_with_port(transport_name): + client = InstantSnapshotsClient( + 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_instant_snapshots_client_transport_session_collision(transport_name): + creds1 = ga_credentials.AnonymousCredentials() + creds2 = ga_credentials.AnonymousCredentials() + client1 = InstantSnapshotsClient( + credentials=creds1, + transport=transport_name, + ) + client2 = InstantSnapshotsClient( + credentials=creds2, + transport=transport_name, + ) + session1 = client1.transport.aggregated_list._session + session2 = client2.transport.aggregated_list._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.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.set_iam_policy._session + session2 = client2.transport.set_iam_policy._session + assert session1 != session2 + session1 = client1.transport.set_labels._session + session2 = client2.transport.set_labels._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 = InstantSnapshotsClient.common_billing_account_path(billing_account) + assert expected == actual + + +def test_parse_common_billing_account_path(): + expected = { + "billing_account": "clam", + } + path = InstantSnapshotsClient.common_billing_account_path(**expected) + + # Check that the path construction is reversible. + actual = InstantSnapshotsClient.parse_common_billing_account_path(path) + assert expected == actual + + +def test_common_folder_path(): + folder = "whelk" + expected = "folders/{folder}".format( + folder=folder, + ) + actual = InstantSnapshotsClient.common_folder_path(folder) + assert expected == actual + + +def test_parse_common_folder_path(): + expected = { + "folder": "octopus", + } + path = InstantSnapshotsClient.common_folder_path(**expected) + + # Check that the path construction is reversible. + actual = InstantSnapshotsClient.parse_common_folder_path(path) + assert expected == actual + + +def test_common_organization_path(): + organization = "oyster" + expected = "organizations/{organization}".format( + organization=organization, + ) + actual = InstantSnapshotsClient.common_organization_path(organization) + assert expected == actual + + +def test_parse_common_organization_path(): + expected = { + "organization": "nudibranch", + } + path = InstantSnapshotsClient.common_organization_path(**expected) + + # Check that the path construction is reversible. + actual = InstantSnapshotsClient.parse_common_organization_path(path) + assert expected == actual + + +def test_common_project_path(): + project = "cuttlefish" + expected = "projects/{project}".format( + project=project, + ) + actual = InstantSnapshotsClient.common_project_path(project) + assert expected == actual + + +def test_parse_common_project_path(): + expected = { + "project": "mussel", + } + path = InstantSnapshotsClient.common_project_path(**expected) + + # Check that the path construction is reversible. + actual = InstantSnapshotsClient.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 = InstantSnapshotsClient.common_location_path(project, location) + assert expected == actual + + +def test_parse_common_location_path(): + expected = { + "project": "scallop", + "location": "abalone", + } + path = InstantSnapshotsClient.common_location_path(**expected) + + # Check that the path construction is reversible. + actual = InstantSnapshotsClient.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.InstantSnapshotsTransport, "_prep_wrapped_messages" + ) as prep: + client = InstantSnapshotsClient( + credentials=ga_credentials.AnonymousCredentials(), + client_info=client_info, + ) + prep.assert_called_once_with(client_info) + + with mock.patch.object( + transports.InstantSnapshotsTransport, "_prep_wrapped_messages" + ) as prep: + transport_class = InstantSnapshotsClient.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(): + transports = { + "rest": "_session", + } + + for transport, close_name in transports.items(): + client = InstantSnapshotsClient( + credentials=ga_credentials.AnonymousCredentials(), transport=transport + ) + with mock.patch.object( + type(getattr(client.transport, close_name)), "close" + ) as close: + with client: + close.assert_not_called() + close.assert_called_once() + + +def test_client_ctx(): + transports = [ + "rest", + ] + for transport in transports: + client = InstantSnapshotsClient( + 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", + [ + (InstantSnapshotsClient, transports.InstantSnapshotsRestTransport), + ], +) +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_projects.py b/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_projects.py index a92f5c6d1668..4915848f7f05 100644 --- a/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_projects.py +++ b/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_projects.py @@ -3706,6 +3706,7 @@ def test_get_rest(request_type): with mock.patch.object(type(client.transport._session), "request") as req: # Designate an appropriate value for the returned response. return_value = compute.Project( + cloud_armor_tier="cloud_armor_tier_value", creation_timestamp="creation_timestamp_value", default_network_tier="default_network_tier_value", default_service_account="default_service_account_value", @@ -3732,6 +3733,7 @@ def test_get_rest(request_type): # Establish that the response is the type that we expect. assert isinstance(response, compute.Project) + assert response.cloud_armor_tier == "cloud_armor_tier_value" assert response.creation_timestamp == "creation_timestamp_value" assert response.default_network_tier == "default_network_tier_value" assert response.default_service_account == "default_service_account_value" @@ -3983,6 +3985,7 @@ def test_get_xpn_host_rest(request_type): with mock.patch.object(type(client.transport._session), "request") as req: # Designate an appropriate value for the returned response. return_value = compute.Project( + cloud_armor_tier="cloud_armor_tier_value", creation_timestamp="creation_timestamp_value", default_network_tier="default_network_tier_value", default_service_account="default_service_account_value", @@ -4009,6 +4012,7 @@ def test_get_xpn_host_rest(request_type): # Establish that the response is the type that we expect. assert isinstance(response, compute.Project) + assert response.cloud_armor_tier == "cloud_armor_tier_value" assert response.creation_timestamp == "creation_timestamp_value" assert response.default_network_tier == "default_network_tier_value" assert response.default_service_account == "default_service_account_value" @@ -6574,6 +6578,798 @@ def test_move_instance_unary_rest_error(): ) +@pytest.mark.parametrize( + "request_type", + [ + compute.SetCloudArmorTierProjectRequest, + dict, + ], +) +def test_set_cloud_armor_tier_rest(request_type): + client = ProjectsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # send a request that will satisfy transcoding + request_init = {"project": "sample1"} + request_init["projects_set_cloud_armor_tier_request_resource"] = { + "cloud_armor_tier": "cloud_armor_tier_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.SetCloudArmorTierProjectRequest.meta.fields[ + "projects_set_cloud_armor_tier_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[ + "projects_set_cloud_armor_tier_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["projects_set_cloud_armor_tier_request_resource"][ + field + ] + ), + ): + del request_init["projects_set_cloud_armor_tier_request_resource"][ + field + ][i][subfield] + else: + del request_init["projects_set_cloud_armor_tier_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 = 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 + response = client.set_cloud_armor_tier(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" + + +def test_set_cloud_armor_tier_rest_required_fields( + request_type=compute.SetCloudArmorTierProjectRequest, +): + transport_class = transports.ProjectsRestTransport + + 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() + ).set_cloud_armor_tier._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() + ).set_cloud_armor_tier._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 = ProjectsClient( + 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 + + response = client.set_cloud_armor_tier(request) + + expected_params = [] + actual_params = req.call_args.kwargs["params"] + assert expected_params == actual_params + + +def test_set_cloud_armor_tier_rest_unset_required_fields(): + transport = transports.ProjectsRestTransport( + credentials=ga_credentials.AnonymousCredentials + ) + + unset_fields = transport.set_cloud_armor_tier._get_unset_required_fields({}) + assert set(unset_fields) == ( + set(("requestId",)) + & set( + ( + "project", + "projectsSetCloudArmorTierRequestResource", + ) + ) + ) + + +@pytest.mark.parametrize("null_interceptor", [True, False]) +def test_set_cloud_armor_tier_rest_interceptors(null_interceptor): + transport = transports.ProjectsRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + interceptor=None if null_interceptor else transports.ProjectsRestInterceptor(), + ) + client = ProjectsClient(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.ProjectsRestInterceptor, "post_set_cloud_armor_tier" + ) as post, mock.patch.object( + transports.ProjectsRestInterceptor, "pre_set_cloud_armor_tier" + ) as pre: + pre.assert_not_called() + post.assert_not_called() + pb_message = compute.SetCloudArmorTierProjectRequest.pb( + compute.SetCloudArmorTierProjectRequest() + ) + transcode.return_value = { + "method": "post", + "uri": "my_uri", + "body": pb_message, + "query_params": pb_message, + } + + req.return_value = Response() + req.return_value.status_code = 200 + req.return_value.request = PreparedRequest() + req.return_value._content = compute.Operation.to_json(compute.Operation()) + + request = compute.SetCloudArmorTierProjectRequest() + metadata = [ + ("key", "val"), + ("cephalopod", "squid"), + ] + pre.return_value = request, metadata + post.return_value = compute.Operation() + + client.set_cloud_armor_tier( + request, + metadata=[ + ("key", "val"), + ("cephalopod", "squid"), + ], + ) + + pre.assert_called_once() + post.assert_called_once() + + +def test_set_cloud_armor_tier_rest_bad_request( + transport: str = "rest", request_type=compute.SetCloudArmorTierProjectRequest +): + client = ProjectsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # 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 = Response() + response_value.status_code = 400 + response_value.request = Request() + req.return_value = response_value + client.set_cloud_armor_tier(request) + + +def test_set_cloud_armor_tier_rest_flattened(): + client = ProjectsClient( + 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", + projects_set_cloud_armor_tier_request_resource=compute.ProjectsSetCloudArmorTierRequest( + cloud_armor_tier="cloud_armor_tier_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 + + client.set_cloud_armor_tier(**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}/setCloudArmorTier" + % client.transport._host, + args[1], + ) + + +def test_set_cloud_armor_tier_rest_flattened_error(transport: str = "rest"): + client = ProjectsClient( + 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_cloud_armor_tier( + compute.SetCloudArmorTierProjectRequest(), + project="project_value", + projects_set_cloud_armor_tier_request_resource=compute.ProjectsSetCloudArmorTierRequest( + cloud_armor_tier="cloud_armor_tier_value" + ), + ) + + +def test_set_cloud_armor_tier_rest_error(): + client = ProjectsClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + + +@pytest.mark.parametrize( + "request_type", + [ + compute.SetCloudArmorTierProjectRequest, + dict, + ], +) +def test_set_cloud_armor_tier_unary_rest(request_type): + client = ProjectsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # send a request that will satisfy transcoding + request_init = {"project": "sample1"} + request_init["projects_set_cloud_armor_tier_request_resource"] = { + "cloud_armor_tier": "cloud_armor_tier_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.SetCloudArmorTierProjectRequest.meta.fields[ + "projects_set_cloud_armor_tier_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[ + "projects_set_cloud_armor_tier_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["projects_set_cloud_armor_tier_request_resource"][ + field + ] + ), + ): + del request_init["projects_set_cloud_armor_tier_request_resource"][ + field + ][i][subfield] + else: + del request_init["projects_set_cloud_armor_tier_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 = 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 + response = client.set_cloud_armor_tier_unary(request) + + # Establish that the response is the type that we expect. + assert isinstance(response, compute.Operation) + + +def test_set_cloud_armor_tier_unary_rest_required_fields( + request_type=compute.SetCloudArmorTierProjectRequest, +): + transport_class = transports.ProjectsRestTransport + + 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() + ).set_cloud_armor_tier._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() + ).set_cloud_armor_tier._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 = ProjectsClient( + 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 + + response = client.set_cloud_armor_tier_unary(request) + + expected_params = [] + actual_params = req.call_args.kwargs["params"] + assert expected_params == actual_params + + +def test_set_cloud_armor_tier_unary_rest_unset_required_fields(): + transport = transports.ProjectsRestTransport( + credentials=ga_credentials.AnonymousCredentials + ) + + unset_fields = transport.set_cloud_armor_tier._get_unset_required_fields({}) + assert set(unset_fields) == ( + set(("requestId",)) + & set( + ( + "project", + "projectsSetCloudArmorTierRequestResource", + ) + ) + ) + + +@pytest.mark.parametrize("null_interceptor", [True, False]) +def test_set_cloud_armor_tier_unary_rest_interceptors(null_interceptor): + transport = transports.ProjectsRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + interceptor=None if null_interceptor else transports.ProjectsRestInterceptor(), + ) + client = ProjectsClient(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.ProjectsRestInterceptor, "post_set_cloud_armor_tier" + ) as post, mock.patch.object( + transports.ProjectsRestInterceptor, "pre_set_cloud_armor_tier" + ) as pre: + pre.assert_not_called() + post.assert_not_called() + pb_message = compute.SetCloudArmorTierProjectRequest.pb( + compute.SetCloudArmorTierProjectRequest() + ) + transcode.return_value = { + "method": "post", + "uri": "my_uri", + "body": pb_message, + "query_params": pb_message, + } + + req.return_value = Response() + req.return_value.status_code = 200 + req.return_value.request = PreparedRequest() + req.return_value._content = compute.Operation.to_json(compute.Operation()) + + request = compute.SetCloudArmorTierProjectRequest() + metadata = [ + ("key", "val"), + ("cephalopod", "squid"), + ] + pre.return_value = request, metadata + post.return_value = compute.Operation() + + client.set_cloud_armor_tier_unary( + request, + metadata=[ + ("key", "val"), + ("cephalopod", "squid"), + ], + ) + + pre.assert_called_once() + post.assert_called_once() + + +def test_set_cloud_armor_tier_unary_rest_bad_request( + transport: str = "rest", request_type=compute.SetCloudArmorTierProjectRequest +): + client = ProjectsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # 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 = Response() + response_value.status_code = 400 + response_value.request = Request() + req.return_value = response_value + client.set_cloud_armor_tier_unary(request) + + +def test_set_cloud_armor_tier_unary_rest_flattened(): + client = ProjectsClient( + 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", + projects_set_cloud_armor_tier_request_resource=compute.ProjectsSetCloudArmorTierRequest( + cloud_armor_tier="cloud_armor_tier_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 + + client.set_cloud_armor_tier_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}/setCloudArmorTier" + % client.transport._host, + args[1], + ) + + +def test_set_cloud_armor_tier_unary_rest_flattened_error(transport: str = "rest"): + client = ProjectsClient( + 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_cloud_armor_tier_unary( + compute.SetCloudArmorTierProjectRequest(), + project="project_value", + projects_set_cloud_armor_tier_request_resource=compute.ProjectsSetCloudArmorTierRequest( + cloud_armor_tier="cloud_armor_tier_value" + ), + ) + + +def test_set_cloud_armor_tier_unary_rest_error(): + client = ProjectsClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + + @pytest.mark.parametrize( "request_type", [ @@ -9032,6 +9828,7 @@ def test_projects_base_transport(): "list_xpn_hosts", "move_disk", "move_instance", + "set_cloud_armor_tier", "set_common_instance_metadata", "set_default_network_tier", "set_usage_export_bucket", @@ -9202,6 +9999,9 @@ def test_projects_client_transport_session_collision(transport_name): session1 = client1.transport.move_instance._session session2 = client2.transport.move_instance._session assert session1 != session2 + session1 = client1.transport.set_cloud_armor_tier._session + session2 = client2.transport.set_cloud_armor_tier._session + assert session1 != session2 session1 = client1.transport.set_common_instance_metadata._session session2 = client2.transport.set_common_instance_metadata._session assert session1 != session2 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 af6f31916c6c..92e84727bac2 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 @@ -1715,6 +1715,7 @@ def test_get_rest(request_type): security_policy="security_policy_value", self_link="self_link_value", service_bindings=["service_bindings_value"], + service_lb_policy="service_lb_policy_value", session_affinity="session_affinity_value", timeout_sec=1185, ) @@ -1755,6 +1756,7 @@ def test_get_rest(request_type): assert response.security_policy == "security_policy_value" assert response.self_link == "self_link_value" assert response.service_bindings == ["service_bindings_value"] + assert response.service_lb_policy == "service_lb_policy_value" assert response.session_affinity == "session_affinity_value" assert response.timeout_sec == 1185 @@ -2725,6 +2727,7 @@ def test_insert_rest(request_type): "max_rate_per_endpoint": 0.22310000000000002, "max_rate_per_instance": 0.22190000000000001, "max_utilization": 0.1633, + "preference": "preference_value", } ], "cdn_policy": { @@ -2866,6 +2869,7 @@ def test_insert_rest(request_type): }, "self_link": "self_link_value", "service_bindings": ["service_bindings_value1", "service_bindings_value2"], + "service_lb_policy": "service_lb_policy_value", "session_affinity": "session_affinity_value", "subsetting": {"policy": "policy_value"}, "timeout_sec": 1185, @@ -3289,6 +3293,7 @@ def test_insert_unary_rest(request_type): "max_rate_per_endpoint": 0.22310000000000002, "max_rate_per_instance": 0.22190000000000001, "max_utilization": 0.1633, + "preference": "preference_value", } ], "cdn_policy": { @@ -3430,6 +3435,7 @@ def test_insert_unary_rest(request_type): }, "self_link": "self_link_value", "service_bindings": ["service_bindings_value1", "service_bindings_value2"], + "service_lb_policy": "service_lb_policy_value", "session_affinity": "session_affinity_value", "subsetting": {"policy": "policy_value"}, "timeout_sec": 1185, @@ -4555,6 +4561,7 @@ def test_patch_rest(request_type): "max_rate_per_endpoint": 0.22310000000000002, "max_rate_per_instance": 0.22190000000000001, "max_utilization": 0.1633, + "preference": "preference_value", } ], "cdn_policy": { @@ -4696,6 +4703,7 @@ def test_patch_rest(request_type): }, "self_link": "self_link_value", "service_bindings": ["service_bindings_value1", "service_bindings_value2"], + "service_lb_policy": "service_lb_policy_value", "session_affinity": "session_affinity_value", "subsetting": {"policy": "policy_value"}, "timeout_sec": 1185, @@ -5138,6 +5146,7 @@ def test_patch_unary_rest(request_type): "max_rate_per_endpoint": 0.22310000000000002, "max_rate_per_instance": 0.22190000000000001, "max_utilization": 0.1633, + "preference": "preference_value", } ], "cdn_policy": { @@ -5279,6 +5288,7 @@ def test_patch_unary_rest(request_type): }, "self_link": "self_link_value", "service_bindings": ["service_bindings_value1", "service_bindings_value2"], + "service_lb_policy": "service_lb_policy_value", "session_affinity": "session_affinity_value", "subsetting": {"policy": "policy_value"}, "timeout_sec": 1185, @@ -7369,6 +7379,7 @@ def test_update_rest(request_type): "max_rate_per_endpoint": 0.22310000000000002, "max_rate_per_instance": 0.22190000000000001, "max_utilization": 0.1633, + "preference": "preference_value", } ], "cdn_policy": { @@ -7510,6 +7521,7 @@ def test_update_rest(request_type): }, "self_link": "self_link_value", "service_bindings": ["service_bindings_value1", "service_bindings_value2"], + "service_lb_policy": "service_lb_policy_value", "session_affinity": "session_affinity_value", "subsetting": {"policy": "policy_value"}, "timeout_sec": 1185, @@ -7952,6 +7964,7 @@ def test_update_unary_rest(request_type): "max_rate_per_endpoint": 0.22310000000000002, "max_rate_per_instance": 0.22190000000000001, "max_utilization": 0.1633, + "preference": "preference_value", } ], "cdn_policy": { @@ -8093,6 +8106,7 @@ def test_update_unary_rest(request_type): }, "self_link": "self_link_value", "service_bindings": ["service_bindings_value1", "service_bindings_value2"], + "service_lb_policy": "service_lb_policy_value", "session_affinity": "session_affinity_value", "subsetting": {"policy": "policy_value"}, "timeout_sec": 1185, diff --git a/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_region_disks.py b/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_region_disks.py index 5b07ee05d466..186f626bb698 100644 --- a/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_region_disks.py +++ b/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_region_disks.py @@ -2605,6 +2605,9 @@ def test_create_snapshot_rest(request_type): "source_disk_encryption_key": {}, "source_disk_for_recovery_checkpoint": "source_disk_for_recovery_checkpoint_value", "source_disk_id": "source_disk_id_value", + "source_instant_snapshot": "source_instant_snapshot_value", + "source_instant_snapshot_encryption_key": {}, + "source_instant_snapshot_id": "source_instant_snapshot_id_value", "source_snapshot_schedule_policy": "source_snapshot_schedule_policy_value", "source_snapshot_schedule_policy_id": "source_snapshot_schedule_policy_id_value", "status": "status_value", @@ -3049,6 +3052,9 @@ def test_create_snapshot_unary_rest(request_type): "source_disk_encryption_key": {}, "source_disk_for_recovery_checkpoint": "source_disk_for_recovery_checkpoint_value", "source_disk_id": "source_disk_id_value", + "source_instant_snapshot": "source_instant_snapshot_value", + "source_instant_snapshot_encryption_key": {}, + "source_instant_snapshot_id": "source_instant_snapshot_id_value", "source_snapshot_schedule_policy": "source_snapshot_schedule_policy_value", "source_snapshot_schedule_policy_id": "source_snapshot_schedule_policy_id_value", "status": "status_value", @@ -4109,6 +4115,8 @@ def test_get_rest(request_type): source_disk_id="source_disk_id_value", source_image="source_image_value", source_image_id="source_image_id_value", + source_instant_snapshot="source_instant_snapshot_value", + source_instant_snapshot_id="source_instant_snapshot_id_value", source_snapshot="source_snapshot_value", source_snapshot_id="source_snapshot_id_value", source_storage_object="source_storage_object_value", @@ -4167,6 +4175,8 @@ def test_get_rest(request_type): assert response.source_disk_id == "source_disk_id_value" assert response.source_image == "source_image_value" assert response.source_image_id == "source_image_id_value" + assert response.source_instant_snapshot == "source_instant_snapshot_value" + assert response.source_instant_snapshot_id == "source_instant_snapshot_id_value" assert response.source_snapshot == "source_snapshot_value" assert response.source_snapshot_id == "source_snapshot_id_value" assert response.source_storage_object == "source_storage_object_value" @@ -4782,6 +4792,8 @@ def test_insert_rest(request_type): "source_image": "source_image_value", "source_image_encryption_key": {}, "source_image_id": "source_image_id_value", + "source_instant_snapshot": "source_instant_snapshot_value", + "source_instant_snapshot_id": "source_instant_snapshot_id_value", "source_snapshot": "source_snapshot_value", "source_snapshot_encryption_key": {}, "source_snapshot_id": "source_snapshot_id_value", @@ -5246,6 +5258,8 @@ def test_insert_unary_rest(request_type): "source_image": "source_image_value", "source_image_encryption_key": {}, "source_image_id": "source_image_id_value", + "source_instant_snapshot": "source_instant_snapshot_value", + "source_instant_snapshot_id": "source_instant_snapshot_id_value", "source_snapshot": "source_snapshot_value", "source_snapshot_encryption_key": {}, "source_snapshot_id": "source_snapshot_id_value", @@ -11606,6 +11620,8 @@ def test_update_rest(request_type): "source_image": "source_image_value", "source_image_encryption_key": {}, "source_image_id": "source_image_id_value", + "source_instant_snapshot": "source_instant_snapshot_value", + "source_instant_snapshot_id": "source_instant_snapshot_id_value", "source_snapshot": "source_snapshot_value", "source_snapshot_encryption_key": {}, "source_snapshot_id": "source_snapshot_id_value", @@ -12079,6 +12095,8 @@ def test_update_unary_rest(request_type): "source_image": "source_image_value", "source_image_encryption_key": {}, "source_image_id": "source_image_id_value", + "source_instant_snapshot": "source_instant_snapshot_value", + "source_instant_snapshot_id": "source_instant_snapshot_id_value", "source_snapshot": "source_snapshot_value", "source_snapshot_encryption_key": {}, "source_snapshot_id": "source_snapshot_id_value", diff --git a/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_region_instance_group_managers.py b/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_region_instance_group_managers.py index 7a8225aa9fb9..e09b3f945346 100644 --- a/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_region_instance_group_managers.py +++ b/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_region_instance_group_managers.py @@ -6362,7 +6362,8 @@ def test_insert_rest(request_type): "id": 205, "instance_group": "instance_group_value", "instance_lifecycle_policy": { - "force_update_on_repair": "force_update_on_repair_value" + "default_action_on_failure": "default_action_on_failure_value", + "force_update_on_repair": "force_update_on_repair_value", }, "instance_template": "instance_template_value", "kind": "kind_value", @@ -6853,7 +6854,8 @@ def test_insert_unary_rest(request_type): "id": 205, "instance_group": "instance_group_value", "instance_lifecycle_policy": { - "force_update_on_repair": "force_update_on_repair_value" + "default_action_on_failure": "default_action_on_failure_value", + "force_update_on_repair": "force_update_on_repair_value", }, "instance_template": "instance_template_value", "kind": "kind_value", @@ -8863,7 +8865,8 @@ def test_patch_rest(request_type): "id": 205, "instance_group": "instance_group_value", "instance_lifecycle_policy": { - "force_update_on_repair": "force_update_on_repair_value" + "default_action_on_failure": "default_action_on_failure_value", + "force_update_on_repair": "force_update_on_repair_value", }, "instance_template": "instance_template_value", "kind": "kind_value", @@ -9372,7 +9375,8 @@ def test_patch_unary_rest(request_type): "id": 205, "instance_group": "instance_group_value", "instance_lifecycle_policy": { - "force_update_on_repair": "force_update_on_repair_value" + "default_action_on_failure": "default_action_on_failure_value", + "force_update_on_repair": "force_update_on_repair_value", }, "instance_template": "instance_template_value", "kind": "kind_value", diff --git a/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_region_instant_snapshots.py b/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_region_instant_snapshots.py new file mode 100644 index 000000000000..cd0f8902f8e3 --- /dev/null +++ b/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_region_instant_snapshots.py @@ -0,0 +1,5610 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 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 Iterable +import json +import math + +from google.api_core import ( + future, + gapic_v1, + grpc_helpers, + grpc_helpers_async, + path_template, +) +from google.api_core import api_core_version, client_options +from google.api_core import exceptions as core_exceptions +from google.api_core import extended_operation # type: ignore +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.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 + +from google.cloud.compute_v1.services.region_instant_snapshots import ( + RegionInstantSnapshotsClient, + pagers, + transports, +) +from google.cloud.compute_v1.types import compute + + +def client_cert_source_callback(): + return b"cert bytes", b"key bytes" + + +# 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 RegionInstantSnapshotsClient._get_default_mtls_endpoint(None) is None + assert ( + RegionInstantSnapshotsClient._get_default_mtls_endpoint(api_endpoint) + == api_mtls_endpoint + ) + assert ( + RegionInstantSnapshotsClient._get_default_mtls_endpoint(api_mtls_endpoint) + == api_mtls_endpoint + ) + assert ( + RegionInstantSnapshotsClient._get_default_mtls_endpoint(sandbox_endpoint) + == sandbox_mtls_endpoint + ) + assert ( + RegionInstantSnapshotsClient._get_default_mtls_endpoint(sandbox_mtls_endpoint) + == sandbox_mtls_endpoint + ) + assert ( + RegionInstantSnapshotsClient._get_default_mtls_endpoint(non_googleapi) + == non_googleapi + ) + + +def test__read_environment_variables(): + assert RegionInstantSnapshotsClient._read_environment_variables() == ( + False, + "auto", + None, + ) + + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "true"}): + assert RegionInstantSnapshotsClient._read_environment_variables() == ( + True, + "auto", + None, + ) + + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "false"}): + assert RegionInstantSnapshotsClient._read_environment_variables() == ( + False, + "auto", + None, + ) + + with mock.patch.dict( + os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "Unsupported"} + ): + with pytest.raises(ValueError) as excinfo: + RegionInstantSnapshotsClient._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 RegionInstantSnapshotsClient._read_environment_variables() == ( + False, + "never", + None, + ) + + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}): + assert RegionInstantSnapshotsClient._read_environment_variables() == ( + False, + "always", + None, + ) + + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "auto"}): + assert RegionInstantSnapshotsClient._read_environment_variables() == ( + False, + "auto", + None, + ) + + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "Unsupported"}): + with pytest.raises(MutualTLSChannelError) as excinfo: + RegionInstantSnapshotsClient._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 RegionInstantSnapshotsClient._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 RegionInstantSnapshotsClient._get_client_cert_source(None, False) is None + assert ( + RegionInstantSnapshotsClient._get_client_cert_source( + mock_provided_cert_source, False + ) + is None + ) + assert ( + RegionInstantSnapshotsClient._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 ( + RegionInstantSnapshotsClient._get_client_cert_source(None, True) + is mock_default_cert_source + ) + assert ( + RegionInstantSnapshotsClient._get_client_cert_source( + mock_provided_cert_source, "true" + ) + is mock_provided_cert_source + ) + + +@mock.patch.object( + RegionInstantSnapshotsClient, + "_DEFAULT_ENDPOINT_TEMPLATE", + modify_default_endpoint_template(RegionInstantSnapshotsClient), +) +def test__get_api_endpoint(): + api_override = "foo.com" + mock_client_cert_source = mock.Mock() + default_universe = RegionInstantSnapshotsClient._DEFAULT_UNIVERSE + default_endpoint = RegionInstantSnapshotsClient._DEFAULT_ENDPOINT_TEMPLATE.format( + UNIVERSE_DOMAIN=default_universe + ) + mock_universe = "bar.com" + mock_endpoint = RegionInstantSnapshotsClient._DEFAULT_ENDPOINT_TEMPLATE.format( + UNIVERSE_DOMAIN=mock_universe + ) + + assert ( + RegionInstantSnapshotsClient._get_api_endpoint( + api_override, mock_client_cert_source, default_universe, "always" + ) + == api_override + ) + assert ( + RegionInstantSnapshotsClient._get_api_endpoint( + None, mock_client_cert_source, default_universe, "auto" + ) + == RegionInstantSnapshotsClient.DEFAULT_MTLS_ENDPOINT + ) + assert ( + RegionInstantSnapshotsClient._get_api_endpoint( + None, None, default_universe, "auto" + ) + == default_endpoint + ) + assert ( + RegionInstantSnapshotsClient._get_api_endpoint( + None, None, default_universe, "always" + ) + == RegionInstantSnapshotsClient.DEFAULT_MTLS_ENDPOINT + ) + assert ( + RegionInstantSnapshotsClient._get_api_endpoint( + None, mock_client_cert_source, default_universe, "always" + ) + == RegionInstantSnapshotsClient.DEFAULT_MTLS_ENDPOINT + ) + assert ( + RegionInstantSnapshotsClient._get_api_endpoint( + None, None, mock_universe, "never" + ) + == mock_endpoint + ) + assert ( + RegionInstantSnapshotsClient._get_api_endpoint( + None, None, default_universe, "never" + ) + == default_endpoint + ) + + with pytest.raises(MutualTLSChannelError) as excinfo: + RegionInstantSnapshotsClient._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 ( + RegionInstantSnapshotsClient._get_universe_domain( + client_universe_domain, universe_domain_env + ) + == client_universe_domain + ) + assert ( + RegionInstantSnapshotsClient._get_universe_domain(None, universe_domain_env) + == universe_domain_env + ) + assert ( + RegionInstantSnapshotsClient._get_universe_domain(None, None) + == RegionInstantSnapshotsClient._DEFAULT_UNIVERSE + ) + + with pytest.raises(ValueError) as excinfo: + RegionInstantSnapshotsClient._get_universe_domain("", None) + assert str(excinfo.value) == "Universe Domain cannot be an empty string." + + +@pytest.mark.parametrize( + "client_class,transport_class,transport_name", + [ + ( + RegionInstantSnapshotsClient, + transports.RegionInstantSnapshotsRestTransport, + "rest", + ), + ], +) +def test__validate_universe_domain(client_class, transport_class, transport_name): + client = client_class( + transport=transport_class(credentials=ga_credentials.AnonymousCredentials()) + ) + assert client._validate_universe_domain() == True + + # Test the case when universe is already validated. + assert client._validate_universe_domain() == True + + if transport_name == "grpc": + # Test the case where credentials are provided by the + # `local_channel_credentials`. The default universes in both match. + channel = grpc.secure_channel( + "http://localhost/", grpc.local_channel_credentials() + ) + client = client_class(transport=transport_class(channel=channel)) + assert client._validate_universe_domain() == True + + # Test the case where credentials do not exist: e.g. a transport is provided + # with no credentials. Validation should still succeed because there is no + # mismatch with non-existent credentials. + channel = grpc.secure_channel( + "http://localhost/", grpc.local_channel_credentials() + ) + transport = transport_class(channel=channel) + transport._credentials = None + client = client_class(transport=transport) + assert client._validate_universe_domain() == True + + # TODO: This is needed to cater for older versions of google-auth + # Make this test unconditional once the minimum supported version of + # google-auth becomes 2.23.0 or higher. + google_auth_major, google_auth_minor = [ + int(part) for part in google.auth.__version__.split(".")[0:2] + ] + if google_auth_major > 2 or (google_auth_major == 2 and google_auth_minor >= 23): + credentials = ga_credentials.AnonymousCredentials() + credentials._universe_domain = "foo.com" + # Test the case when there is a universe mismatch from the credentials. + client = client_class(transport=transport_class(credentials=credentials)) + with pytest.raises(ValueError) as excinfo: + client._validate_universe_domain() + assert ( + str(excinfo.value) + == "The configured universe domain (googleapis.com) does not match the universe domain found in the credentials (foo.com). If you haven't configured the universe domain explicitly, `googleapis.com` is the default." + ) + + # Test the case when there is a universe mismatch from the client. + # + # TODO: Make this test unconditional once the minimum supported version of + # google-api-core becomes 2.15.0 or higher. + api_core_major, api_core_minor = [ + int(part) for part in api_core_version.__version__.split(".")[0:2] + ] + if api_core_major > 2 or (api_core_major == 2 and api_core_minor >= 15): + client = client_class( + client_options={"universe_domain": "bar.com"}, + transport=transport_class( + credentials=ga_credentials.AnonymousCredentials(), + ), + ) + with pytest.raises(ValueError) as excinfo: + client._validate_universe_domain() + assert ( + str(excinfo.value) + == "The configured universe domain (bar.com) does not match the universe domain found in the credentials (googleapis.com). If you haven't configured the universe domain explicitly, `googleapis.com` is the default." + ) + + # Test that ValueError is raised if universe_domain is provided via client options and credentials is None + with pytest.raises(ValueError): + client._compare_universes("foo.bar", None) + + +@pytest.mark.parametrize( + "client_class,transport_name", + [ + (RegionInstantSnapshotsClient, "rest"), + ], +) +def test_region_instant_snapshots_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.RegionInstantSnapshotsRestTransport, "rest"), + ], +) +def test_region_instant_snapshots_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", + [ + (RegionInstantSnapshotsClient, "rest"), + ], +) +def test_region_instant_snapshots_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_region_instant_snapshots_client_get_transport_class(): + transport = RegionInstantSnapshotsClient.get_transport_class() + available_transports = [ + transports.RegionInstantSnapshotsRestTransport, + ] + assert transport in available_transports + + transport = RegionInstantSnapshotsClient.get_transport_class("rest") + assert transport == transports.RegionInstantSnapshotsRestTransport + + +@pytest.mark.parametrize( + "client_class,transport_class,transport_name", + [ + ( + RegionInstantSnapshotsClient, + transports.RegionInstantSnapshotsRestTransport, + "rest", + ), + ], +) +@mock.patch.object( + RegionInstantSnapshotsClient, + "_DEFAULT_ENDPOINT_TEMPLATE", + modify_default_endpoint_template(RegionInstantSnapshotsClient), +) +def test_region_instant_snapshots_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(RegionInstantSnapshotsClient, "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(RegionInstantSnapshotsClient, "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", + [ + ( + RegionInstantSnapshotsClient, + transports.RegionInstantSnapshotsRestTransport, + "rest", + "true", + ), + ( + RegionInstantSnapshotsClient, + transports.RegionInstantSnapshotsRestTransport, + "rest", + "false", + ), + ], +) +@mock.patch.object( + RegionInstantSnapshotsClient, + "_DEFAULT_ENDPOINT_TEMPLATE", + modify_default_endpoint_template(RegionInstantSnapshotsClient), +) +@mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "auto"}) +def test_region_instant_snapshots_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", [RegionInstantSnapshotsClient]) +@mock.patch.object( + RegionInstantSnapshotsClient, + "DEFAULT_ENDPOINT", + modify_default_endpoint(RegionInstantSnapshotsClient), +) +def test_region_instant_snapshots_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", [RegionInstantSnapshotsClient]) +@mock.patch.object( + RegionInstantSnapshotsClient, + "_DEFAULT_ENDPOINT_TEMPLATE", + modify_default_endpoint_template(RegionInstantSnapshotsClient), +) +def test_region_instant_snapshots_client_client_api_endpoint(client_class): + mock_client_cert_source = client_cert_source_callback + api_override = "foo.com" + default_universe = RegionInstantSnapshotsClient._DEFAULT_UNIVERSE + default_endpoint = RegionInstantSnapshotsClient._DEFAULT_ENDPOINT_TEMPLATE.format( + UNIVERSE_DOMAIN=default_universe + ) + mock_universe = "bar.com" + mock_endpoint = RegionInstantSnapshotsClient._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", + [ + ( + RegionInstantSnapshotsClient, + transports.RegionInstantSnapshotsRestTransport, + "rest", + ), + ], +) +def test_region_instant_snapshots_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", + [ + ( + RegionInstantSnapshotsClient, + transports.RegionInstantSnapshotsRestTransport, + "rest", + None, + ), + ], +) +def test_region_instant_snapshots_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, + ) + + +@pytest.mark.parametrize( + "request_type", + [ + compute.DeleteRegionInstantSnapshotRequest, + dict, + ], +) +def test_delete_rest(request_type): + client = RegionInstantSnapshotsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # send a request that will satisfy transcoding + request_init = { + "project": "sample1", + "region": "sample2", + "instant_snapshot": "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.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 = 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 + 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" + + +def test_delete_rest_required_fields( + request_type=compute.DeleteRegionInstantSnapshotRequest, +): + transport_class = transports.RegionInstantSnapshotsRestTransport + + request_init = {} + request_init["instant_snapshot"] = "" + request_init["project"] = "" + request_init["region"] = "" + 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["instantSnapshot"] = "instant_snapshot_value" + jsonified_request["project"] = "project_value" + jsonified_request["region"] = "region_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 "instantSnapshot" in jsonified_request + assert jsonified_request["instantSnapshot"] == "instant_snapshot_value" + assert "project" in jsonified_request + assert jsonified_request["project"] == "project_value" + assert "region" in jsonified_request + assert jsonified_request["region"] == "region_value" + + client = RegionInstantSnapshotsClient( + 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 + + 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.RegionInstantSnapshotsRestTransport( + credentials=ga_credentials.AnonymousCredentials + ) + + unset_fields = transport.delete._get_unset_required_fields({}) + assert set(unset_fields) == ( + set(("requestId",)) + & set( + ( + "instantSnapshot", + "project", + "region", + ) + ) + ) + + +@pytest.mark.parametrize("null_interceptor", [True, False]) +def test_delete_rest_interceptors(null_interceptor): + transport = transports.RegionInstantSnapshotsRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + interceptor=None + if null_interceptor + else transports.RegionInstantSnapshotsRestInterceptor(), + ) + client = RegionInstantSnapshotsClient(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.RegionInstantSnapshotsRestInterceptor, "post_delete" + ) as post, mock.patch.object( + transports.RegionInstantSnapshotsRestInterceptor, "pre_delete" + ) as pre: + pre.assert_not_called() + post.assert_not_called() + pb_message = compute.DeleteRegionInstantSnapshotRequest.pb( + compute.DeleteRegionInstantSnapshotRequest() + ) + transcode.return_value = { + "method": "post", + "uri": "my_uri", + "body": pb_message, + "query_params": pb_message, + } + + req.return_value = Response() + req.return_value.status_code = 200 + req.return_value.request = PreparedRequest() + req.return_value._content = compute.Operation.to_json(compute.Operation()) + + request = compute.DeleteRegionInstantSnapshotRequest() + metadata = [ + ("key", "val"), + ("cephalopod", "squid"), + ] + pre.return_value = request, metadata + post.return_value = compute.Operation() + + client.delete( + request, + metadata=[ + ("key", "val"), + ("cephalopod", "squid"), + ], + ) + + pre.assert_called_once() + post.assert_called_once() + + +def test_delete_rest_bad_request( + transport: str = "rest", request_type=compute.DeleteRegionInstantSnapshotRequest +): + client = RegionInstantSnapshotsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # send a request that will satisfy transcoding + request_init = { + "project": "sample1", + "region": "sample2", + "instant_snapshot": "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 = Response() + response_value.status_code = 400 + response_value.request = Request() + req.return_value = response_value + client.delete(request) + + +def test_delete_rest_flattened(): + client = RegionInstantSnapshotsClient( + 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", + "region": "sample2", + "instant_snapshot": "sample3", + } + + # get truthy value for each flattened field + mock_args = dict( + project="project_value", + region="region_value", + instant_snapshot="instant_snapshot_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 + + 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}/regions/{region}/instantSnapshots/{instant_snapshot}" + % client.transport._host, + args[1], + ) + + +def test_delete_rest_flattened_error(transport: str = "rest"): + client = RegionInstantSnapshotsClient( + 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.DeleteRegionInstantSnapshotRequest(), + project="project_value", + region="region_value", + instant_snapshot="instant_snapshot_value", + ) + + +def test_delete_rest_error(): + client = RegionInstantSnapshotsClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + + +@pytest.mark.parametrize( + "request_type", + [ + compute.DeleteRegionInstantSnapshotRequest, + dict, + ], +) +def test_delete_unary_rest(request_type): + client = RegionInstantSnapshotsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # send a request that will satisfy transcoding + request_init = { + "project": "sample1", + "region": "sample2", + "instant_snapshot": "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.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 = 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 + response = client.delete_unary(request) + + # Establish that the response is the type that we expect. + assert isinstance(response, compute.Operation) + + +def test_delete_unary_rest_required_fields( + request_type=compute.DeleteRegionInstantSnapshotRequest, +): + transport_class = transports.RegionInstantSnapshotsRestTransport + + request_init = {} + request_init["instant_snapshot"] = "" + request_init["project"] = "" + request_init["region"] = "" + 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["instantSnapshot"] = "instant_snapshot_value" + jsonified_request["project"] = "project_value" + jsonified_request["region"] = "region_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 "instantSnapshot" in jsonified_request + assert jsonified_request["instantSnapshot"] == "instant_snapshot_value" + assert "project" in jsonified_request + assert jsonified_request["project"] == "project_value" + assert "region" in jsonified_request + assert jsonified_request["region"] == "region_value" + + client = RegionInstantSnapshotsClient( + 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 + + 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.RegionInstantSnapshotsRestTransport( + credentials=ga_credentials.AnonymousCredentials + ) + + unset_fields = transport.delete._get_unset_required_fields({}) + assert set(unset_fields) == ( + set(("requestId",)) + & set( + ( + "instantSnapshot", + "project", + "region", + ) + ) + ) + + +@pytest.mark.parametrize("null_interceptor", [True, False]) +def test_delete_unary_rest_interceptors(null_interceptor): + transport = transports.RegionInstantSnapshotsRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + interceptor=None + if null_interceptor + else transports.RegionInstantSnapshotsRestInterceptor(), + ) + client = RegionInstantSnapshotsClient(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.RegionInstantSnapshotsRestInterceptor, "post_delete" + ) as post, mock.patch.object( + transports.RegionInstantSnapshotsRestInterceptor, "pre_delete" + ) as pre: + pre.assert_not_called() + post.assert_not_called() + pb_message = compute.DeleteRegionInstantSnapshotRequest.pb( + compute.DeleteRegionInstantSnapshotRequest() + ) + transcode.return_value = { + "method": "post", + "uri": "my_uri", + "body": pb_message, + "query_params": pb_message, + } + + req.return_value = Response() + req.return_value.status_code = 200 + req.return_value.request = PreparedRequest() + req.return_value._content = compute.Operation.to_json(compute.Operation()) + + request = compute.DeleteRegionInstantSnapshotRequest() + metadata = [ + ("key", "val"), + ("cephalopod", "squid"), + ] + pre.return_value = request, metadata + post.return_value = compute.Operation() + + client.delete_unary( + request, + metadata=[ + ("key", "val"), + ("cephalopod", "squid"), + ], + ) + + pre.assert_called_once() + post.assert_called_once() + + +def test_delete_unary_rest_bad_request( + transport: str = "rest", request_type=compute.DeleteRegionInstantSnapshotRequest +): + client = RegionInstantSnapshotsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # send a request that will satisfy transcoding + request_init = { + "project": "sample1", + "region": "sample2", + "instant_snapshot": "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 = Response() + response_value.status_code = 400 + response_value.request = Request() + req.return_value = response_value + client.delete_unary(request) + + +def test_delete_unary_rest_flattened(): + client = RegionInstantSnapshotsClient( + 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", + "region": "sample2", + "instant_snapshot": "sample3", + } + + # get truthy value for each flattened field + mock_args = dict( + project="project_value", + region="region_value", + instant_snapshot="instant_snapshot_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 + + 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}/regions/{region}/instantSnapshots/{instant_snapshot}" + % client.transport._host, + args[1], + ) + + +def test_delete_unary_rest_flattened_error(transport: str = "rest"): + client = RegionInstantSnapshotsClient( + 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.DeleteRegionInstantSnapshotRequest(), + project="project_value", + region="region_value", + instant_snapshot="instant_snapshot_value", + ) + + +def test_delete_unary_rest_error(): + client = RegionInstantSnapshotsClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + + +@pytest.mark.parametrize( + "request_type", + [ + compute.GetRegionInstantSnapshotRequest, + dict, + ], +) +def test_get_rest(request_type): + client = RegionInstantSnapshotsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # send a request that will satisfy transcoding + request_init = { + "project": "sample1", + "region": "sample2", + "instant_snapshot": "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.InstantSnapshot( + architecture="architecture_value", + creation_timestamp="creation_timestamp_value", + description="description_value", + disk_size_gb=1261, + id=205, + kind="kind_value", + label_fingerprint="label_fingerprint_value", + name="name_value", + region="region_value", + satisfies_pzi=True, + satisfies_pzs=True, + self_link="self_link_value", + self_link_with_id="self_link_with_id_value", + source_disk="source_disk_value", + source_disk_id="source_disk_id_value", + status="status_value", + zone="zone_value", + ) + + # 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.InstantSnapshot.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 + response = client.get(request) + + # Establish that the response is the type that we expect. + assert isinstance(response, compute.InstantSnapshot) + assert response.architecture == "architecture_value" + assert response.creation_timestamp == "creation_timestamp_value" + assert response.description == "description_value" + assert response.disk_size_gb == 1261 + assert response.id == 205 + assert response.kind == "kind_value" + assert response.label_fingerprint == "label_fingerprint_value" + assert response.name == "name_value" + assert response.region == "region_value" + assert response.satisfies_pzi is True + assert response.satisfies_pzs is True + assert response.self_link == "self_link_value" + assert response.self_link_with_id == "self_link_with_id_value" + assert response.source_disk == "source_disk_value" + assert response.source_disk_id == "source_disk_id_value" + assert response.status == "status_value" + assert response.zone == "zone_value" + + +def test_get_rest_required_fields(request_type=compute.GetRegionInstantSnapshotRequest): + transport_class = transports.RegionInstantSnapshotsRestTransport + + request_init = {} + request_init["instant_snapshot"] = "" + request_init["project"] = "" + request_init["region"] = "" + 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["instantSnapshot"] = "instant_snapshot_value" + jsonified_request["project"] = "project_value" + jsonified_request["region"] = "region_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 "instantSnapshot" in jsonified_request + assert jsonified_request["instantSnapshot"] == "instant_snapshot_value" + assert "project" in jsonified_request + assert jsonified_request["project"] == "project_value" + assert "region" in jsonified_request + assert jsonified_request["region"] == "region_value" + + client = RegionInstantSnapshotsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + request = request_type(**request_init) + + # Designate an appropriate value for the returned response. + return_value = compute.InstantSnapshot() + # 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.InstantSnapshot.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 + + 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.RegionInstantSnapshotsRestTransport( + credentials=ga_credentials.AnonymousCredentials + ) + + unset_fields = transport.get._get_unset_required_fields({}) + assert set(unset_fields) == ( + set(()) + & set( + ( + "instantSnapshot", + "project", + "region", + ) + ) + ) + + +@pytest.mark.parametrize("null_interceptor", [True, False]) +def test_get_rest_interceptors(null_interceptor): + transport = transports.RegionInstantSnapshotsRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + interceptor=None + if null_interceptor + else transports.RegionInstantSnapshotsRestInterceptor(), + ) + client = RegionInstantSnapshotsClient(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.RegionInstantSnapshotsRestInterceptor, "post_get" + ) as post, mock.patch.object( + transports.RegionInstantSnapshotsRestInterceptor, "pre_get" + ) as pre: + pre.assert_not_called() + post.assert_not_called() + pb_message = compute.GetRegionInstantSnapshotRequest.pb( + compute.GetRegionInstantSnapshotRequest() + ) + transcode.return_value = { + "method": "post", + "uri": "my_uri", + "body": pb_message, + "query_params": pb_message, + } + + req.return_value = Response() + req.return_value.status_code = 200 + req.return_value.request = PreparedRequest() + req.return_value._content = compute.InstantSnapshot.to_json( + compute.InstantSnapshot() + ) + + request = compute.GetRegionInstantSnapshotRequest() + metadata = [ + ("key", "val"), + ("cephalopod", "squid"), + ] + pre.return_value = request, metadata + post.return_value = compute.InstantSnapshot() + + client.get( + request, + metadata=[ + ("key", "val"), + ("cephalopod", "squid"), + ], + ) + + pre.assert_called_once() + post.assert_called_once() + + +def test_get_rest_bad_request( + transport: str = "rest", request_type=compute.GetRegionInstantSnapshotRequest +): + client = RegionInstantSnapshotsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # send a request that will satisfy transcoding + request_init = { + "project": "sample1", + "region": "sample2", + "instant_snapshot": "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 = Response() + response_value.status_code = 400 + response_value.request = Request() + req.return_value = response_value + client.get(request) + + +def test_get_rest_flattened(): + client = RegionInstantSnapshotsClient( + 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.InstantSnapshot() + + # get arguments that satisfy an http rule for this method + sample_request = { + "project": "sample1", + "region": "sample2", + "instant_snapshot": "sample3", + } + + # get truthy value for each flattened field + mock_args = dict( + project="project_value", + region="region_value", + instant_snapshot="instant_snapshot_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.InstantSnapshot.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 + + 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}/regions/{region}/instantSnapshots/{instant_snapshot}" + % client.transport._host, + args[1], + ) + + +def test_get_rest_flattened_error(transport: str = "rest"): + client = RegionInstantSnapshotsClient( + 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.GetRegionInstantSnapshotRequest(), + project="project_value", + region="region_value", + instant_snapshot="instant_snapshot_value", + ) + + +def test_get_rest_error(): + client = RegionInstantSnapshotsClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + + +@pytest.mark.parametrize( + "request_type", + [ + compute.GetIamPolicyRegionInstantSnapshotRequest, + dict, + ], +) +def test_get_iam_policy_rest(request_type): + client = RegionInstantSnapshotsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # send a request that will satisfy transcoding + request_init = {"project": "sample1", "region": "sample2", "resource": "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.Policy( + etag="etag_value", + iam_owned=True, + version=774, + ) + + # 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 + 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 + + +def test_get_iam_policy_rest_required_fields( + request_type=compute.GetIamPolicyRegionInstantSnapshotRequest, +): + transport_class = transports.RegionInstantSnapshotsRestTransport + + request_init = {} + request_init["project"] = "" + request_init["region"] = "" + 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["region"] = "region_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 "region" in jsonified_request + assert jsonified_request["region"] == "region_value" + assert "resource" in jsonified_request + assert jsonified_request["resource"] == "resource_value" + + client = RegionInstantSnapshotsClient( + 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 + + 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.RegionInstantSnapshotsRestTransport( + credentials=ga_credentials.AnonymousCredentials + ) + + unset_fields = transport.get_iam_policy._get_unset_required_fields({}) + assert set(unset_fields) == ( + set(("optionsRequestedPolicyVersion",)) + & set( + ( + "project", + "region", + "resource", + ) + ) + ) + + +@pytest.mark.parametrize("null_interceptor", [True, False]) +def test_get_iam_policy_rest_interceptors(null_interceptor): + transport = transports.RegionInstantSnapshotsRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + interceptor=None + if null_interceptor + else transports.RegionInstantSnapshotsRestInterceptor(), + ) + client = RegionInstantSnapshotsClient(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.RegionInstantSnapshotsRestInterceptor, "post_get_iam_policy" + ) as post, mock.patch.object( + transports.RegionInstantSnapshotsRestInterceptor, "pre_get_iam_policy" + ) as pre: + pre.assert_not_called() + post.assert_not_called() + pb_message = compute.GetIamPolicyRegionInstantSnapshotRequest.pb( + compute.GetIamPolicyRegionInstantSnapshotRequest() + ) + transcode.return_value = { + "method": "post", + "uri": "my_uri", + "body": pb_message, + "query_params": pb_message, + } + + req.return_value = Response() + req.return_value.status_code = 200 + req.return_value.request = PreparedRequest() + req.return_value._content = compute.Policy.to_json(compute.Policy()) + + request = compute.GetIamPolicyRegionInstantSnapshotRequest() + metadata = [ + ("key", "val"), + ("cephalopod", "squid"), + ] + pre.return_value = request, metadata + post.return_value = compute.Policy() + + client.get_iam_policy( + request, + metadata=[ + ("key", "val"), + ("cephalopod", "squid"), + ], + ) + + pre.assert_called_once() + post.assert_called_once() + + +def test_get_iam_policy_rest_bad_request( + transport: str = "rest", + request_type=compute.GetIamPolicyRegionInstantSnapshotRequest, +): + client = RegionInstantSnapshotsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # send a request that will satisfy transcoding + request_init = {"project": "sample1", "region": "sample2", "resource": "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 = Response() + response_value.status_code = 400 + response_value.request = Request() + req.return_value = response_value + client.get_iam_policy(request) + + +def test_get_iam_policy_rest_flattened(): + client = RegionInstantSnapshotsClient( + 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", + "region": "sample2", + "resource": "sample3", + } + + # get truthy value for each flattened field + mock_args = dict( + project="project_value", + region="region_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 + + 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}/regions/{region}/instantSnapshots/{resource}/getIamPolicy" + % client.transport._host, + args[1], + ) + + +def test_get_iam_policy_rest_flattened_error(transport: str = "rest"): + client = RegionInstantSnapshotsClient( + 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.GetIamPolicyRegionInstantSnapshotRequest(), + project="project_value", + region="region_value", + resource="resource_value", + ) + + +def test_get_iam_policy_rest_error(): + client = RegionInstantSnapshotsClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + + +@pytest.mark.parametrize( + "request_type", + [ + compute.InsertRegionInstantSnapshotRequest, + dict, + ], +) +def test_insert_rest(request_type): + client = RegionInstantSnapshotsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # send a request that will satisfy transcoding + request_init = {"project": "sample1", "region": "sample2"} + request_init["instant_snapshot_resource"] = { + "architecture": "architecture_value", + "creation_timestamp": "creation_timestamp_value", + "description": "description_value", + "disk_size_gb": 1261, + "id": 205, + "kind": "kind_value", + "label_fingerprint": "label_fingerprint_value", + "labels": {}, + "name": "name_value", + "region": "region_value", + "resource_status": {"storage_size_bytes": 1941}, + "satisfies_pzi": True, + "satisfies_pzs": True, + "self_link": "self_link_value", + "self_link_with_id": "self_link_with_id_value", + "source_disk": "source_disk_value", + "source_disk_id": "source_disk_id_value", + "status": "status_value", + "zone": "zone_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.InsertRegionInstantSnapshotRequest.meta.fields[ + "instant_snapshot_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[ + "instant_snapshot_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["instant_snapshot_resource"][field]) + ): + del request_init["instant_snapshot_resource"][field][i][subfield] + else: + del request_init["instant_snapshot_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 = 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 + 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" + + +def test_insert_rest_required_fields( + request_type=compute.InsertRegionInstantSnapshotRequest, +): + transport_class = transports.RegionInstantSnapshotsRestTransport + + request_init = {} + request_init["project"] = "" + request_init["region"] = "" + 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" + jsonified_request["region"] = "region_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" + assert "region" in jsonified_request + assert jsonified_request["region"] == "region_value" + + client = RegionInstantSnapshotsClient( + 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 + + 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.RegionInstantSnapshotsRestTransport( + credentials=ga_credentials.AnonymousCredentials + ) + + unset_fields = transport.insert._get_unset_required_fields({}) + assert set(unset_fields) == ( + set(("requestId",)) + & set( + ( + "instantSnapshotResource", + "project", + "region", + ) + ) + ) + + +@pytest.mark.parametrize("null_interceptor", [True, False]) +def test_insert_rest_interceptors(null_interceptor): + transport = transports.RegionInstantSnapshotsRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + interceptor=None + if null_interceptor + else transports.RegionInstantSnapshotsRestInterceptor(), + ) + client = RegionInstantSnapshotsClient(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.RegionInstantSnapshotsRestInterceptor, "post_insert" + ) as post, mock.patch.object( + transports.RegionInstantSnapshotsRestInterceptor, "pre_insert" + ) as pre: + pre.assert_not_called() + post.assert_not_called() + pb_message = compute.InsertRegionInstantSnapshotRequest.pb( + compute.InsertRegionInstantSnapshotRequest() + ) + transcode.return_value = { + "method": "post", + "uri": "my_uri", + "body": pb_message, + "query_params": pb_message, + } + + req.return_value = Response() + req.return_value.status_code = 200 + req.return_value.request = PreparedRequest() + req.return_value._content = compute.Operation.to_json(compute.Operation()) + + request = compute.InsertRegionInstantSnapshotRequest() + metadata = [ + ("key", "val"), + ("cephalopod", "squid"), + ] + pre.return_value = request, metadata + post.return_value = compute.Operation() + + client.insert( + request, + metadata=[ + ("key", "val"), + ("cephalopod", "squid"), + ], + ) + + pre.assert_called_once() + post.assert_called_once() + + +def test_insert_rest_bad_request( + transport: str = "rest", request_type=compute.InsertRegionInstantSnapshotRequest +): + client = RegionInstantSnapshotsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # send a request that will satisfy transcoding + request_init = {"project": "sample1", "region": "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 = Response() + response_value.status_code = 400 + response_value.request = Request() + req.return_value = response_value + client.insert(request) + + +def test_insert_rest_flattened(): + client = RegionInstantSnapshotsClient( + 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", "region": "sample2"} + + # get truthy value for each flattened field + mock_args = dict( + project="project_value", + region="region_value", + instant_snapshot_resource=compute.InstantSnapshot( + architecture="architecture_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 + + 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}/regions/{region}/instantSnapshots" + % client.transport._host, + args[1], + ) + + +def test_insert_rest_flattened_error(transport: str = "rest"): + client = RegionInstantSnapshotsClient( + 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.InsertRegionInstantSnapshotRequest(), + project="project_value", + region="region_value", + instant_snapshot_resource=compute.InstantSnapshot( + architecture="architecture_value" + ), + ) + + +def test_insert_rest_error(): + client = RegionInstantSnapshotsClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + + +@pytest.mark.parametrize( + "request_type", + [ + compute.InsertRegionInstantSnapshotRequest, + dict, + ], +) +def test_insert_unary_rest(request_type): + client = RegionInstantSnapshotsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # send a request that will satisfy transcoding + request_init = {"project": "sample1", "region": "sample2"} + request_init["instant_snapshot_resource"] = { + "architecture": "architecture_value", + "creation_timestamp": "creation_timestamp_value", + "description": "description_value", + "disk_size_gb": 1261, + "id": 205, + "kind": "kind_value", + "label_fingerprint": "label_fingerprint_value", + "labels": {}, + "name": "name_value", + "region": "region_value", + "resource_status": {"storage_size_bytes": 1941}, + "satisfies_pzi": True, + "satisfies_pzs": True, + "self_link": "self_link_value", + "self_link_with_id": "self_link_with_id_value", + "source_disk": "source_disk_value", + "source_disk_id": "source_disk_id_value", + "status": "status_value", + "zone": "zone_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.InsertRegionInstantSnapshotRequest.meta.fields[ + "instant_snapshot_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[ + "instant_snapshot_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["instant_snapshot_resource"][field]) + ): + del request_init["instant_snapshot_resource"][field][i][subfield] + else: + del request_init["instant_snapshot_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 = 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 + response = client.insert_unary(request) + + # Establish that the response is the type that we expect. + assert isinstance(response, compute.Operation) + + +def test_insert_unary_rest_required_fields( + request_type=compute.InsertRegionInstantSnapshotRequest, +): + transport_class = transports.RegionInstantSnapshotsRestTransport + + request_init = {} + request_init["project"] = "" + request_init["region"] = "" + 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" + jsonified_request["region"] = "region_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" + assert "region" in jsonified_request + assert jsonified_request["region"] == "region_value" + + client = RegionInstantSnapshotsClient( + 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 + + 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.RegionInstantSnapshotsRestTransport( + credentials=ga_credentials.AnonymousCredentials + ) + + unset_fields = transport.insert._get_unset_required_fields({}) + assert set(unset_fields) == ( + set(("requestId",)) + & set( + ( + "instantSnapshotResource", + "project", + "region", + ) + ) + ) + + +@pytest.mark.parametrize("null_interceptor", [True, False]) +def test_insert_unary_rest_interceptors(null_interceptor): + transport = transports.RegionInstantSnapshotsRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + interceptor=None + if null_interceptor + else transports.RegionInstantSnapshotsRestInterceptor(), + ) + client = RegionInstantSnapshotsClient(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.RegionInstantSnapshotsRestInterceptor, "post_insert" + ) as post, mock.patch.object( + transports.RegionInstantSnapshotsRestInterceptor, "pre_insert" + ) as pre: + pre.assert_not_called() + post.assert_not_called() + pb_message = compute.InsertRegionInstantSnapshotRequest.pb( + compute.InsertRegionInstantSnapshotRequest() + ) + transcode.return_value = { + "method": "post", + "uri": "my_uri", + "body": pb_message, + "query_params": pb_message, + } + + req.return_value = Response() + req.return_value.status_code = 200 + req.return_value.request = PreparedRequest() + req.return_value._content = compute.Operation.to_json(compute.Operation()) + + request = compute.InsertRegionInstantSnapshotRequest() + metadata = [ + ("key", "val"), + ("cephalopod", "squid"), + ] + pre.return_value = request, metadata + post.return_value = compute.Operation() + + client.insert_unary( + request, + metadata=[ + ("key", "val"), + ("cephalopod", "squid"), + ], + ) + + pre.assert_called_once() + post.assert_called_once() + + +def test_insert_unary_rest_bad_request( + transport: str = "rest", request_type=compute.InsertRegionInstantSnapshotRequest +): + client = RegionInstantSnapshotsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # send a request that will satisfy transcoding + request_init = {"project": "sample1", "region": "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 = Response() + response_value.status_code = 400 + response_value.request = Request() + req.return_value = response_value + client.insert_unary(request) + + +def test_insert_unary_rest_flattened(): + client = RegionInstantSnapshotsClient( + 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", "region": "sample2"} + + # get truthy value for each flattened field + mock_args = dict( + project="project_value", + region="region_value", + instant_snapshot_resource=compute.InstantSnapshot( + architecture="architecture_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 + + 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}/regions/{region}/instantSnapshots" + % client.transport._host, + args[1], + ) + + +def test_insert_unary_rest_flattened_error(transport: str = "rest"): + client = RegionInstantSnapshotsClient( + 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.InsertRegionInstantSnapshotRequest(), + project="project_value", + region="region_value", + instant_snapshot_resource=compute.InstantSnapshot( + architecture="architecture_value" + ), + ) + + +def test_insert_unary_rest_error(): + client = RegionInstantSnapshotsClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + + +@pytest.mark.parametrize( + "request_type", + [ + compute.ListRegionInstantSnapshotsRequest, + dict, + ], +) +def test_list_rest(request_type): + client = RegionInstantSnapshotsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # send a request that will satisfy transcoding + request_init = {"project": "sample1", "region": "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.InstantSnapshotList( + 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 = Response() + response_value.status_code = 200 + # Convert return value to protobuf type + return_value = compute.InstantSnapshotList.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 + 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" + + +def test_list_rest_required_fields( + request_type=compute.ListRegionInstantSnapshotsRequest, +): + transport_class = transports.RegionInstantSnapshotsRestTransport + + request_init = {} + request_init["project"] = "" + request_init["region"] = "" + 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" + jsonified_request["region"] = "region_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" + assert "region" in jsonified_request + assert jsonified_request["region"] == "region_value" + + client = RegionInstantSnapshotsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + request = request_type(**request_init) + + # Designate an appropriate value for the returned response. + return_value = compute.InstantSnapshotList() + # 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.InstantSnapshotList.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 + + 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.RegionInstantSnapshotsRestTransport( + credentials=ga_credentials.AnonymousCredentials + ) + + unset_fields = transport.list._get_unset_required_fields({}) + assert set(unset_fields) == ( + set( + ( + "filter", + "maxResults", + "orderBy", + "pageToken", + "returnPartialSuccess", + ) + ) + & set( + ( + "project", + "region", + ) + ) + ) + + +@pytest.mark.parametrize("null_interceptor", [True, False]) +def test_list_rest_interceptors(null_interceptor): + transport = transports.RegionInstantSnapshotsRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + interceptor=None + if null_interceptor + else transports.RegionInstantSnapshotsRestInterceptor(), + ) + client = RegionInstantSnapshotsClient(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.RegionInstantSnapshotsRestInterceptor, "post_list" + ) as post, mock.patch.object( + transports.RegionInstantSnapshotsRestInterceptor, "pre_list" + ) as pre: + pre.assert_not_called() + post.assert_not_called() + pb_message = compute.ListRegionInstantSnapshotsRequest.pb( + compute.ListRegionInstantSnapshotsRequest() + ) + transcode.return_value = { + "method": "post", + "uri": "my_uri", + "body": pb_message, + "query_params": pb_message, + } + + req.return_value = Response() + req.return_value.status_code = 200 + req.return_value.request = PreparedRequest() + req.return_value._content = compute.InstantSnapshotList.to_json( + compute.InstantSnapshotList() + ) + + request = compute.ListRegionInstantSnapshotsRequest() + metadata = [ + ("key", "val"), + ("cephalopod", "squid"), + ] + pre.return_value = request, metadata + post.return_value = compute.InstantSnapshotList() + + client.list( + request, + metadata=[ + ("key", "val"), + ("cephalopod", "squid"), + ], + ) + + pre.assert_called_once() + post.assert_called_once() + + +def test_list_rest_bad_request( + transport: str = "rest", request_type=compute.ListRegionInstantSnapshotsRequest +): + client = RegionInstantSnapshotsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # send a request that will satisfy transcoding + request_init = {"project": "sample1", "region": "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 = Response() + response_value.status_code = 400 + response_value.request = Request() + req.return_value = response_value + client.list(request) + + +def test_list_rest_flattened(): + client = RegionInstantSnapshotsClient( + 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.InstantSnapshotList() + + # get arguments that satisfy an http rule for this method + sample_request = {"project": "sample1", "region": "sample2"} + + # get truthy value for each flattened field + mock_args = dict( + project="project_value", + region="region_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.InstantSnapshotList.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 + + 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}/regions/{region}/instantSnapshots" + % client.transport._host, + args[1], + ) + + +def test_list_rest_flattened_error(transport: str = "rest"): + client = RegionInstantSnapshotsClient( + 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.ListRegionInstantSnapshotsRequest(), + project="project_value", + region="region_value", + ) + + +def test_list_rest_pager(transport: str = "rest"): + client = RegionInstantSnapshotsClient( + 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.InstantSnapshotList( + items=[ + compute.InstantSnapshot(), + compute.InstantSnapshot(), + compute.InstantSnapshot(), + ], + next_page_token="abc", + ), + compute.InstantSnapshotList( + items=[], + next_page_token="def", + ), + compute.InstantSnapshotList( + items=[ + compute.InstantSnapshot(), + ], + next_page_token="ghi", + ), + compute.InstantSnapshotList( + items=[ + compute.InstantSnapshot(), + compute.InstantSnapshot(), + ], + ), + ) + # Two responses for two calls + response = response + response + + # Wrap the values into proper Response objs + response = tuple(compute.InstantSnapshotList.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", "region": "sample2"} + + pager = client.list(request=sample_request) + + results = list(pager) + assert len(results) == 6 + assert all(isinstance(i, compute.InstantSnapshot) 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 + + +@pytest.mark.parametrize( + "request_type", + [ + compute.SetIamPolicyRegionInstantSnapshotRequest, + dict, + ], +) +def test_set_iam_policy_rest(request_type): + client = RegionInstantSnapshotsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # send a request that will satisfy transcoding + request_init = {"project": "sample1", "region": "sample2", "resource": "sample3"} + request_init["region_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, + "rules": [ + { + "action": "action_value", + "conditions": [ + { + "iam": "iam_value", + "op": "op_value", + "svc": "svc_value", + "sys": "sys_value", + "values": ["values_value1", "values_value2"], + } + ], + "description": "description_value", + "ins": ["ins_value1", "ins_value2"], + "log_configs": [ + { + "cloud_audit": { + "authorization_logging_options": { + "permission_type": "permission_type_value" + }, + "log_name": "log_name_value", + }, + "counter": { + "custom_fields": [ + {"name": "name_value", "value": "value_value"} + ], + "field": "field_value", + "metric": "metric_value", + }, + "data_access": {"log_mode": "log_mode_value"}, + } + ], + "not_ins": ["not_ins_value1", "not_ins_value2"], + "permissions": ["permissions_value1", "permissions_value2"], + } + ], + "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.SetIamPolicyRegionInstantSnapshotRequest.meta.fields[ + "region_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[ + "region_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["region_set_policy_request_resource"][field]) + ): + del request_init["region_set_policy_request_resource"][field][i][ + subfield + ] + else: + del request_init["region_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 = 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 + 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 + + +def test_set_iam_policy_rest_required_fields( + request_type=compute.SetIamPolicyRegionInstantSnapshotRequest, +): + transport_class = transports.RegionInstantSnapshotsRestTransport + + request_init = {} + request_init["project"] = "" + request_init["region"] = "" + 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["region"] = "region_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 "region" in jsonified_request + assert jsonified_request["region"] == "region_value" + assert "resource" in jsonified_request + assert jsonified_request["resource"] == "resource_value" + + client = RegionInstantSnapshotsClient( + 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 + + 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.RegionInstantSnapshotsRestTransport( + credentials=ga_credentials.AnonymousCredentials + ) + + unset_fields = transport.set_iam_policy._get_unset_required_fields({}) + assert set(unset_fields) == ( + set(()) + & set( + ( + "project", + "region", + "regionSetPolicyRequestResource", + "resource", + ) + ) + ) + + +@pytest.mark.parametrize("null_interceptor", [True, False]) +def test_set_iam_policy_rest_interceptors(null_interceptor): + transport = transports.RegionInstantSnapshotsRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + interceptor=None + if null_interceptor + else transports.RegionInstantSnapshotsRestInterceptor(), + ) + client = RegionInstantSnapshotsClient(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.RegionInstantSnapshotsRestInterceptor, "post_set_iam_policy" + ) as post, mock.patch.object( + transports.RegionInstantSnapshotsRestInterceptor, "pre_set_iam_policy" + ) as pre: + pre.assert_not_called() + post.assert_not_called() + pb_message = compute.SetIamPolicyRegionInstantSnapshotRequest.pb( + compute.SetIamPolicyRegionInstantSnapshotRequest() + ) + transcode.return_value = { + "method": "post", + "uri": "my_uri", + "body": pb_message, + "query_params": pb_message, + } + + req.return_value = Response() + req.return_value.status_code = 200 + req.return_value.request = PreparedRequest() + req.return_value._content = compute.Policy.to_json(compute.Policy()) + + request = compute.SetIamPolicyRegionInstantSnapshotRequest() + metadata = [ + ("key", "val"), + ("cephalopod", "squid"), + ] + pre.return_value = request, metadata + post.return_value = compute.Policy() + + client.set_iam_policy( + request, + metadata=[ + ("key", "val"), + ("cephalopod", "squid"), + ], + ) + + pre.assert_called_once() + post.assert_called_once() + + +def test_set_iam_policy_rest_bad_request( + transport: str = "rest", + request_type=compute.SetIamPolicyRegionInstantSnapshotRequest, +): + client = RegionInstantSnapshotsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # send a request that will satisfy transcoding + request_init = {"project": "sample1", "region": "sample2", "resource": "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 = Response() + response_value.status_code = 400 + response_value.request = Request() + req.return_value = response_value + client.set_iam_policy(request) + + +def test_set_iam_policy_rest_flattened(): + client = RegionInstantSnapshotsClient( + 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", + "region": "sample2", + "resource": "sample3", + } + + # get truthy value for each flattened field + mock_args = dict( + project="project_value", + region="region_value", + resource="resource_value", + region_set_policy_request_resource=compute.RegionSetPolicyRequest( + 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 + + 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}/regions/{region}/instantSnapshots/{resource}/setIamPolicy" + % client.transport._host, + args[1], + ) + + +def test_set_iam_policy_rest_flattened_error(transport: str = "rest"): + client = RegionInstantSnapshotsClient( + 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.SetIamPolicyRegionInstantSnapshotRequest(), + project="project_value", + region="region_value", + resource="resource_value", + region_set_policy_request_resource=compute.RegionSetPolicyRequest( + bindings=[compute.Binding(binding_id="binding_id_value")] + ), + ) + + +def test_set_iam_policy_rest_error(): + client = RegionInstantSnapshotsClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + + +@pytest.mark.parametrize( + "request_type", + [ + compute.SetLabelsRegionInstantSnapshotRequest, + dict, + ], +) +def test_set_labels_rest(request_type): + client = RegionInstantSnapshotsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # send a request that will satisfy transcoding + request_init = {"project": "sample1", "region": "sample2", "resource": "sample3"} + request_init["region_set_labels_request_resource"] = { + "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.SetLabelsRegionInstantSnapshotRequest.meta.fields[ + "region_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[ + "region_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["region_set_labels_request_resource"][field]) + ): + del request_init["region_set_labels_request_resource"][field][i][ + subfield + ] + else: + del request_init["region_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 = 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 + response = client.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" + + +def test_set_labels_rest_required_fields( + request_type=compute.SetLabelsRegionInstantSnapshotRequest, +): + transport_class = transports.RegionInstantSnapshotsRestTransport + + request_init = {} + request_init["project"] = "" + request_init["region"] = "" + 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_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["region"] = "region_value" + jsonified_request["resource"] = "resource_value" + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).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",)) + 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 "region" in jsonified_request + assert jsonified_request["region"] == "region_value" + assert "resource" in jsonified_request + assert jsonified_request["resource"] == "resource_value" + + client = RegionInstantSnapshotsClient( + 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 + + response = client.set_labels(request) + + expected_params = [] + actual_params = req.call_args.kwargs["params"] + assert expected_params == actual_params + + +def test_set_labels_rest_unset_required_fields(): + transport = transports.RegionInstantSnapshotsRestTransport( + credentials=ga_credentials.AnonymousCredentials + ) + + unset_fields = transport.set_labels._get_unset_required_fields({}) + assert set(unset_fields) == ( + set(("requestId",)) + & set( + ( + "project", + "region", + "regionSetLabelsRequestResource", + "resource", + ) + ) + ) + + +@pytest.mark.parametrize("null_interceptor", [True, False]) +def test_set_labels_rest_interceptors(null_interceptor): + transport = transports.RegionInstantSnapshotsRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + interceptor=None + if null_interceptor + else transports.RegionInstantSnapshotsRestInterceptor(), + ) + client = RegionInstantSnapshotsClient(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.RegionInstantSnapshotsRestInterceptor, "post_set_labels" + ) as post, mock.patch.object( + transports.RegionInstantSnapshotsRestInterceptor, "pre_set_labels" + ) as pre: + pre.assert_not_called() + post.assert_not_called() + pb_message = compute.SetLabelsRegionInstantSnapshotRequest.pb( + compute.SetLabelsRegionInstantSnapshotRequest() + ) + transcode.return_value = { + "method": "post", + "uri": "my_uri", + "body": pb_message, + "query_params": pb_message, + } + + req.return_value = Response() + req.return_value.status_code = 200 + req.return_value.request = PreparedRequest() + req.return_value._content = compute.Operation.to_json(compute.Operation()) + + request = compute.SetLabelsRegionInstantSnapshotRequest() + metadata = [ + ("key", "val"), + ("cephalopod", "squid"), + ] + pre.return_value = request, metadata + post.return_value = compute.Operation() + + client.set_labels( + request, + metadata=[ + ("key", "val"), + ("cephalopod", "squid"), + ], + ) + + pre.assert_called_once() + post.assert_called_once() + + +def test_set_labels_rest_bad_request( + transport: str = "rest", request_type=compute.SetLabelsRegionInstantSnapshotRequest +): + client = RegionInstantSnapshotsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # send a request that will satisfy transcoding + request_init = {"project": "sample1", "region": "sample2", "resource": "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 = Response() + response_value.status_code = 400 + response_value.request = Request() + req.return_value = response_value + client.set_labels(request) + + +def test_set_labels_rest_flattened(): + client = RegionInstantSnapshotsClient( + 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", + "region": "sample2", + "resource": "sample3", + } + + # get truthy value for each flattened field + mock_args = dict( + project="project_value", + region="region_value", + resource="resource_value", + region_set_labels_request_resource=compute.RegionSetLabelsRequest( + 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 + + client.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}/regions/{region}/instantSnapshots/{resource}/setLabels" + % client.transport._host, + args[1], + ) + + +def test_set_labels_rest_flattened_error(transport: str = "rest"): + client = RegionInstantSnapshotsClient( + 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_labels( + compute.SetLabelsRegionInstantSnapshotRequest(), + project="project_value", + region="region_value", + resource="resource_value", + region_set_labels_request_resource=compute.RegionSetLabelsRequest( + label_fingerprint="label_fingerprint_value" + ), + ) + + +def test_set_labels_rest_error(): + client = RegionInstantSnapshotsClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + + +@pytest.mark.parametrize( + "request_type", + [ + compute.SetLabelsRegionInstantSnapshotRequest, + dict, + ], +) +def test_set_labels_unary_rest(request_type): + client = RegionInstantSnapshotsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # send a request that will satisfy transcoding + request_init = {"project": "sample1", "region": "sample2", "resource": "sample3"} + request_init["region_set_labels_request_resource"] = { + "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.SetLabelsRegionInstantSnapshotRequest.meta.fields[ + "region_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[ + "region_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["region_set_labels_request_resource"][field]) + ): + del request_init["region_set_labels_request_resource"][field][i][ + subfield + ] + else: + del request_init["region_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 = 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 + response = client.set_labels_unary(request) + + # Establish that the response is the type that we expect. + assert isinstance(response, compute.Operation) + + +def test_set_labels_unary_rest_required_fields( + request_type=compute.SetLabelsRegionInstantSnapshotRequest, +): + transport_class = transports.RegionInstantSnapshotsRestTransport + + request_init = {} + request_init["project"] = "" + request_init["region"] = "" + 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_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["region"] = "region_value" + jsonified_request["resource"] = "resource_value" + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).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",)) + 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 "region" in jsonified_request + assert jsonified_request["region"] == "region_value" + assert "resource" in jsonified_request + assert jsonified_request["resource"] == "resource_value" + + client = RegionInstantSnapshotsClient( + 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 + + response = client.set_labels_unary(request) + + expected_params = [] + actual_params = req.call_args.kwargs["params"] + assert expected_params == actual_params + + +def test_set_labels_unary_rest_unset_required_fields(): + transport = transports.RegionInstantSnapshotsRestTransport( + credentials=ga_credentials.AnonymousCredentials + ) + + unset_fields = transport.set_labels._get_unset_required_fields({}) + assert set(unset_fields) == ( + set(("requestId",)) + & set( + ( + "project", + "region", + "regionSetLabelsRequestResource", + "resource", + ) + ) + ) + + +@pytest.mark.parametrize("null_interceptor", [True, False]) +def test_set_labels_unary_rest_interceptors(null_interceptor): + transport = transports.RegionInstantSnapshotsRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + interceptor=None + if null_interceptor + else transports.RegionInstantSnapshotsRestInterceptor(), + ) + client = RegionInstantSnapshotsClient(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.RegionInstantSnapshotsRestInterceptor, "post_set_labels" + ) as post, mock.patch.object( + transports.RegionInstantSnapshotsRestInterceptor, "pre_set_labels" + ) as pre: + pre.assert_not_called() + post.assert_not_called() + pb_message = compute.SetLabelsRegionInstantSnapshotRequest.pb( + compute.SetLabelsRegionInstantSnapshotRequest() + ) + transcode.return_value = { + "method": "post", + "uri": "my_uri", + "body": pb_message, + "query_params": pb_message, + } + + req.return_value = Response() + req.return_value.status_code = 200 + req.return_value.request = PreparedRequest() + req.return_value._content = compute.Operation.to_json(compute.Operation()) + + request = compute.SetLabelsRegionInstantSnapshotRequest() + metadata = [ + ("key", "val"), + ("cephalopod", "squid"), + ] + pre.return_value = request, metadata + post.return_value = compute.Operation() + + client.set_labels_unary( + request, + metadata=[ + ("key", "val"), + ("cephalopod", "squid"), + ], + ) + + pre.assert_called_once() + post.assert_called_once() + + +def test_set_labels_unary_rest_bad_request( + transport: str = "rest", request_type=compute.SetLabelsRegionInstantSnapshotRequest +): + client = RegionInstantSnapshotsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # send a request that will satisfy transcoding + request_init = {"project": "sample1", "region": "sample2", "resource": "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 = Response() + response_value.status_code = 400 + response_value.request = Request() + req.return_value = response_value + client.set_labels_unary(request) + + +def test_set_labels_unary_rest_flattened(): + client = RegionInstantSnapshotsClient( + 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", + "region": "sample2", + "resource": "sample3", + } + + # get truthy value for each flattened field + mock_args = dict( + project="project_value", + region="region_value", + resource="resource_value", + region_set_labels_request_resource=compute.RegionSetLabelsRequest( + 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 + + client.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}/regions/{region}/instantSnapshots/{resource}/setLabels" + % client.transport._host, + args[1], + ) + + +def test_set_labels_unary_rest_flattened_error(transport: str = "rest"): + client = RegionInstantSnapshotsClient( + 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_labels_unary( + compute.SetLabelsRegionInstantSnapshotRequest(), + project="project_value", + region="region_value", + resource="resource_value", + region_set_labels_request_resource=compute.RegionSetLabelsRequest( + label_fingerprint="label_fingerprint_value" + ), + ) + + +def test_set_labels_unary_rest_error(): + client = RegionInstantSnapshotsClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + + +@pytest.mark.parametrize( + "request_type", + [ + compute.TestIamPermissionsRegionInstantSnapshotRequest, + dict, + ], +) +def test_test_iam_permissions_rest(request_type): + client = RegionInstantSnapshotsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # send a request that will satisfy transcoding + request_init = {"project": "sample1", "region": "sample2", "resource": "sample3"} + 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.TestIamPermissionsRegionInstantSnapshotRequest.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 = 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 + 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"] + + +def test_test_iam_permissions_rest_required_fields( + request_type=compute.TestIamPermissionsRegionInstantSnapshotRequest, +): + transport_class = transports.RegionInstantSnapshotsRestTransport + + request_init = {} + request_init["project"] = "" + request_init["region"] = "" + 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["region"] = "region_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 "region" in jsonified_request + assert jsonified_request["region"] == "region_value" + assert "resource" in jsonified_request + assert jsonified_request["resource"] == "resource_value" + + client = RegionInstantSnapshotsClient( + 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 + + 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.RegionInstantSnapshotsRestTransport( + credentials=ga_credentials.AnonymousCredentials + ) + + unset_fields = transport.test_iam_permissions._get_unset_required_fields({}) + assert set(unset_fields) == ( + set(()) + & set( + ( + "project", + "region", + "resource", + "testPermissionsRequestResource", + ) + ) + ) + + +@pytest.mark.parametrize("null_interceptor", [True, False]) +def test_test_iam_permissions_rest_interceptors(null_interceptor): + transport = transports.RegionInstantSnapshotsRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + interceptor=None + if null_interceptor + else transports.RegionInstantSnapshotsRestInterceptor(), + ) + client = RegionInstantSnapshotsClient(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.RegionInstantSnapshotsRestInterceptor, "post_test_iam_permissions" + ) as post, mock.patch.object( + transports.RegionInstantSnapshotsRestInterceptor, "pre_test_iam_permissions" + ) as pre: + pre.assert_not_called() + post.assert_not_called() + pb_message = compute.TestIamPermissionsRegionInstantSnapshotRequest.pb( + compute.TestIamPermissionsRegionInstantSnapshotRequest() + ) + transcode.return_value = { + "method": "post", + "uri": "my_uri", + "body": pb_message, + "query_params": pb_message, + } + + req.return_value = Response() + req.return_value.status_code = 200 + req.return_value.request = PreparedRequest() + req.return_value._content = compute.TestPermissionsResponse.to_json( + compute.TestPermissionsResponse() + ) + + request = compute.TestIamPermissionsRegionInstantSnapshotRequest() + metadata = [ + ("key", "val"), + ("cephalopod", "squid"), + ] + pre.return_value = request, metadata + post.return_value = compute.TestPermissionsResponse() + + client.test_iam_permissions( + request, + metadata=[ + ("key", "val"), + ("cephalopod", "squid"), + ], + ) + + pre.assert_called_once() + post.assert_called_once() + + +def test_test_iam_permissions_rest_bad_request( + transport: str = "rest", + request_type=compute.TestIamPermissionsRegionInstantSnapshotRequest, +): + client = RegionInstantSnapshotsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # send a request that will satisfy transcoding + request_init = {"project": "sample1", "region": "sample2", "resource": "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 = Response() + response_value.status_code = 400 + response_value.request = Request() + req.return_value = response_value + client.test_iam_permissions(request) + + +def test_test_iam_permissions_rest_flattened(): + client = RegionInstantSnapshotsClient( + 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", + "region": "sample2", + "resource": "sample3", + } + + # get truthy value for each flattened field + mock_args = dict( + project="project_value", + region="region_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 + + 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}/regions/{region}/instantSnapshots/{resource}/testIamPermissions" + % client.transport._host, + args[1], + ) + + +def test_test_iam_permissions_rest_flattened_error(transport: str = "rest"): + client = RegionInstantSnapshotsClient( + 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.TestIamPermissionsRegionInstantSnapshotRequest(), + project="project_value", + region="region_value", + resource="resource_value", + test_permissions_request_resource=compute.TestPermissionsRequest( + permissions=["permissions_value"] + ), + ) + + +def test_test_iam_permissions_rest_error(): + client = RegionInstantSnapshotsClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + + +def test_credentials_transport_error(): + # It is an error to provide credentials and a transport instance. + transport = transports.RegionInstantSnapshotsRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + ) + with pytest.raises(ValueError): + client = RegionInstantSnapshotsClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # It is an error to provide a credentials file and a transport instance. + transport = transports.RegionInstantSnapshotsRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + ) + with pytest.raises(ValueError): + client = RegionInstantSnapshotsClient( + client_options={"credentials_file": "credentials.json"}, + transport=transport, + ) + + # It is an error to provide an api_key and a transport instance. + transport = transports.RegionInstantSnapshotsRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + ) + options = client_options.ClientOptions() + options.api_key = "api_key" + with pytest.raises(ValueError): + client = RegionInstantSnapshotsClient( + 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 = RegionInstantSnapshotsClient( + client_options=options, credentials=ga_credentials.AnonymousCredentials() + ) + + # It is an error to provide scopes and a transport instance. + transport = transports.RegionInstantSnapshotsRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + ) + with pytest.raises(ValueError): + client = RegionInstantSnapshotsClient( + client_options={"scopes": ["1", "2"]}, + transport=transport, + ) + + +def test_transport_instance(): + # A client may be instantiated with a custom transport instance. + transport = transports.RegionInstantSnapshotsRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + ) + client = RegionInstantSnapshotsClient(transport=transport) + assert client.transport is transport + + +@pytest.mark.parametrize( + "transport_class", + [ + transports.RegionInstantSnapshotsRestTransport, + ], +) +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() + + +@pytest.mark.parametrize( + "transport_name", + [ + "rest", + ], +) +def test_transport_kind(transport_name): + transport = RegionInstantSnapshotsClient.get_transport_class(transport_name)( + credentials=ga_credentials.AnonymousCredentials(), + ) + assert transport.kind == transport_name + + +def test_region_instant_snapshots_base_transport_error(): + # Passing both a credentials object and credentials_file should raise an error + with pytest.raises(core_exceptions.DuplicateCredentialArgs): + transport = transports.RegionInstantSnapshotsTransport( + credentials=ga_credentials.AnonymousCredentials(), + credentials_file="credentials.json", + ) + + +def test_region_instant_snapshots_base_transport(): + # Instantiate the base transport. + with mock.patch( + "google.cloud.compute_v1.services.region_instant_snapshots.transports.RegionInstantSnapshotsTransport.__init__" + ) as Transport: + Transport.return_value = None + transport = transports.RegionInstantSnapshotsTransport( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Every method on the transport should just blindly + # raise NotImplementedError. + methods = ( + "delete", + "get", + "get_iam_policy", + "insert", + "list", + "set_iam_policy", + "set_labels", + "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_region_instant_snapshots_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.region_instant_snapshots.transports.RegionInstantSnapshotsTransport._prep_wrapped_messages" + ) as Transport: + Transport.return_value = None + load_creds.return_value = (ga_credentials.AnonymousCredentials(), None) + transport = transports.RegionInstantSnapshotsTransport( + 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_region_instant_snapshots_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.region_instant_snapshots.transports.RegionInstantSnapshotsTransport._prep_wrapped_messages" + ) as Transport: + Transport.return_value = None + adc.return_value = (ga_credentials.AnonymousCredentials(), None) + transport = transports.RegionInstantSnapshotsTransport() + adc.assert_called_once() + + +def test_region_instant_snapshots_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) + RegionInstantSnapshotsClient() + 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_region_instant_snapshots_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.RegionInstantSnapshotsRestTransport( + 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_region_instant_snapshots_host_no_port(transport_name): + client = RegionInstantSnapshotsClient( + 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_region_instant_snapshots_host_with_port(transport_name): + client = RegionInstantSnapshotsClient( + 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_region_instant_snapshots_client_transport_session_collision(transport_name): + creds1 = ga_credentials.AnonymousCredentials() + creds2 = ga_credentials.AnonymousCredentials() + client1 = RegionInstantSnapshotsClient( + credentials=creds1, + transport=transport_name, + ) + client2 = RegionInstantSnapshotsClient( + 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.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.set_iam_policy._session + session2 = client2.transport.set_iam_policy._session + assert session1 != session2 + session1 = client1.transport.set_labels._session + session2 = client2.transport.set_labels._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 = RegionInstantSnapshotsClient.common_billing_account_path(billing_account) + assert expected == actual + + +def test_parse_common_billing_account_path(): + expected = { + "billing_account": "clam", + } + path = RegionInstantSnapshotsClient.common_billing_account_path(**expected) + + # Check that the path construction is reversible. + actual = RegionInstantSnapshotsClient.parse_common_billing_account_path(path) + assert expected == actual + + +def test_common_folder_path(): + folder = "whelk" + expected = "folders/{folder}".format( + folder=folder, + ) + actual = RegionInstantSnapshotsClient.common_folder_path(folder) + assert expected == actual + + +def test_parse_common_folder_path(): + expected = { + "folder": "octopus", + } + path = RegionInstantSnapshotsClient.common_folder_path(**expected) + + # Check that the path construction is reversible. + actual = RegionInstantSnapshotsClient.parse_common_folder_path(path) + assert expected == actual + + +def test_common_organization_path(): + organization = "oyster" + expected = "organizations/{organization}".format( + organization=organization, + ) + actual = RegionInstantSnapshotsClient.common_organization_path(organization) + assert expected == actual + + +def test_parse_common_organization_path(): + expected = { + "organization": "nudibranch", + } + path = RegionInstantSnapshotsClient.common_organization_path(**expected) + + # Check that the path construction is reversible. + actual = RegionInstantSnapshotsClient.parse_common_organization_path(path) + assert expected == actual + + +def test_common_project_path(): + project = "cuttlefish" + expected = "projects/{project}".format( + project=project, + ) + actual = RegionInstantSnapshotsClient.common_project_path(project) + assert expected == actual + + +def test_parse_common_project_path(): + expected = { + "project": "mussel", + } + path = RegionInstantSnapshotsClient.common_project_path(**expected) + + # Check that the path construction is reversible. + actual = RegionInstantSnapshotsClient.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 = RegionInstantSnapshotsClient.common_location_path(project, location) + assert expected == actual + + +def test_parse_common_location_path(): + expected = { + "project": "scallop", + "location": "abalone", + } + path = RegionInstantSnapshotsClient.common_location_path(**expected) + + # Check that the path construction is reversible. + actual = RegionInstantSnapshotsClient.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.RegionInstantSnapshotsTransport, "_prep_wrapped_messages" + ) as prep: + client = RegionInstantSnapshotsClient( + credentials=ga_credentials.AnonymousCredentials(), + client_info=client_info, + ) + prep.assert_called_once_with(client_info) + + with mock.patch.object( + transports.RegionInstantSnapshotsTransport, "_prep_wrapped_messages" + ) as prep: + transport_class = RegionInstantSnapshotsClient.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(): + transports = { + "rest": "_session", + } + + for transport, close_name in transports.items(): + client = RegionInstantSnapshotsClient( + credentials=ga_credentials.AnonymousCredentials(), transport=transport + ) + with mock.patch.object( + type(getattr(client.transport, close_name)), "close" + ) as close: + with client: + close.assert_not_called() + close.assert_called_once() + + +def test_client_ctx(): + transports = [ + "rest", + ] + for transport in transports: + client = RegionInstantSnapshotsClient( + 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", + [ + (RegionInstantSnapshotsClient, transports.RegionInstantSnapshotsRestTransport), + ], +) +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_snapshots.py b/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_snapshots.py index 0ba3ad8323a8..cc40bd2f0991 100644 --- a/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_snapshots.py +++ b/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_snapshots.py @@ -1584,6 +1584,8 @@ def test_get_rest(request_type): source_disk="source_disk_value", source_disk_for_recovery_checkpoint="source_disk_for_recovery_checkpoint_value", source_disk_id="source_disk_id_value", + source_instant_snapshot="source_instant_snapshot_value", + source_instant_snapshot_id="source_instant_snapshot_id_value", source_snapshot_schedule_policy="source_snapshot_schedule_policy_value", source_snapshot_schedule_policy_id="source_snapshot_schedule_policy_id_value", status="status_value", @@ -1631,6 +1633,8 @@ def test_get_rest(request_type): == "source_disk_for_recovery_checkpoint_value" ) assert response.source_disk_id == "source_disk_id_value" + assert response.source_instant_snapshot == "source_instant_snapshot_value" + assert response.source_instant_snapshot_id == "source_instant_snapshot_id_value" assert ( response.source_snapshot_schedule_policy == "source_snapshot_schedule_policy_value" @@ -2210,6 +2214,9 @@ def test_insert_rest(request_type): "source_disk_encryption_key": {}, "source_disk_for_recovery_checkpoint": "source_disk_for_recovery_checkpoint_value", "source_disk_id": "source_disk_id_value", + "source_instant_snapshot": "source_instant_snapshot_value", + "source_instant_snapshot_encryption_key": {}, + "source_instant_snapshot_id": "source_instant_snapshot_id_value", "source_snapshot_schedule_policy": "source_snapshot_schedule_policy_value", "source_snapshot_schedule_policy_id": "source_snapshot_schedule_policy_id_value", "status": "status_value", @@ -2632,6 +2639,9 @@ def test_insert_unary_rest(request_type): "source_disk_encryption_key": {}, "source_disk_for_recovery_checkpoint": "source_disk_for_recovery_checkpoint_value", "source_disk_id": "source_disk_id_value", + "source_instant_snapshot": "source_instant_snapshot_value", + "source_instant_snapshot_encryption_key": {}, + "source_instant_snapshot_id": "source_instant_snapshot_id_value", "source_snapshot_schedule_policy": "source_snapshot_schedule_policy_value", "source_snapshot_schedule_policy_id": "source_snapshot_schedule_policy_id_value", "status": "status_value", diff --git a/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_vpn_gateways.py b/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_vpn_gateways.py index 111b9698ee76..d4b139ce9b42 100644 --- a/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_vpn_gateways.py +++ b/packages/google-cloud-compute/tests/unit/gapic/compute_v1/test_vpn_gateways.py @@ -1970,6 +1970,7 @@ def test_get_rest(request_type): return_value = compute.VpnGateway( creation_timestamp="creation_timestamp_value", description="description_value", + gateway_ip_version="gateway_ip_version_value", id=205, kind="kind_value", label_fingerprint="label_fingerprint_value", @@ -1995,6 +1996,7 @@ def test_get_rest(request_type): assert isinstance(response, compute.VpnGateway) assert response.creation_timestamp == "creation_timestamp_value" assert response.description == "description_value" + assert response.gateway_ip_version == "gateway_ip_version_value" assert response.id == 205 assert response.kind == "kind_value" assert response.label_fingerprint == "label_fingerprint_value" @@ -2558,6 +2560,7 @@ def test_insert_rest(request_type): request_init["vpn_gateway_resource"] = { "creation_timestamp": "creation_timestamp_value", "description": "description_value", + "gateway_ip_version": "gateway_ip_version_value", "id": 205, "kind": "kind_value", "label_fingerprint": "label_fingerprint_value", @@ -2572,6 +2575,7 @@ def test_insert_rest(request_type): "id": 205, "interconnect_attachment": "interconnect_attachment_value", "ip_address": "ip_address_value", + "ipv6_address": "ipv6_address_value", } ], } @@ -2976,6 +2980,7 @@ def test_insert_unary_rest(request_type): request_init["vpn_gateway_resource"] = { "creation_timestamp": "creation_timestamp_value", "description": "description_value", + "gateway_ip_version": "gateway_ip_version_value", "id": 205, "kind": "kind_value", "label_fingerprint": "label_fingerprint_value", @@ -2990,6 +2995,7 @@ def test_insert_unary_rest(request_type): "id": 205, "interconnect_attachment": "interconnect_attachment_value", "ip_address": "ip_address_value", + "ipv6_address": "ipv6_address_value", } ], }