From e6f8670fd9ea278cd8324890866034a08e2b1904 Mon Sep 17 00:00:00 2001 From: Brent Shaffer Date: Wed, 11 Dec 2024 11:21:34 -0800 Subject: [PATCH] docs(Compute): update samples to use new surface (#7907) updates after rebase --- .../aggregated_list.php | 9 +- .../samples/V1/AcceleratorTypesClient/get.php | 11 ++- .../V1/AcceleratorTypesClient/list.php | 10 +- .../V1/AddressesClient/aggregated_list.php | 9 +- Compute/samples/V1/AddressesClient/delete.php | 11 ++- Compute/samples/V1/AddressesClient/get.php | 11 ++- Compute/samples/V1/AddressesClient/insert.php | 11 ++- Compute/samples/V1/AddressesClient/list.php | 10 +- Compute/samples/V1/AddressesClient/move.php | 17 ++-- .../samples/V1/AddressesClient/set_labels.php | 17 ++-- .../V1/AutoscalersClient/aggregated_list.php | 9 +- .../samples/V1/AutoscalersClient/delete.php | 11 ++- Compute/samples/V1/AutoscalersClient/get.php | 11 ++- .../samples/V1/AutoscalersClient/insert.php | 11 ++- Compute/samples/V1/AutoscalersClient/list.php | 10 +- .../samples/V1/AutoscalersClient/patch.php | 11 ++- .../samples/V1/AutoscalersClient/update.php | 11 ++- .../add_signed_url_key.php | 11 ++- .../V1/BackendBucketsClient/delete.php | 10 +- .../delete_signed_url_key.php | 11 ++- .../samples/V1/BackendBucketsClient/get.php | 10 +- .../BackendBucketsClient/get_iam_policy.php | 10 +- .../V1/BackendBucketsClient/insert.php | 10 +- .../samples/V1/BackendBucketsClient/list.php | 9 +- .../samples/V1/BackendBucketsClient/patch.php | 11 ++- .../set_edge_security_policy.php | 15 +-- .../BackendBucketsClient/set_iam_policy.php | 15 +-- .../test_iam_permissions.php | 15 +-- .../V1/BackendBucketsClient/update.php | 11 ++- .../add_signed_url_key.php | 15 +-- .../BackendServicesClient/aggregated_list.php | 9 +- .../V1/BackendServicesClient/delete.php | 10 +- .../delete_signed_url_key.php | 11 ++- .../samples/V1/BackendServicesClient/get.php | 10 +- .../V1/BackendServicesClient/get_health.php | 15 +-- .../BackendServicesClient/get_iam_policy.php | 10 +- .../V1/BackendServicesClient/insert.php | 10 +- .../samples/V1/BackendServicesClient/list.php | 9 +- .../V1/BackendServicesClient/list_usable.php | 9 +- .../V1/BackendServicesClient/patch.php | 11 ++- .../set_edge_security_policy.php | 15 +-- .../BackendServicesClient/set_iam_policy.php | 15 +-- .../set_security_policy.php | 15 +-- .../test_iam_permissions.php | 15 +-- .../V1/BackendServicesClient/update.php | 11 ++- .../V1/DiskTypesClient/aggregated_list.php | 9 +- Compute/samples/V1/DiskTypesClient/get.php | 11 ++- Compute/samples/V1/DiskTypesClient/list.php | 10 +- .../V1/DisksClient/add_resource_policies.php | 17 ++-- .../V1/DisksClient/aggregated_list.php | 9 +- .../samples/V1/DisksClient/bulk_insert.php | 11 ++- .../V1/DisksClient/create_snapshot.php | 12 ++- Compute/samples/V1/DisksClient/delete.php | 11 ++- Compute/samples/V1/DisksClient/get.php | 11 ++- .../samples/V1/DisksClient/get_iam_policy.php | 11 ++- Compute/samples/V1/DisksClient/insert.php | 11 ++- Compute/samples/V1/DisksClient/list.php | 10 +- .../DisksClient/remove_resource_policies.php | 17 ++-- Compute/samples/V1/DisksClient/resize.php | 12 ++- .../samples/V1/DisksClient/set_iam_policy.php | 12 ++- Compute/samples/V1/DisksClient/set_labels.php | 12 ++- .../DisksClient/start_async_replication.php | 17 ++-- .../V1/DisksClient/stop_async_replication.php | 11 ++- .../stop_group_async_replication.php | 15 +-- .../V1/DisksClient/test_iam_permissions.php | 17 ++-- Compute/samples/V1/DisksClient/update.php | 12 ++- .../V1/ExternalVpnGatewaysClient/delete.php | 10 +- .../V1/ExternalVpnGatewaysClient/get.php | 10 +- .../V1/ExternalVpnGatewaysClient/insert.php | 10 +- .../V1/ExternalVpnGatewaysClient/list.php | 9 +- .../ExternalVpnGatewaysClient/set_labels.php | 15 +-- .../test_iam_permissions.php | 15 +-- .../add_association.php | 13 +-- .../V1/FirewallPoliciesClient/add_rule.php | 10 +- .../V1/FirewallPoliciesClient/clone_rules.php | 9 +- .../V1/FirewallPoliciesClient/delete.php | 9 +- .../samples/V1/FirewallPoliciesClient/get.php | 9 +- .../get_association.php | 9 +- .../FirewallPoliciesClient/get_iam_policy.php | 9 +- .../V1/FirewallPoliciesClient/get_rule.php | 9 +- .../V1/FirewallPoliciesClient/insert.php | 10 +- .../V1/FirewallPoliciesClient/list.php | 8 +- .../list_associations.php | 8 +- .../V1/FirewallPoliciesClient/move.php | 10 +- .../V1/FirewallPoliciesClient/patch.php | 10 +- .../V1/FirewallPoliciesClient/patch_rule.php | 10 +- .../remove_association.php | 9 +- .../V1/FirewallPoliciesClient/remove_rule.php | 9 +- .../FirewallPoliciesClient/set_iam_policy.php | 13 +-- .../test_iam_permissions.php | 10 +- Compute/samples/V1/FirewallsClient/delete.php | 10 +- Compute/samples/V1/FirewallsClient/get.php | 10 +- Compute/samples/V1/FirewallsClient/insert.php | 10 +- Compute/samples/V1/FirewallsClient/list.php | 9 +- Compute/samples/V1/FirewallsClient/patch.php | 11 ++- Compute/samples/V1/FirewallsClient/update.php | 11 ++- .../ForwardingRulesClient/aggregated_list.php | 9 +- .../V1/ForwardingRulesClient/delete.php | 11 ++- .../samples/V1/ForwardingRulesClient/get.php | 11 ++- .../V1/ForwardingRulesClient/insert.php | 11 ++- .../samples/V1/ForwardingRulesClient/list.php | 10 +- .../V1/ForwardingRulesClient/patch.php | 17 ++-- .../V1/ForwardingRulesClient/set_labels.php | 17 ++-- .../V1/ForwardingRulesClient/set_target.php | 17 ++-- .../V1/GlobalAddressesClient/delete.php | 10 +- .../samples/V1/GlobalAddressesClient/get.php | 10 +- .../V1/GlobalAddressesClient/insert.php | 10 +- .../samples/V1/GlobalAddressesClient/list.php | 9 +- .../samples/V1/GlobalAddressesClient/move.php | 11 ++- .../V1/GlobalAddressesClient/set_labels.php | 11 ++- .../V1/GlobalForwardingRulesClient/delete.php | 10 +- .../V1/GlobalForwardingRulesClient/get.php | 10 +- .../V1/GlobalForwardingRulesClient/insert.php | 10 +- .../V1/GlobalForwardingRulesClient/list.php | 9 +- .../V1/GlobalForwardingRulesClient/patch.php | 11 ++- .../set_labels.php | 15 +-- .../set_target.php | 15 +-- .../attach_network_endpoints.php | 17 ++-- .../delete.php | 10 +- .../detach_network_endpoints.php | 17 ++-- .../GlobalNetworkEndpointGroupsClient/get.php | 10 +- .../insert.php | 10 +- .../list.php | 9 +- .../list_network_endpoints.php | 13 ++- .../aggregated_list.php | 9 +- .../V1/GlobalOperationsClient/delete.php | 10 +- .../samples/V1/GlobalOperationsClient/get.php | 10 +- .../V1/GlobalOperationsClient/list.php | 9 +- .../V1/GlobalOperationsClient/wait.php | 10 +- .../delete.php | 9 +- .../get.php | 9 +- .../list.php | 8 +- .../delete.php | 10 +- .../get.php | 10 +- .../insert.php | 10 +- .../list.php | 9 +- .../patch.php | 15 +-- .../V1/HealthChecksClient/aggregated_list.php | 9 +- .../samples/V1/HealthChecksClient/delete.php | 10 +- Compute/samples/V1/HealthChecksClient/get.php | 10 +- .../samples/V1/HealthChecksClient/insert.php | 10 +- .../samples/V1/HealthChecksClient/list.php | 9 +- .../samples/V1/HealthChecksClient/patch.php | 11 ++- .../samples/V1/HealthChecksClient/update.php | 11 ++- .../samples/V1/ImageFamilyViewsClient/get.php | 11 ++- Compute/samples/V1/ImagesClient/delete.php | 10 +- Compute/samples/V1/ImagesClient/deprecate.php | 11 ++- Compute/samples/V1/ImagesClient/get.php | 10 +- .../V1/ImagesClient/get_from_family.php | 10 +- .../V1/ImagesClient/get_iam_policy.php | 10 +- Compute/samples/V1/ImagesClient/insert.php | 10 +- Compute/samples/V1/ImagesClient/list.php | 9 +- Compute/samples/V1/ImagesClient/patch.php | 11 ++- .../V1/ImagesClient/set_iam_policy.php | 11 ++- .../samples/V1/ImagesClient/set_labels.php | 11 ++- .../V1/ImagesClient/test_iam_permissions.php | 11 ++- .../cancel.php | 17 ++-- .../delete.php | 17 ++-- .../get.php | 17 ++-- .../insert.php | 17 ++-- .../list.php | 11 ++- .../abandon_instances.php | 19 ++-- .../aggregated_list.php | 9 +- .../apply_updates_to_instances.php | 19 ++-- .../create_instances.php | 19 ++-- .../V1/InstanceGroupManagersClient/delete.php | 11 ++- .../delete_instances.php | 19 ++-- .../delete_per_instance_configs.php | 19 ++-- .../V1/InstanceGroupManagersClient/get.php | 11 ++- .../V1/InstanceGroupManagersClient/insert.php | 11 ++- .../V1/InstanceGroupManagersClient/list.php | 10 +- .../list_errors.php | 11 ++- .../list_managed_instances.php | 15 +-- .../list_per_instance_configs.php | 15 +-- .../V1/InstanceGroupManagersClient/patch.php | 17 ++-- .../patch_per_instance_configs.php | 19 ++-- .../recreate_instances.php | 19 ++-- .../V1/InstanceGroupManagersClient/resize.php | 12 ++- .../resume_instances.php | 19 ++-- .../set_instance_template.php | 19 ++-- .../set_target_pools.php | 19 ++-- .../start_instances.php | 19 ++-- .../stop_instances.php | 19 ++-- .../suspend_instances.php | 19 ++-- .../update_per_instance_configs.php | 19 ++-- .../V1/InstanceGroupsClient/add_instances.php | 17 ++-- .../InstanceGroupsClient/aggregated_list.php | 9 +- .../V1/InstanceGroupsClient/delete.php | 11 ++- .../samples/V1/InstanceGroupsClient/get.php | 11 ++- .../V1/InstanceGroupsClient/insert.php | 11 ++- .../samples/V1/InstanceGroupsClient/list.php | 10 +- .../InstanceGroupsClient/list_instances.php | 17 ++-- .../InstanceGroupsClient/remove_instances.php | 17 ++-- .../InstanceGroupsClient/set_named_ports.php | 17 ++-- .../V1/InstanceSettingsServiceClient/get.php | 10 +- .../InstanceSettingsServiceClient/patch.php | 11 ++- .../aggregated_list.php | 9 +- .../V1/InstanceTemplatesClient/delete.php | 10 +- .../V1/InstanceTemplatesClient/get.php | 10 +- .../get_iam_policy.php | 10 +- .../V1/InstanceTemplatesClient/insert.php | 10 +- .../V1/InstanceTemplatesClient/list.php | 9 +- .../set_iam_policy.php | 15 +-- .../test_iam_permissions.php | 15 +-- .../V1/InstancesClient/add_access_config.php | 19 ++-- .../InstancesClient/add_resource_policies.php | 17 ++-- .../V1/InstancesClient/aggregated_list.php | 9 +- .../V1/InstancesClient/attach_disk.php | 12 ++- .../V1/InstancesClient/bulk_insert.php | 11 ++- Compute/samples/V1/InstancesClient/delete.php | 11 ++- .../InstancesClient/delete_access_config.php | 19 ++-- .../V1/InstancesClient/detach_disk.php | 12 ++- Compute/samples/V1/InstancesClient/get.php | 11 ++- .../get_effective_firewalls.php | 12 ++- .../InstancesClient/get_guest_attributes.php | 11 ++- .../V1/InstancesClient/get_iam_policy.php | 11 ++- .../V1/InstancesClient/get_screenshot.php | 11 ++- .../get_serial_port_output.php | 11 ++- .../get_shielded_instance_identity.php | 11 ++- Compute/samples/V1/InstancesClient/insert.php | 11 ++- Compute/samples/V1/InstancesClient/list.php | 10 +- .../V1/InstancesClient/list_referrers.php | 11 ++- .../InstancesClient/perform_maintenance.php | 11 ++- .../remove_resource_policies.php | 17 ++-- Compute/samples/V1/InstancesClient/reset.php | 11 ++- Compute/samples/V1/InstancesClient/resume.php | 11 ++- .../send_diagnostic_interrupt.php | 11 ++- .../set_deletion_protection.php | 11 ++- .../InstancesClient/set_disk_auto_delete.php | 19 ++-- .../V1/InstancesClient/set_iam_policy.php | 17 ++-- .../samples/V1/InstancesClient/set_labels.php | 17 ++-- .../InstancesClient/set_machine_resources.php | 17 ++-- .../V1/InstancesClient/set_machine_type.php | 17 ++-- .../V1/InstancesClient/set_metadata.php | 12 ++- .../InstancesClient/set_min_cpu_platform.php | 17 ++-- .../samples/V1/InstancesClient/set_name.php | 12 ++- .../V1/InstancesClient/set_scheduling.php | 12 ++- .../InstancesClient/set_security_policy.php | 17 ++-- .../InstancesClient/set_service_account.php | 17 ++-- ...set_shielded_instance_integrity_policy.php | 17 ++-- .../samples/V1/InstancesClient/set_tags.php | 12 ++- .../simulate_maintenance_event.php | 11 ++- Compute/samples/V1/InstancesClient/start.php | 11 ++- .../start_with_encryption_key.php | 17 ++-- Compute/samples/V1/InstancesClient/stop.php | 11 ++- .../samples/V1/InstancesClient/suspend.php | 11 ++- .../InstancesClient/test_iam_permissions.php | 17 ++-- Compute/samples/V1/InstancesClient/update.php | 12 ++- .../InstancesClient/update_access_config.php | 19 ++-- .../InstancesClient/update_display_device.php | 17 ++-- .../update_network_interface.php | 19 ++-- .../update_shielded_instance_config.php | 17 ++-- .../aggregated_list.php | 9 +- .../V1/InstantSnapshotsClient/delete.php | 11 ++- .../samples/V1/InstantSnapshotsClient/get.php | 11 ++- .../InstantSnapshotsClient/get_iam_policy.php | 11 ++- .../V1/InstantSnapshotsClient/insert.php | 11 ++- .../V1/InstantSnapshotsClient/list.php | 10 +- .../InstantSnapshotsClient/set_iam_policy.php | 17 ++-- .../V1/InstantSnapshotsClient/set_labels.php | 17 ++-- .../test_iam_permissions.php | 17 ++-- .../aggregated_list.php | 9 +- .../InterconnectAttachmentsClient/delete.php | 11 ++- .../V1/InterconnectAttachmentsClient/get.php | 11 ++- .../InterconnectAttachmentsClient/insert.php | 15 +-- .../V1/InterconnectAttachmentsClient/list.php | 10 +- .../InterconnectAttachmentsClient/patch.php | 17 ++-- .../set_labels.php | 17 ++-- .../V1/InterconnectLocationsClient/get.php | 10 +- .../V1/InterconnectLocationsClient/list.php | 9 +- .../InterconnectRemoteLocationsClient/get.php | 10 +- .../list.php | 9 +- .../samples/V1/InterconnectsClient/delete.php | 10 +- .../samples/V1/InterconnectsClient/get.php | 10 +- .../InterconnectsClient/get_diagnostics.php | 10 +- .../InterconnectsClient/get_macsec_config.php | 10 +- .../samples/V1/InterconnectsClient/insert.php | 10 +- .../samples/V1/InterconnectsClient/list.php | 9 +- .../samples/V1/InterconnectsClient/patch.php | 11 ++- .../V1/InterconnectsClient/set_labels.php | 11 ++- Compute/samples/V1/LicenseCodesClient/get.php | 10 +- .../test_iam_permissions.php | 15 +-- Compute/samples/V1/LicensesClient/delete.php | 10 +- Compute/samples/V1/LicensesClient/get.php | 10 +- .../V1/LicensesClient/get_iam_policy.php | 10 +- Compute/samples/V1/LicensesClient/insert.php | 10 +- Compute/samples/V1/LicensesClient/list.php | 9 +- .../V1/LicensesClient/set_iam_policy.php | 11 ++- .../LicensesClient/test_iam_permissions.php | 15 +-- .../samples/V1/MachineImagesClient/delete.php | 10 +- .../samples/V1/MachineImagesClient/get.php | 10 +- .../V1/MachineImagesClient/get_iam_policy.php | 10 +- .../samples/V1/MachineImagesClient/insert.php | 10 +- .../samples/V1/MachineImagesClient/list.php | 9 +- .../V1/MachineImagesClient/set_iam_policy.php | 15 +-- .../test_iam_permissions.php | 15 +-- .../V1/MachineTypesClient/aggregated_list.php | 9 +- Compute/samples/V1/MachineTypesClient/get.php | 11 ++- .../samples/V1/MachineTypesClient/list.php | 10 +- .../aggregated_list.php | 9 +- .../V1/NetworkAttachmentsClient/delete.php | 11 ++- .../V1/NetworkAttachmentsClient/get.php | 11 ++- .../get_iam_policy.php | 11 ++- .../V1/NetworkAttachmentsClient/insert.php | 11 ++- .../V1/NetworkAttachmentsClient/list.php | 10 +- .../V1/NetworkAttachmentsClient/patch.php | 17 ++-- .../set_iam_policy.php | 17 ++-- .../test_iam_permissions.php | 17 ++-- .../aggregated_list.php | 9 +- .../delete.php | 15 +-- .../NetworkEdgeSecurityServicesClient/get.php | 11 ++- .../insert.php | 15 +-- .../patch.php | 17 ++-- .../aggregated_list.php | 9 +- .../attach_network_endpoints.php | 19 ++-- .../V1/NetworkEndpointGroupsClient/delete.php | 11 ++- .../detach_network_endpoints.php | 19 ++-- .../V1/NetworkEndpointGroupsClient/get.php | 11 ++- .../V1/NetworkEndpointGroupsClient/insert.php | 11 ++- .../V1/NetworkEndpointGroupsClient/list.php | 10 +- .../list_network_endpoints.php | 19 ++-- .../test_iam_permissions.php | 17 ++-- .../add_association.php | 15 +-- .../add_rule.php | 15 +-- .../clone_rules.php | 10 +- .../NetworkFirewallPoliciesClient/delete.php | 10 +- .../V1/NetworkFirewallPoliciesClient/get.php | 10 +- .../get_association.php | 10 +- .../get_iam_policy.php | 10 +- .../get_rule.php | 10 +- .../NetworkFirewallPoliciesClient/insert.php | 10 +- .../V1/NetworkFirewallPoliciesClient/list.php | 9 +- .../NetworkFirewallPoliciesClient/patch.php | 15 +-- .../patch_rule.php | 15 +-- .../remove_association.php | 10 +- .../remove_rule.php | 10 +- .../set_iam_policy.php | 15 +-- .../test_iam_permissions.php | 15 +-- .../samples/V1/NetworkProfilesClient/get.php | 10 +- .../samples/V1/NetworkProfilesClient/list.php | 9 +- .../samples/V1/NetworksClient/add_peering.php | 11 ++- Compute/samples/V1/NetworksClient/delete.php | 10 +- Compute/samples/V1/NetworksClient/get.php | 10 +- .../get_effective_firewalls.php | 10 +- Compute/samples/V1/NetworksClient/insert.php | 10 +- Compute/samples/V1/NetworksClient/list.php | 9 +- .../V1/NetworksClient/list_peering_routes.php | 10 +- Compute/samples/V1/NetworksClient/patch.php | 11 ++- .../V1/NetworksClient/remove_peering.php | 15 +-- .../NetworksClient/switch_to_custom_mode.php | 10 +- .../V1/NetworksClient/update_peering.php | 15 +-- .../samples/V1/NodeGroupsClient/add_nodes.php | 17 ++-- .../V1/NodeGroupsClient/aggregated_list.php | 9 +- .../samples/V1/NodeGroupsClient/delete.php | 11 ++- .../V1/NodeGroupsClient/delete_nodes.php | 17 ++-- Compute/samples/V1/NodeGroupsClient/get.php | 11 ++- .../V1/NodeGroupsClient/get_iam_policy.php | 11 ++- .../samples/V1/NodeGroupsClient/insert.php | 12 ++- Compute/samples/V1/NodeGroupsClient/list.php | 10 +- .../V1/NodeGroupsClient/list_nodes.php | 11 ++- Compute/samples/V1/NodeGroupsClient/patch.php | 12 ++- .../NodeGroupsClient/perform_maintenance.php | 17 ++-- .../V1/NodeGroupsClient/set_iam_policy.php | 17 ++-- .../V1/NodeGroupsClient/set_node_template.php | 17 ++-- .../simulate_maintenance_event.php | 19 ++-- .../NodeGroupsClient/test_iam_permissions.php | 17 ++-- .../NodeTemplatesClient/aggregated_list.php | 9 +- .../samples/V1/NodeTemplatesClient/delete.php | 11 ++- .../samples/V1/NodeTemplatesClient/get.php | 11 ++- .../V1/NodeTemplatesClient/get_iam_policy.php | 11 ++- .../samples/V1/NodeTemplatesClient/insert.php | 11 ++- .../samples/V1/NodeTemplatesClient/list.php | 10 +- .../V1/NodeTemplatesClient/set_iam_policy.php | 17 ++-- .../test_iam_permissions.php | 17 ++-- .../V1/NodeTypesClient/aggregated_list.php | 9 +- Compute/samples/V1/NodeTypesClient/get.php | 11 ++- Compute/samples/V1/NodeTypesClient/list.php | 10 +- .../aggregated_list.php | 9 +- .../V1/PacketMirroringsClient/delete.php | 11 ++- .../samples/V1/PacketMirroringsClient/get.php | 11 ++- .../V1/PacketMirroringsClient/insert.php | 11 ++- .../V1/PacketMirroringsClient/list.php | 10 +- .../V1/PacketMirroringsClient/patch.php | 17 ++-- .../test_iam_permissions.php | 17 ++-- .../V1/ProjectsClient/disable_xpn_host.php | 9 +- .../ProjectsClient/disable_xpn_resource.php | 13 +-- .../V1/ProjectsClient/enable_xpn_host.php | 9 +- .../V1/ProjectsClient/enable_xpn_resource.php | 10 +- Compute/samples/V1/ProjectsClient/get.php | 9 +- .../V1/ProjectsClient/get_xpn_host.php | 9 +- .../V1/ProjectsClient/get_xpn_resources.php | 9 +- .../V1/ProjectsClient/list_xpn_hosts.php | 10 +- .../samples/V1/ProjectsClient/move_disk.php | 10 +- .../V1/ProjectsClient/move_instance.php | 10 +- .../ProjectsClient/set_cloud_armor_tier.php | 10 +- .../set_common_instance_metadata.php | 10 +- .../set_default_network_tier.php | 13 +-- .../set_usage_export_bucket.php | 10 +- .../announce.php | 10 +- .../PublicAdvertisedPrefixesClient/delete.php | 10 +- .../V1/PublicAdvertisedPrefixesClient/get.php | 10 +- .../PublicAdvertisedPrefixesClient/insert.php | 10 +- .../PublicAdvertisedPrefixesClient/list.php | 9 +- .../PublicAdvertisedPrefixesClient/patch.php | 15 +-- .../withdraw.php | 10 +- .../aggregated_list.php | 9 +- .../announce.php | 11 ++- .../PublicDelegatedPrefixesClient/delete.php | 11 ++- .../V1/PublicDelegatedPrefixesClient/get.php | 11 ++- .../PublicDelegatedPrefixesClient/insert.php | 15 +-- .../V1/PublicDelegatedPrefixesClient/list.php | 10 +- .../PublicDelegatedPrefixesClient/patch.php | 17 ++-- .../withdraw.php | 11 ++- .../V1/RegionAutoscalersClient/delete.php | 11 ++- .../V1/RegionAutoscalersClient/get.php | 11 ++- .../V1/RegionAutoscalersClient/insert.php | 11 ++- .../V1/RegionAutoscalersClient/list.php | 10 +- .../V1/RegionAutoscalersClient/patch.php | 11 ++- .../V1/RegionAutoscalersClient/update.php | 11 ++- .../V1/RegionBackendServicesClient/delete.php | 11 ++- .../V1/RegionBackendServicesClient/get.php | 11 ++- .../get_health.php | 17 ++-- .../get_iam_policy.php | 11 ++- .../V1/RegionBackendServicesClient/insert.php | 11 ++- .../V1/RegionBackendServicesClient/list.php | 10 +- .../list_usable.php | 10 +- .../V1/RegionBackendServicesClient/patch.php | 17 ++-- .../set_iam_policy.php | 17 ++-- .../set_security_policy.php | 17 ++-- .../test_iam_permissions.php | 17 ++-- .../V1/RegionBackendServicesClient/update.php | 17 ++-- .../aggregated_list.php | 9 +- .../V1/RegionCommitmentsClient/get.php | 11 ++- .../V1/RegionCommitmentsClient/insert.php | 11 ++- .../V1/RegionCommitmentsClient/list.php | 10 +- .../V1/RegionCommitmentsClient/update.php | 12 ++- .../samples/V1/RegionDiskTypesClient/get.php | 11 ++- .../samples/V1/RegionDiskTypesClient/list.php | 10 +- .../add_resource_policies.php | 17 ++-- .../V1/RegionDisksClient/bulk_insert.php | 11 ++- .../V1/RegionDisksClient/create_snapshot.php | 12 ++- .../samples/V1/RegionDisksClient/delete.php | 11 ++- Compute/samples/V1/RegionDisksClient/get.php | 11 ++- .../V1/RegionDisksClient/get_iam_policy.php | 11 ++- .../samples/V1/RegionDisksClient/insert.php | 11 ++- Compute/samples/V1/RegionDisksClient/list.php | 10 +- .../remove_resource_policies.php | 19 ++-- .../samples/V1/RegionDisksClient/resize.php | 12 ++- .../V1/RegionDisksClient/set_iam_policy.php | 17 ++-- .../V1/RegionDisksClient/set_labels.php | 17 ++-- .../start_async_replication.php | 19 ++-- .../stop_async_replication.php | 11 ++- .../stop_group_async_replication.php | 15 +-- .../test_iam_permissions.php | 17 ++-- .../samples/V1/RegionDisksClient/update.php | 12 ++- .../delete.php | 11 ++- .../RegionHealthCheckServicesClient/get.php | 11 ++- .../insert.php | 15 +-- .../RegionHealthCheckServicesClient/list.php | 10 +- .../RegionHealthCheckServicesClient/patch.php | 17 ++-- .../V1/RegionHealthChecksClient/delete.php | 11 ++- .../V1/RegionHealthChecksClient/get.php | 11 ++- .../V1/RegionHealthChecksClient/insert.php | 11 ++- .../V1/RegionHealthChecksClient/list.php | 10 +- .../V1/RegionHealthChecksClient/patch.php | 12 ++- .../V1/RegionHealthChecksClient/update.php | 17 ++-- .../abandon_instances.php | 19 ++-- .../apply_updates_to_instances.php | 19 ++-- .../create_instances.php | 19 ++-- .../delete.php | 11 ++- .../delete_instances.php | 19 ++-- .../delete_per_instance_configs.php | 19 ++-- .../RegionInstanceGroupManagersClient/get.php | 11 ++- .../insert.php | 15 +-- .../list.php | 10 +- .../list_errors.php | 15 +-- .../list_managed_instances.php | 15 +-- .../list_per_instance_configs.php | 15 +-- .../patch.php | 17 ++-- .../patch_per_instance_configs.php | 19 ++-- .../recreate_instances.php | 19 ++-- .../resize.php | 17 ++-- .../resume_instances.php | 19 ++-- .../set_instance_template.php | 19 ++-- .../set_target_pools.php | 19 ++-- .../start_instances.php | 19 ++-- .../stop_instances.php | 19 ++-- .../suspend_instances.php | 19 ++-- .../update_per_instance_configs.php | 19 ++-- .../V1/RegionInstanceGroupsClient/get.php | 11 ++- .../V1/RegionInstanceGroupsClient/list.php | 10 +- .../list_instances.php | 19 ++-- .../set_named_ports.php | 19 ++-- .../RegionInstanceTemplatesClient/delete.php | 11 ++- .../V1/RegionInstanceTemplatesClient/get.php | 11 ++- .../RegionInstanceTemplatesClient/insert.php | 11 ++- .../V1/RegionInstanceTemplatesClient/list.php | 10 +- .../V1/RegionInstancesClient/bulk_insert.php | 15 +-- .../RegionInstantSnapshotsClient/delete.php | 11 ++- .../V1/RegionInstantSnapshotsClient/get.php | 11 ++- .../get_iam_policy.php | 11 ++- .../RegionInstantSnapshotsClient/insert.php | 11 ++- .../V1/RegionInstantSnapshotsClient/list.php | 10 +- .../set_iam_policy.php | 17 ++-- .../set_labels.php | 17 ++-- .../test_iam_permissions.php | 17 ++-- .../attach_network_endpoints.php | 19 ++-- .../delete.php | 11 ++- .../detach_network_endpoints.php | 19 ++-- .../RegionNetworkEndpointGroupsClient/get.php | 11 ++- .../insert.php | 15 +-- .../list.php | 10 +- .../list_network_endpoints.php | 15 +-- .../add_association.php | 17 ++-- .../add_rule.php | 17 ++-- .../clone_rules.php | 11 ++- .../delete.php | 11 ++- .../get.php | 11 ++- .../get_association.php | 15 +-- .../get_effective_firewalls.php | 15 +-- .../get_iam_policy.php | 11 ++- .../get_rule.php | 11 ++- .../insert.php | 15 +-- .../list.php | 10 +- .../patch.php | 17 ++-- .../patch_rule.php | 17 ++-- .../remove_association.php | 15 +-- .../remove_rule.php | 11 ++- .../set_iam_policy.php | 17 ++-- .../test_iam_permissions.php | 17 ++-- .../delete.php | 11 ++- .../RegionNotificationEndpointsClient/get.php | 11 ++- .../insert.php | 15 +-- .../list.php | 10 +- .../V1/RegionOperationsClient/delete.php | 11 ++- .../samples/V1/RegionOperationsClient/get.php | 11 ++- .../V1/RegionOperationsClient/list.php | 10 +- .../V1/RegionOperationsClient/wait.php | 11 ++- .../RegionSecurityPoliciesClient/add_rule.php | 17 ++-- .../RegionSecurityPoliciesClient/delete.php | 11 ++- .../V1/RegionSecurityPoliciesClient/get.php | 11 ++- .../RegionSecurityPoliciesClient/get_rule.php | 11 ++- .../RegionSecurityPoliciesClient/insert.php | 11 ++- .../V1/RegionSecurityPoliciesClient/list.php | 10 +- .../V1/RegionSecurityPoliciesClient/patch.php | 17 ++-- .../patch_rule.php | 17 ++-- .../remove_rule.php | 11 ++- .../set_labels.php | 17 ++-- .../V1/RegionSslCertificatesClient/delete.php | 11 ++- .../V1/RegionSslCertificatesClient/get.php | 11 ++- .../V1/RegionSslCertificatesClient/insert.php | 11 ++- .../V1/RegionSslCertificatesClient/list.php | 10 +- .../V1/RegionSslPoliciesClient/delete.php | 11 ++- .../V1/RegionSslPoliciesClient/get.php | 11 ++- .../V1/RegionSslPoliciesClient/insert.php | 11 ++- .../V1/RegionSslPoliciesClient/list.php | 10 +- .../list_available_features.php | 10 +- .../V1/RegionSslPoliciesClient/patch.php | 12 ++- .../RegionTargetHttpProxiesClient/delete.php | 11 ++- .../V1/RegionTargetHttpProxiesClient/get.php | 11 ++- .../RegionTargetHttpProxiesClient/insert.php | 11 ++- .../V1/RegionTargetHttpProxiesClient/list.php | 10 +- .../set_url_map.php | 17 ++-- .../RegionTargetHttpsProxiesClient/delete.php | 11 ++- .../V1/RegionTargetHttpsProxiesClient/get.php | 11 ++- .../RegionTargetHttpsProxiesClient/insert.php | 11 ++- .../RegionTargetHttpsProxiesClient/list.php | 10 +- .../RegionTargetHttpsProxiesClient/patch.php | 17 ++-- .../set_ssl_certificates.php | 19 ++-- .../set_url_map.php | 17 ++-- .../RegionTargetTcpProxiesClient/delete.php | 11 ++- .../V1/RegionTargetTcpProxiesClient/get.php | 11 ++- .../RegionTargetTcpProxiesClient/insert.php | 11 ++- .../V1/RegionTargetTcpProxiesClient/list.php | 10 +- .../samples/V1/RegionUrlMapsClient/delete.php | 11 ++- .../samples/V1/RegionUrlMapsClient/get.php | 11 ++- .../samples/V1/RegionUrlMapsClient/insert.php | 11 ++- .../samples/V1/RegionUrlMapsClient/list.php | 10 +- .../samples/V1/RegionUrlMapsClient/patch.php | 12 ++- .../samples/V1/RegionUrlMapsClient/update.php | 12 ++- .../V1/RegionUrlMapsClient/validate.php | 17 ++-- Compute/samples/V1/RegionZonesClient/list.php | 10 +- Compute/samples/V1/RegionsClient/get.php | 10 +- Compute/samples/V1/RegionsClient/list.php | 9 +- .../V1/ReservationsClient/aggregated_list.php | 9 +- .../samples/V1/ReservationsClient/delete.php | 11 ++- Compute/samples/V1/ReservationsClient/get.php | 11 ++- .../V1/ReservationsClient/get_iam_policy.php | 11 ++- .../samples/V1/ReservationsClient/insert.php | 11 ++- .../samples/V1/ReservationsClient/list.php | 10 +- .../samples/V1/ReservationsClient/resize.php | 17 ++-- .../V1/ReservationsClient/set_iam_policy.php | 17 ++-- .../test_iam_permissions.php | 17 ++-- .../samples/V1/ReservationsClient/update.php | 12 ++- .../aggregated_list.php | 9 +- .../V1/ResourcePoliciesClient/delete.php | 11 ++- .../samples/V1/ResourcePoliciesClient/get.php | 11 ++- .../ResourcePoliciesClient/get_iam_policy.php | 11 ++- .../V1/ResourcePoliciesClient/insert.php | 11 ++- .../V1/ResourcePoliciesClient/list.php | 10 +- .../V1/ResourcePoliciesClient/patch.php | 17 ++-- .../ResourcePoliciesClient/set_iam_policy.php | 17 ++-- .../test_iam_permissions.php | 17 ++-- .../V1/RoutersClient/aggregated_list.php | 9 +- Compute/samples/V1/RoutersClient/delete.php | 11 ++- Compute/samples/V1/RoutersClient/get.php | 11 ++- .../V1/RoutersClient/get_nat_ip_info.php | 11 ++- .../V1/RoutersClient/get_nat_mapping_info.php | 11 ++- .../V1/RoutersClient/get_router_status.php | 11 ++- Compute/samples/V1/RoutersClient/insert.php | 11 ++- Compute/samples/V1/RoutersClient/list.php | 10 +- Compute/samples/V1/RoutersClient/patch.php | 12 ++- Compute/samples/V1/RoutersClient/preview.php | 12 ++- Compute/samples/V1/RoutersClient/update.php | 12 ++- Compute/samples/V1/RoutesClient/delete.php | 10 +- Compute/samples/V1/RoutesClient/get.php | 10 +- Compute/samples/V1/RoutesClient/insert.php | 10 +- Compute/samples/V1/RoutesClient/list.php | 9 +- .../V1/SecurityPoliciesClient/add_rule.php | 15 +-- .../aggregated_list.php | 9 +- .../V1/SecurityPoliciesClient/delete.php | 10 +- .../samples/V1/SecurityPoliciesClient/get.php | 10 +- .../V1/SecurityPoliciesClient/get_rule.php | 10 +- .../V1/SecurityPoliciesClient/insert.php | 10 +- .../V1/SecurityPoliciesClient/list.php | 9 +- .../list_preconfigured_expression_sets.php | 9 +- .../V1/SecurityPoliciesClient/patch.php | 11 ++- .../V1/SecurityPoliciesClient/patch_rule.php | 15 +-- .../V1/SecurityPoliciesClient/remove_rule.php | 10 +- .../V1/SecurityPoliciesClient/set_labels.php | 15 +-- .../aggregated_list.php | 9 +- .../V1/ServiceAttachmentsClient/delete.php | 11 ++- .../V1/ServiceAttachmentsClient/get.php | 11 ++- .../get_iam_policy.php | 11 ++- .../V1/ServiceAttachmentsClient/insert.php | 11 ++- .../V1/ServiceAttachmentsClient/list.php | 10 +- .../V1/ServiceAttachmentsClient/patch.php | 17 ++-- .../set_iam_policy.php | 17 ++-- .../test_iam_permissions.php | 17 ++-- .../V1/SnapshotSettingsServiceClient/get.php | 9 +- .../SnapshotSettingsServiceClient/patch.php | 10 +- Compute/samples/V1/SnapshotsClient/delete.php | 10 +- Compute/samples/V1/SnapshotsClient/get.php | 10 +- .../V1/SnapshotsClient/get_iam_policy.php | 10 +- Compute/samples/V1/SnapshotsClient/insert.php | 10 +- Compute/samples/V1/SnapshotsClient/list.php | 9 +- .../V1/SnapshotsClient/set_iam_policy.php | 11 ++- .../samples/V1/SnapshotsClient/set_labels.php | 11 ++- .../SnapshotsClient/test_iam_permissions.php | 15 +-- .../SslCertificatesClient/aggregated_list.php | 9 +- .../V1/SslCertificatesClient/delete.php | 10 +- .../samples/V1/SslCertificatesClient/get.php | 10 +- .../V1/SslCertificatesClient/insert.php | 10 +- .../samples/V1/SslCertificatesClient/list.php | 9 +- .../V1/SslPoliciesClient/aggregated_list.php | 9 +- .../samples/V1/SslPoliciesClient/delete.php | 10 +- Compute/samples/V1/SslPoliciesClient/get.php | 10 +- .../samples/V1/SslPoliciesClient/insert.php | 10 +- Compute/samples/V1/SslPoliciesClient/list.php | 9 +- .../list_available_features.php | 9 +- .../samples/V1/SslPoliciesClient/patch.php | 11 ++- .../aggregated_list.php | 9 +- .../samples/V1/StoragePoolTypesClient/get.php | 11 ++- .../V1/StoragePoolTypesClient/list.php | 10 +- .../V1/StoragePoolsClient/aggregated_list.php | 9 +- .../samples/V1/StoragePoolsClient/delete.php | 11 ++- Compute/samples/V1/StoragePoolsClient/get.php | 11 ++- .../V1/StoragePoolsClient/get_iam_policy.php | 11 ++- .../samples/V1/StoragePoolsClient/insert.php | 11 ++- .../samples/V1/StoragePoolsClient/list.php | 10 +- .../V1/StoragePoolsClient/list_disks.php | 11 ++- .../V1/StoragePoolsClient/set_iam_policy.php | 17 ++-- .../test_iam_permissions.php | 17 ++-- .../samples/V1/StoragePoolsClient/update.php | 12 ++- .../V1/SubnetworksClient/aggregated_list.php | 9 +- .../samples/V1/SubnetworksClient/delete.php | 11 ++- .../expand_ip_cidr_range.php | 17 ++-- Compute/samples/V1/SubnetworksClient/get.php | 11 ++- .../V1/SubnetworksClient/get_iam_policy.php | 11 ++- .../samples/V1/SubnetworksClient/insert.php | 11 ++- Compute/samples/V1/SubnetworksClient/list.php | 10 +- .../V1/SubnetworksClient/list_usable.php | 9 +- .../samples/V1/SubnetworksClient/patch.php | 12 ++- .../V1/SubnetworksClient/set_iam_policy.php | 17 ++-- .../set_private_ip_google_access.php | 19 ++-- .../test_iam_permissions.php | 17 ++-- .../V1/TargetGrpcProxiesClient/delete.php | 10 +- .../V1/TargetGrpcProxiesClient/get.php | 10 +- .../V1/TargetGrpcProxiesClient/insert.php | 10 +- .../V1/TargetGrpcProxiesClient/list.php | 9 +- .../V1/TargetGrpcProxiesClient/patch.php | 11 ++- .../aggregated_list.php | 9 +- .../V1/TargetHttpProxiesClient/delete.php | 10 +- .../V1/TargetHttpProxiesClient/get.php | 10 +- .../V1/TargetHttpProxiesClient/insert.php | 10 +- .../V1/TargetHttpProxiesClient/list.php | 9 +- .../V1/TargetHttpProxiesClient/patch.php | 11 ++- .../TargetHttpProxiesClient/set_url_map.php | 15 +-- .../aggregated_list.php | 9 +- .../V1/TargetHttpsProxiesClient/delete.php | 10 +- .../V1/TargetHttpsProxiesClient/get.php | 10 +- .../V1/TargetHttpsProxiesClient/insert.php | 10 +- .../V1/TargetHttpsProxiesClient/list.php | 9 +- .../V1/TargetHttpsProxiesClient/patch.php | 15 +-- .../set_certificate_map.php | 17 ++-- .../set_quic_override.php | 17 ++-- .../set_ssl_certificates.php | 17 ++-- .../set_ssl_policy.php | 15 +-- .../TargetHttpsProxiesClient/set_url_map.php | 15 +-- .../TargetInstancesClient/aggregated_list.php | 9 +- .../V1/TargetInstancesClient/delete.php | 11 ++- .../samples/V1/TargetInstancesClient/get.php | 11 ++- .../V1/TargetInstancesClient/insert.php | 11 ++- .../samples/V1/TargetInstancesClient/list.php | 10 +- .../set_security_policy.php | 17 ++-- .../V1/TargetPoolsClient/add_health_check.php | 17 ++-- .../V1/TargetPoolsClient/add_instance.php | 17 ++-- .../V1/TargetPoolsClient/aggregated_list.php | 9 +- .../samples/V1/TargetPoolsClient/delete.php | 11 ++- Compute/samples/V1/TargetPoolsClient/get.php | 11 ++- .../V1/TargetPoolsClient/get_health.php | 17 ++-- .../samples/V1/TargetPoolsClient/insert.php | 11 ++- Compute/samples/V1/TargetPoolsClient/list.php | 10 +- .../TargetPoolsClient/remove_health_check.php | 17 ++-- .../V1/TargetPoolsClient/remove_instance.php | 17 ++-- .../V1/TargetPoolsClient/set_backup.php | 12 ++- .../TargetPoolsClient/set_security_policy.php | 17 ++-- .../V1/TargetSslProxiesClient/delete.php | 10 +- .../samples/V1/TargetSslProxiesClient/get.php | 10 +- .../V1/TargetSslProxiesClient/insert.php | 10 +- .../V1/TargetSslProxiesClient/list.php | 9 +- .../set_backend_service.php | 17 ++-- .../set_certificate_map.php | 17 ++-- .../set_proxy_header.php | 15 +-- .../set_ssl_certificates.php | 17 ++-- .../TargetSslProxiesClient/set_ssl_policy.php | 15 +-- .../aggregated_list.php | 9 +- .../V1/TargetTcpProxiesClient/delete.php | 10 +- .../samples/V1/TargetTcpProxiesClient/get.php | 10 +- .../V1/TargetTcpProxiesClient/insert.php | 10 +- .../V1/TargetTcpProxiesClient/list.php | 9 +- .../set_backend_service.php | 17 ++-- .../set_proxy_header.php | 15 +-- .../aggregated_list.php | 9 +- .../V1/TargetVpnGatewaysClient/delete.php | 11 ++- .../V1/TargetVpnGatewaysClient/get.php | 11 ++- .../V1/TargetVpnGatewaysClient/insert.php | 11 ++- .../V1/TargetVpnGatewaysClient/list.php | 10 +- .../V1/TargetVpnGatewaysClient/set_labels.php | 17 ++-- .../V1/UrlMapsClient/aggregated_list.php | 9 +- Compute/samples/V1/UrlMapsClient/delete.php | 10 +- Compute/samples/V1/UrlMapsClient/get.php | 10 +- Compute/samples/V1/UrlMapsClient/insert.php | 10 +- .../V1/UrlMapsClient/invalidate_cache.php | 11 ++- Compute/samples/V1/UrlMapsClient/list.php | 9 +- Compute/samples/V1/UrlMapsClient/patch.php | 11 ++- Compute/samples/V1/UrlMapsClient/update.php | 11 ++- Compute/samples/V1/UrlMapsClient/validate.php | 11 ++- .../V1/VpnGatewaysClient/aggregated_list.php | 9 +- .../samples/V1/VpnGatewaysClient/delete.php | 11 ++- Compute/samples/V1/VpnGatewaysClient/get.php | 11 ++- .../V1/VpnGatewaysClient/get_status.php | 11 ++- .../samples/V1/VpnGatewaysClient/insert.php | 11 ++- Compute/samples/V1/VpnGatewaysClient/list.php | 10 +- .../V1/VpnGatewaysClient/set_labels.php | 17 ++-- .../test_iam_permissions.php | 17 ++-- .../V1/VpnTunnelsClient/aggregated_list.php | 9 +- .../samples/V1/VpnTunnelsClient/delete.php | 11 ++- Compute/samples/V1/VpnTunnelsClient/get.php | 11 ++- .../samples/V1/VpnTunnelsClient/insert.php | 11 ++- Compute/samples/V1/VpnTunnelsClient/list.php | 10 +- .../V1/VpnTunnelsClient/set_labels.php | 17 ++-- .../V1/ZoneOperationsClient/delete.php | 11 ++- .../samples/V1/ZoneOperationsClient/get.php | 11 ++- .../samples/V1/ZoneOperationsClient/list.php | 10 +- .../samples/V1/ZoneOperationsClient/wait.php | 11 ++- Compute/samples/V1/ZonesClient/get.php | 10 +- Compute/samples/V1/ZonesClient/list.php | 9 +- .../src/V1/Client/AcceleratorTypesClient.php | 6 ++ Compute/src/V1/Client/AddressesClient.php | 14 +++ Compute/src/V1/Client/AutoscalersClient.php | 14 +++ .../src/V1/Client/BackendBucketsClient.php | 24 +++++ .../src/V1/Client/BackendServicesClient.php | 32 +++++++ Compute/src/V1/Client/DiskTypesClient.php | 6 ++ Compute/src/V1/Client/DisksClient.php | 36 +++++++ .../V1/Client/ExternalVpnGatewaysClient.php | 12 +++ .../src/V1/Client/FirewallPoliciesClient.php | 36 +++++++ Compute/src/V1/Client/FirewallsClient.php | 12 +++ .../src/V1/Client/ForwardingRulesClient.php | 16 ++++ .../src/V1/Client/GlobalAddressesClient.php | 12 +++ .../V1/Client/GlobalForwardingRulesClient.php | 14 +++ .../GlobalNetworkEndpointGroupsClient.php | 14 +++ .../src/V1/Client/GlobalOperationsClient.php | 10 ++ .../GlobalOrganizationOperationsClient.php | 6 ++ .../GlobalPublicDelegatedPrefixesClient.php | 10 ++ Compute/src/V1/Client/HealthChecksClient.php | 14 +++ .../src/V1/Client/ImageFamilyViewsClient.php | 2 + Compute/src/V1/Client/ImagesClient.php | 22 +++++ ...stanceGroupManagerResizeRequestsClient.php | 10 ++ .../V1/Client/InstanceGroupManagersClient.php | 48 ++++++++++ .../src/V1/Client/InstanceGroupsClient.php | 18 ++++ .../Client/InstanceSettingsServiceClient.php | 4 + .../src/V1/Client/InstanceTemplatesClient.php | 16 ++++ Compute/src/V1/Client/InstancesClient.php | 96 +++++++++++++++++++ .../src/V1/Client/InstantSnapshotsClient.php | 18 ++++ .../Client/InterconnectAttachmentsClient.php | 14 +++ .../V1/Client/InterconnectLocationsClient.php | 4 + .../InterconnectRemoteLocationsClient.php | 4 + Compute/src/V1/Client/InterconnectsClient.php | 16 ++++ Compute/src/V1/Client/LicenseCodesClient.php | 4 + Compute/src/V1/Client/LicensesClient.php | 14 +++ Compute/src/V1/Client/MachineImagesClient.php | 14 +++ Compute/src/V1/Client/MachineTypesClient.php | 6 ++ .../V1/Client/NetworkAttachmentsClient.php | 18 ++++ .../NetworkEdgeSecurityServicesClient.php | 10 ++ .../V1/Client/NetworkEndpointGroupsClient.php | 18 ++++ .../Client/NetworkFirewallPoliciesClient.php | 32 +++++++ .../src/V1/Client/NetworkProfilesClient.php | 4 + Compute/src/V1/Client/NetworksClient.php | 22 +++++ Compute/src/V1/Client/NodeGroupsClient.php | 30 ++++++ Compute/src/V1/Client/NodeTemplatesClient.php | 16 ++++ Compute/src/V1/Client/NodeTypesClient.php | 6 ++ .../src/V1/Client/PacketMirroringsClient.php | 14 +++ Compute/src/V1/Client/ProjectsClient.php | 28 ++++++ .../Client/PublicAdvertisedPrefixesClient.php | 14 +++ .../Client/PublicDelegatedPrefixesClient.php | 16 ++++ .../src/V1/Client/RegionAutoscalersClient.php | 12 +++ .../V1/Client/RegionBackendServicesClient.php | 24 +++++ .../src/V1/Client/RegionCommitmentsClient.php | 10 ++ .../src/V1/Client/RegionDiskTypesClient.php | 4 + Compute/src/V1/Client/RegionDisksClient.php | 34 +++++++ .../RegionHealthCheckServicesClient.php | 10 ++ .../V1/Client/RegionHealthChecksClient.php | 12 +++ .../RegionInstanceGroupManagersClient.php | 46 +++++++++ .../V1/Client/RegionInstanceGroupsClient.php | 8 ++ .../Client/RegionInstanceTemplatesClient.php | 8 ++ .../src/V1/Client/RegionInstancesClient.php | 2 + .../Client/RegionInstantSnapshotsClient.php | 16 ++++ .../RegionNetworkEndpointGroupsClient.php | 14 +++ .../RegionNetworkFirewallPoliciesClient.php | 34 +++++++ .../RegionNotificationEndpointsClient.php | 8 ++ .../src/V1/Client/RegionOperationsClient.php | 8 ++ .../Client/RegionSecurityPoliciesClient.php | 20 ++++ .../V1/Client/RegionSslCertificatesClient.php | 8 ++ .../src/V1/Client/RegionSslPoliciesClient.php | 12 +++ .../Client/RegionTargetHttpProxiesClient.php | 10 ++ .../Client/RegionTargetHttpsProxiesClient.php | 14 +++ .../Client/RegionTargetTcpProxiesClient.php | 8 ++ Compute/src/V1/Client/RegionUrlMapsClient.php | 14 +++ Compute/src/V1/Client/RegionZonesClient.php | 2 + Compute/src/V1/Client/RegionsClient.php | 4 + Compute/src/V1/Client/ReservationsClient.php | 20 ++++ .../src/V1/Client/ResourcePoliciesClient.php | 18 ++++ Compute/src/V1/Client/RoutersClient.php | 22 +++++ Compute/src/V1/Client/RoutesClient.php | 8 ++ .../src/V1/Client/SecurityPoliciesClient.php | 24 +++++ .../V1/Client/ServiceAttachmentsClient.php | 18 ++++ .../Client/SnapshotSettingsServiceClient.php | 4 + Compute/src/V1/Client/SnapshotsClient.php | 16 ++++ .../src/V1/Client/SslCertificatesClient.php | 10 ++ Compute/src/V1/Client/SslPoliciesClient.php | 14 +++ .../src/V1/Client/StoragePoolTypesClient.php | 6 ++ Compute/src/V1/Client/StoragePoolsClient.php | 20 ++++ Compute/src/V1/Client/SubnetworksClient.php | 24 +++++ .../src/V1/Client/TargetGrpcProxiesClient.php | 10 ++ .../src/V1/Client/TargetHttpProxiesClient.php | 14 +++ .../V1/Client/TargetHttpsProxiesClient.php | 22 +++++ .../src/V1/Client/TargetInstancesClient.php | 12 +++ Compute/src/V1/Client/TargetPoolsClient.php | 24 +++++ .../src/V1/Client/TargetSslProxiesClient.php | 18 ++++ .../src/V1/Client/TargetTcpProxiesClient.php | 14 +++ .../src/V1/Client/TargetVpnGatewaysClient.php | 12 +++ Compute/src/V1/Client/UrlMapsClient.php | 18 ++++ Compute/src/V1/Client/VpnGatewaysClient.php | 16 ++++ Compute/src/V1/Client/VpnTunnelsClient.php | 12 +++ .../src/V1/Client/ZoneOperationsClient.php | 8 ++ Compute/src/V1/Client/ZonesClient.php | 4 + 877 files changed, 8090 insertions(+), 2984 deletions(-) diff --git a/Compute/samples/V1/AcceleratorTypesClient/aggregated_list.php b/Compute/samples/V1/AcceleratorTypesClient/aggregated_list.php index 86f8ccb5d452..5f1f70653107 100644 --- a/Compute/samples/V1/AcceleratorTypesClient/aggregated_list.php +++ b/Compute/samples/V1/AcceleratorTypesClient/aggregated_list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_AcceleratorTypes_AggregatedList_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\AcceleratorTypesClient; +use Google\Cloud\Compute\V1\AggregatedListAcceleratorTypesRequest; +use Google\Cloud\Compute\V1\Client\AcceleratorTypesClient; /** * Retrieves an aggregated list of accelerator types. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. @@ -37,10 +38,14 @@ function aggregated_list_sample(string $project): void // Create a client. $acceleratorTypesClient = new AcceleratorTypesClient(); + // Prepare the request message. + $request = (new AggregatedListAcceleratorTypesRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $acceleratorTypesClient->aggregatedList($project); + $response = $acceleratorTypesClient->aggregatedList($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/AcceleratorTypesClient/get.php b/Compute/samples/V1/AcceleratorTypesClient/get.php index e543636e97e9..e470891c7370 100644 --- a/Compute/samples/V1/AcceleratorTypesClient/get.php +++ b/Compute/samples/V1/AcceleratorTypesClient/get.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_AcceleratorTypes_Get_sync] use Google\ApiCore\ApiException; use Google\Cloud\Compute\V1\AcceleratorType; -use Google\Cloud\Compute\V1\AcceleratorTypesClient; +use Google\Cloud\Compute\V1\Client\AcceleratorTypesClient; +use Google\Cloud\Compute\V1\GetAcceleratorTypeRequest; /** * Returns the specified accelerator type. @@ -39,10 +40,16 @@ function get_sample(string $acceleratorType, string $project, string $zone): voi // Create a client. $acceleratorTypesClient = new AcceleratorTypesClient(); + // Prepare the request message. + $request = (new GetAcceleratorTypeRequest()) + ->setAcceleratorType($acceleratorType) + ->setProject($project) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var AcceleratorType $response */ - $response = $acceleratorTypesClient->get($acceleratorType, $project, $zone); + $response = $acceleratorTypesClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/AcceleratorTypesClient/list.php b/Compute/samples/V1/AcceleratorTypesClient/list.php index 13738e04e1d9..e08a87a82a37 100644 --- a/Compute/samples/V1/AcceleratorTypesClient/list.php +++ b/Compute/samples/V1/AcceleratorTypesClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_AcceleratorTypes_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\AcceleratorTypesClient; +use Google\Cloud\Compute\V1\Client\AcceleratorTypesClient; +use Google\Cloud\Compute\V1\ListAcceleratorTypesRequest; /** * Retrieves a list of accelerator types that are available to the specified project. @@ -38,10 +39,15 @@ function list_sample(string $project, string $zone): void // Create a client. $acceleratorTypesClient = new AcceleratorTypesClient(); + // Prepare the request message. + $request = (new ListAcceleratorTypesRequest()) + ->setProject($project) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $acceleratorTypesClient->list($project, $zone); + $response = $acceleratorTypesClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/AddressesClient/aggregated_list.php b/Compute/samples/V1/AddressesClient/aggregated_list.php index 3d20d1e3fdb1..095440364dec 100644 --- a/Compute/samples/V1/AddressesClient/aggregated_list.php +++ b/Compute/samples/V1/AddressesClient/aggregated_list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_Addresses_AggregatedList_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\AddressesClient; +use Google\Cloud\Compute\V1\AggregatedListAddressesRequest; +use Google\Cloud\Compute\V1\Client\AddressesClient; /** * Retrieves an aggregated list of addresses. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. @@ -37,10 +38,14 @@ function aggregated_list_sample(string $project): void // Create a client. $addressesClient = new AddressesClient(); + // Prepare the request message. + $request = (new AggregatedListAddressesRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $addressesClient->aggregatedList($project); + $response = $addressesClient->aggregatedList($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/AddressesClient/delete.php b/Compute/samples/V1/AddressesClient/delete.php index ed1497ecc96e..fba8d487ad4b 100644 --- a/Compute/samples/V1/AddressesClient/delete.php +++ b/Compute/samples/V1/AddressesClient/delete.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_Addresses_Delete_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\AddressesClient; +use Google\Cloud\Compute\V1\Client\AddressesClient; +use Google\Cloud\Compute\V1\DeleteAddressRequest; use Google\Rpc\Status; /** @@ -40,10 +41,16 @@ function delete_sample(string $address, string $project, string $region): void // Create a client. $addressesClient = new AddressesClient(); + // Prepare the request message. + $request = (new DeleteAddressRequest()) + ->setAddress($address) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $addressesClient->delete($address, $project, $region); + $response = $addressesClient->delete($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/AddressesClient/get.php b/Compute/samples/V1/AddressesClient/get.php index 8b53fe9294c5..7465ca3c8965 100644 --- a/Compute/samples/V1/AddressesClient/get.php +++ b/Compute/samples/V1/AddressesClient/get.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_Addresses_Get_sync] use Google\ApiCore\ApiException; use Google\Cloud\Compute\V1\Address; -use Google\Cloud\Compute\V1\AddressesClient; +use Google\Cloud\Compute\V1\Client\AddressesClient; +use Google\Cloud\Compute\V1\GetAddressRequest; /** * Returns the specified address resource. @@ -39,10 +40,16 @@ function get_sample(string $address, string $project, string $region): void // Create a client. $addressesClient = new AddressesClient(); + // Prepare the request message. + $request = (new GetAddressRequest()) + ->setAddress($address) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var Address $response */ - $response = $addressesClient->get($address, $project, $region); + $response = $addressesClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/AddressesClient/insert.php b/Compute/samples/V1/AddressesClient/insert.php index 85dc710cbd0a..8313843b91f6 100644 --- a/Compute/samples/V1/AddressesClient/insert.php +++ b/Compute/samples/V1/AddressesClient/insert.php @@ -26,7 +26,8 @@ use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; use Google\Cloud\Compute\V1\Address; -use Google\Cloud\Compute\V1\AddressesClient; +use Google\Cloud\Compute\V1\Client\AddressesClient; +use Google\Cloud\Compute\V1\InsertAddressRequest; use Google\Rpc\Status; /** @@ -40,13 +41,17 @@ function insert_sample(string $project, string $region): void // Create a client. $addressesClient = new AddressesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $addressResource = new Address(); + $request = (new InsertAddressRequest()) + ->setAddressResource($addressResource) + ->setProject($project) + ->setRegion($region); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $addressesClient->insert($addressResource, $project, $region); + $response = $addressesClient->insert($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/AddressesClient/list.php b/Compute/samples/V1/AddressesClient/list.php index 98a2f3c6034e..201339cdb56d 100644 --- a/Compute/samples/V1/AddressesClient/list.php +++ b/Compute/samples/V1/AddressesClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_Addresses_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\AddressesClient; +use Google\Cloud\Compute\V1\Client\AddressesClient; +use Google\Cloud\Compute\V1\ListAddressesRequest; /** * Retrieves a list of addresses contained within the specified region. @@ -38,10 +39,15 @@ function list_sample(string $project, string $region): void // Create a client. $addressesClient = new AddressesClient(); + // Prepare the request message. + $request = (new ListAddressesRequest()) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $addressesClient->list($project, $region); + $response = $addressesClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/AddressesClient/move.php b/Compute/samples/V1/AddressesClient/move.php index 6c191c904a11..740398848e3a 100644 --- a/Compute/samples/V1/AddressesClient/move.php +++ b/Compute/samples/V1/AddressesClient/move.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_Addresses_Move_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\AddressesClient; +use Google\Cloud\Compute\V1\Client\AddressesClient; +use Google\Cloud\Compute\V1\MoveAddressRequest; use Google\Cloud\Compute\V1\RegionAddressesMoveRequest; use Google\Rpc\Status; @@ -41,18 +42,18 @@ function move_sample(string $address, string $project, string $region): void // Create a client. $addressesClient = new AddressesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $regionAddressesMoveRequestResource = new RegionAddressesMoveRequest(); + $request = (new MoveAddressRequest()) + ->setAddress($address) + ->setProject($project) + ->setRegion($region) + ->setRegionAddressesMoveRequestResource($regionAddressesMoveRequestResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $addressesClient->move( - $address, - $project, - $region, - $regionAddressesMoveRequestResource - ); + $response = $addressesClient->move($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/AddressesClient/set_labels.php b/Compute/samples/V1/AddressesClient/set_labels.php index 698f703dd723..df5bfab34174 100644 --- a/Compute/samples/V1/AddressesClient/set_labels.php +++ b/Compute/samples/V1/AddressesClient/set_labels.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_Addresses_SetLabels_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\AddressesClient; +use Google\Cloud\Compute\V1\Client\AddressesClient; use Google\Cloud\Compute\V1\RegionSetLabelsRequest; +use Google\Cloud\Compute\V1\SetLabelsAddressRequest; use Google\Rpc\Status; /** @@ -41,18 +42,18 @@ function set_labels_sample(string $project, string $region, string $resource): v // Create a client. $addressesClient = new AddressesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $regionSetLabelsRequestResource = new RegionSetLabelsRequest(); + $request = (new SetLabelsAddressRequest()) + ->setProject($project) + ->setRegion($region) + ->setRegionSetLabelsRequestResource($regionSetLabelsRequestResource) + ->setResource($resource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $addressesClient->setLabels( - $project, - $region, - $regionSetLabelsRequestResource, - $resource - ); + $response = $addressesClient->setLabels($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/AutoscalersClient/aggregated_list.php b/Compute/samples/V1/AutoscalersClient/aggregated_list.php index 648795ecda20..dc49aa399d47 100644 --- a/Compute/samples/V1/AutoscalersClient/aggregated_list.php +++ b/Compute/samples/V1/AutoscalersClient/aggregated_list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_Autoscalers_AggregatedList_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\AutoscalersClient; +use Google\Cloud\Compute\V1\AggregatedListAutoscalersRequest; +use Google\Cloud\Compute\V1\Client\AutoscalersClient; /** * Retrieves an aggregated list of autoscalers. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. @@ -37,10 +38,14 @@ function aggregated_list_sample(string $project): void // Create a client. $autoscalersClient = new AutoscalersClient(); + // Prepare the request message. + $request = (new AggregatedListAutoscalersRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $autoscalersClient->aggregatedList($project); + $response = $autoscalersClient->aggregatedList($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/AutoscalersClient/delete.php b/Compute/samples/V1/AutoscalersClient/delete.php index 799733862e25..ce109403c0bf 100644 --- a/Compute/samples/V1/AutoscalersClient/delete.php +++ b/Compute/samples/V1/AutoscalersClient/delete.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_Autoscalers_Delete_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\AutoscalersClient; +use Google\Cloud\Compute\V1\Client\AutoscalersClient; +use Google\Cloud\Compute\V1\DeleteAutoscalerRequest; use Google\Rpc\Status; /** @@ -40,10 +41,16 @@ function delete_sample(string $autoscaler, string $project, string $zone): void // Create a client. $autoscalersClient = new AutoscalersClient(); + // Prepare the request message. + $request = (new DeleteAutoscalerRequest()) + ->setAutoscaler($autoscaler) + ->setProject($project) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $autoscalersClient->delete($autoscaler, $project, $zone); + $response = $autoscalersClient->delete($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/AutoscalersClient/get.php b/Compute/samples/V1/AutoscalersClient/get.php index 13c5b09fe169..01b452923b64 100644 --- a/Compute/samples/V1/AutoscalersClient/get.php +++ b/Compute/samples/V1/AutoscalersClient/get.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_Autoscalers_Get_sync] use Google\ApiCore\ApiException; use Google\Cloud\Compute\V1\Autoscaler; -use Google\Cloud\Compute\V1\AutoscalersClient; +use Google\Cloud\Compute\V1\Client\AutoscalersClient; +use Google\Cloud\Compute\V1\GetAutoscalerRequest; /** * Returns the specified autoscaler resource. @@ -39,10 +40,16 @@ function get_sample(string $autoscaler, string $project, string $zone): void // Create a client. $autoscalersClient = new AutoscalersClient(); + // Prepare the request message. + $request = (new GetAutoscalerRequest()) + ->setAutoscaler($autoscaler) + ->setProject($project) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var Autoscaler $response */ - $response = $autoscalersClient->get($autoscaler, $project, $zone); + $response = $autoscalersClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/AutoscalersClient/insert.php b/Compute/samples/V1/AutoscalersClient/insert.php index fd50af9b67fb..86daf23afc2b 100644 --- a/Compute/samples/V1/AutoscalersClient/insert.php +++ b/Compute/samples/V1/AutoscalersClient/insert.php @@ -26,7 +26,8 @@ use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; use Google\Cloud\Compute\V1\Autoscaler; -use Google\Cloud\Compute\V1\AutoscalersClient; +use Google\Cloud\Compute\V1\Client\AutoscalersClient; +use Google\Cloud\Compute\V1\InsertAutoscalerRequest; use Google\Rpc\Status; /** @@ -40,13 +41,17 @@ function insert_sample(string $project, string $zone): void // Create a client. $autoscalersClient = new AutoscalersClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $autoscalerResource = new Autoscaler(); + $request = (new InsertAutoscalerRequest()) + ->setAutoscalerResource($autoscalerResource) + ->setProject($project) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $autoscalersClient->insert($autoscalerResource, $project, $zone); + $response = $autoscalersClient->insert($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/AutoscalersClient/list.php b/Compute/samples/V1/AutoscalersClient/list.php index 64980645641e..92a58fe21ba2 100644 --- a/Compute/samples/V1/AutoscalersClient/list.php +++ b/Compute/samples/V1/AutoscalersClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_Autoscalers_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\AutoscalersClient; +use Google\Cloud\Compute\V1\Client\AutoscalersClient; +use Google\Cloud\Compute\V1\ListAutoscalersRequest; /** * Retrieves a list of autoscalers contained within the specified zone. @@ -38,10 +39,15 @@ function list_sample(string $project, string $zone): void // Create a client. $autoscalersClient = new AutoscalersClient(); + // Prepare the request message. + $request = (new ListAutoscalersRequest()) + ->setProject($project) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $autoscalersClient->list($project, $zone); + $response = $autoscalersClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/AutoscalersClient/patch.php b/Compute/samples/V1/AutoscalersClient/patch.php index 1e661e39901e..535dcebaa3e1 100644 --- a/Compute/samples/V1/AutoscalersClient/patch.php +++ b/Compute/samples/V1/AutoscalersClient/patch.php @@ -26,7 +26,8 @@ use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; use Google\Cloud\Compute\V1\Autoscaler; -use Google\Cloud\Compute\V1\AutoscalersClient; +use Google\Cloud\Compute\V1\Client\AutoscalersClient; +use Google\Cloud\Compute\V1\PatchAutoscalerRequest; use Google\Rpc\Status; /** @@ -40,13 +41,17 @@ function patch_sample(string $project, string $zone): void // Create a client. $autoscalersClient = new AutoscalersClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $autoscalerResource = new Autoscaler(); + $request = (new PatchAutoscalerRequest()) + ->setAutoscalerResource($autoscalerResource) + ->setProject($project) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $autoscalersClient->patch($autoscalerResource, $project, $zone); + $response = $autoscalersClient->patch($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/AutoscalersClient/update.php b/Compute/samples/V1/AutoscalersClient/update.php index 87293f5c0885..ca78d981c910 100644 --- a/Compute/samples/V1/AutoscalersClient/update.php +++ b/Compute/samples/V1/AutoscalersClient/update.php @@ -26,7 +26,8 @@ use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; use Google\Cloud\Compute\V1\Autoscaler; -use Google\Cloud\Compute\V1\AutoscalersClient; +use Google\Cloud\Compute\V1\Client\AutoscalersClient; +use Google\Cloud\Compute\V1\UpdateAutoscalerRequest; use Google\Rpc\Status; /** @@ -40,13 +41,17 @@ function update_sample(string $project, string $zone): void // Create a client. $autoscalersClient = new AutoscalersClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $autoscalerResource = new Autoscaler(); + $request = (new UpdateAutoscalerRequest()) + ->setAutoscalerResource($autoscalerResource) + ->setProject($project) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $autoscalersClient->update($autoscalerResource, $project, $zone); + $response = $autoscalersClient->update($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/BackendBucketsClient/add_signed_url_key.php b/Compute/samples/V1/BackendBucketsClient/add_signed_url_key.php index 5845761c6527..631ba963f25a 100644 --- a/Compute/samples/V1/BackendBucketsClient/add_signed_url_key.php +++ b/Compute/samples/V1/BackendBucketsClient/add_signed_url_key.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_BackendBuckets_AddSignedUrlKey_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\BackendBucketsClient; +use Google\Cloud\Compute\V1\AddSignedUrlKeyBackendBucketRequest; +use Google\Cloud\Compute\V1\Client\BackendBucketsClient; use Google\Cloud\Compute\V1\SignedUrlKey; use Google\Rpc\Status; @@ -40,13 +41,17 @@ function add_signed_url_key_sample(string $backendBucket, string $project): void // Create a client. $backendBucketsClient = new BackendBucketsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $signedUrlKeyResource = new SignedUrlKey(); + $request = (new AddSignedUrlKeyBackendBucketRequest()) + ->setBackendBucket($backendBucket) + ->setProject($project) + ->setSignedUrlKeyResource($signedUrlKeyResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $backendBucketsClient->addSignedUrlKey($backendBucket, $project, $signedUrlKeyResource); + $response = $backendBucketsClient->addSignedUrlKey($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/BackendBucketsClient/delete.php b/Compute/samples/V1/BackendBucketsClient/delete.php index ad0a03a942f2..5e68c277c6ec 100644 --- a/Compute/samples/V1/BackendBucketsClient/delete.php +++ b/Compute/samples/V1/BackendBucketsClient/delete.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_BackendBuckets_Delete_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\BackendBucketsClient; +use Google\Cloud\Compute\V1\Client\BackendBucketsClient; +use Google\Cloud\Compute\V1\DeleteBackendBucketRequest; use Google\Rpc\Status; /** @@ -39,10 +40,15 @@ function delete_sample(string $backendBucket, string $project): void // Create a client. $backendBucketsClient = new BackendBucketsClient(); + // Prepare the request message. + $request = (new DeleteBackendBucketRequest()) + ->setBackendBucket($backendBucket) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $backendBucketsClient->delete($backendBucket, $project); + $response = $backendBucketsClient->delete($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/BackendBucketsClient/delete_signed_url_key.php b/Compute/samples/V1/BackendBucketsClient/delete_signed_url_key.php index ac649029f01b..731c0005caf8 100644 --- a/Compute/samples/V1/BackendBucketsClient/delete_signed_url_key.php +++ b/Compute/samples/V1/BackendBucketsClient/delete_signed_url_key.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_BackendBuckets_DeleteSignedUrlKey_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\BackendBucketsClient; +use Google\Cloud\Compute\V1\Client\BackendBucketsClient; +use Google\Cloud\Compute\V1\DeleteSignedUrlKeyBackendBucketRequest; use Google\Rpc\Status; /** @@ -43,10 +44,16 @@ function delete_signed_url_key_sample( // Create a client. $backendBucketsClient = new BackendBucketsClient(); + // Prepare the request message. + $request = (new DeleteSignedUrlKeyBackendBucketRequest()) + ->setBackendBucket($backendBucket) + ->setKeyName($keyName) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $backendBucketsClient->deleteSignedUrlKey($backendBucket, $keyName, $project); + $response = $backendBucketsClient->deleteSignedUrlKey($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/BackendBucketsClient/get.php b/Compute/samples/V1/BackendBucketsClient/get.php index 5149ea6dfa1f..3d26234fa6a1 100644 --- a/Compute/samples/V1/BackendBucketsClient/get.php +++ b/Compute/samples/V1/BackendBucketsClient/get.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_BackendBuckets_Get_sync] use Google\ApiCore\ApiException; use Google\Cloud\Compute\V1\BackendBucket; -use Google\Cloud\Compute\V1\BackendBucketsClient; +use Google\Cloud\Compute\V1\Client\BackendBucketsClient; +use Google\Cloud\Compute\V1\GetBackendBucketRequest; /** * Returns the specified BackendBucket resource. @@ -38,10 +39,15 @@ function get_sample(string $backendBucket, string $project): void // Create a client. $backendBucketsClient = new BackendBucketsClient(); + // Prepare the request message. + $request = (new GetBackendBucketRequest()) + ->setBackendBucket($backendBucket) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var BackendBucket $response */ - $response = $backendBucketsClient->get($backendBucket, $project); + $response = $backendBucketsClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/BackendBucketsClient/get_iam_policy.php b/Compute/samples/V1/BackendBucketsClient/get_iam_policy.php index 78c862552f21..e0162ce4ac31 100644 --- a/Compute/samples/V1/BackendBucketsClient/get_iam_policy.php +++ b/Compute/samples/V1/BackendBucketsClient/get_iam_policy.php @@ -24,7 +24,8 @@ // [START compute_v1_generated_BackendBuckets_GetIamPolicy_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\BackendBucketsClient; +use Google\Cloud\Compute\V1\Client\BackendBucketsClient; +use Google\Cloud\Compute\V1\GetIamPolicyBackendBucketRequest; use Google\Cloud\Compute\V1\Policy; /** @@ -38,10 +39,15 @@ function get_iam_policy_sample(string $project, string $resource): void // Create a client. $backendBucketsClient = new BackendBucketsClient(); + // Prepare the request message. + $request = (new GetIamPolicyBackendBucketRequest()) + ->setProject($project) + ->setResource($resource); + // Call the API and handle any network failures. try { /** @var Policy $response */ - $response = $backendBucketsClient->getIamPolicy($project, $resource); + $response = $backendBucketsClient->getIamPolicy($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/BackendBucketsClient/insert.php b/Compute/samples/V1/BackendBucketsClient/insert.php index eb8d975a9f87..99bfe4abf634 100644 --- a/Compute/samples/V1/BackendBucketsClient/insert.php +++ b/Compute/samples/V1/BackendBucketsClient/insert.php @@ -26,7 +26,8 @@ use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; use Google\Cloud\Compute\V1\BackendBucket; -use Google\Cloud\Compute\V1\BackendBucketsClient; +use Google\Cloud\Compute\V1\Client\BackendBucketsClient; +use Google\Cloud\Compute\V1\InsertBackendBucketRequest; use Google\Rpc\Status; /** @@ -39,13 +40,16 @@ function insert_sample(string $project): void // Create a client. $backendBucketsClient = new BackendBucketsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $backendBucketResource = new BackendBucket(); + $request = (new InsertBackendBucketRequest()) + ->setBackendBucketResource($backendBucketResource) + ->setProject($project); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $backendBucketsClient->insert($backendBucketResource, $project); + $response = $backendBucketsClient->insert($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/BackendBucketsClient/list.php b/Compute/samples/V1/BackendBucketsClient/list.php index f4e6eae87aa0..88b8bd5571ec 100644 --- a/Compute/samples/V1/BackendBucketsClient/list.php +++ b/Compute/samples/V1/BackendBucketsClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_BackendBuckets_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\BackendBucketsClient; +use Google\Cloud\Compute\V1\Client\BackendBucketsClient; +use Google\Cloud\Compute\V1\ListBackendBucketsRequest; /** * Retrieves the list of BackendBucket resources available to the specified project. @@ -37,10 +38,14 @@ function list_sample(string $project): void // Create a client. $backendBucketsClient = new BackendBucketsClient(); + // Prepare the request message. + $request = (new ListBackendBucketsRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $backendBucketsClient->list($project); + $response = $backendBucketsClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/BackendBucketsClient/patch.php b/Compute/samples/V1/BackendBucketsClient/patch.php index 42d6c69b1bfb..931c3adf8ca0 100644 --- a/Compute/samples/V1/BackendBucketsClient/patch.php +++ b/Compute/samples/V1/BackendBucketsClient/patch.php @@ -26,7 +26,8 @@ use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; use Google\Cloud\Compute\V1\BackendBucket; -use Google\Cloud\Compute\V1\BackendBucketsClient; +use Google\Cloud\Compute\V1\Client\BackendBucketsClient; +use Google\Cloud\Compute\V1\PatchBackendBucketRequest; use Google\Rpc\Status; /** @@ -40,13 +41,17 @@ function patch_sample(string $backendBucket, string $project): void // Create a client. $backendBucketsClient = new BackendBucketsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $backendBucketResource = new BackendBucket(); + $request = (new PatchBackendBucketRequest()) + ->setBackendBucket($backendBucket) + ->setBackendBucketResource($backendBucketResource) + ->setProject($project); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $backendBucketsClient->patch($backendBucket, $backendBucketResource, $project); + $response = $backendBucketsClient->patch($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/BackendBucketsClient/set_edge_security_policy.php b/Compute/samples/V1/BackendBucketsClient/set_edge_security_policy.php index e5c60c88b686..2786d2c59783 100644 --- a/Compute/samples/V1/BackendBucketsClient/set_edge_security_policy.php +++ b/Compute/samples/V1/BackendBucketsClient/set_edge_security_policy.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_BackendBuckets_SetEdgeSecurityPolicy_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\BackendBucketsClient; +use Google\Cloud\Compute\V1\Client\BackendBucketsClient; use Google\Cloud\Compute\V1\SecurityPolicyReference; +use Google\Cloud\Compute\V1\SetEdgeSecurityPolicyBackendBucketRequest; use Google\Rpc\Status; /** @@ -40,17 +41,17 @@ function set_edge_security_policy_sample(string $backendBucket, string $project) // Create a client. $backendBucketsClient = new BackendBucketsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $securityPolicyReferenceResource = new SecurityPolicyReference(); + $request = (new SetEdgeSecurityPolicyBackendBucketRequest()) + ->setBackendBucket($backendBucket) + ->setProject($project) + ->setSecurityPolicyReferenceResource($securityPolicyReferenceResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $backendBucketsClient->setEdgeSecurityPolicy( - $backendBucket, - $project, - $securityPolicyReferenceResource - ); + $response = $backendBucketsClient->setEdgeSecurityPolicy($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/BackendBucketsClient/set_iam_policy.php b/Compute/samples/V1/BackendBucketsClient/set_iam_policy.php index e7a6cd933a4a..22b614e86500 100644 --- a/Compute/samples/V1/BackendBucketsClient/set_iam_policy.php +++ b/Compute/samples/V1/BackendBucketsClient/set_iam_policy.php @@ -24,9 +24,10 @@ // [START compute_v1_generated_BackendBuckets_SetIamPolicy_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\BackendBucketsClient; +use Google\Cloud\Compute\V1\Client\BackendBucketsClient; use Google\Cloud\Compute\V1\GlobalSetPolicyRequest; use Google\Cloud\Compute\V1\Policy; +use Google\Cloud\Compute\V1\SetIamPolicyBackendBucketRequest; /** * Sets the access control policy on the specified resource. Replaces any existing policy. @@ -39,17 +40,17 @@ function set_iam_policy_sample(string $project, string $resource): void // Create a client. $backendBucketsClient = new BackendBucketsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $globalSetPolicyRequestResource = new GlobalSetPolicyRequest(); + $request = (new SetIamPolicyBackendBucketRequest()) + ->setGlobalSetPolicyRequestResource($globalSetPolicyRequestResource) + ->setProject($project) + ->setResource($resource); // Call the API and handle any network failures. try { /** @var Policy $response */ - $response = $backendBucketsClient->setIamPolicy( - $globalSetPolicyRequestResource, - $project, - $resource - ); + $response = $backendBucketsClient->setIamPolicy($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/BackendBucketsClient/test_iam_permissions.php b/Compute/samples/V1/BackendBucketsClient/test_iam_permissions.php index 325e38e866dd..3a8f3252a422 100644 --- a/Compute/samples/V1/BackendBucketsClient/test_iam_permissions.php +++ b/Compute/samples/V1/BackendBucketsClient/test_iam_permissions.php @@ -24,7 +24,8 @@ // [START compute_v1_generated_BackendBuckets_TestIamPermissions_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\BackendBucketsClient; +use Google\Cloud\Compute\V1\Client\BackendBucketsClient; +use Google\Cloud\Compute\V1\TestIamPermissionsBackendBucketRequest; use Google\Cloud\Compute\V1\TestPermissionsRequest; use Google\Cloud\Compute\V1\TestPermissionsResponse; @@ -39,17 +40,17 @@ function test_iam_permissions_sample(string $project, string $resource): void // Create a client. $backendBucketsClient = new BackendBucketsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $testPermissionsRequestResource = new TestPermissionsRequest(); + $request = (new TestIamPermissionsBackendBucketRequest()) + ->setProject($project) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); // Call the API and handle any network failures. try { /** @var TestPermissionsResponse $response */ - $response = $backendBucketsClient->testIamPermissions( - $project, - $resource, - $testPermissionsRequestResource - ); + $response = $backendBucketsClient->testIamPermissions($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/BackendBucketsClient/update.php b/Compute/samples/V1/BackendBucketsClient/update.php index 6cfc4e92b016..d98d5ffa4a96 100644 --- a/Compute/samples/V1/BackendBucketsClient/update.php +++ b/Compute/samples/V1/BackendBucketsClient/update.php @@ -26,7 +26,8 @@ use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; use Google\Cloud\Compute\V1\BackendBucket; -use Google\Cloud\Compute\V1\BackendBucketsClient; +use Google\Cloud\Compute\V1\Client\BackendBucketsClient; +use Google\Cloud\Compute\V1\UpdateBackendBucketRequest; use Google\Rpc\Status; /** @@ -40,13 +41,17 @@ function update_sample(string $backendBucket, string $project): void // Create a client. $backendBucketsClient = new BackendBucketsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $backendBucketResource = new BackendBucket(); + $request = (new UpdateBackendBucketRequest()) + ->setBackendBucket($backendBucket) + ->setBackendBucketResource($backendBucketResource) + ->setProject($project); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $backendBucketsClient->update($backendBucket, $backendBucketResource, $project); + $response = $backendBucketsClient->update($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/BackendServicesClient/add_signed_url_key.php b/Compute/samples/V1/BackendServicesClient/add_signed_url_key.php index b36d8ac77e6d..b1159354e455 100644 --- a/Compute/samples/V1/BackendServicesClient/add_signed_url_key.php +++ b/Compute/samples/V1/BackendServicesClient/add_signed_url_key.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_BackendServices_AddSignedUrlKey_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\BackendServicesClient; +use Google\Cloud\Compute\V1\AddSignedUrlKeyBackendServiceRequest; +use Google\Cloud\Compute\V1\Client\BackendServicesClient; use Google\Cloud\Compute\V1\SignedUrlKey; use Google\Rpc\Status; @@ -40,17 +41,17 @@ function add_signed_url_key_sample(string $backendService, string $project): voi // Create a client. $backendServicesClient = new BackendServicesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $signedUrlKeyResource = new SignedUrlKey(); + $request = (new AddSignedUrlKeyBackendServiceRequest()) + ->setBackendService($backendService) + ->setProject($project) + ->setSignedUrlKeyResource($signedUrlKeyResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $backendServicesClient->addSignedUrlKey( - $backendService, - $project, - $signedUrlKeyResource - ); + $response = $backendServicesClient->addSignedUrlKey($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/BackendServicesClient/aggregated_list.php b/Compute/samples/V1/BackendServicesClient/aggregated_list.php index 6df93b642f4b..c6a2e048f116 100644 --- a/Compute/samples/V1/BackendServicesClient/aggregated_list.php +++ b/Compute/samples/V1/BackendServicesClient/aggregated_list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_BackendServices_AggregatedList_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\BackendServicesClient; +use Google\Cloud\Compute\V1\AggregatedListBackendServicesRequest; +use Google\Cloud\Compute\V1\Client\BackendServicesClient; /** * 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`. @@ -37,10 +38,14 @@ function aggregated_list_sample(string $project): void // Create a client. $backendServicesClient = new BackendServicesClient(); + // Prepare the request message. + $request = (new AggregatedListBackendServicesRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $backendServicesClient->aggregatedList($project); + $response = $backendServicesClient->aggregatedList($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/BackendServicesClient/delete.php b/Compute/samples/V1/BackendServicesClient/delete.php index 9d99e4ba70d5..be69de1c74d7 100644 --- a/Compute/samples/V1/BackendServicesClient/delete.php +++ b/Compute/samples/V1/BackendServicesClient/delete.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_BackendServices_Delete_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\BackendServicesClient; +use Google\Cloud\Compute\V1\Client\BackendServicesClient; +use Google\Cloud\Compute\V1\DeleteBackendServiceRequest; use Google\Rpc\Status; /** @@ -39,10 +40,15 @@ function delete_sample(string $backendService, string $project): void // Create a client. $backendServicesClient = new BackendServicesClient(); + // Prepare the request message. + $request = (new DeleteBackendServiceRequest()) + ->setBackendService($backendService) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $backendServicesClient->delete($backendService, $project); + $response = $backendServicesClient->delete($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/BackendServicesClient/delete_signed_url_key.php b/Compute/samples/V1/BackendServicesClient/delete_signed_url_key.php index 7f562b84bdd5..4d7329b55a2d 100644 --- a/Compute/samples/V1/BackendServicesClient/delete_signed_url_key.php +++ b/Compute/samples/V1/BackendServicesClient/delete_signed_url_key.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_BackendServices_DeleteSignedUrlKey_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\BackendServicesClient; +use Google\Cloud\Compute\V1\Client\BackendServicesClient; +use Google\Cloud\Compute\V1\DeleteSignedUrlKeyBackendServiceRequest; use Google\Rpc\Status; /** @@ -43,10 +44,16 @@ function delete_signed_url_key_sample( // Create a client. $backendServicesClient = new BackendServicesClient(); + // Prepare the request message. + $request = (new DeleteSignedUrlKeyBackendServiceRequest()) + ->setBackendService($backendService) + ->setKeyName($keyName) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $backendServicesClient->deleteSignedUrlKey($backendService, $keyName, $project); + $response = $backendServicesClient->deleteSignedUrlKey($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/BackendServicesClient/get.php b/Compute/samples/V1/BackendServicesClient/get.php index 23cf53699256..a18c5dacfa42 100644 --- a/Compute/samples/V1/BackendServicesClient/get.php +++ b/Compute/samples/V1/BackendServicesClient/get.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_BackendServices_Get_sync] use Google\ApiCore\ApiException; use Google\Cloud\Compute\V1\BackendService; -use Google\Cloud\Compute\V1\BackendServicesClient; +use Google\Cloud\Compute\V1\Client\BackendServicesClient; +use Google\Cloud\Compute\V1\GetBackendServiceRequest; /** * Returns the specified BackendService resource. @@ -38,10 +39,15 @@ function get_sample(string $backendService, string $project): void // Create a client. $backendServicesClient = new BackendServicesClient(); + // Prepare the request message. + $request = (new GetBackendServiceRequest()) + ->setBackendService($backendService) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var BackendService $response */ - $response = $backendServicesClient->get($backendService, $project); + $response = $backendServicesClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/BackendServicesClient/get_health.php b/Compute/samples/V1/BackendServicesClient/get_health.php index ed0e00571cf4..fade1c200635 100644 --- a/Compute/samples/V1/BackendServicesClient/get_health.php +++ b/Compute/samples/V1/BackendServicesClient/get_health.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_BackendServices_GetHealth_sync] use Google\ApiCore\ApiException; use Google\Cloud\Compute\V1\BackendServiceGroupHealth; -use Google\Cloud\Compute\V1\BackendServicesClient; +use Google\Cloud\Compute\V1\Client\BackendServicesClient; +use Google\Cloud\Compute\V1\GetHealthBackendServiceRequest; use Google\Cloud\Compute\V1\ResourceGroupReference; /** @@ -39,17 +40,17 @@ function get_health_sample(string $backendService, string $project): void // Create a client. $backendServicesClient = new BackendServicesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $resourceGroupReferenceResource = new ResourceGroupReference(); + $request = (new GetHealthBackendServiceRequest()) + ->setBackendService($backendService) + ->setProject($project) + ->setResourceGroupReferenceResource($resourceGroupReferenceResource); // Call the API and handle any network failures. try { /** @var BackendServiceGroupHealth $response */ - $response = $backendServicesClient->getHealth( - $backendService, - $project, - $resourceGroupReferenceResource - ); + $response = $backendServicesClient->getHealth($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/BackendServicesClient/get_iam_policy.php b/Compute/samples/V1/BackendServicesClient/get_iam_policy.php index 55e27eaef896..10a1416b0af1 100644 --- a/Compute/samples/V1/BackendServicesClient/get_iam_policy.php +++ b/Compute/samples/V1/BackendServicesClient/get_iam_policy.php @@ -24,7 +24,8 @@ // [START compute_v1_generated_BackendServices_GetIamPolicy_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\BackendServicesClient; +use Google\Cloud\Compute\V1\Client\BackendServicesClient; +use Google\Cloud\Compute\V1\GetIamPolicyBackendServiceRequest; use Google\Cloud\Compute\V1\Policy; /** @@ -38,10 +39,15 @@ function get_iam_policy_sample(string $project, string $resource): void // Create a client. $backendServicesClient = new BackendServicesClient(); + // Prepare the request message. + $request = (new GetIamPolicyBackendServiceRequest()) + ->setProject($project) + ->setResource($resource); + // Call the API and handle any network failures. try { /** @var Policy $response */ - $response = $backendServicesClient->getIamPolicy($project, $resource); + $response = $backendServicesClient->getIamPolicy($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/BackendServicesClient/insert.php b/Compute/samples/V1/BackendServicesClient/insert.php index b02528c2637e..f4e89d70392c 100644 --- a/Compute/samples/V1/BackendServicesClient/insert.php +++ b/Compute/samples/V1/BackendServicesClient/insert.php @@ -26,7 +26,8 @@ use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; use Google\Cloud\Compute\V1\BackendService; -use Google\Cloud\Compute\V1\BackendServicesClient; +use Google\Cloud\Compute\V1\Client\BackendServicesClient; +use Google\Cloud\Compute\V1\InsertBackendServiceRequest; use Google\Rpc\Status; /** @@ -39,13 +40,16 @@ function insert_sample(string $project): void // Create a client. $backendServicesClient = new BackendServicesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $backendServiceResource = new BackendService(); + $request = (new InsertBackendServiceRequest()) + ->setBackendServiceResource($backendServiceResource) + ->setProject($project); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $backendServicesClient->insert($backendServiceResource, $project); + $response = $backendServicesClient->insert($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/BackendServicesClient/list.php b/Compute/samples/V1/BackendServicesClient/list.php index 9435b57e1a24..2b0623ed3264 100644 --- a/Compute/samples/V1/BackendServicesClient/list.php +++ b/Compute/samples/V1/BackendServicesClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_BackendServices_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\BackendServicesClient; +use Google\Cloud\Compute\V1\Client\BackendServicesClient; +use Google\Cloud\Compute\V1\ListBackendServicesRequest; /** * Retrieves the list of BackendService resources available to the specified project. @@ -37,10 +38,14 @@ function list_sample(string $project): void // Create a client. $backendServicesClient = new BackendServicesClient(); + // Prepare the request message. + $request = (new ListBackendServicesRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $backendServicesClient->list($project); + $response = $backendServicesClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/BackendServicesClient/list_usable.php b/Compute/samples/V1/BackendServicesClient/list_usable.php index f67af07cc528..8489daa37f4d 100644 --- a/Compute/samples/V1/BackendServicesClient/list_usable.php +++ b/Compute/samples/V1/BackendServicesClient/list_usable.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_BackendServices_ListUsable_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\BackendServicesClient; +use Google\Cloud\Compute\V1\Client\BackendServicesClient; +use Google\Cloud\Compute\V1\ListUsableBackendServicesRequest; /** * Retrieves a list of all usable backend services in the specified project. @@ -37,10 +38,14 @@ function list_usable_sample(string $project): void // Create a client. $backendServicesClient = new BackendServicesClient(); + // Prepare the request message. + $request = (new ListUsableBackendServicesRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $backendServicesClient->listUsable($project); + $response = $backendServicesClient->listUsable($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/BackendServicesClient/patch.php b/Compute/samples/V1/BackendServicesClient/patch.php index c32a8bcc8ff8..94d8a270ed18 100644 --- a/Compute/samples/V1/BackendServicesClient/patch.php +++ b/Compute/samples/V1/BackendServicesClient/patch.php @@ -26,7 +26,8 @@ use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; use Google\Cloud\Compute\V1\BackendService; -use Google\Cloud\Compute\V1\BackendServicesClient; +use Google\Cloud\Compute\V1\Client\BackendServicesClient; +use Google\Cloud\Compute\V1\PatchBackendServiceRequest; use Google\Rpc\Status; /** @@ -40,13 +41,17 @@ function patch_sample(string $backendService, string $project): void // Create a client. $backendServicesClient = new BackendServicesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $backendServiceResource = new BackendService(); + $request = (new PatchBackendServiceRequest()) + ->setBackendService($backendService) + ->setBackendServiceResource($backendServiceResource) + ->setProject($project); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $backendServicesClient->patch($backendService, $backendServiceResource, $project); + $response = $backendServicesClient->patch($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/BackendServicesClient/set_edge_security_policy.php b/Compute/samples/V1/BackendServicesClient/set_edge_security_policy.php index f12f33c9338a..749f0c456c95 100644 --- a/Compute/samples/V1/BackendServicesClient/set_edge_security_policy.php +++ b/Compute/samples/V1/BackendServicesClient/set_edge_security_policy.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_BackendServices_SetEdgeSecurityPolicy_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\BackendServicesClient; +use Google\Cloud\Compute\V1\Client\BackendServicesClient; use Google\Cloud\Compute\V1\SecurityPolicyReference; +use Google\Cloud\Compute\V1\SetEdgeSecurityPolicyBackendServiceRequest; use Google\Rpc\Status; /** @@ -40,17 +41,17 @@ function set_edge_security_policy_sample(string $backendService, string $project // Create a client. $backendServicesClient = new BackendServicesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $securityPolicyReferenceResource = new SecurityPolicyReference(); + $request = (new SetEdgeSecurityPolicyBackendServiceRequest()) + ->setBackendService($backendService) + ->setProject($project) + ->setSecurityPolicyReferenceResource($securityPolicyReferenceResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $backendServicesClient->setEdgeSecurityPolicy( - $backendService, - $project, - $securityPolicyReferenceResource - ); + $response = $backendServicesClient->setEdgeSecurityPolicy($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/BackendServicesClient/set_iam_policy.php b/Compute/samples/V1/BackendServicesClient/set_iam_policy.php index 903b69915372..8439b2b3984e 100644 --- a/Compute/samples/V1/BackendServicesClient/set_iam_policy.php +++ b/Compute/samples/V1/BackendServicesClient/set_iam_policy.php @@ -24,9 +24,10 @@ // [START compute_v1_generated_BackendServices_SetIamPolicy_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\BackendServicesClient; +use Google\Cloud\Compute\V1\Client\BackendServicesClient; use Google\Cloud\Compute\V1\GlobalSetPolicyRequest; use Google\Cloud\Compute\V1\Policy; +use Google\Cloud\Compute\V1\SetIamPolicyBackendServiceRequest; /** * Sets the access control policy on the specified resource. Replaces any existing policy. @@ -39,17 +40,17 @@ function set_iam_policy_sample(string $project, string $resource): void // Create a client. $backendServicesClient = new BackendServicesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $globalSetPolicyRequestResource = new GlobalSetPolicyRequest(); + $request = (new SetIamPolicyBackendServiceRequest()) + ->setGlobalSetPolicyRequestResource($globalSetPolicyRequestResource) + ->setProject($project) + ->setResource($resource); // Call the API and handle any network failures. try { /** @var Policy $response */ - $response = $backendServicesClient->setIamPolicy( - $globalSetPolicyRequestResource, - $project, - $resource - ); + $response = $backendServicesClient->setIamPolicy($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/BackendServicesClient/set_security_policy.php b/Compute/samples/V1/BackendServicesClient/set_security_policy.php index b356111db83e..951853478ee4 100644 --- a/Compute/samples/V1/BackendServicesClient/set_security_policy.php +++ b/Compute/samples/V1/BackendServicesClient/set_security_policy.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_BackendServices_SetSecurityPolicy_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\BackendServicesClient; +use Google\Cloud\Compute\V1\Client\BackendServicesClient; use Google\Cloud\Compute\V1\SecurityPolicyReference; +use Google\Cloud\Compute\V1\SetSecurityPolicyBackendServiceRequest; use Google\Rpc\Status; /** @@ -40,17 +41,17 @@ function set_security_policy_sample(string $backendService, string $project): vo // Create a client. $backendServicesClient = new BackendServicesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $securityPolicyReferenceResource = new SecurityPolicyReference(); + $request = (new SetSecurityPolicyBackendServiceRequest()) + ->setBackendService($backendService) + ->setProject($project) + ->setSecurityPolicyReferenceResource($securityPolicyReferenceResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $backendServicesClient->setSecurityPolicy( - $backendService, - $project, - $securityPolicyReferenceResource - ); + $response = $backendServicesClient->setSecurityPolicy($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/BackendServicesClient/test_iam_permissions.php b/Compute/samples/V1/BackendServicesClient/test_iam_permissions.php index 11e5a27fd99f..82a14b1486b6 100644 --- a/Compute/samples/V1/BackendServicesClient/test_iam_permissions.php +++ b/Compute/samples/V1/BackendServicesClient/test_iam_permissions.php @@ -24,7 +24,8 @@ // [START compute_v1_generated_BackendServices_TestIamPermissions_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\BackendServicesClient; +use Google\Cloud\Compute\V1\Client\BackendServicesClient; +use Google\Cloud\Compute\V1\TestIamPermissionsBackendServiceRequest; use Google\Cloud\Compute\V1\TestPermissionsRequest; use Google\Cloud\Compute\V1\TestPermissionsResponse; @@ -39,17 +40,17 @@ function test_iam_permissions_sample(string $project, string $resource): void // Create a client. $backendServicesClient = new BackendServicesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $testPermissionsRequestResource = new TestPermissionsRequest(); + $request = (new TestIamPermissionsBackendServiceRequest()) + ->setProject($project) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); // Call the API and handle any network failures. try { /** @var TestPermissionsResponse $response */ - $response = $backendServicesClient->testIamPermissions( - $project, - $resource, - $testPermissionsRequestResource - ); + $response = $backendServicesClient->testIamPermissions($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/BackendServicesClient/update.php b/Compute/samples/V1/BackendServicesClient/update.php index 88a05df052d5..e10b842dda0d 100644 --- a/Compute/samples/V1/BackendServicesClient/update.php +++ b/Compute/samples/V1/BackendServicesClient/update.php @@ -26,7 +26,8 @@ use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; use Google\Cloud\Compute\V1\BackendService; -use Google\Cloud\Compute\V1\BackendServicesClient; +use Google\Cloud\Compute\V1\Client\BackendServicesClient; +use Google\Cloud\Compute\V1\UpdateBackendServiceRequest; use Google\Rpc\Status; /** @@ -40,13 +41,17 @@ function update_sample(string $backendService, string $project): void // Create a client. $backendServicesClient = new BackendServicesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $backendServiceResource = new BackendService(); + $request = (new UpdateBackendServiceRequest()) + ->setBackendService($backendService) + ->setBackendServiceResource($backendServiceResource) + ->setProject($project); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $backendServicesClient->update($backendService, $backendServiceResource, $project); + $response = $backendServicesClient->update($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/DiskTypesClient/aggregated_list.php b/Compute/samples/V1/DiskTypesClient/aggregated_list.php index 5d99e662a5bb..e2b2af2fc2cb 100644 --- a/Compute/samples/V1/DiskTypesClient/aggregated_list.php +++ b/Compute/samples/V1/DiskTypesClient/aggregated_list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_DiskTypes_AggregatedList_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\DiskTypesClient; +use Google\Cloud\Compute\V1\AggregatedListDiskTypesRequest; +use Google\Cloud\Compute\V1\Client\DiskTypesClient; /** * Retrieves an aggregated list of disk types. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. @@ -37,10 +38,14 @@ function aggregated_list_sample(string $project): void // Create a client. $diskTypesClient = new DiskTypesClient(); + // Prepare the request message. + $request = (new AggregatedListDiskTypesRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $diskTypesClient->aggregatedList($project); + $response = $diskTypesClient->aggregatedList($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/DiskTypesClient/get.php b/Compute/samples/V1/DiskTypesClient/get.php index fda92fb73c8c..79db14636596 100644 --- a/Compute/samples/V1/DiskTypesClient/get.php +++ b/Compute/samples/V1/DiskTypesClient/get.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_DiskTypes_Get_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\DiskTypesClient; use Google\Cloud\Compute\V1\DiskType; -use Google\Cloud\Compute\V1\DiskTypesClient; +use Google\Cloud\Compute\V1\GetDiskTypeRequest; /** * Returns the specified disk type. @@ -39,10 +40,16 @@ function get_sample(string $diskType, string $project, string $zone): void // Create a client. $diskTypesClient = new DiskTypesClient(); + // Prepare the request message. + $request = (new GetDiskTypeRequest()) + ->setDiskType($diskType) + ->setProject($project) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var DiskType $response */ - $response = $diskTypesClient->get($diskType, $project, $zone); + $response = $diskTypesClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/DiskTypesClient/list.php b/Compute/samples/V1/DiskTypesClient/list.php index 6d3bade29c88..21f5c2d7ba46 100644 --- a/Compute/samples/V1/DiskTypesClient/list.php +++ b/Compute/samples/V1/DiskTypesClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_DiskTypes_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\DiskTypesClient; +use Google\Cloud\Compute\V1\Client\DiskTypesClient; +use Google\Cloud\Compute\V1\ListDiskTypesRequest; /** * Retrieves a list of disk types available to the specified project. @@ -38,10 +39,15 @@ function list_sample(string $project, string $zone): void // Create a client. $diskTypesClient = new DiskTypesClient(); + // Prepare the request message. + $request = (new ListDiskTypesRequest()) + ->setProject($project) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $diskTypesClient->list($project, $zone); + $response = $diskTypesClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/DisksClient/add_resource_policies.php b/Compute/samples/V1/DisksClient/add_resource_policies.php index 8d160910bb7b..8d2687cf80e7 100644 --- a/Compute/samples/V1/DisksClient/add_resource_policies.php +++ b/Compute/samples/V1/DisksClient/add_resource_policies.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_Disks_AddResourcePolicies_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\AddResourcePoliciesDiskRequest; +use Google\Cloud\Compute\V1\Client\DisksClient; use Google\Cloud\Compute\V1\DisksAddResourcePoliciesRequest; -use Google\Cloud\Compute\V1\DisksClient; use Google\Rpc\Status; /** @@ -41,18 +42,18 @@ function add_resource_policies_sample(string $disk, string $project, string $zon // Create a client. $disksClient = new DisksClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $disksAddResourcePoliciesRequestResource = new DisksAddResourcePoliciesRequest(); + $request = (new AddResourcePoliciesDiskRequest()) + ->setDisk($disk) + ->setDisksAddResourcePoliciesRequestResource($disksAddResourcePoliciesRequestResource) + ->setProject($project) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $disksClient->addResourcePolicies( - $disk, - $disksAddResourcePoliciesRequestResource, - $project, - $zone - ); + $response = $disksClient->addResourcePolicies($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/DisksClient/aggregated_list.php b/Compute/samples/V1/DisksClient/aggregated_list.php index 257b6db77251..014bc72c27ba 100644 --- a/Compute/samples/V1/DisksClient/aggregated_list.php +++ b/Compute/samples/V1/DisksClient/aggregated_list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_Disks_AggregatedList_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\DisksClient; +use Google\Cloud\Compute\V1\AggregatedListDisksRequest; +use Google\Cloud\Compute\V1\Client\DisksClient; /** * Retrieves an aggregated list of persistent disks. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. @@ -37,10 +38,14 @@ function aggregated_list_sample(string $project): void // Create a client. $disksClient = new DisksClient(); + // Prepare the request message. + $request = (new AggregatedListDisksRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $disksClient->aggregatedList($project); + $response = $disksClient->aggregatedList($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/DisksClient/bulk_insert.php b/Compute/samples/V1/DisksClient/bulk_insert.php index 258ef1cc8dc6..1e1db785647f 100644 --- a/Compute/samples/V1/DisksClient/bulk_insert.php +++ b/Compute/samples/V1/DisksClient/bulk_insert.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_Disks_BulkInsert_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\BulkInsertDiskRequest; use Google\Cloud\Compute\V1\BulkInsertDiskResource; -use Google\Cloud\Compute\V1\DisksClient; +use Google\Cloud\Compute\V1\Client\DisksClient; use Google\Rpc\Status; /** @@ -40,13 +41,17 @@ function bulk_insert_sample(string $project, string $zone): void // Create a client. $disksClient = new DisksClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $bulkInsertDiskResourceResource = new BulkInsertDiskResource(); + $request = (new BulkInsertDiskRequest()) + ->setBulkInsertDiskResourceResource($bulkInsertDiskResourceResource) + ->setProject($project) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $disksClient->bulkInsert($bulkInsertDiskResourceResource, $project, $zone); + $response = $disksClient->bulkInsert($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/DisksClient/create_snapshot.php b/Compute/samples/V1/DisksClient/create_snapshot.php index 0def7c2ad30a..db1a6803ed7b 100644 --- a/Compute/samples/V1/DisksClient/create_snapshot.php +++ b/Compute/samples/V1/DisksClient/create_snapshot.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_Disks_CreateSnapshot_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\DisksClient; +use Google\Cloud\Compute\V1\Client\DisksClient; +use Google\Cloud\Compute\V1\CreateSnapshotDiskRequest; use Google\Cloud\Compute\V1\Snapshot; use Google\Rpc\Status; @@ -41,13 +42,18 @@ function create_snapshot_sample(string $disk, string $project, string $zone): vo // Create a client. $disksClient = new DisksClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $snapshotResource = new Snapshot(); + $request = (new CreateSnapshotDiskRequest()) + ->setDisk($disk) + ->setProject($project) + ->setSnapshotResource($snapshotResource) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $disksClient->createSnapshot($disk, $project, $snapshotResource, $zone); + $response = $disksClient->createSnapshot($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/DisksClient/delete.php b/Compute/samples/V1/DisksClient/delete.php index 94accf7cdbc5..4d24456c19c8 100644 --- a/Compute/samples/V1/DisksClient/delete.php +++ b/Compute/samples/V1/DisksClient/delete.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_Disks_Delete_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\DisksClient; +use Google\Cloud\Compute\V1\Client\DisksClient; +use Google\Cloud\Compute\V1\DeleteDiskRequest; use Google\Rpc\Status; /** @@ -40,10 +41,16 @@ function delete_sample(string $disk, string $project, string $zone): void // Create a client. $disksClient = new DisksClient(); + // Prepare the request message. + $request = (new DeleteDiskRequest()) + ->setDisk($disk) + ->setProject($project) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $disksClient->delete($disk, $project, $zone); + $response = $disksClient->delete($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/DisksClient/get.php b/Compute/samples/V1/DisksClient/get.php index 29672045216a..67c1f1e868d2 100644 --- a/Compute/samples/V1/DisksClient/get.php +++ b/Compute/samples/V1/DisksClient/get.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_Disks_Get_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\DisksClient; use Google\Cloud\Compute\V1\Disk; -use Google\Cloud\Compute\V1\DisksClient; +use Google\Cloud\Compute\V1\GetDiskRequest; /** * Returns the specified persistent disk. @@ -39,10 +40,16 @@ function get_sample(string $disk, string $project, string $zone): void // Create a client. $disksClient = new DisksClient(); + // Prepare the request message. + $request = (new GetDiskRequest()) + ->setDisk($disk) + ->setProject($project) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var Disk $response */ - $response = $disksClient->get($disk, $project, $zone); + $response = $disksClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/DisksClient/get_iam_policy.php b/Compute/samples/V1/DisksClient/get_iam_policy.php index e01e65f3550b..d4b92e93db63 100644 --- a/Compute/samples/V1/DisksClient/get_iam_policy.php +++ b/Compute/samples/V1/DisksClient/get_iam_policy.php @@ -24,7 +24,8 @@ // [START compute_v1_generated_Disks_GetIamPolicy_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\DisksClient; +use Google\Cloud\Compute\V1\Client\DisksClient; +use Google\Cloud\Compute\V1\GetIamPolicyDiskRequest; use Google\Cloud\Compute\V1\Policy; /** @@ -39,10 +40,16 @@ function get_iam_policy_sample(string $project, string $resource, string $zone): // Create a client. $disksClient = new DisksClient(); + // Prepare the request message. + $request = (new GetIamPolicyDiskRequest()) + ->setProject($project) + ->setResource($resource) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var Policy $response */ - $response = $disksClient->getIamPolicy($project, $resource, $zone); + $response = $disksClient->getIamPolicy($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/DisksClient/insert.php b/Compute/samples/V1/DisksClient/insert.php index ec3cafe3f51d..810b4cda4789 100644 --- a/Compute/samples/V1/DisksClient/insert.php +++ b/Compute/samples/V1/DisksClient/insert.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_Disks_Insert_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\DisksClient; use Google\Cloud\Compute\V1\Disk; -use Google\Cloud\Compute\V1\DisksClient; +use Google\Cloud\Compute\V1\InsertDiskRequest; use Google\Rpc\Status; /** @@ -40,13 +41,17 @@ function insert_sample(string $project, string $zone): void // Create a client. $disksClient = new DisksClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $diskResource = new Disk(); + $request = (new InsertDiskRequest()) + ->setDiskResource($diskResource) + ->setProject($project) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $disksClient->insert($diskResource, $project, $zone); + $response = $disksClient->insert($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/DisksClient/list.php b/Compute/samples/V1/DisksClient/list.php index 90be4e9f9b06..4ffce2a6a4b5 100644 --- a/Compute/samples/V1/DisksClient/list.php +++ b/Compute/samples/V1/DisksClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_Disks_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\DisksClient; +use Google\Cloud\Compute\V1\Client\DisksClient; +use Google\Cloud\Compute\V1\ListDisksRequest; /** * Retrieves a list of persistent disks contained within the specified zone. @@ -38,10 +39,15 @@ function list_sample(string $project, string $zone): void // Create a client. $disksClient = new DisksClient(); + // Prepare the request message. + $request = (new ListDisksRequest()) + ->setProject($project) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $disksClient->list($project, $zone); + $response = $disksClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/DisksClient/remove_resource_policies.php b/Compute/samples/V1/DisksClient/remove_resource_policies.php index 46d40a14ebb1..2be2c89ad2ee 100644 --- a/Compute/samples/V1/DisksClient/remove_resource_policies.php +++ b/Compute/samples/V1/DisksClient/remove_resource_policies.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_Disks_RemoveResourcePolicies_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\DisksClient; +use Google\Cloud\Compute\V1\Client\DisksClient; use Google\Cloud\Compute\V1\DisksRemoveResourcePoliciesRequest; +use Google\Cloud\Compute\V1\RemoveResourcePoliciesDiskRequest; use Google\Rpc\Status; /** @@ -41,18 +42,18 @@ function remove_resource_policies_sample(string $disk, string $project, string $ // Create a client. $disksClient = new DisksClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $disksRemoveResourcePoliciesRequestResource = new DisksRemoveResourcePoliciesRequest(); + $request = (new RemoveResourcePoliciesDiskRequest()) + ->setDisk($disk) + ->setDisksRemoveResourcePoliciesRequestResource($disksRemoveResourcePoliciesRequestResource) + ->setProject($project) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $disksClient->removeResourcePolicies( - $disk, - $disksRemoveResourcePoliciesRequestResource, - $project, - $zone - ); + $response = $disksClient->removeResourcePolicies($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/DisksClient/resize.php b/Compute/samples/V1/DisksClient/resize.php index 688eb7a681f8..5a087701b821 100644 --- a/Compute/samples/V1/DisksClient/resize.php +++ b/Compute/samples/V1/DisksClient/resize.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_Disks_Resize_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\DisksClient; +use Google\Cloud\Compute\V1\Client\DisksClient; use Google\Cloud\Compute\V1\DisksResizeRequest; +use Google\Cloud\Compute\V1\ResizeDiskRequest; use Google\Rpc\Status; /** @@ -41,13 +42,18 @@ function resize_sample(string $disk, string $project, string $zone): void // Create a client. $disksClient = new DisksClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $disksResizeRequestResource = new DisksResizeRequest(); + $request = (new ResizeDiskRequest()) + ->setDisk($disk) + ->setDisksResizeRequestResource($disksResizeRequestResource) + ->setProject($project) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $disksClient->resize($disk, $disksResizeRequestResource, $project, $zone); + $response = $disksClient->resize($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/DisksClient/set_iam_policy.php b/Compute/samples/V1/DisksClient/set_iam_policy.php index b6db52897c45..3a7088cd2c81 100644 --- a/Compute/samples/V1/DisksClient/set_iam_policy.php +++ b/Compute/samples/V1/DisksClient/set_iam_policy.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_Disks_SetIamPolicy_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\DisksClient; +use Google\Cloud\Compute\V1\Client\DisksClient; use Google\Cloud\Compute\V1\Policy; +use Google\Cloud\Compute\V1\SetIamPolicyDiskRequest; use Google\Cloud\Compute\V1\ZoneSetPolicyRequest; /** @@ -40,13 +41,18 @@ function set_iam_policy_sample(string $project, string $resource, string $zone): // Create a client. $disksClient = new DisksClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $zoneSetPolicyRequestResource = new ZoneSetPolicyRequest(); + $request = (new SetIamPolicyDiskRequest()) + ->setProject($project) + ->setResource($resource) + ->setZone($zone) + ->setZoneSetPolicyRequestResource($zoneSetPolicyRequestResource); // Call the API and handle any network failures. try { /** @var Policy $response */ - $response = $disksClient->setIamPolicy($project, $resource, $zone, $zoneSetPolicyRequestResource); + $response = $disksClient->setIamPolicy($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/DisksClient/set_labels.php b/Compute/samples/V1/DisksClient/set_labels.php index 0dc991012028..889d7652a58c 100644 --- a/Compute/samples/V1/DisksClient/set_labels.php +++ b/Compute/samples/V1/DisksClient/set_labels.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_Disks_SetLabels_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\DisksClient; +use Google\Cloud\Compute\V1\Client\DisksClient; +use Google\Cloud\Compute\V1\SetLabelsDiskRequest; use Google\Cloud\Compute\V1\ZoneSetLabelsRequest; use Google\Rpc\Status; @@ -41,13 +42,18 @@ function set_labels_sample(string $project, string $resource, string $zone): voi // Create a client. $disksClient = new DisksClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $zoneSetLabelsRequestResource = new ZoneSetLabelsRequest(); + $request = (new SetLabelsDiskRequest()) + ->setProject($project) + ->setResource($resource) + ->setZone($zone) + ->setZoneSetLabelsRequestResource($zoneSetLabelsRequestResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $disksClient->setLabels($project, $resource, $zone, $zoneSetLabelsRequestResource); + $response = $disksClient->setLabels($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/DisksClient/start_async_replication.php b/Compute/samples/V1/DisksClient/start_async_replication.php index a0b10f57cf72..9ce938a2c2cc 100644 --- a/Compute/samples/V1/DisksClient/start_async_replication.php +++ b/Compute/samples/V1/DisksClient/start_async_replication.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_Disks_StartAsyncReplication_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\DisksClient; +use Google\Cloud\Compute\V1\Client\DisksClient; use Google\Cloud\Compute\V1\DisksStartAsyncReplicationRequest; +use Google\Cloud\Compute\V1\StartAsyncReplicationDiskRequest; use Google\Rpc\Status; /** @@ -41,18 +42,18 @@ function start_async_replication_sample(string $disk, string $project, string $z // Create a client. $disksClient = new DisksClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $disksStartAsyncReplicationRequestResource = new DisksStartAsyncReplicationRequest(); + $request = (new StartAsyncReplicationDiskRequest()) + ->setDisk($disk) + ->setDisksStartAsyncReplicationRequestResource($disksStartAsyncReplicationRequestResource) + ->setProject($project) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $disksClient->startAsyncReplication( - $disk, - $disksStartAsyncReplicationRequestResource, - $project, - $zone - ); + $response = $disksClient->startAsyncReplication($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/DisksClient/stop_async_replication.php b/Compute/samples/V1/DisksClient/stop_async_replication.php index c3c928b0b2a6..2b4c5a5108c8 100644 --- a/Compute/samples/V1/DisksClient/stop_async_replication.php +++ b/Compute/samples/V1/DisksClient/stop_async_replication.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_Disks_StopAsyncReplication_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\DisksClient; +use Google\Cloud\Compute\V1\Client\DisksClient; +use Google\Cloud\Compute\V1\StopAsyncReplicationDiskRequest; use Google\Rpc\Status; /** @@ -40,10 +41,16 @@ function stop_async_replication_sample(string $disk, string $project, string $zo // Create a client. $disksClient = new DisksClient(); + // Prepare the request message. + $request = (new StopAsyncReplicationDiskRequest()) + ->setDisk($disk) + ->setProject($project) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $disksClient->stopAsyncReplication($disk, $project, $zone); + $response = $disksClient->stopAsyncReplication($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/DisksClient/stop_group_async_replication.php b/Compute/samples/V1/DisksClient/stop_group_async_replication.php index bdfa145d62ac..8678b05cac6f 100644 --- a/Compute/samples/V1/DisksClient/stop_group_async_replication.php +++ b/Compute/samples/V1/DisksClient/stop_group_async_replication.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_Disks_StopGroupAsyncReplication_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\DisksClient; +use Google\Cloud\Compute\V1\Client\DisksClient; use Google\Cloud\Compute\V1\DisksStopGroupAsyncReplicationResource; +use Google\Cloud\Compute\V1\StopGroupAsyncReplicationDiskRequest; use Google\Rpc\Status; /** @@ -40,17 +41,17 @@ function stop_group_async_replication_sample(string $project, string $zone): voi // Create a client. $disksClient = new DisksClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $disksStopGroupAsyncReplicationResourceResource = new DisksStopGroupAsyncReplicationResource(); + $request = (new StopGroupAsyncReplicationDiskRequest()) + ->setDisksStopGroupAsyncReplicationResourceResource($disksStopGroupAsyncReplicationResourceResource) + ->setProject($project) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $disksClient->stopGroupAsyncReplication( - $disksStopGroupAsyncReplicationResourceResource, - $project, - $zone - ); + $response = $disksClient->stopGroupAsyncReplication($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/DisksClient/test_iam_permissions.php b/Compute/samples/V1/DisksClient/test_iam_permissions.php index e69cc0151108..eb501f100e96 100644 --- a/Compute/samples/V1/DisksClient/test_iam_permissions.php +++ b/Compute/samples/V1/DisksClient/test_iam_permissions.php @@ -24,7 +24,8 @@ // [START compute_v1_generated_Disks_TestIamPermissions_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\DisksClient; +use Google\Cloud\Compute\V1\Client\DisksClient; +use Google\Cloud\Compute\V1\TestIamPermissionsDiskRequest; use Google\Cloud\Compute\V1\TestPermissionsRequest; use Google\Cloud\Compute\V1\TestPermissionsResponse; @@ -40,18 +41,18 @@ function test_iam_permissions_sample(string $project, string $resource, string $ // Create a client. $disksClient = new DisksClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $testPermissionsRequestResource = new TestPermissionsRequest(); + $request = (new TestIamPermissionsDiskRequest()) + ->setProject($project) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var TestPermissionsResponse $response */ - $response = $disksClient->testIamPermissions( - $project, - $resource, - $testPermissionsRequestResource, - $zone - ); + $response = $disksClient->testIamPermissions($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/DisksClient/update.php b/Compute/samples/V1/DisksClient/update.php index d1ffad771273..9241102caadb 100644 --- a/Compute/samples/V1/DisksClient/update.php +++ b/Compute/samples/V1/DisksClient/update.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_Disks_Update_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\DisksClient; use Google\Cloud\Compute\V1\Disk; -use Google\Cloud\Compute\V1\DisksClient; +use Google\Cloud\Compute\V1\UpdateDiskRequest; use Google\Rpc\Status; /** @@ -41,13 +42,18 @@ function update_sample(string $disk, string $project, string $zone): void // Create a client. $disksClient = new DisksClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $diskResource = new Disk(); + $request = (new UpdateDiskRequest()) + ->setDisk($disk) + ->setDiskResource($diskResource) + ->setProject($project) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $disksClient->update($disk, $diskResource, $project, $zone); + $response = $disksClient->update($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/ExternalVpnGatewaysClient/delete.php b/Compute/samples/V1/ExternalVpnGatewaysClient/delete.php index 3a8795bbb7b9..c221d0c13494 100644 --- a/Compute/samples/V1/ExternalVpnGatewaysClient/delete.php +++ b/Compute/samples/V1/ExternalVpnGatewaysClient/delete.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_ExternalVpnGateways_Delete_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\ExternalVpnGatewaysClient; +use Google\Cloud\Compute\V1\Client\ExternalVpnGatewaysClient; +use Google\Cloud\Compute\V1\DeleteExternalVpnGatewayRequest; use Google\Rpc\Status; /** @@ -39,10 +40,15 @@ function delete_sample(string $externalVpnGateway, string $project): void // Create a client. $externalVpnGatewaysClient = new ExternalVpnGatewaysClient(); + // Prepare the request message. + $request = (new DeleteExternalVpnGatewayRequest()) + ->setExternalVpnGateway($externalVpnGateway) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $externalVpnGatewaysClient->delete($externalVpnGateway, $project); + $response = $externalVpnGatewaysClient->delete($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/ExternalVpnGatewaysClient/get.php b/Compute/samples/V1/ExternalVpnGatewaysClient/get.php index 4266d7e10bb8..1aa1dd7ed782 100644 --- a/Compute/samples/V1/ExternalVpnGatewaysClient/get.php +++ b/Compute/samples/V1/ExternalVpnGatewaysClient/get.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_ExternalVpnGateways_Get_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\ExternalVpnGatewaysClient; use Google\Cloud\Compute\V1\ExternalVpnGateway; -use Google\Cloud\Compute\V1\ExternalVpnGatewaysClient; +use Google\Cloud\Compute\V1\GetExternalVpnGatewayRequest; /** * Returns the specified externalVpnGateway. Get a list of available externalVpnGateways by making a list() request. @@ -38,10 +39,15 @@ function get_sample(string $externalVpnGateway, string $project): void // Create a client. $externalVpnGatewaysClient = new ExternalVpnGatewaysClient(); + // Prepare the request message. + $request = (new GetExternalVpnGatewayRequest()) + ->setExternalVpnGateway($externalVpnGateway) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var ExternalVpnGateway $response */ - $response = $externalVpnGatewaysClient->get($externalVpnGateway, $project); + $response = $externalVpnGatewaysClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/ExternalVpnGatewaysClient/insert.php b/Compute/samples/V1/ExternalVpnGatewaysClient/insert.php index 01787c763961..a932503055d7 100644 --- a/Compute/samples/V1/ExternalVpnGatewaysClient/insert.php +++ b/Compute/samples/V1/ExternalVpnGatewaysClient/insert.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_ExternalVpnGateways_Insert_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\ExternalVpnGatewaysClient; use Google\Cloud\Compute\V1\ExternalVpnGateway; -use Google\Cloud\Compute\V1\ExternalVpnGatewaysClient; +use Google\Cloud\Compute\V1\InsertExternalVpnGatewayRequest; use Google\Rpc\Status; /** @@ -39,13 +40,16 @@ function insert_sample(string $project): void // Create a client. $externalVpnGatewaysClient = new ExternalVpnGatewaysClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $externalVpnGatewayResource = new ExternalVpnGateway(); + $request = (new InsertExternalVpnGatewayRequest()) + ->setExternalVpnGatewayResource($externalVpnGatewayResource) + ->setProject($project); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $externalVpnGatewaysClient->insert($externalVpnGatewayResource, $project); + $response = $externalVpnGatewaysClient->insert($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/ExternalVpnGatewaysClient/list.php b/Compute/samples/V1/ExternalVpnGatewaysClient/list.php index 5632223e084c..e79bd8713e6e 100644 --- a/Compute/samples/V1/ExternalVpnGatewaysClient/list.php +++ b/Compute/samples/V1/ExternalVpnGatewaysClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_ExternalVpnGateways_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\ExternalVpnGatewaysClient; +use Google\Cloud\Compute\V1\Client\ExternalVpnGatewaysClient; +use Google\Cloud\Compute\V1\ListExternalVpnGatewaysRequest; /** * Retrieves the list of ExternalVpnGateway available to the specified project. @@ -37,10 +38,14 @@ function list_sample(string $project): void // Create a client. $externalVpnGatewaysClient = new ExternalVpnGatewaysClient(); + // Prepare the request message. + $request = (new ListExternalVpnGatewaysRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $externalVpnGatewaysClient->list($project); + $response = $externalVpnGatewaysClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/ExternalVpnGatewaysClient/set_labels.php b/Compute/samples/V1/ExternalVpnGatewaysClient/set_labels.php index a82a3e712a1d..b2bd1832c773 100644 --- a/Compute/samples/V1/ExternalVpnGatewaysClient/set_labels.php +++ b/Compute/samples/V1/ExternalVpnGatewaysClient/set_labels.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_ExternalVpnGateways_SetLabels_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\ExternalVpnGatewaysClient; +use Google\Cloud\Compute\V1\Client\ExternalVpnGatewaysClient; use Google\Cloud\Compute\V1\GlobalSetLabelsRequest; +use Google\Cloud\Compute\V1\SetLabelsExternalVpnGatewayRequest; use Google\Rpc\Status; /** @@ -40,17 +41,17 @@ function set_labels_sample(string $project, string $resource): void // Create a client. $externalVpnGatewaysClient = new ExternalVpnGatewaysClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $globalSetLabelsRequestResource = new GlobalSetLabelsRequest(); + $request = (new SetLabelsExternalVpnGatewayRequest()) + ->setGlobalSetLabelsRequestResource($globalSetLabelsRequestResource) + ->setProject($project) + ->setResource($resource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $externalVpnGatewaysClient->setLabels( - $globalSetLabelsRequestResource, - $project, - $resource - ); + $response = $externalVpnGatewaysClient->setLabels($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/ExternalVpnGatewaysClient/test_iam_permissions.php b/Compute/samples/V1/ExternalVpnGatewaysClient/test_iam_permissions.php index 3d9b5aaa8663..84e09a422935 100644 --- a/Compute/samples/V1/ExternalVpnGatewaysClient/test_iam_permissions.php +++ b/Compute/samples/V1/ExternalVpnGatewaysClient/test_iam_permissions.php @@ -24,7 +24,8 @@ // [START compute_v1_generated_ExternalVpnGateways_TestIamPermissions_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\ExternalVpnGatewaysClient; +use Google\Cloud\Compute\V1\Client\ExternalVpnGatewaysClient; +use Google\Cloud\Compute\V1\TestIamPermissionsExternalVpnGatewayRequest; use Google\Cloud\Compute\V1\TestPermissionsRequest; use Google\Cloud\Compute\V1\TestPermissionsResponse; @@ -39,17 +40,17 @@ function test_iam_permissions_sample(string $project, string $resource): void // Create a client. $externalVpnGatewaysClient = new ExternalVpnGatewaysClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $testPermissionsRequestResource = new TestPermissionsRequest(); + $request = (new TestIamPermissionsExternalVpnGatewayRequest()) + ->setProject($project) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); // Call the API and handle any network failures. try { /** @var TestPermissionsResponse $response */ - $response = $externalVpnGatewaysClient->testIamPermissions( - $project, - $resource, - $testPermissionsRequestResource - ); + $response = $externalVpnGatewaysClient->testIamPermissions($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/FirewallPoliciesClient/add_association.php b/Compute/samples/V1/FirewallPoliciesClient/add_association.php index 1479f2ada3c0..275e160ed083 100644 --- a/Compute/samples/V1/FirewallPoliciesClient/add_association.php +++ b/Compute/samples/V1/FirewallPoliciesClient/add_association.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_FirewallPolicies_AddAssociation_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\FirewallPoliciesClient; +use Google\Cloud\Compute\V1\AddAssociationFirewallPolicyRequest; +use Google\Cloud\Compute\V1\Client\FirewallPoliciesClient; use Google\Cloud\Compute\V1\FirewallPolicyAssociation; use Google\Rpc\Status; @@ -39,16 +40,16 @@ function add_association_sample(string $firewallPolicy): void // Create a client. $firewallPoliciesClient = new FirewallPoliciesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $firewallPolicyAssociationResource = new FirewallPolicyAssociation(); + $request = (new AddAssociationFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setFirewallPolicyAssociationResource($firewallPolicyAssociationResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $firewallPoliciesClient->addAssociation( - $firewallPolicy, - $firewallPolicyAssociationResource - ); + $response = $firewallPoliciesClient->addAssociation($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/FirewallPoliciesClient/add_rule.php b/Compute/samples/V1/FirewallPoliciesClient/add_rule.php index b19800b75666..46259f92175d 100644 --- a/Compute/samples/V1/FirewallPoliciesClient/add_rule.php +++ b/Compute/samples/V1/FirewallPoliciesClient/add_rule.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_FirewallPolicies_AddRule_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\FirewallPoliciesClient; +use Google\Cloud\Compute\V1\AddRuleFirewallPolicyRequest; +use Google\Cloud\Compute\V1\Client\FirewallPoliciesClient; use Google\Cloud\Compute\V1\FirewallPolicyRule; use Google\Rpc\Status; @@ -39,13 +40,16 @@ function add_rule_sample(string $firewallPolicy): void // Create a client. $firewallPoliciesClient = new FirewallPoliciesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $firewallPolicyRuleResource = new FirewallPolicyRule(); + $request = (new AddRuleFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setFirewallPolicyRuleResource($firewallPolicyRuleResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $firewallPoliciesClient->addRule($firewallPolicy, $firewallPolicyRuleResource); + $response = $firewallPoliciesClient->addRule($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/FirewallPoliciesClient/clone_rules.php b/Compute/samples/V1/FirewallPoliciesClient/clone_rules.php index 84fb36e3e785..a7e98e77300b 100644 --- a/Compute/samples/V1/FirewallPoliciesClient/clone_rules.php +++ b/Compute/samples/V1/FirewallPoliciesClient/clone_rules.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_FirewallPolicies_CloneRules_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\FirewallPoliciesClient; +use Google\Cloud\Compute\V1\Client\FirewallPoliciesClient; +use Google\Cloud\Compute\V1\CloneRulesFirewallPolicyRequest; use Google\Rpc\Status; /** @@ -38,10 +39,14 @@ function clone_rules_sample(string $firewallPolicy): void // Create a client. $firewallPoliciesClient = new FirewallPoliciesClient(); + // Prepare the request message. + $request = (new CloneRulesFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $firewallPoliciesClient->cloneRules($firewallPolicy); + $response = $firewallPoliciesClient->cloneRules($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/FirewallPoliciesClient/delete.php b/Compute/samples/V1/FirewallPoliciesClient/delete.php index dccbd767ce83..7b448eeeead7 100644 --- a/Compute/samples/V1/FirewallPoliciesClient/delete.php +++ b/Compute/samples/V1/FirewallPoliciesClient/delete.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_FirewallPolicies_Delete_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\FirewallPoliciesClient; +use Google\Cloud\Compute\V1\Client\FirewallPoliciesClient; +use Google\Cloud\Compute\V1\DeleteFirewallPolicyRequest; use Google\Rpc\Status; /** @@ -38,10 +39,14 @@ function delete_sample(string $firewallPolicy): void // Create a client. $firewallPoliciesClient = new FirewallPoliciesClient(); + // Prepare the request message. + $request = (new DeleteFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $firewallPoliciesClient->delete($firewallPolicy); + $response = $firewallPoliciesClient->delete($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/FirewallPoliciesClient/get.php b/Compute/samples/V1/FirewallPoliciesClient/get.php index 23949d7d7fe1..cebbb23254d1 100644 --- a/Compute/samples/V1/FirewallPoliciesClient/get.php +++ b/Compute/samples/V1/FirewallPoliciesClient/get.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_FirewallPolicies_Get_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\FirewallPoliciesClient; +use Google\Cloud\Compute\V1\Client\FirewallPoliciesClient; use Google\Cloud\Compute\V1\FirewallPolicy; +use Google\Cloud\Compute\V1\GetFirewallPolicyRequest; /** * Returns the specified firewall policy. @@ -37,10 +38,14 @@ function get_sample(string $firewallPolicy): void // Create a client. $firewallPoliciesClient = new FirewallPoliciesClient(); + // Prepare the request message. + $request = (new GetFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy); + // Call the API and handle any network failures. try { /** @var FirewallPolicy $response */ - $response = $firewallPoliciesClient->get($firewallPolicy); + $response = $firewallPoliciesClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/FirewallPoliciesClient/get_association.php b/Compute/samples/V1/FirewallPoliciesClient/get_association.php index 54c26345d069..1cad3c82e055 100644 --- a/Compute/samples/V1/FirewallPoliciesClient/get_association.php +++ b/Compute/samples/V1/FirewallPoliciesClient/get_association.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_FirewallPolicies_GetAssociation_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\FirewallPoliciesClient; +use Google\Cloud\Compute\V1\Client\FirewallPoliciesClient; use Google\Cloud\Compute\V1\FirewallPolicyAssociation; +use Google\Cloud\Compute\V1\GetAssociationFirewallPolicyRequest; /** * Gets an association with the specified name. @@ -37,10 +38,14 @@ function get_association_sample(string $firewallPolicy): void // Create a client. $firewallPoliciesClient = new FirewallPoliciesClient(); + // Prepare the request message. + $request = (new GetAssociationFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy); + // Call the API and handle any network failures. try { /** @var FirewallPolicyAssociation $response */ - $response = $firewallPoliciesClient->getAssociation($firewallPolicy); + $response = $firewallPoliciesClient->getAssociation($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/FirewallPoliciesClient/get_iam_policy.php b/Compute/samples/V1/FirewallPoliciesClient/get_iam_policy.php index 0752dd172318..dfc7c5ef51f8 100644 --- a/Compute/samples/V1/FirewallPoliciesClient/get_iam_policy.php +++ b/Compute/samples/V1/FirewallPoliciesClient/get_iam_policy.php @@ -24,7 +24,8 @@ // [START compute_v1_generated_FirewallPolicies_GetIamPolicy_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\FirewallPoliciesClient; +use Google\Cloud\Compute\V1\Client\FirewallPoliciesClient; +use Google\Cloud\Compute\V1\GetIamPolicyFirewallPolicyRequest; use Google\Cloud\Compute\V1\Policy; /** @@ -37,10 +38,14 @@ function get_iam_policy_sample(string $resource): void // Create a client. $firewallPoliciesClient = new FirewallPoliciesClient(); + // Prepare the request message. + $request = (new GetIamPolicyFirewallPolicyRequest()) + ->setResource($resource); + // Call the API and handle any network failures. try { /** @var Policy $response */ - $response = $firewallPoliciesClient->getIamPolicy($resource); + $response = $firewallPoliciesClient->getIamPolicy($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/FirewallPoliciesClient/get_rule.php b/Compute/samples/V1/FirewallPoliciesClient/get_rule.php index 014a51ef4f2e..175d007ba421 100644 --- a/Compute/samples/V1/FirewallPoliciesClient/get_rule.php +++ b/Compute/samples/V1/FirewallPoliciesClient/get_rule.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_FirewallPolicies_GetRule_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\FirewallPoliciesClient; +use Google\Cloud\Compute\V1\Client\FirewallPoliciesClient; use Google\Cloud\Compute\V1\FirewallPolicyRule; +use Google\Cloud\Compute\V1\GetRuleFirewallPolicyRequest; /** * Gets a rule of the specified priority. @@ -37,10 +38,14 @@ function get_rule_sample(string $firewallPolicy): void // Create a client. $firewallPoliciesClient = new FirewallPoliciesClient(); + // Prepare the request message. + $request = (new GetRuleFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy); + // Call the API and handle any network failures. try { /** @var FirewallPolicyRule $response */ - $response = $firewallPoliciesClient->getRule($firewallPolicy); + $response = $firewallPoliciesClient->getRule($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/FirewallPoliciesClient/insert.php b/Compute/samples/V1/FirewallPoliciesClient/insert.php index 0bcaa49de137..d14b30918719 100644 --- a/Compute/samples/V1/FirewallPoliciesClient/insert.php +++ b/Compute/samples/V1/FirewallPoliciesClient/insert.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_FirewallPolicies_Insert_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\FirewallPoliciesClient; +use Google\Cloud\Compute\V1\Client\FirewallPoliciesClient; use Google\Cloud\Compute\V1\FirewallPolicy; +use Google\Cloud\Compute\V1\InsertFirewallPolicyRequest; use Google\Rpc\Status; /** @@ -39,13 +40,16 @@ function insert_sample(string $parentId): void // Create a client. $firewallPoliciesClient = new FirewallPoliciesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $firewallPolicyResource = new FirewallPolicy(); + $request = (new InsertFirewallPolicyRequest()) + ->setFirewallPolicyResource($firewallPolicyResource) + ->setParentId($parentId); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $firewallPoliciesClient->insert($firewallPolicyResource, $parentId); + $response = $firewallPoliciesClient->insert($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/FirewallPoliciesClient/list.php b/Compute/samples/V1/FirewallPoliciesClient/list.php index 219a61487797..ff0507eba88b 100644 --- a/Compute/samples/V1/FirewallPoliciesClient/list.php +++ b/Compute/samples/V1/FirewallPoliciesClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_FirewallPolicies_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\FirewallPoliciesClient; +use Google\Cloud\Compute\V1\Client\FirewallPoliciesClient; +use Google\Cloud\Compute\V1\ListFirewallPoliciesRequest; /** * Lists all the policies that have been configured for the specified folder or organization. @@ -41,10 +42,13 @@ function list_sample(): void // Create a client. $firewallPoliciesClient = new FirewallPoliciesClient(); + // Prepare the request message. + $request = new ListFirewallPoliciesRequest(); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $firewallPoliciesClient->list(); + $response = $firewallPoliciesClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/FirewallPoliciesClient/list_associations.php b/Compute/samples/V1/FirewallPoliciesClient/list_associations.php index 58c7c6ed1e2e..652c8445fd4c 100644 --- a/Compute/samples/V1/FirewallPoliciesClient/list_associations.php +++ b/Compute/samples/V1/FirewallPoliciesClient/list_associations.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_FirewallPolicies_ListAssociations_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\FirewallPoliciesClient; +use Google\Cloud\Compute\V1\Client\FirewallPoliciesClient; use Google\Cloud\Compute\V1\FirewallPoliciesListAssociationsResponse; +use Google\Cloud\Compute\V1\ListAssociationsFirewallPolicyRequest; /** * Lists associations of a specified target, i.e., organization or folder. @@ -41,10 +42,13 @@ function list_associations_sample(): void // Create a client. $firewallPoliciesClient = new FirewallPoliciesClient(); + // Prepare the request message. + $request = new ListAssociationsFirewallPolicyRequest(); + // Call the API and handle any network failures. try { /** @var FirewallPoliciesListAssociationsResponse $response */ - $response = $firewallPoliciesClient->listAssociations(); + $response = $firewallPoliciesClient->listAssociations($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/FirewallPoliciesClient/move.php b/Compute/samples/V1/FirewallPoliciesClient/move.php index 7d20479f62fa..44ad21cecac6 100644 --- a/Compute/samples/V1/FirewallPoliciesClient/move.php +++ b/Compute/samples/V1/FirewallPoliciesClient/move.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_FirewallPolicies_Move_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\FirewallPoliciesClient; +use Google\Cloud\Compute\V1\Client\FirewallPoliciesClient; +use Google\Cloud\Compute\V1\MoveFirewallPolicyRequest; use Google\Rpc\Status; /** @@ -39,10 +40,15 @@ function move_sample(string $firewallPolicy, string $parentId): void // Create a client. $firewallPoliciesClient = new FirewallPoliciesClient(); + // Prepare the request message. + $request = (new MoveFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setParentId($parentId); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $firewallPoliciesClient->move($firewallPolicy, $parentId); + $response = $firewallPoliciesClient->move($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/FirewallPoliciesClient/patch.php b/Compute/samples/V1/FirewallPoliciesClient/patch.php index c85b020fdc2c..a929c334cc83 100644 --- a/Compute/samples/V1/FirewallPoliciesClient/patch.php +++ b/Compute/samples/V1/FirewallPoliciesClient/patch.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_FirewallPolicies_Patch_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\FirewallPoliciesClient; +use Google\Cloud\Compute\V1\Client\FirewallPoliciesClient; use Google\Cloud\Compute\V1\FirewallPolicy; +use Google\Cloud\Compute\V1\PatchFirewallPolicyRequest; use Google\Rpc\Status; /** @@ -39,13 +40,16 @@ function patch_sample(string $firewallPolicy): void // Create a client. $firewallPoliciesClient = new FirewallPoliciesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $firewallPolicyResource = new FirewallPolicy(); + $request = (new PatchFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setFirewallPolicyResource($firewallPolicyResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $firewallPoliciesClient->patch($firewallPolicy, $firewallPolicyResource); + $response = $firewallPoliciesClient->patch($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/FirewallPoliciesClient/patch_rule.php b/Compute/samples/V1/FirewallPoliciesClient/patch_rule.php index 5b2cf25d630e..29a68b2e746d 100644 --- a/Compute/samples/V1/FirewallPoliciesClient/patch_rule.php +++ b/Compute/samples/V1/FirewallPoliciesClient/patch_rule.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_FirewallPolicies_PatchRule_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\FirewallPoliciesClient; +use Google\Cloud\Compute\V1\Client\FirewallPoliciesClient; use Google\Cloud\Compute\V1\FirewallPolicyRule; +use Google\Cloud\Compute\V1\PatchRuleFirewallPolicyRequest; use Google\Rpc\Status; /** @@ -39,13 +40,16 @@ function patch_rule_sample(string $firewallPolicy): void // Create a client. $firewallPoliciesClient = new FirewallPoliciesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $firewallPolicyRuleResource = new FirewallPolicyRule(); + $request = (new PatchRuleFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setFirewallPolicyRuleResource($firewallPolicyRuleResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $firewallPoliciesClient->patchRule($firewallPolicy, $firewallPolicyRuleResource); + $response = $firewallPoliciesClient->patchRule($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/FirewallPoliciesClient/remove_association.php b/Compute/samples/V1/FirewallPoliciesClient/remove_association.php index 1dfe0b3362a9..1da971fc1b1b 100644 --- a/Compute/samples/V1/FirewallPoliciesClient/remove_association.php +++ b/Compute/samples/V1/FirewallPoliciesClient/remove_association.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_FirewallPolicies_RemoveAssociation_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\FirewallPoliciesClient; +use Google\Cloud\Compute\V1\Client\FirewallPoliciesClient; +use Google\Cloud\Compute\V1\RemoveAssociationFirewallPolicyRequest; use Google\Rpc\Status; /** @@ -38,10 +39,14 @@ function remove_association_sample(string $firewallPolicy): void // Create a client. $firewallPoliciesClient = new FirewallPoliciesClient(); + // Prepare the request message. + $request = (new RemoveAssociationFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $firewallPoliciesClient->removeAssociation($firewallPolicy); + $response = $firewallPoliciesClient->removeAssociation($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/FirewallPoliciesClient/remove_rule.php b/Compute/samples/V1/FirewallPoliciesClient/remove_rule.php index 84eac8ab908c..9c4ade18ca2d 100644 --- a/Compute/samples/V1/FirewallPoliciesClient/remove_rule.php +++ b/Compute/samples/V1/FirewallPoliciesClient/remove_rule.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_FirewallPolicies_RemoveRule_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\FirewallPoliciesClient; +use Google\Cloud\Compute\V1\Client\FirewallPoliciesClient; +use Google\Cloud\Compute\V1\RemoveRuleFirewallPolicyRequest; use Google\Rpc\Status; /** @@ -38,10 +39,14 @@ function remove_rule_sample(string $firewallPolicy): void // Create a client. $firewallPoliciesClient = new FirewallPoliciesClient(); + // Prepare the request message. + $request = (new RemoveRuleFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $firewallPoliciesClient->removeRule($firewallPolicy); + $response = $firewallPoliciesClient->removeRule($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/FirewallPoliciesClient/set_iam_policy.php b/Compute/samples/V1/FirewallPoliciesClient/set_iam_policy.php index 464c5875ed80..70d176f8e10e 100644 --- a/Compute/samples/V1/FirewallPoliciesClient/set_iam_policy.php +++ b/Compute/samples/V1/FirewallPoliciesClient/set_iam_policy.php @@ -24,9 +24,10 @@ // [START compute_v1_generated_FirewallPolicies_SetIamPolicy_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\FirewallPoliciesClient; +use Google\Cloud\Compute\V1\Client\FirewallPoliciesClient; use Google\Cloud\Compute\V1\GlobalOrganizationSetPolicyRequest; use Google\Cloud\Compute\V1\Policy; +use Google\Cloud\Compute\V1\SetIamPolicyFirewallPolicyRequest; /** * Sets the access control policy on the specified resource. Replaces any existing policy. @@ -38,16 +39,16 @@ function set_iam_policy_sample(string $resource): void // Create a client. $firewallPoliciesClient = new FirewallPoliciesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $globalOrganizationSetPolicyRequestResource = new GlobalOrganizationSetPolicyRequest(); + $request = (new SetIamPolicyFirewallPolicyRequest()) + ->setGlobalOrganizationSetPolicyRequestResource($globalOrganizationSetPolicyRequestResource) + ->setResource($resource); // Call the API and handle any network failures. try { /** @var Policy $response */ - $response = $firewallPoliciesClient->setIamPolicy( - $globalOrganizationSetPolicyRequestResource, - $resource - ); + $response = $firewallPoliciesClient->setIamPolicy($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/FirewallPoliciesClient/test_iam_permissions.php b/Compute/samples/V1/FirewallPoliciesClient/test_iam_permissions.php index 37063738c419..fc3bbf0d608b 100644 --- a/Compute/samples/V1/FirewallPoliciesClient/test_iam_permissions.php +++ b/Compute/samples/V1/FirewallPoliciesClient/test_iam_permissions.php @@ -24,7 +24,8 @@ // [START compute_v1_generated_FirewallPolicies_TestIamPermissions_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\FirewallPoliciesClient; +use Google\Cloud\Compute\V1\Client\FirewallPoliciesClient; +use Google\Cloud\Compute\V1\TestIamPermissionsFirewallPolicyRequest; use Google\Cloud\Compute\V1\TestPermissionsRequest; use Google\Cloud\Compute\V1\TestPermissionsResponse; @@ -38,13 +39,16 @@ function test_iam_permissions_sample(string $resource): void // Create a client. $firewallPoliciesClient = new FirewallPoliciesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $testPermissionsRequestResource = new TestPermissionsRequest(); + $request = (new TestIamPermissionsFirewallPolicyRequest()) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); // Call the API and handle any network failures. try { /** @var TestPermissionsResponse $response */ - $response = $firewallPoliciesClient->testIamPermissions($resource, $testPermissionsRequestResource); + $response = $firewallPoliciesClient->testIamPermissions($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/FirewallsClient/delete.php b/Compute/samples/V1/FirewallsClient/delete.php index 61f417785535..b1574e53ca95 100644 --- a/Compute/samples/V1/FirewallsClient/delete.php +++ b/Compute/samples/V1/FirewallsClient/delete.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_Firewalls_Delete_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\FirewallsClient; +use Google\Cloud\Compute\V1\Client\FirewallsClient; +use Google\Cloud\Compute\V1\DeleteFirewallRequest; use Google\Rpc\Status; /** @@ -39,10 +40,15 @@ function delete_sample(string $firewall, string $project): void // Create a client. $firewallsClient = new FirewallsClient(); + // Prepare the request message. + $request = (new DeleteFirewallRequest()) + ->setFirewall($firewall) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $firewallsClient->delete($firewall, $project); + $response = $firewallsClient->delete($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/FirewallsClient/get.php b/Compute/samples/V1/FirewallsClient/get.php index dbc549a9ae6c..c29bab72ef67 100644 --- a/Compute/samples/V1/FirewallsClient/get.php +++ b/Compute/samples/V1/FirewallsClient/get.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_Firewalls_Get_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\FirewallsClient; use Google\Cloud\Compute\V1\Firewall; -use Google\Cloud\Compute\V1\FirewallsClient; +use Google\Cloud\Compute\V1\GetFirewallRequest; /** * Returns the specified firewall. @@ -38,10 +39,15 @@ function get_sample(string $firewall, string $project): void // Create a client. $firewallsClient = new FirewallsClient(); + // Prepare the request message. + $request = (new GetFirewallRequest()) + ->setFirewall($firewall) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var Firewall $response */ - $response = $firewallsClient->get($firewall, $project); + $response = $firewallsClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/FirewallsClient/insert.php b/Compute/samples/V1/FirewallsClient/insert.php index f0f0b43c64b4..5fe69e4247c2 100644 --- a/Compute/samples/V1/FirewallsClient/insert.php +++ b/Compute/samples/V1/FirewallsClient/insert.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_Firewalls_Insert_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\FirewallsClient; use Google\Cloud\Compute\V1\Firewall; -use Google\Cloud\Compute\V1\FirewallsClient; +use Google\Cloud\Compute\V1\InsertFirewallRequest; use Google\Rpc\Status; /** @@ -39,13 +40,16 @@ function insert_sample(string $project): void // Create a client. $firewallsClient = new FirewallsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $firewallResource = new Firewall(); + $request = (new InsertFirewallRequest()) + ->setFirewallResource($firewallResource) + ->setProject($project); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $firewallsClient->insert($firewallResource, $project); + $response = $firewallsClient->insert($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/FirewallsClient/list.php b/Compute/samples/V1/FirewallsClient/list.php index 989c56c8a1a1..7321c90e5dde 100644 --- a/Compute/samples/V1/FirewallsClient/list.php +++ b/Compute/samples/V1/FirewallsClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_Firewalls_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\FirewallsClient; +use Google\Cloud\Compute\V1\Client\FirewallsClient; +use Google\Cloud\Compute\V1\ListFirewallsRequest; /** * Retrieves the list of firewall rules available to the specified project. @@ -37,10 +38,14 @@ function list_sample(string $project): void // Create a client. $firewallsClient = new FirewallsClient(); + // Prepare the request message. + $request = (new ListFirewallsRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $firewallsClient->list($project); + $response = $firewallsClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/FirewallsClient/patch.php b/Compute/samples/V1/FirewallsClient/patch.php index 289c7bf683db..410e71e9dd66 100644 --- a/Compute/samples/V1/FirewallsClient/patch.php +++ b/Compute/samples/V1/FirewallsClient/patch.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_Firewalls_Patch_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\FirewallsClient; use Google\Cloud\Compute\V1\Firewall; -use Google\Cloud\Compute\V1\FirewallsClient; +use Google\Cloud\Compute\V1\PatchFirewallRequest; use Google\Rpc\Status; /** @@ -40,13 +41,17 @@ function patch_sample(string $firewall, string $project): void // Create a client. $firewallsClient = new FirewallsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $firewallResource = new Firewall(); + $request = (new PatchFirewallRequest()) + ->setFirewall($firewall) + ->setFirewallResource($firewallResource) + ->setProject($project); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $firewallsClient->patch($firewall, $firewallResource, $project); + $response = $firewallsClient->patch($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/FirewallsClient/update.php b/Compute/samples/V1/FirewallsClient/update.php index 0e318fe9d1fd..bca645f4b3d7 100644 --- a/Compute/samples/V1/FirewallsClient/update.php +++ b/Compute/samples/V1/FirewallsClient/update.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_Firewalls_Update_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\FirewallsClient; use Google\Cloud\Compute\V1\Firewall; -use Google\Cloud\Compute\V1\FirewallsClient; +use Google\Cloud\Compute\V1\UpdateFirewallRequest; use Google\Rpc\Status; /** @@ -40,13 +41,17 @@ function update_sample(string $firewall, string $project): void // Create a client. $firewallsClient = new FirewallsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $firewallResource = new Firewall(); + $request = (new UpdateFirewallRequest()) + ->setFirewall($firewall) + ->setFirewallResource($firewallResource) + ->setProject($project); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $firewallsClient->update($firewall, $firewallResource, $project); + $response = $firewallsClient->update($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/ForwardingRulesClient/aggregated_list.php b/Compute/samples/V1/ForwardingRulesClient/aggregated_list.php index 0f23ddefdaa2..50060223f5a3 100644 --- a/Compute/samples/V1/ForwardingRulesClient/aggregated_list.php +++ b/Compute/samples/V1/ForwardingRulesClient/aggregated_list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_ForwardingRules_AggregatedList_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\ForwardingRulesClient; +use Google\Cloud\Compute\V1\AggregatedListForwardingRulesRequest; +use Google\Cloud\Compute\V1\Client\ForwardingRulesClient; /** * Retrieves an aggregated list of forwarding rules. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. @@ -37,10 +38,14 @@ function aggregated_list_sample(string $project): void // Create a client. $forwardingRulesClient = new ForwardingRulesClient(); + // Prepare the request message. + $request = (new AggregatedListForwardingRulesRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $forwardingRulesClient->aggregatedList($project); + $response = $forwardingRulesClient->aggregatedList($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/ForwardingRulesClient/delete.php b/Compute/samples/V1/ForwardingRulesClient/delete.php index 3f65df288d20..4faed73089a7 100644 --- a/Compute/samples/V1/ForwardingRulesClient/delete.php +++ b/Compute/samples/V1/ForwardingRulesClient/delete.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_ForwardingRules_Delete_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\ForwardingRulesClient; +use Google\Cloud\Compute\V1\Client\ForwardingRulesClient; +use Google\Cloud\Compute\V1\DeleteForwardingRuleRequest; use Google\Rpc\Status; /** @@ -40,10 +41,16 @@ function delete_sample(string $forwardingRule, string $project, string $region): // Create a client. $forwardingRulesClient = new ForwardingRulesClient(); + // Prepare the request message. + $request = (new DeleteForwardingRuleRequest()) + ->setForwardingRule($forwardingRule) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $forwardingRulesClient->delete($forwardingRule, $project, $region); + $response = $forwardingRulesClient->delete($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/ForwardingRulesClient/get.php b/Compute/samples/V1/ForwardingRulesClient/get.php index 565e00745a47..44f8d83aa6db 100644 --- a/Compute/samples/V1/ForwardingRulesClient/get.php +++ b/Compute/samples/V1/ForwardingRulesClient/get.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_ForwardingRules_Get_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\ForwardingRulesClient; use Google\Cloud\Compute\V1\ForwardingRule; -use Google\Cloud\Compute\V1\ForwardingRulesClient; +use Google\Cloud\Compute\V1\GetForwardingRuleRequest; /** * Returns the specified ForwardingRule resource. @@ -39,10 +40,16 @@ function get_sample(string $forwardingRule, string $project, string $region): vo // Create a client. $forwardingRulesClient = new ForwardingRulesClient(); + // Prepare the request message. + $request = (new GetForwardingRuleRequest()) + ->setForwardingRule($forwardingRule) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var ForwardingRule $response */ - $response = $forwardingRulesClient->get($forwardingRule, $project, $region); + $response = $forwardingRulesClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/ForwardingRulesClient/insert.php b/Compute/samples/V1/ForwardingRulesClient/insert.php index 8eda737c123c..7afe5028532d 100644 --- a/Compute/samples/V1/ForwardingRulesClient/insert.php +++ b/Compute/samples/V1/ForwardingRulesClient/insert.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_ForwardingRules_Insert_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\ForwardingRulesClient; use Google\Cloud\Compute\V1\ForwardingRule; -use Google\Cloud\Compute\V1\ForwardingRulesClient; +use Google\Cloud\Compute\V1\InsertForwardingRuleRequest; use Google\Rpc\Status; /** @@ -40,13 +41,17 @@ function insert_sample(string $project, string $region): void // Create a client. $forwardingRulesClient = new ForwardingRulesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $forwardingRuleResource = new ForwardingRule(); + $request = (new InsertForwardingRuleRequest()) + ->setForwardingRuleResource($forwardingRuleResource) + ->setProject($project) + ->setRegion($region); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $forwardingRulesClient->insert($forwardingRuleResource, $project, $region); + $response = $forwardingRulesClient->insert($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/ForwardingRulesClient/list.php b/Compute/samples/V1/ForwardingRulesClient/list.php index fae238dc1023..837771393faf 100644 --- a/Compute/samples/V1/ForwardingRulesClient/list.php +++ b/Compute/samples/V1/ForwardingRulesClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_ForwardingRules_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\ForwardingRulesClient; +use Google\Cloud\Compute\V1\Client\ForwardingRulesClient; +use Google\Cloud\Compute\V1\ListForwardingRulesRequest; /** * Retrieves a list of ForwardingRule resources available to the specified project and region. @@ -38,10 +39,15 @@ function list_sample(string $project, string $region): void // Create a client. $forwardingRulesClient = new ForwardingRulesClient(); + // Prepare the request message. + $request = (new ListForwardingRulesRequest()) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $forwardingRulesClient->list($project, $region); + $response = $forwardingRulesClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/ForwardingRulesClient/patch.php b/Compute/samples/V1/ForwardingRulesClient/patch.php index 1b631a89907c..44136208d3bc 100644 --- a/Compute/samples/V1/ForwardingRulesClient/patch.php +++ b/Compute/samples/V1/ForwardingRulesClient/patch.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_ForwardingRules_Patch_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\ForwardingRulesClient; use Google\Cloud\Compute\V1\ForwardingRule; -use Google\Cloud\Compute\V1\ForwardingRulesClient; +use Google\Cloud\Compute\V1\PatchForwardingRuleRequest; use Google\Rpc\Status; /** @@ -41,18 +42,18 @@ function patch_sample(string $forwardingRule, string $project, string $region): // Create a client. $forwardingRulesClient = new ForwardingRulesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $forwardingRuleResource = new ForwardingRule(); + $request = (new PatchForwardingRuleRequest()) + ->setForwardingRule($forwardingRule) + ->setForwardingRuleResource($forwardingRuleResource) + ->setProject($project) + ->setRegion($region); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $forwardingRulesClient->patch( - $forwardingRule, - $forwardingRuleResource, - $project, - $region - ); + $response = $forwardingRulesClient->patch($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/ForwardingRulesClient/set_labels.php b/Compute/samples/V1/ForwardingRulesClient/set_labels.php index a06662e5ca5b..bf54123b9bd0 100644 --- a/Compute/samples/V1/ForwardingRulesClient/set_labels.php +++ b/Compute/samples/V1/ForwardingRulesClient/set_labels.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_ForwardingRules_SetLabels_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\ForwardingRulesClient; +use Google\Cloud\Compute\V1\Client\ForwardingRulesClient; use Google\Cloud\Compute\V1\RegionSetLabelsRequest; +use Google\Cloud\Compute\V1\SetLabelsForwardingRuleRequest; use Google\Rpc\Status; /** @@ -41,18 +42,18 @@ function set_labels_sample(string $project, string $region, string $resource): v // Create a client. $forwardingRulesClient = new ForwardingRulesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $regionSetLabelsRequestResource = new RegionSetLabelsRequest(); + $request = (new SetLabelsForwardingRuleRequest()) + ->setProject($project) + ->setRegion($region) + ->setRegionSetLabelsRequestResource($regionSetLabelsRequestResource) + ->setResource($resource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $forwardingRulesClient->setLabels( - $project, - $region, - $regionSetLabelsRequestResource, - $resource - ); + $response = $forwardingRulesClient->setLabels($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/ForwardingRulesClient/set_target.php b/Compute/samples/V1/ForwardingRulesClient/set_target.php index 28bff65405d3..2a4ea40cb9a0 100644 --- a/Compute/samples/V1/ForwardingRulesClient/set_target.php +++ b/Compute/samples/V1/ForwardingRulesClient/set_target.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_ForwardingRules_SetTarget_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\ForwardingRulesClient; +use Google\Cloud\Compute\V1\Client\ForwardingRulesClient; +use Google\Cloud\Compute\V1\SetTargetForwardingRuleRequest; use Google\Cloud\Compute\V1\TargetReference; use Google\Rpc\Status; @@ -41,18 +42,18 @@ function set_target_sample(string $forwardingRule, string $project, string $regi // Create a client. $forwardingRulesClient = new ForwardingRulesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $targetReferenceResource = new TargetReference(); + $request = (new SetTargetForwardingRuleRequest()) + ->setForwardingRule($forwardingRule) + ->setProject($project) + ->setRegion($region) + ->setTargetReferenceResource($targetReferenceResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $forwardingRulesClient->setTarget( - $forwardingRule, - $project, - $region, - $targetReferenceResource - ); + $response = $forwardingRulesClient->setTarget($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/GlobalAddressesClient/delete.php b/Compute/samples/V1/GlobalAddressesClient/delete.php index 5754ccf9fcbf..b387d4c0ee0e 100644 --- a/Compute/samples/V1/GlobalAddressesClient/delete.php +++ b/Compute/samples/V1/GlobalAddressesClient/delete.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_GlobalAddresses_Delete_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\GlobalAddressesClient; +use Google\Cloud\Compute\V1\Client\GlobalAddressesClient; +use Google\Cloud\Compute\V1\DeleteGlobalAddressRequest; use Google\Rpc\Status; /** @@ -39,10 +40,15 @@ function delete_sample(string $address, string $project): void // Create a client. $globalAddressesClient = new GlobalAddressesClient(); + // Prepare the request message. + $request = (new DeleteGlobalAddressRequest()) + ->setAddress($address) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $globalAddressesClient->delete($address, $project); + $response = $globalAddressesClient->delete($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/GlobalAddressesClient/get.php b/Compute/samples/V1/GlobalAddressesClient/get.php index db5bb20d5a3c..7274932ece54 100644 --- a/Compute/samples/V1/GlobalAddressesClient/get.php +++ b/Compute/samples/V1/GlobalAddressesClient/get.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_GlobalAddresses_Get_sync] use Google\ApiCore\ApiException; use Google\Cloud\Compute\V1\Address; -use Google\Cloud\Compute\V1\GlobalAddressesClient; +use Google\Cloud\Compute\V1\Client\GlobalAddressesClient; +use Google\Cloud\Compute\V1\GetGlobalAddressRequest; /** * Returns the specified address resource. @@ -38,10 +39,15 @@ function get_sample(string $address, string $project): void // Create a client. $globalAddressesClient = new GlobalAddressesClient(); + // Prepare the request message. + $request = (new GetGlobalAddressRequest()) + ->setAddress($address) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var Address $response */ - $response = $globalAddressesClient->get($address, $project); + $response = $globalAddressesClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/GlobalAddressesClient/insert.php b/Compute/samples/V1/GlobalAddressesClient/insert.php index cef16396af9f..da94b5da66fb 100644 --- a/Compute/samples/V1/GlobalAddressesClient/insert.php +++ b/Compute/samples/V1/GlobalAddressesClient/insert.php @@ -26,7 +26,8 @@ use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; use Google\Cloud\Compute\V1\Address; -use Google\Cloud\Compute\V1\GlobalAddressesClient; +use Google\Cloud\Compute\V1\Client\GlobalAddressesClient; +use Google\Cloud\Compute\V1\InsertGlobalAddressRequest; use Google\Rpc\Status; /** @@ -39,13 +40,16 @@ function insert_sample(string $project): void // Create a client. $globalAddressesClient = new GlobalAddressesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $addressResource = new Address(); + $request = (new InsertGlobalAddressRequest()) + ->setAddressResource($addressResource) + ->setProject($project); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $globalAddressesClient->insert($addressResource, $project); + $response = $globalAddressesClient->insert($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/GlobalAddressesClient/list.php b/Compute/samples/V1/GlobalAddressesClient/list.php index c72b65ab7828..44b8b47d8ecd 100644 --- a/Compute/samples/V1/GlobalAddressesClient/list.php +++ b/Compute/samples/V1/GlobalAddressesClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_GlobalAddresses_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\GlobalAddressesClient; +use Google\Cloud\Compute\V1\Client\GlobalAddressesClient; +use Google\Cloud\Compute\V1\ListGlobalAddressesRequest; /** * Retrieves a list of global addresses. @@ -37,10 +38,14 @@ function list_sample(string $project): void // Create a client. $globalAddressesClient = new GlobalAddressesClient(); + // Prepare the request message. + $request = (new ListGlobalAddressesRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $globalAddressesClient->list($project); + $response = $globalAddressesClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/GlobalAddressesClient/move.php b/Compute/samples/V1/GlobalAddressesClient/move.php index 2d43766c2464..7d78630f19f0 100644 --- a/Compute/samples/V1/GlobalAddressesClient/move.php +++ b/Compute/samples/V1/GlobalAddressesClient/move.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_GlobalAddresses_Move_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\GlobalAddressesClient; +use Google\Cloud\Compute\V1\Client\GlobalAddressesClient; use Google\Cloud\Compute\V1\GlobalAddressesMoveRequest; +use Google\Cloud\Compute\V1\MoveGlobalAddressRequest; use Google\Rpc\Status; /** @@ -40,13 +41,17 @@ function move_sample(string $address, string $project): void // Create a client. $globalAddressesClient = new GlobalAddressesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $globalAddressesMoveRequestResource = new GlobalAddressesMoveRequest(); + $request = (new MoveGlobalAddressRequest()) + ->setAddress($address) + ->setGlobalAddressesMoveRequestResource($globalAddressesMoveRequestResource) + ->setProject($project); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $globalAddressesClient->move($address, $globalAddressesMoveRequestResource, $project); + $response = $globalAddressesClient->move($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/GlobalAddressesClient/set_labels.php b/Compute/samples/V1/GlobalAddressesClient/set_labels.php index 344ecc15c586..3f2b49c2a39a 100644 --- a/Compute/samples/V1/GlobalAddressesClient/set_labels.php +++ b/Compute/samples/V1/GlobalAddressesClient/set_labels.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_GlobalAddresses_SetLabels_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\GlobalAddressesClient; +use Google\Cloud\Compute\V1\Client\GlobalAddressesClient; use Google\Cloud\Compute\V1\GlobalSetLabelsRequest; +use Google\Cloud\Compute\V1\SetLabelsGlobalAddressRequest; use Google\Rpc\Status; /** @@ -40,13 +41,17 @@ function set_labels_sample(string $project, string $resource): void // Create a client. $globalAddressesClient = new GlobalAddressesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $globalSetLabelsRequestResource = new GlobalSetLabelsRequest(); + $request = (new SetLabelsGlobalAddressRequest()) + ->setGlobalSetLabelsRequestResource($globalSetLabelsRequestResource) + ->setProject($project) + ->setResource($resource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $globalAddressesClient->setLabels($globalSetLabelsRequestResource, $project, $resource); + $response = $globalAddressesClient->setLabels($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/GlobalForwardingRulesClient/delete.php b/Compute/samples/V1/GlobalForwardingRulesClient/delete.php index 1d6b7eca0bb5..89089d64e072 100644 --- a/Compute/samples/V1/GlobalForwardingRulesClient/delete.php +++ b/Compute/samples/V1/GlobalForwardingRulesClient/delete.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_GlobalForwardingRules_Delete_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\GlobalForwardingRulesClient; +use Google\Cloud\Compute\V1\Client\GlobalForwardingRulesClient; +use Google\Cloud\Compute\V1\DeleteGlobalForwardingRuleRequest; use Google\Rpc\Status; /** @@ -39,10 +40,15 @@ function delete_sample(string $forwardingRule, string $project): void // Create a client. $globalForwardingRulesClient = new GlobalForwardingRulesClient(); + // Prepare the request message. + $request = (new DeleteGlobalForwardingRuleRequest()) + ->setForwardingRule($forwardingRule) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $globalForwardingRulesClient->delete($forwardingRule, $project); + $response = $globalForwardingRulesClient->delete($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/GlobalForwardingRulesClient/get.php b/Compute/samples/V1/GlobalForwardingRulesClient/get.php index 08f46fae7760..e590ab952f6b 100644 --- a/Compute/samples/V1/GlobalForwardingRulesClient/get.php +++ b/Compute/samples/V1/GlobalForwardingRulesClient/get.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_GlobalForwardingRules_Get_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\GlobalForwardingRulesClient; use Google\Cloud\Compute\V1\ForwardingRule; -use Google\Cloud\Compute\V1\GlobalForwardingRulesClient; +use Google\Cloud\Compute\V1\GetGlobalForwardingRuleRequest; /** * Returns the specified GlobalForwardingRule resource. Gets a list of available forwarding rules by making a list() request. @@ -38,10 +39,15 @@ function get_sample(string $forwardingRule, string $project): void // Create a client. $globalForwardingRulesClient = new GlobalForwardingRulesClient(); + // Prepare the request message. + $request = (new GetGlobalForwardingRuleRequest()) + ->setForwardingRule($forwardingRule) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var ForwardingRule $response */ - $response = $globalForwardingRulesClient->get($forwardingRule, $project); + $response = $globalForwardingRulesClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/GlobalForwardingRulesClient/insert.php b/Compute/samples/V1/GlobalForwardingRulesClient/insert.php index 25364830309c..7e6db064b562 100644 --- a/Compute/samples/V1/GlobalForwardingRulesClient/insert.php +++ b/Compute/samples/V1/GlobalForwardingRulesClient/insert.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_GlobalForwardingRules_Insert_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\GlobalForwardingRulesClient; use Google\Cloud\Compute\V1\ForwardingRule; -use Google\Cloud\Compute\V1\GlobalForwardingRulesClient; +use Google\Cloud\Compute\V1\InsertGlobalForwardingRuleRequest; use Google\Rpc\Status; /** @@ -39,13 +40,16 @@ function insert_sample(string $project): void // Create a client. $globalForwardingRulesClient = new GlobalForwardingRulesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $forwardingRuleResource = new ForwardingRule(); + $request = (new InsertGlobalForwardingRuleRequest()) + ->setForwardingRuleResource($forwardingRuleResource) + ->setProject($project); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $globalForwardingRulesClient->insert($forwardingRuleResource, $project); + $response = $globalForwardingRulesClient->insert($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/GlobalForwardingRulesClient/list.php b/Compute/samples/V1/GlobalForwardingRulesClient/list.php index 32809e5ffa86..2fc816981e46 100644 --- a/Compute/samples/V1/GlobalForwardingRulesClient/list.php +++ b/Compute/samples/V1/GlobalForwardingRulesClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_GlobalForwardingRules_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\GlobalForwardingRulesClient; +use Google\Cloud\Compute\V1\Client\GlobalForwardingRulesClient; +use Google\Cloud\Compute\V1\ListGlobalForwardingRulesRequest; /** * Retrieves a list of GlobalForwardingRule resources available to the specified project. @@ -37,10 +38,14 @@ function list_sample(string $project): void // Create a client. $globalForwardingRulesClient = new GlobalForwardingRulesClient(); + // Prepare the request message. + $request = (new ListGlobalForwardingRulesRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $globalForwardingRulesClient->list($project); + $response = $globalForwardingRulesClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/GlobalForwardingRulesClient/patch.php b/Compute/samples/V1/GlobalForwardingRulesClient/patch.php index ae804e07ee69..c7e4c5c0af26 100644 --- a/Compute/samples/V1/GlobalForwardingRulesClient/patch.php +++ b/Compute/samples/V1/GlobalForwardingRulesClient/patch.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_GlobalForwardingRules_Patch_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\GlobalForwardingRulesClient; use Google\Cloud\Compute\V1\ForwardingRule; -use Google\Cloud\Compute\V1\GlobalForwardingRulesClient; +use Google\Cloud\Compute\V1\PatchGlobalForwardingRuleRequest; use Google\Rpc\Status; /** @@ -40,13 +41,17 @@ function patch_sample(string $forwardingRule, string $project): void // Create a client. $globalForwardingRulesClient = new GlobalForwardingRulesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $forwardingRuleResource = new ForwardingRule(); + $request = (new PatchGlobalForwardingRuleRequest()) + ->setForwardingRule($forwardingRule) + ->setForwardingRuleResource($forwardingRuleResource) + ->setProject($project); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $globalForwardingRulesClient->patch($forwardingRule, $forwardingRuleResource, $project); + $response = $globalForwardingRulesClient->patch($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/GlobalForwardingRulesClient/set_labels.php b/Compute/samples/V1/GlobalForwardingRulesClient/set_labels.php index 47ca80ce130c..1a3c023e7090 100644 --- a/Compute/samples/V1/GlobalForwardingRulesClient/set_labels.php +++ b/Compute/samples/V1/GlobalForwardingRulesClient/set_labels.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_GlobalForwardingRules_SetLabels_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\GlobalForwardingRulesClient; +use Google\Cloud\Compute\V1\Client\GlobalForwardingRulesClient; use Google\Cloud\Compute\V1\GlobalSetLabelsRequest; +use Google\Cloud\Compute\V1\SetLabelsGlobalForwardingRuleRequest; use Google\Rpc\Status; /** @@ -40,17 +41,17 @@ function set_labels_sample(string $project, string $resource): void // Create a client. $globalForwardingRulesClient = new GlobalForwardingRulesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $globalSetLabelsRequestResource = new GlobalSetLabelsRequest(); + $request = (new SetLabelsGlobalForwardingRuleRequest()) + ->setGlobalSetLabelsRequestResource($globalSetLabelsRequestResource) + ->setProject($project) + ->setResource($resource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $globalForwardingRulesClient->setLabels( - $globalSetLabelsRequestResource, - $project, - $resource - ); + $response = $globalForwardingRulesClient->setLabels($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/GlobalForwardingRulesClient/set_target.php b/Compute/samples/V1/GlobalForwardingRulesClient/set_target.php index 5eb0e41dd04b..c13e57aa8ec9 100644 --- a/Compute/samples/V1/GlobalForwardingRulesClient/set_target.php +++ b/Compute/samples/V1/GlobalForwardingRulesClient/set_target.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_GlobalForwardingRules_SetTarget_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\GlobalForwardingRulesClient; +use Google\Cloud\Compute\V1\Client\GlobalForwardingRulesClient; +use Google\Cloud\Compute\V1\SetTargetGlobalForwardingRuleRequest; use Google\Cloud\Compute\V1\TargetReference; use Google\Rpc\Status; @@ -40,17 +41,17 @@ function set_target_sample(string $forwardingRule, string $project): void // Create a client. $globalForwardingRulesClient = new GlobalForwardingRulesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $targetReferenceResource = new TargetReference(); + $request = (new SetTargetGlobalForwardingRuleRequest()) + ->setForwardingRule($forwardingRule) + ->setProject($project) + ->setTargetReferenceResource($targetReferenceResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $globalForwardingRulesClient->setTarget( - $forwardingRule, - $project, - $targetReferenceResource - ); + $response = $globalForwardingRulesClient->setTarget($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/GlobalNetworkEndpointGroupsClient/attach_network_endpoints.php b/Compute/samples/V1/GlobalNetworkEndpointGroupsClient/attach_network_endpoints.php index 27a1bcb01cb1..c38994335d8e 100644 --- a/Compute/samples/V1/GlobalNetworkEndpointGroupsClient/attach_network_endpoints.php +++ b/Compute/samples/V1/GlobalNetworkEndpointGroupsClient/attach_network_endpoints.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_GlobalNetworkEndpointGroups_AttachNetworkEndpoints_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest; +use Google\Cloud\Compute\V1\Client\GlobalNetworkEndpointGroupsClient; use Google\Cloud\Compute\V1\GlobalNetworkEndpointGroupsAttachEndpointsRequest; -use Google\Cloud\Compute\V1\GlobalNetworkEndpointGroupsClient; use Google\Rpc\Status; /** @@ -40,17 +41,19 @@ function attach_network_endpoints_sample(string $networkEndpointGroup, string $p // Create a client. $globalNetworkEndpointGroupsClient = new GlobalNetworkEndpointGroupsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $globalNetworkEndpointGroupsAttachEndpointsRequestResource = new GlobalNetworkEndpointGroupsAttachEndpointsRequest(); + $request = (new AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest()) + ->setGlobalNetworkEndpointGroupsAttachEndpointsRequestResource( + $globalNetworkEndpointGroupsAttachEndpointsRequestResource + ) + ->setNetworkEndpointGroup($networkEndpointGroup) + ->setProject($project); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $globalNetworkEndpointGroupsClient->attachNetworkEndpoints( - $globalNetworkEndpointGroupsAttachEndpointsRequestResource, - $networkEndpointGroup, - $project - ); + $response = $globalNetworkEndpointGroupsClient->attachNetworkEndpoints($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/GlobalNetworkEndpointGroupsClient/delete.php b/Compute/samples/V1/GlobalNetworkEndpointGroupsClient/delete.php index 3880a10be623..70b149630d67 100644 --- a/Compute/samples/V1/GlobalNetworkEndpointGroupsClient/delete.php +++ b/Compute/samples/V1/GlobalNetworkEndpointGroupsClient/delete.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_GlobalNetworkEndpointGroups_Delete_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\GlobalNetworkEndpointGroupsClient; +use Google\Cloud\Compute\V1\Client\GlobalNetworkEndpointGroupsClient; +use Google\Cloud\Compute\V1\DeleteGlobalNetworkEndpointGroupRequest; use Google\Rpc\Status; /** @@ -39,10 +40,15 @@ function delete_sample(string $networkEndpointGroup, string $project): void // Create a client. $globalNetworkEndpointGroupsClient = new GlobalNetworkEndpointGroupsClient(); + // Prepare the request message. + $request = (new DeleteGlobalNetworkEndpointGroupRequest()) + ->setNetworkEndpointGroup($networkEndpointGroup) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $globalNetworkEndpointGroupsClient->delete($networkEndpointGroup, $project); + $response = $globalNetworkEndpointGroupsClient->delete($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/GlobalNetworkEndpointGroupsClient/detach_network_endpoints.php b/Compute/samples/V1/GlobalNetworkEndpointGroupsClient/detach_network_endpoints.php index 6279bbb75637..51dd823bc49c 100644 --- a/Compute/samples/V1/GlobalNetworkEndpointGroupsClient/detach_network_endpoints.php +++ b/Compute/samples/V1/GlobalNetworkEndpointGroupsClient/detach_network_endpoints.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_GlobalNetworkEndpointGroups_DetachNetworkEndpoints_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\GlobalNetworkEndpointGroupsClient; +use Google\Cloud\Compute\V1\Client\GlobalNetworkEndpointGroupsClient; +use Google\Cloud\Compute\V1\DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest; use Google\Cloud\Compute\V1\GlobalNetworkEndpointGroupsDetachEndpointsRequest; use Google\Rpc\Status; @@ -40,17 +41,19 @@ function detach_network_endpoints_sample(string $networkEndpointGroup, string $p // Create a client. $globalNetworkEndpointGroupsClient = new GlobalNetworkEndpointGroupsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $globalNetworkEndpointGroupsDetachEndpointsRequestResource = new GlobalNetworkEndpointGroupsDetachEndpointsRequest(); + $request = (new DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest()) + ->setGlobalNetworkEndpointGroupsDetachEndpointsRequestResource( + $globalNetworkEndpointGroupsDetachEndpointsRequestResource + ) + ->setNetworkEndpointGroup($networkEndpointGroup) + ->setProject($project); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $globalNetworkEndpointGroupsClient->detachNetworkEndpoints( - $globalNetworkEndpointGroupsDetachEndpointsRequestResource, - $networkEndpointGroup, - $project - ); + $response = $globalNetworkEndpointGroupsClient->detachNetworkEndpoints($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/GlobalNetworkEndpointGroupsClient/get.php b/Compute/samples/V1/GlobalNetworkEndpointGroupsClient/get.php index 341c706882da..423e4d8a7f6c 100644 --- a/Compute/samples/V1/GlobalNetworkEndpointGroupsClient/get.php +++ b/Compute/samples/V1/GlobalNetworkEndpointGroupsClient/get.php @@ -24,7 +24,8 @@ // [START compute_v1_generated_GlobalNetworkEndpointGroups_Get_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\GlobalNetworkEndpointGroupsClient; +use Google\Cloud\Compute\V1\Client\GlobalNetworkEndpointGroupsClient; +use Google\Cloud\Compute\V1\GetGlobalNetworkEndpointGroupRequest; use Google\Cloud\Compute\V1\NetworkEndpointGroup; /** @@ -38,10 +39,15 @@ function get_sample(string $networkEndpointGroup, string $project): void // Create a client. $globalNetworkEndpointGroupsClient = new GlobalNetworkEndpointGroupsClient(); + // Prepare the request message. + $request = (new GetGlobalNetworkEndpointGroupRequest()) + ->setNetworkEndpointGroup($networkEndpointGroup) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var NetworkEndpointGroup $response */ - $response = $globalNetworkEndpointGroupsClient->get($networkEndpointGroup, $project); + $response = $globalNetworkEndpointGroupsClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/GlobalNetworkEndpointGroupsClient/insert.php b/Compute/samples/V1/GlobalNetworkEndpointGroupsClient/insert.php index 21f51f1a2f14..743c254a1e1e 100644 --- a/Compute/samples/V1/GlobalNetworkEndpointGroupsClient/insert.php +++ b/Compute/samples/V1/GlobalNetworkEndpointGroupsClient/insert.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_GlobalNetworkEndpointGroups_Insert_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\GlobalNetworkEndpointGroupsClient; +use Google\Cloud\Compute\V1\Client\GlobalNetworkEndpointGroupsClient; +use Google\Cloud\Compute\V1\InsertGlobalNetworkEndpointGroupRequest; use Google\Cloud\Compute\V1\NetworkEndpointGroup; use Google\Rpc\Status; @@ -39,13 +40,16 @@ function insert_sample(string $project): void // Create a client. $globalNetworkEndpointGroupsClient = new GlobalNetworkEndpointGroupsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $networkEndpointGroupResource = new NetworkEndpointGroup(); + $request = (new InsertGlobalNetworkEndpointGroupRequest()) + ->setNetworkEndpointGroupResource($networkEndpointGroupResource) + ->setProject($project); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $globalNetworkEndpointGroupsClient->insert($networkEndpointGroupResource, $project); + $response = $globalNetworkEndpointGroupsClient->insert($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/GlobalNetworkEndpointGroupsClient/list.php b/Compute/samples/V1/GlobalNetworkEndpointGroupsClient/list.php index 6a9184fe19ef..fe0e1aed8440 100644 --- a/Compute/samples/V1/GlobalNetworkEndpointGroupsClient/list.php +++ b/Compute/samples/V1/GlobalNetworkEndpointGroupsClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_GlobalNetworkEndpointGroups_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\GlobalNetworkEndpointGroupsClient; +use Google\Cloud\Compute\V1\Client\GlobalNetworkEndpointGroupsClient; +use Google\Cloud\Compute\V1\ListGlobalNetworkEndpointGroupsRequest; /** * Retrieves the list of network endpoint groups that are located in the specified project. @@ -37,10 +38,14 @@ function list_sample(string $project): void // Create a client. $globalNetworkEndpointGroupsClient = new GlobalNetworkEndpointGroupsClient(); + // Prepare the request message. + $request = (new ListGlobalNetworkEndpointGroupsRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $globalNetworkEndpointGroupsClient->list($project); + $response = $globalNetworkEndpointGroupsClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/GlobalNetworkEndpointGroupsClient/list_network_endpoints.php b/Compute/samples/V1/GlobalNetworkEndpointGroupsClient/list_network_endpoints.php index f201463becff..9f6518b7006f 100644 --- a/Compute/samples/V1/GlobalNetworkEndpointGroupsClient/list_network_endpoints.php +++ b/Compute/samples/V1/GlobalNetworkEndpointGroupsClient/list_network_endpoints.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_GlobalNetworkEndpointGroups_ListNetworkEndpoints_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\GlobalNetworkEndpointGroupsClient; +use Google\Cloud\Compute\V1\Client\GlobalNetworkEndpointGroupsClient; +use Google\Cloud\Compute\V1\ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest; /** * Lists the network endpoints in the specified network endpoint group. @@ -38,13 +39,15 @@ function list_network_endpoints_sample(string $networkEndpointGroup, string $pro // Create a client. $globalNetworkEndpointGroupsClient = new GlobalNetworkEndpointGroupsClient(); + // Prepare the request message. + $request = (new ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest()) + ->setNetworkEndpointGroup($networkEndpointGroup) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $globalNetworkEndpointGroupsClient->listNetworkEndpoints( - $networkEndpointGroup, - $project - ); + $response = $globalNetworkEndpointGroupsClient->listNetworkEndpoints($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/GlobalOperationsClient/aggregated_list.php b/Compute/samples/V1/GlobalOperationsClient/aggregated_list.php index ebdb90167068..bb7e5571ebc6 100644 --- a/Compute/samples/V1/GlobalOperationsClient/aggregated_list.php +++ b/Compute/samples/V1/GlobalOperationsClient/aggregated_list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_GlobalOperations_AggregatedList_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\GlobalOperationsClient; +use Google\Cloud\Compute\V1\AggregatedListGlobalOperationsRequest; +use Google\Cloud\Compute\V1\Client\GlobalOperationsClient; /** * Retrieves an aggregated list of all operations. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. @@ -37,10 +38,14 @@ function aggregated_list_sample(string $project): void // Create a client. $globalOperationsClient = new GlobalOperationsClient(); + // Prepare the request message. + $request = (new AggregatedListGlobalOperationsRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $globalOperationsClient->aggregatedList($project); + $response = $globalOperationsClient->aggregatedList($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/GlobalOperationsClient/delete.php b/Compute/samples/V1/GlobalOperationsClient/delete.php index dd5116e43278..f050a90ed252 100644 --- a/Compute/samples/V1/GlobalOperationsClient/delete.php +++ b/Compute/samples/V1/GlobalOperationsClient/delete.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_GlobalOperations_Delete_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\GlobalOperationsClient; +use Google\Cloud\Compute\V1\DeleteGlobalOperationRequest; use Google\Cloud\Compute\V1\DeleteGlobalOperationResponse; -use Google\Cloud\Compute\V1\GlobalOperationsClient; /** * Deletes the specified Operations resource. @@ -38,10 +39,15 @@ function delete_sample(string $operation, string $project): void // Create a client. $globalOperationsClient = new GlobalOperationsClient(); + // Prepare the request message. + $request = (new DeleteGlobalOperationRequest()) + ->setOperation($operation) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var DeleteGlobalOperationResponse $response */ - $response = $globalOperationsClient->delete($operation, $project); + $response = $globalOperationsClient->delete($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/GlobalOperationsClient/get.php b/Compute/samples/V1/GlobalOperationsClient/get.php index 0e1932a36d11..e5457ef74ace 100644 --- a/Compute/samples/V1/GlobalOperationsClient/get.php +++ b/Compute/samples/V1/GlobalOperationsClient/get.php @@ -24,7 +24,8 @@ // [START compute_v1_generated_GlobalOperations_Get_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\GlobalOperationsClient; +use Google\Cloud\Compute\V1\Client\GlobalOperationsClient; +use Google\Cloud\Compute\V1\GetGlobalOperationRequest; use Google\Cloud\Compute\V1\Operation; /** @@ -38,10 +39,15 @@ function get_sample(string $operation, string $project): void // Create a client. $globalOperationsClient = new GlobalOperationsClient(); + // Prepare the request message. + $request = (new GetGlobalOperationRequest()) + ->setOperation($operation) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var Operation $response */ - $response = $globalOperationsClient->get($operation, $project); + $response = $globalOperationsClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/GlobalOperationsClient/list.php b/Compute/samples/V1/GlobalOperationsClient/list.php index 6fe4f3370401..7a9a0734d1bb 100644 --- a/Compute/samples/V1/GlobalOperationsClient/list.php +++ b/Compute/samples/V1/GlobalOperationsClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_GlobalOperations_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\GlobalOperationsClient; +use Google\Cloud\Compute\V1\Client\GlobalOperationsClient; +use Google\Cloud\Compute\V1\ListGlobalOperationsRequest; /** * Retrieves a list of Operation resources contained within the specified project. @@ -37,10 +38,14 @@ function list_sample(string $project): void // Create a client. $globalOperationsClient = new GlobalOperationsClient(); + // Prepare the request message. + $request = (new ListGlobalOperationsRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $globalOperationsClient->list($project); + $response = $globalOperationsClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/GlobalOperationsClient/wait.php b/Compute/samples/V1/GlobalOperationsClient/wait.php index e88cf06035ae..91649b5b597b 100644 --- a/Compute/samples/V1/GlobalOperationsClient/wait.php +++ b/Compute/samples/V1/GlobalOperationsClient/wait.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_GlobalOperations_Wait_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\GlobalOperationsClient; +use Google\Cloud\Compute\V1\Client\GlobalOperationsClient; use Google\Cloud\Compute\V1\Operation; +use Google\Cloud\Compute\V1\WaitGlobalOperationRequest; /** * Waits for the specified Operation resource to return as `DONE` or for the request to approach the 2 minute deadline, and retrieves the specified Operation resource. This method differs from the `GET` method in that it waits for no more than the default deadline (2 minutes) and then returns the current state of the operation, which might be `DONE` or still in progress. This method is called on a best-effort basis. Specifically: - In uncommon cases, when the server is overloaded, the request might return before the default deadline is reached, or might return after zero seconds. - If the default deadline is reached, there is no guarantee that the operation is actually done when the method returns. Be prepared to retry if the operation is not `DONE`. @@ -38,10 +39,15 @@ function wait_sample(string $operation, string $project): void // Create a client. $globalOperationsClient = new GlobalOperationsClient(); + // Prepare the request message. + $request = (new WaitGlobalOperationRequest()) + ->setOperation($operation) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var Operation $response */ - $response = $globalOperationsClient->wait($operation, $project); + $response = $globalOperationsClient->wait($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/GlobalOrganizationOperationsClient/delete.php b/Compute/samples/V1/GlobalOrganizationOperationsClient/delete.php index 09e886c3e585..5b35055f4369 100644 --- a/Compute/samples/V1/GlobalOrganizationOperationsClient/delete.php +++ b/Compute/samples/V1/GlobalOrganizationOperationsClient/delete.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_GlobalOrganizationOperations_Delete_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\GlobalOrganizationOperationsClient; +use Google\Cloud\Compute\V1\DeleteGlobalOrganizationOperationRequest; use Google\Cloud\Compute\V1\DeleteGlobalOrganizationOperationResponse; -use Google\Cloud\Compute\V1\GlobalOrganizationOperationsClient; /** * Deletes the specified Operations resource. @@ -37,10 +38,14 @@ function delete_sample(string $operation): void // Create a client. $globalOrganizationOperationsClient = new GlobalOrganizationOperationsClient(); + // Prepare the request message. + $request = (new DeleteGlobalOrganizationOperationRequest()) + ->setOperation($operation); + // Call the API and handle any network failures. try { /** @var DeleteGlobalOrganizationOperationResponse $response */ - $response = $globalOrganizationOperationsClient->delete($operation); + $response = $globalOrganizationOperationsClient->delete($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/GlobalOrganizationOperationsClient/get.php b/Compute/samples/V1/GlobalOrganizationOperationsClient/get.php index c7a1aa66d9f2..367a47760348 100644 --- a/Compute/samples/V1/GlobalOrganizationOperationsClient/get.php +++ b/Compute/samples/V1/GlobalOrganizationOperationsClient/get.php @@ -24,7 +24,8 @@ // [START compute_v1_generated_GlobalOrganizationOperations_Get_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\GlobalOrganizationOperationsClient; +use Google\Cloud\Compute\V1\Client\GlobalOrganizationOperationsClient; +use Google\Cloud\Compute\V1\GetGlobalOrganizationOperationRequest; use Google\Cloud\Compute\V1\Operation; /** @@ -37,10 +38,14 @@ function get_sample(string $operation): void // Create a client. $globalOrganizationOperationsClient = new GlobalOrganizationOperationsClient(); + // Prepare the request message. + $request = (new GetGlobalOrganizationOperationRequest()) + ->setOperation($operation); + // Call the API and handle any network failures. try { /** @var Operation $response */ - $response = $globalOrganizationOperationsClient->get($operation); + $response = $globalOrganizationOperationsClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/GlobalOrganizationOperationsClient/list.php b/Compute/samples/V1/GlobalOrganizationOperationsClient/list.php index 917d694859fe..12f455c1fe0b 100644 --- a/Compute/samples/V1/GlobalOrganizationOperationsClient/list.php +++ b/Compute/samples/V1/GlobalOrganizationOperationsClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_GlobalOrganizationOperations_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\GlobalOrganizationOperationsClient; +use Google\Cloud\Compute\V1\Client\GlobalOrganizationOperationsClient; +use Google\Cloud\Compute\V1\ListGlobalOrganizationOperationsRequest; /** * Retrieves a list of Operation resources contained within the specified organization. @@ -41,10 +42,13 @@ function list_sample(): void // Create a client. $globalOrganizationOperationsClient = new GlobalOrganizationOperationsClient(); + // Prepare the request message. + $request = new ListGlobalOrganizationOperationsRequest(); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $globalOrganizationOperationsClient->list(); + $response = $globalOrganizationOperationsClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/GlobalPublicDelegatedPrefixesClient/delete.php b/Compute/samples/V1/GlobalPublicDelegatedPrefixesClient/delete.php index 3b92b87b258c..054c5af4f51f 100644 --- a/Compute/samples/V1/GlobalPublicDelegatedPrefixesClient/delete.php +++ b/Compute/samples/V1/GlobalPublicDelegatedPrefixesClient/delete.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_GlobalPublicDelegatedPrefixes_Delete_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\GlobalPublicDelegatedPrefixesClient; +use Google\Cloud\Compute\V1\Client\GlobalPublicDelegatedPrefixesClient; +use Google\Cloud\Compute\V1\DeleteGlobalPublicDelegatedPrefixeRequest; use Google\Rpc\Status; /** @@ -39,10 +40,15 @@ function delete_sample(string $project, string $publicDelegatedPrefix): void // Create a client. $globalPublicDelegatedPrefixesClient = new GlobalPublicDelegatedPrefixesClient(); + // Prepare the request message. + $request = (new DeleteGlobalPublicDelegatedPrefixeRequest()) + ->setProject($project) + ->setPublicDelegatedPrefix($publicDelegatedPrefix); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $globalPublicDelegatedPrefixesClient->delete($project, $publicDelegatedPrefix); + $response = $globalPublicDelegatedPrefixesClient->delete($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/GlobalPublicDelegatedPrefixesClient/get.php b/Compute/samples/V1/GlobalPublicDelegatedPrefixesClient/get.php index f171fb068d6a..fe245565da26 100644 --- a/Compute/samples/V1/GlobalPublicDelegatedPrefixesClient/get.php +++ b/Compute/samples/V1/GlobalPublicDelegatedPrefixesClient/get.php @@ -24,7 +24,8 @@ // [START compute_v1_generated_GlobalPublicDelegatedPrefixes_Get_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\GlobalPublicDelegatedPrefixesClient; +use Google\Cloud\Compute\V1\Client\GlobalPublicDelegatedPrefixesClient; +use Google\Cloud\Compute\V1\GetGlobalPublicDelegatedPrefixeRequest; use Google\Cloud\Compute\V1\PublicDelegatedPrefix; /** @@ -38,10 +39,15 @@ function get_sample(string $project, string $publicDelegatedPrefix): void // Create a client. $globalPublicDelegatedPrefixesClient = new GlobalPublicDelegatedPrefixesClient(); + // Prepare the request message. + $request = (new GetGlobalPublicDelegatedPrefixeRequest()) + ->setProject($project) + ->setPublicDelegatedPrefix($publicDelegatedPrefix); + // Call the API and handle any network failures. try { /** @var PublicDelegatedPrefix $response */ - $response = $globalPublicDelegatedPrefixesClient->get($project, $publicDelegatedPrefix); + $response = $globalPublicDelegatedPrefixesClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/GlobalPublicDelegatedPrefixesClient/insert.php b/Compute/samples/V1/GlobalPublicDelegatedPrefixesClient/insert.php index 22e17eece728..f71db89998f2 100644 --- a/Compute/samples/V1/GlobalPublicDelegatedPrefixesClient/insert.php +++ b/Compute/samples/V1/GlobalPublicDelegatedPrefixesClient/insert.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_GlobalPublicDelegatedPrefixes_Insert_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\GlobalPublicDelegatedPrefixesClient; +use Google\Cloud\Compute\V1\Client\GlobalPublicDelegatedPrefixesClient; +use Google\Cloud\Compute\V1\InsertGlobalPublicDelegatedPrefixeRequest; use Google\Cloud\Compute\V1\PublicDelegatedPrefix; use Google\Rpc\Status; @@ -39,13 +40,16 @@ function insert_sample(string $project): void // Create a client. $globalPublicDelegatedPrefixesClient = new GlobalPublicDelegatedPrefixesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $publicDelegatedPrefixResource = new PublicDelegatedPrefix(); + $request = (new InsertGlobalPublicDelegatedPrefixeRequest()) + ->setProject($project) + ->setPublicDelegatedPrefixResource($publicDelegatedPrefixResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $globalPublicDelegatedPrefixesClient->insert($project, $publicDelegatedPrefixResource); + $response = $globalPublicDelegatedPrefixesClient->insert($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/GlobalPublicDelegatedPrefixesClient/list.php b/Compute/samples/V1/GlobalPublicDelegatedPrefixesClient/list.php index 58f8e4791d14..33b6ef21f918 100644 --- a/Compute/samples/V1/GlobalPublicDelegatedPrefixesClient/list.php +++ b/Compute/samples/V1/GlobalPublicDelegatedPrefixesClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_GlobalPublicDelegatedPrefixes_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\GlobalPublicDelegatedPrefixesClient; +use Google\Cloud\Compute\V1\Client\GlobalPublicDelegatedPrefixesClient; +use Google\Cloud\Compute\V1\ListGlobalPublicDelegatedPrefixesRequest; /** * Lists the global PublicDelegatedPrefixes for a project. @@ -37,10 +38,14 @@ function list_sample(string $project): void // Create a client. $globalPublicDelegatedPrefixesClient = new GlobalPublicDelegatedPrefixesClient(); + // Prepare the request message. + $request = (new ListGlobalPublicDelegatedPrefixesRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $globalPublicDelegatedPrefixesClient->list($project); + $response = $globalPublicDelegatedPrefixesClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/GlobalPublicDelegatedPrefixesClient/patch.php b/Compute/samples/V1/GlobalPublicDelegatedPrefixesClient/patch.php index 1d1682cf67d1..43fbc5429a85 100644 --- a/Compute/samples/V1/GlobalPublicDelegatedPrefixesClient/patch.php +++ b/Compute/samples/V1/GlobalPublicDelegatedPrefixesClient/patch.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_GlobalPublicDelegatedPrefixes_Patch_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\GlobalPublicDelegatedPrefixesClient; +use Google\Cloud\Compute\V1\Client\GlobalPublicDelegatedPrefixesClient; +use Google\Cloud\Compute\V1\PatchGlobalPublicDelegatedPrefixeRequest; use Google\Cloud\Compute\V1\PublicDelegatedPrefix; use Google\Rpc\Status; @@ -40,17 +41,17 @@ function patch_sample(string $project, string $publicDelegatedPrefix): void // Create a client. $globalPublicDelegatedPrefixesClient = new GlobalPublicDelegatedPrefixesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $publicDelegatedPrefixResource = new PublicDelegatedPrefix(); + $request = (new PatchGlobalPublicDelegatedPrefixeRequest()) + ->setProject($project) + ->setPublicDelegatedPrefix($publicDelegatedPrefix) + ->setPublicDelegatedPrefixResource($publicDelegatedPrefixResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $globalPublicDelegatedPrefixesClient->patch( - $project, - $publicDelegatedPrefix, - $publicDelegatedPrefixResource - ); + $response = $globalPublicDelegatedPrefixesClient->patch($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/HealthChecksClient/aggregated_list.php b/Compute/samples/V1/HealthChecksClient/aggregated_list.php index c0a371e9c695..b3bcb6b05294 100644 --- a/Compute/samples/V1/HealthChecksClient/aggregated_list.php +++ b/Compute/samples/V1/HealthChecksClient/aggregated_list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_HealthChecks_AggregatedList_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\HealthChecksClient; +use Google\Cloud\Compute\V1\AggregatedListHealthChecksRequest; +use Google\Cloud\Compute\V1\Client\HealthChecksClient; /** * 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`. @@ -37,10 +38,14 @@ function aggregated_list_sample(string $project): void // Create a client. $healthChecksClient = new HealthChecksClient(); + // Prepare the request message. + $request = (new AggregatedListHealthChecksRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $healthChecksClient->aggregatedList($project); + $response = $healthChecksClient->aggregatedList($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/HealthChecksClient/delete.php b/Compute/samples/V1/HealthChecksClient/delete.php index 89641002a2f5..d2f6e0f7cb64 100644 --- a/Compute/samples/V1/HealthChecksClient/delete.php +++ b/Compute/samples/V1/HealthChecksClient/delete.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_HealthChecks_Delete_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\HealthChecksClient; +use Google\Cloud\Compute\V1\Client\HealthChecksClient; +use Google\Cloud\Compute\V1\DeleteHealthCheckRequest; use Google\Rpc\Status; /** @@ -39,10 +40,15 @@ function delete_sample(string $healthCheck, string $project): void // Create a client. $healthChecksClient = new HealthChecksClient(); + // Prepare the request message. + $request = (new DeleteHealthCheckRequest()) + ->setHealthCheck($healthCheck) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $healthChecksClient->delete($healthCheck, $project); + $response = $healthChecksClient->delete($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/HealthChecksClient/get.php b/Compute/samples/V1/HealthChecksClient/get.php index 2d05ed1b0340..ec161ac6300d 100644 --- a/Compute/samples/V1/HealthChecksClient/get.php +++ b/Compute/samples/V1/HealthChecksClient/get.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_HealthChecks_Get_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\HealthChecksClient; +use Google\Cloud\Compute\V1\GetHealthCheckRequest; use Google\Cloud\Compute\V1\HealthCheck; -use Google\Cloud\Compute\V1\HealthChecksClient; /** * Returns the specified HealthCheck resource. @@ -38,10 +39,15 @@ function get_sample(string $healthCheck, string $project): void // Create a client. $healthChecksClient = new HealthChecksClient(); + // Prepare the request message. + $request = (new GetHealthCheckRequest()) + ->setHealthCheck($healthCheck) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var HealthCheck $response */ - $response = $healthChecksClient->get($healthCheck, $project); + $response = $healthChecksClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/HealthChecksClient/insert.php b/Compute/samples/V1/HealthChecksClient/insert.php index 7e5e10d69249..3268073f5d30 100644 --- a/Compute/samples/V1/HealthChecksClient/insert.php +++ b/Compute/samples/V1/HealthChecksClient/insert.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_HealthChecks_Insert_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\HealthChecksClient; use Google\Cloud\Compute\V1\HealthCheck; -use Google\Cloud\Compute\V1\HealthChecksClient; +use Google\Cloud\Compute\V1\InsertHealthCheckRequest; use Google\Rpc\Status; /** @@ -39,13 +40,16 @@ function insert_sample(string $project): void // Create a client. $healthChecksClient = new HealthChecksClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $healthCheckResource = new HealthCheck(); + $request = (new InsertHealthCheckRequest()) + ->setHealthCheckResource($healthCheckResource) + ->setProject($project); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $healthChecksClient->insert($healthCheckResource, $project); + $response = $healthChecksClient->insert($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/HealthChecksClient/list.php b/Compute/samples/V1/HealthChecksClient/list.php index 889a4407f272..2ea43b6cafb4 100644 --- a/Compute/samples/V1/HealthChecksClient/list.php +++ b/Compute/samples/V1/HealthChecksClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_HealthChecks_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\HealthChecksClient; +use Google\Cloud\Compute\V1\Client\HealthChecksClient; +use Google\Cloud\Compute\V1\ListHealthChecksRequest; /** * Retrieves the list of HealthCheck resources available to the specified project. @@ -37,10 +38,14 @@ function list_sample(string $project): void // Create a client. $healthChecksClient = new HealthChecksClient(); + // Prepare the request message. + $request = (new ListHealthChecksRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $healthChecksClient->list($project); + $response = $healthChecksClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/HealthChecksClient/patch.php b/Compute/samples/V1/HealthChecksClient/patch.php index 15e250cdf265..f69c8ea66958 100644 --- a/Compute/samples/V1/HealthChecksClient/patch.php +++ b/Compute/samples/V1/HealthChecksClient/patch.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_HealthChecks_Patch_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\HealthChecksClient; use Google\Cloud\Compute\V1\HealthCheck; -use Google\Cloud\Compute\V1\HealthChecksClient; +use Google\Cloud\Compute\V1\PatchHealthCheckRequest; use Google\Rpc\Status; /** @@ -40,13 +41,17 @@ function patch_sample(string $healthCheck, string $project): void // Create a client. $healthChecksClient = new HealthChecksClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $healthCheckResource = new HealthCheck(); + $request = (new PatchHealthCheckRequest()) + ->setHealthCheck($healthCheck) + ->setHealthCheckResource($healthCheckResource) + ->setProject($project); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $healthChecksClient->patch($healthCheck, $healthCheckResource, $project); + $response = $healthChecksClient->patch($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/HealthChecksClient/update.php b/Compute/samples/V1/HealthChecksClient/update.php index 91a98900f49c..696241283ebd 100644 --- a/Compute/samples/V1/HealthChecksClient/update.php +++ b/Compute/samples/V1/HealthChecksClient/update.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_HealthChecks_Update_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\HealthChecksClient; use Google\Cloud\Compute\V1\HealthCheck; -use Google\Cloud\Compute\V1\HealthChecksClient; +use Google\Cloud\Compute\V1\UpdateHealthCheckRequest; use Google\Rpc\Status; /** @@ -40,13 +41,17 @@ function update_sample(string $healthCheck, string $project): void // Create a client. $healthChecksClient = new HealthChecksClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $healthCheckResource = new HealthCheck(); + $request = (new UpdateHealthCheckRequest()) + ->setHealthCheck($healthCheck) + ->setHealthCheckResource($healthCheckResource) + ->setProject($project); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $healthChecksClient->update($healthCheck, $healthCheckResource, $project); + $response = $healthChecksClient->update($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/ImageFamilyViewsClient/get.php b/Compute/samples/V1/ImageFamilyViewsClient/get.php index bfb9c87fe6af..1ecc28fb8c4d 100644 --- a/Compute/samples/V1/ImageFamilyViewsClient/get.php +++ b/Compute/samples/V1/ImageFamilyViewsClient/get.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_ImageFamilyViews_Get_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\ImageFamilyViewsClient; +use Google\Cloud\Compute\V1\GetImageFamilyViewRequest; use Google\Cloud\Compute\V1\ImageFamilyView; -use Google\Cloud\Compute\V1\ImageFamilyViewsClient; /** * Returns the latest image that is part of an image family, is not deprecated and is rolled out in the specified zone. @@ -39,10 +40,16 @@ function get_sample(string $family, string $project, string $zone): void // Create a client. $imageFamilyViewsClient = new ImageFamilyViewsClient(); + // Prepare the request message. + $request = (new GetImageFamilyViewRequest()) + ->setFamily($family) + ->setProject($project) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var ImageFamilyView $response */ - $response = $imageFamilyViewsClient->get($family, $project, $zone); + $response = $imageFamilyViewsClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/ImagesClient/delete.php b/Compute/samples/V1/ImagesClient/delete.php index 21514b9c5a40..9b4e71a5e557 100644 --- a/Compute/samples/V1/ImagesClient/delete.php +++ b/Compute/samples/V1/ImagesClient/delete.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_Images_Delete_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\ImagesClient; +use Google\Cloud\Compute\V1\Client\ImagesClient; +use Google\Cloud\Compute\V1\DeleteImageRequest; use Google\Rpc\Status; /** @@ -39,10 +40,15 @@ function delete_sample(string $image, string $project): void // Create a client. $imagesClient = new ImagesClient(); + // Prepare the request message. + $request = (new DeleteImageRequest()) + ->setImage($image) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $imagesClient->delete($image, $project); + $response = $imagesClient->delete($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/ImagesClient/deprecate.php b/Compute/samples/V1/ImagesClient/deprecate.php index e95cd7740fb8..8de1133cd862 100644 --- a/Compute/samples/V1/ImagesClient/deprecate.php +++ b/Compute/samples/V1/ImagesClient/deprecate.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_Images_Deprecate_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\ImagesClient; +use Google\Cloud\Compute\V1\DeprecateImageRequest; use Google\Cloud\Compute\V1\DeprecationStatus; -use Google\Cloud\Compute\V1\ImagesClient; use Google\Rpc\Status; /** @@ -40,13 +41,17 @@ function deprecate_sample(string $image, string $project): void // Create a client. $imagesClient = new ImagesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $deprecationStatusResource = new DeprecationStatus(); + $request = (new DeprecateImageRequest()) + ->setDeprecationStatusResource($deprecationStatusResource) + ->setImage($image) + ->setProject($project); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $imagesClient->deprecate($deprecationStatusResource, $image, $project); + $response = $imagesClient->deprecate($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/ImagesClient/get.php b/Compute/samples/V1/ImagesClient/get.php index 1b0efb3e115d..99e78a83279c 100644 --- a/Compute/samples/V1/ImagesClient/get.php +++ b/Compute/samples/V1/ImagesClient/get.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_Images_Get_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\ImagesClient; +use Google\Cloud\Compute\V1\GetImageRequest; use Google\Cloud\Compute\V1\Image; -use Google\Cloud\Compute\V1\ImagesClient; /** * Returns the specified image. @@ -38,10 +39,15 @@ function get_sample(string $image, string $project): void // Create a client. $imagesClient = new ImagesClient(); + // Prepare the request message. + $request = (new GetImageRequest()) + ->setImage($image) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var Image $response */ - $response = $imagesClient->get($image, $project); + $response = $imagesClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/ImagesClient/get_from_family.php b/Compute/samples/V1/ImagesClient/get_from_family.php index 1f46c7dd33af..836ae3086fbe 100644 --- a/Compute/samples/V1/ImagesClient/get_from_family.php +++ b/Compute/samples/V1/ImagesClient/get_from_family.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_Images_GetFromFamily_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\ImagesClient; +use Google\Cloud\Compute\V1\GetFromFamilyImageRequest; use Google\Cloud\Compute\V1\Image; -use Google\Cloud\Compute\V1\ImagesClient; /** * Returns the latest image that is part of an image family and is not deprecated. For more information on image families, see Public image families documentation. @@ -38,10 +39,15 @@ function get_from_family_sample(string $family, string $project): void // Create a client. $imagesClient = new ImagesClient(); + // Prepare the request message. + $request = (new GetFromFamilyImageRequest()) + ->setFamily($family) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var Image $response */ - $response = $imagesClient->getFromFamily($family, $project); + $response = $imagesClient->getFromFamily($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/ImagesClient/get_iam_policy.php b/Compute/samples/V1/ImagesClient/get_iam_policy.php index e29d418ae02c..d8211d42646c 100644 --- a/Compute/samples/V1/ImagesClient/get_iam_policy.php +++ b/Compute/samples/V1/ImagesClient/get_iam_policy.php @@ -24,7 +24,8 @@ // [START compute_v1_generated_Images_GetIamPolicy_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\ImagesClient; +use Google\Cloud\Compute\V1\Client\ImagesClient; +use Google\Cloud\Compute\V1\GetIamPolicyImageRequest; use Google\Cloud\Compute\V1\Policy; /** @@ -38,10 +39,15 @@ function get_iam_policy_sample(string $project, string $resource): void // Create a client. $imagesClient = new ImagesClient(); + // Prepare the request message. + $request = (new GetIamPolicyImageRequest()) + ->setProject($project) + ->setResource($resource); + // Call the API and handle any network failures. try { /** @var Policy $response */ - $response = $imagesClient->getIamPolicy($project, $resource); + $response = $imagesClient->getIamPolicy($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/ImagesClient/insert.php b/Compute/samples/V1/ImagesClient/insert.php index 464abd3a3719..26e49a978b7d 100644 --- a/Compute/samples/V1/ImagesClient/insert.php +++ b/Compute/samples/V1/ImagesClient/insert.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_Images_Insert_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\ImagesClient; use Google\Cloud\Compute\V1\Image; -use Google\Cloud\Compute\V1\ImagesClient; +use Google\Cloud\Compute\V1\InsertImageRequest; use Google\Rpc\Status; /** @@ -39,13 +40,16 @@ function insert_sample(string $project): void // Create a client. $imagesClient = new ImagesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $imageResource = new Image(); + $request = (new InsertImageRequest()) + ->setImageResource($imageResource) + ->setProject($project); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $imagesClient->insert($imageResource, $project); + $response = $imagesClient->insert($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/ImagesClient/list.php b/Compute/samples/V1/ImagesClient/list.php index 7a674bc52290..5322b4e2b3f7 100644 --- a/Compute/samples/V1/ImagesClient/list.php +++ b/Compute/samples/V1/ImagesClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_Images_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\ImagesClient; +use Google\Cloud\Compute\V1\Client\ImagesClient; +use Google\Cloud\Compute\V1\ListImagesRequest; /** * Retrieves the list of custom images available to the specified project. Custom images are images you create that belong to your project. This method does not get any images that belong to other projects, including publicly-available images, like Debian 8. If you want to get a list of publicly-available images, use this method to make a request to the respective image project, such as debian-cloud or windows-cloud. @@ -37,10 +38,14 @@ function list_sample(string $project): void // Create a client. $imagesClient = new ImagesClient(); + // Prepare the request message. + $request = (new ListImagesRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $imagesClient->list($project); + $response = $imagesClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/ImagesClient/patch.php b/Compute/samples/V1/ImagesClient/patch.php index 2d8dde68ab8f..f91bb8493b85 100644 --- a/Compute/samples/V1/ImagesClient/patch.php +++ b/Compute/samples/V1/ImagesClient/patch.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_Images_Patch_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\ImagesClient; use Google\Cloud\Compute\V1\Image; -use Google\Cloud\Compute\V1\ImagesClient; +use Google\Cloud\Compute\V1\PatchImageRequest; use Google\Rpc\Status; /** @@ -40,13 +41,17 @@ function patch_sample(string $image, string $project): void // Create a client. $imagesClient = new ImagesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $imageResource = new Image(); + $request = (new PatchImageRequest()) + ->setImage($image) + ->setImageResource($imageResource) + ->setProject($project); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $imagesClient->patch($image, $imageResource, $project); + $response = $imagesClient->patch($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/ImagesClient/set_iam_policy.php b/Compute/samples/V1/ImagesClient/set_iam_policy.php index 46f3b0a9fa5b..6c6c5899dbaf 100644 --- a/Compute/samples/V1/ImagesClient/set_iam_policy.php +++ b/Compute/samples/V1/ImagesClient/set_iam_policy.php @@ -24,9 +24,10 @@ // [START compute_v1_generated_Images_SetIamPolicy_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\ImagesClient; use Google\Cloud\Compute\V1\GlobalSetPolicyRequest; -use Google\Cloud\Compute\V1\ImagesClient; use Google\Cloud\Compute\V1\Policy; +use Google\Cloud\Compute\V1\SetIamPolicyImageRequest; /** * Sets the access control policy on the specified resource. Replaces any existing policy. @@ -39,13 +40,17 @@ function set_iam_policy_sample(string $project, string $resource): void // Create a client. $imagesClient = new ImagesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $globalSetPolicyRequestResource = new GlobalSetPolicyRequest(); + $request = (new SetIamPolicyImageRequest()) + ->setGlobalSetPolicyRequestResource($globalSetPolicyRequestResource) + ->setProject($project) + ->setResource($resource); // Call the API and handle any network failures. try { /** @var Policy $response */ - $response = $imagesClient->setIamPolicy($globalSetPolicyRequestResource, $project, $resource); + $response = $imagesClient->setIamPolicy($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/ImagesClient/set_labels.php b/Compute/samples/V1/ImagesClient/set_labels.php index 12db18b8de2b..135dde1da21a 100644 --- a/Compute/samples/V1/ImagesClient/set_labels.php +++ b/Compute/samples/V1/ImagesClient/set_labels.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_Images_SetLabels_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\ImagesClient; use Google\Cloud\Compute\V1\GlobalSetLabelsRequest; -use Google\Cloud\Compute\V1\ImagesClient; +use Google\Cloud\Compute\V1\SetLabelsImageRequest; use Google\Rpc\Status; /** @@ -40,13 +41,17 @@ function set_labels_sample(string $project, string $resource): void // Create a client. $imagesClient = new ImagesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $globalSetLabelsRequestResource = new GlobalSetLabelsRequest(); + $request = (new SetLabelsImageRequest()) + ->setGlobalSetLabelsRequestResource($globalSetLabelsRequestResource) + ->setProject($project) + ->setResource($resource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $imagesClient->setLabels($globalSetLabelsRequestResource, $project, $resource); + $response = $imagesClient->setLabels($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/ImagesClient/test_iam_permissions.php b/Compute/samples/V1/ImagesClient/test_iam_permissions.php index 2899043944e0..e8ffae0efadb 100644 --- a/Compute/samples/V1/ImagesClient/test_iam_permissions.php +++ b/Compute/samples/V1/ImagesClient/test_iam_permissions.php @@ -24,7 +24,8 @@ // [START compute_v1_generated_Images_TestIamPermissions_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\ImagesClient; +use Google\Cloud\Compute\V1\Client\ImagesClient; +use Google\Cloud\Compute\V1\TestIamPermissionsImageRequest; use Google\Cloud\Compute\V1\TestPermissionsRequest; use Google\Cloud\Compute\V1\TestPermissionsResponse; @@ -39,13 +40,17 @@ function test_iam_permissions_sample(string $project, string $resource): void // Create a client. $imagesClient = new ImagesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $testPermissionsRequestResource = new TestPermissionsRequest(); + $request = (new TestIamPermissionsImageRequest()) + ->setProject($project) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); // Call the API and handle any network failures. try { /** @var TestPermissionsResponse $response */ - $response = $imagesClient->testIamPermissions($project, $resource, $testPermissionsRequestResource); + $response = $imagesClient->testIamPermissions($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/InstanceGroupManagerResizeRequestsClient/cancel.php b/Compute/samples/V1/InstanceGroupManagerResizeRequestsClient/cancel.php index 3646ae02c227..1d9e3eaacf04 100644 --- a/Compute/samples/V1/InstanceGroupManagerResizeRequestsClient/cancel.php +++ b/Compute/samples/V1/InstanceGroupManagerResizeRequestsClient/cancel.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_InstanceGroupManagerResizeRequests_Cancel_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\InstanceGroupManagerResizeRequestsClient; +use Google\Cloud\Compute\V1\CancelInstanceGroupManagerResizeRequestRequest; +use Google\Cloud\Compute\V1\Client\InstanceGroupManagerResizeRequestsClient; use Google\Rpc\Status; /** @@ -45,15 +46,17 @@ function cancel_sample( // Create a client. $instanceGroupManagerResizeRequestsClient = new InstanceGroupManagerResizeRequestsClient(); + // Prepare the request message. + $request = (new CancelInstanceGroupManagerResizeRequestRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setResizeRequest($resizeRequest) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $instanceGroupManagerResizeRequestsClient->cancel( - $instanceGroupManager, - $project, - $resizeRequest, - $zone - ); + $response = $instanceGroupManagerResizeRequestsClient->cancel($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/InstanceGroupManagerResizeRequestsClient/delete.php b/Compute/samples/V1/InstanceGroupManagerResizeRequestsClient/delete.php index 2a37cc86ce28..90fd57d0b7cd 100644 --- a/Compute/samples/V1/InstanceGroupManagerResizeRequestsClient/delete.php +++ b/Compute/samples/V1/InstanceGroupManagerResizeRequestsClient/delete.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_InstanceGroupManagerResizeRequests_Delete_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\InstanceGroupManagerResizeRequestsClient; +use Google\Cloud\Compute\V1\Client\InstanceGroupManagerResizeRequestsClient; +use Google\Cloud\Compute\V1\DeleteInstanceGroupManagerResizeRequestRequest; use Google\Rpc\Status; /** @@ -45,15 +46,17 @@ function delete_sample( // Create a client. $instanceGroupManagerResizeRequestsClient = new InstanceGroupManagerResizeRequestsClient(); + // Prepare the request message. + $request = (new DeleteInstanceGroupManagerResizeRequestRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setResizeRequest($resizeRequest) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $instanceGroupManagerResizeRequestsClient->delete( - $instanceGroupManager, - $project, - $resizeRequest, - $zone - ); + $response = $instanceGroupManagerResizeRequestsClient->delete($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/InstanceGroupManagerResizeRequestsClient/get.php b/Compute/samples/V1/InstanceGroupManagerResizeRequestsClient/get.php index eb562b7b4435..aaef1d3a7b86 100644 --- a/Compute/samples/V1/InstanceGroupManagerResizeRequestsClient/get.php +++ b/Compute/samples/V1/InstanceGroupManagerResizeRequestsClient/get.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_InstanceGroupManagerResizeRequests_Get_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\InstanceGroupManagerResizeRequestsClient; +use Google\Cloud\Compute\V1\GetInstanceGroupManagerResizeRequestRequest; use Google\Cloud\Compute\V1\InstanceGroupManagerResizeRequest; -use Google\Cloud\Compute\V1\InstanceGroupManagerResizeRequestsClient; /** * Returns all of the details about the specified resize request. @@ -44,15 +45,17 @@ function get_sample( // Create a client. $instanceGroupManagerResizeRequestsClient = new InstanceGroupManagerResizeRequestsClient(); + // Prepare the request message. + $request = (new GetInstanceGroupManagerResizeRequestRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setResizeRequest($resizeRequest) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var InstanceGroupManagerResizeRequest $response */ - $response = $instanceGroupManagerResizeRequestsClient->get( - $instanceGroupManager, - $project, - $resizeRequest, - $zone - ); + $response = $instanceGroupManagerResizeRequestsClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/InstanceGroupManagerResizeRequestsClient/insert.php b/Compute/samples/V1/InstanceGroupManagerResizeRequestsClient/insert.php index f02c8379c094..8afa90b62f53 100644 --- a/Compute/samples/V1/InstanceGroupManagerResizeRequestsClient/insert.php +++ b/Compute/samples/V1/InstanceGroupManagerResizeRequestsClient/insert.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_InstanceGroupManagerResizeRequests_Insert_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\InstanceGroupManagerResizeRequestsClient; +use Google\Cloud\Compute\V1\InsertInstanceGroupManagerResizeRequestRequest; use Google\Cloud\Compute\V1\InstanceGroupManagerResizeRequest; -use Google\Cloud\Compute\V1\InstanceGroupManagerResizeRequestsClient; use Google\Rpc\Status; /** @@ -41,18 +42,18 @@ function insert_sample(string $instanceGroupManager, string $project, string $zo // Create a client. $instanceGroupManagerResizeRequestsClient = new InstanceGroupManagerResizeRequestsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $instanceGroupManagerResizeRequestResource = new InstanceGroupManagerResizeRequest(); + $request = (new InsertInstanceGroupManagerResizeRequestRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagerResizeRequestResource($instanceGroupManagerResizeRequestResource) + ->setProject($project) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $instanceGroupManagerResizeRequestsClient->insert( - $instanceGroupManager, - $instanceGroupManagerResizeRequestResource, - $project, - $zone - ); + $response = $instanceGroupManagerResizeRequestsClient->insert($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/InstanceGroupManagerResizeRequestsClient/list.php b/Compute/samples/V1/InstanceGroupManagerResizeRequestsClient/list.php index a9583e0f1fee..a51e47b7168d 100644 --- a/Compute/samples/V1/InstanceGroupManagerResizeRequestsClient/list.php +++ b/Compute/samples/V1/InstanceGroupManagerResizeRequestsClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_InstanceGroupManagerResizeRequests_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\InstanceGroupManagerResizeRequestsClient; +use Google\Cloud\Compute\V1\Client\InstanceGroupManagerResizeRequestsClient; +use Google\Cloud\Compute\V1\ListInstanceGroupManagerResizeRequestsRequest; /** * Retrieves a list of resize requests that are contained in the managed instance group. @@ -39,10 +40,16 @@ function list_sample(string $instanceGroupManager, string $project, string $zone // Create a client. $instanceGroupManagerResizeRequestsClient = new InstanceGroupManagerResizeRequestsClient(); + // Prepare the request message. + $request = (new ListInstanceGroupManagerResizeRequestsRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $instanceGroupManagerResizeRequestsClient->list($instanceGroupManager, $project, $zone); + $response = $instanceGroupManagerResizeRequestsClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/InstanceGroupManagersClient/abandon_instances.php b/Compute/samples/V1/InstanceGroupManagersClient/abandon_instances.php index 8405e46eef5f..e35b67df9b6d 100644 --- a/Compute/samples/V1/InstanceGroupManagersClient/abandon_instances.php +++ b/Compute/samples/V1/InstanceGroupManagersClient/abandon_instances.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_InstanceGroupManagers_AbandonInstances_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\AbandonInstancesInstanceGroupManagerRequest; +use Google\Cloud\Compute\V1\Client\InstanceGroupManagersClient; use Google\Cloud\Compute\V1\InstanceGroupManagersAbandonInstancesRequest; -use Google\Cloud\Compute\V1\InstanceGroupManagersClient; use Google\Rpc\Status; /** @@ -44,18 +45,20 @@ function abandon_instances_sample( // Create a client. $instanceGroupManagersClient = new InstanceGroupManagersClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $instanceGroupManagersAbandonInstancesRequestResource = new InstanceGroupManagersAbandonInstancesRequest(); + $request = (new AbandonInstancesInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagersAbandonInstancesRequestResource( + $instanceGroupManagersAbandonInstancesRequestResource + ) + ->setProject($project) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $instanceGroupManagersClient->abandonInstances( - $instanceGroupManager, - $instanceGroupManagersAbandonInstancesRequestResource, - $project, - $zone - ); + $response = $instanceGroupManagersClient->abandonInstances($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/InstanceGroupManagersClient/aggregated_list.php b/Compute/samples/V1/InstanceGroupManagersClient/aggregated_list.php index 16fb5555deca..2777d7353c80 100644 --- a/Compute/samples/V1/InstanceGroupManagersClient/aggregated_list.php +++ b/Compute/samples/V1/InstanceGroupManagersClient/aggregated_list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_InstanceGroupManagers_AggregatedList_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\InstanceGroupManagersClient; +use Google\Cloud\Compute\V1\AggregatedListInstanceGroupManagersRequest; +use Google\Cloud\Compute\V1\Client\InstanceGroupManagersClient; /** * 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`. @@ -37,10 +38,14 @@ function aggregated_list_sample(string $project): void // Create a client. $instanceGroupManagersClient = new InstanceGroupManagersClient(); + // Prepare the request message. + $request = (new AggregatedListInstanceGroupManagersRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $instanceGroupManagersClient->aggregatedList($project); + $response = $instanceGroupManagersClient->aggregatedList($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/InstanceGroupManagersClient/apply_updates_to_instances.php b/Compute/samples/V1/InstanceGroupManagersClient/apply_updates_to_instances.php index cbd7b0b91e4e..3294e4f41555 100644 --- a/Compute/samples/V1/InstanceGroupManagersClient/apply_updates_to_instances.php +++ b/Compute/samples/V1/InstanceGroupManagersClient/apply_updates_to_instances.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_InstanceGroupManagers_ApplyUpdatesToInstances_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\ApplyUpdatesToInstancesInstanceGroupManagerRequest; +use Google\Cloud\Compute\V1\Client\InstanceGroupManagersClient; use Google\Cloud\Compute\V1\InstanceGroupManagersApplyUpdatesRequest; -use Google\Cloud\Compute\V1\InstanceGroupManagersClient; use Google\Rpc\Status; /** @@ -44,18 +45,20 @@ function apply_updates_to_instances_sample( // Create a client. $instanceGroupManagersClient = new InstanceGroupManagersClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $instanceGroupManagersApplyUpdatesRequestResource = new InstanceGroupManagersApplyUpdatesRequest(); + $request = (new ApplyUpdatesToInstancesInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagersApplyUpdatesRequestResource( + $instanceGroupManagersApplyUpdatesRequestResource + ) + ->setProject($project) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $instanceGroupManagersClient->applyUpdatesToInstances( - $instanceGroupManager, - $instanceGroupManagersApplyUpdatesRequestResource, - $project, - $zone - ); + $response = $instanceGroupManagersClient->applyUpdatesToInstances($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/InstanceGroupManagersClient/create_instances.php b/Compute/samples/V1/InstanceGroupManagersClient/create_instances.php index 9ce27ecd7a48..974a320b9ffe 100644 --- a/Compute/samples/V1/InstanceGroupManagersClient/create_instances.php +++ b/Compute/samples/V1/InstanceGroupManagersClient/create_instances.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_InstanceGroupManagers_CreateInstances_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\InstanceGroupManagersClient; +use Google\Cloud\Compute\V1\Client\InstanceGroupManagersClient; +use Google\Cloud\Compute\V1\CreateInstancesInstanceGroupManagerRequest; use Google\Cloud\Compute\V1\InstanceGroupManagersCreateInstancesRequest; use Google\Rpc\Status; @@ -44,18 +45,20 @@ function create_instances_sample( // Create a client. $instanceGroupManagersClient = new InstanceGroupManagersClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $instanceGroupManagersCreateInstancesRequestResource = new InstanceGroupManagersCreateInstancesRequest(); + $request = (new CreateInstancesInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagersCreateInstancesRequestResource( + $instanceGroupManagersCreateInstancesRequestResource + ) + ->setProject($project) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $instanceGroupManagersClient->createInstances( - $instanceGroupManager, - $instanceGroupManagersCreateInstancesRequestResource, - $project, - $zone - ); + $response = $instanceGroupManagersClient->createInstances($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/InstanceGroupManagersClient/delete.php b/Compute/samples/V1/InstanceGroupManagersClient/delete.php index 8cc2ddaab064..c5832e2143fa 100644 --- a/Compute/samples/V1/InstanceGroupManagersClient/delete.php +++ b/Compute/samples/V1/InstanceGroupManagersClient/delete.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_InstanceGroupManagers_Delete_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\InstanceGroupManagersClient; +use Google\Cloud\Compute\V1\Client\InstanceGroupManagersClient; +use Google\Cloud\Compute\V1\DeleteInstanceGroupManagerRequest; use Google\Rpc\Status; /** @@ -40,10 +41,16 @@ function delete_sample(string $instanceGroupManager, string $project, string $zo // Create a client. $instanceGroupManagersClient = new InstanceGroupManagersClient(); + // Prepare the request message. + $request = (new DeleteInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $instanceGroupManagersClient->delete($instanceGroupManager, $project, $zone); + $response = $instanceGroupManagersClient->delete($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/InstanceGroupManagersClient/delete_instances.php b/Compute/samples/V1/InstanceGroupManagersClient/delete_instances.php index 1640d07084d3..90152d7238e8 100644 --- a/Compute/samples/V1/InstanceGroupManagersClient/delete_instances.php +++ b/Compute/samples/V1/InstanceGroupManagersClient/delete_instances.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_InstanceGroupManagers_DeleteInstances_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\InstanceGroupManagersClient; +use Google\Cloud\Compute\V1\Client\InstanceGroupManagersClient; +use Google\Cloud\Compute\V1\DeleteInstancesInstanceGroupManagerRequest; use Google\Cloud\Compute\V1\InstanceGroupManagersDeleteInstancesRequest; use Google\Rpc\Status; @@ -44,18 +45,20 @@ function delete_instances_sample( // Create a client. $instanceGroupManagersClient = new InstanceGroupManagersClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $instanceGroupManagersDeleteInstancesRequestResource = new InstanceGroupManagersDeleteInstancesRequest(); + $request = (new DeleteInstancesInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagersDeleteInstancesRequestResource( + $instanceGroupManagersDeleteInstancesRequestResource + ) + ->setProject($project) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $instanceGroupManagersClient->deleteInstances( - $instanceGroupManager, - $instanceGroupManagersDeleteInstancesRequestResource, - $project, - $zone - ); + $response = $instanceGroupManagersClient->deleteInstances($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/InstanceGroupManagersClient/delete_per_instance_configs.php b/Compute/samples/V1/InstanceGroupManagersClient/delete_per_instance_configs.php index c5185028ccd2..a5e1ca5d809f 100644 --- a/Compute/samples/V1/InstanceGroupManagersClient/delete_per_instance_configs.php +++ b/Compute/samples/V1/InstanceGroupManagersClient/delete_per_instance_configs.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_InstanceGroupManagers_DeletePerInstanceConfigs_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\InstanceGroupManagersClient; +use Google\Cloud\Compute\V1\Client\InstanceGroupManagersClient; +use Google\Cloud\Compute\V1\DeletePerInstanceConfigsInstanceGroupManagerRequest; use Google\Cloud\Compute\V1\InstanceGroupManagersDeletePerInstanceConfigsReq; use Google\Rpc\Status; @@ -44,18 +45,20 @@ function delete_per_instance_configs_sample( // Create a client. $instanceGroupManagersClient = new InstanceGroupManagersClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $instanceGroupManagersDeletePerInstanceConfigsReqResource = new InstanceGroupManagersDeletePerInstanceConfigsReq(); + $request = (new DeletePerInstanceConfigsInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagersDeletePerInstanceConfigsReqResource( + $instanceGroupManagersDeletePerInstanceConfigsReqResource + ) + ->setProject($project) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $instanceGroupManagersClient->deletePerInstanceConfigs( - $instanceGroupManager, - $instanceGroupManagersDeletePerInstanceConfigsReqResource, - $project, - $zone - ); + $response = $instanceGroupManagersClient->deletePerInstanceConfigs($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/InstanceGroupManagersClient/get.php b/Compute/samples/V1/InstanceGroupManagersClient/get.php index 9ad469e4c522..ca8c59b49e06 100644 --- a/Compute/samples/V1/InstanceGroupManagersClient/get.php +++ b/Compute/samples/V1/InstanceGroupManagersClient/get.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_InstanceGroupManagers_Get_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\InstanceGroupManagersClient; +use Google\Cloud\Compute\V1\GetInstanceGroupManagerRequest; use Google\Cloud\Compute\V1\InstanceGroupManager; -use Google\Cloud\Compute\V1\InstanceGroupManagersClient; /** * Returns all of the details about the specified managed instance group. @@ -39,10 +40,16 @@ function get_sample(string $instanceGroupManager, string $project, string $zone) // Create a client. $instanceGroupManagersClient = new InstanceGroupManagersClient(); + // Prepare the request message. + $request = (new GetInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var InstanceGroupManager $response */ - $response = $instanceGroupManagersClient->get($instanceGroupManager, $project, $zone); + $response = $instanceGroupManagersClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/InstanceGroupManagersClient/insert.php b/Compute/samples/V1/InstanceGroupManagersClient/insert.php index 895d5492c267..692ff5a8e0f9 100644 --- a/Compute/samples/V1/InstanceGroupManagersClient/insert.php +++ b/Compute/samples/V1/InstanceGroupManagersClient/insert.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_InstanceGroupManagers_Insert_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\InstanceGroupManagersClient; +use Google\Cloud\Compute\V1\InsertInstanceGroupManagerRequest; use Google\Cloud\Compute\V1\InstanceGroupManager; -use Google\Cloud\Compute\V1\InstanceGroupManagersClient; use Google\Rpc\Status; /** @@ -40,13 +41,17 @@ function insert_sample(string $project, string $zone): void // Create a client. $instanceGroupManagersClient = new InstanceGroupManagersClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $instanceGroupManagerResource = new InstanceGroupManager(); + $request = (new InsertInstanceGroupManagerRequest()) + ->setInstanceGroupManagerResource($instanceGroupManagerResource) + ->setProject($project) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $instanceGroupManagersClient->insert($instanceGroupManagerResource, $project, $zone); + $response = $instanceGroupManagersClient->insert($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/InstanceGroupManagersClient/list.php b/Compute/samples/V1/InstanceGroupManagersClient/list.php index 0b30160e41a5..dc08d5cbaf33 100644 --- a/Compute/samples/V1/InstanceGroupManagersClient/list.php +++ b/Compute/samples/V1/InstanceGroupManagersClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_InstanceGroupManagers_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\InstanceGroupManagersClient; +use Google\Cloud\Compute\V1\Client\InstanceGroupManagersClient; +use Google\Cloud\Compute\V1\ListInstanceGroupManagersRequest; /** * Retrieves a list of managed instance groups that are contained within the specified project and zone. @@ -38,10 +39,15 @@ function list_sample(string $project, string $zone): void // Create a client. $instanceGroupManagersClient = new InstanceGroupManagersClient(); + // Prepare the request message. + $request = (new ListInstanceGroupManagersRequest()) + ->setProject($project) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $instanceGroupManagersClient->list($project, $zone); + $response = $instanceGroupManagersClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/InstanceGroupManagersClient/list_errors.php b/Compute/samples/V1/InstanceGroupManagersClient/list_errors.php index ac5aa98b048e..e915daeb716a 100644 --- a/Compute/samples/V1/InstanceGroupManagersClient/list_errors.php +++ b/Compute/samples/V1/InstanceGroupManagersClient/list_errors.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_InstanceGroupManagers_ListErrors_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\InstanceGroupManagersClient; +use Google\Cloud\Compute\V1\Client\InstanceGroupManagersClient; +use Google\Cloud\Compute\V1\ListErrorsInstanceGroupManagersRequest; /** * Lists all errors thrown by actions on instances for a given managed instance group. The filter and orderBy query parameters are not supported. @@ -39,10 +40,16 @@ function list_errors_sample(string $instanceGroupManager, string $project, strin // Create a client. $instanceGroupManagersClient = new InstanceGroupManagersClient(); + // Prepare the request message. + $request = (new ListErrorsInstanceGroupManagersRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $instanceGroupManagersClient->listErrors($instanceGroupManager, $project, $zone); + $response = $instanceGroupManagersClient->listErrors($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/InstanceGroupManagersClient/list_managed_instances.php b/Compute/samples/V1/InstanceGroupManagersClient/list_managed_instances.php index fc61feeb5276..e24dd4275477 100644 --- a/Compute/samples/V1/InstanceGroupManagersClient/list_managed_instances.php +++ b/Compute/samples/V1/InstanceGroupManagersClient/list_managed_instances.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_InstanceGroupManagers_ListManagedInstances_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\InstanceGroupManagersClient; +use Google\Cloud\Compute\V1\Client\InstanceGroupManagersClient; +use Google\Cloud\Compute\V1\ListManagedInstancesInstanceGroupManagersRequest; /** * Lists all of the instances in the managed instance group. Each instance in the list has a currentAction, which indicates the action that the managed instance group is performing on the instance. For example, if the group is still creating an instance, the currentAction is CREATING. If a previous action failed, the list displays the errors for that failed action. The orderBy query parameter is not supported. The `pageToken` query parameter is supported only if the group's `listManagedInstancesResults` field is set to `PAGINATED`. @@ -42,14 +43,16 @@ function list_managed_instances_sample( // Create a client. $instanceGroupManagersClient = new InstanceGroupManagersClient(); + // Prepare the request message. + $request = (new ListManagedInstancesInstanceGroupManagersRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $instanceGroupManagersClient->listManagedInstances( - $instanceGroupManager, - $project, - $zone - ); + $response = $instanceGroupManagersClient->listManagedInstances($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/InstanceGroupManagersClient/list_per_instance_configs.php b/Compute/samples/V1/InstanceGroupManagersClient/list_per_instance_configs.php index 0784fae87ba9..948c3a5c2f42 100644 --- a/Compute/samples/V1/InstanceGroupManagersClient/list_per_instance_configs.php +++ b/Compute/samples/V1/InstanceGroupManagersClient/list_per_instance_configs.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_InstanceGroupManagers_ListPerInstanceConfigs_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\InstanceGroupManagersClient; +use Google\Cloud\Compute\V1\Client\InstanceGroupManagersClient; +use Google\Cloud\Compute\V1\ListPerInstanceConfigsInstanceGroupManagersRequest; /** * Lists all of the per-instance configurations defined for the managed instance group. The orderBy query parameter is not supported. @@ -42,14 +43,16 @@ function list_per_instance_configs_sample( // Create a client. $instanceGroupManagersClient = new InstanceGroupManagersClient(); + // Prepare the request message. + $request = (new ListPerInstanceConfigsInstanceGroupManagersRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $instanceGroupManagersClient->listPerInstanceConfigs( - $instanceGroupManager, - $project, - $zone - ); + $response = $instanceGroupManagersClient->listPerInstanceConfigs($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/InstanceGroupManagersClient/patch.php b/Compute/samples/V1/InstanceGroupManagersClient/patch.php index 2b88c177072f..51b73d066a91 100644 --- a/Compute/samples/V1/InstanceGroupManagersClient/patch.php +++ b/Compute/samples/V1/InstanceGroupManagersClient/patch.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_InstanceGroupManagers_Patch_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\InstanceGroupManagersClient; use Google\Cloud\Compute\V1\InstanceGroupManager; -use Google\Cloud\Compute\V1\InstanceGroupManagersClient; +use Google\Cloud\Compute\V1\PatchInstanceGroupManagerRequest; use Google\Rpc\Status; /** @@ -41,18 +42,18 @@ function patch_sample(string $instanceGroupManager, string $project, string $zon // Create a client. $instanceGroupManagersClient = new InstanceGroupManagersClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $instanceGroupManagerResource = new InstanceGroupManager(); + $request = (new PatchInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagerResource($instanceGroupManagerResource) + ->setProject($project) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $instanceGroupManagersClient->patch( - $instanceGroupManager, - $instanceGroupManagerResource, - $project, - $zone - ); + $response = $instanceGroupManagersClient->patch($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/InstanceGroupManagersClient/patch_per_instance_configs.php b/Compute/samples/V1/InstanceGroupManagersClient/patch_per_instance_configs.php index 2f983d9bdc0c..bcf3fdab164a 100644 --- a/Compute/samples/V1/InstanceGroupManagersClient/patch_per_instance_configs.php +++ b/Compute/samples/V1/InstanceGroupManagersClient/patch_per_instance_configs.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_InstanceGroupManagers_PatchPerInstanceConfigs_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\InstanceGroupManagersClient; +use Google\Cloud\Compute\V1\Client\InstanceGroupManagersClient; use Google\Cloud\Compute\V1\InstanceGroupManagersPatchPerInstanceConfigsReq; +use Google\Cloud\Compute\V1\PatchPerInstanceConfigsInstanceGroupManagerRequest; use Google\Rpc\Status; /** @@ -44,18 +45,20 @@ function patch_per_instance_configs_sample( // Create a client. $instanceGroupManagersClient = new InstanceGroupManagersClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $instanceGroupManagersPatchPerInstanceConfigsReqResource = new InstanceGroupManagersPatchPerInstanceConfigsReq(); + $request = (new PatchPerInstanceConfigsInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagersPatchPerInstanceConfigsReqResource( + $instanceGroupManagersPatchPerInstanceConfigsReqResource + ) + ->setProject($project) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $instanceGroupManagersClient->patchPerInstanceConfigs( - $instanceGroupManager, - $instanceGroupManagersPatchPerInstanceConfigsReqResource, - $project, - $zone - ); + $response = $instanceGroupManagersClient->patchPerInstanceConfigs($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/InstanceGroupManagersClient/recreate_instances.php b/Compute/samples/V1/InstanceGroupManagersClient/recreate_instances.php index cfcb2fdce6a7..71b345df43f8 100644 --- a/Compute/samples/V1/InstanceGroupManagersClient/recreate_instances.php +++ b/Compute/samples/V1/InstanceGroupManagersClient/recreate_instances.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_InstanceGroupManagers_RecreateInstances_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\InstanceGroupManagersClient; +use Google\Cloud\Compute\V1\Client\InstanceGroupManagersClient; use Google\Cloud\Compute\V1\InstanceGroupManagersRecreateInstancesRequest; +use Google\Cloud\Compute\V1\RecreateInstancesInstanceGroupManagerRequest; use Google\Rpc\Status; /** @@ -44,18 +45,20 @@ function recreate_instances_sample( // Create a client. $instanceGroupManagersClient = new InstanceGroupManagersClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $instanceGroupManagersRecreateInstancesRequestResource = new InstanceGroupManagersRecreateInstancesRequest(); + $request = (new RecreateInstancesInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagersRecreateInstancesRequestResource( + $instanceGroupManagersRecreateInstancesRequestResource + ) + ->setProject($project) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $instanceGroupManagersClient->recreateInstances( - $instanceGroupManager, - $instanceGroupManagersRecreateInstancesRequestResource, - $project, - $zone - ); + $response = $instanceGroupManagersClient->recreateInstances($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/InstanceGroupManagersClient/resize.php b/Compute/samples/V1/InstanceGroupManagersClient/resize.php index 6e2de7d8a201..bce829e5f784 100644 --- a/Compute/samples/V1/InstanceGroupManagersClient/resize.php +++ b/Compute/samples/V1/InstanceGroupManagersClient/resize.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_InstanceGroupManagers_Resize_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\InstanceGroupManagersClient; +use Google\Cloud\Compute\V1\Client\InstanceGroupManagersClient; +use Google\Cloud\Compute\V1\ResizeInstanceGroupManagerRequest; use Google\Rpc\Status; /** @@ -45,10 +46,17 @@ function resize_sample( // Create a client. $instanceGroupManagersClient = new InstanceGroupManagersClient(); + // Prepare the request message. + $request = (new ResizeInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setSize($size) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $instanceGroupManagersClient->resize($instanceGroupManager, $project, $size, $zone); + $response = $instanceGroupManagersClient->resize($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/InstanceGroupManagersClient/resume_instances.php b/Compute/samples/V1/InstanceGroupManagersClient/resume_instances.php index c3074bfefc8b..450cdf53a828 100644 --- a/Compute/samples/V1/InstanceGroupManagersClient/resume_instances.php +++ b/Compute/samples/V1/InstanceGroupManagersClient/resume_instances.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_InstanceGroupManagers_ResumeInstances_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\InstanceGroupManagersClient; +use Google\Cloud\Compute\V1\Client\InstanceGroupManagersClient; use Google\Cloud\Compute\V1\InstanceGroupManagersResumeInstancesRequest; +use Google\Cloud\Compute\V1\ResumeInstancesInstanceGroupManagerRequest; use Google\Rpc\Status; /** @@ -44,18 +45,20 @@ function resume_instances_sample( // Create a client. $instanceGroupManagersClient = new InstanceGroupManagersClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $instanceGroupManagersResumeInstancesRequestResource = new InstanceGroupManagersResumeInstancesRequest(); + $request = (new ResumeInstancesInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagersResumeInstancesRequestResource( + $instanceGroupManagersResumeInstancesRequestResource + ) + ->setProject($project) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $instanceGroupManagersClient->resumeInstances( - $instanceGroupManager, - $instanceGroupManagersResumeInstancesRequestResource, - $project, - $zone - ); + $response = $instanceGroupManagersClient->resumeInstances($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/InstanceGroupManagersClient/set_instance_template.php b/Compute/samples/V1/InstanceGroupManagersClient/set_instance_template.php index 6cddb63b1ba3..09de5a236b91 100644 --- a/Compute/samples/V1/InstanceGroupManagersClient/set_instance_template.php +++ b/Compute/samples/V1/InstanceGroupManagersClient/set_instance_template.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_InstanceGroupManagers_SetInstanceTemplate_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\InstanceGroupManagersClient; +use Google\Cloud\Compute\V1\Client\InstanceGroupManagersClient; use Google\Cloud\Compute\V1\InstanceGroupManagersSetInstanceTemplateRequest; +use Google\Cloud\Compute\V1\SetInstanceTemplateInstanceGroupManagerRequest; use Google\Rpc\Status; /** @@ -44,18 +45,20 @@ function set_instance_template_sample( // Create a client. $instanceGroupManagersClient = new InstanceGroupManagersClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $instanceGroupManagersSetInstanceTemplateRequestResource = new InstanceGroupManagersSetInstanceTemplateRequest(); + $request = (new SetInstanceTemplateInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagersSetInstanceTemplateRequestResource( + $instanceGroupManagersSetInstanceTemplateRequestResource + ) + ->setProject($project) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $instanceGroupManagersClient->setInstanceTemplate( - $instanceGroupManager, - $instanceGroupManagersSetInstanceTemplateRequestResource, - $project, - $zone - ); + $response = $instanceGroupManagersClient->setInstanceTemplate($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/InstanceGroupManagersClient/set_target_pools.php b/Compute/samples/V1/InstanceGroupManagersClient/set_target_pools.php index c21b1c7d7c23..c90f52d18e55 100644 --- a/Compute/samples/V1/InstanceGroupManagersClient/set_target_pools.php +++ b/Compute/samples/V1/InstanceGroupManagersClient/set_target_pools.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_InstanceGroupManagers_SetTargetPools_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\InstanceGroupManagersClient; +use Google\Cloud\Compute\V1\Client\InstanceGroupManagersClient; use Google\Cloud\Compute\V1\InstanceGroupManagersSetTargetPoolsRequest; +use Google\Cloud\Compute\V1\SetTargetPoolsInstanceGroupManagerRequest; use Google\Rpc\Status; /** @@ -44,18 +45,20 @@ function set_target_pools_sample( // Create a client. $instanceGroupManagersClient = new InstanceGroupManagersClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $instanceGroupManagersSetTargetPoolsRequestResource = new InstanceGroupManagersSetTargetPoolsRequest(); + $request = (new SetTargetPoolsInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagersSetTargetPoolsRequestResource( + $instanceGroupManagersSetTargetPoolsRequestResource + ) + ->setProject($project) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $instanceGroupManagersClient->setTargetPools( - $instanceGroupManager, - $instanceGroupManagersSetTargetPoolsRequestResource, - $project, - $zone - ); + $response = $instanceGroupManagersClient->setTargetPools($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/InstanceGroupManagersClient/start_instances.php b/Compute/samples/V1/InstanceGroupManagersClient/start_instances.php index 9315e5e25b9e..646b7c8ff331 100644 --- a/Compute/samples/V1/InstanceGroupManagersClient/start_instances.php +++ b/Compute/samples/V1/InstanceGroupManagersClient/start_instances.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_InstanceGroupManagers_StartInstances_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\InstanceGroupManagersClient; +use Google\Cloud\Compute\V1\Client\InstanceGroupManagersClient; use Google\Cloud\Compute\V1\InstanceGroupManagersStartInstancesRequest; +use Google\Cloud\Compute\V1\StartInstancesInstanceGroupManagerRequest; use Google\Rpc\Status; /** @@ -41,18 +42,20 @@ function start_instances_sample(string $instanceGroupManager, string $project, s // Create a client. $instanceGroupManagersClient = new InstanceGroupManagersClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $instanceGroupManagersStartInstancesRequestResource = new InstanceGroupManagersStartInstancesRequest(); + $request = (new StartInstancesInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagersStartInstancesRequestResource( + $instanceGroupManagersStartInstancesRequestResource + ) + ->setProject($project) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $instanceGroupManagersClient->startInstances( - $instanceGroupManager, - $instanceGroupManagersStartInstancesRequestResource, - $project, - $zone - ); + $response = $instanceGroupManagersClient->startInstances($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/InstanceGroupManagersClient/stop_instances.php b/Compute/samples/V1/InstanceGroupManagersClient/stop_instances.php index 9057de9ba964..65d96d82547c 100644 --- a/Compute/samples/V1/InstanceGroupManagersClient/stop_instances.php +++ b/Compute/samples/V1/InstanceGroupManagersClient/stop_instances.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_InstanceGroupManagers_StopInstances_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\InstanceGroupManagersClient; +use Google\Cloud\Compute\V1\Client\InstanceGroupManagersClient; use Google\Cloud\Compute\V1\InstanceGroupManagersStopInstancesRequest; +use Google\Cloud\Compute\V1\StopInstancesInstanceGroupManagerRequest; use Google\Rpc\Status; /** @@ -41,18 +42,20 @@ function stop_instances_sample(string $instanceGroupManager, string $project, st // Create a client. $instanceGroupManagersClient = new InstanceGroupManagersClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $instanceGroupManagersStopInstancesRequestResource = new InstanceGroupManagersStopInstancesRequest(); + $request = (new StopInstancesInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagersStopInstancesRequestResource( + $instanceGroupManagersStopInstancesRequestResource + ) + ->setProject($project) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $instanceGroupManagersClient->stopInstances( - $instanceGroupManager, - $instanceGroupManagersStopInstancesRequestResource, - $project, - $zone - ); + $response = $instanceGroupManagersClient->stopInstances($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/InstanceGroupManagersClient/suspend_instances.php b/Compute/samples/V1/InstanceGroupManagersClient/suspend_instances.php index 9627c112090e..aec4e6e4b778 100644 --- a/Compute/samples/V1/InstanceGroupManagersClient/suspend_instances.php +++ b/Compute/samples/V1/InstanceGroupManagersClient/suspend_instances.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_InstanceGroupManagers_SuspendInstances_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\InstanceGroupManagersClient; +use Google\Cloud\Compute\V1\Client\InstanceGroupManagersClient; use Google\Cloud\Compute\V1\InstanceGroupManagersSuspendInstancesRequest; +use Google\Cloud\Compute\V1\SuspendInstancesInstanceGroupManagerRequest; use Google\Rpc\Status; /** @@ -44,18 +45,20 @@ function suspend_instances_sample( // Create a client. $instanceGroupManagersClient = new InstanceGroupManagersClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $instanceGroupManagersSuspendInstancesRequestResource = new InstanceGroupManagersSuspendInstancesRequest(); + $request = (new SuspendInstancesInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagersSuspendInstancesRequestResource( + $instanceGroupManagersSuspendInstancesRequestResource + ) + ->setProject($project) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $instanceGroupManagersClient->suspendInstances( - $instanceGroupManager, - $instanceGroupManagersSuspendInstancesRequestResource, - $project, - $zone - ); + $response = $instanceGroupManagersClient->suspendInstances($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/InstanceGroupManagersClient/update_per_instance_configs.php b/Compute/samples/V1/InstanceGroupManagersClient/update_per_instance_configs.php index e73f4a88c6cc..da101b162c63 100644 --- a/Compute/samples/V1/InstanceGroupManagersClient/update_per_instance_configs.php +++ b/Compute/samples/V1/InstanceGroupManagersClient/update_per_instance_configs.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_InstanceGroupManagers_UpdatePerInstanceConfigs_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\InstanceGroupManagersClient; +use Google\Cloud\Compute\V1\Client\InstanceGroupManagersClient; use Google\Cloud\Compute\V1\InstanceGroupManagersUpdatePerInstanceConfigsReq; +use Google\Cloud\Compute\V1\UpdatePerInstanceConfigsInstanceGroupManagerRequest; use Google\Rpc\Status; /** @@ -44,18 +45,20 @@ function update_per_instance_configs_sample( // Create a client. $instanceGroupManagersClient = new InstanceGroupManagersClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $instanceGroupManagersUpdatePerInstanceConfigsReqResource = new InstanceGroupManagersUpdatePerInstanceConfigsReq(); + $request = (new UpdatePerInstanceConfigsInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagersUpdatePerInstanceConfigsReqResource( + $instanceGroupManagersUpdatePerInstanceConfigsReqResource + ) + ->setProject($project) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $instanceGroupManagersClient->updatePerInstanceConfigs( - $instanceGroupManager, - $instanceGroupManagersUpdatePerInstanceConfigsReqResource, - $project, - $zone - ); + $response = $instanceGroupManagersClient->updatePerInstanceConfigs($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/InstanceGroupsClient/add_instances.php b/Compute/samples/V1/InstanceGroupsClient/add_instances.php index bb6e80860514..fdc458b817da 100644 --- a/Compute/samples/V1/InstanceGroupsClient/add_instances.php +++ b/Compute/samples/V1/InstanceGroupsClient/add_instances.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_InstanceGroups_AddInstances_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\AddInstancesInstanceGroupRequest; +use Google\Cloud\Compute\V1\Client\InstanceGroupsClient; use Google\Cloud\Compute\V1\InstanceGroupsAddInstancesRequest; -use Google\Cloud\Compute\V1\InstanceGroupsClient; use Google\Rpc\Status; /** @@ -41,18 +42,18 @@ function add_instances_sample(string $instanceGroup, string $project, string $zo // Create a client. $instanceGroupsClient = new InstanceGroupsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $instanceGroupsAddInstancesRequestResource = new InstanceGroupsAddInstancesRequest(); + $request = (new AddInstancesInstanceGroupRequest()) + ->setInstanceGroup($instanceGroup) + ->setInstanceGroupsAddInstancesRequestResource($instanceGroupsAddInstancesRequestResource) + ->setProject($project) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $instanceGroupsClient->addInstances( - $instanceGroup, - $instanceGroupsAddInstancesRequestResource, - $project, - $zone - ); + $response = $instanceGroupsClient->addInstances($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/InstanceGroupsClient/aggregated_list.php b/Compute/samples/V1/InstanceGroupsClient/aggregated_list.php index 69b49461fa62..decd697ad44b 100644 --- a/Compute/samples/V1/InstanceGroupsClient/aggregated_list.php +++ b/Compute/samples/V1/InstanceGroupsClient/aggregated_list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_InstanceGroups_AggregatedList_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\InstanceGroupsClient; +use Google\Cloud\Compute\V1\AggregatedListInstanceGroupsRequest; +use Google\Cloud\Compute\V1\Client\InstanceGroupsClient; /** * Retrieves the list of instance groups and sorts them by zone. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. @@ -37,10 +38,14 @@ function aggregated_list_sample(string $project): void // Create a client. $instanceGroupsClient = new InstanceGroupsClient(); + // Prepare the request message. + $request = (new AggregatedListInstanceGroupsRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $instanceGroupsClient->aggregatedList($project); + $response = $instanceGroupsClient->aggregatedList($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/InstanceGroupsClient/delete.php b/Compute/samples/V1/InstanceGroupsClient/delete.php index 0b747dd0b322..a64f52aa298d 100644 --- a/Compute/samples/V1/InstanceGroupsClient/delete.php +++ b/Compute/samples/V1/InstanceGroupsClient/delete.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_InstanceGroups_Delete_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\InstanceGroupsClient; +use Google\Cloud\Compute\V1\Client\InstanceGroupsClient; +use Google\Cloud\Compute\V1\DeleteInstanceGroupRequest; use Google\Rpc\Status; /** @@ -40,10 +41,16 @@ function delete_sample(string $instanceGroup, string $project, string $zone): vo // Create a client. $instanceGroupsClient = new InstanceGroupsClient(); + // Prepare the request message. + $request = (new DeleteInstanceGroupRequest()) + ->setInstanceGroup($instanceGroup) + ->setProject($project) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $instanceGroupsClient->delete($instanceGroup, $project, $zone); + $response = $instanceGroupsClient->delete($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/InstanceGroupsClient/get.php b/Compute/samples/V1/InstanceGroupsClient/get.php index 48a4f1f1591f..99d86356863f 100644 --- a/Compute/samples/V1/InstanceGroupsClient/get.php +++ b/Compute/samples/V1/InstanceGroupsClient/get.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_InstanceGroups_Get_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\InstanceGroupsClient; +use Google\Cloud\Compute\V1\GetInstanceGroupRequest; use Google\Cloud\Compute\V1\InstanceGroup; -use Google\Cloud\Compute\V1\InstanceGroupsClient; /** * Returns the specified zonal instance group. Get a list of available zonal instance groups by making a list() request. For managed instance groups, use the instanceGroupManagers or regionInstanceGroupManagers methods instead. @@ -39,10 +40,16 @@ function get_sample(string $instanceGroup, string $project, string $zone): void // Create a client. $instanceGroupsClient = new InstanceGroupsClient(); + // Prepare the request message. + $request = (new GetInstanceGroupRequest()) + ->setInstanceGroup($instanceGroup) + ->setProject($project) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var InstanceGroup $response */ - $response = $instanceGroupsClient->get($instanceGroup, $project, $zone); + $response = $instanceGroupsClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/InstanceGroupsClient/insert.php b/Compute/samples/V1/InstanceGroupsClient/insert.php index a7becfe69b94..30e887394075 100644 --- a/Compute/samples/V1/InstanceGroupsClient/insert.php +++ b/Compute/samples/V1/InstanceGroupsClient/insert.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_InstanceGroups_Insert_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\InstanceGroupsClient; +use Google\Cloud\Compute\V1\InsertInstanceGroupRequest; use Google\Cloud\Compute\V1\InstanceGroup; -use Google\Cloud\Compute\V1\InstanceGroupsClient; use Google\Rpc\Status; /** @@ -40,13 +41,17 @@ function insert_sample(string $project, string $zone): void // Create a client. $instanceGroupsClient = new InstanceGroupsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $instanceGroupResource = new InstanceGroup(); + $request = (new InsertInstanceGroupRequest()) + ->setInstanceGroupResource($instanceGroupResource) + ->setProject($project) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $instanceGroupsClient->insert($instanceGroupResource, $project, $zone); + $response = $instanceGroupsClient->insert($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/InstanceGroupsClient/list.php b/Compute/samples/V1/InstanceGroupsClient/list.php index 1838404ce217..e0eee3c2b57b 100644 --- a/Compute/samples/V1/InstanceGroupsClient/list.php +++ b/Compute/samples/V1/InstanceGroupsClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_InstanceGroups_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\InstanceGroupsClient; +use Google\Cloud\Compute\V1\Client\InstanceGroupsClient; +use Google\Cloud\Compute\V1\ListInstanceGroupsRequest; /** * Retrieves the list of zonal instance group resources contained within the specified zone. For managed instance groups, use the instanceGroupManagers or regionInstanceGroupManagers methods instead. @@ -38,10 +39,15 @@ function list_sample(string $project, string $zone): void // Create a client. $instanceGroupsClient = new InstanceGroupsClient(); + // Prepare the request message. + $request = (new ListInstanceGroupsRequest()) + ->setProject($project) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $instanceGroupsClient->list($project, $zone); + $response = $instanceGroupsClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/InstanceGroupsClient/list_instances.php b/Compute/samples/V1/InstanceGroupsClient/list_instances.php index 9c0a42adbc8d..fb636792e243 100644 --- a/Compute/samples/V1/InstanceGroupsClient/list_instances.php +++ b/Compute/samples/V1/InstanceGroupsClient/list_instances.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_InstanceGroups_ListInstances_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\InstanceGroupsClient; +use Google\Cloud\Compute\V1\Client\InstanceGroupsClient; use Google\Cloud\Compute\V1\InstanceGroupsListInstancesRequest; +use Google\Cloud\Compute\V1\ListInstancesInstanceGroupsRequest; /** * Lists the instances in the specified instance group. The orderBy query parameter is not supported. The filter query parameter is supported, but only for expressions that use `eq` (equal) or `ne` (not equal) operators. @@ -40,18 +41,18 @@ function list_instances_sample(string $instanceGroup, string $project, string $z // Create a client. $instanceGroupsClient = new InstanceGroupsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $instanceGroupsListInstancesRequestResource = new InstanceGroupsListInstancesRequest(); + $request = (new ListInstancesInstanceGroupsRequest()) + ->setInstanceGroup($instanceGroup) + ->setInstanceGroupsListInstancesRequestResource($instanceGroupsListInstancesRequestResource) + ->setProject($project) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $instanceGroupsClient->listInstances( - $instanceGroup, - $instanceGroupsListInstancesRequestResource, - $project, - $zone - ); + $response = $instanceGroupsClient->listInstances($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/InstanceGroupsClient/remove_instances.php b/Compute/samples/V1/InstanceGroupsClient/remove_instances.php index ba9dbb35f3c7..b63243587c72 100644 --- a/Compute/samples/V1/InstanceGroupsClient/remove_instances.php +++ b/Compute/samples/V1/InstanceGroupsClient/remove_instances.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_InstanceGroups_RemoveInstances_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\InstanceGroupsClient; +use Google\Cloud\Compute\V1\Client\InstanceGroupsClient; use Google\Cloud\Compute\V1\InstanceGroupsRemoveInstancesRequest; +use Google\Cloud\Compute\V1\RemoveInstancesInstanceGroupRequest; use Google\Rpc\Status; /** @@ -41,18 +42,18 @@ function remove_instances_sample(string $instanceGroup, string $project, string // Create a client. $instanceGroupsClient = new InstanceGroupsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $instanceGroupsRemoveInstancesRequestResource = new InstanceGroupsRemoveInstancesRequest(); + $request = (new RemoveInstancesInstanceGroupRequest()) + ->setInstanceGroup($instanceGroup) + ->setInstanceGroupsRemoveInstancesRequestResource($instanceGroupsRemoveInstancesRequestResource) + ->setProject($project) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $instanceGroupsClient->removeInstances( - $instanceGroup, - $instanceGroupsRemoveInstancesRequestResource, - $project, - $zone - ); + $response = $instanceGroupsClient->removeInstances($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/InstanceGroupsClient/set_named_ports.php b/Compute/samples/V1/InstanceGroupsClient/set_named_ports.php index c07f2a7a00bc..1151a363eb82 100644 --- a/Compute/samples/V1/InstanceGroupsClient/set_named_ports.php +++ b/Compute/samples/V1/InstanceGroupsClient/set_named_ports.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_InstanceGroups_SetNamedPorts_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\InstanceGroupsClient; +use Google\Cloud\Compute\V1\Client\InstanceGroupsClient; use Google\Cloud\Compute\V1\InstanceGroupsSetNamedPortsRequest; +use Google\Cloud\Compute\V1\SetNamedPortsInstanceGroupRequest; use Google\Rpc\Status; /** @@ -41,18 +42,18 @@ function set_named_ports_sample(string $instanceGroup, string $project, string $ // Create a client. $instanceGroupsClient = new InstanceGroupsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $instanceGroupsSetNamedPortsRequestResource = new InstanceGroupsSetNamedPortsRequest(); + $request = (new SetNamedPortsInstanceGroupRequest()) + ->setInstanceGroup($instanceGroup) + ->setInstanceGroupsSetNamedPortsRequestResource($instanceGroupsSetNamedPortsRequestResource) + ->setProject($project) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $instanceGroupsClient->setNamedPorts( - $instanceGroup, - $instanceGroupsSetNamedPortsRequestResource, - $project, - $zone - ); + $response = $instanceGroupsClient->setNamedPorts($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/InstanceSettingsServiceClient/get.php b/Compute/samples/V1/InstanceSettingsServiceClient/get.php index 7e15d801afd4..c81fbfed409d 100644 --- a/Compute/samples/V1/InstanceSettingsServiceClient/get.php +++ b/Compute/samples/V1/InstanceSettingsServiceClient/get.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_InstanceSettingsService_Get_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\InstanceSettingsServiceClient; +use Google\Cloud\Compute\V1\GetInstanceSettingRequest; use Google\Cloud\Compute\V1\InstanceSettings; -use Google\Cloud\Compute\V1\InstanceSettingsServiceClient; /** * Get Instance settings. @@ -38,10 +39,15 @@ function get_sample(string $project, string $zone): void // Create a client. $instanceSettingsServiceClient = new InstanceSettingsServiceClient(); + // Prepare the request message. + $request = (new GetInstanceSettingRequest()) + ->setProject($project) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var InstanceSettings $response */ - $response = $instanceSettingsServiceClient->get($project, $zone); + $response = $instanceSettingsServiceClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/InstanceSettingsServiceClient/patch.php b/Compute/samples/V1/InstanceSettingsServiceClient/patch.php index fd51e68f9d7a..4835889e2276 100644 --- a/Compute/samples/V1/InstanceSettingsServiceClient/patch.php +++ b/Compute/samples/V1/InstanceSettingsServiceClient/patch.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_InstanceSettingsService_Patch_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\InstanceSettingsServiceClient; use Google\Cloud\Compute\V1\InstanceSettings; -use Google\Cloud\Compute\V1\InstanceSettingsServiceClient; +use Google\Cloud\Compute\V1\PatchInstanceSettingRequest; use Google\Rpc\Status; /** @@ -40,13 +41,17 @@ function patch_sample(string $project, string $zone): void // Create a client. $instanceSettingsServiceClient = new InstanceSettingsServiceClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $instanceSettingsResource = new InstanceSettings(); + $request = (new PatchInstanceSettingRequest()) + ->setInstanceSettingsResource($instanceSettingsResource) + ->setProject($project) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $instanceSettingsServiceClient->patch($instanceSettingsResource, $project, $zone); + $response = $instanceSettingsServiceClient->patch($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/InstanceTemplatesClient/aggregated_list.php b/Compute/samples/V1/InstanceTemplatesClient/aggregated_list.php index ce34b5262fc3..39e7fc807009 100644 --- a/Compute/samples/V1/InstanceTemplatesClient/aggregated_list.php +++ b/Compute/samples/V1/InstanceTemplatesClient/aggregated_list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_InstanceTemplates_AggregatedList_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\InstanceTemplatesClient; +use Google\Cloud\Compute\V1\AggregatedListInstanceTemplatesRequest; +use Google\Cloud\Compute\V1\Client\InstanceTemplatesClient; /** * 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`. @@ -37,10 +38,14 @@ function aggregated_list_sample(string $project): void // Create a client. $instanceTemplatesClient = new InstanceTemplatesClient(); + // Prepare the request message. + $request = (new AggregatedListInstanceTemplatesRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $instanceTemplatesClient->aggregatedList($project); + $response = $instanceTemplatesClient->aggregatedList($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/InstanceTemplatesClient/delete.php b/Compute/samples/V1/InstanceTemplatesClient/delete.php index 3bacd5c26ae6..31231982a6aa 100644 --- a/Compute/samples/V1/InstanceTemplatesClient/delete.php +++ b/Compute/samples/V1/InstanceTemplatesClient/delete.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_InstanceTemplates_Delete_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\InstanceTemplatesClient; +use Google\Cloud\Compute\V1\Client\InstanceTemplatesClient; +use Google\Cloud\Compute\V1\DeleteInstanceTemplateRequest; use Google\Rpc\Status; /** @@ -39,10 +40,15 @@ function delete_sample(string $instanceTemplate, string $project): void // Create a client. $instanceTemplatesClient = new InstanceTemplatesClient(); + // Prepare the request message. + $request = (new DeleteInstanceTemplateRequest()) + ->setInstanceTemplate($instanceTemplate) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $instanceTemplatesClient->delete($instanceTemplate, $project); + $response = $instanceTemplatesClient->delete($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/InstanceTemplatesClient/get.php b/Compute/samples/V1/InstanceTemplatesClient/get.php index 8b38a1c1c882..68c1ae3bbc44 100644 --- a/Compute/samples/V1/InstanceTemplatesClient/get.php +++ b/Compute/samples/V1/InstanceTemplatesClient/get.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_InstanceTemplates_Get_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\InstanceTemplatesClient; +use Google\Cloud\Compute\V1\GetInstanceTemplateRequest; use Google\Cloud\Compute\V1\InstanceTemplate; -use Google\Cloud\Compute\V1\InstanceTemplatesClient; /** * Returns the specified instance template. @@ -38,10 +39,15 @@ function get_sample(string $instanceTemplate, string $project): void // Create a client. $instanceTemplatesClient = new InstanceTemplatesClient(); + // Prepare the request message. + $request = (new GetInstanceTemplateRequest()) + ->setInstanceTemplate($instanceTemplate) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var InstanceTemplate $response */ - $response = $instanceTemplatesClient->get($instanceTemplate, $project); + $response = $instanceTemplatesClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/InstanceTemplatesClient/get_iam_policy.php b/Compute/samples/V1/InstanceTemplatesClient/get_iam_policy.php index 161641f3c3a9..fba2b57c4702 100644 --- a/Compute/samples/V1/InstanceTemplatesClient/get_iam_policy.php +++ b/Compute/samples/V1/InstanceTemplatesClient/get_iam_policy.php @@ -24,7 +24,8 @@ // [START compute_v1_generated_InstanceTemplates_GetIamPolicy_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\InstanceTemplatesClient; +use Google\Cloud\Compute\V1\Client\InstanceTemplatesClient; +use Google\Cloud\Compute\V1\GetIamPolicyInstanceTemplateRequest; use Google\Cloud\Compute\V1\Policy; /** @@ -38,10 +39,15 @@ function get_iam_policy_sample(string $project, string $resource): void // Create a client. $instanceTemplatesClient = new InstanceTemplatesClient(); + // Prepare the request message. + $request = (new GetIamPolicyInstanceTemplateRequest()) + ->setProject($project) + ->setResource($resource); + // Call the API and handle any network failures. try { /** @var Policy $response */ - $response = $instanceTemplatesClient->getIamPolicy($project, $resource); + $response = $instanceTemplatesClient->getIamPolicy($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/InstanceTemplatesClient/insert.php b/Compute/samples/V1/InstanceTemplatesClient/insert.php index e1ecd9bfcc85..e07d2a6762ad 100644 --- a/Compute/samples/V1/InstanceTemplatesClient/insert.php +++ b/Compute/samples/V1/InstanceTemplatesClient/insert.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_InstanceTemplates_Insert_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\InstanceTemplatesClient; +use Google\Cloud\Compute\V1\InsertInstanceTemplateRequest; use Google\Cloud\Compute\V1\InstanceTemplate; -use Google\Cloud\Compute\V1\InstanceTemplatesClient; use Google\Rpc\Status; /** @@ -39,13 +40,16 @@ function insert_sample(string $project): void // Create a client. $instanceTemplatesClient = new InstanceTemplatesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $instanceTemplateResource = new InstanceTemplate(); + $request = (new InsertInstanceTemplateRequest()) + ->setInstanceTemplateResource($instanceTemplateResource) + ->setProject($project); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $instanceTemplatesClient->insert($instanceTemplateResource, $project); + $response = $instanceTemplatesClient->insert($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/InstanceTemplatesClient/list.php b/Compute/samples/V1/InstanceTemplatesClient/list.php index 51db0e4b51e8..446e0c72e8db 100644 --- a/Compute/samples/V1/InstanceTemplatesClient/list.php +++ b/Compute/samples/V1/InstanceTemplatesClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_InstanceTemplates_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\InstanceTemplatesClient; +use Google\Cloud\Compute\V1\Client\InstanceTemplatesClient; +use Google\Cloud\Compute\V1\ListInstanceTemplatesRequest; /** * Retrieves a list of instance templates that are contained within the specified project. @@ -37,10 +38,14 @@ function list_sample(string $project): void // Create a client. $instanceTemplatesClient = new InstanceTemplatesClient(); + // Prepare the request message. + $request = (new ListInstanceTemplatesRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $instanceTemplatesClient->list($project); + $response = $instanceTemplatesClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/InstanceTemplatesClient/set_iam_policy.php b/Compute/samples/V1/InstanceTemplatesClient/set_iam_policy.php index c8380df1f3b6..4d2adcfbf1be 100644 --- a/Compute/samples/V1/InstanceTemplatesClient/set_iam_policy.php +++ b/Compute/samples/V1/InstanceTemplatesClient/set_iam_policy.php @@ -24,9 +24,10 @@ // [START compute_v1_generated_InstanceTemplates_SetIamPolicy_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\InstanceTemplatesClient; use Google\Cloud\Compute\V1\GlobalSetPolicyRequest; -use Google\Cloud\Compute\V1\InstanceTemplatesClient; use Google\Cloud\Compute\V1\Policy; +use Google\Cloud\Compute\V1\SetIamPolicyInstanceTemplateRequest; /** * Sets the access control policy on the specified resource. Replaces any existing policy. @@ -39,17 +40,17 @@ function set_iam_policy_sample(string $project, string $resource): void // Create a client. $instanceTemplatesClient = new InstanceTemplatesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $globalSetPolicyRequestResource = new GlobalSetPolicyRequest(); + $request = (new SetIamPolicyInstanceTemplateRequest()) + ->setGlobalSetPolicyRequestResource($globalSetPolicyRequestResource) + ->setProject($project) + ->setResource($resource); // Call the API and handle any network failures. try { /** @var Policy $response */ - $response = $instanceTemplatesClient->setIamPolicy( - $globalSetPolicyRequestResource, - $project, - $resource - ); + $response = $instanceTemplatesClient->setIamPolicy($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/InstanceTemplatesClient/test_iam_permissions.php b/Compute/samples/V1/InstanceTemplatesClient/test_iam_permissions.php index ea4b62dc780c..32c7a4810a0d 100644 --- a/Compute/samples/V1/InstanceTemplatesClient/test_iam_permissions.php +++ b/Compute/samples/V1/InstanceTemplatesClient/test_iam_permissions.php @@ -24,7 +24,8 @@ // [START compute_v1_generated_InstanceTemplates_TestIamPermissions_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\InstanceTemplatesClient; +use Google\Cloud\Compute\V1\Client\InstanceTemplatesClient; +use Google\Cloud\Compute\V1\TestIamPermissionsInstanceTemplateRequest; use Google\Cloud\Compute\V1\TestPermissionsRequest; use Google\Cloud\Compute\V1\TestPermissionsResponse; @@ -39,17 +40,17 @@ function test_iam_permissions_sample(string $project, string $resource): void // Create a client. $instanceTemplatesClient = new InstanceTemplatesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $testPermissionsRequestResource = new TestPermissionsRequest(); + $request = (new TestIamPermissionsInstanceTemplateRequest()) + ->setProject($project) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); // Call the API and handle any network failures. try { /** @var TestPermissionsResponse $response */ - $response = $instanceTemplatesClient->testIamPermissions( - $project, - $resource, - $testPermissionsRequestResource - ); + $response = $instanceTemplatesClient->testIamPermissions($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/InstancesClient/add_access_config.php b/Compute/samples/V1/InstancesClient/add_access_config.php index 3a94bbba05e2..ca1646eff1cd 100644 --- a/Compute/samples/V1/InstancesClient/add_access_config.php +++ b/Compute/samples/V1/InstancesClient/add_access_config.php @@ -26,7 +26,8 @@ use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; use Google\Cloud\Compute\V1\AccessConfig; -use Google\Cloud\Compute\V1\InstancesClient; +use Google\Cloud\Compute\V1\AddAccessConfigInstanceRequest; +use Google\Cloud\Compute\V1\Client\InstancesClient; use Google\Rpc\Status; /** @@ -46,19 +47,19 @@ function add_access_config_sample( // Create a client. $instancesClient = new InstancesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $accessConfigResource = new AccessConfig(); + $request = (new AddAccessConfigInstanceRequest()) + ->setAccessConfigResource($accessConfigResource) + ->setInstance($instance) + ->setNetworkInterface($networkInterface) + ->setProject($project) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $instancesClient->addAccessConfig( - $accessConfigResource, - $instance, - $networkInterface, - $project, - $zone - ); + $response = $instancesClient->addAccessConfig($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/InstancesClient/add_resource_policies.php b/Compute/samples/V1/InstancesClient/add_resource_policies.php index 575a65726bb7..b864598a9a7c 100644 --- a/Compute/samples/V1/InstancesClient/add_resource_policies.php +++ b/Compute/samples/V1/InstancesClient/add_resource_policies.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_Instances_AddResourcePolicies_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\AddResourcePoliciesInstanceRequest; +use Google\Cloud\Compute\V1\Client\InstancesClient; use Google\Cloud\Compute\V1\InstancesAddResourcePoliciesRequest; -use Google\Cloud\Compute\V1\InstancesClient; use Google\Rpc\Status; /** @@ -41,18 +42,18 @@ function add_resource_policies_sample(string $instance, string $project, string // Create a client. $instancesClient = new InstancesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $instancesAddResourcePoliciesRequestResource = new InstancesAddResourcePoliciesRequest(); + $request = (new AddResourcePoliciesInstanceRequest()) + ->setInstance($instance) + ->setInstancesAddResourcePoliciesRequestResource($instancesAddResourcePoliciesRequestResource) + ->setProject($project) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $instancesClient->addResourcePolicies( - $instance, - $instancesAddResourcePoliciesRequestResource, - $project, - $zone - ); + $response = $instancesClient->addResourcePolicies($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/InstancesClient/aggregated_list.php b/Compute/samples/V1/InstancesClient/aggregated_list.php index 2ad25f06727a..58a0472dfc0b 100644 --- a/Compute/samples/V1/InstancesClient/aggregated_list.php +++ b/Compute/samples/V1/InstancesClient/aggregated_list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_Instances_AggregatedList_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\InstancesClient; +use Google\Cloud\Compute\V1\AggregatedListInstancesRequest; +use Google\Cloud\Compute\V1\Client\InstancesClient; /** * 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`. @@ -37,10 +38,14 @@ function aggregated_list_sample(string $project): void // Create a client. $instancesClient = new InstancesClient(); + // Prepare the request message. + $request = (new AggregatedListInstancesRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $instancesClient->aggregatedList($project); + $response = $instancesClient->aggregatedList($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/InstancesClient/attach_disk.php b/Compute/samples/V1/InstancesClient/attach_disk.php index f4987fc0855f..2a97e97404b3 100644 --- a/Compute/samples/V1/InstancesClient/attach_disk.php +++ b/Compute/samples/V1/InstancesClient/attach_disk.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_Instances_AttachDisk_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\AttachDiskInstanceRequest; use Google\Cloud\Compute\V1\AttachedDisk; -use Google\Cloud\Compute\V1\InstancesClient; +use Google\Cloud\Compute\V1\Client\InstancesClient; use Google\Rpc\Status; /** @@ -41,13 +42,18 @@ function attach_disk_sample(string $instance, string $project, string $zone): vo // Create a client. $instancesClient = new InstancesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $attachedDiskResource = new AttachedDisk(); + $request = (new AttachDiskInstanceRequest()) + ->setAttachedDiskResource($attachedDiskResource) + ->setInstance($instance) + ->setProject($project) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $instancesClient->attachDisk($attachedDiskResource, $instance, $project, $zone); + $response = $instancesClient->attachDisk($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/InstancesClient/bulk_insert.php b/Compute/samples/V1/InstancesClient/bulk_insert.php index ad11ba0843d6..c4f17ed6cd8c 100644 --- a/Compute/samples/V1/InstancesClient/bulk_insert.php +++ b/Compute/samples/V1/InstancesClient/bulk_insert.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_Instances_BulkInsert_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\BulkInsertInstanceRequest; use Google\Cloud\Compute\V1\BulkInsertInstanceResource; -use Google\Cloud\Compute\V1\InstancesClient; +use Google\Cloud\Compute\V1\Client\InstancesClient; use Google\Rpc\Status; /** @@ -40,13 +41,17 @@ function bulk_insert_sample(string $project, string $zone): void // Create a client. $instancesClient = new InstancesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $bulkInsertInstanceResourceResource = new BulkInsertInstanceResource(); + $request = (new BulkInsertInstanceRequest()) + ->setBulkInsertInstanceResourceResource($bulkInsertInstanceResourceResource) + ->setProject($project) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $instancesClient->bulkInsert($bulkInsertInstanceResourceResource, $project, $zone); + $response = $instancesClient->bulkInsert($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/InstancesClient/delete.php b/Compute/samples/V1/InstancesClient/delete.php index 14e4803039b1..7b8c645cb3d2 100644 --- a/Compute/samples/V1/InstancesClient/delete.php +++ b/Compute/samples/V1/InstancesClient/delete.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_Instances_Delete_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\InstancesClient; +use Google\Cloud\Compute\V1\Client\InstancesClient; +use Google\Cloud\Compute\V1\DeleteInstanceRequest; use Google\Rpc\Status; /** @@ -40,10 +41,16 @@ function delete_sample(string $instance, string $project, string $zone): void // Create a client. $instancesClient = new InstancesClient(); + // Prepare the request message. + $request = (new DeleteInstanceRequest()) + ->setInstance($instance) + ->setProject($project) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $instancesClient->delete($instance, $project, $zone); + $response = $instancesClient->delete($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/InstancesClient/delete_access_config.php b/Compute/samples/V1/InstancesClient/delete_access_config.php index fcabe213d359..a469813344e4 100644 --- a/Compute/samples/V1/InstancesClient/delete_access_config.php +++ b/Compute/samples/V1/InstancesClient/delete_access_config.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_Instances_DeleteAccessConfig_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\InstancesClient; +use Google\Cloud\Compute\V1\Client\InstancesClient; +use Google\Cloud\Compute\V1\DeleteAccessConfigInstanceRequest; use Google\Rpc\Status; /** @@ -47,16 +48,18 @@ function delete_access_config_sample( // Create a client. $instancesClient = new InstancesClient(); + // Prepare the request message. + $request = (new DeleteAccessConfigInstanceRequest()) + ->setAccessConfig($accessConfig) + ->setInstance($instance) + ->setNetworkInterface($networkInterface) + ->setProject($project) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $instancesClient->deleteAccessConfig( - $accessConfig, - $instance, - $networkInterface, - $project, - $zone - ); + $response = $instancesClient->deleteAccessConfig($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/InstancesClient/detach_disk.php b/Compute/samples/V1/InstancesClient/detach_disk.php index a8ea7954b89d..706a3c79d083 100644 --- a/Compute/samples/V1/InstancesClient/detach_disk.php +++ b/Compute/samples/V1/InstancesClient/detach_disk.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_Instances_DetachDisk_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\InstancesClient; +use Google\Cloud\Compute\V1\Client\InstancesClient; +use Google\Cloud\Compute\V1\DetachDiskInstanceRequest; use Google\Rpc\Status; /** @@ -45,10 +46,17 @@ function detach_disk_sample( // Create a client. $instancesClient = new InstancesClient(); + // Prepare the request message. + $request = (new DetachDiskInstanceRequest()) + ->setDeviceName($deviceName) + ->setInstance($instance) + ->setProject($project) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $instancesClient->detachDisk($deviceName, $instance, $project, $zone); + $response = $instancesClient->detachDisk($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/InstancesClient/get.php b/Compute/samples/V1/InstancesClient/get.php index ce80922a54f0..03d7b0f1f4a0 100644 --- a/Compute/samples/V1/InstancesClient/get.php +++ b/Compute/samples/V1/InstancesClient/get.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_Instances_Get_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\InstancesClient; +use Google\Cloud\Compute\V1\GetInstanceRequest; use Google\Cloud\Compute\V1\Instance; -use Google\Cloud\Compute\V1\InstancesClient; /** * Returns the specified Instance resource. @@ -39,10 +40,16 @@ function get_sample(string $instance, string $project, string $zone): void // Create a client. $instancesClient = new InstancesClient(); + // Prepare the request message. + $request = (new GetInstanceRequest()) + ->setInstance($instance) + ->setProject($project) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var Instance $response */ - $response = $instancesClient->get($instance, $project, $zone); + $response = $instancesClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/InstancesClient/get_effective_firewalls.php b/Compute/samples/V1/InstancesClient/get_effective_firewalls.php index a97fa1bdd52b..cbfeec3d2655 100644 --- a/Compute/samples/V1/InstancesClient/get_effective_firewalls.php +++ b/Compute/samples/V1/InstancesClient/get_effective_firewalls.php @@ -24,7 +24,8 @@ // [START compute_v1_generated_Instances_GetEffectiveFirewalls_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\InstancesClient; +use Google\Cloud\Compute\V1\Client\InstancesClient; +use Google\Cloud\Compute\V1\GetEffectiveFirewallsInstanceRequest; use Google\Cloud\Compute\V1\InstancesGetEffectiveFirewallsResponse; /** @@ -44,10 +45,17 @@ function get_effective_firewalls_sample( // Create a client. $instancesClient = new InstancesClient(); + // Prepare the request message. + $request = (new GetEffectiveFirewallsInstanceRequest()) + ->setInstance($instance) + ->setNetworkInterface($networkInterface) + ->setProject($project) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var InstancesGetEffectiveFirewallsResponse $response */ - $response = $instancesClient->getEffectiveFirewalls($instance, $networkInterface, $project, $zone); + $response = $instancesClient->getEffectiveFirewalls($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/InstancesClient/get_guest_attributes.php b/Compute/samples/V1/InstancesClient/get_guest_attributes.php index 9e8730a61a1d..b70945dfc35e 100644 --- a/Compute/samples/V1/InstancesClient/get_guest_attributes.php +++ b/Compute/samples/V1/InstancesClient/get_guest_attributes.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_Instances_GetGuestAttributes_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\InstancesClient; +use Google\Cloud\Compute\V1\GetGuestAttributesInstanceRequest; use Google\Cloud\Compute\V1\GuestAttributes; -use Google\Cloud\Compute\V1\InstancesClient; /** * Returns the specified guest attributes entry. @@ -39,10 +40,16 @@ function get_guest_attributes_sample(string $instance, string $project, string $ // Create a client. $instancesClient = new InstancesClient(); + // Prepare the request message. + $request = (new GetGuestAttributesInstanceRequest()) + ->setInstance($instance) + ->setProject($project) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var GuestAttributes $response */ - $response = $instancesClient->getGuestAttributes($instance, $project, $zone); + $response = $instancesClient->getGuestAttributes($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/InstancesClient/get_iam_policy.php b/Compute/samples/V1/InstancesClient/get_iam_policy.php index ad428acc0786..b7cd99615c06 100644 --- a/Compute/samples/V1/InstancesClient/get_iam_policy.php +++ b/Compute/samples/V1/InstancesClient/get_iam_policy.php @@ -24,7 +24,8 @@ // [START compute_v1_generated_Instances_GetIamPolicy_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\InstancesClient; +use Google\Cloud\Compute\V1\Client\InstancesClient; +use Google\Cloud\Compute\V1\GetIamPolicyInstanceRequest; use Google\Cloud\Compute\V1\Policy; /** @@ -39,10 +40,16 @@ function get_iam_policy_sample(string $project, string $resource, string $zone): // Create a client. $instancesClient = new InstancesClient(); + // Prepare the request message. + $request = (new GetIamPolicyInstanceRequest()) + ->setProject($project) + ->setResource($resource) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var Policy $response */ - $response = $instancesClient->getIamPolicy($project, $resource, $zone); + $response = $instancesClient->getIamPolicy($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/InstancesClient/get_screenshot.php b/Compute/samples/V1/InstancesClient/get_screenshot.php index d568b22b38d4..fcfd2d37239a 100644 --- a/Compute/samples/V1/InstancesClient/get_screenshot.php +++ b/Compute/samples/V1/InstancesClient/get_screenshot.php @@ -24,7 +24,8 @@ // [START compute_v1_generated_Instances_GetScreenshot_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\InstancesClient; +use Google\Cloud\Compute\V1\Client\InstancesClient; +use Google\Cloud\Compute\V1\GetScreenshotInstanceRequest; use Google\Cloud\Compute\V1\Screenshot; /** @@ -39,10 +40,16 @@ function get_screenshot_sample(string $instance, string $project, string $zone): // Create a client. $instancesClient = new InstancesClient(); + // Prepare the request message. + $request = (new GetScreenshotInstanceRequest()) + ->setInstance($instance) + ->setProject($project) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var Screenshot $response */ - $response = $instancesClient->getScreenshot($instance, $project, $zone); + $response = $instancesClient->getScreenshot($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/InstancesClient/get_serial_port_output.php b/Compute/samples/V1/InstancesClient/get_serial_port_output.php index b89c0e25e14e..04327f93bf96 100644 --- a/Compute/samples/V1/InstancesClient/get_serial_port_output.php +++ b/Compute/samples/V1/InstancesClient/get_serial_port_output.php @@ -24,7 +24,8 @@ // [START compute_v1_generated_Instances_GetSerialPortOutput_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\InstancesClient; +use Google\Cloud\Compute\V1\Client\InstancesClient; +use Google\Cloud\Compute\V1\GetSerialPortOutputInstanceRequest; use Google\Cloud\Compute\V1\SerialPortOutput; /** @@ -39,10 +40,16 @@ function get_serial_port_output_sample(string $instance, string $project, string // Create a client. $instancesClient = new InstancesClient(); + // Prepare the request message. + $request = (new GetSerialPortOutputInstanceRequest()) + ->setInstance($instance) + ->setProject($project) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var SerialPortOutput $response */ - $response = $instancesClient->getSerialPortOutput($instance, $project, $zone); + $response = $instancesClient->getSerialPortOutput($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/InstancesClient/get_shielded_instance_identity.php b/Compute/samples/V1/InstancesClient/get_shielded_instance_identity.php index 6562bcac1f8a..0334997802ec 100644 --- a/Compute/samples/V1/InstancesClient/get_shielded_instance_identity.php +++ b/Compute/samples/V1/InstancesClient/get_shielded_instance_identity.php @@ -24,7 +24,8 @@ // [START compute_v1_generated_Instances_GetShieldedInstanceIdentity_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\InstancesClient; +use Google\Cloud\Compute\V1\Client\InstancesClient; +use Google\Cloud\Compute\V1\GetShieldedInstanceIdentityInstanceRequest; use Google\Cloud\Compute\V1\ShieldedInstanceIdentity; /** @@ -42,10 +43,16 @@ function get_shielded_instance_identity_sample( // Create a client. $instancesClient = new InstancesClient(); + // Prepare the request message. + $request = (new GetShieldedInstanceIdentityInstanceRequest()) + ->setInstance($instance) + ->setProject($project) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var ShieldedInstanceIdentity $response */ - $response = $instancesClient->getShieldedInstanceIdentity($instance, $project, $zone); + $response = $instancesClient->getShieldedInstanceIdentity($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/InstancesClient/insert.php b/Compute/samples/V1/InstancesClient/insert.php index a94a59861bf8..055ec9fcb84f 100644 --- a/Compute/samples/V1/InstancesClient/insert.php +++ b/Compute/samples/V1/InstancesClient/insert.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_Instances_Insert_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\InstancesClient; +use Google\Cloud\Compute\V1\InsertInstanceRequest; use Google\Cloud\Compute\V1\Instance; -use Google\Cloud\Compute\V1\InstancesClient; use Google\Rpc\Status; /** @@ -40,13 +41,17 @@ function insert_sample(string $project, string $zone): void // Create a client. $instancesClient = new InstancesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $instanceResource = new Instance(); + $request = (new InsertInstanceRequest()) + ->setInstanceResource($instanceResource) + ->setProject($project) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $instancesClient->insert($instanceResource, $project, $zone); + $response = $instancesClient->insert($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/InstancesClient/list.php b/Compute/samples/V1/InstancesClient/list.php index f4bc7ca55492..7d5133949e30 100644 --- a/Compute/samples/V1/InstancesClient/list.php +++ b/Compute/samples/V1/InstancesClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_Instances_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\InstancesClient; +use Google\Cloud\Compute\V1\Client\InstancesClient; +use Google\Cloud\Compute\V1\ListInstancesRequest; /** * Retrieves the list of instances contained within the specified zone. @@ -38,10 +39,15 @@ function list_sample(string $project, string $zone): void // Create a client. $instancesClient = new InstancesClient(); + // Prepare the request message. + $request = (new ListInstancesRequest()) + ->setProject($project) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $instancesClient->list($project, $zone); + $response = $instancesClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/InstancesClient/list_referrers.php b/Compute/samples/V1/InstancesClient/list_referrers.php index 8dba51376917..8b12ff5261a1 100644 --- a/Compute/samples/V1/InstancesClient/list_referrers.php +++ b/Compute/samples/V1/InstancesClient/list_referrers.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_Instances_ListReferrers_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\InstancesClient; +use Google\Cloud\Compute\V1\Client\InstancesClient; +use Google\Cloud\Compute\V1\ListReferrersInstancesRequest; /** * Retrieves a list of resources that refer to the VM instance specified in the request. For example, if the VM instance is part of a managed or unmanaged instance group, the referrers list includes the instance group. For more information, read Viewing referrers to VM instances. @@ -39,10 +40,16 @@ function list_referrers_sample(string $instance, string $project, string $zone): // Create a client. $instancesClient = new InstancesClient(); + // Prepare the request message. + $request = (new ListReferrersInstancesRequest()) + ->setInstance($instance) + ->setProject($project) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $instancesClient->listReferrers($instance, $project, $zone); + $response = $instancesClient->listReferrers($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/InstancesClient/perform_maintenance.php b/Compute/samples/V1/InstancesClient/perform_maintenance.php index 8f028a29cd26..53852ad513c0 100644 --- a/Compute/samples/V1/InstancesClient/perform_maintenance.php +++ b/Compute/samples/V1/InstancesClient/perform_maintenance.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_Instances_PerformMaintenance_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\InstancesClient; +use Google\Cloud\Compute\V1\Client\InstancesClient; +use Google\Cloud\Compute\V1\PerformMaintenanceInstanceRequest; use Google\Rpc\Status; /** @@ -40,10 +41,16 @@ function perform_maintenance_sample(string $instance, string $project, string $z // Create a client. $instancesClient = new InstancesClient(); + // Prepare the request message. + $request = (new PerformMaintenanceInstanceRequest()) + ->setInstance($instance) + ->setProject($project) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $instancesClient->performMaintenance($instance, $project, $zone); + $response = $instancesClient->performMaintenance($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/InstancesClient/remove_resource_policies.php b/Compute/samples/V1/InstancesClient/remove_resource_policies.php index 54f692df919a..d4e7a774e91d 100644 --- a/Compute/samples/V1/InstancesClient/remove_resource_policies.php +++ b/Compute/samples/V1/InstancesClient/remove_resource_policies.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_Instances_RemoveResourcePolicies_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\InstancesClient; +use Google\Cloud\Compute\V1\Client\InstancesClient; use Google\Cloud\Compute\V1\InstancesRemoveResourcePoliciesRequest; +use Google\Cloud\Compute\V1\RemoveResourcePoliciesInstanceRequest; use Google\Rpc\Status; /** @@ -41,18 +42,18 @@ function remove_resource_policies_sample(string $instance, string $project, stri // Create a client. $instancesClient = new InstancesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $instancesRemoveResourcePoliciesRequestResource = new InstancesRemoveResourcePoliciesRequest(); + $request = (new RemoveResourcePoliciesInstanceRequest()) + ->setInstance($instance) + ->setInstancesRemoveResourcePoliciesRequestResource($instancesRemoveResourcePoliciesRequestResource) + ->setProject($project) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $instancesClient->removeResourcePolicies( - $instance, - $instancesRemoveResourcePoliciesRequestResource, - $project, - $zone - ); + $response = $instancesClient->removeResourcePolicies($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/InstancesClient/reset.php b/Compute/samples/V1/InstancesClient/reset.php index f608bda4e7d2..ab59811f40ea 100644 --- a/Compute/samples/V1/InstancesClient/reset.php +++ b/Compute/samples/V1/InstancesClient/reset.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_Instances_Reset_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\InstancesClient; +use Google\Cloud\Compute\V1\Client\InstancesClient; +use Google\Cloud\Compute\V1\ResetInstanceRequest; use Google\Rpc\Status; /** @@ -40,10 +41,16 @@ function reset_sample(string $instance, string $project, string $zone): void // Create a client. $instancesClient = new InstancesClient(); + // Prepare the request message. + $request = (new ResetInstanceRequest()) + ->setInstance($instance) + ->setProject($project) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $instancesClient->reset($instance, $project, $zone); + $response = $instancesClient->reset($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/InstancesClient/resume.php b/Compute/samples/V1/InstancesClient/resume.php index 7541d5880b7a..24382da6aef6 100644 --- a/Compute/samples/V1/InstancesClient/resume.php +++ b/Compute/samples/V1/InstancesClient/resume.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_Instances_Resume_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\InstancesClient; +use Google\Cloud\Compute\V1\Client\InstancesClient; +use Google\Cloud\Compute\V1\ResumeInstanceRequest; use Google\Rpc\Status; /** @@ -40,10 +41,16 @@ function resume_sample(string $instance, string $project, string $zone): void // Create a client. $instancesClient = new InstancesClient(); + // Prepare the request message. + $request = (new ResumeInstanceRequest()) + ->setInstance($instance) + ->setProject($project) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $instancesClient->resume($instance, $project, $zone); + $response = $instancesClient->resume($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/InstancesClient/send_diagnostic_interrupt.php b/Compute/samples/V1/InstancesClient/send_diagnostic_interrupt.php index f542f0b38884..f570d2889db9 100644 --- a/Compute/samples/V1/InstancesClient/send_diagnostic_interrupt.php +++ b/Compute/samples/V1/InstancesClient/send_diagnostic_interrupt.php @@ -24,7 +24,8 @@ // [START compute_v1_generated_Instances_SendDiagnosticInterrupt_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\InstancesClient; +use Google\Cloud\Compute\V1\Client\InstancesClient; +use Google\Cloud\Compute\V1\SendDiagnosticInterruptInstanceRequest; use Google\Cloud\Compute\V1\SendDiagnosticInterruptInstanceResponse; /** @@ -39,10 +40,16 @@ function send_diagnostic_interrupt_sample(string $instance, string $project, str // Create a client. $instancesClient = new InstancesClient(); + // Prepare the request message. + $request = (new SendDiagnosticInterruptInstanceRequest()) + ->setInstance($instance) + ->setProject($project) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var SendDiagnosticInterruptInstanceResponse $response */ - $response = $instancesClient->sendDiagnosticInterrupt($instance, $project, $zone); + $response = $instancesClient->sendDiagnosticInterrupt($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/InstancesClient/set_deletion_protection.php b/Compute/samples/V1/InstancesClient/set_deletion_protection.php index a4a12cb2555c..04574c8433e5 100644 --- a/Compute/samples/V1/InstancesClient/set_deletion_protection.php +++ b/Compute/samples/V1/InstancesClient/set_deletion_protection.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_Instances_SetDeletionProtection_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\InstancesClient; +use Google\Cloud\Compute\V1\Client\InstancesClient; +use Google\Cloud\Compute\V1\SetDeletionProtectionInstanceRequest; use Google\Rpc\Status; /** @@ -40,10 +41,16 @@ function set_deletion_protection_sample(string $project, string $resource, strin // Create a client. $instancesClient = new InstancesClient(); + // Prepare the request message. + $request = (new SetDeletionProtectionInstanceRequest()) + ->setProject($project) + ->setResource($resource) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $instancesClient->setDeletionProtection($project, $resource, $zone); + $response = $instancesClient->setDeletionProtection($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/InstancesClient/set_disk_auto_delete.php b/Compute/samples/V1/InstancesClient/set_disk_auto_delete.php index 8b1e6ed3bda3..43be2134a8c4 100644 --- a/Compute/samples/V1/InstancesClient/set_disk_auto_delete.php +++ b/Compute/samples/V1/InstancesClient/set_disk_auto_delete.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_Instances_SetDiskAutoDelete_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\InstancesClient; +use Google\Cloud\Compute\V1\Client\InstancesClient; +use Google\Cloud\Compute\V1\SetDiskAutoDeleteInstanceRequest; use Google\Rpc\Status; /** @@ -47,16 +48,18 @@ function set_disk_auto_delete_sample( // Create a client. $instancesClient = new InstancesClient(); + // Prepare the request message. + $request = (new SetDiskAutoDeleteInstanceRequest()) + ->setAutoDelete($autoDelete) + ->setDeviceName($deviceName) + ->setInstance($instance) + ->setProject($project) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $instancesClient->setDiskAutoDelete( - $autoDelete, - $deviceName, - $instance, - $project, - $zone - ); + $response = $instancesClient->setDiskAutoDelete($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/InstancesClient/set_iam_policy.php b/Compute/samples/V1/InstancesClient/set_iam_policy.php index cf80d4333258..fef89c92dd97 100644 --- a/Compute/samples/V1/InstancesClient/set_iam_policy.php +++ b/Compute/samples/V1/InstancesClient/set_iam_policy.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_Instances_SetIamPolicy_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\InstancesClient; +use Google\Cloud\Compute\V1\Client\InstancesClient; use Google\Cloud\Compute\V1\Policy; +use Google\Cloud\Compute\V1\SetIamPolicyInstanceRequest; use Google\Cloud\Compute\V1\ZoneSetPolicyRequest; /** @@ -40,18 +41,18 @@ function set_iam_policy_sample(string $project, string $resource, string $zone): // Create a client. $instancesClient = new InstancesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $zoneSetPolicyRequestResource = new ZoneSetPolicyRequest(); + $request = (new SetIamPolicyInstanceRequest()) + ->setProject($project) + ->setResource($resource) + ->setZone($zone) + ->setZoneSetPolicyRequestResource($zoneSetPolicyRequestResource); // Call the API and handle any network failures. try { /** @var Policy $response */ - $response = $instancesClient->setIamPolicy( - $project, - $resource, - $zone, - $zoneSetPolicyRequestResource - ); + $response = $instancesClient->setIamPolicy($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/InstancesClient/set_labels.php b/Compute/samples/V1/InstancesClient/set_labels.php index d69950fbb4a7..7678dadf0004 100644 --- a/Compute/samples/V1/InstancesClient/set_labels.php +++ b/Compute/samples/V1/InstancesClient/set_labels.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_Instances_SetLabels_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\InstancesClient; +use Google\Cloud\Compute\V1\Client\InstancesClient; use Google\Cloud\Compute\V1\InstancesSetLabelsRequest; +use Google\Cloud\Compute\V1\SetLabelsInstanceRequest; use Google\Rpc\Status; /** @@ -41,18 +42,18 @@ function set_labels_sample(string $instance, string $project, string $zone): voi // Create a client. $instancesClient = new InstancesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $instancesSetLabelsRequestResource = new InstancesSetLabelsRequest(); + $request = (new SetLabelsInstanceRequest()) + ->setInstance($instance) + ->setInstancesSetLabelsRequestResource($instancesSetLabelsRequestResource) + ->setProject($project) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $instancesClient->setLabels( - $instance, - $instancesSetLabelsRequestResource, - $project, - $zone - ); + $response = $instancesClient->setLabels($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/InstancesClient/set_machine_resources.php b/Compute/samples/V1/InstancesClient/set_machine_resources.php index ddfdb0530802..382f8de9a52f 100644 --- a/Compute/samples/V1/InstancesClient/set_machine_resources.php +++ b/Compute/samples/V1/InstancesClient/set_machine_resources.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_Instances_SetMachineResources_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\InstancesClient; +use Google\Cloud\Compute\V1\Client\InstancesClient; use Google\Cloud\Compute\V1\InstancesSetMachineResourcesRequest; +use Google\Cloud\Compute\V1\SetMachineResourcesInstanceRequest; use Google\Rpc\Status; /** @@ -41,18 +42,18 @@ function set_machine_resources_sample(string $instance, string $project, string // Create a client. $instancesClient = new InstancesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $instancesSetMachineResourcesRequestResource = new InstancesSetMachineResourcesRequest(); + $request = (new SetMachineResourcesInstanceRequest()) + ->setInstance($instance) + ->setInstancesSetMachineResourcesRequestResource($instancesSetMachineResourcesRequestResource) + ->setProject($project) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $instancesClient->setMachineResources( - $instance, - $instancesSetMachineResourcesRequestResource, - $project, - $zone - ); + $response = $instancesClient->setMachineResources($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/InstancesClient/set_machine_type.php b/Compute/samples/V1/InstancesClient/set_machine_type.php index f8cd638fcc30..b08c10ea7aec 100644 --- a/Compute/samples/V1/InstancesClient/set_machine_type.php +++ b/Compute/samples/V1/InstancesClient/set_machine_type.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_Instances_SetMachineType_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\InstancesClient; +use Google\Cloud\Compute\V1\Client\InstancesClient; use Google\Cloud\Compute\V1\InstancesSetMachineTypeRequest; +use Google\Cloud\Compute\V1\SetMachineTypeInstanceRequest; use Google\Rpc\Status; /** @@ -41,18 +42,18 @@ function set_machine_type_sample(string $instance, string $project, string $zone // Create a client. $instancesClient = new InstancesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $instancesSetMachineTypeRequestResource = new InstancesSetMachineTypeRequest(); + $request = (new SetMachineTypeInstanceRequest()) + ->setInstance($instance) + ->setInstancesSetMachineTypeRequestResource($instancesSetMachineTypeRequestResource) + ->setProject($project) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $instancesClient->setMachineType( - $instance, - $instancesSetMachineTypeRequestResource, - $project, - $zone - ); + $response = $instancesClient->setMachineType($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/InstancesClient/set_metadata.php b/Compute/samples/V1/InstancesClient/set_metadata.php index 5c580fff9d11..eba016bae5ae 100644 --- a/Compute/samples/V1/InstancesClient/set_metadata.php +++ b/Compute/samples/V1/InstancesClient/set_metadata.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_Instances_SetMetadata_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\InstancesClient; +use Google\Cloud\Compute\V1\Client\InstancesClient; use Google\Cloud\Compute\V1\Metadata; +use Google\Cloud\Compute\V1\SetMetadataInstanceRequest; use Google\Rpc\Status; /** @@ -41,13 +42,18 @@ function set_metadata_sample(string $instance, string $project, string $zone): v // Create a client. $instancesClient = new InstancesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $metadataResource = new Metadata(); + $request = (new SetMetadataInstanceRequest()) + ->setInstance($instance) + ->setMetadataResource($metadataResource) + ->setProject($project) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $instancesClient->setMetadata($instance, $metadataResource, $project, $zone); + $response = $instancesClient->setMetadata($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/InstancesClient/set_min_cpu_platform.php b/Compute/samples/V1/InstancesClient/set_min_cpu_platform.php index 4726a0848de3..38c6c7c6fe62 100644 --- a/Compute/samples/V1/InstancesClient/set_min_cpu_platform.php +++ b/Compute/samples/V1/InstancesClient/set_min_cpu_platform.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_Instances_SetMinCpuPlatform_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\InstancesClient; +use Google\Cloud\Compute\V1\Client\InstancesClient; use Google\Cloud\Compute\V1\InstancesSetMinCpuPlatformRequest; +use Google\Cloud\Compute\V1\SetMinCpuPlatformInstanceRequest; use Google\Rpc\Status; /** @@ -41,18 +42,18 @@ function set_min_cpu_platform_sample(string $instance, string $project, string $ // Create a client. $instancesClient = new InstancesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $instancesSetMinCpuPlatformRequestResource = new InstancesSetMinCpuPlatformRequest(); + $request = (new SetMinCpuPlatformInstanceRequest()) + ->setInstance($instance) + ->setInstancesSetMinCpuPlatformRequestResource($instancesSetMinCpuPlatformRequestResource) + ->setProject($project) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $instancesClient->setMinCpuPlatform( - $instance, - $instancesSetMinCpuPlatformRequestResource, - $project, - $zone - ); + $response = $instancesClient->setMinCpuPlatform($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/InstancesClient/set_name.php b/Compute/samples/V1/InstancesClient/set_name.php index 73c062924c4a..eb4e69bbe86d 100644 --- a/Compute/samples/V1/InstancesClient/set_name.php +++ b/Compute/samples/V1/InstancesClient/set_name.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_Instances_SetName_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\InstancesClient; +use Google\Cloud\Compute\V1\Client\InstancesClient; use Google\Cloud\Compute\V1\InstancesSetNameRequest; +use Google\Cloud\Compute\V1\SetNameInstanceRequest; use Google\Rpc\Status; /** @@ -41,13 +42,18 @@ function set_name_sample(string $instance, string $project, string $zone): void // Create a client. $instancesClient = new InstancesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $instancesSetNameRequestResource = new InstancesSetNameRequest(); + $request = (new SetNameInstanceRequest()) + ->setInstance($instance) + ->setInstancesSetNameRequestResource($instancesSetNameRequestResource) + ->setProject($project) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $instancesClient->setName($instance, $instancesSetNameRequestResource, $project, $zone); + $response = $instancesClient->setName($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/InstancesClient/set_scheduling.php b/Compute/samples/V1/InstancesClient/set_scheduling.php index 37cf87525e99..58bd88a5afed 100644 --- a/Compute/samples/V1/InstancesClient/set_scheduling.php +++ b/Compute/samples/V1/InstancesClient/set_scheduling.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_Instances_SetScheduling_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\InstancesClient; +use Google\Cloud\Compute\V1\Client\InstancesClient; use Google\Cloud\Compute\V1\Scheduling; +use Google\Cloud\Compute\V1\SetSchedulingInstanceRequest; use Google\Rpc\Status; /** @@ -41,13 +42,18 @@ function set_scheduling_sample(string $instance, string $project, string $zone): // Create a client. $instancesClient = new InstancesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $schedulingResource = new Scheduling(); + $request = (new SetSchedulingInstanceRequest()) + ->setInstance($instance) + ->setProject($project) + ->setSchedulingResource($schedulingResource) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $instancesClient->setScheduling($instance, $project, $schedulingResource, $zone); + $response = $instancesClient->setScheduling($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/InstancesClient/set_security_policy.php b/Compute/samples/V1/InstancesClient/set_security_policy.php index dd931bd41cb8..dd9c0073fd3a 100644 --- a/Compute/samples/V1/InstancesClient/set_security_policy.php +++ b/Compute/samples/V1/InstancesClient/set_security_policy.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_Instances_SetSecurityPolicy_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\InstancesClient; +use Google\Cloud\Compute\V1\Client\InstancesClient; use Google\Cloud\Compute\V1\InstancesSetSecurityPolicyRequest; +use Google\Cloud\Compute\V1\SetSecurityPolicyInstanceRequest; use Google\Rpc\Status; /** @@ -41,18 +42,18 @@ function set_security_policy_sample(string $instance, string $project, string $z // Create a client. $instancesClient = new InstancesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $instancesSetSecurityPolicyRequestResource = new InstancesSetSecurityPolicyRequest(); + $request = (new SetSecurityPolicyInstanceRequest()) + ->setInstance($instance) + ->setInstancesSetSecurityPolicyRequestResource($instancesSetSecurityPolicyRequestResource) + ->setProject($project) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $instancesClient->setSecurityPolicy( - $instance, - $instancesSetSecurityPolicyRequestResource, - $project, - $zone - ); + $response = $instancesClient->setSecurityPolicy($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/InstancesClient/set_service_account.php b/Compute/samples/V1/InstancesClient/set_service_account.php index d525931496eb..55fb08ecf1b9 100644 --- a/Compute/samples/V1/InstancesClient/set_service_account.php +++ b/Compute/samples/V1/InstancesClient/set_service_account.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_Instances_SetServiceAccount_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\InstancesClient; +use Google\Cloud\Compute\V1\Client\InstancesClient; use Google\Cloud\Compute\V1\InstancesSetServiceAccountRequest; +use Google\Cloud\Compute\V1\SetServiceAccountInstanceRequest; use Google\Rpc\Status; /** @@ -41,18 +42,18 @@ function set_service_account_sample(string $instance, string $project, string $z // Create a client. $instancesClient = new InstancesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $instancesSetServiceAccountRequestResource = new InstancesSetServiceAccountRequest(); + $request = (new SetServiceAccountInstanceRequest()) + ->setInstance($instance) + ->setInstancesSetServiceAccountRequestResource($instancesSetServiceAccountRequestResource) + ->setProject($project) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $instancesClient->setServiceAccount( - $instance, - $instancesSetServiceAccountRequestResource, - $project, - $zone - ); + $response = $instancesClient->setServiceAccount($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/InstancesClient/set_shielded_instance_integrity_policy.php b/Compute/samples/V1/InstancesClient/set_shielded_instance_integrity_policy.php index 50940e671063..408afff73641 100644 --- a/Compute/samples/V1/InstancesClient/set_shielded_instance_integrity_policy.php +++ b/Compute/samples/V1/InstancesClient/set_shielded_instance_integrity_policy.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_Instances_SetShieldedInstanceIntegrityPolicy_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\InstancesClient; +use Google\Cloud\Compute\V1\Client\InstancesClient; +use Google\Cloud\Compute\V1\SetShieldedInstanceIntegrityPolicyInstanceRequest; use Google\Cloud\Compute\V1\ShieldedInstanceIntegrityPolicy; use Google\Rpc\Status; @@ -44,18 +45,18 @@ function set_shielded_instance_integrity_policy_sample( // Create a client. $instancesClient = new InstancesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $shieldedInstanceIntegrityPolicyResource = new ShieldedInstanceIntegrityPolicy(); + $request = (new SetShieldedInstanceIntegrityPolicyInstanceRequest()) + ->setInstance($instance) + ->setProject($project) + ->setShieldedInstanceIntegrityPolicyResource($shieldedInstanceIntegrityPolicyResource) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $instancesClient->setShieldedInstanceIntegrityPolicy( - $instance, - $project, - $shieldedInstanceIntegrityPolicyResource, - $zone - ); + $response = $instancesClient->setShieldedInstanceIntegrityPolicy($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/InstancesClient/set_tags.php b/Compute/samples/V1/InstancesClient/set_tags.php index f51e029ca173..9287352d252d 100644 --- a/Compute/samples/V1/InstancesClient/set_tags.php +++ b/Compute/samples/V1/InstancesClient/set_tags.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_Instances_SetTags_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\InstancesClient; +use Google\Cloud\Compute\V1\Client\InstancesClient; +use Google\Cloud\Compute\V1\SetTagsInstanceRequest; use Google\Cloud\Compute\V1\Tags; use Google\Rpc\Status; @@ -41,13 +42,18 @@ function set_tags_sample(string $instance, string $project, string $zone): void // Create a client. $instancesClient = new InstancesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $tagsResource = new Tags(); + $request = (new SetTagsInstanceRequest()) + ->setInstance($instance) + ->setProject($project) + ->setTagsResource($tagsResource) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $instancesClient->setTags($instance, $project, $tagsResource, $zone); + $response = $instancesClient->setTags($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/InstancesClient/simulate_maintenance_event.php b/Compute/samples/V1/InstancesClient/simulate_maintenance_event.php index f64f067e1a0d..2a57e34c5a5e 100644 --- a/Compute/samples/V1/InstancesClient/simulate_maintenance_event.php +++ b/Compute/samples/V1/InstancesClient/simulate_maintenance_event.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_Instances_SimulateMaintenanceEvent_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\InstancesClient; +use Google\Cloud\Compute\V1\Client\InstancesClient; +use Google\Cloud\Compute\V1\SimulateMaintenanceEventInstanceRequest; use Google\Rpc\Status; /** @@ -40,10 +41,16 @@ function simulate_maintenance_event_sample(string $instance, string $project, st // Create a client. $instancesClient = new InstancesClient(); + // Prepare the request message. + $request = (new SimulateMaintenanceEventInstanceRequest()) + ->setInstance($instance) + ->setProject($project) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $instancesClient->simulateMaintenanceEvent($instance, $project, $zone); + $response = $instancesClient->simulateMaintenanceEvent($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/InstancesClient/start.php b/Compute/samples/V1/InstancesClient/start.php index afe4490297df..46db4990325f 100644 --- a/Compute/samples/V1/InstancesClient/start.php +++ b/Compute/samples/V1/InstancesClient/start.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_Instances_Start_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\InstancesClient; +use Google\Cloud\Compute\V1\Client\InstancesClient; +use Google\Cloud\Compute\V1\StartInstanceRequest; use Google\Rpc\Status; /** @@ -40,10 +41,16 @@ function start_sample(string $instance, string $project, string $zone): void // Create a client. $instancesClient = new InstancesClient(); + // Prepare the request message. + $request = (new StartInstanceRequest()) + ->setInstance($instance) + ->setProject($project) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $instancesClient->start($instance, $project, $zone); + $response = $instancesClient->start($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/InstancesClient/start_with_encryption_key.php b/Compute/samples/V1/InstancesClient/start_with_encryption_key.php index a12f5da8e01e..893507d0b36b 100644 --- a/Compute/samples/V1/InstancesClient/start_with_encryption_key.php +++ b/Compute/samples/V1/InstancesClient/start_with_encryption_key.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_Instances_StartWithEncryptionKey_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\InstancesClient; +use Google\Cloud\Compute\V1\Client\InstancesClient; use Google\Cloud\Compute\V1\InstancesStartWithEncryptionKeyRequest; +use Google\Cloud\Compute\V1\StartWithEncryptionKeyInstanceRequest; use Google\Rpc\Status; /** @@ -41,18 +42,18 @@ function start_with_encryption_key_sample(string $instance, string $project, str // Create a client. $instancesClient = new InstancesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $instancesStartWithEncryptionKeyRequestResource = new InstancesStartWithEncryptionKeyRequest(); + $request = (new StartWithEncryptionKeyInstanceRequest()) + ->setInstance($instance) + ->setInstancesStartWithEncryptionKeyRequestResource($instancesStartWithEncryptionKeyRequestResource) + ->setProject($project) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $instancesClient->startWithEncryptionKey( - $instance, - $instancesStartWithEncryptionKeyRequestResource, - $project, - $zone - ); + $response = $instancesClient->startWithEncryptionKey($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/InstancesClient/stop.php b/Compute/samples/V1/InstancesClient/stop.php index b2339369cc78..84224d66f320 100644 --- a/Compute/samples/V1/InstancesClient/stop.php +++ b/Compute/samples/V1/InstancesClient/stop.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_Instances_Stop_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\InstancesClient; +use Google\Cloud\Compute\V1\Client\InstancesClient; +use Google\Cloud\Compute\V1\StopInstanceRequest; use Google\Rpc\Status; /** @@ -40,10 +41,16 @@ function stop_sample(string $instance, string $project, string $zone): void // Create a client. $instancesClient = new InstancesClient(); + // Prepare the request message. + $request = (new StopInstanceRequest()) + ->setInstance($instance) + ->setProject($project) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $instancesClient->stop($instance, $project, $zone); + $response = $instancesClient->stop($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/InstancesClient/suspend.php b/Compute/samples/V1/InstancesClient/suspend.php index 2de0ebb17ae3..f46a2e6cc683 100644 --- a/Compute/samples/V1/InstancesClient/suspend.php +++ b/Compute/samples/V1/InstancesClient/suspend.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_Instances_Suspend_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\InstancesClient; +use Google\Cloud\Compute\V1\Client\InstancesClient; +use Google\Cloud\Compute\V1\SuspendInstanceRequest; use Google\Rpc\Status; /** @@ -40,10 +41,16 @@ function suspend_sample(string $instance, string $project, string $zone): void // Create a client. $instancesClient = new InstancesClient(); + // Prepare the request message. + $request = (new SuspendInstanceRequest()) + ->setInstance($instance) + ->setProject($project) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $instancesClient->suspend($instance, $project, $zone); + $response = $instancesClient->suspend($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/InstancesClient/test_iam_permissions.php b/Compute/samples/V1/InstancesClient/test_iam_permissions.php index 84613d53cf17..b2f52686724c 100644 --- a/Compute/samples/V1/InstancesClient/test_iam_permissions.php +++ b/Compute/samples/V1/InstancesClient/test_iam_permissions.php @@ -24,7 +24,8 @@ // [START compute_v1_generated_Instances_TestIamPermissions_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\InstancesClient; +use Google\Cloud\Compute\V1\Client\InstancesClient; +use Google\Cloud\Compute\V1\TestIamPermissionsInstanceRequest; use Google\Cloud\Compute\V1\TestPermissionsRequest; use Google\Cloud\Compute\V1\TestPermissionsResponse; @@ -40,18 +41,18 @@ function test_iam_permissions_sample(string $project, string $resource, string $ // Create a client. $instancesClient = new InstancesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $testPermissionsRequestResource = new TestPermissionsRequest(); + $request = (new TestIamPermissionsInstanceRequest()) + ->setProject($project) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var TestPermissionsResponse $response */ - $response = $instancesClient->testIamPermissions( - $project, - $resource, - $testPermissionsRequestResource, - $zone - ); + $response = $instancesClient->testIamPermissions($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/InstancesClient/update.php b/Compute/samples/V1/InstancesClient/update.php index f53117b0f352..34f9716a6962 100644 --- a/Compute/samples/V1/InstancesClient/update.php +++ b/Compute/samples/V1/InstancesClient/update.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_Instances_Update_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\InstancesClient; use Google\Cloud\Compute\V1\Instance; -use Google\Cloud\Compute\V1\InstancesClient; +use Google\Cloud\Compute\V1\UpdateInstanceRequest; use Google\Rpc\Status; /** @@ -41,13 +42,18 @@ function update_sample(string $instance, string $project, string $zone): void // Create a client. $instancesClient = new InstancesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $instanceResource = new Instance(); + $request = (new UpdateInstanceRequest()) + ->setInstance($instance) + ->setInstanceResource($instanceResource) + ->setProject($project) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $instancesClient->update($instance, $instanceResource, $project, $zone); + $response = $instancesClient->update($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/InstancesClient/update_access_config.php b/Compute/samples/V1/InstancesClient/update_access_config.php index 4d700accd47b..dad4c29346ab 100644 --- a/Compute/samples/V1/InstancesClient/update_access_config.php +++ b/Compute/samples/V1/InstancesClient/update_access_config.php @@ -26,7 +26,8 @@ use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; use Google\Cloud\Compute\V1\AccessConfig; -use Google\Cloud\Compute\V1\InstancesClient; +use Google\Cloud\Compute\V1\Client\InstancesClient; +use Google\Cloud\Compute\V1\UpdateAccessConfigInstanceRequest; use Google\Rpc\Status; /** @@ -46,19 +47,19 @@ function update_access_config_sample( // Create a client. $instancesClient = new InstancesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $accessConfigResource = new AccessConfig(); + $request = (new UpdateAccessConfigInstanceRequest()) + ->setAccessConfigResource($accessConfigResource) + ->setInstance($instance) + ->setNetworkInterface($networkInterface) + ->setProject($project) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $instancesClient->updateAccessConfig( - $accessConfigResource, - $instance, - $networkInterface, - $project, - $zone - ); + $response = $instancesClient->updateAccessConfig($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/InstancesClient/update_display_device.php b/Compute/samples/V1/InstancesClient/update_display_device.php index 1baed338a8b4..4f3c667d0e44 100644 --- a/Compute/samples/V1/InstancesClient/update_display_device.php +++ b/Compute/samples/V1/InstancesClient/update_display_device.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_Instances_UpdateDisplayDevice_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\InstancesClient; use Google\Cloud\Compute\V1\DisplayDevice; -use Google\Cloud\Compute\V1\InstancesClient; +use Google\Cloud\Compute\V1\UpdateDisplayDeviceInstanceRequest; use Google\Rpc\Status; /** @@ -41,18 +42,18 @@ function update_display_device_sample(string $instance, string $project, string // Create a client. $instancesClient = new InstancesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $displayDeviceResource = new DisplayDevice(); + $request = (new UpdateDisplayDeviceInstanceRequest()) + ->setDisplayDeviceResource($displayDeviceResource) + ->setInstance($instance) + ->setProject($project) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $instancesClient->updateDisplayDevice( - $displayDeviceResource, - $instance, - $project, - $zone - ); + $response = $instancesClient->updateDisplayDevice($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/InstancesClient/update_network_interface.php b/Compute/samples/V1/InstancesClient/update_network_interface.php index 782a85167282..695b1bbe56c1 100644 --- a/Compute/samples/V1/InstancesClient/update_network_interface.php +++ b/Compute/samples/V1/InstancesClient/update_network_interface.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_Instances_UpdateNetworkInterface_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\InstancesClient; +use Google\Cloud\Compute\V1\Client\InstancesClient; use Google\Cloud\Compute\V1\NetworkInterface; +use Google\Cloud\Compute\V1\UpdateNetworkInterfaceInstanceRequest; use Google\Rpc\Status; /** @@ -46,19 +47,19 @@ function update_network_interface_sample( // Create a client. $instancesClient = new InstancesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $networkInterfaceResource = new NetworkInterface(); + $request = (new UpdateNetworkInterfaceInstanceRequest()) + ->setInstance($instance) + ->setNetworkInterface($networkInterface) + ->setNetworkInterfaceResource($networkInterfaceResource) + ->setProject($project) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $instancesClient->updateNetworkInterface( - $instance, - $networkInterface, - $networkInterfaceResource, - $project, - $zone - ); + $response = $instancesClient->updateNetworkInterface($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/InstancesClient/update_shielded_instance_config.php b/Compute/samples/V1/InstancesClient/update_shielded_instance_config.php index 5d70488d176e..d9074a14355a 100644 --- a/Compute/samples/V1/InstancesClient/update_shielded_instance_config.php +++ b/Compute/samples/V1/InstancesClient/update_shielded_instance_config.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_Instances_UpdateShieldedInstanceConfig_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\InstancesClient; +use Google\Cloud\Compute\V1\Client\InstancesClient; use Google\Cloud\Compute\V1\ShieldedInstanceConfig; +use Google\Cloud\Compute\V1\UpdateShieldedInstanceConfigInstanceRequest; use Google\Rpc\Status; /** @@ -44,18 +45,18 @@ function update_shielded_instance_config_sample( // Create a client. $instancesClient = new InstancesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $shieldedInstanceConfigResource = new ShieldedInstanceConfig(); + $request = (new UpdateShieldedInstanceConfigInstanceRequest()) + ->setInstance($instance) + ->setProject($project) + ->setShieldedInstanceConfigResource($shieldedInstanceConfigResource) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $instancesClient->updateShieldedInstanceConfig( - $instance, - $project, - $shieldedInstanceConfigResource, - $zone - ); + $response = $instancesClient->updateShieldedInstanceConfig($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/InstantSnapshotsClient/aggregated_list.php b/Compute/samples/V1/InstantSnapshotsClient/aggregated_list.php index 3145f1f9557b..2053ca9c6a67 100644 --- a/Compute/samples/V1/InstantSnapshotsClient/aggregated_list.php +++ b/Compute/samples/V1/InstantSnapshotsClient/aggregated_list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_InstantSnapshots_AggregatedList_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\InstantSnapshotsClient; +use Google\Cloud\Compute\V1\AggregatedListInstantSnapshotsRequest; +use Google\Cloud\Compute\V1\Client\InstantSnapshotsClient; /** * Retrieves an aggregated list of instantSnapshots. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. @@ -37,10 +38,14 @@ function aggregated_list_sample(string $project): void // Create a client. $instantSnapshotsClient = new InstantSnapshotsClient(); + // Prepare the request message. + $request = (new AggregatedListInstantSnapshotsRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $instantSnapshotsClient->aggregatedList($project); + $response = $instantSnapshotsClient->aggregatedList($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/InstantSnapshotsClient/delete.php b/Compute/samples/V1/InstantSnapshotsClient/delete.php index a0365b8d709b..ccbaa8e7d5d8 100644 --- a/Compute/samples/V1/InstantSnapshotsClient/delete.php +++ b/Compute/samples/V1/InstantSnapshotsClient/delete.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_InstantSnapshots_Delete_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\InstantSnapshotsClient; +use Google\Cloud\Compute\V1\Client\InstantSnapshotsClient; +use Google\Cloud\Compute\V1\DeleteInstantSnapshotRequest; use Google\Rpc\Status; /** @@ -40,10 +41,16 @@ function delete_sample(string $instantSnapshot, string $project, string $zone): // Create a client. $instantSnapshotsClient = new InstantSnapshotsClient(); + // Prepare the request message. + $request = (new DeleteInstantSnapshotRequest()) + ->setInstantSnapshot($instantSnapshot) + ->setProject($project) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $instantSnapshotsClient->delete($instantSnapshot, $project, $zone); + $response = $instantSnapshotsClient->delete($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/InstantSnapshotsClient/get.php b/Compute/samples/V1/InstantSnapshotsClient/get.php index ee64acebdd66..673143c50412 100644 --- a/Compute/samples/V1/InstantSnapshotsClient/get.php +++ b/Compute/samples/V1/InstantSnapshotsClient/get.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_InstantSnapshots_Get_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\InstantSnapshotsClient; +use Google\Cloud\Compute\V1\GetInstantSnapshotRequest; use Google\Cloud\Compute\V1\InstantSnapshot; -use Google\Cloud\Compute\V1\InstantSnapshotsClient; /** * Returns the specified InstantSnapshot resource in the specified zone. @@ -39,10 +40,16 @@ function get_sample(string $instantSnapshot, string $project, string $zone): voi // Create a client. $instantSnapshotsClient = new InstantSnapshotsClient(); + // Prepare the request message. + $request = (new GetInstantSnapshotRequest()) + ->setInstantSnapshot($instantSnapshot) + ->setProject($project) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var InstantSnapshot $response */ - $response = $instantSnapshotsClient->get($instantSnapshot, $project, $zone); + $response = $instantSnapshotsClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/InstantSnapshotsClient/get_iam_policy.php b/Compute/samples/V1/InstantSnapshotsClient/get_iam_policy.php index e80fe05bc1d4..384abe63de37 100644 --- a/Compute/samples/V1/InstantSnapshotsClient/get_iam_policy.php +++ b/Compute/samples/V1/InstantSnapshotsClient/get_iam_policy.php @@ -24,7 +24,8 @@ // [START compute_v1_generated_InstantSnapshots_GetIamPolicy_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\InstantSnapshotsClient; +use Google\Cloud\Compute\V1\Client\InstantSnapshotsClient; +use Google\Cloud\Compute\V1\GetIamPolicyInstantSnapshotRequest; use Google\Cloud\Compute\V1\Policy; /** @@ -39,10 +40,16 @@ function get_iam_policy_sample(string $project, string $resource, string $zone): // Create a client. $instantSnapshotsClient = new InstantSnapshotsClient(); + // Prepare the request message. + $request = (new GetIamPolicyInstantSnapshotRequest()) + ->setProject($project) + ->setResource($resource) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var Policy $response */ - $response = $instantSnapshotsClient->getIamPolicy($project, $resource, $zone); + $response = $instantSnapshotsClient->getIamPolicy($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/InstantSnapshotsClient/insert.php b/Compute/samples/V1/InstantSnapshotsClient/insert.php index c76978234d25..7b770fc87d5b 100644 --- a/Compute/samples/V1/InstantSnapshotsClient/insert.php +++ b/Compute/samples/V1/InstantSnapshotsClient/insert.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_InstantSnapshots_Insert_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\InstantSnapshotsClient; +use Google\Cloud\Compute\V1\InsertInstantSnapshotRequest; use Google\Cloud\Compute\V1\InstantSnapshot; -use Google\Cloud\Compute\V1\InstantSnapshotsClient; use Google\Rpc\Status; /** @@ -40,13 +41,17 @@ function insert_sample(string $project, string $zone): void // Create a client. $instantSnapshotsClient = new InstantSnapshotsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $instantSnapshotResource = new InstantSnapshot(); + $request = (new InsertInstantSnapshotRequest()) + ->setInstantSnapshotResource($instantSnapshotResource) + ->setProject($project) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $instantSnapshotsClient->insert($instantSnapshotResource, $project, $zone); + $response = $instantSnapshotsClient->insert($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/InstantSnapshotsClient/list.php b/Compute/samples/V1/InstantSnapshotsClient/list.php index 3c6d08fd85c0..0a2a3522fa30 100644 --- a/Compute/samples/V1/InstantSnapshotsClient/list.php +++ b/Compute/samples/V1/InstantSnapshotsClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_InstantSnapshots_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\InstantSnapshotsClient; +use Google\Cloud\Compute\V1\Client\InstantSnapshotsClient; +use Google\Cloud\Compute\V1\ListInstantSnapshotsRequest; /** * Retrieves the list of InstantSnapshot resources contained within the specified zone. @@ -38,10 +39,15 @@ function list_sample(string $project, string $zone): void // Create a client. $instantSnapshotsClient = new InstantSnapshotsClient(); + // Prepare the request message. + $request = (new ListInstantSnapshotsRequest()) + ->setProject($project) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $instantSnapshotsClient->list($project, $zone); + $response = $instantSnapshotsClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/InstantSnapshotsClient/set_iam_policy.php b/Compute/samples/V1/InstantSnapshotsClient/set_iam_policy.php index 93512a1834cb..7b8ddeea5c5a 100644 --- a/Compute/samples/V1/InstantSnapshotsClient/set_iam_policy.php +++ b/Compute/samples/V1/InstantSnapshotsClient/set_iam_policy.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_InstantSnapshots_SetIamPolicy_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\InstantSnapshotsClient; +use Google\Cloud\Compute\V1\Client\InstantSnapshotsClient; use Google\Cloud\Compute\V1\Policy; +use Google\Cloud\Compute\V1\SetIamPolicyInstantSnapshotRequest; use Google\Cloud\Compute\V1\ZoneSetPolicyRequest; /** @@ -40,18 +41,18 @@ function set_iam_policy_sample(string $project, string $resource, string $zone): // Create a client. $instantSnapshotsClient = new InstantSnapshotsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $zoneSetPolicyRequestResource = new ZoneSetPolicyRequest(); + $request = (new SetIamPolicyInstantSnapshotRequest()) + ->setProject($project) + ->setResource($resource) + ->setZone($zone) + ->setZoneSetPolicyRequestResource($zoneSetPolicyRequestResource); // Call the API and handle any network failures. try { /** @var Policy $response */ - $response = $instantSnapshotsClient->setIamPolicy( - $project, - $resource, - $zone, - $zoneSetPolicyRequestResource - ); + $response = $instantSnapshotsClient->setIamPolicy($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/InstantSnapshotsClient/set_labels.php b/Compute/samples/V1/InstantSnapshotsClient/set_labels.php index 9cf50c847daa..0f3dd644405f 100644 --- a/Compute/samples/V1/InstantSnapshotsClient/set_labels.php +++ b/Compute/samples/V1/InstantSnapshotsClient/set_labels.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_InstantSnapshots_SetLabels_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\InstantSnapshotsClient; +use Google\Cloud\Compute\V1\Client\InstantSnapshotsClient; +use Google\Cloud\Compute\V1\SetLabelsInstantSnapshotRequest; use Google\Cloud\Compute\V1\ZoneSetLabelsRequest; use Google\Rpc\Status; @@ -41,18 +42,18 @@ function set_labels_sample(string $project, string $resource, string $zone): voi // Create a client. $instantSnapshotsClient = new InstantSnapshotsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $zoneSetLabelsRequestResource = new ZoneSetLabelsRequest(); + $request = (new SetLabelsInstantSnapshotRequest()) + ->setProject($project) + ->setResource($resource) + ->setZone($zone) + ->setZoneSetLabelsRequestResource($zoneSetLabelsRequestResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $instantSnapshotsClient->setLabels( - $project, - $resource, - $zone, - $zoneSetLabelsRequestResource - ); + $response = $instantSnapshotsClient->setLabels($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/InstantSnapshotsClient/test_iam_permissions.php b/Compute/samples/V1/InstantSnapshotsClient/test_iam_permissions.php index 0ccd513b5ccb..2d9ee5a58b9e 100644 --- a/Compute/samples/V1/InstantSnapshotsClient/test_iam_permissions.php +++ b/Compute/samples/V1/InstantSnapshotsClient/test_iam_permissions.php @@ -24,7 +24,8 @@ // [START compute_v1_generated_InstantSnapshots_TestIamPermissions_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\InstantSnapshotsClient; +use Google\Cloud\Compute\V1\Client\InstantSnapshotsClient; +use Google\Cloud\Compute\V1\TestIamPermissionsInstantSnapshotRequest; use Google\Cloud\Compute\V1\TestPermissionsRequest; use Google\Cloud\Compute\V1\TestPermissionsResponse; @@ -40,18 +41,18 @@ function test_iam_permissions_sample(string $project, string $resource, string $ // Create a client. $instantSnapshotsClient = new InstantSnapshotsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $testPermissionsRequestResource = new TestPermissionsRequest(); + $request = (new TestIamPermissionsInstantSnapshotRequest()) + ->setProject($project) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var TestPermissionsResponse $response */ - $response = $instantSnapshotsClient->testIamPermissions( - $project, - $resource, - $testPermissionsRequestResource, - $zone - ); + $response = $instantSnapshotsClient->testIamPermissions($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/InterconnectAttachmentsClient/aggregated_list.php b/Compute/samples/V1/InterconnectAttachmentsClient/aggregated_list.php index b40ac195cadb..d4377e4176fe 100644 --- a/Compute/samples/V1/InterconnectAttachmentsClient/aggregated_list.php +++ b/Compute/samples/V1/InterconnectAttachmentsClient/aggregated_list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_InterconnectAttachments_AggregatedList_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\InterconnectAttachmentsClient; +use Google\Cloud\Compute\V1\AggregatedListInterconnectAttachmentsRequest; +use Google\Cloud\Compute\V1\Client\InterconnectAttachmentsClient; /** * Retrieves an aggregated list of interconnect attachments. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. @@ -37,10 +38,14 @@ function aggregated_list_sample(string $project): void // Create a client. $interconnectAttachmentsClient = new InterconnectAttachmentsClient(); + // Prepare the request message. + $request = (new AggregatedListInterconnectAttachmentsRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $interconnectAttachmentsClient->aggregatedList($project); + $response = $interconnectAttachmentsClient->aggregatedList($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/InterconnectAttachmentsClient/delete.php b/Compute/samples/V1/InterconnectAttachmentsClient/delete.php index aeb17255079b..1869255941cd 100644 --- a/Compute/samples/V1/InterconnectAttachmentsClient/delete.php +++ b/Compute/samples/V1/InterconnectAttachmentsClient/delete.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_InterconnectAttachments_Delete_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\InterconnectAttachmentsClient; +use Google\Cloud\Compute\V1\Client\InterconnectAttachmentsClient; +use Google\Cloud\Compute\V1\DeleteInterconnectAttachmentRequest; use Google\Rpc\Status; /** @@ -40,10 +41,16 @@ function delete_sample(string $interconnectAttachment, string $project, string $ // Create a client. $interconnectAttachmentsClient = new InterconnectAttachmentsClient(); + // Prepare the request message. + $request = (new DeleteInterconnectAttachmentRequest()) + ->setInterconnectAttachment($interconnectAttachment) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $interconnectAttachmentsClient->delete($interconnectAttachment, $project, $region); + $response = $interconnectAttachmentsClient->delete($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/InterconnectAttachmentsClient/get.php b/Compute/samples/V1/InterconnectAttachmentsClient/get.php index a3d4daf9ed7f..513fa796442b 100644 --- a/Compute/samples/V1/InterconnectAttachmentsClient/get.php +++ b/Compute/samples/V1/InterconnectAttachmentsClient/get.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_InterconnectAttachments_Get_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\InterconnectAttachmentsClient; +use Google\Cloud\Compute\V1\GetInterconnectAttachmentRequest; use Google\Cloud\Compute\V1\InterconnectAttachment; -use Google\Cloud\Compute\V1\InterconnectAttachmentsClient; /** * Returns the specified interconnect attachment. @@ -39,10 +40,16 @@ function get_sample(string $interconnectAttachment, string $project, string $reg // Create a client. $interconnectAttachmentsClient = new InterconnectAttachmentsClient(); + // Prepare the request message. + $request = (new GetInterconnectAttachmentRequest()) + ->setInterconnectAttachment($interconnectAttachment) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var InterconnectAttachment $response */ - $response = $interconnectAttachmentsClient->get($interconnectAttachment, $project, $region); + $response = $interconnectAttachmentsClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/InterconnectAttachmentsClient/insert.php b/Compute/samples/V1/InterconnectAttachmentsClient/insert.php index f7f9a6df3ab8..a290938033d3 100644 --- a/Compute/samples/V1/InterconnectAttachmentsClient/insert.php +++ b/Compute/samples/V1/InterconnectAttachmentsClient/insert.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_InterconnectAttachments_Insert_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\InterconnectAttachmentsClient; +use Google\Cloud\Compute\V1\InsertInterconnectAttachmentRequest; use Google\Cloud\Compute\V1\InterconnectAttachment; -use Google\Cloud\Compute\V1\InterconnectAttachmentsClient; use Google\Rpc\Status; /** @@ -40,17 +41,17 @@ function insert_sample(string $project, string $region): void // Create a client. $interconnectAttachmentsClient = new InterconnectAttachmentsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $interconnectAttachmentResource = new InterconnectAttachment(); + $request = (new InsertInterconnectAttachmentRequest()) + ->setInterconnectAttachmentResource($interconnectAttachmentResource) + ->setProject($project) + ->setRegion($region); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $interconnectAttachmentsClient->insert( - $interconnectAttachmentResource, - $project, - $region - ); + $response = $interconnectAttachmentsClient->insert($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/InterconnectAttachmentsClient/list.php b/Compute/samples/V1/InterconnectAttachmentsClient/list.php index e033f63b1d45..75f4b72c4912 100644 --- a/Compute/samples/V1/InterconnectAttachmentsClient/list.php +++ b/Compute/samples/V1/InterconnectAttachmentsClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_InterconnectAttachments_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\InterconnectAttachmentsClient; +use Google\Cloud\Compute\V1\Client\InterconnectAttachmentsClient; +use Google\Cloud\Compute\V1\ListInterconnectAttachmentsRequest; /** * Retrieves the list of interconnect attachments contained within the specified region. @@ -38,10 +39,15 @@ function list_sample(string $project, string $region): void // Create a client. $interconnectAttachmentsClient = new InterconnectAttachmentsClient(); + // Prepare the request message. + $request = (new ListInterconnectAttachmentsRequest()) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $interconnectAttachmentsClient->list($project, $region); + $response = $interconnectAttachmentsClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/InterconnectAttachmentsClient/patch.php b/Compute/samples/V1/InterconnectAttachmentsClient/patch.php index 31168b40ed77..66f25ded1c83 100644 --- a/Compute/samples/V1/InterconnectAttachmentsClient/patch.php +++ b/Compute/samples/V1/InterconnectAttachmentsClient/patch.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_InterconnectAttachments_Patch_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\InterconnectAttachmentsClient; use Google\Cloud\Compute\V1\InterconnectAttachment; -use Google\Cloud\Compute\V1\InterconnectAttachmentsClient; +use Google\Cloud\Compute\V1\PatchInterconnectAttachmentRequest; use Google\Rpc\Status; /** @@ -41,18 +42,18 @@ function patch_sample(string $interconnectAttachment, string $project, string $r // Create a client. $interconnectAttachmentsClient = new InterconnectAttachmentsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $interconnectAttachmentResource = new InterconnectAttachment(); + $request = (new PatchInterconnectAttachmentRequest()) + ->setInterconnectAttachment($interconnectAttachment) + ->setInterconnectAttachmentResource($interconnectAttachmentResource) + ->setProject($project) + ->setRegion($region); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $interconnectAttachmentsClient->patch( - $interconnectAttachment, - $interconnectAttachmentResource, - $project, - $region - ); + $response = $interconnectAttachmentsClient->patch($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/InterconnectAttachmentsClient/set_labels.php b/Compute/samples/V1/InterconnectAttachmentsClient/set_labels.php index bae5def6770c..2d61ac20072f 100644 --- a/Compute/samples/V1/InterconnectAttachmentsClient/set_labels.php +++ b/Compute/samples/V1/InterconnectAttachmentsClient/set_labels.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_InterconnectAttachments_SetLabels_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\InterconnectAttachmentsClient; +use Google\Cloud\Compute\V1\Client\InterconnectAttachmentsClient; use Google\Cloud\Compute\V1\RegionSetLabelsRequest; +use Google\Cloud\Compute\V1\SetLabelsInterconnectAttachmentRequest; use Google\Rpc\Status; /** @@ -41,18 +42,18 @@ function set_labels_sample(string $project, string $region, string $resource): v // Create a client. $interconnectAttachmentsClient = new InterconnectAttachmentsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $regionSetLabelsRequestResource = new RegionSetLabelsRequest(); + $request = (new SetLabelsInterconnectAttachmentRequest()) + ->setProject($project) + ->setRegion($region) + ->setRegionSetLabelsRequestResource($regionSetLabelsRequestResource) + ->setResource($resource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $interconnectAttachmentsClient->setLabels( - $project, - $region, - $regionSetLabelsRequestResource, - $resource - ); + $response = $interconnectAttachmentsClient->setLabels($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/InterconnectLocationsClient/get.php b/Compute/samples/V1/InterconnectLocationsClient/get.php index a0a607beb42d..3620ebbb3916 100644 --- a/Compute/samples/V1/InterconnectLocationsClient/get.php +++ b/Compute/samples/V1/InterconnectLocationsClient/get.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_InterconnectLocations_Get_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\InterconnectLocationsClient; +use Google\Cloud\Compute\V1\GetInterconnectLocationRequest; use Google\Cloud\Compute\V1\InterconnectLocation; -use Google\Cloud\Compute\V1\InterconnectLocationsClient; /** * Returns the details for the specified interconnect location. Gets a list of available interconnect locations by making a list() request. @@ -38,10 +39,15 @@ function get_sample(string $interconnectLocation, string $project): void // Create a client. $interconnectLocationsClient = new InterconnectLocationsClient(); + // Prepare the request message. + $request = (new GetInterconnectLocationRequest()) + ->setInterconnectLocation($interconnectLocation) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var InterconnectLocation $response */ - $response = $interconnectLocationsClient->get($interconnectLocation, $project); + $response = $interconnectLocationsClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/InterconnectLocationsClient/list.php b/Compute/samples/V1/InterconnectLocationsClient/list.php index 6602f287eec9..8c8953a3d959 100644 --- a/Compute/samples/V1/InterconnectLocationsClient/list.php +++ b/Compute/samples/V1/InterconnectLocationsClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_InterconnectLocations_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\InterconnectLocationsClient; +use Google\Cloud\Compute\V1\Client\InterconnectLocationsClient; +use Google\Cloud\Compute\V1\ListInterconnectLocationsRequest; /** * Retrieves the list of interconnect locations available to the specified project. @@ -37,10 +38,14 @@ function list_sample(string $project): void // Create a client. $interconnectLocationsClient = new InterconnectLocationsClient(); + // Prepare the request message. + $request = (new ListInterconnectLocationsRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $interconnectLocationsClient->list($project); + $response = $interconnectLocationsClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/InterconnectRemoteLocationsClient/get.php b/Compute/samples/V1/InterconnectRemoteLocationsClient/get.php index 3dbc8aa1ef52..70634af53db0 100644 --- a/Compute/samples/V1/InterconnectRemoteLocationsClient/get.php +++ b/Compute/samples/V1/InterconnectRemoteLocationsClient/get.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_InterconnectRemoteLocations_Get_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\InterconnectRemoteLocationsClient; +use Google\Cloud\Compute\V1\GetInterconnectRemoteLocationRequest; use Google\Cloud\Compute\V1\InterconnectRemoteLocation; -use Google\Cloud\Compute\V1\InterconnectRemoteLocationsClient; /** * Returns the details for the specified interconnect remote location. Gets a list of available interconnect remote locations by making a list() request. @@ -38,10 +39,15 @@ function get_sample(string $interconnectRemoteLocation, string $project): void // Create a client. $interconnectRemoteLocationsClient = new InterconnectRemoteLocationsClient(); + // Prepare the request message. + $request = (new GetInterconnectRemoteLocationRequest()) + ->setInterconnectRemoteLocation($interconnectRemoteLocation) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var InterconnectRemoteLocation $response */ - $response = $interconnectRemoteLocationsClient->get($interconnectRemoteLocation, $project); + $response = $interconnectRemoteLocationsClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/InterconnectRemoteLocationsClient/list.php b/Compute/samples/V1/InterconnectRemoteLocationsClient/list.php index 967c03d86f81..28a5cf60a06b 100644 --- a/Compute/samples/V1/InterconnectRemoteLocationsClient/list.php +++ b/Compute/samples/V1/InterconnectRemoteLocationsClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_InterconnectRemoteLocations_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\InterconnectRemoteLocationsClient; +use Google\Cloud\Compute\V1\Client\InterconnectRemoteLocationsClient; +use Google\Cloud\Compute\V1\ListInterconnectRemoteLocationsRequest; /** * Retrieves the list of interconnect remote locations available to the specified project. @@ -37,10 +38,14 @@ function list_sample(string $project): void // Create a client. $interconnectRemoteLocationsClient = new InterconnectRemoteLocationsClient(); + // Prepare the request message. + $request = (new ListInterconnectRemoteLocationsRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $interconnectRemoteLocationsClient->list($project); + $response = $interconnectRemoteLocationsClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/InterconnectsClient/delete.php b/Compute/samples/V1/InterconnectsClient/delete.php index 23e6cf75cb10..0912e907f6ab 100644 --- a/Compute/samples/V1/InterconnectsClient/delete.php +++ b/Compute/samples/V1/InterconnectsClient/delete.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_Interconnects_Delete_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\InterconnectsClient; +use Google\Cloud\Compute\V1\Client\InterconnectsClient; +use Google\Cloud\Compute\V1\DeleteInterconnectRequest; use Google\Rpc\Status; /** @@ -39,10 +40,15 @@ function delete_sample(string $interconnect, string $project): void // Create a client. $interconnectsClient = new InterconnectsClient(); + // Prepare the request message. + $request = (new DeleteInterconnectRequest()) + ->setInterconnect($interconnect) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $interconnectsClient->delete($interconnect, $project); + $response = $interconnectsClient->delete($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/InterconnectsClient/get.php b/Compute/samples/V1/InterconnectsClient/get.php index e84cd5f538e0..635503972525 100644 --- a/Compute/samples/V1/InterconnectsClient/get.php +++ b/Compute/samples/V1/InterconnectsClient/get.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_Interconnects_Get_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\InterconnectsClient; +use Google\Cloud\Compute\V1\GetInterconnectRequest; use Google\Cloud\Compute\V1\Interconnect; -use Google\Cloud\Compute\V1\InterconnectsClient; /** * Returns the specified Interconnect. Get a list of available Interconnects by making a list() request. @@ -38,10 +39,15 @@ function get_sample(string $interconnect, string $project): void // Create a client. $interconnectsClient = new InterconnectsClient(); + // Prepare the request message. + $request = (new GetInterconnectRequest()) + ->setInterconnect($interconnect) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var Interconnect $response */ - $response = $interconnectsClient->get($interconnect, $project); + $response = $interconnectsClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/InterconnectsClient/get_diagnostics.php b/Compute/samples/V1/InterconnectsClient/get_diagnostics.php index 2cca78bf9a32..30ab83427555 100644 --- a/Compute/samples/V1/InterconnectsClient/get_diagnostics.php +++ b/Compute/samples/V1/InterconnectsClient/get_diagnostics.php @@ -24,7 +24,8 @@ // [START compute_v1_generated_Interconnects_GetDiagnostics_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\InterconnectsClient; +use Google\Cloud\Compute\V1\Client\InterconnectsClient; +use Google\Cloud\Compute\V1\GetDiagnosticsInterconnectRequest; use Google\Cloud\Compute\V1\InterconnectsGetDiagnosticsResponse; /** @@ -38,10 +39,15 @@ function get_diagnostics_sample(string $interconnect, string $project): void // Create a client. $interconnectsClient = new InterconnectsClient(); + // Prepare the request message. + $request = (new GetDiagnosticsInterconnectRequest()) + ->setInterconnect($interconnect) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var InterconnectsGetDiagnosticsResponse $response */ - $response = $interconnectsClient->getDiagnostics($interconnect, $project); + $response = $interconnectsClient->getDiagnostics($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/InterconnectsClient/get_macsec_config.php b/Compute/samples/V1/InterconnectsClient/get_macsec_config.php index 30c2a975e830..10509d4b4476 100644 --- a/Compute/samples/V1/InterconnectsClient/get_macsec_config.php +++ b/Compute/samples/V1/InterconnectsClient/get_macsec_config.php @@ -24,7 +24,8 @@ // [START compute_v1_generated_Interconnects_GetMacsecConfig_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\InterconnectsClient; +use Google\Cloud\Compute\V1\Client\InterconnectsClient; +use Google\Cloud\Compute\V1\GetMacsecConfigInterconnectRequest; use Google\Cloud\Compute\V1\InterconnectsGetMacsecConfigResponse; /** @@ -38,10 +39,15 @@ function get_macsec_config_sample(string $interconnect, string $project): void // Create a client. $interconnectsClient = new InterconnectsClient(); + // Prepare the request message. + $request = (new GetMacsecConfigInterconnectRequest()) + ->setInterconnect($interconnect) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var InterconnectsGetMacsecConfigResponse $response */ - $response = $interconnectsClient->getMacsecConfig($interconnect, $project); + $response = $interconnectsClient->getMacsecConfig($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/InterconnectsClient/insert.php b/Compute/samples/V1/InterconnectsClient/insert.php index 6dcf68d04b98..273fd5af8694 100644 --- a/Compute/samples/V1/InterconnectsClient/insert.php +++ b/Compute/samples/V1/InterconnectsClient/insert.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_Interconnects_Insert_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\InterconnectsClient; +use Google\Cloud\Compute\V1\InsertInterconnectRequest; use Google\Cloud\Compute\V1\Interconnect; -use Google\Cloud\Compute\V1\InterconnectsClient; use Google\Rpc\Status; /** @@ -39,13 +40,16 @@ function insert_sample(string $project): void // Create a client. $interconnectsClient = new InterconnectsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $interconnectResource = new Interconnect(); + $request = (new InsertInterconnectRequest()) + ->setInterconnectResource($interconnectResource) + ->setProject($project); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $interconnectsClient->insert($interconnectResource, $project); + $response = $interconnectsClient->insert($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/InterconnectsClient/list.php b/Compute/samples/V1/InterconnectsClient/list.php index 60803f79d106..92e04905fd6d 100644 --- a/Compute/samples/V1/InterconnectsClient/list.php +++ b/Compute/samples/V1/InterconnectsClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_Interconnects_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\InterconnectsClient; +use Google\Cloud\Compute\V1\Client\InterconnectsClient; +use Google\Cloud\Compute\V1\ListInterconnectsRequest; /** * Retrieves the list of Interconnects available to the specified project. @@ -37,10 +38,14 @@ function list_sample(string $project): void // Create a client. $interconnectsClient = new InterconnectsClient(); + // Prepare the request message. + $request = (new ListInterconnectsRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $interconnectsClient->list($project); + $response = $interconnectsClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/InterconnectsClient/patch.php b/Compute/samples/V1/InterconnectsClient/patch.php index 8f154bbd0a04..3b24e0e5f717 100644 --- a/Compute/samples/V1/InterconnectsClient/patch.php +++ b/Compute/samples/V1/InterconnectsClient/patch.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_Interconnects_Patch_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\InterconnectsClient; use Google\Cloud\Compute\V1\Interconnect; -use Google\Cloud\Compute\V1\InterconnectsClient; +use Google\Cloud\Compute\V1\PatchInterconnectRequest; use Google\Rpc\Status; /** @@ -40,13 +41,17 @@ function patch_sample(string $interconnect, string $project): void // Create a client. $interconnectsClient = new InterconnectsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $interconnectResource = new Interconnect(); + $request = (new PatchInterconnectRequest()) + ->setInterconnect($interconnect) + ->setInterconnectResource($interconnectResource) + ->setProject($project); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $interconnectsClient->patch($interconnect, $interconnectResource, $project); + $response = $interconnectsClient->patch($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/InterconnectsClient/set_labels.php b/Compute/samples/V1/InterconnectsClient/set_labels.php index ddd1eeefa9f2..2af2526162ee 100644 --- a/Compute/samples/V1/InterconnectsClient/set_labels.php +++ b/Compute/samples/V1/InterconnectsClient/set_labels.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_Interconnects_SetLabels_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\InterconnectsClient; use Google\Cloud\Compute\V1\GlobalSetLabelsRequest; -use Google\Cloud\Compute\V1\InterconnectsClient; +use Google\Cloud\Compute\V1\SetLabelsInterconnectRequest; use Google\Rpc\Status; /** @@ -40,13 +41,17 @@ function set_labels_sample(string $project, string $resource): void // Create a client. $interconnectsClient = new InterconnectsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $globalSetLabelsRequestResource = new GlobalSetLabelsRequest(); + $request = (new SetLabelsInterconnectRequest()) + ->setGlobalSetLabelsRequestResource($globalSetLabelsRequestResource) + ->setProject($project) + ->setResource($resource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $interconnectsClient->setLabels($globalSetLabelsRequestResource, $project, $resource); + $response = $interconnectsClient->setLabels($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/LicenseCodesClient/get.php b/Compute/samples/V1/LicenseCodesClient/get.php index 6de9a547bb6c..bda5cee9dc91 100644 --- a/Compute/samples/V1/LicenseCodesClient/get.php +++ b/Compute/samples/V1/LicenseCodesClient/get.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_LicenseCodes_Get_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\LicenseCodesClient; +use Google\Cloud\Compute\V1\GetLicenseCodeRequest; use Google\Cloud\Compute\V1\LicenseCode; -use Google\Cloud\Compute\V1\LicenseCodesClient; /** * Return a specified license code. License codes are mirrored across all projects that have permissions to read the License Code. *Caution* This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. @@ -38,10 +39,15 @@ function get_sample(string $licenseCode, string $project): void // Create a client. $licenseCodesClient = new LicenseCodesClient(); + // Prepare the request message. + $request = (new GetLicenseCodeRequest()) + ->setLicenseCode($licenseCode) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var LicenseCode $response */ - $response = $licenseCodesClient->get($licenseCode, $project); + $response = $licenseCodesClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/LicenseCodesClient/test_iam_permissions.php b/Compute/samples/V1/LicenseCodesClient/test_iam_permissions.php index ab9f19b0b1c8..dc1c64fce5ef 100644 --- a/Compute/samples/V1/LicenseCodesClient/test_iam_permissions.php +++ b/Compute/samples/V1/LicenseCodesClient/test_iam_permissions.php @@ -24,7 +24,8 @@ // [START compute_v1_generated_LicenseCodes_TestIamPermissions_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\LicenseCodesClient; +use Google\Cloud\Compute\V1\Client\LicenseCodesClient; +use Google\Cloud\Compute\V1\TestIamPermissionsLicenseCodeRequest; use Google\Cloud\Compute\V1\TestPermissionsRequest; use Google\Cloud\Compute\V1\TestPermissionsResponse; @@ -39,17 +40,17 @@ function test_iam_permissions_sample(string $project, string $resource): void // Create a client. $licenseCodesClient = new LicenseCodesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $testPermissionsRequestResource = new TestPermissionsRequest(); + $request = (new TestIamPermissionsLicenseCodeRequest()) + ->setProject($project) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); // Call the API and handle any network failures. try { /** @var TestPermissionsResponse $response */ - $response = $licenseCodesClient->testIamPermissions( - $project, - $resource, - $testPermissionsRequestResource - ); + $response = $licenseCodesClient->testIamPermissions($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/LicensesClient/delete.php b/Compute/samples/V1/LicensesClient/delete.php index 4956f498c9d0..623dc0561eea 100644 --- a/Compute/samples/V1/LicensesClient/delete.php +++ b/Compute/samples/V1/LicensesClient/delete.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_Licenses_Delete_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\LicensesClient; +use Google\Cloud\Compute\V1\Client\LicensesClient; +use Google\Cloud\Compute\V1\DeleteLicenseRequest; use Google\Rpc\Status; /** @@ -39,10 +40,15 @@ function delete_sample(string $license, string $project): void // Create a client. $licensesClient = new LicensesClient(); + // Prepare the request message. + $request = (new DeleteLicenseRequest()) + ->setLicense($license) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $licensesClient->delete($license, $project); + $response = $licensesClient->delete($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/LicensesClient/get.php b/Compute/samples/V1/LicensesClient/get.php index 1e13f091ca6e..81f6b561cd67 100644 --- a/Compute/samples/V1/LicensesClient/get.php +++ b/Compute/samples/V1/LicensesClient/get.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_Licenses_Get_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\LicensesClient; +use Google\Cloud\Compute\V1\GetLicenseRequest; use Google\Cloud\Compute\V1\License; -use Google\Cloud\Compute\V1\LicensesClient; /** * Returns the specified License resource. *Caution* This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. @@ -38,10 +39,15 @@ function get_sample(string $license, string $project): void // Create a client. $licensesClient = new LicensesClient(); + // Prepare the request message. + $request = (new GetLicenseRequest()) + ->setLicense($license) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var License $response */ - $response = $licensesClient->get($license, $project); + $response = $licensesClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/LicensesClient/get_iam_policy.php b/Compute/samples/V1/LicensesClient/get_iam_policy.php index f53a62af84b5..4fbda8bdb7b2 100644 --- a/Compute/samples/V1/LicensesClient/get_iam_policy.php +++ b/Compute/samples/V1/LicensesClient/get_iam_policy.php @@ -24,7 +24,8 @@ // [START compute_v1_generated_Licenses_GetIamPolicy_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\LicensesClient; +use Google\Cloud\Compute\V1\Client\LicensesClient; +use Google\Cloud\Compute\V1\GetIamPolicyLicenseRequest; use Google\Cloud\Compute\V1\Policy; /** @@ -38,10 +39,15 @@ function get_iam_policy_sample(string $project, string $resource): void // Create a client. $licensesClient = new LicensesClient(); + // Prepare the request message. + $request = (new GetIamPolicyLicenseRequest()) + ->setProject($project) + ->setResource($resource); + // Call the API and handle any network failures. try { /** @var Policy $response */ - $response = $licensesClient->getIamPolicy($project, $resource); + $response = $licensesClient->getIamPolicy($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/LicensesClient/insert.php b/Compute/samples/V1/LicensesClient/insert.php index 88114c5f99e5..107cad103883 100644 --- a/Compute/samples/V1/LicensesClient/insert.php +++ b/Compute/samples/V1/LicensesClient/insert.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_Licenses_Insert_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\LicensesClient; +use Google\Cloud\Compute\V1\InsertLicenseRequest; use Google\Cloud\Compute\V1\License; -use Google\Cloud\Compute\V1\LicensesClient; use Google\Rpc\Status; /** @@ -39,13 +40,16 @@ function insert_sample(string $project): void // Create a client. $licensesClient = new LicensesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $licenseResource = new License(); + $request = (new InsertLicenseRequest()) + ->setLicenseResource($licenseResource) + ->setProject($project); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $licensesClient->insert($licenseResource, $project); + $response = $licensesClient->insert($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/LicensesClient/list.php b/Compute/samples/V1/LicensesClient/list.php index c2cf568240f4..fd4de2ff50a9 100644 --- a/Compute/samples/V1/LicensesClient/list.php +++ b/Compute/samples/V1/LicensesClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_Licenses_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\LicensesClient; +use Google\Cloud\Compute\V1\Client\LicensesClient; +use Google\Cloud\Compute\V1\ListLicensesRequest; /** * Retrieves the list of licenses available in the specified project. This method does not get any licenses that belong to other projects, including licenses attached to publicly-available images, like Debian 9. If you want to get a list of publicly-available licenses, use this method to make a request to the respective image project, such as debian-cloud or windows-cloud. *Caution* This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. @@ -37,10 +38,14 @@ function list_sample(string $project): void // Create a client. $licensesClient = new LicensesClient(); + // Prepare the request message. + $request = (new ListLicensesRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $licensesClient->list($project); + $response = $licensesClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/LicensesClient/set_iam_policy.php b/Compute/samples/V1/LicensesClient/set_iam_policy.php index 0d3a5823ebfb..907ed62479fb 100644 --- a/Compute/samples/V1/LicensesClient/set_iam_policy.php +++ b/Compute/samples/V1/LicensesClient/set_iam_policy.php @@ -24,9 +24,10 @@ // [START compute_v1_generated_Licenses_SetIamPolicy_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\LicensesClient; use Google\Cloud\Compute\V1\GlobalSetPolicyRequest; -use Google\Cloud\Compute\V1\LicensesClient; use Google\Cloud\Compute\V1\Policy; +use Google\Cloud\Compute\V1\SetIamPolicyLicenseRequest; /** * Sets the access control policy on the specified resource. Replaces any existing policy. *Caution* This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. @@ -39,13 +40,17 @@ function set_iam_policy_sample(string $project, string $resource): void // Create a client. $licensesClient = new LicensesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $globalSetPolicyRequestResource = new GlobalSetPolicyRequest(); + $request = (new SetIamPolicyLicenseRequest()) + ->setGlobalSetPolicyRequestResource($globalSetPolicyRequestResource) + ->setProject($project) + ->setResource($resource); // Call the API and handle any network failures. try { /** @var Policy $response */ - $response = $licensesClient->setIamPolicy($globalSetPolicyRequestResource, $project, $resource); + $response = $licensesClient->setIamPolicy($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/LicensesClient/test_iam_permissions.php b/Compute/samples/V1/LicensesClient/test_iam_permissions.php index 9b0157d5ba29..be52030e92e0 100644 --- a/Compute/samples/V1/LicensesClient/test_iam_permissions.php +++ b/Compute/samples/V1/LicensesClient/test_iam_permissions.php @@ -24,7 +24,8 @@ // [START compute_v1_generated_Licenses_TestIamPermissions_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\LicensesClient; +use Google\Cloud\Compute\V1\Client\LicensesClient; +use Google\Cloud\Compute\V1\TestIamPermissionsLicenseRequest; use Google\Cloud\Compute\V1\TestPermissionsRequest; use Google\Cloud\Compute\V1\TestPermissionsResponse; @@ -39,17 +40,17 @@ function test_iam_permissions_sample(string $project, string $resource): void // Create a client. $licensesClient = new LicensesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $testPermissionsRequestResource = new TestPermissionsRequest(); + $request = (new TestIamPermissionsLicenseRequest()) + ->setProject($project) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); // Call the API and handle any network failures. try { /** @var TestPermissionsResponse $response */ - $response = $licensesClient->testIamPermissions( - $project, - $resource, - $testPermissionsRequestResource - ); + $response = $licensesClient->testIamPermissions($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/MachineImagesClient/delete.php b/Compute/samples/V1/MachineImagesClient/delete.php index 04d7b05f7550..847e79adbf70 100644 --- a/Compute/samples/V1/MachineImagesClient/delete.php +++ b/Compute/samples/V1/MachineImagesClient/delete.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_MachineImages_Delete_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\MachineImagesClient; +use Google\Cloud\Compute\V1\Client\MachineImagesClient; +use Google\Cloud\Compute\V1\DeleteMachineImageRequest; use Google\Rpc\Status; /** @@ -39,10 +40,15 @@ function delete_sample(string $machineImage, string $project): void // Create a client. $machineImagesClient = new MachineImagesClient(); + // Prepare the request message. + $request = (new DeleteMachineImageRequest()) + ->setMachineImage($machineImage) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $machineImagesClient->delete($machineImage, $project); + $response = $machineImagesClient->delete($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/MachineImagesClient/get.php b/Compute/samples/V1/MachineImagesClient/get.php index ab0ba19f6bf3..c97b619c0299 100644 --- a/Compute/samples/V1/MachineImagesClient/get.php +++ b/Compute/samples/V1/MachineImagesClient/get.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_MachineImages_Get_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\MachineImagesClient; +use Google\Cloud\Compute\V1\GetMachineImageRequest; use Google\Cloud\Compute\V1\MachineImage; -use Google\Cloud\Compute\V1\MachineImagesClient; /** * Returns the specified machine image. @@ -38,10 +39,15 @@ function get_sample(string $machineImage, string $project): void // Create a client. $machineImagesClient = new MachineImagesClient(); + // Prepare the request message. + $request = (new GetMachineImageRequest()) + ->setMachineImage($machineImage) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var MachineImage $response */ - $response = $machineImagesClient->get($machineImage, $project); + $response = $machineImagesClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/MachineImagesClient/get_iam_policy.php b/Compute/samples/V1/MachineImagesClient/get_iam_policy.php index 806f64731bbb..c9c91e1e9fca 100644 --- a/Compute/samples/V1/MachineImagesClient/get_iam_policy.php +++ b/Compute/samples/V1/MachineImagesClient/get_iam_policy.php @@ -24,7 +24,8 @@ // [START compute_v1_generated_MachineImages_GetIamPolicy_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\MachineImagesClient; +use Google\Cloud\Compute\V1\Client\MachineImagesClient; +use Google\Cloud\Compute\V1\GetIamPolicyMachineImageRequest; use Google\Cloud\Compute\V1\Policy; /** @@ -38,10 +39,15 @@ function get_iam_policy_sample(string $project, string $resource): void // Create a client. $machineImagesClient = new MachineImagesClient(); + // Prepare the request message. + $request = (new GetIamPolicyMachineImageRequest()) + ->setProject($project) + ->setResource($resource); + // Call the API and handle any network failures. try { /** @var Policy $response */ - $response = $machineImagesClient->getIamPolicy($project, $resource); + $response = $machineImagesClient->getIamPolicy($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/MachineImagesClient/insert.php b/Compute/samples/V1/MachineImagesClient/insert.php index 1e0e0ea7c8bf..f42c4f5b60bb 100644 --- a/Compute/samples/V1/MachineImagesClient/insert.php +++ b/Compute/samples/V1/MachineImagesClient/insert.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_MachineImages_Insert_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\MachineImagesClient; +use Google\Cloud\Compute\V1\InsertMachineImageRequest; use Google\Cloud\Compute\V1\MachineImage; -use Google\Cloud\Compute\V1\MachineImagesClient; use Google\Rpc\Status; /** @@ -39,13 +40,16 @@ function insert_sample(string $project): void // Create a client. $machineImagesClient = new MachineImagesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $machineImageResource = new MachineImage(); + $request = (new InsertMachineImageRequest()) + ->setMachineImageResource($machineImageResource) + ->setProject($project); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $machineImagesClient->insert($machineImageResource, $project); + $response = $machineImagesClient->insert($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/MachineImagesClient/list.php b/Compute/samples/V1/MachineImagesClient/list.php index 1053954b1c3d..63865c677a31 100644 --- a/Compute/samples/V1/MachineImagesClient/list.php +++ b/Compute/samples/V1/MachineImagesClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_MachineImages_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\MachineImagesClient; +use Google\Cloud\Compute\V1\Client\MachineImagesClient; +use Google\Cloud\Compute\V1\ListMachineImagesRequest; /** * Retrieves a list of machine images that are contained within the specified project. @@ -37,10 +38,14 @@ function list_sample(string $project): void // Create a client. $machineImagesClient = new MachineImagesClient(); + // Prepare the request message. + $request = (new ListMachineImagesRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $machineImagesClient->list($project); + $response = $machineImagesClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/MachineImagesClient/set_iam_policy.php b/Compute/samples/V1/MachineImagesClient/set_iam_policy.php index c222b457fb6d..66cbc2c87658 100644 --- a/Compute/samples/V1/MachineImagesClient/set_iam_policy.php +++ b/Compute/samples/V1/MachineImagesClient/set_iam_policy.php @@ -24,9 +24,10 @@ // [START compute_v1_generated_MachineImages_SetIamPolicy_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\MachineImagesClient; use Google\Cloud\Compute\V1\GlobalSetPolicyRequest; -use Google\Cloud\Compute\V1\MachineImagesClient; use Google\Cloud\Compute\V1\Policy; +use Google\Cloud\Compute\V1\SetIamPolicyMachineImageRequest; /** * Sets the access control policy on the specified resource. Replaces any existing policy. @@ -39,17 +40,17 @@ function set_iam_policy_sample(string $project, string $resource): void // Create a client. $machineImagesClient = new MachineImagesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $globalSetPolicyRequestResource = new GlobalSetPolicyRequest(); + $request = (new SetIamPolicyMachineImageRequest()) + ->setGlobalSetPolicyRequestResource($globalSetPolicyRequestResource) + ->setProject($project) + ->setResource($resource); // Call the API and handle any network failures. try { /** @var Policy $response */ - $response = $machineImagesClient->setIamPolicy( - $globalSetPolicyRequestResource, - $project, - $resource - ); + $response = $machineImagesClient->setIamPolicy($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/MachineImagesClient/test_iam_permissions.php b/Compute/samples/V1/MachineImagesClient/test_iam_permissions.php index f0a13f25ab97..b98fd0bc6979 100644 --- a/Compute/samples/V1/MachineImagesClient/test_iam_permissions.php +++ b/Compute/samples/V1/MachineImagesClient/test_iam_permissions.php @@ -24,7 +24,8 @@ // [START compute_v1_generated_MachineImages_TestIamPermissions_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\MachineImagesClient; +use Google\Cloud\Compute\V1\Client\MachineImagesClient; +use Google\Cloud\Compute\V1\TestIamPermissionsMachineImageRequest; use Google\Cloud\Compute\V1\TestPermissionsRequest; use Google\Cloud\Compute\V1\TestPermissionsResponse; @@ -39,17 +40,17 @@ function test_iam_permissions_sample(string $project, string $resource): void // Create a client. $machineImagesClient = new MachineImagesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $testPermissionsRequestResource = new TestPermissionsRequest(); + $request = (new TestIamPermissionsMachineImageRequest()) + ->setProject($project) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); // Call the API and handle any network failures. try { /** @var TestPermissionsResponse $response */ - $response = $machineImagesClient->testIamPermissions( - $project, - $resource, - $testPermissionsRequestResource - ); + $response = $machineImagesClient->testIamPermissions($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/MachineTypesClient/aggregated_list.php b/Compute/samples/V1/MachineTypesClient/aggregated_list.php index 51ae821244b4..44c1a52f9e89 100644 --- a/Compute/samples/V1/MachineTypesClient/aggregated_list.php +++ b/Compute/samples/V1/MachineTypesClient/aggregated_list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_MachineTypes_AggregatedList_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\MachineTypesClient; +use Google\Cloud\Compute\V1\AggregatedListMachineTypesRequest; +use Google\Cloud\Compute\V1\Client\MachineTypesClient; /** * Retrieves an aggregated list of machine types. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. @@ -37,10 +38,14 @@ function aggregated_list_sample(string $project): void // Create a client. $machineTypesClient = new MachineTypesClient(); + // Prepare the request message. + $request = (new AggregatedListMachineTypesRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $machineTypesClient->aggregatedList($project); + $response = $machineTypesClient->aggregatedList($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/MachineTypesClient/get.php b/Compute/samples/V1/MachineTypesClient/get.php index 409cbba29494..192c83a54bdf 100644 --- a/Compute/samples/V1/MachineTypesClient/get.php +++ b/Compute/samples/V1/MachineTypesClient/get.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_MachineTypes_Get_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\MachineTypesClient; +use Google\Cloud\Compute\V1\GetMachineTypeRequest; use Google\Cloud\Compute\V1\MachineType; -use Google\Cloud\Compute\V1\MachineTypesClient; /** * Returns the specified machine type. @@ -39,10 +40,16 @@ function get_sample(string $machineType, string $project, string $zone): void // Create a client. $machineTypesClient = new MachineTypesClient(); + // Prepare the request message. + $request = (new GetMachineTypeRequest()) + ->setMachineType($machineType) + ->setProject($project) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var MachineType $response */ - $response = $machineTypesClient->get($machineType, $project, $zone); + $response = $machineTypesClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/MachineTypesClient/list.php b/Compute/samples/V1/MachineTypesClient/list.php index f021e91a30d8..ce9be0b7056c 100644 --- a/Compute/samples/V1/MachineTypesClient/list.php +++ b/Compute/samples/V1/MachineTypesClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_MachineTypes_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\MachineTypesClient; +use Google\Cloud\Compute\V1\Client\MachineTypesClient; +use Google\Cloud\Compute\V1\ListMachineTypesRequest; /** * Retrieves a list of machine types available to the specified project. @@ -38,10 +39,15 @@ function list_sample(string $project, string $zone): void // Create a client. $machineTypesClient = new MachineTypesClient(); + // Prepare the request message. + $request = (new ListMachineTypesRequest()) + ->setProject($project) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $machineTypesClient->list($project, $zone); + $response = $machineTypesClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/NetworkAttachmentsClient/aggregated_list.php b/Compute/samples/V1/NetworkAttachmentsClient/aggregated_list.php index 249ae3d08c9f..d4075db38ae9 100644 --- a/Compute/samples/V1/NetworkAttachmentsClient/aggregated_list.php +++ b/Compute/samples/V1/NetworkAttachmentsClient/aggregated_list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_NetworkAttachments_AggregatedList_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\NetworkAttachmentsClient; +use Google\Cloud\Compute\V1\AggregatedListNetworkAttachmentsRequest; +use Google\Cloud\Compute\V1\Client\NetworkAttachmentsClient; /** * 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`. @@ -37,10 +38,14 @@ function aggregated_list_sample(string $project): void // Create a client. $networkAttachmentsClient = new NetworkAttachmentsClient(); + // Prepare the request message. + $request = (new AggregatedListNetworkAttachmentsRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $networkAttachmentsClient->aggregatedList($project); + $response = $networkAttachmentsClient->aggregatedList($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/NetworkAttachmentsClient/delete.php b/Compute/samples/V1/NetworkAttachmentsClient/delete.php index 7fcfaee16fc3..3bf92b28cf47 100644 --- a/Compute/samples/V1/NetworkAttachmentsClient/delete.php +++ b/Compute/samples/V1/NetworkAttachmentsClient/delete.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_NetworkAttachments_Delete_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\NetworkAttachmentsClient; +use Google\Cloud\Compute\V1\Client\NetworkAttachmentsClient; +use Google\Cloud\Compute\V1\DeleteNetworkAttachmentRequest; use Google\Rpc\Status; /** @@ -40,10 +41,16 @@ function delete_sample(string $networkAttachment, string $project, string $regio // Create a client. $networkAttachmentsClient = new NetworkAttachmentsClient(); + // Prepare the request message. + $request = (new DeleteNetworkAttachmentRequest()) + ->setNetworkAttachment($networkAttachment) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $networkAttachmentsClient->delete($networkAttachment, $project, $region); + $response = $networkAttachmentsClient->delete($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/NetworkAttachmentsClient/get.php b/Compute/samples/V1/NetworkAttachmentsClient/get.php index 03e108f5ff0c..d18e0af1b188 100644 --- a/Compute/samples/V1/NetworkAttachmentsClient/get.php +++ b/Compute/samples/V1/NetworkAttachmentsClient/get.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_NetworkAttachments_Get_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\NetworkAttachmentsClient; +use Google\Cloud\Compute\V1\GetNetworkAttachmentRequest; use Google\Cloud\Compute\V1\NetworkAttachment; -use Google\Cloud\Compute\V1\NetworkAttachmentsClient; /** * Returns the specified NetworkAttachment resource in the given scope. @@ -39,10 +40,16 @@ function get_sample(string $networkAttachment, string $project, string $region): // Create a client. $networkAttachmentsClient = new NetworkAttachmentsClient(); + // Prepare the request message. + $request = (new GetNetworkAttachmentRequest()) + ->setNetworkAttachment($networkAttachment) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var NetworkAttachment $response */ - $response = $networkAttachmentsClient->get($networkAttachment, $project, $region); + $response = $networkAttachmentsClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/NetworkAttachmentsClient/get_iam_policy.php b/Compute/samples/V1/NetworkAttachmentsClient/get_iam_policy.php index 61c1acf625d6..76d4c82c0353 100644 --- a/Compute/samples/V1/NetworkAttachmentsClient/get_iam_policy.php +++ b/Compute/samples/V1/NetworkAttachmentsClient/get_iam_policy.php @@ -24,7 +24,8 @@ // [START compute_v1_generated_NetworkAttachments_GetIamPolicy_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\NetworkAttachmentsClient; +use Google\Cloud\Compute\V1\Client\NetworkAttachmentsClient; +use Google\Cloud\Compute\V1\GetIamPolicyNetworkAttachmentRequest; use Google\Cloud\Compute\V1\Policy; /** @@ -39,10 +40,16 @@ function get_iam_policy_sample(string $project, string $region, string $resource // Create a client. $networkAttachmentsClient = new NetworkAttachmentsClient(); + // Prepare the request message. + $request = (new GetIamPolicyNetworkAttachmentRequest()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource); + // Call the API and handle any network failures. try { /** @var Policy $response */ - $response = $networkAttachmentsClient->getIamPolicy($project, $region, $resource); + $response = $networkAttachmentsClient->getIamPolicy($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/NetworkAttachmentsClient/insert.php b/Compute/samples/V1/NetworkAttachmentsClient/insert.php index 2654052d7b24..2d9d638ea8ad 100644 --- a/Compute/samples/V1/NetworkAttachmentsClient/insert.php +++ b/Compute/samples/V1/NetworkAttachmentsClient/insert.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_NetworkAttachments_Insert_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\NetworkAttachmentsClient; +use Google\Cloud\Compute\V1\InsertNetworkAttachmentRequest; use Google\Cloud\Compute\V1\NetworkAttachment; -use Google\Cloud\Compute\V1\NetworkAttachmentsClient; use Google\Rpc\Status; /** @@ -40,13 +41,17 @@ function insert_sample(string $project, string $region): void // Create a client. $networkAttachmentsClient = new NetworkAttachmentsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $networkAttachmentResource = new NetworkAttachment(); + $request = (new InsertNetworkAttachmentRequest()) + ->setNetworkAttachmentResource($networkAttachmentResource) + ->setProject($project) + ->setRegion($region); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $networkAttachmentsClient->insert($networkAttachmentResource, $project, $region); + $response = $networkAttachmentsClient->insert($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/NetworkAttachmentsClient/list.php b/Compute/samples/V1/NetworkAttachmentsClient/list.php index 87aa457ba419..54685e303b31 100644 --- a/Compute/samples/V1/NetworkAttachmentsClient/list.php +++ b/Compute/samples/V1/NetworkAttachmentsClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_NetworkAttachments_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\NetworkAttachmentsClient; +use Google\Cloud\Compute\V1\Client\NetworkAttachmentsClient; +use Google\Cloud\Compute\V1\ListNetworkAttachmentsRequest; /** * Lists the NetworkAttachments for a project in the given scope. @@ -38,10 +39,15 @@ function list_sample(string $project, string $region): void // Create a client. $networkAttachmentsClient = new NetworkAttachmentsClient(); + // Prepare the request message. + $request = (new ListNetworkAttachmentsRequest()) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $networkAttachmentsClient->list($project, $region); + $response = $networkAttachmentsClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/NetworkAttachmentsClient/patch.php b/Compute/samples/V1/NetworkAttachmentsClient/patch.php index ed975572d5c0..1186a31d1c2e 100644 --- a/Compute/samples/V1/NetworkAttachmentsClient/patch.php +++ b/Compute/samples/V1/NetworkAttachmentsClient/patch.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_NetworkAttachments_Patch_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\NetworkAttachmentsClient; use Google\Cloud\Compute\V1\NetworkAttachment; -use Google\Cloud\Compute\V1\NetworkAttachmentsClient; +use Google\Cloud\Compute\V1\PatchNetworkAttachmentRequest; use Google\Rpc\Status; /** @@ -41,18 +42,18 @@ function patch_sample(string $networkAttachment, string $project, string $region // Create a client. $networkAttachmentsClient = new NetworkAttachmentsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $networkAttachmentResource = new NetworkAttachment(); + $request = (new PatchNetworkAttachmentRequest()) + ->setNetworkAttachment($networkAttachment) + ->setNetworkAttachmentResource($networkAttachmentResource) + ->setProject($project) + ->setRegion($region); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $networkAttachmentsClient->patch( - $networkAttachment, - $networkAttachmentResource, - $project, - $region - ); + $response = $networkAttachmentsClient->patch($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/NetworkAttachmentsClient/set_iam_policy.php b/Compute/samples/V1/NetworkAttachmentsClient/set_iam_policy.php index bbf7cc01084e..c96b1c0f303b 100644 --- a/Compute/samples/V1/NetworkAttachmentsClient/set_iam_policy.php +++ b/Compute/samples/V1/NetworkAttachmentsClient/set_iam_policy.php @@ -24,9 +24,10 @@ // [START compute_v1_generated_NetworkAttachments_SetIamPolicy_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\NetworkAttachmentsClient; +use Google\Cloud\Compute\V1\Client\NetworkAttachmentsClient; use Google\Cloud\Compute\V1\Policy; use Google\Cloud\Compute\V1\RegionSetPolicyRequest; +use Google\Cloud\Compute\V1\SetIamPolicyNetworkAttachmentRequest; /** * Sets the access control policy on the specified resource. Replaces any existing policy. @@ -40,18 +41,18 @@ function set_iam_policy_sample(string $project, string $region, string $resource // Create a client. $networkAttachmentsClient = new NetworkAttachmentsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $regionSetPolicyRequestResource = new RegionSetPolicyRequest(); + $request = (new SetIamPolicyNetworkAttachmentRequest()) + ->setProject($project) + ->setRegion($region) + ->setRegionSetPolicyRequestResource($regionSetPolicyRequestResource) + ->setResource($resource); // Call the API and handle any network failures. try { /** @var Policy $response */ - $response = $networkAttachmentsClient->setIamPolicy( - $project, - $region, - $regionSetPolicyRequestResource, - $resource - ); + $response = $networkAttachmentsClient->setIamPolicy($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/NetworkAttachmentsClient/test_iam_permissions.php b/Compute/samples/V1/NetworkAttachmentsClient/test_iam_permissions.php index 49d8ac1c09ca..ebdeebcc04e9 100644 --- a/Compute/samples/V1/NetworkAttachmentsClient/test_iam_permissions.php +++ b/Compute/samples/V1/NetworkAttachmentsClient/test_iam_permissions.php @@ -24,7 +24,8 @@ // [START compute_v1_generated_NetworkAttachments_TestIamPermissions_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\NetworkAttachmentsClient; +use Google\Cloud\Compute\V1\Client\NetworkAttachmentsClient; +use Google\Cloud\Compute\V1\TestIamPermissionsNetworkAttachmentRequest; use Google\Cloud\Compute\V1\TestPermissionsRequest; use Google\Cloud\Compute\V1\TestPermissionsResponse; @@ -40,18 +41,18 @@ function test_iam_permissions_sample(string $project, string $region, string $re // Create a client. $networkAttachmentsClient = new NetworkAttachmentsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $testPermissionsRequestResource = new TestPermissionsRequest(); + $request = (new TestIamPermissionsNetworkAttachmentRequest()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); // Call the API and handle any network failures. try { /** @var TestPermissionsResponse $response */ - $response = $networkAttachmentsClient->testIamPermissions( - $project, - $region, - $resource, - $testPermissionsRequestResource - ); + $response = $networkAttachmentsClient->testIamPermissions($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/NetworkEdgeSecurityServicesClient/aggregated_list.php b/Compute/samples/V1/NetworkEdgeSecurityServicesClient/aggregated_list.php index d75314573fb2..7a389071b7f3 100644 --- a/Compute/samples/V1/NetworkEdgeSecurityServicesClient/aggregated_list.php +++ b/Compute/samples/V1/NetworkEdgeSecurityServicesClient/aggregated_list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_NetworkEdgeSecurityServices_AggregatedList_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\NetworkEdgeSecurityServicesClient; +use Google\Cloud\Compute\V1\AggregatedListNetworkEdgeSecurityServicesRequest; +use Google\Cloud\Compute\V1\Client\NetworkEdgeSecurityServicesClient; /** * 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`. @@ -37,10 +38,14 @@ function aggregated_list_sample(string $project): void // Create a client. $networkEdgeSecurityServicesClient = new NetworkEdgeSecurityServicesClient(); + // Prepare the request message. + $request = (new AggregatedListNetworkEdgeSecurityServicesRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $networkEdgeSecurityServicesClient->aggregatedList($project); + $response = $networkEdgeSecurityServicesClient->aggregatedList($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/NetworkEdgeSecurityServicesClient/delete.php b/Compute/samples/V1/NetworkEdgeSecurityServicesClient/delete.php index 9c12dd6efc1b..22572c9c45bf 100644 --- a/Compute/samples/V1/NetworkEdgeSecurityServicesClient/delete.php +++ b/Compute/samples/V1/NetworkEdgeSecurityServicesClient/delete.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_NetworkEdgeSecurityServices_Delete_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\NetworkEdgeSecurityServicesClient; +use Google\Cloud\Compute\V1\Client\NetworkEdgeSecurityServicesClient; +use Google\Cloud\Compute\V1\DeleteNetworkEdgeSecurityServiceRequest; use Google\Rpc\Status; /** @@ -40,14 +41,16 @@ function delete_sample(string $networkEdgeSecurityService, string $project, stri // Create a client. $networkEdgeSecurityServicesClient = new NetworkEdgeSecurityServicesClient(); + // Prepare the request message. + $request = (new DeleteNetworkEdgeSecurityServiceRequest()) + ->setNetworkEdgeSecurityService($networkEdgeSecurityService) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $networkEdgeSecurityServicesClient->delete( - $networkEdgeSecurityService, - $project, - $region - ); + $response = $networkEdgeSecurityServicesClient->delete($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/NetworkEdgeSecurityServicesClient/get.php b/Compute/samples/V1/NetworkEdgeSecurityServicesClient/get.php index fccd7b66220c..3623c4ec2b77 100644 --- a/Compute/samples/V1/NetworkEdgeSecurityServicesClient/get.php +++ b/Compute/samples/V1/NetworkEdgeSecurityServicesClient/get.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_NetworkEdgeSecurityServices_Get_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\NetworkEdgeSecurityServicesClient; +use Google\Cloud\Compute\V1\GetNetworkEdgeSecurityServiceRequest; use Google\Cloud\Compute\V1\NetworkEdgeSecurityService; -use Google\Cloud\Compute\V1\NetworkEdgeSecurityServicesClient; /** * Gets a specified NetworkEdgeSecurityService. @@ -39,10 +40,16 @@ function get_sample(string $networkEdgeSecurityService, string $project, string // Create a client. $networkEdgeSecurityServicesClient = new NetworkEdgeSecurityServicesClient(); + // Prepare the request message. + $request = (new GetNetworkEdgeSecurityServiceRequest()) + ->setNetworkEdgeSecurityService($networkEdgeSecurityService) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var NetworkEdgeSecurityService $response */ - $response = $networkEdgeSecurityServicesClient->get($networkEdgeSecurityService, $project, $region); + $response = $networkEdgeSecurityServicesClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/NetworkEdgeSecurityServicesClient/insert.php b/Compute/samples/V1/NetworkEdgeSecurityServicesClient/insert.php index 2ac34357aba2..d65e33d4ec31 100644 --- a/Compute/samples/V1/NetworkEdgeSecurityServicesClient/insert.php +++ b/Compute/samples/V1/NetworkEdgeSecurityServicesClient/insert.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_NetworkEdgeSecurityServices_Insert_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\NetworkEdgeSecurityServicesClient; +use Google\Cloud\Compute\V1\InsertNetworkEdgeSecurityServiceRequest; use Google\Cloud\Compute\V1\NetworkEdgeSecurityService; -use Google\Cloud\Compute\V1\NetworkEdgeSecurityServicesClient; use Google\Rpc\Status; /** @@ -40,17 +41,17 @@ function insert_sample(string $project, string $region): void // Create a client. $networkEdgeSecurityServicesClient = new NetworkEdgeSecurityServicesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $networkEdgeSecurityServiceResource = new NetworkEdgeSecurityService(); + $request = (new InsertNetworkEdgeSecurityServiceRequest()) + ->setNetworkEdgeSecurityServiceResource($networkEdgeSecurityServiceResource) + ->setProject($project) + ->setRegion($region); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $networkEdgeSecurityServicesClient->insert( - $networkEdgeSecurityServiceResource, - $project, - $region - ); + $response = $networkEdgeSecurityServicesClient->insert($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/NetworkEdgeSecurityServicesClient/patch.php b/Compute/samples/V1/NetworkEdgeSecurityServicesClient/patch.php index 28ee100885df..4682ac11520b 100644 --- a/Compute/samples/V1/NetworkEdgeSecurityServicesClient/patch.php +++ b/Compute/samples/V1/NetworkEdgeSecurityServicesClient/patch.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_NetworkEdgeSecurityServices_Patch_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\NetworkEdgeSecurityServicesClient; use Google\Cloud\Compute\V1\NetworkEdgeSecurityService; -use Google\Cloud\Compute\V1\NetworkEdgeSecurityServicesClient; +use Google\Cloud\Compute\V1\PatchNetworkEdgeSecurityServiceRequest; use Google\Rpc\Status; /** @@ -41,18 +42,18 @@ function patch_sample(string $networkEdgeSecurityService, string $project, strin // Create a client. $networkEdgeSecurityServicesClient = new NetworkEdgeSecurityServicesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $networkEdgeSecurityServiceResource = new NetworkEdgeSecurityService(); + $request = (new PatchNetworkEdgeSecurityServiceRequest()) + ->setNetworkEdgeSecurityService($networkEdgeSecurityService) + ->setNetworkEdgeSecurityServiceResource($networkEdgeSecurityServiceResource) + ->setProject($project) + ->setRegion($region); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $networkEdgeSecurityServicesClient->patch( - $networkEdgeSecurityService, - $networkEdgeSecurityServiceResource, - $project, - $region - ); + $response = $networkEdgeSecurityServicesClient->patch($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/NetworkEndpointGroupsClient/aggregated_list.php b/Compute/samples/V1/NetworkEndpointGroupsClient/aggregated_list.php index d9410f3d4333..aab4287e5f39 100644 --- a/Compute/samples/V1/NetworkEndpointGroupsClient/aggregated_list.php +++ b/Compute/samples/V1/NetworkEndpointGroupsClient/aggregated_list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_NetworkEndpointGroups_AggregatedList_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\NetworkEndpointGroupsClient; +use Google\Cloud\Compute\V1\AggregatedListNetworkEndpointGroupsRequest; +use Google\Cloud\Compute\V1\Client\NetworkEndpointGroupsClient; /** * 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`. @@ -37,10 +38,14 @@ function aggregated_list_sample(string $project): void // Create a client. $networkEndpointGroupsClient = new NetworkEndpointGroupsClient(); + // Prepare the request message. + $request = (new AggregatedListNetworkEndpointGroupsRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $networkEndpointGroupsClient->aggregatedList($project); + $response = $networkEndpointGroupsClient->aggregatedList($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/NetworkEndpointGroupsClient/attach_network_endpoints.php b/Compute/samples/V1/NetworkEndpointGroupsClient/attach_network_endpoints.php index 18d56a4f4d6e..c5db4dd447bb 100644 --- a/Compute/samples/V1/NetworkEndpointGroupsClient/attach_network_endpoints.php +++ b/Compute/samples/V1/NetworkEndpointGroupsClient/attach_network_endpoints.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_NetworkEndpointGroups_AttachNetworkEndpoints_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\AttachNetworkEndpointsNetworkEndpointGroupRequest; +use Google\Cloud\Compute\V1\Client\NetworkEndpointGroupsClient; use Google\Cloud\Compute\V1\NetworkEndpointGroupsAttachEndpointsRequest; -use Google\Cloud\Compute\V1\NetworkEndpointGroupsClient; use Google\Rpc\Status; /** @@ -44,18 +45,20 @@ function attach_network_endpoints_sample( // Create a client. $networkEndpointGroupsClient = new NetworkEndpointGroupsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $networkEndpointGroupsAttachEndpointsRequestResource = new NetworkEndpointGroupsAttachEndpointsRequest(); + $request = (new AttachNetworkEndpointsNetworkEndpointGroupRequest()) + ->setNetworkEndpointGroup($networkEndpointGroup) + ->setNetworkEndpointGroupsAttachEndpointsRequestResource( + $networkEndpointGroupsAttachEndpointsRequestResource + ) + ->setProject($project) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $networkEndpointGroupsClient->attachNetworkEndpoints( - $networkEndpointGroup, - $networkEndpointGroupsAttachEndpointsRequestResource, - $project, - $zone - ); + $response = $networkEndpointGroupsClient->attachNetworkEndpoints($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/NetworkEndpointGroupsClient/delete.php b/Compute/samples/V1/NetworkEndpointGroupsClient/delete.php index 6d9be8783f27..82fd32574d12 100644 --- a/Compute/samples/V1/NetworkEndpointGroupsClient/delete.php +++ b/Compute/samples/V1/NetworkEndpointGroupsClient/delete.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_NetworkEndpointGroups_Delete_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\NetworkEndpointGroupsClient; +use Google\Cloud\Compute\V1\Client\NetworkEndpointGroupsClient; +use Google\Cloud\Compute\V1\DeleteNetworkEndpointGroupRequest; use Google\Rpc\Status; /** @@ -40,10 +41,16 @@ function delete_sample(string $networkEndpointGroup, string $project, string $zo // Create a client. $networkEndpointGroupsClient = new NetworkEndpointGroupsClient(); + // Prepare the request message. + $request = (new DeleteNetworkEndpointGroupRequest()) + ->setNetworkEndpointGroup($networkEndpointGroup) + ->setProject($project) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $networkEndpointGroupsClient->delete($networkEndpointGroup, $project, $zone); + $response = $networkEndpointGroupsClient->delete($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/NetworkEndpointGroupsClient/detach_network_endpoints.php b/Compute/samples/V1/NetworkEndpointGroupsClient/detach_network_endpoints.php index 2ee5e44edd14..291df911dd6a 100644 --- a/Compute/samples/V1/NetworkEndpointGroupsClient/detach_network_endpoints.php +++ b/Compute/samples/V1/NetworkEndpointGroupsClient/detach_network_endpoints.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_NetworkEndpointGroups_DetachNetworkEndpoints_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\NetworkEndpointGroupsClient; +use Google\Cloud\Compute\V1\Client\NetworkEndpointGroupsClient; +use Google\Cloud\Compute\V1\DetachNetworkEndpointsNetworkEndpointGroupRequest; use Google\Cloud\Compute\V1\NetworkEndpointGroupsDetachEndpointsRequest; use Google\Rpc\Status; @@ -44,18 +45,20 @@ function detach_network_endpoints_sample( // Create a client. $networkEndpointGroupsClient = new NetworkEndpointGroupsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $networkEndpointGroupsDetachEndpointsRequestResource = new NetworkEndpointGroupsDetachEndpointsRequest(); + $request = (new DetachNetworkEndpointsNetworkEndpointGroupRequest()) + ->setNetworkEndpointGroup($networkEndpointGroup) + ->setNetworkEndpointGroupsDetachEndpointsRequestResource( + $networkEndpointGroupsDetachEndpointsRequestResource + ) + ->setProject($project) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $networkEndpointGroupsClient->detachNetworkEndpoints( - $networkEndpointGroup, - $networkEndpointGroupsDetachEndpointsRequestResource, - $project, - $zone - ); + $response = $networkEndpointGroupsClient->detachNetworkEndpoints($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/NetworkEndpointGroupsClient/get.php b/Compute/samples/V1/NetworkEndpointGroupsClient/get.php index db8b2ad49124..fd8e41265da8 100644 --- a/Compute/samples/V1/NetworkEndpointGroupsClient/get.php +++ b/Compute/samples/V1/NetworkEndpointGroupsClient/get.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_NetworkEndpointGroups_Get_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\NetworkEndpointGroupsClient; +use Google\Cloud\Compute\V1\GetNetworkEndpointGroupRequest; use Google\Cloud\Compute\V1\NetworkEndpointGroup; -use Google\Cloud\Compute\V1\NetworkEndpointGroupsClient; /** * Returns the specified network endpoint group. @@ -39,10 +40,16 @@ function get_sample(string $networkEndpointGroup, string $project, string $zone) // Create a client. $networkEndpointGroupsClient = new NetworkEndpointGroupsClient(); + // Prepare the request message. + $request = (new GetNetworkEndpointGroupRequest()) + ->setNetworkEndpointGroup($networkEndpointGroup) + ->setProject($project) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var NetworkEndpointGroup $response */ - $response = $networkEndpointGroupsClient->get($networkEndpointGroup, $project, $zone); + $response = $networkEndpointGroupsClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/NetworkEndpointGroupsClient/insert.php b/Compute/samples/V1/NetworkEndpointGroupsClient/insert.php index 9a90a2670c37..52ff615237f2 100644 --- a/Compute/samples/V1/NetworkEndpointGroupsClient/insert.php +++ b/Compute/samples/V1/NetworkEndpointGroupsClient/insert.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_NetworkEndpointGroups_Insert_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\NetworkEndpointGroupsClient; +use Google\Cloud\Compute\V1\InsertNetworkEndpointGroupRequest; use Google\Cloud\Compute\V1\NetworkEndpointGroup; -use Google\Cloud\Compute\V1\NetworkEndpointGroupsClient; use Google\Rpc\Status; /** @@ -40,13 +41,17 @@ function insert_sample(string $project, string $zone): void // Create a client. $networkEndpointGroupsClient = new NetworkEndpointGroupsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $networkEndpointGroupResource = new NetworkEndpointGroup(); + $request = (new InsertNetworkEndpointGroupRequest()) + ->setNetworkEndpointGroupResource($networkEndpointGroupResource) + ->setProject($project) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $networkEndpointGroupsClient->insert($networkEndpointGroupResource, $project, $zone); + $response = $networkEndpointGroupsClient->insert($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/NetworkEndpointGroupsClient/list.php b/Compute/samples/V1/NetworkEndpointGroupsClient/list.php index e8482436e94c..81f4cd736f59 100644 --- a/Compute/samples/V1/NetworkEndpointGroupsClient/list.php +++ b/Compute/samples/V1/NetworkEndpointGroupsClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_NetworkEndpointGroups_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\NetworkEndpointGroupsClient; +use Google\Cloud\Compute\V1\Client\NetworkEndpointGroupsClient; +use Google\Cloud\Compute\V1\ListNetworkEndpointGroupsRequest; /** * Retrieves the list of network endpoint groups that are located in the specified project and zone. @@ -38,10 +39,15 @@ function list_sample(string $project, string $zone): void // Create a client. $networkEndpointGroupsClient = new NetworkEndpointGroupsClient(); + // Prepare the request message. + $request = (new ListNetworkEndpointGroupsRequest()) + ->setProject($project) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $networkEndpointGroupsClient->list($project, $zone); + $response = $networkEndpointGroupsClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/NetworkEndpointGroupsClient/list_network_endpoints.php b/Compute/samples/V1/NetworkEndpointGroupsClient/list_network_endpoints.php index 041e97868ef5..0636631194f5 100644 --- a/Compute/samples/V1/NetworkEndpointGroupsClient/list_network_endpoints.php +++ b/Compute/samples/V1/NetworkEndpointGroupsClient/list_network_endpoints.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_NetworkEndpointGroups_ListNetworkEndpoints_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\NetworkEndpointGroupsClient; +use Google\Cloud\Compute\V1\Client\NetworkEndpointGroupsClient; +use Google\Cloud\Compute\V1\ListNetworkEndpointsNetworkEndpointGroupsRequest; use Google\Cloud\Compute\V1\NetworkEndpointGroupsListEndpointsRequest; /** @@ -43,18 +44,20 @@ function list_network_endpoints_sample( // Create a client. $networkEndpointGroupsClient = new NetworkEndpointGroupsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $networkEndpointGroupsListEndpointsRequestResource = new NetworkEndpointGroupsListEndpointsRequest(); + $request = (new ListNetworkEndpointsNetworkEndpointGroupsRequest()) + ->setNetworkEndpointGroup($networkEndpointGroup) + ->setNetworkEndpointGroupsListEndpointsRequestResource( + $networkEndpointGroupsListEndpointsRequestResource + ) + ->setProject($project) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $networkEndpointGroupsClient->listNetworkEndpoints( - $networkEndpointGroup, - $networkEndpointGroupsListEndpointsRequestResource, - $project, - $zone - ); + $response = $networkEndpointGroupsClient->listNetworkEndpoints($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/NetworkEndpointGroupsClient/test_iam_permissions.php b/Compute/samples/V1/NetworkEndpointGroupsClient/test_iam_permissions.php index 0e8f9a0fb7ac..48ba75bc9b9e 100644 --- a/Compute/samples/V1/NetworkEndpointGroupsClient/test_iam_permissions.php +++ b/Compute/samples/V1/NetworkEndpointGroupsClient/test_iam_permissions.php @@ -24,7 +24,8 @@ // [START compute_v1_generated_NetworkEndpointGroups_TestIamPermissions_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\NetworkEndpointGroupsClient; +use Google\Cloud\Compute\V1\Client\NetworkEndpointGroupsClient; +use Google\Cloud\Compute\V1\TestIamPermissionsNetworkEndpointGroupRequest; use Google\Cloud\Compute\V1\TestPermissionsRequest; use Google\Cloud\Compute\V1\TestPermissionsResponse; @@ -40,18 +41,18 @@ function test_iam_permissions_sample(string $project, string $resource, string $ // Create a client. $networkEndpointGroupsClient = new NetworkEndpointGroupsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $testPermissionsRequestResource = new TestPermissionsRequest(); + $request = (new TestIamPermissionsNetworkEndpointGroupRequest()) + ->setProject($project) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var TestPermissionsResponse $response */ - $response = $networkEndpointGroupsClient->testIamPermissions( - $project, - $resource, - $testPermissionsRequestResource, - $zone - ); + $response = $networkEndpointGroupsClient->testIamPermissions($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/NetworkFirewallPoliciesClient/add_association.php b/Compute/samples/V1/NetworkFirewallPoliciesClient/add_association.php index db52f52223f8..241720a568af 100644 --- a/Compute/samples/V1/NetworkFirewallPoliciesClient/add_association.php +++ b/Compute/samples/V1/NetworkFirewallPoliciesClient/add_association.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_NetworkFirewallPolicies_AddAssociation_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\AddAssociationNetworkFirewallPolicyRequest; +use Google\Cloud\Compute\V1\Client\NetworkFirewallPoliciesClient; use Google\Cloud\Compute\V1\FirewallPolicyAssociation; -use Google\Cloud\Compute\V1\NetworkFirewallPoliciesClient; use Google\Rpc\Status; /** @@ -40,17 +41,17 @@ function add_association_sample(string $firewallPolicy, string $project): void // Create a client. $networkFirewallPoliciesClient = new NetworkFirewallPoliciesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $firewallPolicyAssociationResource = new FirewallPolicyAssociation(); + $request = (new AddAssociationNetworkFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setFirewallPolicyAssociationResource($firewallPolicyAssociationResource) + ->setProject($project); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $networkFirewallPoliciesClient->addAssociation( - $firewallPolicy, - $firewallPolicyAssociationResource, - $project - ); + $response = $networkFirewallPoliciesClient->addAssociation($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/NetworkFirewallPoliciesClient/add_rule.php b/Compute/samples/V1/NetworkFirewallPoliciesClient/add_rule.php index 159f9503df1c..8000e8295a96 100644 --- a/Compute/samples/V1/NetworkFirewallPoliciesClient/add_rule.php +++ b/Compute/samples/V1/NetworkFirewallPoliciesClient/add_rule.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_NetworkFirewallPolicies_AddRule_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\AddRuleNetworkFirewallPolicyRequest; +use Google\Cloud\Compute\V1\Client\NetworkFirewallPoliciesClient; use Google\Cloud\Compute\V1\FirewallPolicyRule; -use Google\Cloud\Compute\V1\NetworkFirewallPoliciesClient; use Google\Rpc\Status; /** @@ -40,17 +41,17 @@ function add_rule_sample(string $firewallPolicy, string $project): void // Create a client. $networkFirewallPoliciesClient = new NetworkFirewallPoliciesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $firewallPolicyRuleResource = new FirewallPolicyRule(); + $request = (new AddRuleNetworkFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setFirewallPolicyRuleResource($firewallPolicyRuleResource) + ->setProject($project); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $networkFirewallPoliciesClient->addRule( - $firewallPolicy, - $firewallPolicyRuleResource, - $project - ); + $response = $networkFirewallPoliciesClient->addRule($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/NetworkFirewallPoliciesClient/clone_rules.php b/Compute/samples/V1/NetworkFirewallPoliciesClient/clone_rules.php index a58f96e5f142..79e5f4e5dde5 100644 --- a/Compute/samples/V1/NetworkFirewallPoliciesClient/clone_rules.php +++ b/Compute/samples/V1/NetworkFirewallPoliciesClient/clone_rules.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_NetworkFirewallPolicies_CloneRules_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\NetworkFirewallPoliciesClient; +use Google\Cloud\Compute\V1\Client\NetworkFirewallPoliciesClient; +use Google\Cloud\Compute\V1\CloneRulesNetworkFirewallPolicyRequest; use Google\Rpc\Status; /** @@ -39,10 +40,15 @@ function clone_rules_sample(string $firewallPolicy, string $project): void // Create a client. $networkFirewallPoliciesClient = new NetworkFirewallPoliciesClient(); + // Prepare the request message. + $request = (new CloneRulesNetworkFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $networkFirewallPoliciesClient->cloneRules($firewallPolicy, $project); + $response = $networkFirewallPoliciesClient->cloneRules($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/NetworkFirewallPoliciesClient/delete.php b/Compute/samples/V1/NetworkFirewallPoliciesClient/delete.php index 3299688f8781..3b159d7f27c2 100644 --- a/Compute/samples/V1/NetworkFirewallPoliciesClient/delete.php +++ b/Compute/samples/V1/NetworkFirewallPoliciesClient/delete.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_NetworkFirewallPolicies_Delete_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\NetworkFirewallPoliciesClient; +use Google\Cloud\Compute\V1\Client\NetworkFirewallPoliciesClient; +use Google\Cloud\Compute\V1\DeleteNetworkFirewallPolicyRequest; use Google\Rpc\Status; /** @@ -39,10 +40,15 @@ function delete_sample(string $firewallPolicy, string $project): void // Create a client. $networkFirewallPoliciesClient = new NetworkFirewallPoliciesClient(); + // Prepare the request message. + $request = (new DeleteNetworkFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $networkFirewallPoliciesClient->delete($firewallPolicy, $project); + $response = $networkFirewallPoliciesClient->delete($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/NetworkFirewallPoliciesClient/get.php b/Compute/samples/V1/NetworkFirewallPoliciesClient/get.php index 939760d74257..5563a10b9ec7 100644 --- a/Compute/samples/V1/NetworkFirewallPoliciesClient/get.php +++ b/Compute/samples/V1/NetworkFirewallPoliciesClient/get.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_NetworkFirewallPolicies_Get_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\NetworkFirewallPoliciesClient; use Google\Cloud\Compute\V1\FirewallPolicy; -use Google\Cloud\Compute\V1\NetworkFirewallPoliciesClient; +use Google\Cloud\Compute\V1\GetNetworkFirewallPolicyRequest; /** * Returns the specified network firewall policy. @@ -38,10 +39,15 @@ function get_sample(string $firewallPolicy, string $project): void // Create a client. $networkFirewallPoliciesClient = new NetworkFirewallPoliciesClient(); + // Prepare the request message. + $request = (new GetNetworkFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var FirewallPolicy $response */ - $response = $networkFirewallPoliciesClient->get($firewallPolicy, $project); + $response = $networkFirewallPoliciesClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/NetworkFirewallPoliciesClient/get_association.php b/Compute/samples/V1/NetworkFirewallPoliciesClient/get_association.php index 9992c8e71391..d2a1bddecf9d 100644 --- a/Compute/samples/V1/NetworkFirewallPoliciesClient/get_association.php +++ b/Compute/samples/V1/NetworkFirewallPoliciesClient/get_association.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_NetworkFirewallPolicies_GetAssociation_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\NetworkFirewallPoliciesClient; use Google\Cloud\Compute\V1\FirewallPolicyAssociation; -use Google\Cloud\Compute\V1\NetworkFirewallPoliciesClient; +use Google\Cloud\Compute\V1\GetAssociationNetworkFirewallPolicyRequest; /** * Gets an association with the specified name. @@ -38,10 +39,15 @@ function get_association_sample(string $firewallPolicy, string $project): void // Create a client. $networkFirewallPoliciesClient = new NetworkFirewallPoliciesClient(); + // Prepare the request message. + $request = (new GetAssociationNetworkFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var FirewallPolicyAssociation $response */ - $response = $networkFirewallPoliciesClient->getAssociation($firewallPolicy, $project); + $response = $networkFirewallPoliciesClient->getAssociation($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/NetworkFirewallPoliciesClient/get_iam_policy.php b/Compute/samples/V1/NetworkFirewallPoliciesClient/get_iam_policy.php index 21abab28154f..e4261d07c248 100644 --- a/Compute/samples/V1/NetworkFirewallPoliciesClient/get_iam_policy.php +++ b/Compute/samples/V1/NetworkFirewallPoliciesClient/get_iam_policy.php @@ -24,7 +24,8 @@ // [START compute_v1_generated_NetworkFirewallPolicies_GetIamPolicy_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\NetworkFirewallPoliciesClient; +use Google\Cloud\Compute\V1\Client\NetworkFirewallPoliciesClient; +use Google\Cloud\Compute\V1\GetIamPolicyNetworkFirewallPolicyRequest; use Google\Cloud\Compute\V1\Policy; /** @@ -38,10 +39,15 @@ function get_iam_policy_sample(string $project, string $resource): void // Create a client. $networkFirewallPoliciesClient = new NetworkFirewallPoliciesClient(); + // Prepare the request message. + $request = (new GetIamPolicyNetworkFirewallPolicyRequest()) + ->setProject($project) + ->setResource($resource); + // Call the API and handle any network failures. try { /** @var Policy $response */ - $response = $networkFirewallPoliciesClient->getIamPolicy($project, $resource); + $response = $networkFirewallPoliciesClient->getIamPolicy($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/NetworkFirewallPoliciesClient/get_rule.php b/Compute/samples/V1/NetworkFirewallPoliciesClient/get_rule.php index 808a7e58a454..e3debeec0933 100644 --- a/Compute/samples/V1/NetworkFirewallPoliciesClient/get_rule.php +++ b/Compute/samples/V1/NetworkFirewallPoliciesClient/get_rule.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_NetworkFirewallPolicies_GetRule_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\NetworkFirewallPoliciesClient; use Google\Cloud\Compute\V1\FirewallPolicyRule; -use Google\Cloud\Compute\V1\NetworkFirewallPoliciesClient; +use Google\Cloud\Compute\V1\GetRuleNetworkFirewallPolicyRequest; /** * Gets a rule of the specified priority. @@ -38,10 +39,15 @@ function get_rule_sample(string $firewallPolicy, string $project): void // Create a client. $networkFirewallPoliciesClient = new NetworkFirewallPoliciesClient(); + // Prepare the request message. + $request = (new GetRuleNetworkFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var FirewallPolicyRule $response */ - $response = $networkFirewallPoliciesClient->getRule($firewallPolicy, $project); + $response = $networkFirewallPoliciesClient->getRule($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/NetworkFirewallPoliciesClient/insert.php b/Compute/samples/V1/NetworkFirewallPoliciesClient/insert.php index db71ed253c7f..286da4d17b38 100644 --- a/Compute/samples/V1/NetworkFirewallPoliciesClient/insert.php +++ b/Compute/samples/V1/NetworkFirewallPoliciesClient/insert.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_NetworkFirewallPolicies_Insert_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\NetworkFirewallPoliciesClient; use Google\Cloud\Compute\V1\FirewallPolicy; -use Google\Cloud\Compute\V1\NetworkFirewallPoliciesClient; +use Google\Cloud\Compute\V1\InsertNetworkFirewallPolicyRequest; use Google\Rpc\Status; /** @@ -39,13 +40,16 @@ function insert_sample(string $project): void // Create a client. $networkFirewallPoliciesClient = new NetworkFirewallPoliciesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $firewallPolicyResource = new FirewallPolicy(); + $request = (new InsertNetworkFirewallPolicyRequest()) + ->setFirewallPolicyResource($firewallPolicyResource) + ->setProject($project); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $networkFirewallPoliciesClient->insert($firewallPolicyResource, $project); + $response = $networkFirewallPoliciesClient->insert($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/NetworkFirewallPoliciesClient/list.php b/Compute/samples/V1/NetworkFirewallPoliciesClient/list.php index d63140b81092..a4e38fa392a5 100644 --- a/Compute/samples/V1/NetworkFirewallPoliciesClient/list.php +++ b/Compute/samples/V1/NetworkFirewallPoliciesClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_NetworkFirewallPolicies_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\NetworkFirewallPoliciesClient; +use Google\Cloud\Compute\V1\Client\NetworkFirewallPoliciesClient; +use Google\Cloud\Compute\V1\ListNetworkFirewallPoliciesRequest; /** * Lists all the policies that have been configured for the specified project. @@ -37,10 +38,14 @@ function list_sample(string $project): void // Create a client. $networkFirewallPoliciesClient = new NetworkFirewallPoliciesClient(); + // Prepare the request message. + $request = (new ListNetworkFirewallPoliciesRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $networkFirewallPoliciesClient->list($project); + $response = $networkFirewallPoliciesClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/NetworkFirewallPoliciesClient/patch.php b/Compute/samples/V1/NetworkFirewallPoliciesClient/patch.php index 582f226ec35c..686d5b431197 100644 --- a/Compute/samples/V1/NetworkFirewallPoliciesClient/patch.php +++ b/Compute/samples/V1/NetworkFirewallPoliciesClient/patch.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_NetworkFirewallPolicies_Patch_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\NetworkFirewallPoliciesClient; use Google\Cloud\Compute\V1\FirewallPolicy; -use Google\Cloud\Compute\V1\NetworkFirewallPoliciesClient; +use Google\Cloud\Compute\V1\PatchNetworkFirewallPolicyRequest; use Google\Rpc\Status; /** @@ -40,17 +41,17 @@ function patch_sample(string $firewallPolicy, string $project): void // Create a client. $networkFirewallPoliciesClient = new NetworkFirewallPoliciesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $firewallPolicyResource = new FirewallPolicy(); + $request = (new PatchNetworkFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setFirewallPolicyResource($firewallPolicyResource) + ->setProject($project); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $networkFirewallPoliciesClient->patch( - $firewallPolicy, - $firewallPolicyResource, - $project - ); + $response = $networkFirewallPoliciesClient->patch($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/NetworkFirewallPoliciesClient/patch_rule.php b/Compute/samples/V1/NetworkFirewallPoliciesClient/patch_rule.php index ecdb6c444226..04b49d36e5d4 100644 --- a/Compute/samples/V1/NetworkFirewallPoliciesClient/patch_rule.php +++ b/Compute/samples/V1/NetworkFirewallPoliciesClient/patch_rule.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_NetworkFirewallPolicies_PatchRule_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\NetworkFirewallPoliciesClient; use Google\Cloud\Compute\V1\FirewallPolicyRule; -use Google\Cloud\Compute\V1\NetworkFirewallPoliciesClient; +use Google\Cloud\Compute\V1\PatchRuleNetworkFirewallPolicyRequest; use Google\Rpc\Status; /** @@ -40,17 +41,17 @@ function patch_rule_sample(string $firewallPolicy, string $project): void // Create a client. $networkFirewallPoliciesClient = new NetworkFirewallPoliciesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $firewallPolicyRuleResource = new FirewallPolicyRule(); + $request = (new PatchRuleNetworkFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setFirewallPolicyRuleResource($firewallPolicyRuleResource) + ->setProject($project); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $networkFirewallPoliciesClient->patchRule( - $firewallPolicy, - $firewallPolicyRuleResource, - $project - ); + $response = $networkFirewallPoliciesClient->patchRule($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/NetworkFirewallPoliciesClient/remove_association.php b/Compute/samples/V1/NetworkFirewallPoliciesClient/remove_association.php index 71715245eaa5..102e6ec09a42 100644 --- a/Compute/samples/V1/NetworkFirewallPoliciesClient/remove_association.php +++ b/Compute/samples/V1/NetworkFirewallPoliciesClient/remove_association.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_NetworkFirewallPolicies_RemoveAssociation_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\NetworkFirewallPoliciesClient; +use Google\Cloud\Compute\V1\Client\NetworkFirewallPoliciesClient; +use Google\Cloud\Compute\V1\RemoveAssociationNetworkFirewallPolicyRequest; use Google\Rpc\Status; /** @@ -39,10 +40,15 @@ function remove_association_sample(string $firewallPolicy, string $project): voi // Create a client. $networkFirewallPoliciesClient = new NetworkFirewallPoliciesClient(); + // Prepare the request message. + $request = (new RemoveAssociationNetworkFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $networkFirewallPoliciesClient->removeAssociation($firewallPolicy, $project); + $response = $networkFirewallPoliciesClient->removeAssociation($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/NetworkFirewallPoliciesClient/remove_rule.php b/Compute/samples/V1/NetworkFirewallPoliciesClient/remove_rule.php index 13bf7a414c88..09d62b9b496e 100644 --- a/Compute/samples/V1/NetworkFirewallPoliciesClient/remove_rule.php +++ b/Compute/samples/V1/NetworkFirewallPoliciesClient/remove_rule.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_NetworkFirewallPolicies_RemoveRule_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\NetworkFirewallPoliciesClient; +use Google\Cloud\Compute\V1\Client\NetworkFirewallPoliciesClient; +use Google\Cloud\Compute\V1\RemoveRuleNetworkFirewallPolicyRequest; use Google\Rpc\Status; /** @@ -39,10 +40,15 @@ function remove_rule_sample(string $firewallPolicy, string $project): void // Create a client. $networkFirewallPoliciesClient = new NetworkFirewallPoliciesClient(); + // Prepare the request message. + $request = (new RemoveRuleNetworkFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $networkFirewallPoliciesClient->removeRule($firewallPolicy, $project); + $response = $networkFirewallPoliciesClient->removeRule($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/NetworkFirewallPoliciesClient/set_iam_policy.php b/Compute/samples/V1/NetworkFirewallPoliciesClient/set_iam_policy.php index d4b9715677ae..154e50c3b88e 100644 --- a/Compute/samples/V1/NetworkFirewallPoliciesClient/set_iam_policy.php +++ b/Compute/samples/V1/NetworkFirewallPoliciesClient/set_iam_policy.php @@ -24,9 +24,10 @@ // [START compute_v1_generated_NetworkFirewallPolicies_SetIamPolicy_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\NetworkFirewallPoliciesClient; use Google\Cloud\Compute\V1\GlobalSetPolicyRequest; -use Google\Cloud\Compute\V1\NetworkFirewallPoliciesClient; use Google\Cloud\Compute\V1\Policy; +use Google\Cloud\Compute\V1\SetIamPolicyNetworkFirewallPolicyRequest; /** * Sets the access control policy on the specified resource. Replaces any existing policy. @@ -39,17 +40,17 @@ function set_iam_policy_sample(string $project, string $resource): void // Create a client. $networkFirewallPoliciesClient = new NetworkFirewallPoliciesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $globalSetPolicyRequestResource = new GlobalSetPolicyRequest(); + $request = (new SetIamPolicyNetworkFirewallPolicyRequest()) + ->setGlobalSetPolicyRequestResource($globalSetPolicyRequestResource) + ->setProject($project) + ->setResource($resource); // Call the API and handle any network failures. try { /** @var Policy $response */ - $response = $networkFirewallPoliciesClient->setIamPolicy( - $globalSetPolicyRequestResource, - $project, - $resource - ); + $response = $networkFirewallPoliciesClient->setIamPolicy($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/NetworkFirewallPoliciesClient/test_iam_permissions.php b/Compute/samples/V1/NetworkFirewallPoliciesClient/test_iam_permissions.php index 83aaf494365b..d1501dbffc96 100644 --- a/Compute/samples/V1/NetworkFirewallPoliciesClient/test_iam_permissions.php +++ b/Compute/samples/V1/NetworkFirewallPoliciesClient/test_iam_permissions.php @@ -24,7 +24,8 @@ // [START compute_v1_generated_NetworkFirewallPolicies_TestIamPermissions_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\NetworkFirewallPoliciesClient; +use Google\Cloud\Compute\V1\Client\NetworkFirewallPoliciesClient; +use Google\Cloud\Compute\V1\TestIamPermissionsNetworkFirewallPolicyRequest; use Google\Cloud\Compute\V1\TestPermissionsRequest; use Google\Cloud\Compute\V1\TestPermissionsResponse; @@ -39,17 +40,17 @@ function test_iam_permissions_sample(string $project, string $resource): void // Create a client. $networkFirewallPoliciesClient = new NetworkFirewallPoliciesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $testPermissionsRequestResource = new TestPermissionsRequest(); + $request = (new TestIamPermissionsNetworkFirewallPolicyRequest()) + ->setProject($project) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); // Call the API and handle any network failures. try { /** @var TestPermissionsResponse $response */ - $response = $networkFirewallPoliciesClient->testIamPermissions( - $project, - $resource, - $testPermissionsRequestResource - ); + $response = $networkFirewallPoliciesClient->testIamPermissions($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/NetworkProfilesClient/get.php b/Compute/samples/V1/NetworkProfilesClient/get.php index 9f9b40642506..a2f0bac0d766 100644 --- a/Compute/samples/V1/NetworkProfilesClient/get.php +++ b/Compute/samples/V1/NetworkProfilesClient/get.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_NetworkProfiles_Get_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\NetworkProfilesClient; +use Google\Cloud\Compute\V1\GetNetworkProfileRequest; use Google\Cloud\Compute\V1\NetworkProfile; -use Google\Cloud\Compute\V1\NetworkProfilesClient; /** * Returns the specified network profile. @@ -38,10 +39,15 @@ function get_sample(string $networkProfile, string $project): void // Create a client. $networkProfilesClient = new NetworkProfilesClient(); + // Prepare the request message. + $request = (new GetNetworkProfileRequest()) + ->setNetworkProfile($networkProfile) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var NetworkProfile $response */ - $response = $networkProfilesClient->get($networkProfile, $project); + $response = $networkProfilesClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/NetworkProfilesClient/list.php b/Compute/samples/V1/NetworkProfilesClient/list.php index a14ab080cfd1..46257f42f691 100644 --- a/Compute/samples/V1/NetworkProfilesClient/list.php +++ b/Compute/samples/V1/NetworkProfilesClient/list.php @@ -24,7 +24,8 @@ // [START compute_v1_generated_NetworkProfiles_List_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\NetworkProfilesClient; +use Google\Cloud\Compute\V1\Client\NetworkProfilesClient; +use Google\Cloud\Compute\V1\ListNetworkProfilesRequest; use Google\Cloud\Compute\V1\NetworkProfilesListResponse; /** @@ -37,10 +38,14 @@ function list_sample(string $project): void // Create a client. $networkProfilesClient = new NetworkProfilesClient(); + // Prepare the request message. + $request = (new ListNetworkProfilesRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var NetworkProfilesListResponse $response */ - $response = $networkProfilesClient->list($project); + $response = $networkProfilesClient->list($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/NetworksClient/add_peering.php b/Compute/samples/V1/NetworksClient/add_peering.php index 15258cd0dc87..6a0a32525d9a 100644 --- a/Compute/samples/V1/NetworksClient/add_peering.php +++ b/Compute/samples/V1/NetworksClient/add_peering.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_Networks_AddPeering_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\AddPeeringNetworkRequest; +use Google\Cloud\Compute\V1\Client\NetworksClient; use Google\Cloud\Compute\V1\NetworksAddPeeringRequest; -use Google\Cloud\Compute\V1\NetworksClient; use Google\Rpc\Status; /** @@ -40,13 +41,17 @@ function add_peering_sample(string $network, string $project): void // Create a client. $networksClient = new NetworksClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $networksAddPeeringRequestResource = new NetworksAddPeeringRequest(); + $request = (new AddPeeringNetworkRequest()) + ->setNetwork($network) + ->setNetworksAddPeeringRequestResource($networksAddPeeringRequestResource) + ->setProject($project); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $networksClient->addPeering($network, $networksAddPeeringRequestResource, $project); + $response = $networksClient->addPeering($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/NetworksClient/delete.php b/Compute/samples/V1/NetworksClient/delete.php index 655cd88a91f2..1fe998d9a1bc 100644 --- a/Compute/samples/V1/NetworksClient/delete.php +++ b/Compute/samples/V1/NetworksClient/delete.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_Networks_Delete_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\NetworksClient; +use Google\Cloud\Compute\V1\Client\NetworksClient; +use Google\Cloud\Compute\V1\DeleteNetworkRequest; use Google\Rpc\Status; /** @@ -39,10 +40,15 @@ function delete_sample(string $network, string $project): void // Create a client. $networksClient = new NetworksClient(); + // Prepare the request message. + $request = (new DeleteNetworkRequest()) + ->setNetwork($network) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $networksClient->delete($network, $project); + $response = $networksClient->delete($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/NetworksClient/get.php b/Compute/samples/V1/NetworksClient/get.php index af8bd4973206..6a13d9cfb265 100644 --- a/Compute/samples/V1/NetworksClient/get.php +++ b/Compute/samples/V1/NetworksClient/get.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_Networks_Get_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\NetworksClient; +use Google\Cloud\Compute\V1\GetNetworkRequest; use Google\Cloud\Compute\V1\Network; -use Google\Cloud\Compute\V1\NetworksClient; /** * Returns the specified network. @@ -38,10 +39,15 @@ function get_sample(string $network, string $project): void // Create a client. $networksClient = new NetworksClient(); + // Prepare the request message. + $request = (new GetNetworkRequest()) + ->setNetwork($network) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var Network $response */ - $response = $networksClient->get($network, $project); + $response = $networksClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/NetworksClient/get_effective_firewalls.php b/Compute/samples/V1/NetworksClient/get_effective_firewalls.php index 49564f026c4e..6307609b1b9b 100644 --- a/Compute/samples/V1/NetworksClient/get_effective_firewalls.php +++ b/Compute/samples/V1/NetworksClient/get_effective_firewalls.php @@ -24,7 +24,8 @@ // [START compute_v1_generated_Networks_GetEffectiveFirewalls_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\NetworksClient; +use Google\Cloud\Compute\V1\Client\NetworksClient; +use Google\Cloud\Compute\V1\GetEffectiveFirewallsNetworkRequest; use Google\Cloud\Compute\V1\NetworksGetEffectiveFirewallsResponse; /** @@ -38,10 +39,15 @@ function get_effective_firewalls_sample(string $network, string $project): void // Create a client. $networksClient = new NetworksClient(); + // Prepare the request message. + $request = (new GetEffectiveFirewallsNetworkRequest()) + ->setNetwork($network) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var NetworksGetEffectiveFirewallsResponse $response */ - $response = $networksClient->getEffectiveFirewalls($network, $project); + $response = $networksClient->getEffectiveFirewalls($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/NetworksClient/insert.php b/Compute/samples/V1/NetworksClient/insert.php index f3425baabbfb..91395fc0a67f 100644 --- a/Compute/samples/V1/NetworksClient/insert.php +++ b/Compute/samples/V1/NetworksClient/insert.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_Networks_Insert_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\NetworksClient; +use Google\Cloud\Compute\V1\InsertNetworkRequest; use Google\Cloud\Compute\V1\Network; -use Google\Cloud\Compute\V1\NetworksClient; use Google\Rpc\Status; /** @@ -39,13 +40,16 @@ function insert_sample(string $project): void // Create a client. $networksClient = new NetworksClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $networkResource = new Network(); + $request = (new InsertNetworkRequest()) + ->setNetworkResource($networkResource) + ->setProject($project); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $networksClient->insert($networkResource, $project); + $response = $networksClient->insert($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/NetworksClient/list.php b/Compute/samples/V1/NetworksClient/list.php index 66c06c8755b1..0bbb1eed4ee1 100644 --- a/Compute/samples/V1/NetworksClient/list.php +++ b/Compute/samples/V1/NetworksClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_Networks_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\NetworksClient; +use Google\Cloud\Compute\V1\Client\NetworksClient; +use Google\Cloud\Compute\V1\ListNetworksRequest; /** * Retrieves the list of networks available to the specified project. @@ -37,10 +38,14 @@ function list_sample(string $project): void // Create a client. $networksClient = new NetworksClient(); + // Prepare the request message. + $request = (new ListNetworksRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $networksClient->list($project); + $response = $networksClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/NetworksClient/list_peering_routes.php b/Compute/samples/V1/NetworksClient/list_peering_routes.php index 85bde3c0ee16..adce4e0c1ff2 100644 --- a/Compute/samples/V1/NetworksClient/list_peering_routes.php +++ b/Compute/samples/V1/NetworksClient/list_peering_routes.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_Networks_ListPeeringRoutes_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\NetworksClient; +use Google\Cloud\Compute\V1\Client\NetworksClient; +use Google\Cloud\Compute\V1\ListPeeringRoutesNetworksRequest; /** * Lists the peering routes exchanged over peering connection. @@ -38,10 +39,15 @@ function list_peering_routes_sample(string $network, string $project): void // Create a client. $networksClient = new NetworksClient(); + // Prepare the request message. + $request = (new ListPeeringRoutesNetworksRequest()) + ->setNetwork($network) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $networksClient->listPeeringRoutes($network, $project); + $response = $networksClient->listPeeringRoutes($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/NetworksClient/patch.php b/Compute/samples/V1/NetworksClient/patch.php index 968158961685..7da1cee27a25 100644 --- a/Compute/samples/V1/NetworksClient/patch.php +++ b/Compute/samples/V1/NetworksClient/patch.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_Networks_Patch_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\NetworksClient; use Google\Cloud\Compute\V1\Network; -use Google\Cloud\Compute\V1\NetworksClient; +use Google\Cloud\Compute\V1\PatchNetworkRequest; use Google\Rpc\Status; /** @@ -40,13 +41,17 @@ function patch_sample(string $network, string $project): void // Create a client. $networksClient = new NetworksClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $networkResource = new Network(); + $request = (new PatchNetworkRequest()) + ->setNetwork($network) + ->setNetworkResource($networkResource) + ->setProject($project); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $networksClient->patch($network, $networkResource, $project); + $response = $networksClient->patch($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/NetworksClient/remove_peering.php b/Compute/samples/V1/NetworksClient/remove_peering.php index ef63ae61cb7e..338f4e5096ec 100644 --- a/Compute/samples/V1/NetworksClient/remove_peering.php +++ b/Compute/samples/V1/NetworksClient/remove_peering.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_Networks_RemovePeering_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\NetworksClient; +use Google\Cloud\Compute\V1\Client\NetworksClient; use Google\Cloud\Compute\V1\NetworksRemovePeeringRequest; +use Google\Cloud\Compute\V1\RemovePeeringNetworkRequest; use Google\Rpc\Status; /** @@ -40,17 +41,17 @@ function remove_peering_sample(string $network, string $project): void // Create a client. $networksClient = new NetworksClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $networksRemovePeeringRequestResource = new NetworksRemovePeeringRequest(); + $request = (new RemovePeeringNetworkRequest()) + ->setNetwork($network) + ->setNetworksRemovePeeringRequestResource($networksRemovePeeringRequestResource) + ->setProject($project); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $networksClient->removePeering( - $network, - $networksRemovePeeringRequestResource, - $project - ); + $response = $networksClient->removePeering($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/NetworksClient/switch_to_custom_mode.php b/Compute/samples/V1/NetworksClient/switch_to_custom_mode.php index f406e5111f15..ec5bde34b06c 100644 --- a/Compute/samples/V1/NetworksClient/switch_to_custom_mode.php +++ b/Compute/samples/V1/NetworksClient/switch_to_custom_mode.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_Networks_SwitchToCustomMode_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\NetworksClient; +use Google\Cloud\Compute\V1\Client\NetworksClient; +use Google\Cloud\Compute\V1\SwitchToCustomModeNetworkRequest; use Google\Rpc\Status; /** @@ -39,10 +40,15 @@ function switch_to_custom_mode_sample(string $network, string $project): void // Create a client. $networksClient = new NetworksClient(); + // Prepare the request message. + $request = (new SwitchToCustomModeNetworkRequest()) + ->setNetwork($network) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $networksClient->switchToCustomMode($network, $project); + $response = $networksClient->switchToCustomMode($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/NetworksClient/update_peering.php b/Compute/samples/V1/NetworksClient/update_peering.php index 69848ed96066..b992645993c7 100644 --- a/Compute/samples/V1/NetworksClient/update_peering.php +++ b/Compute/samples/V1/NetworksClient/update_peering.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_Networks_UpdatePeering_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\NetworksClient; +use Google\Cloud\Compute\V1\Client\NetworksClient; use Google\Cloud\Compute\V1\NetworksUpdatePeeringRequest; +use Google\Cloud\Compute\V1\UpdatePeeringNetworkRequest; use Google\Rpc\Status; /** @@ -40,17 +41,17 @@ function update_peering_sample(string $network, string $project): void // Create a client. $networksClient = new NetworksClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $networksUpdatePeeringRequestResource = new NetworksUpdatePeeringRequest(); + $request = (new UpdatePeeringNetworkRequest()) + ->setNetwork($network) + ->setNetworksUpdatePeeringRequestResource($networksUpdatePeeringRequestResource) + ->setProject($project); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $networksClient->updatePeering( - $network, - $networksUpdatePeeringRequestResource, - $project - ); + $response = $networksClient->updatePeering($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/NodeGroupsClient/add_nodes.php b/Compute/samples/V1/NodeGroupsClient/add_nodes.php index ecb0c1f40c20..41b0d1561808 100644 --- a/Compute/samples/V1/NodeGroupsClient/add_nodes.php +++ b/Compute/samples/V1/NodeGroupsClient/add_nodes.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_NodeGroups_AddNodes_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\AddNodesNodeGroupRequest; +use Google\Cloud\Compute\V1\Client\NodeGroupsClient; use Google\Cloud\Compute\V1\NodeGroupsAddNodesRequest; -use Google\Cloud\Compute\V1\NodeGroupsClient; use Google\Rpc\Status; /** @@ -41,18 +42,18 @@ function add_nodes_sample(string $nodeGroup, string $project, string $zone): voi // Create a client. $nodeGroupsClient = new NodeGroupsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $nodeGroupsAddNodesRequestResource = new NodeGroupsAddNodesRequest(); + $request = (new AddNodesNodeGroupRequest()) + ->setNodeGroup($nodeGroup) + ->setNodeGroupsAddNodesRequestResource($nodeGroupsAddNodesRequestResource) + ->setProject($project) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $nodeGroupsClient->addNodes( - $nodeGroup, - $nodeGroupsAddNodesRequestResource, - $project, - $zone - ); + $response = $nodeGroupsClient->addNodes($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/NodeGroupsClient/aggregated_list.php b/Compute/samples/V1/NodeGroupsClient/aggregated_list.php index 06665d279a0b..cc6aa2c9fe1e 100644 --- a/Compute/samples/V1/NodeGroupsClient/aggregated_list.php +++ b/Compute/samples/V1/NodeGroupsClient/aggregated_list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_NodeGroups_AggregatedList_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\NodeGroupsClient; +use Google\Cloud\Compute\V1\AggregatedListNodeGroupsRequest; +use Google\Cloud\Compute\V1\Client\NodeGroupsClient; /** * 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`. @@ -37,10 +38,14 @@ function aggregated_list_sample(string $project): void // Create a client. $nodeGroupsClient = new NodeGroupsClient(); + // Prepare the request message. + $request = (new AggregatedListNodeGroupsRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $nodeGroupsClient->aggregatedList($project); + $response = $nodeGroupsClient->aggregatedList($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/NodeGroupsClient/delete.php b/Compute/samples/V1/NodeGroupsClient/delete.php index 576b9ace9162..06607623c9a4 100644 --- a/Compute/samples/V1/NodeGroupsClient/delete.php +++ b/Compute/samples/V1/NodeGroupsClient/delete.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_NodeGroups_Delete_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\NodeGroupsClient; +use Google\Cloud\Compute\V1\Client\NodeGroupsClient; +use Google\Cloud\Compute\V1\DeleteNodeGroupRequest; use Google\Rpc\Status; /** @@ -40,10 +41,16 @@ function delete_sample(string $nodeGroup, string $project, string $zone): void // Create a client. $nodeGroupsClient = new NodeGroupsClient(); + // Prepare the request message. + $request = (new DeleteNodeGroupRequest()) + ->setNodeGroup($nodeGroup) + ->setProject($project) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $nodeGroupsClient->delete($nodeGroup, $project, $zone); + $response = $nodeGroupsClient->delete($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/NodeGroupsClient/delete_nodes.php b/Compute/samples/V1/NodeGroupsClient/delete_nodes.php index bc6aec4bf76b..f98a5b5f0845 100644 --- a/Compute/samples/V1/NodeGroupsClient/delete_nodes.php +++ b/Compute/samples/V1/NodeGroupsClient/delete_nodes.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_NodeGroups_DeleteNodes_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\NodeGroupsClient; +use Google\Cloud\Compute\V1\Client\NodeGroupsClient; +use Google\Cloud\Compute\V1\DeleteNodesNodeGroupRequest; use Google\Cloud\Compute\V1\NodeGroupsDeleteNodesRequest; use Google\Rpc\Status; @@ -41,18 +42,18 @@ function delete_nodes_sample(string $nodeGroup, string $project, string $zone): // Create a client. $nodeGroupsClient = new NodeGroupsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $nodeGroupsDeleteNodesRequestResource = new NodeGroupsDeleteNodesRequest(); + $request = (new DeleteNodesNodeGroupRequest()) + ->setNodeGroup($nodeGroup) + ->setNodeGroupsDeleteNodesRequestResource($nodeGroupsDeleteNodesRequestResource) + ->setProject($project) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $nodeGroupsClient->deleteNodes( - $nodeGroup, - $nodeGroupsDeleteNodesRequestResource, - $project, - $zone - ); + $response = $nodeGroupsClient->deleteNodes($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/NodeGroupsClient/get.php b/Compute/samples/V1/NodeGroupsClient/get.php index 51f297365b48..6721522f5bf0 100644 --- a/Compute/samples/V1/NodeGroupsClient/get.php +++ b/Compute/samples/V1/NodeGroupsClient/get.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_NodeGroups_Get_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\NodeGroupsClient; +use Google\Cloud\Compute\V1\GetNodeGroupRequest; use Google\Cloud\Compute\V1\NodeGroup; -use Google\Cloud\Compute\V1\NodeGroupsClient; /** * Returns the specified NodeGroup. Get a list of available NodeGroups by making a list() request. Note: the "nodes" field should not be used. Use nodeGroups.listNodes instead. @@ -39,10 +40,16 @@ function get_sample(string $nodeGroup, string $project, string $zone): void // Create a client. $nodeGroupsClient = new NodeGroupsClient(); + // Prepare the request message. + $request = (new GetNodeGroupRequest()) + ->setNodeGroup($nodeGroup) + ->setProject($project) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var NodeGroup $response */ - $response = $nodeGroupsClient->get($nodeGroup, $project, $zone); + $response = $nodeGroupsClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/NodeGroupsClient/get_iam_policy.php b/Compute/samples/V1/NodeGroupsClient/get_iam_policy.php index 8dc425bcdf70..60d9faffd392 100644 --- a/Compute/samples/V1/NodeGroupsClient/get_iam_policy.php +++ b/Compute/samples/V1/NodeGroupsClient/get_iam_policy.php @@ -24,7 +24,8 @@ // [START compute_v1_generated_NodeGroups_GetIamPolicy_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\NodeGroupsClient; +use Google\Cloud\Compute\V1\Client\NodeGroupsClient; +use Google\Cloud\Compute\V1\GetIamPolicyNodeGroupRequest; use Google\Cloud\Compute\V1\Policy; /** @@ -39,10 +40,16 @@ function get_iam_policy_sample(string $project, string $resource, string $zone): // Create a client. $nodeGroupsClient = new NodeGroupsClient(); + // Prepare the request message. + $request = (new GetIamPolicyNodeGroupRequest()) + ->setProject($project) + ->setResource($resource) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var Policy $response */ - $response = $nodeGroupsClient->getIamPolicy($project, $resource, $zone); + $response = $nodeGroupsClient->getIamPolicy($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/NodeGroupsClient/insert.php b/Compute/samples/V1/NodeGroupsClient/insert.php index 36109ec33bd5..acbf54e8fba6 100644 --- a/Compute/samples/V1/NodeGroupsClient/insert.php +++ b/Compute/samples/V1/NodeGroupsClient/insert.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_NodeGroups_Insert_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\NodeGroupsClient; +use Google\Cloud\Compute\V1\InsertNodeGroupRequest; use Google\Cloud\Compute\V1\NodeGroup; -use Google\Cloud\Compute\V1\NodeGroupsClient; use Google\Rpc\Status; /** @@ -41,13 +42,18 @@ function insert_sample(int $initialNodeCount, string $project, string $zone): vo // Create a client. $nodeGroupsClient = new NodeGroupsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $nodeGroupResource = new NodeGroup(); + $request = (new InsertNodeGroupRequest()) + ->setInitialNodeCount($initialNodeCount) + ->setNodeGroupResource($nodeGroupResource) + ->setProject($project) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $nodeGroupsClient->insert($initialNodeCount, $nodeGroupResource, $project, $zone); + $response = $nodeGroupsClient->insert($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/NodeGroupsClient/list.php b/Compute/samples/V1/NodeGroupsClient/list.php index e2bd45678568..f2c4f1cabbec 100644 --- a/Compute/samples/V1/NodeGroupsClient/list.php +++ b/Compute/samples/V1/NodeGroupsClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_NodeGroups_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\NodeGroupsClient; +use Google\Cloud\Compute\V1\Client\NodeGroupsClient; +use Google\Cloud\Compute\V1\ListNodeGroupsRequest; /** * Retrieves a list of node groups available to the specified project. Note: use nodeGroups.listNodes for more details about each group. @@ -38,10 +39,15 @@ function list_sample(string $project, string $zone): void // Create a client. $nodeGroupsClient = new NodeGroupsClient(); + // Prepare the request message. + $request = (new ListNodeGroupsRequest()) + ->setProject($project) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $nodeGroupsClient->list($project, $zone); + $response = $nodeGroupsClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/NodeGroupsClient/list_nodes.php b/Compute/samples/V1/NodeGroupsClient/list_nodes.php index 8b5028a1f349..9cc4ba0aa9ec 100644 --- a/Compute/samples/V1/NodeGroupsClient/list_nodes.php +++ b/Compute/samples/V1/NodeGroupsClient/list_nodes.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_NodeGroups_ListNodes_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\NodeGroupsClient; +use Google\Cloud\Compute\V1\Client\NodeGroupsClient; +use Google\Cloud\Compute\V1\ListNodesNodeGroupsRequest; /** * Lists nodes in the node group. @@ -39,10 +40,16 @@ function list_nodes_sample(string $nodeGroup, string $project, string $zone): vo // Create a client. $nodeGroupsClient = new NodeGroupsClient(); + // Prepare the request message. + $request = (new ListNodesNodeGroupsRequest()) + ->setNodeGroup($nodeGroup) + ->setProject($project) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $nodeGroupsClient->listNodes($nodeGroup, $project, $zone); + $response = $nodeGroupsClient->listNodes($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/NodeGroupsClient/patch.php b/Compute/samples/V1/NodeGroupsClient/patch.php index ddcc0a3ece3d..4008fbaee2f9 100644 --- a/Compute/samples/V1/NodeGroupsClient/patch.php +++ b/Compute/samples/V1/NodeGroupsClient/patch.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_NodeGroups_Patch_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\NodeGroupsClient; use Google\Cloud\Compute\V1\NodeGroup; -use Google\Cloud\Compute\V1\NodeGroupsClient; +use Google\Cloud\Compute\V1\PatchNodeGroupRequest; use Google\Rpc\Status; /** @@ -41,13 +42,18 @@ function patch_sample(string $nodeGroup, string $project, string $zone): void // Create a client. $nodeGroupsClient = new NodeGroupsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $nodeGroupResource = new NodeGroup(); + $request = (new PatchNodeGroupRequest()) + ->setNodeGroup($nodeGroup) + ->setNodeGroupResource($nodeGroupResource) + ->setProject($project) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $nodeGroupsClient->patch($nodeGroup, $nodeGroupResource, $project, $zone); + $response = $nodeGroupsClient->patch($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/NodeGroupsClient/perform_maintenance.php b/Compute/samples/V1/NodeGroupsClient/perform_maintenance.php index aef9adf0c70b..dd11eb8bb702 100644 --- a/Compute/samples/V1/NodeGroupsClient/perform_maintenance.php +++ b/Compute/samples/V1/NodeGroupsClient/perform_maintenance.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_NodeGroups_PerformMaintenance_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\NodeGroupsClient; +use Google\Cloud\Compute\V1\Client\NodeGroupsClient; use Google\Cloud\Compute\V1\NodeGroupsPerformMaintenanceRequest; +use Google\Cloud\Compute\V1\PerformMaintenanceNodeGroupRequest; use Google\Rpc\Status; /** @@ -41,18 +42,18 @@ function perform_maintenance_sample(string $nodeGroup, string $project, string $ // Create a client. $nodeGroupsClient = new NodeGroupsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $nodeGroupsPerformMaintenanceRequestResource = new NodeGroupsPerformMaintenanceRequest(); + $request = (new PerformMaintenanceNodeGroupRequest()) + ->setNodeGroup($nodeGroup) + ->setNodeGroupsPerformMaintenanceRequestResource($nodeGroupsPerformMaintenanceRequestResource) + ->setProject($project) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $nodeGroupsClient->performMaintenance( - $nodeGroup, - $nodeGroupsPerformMaintenanceRequestResource, - $project, - $zone - ); + $response = $nodeGroupsClient->performMaintenance($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/NodeGroupsClient/set_iam_policy.php b/Compute/samples/V1/NodeGroupsClient/set_iam_policy.php index 95bb1129a7ba..065a8e29d830 100644 --- a/Compute/samples/V1/NodeGroupsClient/set_iam_policy.php +++ b/Compute/samples/V1/NodeGroupsClient/set_iam_policy.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_NodeGroups_SetIamPolicy_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\NodeGroupsClient; +use Google\Cloud\Compute\V1\Client\NodeGroupsClient; use Google\Cloud\Compute\V1\Policy; +use Google\Cloud\Compute\V1\SetIamPolicyNodeGroupRequest; use Google\Cloud\Compute\V1\ZoneSetPolicyRequest; /** @@ -40,18 +41,18 @@ function set_iam_policy_sample(string $project, string $resource, string $zone): // Create a client. $nodeGroupsClient = new NodeGroupsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $zoneSetPolicyRequestResource = new ZoneSetPolicyRequest(); + $request = (new SetIamPolicyNodeGroupRequest()) + ->setProject($project) + ->setResource($resource) + ->setZone($zone) + ->setZoneSetPolicyRequestResource($zoneSetPolicyRequestResource); // Call the API and handle any network failures. try { /** @var Policy $response */ - $response = $nodeGroupsClient->setIamPolicy( - $project, - $resource, - $zone, - $zoneSetPolicyRequestResource - ); + $response = $nodeGroupsClient->setIamPolicy($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/NodeGroupsClient/set_node_template.php b/Compute/samples/V1/NodeGroupsClient/set_node_template.php index 4ea1e3cc03a9..0685d9a43fe1 100644 --- a/Compute/samples/V1/NodeGroupsClient/set_node_template.php +++ b/Compute/samples/V1/NodeGroupsClient/set_node_template.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_NodeGroups_SetNodeTemplate_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\NodeGroupsClient; +use Google\Cloud\Compute\V1\Client\NodeGroupsClient; use Google\Cloud\Compute\V1\NodeGroupsSetNodeTemplateRequest; +use Google\Cloud\Compute\V1\SetNodeTemplateNodeGroupRequest; use Google\Rpc\Status; /** @@ -41,18 +42,18 @@ function set_node_template_sample(string $nodeGroup, string $project, string $zo // Create a client. $nodeGroupsClient = new NodeGroupsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $nodeGroupsSetNodeTemplateRequestResource = new NodeGroupsSetNodeTemplateRequest(); + $request = (new SetNodeTemplateNodeGroupRequest()) + ->setNodeGroup($nodeGroup) + ->setNodeGroupsSetNodeTemplateRequestResource($nodeGroupsSetNodeTemplateRequestResource) + ->setProject($project) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $nodeGroupsClient->setNodeTemplate( - $nodeGroup, - $nodeGroupsSetNodeTemplateRequestResource, - $project, - $zone - ); + $response = $nodeGroupsClient->setNodeTemplate($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/NodeGroupsClient/simulate_maintenance_event.php b/Compute/samples/V1/NodeGroupsClient/simulate_maintenance_event.php index 185e9f0e17e3..7d4fe1346360 100644 --- a/Compute/samples/V1/NodeGroupsClient/simulate_maintenance_event.php +++ b/Compute/samples/V1/NodeGroupsClient/simulate_maintenance_event.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_NodeGroups_SimulateMaintenanceEvent_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\NodeGroupsClient; +use Google\Cloud\Compute\V1\Client\NodeGroupsClient; use Google\Cloud\Compute\V1\NodeGroupsSimulateMaintenanceEventRequest; +use Google\Cloud\Compute\V1\SimulateMaintenanceEventNodeGroupRequest; use Google\Rpc\Status; /** @@ -41,18 +42,20 @@ function simulate_maintenance_event_sample(string $nodeGroup, string $project, s // Create a client. $nodeGroupsClient = new NodeGroupsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $nodeGroupsSimulateMaintenanceEventRequestResource = new NodeGroupsSimulateMaintenanceEventRequest(); + $request = (new SimulateMaintenanceEventNodeGroupRequest()) + ->setNodeGroup($nodeGroup) + ->setNodeGroupsSimulateMaintenanceEventRequestResource( + $nodeGroupsSimulateMaintenanceEventRequestResource + ) + ->setProject($project) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $nodeGroupsClient->simulateMaintenanceEvent( - $nodeGroup, - $nodeGroupsSimulateMaintenanceEventRequestResource, - $project, - $zone - ); + $response = $nodeGroupsClient->simulateMaintenanceEvent($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/NodeGroupsClient/test_iam_permissions.php b/Compute/samples/V1/NodeGroupsClient/test_iam_permissions.php index aff7d1c0ad75..e2352a2665f6 100644 --- a/Compute/samples/V1/NodeGroupsClient/test_iam_permissions.php +++ b/Compute/samples/V1/NodeGroupsClient/test_iam_permissions.php @@ -24,7 +24,8 @@ // [START compute_v1_generated_NodeGroups_TestIamPermissions_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\NodeGroupsClient; +use Google\Cloud\Compute\V1\Client\NodeGroupsClient; +use Google\Cloud\Compute\V1\TestIamPermissionsNodeGroupRequest; use Google\Cloud\Compute\V1\TestPermissionsRequest; use Google\Cloud\Compute\V1\TestPermissionsResponse; @@ -40,18 +41,18 @@ function test_iam_permissions_sample(string $project, string $resource, string $ // Create a client. $nodeGroupsClient = new NodeGroupsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $testPermissionsRequestResource = new TestPermissionsRequest(); + $request = (new TestIamPermissionsNodeGroupRequest()) + ->setProject($project) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var TestPermissionsResponse $response */ - $response = $nodeGroupsClient->testIamPermissions( - $project, - $resource, - $testPermissionsRequestResource, - $zone - ); + $response = $nodeGroupsClient->testIamPermissions($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/NodeTemplatesClient/aggregated_list.php b/Compute/samples/V1/NodeTemplatesClient/aggregated_list.php index edd8d12fe94b..1992b8235fe9 100644 --- a/Compute/samples/V1/NodeTemplatesClient/aggregated_list.php +++ b/Compute/samples/V1/NodeTemplatesClient/aggregated_list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_NodeTemplates_AggregatedList_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\NodeTemplatesClient; +use Google\Cloud\Compute\V1\AggregatedListNodeTemplatesRequest; +use Google\Cloud\Compute\V1\Client\NodeTemplatesClient; /** * Retrieves an aggregated list of node templates. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. @@ -37,10 +38,14 @@ function aggregated_list_sample(string $project): void // Create a client. $nodeTemplatesClient = new NodeTemplatesClient(); + // Prepare the request message. + $request = (new AggregatedListNodeTemplatesRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $nodeTemplatesClient->aggregatedList($project); + $response = $nodeTemplatesClient->aggregatedList($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/NodeTemplatesClient/delete.php b/Compute/samples/V1/NodeTemplatesClient/delete.php index 187409136e67..ee4fd2976a83 100644 --- a/Compute/samples/V1/NodeTemplatesClient/delete.php +++ b/Compute/samples/V1/NodeTemplatesClient/delete.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_NodeTemplates_Delete_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\NodeTemplatesClient; +use Google\Cloud\Compute\V1\Client\NodeTemplatesClient; +use Google\Cloud\Compute\V1\DeleteNodeTemplateRequest; use Google\Rpc\Status; /** @@ -40,10 +41,16 @@ function delete_sample(string $nodeTemplate, string $project, string $region): v // Create a client. $nodeTemplatesClient = new NodeTemplatesClient(); + // Prepare the request message. + $request = (new DeleteNodeTemplateRequest()) + ->setNodeTemplate($nodeTemplate) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $nodeTemplatesClient->delete($nodeTemplate, $project, $region); + $response = $nodeTemplatesClient->delete($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/NodeTemplatesClient/get.php b/Compute/samples/V1/NodeTemplatesClient/get.php index f1b6ca4f0b43..94299f451220 100644 --- a/Compute/samples/V1/NodeTemplatesClient/get.php +++ b/Compute/samples/V1/NodeTemplatesClient/get.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_NodeTemplates_Get_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\NodeTemplatesClient; +use Google\Cloud\Compute\V1\GetNodeTemplateRequest; use Google\Cloud\Compute\V1\NodeTemplate; -use Google\Cloud\Compute\V1\NodeTemplatesClient; /** * Returns the specified node template. @@ -39,10 +40,16 @@ function get_sample(string $nodeTemplate, string $project, string $region): void // Create a client. $nodeTemplatesClient = new NodeTemplatesClient(); + // Prepare the request message. + $request = (new GetNodeTemplateRequest()) + ->setNodeTemplate($nodeTemplate) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var NodeTemplate $response */ - $response = $nodeTemplatesClient->get($nodeTemplate, $project, $region); + $response = $nodeTemplatesClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/NodeTemplatesClient/get_iam_policy.php b/Compute/samples/V1/NodeTemplatesClient/get_iam_policy.php index 34f34380617c..17cb2b7e33f4 100644 --- a/Compute/samples/V1/NodeTemplatesClient/get_iam_policy.php +++ b/Compute/samples/V1/NodeTemplatesClient/get_iam_policy.php @@ -24,7 +24,8 @@ // [START compute_v1_generated_NodeTemplates_GetIamPolicy_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\NodeTemplatesClient; +use Google\Cloud\Compute\V1\Client\NodeTemplatesClient; +use Google\Cloud\Compute\V1\GetIamPolicyNodeTemplateRequest; use Google\Cloud\Compute\V1\Policy; /** @@ -39,10 +40,16 @@ function get_iam_policy_sample(string $project, string $region, string $resource // Create a client. $nodeTemplatesClient = new NodeTemplatesClient(); + // Prepare the request message. + $request = (new GetIamPolicyNodeTemplateRequest()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource); + // Call the API and handle any network failures. try { /** @var Policy $response */ - $response = $nodeTemplatesClient->getIamPolicy($project, $region, $resource); + $response = $nodeTemplatesClient->getIamPolicy($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/NodeTemplatesClient/insert.php b/Compute/samples/V1/NodeTemplatesClient/insert.php index e9dca78bd467..c9b383bfd526 100644 --- a/Compute/samples/V1/NodeTemplatesClient/insert.php +++ b/Compute/samples/V1/NodeTemplatesClient/insert.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_NodeTemplates_Insert_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\NodeTemplatesClient; +use Google\Cloud\Compute\V1\InsertNodeTemplateRequest; use Google\Cloud\Compute\V1\NodeTemplate; -use Google\Cloud\Compute\V1\NodeTemplatesClient; use Google\Rpc\Status; /** @@ -40,13 +41,17 @@ function insert_sample(string $project, string $region): void // Create a client. $nodeTemplatesClient = new NodeTemplatesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $nodeTemplateResource = new NodeTemplate(); + $request = (new InsertNodeTemplateRequest()) + ->setNodeTemplateResource($nodeTemplateResource) + ->setProject($project) + ->setRegion($region); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $nodeTemplatesClient->insert($nodeTemplateResource, $project, $region); + $response = $nodeTemplatesClient->insert($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/NodeTemplatesClient/list.php b/Compute/samples/V1/NodeTemplatesClient/list.php index 3235f2fb05c5..b93839441c9f 100644 --- a/Compute/samples/V1/NodeTemplatesClient/list.php +++ b/Compute/samples/V1/NodeTemplatesClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_NodeTemplates_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\NodeTemplatesClient; +use Google\Cloud\Compute\V1\Client\NodeTemplatesClient; +use Google\Cloud\Compute\V1\ListNodeTemplatesRequest; /** * Retrieves a list of node templates available to the specified project. @@ -38,10 +39,15 @@ function list_sample(string $project, string $region): void // Create a client. $nodeTemplatesClient = new NodeTemplatesClient(); + // Prepare the request message. + $request = (new ListNodeTemplatesRequest()) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $nodeTemplatesClient->list($project, $region); + $response = $nodeTemplatesClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/NodeTemplatesClient/set_iam_policy.php b/Compute/samples/V1/NodeTemplatesClient/set_iam_policy.php index f56260fc82ee..c18c304513a1 100644 --- a/Compute/samples/V1/NodeTemplatesClient/set_iam_policy.php +++ b/Compute/samples/V1/NodeTemplatesClient/set_iam_policy.php @@ -24,9 +24,10 @@ // [START compute_v1_generated_NodeTemplates_SetIamPolicy_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\NodeTemplatesClient; +use Google\Cloud\Compute\V1\Client\NodeTemplatesClient; use Google\Cloud\Compute\V1\Policy; use Google\Cloud\Compute\V1\RegionSetPolicyRequest; +use Google\Cloud\Compute\V1\SetIamPolicyNodeTemplateRequest; /** * Sets the access control policy on the specified resource. Replaces any existing policy. @@ -40,18 +41,18 @@ function set_iam_policy_sample(string $project, string $region, string $resource // Create a client. $nodeTemplatesClient = new NodeTemplatesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $regionSetPolicyRequestResource = new RegionSetPolicyRequest(); + $request = (new SetIamPolicyNodeTemplateRequest()) + ->setProject($project) + ->setRegion($region) + ->setRegionSetPolicyRequestResource($regionSetPolicyRequestResource) + ->setResource($resource); // Call the API and handle any network failures. try { /** @var Policy $response */ - $response = $nodeTemplatesClient->setIamPolicy( - $project, - $region, - $regionSetPolicyRequestResource, - $resource - ); + $response = $nodeTemplatesClient->setIamPolicy($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/NodeTemplatesClient/test_iam_permissions.php b/Compute/samples/V1/NodeTemplatesClient/test_iam_permissions.php index c95a48c6d029..68735699050d 100644 --- a/Compute/samples/V1/NodeTemplatesClient/test_iam_permissions.php +++ b/Compute/samples/V1/NodeTemplatesClient/test_iam_permissions.php @@ -24,7 +24,8 @@ // [START compute_v1_generated_NodeTemplates_TestIamPermissions_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\NodeTemplatesClient; +use Google\Cloud\Compute\V1\Client\NodeTemplatesClient; +use Google\Cloud\Compute\V1\TestIamPermissionsNodeTemplateRequest; use Google\Cloud\Compute\V1\TestPermissionsRequest; use Google\Cloud\Compute\V1\TestPermissionsResponse; @@ -40,18 +41,18 @@ function test_iam_permissions_sample(string $project, string $region, string $re // Create a client. $nodeTemplatesClient = new NodeTemplatesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $testPermissionsRequestResource = new TestPermissionsRequest(); + $request = (new TestIamPermissionsNodeTemplateRequest()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); // Call the API and handle any network failures. try { /** @var TestPermissionsResponse $response */ - $response = $nodeTemplatesClient->testIamPermissions( - $project, - $region, - $resource, - $testPermissionsRequestResource - ); + $response = $nodeTemplatesClient->testIamPermissions($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/NodeTypesClient/aggregated_list.php b/Compute/samples/V1/NodeTypesClient/aggregated_list.php index 848b029a5a1e..636f23d564d5 100644 --- a/Compute/samples/V1/NodeTypesClient/aggregated_list.php +++ b/Compute/samples/V1/NodeTypesClient/aggregated_list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_NodeTypes_AggregatedList_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\NodeTypesClient; +use Google\Cloud\Compute\V1\AggregatedListNodeTypesRequest; +use Google\Cloud\Compute\V1\Client\NodeTypesClient; /** * Retrieves an aggregated list of node types. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. @@ -37,10 +38,14 @@ function aggregated_list_sample(string $project): void // Create a client. $nodeTypesClient = new NodeTypesClient(); + // Prepare the request message. + $request = (new AggregatedListNodeTypesRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $nodeTypesClient->aggregatedList($project); + $response = $nodeTypesClient->aggregatedList($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/NodeTypesClient/get.php b/Compute/samples/V1/NodeTypesClient/get.php index 88d08cd118da..3bad25061da6 100644 --- a/Compute/samples/V1/NodeTypesClient/get.php +++ b/Compute/samples/V1/NodeTypesClient/get.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_NodeTypes_Get_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\NodeTypesClient; +use Google\Cloud\Compute\V1\GetNodeTypeRequest; use Google\Cloud\Compute\V1\NodeType; -use Google\Cloud\Compute\V1\NodeTypesClient; /** * Returns the specified node type. @@ -39,10 +40,16 @@ function get_sample(string $nodeType, string $project, string $zone): void // Create a client. $nodeTypesClient = new NodeTypesClient(); + // Prepare the request message. + $request = (new GetNodeTypeRequest()) + ->setNodeType($nodeType) + ->setProject($project) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var NodeType $response */ - $response = $nodeTypesClient->get($nodeType, $project, $zone); + $response = $nodeTypesClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/NodeTypesClient/list.php b/Compute/samples/V1/NodeTypesClient/list.php index 13ae059a28dc..9b0b08845474 100644 --- a/Compute/samples/V1/NodeTypesClient/list.php +++ b/Compute/samples/V1/NodeTypesClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_NodeTypes_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\NodeTypesClient; +use Google\Cloud\Compute\V1\Client\NodeTypesClient; +use Google\Cloud\Compute\V1\ListNodeTypesRequest; /** * Retrieves a list of node types available to the specified project. @@ -38,10 +39,15 @@ function list_sample(string $project, string $zone): void // Create a client. $nodeTypesClient = new NodeTypesClient(); + // Prepare the request message. + $request = (new ListNodeTypesRequest()) + ->setProject($project) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $nodeTypesClient->list($project, $zone); + $response = $nodeTypesClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/PacketMirroringsClient/aggregated_list.php b/Compute/samples/V1/PacketMirroringsClient/aggregated_list.php index 4963e28304d6..620125087267 100644 --- a/Compute/samples/V1/PacketMirroringsClient/aggregated_list.php +++ b/Compute/samples/V1/PacketMirroringsClient/aggregated_list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_PacketMirrorings_AggregatedList_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\PacketMirroringsClient; +use Google\Cloud\Compute\V1\AggregatedListPacketMirroringsRequest; +use Google\Cloud\Compute\V1\Client\PacketMirroringsClient; /** * Retrieves an aggregated list of packetMirrorings. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. @@ -37,10 +38,14 @@ function aggregated_list_sample(string $project): void // Create a client. $packetMirroringsClient = new PacketMirroringsClient(); + // Prepare the request message. + $request = (new AggregatedListPacketMirroringsRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $packetMirroringsClient->aggregatedList($project); + $response = $packetMirroringsClient->aggregatedList($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/PacketMirroringsClient/delete.php b/Compute/samples/V1/PacketMirroringsClient/delete.php index 86ee839e55e7..b6fdc8b0f55c 100644 --- a/Compute/samples/V1/PacketMirroringsClient/delete.php +++ b/Compute/samples/V1/PacketMirroringsClient/delete.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_PacketMirrorings_Delete_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\PacketMirroringsClient; +use Google\Cloud\Compute\V1\Client\PacketMirroringsClient; +use Google\Cloud\Compute\V1\DeletePacketMirroringRequest; use Google\Rpc\Status; /** @@ -40,10 +41,16 @@ function delete_sample(string $packetMirroring, string $project, string $region) // Create a client. $packetMirroringsClient = new PacketMirroringsClient(); + // Prepare the request message. + $request = (new DeletePacketMirroringRequest()) + ->setPacketMirroring($packetMirroring) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $packetMirroringsClient->delete($packetMirroring, $project, $region); + $response = $packetMirroringsClient->delete($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/PacketMirroringsClient/get.php b/Compute/samples/V1/PacketMirroringsClient/get.php index ec72d3e0c337..e65e050e7ab2 100644 --- a/Compute/samples/V1/PacketMirroringsClient/get.php +++ b/Compute/samples/V1/PacketMirroringsClient/get.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_PacketMirrorings_Get_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\PacketMirroringsClient; +use Google\Cloud\Compute\V1\GetPacketMirroringRequest; use Google\Cloud\Compute\V1\PacketMirroring; -use Google\Cloud\Compute\V1\PacketMirroringsClient; /** * Returns the specified PacketMirroring resource. @@ -39,10 +40,16 @@ function get_sample(string $packetMirroring, string $project, string $region): v // Create a client. $packetMirroringsClient = new PacketMirroringsClient(); + // Prepare the request message. + $request = (new GetPacketMirroringRequest()) + ->setPacketMirroring($packetMirroring) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var PacketMirroring $response */ - $response = $packetMirroringsClient->get($packetMirroring, $project, $region); + $response = $packetMirroringsClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/PacketMirroringsClient/insert.php b/Compute/samples/V1/PacketMirroringsClient/insert.php index 34f4b4fc6a60..c27ac3360b5a 100644 --- a/Compute/samples/V1/PacketMirroringsClient/insert.php +++ b/Compute/samples/V1/PacketMirroringsClient/insert.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_PacketMirrorings_Insert_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\PacketMirroringsClient; +use Google\Cloud\Compute\V1\InsertPacketMirroringRequest; use Google\Cloud\Compute\V1\PacketMirroring; -use Google\Cloud\Compute\V1\PacketMirroringsClient; use Google\Rpc\Status; /** @@ -40,13 +41,17 @@ function insert_sample(string $project, string $region): void // Create a client. $packetMirroringsClient = new PacketMirroringsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $packetMirroringResource = new PacketMirroring(); + $request = (new InsertPacketMirroringRequest()) + ->setPacketMirroringResource($packetMirroringResource) + ->setProject($project) + ->setRegion($region); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $packetMirroringsClient->insert($packetMirroringResource, $project, $region); + $response = $packetMirroringsClient->insert($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/PacketMirroringsClient/list.php b/Compute/samples/V1/PacketMirroringsClient/list.php index 5bf7e7c21776..301a32da93b3 100644 --- a/Compute/samples/V1/PacketMirroringsClient/list.php +++ b/Compute/samples/V1/PacketMirroringsClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_PacketMirrorings_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\PacketMirroringsClient; +use Google\Cloud\Compute\V1\Client\PacketMirroringsClient; +use Google\Cloud\Compute\V1\ListPacketMirroringsRequest; /** * Retrieves a list of PacketMirroring resources available to the specified project and region. @@ -38,10 +39,15 @@ function list_sample(string $project, string $region): void // Create a client. $packetMirroringsClient = new PacketMirroringsClient(); + // Prepare the request message. + $request = (new ListPacketMirroringsRequest()) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $packetMirroringsClient->list($project, $region); + $response = $packetMirroringsClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/PacketMirroringsClient/patch.php b/Compute/samples/V1/PacketMirroringsClient/patch.php index 8616f88bd2af..76f9d658c044 100644 --- a/Compute/samples/V1/PacketMirroringsClient/patch.php +++ b/Compute/samples/V1/PacketMirroringsClient/patch.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_PacketMirrorings_Patch_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\PacketMirroringsClient; use Google\Cloud\Compute\V1\PacketMirroring; -use Google\Cloud\Compute\V1\PacketMirroringsClient; +use Google\Cloud\Compute\V1\PatchPacketMirroringRequest; use Google\Rpc\Status; /** @@ -41,18 +42,18 @@ function patch_sample(string $packetMirroring, string $project, string $region): // Create a client. $packetMirroringsClient = new PacketMirroringsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $packetMirroringResource = new PacketMirroring(); + $request = (new PatchPacketMirroringRequest()) + ->setPacketMirroring($packetMirroring) + ->setPacketMirroringResource($packetMirroringResource) + ->setProject($project) + ->setRegion($region); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $packetMirroringsClient->patch( - $packetMirroring, - $packetMirroringResource, - $project, - $region - ); + $response = $packetMirroringsClient->patch($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/PacketMirroringsClient/test_iam_permissions.php b/Compute/samples/V1/PacketMirroringsClient/test_iam_permissions.php index 2413d2240b34..9e785a8b5925 100644 --- a/Compute/samples/V1/PacketMirroringsClient/test_iam_permissions.php +++ b/Compute/samples/V1/PacketMirroringsClient/test_iam_permissions.php @@ -24,7 +24,8 @@ // [START compute_v1_generated_PacketMirrorings_TestIamPermissions_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\PacketMirroringsClient; +use Google\Cloud\Compute\V1\Client\PacketMirroringsClient; +use Google\Cloud\Compute\V1\TestIamPermissionsPacketMirroringRequest; use Google\Cloud\Compute\V1\TestPermissionsRequest; use Google\Cloud\Compute\V1\TestPermissionsResponse; @@ -40,18 +41,18 @@ function test_iam_permissions_sample(string $project, string $region, string $re // Create a client. $packetMirroringsClient = new PacketMirroringsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $testPermissionsRequestResource = new TestPermissionsRequest(); + $request = (new TestIamPermissionsPacketMirroringRequest()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); // Call the API and handle any network failures. try { /** @var TestPermissionsResponse $response */ - $response = $packetMirroringsClient->testIamPermissions( - $project, - $region, - $resource, - $testPermissionsRequestResource - ); + $response = $packetMirroringsClient->testIamPermissions($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/ProjectsClient/disable_xpn_host.php b/Compute/samples/V1/ProjectsClient/disable_xpn_host.php index b881c0481acd..5709cd495971 100644 --- a/Compute/samples/V1/ProjectsClient/disable_xpn_host.php +++ b/Compute/samples/V1/ProjectsClient/disable_xpn_host.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_Projects_DisableXpnHost_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\ProjectsClient; +use Google\Cloud\Compute\V1\Client\ProjectsClient; +use Google\Cloud\Compute\V1\DisableXpnHostProjectRequest; use Google\Rpc\Status; /** @@ -38,10 +39,14 @@ function disable_xpn_host_sample(string $project): void // Create a client. $projectsClient = new ProjectsClient(); + // Prepare the request message. + $request = (new DisableXpnHostProjectRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $projectsClient->disableXpnHost($project); + $response = $projectsClient->disableXpnHost($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/ProjectsClient/disable_xpn_resource.php b/Compute/samples/V1/ProjectsClient/disable_xpn_resource.php index 5911a3a2dda9..033537965a4d 100644 --- a/Compute/samples/V1/ProjectsClient/disable_xpn_resource.php +++ b/Compute/samples/V1/ProjectsClient/disable_xpn_resource.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_Projects_DisableXpnResource_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\ProjectsClient; +use Google\Cloud\Compute\V1\Client\ProjectsClient; +use Google\Cloud\Compute\V1\DisableXpnResourceProjectRequest; use Google\Cloud\Compute\V1\ProjectsDisableXpnResourceRequest; use Google\Rpc\Status; @@ -39,16 +40,16 @@ function disable_xpn_resource_sample(string $project): void // Create a client. $projectsClient = new ProjectsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $projectsDisableXpnResourceRequestResource = new ProjectsDisableXpnResourceRequest(); + $request = (new DisableXpnResourceProjectRequest()) + ->setProject($project) + ->setProjectsDisableXpnResourceRequestResource($projectsDisableXpnResourceRequestResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $projectsClient->disableXpnResource( - $project, - $projectsDisableXpnResourceRequestResource - ); + $response = $projectsClient->disableXpnResource($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/ProjectsClient/enable_xpn_host.php b/Compute/samples/V1/ProjectsClient/enable_xpn_host.php index 99eacc1f40d6..9d94fdbddfcf 100644 --- a/Compute/samples/V1/ProjectsClient/enable_xpn_host.php +++ b/Compute/samples/V1/ProjectsClient/enable_xpn_host.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_Projects_EnableXpnHost_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\ProjectsClient; +use Google\Cloud\Compute\V1\Client\ProjectsClient; +use Google\Cloud\Compute\V1\EnableXpnHostProjectRequest; use Google\Rpc\Status; /** @@ -38,10 +39,14 @@ function enable_xpn_host_sample(string $project): void // Create a client. $projectsClient = new ProjectsClient(); + // Prepare the request message. + $request = (new EnableXpnHostProjectRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $projectsClient->enableXpnHost($project); + $response = $projectsClient->enableXpnHost($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/ProjectsClient/enable_xpn_resource.php b/Compute/samples/V1/ProjectsClient/enable_xpn_resource.php index fd102b704ba1..809277a8bdb0 100644 --- a/Compute/samples/V1/ProjectsClient/enable_xpn_resource.php +++ b/Compute/samples/V1/ProjectsClient/enable_xpn_resource.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_Projects_EnableXpnResource_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\ProjectsClient; +use Google\Cloud\Compute\V1\Client\ProjectsClient; +use Google\Cloud\Compute\V1\EnableXpnResourceProjectRequest; use Google\Cloud\Compute\V1\ProjectsEnableXpnResourceRequest; use Google\Rpc\Status; @@ -39,13 +40,16 @@ function enable_xpn_resource_sample(string $project): void // Create a client. $projectsClient = new ProjectsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $projectsEnableXpnResourceRequestResource = new ProjectsEnableXpnResourceRequest(); + $request = (new EnableXpnResourceProjectRequest()) + ->setProject($project) + ->setProjectsEnableXpnResourceRequestResource($projectsEnableXpnResourceRequestResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $projectsClient->enableXpnResource($project, $projectsEnableXpnResourceRequestResource); + $response = $projectsClient->enableXpnResource($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/ProjectsClient/get.php b/Compute/samples/V1/ProjectsClient/get.php index 7dbd78b5a133..d88296131b81 100644 --- a/Compute/samples/V1/ProjectsClient/get.php +++ b/Compute/samples/V1/ProjectsClient/get.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_Projects_Get_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\ProjectsClient; +use Google\Cloud\Compute\V1\GetProjectRequest; use Google\Cloud\Compute\V1\Project; -use Google\Cloud\Compute\V1\ProjectsClient; /** * Returns the specified Project resource. To decrease latency for this method, you can optionally omit any unneeded information from the response by using a field mask. This practice is especially recommended for unused quota information (the `quotas` field). To exclude one or more fields, set your request's `fields` query parameter to only include the fields you need. For example, to only include the `id` and `selfLink` fields, add the query parameter `?fields=id,selfLink` to your request. @@ -37,10 +38,14 @@ function get_sample(string $project): void // Create a client. $projectsClient = new ProjectsClient(); + // Prepare the request message. + $request = (new GetProjectRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var Project $response */ - $response = $projectsClient->get($project); + $response = $projectsClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/ProjectsClient/get_xpn_host.php b/Compute/samples/V1/ProjectsClient/get_xpn_host.php index e9c1aae0ab1b..bb068eff35dd 100644 --- a/Compute/samples/V1/ProjectsClient/get_xpn_host.php +++ b/Compute/samples/V1/ProjectsClient/get_xpn_host.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_Projects_GetXpnHost_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\ProjectsClient; +use Google\Cloud\Compute\V1\GetXpnHostProjectRequest; use Google\Cloud\Compute\V1\Project; -use Google\Cloud\Compute\V1\ProjectsClient; /** * Gets the shared VPC host project that this project links to. May be empty if no link exists. @@ -37,10 +38,14 @@ function get_xpn_host_sample(string $project): void // Create a client. $projectsClient = new ProjectsClient(); + // Prepare the request message. + $request = (new GetXpnHostProjectRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var Project $response */ - $response = $projectsClient->getXpnHost($project); + $response = $projectsClient->getXpnHost($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/ProjectsClient/get_xpn_resources.php b/Compute/samples/V1/ProjectsClient/get_xpn_resources.php index 4bfcdab81b4e..d84f1a1017e8 100644 --- a/Compute/samples/V1/ProjectsClient/get_xpn_resources.php +++ b/Compute/samples/V1/ProjectsClient/get_xpn_resources.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_Projects_GetXpnResources_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\ProjectsClient; +use Google\Cloud\Compute\V1\Client\ProjectsClient; +use Google\Cloud\Compute\V1\GetXpnResourcesProjectsRequest; /** * Gets service resources (a.k.a service project) associated with this host project. @@ -37,10 +38,14 @@ function get_xpn_resources_sample(string $project): void // Create a client. $projectsClient = new ProjectsClient(); + // Prepare the request message. + $request = (new GetXpnResourcesProjectsRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $projectsClient->getXpnResources($project); + $response = $projectsClient->getXpnResources($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/ProjectsClient/list_xpn_hosts.php b/Compute/samples/V1/ProjectsClient/list_xpn_hosts.php index cd936fcb5f71..0670cfa2d41c 100644 --- a/Compute/samples/V1/ProjectsClient/list_xpn_hosts.php +++ b/Compute/samples/V1/ProjectsClient/list_xpn_hosts.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_Projects_ListXpnHosts_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\ProjectsClient; +use Google\Cloud\Compute\V1\Client\ProjectsClient; +use Google\Cloud\Compute\V1\ListXpnHostsProjectsRequest; use Google\Cloud\Compute\V1\ProjectsListXpnHostsRequest; /** @@ -38,13 +39,16 @@ function list_xpn_hosts_sample(string $project): void // Create a client. $projectsClient = new ProjectsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $projectsListXpnHostsRequestResource = new ProjectsListXpnHostsRequest(); + $request = (new ListXpnHostsProjectsRequest()) + ->setProject($project) + ->setProjectsListXpnHostsRequestResource($projectsListXpnHostsRequestResource); // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $projectsClient->listXpnHosts($project, $projectsListXpnHostsRequestResource); + $response = $projectsClient->listXpnHosts($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/ProjectsClient/move_disk.php b/Compute/samples/V1/ProjectsClient/move_disk.php index 5fad68797e37..a4f369ab0ffd 100644 --- a/Compute/samples/V1/ProjectsClient/move_disk.php +++ b/Compute/samples/V1/ProjectsClient/move_disk.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_Projects_MoveDisk_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\ProjectsClient; use Google\Cloud\Compute\V1\DiskMoveRequest; -use Google\Cloud\Compute\V1\ProjectsClient; +use Google\Cloud\Compute\V1\MoveDiskProjectRequest; use Google\Rpc\Status; /** @@ -39,13 +40,16 @@ function move_disk_sample(string $project): void // Create a client. $projectsClient = new ProjectsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $diskMoveRequestResource = new DiskMoveRequest(); + $request = (new MoveDiskProjectRequest()) + ->setDiskMoveRequestResource($diskMoveRequestResource) + ->setProject($project); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $projectsClient->moveDisk($diskMoveRequestResource, $project); + $response = $projectsClient->moveDisk($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/ProjectsClient/move_instance.php b/Compute/samples/V1/ProjectsClient/move_instance.php index ac81c98db77c..e641675e7dde 100644 --- a/Compute/samples/V1/ProjectsClient/move_instance.php +++ b/Compute/samples/V1/ProjectsClient/move_instance.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_Projects_MoveInstance_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\ProjectsClient; use Google\Cloud\Compute\V1\InstanceMoveRequest; -use Google\Cloud\Compute\V1\ProjectsClient; +use Google\Cloud\Compute\V1\MoveInstanceProjectRequest; use Google\Rpc\Status; /** @@ -39,13 +40,16 @@ function move_instance_sample(string $project): void // Create a client. $projectsClient = new ProjectsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $instanceMoveRequestResource = new InstanceMoveRequest(); + $request = (new MoveInstanceProjectRequest()) + ->setInstanceMoveRequestResource($instanceMoveRequestResource) + ->setProject($project); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $projectsClient->moveInstance($instanceMoveRequestResource, $project); + $response = $projectsClient->moveInstance($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/ProjectsClient/set_cloud_armor_tier.php b/Compute/samples/V1/ProjectsClient/set_cloud_armor_tier.php index b299afcc8ba2..de4cbfb92b96 100644 --- a/Compute/samples/V1/ProjectsClient/set_cloud_armor_tier.php +++ b/Compute/samples/V1/ProjectsClient/set_cloud_armor_tier.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_Projects_SetCloudArmorTier_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\ProjectsClient; +use Google\Cloud\Compute\V1\Client\ProjectsClient; use Google\Cloud\Compute\V1\ProjectsSetCloudArmorTierRequest; +use Google\Cloud\Compute\V1\SetCloudArmorTierProjectRequest; use Google\Rpc\Status; /** @@ -39,13 +40,16 @@ function set_cloud_armor_tier_sample(string $project): void // Create a client. $projectsClient = new ProjectsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $projectsSetCloudArmorTierRequestResource = new ProjectsSetCloudArmorTierRequest(); + $request = (new SetCloudArmorTierProjectRequest()) + ->setProject($project) + ->setProjectsSetCloudArmorTierRequestResource($projectsSetCloudArmorTierRequestResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $projectsClient->setCloudArmorTier($project, $projectsSetCloudArmorTierRequestResource); + $response = $projectsClient->setCloudArmorTier($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/ProjectsClient/set_common_instance_metadata.php b/Compute/samples/V1/ProjectsClient/set_common_instance_metadata.php index 5032b470aee2..fb54a1da871e 100644 --- a/Compute/samples/V1/ProjectsClient/set_common_instance_metadata.php +++ b/Compute/samples/V1/ProjectsClient/set_common_instance_metadata.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_Projects_SetCommonInstanceMetadata_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\ProjectsClient; use Google\Cloud\Compute\V1\Metadata; -use Google\Cloud\Compute\V1\ProjectsClient; +use Google\Cloud\Compute\V1\SetCommonInstanceMetadataProjectRequest; use Google\Rpc\Status; /** @@ -39,13 +40,16 @@ function set_common_instance_metadata_sample(string $project): void // Create a client. $projectsClient = new ProjectsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $metadataResource = new Metadata(); + $request = (new SetCommonInstanceMetadataProjectRequest()) + ->setMetadataResource($metadataResource) + ->setProject($project); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $projectsClient->setCommonInstanceMetadata($metadataResource, $project); + $response = $projectsClient->setCommonInstanceMetadata($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/ProjectsClient/set_default_network_tier.php b/Compute/samples/V1/ProjectsClient/set_default_network_tier.php index 0734cd9d333c..71d062693b51 100644 --- a/Compute/samples/V1/ProjectsClient/set_default_network_tier.php +++ b/Compute/samples/V1/ProjectsClient/set_default_network_tier.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_Projects_SetDefaultNetworkTier_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\ProjectsClient; +use Google\Cloud\Compute\V1\Client\ProjectsClient; use Google\Cloud\Compute\V1\ProjectsSetDefaultNetworkTierRequest; +use Google\Cloud\Compute\V1\SetDefaultNetworkTierProjectRequest; use Google\Rpc\Status; /** @@ -39,16 +40,16 @@ function set_default_network_tier_sample(string $project): void // Create a client. $projectsClient = new ProjectsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $projectsSetDefaultNetworkTierRequestResource = new ProjectsSetDefaultNetworkTierRequest(); + $request = (new SetDefaultNetworkTierProjectRequest()) + ->setProject($project) + ->setProjectsSetDefaultNetworkTierRequestResource($projectsSetDefaultNetworkTierRequestResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $projectsClient->setDefaultNetworkTier( - $project, - $projectsSetDefaultNetworkTierRequestResource - ); + $response = $projectsClient->setDefaultNetworkTier($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/ProjectsClient/set_usage_export_bucket.php b/Compute/samples/V1/ProjectsClient/set_usage_export_bucket.php index 0f2b22914f6a..e46730fcd647 100644 --- a/Compute/samples/V1/ProjectsClient/set_usage_export_bucket.php +++ b/Compute/samples/V1/ProjectsClient/set_usage_export_bucket.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_Projects_SetUsageExportBucket_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\ProjectsClient; +use Google\Cloud\Compute\V1\Client\ProjectsClient; +use Google\Cloud\Compute\V1\SetUsageExportBucketProjectRequest; use Google\Cloud\Compute\V1\UsageExportLocation; use Google\Rpc\Status; @@ -39,13 +40,16 @@ function set_usage_export_bucket_sample(string $project): void // Create a client. $projectsClient = new ProjectsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $usageExportLocationResource = new UsageExportLocation(); + $request = (new SetUsageExportBucketProjectRequest()) + ->setProject($project) + ->setUsageExportLocationResource($usageExportLocationResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $projectsClient->setUsageExportBucket($project, $usageExportLocationResource); + $response = $projectsClient->setUsageExportBucket($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/PublicAdvertisedPrefixesClient/announce.php b/Compute/samples/V1/PublicAdvertisedPrefixesClient/announce.php index d88f6ac664bb..d22a19175e40 100644 --- a/Compute/samples/V1/PublicAdvertisedPrefixesClient/announce.php +++ b/Compute/samples/V1/PublicAdvertisedPrefixesClient/announce.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_PublicAdvertisedPrefixes_Announce_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\PublicAdvertisedPrefixesClient; +use Google\Cloud\Compute\V1\AnnouncePublicAdvertisedPrefixeRequest; +use Google\Cloud\Compute\V1\Client\PublicAdvertisedPrefixesClient; use Google\Rpc\Status; /** @@ -39,10 +40,15 @@ function announce_sample(string $project, string $publicAdvertisedPrefix): void // Create a client. $publicAdvertisedPrefixesClient = new PublicAdvertisedPrefixesClient(); + // Prepare the request message. + $request = (new AnnouncePublicAdvertisedPrefixeRequest()) + ->setProject($project) + ->setPublicAdvertisedPrefix($publicAdvertisedPrefix); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $publicAdvertisedPrefixesClient->announce($project, $publicAdvertisedPrefix); + $response = $publicAdvertisedPrefixesClient->announce($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/PublicAdvertisedPrefixesClient/delete.php b/Compute/samples/V1/PublicAdvertisedPrefixesClient/delete.php index df0072c2fa80..baad20b89bf6 100644 --- a/Compute/samples/V1/PublicAdvertisedPrefixesClient/delete.php +++ b/Compute/samples/V1/PublicAdvertisedPrefixesClient/delete.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_PublicAdvertisedPrefixes_Delete_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\PublicAdvertisedPrefixesClient; +use Google\Cloud\Compute\V1\Client\PublicAdvertisedPrefixesClient; +use Google\Cloud\Compute\V1\DeletePublicAdvertisedPrefixeRequest; use Google\Rpc\Status; /** @@ -39,10 +40,15 @@ function delete_sample(string $project, string $publicAdvertisedPrefix): void // Create a client. $publicAdvertisedPrefixesClient = new PublicAdvertisedPrefixesClient(); + // Prepare the request message. + $request = (new DeletePublicAdvertisedPrefixeRequest()) + ->setProject($project) + ->setPublicAdvertisedPrefix($publicAdvertisedPrefix); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $publicAdvertisedPrefixesClient->delete($project, $publicAdvertisedPrefix); + $response = $publicAdvertisedPrefixesClient->delete($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/PublicAdvertisedPrefixesClient/get.php b/Compute/samples/V1/PublicAdvertisedPrefixesClient/get.php index ee0f79c14b1b..702893f7af95 100644 --- a/Compute/samples/V1/PublicAdvertisedPrefixesClient/get.php +++ b/Compute/samples/V1/PublicAdvertisedPrefixesClient/get.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_PublicAdvertisedPrefixes_Get_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\PublicAdvertisedPrefixesClient; +use Google\Cloud\Compute\V1\GetPublicAdvertisedPrefixeRequest; use Google\Cloud\Compute\V1\PublicAdvertisedPrefix; -use Google\Cloud\Compute\V1\PublicAdvertisedPrefixesClient; /** * Returns the specified PublicAdvertisedPrefix resource. @@ -38,10 +39,15 @@ function get_sample(string $project, string $publicAdvertisedPrefix): void // Create a client. $publicAdvertisedPrefixesClient = new PublicAdvertisedPrefixesClient(); + // Prepare the request message. + $request = (new GetPublicAdvertisedPrefixeRequest()) + ->setProject($project) + ->setPublicAdvertisedPrefix($publicAdvertisedPrefix); + // Call the API and handle any network failures. try { /** @var PublicAdvertisedPrefix $response */ - $response = $publicAdvertisedPrefixesClient->get($project, $publicAdvertisedPrefix); + $response = $publicAdvertisedPrefixesClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/PublicAdvertisedPrefixesClient/insert.php b/Compute/samples/V1/PublicAdvertisedPrefixesClient/insert.php index 9e446bf84de5..9ed715ee6eaa 100644 --- a/Compute/samples/V1/PublicAdvertisedPrefixesClient/insert.php +++ b/Compute/samples/V1/PublicAdvertisedPrefixesClient/insert.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_PublicAdvertisedPrefixes_Insert_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\PublicAdvertisedPrefixesClient; +use Google\Cloud\Compute\V1\InsertPublicAdvertisedPrefixeRequest; use Google\Cloud\Compute\V1\PublicAdvertisedPrefix; -use Google\Cloud\Compute\V1\PublicAdvertisedPrefixesClient; use Google\Rpc\Status; /** @@ -39,13 +40,16 @@ function insert_sample(string $project): void // Create a client. $publicAdvertisedPrefixesClient = new PublicAdvertisedPrefixesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $publicAdvertisedPrefixResource = new PublicAdvertisedPrefix(); + $request = (new InsertPublicAdvertisedPrefixeRequest()) + ->setProject($project) + ->setPublicAdvertisedPrefixResource($publicAdvertisedPrefixResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $publicAdvertisedPrefixesClient->insert($project, $publicAdvertisedPrefixResource); + $response = $publicAdvertisedPrefixesClient->insert($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/PublicAdvertisedPrefixesClient/list.php b/Compute/samples/V1/PublicAdvertisedPrefixesClient/list.php index 59e3b7c530fe..3a07847d377b 100644 --- a/Compute/samples/V1/PublicAdvertisedPrefixesClient/list.php +++ b/Compute/samples/V1/PublicAdvertisedPrefixesClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_PublicAdvertisedPrefixes_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\PublicAdvertisedPrefixesClient; +use Google\Cloud\Compute\V1\Client\PublicAdvertisedPrefixesClient; +use Google\Cloud\Compute\V1\ListPublicAdvertisedPrefixesRequest; /** * Lists the PublicAdvertisedPrefixes for a project. @@ -37,10 +38,14 @@ function list_sample(string $project): void // Create a client. $publicAdvertisedPrefixesClient = new PublicAdvertisedPrefixesClient(); + // Prepare the request message. + $request = (new ListPublicAdvertisedPrefixesRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $publicAdvertisedPrefixesClient->list($project); + $response = $publicAdvertisedPrefixesClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/PublicAdvertisedPrefixesClient/patch.php b/Compute/samples/V1/PublicAdvertisedPrefixesClient/patch.php index 47554e9d4072..3a2f7195d87b 100644 --- a/Compute/samples/V1/PublicAdvertisedPrefixesClient/patch.php +++ b/Compute/samples/V1/PublicAdvertisedPrefixesClient/patch.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_PublicAdvertisedPrefixes_Patch_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\PublicAdvertisedPrefixesClient; +use Google\Cloud\Compute\V1\PatchPublicAdvertisedPrefixeRequest; use Google\Cloud\Compute\V1\PublicAdvertisedPrefix; -use Google\Cloud\Compute\V1\PublicAdvertisedPrefixesClient; use Google\Rpc\Status; /** @@ -40,17 +41,17 @@ function patch_sample(string $project, string $publicAdvertisedPrefix): void // Create a client. $publicAdvertisedPrefixesClient = new PublicAdvertisedPrefixesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $publicAdvertisedPrefixResource = new PublicAdvertisedPrefix(); + $request = (new PatchPublicAdvertisedPrefixeRequest()) + ->setProject($project) + ->setPublicAdvertisedPrefix($publicAdvertisedPrefix) + ->setPublicAdvertisedPrefixResource($publicAdvertisedPrefixResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $publicAdvertisedPrefixesClient->patch( - $project, - $publicAdvertisedPrefix, - $publicAdvertisedPrefixResource - ); + $response = $publicAdvertisedPrefixesClient->patch($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/PublicAdvertisedPrefixesClient/withdraw.php b/Compute/samples/V1/PublicAdvertisedPrefixesClient/withdraw.php index ee07f906245a..de73508be0e9 100644 --- a/Compute/samples/V1/PublicAdvertisedPrefixesClient/withdraw.php +++ b/Compute/samples/V1/PublicAdvertisedPrefixesClient/withdraw.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_PublicAdvertisedPrefixes_Withdraw_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\PublicAdvertisedPrefixesClient; +use Google\Cloud\Compute\V1\Client\PublicAdvertisedPrefixesClient; +use Google\Cloud\Compute\V1\WithdrawPublicAdvertisedPrefixeRequest; use Google\Rpc\Status; /** @@ -39,10 +40,15 @@ function withdraw_sample(string $project, string $publicAdvertisedPrefix): void // Create a client. $publicAdvertisedPrefixesClient = new PublicAdvertisedPrefixesClient(); + // Prepare the request message. + $request = (new WithdrawPublicAdvertisedPrefixeRequest()) + ->setProject($project) + ->setPublicAdvertisedPrefix($publicAdvertisedPrefix); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $publicAdvertisedPrefixesClient->withdraw($project, $publicAdvertisedPrefix); + $response = $publicAdvertisedPrefixesClient->withdraw($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/PublicDelegatedPrefixesClient/aggregated_list.php b/Compute/samples/V1/PublicDelegatedPrefixesClient/aggregated_list.php index 7d2978a315ce..93f101a8fcd2 100644 --- a/Compute/samples/V1/PublicDelegatedPrefixesClient/aggregated_list.php +++ b/Compute/samples/V1/PublicDelegatedPrefixesClient/aggregated_list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_PublicDelegatedPrefixes_AggregatedList_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\PublicDelegatedPrefixesClient; +use Google\Cloud\Compute\V1\AggregatedListPublicDelegatedPrefixesRequest; +use Google\Cloud\Compute\V1\Client\PublicDelegatedPrefixesClient; /** * 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`. @@ -37,10 +38,14 @@ function aggregated_list_sample(string $project): void // Create a client. $publicDelegatedPrefixesClient = new PublicDelegatedPrefixesClient(); + // Prepare the request message. + $request = (new AggregatedListPublicDelegatedPrefixesRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $publicDelegatedPrefixesClient->aggregatedList($project); + $response = $publicDelegatedPrefixesClient->aggregatedList($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/PublicDelegatedPrefixesClient/announce.php b/Compute/samples/V1/PublicDelegatedPrefixesClient/announce.php index 442e7e72dcd0..ad420813eba0 100644 --- a/Compute/samples/V1/PublicDelegatedPrefixesClient/announce.php +++ b/Compute/samples/V1/PublicDelegatedPrefixesClient/announce.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_PublicDelegatedPrefixes_Announce_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\PublicDelegatedPrefixesClient; +use Google\Cloud\Compute\V1\AnnouncePublicDelegatedPrefixeRequest; +use Google\Cloud\Compute\V1\Client\PublicDelegatedPrefixesClient; use Google\Rpc\Status; /** @@ -40,10 +41,16 @@ function announce_sample(string $project, string $publicDelegatedPrefix, string // Create a client. $publicDelegatedPrefixesClient = new PublicDelegatedPrefixesClient(); + // Prepare the request message. + $request = (new AnnouncePublicDelegatedPrefixeRequest()) + ->setProject($project) + ->setPublicDelegatedPrefix($publicDelegatedPrefix) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $publicDelegatedPrefixesClient->announce($project, $publicDelegatedPrefix, $region); + $response = $publicDelegatedPrefixesClient->announce($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/PublicDelegatedPrefixesClient/delete.php b/Compute/samples/V1/PublicDelegatedPrefixesClient/delete.php index 21eb0a9534fd..a4a045e2a880 100644 --- a/Compute/samples/V1/PublicDelegatedPrefixesClient/delete.php +++ b/Compute/samples/V1/PublicDelegatedPrefixesClient/delete.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_PublicDelegatedPrefixes_Delete_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\PublicDelegatedPrefixesClient; +use Google\Cloud\Compute\V1\Client\PublicDelegatedPrefixesClient; +use Google\Cloud\Compute\V1\DeletePublicDelegatedPrefixeRequest; use Google\Rpc\Status; /** @@ -40,10 +41,16 @@ function delete_sample(string $project, string $publicDelegatedPrefix, string $r // Create a client. $publicDelegatedPrefixesClient = new PublicDelegatedPrefixesClient(); + // Prepare the request message. + $request = (new DeletePublicDelegatedPrefixeRequest()) + ->setProject($project) + ->setPublicDelegatedPrefix($publicDelegatedPrefix) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $publicDelegatedPrefixesClient->delete($project, $publicDelegatedPrefix, $region); + $response = $publicDelegatedPrefixesClient->delete($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/PublicDelegatedPrefixesClient/get.php b/Compute/samples/V1/PublicDelegatedPrefixesClient/get.php index 6aa40ead0bb2..ccd026e15739 100644 --- a/Compute/samples/V1/PublicDelegatedPrefixesClient/get.php +++ b/Compute/samples/V1/PublicDelegatedPrefixesClient/get.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_PublicDelegatedPrefixes_Get_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\PublicDelegatedPrefixesClient; +use Google\Cloud\Compute\V1\GetPublicDelegatedPrefixeRequest; use Google\Cloud\Compute\V1\PublicDelegatedPrefix; -use Google\Cloud\Compute\V1\PublicDelegatedPrefixesClient; /** * Returns the specified PublicDelegatedPrefix resource in the given region. @@ -39,10 +40,16 @@ function get_sample(string $project, string $publicDelegatedPrefix, string $regi // Create a client. $publicDelegatedPrefixesClient = new PublicDelegatedPrefixesClient(); + // Prepare the request message. + $request = (new GetPublicDelegatedPrefixeRequest()) + ->setProject($project) + ->setPublicDelegatedPrefix($publicDelegatedPrefix) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var PublicDelegatedPrefix $response */ - $response = $publicDelegatedPrefixesClient->get($project, $publicDelegatedPrefix, $region); + $response = $publicDelegatedPrefixesClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/PublicDelegatedPrefixesClient/insert.php b/Compute/samples/V1/PublicDelegatedPrefixesClient/insert.php index c50e53810bd7..75bc37c24bee 100644 --- a/Compute/samples/V1/PublicDelegatedPrefixesClient/insert.php +++ b/Compute/samples/V1/PublicDelegatedPrefixesClient/insert.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_PublicDelegatedPrefixes_Insert_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\PublicDelegatedPrefixesClient; +use Google\Cloud\Compute\V1\InsertPublicDelegatedPrefixeRequest; use Google\Cloud\Compute\V1\PublicDelegatedPrefix; -use Google\Cloud\Compute\V1\PublicDelegatedPrefixesClient; use Google\Rpc\Status; /** @@ -40,17 +41,17 @@ function insert_sample(string $project, string $region): void // Create a client. $publicDelegatedPrefixesClient = new PublicDelegatedPrefixesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $publicDelegatedPrefixResource = new PublicDelegatedPrefix(); + $request = (new InsertPublicDelegatedPrefixeRequest()) + ->setProject($project) + ->setPublicDelegatedPrefixResource($publicDelegatedPrefixResource) + ->setRegion($region); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $publicDelegatedPrefixesClient->insert( - $project, - $publicDelegatedPrefixResource, - $region - ); + $response = $publicDelegatedPrefixesClient->insert($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/PublicDelegatedPrefixesClient/list.php b/Compute/samples/V1/PublicDelegatedPrefixesClient/list.php index 3f51a4e1896f..59565ed1fb03 100644 --- a/Compute/samples/V1/PublicDelegatedPrefixesClient/list.php +++ b/Compute/samples/V1/PublicDelegatedPrefixesClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_PublicDelegatedPrefixes_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\PublicDelegatedPrefixesClient; +use Google\Cloud\Compute\V1\Client\PublicDelegatedPrefixesClient; +use Google\Cloud\Compute\V1\ListPublicDelegatedPrefixesRequest; /** * Lists the PublicDelegatedPrefixes for a project in the given region. @@ -38,10 +39,15 @@ function list_sample(string $project, string $region): void // Create a client. $publicDelegatedPrefixesClient = new PublicDelegatedPrefixesClient(); + // Prepare the request message. + $request = (new ListPublicDelegatedPrefixesRequest()) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $publicDelegatedPrefixesClient->list($project, $region); + $response = $publicDelegatedPrefixesClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/PublicDelegatedPrefixesClient/patch.php b/Compute/samples/V1/PublicDelegatedPrefixesClient/patch.php index 525cf8be2c25..e6fc9de3d0f8 100644 --- a/Compute/samples/V1/PublicDelegatedPrefixesClient/patch.php +++ b/Compute/samples/V1/PublicDelegatedPrefixesClient/patch.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_PublicDelegatedPrefixes_Patch_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\PublicDelegatedPrefixesClient; +use Google\Cloud\Compute\V1\PatchPublicDelegatedPrefixeRequest; use Google\Cloud\Compute\V1\PublicDelegatedPrefix; -use Google\Cloud\Compute\V1\PublicDelegatedPrefixesClient; use Google\Rpc\Status; /** @@ -41,18 +42,18 @@ function patch_sample(string $project, string $publicDelegatedPrefix, string $re // Create a client. $publicDelegatedPrefixesClient = new PublicDelegatedPrefixesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $publicDelegatedPrefixResource = new PublicDelegatedPrefix(); + $request = (new PatchPublicDelegatedPrefixeRequest()) + ->setProject($project) + ->setPublicDelegatedPrefix($publicDelegatedPrefix) + ->setPublicDelegatedPrefixResource($publicDelegatedPrefixResource) + ->setRegion($region); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $publicDelegatedPrefixesClient->patch( - $project, - $publicDelegatedPrefix, - $publicDelegatedPrefixResource, - $region - ); + $response = $publicDelegatedPrefixesClient->patch($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/PublicDelegatedPrefixesClient/withdraw.php b/Compute/samples/V1/PublicDelegatedPrefixesClient/withdraw.php index 6ba62a2dda85..a25045da240e 100644 --- a/Compute/samples/V1/PublicDelegatedPrefixesClient/withdraw.php +++ b/Compute/samples/V1/PublicDelegatedPrefixesClient/withdraw.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_PublicDelegatedPrefixes_Withdraw_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\PublicDelegatedPrefixesClient; +use Google\Cloud\Compute\V1\Client\PublicDelegatedPrefixesClient; +use Google\Cloud\Compute\V1\WithdrawPublicDelegatedPrefixeRequest; use Google\Rpc\Status; /** @@ -40,10 +41,16 @@ function withdraw_sample(string $project, string $publicDelegatedPrefix, string // Create a client. $publicDelegatedPrefixesClient = new PublicDelegatedPrefixesClient(); + // Prepare the request message. + $request = (new WithdrawPublicDelegatedPrefixeRequest()) + ->setProject($project) + ->setPublicDelegatedPrefix($publicDelegatedPrefix) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $publicDelegatedPrefixesClient->withdraw($project, $publicDelegatedPrefix, $region); + $response = $publicDelegatedPrefixesClient->withdraw($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionAutoscalersClient/delete.php b/Compute/samples/V1/RegionAutoscalersClient/delete.php index abb9ea659203..416bc4ca8274 100644 --- a/Compute/samples/V1/RegionAutoscalersClient/delete.php +++ b/Compute/samples/V1/RegionAutoscalersClient/delete.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_RegionAutoscalers_Delete_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\RegionAutoscalersClient; +use Google\Cloud\Compute\V1\Client\RegionAutoscalersClient; +use Google\Cloud\Compute\V1\DeleteRegionAutoscalerRequest; use Google\Rpc\Status; /** @@ -40,10 +41,16 @@ function delete_sample(string $autoscaler, string $project, string $region): voi // Create a client. $regionAutoscalersClient = new RegionAutoscalersClient(); + // Prepare the request message. + $request = (new DeleteRegionAutoscalerRequest()) + ->setAutoscaler($autoscaler) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionAutoscalersClient->delete($autoscaler, $project, $region); + $response = $regionAutoscalersClient->delete($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionAutoscalersClient/get.php b/Compute/samples/V1/RegionAutoscalersClient/get.php index c15bd109a7da..65d550e41a0b 100644 --- a/Compute/samples/V1/RegionAutoscalersClient/get.php +++ b/Compute/samples/V1/RegionAutoscalersClient/get.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_RegionAutoscalers_Get_sync] use Google\ApiCore\ApiException; use Google\Cloud\Compute\V1\Autoscaler; -use Google\Cloud\Compute\V1\RegionAutoscalersClient; +use Google\Cloud\Compute\V1\Client\RegionAutoscalersClient; +use Google\Cloud\Compute\V1\GetRegionAutoscalerRequest; /** * Returns the specified autoscaler. @@ -39,10 +40,16 @@ function get_sample(string $autoscaler, string $project, string $region): void // Create a client. $regionAutoscalersClient = new RegionAutoscalersClient(); + // Prepare the request message. + $request = (new GetRegionAutoscalerRequest()) + ->setAutoscaler($autoscaler) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var Autoscaler $response */ - $response = $regionAutoscalersClient->get($autoscaler, $project, $region); + $response = $regionAutoscalersClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/RegionAutoscalersClient/insert.php b/Compute/samples/V1/RegionAutoscalersClient/insert.php index bf006805fdd9..c534ede42954 100644 --- a/Compute/samples/V1/RegionAutoscalersClient/insert.php +++ b/Compute/samples/V1/RegionAutoscalersClient/insert.php @@ -26,7 +26,8 @@ use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; use Google\Cloud\Compute\V1\Autoscaler; -use Google\Cloud\Compute\V1\RegionAutoscalersClient; +use Google\Cloud\Compute\V1\Client\RegionAutoscalersClient; +use Google\Cloud\Compute\V1\InsertRegionAutoscalerRequest; use Google\Rpc\Status; /** @@ -40,13 +41,17 @@ function insert_sample(string $project, string $region): void // Create a client. $regionAutoscalersClient = new RegionAutoscalersClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $autoscalerResource = new Autoscaler(); + $request = (new InsertRegionAutoscalerRequest()) + ->setAutoscalerResource($autoscalerResource) + ->setProject($project) + ->setRegion($region); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionAutoscalersClient->insert($autoscalerResource, $project, $region); + $response = $regionAutoscalersClient->insert($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionAutoscalersClient/list.php b/Compute/samples/V1/RegionAutoscalersClient/list.php index 1eaec6593d6d..a43395f41a51 100644 --- a/Compute/samples/V1/RegionAutoscalersClient/list.php +++ b/Compute/samples/V1/RegionAutoscalersClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_RegionAutoscalers_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\RegionAutoscalersClient; +use Google\Cloud\Compute\V1\Client\RegionAutoscalersClient; +use Google\Cloud\Compute\V1\ListRegionAutoscalersRequest; /** * Retrieves a list of autoscalers contained within the specified region. @@ -38,10 +39,15 @@ function list_sample(string $project, string $region): void // Create a client. $regionAutoscalersClient = new RegionAutoscalersClient(); + // Prepare the request message. + $request = (new ListRegionAutoscalersRequest()) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $regionAutoscalersClient->list($project, $region); + $response = $regionAutoscalersClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/RegionAutoscalersClient/patch.php b/Compute/samples/V1/RegionAutoscalersClient/patch.php index 0b43a2c9fae7..39898737e535 100644 --- a/Compute/samples/V1/RegionAutoscalersClient/patch.php +++ b/Compute/samples/V1/RegionAutoscalersClient/patch.php @@ -26,7 +26,8 @@ use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; use Google\Cloud\Compute\V1\Autoscaler; -use Google\Cloud\Compute\V1\RegionAutoscalersClient; +use Google\Cloud\Compute\V1\Client\RegionAutoscalersClient; +use Google\Cloud\Compute\V1\PatchRegionAutoscalerRequest; use Google\Rpc\Status; /** @@ -40,13 +41,17 @@ function patch_sample(string $project, string $region): void // Create a client. $regionAutoscalersClient = new RegionAutoscalersClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $autoscalerResource = new Autoscaler(); + $request = (new PatchRegionAutoscalerRequest()) + ->setAutoscalerResource($autoscalerResource) + ->setProject($project) + ->setRegion($region); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionAutoscalersClient->patch($autoscalerResource, $project, $region); + $response = $regionAutoscalersClient->patch($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionAutoscalersClient/update.php b/Compute/samples/V1/RegionAutoscalersClient/update.php index 49fc024e5224..36413f6badb1 100644 --- a/Compute/samples/V1/RegionAutoscalersClient/update.php +++ b/Compute/samples/V1/RegionAutoscalersClient/update.php @@ -26,7 +26,8 @@ use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; use Google\Cloud\Compute\V1\Autoscaler; -use Google\Cloud\Compute\V1\RegionAutoscalersClient; +use Google\Cloud\Compute\V1\Client\RegionAutoscalersClient; +use Google\Cloud\Compute\V1\UpdateRegionAutoscalerRequest; use Google\Rpc\Status; /** @@ -40,13 +41,17 @@ function update_sample(string $project, string $region): void // Create a client. $regionAutoscalersClient = new RegionAutoscalersClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $autoscalerResource = new Autoscaler(); + $request = (new UpdateRegionAutoscalerRequest()) + ->setAutoscalerResource($autoscalerResource) + ->setProject($project) + ->setRegion($region); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionAutoscalersClient->update($autoscalerResource, $project, $region); + $response = $regionAutoscalersClient->update($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionBackendServicesClient/delete.php b/Compute/samples/V1/RegionBackendServicesClient/delete.php index 758274c7d9b3..c64d8aa3d71a 100644 --- a/Compute/samples/V1/RegionBackendServicesClient/delete.php +++ b/Compute/samples/V1/RegionBackendServicesClient/delete.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_RegionBackendServices_Delete_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\RegionBackendServicesClient; +use Google\Cloud\Compute\V1\Client\RegionBackendServicesClient; +use Google\Cloud\Compute\V1\DeleteRegionBackendServiceRequest; use Google\Rpc\Status; /** @@ -40,10 +41,16 @@ function delete_sample(string $backendService, string $project, string $region): // Create a client. $regionBackendServicesClient = new RegionBackendServicesClient(); + // Prepare the request message. + $request = (new DeleteRegionBackendServiceRequest()) + ->setBackendService($backendService) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionBackendServicesClient->delete($backendService, $project, $region); + $response = $regionBackendServicesClient->delete($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionBackendServicesClient/get.php b/Compute/samples/V1/RegionBackendServicesClient/get.php index f1cf14469c58..3488228500b0 100644 --- a/Compute/samples/V1/RegionBackendServicesClient/get.php +++ b/Compute/samples/V1/RegionBackendServicesClient/get.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_RegionBackendServices_Get_sync] use Google\ApiCore\ApiException; use Google\Cloud\Compute\V1\BackendService; -use Google\Cloud\Compute\V1\RegionBackendServicesClient; +use Google\Cloud\Compute\V1\Client\RegionBackendServicesClient; +use Google\Cloud\Compute\V1\GetRegionBackendServiceRequest; /** * Returns the specified regional BackendService resource. @@ -39,10 +40,16 @@ function get_sample(string $backendService, string $project, string $region): vo // Create a client. $regionBackendServicesClient = new RegionBackendServicesClient(); + // Prepare the request message. + $request = (new GetRegionBackendServiceRequest()) + ->setBackendService($backendService) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var BackendService $response */ - $response = $regionBackendServicesClient->get($backendService, $project, $region); + $response = $regionBackendServicesClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/RegionBackendServicesClient/get_health.php b/Compute/samples/V1/RegionBackendServicesClient/get_health.php index 8f23a62cf508..3d01a1016f5e 100644 --- a/Compute/samples/V1/RegionBackendServicesClient/get_health.php +++ b/Compute/samples/V1/RegionBackendServicesClient/get_health.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_RegionBackendServices_GetHealth_sync] use Google\ApiCore\ApiException; use Google\Cloud\Compute\V1\BackendServiceGroupHealth; -use Google\Cloud\Compute\V1\RegionBackendServicesClient; +use Google\Cloud\Compute\V1\Client\RegionBackendServicesClient; +use Google\Cloud\Compute\V1\GetHealthRegionBackendServiceRequest; use Google\Cloud\Compute\V1\ResourceGroupReference; /** @@ -40,18 +41,18 @@ function get_health_sample(string $backendService, string $project, string $regi // Create a client. $regionBackendServicesClient = new RegionBackendServicesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $resourceGroupReferenceResource = new ResourceGroupReference(); + $request = (new GetHealthRegionBackendServiceRequest()) + ->setBackendService($backendService) + ->setProject($project) + ->setRegion($region) + ->setResourceGroupReferenceResource($resourceGroupReferenceResource); // Call the API and handle any network failures. try { /** @var BackendServiceGroupHealth $response */ - $response = $regionBackendServicesClient->getHealth( - $backendService, - $project, - $region, - $resourceGroupReferenceResource - ); + $response = $regionBackendServicesClient->getHealth($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/RegionBackendServicesClient/get_iam_policy.php b/Compute/samples/V1/RegionBackendServicesClient/get_iam_policy.php index f61fb1157072..74cf7c2d7fc0 100644 --- a/Compute/samples/V1/RegionBackendServicesClient/get_iam_policy.php +++ b/Compute/samples/V1/RegionBackendServicesClient/get_iam_policy.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_RegionBackendServices_GetIamPolicy_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\RegionBackendServicesClient; +use Google\Cloud\Compute\V1\GetIamPolicyRegionBackendServiceRequest; use Google\Cloud\Compute\V1\Policy; -use Google\Cloud\Compute\V1\RegionBackendServicesClient; /** * Gets the access control policy for a resource. May be empty if no such policy or resource exists. @@ -39,10 +40,16 @@ function get_iam_policy_sample(string $project, string $region, string $resource // Create a client. $regionBackendServicesClient = new RegionBackendServicesClient(); + // Prepare the request message. + $request = (new GetIamPolicyRegionBackendServiceRequest()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource); + // Call the API and handle any network failures. try { /** @var Policy $response */ - $response = $regionBackendServicesClient->getIamPolicy($project, $region, $resource); + $response = $regionBackendServicesClient->getIamPolicy($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/RegionBackendServicesClient/insert.php b/Compute/samples/V1/RegionBackendServicesClient/insert.php index 09c44ef9715f..d7a268fa63c0 100644 --- a/Compute/samples/V1/RegionBackendServicesClient/insert.php +++ b/Compute/samples/V1/RegionBackendServicesClient/insert.php @@ -26,7 +26,8 @@ use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; use Google\Cloud\Compute\V1\BackendService; -use Google\Cloud\Compute\V1\RegionBackendServicesClient; +use Google\Cloud\Compute\V1\Client\RegionBackendServicesClient; +use Google\Cloud\Compute\V1\InsertRegionBackendServiceRequest; use Google\Rpc\Status; /** @@ -40,13 +41,17 @@ function insert_sample(string $project, string $region): void // Create a client. $regionBackendServicesClient = new RegionBackendServicesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $backendServiceResource = new BackendService(); + $request = (new InsertRegionBackendServiceRequest()) + ->setBackendServiceResource($backendServiceResource) + ->setProject($project) + ->setRegion($region); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionBackendServicesClient->insert($backendServiceResource, $project, $region); + $response = $regionBackendServicesClient->insert($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionBackendServicesClient/list.php b/Compute/samples/V1/RegionBackendServicesClient/list.php index 67e0795935b1..c9d6348f1ff1 100644 --- a/Compute/samples/V1/RegionBackendServicesClient/list.php +++ b/Compute/samples/V1/RegionBackendServicesClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_RegionBackendServices_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\RegionBackendServicesClient; +use Google\Cloud\Compute\V1\Client\RegionBackendServicesClient; +use Google\Cloud\Compute\V1\ListRegionBackendServicesRequest; /** * Retrieves the list of regional BackendService resources available to the specified project in the given region. @@ -38,10 +39,15 @@ function list_sample(string $project, string $region): void // Create a client. $regionBackendServicesClient = new RegionBackendServicesClient(); + // Prepare the request message. + $request = (new ListRegionBackendServicesRequest()) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $regionBackendServicesClient->list($project, $region); + $response = $regionBackendServicesClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/RegionBackendServicesClient/list_usable.php b/Compute/samples/V1/RegionBackendServicesClient/list_usable.php index 1b660bf98b9d..91b2228910b1 100644 --- a/Compute/samples/V1/RegionBackendServicesClient/list_usable.php +++ b/Compute/samples/V1/RegionBackendServicesClient/list_usable.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_RegionBackendServices_ListUsable_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\RegionBackendServicesClient; +use Google\Cloud\Compute\V1\Client\RegionBackendServicesClient; +use Google\Cloud\Compute\V1\ListUsableRegionBackendServicesRequest; /** * Retrieves a list of all usable backend services in the specified project in the given region. @@ -38,10 +39,15 @@ function list_usable_sample(string $project, string $region): void // Create a client. $regionBackendServicesClient = new RegionBackendServicesClient(); + // Prepare the request message. + $request = (new ListUsableRegionBackendServicesRequest()) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $regionBackendServicesClient->listUsable($project, $region); + $response = $regionBackendServicesClient->listUsable($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/RegionBackendServicesClient/patch.php b/Compute/samples/V1/RegionBackendServicesClient/patch.php index f00954b38a42..291ec651e2ef 100644 --- a/Compute/samples/V1/RegionBackendServicesClient/patch.php +++ b/Compute/samples/V1/RegionBackendServicesClient/patch.php @@ -26,7 +26,8 @@ use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; use Google\Cloud\Compute\V1\BackendService; -use Google\Cloud\Compute\V1\RegionBackendServicesClient; +use Google\Cloud\Compute\V1\Client\RegionBackendServicesClient; +use Google\Cloud\Compute\V1\PatchRegionBackendServiceRequest; use Google\Rpc\Status; /** @@ -41,18 +42,18 @@ function patch_sample(string $backendService, string $project, string $region): // Create a client. $regionBackendServicesClient = new RegionBackendServicesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $backendServiceResource = new BackendService(); + $request = (new PatchRegionBackendServiceRequest()) + ->setBackendService($backendService) + ->setBackendServiceResource($backendServiceResource) + ->setProject($project) + ->setRegion($region); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionBackendServicesClient->patch( - $backendService, - $backendServiceResource, - $project, - $region - ); + $response = $regionBackendServicesClient->patch($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionBackendServicesClient/set_iam_policy.php b/Compute/samples/V1/RegionBackendServicesClient/set_iam_policy.php index d9be67a842b2..abbd55db41ad 100644 --- a/Compute/samples/V1/RegionBackendServicesClient/set_iam_policy.php +++ b/Compute/samples/V1/RegionBackendServicesClient/set_iam_policy.php @@ -24,9 +24,10 @@ // [START compute_v1_generated_RegionBackendServices_SetIamPolicy_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\RegionBackendServicesClient; use Google\Cloud\Compute\V1\Policy; -use Google\Cloud\Compute\V1\RegionBackendServicesClient; use Google\Cloud\Compute\V1\RegionSetPolicyRequest; +use Google\Cloud\Compute\V1\SetIamPolicyRegionBackendServiceRequest; /** * Sets the access control policy on the specified resource. Replaces any existing policy. @@ -40,18 +41,18 @@ function set_iam_policy_sample(string $project, string $region, string $resource // Create a client. $regionBackendServicesClient = new RegionBackendServicesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $regionSetPolicyRequestResource = new RegionSetPolicyRequest(); + $request = (new SetIamPolicyRegionBackendServiceRequest()) + ->setProject($project) + ->setRegion($region) + ->setRegionSetPolicyRequestResource($regionSetPolicyRequestResource) + ->setResource($resource); // Call the API and handle any network failures. try { /** @var Policy $response */ - $response = $regionBackendServicesClient->setIamPolicy( - $project, - $region, - $regionSetPolicyRequestResource, - $resource - ); + $response = $regionBackendServicesClient->setIamPolicy($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/RegionBackendServicesClient/set_security_policy.php b/Compute/samples/V1/RegionBackendServicesClient/set_security_policy.php index 8e8bf232b3d2..e74a1e618630 100644 --- a/Compute/samples/V1/RegionBackendServicesClient/set_security_policy.php +++ b/Compute/samples/V1/RegionBackendServicesClient/set_security_policy.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_RegionBackendServices_SetSecurityPolicy_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\RegionBackendServicesClient; +use Google\Cloud\Compute\V1\Client\RegionBackendServicesClient; use Google\Cloud\Compute\V1\SecurityPolicyReference; +use Google\Cloud\Compute\V1\SetSecurityPolicyRegionBackendServiceRequest; use Google\Rpc\Status; /** @@ -41,18 +42,18 @@ function set_security_policy_sample(string $backendService, string $project, str // Create a client. $regionBackendServicesClient = new RegionBackendServicesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $securityPolicyReferenceResource = new SecurityPolicyReference(); + $request = (new SetSecurityPolicyRegionBackendServiceRequest()) + ->setBackendService($backendService) + ->setProject($project) + ->setRegion($region) + ->setSecurityPolicyReferenceResource($securityPolicyReferenceResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionBackendServicesClient->setSecurityPolicy( - $backendService, - $project, - $region, - $securityPolicyReferenceResource - ); + $response = $regionBackendServicesClient->setSecurityPolicy($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionBackendServicesClient/test_iam_permissions.php b/Compute/samples/V1/RegionBackendServicesClient/test_iam_permissions.php index 6216d9a06abe..8ad55dd3aab3 100644 --- a/Compute/samples/V1/RegionBackendServicesClient/test_iam_permissions.php +++ b/Compute/samples/V1/RegionBackendServicesClient/test_iam_permissions.php @@ -24,7 +24,8 @@ // [START compute_v1_generated_RegionBackendServices_TestIamPermissions_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\RegionBackendServicesClient; +use Google\Cloud\Compute\V1\Client\RegionBackendServicesClient; +use Google\Cloud\Compute\V1\TestIamPermissionsRegionBackendServiceRequest; use Google\Cloud\Compute\V1\TestPermissionsRequest; use Google\Cloud\Compute\V1\TestPermissionsResponse; @@ -40,18 +41,18 @@ function test_iam_permissions_sample(string $project, string $region, string $re // Create a client. $regionBackendServicesClient = new RegionBackendServicesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $testPermissionsRequestResource = new TestPermissionsRequest(); + $request = (new TestIamPermissionsRegionBackendServiceRequest()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); // Call the API and handle any network failures. try { /** @var TestPermissionsResponse $response */ - $response = $regionBackendServicesClient->testIamPermissions( - $project, - $region, - $resource, - $testPermissionsRequestResource - ); + $response = $regionBackendServicesClient->testIamPermissions($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/RegionBackendServicesClient/update.php b/Compute/samples/V1/RegionBackendServicesClient/update.php index 19b83dca74b9..983b0ce568d8 100644 --- a/Compute/samples/V1/RegionBackendServicesClient/update.php +++ b/Compute/samples/V1/RegionBackendServicesClient/update.php @@ -26,7 +26,8 @@ use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; use Google\Cloud\Compute\V1\BackendService; -use Google\Cloud\Compute\V1\RegionBackendServicesClient; +use Google\Cloud\Compute\V1\Client\RegionBackendServicesClient; +use Google\Cloud\Compute\V1\UpdateRegionBackendServiceRequest; use Google\Rpc\Status; /** @@ -41,18 +42,18 @@ function update_sample(string $backendService, string $project, string $region): // Create a client. $regionBackendServicesClient = new RegionBackendServicesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $backendServiceResource = new BackendService(); + $request = (new UpdateRegionBackendServiceRequest()) + ->setBackendService($backendService) + ->setBackendServiceResource($backendServiceResource) + ->setProject($project) + ->setRegion($region); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionBackendServicesClient->update( - $backendService, - $backendServiceResource, - $project, - $region - ); + $response = $regionBackendServicesClient->update($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionCommitmentsClient/aggregated_list.php b/Compute/samples/V1/RegionCommitmentsClient/aggregated_list.php index d45b52726785..0e2da4038ebb 100644 --- a/Compute/samples/V1/RegionCommitmentsClient/aggregated_list.php +++ b/Compute/samples/V1/RegionCommitmentsClient/aggregated_list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_RegionCommitments_AggregatedList_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\RegionCommitmentsClient; +use Google\Cloud\Compute\V1\AggregatedListRegionCommitmentsRequest; +use Google\Cloud\Compute\V1\Client\RegionCommitmentsClient; /** * Retrieves an aggregated list of commitments by region. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. @@ -37,10 +38,14 @@ function aggregated_list_sample(string $project): void // Create a client. $regionCommitmentsClient = new RegionCommitmentsClient(); + // Prepare the request message. + $request = (new AggregatedListRegionCommitmentsRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $regionCommitmentsClient->aggregatedList($project); + $response = $regionCommitmentsClient->aggregatedList($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/RegionCommitmentsClient/get.php b/Compute/samples/V1/RegionCommitmentsClient/get.php index 8f7fafd25398..1de88be3d1a7 100644 --- a/Compute/samples/V1/RegionCommitmentsClient/get.php +++ b/Compute/samples/V1/RegionCommitmentsClient/get.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_RegionCommitments_Get_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\RegionCommitmentsClient; use Google\Cloud\Compute\V1\Commitment; -use Google\Cloud\Compute\V1\RegionCommitmentsClient; +use Google\Cloud\Compute\V1\GetRegionCommitmentRequest; /** * Returns the specified commitment resource. @@ -39,10 +40,16 @@ function get_sample(string $commitment, string $project, string $region): void // Create a client. $regionCommitmentsClient = new RegionCommitmentsClient(); + // Prepare the request message. + $request = (new GetRegionCommitmentRequest()) + ->setCommitment($commitment) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var Commitment $response */ - $response = $regionCommitmentsClient->get($commitment, $project, $region); + $response = $regionCommitmentsClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/RegionCommitmentsClient/insert.php b/Compute/samples/V1/RegionCommitmentsClient/insert.php index 6145d1c75cc4..e27b063f155d 100644 --- a/Compute/samples/V1/RegionCommitmentsClient/insert.php +++ b/Compute/samples/V1/RegionCommitmentsClient/insert.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_RegionCommitments_Insert_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\RegionCommitmentsClient; use Google\Cloud\Compute\V1\Commitment; -use Google\Cloud\Compute\V1\RegionCommitmentsClient; +use Google\Cloud\Compute\V1\InsertRegionCommitmentRequest; use Google\Rpc\Status; /** @@ -40,13 +41,17 @@ function insert_sample(string $project, string $region): void // Create a client. $regionCommitmentsClient = new RegionCommitmentsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $commitmentResource = new Commitment(); + $request = (new InsertRegionCommitmentRequest()) + ->setCommitmentResource($commitmentResource) + ->setProject($project) + ->setRegion($region); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionCommitmentsClient->insert($commitmentResource, $project, $region); + $response = $regionCommitmentsClient->insert($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionCommitmentsClient/list.php b/Compute/samples/V1/RegionCommitmentsClient/list.php index f29610e8bd7d..2b597a88ae3d 100644 --- a/Compute/samples/V1/RegionCommitmentsClient/list.php +++ b/Compute/samples/V1/RegionCommitmentsClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_RegionCommitments_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\RegionCommitmentsClient; +use Google\Cloud\Compute\V1\Client\RegionCommitmentsClient; +use Google\Cloud\Compute\V1\ListRegionCommitmentsRequest; /** * Retrieves a list of commitments contained within the specified region. @@ -38,10 +39,15 @@ function list_sample(string $project, string $region): void // Create a client. $regionCommitmentsClient = new RegionCommitmentsClient(); + // Prepare the request message. + $request = (new ListRegionCommitmentsRequest()) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $regionCommitmentsClient->list($project, $region); + $response = $regionCommitmentsClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/RegionCommitmentsClient/update.php b/Compute/samples/V1/RegionCommitmentsClient/update.php index ee38a23eae67..71bd5687937b 100644 --- a/Compute/samples/V1/RegionCommitmentsClient/update.php +++ b/Compute/samples/V1/RegionCommitmentsClient/update.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_RegionCommitments_Update_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\RegionCommitmentsClient; use Google\Cloud\Compute\V1\Commitment; -use Google\Cloud\Compute\V1\RegionCommitmentsClient; +use Google\Cloud\Compute\V1\UpdateRegionCommitmentRequest; use Google\Rpc\Status; /** @@ -41,13 +42,18 @@ function update_sample(string $commitment, string $project, string $region): voi // Create a client. $regionCommitmentsClient = new RegionCommitmentsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $commitmentResource = new Commitment(); + $request = (new UpdateRegionCommitmentRequest()) + ->setCommitment($commitment) + ->setCommitmentResource($commitmentResource) + ->setProject($project) + ->setRegion($region); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionCommitmentsClient->update($commitment, $commitmentResource, $project, $region); + $response = $regionCommitmentsClient->update($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionDiskTypesClient/get.php b/Compute/samples/V1/RegionDiskTypesClient/get.php index 32f208c64161..58f823a4dea9 100644 --- a/Compute/samples/V1/RegionDiskTypesClient/get.php +++ b/Compute/samples/V1/RegionDiskTypesClient/get.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_RegionDiskTypes_Get_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\RegionDiskTypesClient; use Google\Cloud\Compute\V1\DiskType; -use Google\Cloud\Compute\V1\RegionDiskTypesClient; +use Google\Cloud\Compute\V1\GetRegionDiskTypeRequest; /** * Returns the specified regional disk type. @@ -39,10 +40,16 @@ function get_sample(string $diskType, string $project, string $region): void // Create a client. $regionDiskTypesClient = new RegionDiskTypesClient(); + // Prepare the request message. + $request = (new GetRegionDiskTypeRequest()) + ->setDiskType($diskType) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var DiskType $response */ - $response = $regionDiskTypesClient->get($diskType, $project, $region); + $response = $regionDiskTypesClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/RegionDiskTypesClient/list.php b/Compute/samples/V1/RegionDiskTypesClient/list.php index 8d6d37424733..26801b9cadf3 100644 --- a/Compute/samples/V1/RegionDiskTypesClient/list.php +++ b/Compute/samples/V1/RegionDiskTypesClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_RegionDiskTypes_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\RegionDiskTypesClient; +use Google\Cloud\Compute\V1\Client\RegionDiskTypesClient; +use Google\Cloud\Compute\V1\ListRegionDiskTypesRequest; /** * Retrieves a list of regional disk types available to the specified project. @@ -38,10 +39,15 @@ function list_sample(string $project, string $region): void // Create a client. $regionDiskTypesClient = new RegionDiskTypesClient(); + // Prepare the request message. + $request = (new ListRegionDiskTypesRequest()) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $regionDiskTypesClient->list($project, $region); + $response = $regionDiskTypesClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/RegionDisksClient/add_resource_policies.php b/Compute/samples/V1/RegionDisksClient/add_resource_policies.php index 8ec893ec3837..76e9b780978a 100644 --- a/Compute/samples/V1/RegionDisksClient/add_resource_policies.php +++ b/Compute/samples/V1/RegionDisksClient/add_resource_policies.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_RegionDisks_AddResourcePolicies_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\AddResourcePoliciesRegionDiskRequest; +use Google\Cloud\Compute\V1\Client\RegionDisksClient; use Google\Cloud\Compute\V1\RegionDisksAddResourcePoliciesRequest; -use Google\Cloud\Compute\V1\RegionDisksClient; use Google\Rpc\Status; /** @@ -41,18 +42,18 @@ function add_resource_policies_sample(string $disk, string $project, string $reg // Create a client. $regionDisksClient = new RegionDisksClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $regionDisksAddResourcePoliciesRequestResource = new RegionDisksAddResourcePoliciesRequest(); + $request = (new AddResourcePoliciesRegionDiskRequest()) + ->setDisk($disk) + ->setProject($project) + ->setRegion($region) + ->setRegionDisksAddResourcePoliciesRequestResource($regionDisksAddResourcePoliciesRequestResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionDisksClient->addResourcePolicies( - $disk, - $project, - $region, - $regionDisksAddResourcePoliciesRequestResource - ); + $response = $regionDisksClient->addResourcePolicies($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionDisksClient/bulk_insert.php b/Compute/samples/V1/RegionDisksClient/bulk_insert.php index 1b1a11b660fd..63b23b6847a9 100644 --- a/Compute/samples/V1/RegionDisksClient/bulk_insert.php +++ b/Compute/samples/V1/RegionDisksClient/bulk_insert.php @@ -26,7 +26,8 @@ use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; use Google\Cloud\Compute\V1\BulkInsertDiskResource; -use Google\Cloud\Compute\V1\RegionDisksClient; +use Google\Cloud\Compute\V1\BulkInsertRegionDiskRequest; +use Google\Cloud\Compute\V1\Client\RegionDisksClient; use Google\Rpc\Status; /** @@ -40,13 +41,17 @@ function bulk_insert_sample(string $project, string $region): void // Create a client. $regionDisksClient = new RegionDisksClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $bulkInsertDiskResourceResource = new BulkInsertDiskResource(); + $request = (new BulkInsertRegionDiskRequest()) + ->setBulkInsertDiskResourceResource($bulkInsertDiskResourceResource) + ->setProject($project) + ->setRegion($region); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionDisksClient->bulkInsert($bulkInsertDiskResourceResource, $project, $region); + $response = $regionDisksClient->bulkInsert($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionDisksClient/create_snapshot.php b/Compute/samples/V1/RegionDisksClient/create_snapshot.php index c3b9974c4a11..514f4c20235b 100644 --- a/Compute/samples/V1/RegionDisksClient/create_snapshot.php +++ b/Compute/samples/V1/RegionDisksClient/create_snapshot.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_RegionDisks_CreateSnapshot_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\RegionDisksClient; +use Google\Cloud\Compute\V1\Client\RegionDisksClient; +use Google\Cloud\Compute\V1\CreateSnapshotRegionDiskRequest; use Google\Cloud\Compute\V1\Snapshot; use Google\Rpc\Status; @@ -41,13 +42,18 @@ function create_snapshot_sample(string $disk, string $project, string $region): // Create a client. $regionDisksClient = new RegionDisksClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $snapshotResource = new Snapshot(); + $request = (new CreateSnapshotRegionDiskRequest()) + ->setDisk($disk) + ->setProject($project) + ->setRegion($region) + ->setSnapshotResource($snapshotResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionDisksClient->createSnapshot($disk, $project, $region, $snapshotResource); + $response = $regionDisksClient->createSnapshot($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionDisksClient/delete.php b/Compute/samples/V1/RegionDisksClient/delete.php index 4b5e5f8f7416..64a3eb73d6e1 100644 --- a/Compute/samples/V1/RegionDisksClient/delete.php +++ b/Compute/samples/V1/RegionDisksClient/delete.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_RegionDisks_Delete_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\RegionDisksClient; +use Google\Cloud\Compute\V1\Client\RegionDisksClient; +use Google\Cloud\Compute\V1\DeleteRegionDiskRequest; use Google\Rpc\Status; /** @@ -40,10 +41,16 @@ function delete_sample(string $disk, string $project, string $region): void // Create a client. $regionDisksClient = new RegionDisksClient(); + // Prepare the request message. + $request = (new DeleteRegionDiskRequest()) + ->setDisk($disk) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionDisksClient->delete($disk, $project, $region); + $response = $regionDisksClient->delete($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionDisksClient/get.php b/Compute/samples/V1/RegionDisksClient/get.php index 34f7fed1dba7..ef68323653a9 100644 --- a/Compute/samples/V1/RegionDisksClient/get.php +++ b/Compute/samples/V1/RegionDisksClient/get.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_RegionDisks_Get_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\RegionDisksClient; use Google\Cloud\Compute\V1\Disk; -use Google\Cloud\Compute\V1\RegionDisksClient; +use Google\Cloud\Compute\V1\GetRegionDiskRequest; /** * Returns a specified regional persistent disk. @@ -39,10 +40,16 @@ function get_sample(string $disk, string $project, string $region): void // Create a client. $regionDisksClient = new RegionDisksClient(); + // Prepare the request message. + $request = (new GetRegionDiskRequest()) + ->setDisk($disk) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var Disk $response */ - $response = $regionDisksClient->get($disk, $project, $region); + $response = $regionDisksClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/RegionDisksClient/get_iam_policy.php b/Compute/samples/V1/RegionDisksClient/get_iam_policy.php index cabb3322d632..7fb1b58bcc17 100644 --- a/Compute/samples/V1/RegionDisksClient/get_iam_policy.php +++ b/Compute/samples/V1/RegionDisksClient/get_iam_policy.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_RegionDisks_GetIamPolicy_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\RegionDisksClient; +use Google\Cloud\Compute\V1\GetIamPolicyRegionDiskRequest; use Google\Cloud\Compute\V1\Policy; -use Google\Cloud\Compute\V1\RegionDisksClient; /** * Gets the access control policy for a resource. May be empty if no such policy or resource exists. @@ -39,10 +40,16 @@ function get_iam_policy_sample(string $project, string $region, string $resource // Create a client. $regionDisksClient = new RegionDisksClient(); + // Prepare the request message. + $request = (new GetIamPolicyRegionDiskRequest()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource); + // Call the API and handle any network failures. try { /** @var Policy $response */ - $response = $regionDisksClient->getIamPolicy($project, $region, $resource); + $response = $regionDisksClient->getIamPolicy($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/RegionDisksClient/insert.php b/Compute/samples/V1/RegionDisksClient/insert.php index 5c55ea54176c..c04c6d0ea5a5 100644 --- a/Compute/samples/V1/RegionDisksClient/insert.php +++ b/Compute/samples/V1/RegionDisksClient/insert.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_RegionDisks_Insert_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\RegionDisksClient; use Google\Cloud\Compute\V1\Disk; -use Google\Cloud\Compute\V1\RegionDisksClient; +use Google\Cloud\Compute\V1\InsertRegionDiskRequest; use Google\Rpc\Status; /** @@ -40,13 +41,17 @@ function insert_sample(string $project, string $region): void // Create a client. $regionDisksClient = new RegionDisksClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $diskResource = new Disk(); + $request = (new InsertRegionDiskRequest()) + ->setDiskResource($diskResource) + ->setProject($project) + ->setRegion($region); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionDisksClient->insert($diskResource, $project, $region); + $response = $regionDisksClient->insert($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionDisksClient/list.php b/Compute/samples/V1/RegionDisksClient/list.php index 5b506af47766..c1c2d8d4ee2b 100644 --- a/Compute/samples/V1/RegionDisksClient/list.php +++ b/Compute/samples/V1/RegionDisksClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_RegionDisks_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\RegionDisksClient; +use Google\Cloud\Compute\V1\Client\RegionDisksClient; +use Google\Cloud\Compute\V1\ListRegionDisksRequest; /** * Retrieves the list of persistent disks contained within the specified region. @@ -38,10 +39,15 @@ function list_sample(string $project, string $region): void // Create a client. $regionDisksClient = new RegionDisksClient(); + // Prepare the request message. + $request = (new ListRegionDisksRequest()) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $regionDisksClient->list($project, $region); + $response = $regionDisksClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/RegionDisksClient/remove_resource_policies.php b/Compute/samples/V1/RegionDisksClient/remove_resource_policies.php index ebe1d90f8fa3..4a5bcab7cb3d 100644 --- a/Compute/samples/V1/RegionDisksClient/remove_resource_policies.php +++ b/Compute/samples/V1/RegionDisksClient/remove_resource_policies.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_RegionDisks_RemoveResourcePolicies_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\RegionDisksClient; +use Google\Cloud\Compute\V1\Client\RegionDisksClient; use Google\Cloud\Compute\V1\RegionDisksRemoveResourcePoliciesRequest; +use Google\Cloud\Compute\V1\RemoveResourcePoliciesRegionDiskRequest; use Google\Rpc\Status; /** @@ -41,18 +42,20 @@ function remove_resource_policies_sample(string $disk, string $project, string $ // Create a client. $regionDisksClient = new RegionDisksClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $regionDisksRemoveResourcePoliciesRequestResource = new RegionDisksRemoveResourcePoliciesRequest(); + $request = (new RemoveResourcePoliciesRegionDiskRequest()) + ->setDisk($disk) + ->setProject($project) + ->setRegion($region) + ->setRegionDisksRemoveResourcePoliciesRequestResource( + $regionDisksRemoveResourcePoliciesRequestResource + ); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionDisksClient->removeResourcePolicies( - $disk, - $project, - $region, - $regionDisksRemoveResourcePoliciesRequestResource - ); + $response = $regionDisksClient->removeResourcePolicies($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionDisksClient/resize.php b/Compute/samples/V1/RegionDisksClient/resize.php index cc7f6c2b3965..33937ebd30b7 100644 --- a/Compute/samples/V1/RegionDisksClient/resize.php +++ b/Compute/samples/V1/RegionDisksClient/resize.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_RegionDisks_Resize_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\RegionDisksClient; +use Google\Cloud\Compute\V1\Client\RegionDisksClient; use Google\Cloud\Compute\V1\RegionDisksResizeRequest; +use Google\Cloud\Compute\V1\ResizeRegionDiskRequest; use Google\Rpc\Status; /** @@ -41,13 +42,18 @@ function resize_sample(string $disk, string $project, string $region): void // Create a client. $regionDisksClient = new RegionDisksClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $regionDisksResizeRequestResource = new RegionDisksResizeRequest(); + $request = (new ResizeRegionDiskRequest()) + ->setDisk($disk) + ->setProject($project) + ->setRegion($region) + ->setRegionDisksResizeRequestResource($regionDisksResizeRequestResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionDisksClient->resize($disk, $project, $region, $regionDisksResizeRequestResource); + $response = $regionDisksClient->resize($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionDisksClient/set_iam_policy.php b/Compute/samples/V1/RegionDisksClient/set_iam_policy.php index a9d7f6849d9a..443b55603cb8 100644 --- a/Compute/samples/V1/RegionDisksClient/set_iam_policy.php +++ b/Compute/samples/V1/RegionDisksClient/set_iam_policy.php @@ -24,9 +24,10 @@ // [START compute_v1_generated_RegionDisks_SetIamPolicy_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\RegionDisksClient; use Google\Cloud\Compute\V1\Policy; -use Google\Cloud\Compute\V1\RegionDisksClient; use Google\Cloud\Compute\V1\RegionSetPolicyRequest; +use Google\Cloud\Compute\V1\SetIamPolicyRegionDiskRequest; /** * Sets the access control policy on the specified resource. Replaces any existing policy. @@ -40,18 +41,18 @@ function set_iam_policy_sample(string $project, string $region, string $resource // Create a client. $regionDisksClient = new RegionDisksClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $regionSetPolicyRequestResource = new RegionSetPolicyRequest(); + $request = (new SetIamPolicyRegionDiskRequest()) + ->setProject($project) + ->setRegion($region) + ->setRegionSetPolicyRequestResource($regionSetPolicyRequestResource) + ->setResource($resource); // Call the API and handle any network failures. try { /** @var Policy $response */ - $response = $regionDisksClient->setIamPolicy( - $project, - $region, - $regionSetPolicyRequestResource, - $resource - ); + $response = $regionDisksClient->setIamPolicy($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/RegionDisksClient/set_labels.php b/Compute/samples/V1/RegionDisksClient/set_labels.php index dff79df15cff..950de31129cb 100644 --- a/Compute/samples/V1/RegionDisksClient/set_labels.php +++ b/Compute/samples/V1/RegionDisksClient/set_labels.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_RegionDisks_SetLabels_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\RegionDisksClient; +use Google\Cloud\Compute\V1\Client\RegionDisksClient; use Google\Cloud\Compute\V1\RegionSetLabelsRequest; +use Google\Cloud\Compute\V1\SetLabelsRegionDiskRequest; use Google\Rpc\Status; /** @@ -41,18 +42,18 @@ function set_labels_sample(string $project, string $region, string $resource): v // Create a client. $regionDisksClient = new RegionDisksClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $regionSetLabelsRequestResource = new RegionSetLabelsRequest(); + $request = (new SetLabelsRegionDiskRequest()) + ->setProject($project) + ->setRegion($region) + ->setRegionSetLabelsRequestResource($regionSetLabelsRequestResource) + ->setResource($resource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionDisksClient->setLabels( - $project, - $region, - $regionSetLabelsRequestResource, - $resource - ); + $response = $regionDisksClient->setLabels($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionDisksClient/start_async_replication.php b/Compute/samples/V1/RegionDisksClient/start_async_replication.php index 6fed28714cad..16c323469d0b 100644 --- a/Compute/samples/V1/RegionDisksClient/start_async_replication.php +++ b/Compute/samples/V1/RegionDisksClient/start_async_replication.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_RegionDisks_StartAsyncReplication_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\RegionDisksClient; +use Google\Cloud\Compute\V1\Client\RegionDisksClient; use Google\Cloud\Compute\V1\RegionDisksStartAsyncReplicationRequest; +use Google\Cloud\Compute\V1\StartAsyncReplicationRegionDiskRequest; use Google\Rpc\Status; /** @@ -41,18 +42,20 @@ function start_async_replication_sample(string $disk, string $project, string $r // Create a client. $regionDisksClient = new RegionDisksClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $regionDisksStartAsyncReplicationRequestResource = new RegionDisksStartAsyncReplicationRequest(); + $request = (new StartAsyncReplicationRegionDiskRequest()) + ->setDisk($disk) + ->setProject($project) + ->setRegion($region) + ->setRegionDisksStartAsyncReplicationRequestResource( + $regionDisksStartAsyncReplicationRequestResource + ); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionDisksClient->startAsyncReplication( - $disk, - $project, - $region, - $regionDisksStartAsyncReplicationRequestResource - ); + $response = $regionDisksClient->startAsyncReplication($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionDisksClient/stop_async_replication.php b/Compute/samples/V1/RegionDisksClient/stop_async_replication.php index 4a8c553c5a60..f1408f0f253d 100644 --- a/Compute/samples/V1/RegionDisksClient/stop_async_replication.php +++ b/Compute/samples/V1/RegionDisksClient/stop_async_replication.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_RegionDisks_StopAsyncReplication_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\RegionDisksClient; +use Google\Cloud\Compute\V1\Client\RegionDisksClient; +use Google\Cloud\Compute\V1\StopAsyncReplicationRegionDiskRequest; use Google\Rpc\Status; /** @@ -40,10 +41,16 @@ function stop_async_replication_sample(string $disk, string $project, string $re // Create a client. $regionDisksClient = new RegionDisksClient(); + // Prepare the request message. + $request = (new StopAsyncReplicationRegionDiskRequest()) + ->setDisk($disk) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionDisksClient->stopAsyncReplication($disk, $project, $region); + $response = $regionDisksClient->stopAsyncReplication($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionDisksClient/stop_group_async_replication.php b/Compute/samples/V1/RegionDisksClient/stop_group_async_replication.php index 24b00fa335c6..e2b3731f60c3 100644 --- a/Compute/samples/V1/RegionDisksClient/stop_group_async_replication.php +++ b/Compute/samples/V1/RegionDisksClient/stop_group_async_replication.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_RegionDisks_StopGroupAsyncReplication_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\RegionDisksClient; use Google\Cloud\Compute\V1\DisksStopGroupAsyncReplicationResource; -use Google\Cloud\Compute\V1\RegionDisksClient; +use Google\Cloud\Compute\V1\StopGroupAsyncReplicationRegionDiskRequest; use Google\Rpc\Status; /** @@ -40,17 +41,17 @@ function stop_group_async_replication_sample(string $project, string $region): v // Create a client. $regionDisksClient = new RegionDisksClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $disksStopGroupAsyncReplicationResourceResource = new DisksStopGroupAsyncReplicationResource(); + $request = (new StopGroupAsyncReplicationRegionDiskRequest()) + ->setDisksStopGroupAsyncReplicationResourceResource($disksStopGroupAsyncReplicationResourceResource) + ->setProject($project) + ->setRegion($region); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionDisksClient->stopGroupAsyncReplication( - $disksStopGroupAsyncReplicationResourceResource, - $project, - $region - ); + $response = $regionDisksClient->stopGroupAsyncReplication($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionDisksClient/test_iam_permissions.php b/Compute/samples/V1/RegionDisksClient/test_iam_permissions.php index 6ddb483ce46c..315526532df3 100644 --- a/Compute/samples/V1/RegionDisksClient/test_iam_permissions.php +++ b/Compute/samples/V1/RegionDisksClient/test_iam_permissions.php @@ -24,7 +24,8 @@ // [START compute_v1_generated_RegionDisks_TestIamPermissions_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\RegionDisksClient; +use Google\Cloud\Compute\V1\Client\RegionDisksClient; +use Google\Cloud\Compute\V1\TestIamPermissionsRegionDiskRequest; use Google\Cloud\Compute\V1\TestPermissionsRequest; use Google\Cloud\Compute\V1\TestPermissionsResponse; @@ -40,18 +41,18 @@ function test_iam_permissions_sample(string $project, string $region, string $re // Create a client. $regionDisksClient = new RegionDisksClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $testPermissionsRequestResource = new TestPermissionsRequest(); + $request = (new TestIamPermissionsRegionDiskRequest()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); // Call the API and handle any network failures. try { /** @var TestPermissionsResponse $response */ - $response = $regionDisksClient->testIamPermissions( - $project, - $region, - $resource, - $testPermissionsRequestResource - ); + $response = $regionDisksClient->testIamPermissions($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/RegionDisksClient/update.php b/Compute/samples/V1/RegionDisksClient/update.php index c4cd2495b3cf..28b9b7c1a034 100644 --- a/Compute/samples/V1/RegionDisksClient/update.php +++ b/Compute/samples/V1/RegionDisksClient/update.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_RegionDisks_Update_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\RegionDisksClient; use Google\Cloud\Compute\V1\Disk; -use Google\Cloud\Compute\V1\RegionDisksClient; +use Google\Cloud\Compute\V1\UpdateRegionDiskRequest; use Google\Rpc\Status; /** @@ -41,13 +42,18 @@ function update_sample(string $disk, string $project, string $region): void // Create a client. $regionDisksClient = new RegionDisksClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $diskResource = new Disk(); + $request = (new UpdateRegionDiskRequest()) + ->setDisk($disk) + ->setDiskResource($diskResource) + ->setProject($project) + ->setRegion($region); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionDisksClient->update($disk, $diskResource, $project, $region); + $response = $regionDisksClient->update($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionHealthCheckServicesClient/delete.php b/Compute/samples/V1/RegionHealthCheckServicesClient/delete.php index 2ad77f1f1b23..fc94d6e8e86a 100644 --- a/Compute/samples/V1/RegionHealthCheckServicesClient/delete.php +++ b/Compute/samples/V1/RegionHealthCheckServicesClient/delete.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_RegionHealthCheckServices_Delete_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\RegionHealthCheckServicesClient; +use Google\Cloud\Compute\V1\Client\RegionHealthCheckServicesClient; +use Google\Cloud\Compute\V1\DeleteRegionHealthCheckServiceRequest; use Google\Rpc\Status; /** @@ -40,10 +41,16 @@ function delete_sample(string $healthCheckService, string $project, string $regi // Create a client. $regionHealthCheckServicesClient = new RegionHealthCheckServicesClient(); + // Prepare the request message. + $request = (new DeleteRegionHealthCheckServiceRequest()) + ->setHealthCheckService($healthCheckService) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionHealthCheckServicesClient->delete($healthCheckService, $project, $region); + $response = $regionHealthCheckServicesClient->delete($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionHealthCheckServicesClient/get.php b/Compute/samples/V1/RegionHealthCheckServicesClient/get.php index ab02d8e907f1..bad38d2ae0e2 100644 --- a/Compute/samples/V1/RegionHealthCheckServicesClient/get.php +++ b/Compute/samples/V1/RegionHealthCheckServicesClient/get.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_RegionHealthCheckServices_Get_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\RegionHealthCheckServicesClient; +use Google\Cloud\Compute\V1\GetRegionHealthCheckServiceRequest; use Google\Cloud\Compute\V1\HealthCheckService; -use Google\Cloud\Compute\V1\RegionHealthCheckServicesClient; /** * Returns the specified regional HealthCheckService resource. @@ -39,10 +40,16 @@ function get_sample(string $healthCheckService, string $project, string $region) // Create a client. $regionHealthCheckServicesClient = new RegionHealthCheckServicesClient(); + // Prepare the request message. + $request = (new GetRegionHealthCheckServiceRequest()) + ->setHealthCheckService($healthCheckService) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var HealthCheckService $response */ - $response = $regionHealthCheckServicesClient->get($healthCheckService, $project, $region); + $response = $regionHealthCheckServicesClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/RegionHealthCheckServicesClient/insert.php b/Compute/samples/V1/RegionHealthCheckServicesClient/insert.php index 540ef178ba69..8a3393802bc5 100644 --- a/Compute/samples/V1/RegionHealthCheckServicesClient/insert.php +++ b/Compute/samples/V1/RegionHealthCheckServicesClient/insert.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_RegionHealthCheckServices_Insert_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\RegionHealthCheckServicesClient; use Google\Cloud\Compute\V1\HealthCheckService; -use Google\Cloud\Compute\V1\RegionHealthCheckServicesClient; +use Google\Cloud\Compute\V1\InsertRegionHealthCheckServiceRequest; use Google\Rpc\Status; /** @@ -40,17 +41,17 @@ function insert_sample(string $project, string $region): void // Create a client. $regionHealthCheckServicesClient = new RegionHealthCheckServicesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $healthCheckServiceResource = new HealthCheckService(); + $request = (new InsertRegionHealthCheckServiceRequest()) + ->setHealthCheckServiceResource($healthCheckServiceResource) + ->setProject($project) + ->setRegion($region); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionHealthCheckServicesClient->insert( - $healthCheckServiceResource, - $project, - $region - ); + $response = $regionHealthCheckServicesClient->insert($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionHealthCheckServicesClient/list.php b/Compute/samples/V1/RegionHealthCheckServicesClient/list.php index 50228f80d76c..c95f2c84494b 100644 --- a/Compute/samples/V1/RegionHealthCheckServicesClient/list.php +++ b/Compute/samples/V1/RegionHealthCheckServicesClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_RegionHealthCheckServices_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\RegionHealthCheckServicesClient; +use Google\Cloud\Compute\V1\Client\RegionHealthCheckServicesClient; +use Google\Cloud\Compute\V1\ListRegionHealthCheckServicesRequest; /** * Lists all the HealthCheckService resources that have been configured for the specified project in the given region. @@ -38,10 +39,15 @@ function list_sample(string $project, string $region): void // Create a client. $regionHealthCheckServicesClient = new RegionHealthCheckServicesClient(); + // Prepare the request message. + $request = (new ListRegionHealthCheckServicesRequest()) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $regionHealthCheckServicesClient->list($project, $region); + $response = $regionHealthCheckServicesClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/RegionHealthCheckServicesClient/patch.php b/Compute/samples/V1/RegionHealthCheckServicesClient/patch.php index faf268a8505e..42242487e92d 100644 --- a/Compute/samples/V1/RegionHealthCheckServicesClient/patch.php +++ b/Compute/samples/V1/RegionHealthCheckServicesClient/patch.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_RegionHealthCheckServices_Patch_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\RegionHealthCheckServicesClient; use Google\Cloud\Compute\V1\HealthCheckService; -use Google\Cloud\Compute\V1\RegionHealthCheckServicesClient; +use Google\Cloud\Compute\V1\PatchRegionHealthCheckServiceRequest; use Google\Rpc\Status; /** @@ -41,18 +42,18 @@ function patch_sample(string $healthCheckService, string $project, string $regio // Create a client. $regionHealthCheckServicesClient = new RegionHealthCheckServicesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $healthCheckServiceResource = new HealthCheckService(); + $request = (new PatchRegionHealthCheckServiceRequest()) + ->setHealthCheckService($healthCheckService) + ->setHealthCheckServiceResource($healthCheckServiceResource) + ->setProject($project) + ->setRegion($region); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionHealthCheckServicesClient->patch( - $healthCheckService, - $healthCheckServiceResource, - $project, - $region - ); + $response = $regionHealthCheckServicesClient->patch($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionHealthChecksClient/delete.php b/Compute/samples/V1/RegionHealthChecksClient/delete.php index c47bc645b5bb..cef4a875a6be 100644 --- a/Compute/samples/V1/RegionHealthChecksClient/delete.php +++ b/Compute/samples/V1/RegionHealthChecksClient/delete.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_RegionHealthChecks_Delete_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\RegionHealthChecksClient; +use Google\Cloud\Compute\V1\Client\RegionHealthChecksClient; +use Google\Cloud\Compute\V1\DeleteRegionHealthCheckRequest; use Google\Rpc\Status; /** @@ -40,10 +41,16 @@ function delete_sample(string $healthCheck, string $project, string $region): vo // Create a client. $regionHealthChecksClient = new RegionHealthChecksClient(); + // Prepare the request message. + $request = (new DeleteRegionHealthCheckRequest()) + ->setHealthCheck($healthCheck) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionHealthChecksClient->delete($healthCheck, $project, $region); + $response = $regionHealthChecksClient->delete($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionHealthChecksClient/get.php b/Compute/samples/V1/RegionHealthChecksClient/get.php index 4ac7f83f08fa..69317035897d 100644 --- a/Compute/samples/V1/RegionHealthChecksClient/get.php +++ b/Compute/samples/V1/RegionHealthChecksClient/get.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_RegionHealthChecks_Get_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\RegionHealthChecksClient; +use Google\Cloud\Compute\V1\GetRegionHealthCheckRequest; use Google\Cloud\Compute\V1\HealthCheck; -use Google\Cloud\Compute\V1\RegionHealthChecksClient; /** * Returns the specified HealthCheck resource. @@ -39,10 +40,16 @@ function get_sample(string $healthCheck, string $project, string $region): void // Create a client. $regionHealthChecksClient = new RegionHealthChecksClient(); + // Prepare the request message. + $request = (new GetRegionHealthCheckRequest()) + ->setHealthCheck($healthCheck) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var HealthCheck $response */ - $response = $regionHealthChecksClient->get($healthCheck, $project, $region); + $response = $regionHealthChecksClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/RegionHealthChecksClient/insert.php b/Compute/samples/V1/RegionHealthChecksClient/insert.php index 4baaef886de8..2704bdcc5c66 100644 --- a/Compute/samples/V1/RegionHealthChecksClient/insert.php +++ b/Compute/samples/V1/RegionHealthChecksClient/insert.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_RegionHealthChecks_Insert_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\RegionHealthChecksClient; use Google\Cloud\Compute\V1\HealthCheck; -use Google\Cloud\Compute\V1\RegionHealthChecksClient; +use Google\Cloud\Compute\V1\InsertRegionHealthCheckRequest; use Google\Rpc\Status; /** @@ -40,13 +41,17 @@ function insert_sample(string $project, string $region): void // Create a client. $regionHealthChecksClient = new RegionHealthChecksClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $healthCheckResource = new HealthCheck(); + $request = (new InsertRegionHealthCheckRequest()) + ->setHealthCheckResource($healthCheckResource) + ->setProject($project) + ->setRegion($region); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionHealthChecksClient->insert($healthCheckResource, $project, $region); + $response = $regionHealthChecksClient->insert($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionHealthChecksClient/list.php b/Compute/samples/V1/RegionHealthChecksClient/list.php index 4c899900154d..d26b23911037 100644 --- a/Compute/samples/V1/RegionHealthChecksClient/list.php +++ b/Compute/samples/V1/RegionHealthChecksClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_RegionHealthChecks_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\RegionHealthChecksClient; +use Google\Cloud\Compute\V1\Client\RegionHealthChecksClient; +use Google\Cloud\Compute\V1\ListRegionHealthChecksRequest; /** * Retrieves the list of HealthCheck resources available to the specified project. @@ -38,10 +39,15 @@ function list_sample(string $project, string $region): void // Create a client. $regionHealthChecksClient = new RegionHealthChecksClient(); + // Prepare the request message. + $request = (new ListRegionHealthChecksRequest()) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $regionHealthChecksClient->list($project, $region); + $response = $regionHealthChecksClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/RegionHealthChecksClient/patch.php b/Compute/samples/V1/RegionHealthChecksClient/patch.php index 7858de31b14f..2d59d2904046 100644 --- a/Compute/samples/V1/RegionHealthChecksClient/patch.php +++ b/Compute/samples/V1/RegionHealthChecksClient/patch.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_RegionHealthChecks_Patch_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\RegionHealthChecksClient; use Google\Cloud\Compute\V1\HealthCheck; -use Google\Cloud\Compute\V1\RegionHealthChecksClient; +use Google\Cloud\Compute\V1\PatchRegionHealthCheckRequest; use Google\Rpc\Status; /** @@ -41,13 +42,18 @@ function patch_sample(string $healthCheck, string $project, string $region): voi // Create a client. $regionHealthChecksClient = new RegionHealthChecksClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $healthCheckResource = new HealthCheck(); + $request = (new PatchRegionHealthCheckRequest()) + ->setHealthCheck($healthCheck) + ->setHealthCheckResource($healthCheckResource) + ->setProject($project) + ->setRegion($region); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionHealthChecksClient->patch($healthCheck, $healthCheckResource, $project, $region); + $response = $regionHealthChecksClient->patch($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionHealthChecksClient/update.php b/Compute/samples/V1/RegionHealthChecksClient/update.php index 66533374865a..00fc2ebb5095 100644 --- a/Compute/samples/V1/RegionHealthChecksClient/update.php +++ b/Compute/samples/V1/RegionHealthChecksClient/update.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_RegionHealthChecks_Update_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\RegionHealthChecksClient; use Google\Cloud\Compute\V1\HealthCheck; -use Google\Cloud\Compute\V1\RegionHealthChecksClient; +use Google\Cloud\Compute\V1\UpdateRegionHealthCheckRequest; use Google\Rpc\Status; /** @@ -41,18 +42,18 @@ function update_sample(string $healthCheck, string $project, string $region): vo // Create a client. $regionHealthChecksClient = new RegionHealthChecksClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $healthCheckResource = new HealthCheck(); + $request = (new UpdateRegionHealthCheckRequest()) + ->setHealthCheck($healthCheck) + ->setHealthCheckResource($healthCheckResource) + ->setProject($project) + ->setRegion($region); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionHealthChecksClient->update( - $healthCheck, - $healthCheckResource, - $project, - $region - ); + $response = $regionHealthChecksClient->update($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionInstanceGroupManagersClient/abandon_instances.php b/Compute/samples/V1/RegionInstanceGroupManagersClient/abandon_instances.php index 10ef77370429..b1f59f6b04e1 100644 --- a/Compute/samples/V1/RegionInstanceGroupManagersClient/abandon_instances.php +++ b/Compute/samples/V1/RegionInstanceGroupManagersClient/abandon_instances.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_RegionInstanceGroupManagers_AbandonInstances_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\AbandonInstancesRegionInstanceGroupManagerRequest; +use Google\Cloud\Compute\V1\Client\RegionInstanceGroupManagersClient; use Google\Cloud\Compute\V1\RegionInstanceGroupManagersAbandonInstancesRequest; -use Google\Cloud\Compute\V1\RegionInstanceGroupManagersClient; use Google\Rpc\Status; /** @@ -44,18 +45,20 @@ function abandon_instances_sample( // Create a client. $regionInstanceGroupManagersClient = new RegionInstanceGroupManagersClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $regionInstanceGroupManagersAbandonInstancesRequestResource = new RegionInstanceGroupManagersAbandonInstancesRequest(); + $request = (new AbandonInstancesRegionInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region) + ->setRegionInstanceGroupManagersAbandonInstancesRequestResource( + $regionInstanceGroupManagersAbandonInstancesRequestResource + ); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionInstanceGroupManagersClient->abandonInstances( - $instanceGroupManager, - $project, - $region, - $regionInstanceGroupManagersAbandonInstancesRequestResource - ); + $response = $regionInstanceGroupManagersClient->abandonInstances($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionInstanceGroupManagersClient/apply_updates_to_instances.php b/Compute/samples/V1/RegionInstanceGroupManagersClient/apply_updates_to_instances.php index 0323adaf8e5a..4f2f7ceed642 100644 --- a/Compute/samples/V1/RegionInstanceGroupManagersClient/apply_updates_to_instances.php +++ b/Compute/samples/V1/RegionInstanceGroupManagersClient/apply_updates_to_instances.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_RegionInstanceGroupManagers_ApplyUpdatesToInstances_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest; +use Google\Cloud\Compute\V1\Client\RegionInstanceGroupManagersClient; use Google\Cloud\Compute\V1\RegionInstanceGroupManagersApplyUpdatesRequest; -use Google\Cloud\Compute\V1\RegionInstanceGroupManagersClient; use Google\Rpc\Status; /** @@ -44,18 +45,20 @@ function apply_updates_to_instances_sample( // Create a client. $regionInstanceGroupManagersClient = new RegionInstanceGroupManagersClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $regionInstanceGroupManagersApplyUpdatesRequestResource = new RegionInstanceGroupManagersApplyUpdatesRequest(); + $request = (new ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region) + ->setRegionInstanceGroupManagersApplyUpdatesRequestResource( + $regionInstanceGroupManagersApplyUpdatesRequestResource + ); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionInstanceGroupManagersClient->applyUpdatesToInstances( - $instanceGroupManager, - $project, - $region, - $regionInstanceGroupManagersApplyUpdatesRequestResource - ); + $response = $regionInstanceGroupManagersClient->applyUpdatesToInstances($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionInstanceGroupManagersClient/create_instances.php b/Compute/samples/V1/RegionInstanceGroupManagersClient/create_instances.php index 78876a7705c5..9b0a59019f59 100644 --- a/Compute/samples/V1/RegionInstanceGroupManagersClient/create_instances.php +++ b/Compute/samples/V1/RegionInstanceGroupManagersClient/create_instances.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_RegionInstanceGroupManagers_CreateInstances_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\RegionInstanceGroupManagersClient; +use Google\Cloud\Compute\V1\Client\RegionInstanceGroupManagersClient; +use Google\Cloud\Compute\V1\CreateInstancesRegionInstanceGroupManagerRequest; use Google\Cloud\Compute\V1\RegionInstanceGroupManagersCreateInstancesRequest; use Google\Rpc\Status; @@ -44,18 +45,20 @@ function create_instances_sample( // Create a client. $regionInstanceGroupManagersClient = new RegionInstanceGroupManagersClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $regionInstanceGroupManagersCreateInstancesRequestResource = new RegionInstanceGroupManagersCreateInstancesRequest(); + $request = (new CreateInstancesRegionInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region) + ->setRegionInstanceGroupManagersCreateInstancesRequestResource( + $regionInstanceGroupManagersCreateInstancesRequestResource + ); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionInstanceGroupManagersClient->createInstances( - $instanceGroupManager, - $project, - $region, - $regionInstanceGroupManagersCreateInstancesRequestResource - ); + $response = $regionInstanceGroupManagersClient->createInstances($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionInstanceGroupManagersClient/delete.php b/Compute/samples/V1/RegionInstanceGroupManagersClient/delete.php index 22d0396c437c..ddba25e845e0 100644 --- a/Compute/samples/V1/RegionInstanceGroupManagersClient/delete.php +++ b/Compute/samples/V1/RegionInstanceGroupManagersClient/delete.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_RegionInstanceGroupManagers_Delete_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\RegionInstanceGroupManagersClient; +use Google\Cloud\Compute\V1\Client\RegionInstanceGroupManagersClient; +use Google\Cloud\Compute\V1\DeleteRegionInstanceGroupManagerRequest; use Google\Rpc\Status; /** @@ -40,10 +41,16 @@ function delete_sample(string $instanceGroupManager, string $project, string $re // Create a client. $regionInstanceGroupManagersClient = new RegionInstanceGroupManagersClient(); + // Prepare the request message. + $request = (new DeleteRegionInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionInstanceGroupManagersClient->delete($instanceGroupManager, $project, $region); + $response = $regionInstanceGroupManagersClient->delete($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionInstanceGroupManagersClient/delete_instances.php b/Compute/samples/V1/RegionInstanceGroupManagersClient/delete_instances.php index 99bf70ce7273..a8bad09f71cf 100644 --- a/Compute/samples/V1/RegionInstanceGroupManagersClient/delete_instances.php +++ b/Compute/samples/V1/RegionInstanceGroupManagersClient/delete_instances.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_RegionInstanceGroupManagers_DeleteInstances_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\RegionInstanceGroupManagersClient; +use Google\Cloud\Compute\V1\Client\RegionInstanceGroupManagersClient; +use Google\Cloud\Compute\V1\DeleteInstancesRegionInstanceGroupManagerRequest; use Google\Cloud\Compute\V1\RegionInstanceGroupManagersDeleteInstancesRequest; use Google\Rpc\Status; @@ -44,18 +45,20 @@ function delete_instances_sample( // Create a client. $regionInstanceGroupManagersClient = new RegionInstanceGroupManagersClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $regionInstanceGroupManagersDeleteInstancesRequestResource = new RegionInstanceGroupManagersDeleteInstancesRequest(); + $request = (new DeleteInstancesRegionInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region) + ->setRegionInstanceGroupManagersDeleteInstancesRequestResource( + $regionInstanceGroupManagersDeleteInstancesRequestResource + ); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionInstanceGroupManagersClient->deleteInstances( - $instanceGroupManager, - $project, - $region, - $regionInstanceGroupManagersDeleteInstancesRequestResource - ); + $response = $regionInstanceGroupManagersClient->deleteInstances($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionInstanceGroupManagersClient/delete_per_instance_configs.php b/Compute/samples/V1/RegionInstanceGroupManagersClient/delete_per_instance_configs.php index 75c8474fb198..76e0fd11a846 100644 --- a/Compute/samples/V1/RegionInstanceGroupManagersClient/delete_per_instance_configs.php +++ b/Compute/samples/V1/RegionInstanceGroupManagersClient/delete_per_instance_configs.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_RegionInstanceGroupManagers_DeletePerInstanceConfigs_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\RegionInstanceGroupManagersClient; +use Google\Cloud\Compute\V1\DeletePerInstanceConfigsRegionInstanceGroupManagerRequest; use Google\Cloud\Compute\V1\RegionInstanceGroupManagerDeleteInstanceConfigReq; -use Google\Cloud\Compute\V1\RegionInstanceGroupManagersClient; use Google\Rpc\Status; /** @@ -44,18 +45,20 @@ function delete_per_instance_configs_sample( // Create a client. $regionInstanceGroupManagersClient = new RegionInstanceGroupManagersClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $regionInstanceGroupManagerDeleteInstanceConfigReqResource = new RegionInstanceGroupManagerDeleteInstanceConfigReq(); + $request = (new DeletePerInstanceConfigsRegionInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region) + ->setRegionInstanceGroupManagerDeleteInstanceConfigReqResource( + $regionInstanceGroupManagerDeleteInstanceConfigReqResource + ); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionInstanceGroupManagersClient->deletePerInstanceConfigs( - $instanceGroupManager, - $project, - $region, - $regionInstanceGroupManagerDeleteInstanceConfigReqResource - ); + $response = $regionInstanceGroupManagersClient->deletePerInstanceConfigs($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionInstanceGroupManagersClient/get.php b/Compute/samples/V1/RegionInstanceGroupManagersClient/get.php index 306e77090c2e..d19aa0921801 100644 --- a/Compute/samples/V1/RegionInstanceGroupManagersClient/get.php +++ b/Compute/samples/V1/RegionInstanceGroupManagersClient/get.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_RegionInstanceGroupManagers_Get_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\RegionInstanceGroupManagersClient; +use Google\Cloud\Compute\V1\GetRegionInstanceGroupManagerRequest; use Google\Cloud\Compute\V1\InstanceGroupManager; -use Google\Cloud\Compute\V1\RegionInstanceGroupManagersClient; /** * Returns all of the details about the specified managed instance group. @@ -39,10 +40,16 @@ function get_sample(string $instanceGroupManager, string $project, string $regio // Create a client. $regionInstanceGroupManagersClient = new RegionInstanceGroupManagersClient(); + // Prepare the request message. + $request = (new GetRegionInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var InstanceGroupManager $response */ - $response = $regionInstanceGroupManagersClient->get($instanceGroupManager, $project, $region); + $response = $regionInstanceGroupManagersClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/RegionInstanceGroupManagersClient/insert.php b/Compute/samples/V1/RegionInstanceGroupManagersClient/insert.php index 9ba3b3f2d72d..3f196a3a0657 100644 --- a/Compute/samples/V1/RegionInstanceGroupManagersClient/insert.php +++ b/Compute/samples/V1/RegionInstanceGroupManagersClient/insert.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_RegionInstanceGroupManagers_Insert_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\RegionInstanceGroupManagersClient; +use Google\Cloud\Compute\V1\InsertRegionInstanceGroupManagerRequest; use Google\Cloud\Compute\V1\InstanceGroupManager; -use Google\Cloud\Compute\V1\RegionInstanceGroupManagersClient; use Google\Rpc\Status; /** @@ -40,17 +41,17 @@ function insert_sample(string $project, string $region): void // Create a client. $regionInstanceGroupManagersClient = new RegionInstanceGroupManagersClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $instanceGroupManagerResource = new InstanceGroupManager(); + $request = (new InsertRegionInstanceGroupManagerRequest()) + ->setInstanceGroupManagerResource($instanceGroupManagerResource) + ->setProject($project) + ->setRegion($region); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionInstanceGroupManagersClient->insert( - $instanceGroupManagerResource, - $project, - $region - ); + $response = $regionInstanceGroupManagersClient->insert($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionInstanceGroupManagersClient/list.php b/Compute/samples/V1/RegionInstanceGroupManagersClient/list.php index 6ffdb1ffb0d4..700ed5ef1ffb 100644 --- a/Compute/samples/V1/RegionInstanceGroupManagersClient/list.php +++ b/Compute/samples/V1/RegionInstanceGroupManagersClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_RegionInstanceGroupManagers_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\RegionInstanceGroupManagersClient; +use Google\Cloud\Compute\V1\Client\RegionInstanceGroupManagersClient; +use Google\Cloud\Compute\V1\ListRegionInstanceGroupManagersRequest; /** * Retrieves the list of managed instance groups that are contained within the specified region. @@ -38,10 +39,15 @@ function list_sample(string $project, string $region): void // Create a client. $regionInstanceGroupManagersClient = new RegionInstanceGroupManagersClient(); + // Prepare the request message. + $request = (new ListRegionInstanceGroupManagersRequest()) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $regionInstanceGroupManagersClient->list($project, $region); + $response = $regionInstanceGroupManagersClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/RegionInstanceGroupManagersClient/list_errors.php b/Compute/samples/V1/RegionInstanceGroupManagersClient/list_errors.php index fc47c3a2a0c7..0118c0317124 100644 --- a/Compute/samples/V1/RegionInstanceGroupManagersClient/list_errors.php +++ b/Compute/samples/V1/RegionInstanceGroupManagersClient/list_errors.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_RegionInstanceGroupManagers_ListErrors_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\RegionInstanceGroupManagersClient; +use Google\Cloud\Compute\V1\Client\RegionInstanceGroupManagersClient; +use Google\Cloud\Compute\V1\ListErrorsRegionInstanceGroupManagersRequest; /** * Lists all errors thrown by actions on instances for a given regional managed instance group. The filter and orderBy query parameters are not supported. @@ -39,14 +40,16 @@ function list_errors_sample(string $instanceGroupManager, string $project, strin // Create a client. $regionInstanceGroupManagersClient = new RegionInstanceGroupManagersClient(); + // Prepare the request message. + $request = (new ListErrorsRegionInstanceGroupManagersRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $regionInstanceGroupManagersClient->listErrors( - $instanceGroupManager, - $project, - $region - ); + $response = $regionInstanceGroupManagersClient->listErrors($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/RegionInstanceGroupManagersClient/list_managed_instances.php b/Compute/samples/V1/RegionInstanceGroupManagersClient/list_managed_instances.php index 2911969c5c05..f009d9a589c1 100644 --- a/Compute/samples/V1/RegionInstanceGroupManagersClient/list_managed_instances.php +++ b/Compute/samples/V1/RegionInstanceGroupManagersClient/list_managed_instances.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_RegionInstanceGroupManagers_ListManagedInstances_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\RegionInstanceGroupManagersClient; +use Google\Cloud\Compute\V1\Client\RegionInstanceGroupManagersClient; +use Google\Cloud\Compute\V1\ListManagedInstancesRegionInstanceGroupManagersRequest; /** * Lists the instances in the managed instance group and instances that are scheduled to be created. The list includes any current actions that the group has scheduled for its instances. The orderBy query parameter is not supported. The `pageToken` query parameter is supported only if the group's `listManagedInstancesResults` field is set to `PAGINATED`. @@ -42,14 +43,16 @@ function list_managed_instances_sample( // Create a client. $regionInstanceGroupManagersClient = new RegionInstanceGroupManagersClient(); + // Prepare the request message. + $request = (new ListManagedInstancesRegionInstanceGroupManagersRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $regionInstanceGroupManagersClient->listManagedInstances( - $instanceGroupManager, - $project, - $region - ); + $response = $regionInstanceGroupManagersClient->listManagedInstances($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/RegionInstanceGroupManagersClient/list_per_instance_configs.php b/Compute/samples/V1/RegionInstanceGroupManagersClient/list_per_instance_configs.php index 59a972543e84..425a7350241a 100644 --- a/Compute/samples/V1/RegionInstanceGroupManagersClient/list_per_instance_configs.php +++ b/Compute/samples/V1/RegionInstanceGroupManagersClient/list_per_instance_configs.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_RegionInstanceGroupManagers_ListPerInstanceConfigs_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\RegionInstanceGroupManagersClient; +use Google\Cloud\Compute\V1\Client\RegionInstanceGroupManagersClient; +use Google\Cloud\Compute\V1\ListPerInstanceConfigsRegionInstanceGroupManagersRequest; /** * Lists all of the per-instance configurations defined for the managed instance group. The orderBy query parameter is not supported. @@ -42,14 +43,16 @@ function list_per_instance_configs_sample( // Create a client. $regionInstanceGroupManagersClient = new RegionInstanceGroupManagersClient(); + // Prepare the request message. + $request = (new ListPerInstanceConfigsRegionInstanceGroupManagersRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $regionInstanceGroupManagersClient->listPerInstanceConfigs( - $instanceGroupManager, - $project, - $region - ); + $response = $regionInstanceGroupManagersClient->listPerInstanceConfigs($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/RegionInstanceGroupManagersClient/patch.php b/Compute/samples/V1/RegionInstanceGroupManagersClient/patch.php index 9de4abfa37d5..9d3ef89f8787 100644 --- a/Compute/samples/V1/RegionInstanceGroupManagersClient/patch.php +++ b/Compute/samples/V1/RegionInstanceGroupManagersClient/patch.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_RegionInstanceGroupManagers_Patch_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\RegionInstanceGroupManagersClient; use Google\Cloud\Compute\V1\InstanceGroupManager; -use Google\Cloud\Compute\V1\RegionInstanceGroupManagersClient; +use Google\Cloud\Compute\V1\PatchRegionInstanceGroupManagerRequest; use Google\Rpc\Status; /** @@ -41,18 +42,18 @@ function patch_sample(string $instanceGroupManager, string $project, string $reg // Create a client. $regionInstanceGroupManagersClient = new RegionInstanceGroupManagersClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $instanceGroupManagerResource = new InstanceGroupManager(); + $request = (new PatchRegionInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagerResource($instanceGroupManagerResource) + ->setProject($project) + ->setRegion($region); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionInstanceGroupManagersClient->patch( - $instanceGroupManager, - $instanceGroupManagerResource, - $project, - $region - ); + $response = $regionInstanceGroupManagersClient->patch($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionInstanceGroupManagersClient/patch_per_instance_configs.php b/Compute/samples/V1/RegionInstanceGroupManagersClient/patch_per_instance_configs.php index 74cf7a42e879..df08548e49d6 100644 --- a/Compute/samples/V1/RegionInstanceGroupManagersClient/patch_per_instance_configs.php +++ b/Compute/samples/V1/RegionInstanceGroupManagersClient/patch_per_instance_configs.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_RegionInstanceGroupManagers_PatchPerInstanceConfigs_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\RegionInstanceGroupManagersClient; +use Google\Cloud\Compute\V1\PatchPerInstanceConfigsRegionInstanceGroupManagerRequest; use Google\Cloud\Compute\V1\RegionInstanceGroupManagerPatchInstanceConfigReq; -use Google\Cloud\Compute\V1\RegionInstanceGroupManagersClient; use Google\Rpc\Status; /** @@ -44,18 +45,20 @@ function patch_per_instance_configs_sample( // Create a client. $regionInstanceGroupManagersClient = new RegionInstanceGroupManagersClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $regionInstanceGroupManagerPatchInstanceConfigReqResource = new RegionInstanceGroupManagerPatchInstanceConfigReq(); + $request = (new PatchPerInstanceConfigsRegionInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region) + ->setRegionInstanceGroupManagerPatchInstanceConfigReqResource( + $regionInstanceGroupManagerPatchInstanceConfigReqResource + ); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionInstanceGroupManagersClient->patchPerInstanceConfigs( - $instanceGroupManager, - $project, - $region, - $regionInstanceGroupManagerPatchInstanceConfigReqResource - ); + $response = $regionInstanceGroupManagersClient->patchPerInstanceConfigs($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionInstanceGroupManagersClient/recreate_instances.php b/Compute/samples/V1/RegionInstanceGroupManagersClient/recreate_instances.php index 4cbc6d1149d0..1ab1b1e8801c 100644 --- a/Compute/samples/V1/RegionInstanceGroupManagersClient/recreate_instances.php +++ b/Compute/samples/V1/RegionInstanceGroupManagersClient/recreate_instances.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_RegionInstanceGroupManagers_RecreateInstances_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\RegionInstanceGroupManagersClient; +use Google\Cloud\Compute\V1\Client\RegionInstanceGroupManagersClient; +use Google\Cloud\Compute\V1\RecreateInstancesRegionInstanceGroupManagerRequest; use Google\Cloud\Compute\V1\RegionInstanceGroupManagersRecreateRequest; use Google\Rpc\Status; @@ -44,18 +45,20 @@ function recreate_instances_sample( // Create a client. $regionInstanceGroupManagersClient = new RegionInstanceGroupManagersClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $regionInstanceGroupManagersRecreateRequestResource = new RegionInstanceGroupManagersRecreateRequest(); + $request = (new RecreateInstancesRegionInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region) + ->setRegionInstanceGroupManagersRecreateRequestResource( + $regionInstanceGroupManagersRecreateRequestResource + ); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionInstanceGroupManagersClient->recreateInstances( - $instanceGroupManager, - $project, - $region, - $regionInstanceGroupManagersRecreateRequestResource - ); + $response = $regionInstanceGroupManagersClient->recreateInstances($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionInstanceGroupManagersClient/resize.php b/Compute/samples/V1/RegionInstanceGroupManagersClient/resize.php index c422bfe7009d..e68598012041 100644 --- a/Compute/samples/V1/RegionInstanceGroupManagersClient/resize.php +++ b/Compute/samples/V1/RegionInstanceGroupManagersClient/resize.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_RegionInstanceGroupManagers_Resize_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\RegionInstanceGroupManagersClient; +use Google\Cloud\Compute\V1\Client\RegionInstanceGroupManagersClient; +use Google\Cloud\Compute\V1\ResizeRegionInstanceGroupManagerRequest; use Google\Rpc\Status; /** @@ -45,15 +46,17 @@ function resize_sample( // Create a client. $regionInstanceGroupManagersClient = new RegionInstanceGroupManagersClient(); + // Prepare the request message. + $request = (new ResizeRegionInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region) + ->setSize($size); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionInstanceGroupManagersClient->resize( - $instanceGroupManager, - $project, - $region, - $size - ); + $response = $regionInstanceGroupManagersClient->resize($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionInstanceGroupManagersClient/resume_instances.php b/Compute/samples/V1/RegionInstanceGroupManagersClient/resume_instances.php index 9b7267290664..9e55a0a7c8d4 100644 --- a/Compute/samples/V1/RegionInstanceGroupManagersClient/resume_instances.php +++ b/Compute/samples/V1/RegionInstanceGroupManagersClient/resume_instances.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_RegionInstanceGroupManagers_ResumeInstances_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\RegionInstanceGroupManagersClient; +use Google\Cloud\Compute\V1\Client\RegionInstanceGroupManagersClient; use Google\Cloud\Compute\V1\RegionInstanceGroupManagersResumeInstancesRequest; +use Google\Cloud\Compute\V1\ResumeInstancesRegionInstanceGroupManagerRequest; use Google\Rpc\Status; /** @@ -44,18 +45,20 @@ function resume_instances_sample( // Create a client. $regionInstanceGroupManagersClient = new RegionInstanceGroupManagersClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $regionInstanceGroupManagersResumeInstancesRequestResource = new RegionInstanceGroupManagersResumeInstancesRequest(); + $request = (new ResumeInstancesRegionInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region) + ->setRegionInstanceGroupManagersResumeInstancesRequestResource( + $regionInstanceGroupManagersResumeInstancesRequestResource + ); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionInstanceGroupManagersClient->resumeInstances( - $instanceGroupManager, - $project, - $region, - $regionInstanceGroupManagersResumeInstancesRequestResource - ); + $response = $regionInstanceGroupManagersClient->resumeInstances($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionInstanceGroupManagersClient/set_instance_template.php b/Compute/samples/V1/RegionInstanceGroupManagersClient/set_instance_template.php index 1fdee74deeee..bdc8376e61ee 100644 --- a/Compute/samples/V1/RegionInstanceGroupManagersClient/set_instance_template.php +++ b/Compute/samples/V1/RegionInstanceGroupManagersClient/set_instance_template.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_RegionInstanceGroupManagers_SetInstanceTemplate_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\RegionInstanceGroupManagersClient; +use Google\Cloud\Compute\V1\Client\RegionInstanceGroupManagersClient; use Google\Cloud\Compute\V1\RegionInstanceGroupManagersSetTemplateRequest; +use Google\Cloud\Compute\V1\SetInstanceTemplateRegionInstanceGroupManagerRequest; use Google\Rpc\Status; /** @@ -44,18 +45,20 @@ function set_instance_template_sample( // Create a client. $regionInstanceGroupManagersClient = new RegionInstanceGroupManagersClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $regionInstanceGroupManagersSetTemplateRequestResource = new RegionInstanceGroupManagersSetTemplateRequest(); + $request = (new SetInstanceTemplateRegionInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region) + ->setRegionInstanceGroupManagersSetTemplateRequestResource( + $regionInstanceGroupManagersSetTemplateRequestResource + ); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionInstanceGroupManagersClient->setInstanceTemplate( - $instanceGroupManager, - $project, - $region, - $regionInstanceGroupManagersSetTemplateRequestResource - ); + $response = $regionInstanceGroupManagersClient->setInstanceTemplate($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionInstanceGroupManagersClient/set_target_pools.php b/Compute/samples/V1/RegionInstanceGroupManagersClient/set_target_pools.php index c97dc9060154..f96008d5dd1c 100644 --- a/Compute/samples/V1/RegionInstanceGroupManagersClient/set_target_pools.php +++ b/Compute/samples/V1/RegionInstanceGroupManagersClient/set_target_pools.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_RegionInstanceGroupManagers_SetTargetPools_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\RegionInstanceGroupManagersClient; +use Google\Cloud\Compute\V1\Client\RegionInstanceGroupManagersClient; use Google\Cloud\Compute\V1\RegionInstanceGroupManagersSetTargetPoolsRequest; +use Google\Cloud\Compute\V1\SetTargetPoolsRegionInstanceGroupManagerRequest; use Google\Rpc\Status; /** @@ -44,18 +45,20 @@ function set_target_pools_sample( // Create a client. $regionInstanceGroupManagersClient = new RegionInstanceGroupManagersClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $regionInstanceGroupManagersSetTargetPoolsRequestResource = new RegionInstanceGroupManagersSetTargetPoolsRequest(); + $request = (new SetTargetPoolsRegionInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region) + ->setRegionInstanceGroupManagersSetTargetPoolsRequestResource( + $regionInstanceGroupManagersSetTargetPoolsRequestResource + ); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionInstanceGroupManagersClient->setTargetPools( - $instanceGroupManager, - $project, - $region, - $regionInstanceGroupManagersSetTargetPoolsRequestResource - ); + $response = $regionInstanceGroupManagersClient->setTargetPools($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionInstanceGroupManagersClient/start_instances.php b/Compute/samples/V1/RegionInstanceGroupManagersClient/start_instances.php index 5b4ffb0fba62..8ec12fcb3b60 100644 --- a/Compute/samples/V1/RegionInstanceGroupManagersClient/start_instances.php +++ b/Compute/samples/V1/RegionInstanceGroupManagersClient/start_instances.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_RegionInstanceGroupManagers_StartInstances_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\RegionInstanceGroupManagersClient; +use Google\Cloud\Compute\V1\Client\RegionInstanceGroupManagersClient; use Google\Cloud\Compute\V1\RegionInstanceGroupManagersStartInstancesRequest; +use Google\Cloud\Compute\V1\StartInstancesRegionInstanceGroupManagerRequest; use Google\Rpc\Status; /** @@ -44,18 +45,20 @@ function start_instances_sample( // Create a client. $regionInstanceGroupManagersClient = new RegionInstanceGroupManagersClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $regionInstanceGroupManagersStartInstancesRequestResource = new RegionInstanceGroupManagersStartInstancesRequest(); + $request = (new StartInstancesRegionInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region) + ->setRegionInstanceGroupManagersStartInstancesRequestResource( + $regionInstanceGroupManagersStartInstancesRequestResource + ); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionInstanceGroupManagersClient->startInstances( - $instanceGroupManager, - $project, - $region, - $regionInstanceGroupManagersStartInstancesRequestResource - ); + $response = $regionInstanceGroupManagersClient->startInstances($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionInstanceGroupManagersClient/stop_instances.php b/Compute/samples/V1/RegionInstanceGroupManagersClient/stop_instances.php index ed887739eaf2..8abe0fcd78b8 100644 --- a/Compute/samples/V1/RegionInstanceGroupManagersClient/stop_instances.php +++ b/Compute/samples/V1/RegionInstanceGroupManagersClient/stop_instances.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_RegionInstanceGroupManagers_StopInstances_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\RegionInstanceGroupManagersClient; +use Google\Cloud\Compute\V1\Client\RegionInstanceGroupManagersClient; use Google\Cloud\Compute\V1\RegionInstanceGroupManagersStopInstancesRequest; +use Google\Cloud\Compute\V1\StopInstancesRegionInstanceGroupManagerRequest; use Google\Rpc\Status; /** @@ -44,18 +45,20 @@ function stop_instances_sample( // Create a client. $regionInstanceGroupManagersClient = new RegionInstanceGroupManagersClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $regionInstanceGroupManagersStopInstancesRequestResource = new RegionInstanceGroupManagersStopInstancesRequest(); + $request = (new StopInstancesRegionInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region) + ->setRegionInstanceGroupManagersStopInstancesRequestResource( + $regionInstanceGroupManagersStopInstancesRequestResource + ); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionInstanceGroupManagersClient->stopInstances( - $instanceGroupManager, - $project, - $region, - $regionInstanceGroupManagersStopInstancesRequestResource - ); + $response = $regionInstanceGroupManagersClient->stopInstances($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionInstanceGroupManagersClient/suspend_instances.php b/Compute/samples/V1/RegionInstanceGroupManagersClient/suspend_instances.php index 39e042de6569..2bdc949ec758 100644 --- a/Compute/samples/V1/RegionInstanceGroupManagersClient/suspend_instances.php +++ b/Compute/samples/V1/RegionInstanceGroupManagersClient/suspend_instances.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_RegionInstanceGroupManagers_SuspendInstances_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\RegionInstanceGroupManagersClient; +use Google\Cloud\Compute\V1\Client\RegionInstanceGroupManagersClient; use Google\Cloud\Compute\V1\RegionInstanceGroupManagersSuspendInstancesRequest; +use Google\Cloud\Compute\V1\SuspendInstancesRegionInstanceGroupManagerRequest; use Google\Rpc\Status; /** @@ -44,18 +45,20 @@ function suspend_instances_sample( // Create a client. $regionInstanceGroupManagersClient = new RegionInstanceGroupManagersClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $regionInstanceGroupManagersSuspendInstancesRequestResource = new RegionInstanceGroupManagersSuspendInstancesRequest(); + $request = (new SuspendInstancesRegionInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region) + ->setRegionInstanceGroupManagersSuspendInstancesRequestResource( + $regionInstanceGroupManagersSuspendInstancesRequestResource + ); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionInstanceGroupManagersClient->suspendInstances( - $instanceGroupManager, - $project, - $region, - $regionInstanceGroupManagersSuspendInstancesRequestResource - ); + $response = $regionInstanceGroupManagersClient->suspendInstances($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionInstanceGroupManagersClient/update_per_instance_configs.php b/Compute/samples/V1/RegionInstanceGroupManagersClient/update_per_instance_configs.php index f4a0719c3e15..8c4903dc3846 100644 --- a/Compute/samples/V1/RegionInstanceGroupManagersClient/update_per_instance_configs.php +++ b/Compute/samples/V1/RegionInstanceGroupManagersClient/update_per_instance_configs.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_RegionInstanceGroupManagers_UpdatePerInstanceConfigs_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\RegionInstanceGroupManagersClient; use Google\Cloud\Compute\V1\RegionInstanceGroupManagerUpdateInstanceConfigReq; -use Google\Cloud\Compute\V1\RegionInstanceGroupManagersClient; +use Google\Cloud\Compute\V1\UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest; use Google\Rpc\Status; /** @@ -44,18 +45,20 @@ function update_per_instance_configs_sample( // Create a client. $regionInstanceGroupManagersClient = new RegionInstanceGroupManagersClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $regionInstanceGroupManagerUpdateInstanceConfigReqResource = new RegionInstanceGroupManagerUpdateInstanceConfigReq(); + $request = (new UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region) + ->setRegionInstanceGroupManagerUpdateInstanceConfigReqResource( + $regionInstanceGroupManagerUpdateInstanceConfigReqResource + ); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionInstanceGroupManagersClient->updatePerInstanceConfigs( - $instanceGroupManager, - $project, - $region, - $regionInstanceGroupManagerUpdateInstanceConfigReqResource - ); + $response = $regionInstanceGroupManagersClient->updatePerInstanceConfigs($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionInstanceGroupsClient/get.php b/Compute/samples/V1/RegionInstanceGroupsClient/get.php index ee31667ea0af..7b4382933b22 100644 --- a/Compute/samples/V1/RegionInstanceGroupsClient/get.php +++ b/Compute/samples/V1/RegionInstanceGroupsClient/get.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_RegionInstanceGroups_Get_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\RegionInstanceGroupsClient; +use Google\Cloud\Compute\V1\GetRegionInstanceGroupRequest; use Google\Cloud\Compute\V1\InstanceGroup; -use Google\Cloud\Compute\V1\RegionInstanceGroupsClient; /** * Returns the specified instance group resource. @@ -39,10 +40,16 @@ function get_sample(string $instanceGroup, string $project, string $region): voi // Create a client. $regionInstanceGroupsClient = new RegionInstanceGroupsClient(); + // Prepare the request message. + $request = (new GetRegionInstanceGroupRequest()) + ->setInstanceGroup($instanceGroup) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var InstanceGroup $response */ - $response = $regionInstanceGroupsClient->get($instanceGroup, $project, $region); + $response = $regionInstanceGroupsClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/RegionInstanceGroupsClient/list.php b/Compute/samples/V1/RegionInstanceGroupsClient/list.php index 8e24f02d9802..109568f18d14 100644 --- a/Compute/samples/V1/RegionInstanceGroupsClient/list.php +++ b/Compute/samples/V1/RegionInstanceGroupsClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_RegionInstanceGroups_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\RegionInstanceGroupsClient; +use Google\Cloud\Compute\V1\Client\RegionInstanceGroupsClient; +use Google\Cloud\Compute\V1\ListRegionInstanceGroupsRequest; /** * Retrieves the list of instance group resources contained within the specified region. @@ -38,10 +39,15 @@ function list_sample(string $project, string $region): void // Create a client. $regionInstanceGroupsClient = new RegionInstanceGroupsClient(); + // Prepare the request message. + $request = (new ListRegionInstanceGroupsRequest()) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $regionInstanceGroupsClient->list($project, $region); + $response = $regionInstanceGroupsClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/RegionInstanceGroupsClient/list_instances.php b/Compute/samples/V1/RegionInstanceGroupsClient/list_instances.php index 73eca4fc5720..bc44edcafbc4 100644 --- a/Compute/samples/V1/RegionInstanceGroupsClient/list_instances.php +++ b/Compute/samples/V1/RegionInstanceGroupsClient/list_instances.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_RegionInstanceGroups_ListInstances_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\RegionInstanceGroupsClient; +use Google\Cloud\Compute\V1\Client\RegionInstanceGroupsClient; +use Google\Cloud\Compute\V1\ListInstancesRegionInstanceGroupsRequest; use Google\Cloud\Compute\V1\RegionInstanceGroupsListInstancesRequest; /** @@ -40,18 +41,20 @@ function list_instances_sample(string $instanceGroup, string $project, string $r // Create a client. $regionInstanceGroupsClient = new RegionInstanceGroupsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $regionInstanceGroupsListInstancesRequestResource = new RegionInstanceGroupsListInstancesRequest(); + $request = (new ListInstancesRegionInstanceGroupsRequest()) + ->setInstanceGroup($instanceGroup) + ->setProject($project) + ->setRegion($region) + ->setRegionInstanceGroupsListInstancesRequestResource( + $regionInstanceGroupsListInstancesRequestResource + ); // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $regionInstanceGroupsClient->listInstances( - $instanceGroup, - $project, - $region, - $regionInstanceGroupsListInstancesRequestResource - ); + $response = $regionInstanceGroupsClient->listInstances($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/RegionInstanceGroupsClient/set_named_ports.php b/Compute/samples/V1/RegionInstanceGroupsClient/set_named_ports.php index f6ee20efee8d..a3750ce9e8d7 100644 --- a/Compute/samples/V1/RegionInstanceGroupsClient/set_named_ports.php +++ b/Compute/samples/V1/RegionInstanceGroupsClient/set_named_ports.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_RegionInstanceGroups_SetNamedPorts_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\RegionInstanceGroupsClient; +use Google\Cloud\Compute\V1\Client\RegionInstanceGroupsClient; use Google\Cloud\Compute\V1\RegionInstanceGroupsSetNamedPortsRequest; +use Google\Cloud\Compute\V1\SetNamedPortsRegionInstanceGroupRequest; use Google\Rpc\Status; /** @@ -41,18 +42,20 @@ function set_named_ports_sample(string $instanceGroup, string $project, string $ // Create a client. $regionInstanceGroupsClient = new RegionInstanceGroupsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $regionInstanceGroupsSetNamedPortsRequestResource = new RegionInstanceGroupsSetNamedPortsRequest(); + $request = (new SetNamedPortsRegionInstanceGroupRequest()) + ->setInstanceGroup($instanceGroup) + ->setProject($project) + ->setRegion($region) + ->setRegionInstanceGroupsSetNamedPortsRequestResource( + $regionInstanceGroupsSetNamedPortsRequestResource + ); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionInstanceGroupsClient->setNamedPorts( - $instanceGroup, - $project, - $region, - $regionInstanceGroupsSetNamedPortsRequestResource - ); + $response = $regionInstanceGroupsClient->setNamedPorts($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionInstanceTemplatesClient/delete.php b/Compute/samples/V1/RegionInstanceTemplatesClient/delete.php index d0e711a17e2a..24c59237ad54 100644 --- a/Compute/samples/V1/RegionInstanceTemplatesClient/delete.php +++ b/Compute/samples/V1/RegionInstanceTemplatesClient/delete.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_RegionInstanceTemplates_Delete_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\RegionInstanceTemplatesClient; +use Google\Cloud\Compute\V1\Client\RegionInstanceTemplatesClient; +use Google\Cloud\Compute\V1\DeleteRegionInstanceTemplateRequest; use Google\Rpc\Status; /** @@ -40,10 +41,16 @@ function delete_sample(string $instanceTemplate, string $project, string $region // Create a client. $regionInstanceTemplatesClient = new RegionInstanceTemplatesClient(); + // Prepare the request message. + $request = (new DeleteRegionInstanceTemplateRequest()) + ->setInstanceTemplate($instanceTemplate) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionInstanceTemplatesClient->delete($instanceTemplate, $project, $region); + $response = $regionInstanceTemplatesClient->delete($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionInstanceTemplatesClient/get.php b/Compute/samples/V1/RegionInstanceTemplatesClient/get.php index 9249dc8b1c99..8af4e0b1ee26 100644 --- a/Compute/samples/V1/RegionInstanceTemplatesClient/get.php +++ b/Compute/samples/V1/RegionInstanceTemplatesClient/get.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_RegionInstanceTemplates_Get_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\RegionInstanceTemplatesClient; +use Google\Cloud\Compute\V1\GetRegionInstanceTemplateRequest; use Google\Cloud\Compute\V1\InstanceTemplate; -use Google\Cloud\Compute\V1\RegionInstanceTemplatesClient; /** * Returns the specified instance template. @@ -39,10 +40,16 @@ function get_sample(string $instanceTemplate, string $project, string $region): // Create a client. $regionInstanceTemplatesClient = new RegionInstanceTemplatesClient(); + // Prepare the request message. + $request = (new GetRegionInstanceTemplateRequest()) + ->setInstanceTemplate($instanceTemplate) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var InstanceTemplate $response */ - $response = $regionInstanceTemplatesClient->get($instanceTemplate, $project, $region); + $response = $regionInstanceTemplatesClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/RegionInstanceTemplatesClient/insert.php b/Compute/samples/V1/RegionInstanceTemplatesClient/insert.php index 89689bc60b62..b56372502ff9 100644 --- a/Compute/samples/V1/RegionInstanceTemplatesClient/insert.php +++ b/Compute/samples/V1/RegionInstanceTemplatesClient/insert.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_RegionInstanceTemplates_Insert_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\RegionInstanceTemplatesClient; +use Google\Cloud\Compute\V1\InsertRegionInstanceTemplateRequest; use Google\Cloud\Compute\V1\InstanceTemplate; -use Google\Cloud\Compute\V1\RegionInstanceTemplatesClient; use Google\Rpc\Status; /** @@ -40,13 +41,17 @@ function insert_sample(string $project, string $region): void // Create a client. $regionInstanceTemplatesClient = new RegionInstanceTemplatesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $instanceTemplateResource = new InstanceTemplate(); + $request = (new InsertRegionInstanceTemplateRequest()) + ->setInstanceTemplateResource($instanceTemplateResource) + ->setProject($project) + ->setRegion($region); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionInstanceTemplatesClient->insert($instanceTemplateResource, $project, $region); + $response = $regionInstanceTemplatesClient->insert($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionInstanceTemplatesClient/list.php b/Compute/samples/V1/RegionInstanceTemplatesClient/list.php index fabb18f166a4..03c1126d25d2 100644 --- a/Compute/samples/V1/RegionInstanceTemplatesClient/list.php +++ b/Compute/samples/V1/RegionInstanceTemplatesClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_RegionInstanceTemplates_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\RegionInstanceTemplatesClient; +use Google\Cloud\Compute\V1\Client\RegionInstanceTemplatesClient; +use Google\Cloud\Compute\V1\ListRegionInstanceTemplatesRequest; /** * Retrieves a list of instance templates that are contained within the specified project and region. @@ -38,10 +39,15 @@ function list_sample(string $project, string $region): void // Create a client. $regionInstanceTemplatesClient = new RegionInstanceTemplatesClient(); + // Prepare the request message. + $request = (new ListRegionInstanceTemplatesRequest()) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $regionInstanceTemplatesClient->list($project, $region); + $response = $regionInstanceTemplatesClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/RegionInstancesClient/bulk_insert.php b/Compute/samples/V1/RegionInstancesClient/bulk_insert.php index 4213ce6eccd2..3cbf15451aa3 100644 --- a/Compute/samples/V1/RegionInstancesClient/bulk_insert.php +++ b/Compute/samples/V1/RegionInstancesClient/bulk_insert.php @@ -26,7 +26,8 @@ use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; use Google\Cloud\Compute\V1\BulkInsertInstanceResource; -use Google\Cloud\Compute\V1\RegionInstancesClient; +use Google\Cloud\Compute\V1\BulkInsertRegionInstanceRequest; +use Google\Cloud\Compute\V1\Client\RegionInstancesClient; use Google\Rpc\Status; /** @@ -40,17 +41,17 @@ function bulk_insert_sample(string $project, string $region): void // Create a client. $regionInstancesClient = new RegionInstancesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $bulkInsertInstanceResourceResource = new BulkInsertInstanceResource(); + $request = (new BulkInsertRegionInstanceRequest()) + ->setBulkInsertInstanceResourceResource($bulkInsertInstanceResourceResource) + ->setProject($project) + ->setRegion($region); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionInstancesClient->bulkInsert( - $bulkInsertInstanceResourceResource, - $project, - $region - ); + $response = $regionInstancesClient->bulkInsert($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionInstantSnapshotsClient/delete.php b/Compute/samples/V1/RegionInstantSnapshotsClient/delete.php index 12de23a26123..3df532007368 100644 --- a/Compute/samples/V1/RegionInstantSnapshotsClient/delete.php +++ b/Compute/samples/V1/RegionInstantSnapshotsClient/delete.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_RegionInstantSnapshots_Delete_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\RegionInstantSnapshotsClient; +use Google\Cloud\Compute\V1\Client\RegionInstantSnapshotsClient; +use Google\Cloud\Compute\V1\DeleteRegionInstantSnapshotRequest; use Google\Rpc\Status; /** @@ -40,10 +41,16 @@ function delete_sample(string $instantSnapshot, string $project, string $region) // Create a client. $regionInstantSnapshotsClient = new RegionInstantSnapshotsClient(); + // Prepare the request message. + $request = (new DeleteRegionInstantSnapshotRequest()) + ->setInstantSnapshot($instantSnapshot) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionInstantSnapshotsClient->delete($instantSnapshot, $project, $region); + $response = $regionInstantSnapshotsClient->delete($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionInstantSnapshotsClient/get.php b/Compute/samples/V1/RegionInstantSnapshotsClient/get.php index 85aae225855c..b77cf67f86ca 100644 --- a/Compute/samples/V1/RegionInstantSnapshotsClient/get.php +++ b/Compute/samples/V1/RegionInstantSnapshotsClient/get.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_RegionInstantSnapshots_Get_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\RegionInstantSnapshotsClient; +use Google\Cloud\Compute\V1\GetRegionInstantSnapshotRequest; use Google\Cloud\Compute\V1\InstantSnapshot; -use Google\Cloud\Compute\V1\RegionInstantSnapshotsClient; /** * Returns the specified InstantSnapshot resource in the specified region. @@ -39,10 +40,16 @@ function get_sample(string $instantSnapshot, string $project, string $region): v // Create a client. $regionInstantSnapshotsClient = new RegionInstantSnapshotsClient(); + // Prepare the request message. + $request = (new GetRegionInstantSnapshotRequest()) + ->setInstantSnapshot($instantSnapshot) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var InstantSnapshot $response */ - $response = $regionInstantSnapshotsClient->get($instantSnapshot, $project, $region); + $response = $regionInstantSnapshotsClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/RegionInstantSnapshotsClient/get_iam_policy.php b/Compute/samples/V1/RegionInstantSnapshotsClient/get_iam_policy.php index 7ddcac8aa434..9c8f1d378f79 100644 --- a/Compute/samples/V1/RegionInstantSnapshotsClient/get_iam_policy.php +++ b/Compute/samples/V1/RegionInstantSnapshotsClient/get_iam_policy.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_RegionInstantSnapshots_GetIamPolicy_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\RegionInstantSnapshotsClient; +use Google\Cloud\Compute\V1\GetIamPolicyRegionInstantSnapshotRequest; use Google\Cloud\Compute\V1\Policy; -use Google\Cloud\Compute\V1\RegionInstantSnapshotsClient; /** * Gets the access control policy for a resource. May be empty if no such policy or resource exists. @@ -39,10 +40,16 @@ function get_iam_policy_sample(string $project, string $region, string $resource // Create a client. $regionInstantSnapshotsClient = new RegionInstantSnapshotsClient(); + // Prepare the request message. + $request = (new GetIamPolicyRegionInstantSnapshotRequest()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource); + // Call the API and handle any network failures. try { /** @var Policy $response */ - $response = $regionInstantSnapshotsClient->getIamPolicy($project, $region, $resource); + $response = $regionInstantSnapshotsClient->getIamPolicy($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/RegionInstantSnapshotsClient/insert.php b/Compute/samples/V1/RegionInstantSnapshotsClient/insert.php index 5ee1e53b5d77..77a3069bbfb1 100644 --- a/Compute/samples/V1/RegionInstantSnapshotsClient/insert.php +++ b/Compute/samples/V1/RegionInstantSnapshotsClient/insert.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_RegionInstantSnapshots_Insert_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\RegionInstantSnapshotsClient; +use Google\Cloud\Compute\V1\InsertRegionInstantSnapshotRequest; use Google\Cloud\Compute\V1\InstantSnapshot; -use Google\Cloud\Compute\V1\RegionInstantSnapshotsClient; use Google\Rpc\Status; /** @@ -40,13 +41,17 @@ function insert_sample(string $project, string $region): void // Create a client. $regionInstantSnapshotsClient = new RegionInstantSnapshotsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $instantSnapshotResource = new InstantSnapshot(); + $request = (new InsertRegionInstantSnapshotRequest()) + ->setInstantSnapshotResource($instantSnapshotResource) + ->setProject($project) + ->setRegion($region); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionInstantSnapshotsClient->insert($instantSnapshotResource, $project, $region); + $response = $regionInstantSnapshotsClient->insert($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionInstantSnapshotsClient/list.php b/Compute/samples/V1/RegionInstantSnapshotsClient/list.php index 925b6f22cd6e..18e6649d2bce 100644 --- a/Compute/samples/V1/RegionInstantSnapshotsClient/list.php +++ b/Compute/samples/V1/RegionInstantSnapshotsClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_RegionInstantSnapshots_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\RegionInstantSnapshotsClient; +use Google\Cloud\Compute\V1\Client\RegionInstantSnapshotsClient; +use Google\Cloud\Compute\V1\ListRegionInstantSnapshotsRequest; /** * Retrieves the list of InstantSnapshot resources contained within the specified region. @@ -38,10 +39,15 @@ function list_sample(string $project, string $region): void // Create a client. $regionInstantSnapshotsClient = new RegionInstantSnapshotsClient(); + // Prepare the request message. + $request = (new ListRegionInstantSnapshotsRequest()) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $regionInstantSnapshotsClient->list($project, $region); + $response = $regionInstantSnapshotsClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/RegionInstantSnapshotsClient/set_iam_policy.php b/Compute/samples/V1/RegionInstantSnapshotsClient/set_iam_policy.php index 96a8dacb4f30..01f1bffa912e 100644 --- a/Compute/samples/V1/RegionInstantSnapshotsClient/set_iam_policy.php +++ b/Compute/samples/V1/RegionInstantSnapshotsClient/set_iam_policy.php @@ -24,9 +24,10 @@ // [START compute_v1_generated_RegionInstantSnapshots_SetIamPolicy_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\RegionInstantSnapshotsClient; use Google\Cloud\Compute\V1\Policy; -use Google\Cloud\Compute\V1\RegionInstantSnapshotsClient; use Google\Cloud\Compute\V1\RegionSetPolicyRequest; +use Google\Cloud\Compute\V1\SetIamPolicyRegionInstantSnapshotRequest; /** * Sets the access control policy on the specified resource. Replaces any existing policy. @@ -40,18 +41,18 @@ function set_iam_policy_sample(string $project, string $region, string $resource // Create a client. $regionInstantSnapshotsClient = new RegionInstantSnapshotsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $regionSetPolicyRequestResource = new RegionSetPolicyRequest(); + $request = (new SetIamPolicyRegionInstantSnapshotRequest()) + ->setProject($project) + ->setRegion($region) + ->setRegionSetPolicyRequestResource($regionSetPolicyRequestResource) + ->setResource($resource); // Call the API and handle any network failures. try { /** @var Policy $response */ - $response = $regionInstantSnapshotsClient->setIamPolicy( - $project, - $region, - $regionSetPolicyRequestResource, - $resource - ); + $response = $regionInstantSnapshotsClient->setIamPolicy($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/RegionInstantSnapshotsClient/set_labels.php b/Compute/samples/V1/RegionInstantSnapshotsClient/set_labels.php index 354be8553632..dd54f5792a0c 100644 --- a/Compute/samples/V1/RegionInstantSnapshotsClient/set_labels.php +++ b/Compute/samples/V1/RegionInstantSnapshotsClient/set_labels.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_RegionInstantSnapshots_SetLabels_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\RegionInstantSnapshotsClient; +use Google\Cloud\Compute\V1\Client\RegionInstantSnapshotsClient; use Google\Cloud\Compute\V1\RegionSetLabelsRequest; +use Google\Cloud\Compute\V1\SetLabelsRegionInstantSnapshotRequest; use Google\Rpc\Status; /** @@ -41,18 +42,18 @@ function set_labels_sample(string $project, string $region, string $resource): v // Create a client. $regionInstantSnapshotsClient = new RegionInstantSnapshotsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $regionSetLabelsRequestResource = new RegionSetLabelsRequest(); + $request = (new SetLabelsRegionInstantSnapshotRequest()) + ->setProject($project) + ->setRegion($region) + ->setRegionSetLabelsRequestResource($regionSetLabelsRequestResource) + ->setResource($resource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionInstantSnapshotsClient->setLabels( - $project, - $region, - $regionSetLabelsRequestResource, - $resource - ); + $response = $regionInstantSnapshotsClient->setLabels($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionInstantSnapshotsClient/test_iam_permissions.php b/Compute/samples/V1/RegionInstantSnapshotsClient/test_iam_permissions.php index 8415996b5e02..c79106699024 100644 --- a/Compute/samples/V1/RegionInstantSnapshotsClient/test_iam_permissions.php +++ b/Compute/samples/V1/RegionInstantSnapshotsClient/test_iam_permissions.php @@ -24,7 +24,8 @@ // [START compute_v1_generated_RegionInstantSnapshots_TestIamPermissions_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\RegionInstantSnapshotsClient; +use Google\Cloud\Compute\V1\Client\RegionInstantSnapshotsClient; +use Google\Cloud\Compute\V1\TestIamPermissionsRegionInstantSnapshotRequest; use Google\Cloud\Compute\V1\TestPermissionsRequest; use Google\Cloud\Compute\V1\TestPermissionsResponse; @@ -40,18 +41,18 @@ function test_iam_permissions_sample(string $project, string $region, string $re // Create a client. $regionInstantSnapshotsClient = new RegionInstantSnapshotsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $testPermissionsRequestResource = new TestPermissionsRequest(); + $request = (new TestIamPermissionsRegionInstantSnapshotRequest()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); // Call the API and handle any network failures. try { /** @var TestPermissionsResponse $response */ - $response = $regionInstantSnapshotsClient->testIamPermissions( - $project, - $region, - $resource, - $testPermissionsRequestResource - ); + $response = $regionInstantSnapshotsClient->testIamPermissions($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/RegionNetworkEndpointGroupsClient/attach_network_endpoints.php b/Compute/samples/V1/RegionNetworkEndpointGroupsClient/attach_network_endpoints.php index 97c2ad750ed2..0d577e5ebf69 100644 --- a/Compute/samples/V1/RegionNetworkEndpointGroupsClient/attach_network_endpoints.php +++ b/Compute/samples/V1/RegionNetworkEndpointGroupsClient/attach_network_endpoints.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_RegionNetworkEndpointGroups_AttachNetworkEndpoints_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\AttachNetworkEndpointsRegionNetworkEndpointGroupRequest; +use Google\Cloud\Compute\V1\Client\RegionNetworkEndpointGroupsClient; use Google\Cloud\Compute\V1\RegionNetworkEndpointGroupsAttachEndpointsRequest; -use Google\Cloud\Compute\V1\RegionNetworkEndpointGroupsClient; use Google\Rpc\Status; /** @@ -44,18 +45,20 @@ function attach_network_endpoints_sample( // Create a client. $regionNetworkEndpointGroupsClient = new RegionNetworkEndpointGroupsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $regionNetworkEndpointGroupsAttachEndpointsRequestResource = new RegionNetworkEndpointGroupsAttachEndpointsRequest(); + $request = (new AttachNetworkEndpointsRegionNetworkEndpointGroupRequest()) + ->setNetworkEndpointGroup($networkEndpointGroup) + ->setProject($project) + ->setRegion($region) + ->setRegionNetworkEndpointGroupsAttachEndpointsRequestResource( + $regionNetworkEndpointGroupsAttachEndpointsRequestResource + ); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionNetworkEndpointGroupsClient->attachNetworkEndpoints( - $networkEndpointGroup, - $project, - $region, - $regionNetworkEndpointGroupsAttachEndpointsRequestResource - ); + $response = $regionNetworkEndpointGroupsClient->attachNetworkEndpoints($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionNetworkEndpointGroupsClient/delete.php b/Compute/samples/V1/RegionNetworkEndpointGroupsClient/delete.php index 12076109a41d..46e4962ab54f 100644 --- a/Compute/samples/V1/RegionNetworkEndpointGroupsClient/delete.php +++ b/Compute/samples/V1/RegionNetworkEndpointGroupsClient/delete.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_RegionNetworkEndpointGroups_Delete_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\RegionNetworkEndpointGroupsClient; +use Google\Cloud\Compute\V1\Client\RegionNetworkEndpointGroupsClient; +use Google\Cloud\Compute\V1\DeleteRegionNetworkEndpointGroupRequest; use Google\Rpc\Status; /** @@ -40,10 +41,16 @@ function delete_sample(string $networkEndpointGroup, string $project, string $re // Create a client. $regionNetworkEndpointGroupsClient = new RegionNetworkEndpointGroupsClient(); + // Prepare the request message. + $request = (new DeleteRegionNetworkEndpointGroupRequest()) + ->setNetworkEndpointGroup($networkEndpointGroup) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionNetworkEndpointGroupsClient->delete($networkEndpointGroup, $project, $region); + $response = $regionNetworkEndpointGroupsClient->delete($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionNetworkEndpointGroupsClient/detach_network_endpoints.php b/Compute/samples/V1/RegionNetworkEndpointGroupsClient/detach_network_endpoints.php index 81d8a8621dde..b9146ea38d75 100644 --- a/Compute/samples/V1/RegionNetworkEndpointGroupsClient/detach_network_endpoints.php +++ b/Compute/samples/V1/RegionNetworkEndpointGroupsClient/detach_network_endpoints.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_RegionNetworkEndpointGroups_DetachNetworkEndpoints_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\RegionNetworkEndpointGroupsClient; +use Google\Cloud\Compute\V1\Client\RegionNetworkEndpointGroupsClient; +use Google\Cloud\Compute\V1\DetachNetworkEndpointsRegionNetworkEndpointGroupRequest; use Google\Cloud\Compute\V1\RegionNetworkEndpointGroupsDetachEndpointsRequest; use Google\Rpc\Status; @@ -44,18 +45,20 @@ function detach_network_endpoints_sample( // Create a client. $regionNetworkEndpointGroupsClient = new RegionNetworkEndpointGroupsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $regionNetworkEndpointGroupsDetachEndpointsRequestResource = new RegionNetworkEndpointGroupsDetachEndpointsRequest(); + $request = (new DetachNetworkEndpointsRegionNetworkEndpointGroupRequest()) + ->setNetworkEndpointGroup($networkEndpointGroup) + ->setProject($project) + ->setRegion($region) + ->setRegionNetworkEndpointGroupsDetachEndpointsRequestResource( + $regionNetworkEndpointGroupsDetachEndpointsRequestResource + ); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionNetworkEndpointGroupsClient->detachNetworkEndpoints( - $networkEndpointGroup, - $project, - $region, - $regionNetworkEndpointGroupsDetachEndpointsRequestResource - ); + $response = $regionNetworkEndpointGroupsClient->detachNetworkEndpoints($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionNetworkEndpointGroupsClient/get.php b/Compute/samples/V1/RegionNetworkEndpointGroupsClient/get.php index 8bcc56c0a513..a21dfcea21fd 100644 --- a/Compute/samples/V1/RegionNetworkEndpointGroupsClient/get.php +++ b/Compute/samples/V1/RegionNetworkEndpointGroupsClient/get.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_RegionNetworkEndpointGroups_Get_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\RegionNetworkEndpointGroupsClient; +use Google\Cloud\Compute\V1\GetRegionNetworkEndpointGroupRequest; use Google\Cloud\Compute\V1\NetworkEndpointGroup; -use Google\Cloud\Compute\V1\RegionNetworkEndpointGroupsClient; /** * Returns the specified network endpoint group. @@ -39,10 +40,16 @@ function get_sample(string $networkEndpointGroup, string $project, string $regio // Create a client. $regionNetworkEndpointGroupsClient = new RegionNetworkEndpointGroupsClient(); + // Prepare the request message. + $request = (new GetRegionNetworkEndpointGroupRequest()) + ->setNetworkEndpointGroup($networkEndpointGroup) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var NetworkEndpointGroup $response */ - $response = $regionNetworkEndpointGroupsClient->get($networkEndpointGroup, $project, $region); + $response = $regionNetworkEndpointGroupsClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/RegionNetworkEndpointGroupsClient/insert.php b/Compute/samples/V1/RegionNetworkEndpointGroupsClient/insert.php index bfa34b677b58..76435f6d517d 100644 --- a/Compute/samples/V1/RegionNetworkEndpointGroupsClient/insert.php +++ b/Compute/samples/V1/RegionNetworkEndpointGroupsClient/insert.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_RegionNetworkEndpointGroups_Insert_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\RegionNetworkEndpointGroupsClient; +use Google\Cloud\Compute\V1\InsertRegionNetworkEndpointGroupRequest; use Google\Cloud\Compute\V1\NetworkEndpointGroup; -use Google\Cloud\Compute\V1\RegionNetworkEndpointGroupsClient; use Google\Rpc\Status; /** @@ -40,17 +41,17 @@ function insert_sample(string $project, string $region): void // Create a client. $regionNetworkEndpointGroupsClient = new RegionNetworkEndpointGroupsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $networkEndpointGroupResource = new NetworkEndpointGroup(); + $request = (new InsertRegionNetworkEndpointGroupRequest()) + ->setNetworkEndpointGroupResource($networkEndpointGroupResource) + ->setProject($project) + ->setRegion($region); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionNetworkEndpointGroupsClient->insert( - $networkEndpointGroupResource, - $project, - $region - ); + $response = $regionNetworkEndpointGroupsClient->insert($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionNetworkEndpointGroupsClient/list.php b/Compute/samples/V1/RegionNetworkEndpointGroupsClient/list.php index 97ee5d4dbab2..7d2bcb14a5de 100644 --- a/Compute/samples/V1/RegionNetworkEndpointGroupsClient/list.php +++ b/Compute/samples/V1/RegionNetworkEndpointGroupsClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_RegionNetworkEndpointGroups_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\RegionNetworkEndpointGroupsClient; +use Google\Cloud\Compute\V1\Client\RegionNetworkEndpointGroupsClient; +use Google\Cloud\Compute\V1\ListRegionNetworkEndpointGroupsRequest; /** * Retrieves the list of regional network endpoint groups available to the specified project in the given region. @@ -38,10 +39,15 @@ function list_sample(string $project, string $region): void // Create a client. $regionNetworkEndpointGroupsClient = new RegionNetworkEndpointGroupsClient(); + // Prepare the request message. + $request = (new ListRegionNetworkEndpointGroupsRequest()) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $regionNetworkEndpointGroupsClient->list($project, $region); + $response = $regionNetworkEndpointGroupsClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/RegionNetworkEndpointGroupsClient/list_network_endpoints.php b/Compute/samples/V1/RegionNetworkEndpointGroupsClient/list_network_endpoints.php index dc9ce7579e03..9281183c28ff 100644 --- a/Compute/samples/V1/RegionNetworkEndpointGroupsClient/list_network_endpoints.php +++ b/Compute/samples/V1/RegionNetworkEndpointGroupsClient/list_network_endpoints.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_RegionNetworkEndpointGroups_ListNetworkEndpoints_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\RegionNetworkEndpointGroupsClient; +use Google\Cloud\Compute\V1\Client\RegionNetworkEndpointGroupsClient; +use Google\Cloud\Compute\V1\ListNetworkEndpointsRegionNetworkEndpointGroupsRequest; /** * Lists the network endpoints in the specified network endpoint group. @@ -42,14 +43,16 @@ function list_network_endpoints_sample( // Create a client. $regionNetworkEndpointGroupsClient = new RegionNetworkEndpointGroupsClient(); + // Prepare the request message. + $request = (new ListNetworkEndpointsRegionNetworkEndpointGroupsRequest()) + ->setNetworkEndpointGroup($networkEndpointGroup) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $regionNetworkEndpointGroupsClient->listNetworkEndpoints( - $networkEndpointGroup, - $project, - $region - ); + $response = $regionNetworkEndpointGroupsClient->listNetworkEndpoints($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/RegionNetworkFirewallPoliciesClient/add_association.php b/Compute/samples/V1/RegionNetworkFirewallPoliciesClient/add_association.php index 1f4e432d3e67..37551b977ddc 100644 --- a/Compute/samples/V1/RegionNetworkFirewallPoliciesClient/add_association.php +++ b/Compute/samples/V1/RegionNetworkFirewallPoliciesClient/add_association.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_RegionNetworkFirewallPolicies_AddAssociation_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\AddAssociationRegionNetworkFirewallPolicyRequest; +use Google\Cloud\Compute\V1\Client\RegionNetworkFirewallPoliciesClient; use Google\Cloud\Compute\V1\FirewallPolicyAssociation; -use Google\Cloud\Compute\V1\RegionNetworkFirewallPoliciesClient; use Google\Rpc\Status; /** @@ -41,18 +42,18 @@ function add_association_sample(string $firewallPolicy, string $project, string // Create a client. $regionNetworkFirewallPoliciesClient = new RegionNetworkFirewallPoliciesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $firewallPolicyAssociationResource = new FirewallPolicyAssociation(); + $request = (new AddAssociationRegionNetworkFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setFirewallPolicyAssociationResource($firewallPolicyAssociationResource) + ->setProject($project) + ->setRegion($region); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionNetworkFirewallPoliciesClient->addAssociation( - $firewallPolicy, - $firewallPolicyAssociationResource, - $project, - $region - ); + $response = $regionNetworkFirewallPoliciesClient->addAssociation($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionNetworkFirewallPoliciesClient/add_rule.php b/Compute/samples/V1/RegionNetworkFirewallPoliciesClient/add_rule.php index 8a959992f10d..5e8053196961 100644 --- a/Compute/samples/V1/RegionNetworkFirewallPoliciesClient/add_rule.php +++ b/Compute/samples/V1/RegionNetworkFirewallPoliciesClient/add_rule.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_RegionNetworkFirewallPolicies_AddRule_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\AddRuleRegionNetworkFirewallPolicyRequest; +use Google\Cloud\Compute\V1\Client\RegionNetworkFirewallPoliciesClient; use Google\Cloud\Compute\V1\FirewallPolicyRule; -use Google\Cloud\Compute\V1\RegionNetworkFirewallPoliciesClient; use Google\Rpc\Status; /** @@ -41,18 +42,18 @@ function add_rule_sample(string $firewallPolicy, string $project, string $region // Create a client. $regionNetworkFirewallPoliciesClient = new RegionNetworkFirewallPoliciesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $firewallPolicyRuleResource = new FirewallPolicyRule(); + $request = (new AddRuleRegionNetworkFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setFirewallPolicyRuleResource($firewallPolicyRuleResource) + ->setProject($project) + ->setRegion($region); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionNetworkFirewallPoliciesClient->addRule( - $firewallPolicy, - $firewallPolicyRuleResource, - $project, - $region - ); + $response = $regionNetworkFirewallPoliciesClient->addRule($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionNetworkFirewallPoliciesClient/clone_rules.php b/Compute/samples/V1/RegionNetworkFirewallPoliciesClient/clone_rules.php index cfb0bc702ab6..7baf8944ec6e 100644 --- a/Compute/samples/V1/RegionNetworkFirewallPoliciesClient/clone_rules.php +++ b/Compute/samples/V1/RegionNetworkFirewallPoliciesClient/clone_rules.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_RegionNetworkFirewallPolicies_CloneRules_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\RegionNetworkFirewallPoliciesClient; +use Google\Cloud\Compute\V1\Client\RegionNetworkFirewallPoliciesClient; +use Google\Cloud\Compute\V1\CloneRulesRegionNetworkFirewallPolicyRequest; use Google\Rpc\Status; /** @@ -40,10 +41,16 @@ function clone_rules_sample(string $firewallPolicy, string $project, string $reg // Create a client. $regionNetworkFirewallPoliciesClient = new RegionNetworkFirewallPoliciesClient(); + // Prepare the request message. + $request = (new CloneRulesRegionNetworkFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionNetworkFirewallPoliciesClient->cloneRules($firewallPolicy, $project, $region); + $response = $regionNetworkFirewallPoliciesClient->cloneRules($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionNetworkFirewallPoliciesClient/delete.php b/Compute/samples/V1/RegionNetworkFirewallPoliciesClient/delete.php index e26ccb9e7b83..e9a2aaf3a3ce 100644 --- a/Compute/samples/V1/RegionNetworkFirewallPoliciesClient/delete.php +++ b/Compute/samples/V1/RegionNetworkFirewallPoliciesClient/delete.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_RegionNetworkFirewallPolicies_Delete_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\RegionNetworkFirewallPoliciesClient; +use Google\Cloud\Compute\V1\Client\RegionNetworkFirewallPoliciesClient; +use Google\Cloud\Compute\V1\DeleteRegionNetworkFirewallPolicyRequest; use Google\Rpc\Status; /** @@ -40,10 +41,16 @@ function delete_sample(string $firewallPolicy, string $project, string $region): // Create a client. $regionNetworkFirewallPoliciesClient = new RegionNetworkFirewallPoliciesClient(); + // Prepare the request message. + $request = (new DeleteRegionNetworkFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionNetworkFirewallPoliciesClient->delete($firewallPolicy, $project, $region); + $response = $regionNetworkFirewallPoliciesClient->delete($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionNetworkFirewallPoliciesClient/get.php b/Compute/samples/V1/RegionNetworkFirewallPoliciesClient/get.php index 9f1e83f88703..25cf5a04b631 100644 --- a/Compute/samples/V1/RegionNetworkFirewallPoliciesClient/get.php +++ b/Compute/samples/V1/RegionNetworkFirewallPoliciesClient/get.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_RegionNetworkFirewallPolicies_Get_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\RegionNetworkFirewallPoliciesClient; use Google\Cloud\Compute\V1\FirewallPolicy; -use Google\Cloud\Compute\V1\RegionNetworkFirewallPoliciesClient; +use Google\Cloud\Compute\V1\GetRegionNetworkFirewallPolicyRequest; /** * Returns the specified network firewall policy. @@ -39,10 +40,16 @@ function get_sample(string $firewallPolicy, string $project, string $region): vo // Create a client. $regionNetworkFirewallPoliciesClient = new RegionNetworkFirewallPoliciesClient(); + // Prepare the request message. + $request = (new GetRegionNetworkFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var FirewallPolicy $response */ - $response = $regionNetworkFirewallPoliciesClient->get($firewallPolicy, $project, $region); + $response = $regionNetworkFirewallPoliciesClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/RegionNetworkFirewallPoliciesClient/get_association.php b/Compute/samples/V1/RegionNetworkFirewallPoliciesClient/get_association.php index 8878eb1c5b01..063f87fb43a3 100644 --- a/Compute/samples/V1/RegionNetworkFirewallPoliciesClient/get_association.php +++ b/Compute/samples/V1/RegionNetworkFirewallPoliciesClient/get_association.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_RegionNetworkFirewallPolicies_GetAssociation_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\RegionNetworkFirewallPoliciesClient; use Google\Cloud\Compute\V1\FirewallPolicyAssociation; -use Google\Cloud\Compute\V1\RegionNetworkFirewallPoliciesClient; +use Google\Cloud\Compute\V1\GetAssociationRegionNetworkFirewallPolicyRequest; /** * Gets an association with the specified name. @@ -39,14 +40,16 @@ function get_association_sample(string $firewallPolicy, string $project, string // Create a client. $regionNetworkFirewallPoliciesClient = new RegionNetworkFirewallPoliciesClient(); + // Prepare the request message. + $request = (new GetAssociationRegionNetworkFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var FirewallPolicyAssociation $response */ - $response = $regionNetworkFirewallPoliciesClient->getAssociation( - $firewallPolicy, - $project, - $region - ); + $response = $regionNetworkFirewallPoliciesClient->getAssociation($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/RegionNetworkFirewallPoliciesClient/get_effective_firewalls.php b/Compute/samples/V1/RegionNetworkFirewallPoliciesClient/get_effective_firewalls.php index 132b86768cc7..be878c58c48a 100644 --- a/Compute/samples/V1/RegionNetworkFirewallPoliciesClient/get_effective_firewalls.php +++ b/Compute/samples/V1/RegionNetworkFirewallPoliciesClient/get_effective_firewalls.php @@ -24,7 +24,8 @@ // [START compute_v1_generated_RegionNetworkFirewallPolicies_GetEffectiveFirewalls_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\RegionNetworkFirewallPoliciesClient; +use Google\Cloud\Compute\V1\Client\RegionNetworkFirewallPoliciesClient; +use Google\Cloud\Compute\V1\GetEffectiveFirewallsRegionNetworkFirewallPolicyRequest; use Google\Cloud\Compute\V1\RegionNetworkFirewallPoliciesGetEffectiveFirewallsResponse; /** @@ -39,14 +40,16 @@ function get_effective_firewalls_sample(string $network, string $project, string // Create a client. $regionNetworkFirewallPoliciesClient = new RegionNetworkFirewallPoliciesClient(); + // Prepare the request message. + $request = (new GetEffectiveFirewallsRegionNetworkFirewallPolicyRequest()) + ->setNetwork($network) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var RegionNetworkFirewallPoliciesGetEffectiveFirewallsResponse $response */ - $response = $regionNetworkFirewallPoliciesClient->getEffectiveFirewalls( - $network, - $project, - $region - ); + $response = $regionNetworkFirewallPoliciesClient->getEffectiveFirewalls($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/RegionNetworkFirewallPoliciesClient/get_iam_policy.php b/Compute/samples/V1/RegionNetworkFirewallPoliciesClient/get_iam_policy.php index 20b432a302a8..67a83d037b01 100644 --- a/Compute/samples/V1/RegionNetworkFirewallPoliciesClient/get_iam_policy.php +++ b/Compute/samples/V1/RegionNetworkFirewallPoliciesClient/get_iam_policy.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_RegionNetworkFirewallPolicies_GetIamPolicy_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\RegionNetworkFirewallPoliciesClient; +use Google\Cloud\Compute\V1\GetIamPolicyRegionNetworkFirewallPolicyRequest; use Google\Cloud\Compute\V1\Policy; -use Google\Cloud\Compute\V1\RegionNetworkFirewallPoliciesClient; /** * Gets the access control policy for a resource. May be empty if no such policy or resource exists. @@ -39,10 +40,16 @@ function get_iam_policy_sample(string $project, string $region, string $resource // Create a client. $regionNetworkFirewallPoliciesClient = new RegionNetworkFirewallPoliciesClient(); + // Prepare the request message. + $request = (new GetIamPolicyRegionNetworkFirewallPolicyRequest()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource); + // Call the API and handle any network failures. try { /** @var Policy $response */ - $response = $regionNetworkFirewallPoliciesClient->getIamPolicy($project, $region, $resource); + $response = $regionNetworkFirewallPoliciesClient->getIamPolicy($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/RegionNetworkFirewallPoliciesClient/get_rule.php b/Compute/samples/V1/RegionNetworkFirewallPoliciesClient/get_rule.php index 9855a6a2dde7..9720da17d63f 100644 --- a/Compute/samples/V1/RegionNetworkFirewallPoliciesClient/get_rule.php +++ b/Compute/samples/V1/RegionNetworkFirewallPoliciesClient/get_rule.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_RegionNetworkFirewallPolicies_GetRule_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\RegionNetworkFirewallPoliciesClient; use Google\Cloud\Compute\V1\FirewallPolicyRule; -use Google\Cloud\Compute\V1\RegionNetworkFirewallPoliciesClient; +use Google\Cloud\Compute\V1\GetRuleRegionNetworkFirewallPolicyRequest; /** * Gets a rule of the specified priority. @@ -39,10 +40,16 @@ function get_rule_sample(string $firewallPolicy, string $project, string $region // Create a client. $regionNetworkFirewallPoliciesClient = new RegionNetworkFirewallPoliciesClient(); + // Prepare the request message. + $request = (new GetRuleRegionNetworkFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var FirewallPolicyRule $response */ - $response = $regionNetworkFirewallPoliciesClient->getRule($firewallPolicy, $project, $region); + $response = $regionNetworkFirewallPoliciesClient->getRule($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/RegionNetworkFirewallPoliciesClient/insert.php b/Compute/samples/V1/RegionNetworkFirewallPoliciesClient/insert.php index 780072b8a431..2edc252bd400 100644 --- a/Compute/samples/V1/RegionNetworkFirewallPoliciesClient/insert.php +++ b/Compute/samples/V1/RegionNetworkFirewallPoliciesClient/insert.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_RegionNetworkFirewallPolicies_Insert_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\RegionNetworkFirewallPoliciesClient; use Google\Cloud\Compute\V1\FirewallPolicy; -use Google\Cloud\Compute\V1\RegionNetworkFirewallPoliciesClient; +use Google\Cloud\Compute\V1\InsertRegionNetworkFirewallPolicyRequest; use Google\Rpc\Status; /** @@ -40,17 +41,17 @@ function insert_sample(string $project, string $region): void // Create a client. $regionNetworkFirewallPoliciesClient = new RegionNetworkFirewallPoliciesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $firewallPolicyResource = new FirewallPolicy(); + $request = (new InsertRegionNetworkFirewallPolicyRequest()) + ->setFirewallPolicyResource($firewallPolicyResource) + ->setProject($project) + ->setRegion($region); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionNetworkFirewallPoliciesClient->insert( - $firewallPolicyResource, - $project, - $region - ); + $response = $regionNetworkFirewallPoliciesClient->insert($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionNetworkFirewallPoliciesClient/list.php b/Compute/samples/V1/RegionNetworkFirewallPoliciesClient/list.php index e94cb553e372..f4b01150162f 100644 --- a/Compute/samples/V1/RegionNetworkFirewallPoliciesClient/list.php +++ b/Compute/samples/V1/RegionNetworkFirewallPoliciesClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_RegionNetworkFirewallPolicies_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\RegionNetworkFirewallPoliciesClient; +use Google\Cloud\Compute\V1\Client\RegionNetworkFirewallPoliciesClient; +use Google\Cloud\Compute\V1\ListRegionNetworkFirewallPoliciesRequest; /** * Lists all the network firewall policies that have been configured for the specified project in the given region. @@ -38,10 +39,15 @@ function list_sample(string $project, string $region): void // Create a client. $regionNetworkFirewallPoliciesClient = new RegionNetworkFirewallPoliciesClient(); + // Prepare the request message. + $request = (new ListRegionNetworkFirewallPoliciesRequest()) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $regionNetworkFirewallPoliciesClient->list($project, $region); + $response = $regionNetworkFirewallPoliciesClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/RegionNetworkFirewallPoliciesClient/patch.php b/Compute/samples/V1/RegionNetworkFirewallPoliciesClient/patch.php index d6bb1f8269da..720363743b1f 100644 --- a/Compute/samples/V1/RegionNetworkFirewallPoliciesClient/patch.php +++ b/Compute/samples/V1/RegionNetworkFirewallPoliciesClient/patch.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_RegionNetworkFirewallPolicies_Patch_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\RegionNetworkFirewallPoliciesClient; use Google\Cloud\Compute\V1\FirewallPolicy; -use Google\Cloud\Compute\V1\RegionNetworkFirewallPoliciesClient; +use Google\Cloud\Compute\V1\PatchRegionNetworkFirewallPolicyRequest; use Google\Rpc\Status; /** @@ -41,18 +42,18 @@ function patch_sample(string $firewallPolicy, string $project, string $region): // Create a client. $regionNetworkFirewallPoliciesClient = new RegionNetworkFirewallPoliciesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $firewallPolicyResource = new FirewallPolicy(); + $request = (new PatchRegionNetworkFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setFirewallPolicyResource($firewallPolicyResource) + ->setProject($project) + ->setRegion($region); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionNetworkFirewallPoliciesClient->patch( - $firewallPolicy, - $firewallPolicyResource, - $project, - $region - ); + $response = $regionNetworkFirewallPoliciesClient->patch($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionNetworkFirewallPoliciesClient/patch_rule.php b/Compute/samples/V1/RegionNetworkFirewallPoliciesClient/patch_rule.php index c3df0b4a5996..86d12b3c26eb 100644 --- a/Compute/samples/V1/RegionNetworkFirewallPoliciesClient/patch_rule.php +++ b/Compute/samples/V1/RegionNetworkFirewallPoliciesClient/patch_rule.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_RegionNetworkFirewallPolicies_PatchRule_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\RegionNetworkFirewallPoliciesClient; use Google\Cloud\Compute\V1\FirewallPolicyRule; -use Google\Cloud\Compute\V1\RegionNetworkFirewallPoliciesClient; +use Google\Cloud\Compute\V1\PatchRuleRegionNetworkFirewallPolicyRequest; use Google\Rpc\Status; /** @@ -41,18 +42,18 @@ function patch_rule_sample(string $firewallPolicy, string $project, string $regi // Create a client. $regionNetworkFirewallPoliciesClient = new RegionNetworkFirewallPoliciesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $firewallPolicyRuleResource = new FirewallPolicyRule(); + $request = (new PatchRuleRegionNetworkFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setFirewallPolicyRuleResource($firewallPolicyRuleResource) + ->setProject($project) + ->setRegion($region); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionNetworkFirewallPoliciesClient->patchRule( - $firewallPolicy, - $firewallPolicyRuleResource, - $project, - $region - ); + $response = $regionNetworkFirewallPoliciesClient->patchRule($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionNetworkFirewallPoliciesClient/remove_association.php b/Compute/samples/V1/RegionNetworkFirewallPoliciesClient/remove_association.php index 613d5571cf9e..fa18c007fe98 100644 --- a/Compute/samples/V1/RegionNetworkFirewallPoliciesClient/remove_association.php +++ b/Compute/samples/V1/RegionNetworkFirewallPoliciesClient/remove_association.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_RegionNetworkFirewallPolicies_RemoveAssociation_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\RegionNetworkFirewallPoliciesClient; +use Google\Cloud\Compute\V1\Client\RegionNetworkFirewallPoliciesClient; +use Google\Cloud\Compute\V1\RemoveAssociationRegionNetworkFirewallPolicyRequest; use Google\Rpc\Status; /** @@ -40,14 +41,16 @@ function remove_association_sample(string $firewallPolicy, string $project, stri // Create a client. $regionNetworkFirewallPoliciesClient = new RegionNetworkFirewallPoliciesClient(); + // Prepare the request message. + $request = (new RemoveAssociationRegionNetworkFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionNetworkFirewallPoliciesClient->removeAssociation( - $firewallPolicy, - $project, - $region - ); + $response = $regionNetworkFirewallPoliciesClient->removeAssociation($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionNetworkFirewallPoliciesClient/remove_rule.php b/Compute/samples/V1/RegionNetworkFirewallPoliciesClient/remove_rule.php index 185157472672..66b68df888e3 100644 --- a/Compute/samples/V1/RegionNetworkFirewallPoliciesClient/remove_rule.php +++ b/Compute/samples/V1/RegionNetworkFirewallPoliciesClient/remove_rule.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_RegionNetworkFirewallPolicies_RemoveRule_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\RegionNetworkFirewallPoliciesClient; +use Google\Cloud\Compute\V1\Client\RegionNetworkFirewallPoliciesClient; +use Google\Cloud\Compute\V1\RemoveRuleRegionNetworkFirewallPolicyRequest; use Google\Rpc\Status; /** @@ -40,10 +41,16 @@ function remove_rule_sample(string $firewallPolicy, string $project, string $reg // Create a client. $regionNetworkFirewallPoliciesClient = new RegionNetworkFirewallPoliciesClient(); + // Prepare the request message. + $request = (new RemoveRuleRegionNetworkFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionNetworkFirewallPoliciesClient->removeRule($firewallPolicy, $project, $region); + $response = $regionNetworkFirewallPoliciesClient->removeRule($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionNetworkFirewallPoliciesClient/set_iam_policy.php b/Compute/samples/V1/RegionNetworkFirewallPoliciesClient/set_iam_policy.php index 98ef22e1eefe..285b7c2c9c2a 100644 --- a/Compute/samples/V1/RegionNetworkFirewallPoliciesClient/set_iam_policy.php +++ b/Compute/samples/V1/RegionNetworkFirewallPoliciesClient/set_iam_policy.php @@ -24,9 +24,10 @@ // [START compute_v1_generated_RegionNetworkFirewallPolicies_SetIamPolicy_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\RegionNetworkFirewallPoliciesClient; use Google\Cloud\Compute\V1\Policy; -use Google\Cloud\Compute\V1\RegionNetworkFirewallPoliciesClient; use Google\Cloud\Compute\V1\RegionSetPolicyRequest; +use Google\Cloud\Compute\V1\SetIamPolicyRegionNetworkFirewallPolicyRequest; /** * Sets the access control policy on the specified resource. Replaces any existing policy. @@ -40,18 +41,18 @@ function set_iam_policy_sample(string $project, string $region, string $resource // Create a client. $regionNetworkFirewallPoliciesClient = new RegionNetworkFirewallPoliciesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $regionSetPolicyRequestResource = new RegionSetPolicyRequest(); + $request = (new SetIamPolicyRegionNetworkFirewallPolicyRequest()) + ->setProject($project) + ->setRegion($region) + ->setRegionSetPolicyRequestResource($regionSetPolicyRequestResource) + ->setResource($resource); // Call the API and handle any network failures. try { /** @var Policy $response */ - $response = $regionNetworkFirewallPoliciesClient->setIamPolicy( - $project, - $region, - $regionSetPolicyRequestResource, - $resource - ); + $response = $regionNetworkFirewallPoliciesClient->setIamPolicy($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/RegionNetworkFirewallPoliciesClient/test_iam_permissions.php b/Compute/samples/V1/RegionNetworkFirewallPoliciesClient/test_iam_permissions.php index 454efbd88c03..7a217137cd6e 100644 --- a/Compute/samples/V1/RegionNetworkFirewallPoliciesClient/test_iam_permissions.php +++ b/Compute/samples/V1/RegionNetworkFirewallPoliciesClient/test_iam_permissions.php @@ -24,7 +24,8 @@ // [START compute_v1_generated_RegionNetworkFirewallPolicies_TestIamPermissions_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\RegionNetworkFirewallPoliciesClient; +use Google\Cloud\Compute\V1\Client\RegionNetworkFirewallPoliciesClient; +use Google\Cloud\Compute\V1\TestIamPermissionsRegionNetworkFirewallPolicyRequest; use Google\Cloud\Compute\V1\TestPermissionsRequest; use Google\Cloud\Compute\V1\TestPermissionsResponse; @@ -40,18 +41,18 @@ function test_iam_permissions_sample(string $project, string $region, string $re // Create a client. $regionNetworkFirewallPoliciesClient = new RegionNetworkFirewallPoliciesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $testPermissionsRequestResource = new TestPermissionsRequest(); + $request = (new TestIamPermissionsRegionNetworkFirewallPolicyRequest()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); // Call the API and handle any network failures. try { /** @var TestPermissionsResponse $response */ - $response = $regionNetworkFirewallPoliciesClient->testIamPermissions( - $project, - $region, - $resource, - $testPermissionsRequestResource - ); + $response = $regionNetworkFirewallPoliciesClient->testIamPermissions($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/RegionNotificationEndpointsClient/delete.php b/Compute/samples/V1/RegionNotificationEndpointsClient/delete.php index 722f79a1d936..934942d051dc 100644 --- a/Compute/samples/V1/RegionNotificationEndpointsClient/delete.php +++ b/Compute/samples/V1/RegionNotificationEndpointsClient/delete.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_RegionNotificationEndpoints_Delete_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\RegionNotificationEndpointsClient; +use Google\Cloud\Compute\V1\Client\RegionNotificationEndpointsClient; +use Google\Cloud\Compute\V1\DeleteRegionNotificationEndpointRequest; use Google\Rpc\Status; /** @@ -40,10 +41,16 @@ function delete_sample(string $notificationEndpoint, string $project, string $re // Create a client. $regionNotificationEndpointsClient = new RegionNotificationEndpointsClient(); + // Prepare the request message. + $request = (new DeleteRegionNotificationEndpointRequest()) + ->setNotificationEndpoint($notificationEndpoint) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionNotificationEndpointsClient->delete($notificationEndpoint, $project, $region); + $response = $regionNotificationEndpointsClient->delete($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionNotificationEndpointsClient/get.php b/Compute/samples/V1/RegionNotificationEndpointsClient/get.php index df8d148b7c1b..227949c0a2e3 100644 --- a/Compute/samples/V1/RegionNotificationEndpointsClient/get.php +++ b/Compute/samples/V1/RegionNotificationEndpointsClient/get.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_RegionNotificationEndpoints_Get_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\RegionNotificationEndpointsClient; +use Google\Cloud\Compute\V1\GetRegionNotificationEndpointRequest; use Google\Cloud\Compute\V1\NotificationEndpoint; -use Google\Cloud\Compute\V1\RegionNotificationEndpointsClient; /** * Returns the specified NotificationEndpoint resource in the given region. @@ -39,10 +40,16 @@ function get_sample(string $notificationEndpoint, string $project, string $regio // Create a client. $regionNotificationEndpointsClient = new RegionNotificationEndpointsClient(); + // Prepare the request message. + $request = (new GetRegionNotificationEndpointRequest()) + ->setNotificationEndpoint($notificationEndpoint) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var NotificationEndpoint $response */ - $response = $regionNotificationEndpointsClient->get($notificationEndpoint, $project, $region); + $response = $regionNotificationEndpointsClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/RegionNotificationEndpointsClient/insert.php b/Compute/samples/V1/RegionNotificationEndpointsClient/insert.php index ffc838ff90b1..fe55d860502a 100644 --- a/Compute/samples/V1/RegionNotificationEndpointsClient/insert.php +++ b/Compute/samples/V1/RegionNotificationEndpointsClient/insert.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_RegionNotificationEndpoints_Insert_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\RegionNotificationEndpointsClient; +use Google\Cloud\Compute\V1\InsertRegionNotificationEndpointRequest; use Google\Cloud\Compute\V1\NotificationEndpoint; -use Google\Cloud\Compute\V1\RegionNotificationEndpointsClient; use Google\Rpc\Status; /** @@ -40,17 +41,17 @@ function insert_sample(string $project, string $region): void // Create a client. $regionNotificationEndpointsClient = new RegionNotificationEndpointsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $notificationEndpointResource = new NotificationEndpoint(); + $request = (new InsertRegionNotificationEndpointRequest()) + ->setNotificationEndpointResource($notificationEndpointResource) + ->setProject($project) + ->setRegion($region); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionNotificationEndpointsClient->insert( - $notificationEndpointResource, - $project, - $region - ); + $response = $regionNotificationEndpointsClient->insert($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionNotificationEndpointsClient/list.php b/Compute/samples/V1/RegionNotificationEndpointsClient/list.php index dfdaa1c6b1f8..c0f1d46f5c08 100644 --- a/Compute/samples/V1/RegionNotificationEndpointsClient/list.php +++ b/Compute/samples/V1/RegionNotificationEndpointsClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_RegionNotificationEndpoints_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\RegionNotificationEndpointsClient; +use Google\Cloud\Compute\V1\Client\RegionNotificationEndpointsClient; +use Google\Cloud\Compute\V1\ListRegionNotificationEndpointsRequest; /** * Lists the NotificationEndpoints for a project in the given region. @@ -38,10 +39,15 @@ function list_sample(string $project, string $region): void // Create a client. $regionNotificationEndpointsClient = new RegionNotificationEndpointsClient(); + // Prepare the request message. + $request = (new ListRegionNotificationEndpointsRequest()) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $regionNotificationEndpointsClient->list($project, $region); + $response = $regionNotificationEndpointsClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/RegionOperationsClient/delete.php b/Compute/samples/V1/RegionOperationsClient/delete.php index e0f85d05834e..2f1c1e43dd5e 100644 --- a/Compute/samples/V1/RegionOperationsClient/delete.php +++ b/Compute/samples/V1/RegionOperationsClient/delete.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_RegionOperations_Delete_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\RegionOperationsClient; +use Google\Cloud\Compute\V1\DeleteRegionOperationRequest; use Google\Cloud\Compute\V1\DeleteRegionOperationResponse; -use Google\Cloud\Compute\V1\RegionOperationsClient; /** * Deletes the specified region-specific Operations resource. @@ -39,10 +40,16 @@ function delete_sample(string $operation, string $project, string $region): void // Create a client. $regionOperationsClient = new RegionOperationsClient(); + // Prepare the request message. + $request = (new DeleteRegionOperationRequest()) + ->setOperation($operation) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var DeleteRegionOperationResponse $response */ - $response = $regionOperationsClient->delete($operation, $project, $region); + $response = $regionOperationsClient->delete($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/RegionOperationsClient/get.php b/Compute/samples/V1/RegionOperationsClient/get.php index 3b858fedc40b..b202f68380b4 100644 --- a/Compute/samples/V1/RegionOperationsClient/get.php +++ b/Compute/samples/V1/RegionOperationsClient/get.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_RegionOperations_Get_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\RegionOperationsClient; +use Google\Cloud\Compute\V1\GetRegionOperationRequest; use Google\Cloud\Compute\V1\Operation; -use Google\Cloud\Compute\V1\RegionOperationsClient; /** * Retrieves the specified region-specific Operations resource. @@ -39,10 +40,16 @@ function get_sample(string $operation, string $project, string $region): void // Create a client. $regionOperationsClient = new RegionOperationsClient(); + // Prepare the request message. + $request = (new GetRegionOperationRequest()) + ->setOperation($operation) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var Operation $response */ - $response = $regionOperationsClient->get($operation, $project, $region); + $response = $regionOperationsClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/RegionOperationsClient/list.php b/Compute/samples/V1/RegionOperationsClient/list.php index 73b2b49008e4..fbae8276336d 100644 --- a/Compute/samples/V1/RegionOperationsClient/list.php +++ b/Compute/samples/V1/RegionOperationsClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_RegionOperations_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\RegionOperationsClient; +use Google\Cloud\Compute\V1\Client\RegionOperationsClient; +use Google\Cloud\Compute\V1\ListRegionOperationsRequest; /** * Retrieves a list of Operation resources contained within the specified region. @@ -38,10 +39,15 @@ function list_sample(string $project, string $region): void // Create a client. $regionOperationsClient = new RegionOperationsClient(); + // Prepare the request message. + $request = (new ListRegionOperationsRequest()) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $regionOperationsClient->list($project, $region); + $response = $regionOperationsClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/RegionOperationsClient/wait.php b/Compute/samples/V1/RegionOperationsClient/wait.php index 219c32e75e79..5c7d6dfb578f 100644 --- a/Compute/samples/V1/RegionOperationsClient/wait.php +++ b/Compute/samples/V1/RegionOperationsClient/wait.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_RegionOperations_Wait_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\RegionOperationsClient; use Google\Cloud\Compute\V1\Operation; -use Google\Cloud\Compute\V1\RegionOperationsClient; +use Google\Cloud\Compute\V1\WaitRegionOperationRequest; /** * Waits for the specified Operation resource to return as `DONE` or for the request to approach the 2 minute deadline, and retrieves the specified Operation resource. This method differs from the `GET` method in that it waits for no more than the default deadline (2 minutes) and then returns the current state of the operation, which might be `DONE` or still in progress. This method is called on a best-effort basis. Specifically: - In uncommon cases, when the server is overloaded, the request might return before the default deadline is reached, or might return after zero seconds. - If the default deadline is reached, there is no guarantee that the operation is actually done when the method returns. Be prepared to retry if the operation is not `DONE`. @@ -39,10 +40,16 @@ function wait_sample(string $operation, string $project, string $region): void // Create a client. $regionOperationsClient = new RegionOperationsClient(); + // Prepare the request message. + $request = (new WaitRegionOperationRequest()) + ->setOperation($operation) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var Operation $response */ - $response = $regionOperationsClient->wait($operation, $project, $region); + $response = $regionOperationsClient->wait($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/RegionSecurityPoliciesClient/add_rule.php b/Compute/samples/V1/RegionSecurityPoliciesClient/add_rule.php index 8d96ca6a56bf..20c6945286be 100644 --- a/Compute/samples/V1/RegionSecurityPoliciesClient/add_rule.php +++ b/Compute/samples/V1/RegionSecurityPoliciesClient/add_rule.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_RegionSecurityPolicies_AddRule_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\RegionSecurityPoliciesClient; +use Google\Cloud\Compute\V1\AddRuleRegionSecurityPolicyRequest; +use Google\Cloud\Compute\V1\Client\RegionSecurityPoliciesClient; use Google\Cloud\Compute\V1\SecurityPolicyRule; use Google\Rpc\Status; @@ -41,18 +42,18 @@ function add_rule_sample(string $project, string $region, string $securityPolicy // Create a client. $regionSecurityPoliciesClient = new RegionSecurityPoliciesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $securityPolicyRuleResource = new SecurityPolicyRule(); + $request = (new AddRuleRegionSecurityPolicyRequest()) + ->setProject($project) + ->setRegion($region) + ->setSecurityPolicy($securityPolicy) + ->setSecurityPolicyRuleResource($securityPolicyRuleResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionSecurityPoliciesClient->addRule( - $project, - $region, - $securityPolicy, - $securityPolicyRuleResource - ); + $response = $regionSecurityPoliciesClient->addRule($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionSecurityPoliciesClient/delete.php b/Compute/samples/V1/RegionSecurityPoliciesClient/delete.php index a2bdd1786b56..487a01ac0ed9 100644 --- a/Compute/samples/V1/RegionSecurityPoliciesClient/delete.php +++ b/Compute/samples/V1/RegionSecurityPoliciesClient/delete.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_RegionSecurityPolicies_Delete_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\RegionSecurityPoliciesClient; +use Google\Cloud\Compute\V1\Client\RegionSecurityPoliciesClient; +use Google\Cloud\Compute\V1\DeleteRegionSecurityPolicyRequest; use Google\Rpc\Status; /** @@ -40,10 +41,16 @@ function delete_sample(string $project, string $region, string $securityPolicy): // Create a client. $regionSecurityPoliciesClient = new RegionSecurityPoliciesClient(); + // Prepare the request message. + $request = (new DeleteRegionSecurityPolicyRequest()) + ->setProject($project) + ->setRegion($region) + ->setSecurityPolicy($securityPolicy); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionSecurityPoliciesClient->delete($project, $region, $securityPolicy); + $response = $regionSecurityPoliciesClient->delete($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionSecurityPoliciesClient/get.php b/Compute/samples/V1/RegionSecurityPoliciesClient/get.php index 74c09dfd74cc..f280bffbefaf 100644 --- a/Compute/samples/V1/RegionSecurityPoliciesClient/get.php +++ b/Compute/samples/V1/RegionSecurityPoliciesClient/get.php @@ -24,7 +24,8 @@ // [START compute_v1_generated_RegionSecurityPolicies_Get_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\RegionSecurityPoliciesClient; +use Google\Cloud\Compute\V1\Client\RegionSecurityPoliciesClient; +use Google\Cloud\Compute\V1\GetRegionSecurityPolicyRequest; use Google\Cloud\Compute\V1\SecurityPolicy; /** @@ -39,10 +40,16 @@ function get_sample(string $project, string $region, string $securityPolicy): vo // Create a client. $regionSecurityPoliciesClient = new RegionSecurityPoliciesClient(); + // Prepare the request message. + $request = (new GetRegionSecurityPolicyRequest()) + ->setProject($project) + ->setRegion($region) + ->setSecurityPolicy($securityPolicy); + // Call the API and handle any network failures. try { /** @var SecurityPolicy $response */ - $response = $regionSecurityPoliciesClient->get($project, $region, $securityPolicy); + $response = $regionSecurityPoliciesClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/RegionSecurityPoliciesClient/get_rule.php b/Compute/samples/V1/RegionSecurityPoliciesClient/get_rule.php index f1b6695eb9ac..6804843ee8e6 100644 --- a/Compute/samples/V1/RegionSecurityPoliciesClient/get_rule.php +++ b/Compute/samples/V1/RegionSecurityPoliciesClient/get_rule.php @@ -24,7 +24,8 @@ // [START compute_v1_generated_RegionSecurityPolicies_GetRule_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\RegionSecurityPoliciesClient; +use Google\Cloud\Compute\V1\Client\RegionSecurityPoliciesClient; +use Google\Cloud\Compute\V1\GetRuleRegionSecurityPolicyRequest; use Google\Cloud\Compute\V1\SecurityPolicyRule; /** @@ -39,10 +40,16 @@ function get_rule_sample(string $project, string $region, string $securityPolicy // Create a client. $regionSecurityPoliciesClient = new RegionSecurityPoliciesClient(); + // Prepare the request message. + $request = (new GetRuleRegionSecurityPolicyRequest()) + ->setProject($project) + ->setRegion($region) + ->setSecurityPolicy($securityPolicy); + // Call the API and handle any network failures. try { /** @var SecurityPolicyRule $response */ - $response = $regionSecurityPoliciesClient->getRule($project, $region, $securityPolicy); + $response = $regionSecurityPoliciesClient->getRule($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/RegionSecurityPoliciesClient/insert.php b/Compute/samples/V1/RegionSecurityPoliciesClient/insert.php index 60656b987b6f..403666bea646 100644 --- a/Compute/samples/V1/RegionSecurityPoliciesClient/insert.php +++ b/Compute/samples/V1/RegionSecurityPoliciesClient/insert.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_RegionSecurityPolicies_Insert_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\RegionSecurityPoliciesClient; +use Google\Cloud\Compute\V1\Client\RegionSecurityPoliciesClient; +use Google\Cloud\Compute\V1\InsertRegionSecurityPolicyRequest; use Google\Cloud\Compute\V1\SecurityPolicy; use Google\Rpc\Status; @@ -40,13 +41,17 @@ function insert_sample(string $project, string $region): void // Create a client. $regionSecurityPoliciesClient = new RegionSecurityPoliciesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $securityPolicyResource = new SecurityPolicy(); + $request = (new InsertRegionSecurityPolicyRequest()) + ->setProject($project) + ->setRegion($region) + ->setSecurityPolicyResource($securityPolicyResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionSecurityPoliciesClient->insert($project, $region, $securityPolicyResource); + $response = $regionSecurityPoliciesClient->insert($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionSecurityPoliciesClient/list.php b/Compute/samples/V1/RegionSecurityPoliciesClient/list.php index a9c2b46312da..930d7def45e9 100644 --- a/Compute/samples/V1/RegionSecurityPoliciesClient/list.php +++ b/Compute/samples/V1/RegionSecurityPoliciesClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_RegionSecurityPolicies_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\RegionSecurityPoliciesClient; +use Google\Cloud\Compute\V1\Client\RegionSecurityPoliciesClient; +use Google\Cloud\Compute\V1\ListRegionSecurityPoliciesRequest; /** * List all the policies that have been configured for the specified project and region. @@ -38,10 +39,15 @@ function list_sample(string $project, string $region): void // Create a client. $regionSecurityPoliciesClient = new RegionSecurityPoliciesClient(); + // Prepare the request message. + $request = (new ListRegionSecurityPoliciesRequest()) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $regionSecurityPoliciesClient->list($project, $region); + $response = $regionSecurityPoliciesClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/RegionSecurityPoliciesClient/patch.php b/Compute/samples/V1/RegionSecurityPoliciesClient/patch.php index 41c17297a3a0..3c11f2eea33a 100644 --- a/Compute/samples/V1/RegionSecurityPoliciesClient/patch.php +++ b/Compute/samples/V1/RegionSecurityPoliciesClient/patch.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_RegionSecurityPolicies_Patch_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\RegionSecurityPoliciesClient; +use Google\Cloud\Compute\V1\Client\RegionSecurityPoliciesClient; +use Google\Cloud\Compute\V1\PatchRegionSecurityPolicyRequest; use Google\Cloud\Compute\V1\SecurityPolicy; use Google\Rpc\Status; @@ -41,18 +42,18 @@ function patch_sample(string $project, string $region, string $securityPolicy): // Create a client. $regionSecurityPoliciesClient = new RegionSecurityPoliciesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $securityPolicyResource = new SecurityPolicy(); + $request = (new PatchRegionSecurityPolicyRequest()) + ->setProject($project) + ->setRegion($region) + ->setSecurityPolicy($securityPolicy) + ->setSecurityPolicyResource($securityPolicyResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionSecurityPoliciesClient->patch( - $project, - $region, - $securityPolicy, - $securityPolicyResource - ); + $response = $regionSecurityPoliciesClient->patch($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionSecurityPoliciesClient/patch_rule.php b/Compute/samples/V1/RegionSecurityPoliciesClient/patch_rule.php index f811c88d05d9..247c43be89f8 100644 --- a/Compute/samples/V1/RegionSecurityPoliciesClient/patch_rule.php +++ b/Compute/samples/V1/RegionSecurityPoliciesClient/patch_rule.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_RegionSecurityPolicies_PatchRule_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\RegionSecurityPoliciesClient; +use Google\Cloud\Compute\V1\Client\RegionSecurityPoliciesClient; +use Google\Cloud\Compute\V1\PatchRuleRegionSecurityPolicyRequest; use Google\Cloud\Compute\V1\SecurityPolicyRule; use Google\Rpc\Status; @@ -41,18 +42,18 @@ function patch_rule_sample(string $project, string $region, string $securityPoli // Create a client. $regionSecurityPoliciesClient = new RegionSecurityPoliciesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $securityPolicyRuleResource = new SecurityPolicyRule(); + $request = (new PatchRuleRegionSecurityPolicyRequest()) + ->setProject($project) + ->setRegion($region) + ->setSecurityPolicy($securityPolicy) + ->setSecurityPolicyRuleResource($securityPolicyRuleResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionSecurityPoliciesClient->patchRule( - $project, - $region, - $securityPolicy, - $securityPolicyRuleResource - ); + $response = $regionSecurityPoliciesClient->patchRule($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionSecurityPoliciesClient/remove_rule.php b/Compute/samples/V1/RegionSecurityPoliciesClient/remove_rule.php index c0fd5cc2221f..a71178995709 100644 --- a/Compute/samples/V1/RegionSecurityPoliciesClient/remove_rule.php +++ b/Compute/samples/V1/RegionSecurityPoliciesClient/remove_rule.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_RegionSecurityPolicies_RemoveRule_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\RegionSecurityPoliciesClient; +use Google\Cloud\Compute\V1\Client\RegionSecurityPoliciesClient; +use Google\Cloud\Compute\V1\RemoveRuleRegionSecurityPolicyRequest; use Google\Rpc\Status; /** @@ -40,10 +41,16 @@ function remove_rule_sample(string $project, string $region, string $securityPol // Create a client. $regionSecurityPoliciesClient = new RegionSecurityPoliciesClient(); + // Prepare the request message. + $request = (new RemoveRuleRegionSecurityPolicyRequest()) + ->setProject($project) + ->setRegion($region) + ->setSecurityPolicy($securityPolicy); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionSecurityPoliciesClient->removeRule($project, $region, $securityPolicy); + $response = $regionSecurityPoliciesClient->removeRule($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionSecurityPoliciesClient/set_labels.php b/Compute/samples/V1/RegionSecurityPoliciesClient/set_labels.php index 86040afe45da..18376f8bc446 100644 --- a/Compute/samples/V1/RegionSecurityPoliciesClient/set_labels.php +++ b/Compute/samples/V1/RegionSecurityPoliciesClient/set_labels.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_RegionSecurityPolicies_SetLabels_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\RegionSecurityPoliciesClient; +use Google\Cloud\Compute\V1\Client\RegionSecurityPoliciesClient; use Google\Cloud\Compute\V1\RegionSetLabelsRequest; +use Google\Cloud\Compute\V1\SetLabelsRegionSecurityPolicyRequest; use Google\Rpc\Status; /** @@ -41,18 +42,18 @@ function set_labels_sample(string $project, string $region, string $resource): v // Create a client. $regionSecurityPoliciesClient = new RegionSecurityPoliciesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $regionSetLabelsRequestResource = new RegionSetLabelsRequest(); + $request = (new SetLabelsRegionSecurityPolicyRequest()) + ->setProject($project) + ->setRegion($region) + ->setRegionSetLabelsRequestResource($regionSetLabelsRequestResource) + ->setResource($resource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionSecurityPoliciesClient->setLabels( - $project, - $region, - $regionSetLabelsRequestResource, - $resource - ); + $response = $regionSecurityPoliciesClient->setLabels($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionSslCertificatesClient/delete.php b/Compute/samples/V1/RegionSslCertificatesClient/delete.php index dad80f254d63..a4b9369c1b9d 100644 --- a/Compute/samples/V1/RegionSslCertificatesClient/delete.php +++ b/Compute/samples/V1/RegionSslCertificatesClient/delete.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_RegionSslCertificates_Delete_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\RegionSslCertificatesClient; +use Google\Cloud\Compute\V1\Client\RegionSslCertificatesClient; +use Google\Cloud\Compute\V1\DeleteRegionSslCertificateRequest; use Google\Rpc\Status; /** @@ -40,10 +41,16 @@ function delete_sample(string $project, string $region, string $sslCertificate): // Create a client. $regionSslCertificatesClient = new RegionSslCertificatesClient(); + // Prepare the request message. + $request = (new DeleteRegionSslCertificateRequest()) + ->setProject($project) + ->setRegion($region) + ->setSslCertificate($sslCertificate); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionSslCertificatesClient->delete($project, $region, $sslCertificate); + $response = $regionSslCertificatesClient->delete($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionSslCertificatesClient/get.php b/Compute/samples/V1/RegionSslCertificatesClient/get.php index 5d94b2bfb3e7..e2195495b9bd 100644 --- a/Compute/samples/V1/RegionSslCertificatesClient/get.php +++ b/Compute/samples/V1/RegionSslCertificatesClient/get.php @@ -24,7 +24,8 @@ // [START compute_v1_generated_RegionSslCertificates_Get_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\RegionSslCertificatesClient; +use Google\Cloud\Compute\V1\Client\RegionSslCertificatesClient; +use Google\Cloud\Compute\V1\GetRegionSslCertificateRequest; use Google\Cloud\Compute\V1\SslCertificate; /** @@ -39,10 +40,16 @@ function get_sample(string $project, string $region, string $sslCertificate): vo // Create a client. $regionSslCertificatesClient = new RegionSslCertificatesClient(); + // Prepare the request message. + $request = (new GetRegionSslCertificateRequest()) + ->setProject($project) + ->setRegion($region) + ->setSslCertificate($sslCertificate); + // Call the API and handle any network failures. try { /** @var SslCertificate $response */ - $response = $regionSslCertificatesClient->get($project, $region, $sslCertificate); + $response = $regionSslCertificatesClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/RegionSslCertificatesClient/insert.php b/Compute/samples/V1/RegionSslCertificatesClient/insert.php index 13fd8990805c..82823fd3a544 100644 --- a/Compute/samples/V1/RegionSslCertificatesClient/insert.php +++ b/Compute/samples/V1/RegionSslCertificatesClient/insert.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_RegionSslCertificates_Insert_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\RegionSslCertificatesClient; +use Google\Cloud\Compute\V1\Client\RegionSslCertificatesClient; +use Google\Cloud\Compute\V1\InsertRegionSslCertificateRequest; use Google\Cloud\Compute\V1\SslCertificate; use Google\Rpc\Status; @@ -40,13 +41,17 @@ function insert_sample(string $project, string $region): void // Create a client. $regionSslCertificatesClient = new RegionSslCertificatesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $sslCertificateResource = new SslCertificate(); + $request = (new InsertRegionSslCertificateRequest()) + ->setProject($project) + ->setRegion($region) + ->setSslCertificateResource($sslCertificateResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionSslCertificatesClient->insert($project, $region, $sslCertificateResource); + $response = $regionSslCertificatesClient->insert($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionSslCertificatesClient/list.php b/Compute/samples/V1/RegionSslCertificatesClient/list.php index 4043f6f1a923..a5c38de9e47a 100644 --- a/Compute/samples/V1/RegionSslCertificatesClient/list.php +++ b/Compute/samples/V1/RegionSslCertificatesClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_RegionSslCertificates_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\RegionSslCertificatesClient; +use Google\Cloud\Compute\V1\Client\RegionSslCertificatesClient; +use Google\Cloud\Compute\V1\ListRegionSslCertificatesRequest; /** * Retrieves the list of SslCertificate resources available to the specified project in the specified region. @@ -38,10 +39,15 @@ function list_sample(string $project, string $region): void // Create a client. $regionSslCertificatesClient = new RegionSslCertificatesClient(); + // Prepare the request message. + $request = (new ListRegionSslCertificatesRequest()) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $regionSslCertificatesClient->list($project, $region); + $response = $regionSslCertificatesClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/RegionSslPoliciesClient/delete.php b/Compute/samples/V1/RegionSslPoliciesClient/delete.php index 0a6eb7e6e987..5e308a87d2f9 100644 --- a/Compute/samples/V1/RegionSslPoliciesClient/delete.php +++ b/Compute/samples/V1/RegionSslPoliciesClient/delete.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_RegionSslPolicies_Delete_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\RegionSslPoliciesClient; +use Google\Cloud\Compute\V1\Client\RegionSslPoliciesClient; +use Google\Cloud\Compute\V1\DeleteRegionSslPolicyRequest; use Google\Rpc\Status; /** @@ -40,10 +41,16 @@ function delete_sample(string $project, string $region, string $sslPolicy): void // Create a client. $regionSslPoliciesClient = new RegionSslPoliciesClient(); + // Prepare the request message. + $request = (new DeleteRegionSslPolicyRequest()) + ->setProject($project) + ->setRegion($region) + ->setSslPolicy($sslPolicy); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionSslPoliciesClient->delete($project, $region, $sslPolicy); + $response = $regionSslPoliciesClient->delete($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionSslPoliciesClient/get.php b/Compute/samples/V1/RegionSslPoliciesClient/get.php index f9c1f7546f2c..4d469ab07a86 100644 --- a/Compute/samples/V1/RegionSslPoliciesClient/get.php +++ b/Compute/samples/V1/RegionSslPoliciesClient/get.php @@ -24,7 +24,8 @@ // [START compute_v1_generated_RegionSslPolicies_Get_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\RegionSslPoliciesClient; +use Google\Cloud\Compute\V1\Client\RegionSslPoliciesClient; +use Google\Cloud\Compute\V1\GetRegionSslPolicyRequest; use Google\Cloud\Compute\V1\SslPolicy; /** @@ -39,10 +40,16 @@ function get_sample(string $project, string $region, string $sslPolicy): void // Create a client. $regionSslPoliciesClient = new RegionSslPoliciesClient(); + // Prepare the request message. + $request = (new GetRegionSslPolicyRequest()) + ->setProject($project) + ->setRegion($region) + ->setSslPolicy($sslPolicy); + // Call the API and handle any network failures. try { /** @var SslPolicy $response */ - $response = $regionSslPoliciesClient->get($project, $region, $sslPolicy); + $response = $regionSslPoliciesClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/RegionSslPoliciesClient/insert.php b/Compute/samples/V1/RegionSslPoliciesClient/insert.php index fcf9e3dd97b6..04bbaadfa367 100644 --- a/Compute/samples/V1/RegionSslPoliciesClient/insert.php +++ b/Compute/samples/V1/RegionSslPoliciesClient/insert.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_RegionSslPolicies_Insert_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\RegionSslPoliciesClient; +use Google\Cloud\Compute\V1\Client\RegionSslPoliciesClient; +use Google\Cloud\Compute\V1\InsertRegionSslPolicyRequest; use Google\Cloud\Compute\V1\SslPolicy; use Google\Rpc\Status; @@ -40,13 +41,17 @@ function insert_sample(string $project, string $region): void // Create a client. $regionSslPoliciesClient = new RegionSslPoliciesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $sslPolicyResource = new SslPolicy(); + $request = (new InsertRegionSslPolicyRequest()) + ->setProject($project) + ->setRegion($region) + ->setSslPolicyResource($sslPolicyResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionSslPoliciesClient->insert($project, $region, $sslPolicyResource); + $response = $regionSslPoliciesClient->insert($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionSslPoliciesClient/list.php b/Compute/samples/V1/RegionSslPoliciesClient/list.php index 99ef619b2de8..f9419ad26677 100644 --- a/Compute/samples/V1/RegionSslPoliciesClient/list.php +++ b/Compute/samples/V1/RegionSslPoliciesClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_RegionSslPolicies_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\RegionSslPoliciesClient; +use Google\Cloud\Compute\V1\Client\RegionSslPoliciesClient; +use Google\Cloud\Compute\V1\ListRegionSslPoliciesRequest; /** * Lists all the SSL policies that have been configured for the specified project and region. @@ -38,10 +39,15 @@ function list_sample(string $project, string $region): void // Create a client. $regionSslPoliciesClient = new RegionSslPoliciesClient(); + // Prepare the request message. + $request = (new ListRegionSslPoliciesRequest()) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $regionSslPoliciesClient->list($project, $region); + $response = $regionSslPoliciesClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/RegionSslPoliciesClient/list_available_features.php b/Compute/samples/V1/RegionSslPoliciesClient/list_available_features.php index 85b9b9180105..fe5e24401411 100644 --- a/Compute/samples/V1/RegionSslPoliciesClient/list_available_features.php +++ b/Compute/samples/V1/RegionSslPoliciesClient/list_available_features.php @@ -24,7 +24,8 @@ // [START compute_v1_generated_RegionSslPolicies_ListAvailableFeatures_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\RegionSslPoliciesClient; +use Google\Cloud\Compute\V1\Client\RegionSslPoliciesClient; +use Google\Cloud\Compute\V1\ListAvailableFeaturesRegionSslPoliciesRequest; use Google\Cloud\Compute\V1\SslPoliciesListAvailableFeaturesResponse; /** @@ -38,10 +39,15 @@ function list_available_features_sample(string $project, string $region): void // Create a client. $regionSslPoliciesClient = new RegionSslPoliciesClient(); + // Prepare the request message. + $request = (new ListAvailableFeaturesRegionSslPoliciesRequest()) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var SslPoliciesListAvailableFeaturesResponse $response */ - $response = $regionSslPoliciesClient->listAvailableFeatures($project, $region); + $response = $regionSslPoliciesClient->listAvailableFeatures($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/RegionSslPoliciesClient/patch.php b/Compute/samples/V1/RegionSslPoliciesClient/patch.php index ba3dd8aa2c33..15f8865fb92a 100644 --- a/Compute/samples/V1/RegionSslPoliciesClient/patch.php +++ b/Compute/samples/V1/RegionSslPoliciesClient/patch.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_RegionSslPolicies_Patch_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\RegionSslPoliciesClient; +use Google\Cloud\Compute\V1\Client\RegionSslPoliciesClient; +use Google\Cloud\Compute\V1\PatchRegionSslPolicyRequest; use Google\Cloud\Compute\V1\SslPolicy; use Google\Rpc\Status; @@ -41,13 +42,18 @@ function patch_sample(string $project, string $region, string $sslPolicy): void // Create a client. $regionSslPoliciesClient = new RegionSslPoliciesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $sslPolicyResource = new SslPolicy(); + $request = (new PatchRegionSslPolicyRequest()) + ->setProject($project) + ->setRegion($region) + ->setSslPolicy($sslPolicy) + ->setSslPolicyResource($sslPolicyResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionSslPoliciesClient->patch($project, $region, $sslPolicy, $sslPolicyResource); + $response = $regionSslPoliciesClient->patch($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionTargetHttpProxiesClient/delete.php b/Compute/samples/V1/RegionTargetHttpProxiesClient/delete.php index 5b0236f768f8..f217fd80d275 100644 --- a/Compute/samples/V1/RegionTargetHttpProxiesClient/delete.php +++ b/Compute/samples/V1/RegionTargetHttpProxiesClient/delete.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_RegionTargetHttpProxies_Delete_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\RegionTargetHttpProxiesClient; +use Google\Cloud\Compute\V1\Client\RegionTargetHttpProxiesClient; +use Google\Cloud\Compute\V1\DeleteRegionTargetHttpProxyRequest; use Google\Rpc\Status; /** @@ -40,10 +41,16 @@ function delete_sample(string $project, string $region, string $targetHttpProxy) // Create a client. $regionTargetHttpProxiesClient = new RegionTargetHttpProxiesClient(); + // Prepare the request message. + $request = (new DeleteRegionTargetHttpProxyRequest()) + ->setProject($project) + ->setRegion($region) + ->setTargetHttpProxy($targetHttpProxy); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionTargetHttpProxiesClient->delete($project, $region, $targetHttpProxy); + $response = $regionTargetHttpProxiesClient->delete($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionTargetHttpProxiesClient/get.php b/Compute/samples/V1/RegionTargetHttpProxiesClient/get.php index 853ee5f17d78..a8807cb557eb 100644 --- a/Compute/samples/V1/RegionTargetHttpProxiesClient/get.php +++ b/Compute/samples/V1/RegionTargetHttpProxiesClient/get.php @@ -24,7 +24,8 @@ // [START compute_v1_generated_RegionTargetHttpProxies_Get_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\RegionTargetHttpProxiesClient; +use Google\Cloud\Compute\V1\Client\RegionTargetHttpProxiesClient; +use Google\Cloud\Compute\V1\GetRegionTargetHttpProxyRequest; use Google\Cloud\Compute\V1\TargetHttpProxy; /** @@ -39,10 +40,16 @@ function get_sample(string $project, string $region, string $targetHttpProxy): v // Create a client. $regionTargetHttpProxiesClient = new RegionTargetHttpProxiesClient(); + // Prepare the request message. + $request = (new GetRegionTargetHttpProxyRequest()) + ->setProject($project) + ->setRegion($region) + ->setTargetHttpProxy($targetHttpProxy); + // Call the API and handle any network failures. try { /** @var TargetHttpProxy $response */ - $response = $regionTargetHttpProxiesClient->get($project, $region, $targetHttpProxy); + $response = $regionTargetHttpProxiesClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/RegionTargetHttpProxiesClient/insert.php b/Compute/samples/V1/RegionTargetHttpProxiesClient/insert.php index cef989572888..785e8d4dd99e 100644 --- a/Compute/samples/V1/RegionTargetHttpProxiesClient/insert.php +++ b/Compute/samples/V1/RegionTargetHttpProxiesClient/insert.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_RegionTargetHttpProxies_Insert_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\RegionTargetHttpProxiesClient; +use Google\Cloud\Compute\V1\Client\RegionTargetHttpProxiesClient; +use Google\Cloud\Compute\V1\InsertRegionTargetHttpProxyRequest; use Google\Cloud\Compute\V1\TargetHttpProxy; use Google\Rpc\Status; @@ -40,13 +41,17 @@ function insert_sample(string $project, string $region): void // Create a client. $regionTargetHttpProxiesClient = new RegionTargetHttpProxiesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $targetHttpProxyResource = new TargetHttpProxy(); + $request = (new InsertRegionTargetHttpProxyRequest()) + ->setProject($project) + ->setRegion($region) + ->setTargetHttpProxyResource($targetHttpProxyResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionTargetHttpProxiesClient->insert($project, $region, $targetHttpProxyResource); + $response = $regionTargetHttpProxiesClient->insert($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionTargetHttpProxiesClient/list.php b/Compute/samples/V1/RegionTargetHttpProxiesClient/list.php index 0d9f066632f6..2c89e7df3102 100644 --- a/Compute/samples/V1/RegionTargetHttpProxiesClient/list.php +++ b/Compute/samples/V1/RegionTargetHttpProxiesClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_RegionTargetHttpProxies_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\RegionTargetHttpProxiesClient; +use Google\Cloud\Compute\V1\Client\RegionTargetHttpProxiesClient; +use Google\Cloud\Compute\V1\ListRegionTargetHttpProxiesRequest; /** * Retrieves the list of TargetHttpProxy resources available to the specified project in the specified region. @@ -38,10 +39,15 @@ function list_sample(string $project, string $region): void // Create a client. $regionTargetHttpProxiesClient = new RegionTargetHttpProxiesClient(); + // Prepare the request message. + $request = (new ListRegionTargetHttpProxiesRequest()) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $regionTargetHttpProxiesClient->list($project, $region); + $response = $regionTargetHttpProxiesClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/RegionTargetHttpProxiesClient/set_url_map.php b/Compute/samples/V1/RegionTargetHttpProxiesClient/set_url_map.php index 9e18985c0f94..a8df4f6f2105 100644 --- a/Compute/samples/V1/RegionTargetHttpProxiesClient/set_url_map.php +++ b/Compute/samples/V1/RegionTargetHttpProxiesClient/set_url_map.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_RegionTargetHttpProxies_SetUrlMap_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\RegionTargetHttpProxiesClient; +use Google\Cloud\Compute\V1\Client\RegionTargetHttpProxiesClient; +use Google\Cloud\Compute\V1\SetUrlMapRegionTargetHttpProxyRequest; use Google\Cloud\Compute\V1\UrlMapReference; use Google\Rpc\Status; @@ -41,18 +42,18 @@ function set_url_map_sample(string $project, string $region, string $targetHttpP // Create a client. $regionTargetHttpProxiesClient = new RegionTargetHttpProxiesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $urlMapReferenceResource = new UrlMapReference(); + $request = (new SetUrlMapRegionTargetHttpProxyRequest()) + ->setProject($project) + ->setRegion($region) + ->setTargetHttpProxy($targetHttpProxy) + ->setUrlMapReferenceResource($urlMapReferenceResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionTargetHttpProxiesClient->setUrlMap( - $project, - $region, - $targetHttpProxy, - $urlMapReferenceResource - ); + $response = $regionTargetHttpProxiesClient->setUrlMap($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionTargetHttpsProxiesClient/delete.php b/Compute/samples/V1/RegionTargetHttpsProxiesClient/delete.php index 142e7e43d636..6c683f768c3d 100644 --- a/Compute/samples/V1/RegionTargetHttpsProxiesClient/delete.php +++ b/Compute/samples/V1/RegionTargetHttpsProxiesClient/delete.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_RegionTargetHttpsProxies_Delete_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\RegionTargetHttpsProxiesClient; +use Google\Cloud\Compute\V1\Client\RegionTargetHttpsProxiesClient; +use Google\Cloud\Compute\V1\DeleteRegionTargetHttpsProxyRequest; use Google\Rpc\Status; /** @@ -40,10 +41,16 @@ function delete_sample(string $project, string $region, string $targetHttpsProxy // Create a client. $regionTargetHttpsProxiesClient = new RegionTargetHttpsProxiesClient(); + // Prepare the request message. + $request = (new DeleteRegionTargetHttpsProxyRequest()) + ->setProject($project) + ->setRegion($region) + ->setTargetHttpsProxy($targetHttpsProxy); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionTargetHttpsProxiesClient->delete($project, $region, $targetHttpsProxy); + $response = $regionTargetHttpsProxiesClient->delete($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionTargetHttpsProxiesClient/get.php b/Compute/samples/V1/RegionTargetHttpsProxiesClient/get.php index fe0b6f6b6f41..116da5cbb375 100644 --- a/Compute/samples/V1/RegionTargetHttpsProxiesClient/get.php +++ b/Compute/samples/V1/RegionTargetHttpsProxiesClient/get.php @@ -24,7 +24,8 @@ // [START compute_v1_generated_RegionTargetHttpsProxies_Get_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\RegionTargetHttpsProxiesClient; +use Google\Cloud\Compute\V1\Client\RegionTargetHttpsProxiesClient; +use Google\Cloud\Compute\V1\GetRegionTargetHttpsProxyRequest; use Google\Cloud\Compute\V1\TargetHttpsProxy; /** @@ -39,10 +40,16 @@ function get_sample(string $project, string $region, string $targetHttpsProxy): // Create a client. $regionTargetHttpsProxiesClient = new RegionTargetHttpsProxiesClient(); + // Prepare the request message. + $request = (new GetRegionTargetHttpsProxyRequest()) + ->setProject($project) + ->setRegion($region) + ->setTargetHttpsProxy($targetHttpsProxy); + // Call the API and handle any network failures. try { /** @var TargetHttpsProxy $response */ - $response = $regionTargetHttpsProxiesClient->get($project, $region, $targetHttpsProxy); + $response = $regionTargetHttpsProxiesClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/RegionTargetHttpsProxiesClient/insert.php b/Compute/samples/V1/RegionTargetHttpsProxiesClient/insert.php index 9fdd51571f05..60c4aac050a8 100644 --- a/Compute/samples/V1/RegionTargetHttpsProxiesClient/insert.php +++ b/Compute/samples/V1/RegionTargetHttpsProxiesClient/insert.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_RegionTargetHttpsProxies_Insert_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\RegionTargetHttpsProxiesClient; +use Google\Cloud\Compute\V1\Client\RegionTargetHttpsProxiesClient; +use Google\Cloud\Compute\V1\InsertRegionTargetHttpsProxyRequest; use Google\Cloud\Compute\V1\TargetHttpsProxy; use Google\Rpc\Status; @@ -40,13 +41,17 @@ function insert_sample(string $project, string $region): void // Create a client. $regionTargetHttpsProxiesClient = new RegionTargetHttpsProxiesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $targetHttpsProxyResource = new TargetHttpsProxy(); + $request = (new InsertRegionTargetHttpsProxyRequest()) + ->setProject($project) + ->setRegion($region) + ->setTargetHttpsProxyResource($targetHttpsProxyResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionTargetHttpsProxiesClient->insert($project, $region, $targetHttpsProxyResource); + $response = $regionTargetHttpsProxiesClient->insert($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionTargetHttpsProxiesClient/list.php b/Compute/samples/V1/RegionTargetHttpsProxiesClient/list.php index d6c7c4eea850..109a3cbe223e 100644 --- a/Compute/samples/V1/RegionTargetHttpsProxiesClient/list.php +++ b/Compute/samples/V1/RegionTargetHttpsProxiesClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_RegionTargetHttpsProxies_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\RegionTargetHttpsProxiesClient; +use Google\Cloud\Compute\V1\Client\RegionTargetHttpsProxiesClient; +use Google\Cloud\Compute\V1\ListRegionTargetHttpsProxiesRequest; /** * Retrieves the list of TargetHttpsProxy resources available to the specified project in the specified region. @@ -38,10 +39,15 @@ function list_sample(string $project, string $region): void // Create a client. $regionTargetHttpsProxiesClient = new RegionTargetHttpsProxiesClient(); + // Prepare the request message. + $request = (new ListRegionTargetHttpsProxiesRequest()) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $regionTargetHttpsProxiesClient->list($project, $region); + $response = $regionTargetHttpsProxiesClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/RegionTargetHttpsProxiesClient/patch.php b/Compute/samples/V1/RegionTargetHttpsProxiesClient/patch.php index f78ec8ec5521..8cc6b90f839b 100644 --- a/Compute/samples/V1/RegionTargetHttpsProxiesClient/patch.php +++ b/Compute/samples/V1/RegionTargetHttpsProxiesClient/patch.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_RegionTargetHttpsProxies_Patch_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\RegionTargetHttpsProxiesClient; +use Google\Cloud\Compute\V1\Client\RegionTargetHttpsProxiesClient; +use Google\Cloud\Compute\V1\PatchRegionTargetHttpsProxyRequest; use Google\Cloud\Compute\V1\TargetHttpsProxy; use Google\Rpc\Status; @@ -41,18 +42,18 @@ function patch_sample(string $project, string $region, string $targetHttpsProxy) // Create a client. $regionTargetHttpsProxiesClient = new RegionTargetHttpsProxiesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $targetHttpsProxyResource = new TargetHttpsProxy(); + $request = (new PatchRegionTargetHttpsProxyRequest()) + ->setProject($project) + ->setRegion($region) + ->setTargetHttpsProxy($targetHttpsProxy) + ->setTargetHttpsProxyResource($targetHttpsProxyResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionTargetHttpsProxiesClient->patch( - $project, - $region, - $targetHttpsProxy, - $targetHttpsProxyResource - ); + $response = $regionTargetHttpsProxiesClient->patch($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionTargetHttpsProxiesClient/set_ssl_certificates.php b/Compute/samples/V1/RegionTargetHttpsProxiesClient/set_ssl_certificates.php index f02bae601aca..e3d5feb7f1a3 100644 --- a/Compute/samples/V1/RegionTargetHttpsProxiesClient/set_ssl_certificates.php +++ b/Compute/samples/V1/RegionTargetHttpsProxiesClient/set_ssl_certificates.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_RegionTargetHttpsProxies_SetSslCertificates_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\RegionTargetHttpsProxiesClient; +use Google\Cloud\Compute\V1\Client\RegionTargetHttpsProxiesClient; use Google\Cloud\Compute\V1\RegionTargetHttpsProxiesSetSslCertificatesRequest; +use Google\Cloud\Compute\V1\SetSslCertificatesRegionTargetHttpsProxyRequest; use Google\Rpc\Status; /** @@ -44,18 +45,20 @@ function set_ssl_certificates_sample( // Create a client. $regionTargetHttpsProxiesClient = new RegionTargetHttpsProxiesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $regionTargetHttpsProxiesSetSslCertificatesRequestResource = new RegionTargetHttpsProxiesSetSslCertificatesRequest(); + $request = (new SetSslCertificatesRegionTargetHttpsProxyRequest()) + ->setProject($project) + ->setRegion($region) + ->setRegionTargetHttpsProxiesSetSslCertificatesRequestResource( + $regionTargetHttpsProxiesSetSslCertificatesRequestResource + ) + ->setTargetHttpsProxy($targetHttpsProxy); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionTargetHttpsProxiesClient->setSslCertificates( - $project, - $region, - $regionTargetHttpsProxiesSetSslCertificatesRequestResource, - $targetHttpsProxy - ); + $response = $regionTargetHttpsProxiesClient->setSslCertificates($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionTargetHttpsProxiesClient/set_url_map.php b/Compute/samples/V1/RegionTargetHttpsProxiesClient/set_url_map.php index a40152871d70..c7dcecc5a00f 100644 --- a/Compute/samples/V1/RegionTargetHttpsProxiesClient/set_url_map.php +++ b/Compute/samples/V1/RegionTargetHttpsProxiesClient/set_url_map.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_RegionTargetHttpsProxies_SetUrlMap_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\RegionTargetHttpsProxiesClient; +use Google\Cloud\Compute\V1\Client\RegionTargetHttpsProxiesClient; +use Google\Cloud\Compute\V1\SetUrlMapRegionTargetHttpsProxyRequest; use Google\Cloud\Compute\V1\UrlMapReference; use Google\Rpc\Status; @@ -41,18 +42,18 @@ function set_url_map_sample(string $project, string $region, string $targetHttps // Create a client. $regionTargetHttpsProxiesClient = new RegionTargetHttpsProxiesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $urlMapReferenceResource = new UrlMapReference(); + $request = (new SetUrlMapRegionTargetHttpsProxyRequest()) + ->setProject($project) + ->setRegion($region) + ->setTargetHttpsProxy($targetHttpsProxy) + ->setUrlMapReferenceResource($urlMapReferenceResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionTargetHttpsProxiesClient->setUrlMap( - $project, - $region, - $targetHttpsProxy, - $urlMapReferenceResource - ); + $response = $regionTargetHttpsProxiesClient->setUrlMap($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionTargetTcpProxiesClient/delete.php b/Compute/samples/V1/RegionTargetTcpProxiesClient/delete.php index f5d56433220a..1c7aff4d45f5 100644 --- a/Compute/samples/V1/RegionTargetTcpProxiesClient/delete.php +++ b/Compute/samples/V1/RegionTargetTcpProxiesClient/delete.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_RegionTargetTcpProxies_Delete_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\RegionTargetTcpProxiesClient; +use Google\Cloud\Compute\V1\Client\RegionTargetTcpProxiesClient; +use Google\Cloud\Compute\V1\DeleteRegionTargetTcpProxyRequest; use Google\Rpc\Status; /** @@ -40,10 +41,16 @@ function delete_sample(string $project, string $region, string $targetTcpProxy): // Create a client. $regionTargetTcpProxiesClient = new RegionTargetTcpProxiesClient(); + // Prepare the request message. + $request = (new DeleteRegionTargetTcpProxyRequest()) + ->setProject($project) + ->setRegion($region) + ->setTargetTcpProxy($targetTcpProxy); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionTargetTcpProxiesClient->delete($project, $region, $targetTcpProxy); + $response = $regionTargetTcpProxiesClient->delete($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionTargetTcpProxiesClient/get.php b/Compute/samples/V1/RegionTargetTcpProxiesClient/get.php index f548d0778af0..3ef240c5fb8e 100644 --- a/Compute/samples/V1/RegionTargetTcpProxiesClient/get.php +++ b/Compute/samples/V1/RegionTargetTcpProxiesClient/get.php @@ -24,7 +24,8 @@ // [START compute_v1_generated_RegionTargetTcpProxies_Get_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\RegionTargetTcpProxiesClient; +use Google\Cloud\Compute\V1\Client\RegionTargetTcpProxiesClient; +use Google\Cloud\Compute\V1\GetRegionTargetTcpProxyRequest; use Google\Cloud\Compute\V1\TargetTcpProxy; /** @@ -39,10 +40,16 @@ function get_sample(string $project, string $region, string $targetTcpProxy): vo // Create a client. $regionTargetTcpProxiesClient = new RegionTargetTcpProxiesClient(); + // Prepare the request message. + $request = (new GetRegionTargetTcpProxyRequest()) + ->setProject($project) + ->setRegion($region) + ->setTargetTcpProxy($targetTcpProxy); + // Call the API and handle any network failures. try { /** @var TargetTcpProxy $response */ - $response = $regionTargetTcpProxiesClient->get($project, $region, $targetTcpProxy); + $response = $regionTargetTcpProxiesClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/RegionTargetTcpProxiesClient/insert.php b/Compute/samples/V1/RegionTargetTcpProxiesClient/insert.php index 08d31e161610..ab9e9023b2b5 100644 --- a/Compute/samples/V1/RegionTargetTcpProxiesClient/insert.php +++ b/Compute/samples/V1/RegionTargetTcpProxiesClient/insert.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_RegionTargetTcpProxies_Insert_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\RegionTargetTcpProxiesClient; +use Google\Cloud\Compute\V1\Client\RegionTargetTcpProxiesClient; +use Google\Cloud\Compute\V1\InsertRegionTargetTcpProxyRequest; use Google\Cloud\Compute\V1\TargetTcpProxy; use Google\Rpc\Status; @@ -40,13 +41,17 @@ function insert_sample(string $project, string $region): void // Create a client. $regionTargetTcpProxiesClient = new RegionTargetTcpProxiesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $targetTcpProxyResource = new TargetTcpProxy(); + $request = (new InsertRegionTargetTcpProxyRequest()) + ->setProject($project) + ->setRegion($region) + ->setTargetTcpProxyResource($targetTcpProxyResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionTargetTcpProxiesClient->insert($project, $region, $targetTcpProxyResource); + $response = $regionTargetTcpProxiesClient->insert($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionTargetTcpProxiesClient/list.php b/Compute/samples/V1/RegionTargetTcpProxiesClient/list.php index 96cbc578c9b8..d3394f2ef14e 100644 --- a/Compute/samples/V1/RegionTargetTcpProxiesClient/list.php +++ b/Compute/samples/V1/RegionTargetTcpProxiesClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_RegionTargetTcpProxies_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\RegionTargetTcpProxiesClient; +use Google\Cloud\Compute\V1\Client\RegionTargetTcpProxiesClient; +use Google\Cloud\Compute\V1\ListRegionTargetTcpProxiesRequest; /** * Retrieves a list of TargetTcpProxy resources available to the specified project in a given region. @@ -38,10 +39,15 @@ function list_sample(string $project, string $region): void // Create a client. $regionTargetTcpProxiesClient = new RegionTargetTcpProxiesClient(); + // Prepare the request message. + $request = (new ListRegionTargetTcpProxiesRequest()) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $regionTargetTcpProxiesClient->list($project, $region); + $response = $regionTargetTcpProxiesClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/RegionUrlMapsClient/delete.php b/Compute/samples/V1/RegionUrlMapsClient/delete.php index 4d606e45bd58..cb58a8a1f12d 100644 --- a/Compute/samples/V1/RegionUrlMapsClient/delete.php +++ b/Compute/samples/V1/RegionUrlMapsClient/delete.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_RegionUrlMaps_Delete_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\RegionUrlMapsClient; +use Google\Cloud\Compute\V1\Client\RegionUrlMapsClient; +use Google\Cloud\Compute\V1\DeleteRegionUrlMapRequest; use Google\Rpc\Status; /** @@ -40,10 +41,16 @@ function delete_sample(string $project, string $region, string $urlMap): void // Create a client. $regionUrlMapsClient = new RegionUrlMapsClient(); + // Prepare the request message. + $request = (new DeleteRegionUrlMapRequest()) + ->setProject($project) + ->setRegion($region) + ->setUrlMap($urlMap); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionUrlMapsClient->delete($project, $region, $urlMap); + $response = $regionUrlMapsClient->delete($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionUrlMapsClient/get.php b/Compute/samples/V1/RegionUrlMapsClient/get.php index d604429d731d..3776527d3fc9 100644 --- a/Compute/samples/V1/RegionUrlMapsClient/get.php +++ b/Compute/samples/V1/RegionUrlMapsClient/get.php @@ -24,7 +24,8 @@ // [START compute_v1_generated_RegionUrlMaps_Get_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\RegionUrlMapsClient; +use Google\Cloud\Compute\V1\Client\RegionUrlMapsClient; +use Google\Cloud\Compute\V1\GetRegionUrlMapRequest; use Google\Cloud\Compute\V1\UrlMap; /** @@ -39,10 +40,16 @@ function get_sample(string $project, string $region, string $urlMap): void // Create a client. $regionUrlMapsClient = new RegionUrlMapsClient(); + // Prepare the request message. + $request = (new GetRegionUrlMapRequest()) + ->setProject($project) + ->setRegion($region) + ->setUrlMap($urlMap); + // Call the API and handle any network failures. try { /** @var UrlMap $response */ - $response = $regionUrlMapsClient->get($project, $region, $urlMap); + $response = $regionUrlMapsClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/RegionUrlMapsClient/insert.php b/Compute/samples/V1/RegionUrlMapsClient/insert.php index b6607477711f..ed454435f46f 100644 --- a/Compute/samples/V1/RegionUrlMapsClient/insert.php +++ b/Compute/samples/V1/RegionUrlMapsClient/insert.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_RegionUrlMaps_Insert_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\RegionUrlMapsClient; +use Google\Cloud\Compute\V1\Client\RegionUrlMapsClient; +use Google\Cloud\Compute\V1\InsertRegionUrlMapRequest; use Google\Cloud\Compute\V1\UrlMap; use Google\Rpc\Status; @@ -40,13 +41,17 @@ function insert_sample(string $project, string $region): void // Create a client. $regionUrlMapsClient = new RegionUrlMapsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $urlMapResource = new UrlMap(); + $request = (new InsertRegionUrlMapRequest()) + ->setProject($project) + ->setRegion($region) + ->setUrlMapResource($urlMapResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionUrlMapsClient->insert($project, $region, $urlMapResource); + $response = $regionUrlMapsClient->insert($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionUrlMapsClient/list.php b/Compute/samples/V1/RegionUrlMapsClient/list.php index b847e7c4a58e..6ab8968dd8ec 100644 --- a/Compute/samples/V1/RegionUrlMapsClient/list.php +++ b/Compute/samples/V1/RegionUrlMapsClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_RegionUrlMaps_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\RegionUrlMapsClient; +use Google\Cloud\Compute\V1\Client\RegionUrlMapsClient; +use Google\Cloud\Compute\V1\ListRegionUrlMapsRequest; /** * Retrieves the list of UrlMap resources available to the specified project in the specified region. @@ -38,10 +39,15 @@ function list_sample(string $project, string $region): void // Create a client. $regionUrlMapsClient = new RegionUrlMapsClient(); + // Prepare the request message. + $request = (new ListRegionUrlMapsRequest()) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $regionUrlMapsClient->list($project, $region); + $response = $regionUrlMapsClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/RegionUrlMapsClient/patch.php b/Compute/samples/V1/RegionUrlMapsClient/patch.php index 88bdd7ef0334..44cd84fcaba2 100644 --- a/Compute/samples/V1/RegionUrlMapsClient/patch.php +++ b/Compute/samples/V1/RegionUrlMapsClient/patch.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_RegionUrlMaps_Patch_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\RegionUrlMapsClient; +use Google\Cloud\Compute\V1\Client\RegionUrlMapsClient; +use Google\Cloud\Compute\V1\PatchRegionUrlMapRequest; use Google\Cloud\Compute\V1\UrlMap; use Google\Rpc\Status; @@ -41,13 +42,18 @@ function patch_sample(string $project, string $region, string $urlMap): void // Create a client. $regionUrlMapsClient = new RegionUrlMapsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $urlMapResource = new UrlMap(); + $request = (new PatchRegionUrlMapRequest()) + ->setProject($project) + ->setRegion($region) + ->setUrlMap($urlMap) + ->setUrlMapResource($urlMapResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionUrlMapsClient->patch($project, $region, $urlMap, $urlMapResource); + $response = $regionUrlMapsClient->patch($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionUrlMapsClient/update.php b/Compute/samples/V1/RegionUrlMapsClient/update.php index 427c745cfa9b..18f7b9149256 100644 --- a/Compute/samples/V1/RegionUrlMapsClient/update.php +++ b/Compute/samples/V1/RegionUrlMapsClient/update.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_RegionUrlMaps_Update_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\RegionUrlMapsClient; +use Google\Cloud\Compute\V1\Client\RegionUrlMapsClient; +use Google\Cloud\Compute\V1\UpdateRegionUrlMapRequest; use Google\Cloud\Compute\V1\UrlMap; use Google\Rpc\Status; @@ -41,13 +42,18 @@ function update_sample(string $project, string $region, string $urlMap): void // Create a client. $regionUrlMapsClient = new RegionUrlMapsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $urlMapResource = new UrlMap(); + $request = (new UpdateRegionUrlMapRequest()) + ->setProject($project) + ->setRegion($region) + ->setUrlMap($urlMap) + ->setUrlMapResource($urlMapResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $regionUrlMapsClient->update($project, $region, $urlMap, $urlMapResource); + $response = $regionUrlMapsClient->update($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RegionUrlMapsClient/validate.php b/Compute/samples/V1/RegionUrlMapsClient/validate.php index 8c5d9d5f5850..98bc83833431 100644 --- a/Compute/samples/V1/RegionUrlMapsClient/validate.php +++ b/Compute/samples/V1/RegionUrlMapsClient/validate.php @@ -24,9 +24,10 @@ // [START compute_v1_generated_RegionUrlMaps_Validate_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\RegionUrlMapsClient; +use Google\Cloud\Compute\V1\Client\RegionUrlMapsClient; use Google\Cloud\Compute\V1\RegionUrlMapsValidateRequest; use Google\Cloud\Compute\V1\UrlMapsValidateResponse; +use Google\Cloud\Compute\V1\ValidateRegionUrlMapRequest; /** * Runs static validation for the UrlMap. In particular, the tests of the provided UrlMap will be run. Calling this method does NOT create the UrlMap. @@ -40,18 +41,18 @@ function validate_sample(string $project, string $region, string $urlMap): void // Create a client. $regionUrlMapsClient = new RegionUrlMapsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $regionUrlMapsValidateRequestResource = new RegionUrlMapsValidateRequest(); + $request = (new ValidateRegionUrlMapRequest()) + ->setProject($project) + ->setRegion($region) + ->setRegionUrlMapsValidateRequestResource($regionUrlMapsValidateRequestResource) + ->setUrlMap($urlMap); // Call the API and handle any network failures. try { /** @var UrlMapsValidateResponse $response */ - $response = $regionUrlMapsClient->validate( - $project, - $region, - $regionUrlMapsValidateRequestResource, - $urlMap - ); + $response = $regionUrlMapsClient->validate($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/RegionZonesClient/list.php b/Compute/samples/V1/RegionZonesClient/list.php index 4cc788d0fc08..b17d27970a6a 100644 --- a/Compute/samples/V1/RegionZonesClient/list.php +++ b/Compute/samples/V1/RegionZonesClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_RegionZones_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\RegionZonesClient; +use Google\Cloud\Compute\V1\Client\RegionZonesClient; +use Google\Cloud\Compute\V1\ListRegionZonesRequest; /** * Retrieves the list of Zone resources under the specific region available to the specified project. @@ -38,10 +39,15 @@ function list_sample(string $project, string $region): void // Create a client. $regionZonesClient = new RegionZonesClient(); + // Prepare the request message. + $request = (new ListRegionZonesRequest()) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $regionZonesClient->list($project, $region); + $response = $regionZonesClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/RegionsClient/get.php b/Compute/samples/V1/RegionsClient/get.php index dbc454ca89ab..6b2450984049 100644 --- a/Compute/samples/V1/RegionsClient/get.php +++ b/Compute/samples/V1/RegionsClient/get.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_Regions_Get_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\RegionsClient; +use Google\Cloud\Compute\V1\GetRegionRequest; use Google\Cloud\Compute\V1\Region; -use Google\Cloud\Compute\V1\RegionsClient; /** * Returns the specified Region resource. To decrease latency for this method, you can optionally omit any unneeded information from the response by using a field mask. This practice is especially recommended for unused quota information (the `quotas` field). To exclude one or more fields, set your request's `fields` query parameter to only include the fields you need. For example, to only include the `id` and `selfLink` fields, add the query parameter `?fields=id,selfLink` to your request. This method fails if the quota information is unavailable for the region and if the organization policy constraint compute.requireBasicQuotaInResponse is enforced. This constraint, when enforced, disables the fail-open behaviour when quota information (the `items.quotas` field) is unavailable for the region. It is recommended to use the default setting for the constraint unless your application requires the fail-closed behaviour for this method. @@ -38,10 +39,15 @@ function get_sample(string $project, string $region): void // Create a client. $regionsClient = new RegionsClient(); + // Prepare the request message. + $request = (new GetRegionRequest()) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var Region $response */ - $response = $regionsClient->get($project, $region); + $response = $regionsClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/RegionsClient/list.php b/Compute/samples/V1/RegionsClient/list.php index 672c61610261..ae5e7c52a133 100644 --- a/Compute/samples/V1/RegionsClient/list.php +++ b/Compute/samples/V1/RegionsClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_Regions_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\RegionsClient; +use Google\Cloud\Compute\V1\Client\RegionsClient; +use Google\Cloud\Compute\V1\ListRegionsRequest; /** * Retrieves the list of region resources available to the specified project. To decrease latency for this method, you can optionally omit any unneeded information from the response by using a field mask. This practice is especially recommended for unused quota information (the `items.quotas` field). To exclude one or more fields, set your request's `fields` query parameter to only include the fields you need. For example, to only include the `id` and `selfLink` fields, add the query parameter `?fields=id,selfLink` to your request. This method fails if the quota information is unavailable for the region and if the organization policy constraint compute.requireBasicQuotaInResponse is enforced. This constraint, when enforced, disables the fail-open behaviour when quota information (the `items.quotas` field) is unavailable for the region. It is recommended to use the default setting for the constraint unless your application requires the fail-closed behaviour for this method. @@ -37,10 +38,14 @@ function list_sample(string $project): void // Create a client. $regionsClient = new RegionsClient(); + // Prepare the request message. + $request = (new ListRegionsRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $regionsClient->list($project); + $response = $regionsClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/ReservationsClient/aggregated_list.php b/Compute/samples/V1/ReservationsClient/aggregated_list.php index 8f19f4910015..86c0e9dcbeb5 100644 --- a/Compute/samples/V1/ReservationsClient/aggregated_list.php +++ b/Compute/samples/V1/ReservationsClient/aggregated_list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_Reservations_AggregatedList_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\ReservationsClient; +use Google\Cloud\Compute\V1\AggregatedListReservationsRequest; +use Google\Cloud\Compute\V1\Client\ReservationsClient; /** * Retrieves an aggregated list of reservations. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. @@ -37,10 +38,14 @@ function aggregated_list_sample(string $project): void // Create a client. $reservationsClient = new ReservationsClient(); + // Prepare the request message. + $request = (new AggregatedListReservationsRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $reservationsClient->aggregatedList($project); + $response = $reservationsClient->aggregatedList($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/ReservationsClient/delete.php b/Compute/samples/V1/ReservationsClient/delete.php index 5dc8a98d2b44..4f59c2f0e285 100644 --- a/Compute/samples/V1/ReservationsClient/delete.php +++ b/Compute/samples/V1/ReservationsClient/delete.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_Reservations_Delete_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\ReservationsClient; +use Google\Cloud\Compute\V1\Client\ReservationsClient; +use Google\Cloud\Compute\V1\DeleteReservationRequest; use Google\Rpc\Status; /** @@ -40,10 +41,16 @@ function delete_sample(string $project, string $reservation, string $zone): void // Create a client. $reservationsClient = new ReservationsClient(); + // Prepare the request message. + $request = (new DeleteReservationRequest()) + ->setProject($project) + ->setReservation($reservation) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $reservationsClient->delete($project, $reservation, $zone); + $response = $reservationsClient->delete($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/ReservationsClient/get.php b/Compute/samples/V1/ReservationsClient/get.php index c6f426c16200..3a0538bd91e9 100644 --- a/Compute/samples/V1/ReservationsClient/get.php +++ b/Compute/samples/V1/ReservationsClient/get.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_Reservations_Get_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\ReservationsClient; +use Google\Cloud\Compute\V1\GetReservationRequest; use Google\Cloud\Compute\V1\Reservation; -use Google\Cloud\Compute\V1\ReservationsClient; /** * Retrieves information about the specified reservation. @@ -39,10 +40,16 @@ function get_sample(string $project, string $reservation, string $zone): void // Create a client. $reservationsClient = new ReservationsClient(); + // Prepare the request message. + $request = (new GetReservationRequest()) + ->setProject($project) + ->setReservation($reservation) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var Reservation $response */ - $response = $reservationsClient->get($project, $reservation, $zone); + $response = $reservationsClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/ReservationsClient/get_iam_policy.php b/Compute/samples/V1/ReservationsClient/get_iam_policy.php index d9b58e53f42c..286dcc1a1984 100644 --- a/Compute/samples/V1/ReservationsClient/get_iam_policy.php +++ b/Compute/samples/V1/ReservationsClient/get_iam_policy.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_Reservations_GetIamPolicy_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\ReservationsClient; +use Google\Cloud\Compute\V1\GetIamPolicyReservationRequest; use Google\Cloud\Compute\V1\Policy; -use Google\Cloud\Compute\V1\ReservationsClient; /** * Gets the access control policy for a resource. May be empty if no such policy or resource exists. @@ -39,10 +40,16 @@ function get_iam_policy_sample(string $project, string $resource, string $zone): // Create a client. $reservationsClient = new ReservationsClient(); + // Prepare the request message. + $request = (new GetIamPolicyReservationRequest()) + ->setProject($project) + ->setResource($resource) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var Policy $response */ - $response = $reservationsClient->getIamPolicy($project, $resource, $zone); + $response = $reservationsClient->getIamPolicy($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/ReservationsClient/insert.php b/Compute/samples/V1/ReservationsClient/insert.php index 2db95a83258d..9120b13ca72f 100644 --- a/Compute/samples/V1/ReservationsClient/insert.php +++ b/Compute/samples/V1/ReservationsClient/insert.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_Reservations_Insert_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\ReservationsClient; +use Google\Cloud\Compute\V1\InsertReservationRequest; use Google\Cloud\Compute\V1\Reservation; -use Google\Cloud\Compute\V1\ReservationsClient; use Google\Rpc\Status; /** @@ -40,13 +41,17 @@ function insert_sample(string $project, string $zone): void // Create a client. $reservationsClient = new ReservationsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $reservationResource = new Reservation(); + $request = (new InsertReservationRequest()) + ->setProject($project) + ->setReservationResource($reservationResource) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $reservationsClient->insert($project, $reservationResource, $zone); + $response = $reservationsClient->insert($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/ReservationsClient/list.php b/Compute/samples/V1/ReservationsClient/list.php index 59cf60d28b91..768ffe6a49f6 100644 --- a/Compute/samples/V1/ReservationsClient/list.php +++ b/Compute/samples/V1/ReservationsClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_Reservations_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\ReservationsClient; +use Google\Cloud\Compute\V1\Client\ReservationsClient; +use Google\Cloud\Compute\V1\ListReservationsRequest; /** * A list of all the reservations that have been configured for the specified project in specified zone. @@ -38,10 +39,15 @@ function list_sample(string $project, string $zone): void // Create a client. $reservationsClient = new ReservationsClient(); + // Prepare the request message. + $request = (new ListReservationsRequest()) + ->setProject($project) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $reservationsClient->list($project, $zone); + $response = $reservationsClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/ReservationsClient/resize.php b/Compute/samples/V1/ReservationsClient/resize.php index 9f19047a9624..5efacbb4ca1b 100644 --- a/Compute/samples/V1/ReservationsClient/resize.php +++ b/Compute/samples/V1/ReservationsClient/resize.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_Reservations_Resize_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\ReservationsClient; +use Google\Cloud\Compute\V1\Client\ReservationsClient; use Google\Cloud\Compute\V1\ReservationsResizeRequest; +use Google\Cloud\Compute\V1\ResizeReservationRequest; use Google\Rpc\Status; /** @@ -41,18 +42,18 @@ function resize_sample(string $project, string $reservation, string $zone): void // Create a client. $reservationsClient = new ReservationsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $reservationsResizeRequestResource = new ReservationsResizeRequest(); + $request = (new ResizeReservationRequest()) + ->setProject($project) + ->setReservation($reservation) + ->setReservationsResizeRequestResource($reservationsResizeRequestResource) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $reservationsClient->resize( - $project, - $reservation, - $reservationsResizeRequestResource, - $zone - ); + $response = $reservationsClient->resize($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/ReservationsClient/set_iam_policy.php b/Compute/samples/V1/ReservationsClient/set_iam_policy.php index 7e559a1fb369..3fd2358d2b24 100644 --- a/Compute/samples/V1/ReservationsClient/set_iam_policy.php +++ b/Compute/samples/V1/ReservationsClient/set_iam_policy.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_Reservations_SetIamPolicy_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\ReservationsClient; use Google\Cloud\Compute\V1\Policy; -use Google\Cloud\Compute\V1\ReservationsClient; +use Google\Cloud\Compute\V1\SetIamPolicyReservationRequest; use Google\Cloud\Compute\V1\ZoneSetPolicyRequest; /** @@ -40,18 +41,18 @@ function set_iam_policy_sample(string $project, string $resource, string $zone): // Create a client. $reservationsClient = new ReservationsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $zoneSetPolicyRequestResource = new ZoneSetPolicyRequest(); + $request = (new SetIamPolicyReservationRequest()) + ->setProject($project) + ->setResource($resource) + ->setZone($zone) + ->setZoneSetPolicyRequestResource($zoneSetPolicyRequestResource); // Call the API and handle any network failures. try { /** @var Policy $response */ - $response = $reservationsClient->setIamPolicy( - $project, - $resource, - $zone, - $zoneSetPolicyRequestResource - ); + $response = $reservationsClient->setIamPolicy($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/ReservationsClient/test_iam_permissions.php b/Compute/samples/V1/ReservationsClient/test_iam_permissions.php index 5940f9e5537d..e4b4203e24fc 100644 --- a/Compute/samples/V1/ReservationsClient/test_iam_permissions.php +++ b/Compute/samples/V1/ReservationsClient/test_iam_permissions.php @@ -24,7 +24,8 @@ // [START compute_v1_generated_Reservations_TestIamPermissions_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\ReservationsClient; +use Google\Cloud\Compute\V1\Client\ReservationsClient; +use Google\Cloud\Compute\V1\TestIamPermissionsReservationRequest; use Google\Cloud\Compute\V1\TestPermissionsRequest; use Google\Cloud\Compute\V1\TestPermissionsResponse; @@ -40,18 +41,18 @@ function test_iam_permissions_sample(string $project, string $resource, string $ // Create a client. $reservationsClient = new ReservationsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $testPermissionsRequestResource = new TestPermissionsRequest(); + $request = (new TestIamPermissionsReservationRequest()) + ->setProject($project) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var TestPermissionsResponse $response */ - $response = $reservationsClient->testIamPermissions( - $project, - $resource, - $testPermissionsRequestResource, - $zone - ); + $response = $reservationsClient->testIamPermissions($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/ReservationsClient/update.php b/Compute/samples/V1/ReservationsClient/update.php index 73b7b1a03560..7c034d44e61b 100644 --- a/Compute/samples/V1/ReservationsClient/update.php +++ b/Compute/samples/V1/ReservationsClient/update.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_Reservations_Update_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\ReservationsClient; use Google\Cloud\Compute\V1\Reservation; -use Google\Cloud\Compute\V1\ReservationsClient; +use Google\Cloud\Compute\V1\UpdateReservationRequest; use Google\Rpc\Status; /** @@ -41,13 +42,18 @@ function update_sample(string $project, string $reservation, string $zone): void // Create a client. $reservationsClient = new ReservationsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $reservationResource = new Reservation(); + $request = (new UpdateReservationRequest()) + ->setProject($project) + ->setReservation($reservation) + ->setReservationResource($reservationResource) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $reservationsClient->update($project, $reservation, $reservationResource, $zone); + $response = $reservationsClient->update($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/ResourcePoliciesClient/aggregated_list.php b/Compute/samples/V1/ResourcePoliciesClient/aggregated_list.php index 03444991be73..3469fc357423 100644 --- a/Compute/samples/V1/ResourcePoliciesClient/aggregated_list.php +++ b/Compute/samples/V1/ResourcePoliciesClient/aggregated_list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_ResourcePolicies_AggregatedList_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\ResourcePoliciesClient; +use Google\Cloud\Compute\V1\AggregatedListResourcePoliciesRequest; +use Google\Cloud\Compute\V1\Client\ResourcePoliciesClient; /** * Retrieves an aggregated list of resource policies. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. @@ -37,10 +38,14 @@ function aggregated_list_sample(string $project): void // Create a client. $resourcePoliciesClient = new ResourcePoliciesClient(); + // Prepare the request message. + $request = (new AggregatedListResourcePoliciesRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $resourcePoliciesClient->aggregatedList($project); + $response = $resourcePoliciesClient->aggregatedList($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/ResourcePoliciesClient/delete.php b/Compute/samples/V1/ResourcePoliciesClient/delete.php index b4022523062f..2ae0354500bd 100644 --- a/Compute/samples/V1/ResourcePoliciesClient/delete.php +++ b/Compute/samples/V1/ResourcePoliciesClient/delete.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_ResourcePolicies_Delete_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\ResourcePoliciesClient; +use Google\Cloud\Compute\V1\Client\ResourcePoliciesClient; +use Google\Cloud\Compute\V1\DeleteResourcePolicyRequest; use Google\Rpc\Status; /** @@ -40,10 +41,16 @@ function delete_sample(string $project, string $region, string $resourcePolicy): // Create a client. $resourcePoliciesClient = new ResourcePoliciesClient(); + // Prepare the request message. + $request = (new DeleteResourcePolicyRequest()) + ->setProject($project) + ->setRegion($region) + ->setResourcePolicy($resourcePolicy); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $resourcePoliciesClient->delete($project, $region, $resourcePolicy); + $response = $resourcePoliciesClient->delete($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/ResourcePoliciesClient/get.php b/Compute/samples/V1/ResourcePoliciesClient/get.php index 0a3bd90af69c..75f1bbc9ff9f 100644 --- a/Compute/samples/V1/ResourcePoliciesClient/get.php +++ b/Compute/samples/V1/ResourcePoliciesClient/get.php @@ -24,7 +24,8 @@ // [START compute_v1_generated_ResourcePolicies_Get_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\ResourcePoliciesClient; +use Google\Cloud\Compute\V1\Client\ResourcePoliciesClient; +use Google\Cloud\Compute\V1\GetResourcePolicyRequest; use Google\Cloud\Compute\V1\ResourcePolicy; /** @@ -39,10 +40,16 @@ function get_sample(string $project, string $region, string $resourcePolicy): vo // Create a client. $resourcePoliciesClient = new ResourcePoliciesClient(); + // Prepare the request message. + $request = (new GetResourcePolicyRequest()) + ->setProject($project) + ->setRegion($region) + ->setResourcePolicy($resourcePolicy); + // Call the API and handle any network failures. try { /** @var ResourcePolicy $response */ - $response = $resourcePoliciesClient->get($project, $region, $resourcePolicy); + $response = $resourcePoliciesClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/ResourcePoliciesClient/get_iam_policy.php b/Compute/samples/V1/ResourcePoliciesClient/get_iam_policy.php index 78ce6a3e45a1..df504b3b2bff 100644 --- a/Compute/samples/V1/ResourcePoliciesClient/get_iam_policy.php +++ b/Compute/samples/V1/ResourcePoliciesClient/get_iam_policy.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_ResourcePolicies_GetIamPolicy_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\ResourcePoliciesClient; +use Google\Cloud\Compute\V1\GetIamPolicyResourcePolicyRequest; use Google\Cloud\Compute\V1\Policy; -use Google\Cloud\Compute\V1\ResourcePoliciesClient; /** * Gets the access control policy for a resource. May be empty if no such policy or resource exists. @@ -39,10 +40,16 @@ function get_iam_policy_sample(string $project, string $region, string $resource // Create a client. $resourcePoliciesClient = new ResourcePoliciesClient(); + // Prepare the request message. + $request = (new GetIamPolicyResourcePolicyRequest()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource); + // Call the API and handle any network failures. try { /** @var Policy $response */ - $response = $resourcePoliciesClient->getIamPolicy($project, $region, $resource); + $response = $resourcePoliciesClient->getIamPolicy($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/ResourcePoliciesClient/insert.php b/Compute/samples/V1/ResourcePoliciesClient/insert.php index b12878581430..d3d9d070be4d 100644 --- a/Compute/samples/V1/ResourcePoliciesClient/insert.php +++ b/Compute/samples/V1/ResourcePoliciesClient/insert.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_ResourcePolicies_Insert_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\ResourcePoliciesClient; +use Google\Cloud\Compute\V1\Client\ResourcePoliciesClient; +use Google\Cloud\Compute\V1\InsertResourcePolicyRequest; use Google\Cloud\Compute\V1\ResourcePolicy; use Google\Rpc\Status; @@ -40,13 +41,17 @@ function insert_sample(string $project, string $region): void // Create a client. $resourcePoliciesClient = new ResourcePoliciesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $resourcePolicyResource = new ResourcePolicy(); + $request = (new InsertResourcePolicyRequest()) + ->setProject($project) + ->setRegion($region) + ->setResourcePolicyResource($resourcePolicyResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $resourcePoliciesClient->insert($project, $region, $resourcePolicyResource); + $response = $resourcePoliciesClient->insert($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/ResourcePoliciesClient/list.php b/Compute/samples/V1/ResourcePoliciesClient/list.php index 61943e1b460a..230fea43f35e 100644 --- a/Compute/samples/V1/ResourcePoliciesClient/list.php +++ b/Compute/samples/V1/ResourcePoliciesClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_ResourcePolicies_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\ResourcePoliciesClient; +use Google\Cloud\Compute\V1\Client\ResourcePoliciesClient; +use Google\Cloud\Compute\V1\ListResourcePoliciesRequest; /** * A list all the resource policies that have been configured for the specified project in specified region. @@ -38,10 +39,15 @@ function list_sample(string $project, string $region): void // Create a client. $resourcePoliciesClient = new ResourcePoliciesClient(); + // Prepare the request message. + $request = (new ListResourcePoliciesRequest()) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $resourcePoliciesClient->list($project, $region); + $response = $resourcePoliciesClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/ResourcePoliciesClient/patch.php b/Compute/samples/V1/ResourcePoliciesClient/patch.php index d496ab19c5b8..b94e8e633550 100644 --- a/Compute/samples/V1/ResourcePoliciesClient/patch.php +++ b/Compute/samples/V1/ResourcePoliciesClient/patch.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_ResourcePolicies_Patch_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\ResourcePoliciesClient; +use Google\Cloud\Compute\V1\Client\ResourcePoliciesClient; +use Google\Cloud\Compute\V1\PatchResourcePolicyRequest; use Google\Cloud\Compute\V1\ResourcePolicy; use Google\Rpc\Status; @@ -41,18 +42,18 @@ function patch_sample(string $project, string $region, string $resourcePolicy): // Create a client. $resourcePoliciesClient = new ResourcePoliciesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $resourcePolicyResource = new ResourcePolicy(); + $request = (new PatchResourcePolicyRequest()) + ->setProject($project) + ->setRegion($region) + ->setResourcePolicy($resourcePolicy) + ->setResourcePolicyResource($resourcePolicyResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $resourcePoliciesClient->patch( - $project, - $region, - $resourcePolicy, - $resourcePolicyResource - ); + $response = $resourcePoliciesClient->patch($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/ResourcePoliciesClient/set_iam_policy.php b/Compute/samples/V1/ResourcePoliciesClient/set_iam_policy.php index 6f21b8c67f18..5942f57c5759 100644 --- a/Compute/samples/V1/ResourcePoliciesClient/set_iam_policy.php +++ b/Compute/samples/V1/ResourcePoliciesClient/set_iam_policy.php @@ -24,9 +24,10 @@ // [START compute_v1_generated_ResourcePolicies_SetIamPolicy_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\ResourcePoliciesClient; use Google\Cloud\Compute\V1\Policy; use Google\Cloud\Compute\V1\RegionSetPolicyRequest; -use Google\Cloud\Compute\V1\ResourcePoliciesClient; +use Google\Cloud\Compute\V1\SetIamPolicyResourcePolicyRequest; /** * Sets the access control policy on the specified resource. Replaces any existing policy. @@ -40,18 +41,18 @@ function set_iam_policy_sample(string $project, string $region, string $resource // Create a client. $resourcePoliciesClient = new ResourcePoliciesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $regionSetPolicyRequestResource = new RegionSetPolicyRequest(); + $request = (new SetIamPolicyResourcePolicyRequest()) + ->setProject($project) + ->setRegion($region) + ->setRegionSetPolicyRequestResource($regionSetPolicyRequestResource) + ->setResource($resource); // Call the API and handle any network failures. try { /** @var Policy $response */ - $response = $resourcePoliciesClient->setIamPolicy( - $project, - $region, - $regionSetPolicyRequestResource, - $resource - ); + $response = $resourcePoliciesClient->setIamPolicy($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/ResourcePoliciesClient/test_iam_permissions.php b/Compute/samples/V1/ResourcePoliciesClient/test_iam_permissions.php index ddbd8a3a5f5f..38460ebfc6c4 100644 --- a/Compute/samples/V1/ResourcePoliciesClient/test_iam_permissions.php +++ b/Compute/samples/V1/ResourcePoliciesClient/test_iam_permissions.php @@ -24,7 +24,8 @@ // [START compute_v1_generated_ResourcePolicies_TestIamPermissions_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\ResourcePoliciesClient; +use Google\Cloud\Compute\V1\Client\ResourcePoliciesClient; +use Google\Cloud\Compute\V1\TestIamPermissionsResourcePolicyRequest; use Google\Cloud\Compute\V1\TestPermissionsRequest; use Google\Cloud\Compute\V1\TestPermissionsResponse; @@ -40,18 +41,18 @@ function test_iam_permissions_sample(string $project, string $region, string $re // Create a client. $resourcePoliciesClient = new ResourcePoliciesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $testPermissionsRequestResource = new TestPermissionsRequest(); + $request = (new TestIamPermissionsResourcePolicyRequest()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); // Call the API and handle any network failures. try { /** @var TestPermissionsResponse $response */ - $response = $resourcePoliciesClient->testIamPermissions( - $project, - $region, - $resource, - $testPermissionsRequestResource - ); + $response = $resourcePoliciesClient->testIamPermissions($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/RoutersClient/aggregated_list.php b/Compute/samples/V1/RoutersClient/aggregated_list.php index 1ad6a6bda2e4..4e325b20b432 100644 --- a/Compute/samples/V1/RoutersClient/aggregated_list.php +++ b/Compute/samples/V1/RoutersClient/aggregated_list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_Routers_AggregatedList_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\RoutersClient; +use Google\Cloud\Compute\V1\AggregatedListRoutersRequest; +use Google\Cloud\Compute\V1\Client\RoutersClient; /** * Retrieves an aggregated list of routers. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. @@ -37,10 +38,14 @@ function aggregated_list_sample(string $project): void // Create a client. $routersClient = new RoutersClient(); + // Prepare the request message. + $request = (new AggregatedListRoutersRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $routersClient->aggregatedList($project); + $response = $routersClient->aggregatedList($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/RoutersClient/delete.php b/Compute/samples/V1/RoutersClient/delete.php index a40bc4534ff6..4e6fc95e2b44 100644 --- a/Compute/samples/V1/RoutersClient/delete.php +++ b/Compute/samples/V1/RoutersClient/delete.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_Routers_Delete_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\RoutersClient; +use Google\Cloud\Compute\V1\Client\RoutersClient; +use Google\Cloud\Compute\V1\DeleteRouterRequest; use Google\Rpc\Status; /** @@ -40,10 +41,16 @@ function delete_sample(string $project, string $region, string $router): void // Create a client. $routersClient = new RoutersClient(); + // Prepare the request message. + $request = (new DeleteRouterRequest()) + ->setProject($project) + ->setRegion($region) + ->setRouter($router); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $routersClient->delete($project, $region, $router); + $response = $routersClient->delete($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RoutersClient/get.php b/Compute/samples/V1/RoutersClient/get.php index 529d3943915a..0ad1ec8497ab 100644 --- a/Compute/samples/V1/RoutersClient/get.php +++ b/Compute/samples/V1/RoutersClient/get.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_Routers_Get_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\RoutersClient; +use Google\Cloud\Compute\V1\GetRouterRequest; use Google\Cloud\Compute\V1\Router; -use Google\Cloud\Compute\V1\RoutersClient; /** * Returns the specified Router resource. @@ -39,10 +40,16 @@ function get_sample(string $project, string $region, string $router): void // Create a client. $routersClient = new RoutersClient(); + // Prepare the request message. + $request = (new GetRouterRequest()) + ->setProject($project) + ->setRegion($region) + ->setRouter($router); + // Call the API and handle any network failures. try { /** @var Router $response */ - $response = $routersClient->get($project, $region, $router); + $response = $routersClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/RoutersClient/get_nat_ip_info.php b/Compute/samples/V1/RoutersClient/get_nat_ip_info.php index 44d12e821ee5..e6346b7473ff 100644 --- a/Compute/samples/V1/RoutersClient/get_nat_ip_info.php +++ b/Compute/samples/V1/RoutersClient/get_nat_ip_info.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_Routers_GetNatIpInfo_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\RoutersClient; +use Google\Cloud\Compute\V1\GetNatIpInfoRouterRequest; use Google\Cloud\Compute\V1\NatIpInfoResponse; -use Google\Cloud\Compute\V1\RoutersClient; /** * Retrieves runtime NAT IP information. @@ -39,10 +40,16 @@ function get_nat_ip_info_sample(string $project, string $region, string $router) // Create a client. $routersClient = new RoutersClient(); + // Prepare the request message. + $request = (new GetNatIpInfoRouterRequest()) + ->setProject($project) + ->setRegion($region) + ->setRouter($router); + // Call the API and handle any network failures. try { /** @var NatIpInfoResponse $response */ - $response = $routersClient->getNatIpInfo($project, $region, $router); + $response = $routersClient->getNatIpInfo($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/RoutersClient/get_nat_mapping_info.php b/Compute/samples/V1/RoutersClient/get_nat_mapping_info.php index 07b66a35c54f..0e7c1a4cf7ec 100644 --- a/Compute/samples/V1/RoutersClient/get_nat_mapping_info.php +++ b/Compute/samples/V1/RoutersClient/get_nat_mapping_info.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_Routers_GetNatMappingInfo_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\RoutersClient; +use Google\Cloud\Compute\V1\Client\RoutersClient; +use Google\Cloud\Compute\V1\GetNatMappingInfoRoutersRequest; /** * Retrieves runtime Nat mapping information of VM endpoints. @@ -39,10 +40,16 @@ function get_nat_mapping_info_sample(string $project, string $region, string $ro // Create a client. $routersClient = new RoutersClient(); + // Prepare the request message. + $request = (new GetNatMappingInfoRoutersRequest()) + ->setProject($project) + ->setRegion($region) + ->setRouter($router); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $routersClient->getNatMappingInfo($project, $region, $router); + $response = $routersClient->getNatMappingInfo($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/RoutersClient/get_router_status.php b/Compute/samples/V1/RoutersClient/get_router_status.php index adfe65c679d5..0f37caa36319 100644 --- a/Compute/samples/V1/RoutersClient/get_router_status.php +++ b/Compute/samples/V1/RoutersClient/get_router_status.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_Routers_GetRouterStatus_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\RoutersClient; +use Google\Cloud\Compute\V1\GetRouterStatusRouterRequest; use Google\Cloud\Compute\V1\RouterStatusResponse; -use Google\Cloud\Compute\V1\RoutersClient; /** * Retrieves runtime information of the specified router. @@ -39,10 +40,16 @@ function get_router_status_sample(string $project, string $region, string $route // Create a client. $routersClient = new RoutersClient(); + // Prepare the request message. + $request = (new GetRouterStatusRouterRequest()) + ->setProject($project) + ->setRegion($region) + ->setRouter($router); + // Call the API and handle any network failures. try { /** @var RouterStatusResponse $response */ - $response = $routersClient->getRouterStatus($project, $region, $router); + $response = $routersClient->getRouterStatus($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/RoutersClient/insert.php b/Compute/samples/V1/RoutersClient/insert.php index 2ee93400ecb6..a482713196fd 100644 --- a/Compute/samples/V1/RoutersClient/insert.php +++ b/Compute/samples/V1/RoutersClient/insert.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_Routers_Insert_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\RoutersClient; +use Google\Cloud\Compute\V1\InsertRouterRequest; use Google\Cloud\Compute\V1\Router; -use Google\Cloud\Compute\V1\RoutersClient; use Google\Rpc\Status; /** @@ -40,13 +41,17 @@ function insert_sample(string $project, string $region): void // Create a client. $routersClient = new RoutersClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $routerResource = new Router(); + $request = (new InsertRouterRequest()) + ->setProject($project) + ->setRegion($region) + ->setRouterResource($routerResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $routersClient->insert($project, $region, $routerResource); + $response = $routersClient->insert($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RoutersClient/list.php b/Compute/samples/V1/RoutersClient/list.php index 43610a94373d..44d561443568 100644 --- a/Compute/samples/V1/RoutersClient/list.php +++ b/Compute/samples/V1/RoutersClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_Routers_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\RoutersClient; +use Google\Cloud\Compute\V1\Client\RoutersClient; +use Google\Cloud\Compute\V1\ListRoutersRequest; /** * Retrieves a list of Router resources available to the specified project. @@ -38,10 +39,15 @@ function list_sample(string $project, string $region): void // Create a client. $routersClient = new RoutersClient(); + // Prepare the request message. + $request = (new ListRoutersRequest()) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $routersClient->list($project, $region); + $response = $routersClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/RoutersClient/patch.php b/Compute/samples/V1/RoutersClient/patch.php index 9a56d2a10ba8..422d3f6462c8 100644 --- a/Compute/samples/V1/RoutersClient/patch.php +++ b/Compute/samples/V1/RoutersClient/patch.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_Routers_Patch_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\RoutersClient; +use Google\Cloud\Compute\V1\PatchRouterRequest; use Google\Cloud\Compute\V1\Router; -use Google\Cloud\Compute\V1\RoutersClient; use Google\Rpc\Status; /** @@ -41,13 +42,18 @@ function patch_sample(string $project, string $region, string $router): void // Create a client. $routersClient = new RoutersClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $routerResource = new Router(); + $request = (new PatchRouterRequest()) + ->setProject($project) + ->setRegion($region) + ->setRouter($router) + ->setRouterResource($routerResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $routersClient->patch($project, $region, $router, $routerResource); + $response = $routersClient->patch($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RoutersClient/preview.php b/Compute/samples/V1/RoutersClient/preview.php index 18eeb99e60ce..ae32f62ce0b5 100644 --- a/Compute/samples/V1/RoutersClient/preview.php +++ b/Compute/samples/V1/RoutersClient/preview.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_Routers_Preview_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\RoutersClient; +use Google\Cloud\Compute\V1\PreviewRouterRequest; use Google\Cloud\Compute\V1\Router; -use Google\Cloud\Compute\V1\RoutersClient; use Google\Cloud\Compute\V1\RoutersPreviewResponse; /** @@ -40,13 +41,18 @@ function preview_sample(string $project, string $region, string $router): void // Create a client. $routersClient = new RoutersClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $routerResource = new Router(); + $request = (new PreviewRouterRequest()) + ->setProject($project) + ->setRegion($region) + ->setRouter($router) + ->setRouterResource($routerResource); // Call the API and handle any network failures. try { /** @var RoutersPreviewResponse $response */ - $response = $routersClient->preview($project, $region, $router, $routerResource); + $response = $routersClient->preview($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/RoutersClient/update.php b/Compute/samples/V1/RoutersClient/update.php index 31f34a4483e7..828002679d3d 100644 --- a/Compute/samples/V1/RoutersClient/update.php +++ b/Compute/samples/V1/RoutersClient/update.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_Routers_Update_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\RoutersClient; use Google\Cloud\Compute\V1\Router; -use Google\Cloud\Compute\V1\RoutersClient; +use Google\Cloud\Compute\V1\UpdateRouterRequest; use Google\Rpc\Status; /** @@ -41,13 +42,18 @@ function update_sample(string $project, string $region, string $router): void // Create a client. $routersClient = new RoutersClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $routerResource = new Router(); + $request = (new UpdateRouterRequest()) + ->setProject($project) + ->setRegion($region) + ->setRouter($router) + ->setRouterResource($routerResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $routersClient->update($project, $region, $router, $routerResource); + $response = $routersClient->update($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RoutesClient/delete.php b/Compute/samples/V1/RoutesClient/delete.php index e3abc6829f23..693afc609852 100644 --- a/Compute/samples/V1/RoutesClient/delete.php +++ b/Compute/samples/V1/RoutesClient/delete.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_Routes_Delete_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\RoutesClient; +use Google\Cloud\Compute\V1\Client\RoutesClient; +use Google\Cloud\Compute\V1\DeleteRouteRequest; use Google\Rpc\Status; /** @@ -39,10 +40,15 @@ function delete_sample(string $project, string $route): void // Create a client. $routesClient = new RoutesClient(); + // Prepare the request message. + $request = (new DeleteRouteRequest()) + ->setProject($project) + ->setRoute($route); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $routesClient->delete($project, $route); + $response = $routesClient->delete($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RoutesClient/get.php b/Compute/samples/V1/RoutesClient/get.php index ed21dc2b004b..2758bbbf1e64 100644 --- a/Compute/samples/V1/RoutesClient/get.php +++ b/Compute/samples/V1/RoutesClient/get.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_Routes_Get_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\RoutesClient; +use Google\Cloud\Compute\V1\GetRouteRequest; use Google\Cloud\Compute\V1\Route; -use Google\Cloud\Compute\V1\RoutesClient; /** * Returns the specified Route resource. @@ -38,10 +39,15 @@ function get_sample(string $project, string $route): void // Create a client. $routesClient = new RoutesClient(); + // Prepare the request message. + $request = (new GetRouteRequest()) + ->setProject($project) + ->setRoute($route); + // Call the API and handle any network failures. try { /** @var Route $response */ - $response = $routesClient->get($project, $route); + $response = $routesClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/RoutesClient/insert.php b/Compute/samples/V1/RoutesClient/insert.php index e0d73274d271..30187f4ff9ba 100644 --- a/Compute/samples/V1/RoutesClient/insert.php +++ b/Compute/samples/V1/RoutesClient/insert.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_Routes_Insert_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\RoutesClient; +use Google\Cloud\Compute\V1\InsertRouteRequest; use Google\Cloud\Compute\V1\Route; -use Google\Cloud\Compute\V1\RoutesClient; use Google\Rpc\Status; /** @@ -39,13 +40,16 @@ function insert_sample(string $project): void // Create a client. $routesClient = new RoutesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $routeResource = new Route(); + $request = (new InsertRouteRequest()) + ->setProject($project) + ->setRouteResource($routeResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $routesClient->insert($project, $routeResource); + $response = $routesClient->insert($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/RoutesClient/list.php b/Compute/samples/V1/RoutesClient/list.php index 6cf54edd718a..2ae3e92efa08 100644 --- a/Compute/samples/V1/RoutesClient/list.php +++ b/Compute/samples/V1/RoutesClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_Routes_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\RoutesClient; +use Google\Cloud\Compute\V1\Client\RoutesClient; +use Google\Cloud\Compute\V1\ListRoutesRequest; /** * Retrieves the list of Route resources available to the specified project. @@ -37,10 +38,14 @@ function list_sample(string $project): void // Create a client. $routesClient = new RoutesClient(); + // Prepare the request message. + $request = (new ListRoutesRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $routesClient->list($project); + $response = $routesClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/SecurityPoliciesClient/add_rule.php b/Compute/samples/V1/SecurityPoliciesClient/add_rule.php index 99b1339366de..c0393994bbbe 100644 --- a/Compute/samples/V1/SecurityPoliciesClient/add_rule.php +++ b/Compute/samples/V1/SecurityPoliciesClient/add_rule.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_SecurityPolicies_AddRule_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\SecurityPoliciesClient; +use Google\Cloud\Compute\V1\AddRuleSecurityPolicyRequest; +use Google\Cloud\Compute\V1\Client\SecurityPoliciesClient; use Google\Cloud\Compute\V1\SecurityPolicyRule; use Google\Rpc\Status; @@ -40,17 +41,17 @@ function add_rule_sample(string $project, string $securityPolicy): void // Create a client. $securityPoliciesClient = new SecurityPoliciesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $securityPolicyRuleResource = new SecurityPolicyRule(); + $request = (new AddRuleSecurityPolicyRequest()) + ->setProject($project) + ->setSecurityPolicy($securityPolicy) + ->setSecurityPolicyRuleResource($securityPolicyRuleResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $securityPoliciesClient->addRule( - $project, - $securityPolicy, - $securityPolicyRuleResource - ); + $response = $securityPoliciesClient->addRule($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/SecurityPoliciesClient/aggregated_list.php b/Compute/samples/V1/SecurityPoliciesClient/aggregated_list.php index eafd8d6f3957..8bcb781e07a0 100644 --- a/Compute/samples/V1/SecurityPoliciesClient/aggregated_list.php +++ b/Compute/samples/V1/SecurityPoliciesClient/aggregated_list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_SecurityPolicies_AggregatedList_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\SecurityPoliciesClient; +use Google\Cloud\Compute\V1\AggregatedListSecurityPoliciesRequest; +use Google\Cloud\Compute\V1\Client\SecurityPoliciesClient; /** * 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`. @@ -37,10 +38,14 @@ function aggregated_list_sample(string $project): void // Create a client. $securityPoliciesClient = new SecurityPoliciesClient(); + // Prepare the request message. + $request = (new AggregatedListSecurityPoliciesRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $securityPoliciesClient->aggregatedList($project); + $response = $securityPoliciesClient->aggregatedList($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/SecurityPoliciesClient/delete.php b/Compute/samples/V1/SecurityPoliciesClient/delete.php index 539219a58a70..9405178aa028 100644 --- a/Compute/samples/V1/SecurityPoliciesClient/delete.php +++ b/Compute/samples/V1/SecurityPoliciesClient/delete.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_SecurityPolicies_Delete_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\SecurityPoliciesClient; +use Google\Cloud\Compute\V1\Client\SecurityPoliciesClient; +use Google\Cloud\Compute\V1\DeleteSecurityPolicyRequest; use Google\Rpc\Status; /** @@ -39,10 +40,15 @@ function delete_sample(string $project, string $securityPolicy): void // Create a client. $securityPoliciesClient = new SecurityPoliciesClient(); + // Prepare the request message. + $request = (new DeleteSecurityPolicyRequest()) + ->setProject($project) + ->setSecurityPolicy($securityPolicy); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $securityPoliciesClient->delete($project, $securityPolicy); + $response = $securityPoliciesClient->delete($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/SecurityPoliciesClient/get.php b/Compute/samples/V1/SecurityPoliciesClient/get.php index ea0f640e3030..5c8ed3a54e95 100644 --- a/Compute/samples/V1/SecurityPoliciesClient/get.php +++ b/Compute/samples/V1/SecurityPoliciesClient/get.php @@ -24,7 +24,8 @@ // [START compute_v1_generated_SecurityPolicies_Get_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\SecurityPoliciesClient; +use Google\Cloud\Compute\V1\Client\SecurityPoliciesClient; +use Google\Cloud\Compute\V1\GetSecurityPolicyRequest; use Google\Cloud\Compute\V1\SecurityPolicy; /** @@ -38,10 +39,15 @@ function get_sample(string $project, string $securityPolicy): void // Create a client. $securityPoliciesClient = new SecurityPoliciesClient(); + // Prepare the request message. + $request = (new GetSecurityPolicyRequest()) + ->setProject($project) + ->setSecurityPolicy($securityPolicy); + // Call the API and handle any network failures. try { /** @var SecurityPolicy $response */ - $response = $securityPoliciesClient->get($project, $securityPolicy); + $response = $securityPoliciesClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/SecurityPoliciesClient/get_rule.php b/Compute/samples/V1/SecurityPoliciesClient/get_rule.php index 945663406d0a..0ac2e4e977ab 100644 --- a/Compute/samples/V1/SecurityPoliciesClient/get_rule.php +++ b/Compute/samples/V1/SecurityPoliciesClient/get_rule.php @@ -24,7 +24,8 @@ // [START compute_v1_generated_SecurityPolicies_GetRule_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\SecurityPoliciesClient; +use Google\Cloud\Compute\V1\Client\SecurityPoliciesClient; +use Google\Cloud\Compute\V1\GetRuleSecurityPolicyRequest; use Google\Cloud\Compute\V1\SecurityPolicyRule; /** @@ -38,10 +39,15 @@ function get_rule_sample(string $project, string $securityPolicy): void // Create a client. $securityPoliciesClient = new SecurityPoliciesClient(); + // Prepare the request message. + $request = (new GetRuleSecurityPolicyRequest()) + ->setProject($project) + ->setSecurityPolicy($securityPolicy); + // Call the API and handle any network failures. try { /** @var SecurityPolicyRule $response */ - $response = $securityPoliciesClient->getRule($project, $securityPolicy); + $response = $securityPoliciesClient->getRule($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/SecurityPoliciesClient/insert.php b/Compute/samples/V1/SecurityPoliciesClient/insert.php index ccfee1ff9db8..52f5121ba742 100644 --- a/Compute/samples/V1/SecurityPoliciesClient/insert.php +++ b/Compute/samples/V1/SecurityPoliciesClient/insert.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_SecurityPolicies_Insert_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\SecurityPoliciesClient; +use Google\Cloud\Compute\V1\Client\SecurityPoliciesClient; +use Google\Cloud\Compute\V1\InsertSecurityPolicyRequest; use Google\Cloud\Compute\V1\SecurityPolicy; use Google\Rpc\Status; @@ -39,13 +40,16 @@ function insert_sample(string $project): void // Create a client. $securityPoliciesClient = new SecurityPoliciesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $securityPolicyResource = new SecurityPolicy(); + $request = (new InsertSecurityPolicyRequest()) + ->setProject($project) + ->setSecurityPolicyResource($securityPolicyResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $securityPoliciesClient->insert($project, $securityPolicyResource); + $response = $securityPoliciesClient->insert($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/SecurityPoliciesClient/list.php b/Compute/samples/V1/SecurityPoliciesClient/list.php index a9cc050218b7..c7a799a41358 100644 --- a/Compute/samples/V1/SecurityPoliciesClient/list.php +++ b/Compute/samples/V1/SecurityPoliciesClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_SecurityPolicies_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\SecurityPoliciesClient; +use Google\Cloud\Compute\V1\Client\SecurityPoliciesClient; +use Google\Cloud\Compute\V1\ListSecurityPoliciesRequest; /** * List all the policies that have been configured for the specified project. @@ -37,10 +38,14 @@ function list_sample(string $project): void // Create a client. $securityPoliciesClient = new SecurityPoliciesClient(); + // Prepare the request message. + $request = (new ListSecurityPoliciesRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $securityPoliciesClient->list($project); + $response = $securityPoliciesClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/SecurityPoliciesClient/list_preconfigured_expression_sets.php b/Compute/samples/V1/SecurityPoliciesClient/list_preconfigured_expression_sets.php index 80562c7939bd..bc36f85a0e0a 100644 --- a/Compute/samples/V1/SecurityPoliciesClient/list_preconfigured_expression_sets.php +++ b/Compute/samples/V1/SecurityPoliciesClient/list_preconfigured_expression_sets.php @@ -24,7 +24,8 @@ // [START compute_v1_generated_SecurityPolicies_ListPreconfiguredExpressionSets_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\SecurityPoliciesClient; +use Google\Cloud\Compute\V1\Client\SecurityPoliciesClient; +use Google\Cloud\Compute\V1\ListPreconfiguredExpressionSetsSecurityPoliciesRequest; use Google\Cloud\Compute\V1\SecurityPoliciesListPreconfiguredExpressionSetsResponse; /** @@ -37,10 +38,14 @@ function list_preconfigured_expression_sets_sample(string $project): void // Create a client. $securityPoliciesClient = new SecurityPoliciesClient(); + // Prepare the request message. + $request = (new ListPreconfiguredExpressionSetsSecurityPoliciesRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var SecurityPoliciesListPreconfiguredExpressionSetsResponse $response */ - $response = $securityPoliciesClient->listPreconfiguredExpressionSets($project); + $response = $securityPoliciesClient->listPreconfiguredExpressionSets($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/SecurityPoliciesClient/patch.php b/Compute/samples/V1/SecurityPoliciesClient/patch.php index 851cdb577bd3..625d3cd087fb 100644 --- a/Compute/samples/V1/SecurityPoliciesClient/patch.php +++ b/Compute/samples/V1/SecurityPoliciesClient/patch.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_SecurityPolicies_Patch_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\SecurityPoliciesClient; +use Google\Cloud\Compute\V1\Client\SecurityPoliciesClient; +use Google\Cloud\Compute\V1\PatchSecurityPolicyRequest; use Google\Cloud\Compute\V1\SecurityPolicy; use Google\Rpc\Status; @@ -40,13 +41,17 @@ function patch_sample(string $project, string $securityPolicy): void // Create a client. $securityPoliciesClient = new SecurityPoliciesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $securityPolicyResource = new SecurityPolicy(); + $request = (new PatchSecurityPolicyRequest()) + ->setProject($project) + ->setSecurityPolicy($securityPolicy) + ->setSecurityPolicyResource($securityPolicyResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $securityPoliciesClient->patch($project, $securityPolicy, $securityPolicyResource); + $response = $securityPoliciesClient->patch($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/SecurityPoliciesClient/patch_rule.php b/Compute/samples/V1/SecurityPoliciesClient/patch_rule.php index 32aa125766d3..05f0436e217d 100644 --- a/Compute/samples/V1/SecurityPoliciesClient/patch_rule.php +++ b/Compute/samples/V1/SecurityPoliciesClient/patch_rule.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_SecurityPolicies_PatchRule_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\SecurityPoliciesClient; +use Google\Cloud\Compute\V1\Client\SecurityPoliciesClient; +use Google\Cloud\Compute\V1\PatchRuleSecurityPolicyRequest; use Google\Cloud\Compute\V1\SecurityPolicyRule; use Google\Rpc\Status; @@ -40,17 +41,17 @@ function patch_rule_sample(string $project, string $securityPolicy): void // Create a client. $securityPoliciesClient = new SecurityPoliciesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $securityPolicyRuleResource = new SecurityPolicyRule(); + $request = (new PatchRuleSecurityPolicyRequest()) + ->setProject($project) + ->setSecurityPolicy($securityPolicy) + ->setSecurityPolicyRuleResource($securityPolicyRuleResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $securityPoliciesClient->patchRule( - $project, - $securityPolicy, - $securityPolicyRuleResource - ); + $response = $securityPoliciesClient->patchRule($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/SecurityPoliciesClient/remove_rule.php b/Compute/samples/V1/SecurityPoliciesClient/remove_rule.php index 8c4cb0db68f3..6a04306ac858 100644 --- a/Compute/samples/V1/SecurityPoliciesClient/remove_rule.php +++ b/Compute/samples/V1/SecurityPoliciesClient/remove_rule.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_SecurityPolicies_RemoveRule_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\SecurityPoliciesClient; +use Google\Cloud\Compute\V1\Client\SecurityPoliciesClient; +use Google\Cloud\Compute\V1\RemoveRuleSecurityPolicyRequest; use Google\Rpc\Status; /** @@ -39,10 +40,15 @@ function remove_rule_sample(string $project, string $securityPolicy): void // Create a client. $securityPoliciesClient = new SecurityPoliciesClient(); + // Prepare the request message. + $request = (new RemoveRuleSecurityPolicyRequest()) + ->setProject($project) + ->setSecurityPolicy($securityPolicy); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $securityPoliciesClient->removeRule($project, $securityPolicy); + $response = $securityPoliciesClient->removeRule($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/SecurityPoliciesClient/set_labels.php b/Compute/samples/V1/SecurityPoliciesClient/set_labels.php index 945aedc0315c..44e45fc69b45 100644 --- a/Compute/samples/V1/SecurityPoliciesClient/set_labels.php +++ b/Compute/samples/V1/SecurityPoliciesClient/set_labels.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_SecurityPolicies_SetLabels_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\SecurityPoliciesClient; use Google\Cloud\Compute\V1\GlobalSetLabelsRequest; -use Google\Cloud\Compute\V1\SecurityPoliciesClient; +use Google\Cloud\Compute\V1\SetLabelsSecurityPolicyRequest; use Google\Rpc\Status; /** @@ -40,17 +41,17 @@ function set_labels_sample(string $project, string $resource): void // Create a client. $securityPoliciesClient = new SecurityPoliciesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $globalSetLabelsRequestResource = new GlobalSetLabelsRequest(); + $request = (new SetLabelsSecurityPolicyRequest()) + ->setGlobalSetLabelsRequestResource($globalSetLabelsRequestResource) + ->setProject($project) + ->setResource($resource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $securityPoliciesClient->setLabels( - $globalSetLabelsRequestResource, - $project, - $resource - ); + $response = $securityPoliciesClient->setLabels($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/ServiceAttachmentsClient/aggregated_list.php b/Compute/samples/V1/ServiceAttachmentsClient/aggregated_list.php index 17c1821427d5..ff9ddf0ef431 100644 --- a/Compute/samples/V1/ServiceAttachmentsClient/aggregated_list.php +++ b/Compute/samples/V1/ServiceAttachmentsClient/aggregated_list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_ServiceAttachments_AggregatedList_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\ServiceAttachmentsClient; +use Google\Cloud\Compute\V1\AggregatedListServiceAttachmentsRequest; +use Google\Cloud\Compute\V1\Client\ServiceAttachmentsClient; /** * 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`. @@ -37,10 +38,14 @@ function aggregated_list_sample(string $project): void // Create a client. $serviceAttachmentsClient = new ServiceAttachmentsClient(); + // Prepare the request message. + $request = (new AggregatedListServiceAttachmentsRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $serviceAttachmentsClient->aggregatedList($project); + $response = $serviceAttachmentsClient->aggregatedList($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/ServiceAttachmentsClient/delete.php b/Compute/samples/V1/ServiceAttachmentsClient/delete.php index 6d298917566c..14a106999672 100644 --- a/Compute/samples/V1/ServiceAttachmentsClient/delete.php +++ b/Compute/samples/V1/ServiceAttachmentsClient/delete.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_ServiceAttachments_Delete_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\ServiceAttachmentsClient; +use Google\Cloud\Compute\V1\Client\ServiceAttachmentsClient; +use Google\Cloud\Compute\V1\DeleteServiceAttachmentRequest; use Google\Rpc\Status; /** @@ -40,10 +41,16 @@ function delete_sample(string $project, string $region, string $serviceAttachmen // Create a client. $serviceAttachmentsClient = new ServiceAttachmentsClient(); + // Prepare the request message. + $request = (new DeleteServiceAttachmentRequest()) + ->setProject($project) + ->setRegion($region) + ->setServiceAttachment($serviceAttachment); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $serviceAttachmentsClient->delete($project, $region, $serviceAttachment); + $response = $serviceAttachmentsClient->delete($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/ServiceAttachmentsClient/get.php b/Compute/samples/V1/ServiceAttachmentsClient/get.php index 177a6eb30680..38d90b9e3c23 100644 --- a/Compute/samples/V1/ServiceAttachmentsClient/get.php +++ b/Compute/samples/V1/ServiceAttachmentsClient/get.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_ServiceAttachments_Get_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\ServiceAttachmentsClient; +use Google\Cloud\Compute\V1\GetServiceAttachmentRequest; use Google\Cloud\Compute\V1\ServiceAttachment; -use Google\Cloud\Compute\V1\ServiceAttachmentsClient; /** * Returns the specified ServiceAttachment resource in the given scope. @@ -39,10 +40,16 @@ function get_sample(string $project, string $region, string $serviceAttachment): // Create a client. $serviceAttachmentsClient = new ServiceAttachmentsClient(); + // Prepare the request message. + $request = (new GetServiceAttachmentRequest()) + ->setProject($project) + ->setRegion($region) + ->setServiceAttachment($serviceAttachment); + // Call the API and handle any network failures. try { /** @var ServiceAttachment $response */ - $response = $serviceAttachmentsClient->get($project, $region, $serviceAttachment); + $response = $serviceAttachmentsClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/ServiceAttachmentsClient/get_iam_policy.php b/Compute/samples/V1/ServiceAttachmentsClient/get_iam_policy.php index bc24b305dfa6..b2413f38f328 100644 --- a/Compute/samples/V1/ServiceAttachmentsClient/get_iam_policy.php +++ b/Compute/samples/V1/ServiceAttachmentsClient/get_iam_policy.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_ServiceAttachments_GetIamPolicy_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\ServiceAttachmentsClient; +use Google\Cloud\Compute\V1\GetIamPolicyServiceAttachmentRequest; use Google\Cloud\Compute\V1\Policy; -use Google\Cloud\Compute\V1\ServiceAttachmentsClient; /** * Gets the access control policy for a resource. May be empty if no such policy or resource exists. @@ -39,10 +40,16 @@ function get_iam_policy_sample(string $project, string $region, string $resource // Create a client. $serviceAttachmentsClient = new ServiceAttachmentsClient(); + // Prepare the request message. + $request = (new GetIamPolicyServiceAttachmentRequest()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource); + // Call the API and handle any network failures. try { /** @var Policy $response */ - $response = $serviceAttachmentsClient->getIamPolicy($project, $region, $resource); + $response = $serviceAttachmentsClient->getIamPolicy($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/ServiceAttachmentsClient/insert.php b/Compute/samples/V1/ServiceAttachmentsClient/insert.php index 1b72bf1a94a6..88ad092d5fc9 100644 --- a/Compute/samples/V1/ServiceAttachmentsClient/insert.php +++ b/Compute/samples/V1/ServiceAttachmentsClient/insert.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_ServiceAttachments_Insert_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\ServiceAttachmentsClient; +use Google\Cloud\Compute\V1\InsertServiceAttachmentRequest; use Google\Cloud\Compute\V1\ServiceAttachment; -use Google\Cloud\Compute\V1\ServiceAttachmentsClient; use Google\Rpc\Status; /** @@ -40,13 +41,17 @@ function insert_sample(string $project, string $region): void // Create a client. $serviceAttachmentsClient = new ServiceAttachmentsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $serviceAttachmentResource = new ServiceAttachment(); + $request = (new InsertServiceAttachmentRequest()) + ->setProject($project) + ->setRegion($region) + ->setServiceAttachmentResource($serviceAttachmentResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $serviceAttachmentsClient->insert($project, $region, $serviceAttachmentResource); + $response = $serviceAttachmentsClient->insert($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/ServiceAttachmentsClient/list.php b/Compute/samples/V1/ServiceAttachmentsClient/list.php index 3e5ee870b3a9..598c09f9b062 100644 --- a/Compute/samples/V1/ServiceAttachmentsClient/list.php +++ b/Compute/samples/V1/ServiceAttachmentsClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_ServiceAttachments_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\ServiceAttachmentsClient; +use Google\Cloud\Compute\V1\Client\ServiceAttachmentsClient; +use Google\Cloud\Compute\V1\ListServiceAttachmentsRequest; /** * Lists the ServiceAttachments for a project in the given scope. @@ -38,10 +39,15 @@ function list_sample(string $project, string $region): void // Create a client. $serviceAttachmentsClient = new ServiceAttachmentsClient(); + // Prepare the request message. + $request = (new ListServiceAttachmentsRequest()) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $serviceAttachmentsClient->list($project, $region); + $response = $serviceAttachmentsClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/ServiceAttachmentsClient/patch.php b/Compute/samples/V1/ServiceAttachmentsClient/patch.php index 5ef7ea29fbf4..131ac68c6e66 100644 --- a/Compute/samples/V1/ServiceAttachmentsClient/patch.php +++ b/Compute/samples/V1/ServiceAttachmentsClient/patch.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_ServiceAttachments_Patch_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\ServiceAttachmentsClient; +use Google\Cloud\Compute\V1\PatchServiceAttachmentRequest; use Google\Cloud\Compute\V1\ServiceAttachment; -use Google\Cloud\Compute\V1\ServiceAttachmentsClient; use Google\Rpc\Status; /** @@ -41,18 +42,18 @@ function patch_sample(string $project, string $region, string $serviceAttachment // Create a client. $serviceAttachmentsClient = new ServiceAttachmentsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $serviceAttachmentResource = new ServiceAttachment(); + $request = (new PatchServiceAttachmentRequest()) + ->setProject($project) + ->setRegion($region) + ->setServiceAttachment($serviceAttachment) + ->setServiceAttachmentResource($serviceAttachmentResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $serviceAttachmentsClient->patch( - $project, - $region, - $serviceAttachment, - $serviceAttachmentResource - ); + $response = $serviceAttachmentsClient->patch($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/ServiceAttachmentsClient/set_iam_policy.php b/Compute/samples/V1/ServiceAttachmentsClient/set_iam_policy.php index 39cfcbcfba2d..556313a9e8e9 100644 --- a/Compute/samples/V1/ServiceAttachmentsClient/set_iam_policy.php +++ b/Compute/samples/V1/ServiceAttachmentsClient/set_iam_policy.php @@ -24,9 +24,10 @@ // [START compute_v1_generated_ServiceAttachments_SetIamPolicy_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\ServiceAttachmentsClient; use Google\Cloud\Compute\V1\Policy; use Google\Cloud\Compute\V1\RegionSetPolicyRequest; -use Google\Cloud\Compute\V1\ServiceAttachmentsClient; +use Google\Cloud\Compute\V1\SetIamPolicyServiceAttachmentRequest; /** * Sets the access control policy on the specified resource. Replaces any existing policy. @@ -40,18 +41,18 @@ function set_iam_policy_sample(string $project, string $region, string $resource // Create a client. $serviceAttachmentsClient = new ServiceAttachmentsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $regionSetPolicyRequestResource = new RegionSetPolicyRequest(); + $request = (new SetIamPolicyServiceAttachmentRequest()) + ->setProject($project) + ->setRegion($region) + ->setRegionSetPolicyRequestResource($regionSetPolicyRequestResource) + ->setResource($resource); // Call the API and handle any network failures. try { /** @var Policy $response */ - $response = $serviceAttachmentsClient->setIamPolicy( - $project, - $region, - $regionSetPolicyRequestResource, - $resource - ); + $response = $serviceAttachmentsClient->setIamPolicy($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/ServiceAttachmentsClient/test_iam_permissions.php b/Compute/samples/V1/ServiceAttachmentsClient/test_iam_permissions.php index 5307b7d1798a..1dc5e1306868 100644 --- a/Compute/samples/V1/ServiceAttachmentsClient/test_iam_permissions.php +++ b/Compute/samples/V1/ServiceAttachmentsClient/test_iam_permissions.php @@ -24,7 +24,8 @@ // [START compute_v1_generated_ServiceAttachments_TestIamPermissions_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\ServiceAttachmentsClient; +use Google\Cloud\Compute\V1\Client\ServiceAttachmentsClient; +use Google\Cloud\Compute\V1\TestIamPermissionsServiceAttachmentRequest; use Google\Cloud\Compute\V1\TestPermissionsRequest; use Google\Cloud\Compute\V1\TestPermissionsResponse; @@ -40,18 +41,18 @@ function test_iam_permissions_sample(string $project, string $region, string $re // Create a client. $serviceAttachmentsClient = new ServiceAttachmentsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $testPermissionsRequestResource = new TestPermissionsRequest(); + $request = (new TestIamPermissionsServiceAttachmentRequest()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); // Call the API and handle any network failures. try { /** @var TestPermissionsResponse $response */ - $response = $serviceAttachmentsClient->testIamPermissions( - $project, - $region, - $resource, - $testPermissionsRequestResource - ); + $response = $serviceAttachmentsClient->testIamPermissions($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/SnapshotSettingsServiceClient/get.php b/Compute/samples/V1/SnapshotSettingsServiceClient/get.php index 914c6d8a6c3e..e74584d12704 100644 --- a/Compute/samples/V1/SnapshotSettingsServiceClient/get.php +++ b/Compute/samples/V1/SnapshotSettingsServiceClient/get.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_SnapshotSettingsService_Get_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\SnapshotSettingsServiceClient; +use Google\Cloud\Compute\V1\GetSnapshotSettingRequest; use Google\Cloud\Compute\V1\SnapshotSettings; -use Google\Cloud\Compute\V1\SnapshotSettingsServiceClient; /** * Get snapshot settings. @@ -37,10 +38,14 @@ function get_sample(string $project): void // Create a client. $snapshotSettingsServiceClient = new SnapshotSettingsServiceClient(); + // Prepare the request message. + $request = (new GetSnapshotSettingRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var SnapshotSettings $response */ - $response = $snapshotSettingsServiceClient->get($project); + $response = $snapshotSettingsServiceClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/SnapshotSettingsServiceClient/patch.php b/Compute/samples/V1/SnapshotSettingsServiceClient/patch.php index 5daf673894ec..de4c02c8afa4 100644 --- a/Compute/samples/V1/SnapshotSettingsServiceClient/patch.php +++ b/Compute/samples/V1/SnapshotSettingsServiceClient/patch.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_SnapshotSettingsService_Patch_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\SnapshotSettingsServiceClient; +use Google\Cloud\Compute\V1\PatchSnapshotSettingRequest; use Google\Cloud\Compute\V1\SnapshotSettings; -use Google\Cloud\Compute\V1\SnapshotSettingsServiceClient; use Google\Rpc\Status; /** @@ -39,13 +40,16 @@ function patch_sample(string $project): void // Create a client. $snapshotSettingsServiceClient = new SnapshotSettingsServiceClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $snapshotSettingsResource = new SnapshotSettings(); + $request = (new PatchSnapshotSettingRequest()) + ->setProject($project) + ->setSnapshotSettingsResource($snapshotSettingsResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $snapshotSettingsServiceClient->patch($project, $snapshotSettingsResource); + $response = $snapshotSettingsServiceClient->patch($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/SnapshotsClient/delete.php b/Compute/samples/V1/SnapshotsClient/delete.php index 7e85edcf6ccc..8663ce8d6c8f 100644 --- a/Compute/samples/V1/SnapshotsClient/delete.php +++ b/Compute/samples/V1/SnapshotsClient/delete.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_Snapshots_Delete_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\SnapshotsClient; +use Google\Cloud\Compute\V1\Client\SnapshotsClient; +use Google\Cloud\Compute\V1\DeleteSnapshotRequest; use Google\Rpc\Status; /** @@ -39,10 +40,15 @@ function delete_sample(string $project, string $snapshot): void // Create a client. $snapshotsClient = new SnapshotsClient(); + // Prepare the request message. + $request = (new DeleteSnapshotRequest()) + ->setProject($project) + ->setSnapshot($snapshot); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $snapshotsClient->delete($project, $snapshot); + $response = $snapshotsClient->delete($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/SnapshotsClient/get.php b/Compute/samples/V1/SnapshotsClient/get.php index cf474645b32a..d309f30465e4 100644 --- a/Compute/samples/V1/SnapshotsClient/get.php +++ b/Compute/samples/V1/SnapshotsClient/get.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_Snapshots_Get_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\SnapshotsClient; +use Google\Cloud\Compute\V1\GetSnapshotRequest; use Google\Cloud\Compute\V1\Snapshot; -use Google\Cloud\Compute\V1\SnapshotsClient; /** * Returns the specified Snapshot resource. @@ -38,10 +39,15 @@ function get_sample(string $project, string $snapshot): void // Create a client. $snapshotsClient = new SnapshotsClient(); + // Prepare the request message. + $request = (new GetSnapshotRequest()) + ->setProject($project) + ->setSnapshot($snapshot); + // Call the API and handle any network failures. try { /** @var Snapshot $response */ - $response = $snapshotsClient->get($project, $snapshot); + $response = $snapshotsClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/SnapshotsClient/get_iam_policy.php b/Compute/samples/V1/SnapshotsClient/get_iam_policy.php index 8df734258220..b59ddd7aabec 100644 --- a/Compute/samples/V1/SnapshotsClient/get_iam_policy.php +++ b/Compute/samples/V1/SnapshotsClient/get_iam_policy.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_Snapshots_GetIamPolicy_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\SnapshotsClient; +use Google\Cloud\Compute\V1\GetIamPolicySnapshotRequest; use Google\Cloud\Compute\V1\Policy; -use Google\Cloud\Compute\V1\SnapshotsClient; /** * Gets the access control policy for a resource. May be empty if no such policy or resource exists. @@ -38,10 +39,15 @@ function get_iam_policy_sample(string $project, string $resource): void // Create a client. $snapshotsClient = new SnapshotsClient(); + // Prepare the request message. + $request = (new GetIamPolicySnapshotRequest()) + ->setProject($project) + ->setResource($resource); + // Call the API and handle any network failures. try { /** @var Policy $response */ - $response = $snapshotsClient->getIamPolicy($project, $resource); + $response = $snapshotsClient->getIamPolicy($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/SnapshotsClient/insert.php b/Compute/samples/V1/SnapshotsClient/insert.php index 9e33f9fe4935..03218427c68c 100644 --- a/Compute/samples/V1/SnapshotsClient/insert.php +++ b/Compute/samples/V1/SnapshotsClient/insert.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_Snapshots_Insert_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\SnapshotsClient; +use Google\Cloud\Compute\V1\InsertSnapshotRequest; use Google\Cloud\Compute\V1\Snapshot; -use Google\Cloud\Compute\V1\SnapshotsClient; use Google\Rpc\Status; /** @@ -39,13 +40,16 @@ function insert_sample(string $project): void // Create a client. $snapshotsClient = new SnapshotsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $snapshotResource = new Snapshot(); + $request = (new InsertSnapshotRequest()) + ->setProject($project) + ->setSnapshotResource($snapshotResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $snapshotsClient->insert($project, $snapshotResource); + $response = $snapshotsClient->insert($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/SnapshotsClient/list.php b/Compute/samples/V1/SnapshotsClient/list.php index 8ddbbd314479..59c339c3b235 100644 --- a/Compute/samples/V1/SnapshotsClient/list.php +++ b/Compute/samples/V1/SnapshotsClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_Snapshots_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\SnapshotsClient; +use Google\Cloud\Compute\V1\Client\SnapshotsClient; +use Google\Cloud\Compute\V1\ListSnapshotsRequest; /** * Retrieves the list of Snapshot resources contained within the specified project. @@ -37,10 +38,14 @@ function list_sample(string $project): void // Create a client. $snapshotsClient = new SnapshotsClient(); + // Prepare the request message. + $request = (new ListSnapshotsRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $snapshotsClient->list($project); + $response = $snapshotsClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/SnapshotsClient/set_iam_policy.php b/Compute/samples/V1/SnapshotsClient/set_iam_policy.php index 71f46a94eea6..d494c28988bd 100644 --- a/Compute/samples/V1/SnapshotsClient/set_iam_policy.php +++ b/Compute/samples/V1/SnapshotsClient/set_iam_policy.php @@ -24,9 +24,10 @@ // [START compute_v1_generated_Snapshots_SetIamPolicy_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\SnapshotsClient; use Google\Cloud\Compute\V1\GlobalSetPolicyRequest; use Google\Cloud\Compute\V1\Policy; -use Google\Cloud\Compute\V1\SnapshotsClient; +use Google\Cloud\Compute\V1\SetIamPolicySnapshotRequest; /** * Sets the access control policy on the specified resource. Replaces any existing policy. @@ -39,13 +40,17 @@ function set_iam_policy_sample(string $project, string $resource): void // Create a client. $snapshotsClient = new SnapshotsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $globalSetPolicyRequestResource = new GlobalSetPolicyRequest(); + $request = (new SetIamPolicySnapshotRequest()) + ->setGlobalSetPolicyRequestResource($globalSetPolicyRequestResource) + ->setProject($project) + ->setResource($resource); // Call the API and handle any network failures. try { /** @var Policy $response */ - $response = $snapshotsClient->setIamPolicy($globalSetPolicyRequestResource, $project, $resource); + $response = $snapshotsClient->setIamPolicy($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/SnapshotsClient/set_labels.php b/Compute/samples/V1/SnapshotsClient/set_labels.php index 9863251956a6..366791429fa6 100644 --- a/Compute/samples/V1/SnapshotsClient/set_labels.php +++ b/Compute/samples/V1/SnapshotsClient/set_labels.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_Snapshots_SetLabels_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\SnapshotsClient; use Google\Cloud\Compute\V1\GlobalSetLabelsRequest; -use Google\Cloud\Compute\V1\SnapshotsClient; +use Google\Cloud\Compute\V1\SetLabelsSnapshotRequest; use Google\Rpc\Status; /** @@ -40,13 +41,17 @@ function set_labels_sample(string $project, string $resource): void // Create a client. $snapshotsClient = new SnapshotsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $globalSetLabelsRequestResource = new GlobalSetLabelsRequest(); + $request = (new SetLabelsSnapshotRequest()) + ->setGlobalSetLabelsRequestResource($globalSetLabelsRequestResource) + ->setProject($project) + ->setResource($resource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $snapshotsClient->setLabels($globalSetLabelsRequestResource, $project, $resource); + $response = $snapshotsClient->setLabels($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/SnapshotsClient/test_iam_permissions.php b/Compute/samples/V1/SnapshotsClient/test_iam_permissions.php index 0387bdc9ddd9..454b5dc27a7f 100644 --- a/Compute/samples/V1/SnapshotsClient/test_iam_permissions.php +++ b/Compute/samples/V1/SnapshotsClient/test_iam_permissions.php @@ -24,7 +24,8 @@ // [START compute_v1_generated_Snapshots_TestIamPermissions_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\SnapshotsClient; +use Google\Cloud\Compute\V1\Client\SnapshotsClient; +use Google\Cloud\Compute\V1\TestIamPermissionsSnapshotRequest; use Google\Cloud\Compute\V1\TestPermissionsRequest; use Google\Cloud\Compute\V1\TestPermissionsResponse; @@ -39,17 +40,17 @@ function test_iam_permissions_sample(string $project, string $resource): void // Create a client. $snapshotsClient = new SnapshotsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $testPermissionsRequestResource = new TestPermissionsRequest(); + $request = (new TestIamPermissionsSnapshotRequest()) + ->setProject($project) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); // Call the API and handle any network failures. try { /** @var TestPermissionsResponse $response */ - $response = $snapshotsClient->testIamPermissions( - $project, - $resource, - $testPermissionsRequestResource - ); + $response = $snapshotsClient->testIamPermissions($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/SslCertificatesClient/aggregated_list.php b/Compute/samples/V1/SslCertificatesClient/aggregated_list.php index 0d8b4fc7a597..97ed32aabfd9 100644 --- a/Compute/samples/V1/SslCertificatesClient/aggregated_list.php +++ b/Compute/samples/V1/SslCertificatesClient/aggregated_list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_SslCertificates_AggregatedList_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\SslCertificatesClient; +use Google\Cloud\Compute\V1\AggregatedListSslCertificatesRequest; +use Google\Cloud\Compute\V1\Client\SslCertificatesClient; /** * 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`. @@ -37,10 +38,14 @@ function aggregated_list_sample(string $project): void // Create a client. $sslCertificatesClient = new SslCertificatesClient(); + // Prepare the request message. + $request = (new AggregatedListSslCertificatesRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $sslCertificatesClient->aggregatedList($project); + $response = $sslCertificatesClient->aggregatedList($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/SslCertificatesClient/delete.php b/Compute/samples/V1/SslCertificatesClient/delete.php index 783fd3bfddfb..16662b5d1c87 100644 --- a/Compute/samples/V1/SslCertificatesClient/delete.php +++ b/Compute/samples/V1/SslCertificatesClient/delete.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_SslCertificates_Delete_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\SslCertificatesClient; +use Google\Cloud\Compute\V1\Client\SslCertificatesClient; +use Google\Cloud\Compute\V1\DeleteSslCertificateRequest; use Google\Rpc\Status; /** @@ -39,10 +40,15 @@ function delete_sample(string $project, string $sslCertificate): void // Create a client. $sslCertificatesClient = new SslCertificatesClient(); + // Prepare the request message. + $request = (new DeleteSslCertificateRequest()) + ->setProject($project) + ->setSslCertificate($sslCertificate); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $sslCertificatesClient->delete($project, $sslCertificate); + $response = $sslCertificatesClient->delete($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/SslCertificatesClient/get.php b/Compute/samples/V1/SslCertificatesClient/get.php index 6ceac6d2e6a5..09d0e8a95f87 100644 --- a/Compute/samples/V1/SslCertificatesClient/get.php +++ b/Compute/samples/V1/SslCertificatesClient/get.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_SslCertificates_Get_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\SslCertificatesClient; +use Google\Cloud\Compute\V1\GetSslCertificateRequest; use Google\Cloud\Compute\V1\SslCertificate; -use Google\Cloud\Compute\V1\SslCertificatesClient; /** * Returns the specified SslCertificate resource. @@ -38,10 +39,15 @@ function get_sample(string $project, string $sslCertificate): void // Create a client. $sslCertificatesClient = new SslCertificatesClient(); + // Prepare the request message. + $request = (new GetSslCertificateRequest()) + ->setProject($project) + ->setSslCertificate($sslCertificate); + // Call the API and handle any network failures. try { /** @var SslCertificate $response */ - $response = $sslCertificatesClient->get($project, $sslCertificate); + $response = $sslCertificatesClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/SslCertificatesClient/insert.php b/Compute/samples/V1/SslCertificatesClient/insert.php index 74ea12bab121..148c87ec1c6f 100644 --- a/Compute/samples/V1/SslCertificatesClient/insert.php +++ b/Compute/samples/V1/SslCertificatesClient/insert.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_SslCertificates_Insert_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\SslCertificatesClient; +use Google\Cloud\Compute\V1\InsertSslCertificateRequest; use Google\Cloud\Compute\V1\SslCertificate; -use Google\Cloud\Compute\V1\SslCertificatesClient; use Google\Rpc\Status; /** @@ -39,13 +40,16 @@ function insert_sample(string $project): void // Create a client. $sslCertificatesClient = new SslCertificatesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $sslCertificateResource = new SslCertificate(); + $request = (new InsertSslCertificateRequest()) + ->setProject($project) + ->setSslCertificateResource($sslCertificateResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $sslCertificatesClient->insert($project, $sslCertificateResource); + $response = $sslCertificatesClient->insert($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/SslCertificatesClient/list.php b/Compute/samples/V1/SslCertificatesClient/list.php index e387f9b94f2a..49e2781c4ef5 100644 --- a/Compute/samples/V1/SslCertificatesClient/list.php +++ b/Compute/samples/V1/SslCertificatesClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_SslCertificates_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\SslCertificatesClient; +use Google\Cloud\Compute\V1\Client\SslCertificatesClient; +use Google\Cloud\Compute\V1\ListSslCertificatesRequest; /** * Retrieves the list of SslCertificate resources available to the specified project. @@ -37,10 +38,14 @@ function list_sample(string $project): void // Create a client. $sslCertificatesClient = new SslCertificatesClient(); + // Prepare the request message. + $request = (new ListSslCertificatesRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $sslCertificatesClient->list($project); + $response = $sslCertificatesClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/SslPoliciesClient/aggregated_list.php b/Compute/samples/V1/SslPoliciesClient/aggregated_list.php index 71f50f33abd9..6efd5c7b2869 100644 --- a/Compute/samples/V1/SslPoliciesClient/aggregated_list.php +++ b/Compute/samples/V1/SslPoliciesClient/aggregated_list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_SslPolicies_AggregatedList_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\SslPoliciesClient; +use Google\Cloud\Compute\V1\AggregatedListSslPoliciesRequest; +use Google\Cloud\Compute\V1\Client\SslPoliciesClient; /** * 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`. @@ -37,10 +38,14 @@ function aggregated_list_sample(string $project): void // Create a client. $sslPoliciesClient = new SslPoliciesClient(); + // Prepare the request message. + $request = (new AggregatedListSslPoliciesRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $sslPoliciesClient->aggregatedList($project); + $response = $sslPoliciesClient->aggregatedList($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/SslPoliciesClient/delete.php b/Compute/samples/V1/SslPoliciesClient/delete.php index 655855ebab93..257d5c46ab2a 100644 --- a/Compute/samples/V1/SslPoliciesClient/delete.php +++ b/Compute/samples/V1/SslPoliciesClient/delete.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_SslPolicies_Delete_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\SslPoliciesClient; +use Google\Cloud\Compute\V1\Client\SslPoliciesClient; +use Google\Cloud\Compute\V1\DeleteSslPolicyRequest; use Google\Rpc\Status; /** @@ -39,10 +40,15 @@ function delete_sample(string $project, string $sslPolicy): void // Create a client. $sslPoliciesClient = new SslPoliciesClient(); + // Prepare the request message. + $request = (new DeleteSslPolicyRequest()) + ->setProject($project) + ->setSslPolicy($sslPolicy); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $sslPoliciesClient->delete($project, $sslPolicy); + $response = $sslPoliciesClient->delete($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/SslPoliciesClient/get.php b/Compute/samples/V1/SslPoliciesClient/get.php index faa9a601338e..ebe92276280b 100644 --- a/Compute/samples/V1/SslPoliciesClient/get.php +++ b/Compute/samples/V1/SslPoliciesClient/get.php @@ -24,7 +24,8 @@ // [START compute_v1_generated_SslPolicies_Get_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\SslPoliciesClient; +use Google\Cloud\Compute\V1\Client\SslPoliciesClient; +use Google\Cloud\Compute\V1\GetSslPolicyRequest; use Google\Cloud\Compute\V1\SslPolicy; /** @@ -38,10 +39,15 @@ function get_sample(string $project, string $sslPolicy): void // Create a client. $sslPoliciesClient = new SslPoliciesClient(); + // Prepare the request message. + $request = (new GetSslPolicyRequest()) + ->setProject($project) + ->setSslPolicy($sslPolicy); + // Call the API and handle any network failures. try { /** @var SslPolicy $response */ - $response = $sslPoliciesClient->get($project, $sslPolicy); + $response = $sslPoliciesClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/SslPoliciesClient/insert.php b/Compute/samples/V1/SslPoliciesClient/insert.php index 175a2518b88d..529c19c061be 100644 --- a/Compute/samples/V1/SslPoliciesClient/insert.php +++ b/Compute/samples/V1/SslPoliciesClient/insert.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_SslPolicies_Insert_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\SslPoliciesClient; +use Google\Cloud\Compute\V1\Client\SslPoliciesClient; +use Google\Cloud\Compute\V1\InsertSslPolicyRequest; use Google\Cloud\Compute\V1\SslPolicy; use Google\Rpc\Status; @@ -39,13 +40,16 @@ function insert_sample(string $project): void // Create a client. $sslPoliciesClient = new SslPoliciesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $sslPolicyResource = new SslPolicy(); + $request = (new InsertSslPolicyRequest()) + ->setProject($project) + ->setSslPolicyResource($sslPolicyResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $sslPoliciesClient->insert($project, $sslPolicyResource); + $response = $sslPoliciesClient->insert($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/SslPoliciesClient/list.php b/Compute/samples/V1/SslPoliciesClient/list.php index cf95045ed12e..851bbcc6664d 100644 --- a/Compute/samples/V1/SslPoliciesClient/list.php +++ b/Compute/samples/V1/SslPoliciesClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_SslPolicies_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\SslPoliciesClient; +use Google\Cloud\Compute\V1\Client\SslPoliciesClient; +use Google\Cloud\Compute\V1\ListSslPoliciesRequest; /** * Lists all the SSL policies that have been configured for the specified project. @@ -37,10 +38,14 @@ function list_sample(string $project): void // Create a client. $sslPoliciesClient = new SslPoliciesClient(); + // Prepare the request message. + $request = (new ListSslPoliciesRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $sslPoliciesClient->list($project); + $response = $sslPoliciesClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/SslPoliciesClient/list_available_features.php b/Compute/samples/V1/SslPoliciesClient/list_available_features.php index 130d74d534af..26ba560bc1ae 100644 --- a/Compute/samples/V1/SslPoliciesClient/list_available_features.php +++ b/Compute/samples/V1/SslPoliciesClient/list_available_features.php @@ -24,7 +24,8 @@ // [START compute_v1_generated_SslPolicies_ListAvailableFeatures_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\SslPoliciesClient; +use Google\Cloud\Compute\V1\Client\SslPoliciesClient; +use Google\Cloud\Compute\V1\ListAvailableFeaturesSslPoliciesRequest; use Google\Cloud\Compute\V1\SslPoliciesListAvailableFeaturesResponse; /** @@ -37,10 +38,14 @@ function list_available_features_sample(string $project): void // Create a client. $sslPoliciesClient = new SslPoliciesClient(); + // Prepare the request message. + $request = (new ListAvailableFeaturesSslPoliciesRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var SslPoliciesListAvailableFeaturesResponse $response */ - $response = $sslPoliciesClient->listAvailableFeatures($project); + $response = $sslPoliciesClient->listAvailableFeatures($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/SslPoliciesClient/patch.php b/Compute/samples/V1/SslPoliciesClient/patch.php index acdde8dfafba..600d311cad83 100644 --- a/Compute/samples/V1/SslPoliciesClient/patch.php +++ b/Compute/samples/V1/SslPoliciesClient/patch.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_SslPolicies_Patch_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\SslPoliciesClient; +use Google\Cloud\Compute\V1\Client\SslPoliciesClient; +use Google\Cloud\Compute\V1\PatchSslPolicyRequest; use Google\Cloud\Compute\V1\SslPolicy; use Google\Rpc\Status; @@ -40,13 +41,17 @@ function patch_sample(string $project, string $sslPolicy): void // Create a client. $sslPoliciesClient = new SslPoliciesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $sslPolicyResource = new SslPolicy(); + $request = (new PatchSslPolicyRequest()) + ->setProject($project) + ->setSslPolicy($sslPolicy) + ->setSslPolicyResource($sslPolicyResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $sslPoliciesClient->patch($project, $sslPolicy, $sslPolicyResource); + $response = $sslPoliciesClient->patch($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/StoragePoolTypesClient/aggregated_list.php b/Compute/samples/V1/StoragePoolTypesClient/aggregated_list.php index 3433f29781e1..14cae8ef8214 100644 --- a/Compute/samples/V1/StoragePoolTypesClient/aggregated_list.php +++ b/Compute/samples/V1/StoragePoolTypesClient/aggregated_list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_StoragePoolTypes_AggregatedList_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\StoragePoolTypesClient; +use Google\Cloud\Compute\V1\AggregatedListStoragePoolTypesRequest; +use Google\Cloud\Compute\V1\Client\StoragePoolTypesClient; /** * Retrieves an aggregated list of storage pool types. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. @@ -37,10 +38,14 @@ function aggregated_list_sample(string $project): void // Create a client. $storagePoolTypesClient = new StoragePoolTypesClient(); + // Prepare the request message. + $request = (new AggregatedListStoragePoolTypesRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $storagePoolTypesClient->aggregatedList($project); + $response = $storagePoolTypesClient->aggregatedList($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/StoragePoolTypesClient/get.php b/Compute/samples/V1/StoragePoolTypesClient/get.php index 13112067289f..35793f1c3eae 100644 --- a/Compute/samples/V1/StoragePoolTypesClient/get.php +++ b/Compute/samples/V1/StoragePoolTypesClient/get.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_StoragePoolTypes_Get_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\StoragePoolTypesClient; +use Google\Cloud\Compute\V1\GetStoragePoolTypeRequest; use Google\Cloud\Compute\V1\StoragePoolType; -use Google\Cloud\Compute\V1\StoragePoolTypesClient; /** * Returns the specified storage pool type. @@ -39,10 +40,16 @@ function get_sample(string $project, string $storagePoolType, string $zone): voi // Create a client. $storagePoolTypesClient = new StoragePoolTypesClient(); + // Prepare the request message. + $request = (new GetStoragePoolTypeRequest()) + ->setProject($project) + ->setStoragePoolType($storagePoolType) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var StoragePoolType $response */ - $response = $storagePoolTypesClient->get($project, $storagePoolType, $zone); + $response = $storagePoolTypesClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/StoragePoolTypesClient/list.php b/Compute/samples/V1/StoragePoolTypesClient/list.php index a21a0947a5a8..2a67ea8fd3eb 100644 --- a/Compute/samples/V1/StoragePoolTypesClient/list.php +++ b/Compute/samples/V1/StoragePoolTypesClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_StoragePoolTypes_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\StoragePoolTypesClient; +use Google\Cloud\Compute\V1\Client\StoragePoolTypesClient; +use Google\Cloud\Compute\V1\ListStoragePoolTypesRequest; /** * Retrieves a list of storage pool types available to the specified project. @@ -38,10 +39,15 @@ function list_sample(string $project, string $zone): void // Create a client. $storagePoolTypesClient = new StoragePoolTypesClient(); + // Prepare the request message. + $request = (new ListStoragePoolTypesRequest()) + ->setProject($project) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $storagePoolTypesClient->list($project, $zone); + $response = $storagePoolTypesClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/StoragePoolsClient/aggregated_list.php b/Compute/samples/V1/StoragePoolsClient/aggregated_list.php index b5c86c924463..1e328a002d7c 100644 --- a/Compute/samples/V1/StoragePoolsClient/aggregated_list.php +++ b/Compute/samples/V1/StoragePoolsClient/aggregated_list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_StoragePools_AggregatedList_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\StoragePoolsClient; +use Google\Cloud\Compute\V1\AggregatedListStoragePoolsRequest; +use Google\Cloud\Compute\V1\Client\StoragePoolsClient; /** * Retrieves an aggregated list of storage pools. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. @@ -37,10 +38,14 @@ function aggregated_list_sample(string $project): void // Create a client. $storagePoolsClient = new StoragePoolsClient(); + // Prepare the request message. + $request = (new AggregatedListStoragePoolsRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $storagePoolsClient->aggregatedList($project); + $response = $storagePoolsClient->aggregatedList($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/StoragePoolsClient/delete.php b/Compute/samples/V1/StoragePoolsClient/delete.php index 190e28a52b7e..9824c0188fdf 100644 --- a/Compute/samples/V1/StoragePoolsClient/delete.php +++ b/Compute/samples/V1/StoragePoolsClient/delete.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_StoragePools_Delete_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\StoragePoolsClient; +use Google\Cloud\Compute\V1\Client\StoragePoolsClient; +use Google\Cloud\Compute\V1\DeleteStoragePoolRequest; use Google\Rpc\Status; /** @@ -40,10 +41,16 @@ function delete_sample(string $project, string $storagePool, string $zone): void // Create a client. $storagePoolsClient = new StoragePoolsClient(); + // Prepare the request message. + $request = (new DeleteStoragePoolRequest()) + ->setProject($project) + ->setStoragePool($storagePool) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $storagePoolsClient->delete($project, $storagePool, $zone); + $response = $storagePoolsClient->delete($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/StoragePoolsClient/get.php b/Compute/samples/V1/StoragePoolsClient/get.php index 41174f76f0f8..92c7649b0c66 100644 --- a/Compute/samples/V1/StoragePoolsClient/get.php +++ b/Compute/samples/V1/StoragePoolsClient/get.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_StoragePools_Get_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\StoragePoolsClient; +use Google\Cloud\Compute\V1\GetStoragePoolRequest; use Google\Cloud\Compute\V1\StoragePool; -use Google\Cloud\Compute\V1\StoragePoolsClient; /** * Returns a specified storage pool. Gets a list of available storage pools by making a list() request. @@ -39,10 +40,16 @@ function get_sample(string $project, string $storagePool, string $zone): void // Create a client. $storagePoolsClient = new StoragePoolsClient(); + // Prepare the request message. + $request = (new GetStoragePoolRequest()) + ->setProject($project) + ->setStoragePool($storagePool) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var StoragePool $response */ - $response = $storagePoolsClient->get($project, $storagePool, $zone); + $response = $storagePoolsClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/StoragePoolsClient/get_iam_policy.php b/Compute/samples/V1/StoragePoolsClient/get_iam_policy.php index 17860c59fff9..24e955e17907 100644 --- a/Compute/samples/V1/StoragePoolsClient/get_iam_policy.php +++ b/Compute/samples/V1/StoragePoolsClient/get_iam_policy.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_StoragePools_GetIamPolicy_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\StoragePoolsClient; +use Google\Cloud\Compute\V1\GetIamPolicyStoragePoolRequest; use Google\Cloud\Compute\V1\Policy; -use Google\Cloud\Compute\V1\StoragePoolsClient; /** * Gets the access control policy for a resource. May be empty if no such policy or resource exists. @@ -39,10 +40,16 @@ function get_iam_policy_sample(string $project, string $resource, string $zone): // Create a client. $storagePoolsClient = new StoragePoolsClient(); + // Prepare the request message. + $request = (new GetIamPolicyStoragePoolRequest()) + ->setProject($project) + ->setResource($resource) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var Policy $response */ - $response = $storagePoolsClient->getIamPolicy($project, $resource, $zone); + $response = $storagePoolsClient->getIamPolicy($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/StoragePoolsClient/insert.php b/Compute/samples/V1/StoragePoolsClient/insert.php index 42a79ce37a24..4abac2d3ee55 100644 --- a/Compute/samples/V1/StoragePoolsClient/insert.php +++ b/Compute/samples/V1/StoragePoolsClient/insert.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_StoragePools_Insert_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\StoragePoolsClient; +use Google\Cloud\Compute\V1\InsertStoragePoolRequest; use Google\Cloud\Compute\V1\StoragePool; -use Google\Cloud\Compute\V1\StoragePoolsClient; use Google\Rpc\Status; /** @@ -40,13 +41,17 @@ function insert_sample(string $project, string $zone): void // Create a client. $storagePoolsClient = new StoragePoolsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $storagePoolResource = new StoragePool(); + $request = (new InsertStoragePoolRequest()) + ->setProject($project) + ->setStoragePoolResource($storagePoolResource) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $storagePoolsClient->insert($project, $storagePoolResource, $zone); + $response = $storagePoolsClient->insert($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/StoragePoolsClient/list.php b/Compute/samples/V1/StoragePoolsClient/list.php index 56998977d58f..8ab74020905d 100644 --- a/Compute/samples/V1/StoragePoolsClient/list.php +++ b/Compute/samples/V1/StoragePoolsClient/list.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_StoragePools_List_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\StoragePoolsClient; +use Google\Cloud\Compute\V1\ListStoragePoolsRequest; use Google\Cloud\Compute\V1\StoragePoolList; -use Google\Cloud\Compute\V1\StoragePoolsClient; /** * Retrieves a list of storage pools contained within the specified zone. @@ -38,10 +39,15 @@ function list_sample(string $project, string $zone): void // Create a client. $storagePoolsClient = new StoragePoolsClient(); + // Prepare the request message. + $request = (new ListStoragePoolsRequest()) + ->setProject($project) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var StoragePoolList $response */ - $response = $storagePoolsClient->list($project, $zone); + $response = $storagePoolsClient->list($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/StoragePoolsClient/list_disks.php b/Compute/samples/V1/StoragePoolsClient/list_disks.php index c29debf06152..8f6df4716b45 100644 --- a/Compute/samples/V1/StoragePoolsClient/list_disks.php +++ b/Compute/samples/V1/StoragePoolsClient/list_disks.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_StoragePools_ListDisks_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\StoragePoolsClient; +use Google\Cloud\Compute\V1\ListDisksStoragePoolsRequest; use Google\Cloud\Compute\V1\StoragePoolListDisks; -use Google\Cloud\Compute\V1\StoragePoolsClient; /** * Lists the disks in a specified storage pool. @@ -39,10 +40,16 @@ function list_disks_sample(string $project, string $storagePool, string $zone): // Create a client. $storagePoolsClient = new StoragePoolsClient(); + // Prepare the request message. + $request = (new ListDisksStoragePoolsRequest()) + ->setProject($project) + ->setStoragePool($storagePool) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var StoragePoolListDisks $response */ - $response = $storagePoolsClient->listDisks($project, $storagePool, $zone); + $response = $storagePoolsClient->listDisks($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/StoragePoolsClient/set_iam_policy.php b/Compute/samples/V1/StoragePoolsClient/set_iam_policy.php index 26c4568415b1..d20fd01386f8 100644 --- a/Compute/samples/V1/StoragePoolsClient/set_iam_policy.php +++ b/Compute/samples/V1/StoragePoolsClient/set_iam_policy.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_StoragePools_SetIamPolicy_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\StoragePoolsClient; use Google\Cloud\Compute\V1\Policy; -use Google\Cloud\Compute\V1\StoragePoolsClient; +use Google\Cloud\Compute\V1\SetIamPolicyStoragePoolRequest; use Google\Cloud\Compute\V1\ZoneSetPolicyRequest; /** @@ -40,18 +41,18 @@ function set_iam_policy_sample(string $project, string $resource, string $zone): // Create a client. $storagePoolsClient = new StoragePoolsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $zoneSetPolicyRequestResource = new ZoneSetPolicyRequest(); + $request = (new SetIamPolicyStoragePoolRequest()) + ->setProject($project) + ->setResource($resource) + ->setZone($zone) + ->setZoneSetPolicyRequestResource($zoneSetPolicyRequestResource); // Call the API and handle any network failures. try { /** @var Policy $response */ - $response = $storagePoolsClient->setIamPolicy( - $project, - $resource, - $zone, - $zoneSetPolicyRequestResource - ); + $response = $storagePoolsClient->setIamPolicy($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/StoragePoolsClient/test_iam_permissions.php b/Compute/samples/V1/StoragePoolsClient/test_iam_permissions.php index cc205dd335fd..3bb8781a8c1e 100644 --- a/Compute/samples/V1/StoragePoolsClient/test_iam_permissions.php +++ b/Compute/samples/V1/StoragePoolsClient/test_iam_permissions.php @@ -24,7 +24,8 @@ // [START compute_v1_generated_StoragePools_TestIamPermissions_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\StoragePoolsClient; +use Google\Cloud\Compute\V1\Client\StoragePoolsClient; +use Google\Cloud\Compute\V1\TestIamPermissionsStoragePoolRequest; use Google\Cloud\Compute\V1\TestPermissionsRequest; use Google\Cloud\Compute\V1\TestPermissionsResponse; @@ -40,18 +41,18 @@ function test_iam_permissions_sample(string $project, string $resource, string $ // Create a client. $storagePoolsClient = new StoragePoolsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $testPermissionsRequestResource = new TestPermissionsRequest(); + $request = (new TestIamPermissionsStoragePoolRequest()) + ->setProject($project) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var TestPermissionsResponse $response */ - $response = $storagePoolsClient->testIamPermissions( - $project, - $resource, - $testPermissionsRequestResource, - $zone - ); + $response = $storagePoolsClient->testIamPermissions($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/StoragePoolsClient/update.php b/Compute/samples/V1/StoragePoolsClient/update.php index c5164b5ce673..36815576acab 100644 --- a/Compute/samples/V1/StoragePoolsClient/update.php +++ b/Compute/samples/V1/StoragePoolsClient/update.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_StoragePools_Update_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\StoragePoolsClient; use Google\Cloud\Compute\V1\StoragePool; -use Google\Cloud\Compute\V1\StoragePoolsClient; +use Google\Cloud\Compute\V1\UpdateStoragePoolRequest; use Google\Rpc\Status; /** @@ -41,13 +42,18 @@ function update_sample(string $project, string $storagePool, string $zone): void // Create a client. $storagePoolsClient = new StoragePoolsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $storagePoolResource = new StoragePool(); + $request = (new UpdateStoragePoolRequest()) + ->setProject($project) + ->setStoragePool($storagePool) + ->setStoragePoolResource($storagePoolResource) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $storagePoolsClient->update($project, $storagePool, $storagePoolResource, $zone); + $response = $storagePoolsClient->update($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/SubnetworksClient/aggregated_list.php b/Compute/samples/V1/SubnetworksClient/aggregated_list.php index 33ff0465c5fa..f80b206d0811 100644 --- a/Compute/samples/V1/SubnetworksClient/aggregated_list.php +++ b/Compute/samples/V1/SubnetworksClient/aggregated_list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_Subnetworks_AggregatedList_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\SubnetworksClient; +use Google\Cloud\Compute\V1\AggregatedListSubnetworksRequest; +use Google\Cloud\Compute\V1\Client\SubnetworksClient; /** * Retrieves an aggregated list of subnetworks. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. @@ -37,10 +38,14 @@ function aggregated_list_sample(string $project): void // Create a client. $subnetworksClient = new SubnetworksClient(); + // Prepare the request message. + $request = (new AggregatedListSubnetworksRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $subnetworksClient->aggregatedList($project); + $response = $subnetworksClient->aggregatedList($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/SubnetworksClient/delete.php b/Compute/samples/V1/SubnetworksClient/delete.php index 3d2cdaf4d983..888682cd79d5 100644 --- a/Compute/samples/V1/SubnetworksClient/delete.php +++ b/Compute/samples/V1/SubnetworksClient/delete.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_Subnetworks_Delete_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\SubnetworksClient; +use Google\Cloud\Compute\V1\Client\SubnetworksClient; +use Google\Cloud\Compute\V1\DeleteSubnetworkRequest; use Google\Rpc\Status; /** @@ -40,10 +41,16 @@ function delete_sample(string $project, string $region, string $subnetwork): voi // Create a client. $subnetworksClient = new SubnetworksClient(); + // Prepare the request message. + $request = (new DeleteSubnetworkRequest()) + ->setProject($project) + ->setRegion($region) + ->setSubnetwork($subnetwork); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $subnetworksClient->delete($project, $region, $subnetwork); + $response = $subnetworksClient->delete($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/SubnetworksClient/expand_ip_cidr_range.php b/Compute/samples/V1/SubnetworksClient/expand_ip_cidr_range.php index 921d38e3caa5..e052a3e826f3 100644 --- a/Compute/samples/V1/SubnetworksClient/expand_ip_cidr_range.php +++ b/Compute/samples/V1/SubnetworksClient/expand_ip_cidr_range.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_Subnetworks_ExpandIpCidrRange_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\SubnetworksClient; +use Google\Cloud\Compute\V1\Client\SubnetworksClient; +use Google\Cloud\Compute\V1\ExpandIpCidrRangeSubnetworkRequest; use Google\Cloud\Compute\V1\SubnetworksExpandIpCidrRangeRequest; use Google\Rpc\Status; @@ -41,18 +42,18 @@ function expand_ip_cidr_range_sample(string $project, string $region, string $su // Create a client. $subnetworksClient = new SubnetworksClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $subnetworksExpandIpCidrRangeRequestResource = new SubnetworksExpandIpCidrRangeRequest(); + $request = (new ExpandIpCidrRangeSubnetworkRequest()) + ->setProject($project) + ->setRegion($region) + ->setSubnetwork($subnetwork) + ->setSubnetworksExpandIpCidrRangeRequestResource($subnetworksExpandIpCidrRangeRequestResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $subnetworksClient->expandIpCidrRange( - $project, - $region, - $subnetwork, - $subnetworksExpandIpCidrRangeRequestResource - ); + $response = $subnetworksClient->expandIpCidrRange($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/SubnetworksClient/get.php b/Compute/samples/V1/SubnetworksClient/get.php index 3b241ff4b0d4..3f637749c6ff 100644 --- a/Compute/samples/V1/SubnetworksClient/get.php +++ b/Compute/samples/V1/SubnetworksClient/get.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_Subnetworks_Get_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\SubnetworksClient; +use Google\Cloud\Compute\V1\GetSubnetworkRequest; use Google\Cloud\Compute\V1\Subnetwork; -use Google\Cloud\Compute\V1\SubnetworksClient; /** * Returns the specified subnetwork. @@ -39,10 +40,16 @@ function get_sample(string $project, string $region, string $subnetwork): void // Create a client. $subnetworksClient = new SubnetworksClient(); + // Prepare the request message. + $request = (new GetSubnetworkRequest()) + ->setProject($project) + ->setRegion($region) + ->setSubnetwork($subnetwork); + // Call the API and handle any network failures. try { /** @var Subnetwork $response */ - $response = $subnetworksClient->get($project, $region, $subnetwork); + $response = $subnetworksClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/SubnetworksClient/get_iam_policy.php b/Compute/samples/V1/SubnetworksClient/get_iam_policy.php index 5227c509ab24..e0fe6191c31d 100644 --- a/Compute/samples/V1/SubnetworksClient/get_iam_policy.php +++ b/Compute/samples/V1/SubnetworksClient/get_iam_policy.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_Subnetworks_GetIamPolicy_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\SubnetworksClient; +use Google\Cloud\Compute\V1\GetIamPolicySubnetworkRequest; use Google\Cloud\Compute\V1\Policy; -use Google\Cloud\Compute\V1\SubnetworksClient; /** * Gets the access control policy for a resource. May be empty if no such policy or resource exists. @@ -39,10 +40,16 @@ function get_iam_policy_sample(string $project, string $region, string $resource // Create a client. $subnetworksClient = new SubnetworksClient(); + // Prepare the request message. + $request = (new GetIamPolicySubnetworkRequest()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource); + // Call the API and handle any network failures. try { /** @var Policy $response */ - $response = $subnetworksClient->getIamPolicy($project, $region, $resource); + $response = $subnetworksClient->getIamPolicy($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/SubnetworksClient/insert.php b/Compute/samples/V1/SubnetworksClient/insert.php index 1d705e56784a..7e01f2f2378f 100644 --- a/Compute/samples/V1/SubnetworksClient/insert.php +++ b/Compute/samples/V1/SubnetworksClient/insert.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_Subnetworks_Insert_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\SubnetworksClient; +use Google\Cloud\Compute\V1\InsertSubnetworkRequest; use Google\Cloud\Compute\V1\Subnetwork; -use Google\Cloud\Compute\V1\SubnetworksClient; use Google\Rpc\Status; /** @@ -40,13 +41,17 @@ function insert_sample(string $project, string $region): void // Create a client. $subnetworksClient = new SubnetworksClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $subnetworkResource = new Subnetwork(); + $request = (new InsertSubnetworkRequest()) + ->setProject($project) + ->setRegion($region) + ->setSubnetworkResource($subnetworkResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $subnetworksClient->insert($project, $region, $subnetworkResource); + $response = $subnetworksClient->insert($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/SubnetworksClient/list.php b/Compute/samples/V1/SubnetworksClient/list.php index 588f2a4139ae..b2abdc868205 100644 --- a/Compute/samples/V1/SubnetworksClient/list.php +++ b/Compute/samples/V1/SubnetworksClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_Subnetworks_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\SubnetworksClient; +use Google\Cloud\Compute\V1\Client\SubnetworksClient; +use Google\Cloud\Compute\V1\ListSubnetworksRequest; /** * Retrieves a list of subnetworks available to the specified project. @@ -38,10 +39,15 @@ function list_sample(string $project, string $region): void // Create a client. $subnetworksClient = new SubnetworksClient(); + // Prepare the request message. + $request = (new ListSubnetworksRequest()) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $subnetworksClient->list($project, $region); + $response = $subnetworksClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/SubnetworksClient/list_usable.php b/Compute/samples/V1/SubnetworksClient/list_usable.php index 3914c0def8ad..a49800f324ff 100644 --- a/Compute/samples/V1/SubnetworksClient/list_usable.php +++ b/Compute/samples/V1/SubnetworksClient/list_usable.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_Subnetworks_ListUsable_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\SubnetworksClient; +use Google\Cloud\Compute\V1\Client\SubnetworksClient; +use Google\Cloud\Compute\V1\ListUsableSubnetworksRequest; /** * Retrieves an aggregated list of all usable subnetworks in the project. @@ -37,10 +38,14 @@ function list_usable_sample(string $project): void // Create a client. $subnetworksClient = new SubnetworksClient(); + // Prepare the request message. + $request = (new ListUsableSubnetworksRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $subnetworksClient->listUsable($project); + $response = $subnetworksClient->listUsable($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/SubnetworksClient/patch.php b/Compute/samples/V1/SubnetworksClient/patch.php index 49d728f66d33..cd18685c48a9 100644 --- a/Compute/samples/V1/SubnetworksClient/patch.php +++ b/Compute/samples/V1/SubnetworksClient/patch.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_Subnetworks_Patch_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\SubnetworksClient; +use Google\Cloud\Compute\V1\PatchSubnetworkRequest; use Google\Cloud\Compute\V1\Subnetwork; -use Google\Cloud\Compute\V1\SubnetworksClient; use Google\Rpc\Status; /** @@ -41,13 +42,18 @@ function patch_sample(string $project, string $region, string $subnetwork): void // Create a client. $subnetworksClient = new SubnetworksClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $subnetworkResource = new Subnetwork(); + $request = (new PatchSubnetworkRequest()) + ->setProject($project) + ->setRegion($region) + ->setSubnetwork($subnetwork) + ->setSubnetworkResource($subnetworkResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $subnetworksClient->patch($project, $region, $subnetwork, $subnetworkResource); + $response = $subnetworksClient->patch($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/SubnetworksClient/set_iam_policy.php b/Compute/samples/V1/SubnetworksClient/set_iam_policy.php index 52e1a5bc5485..1c4b8394a2ab 100644 --- a/Compute/samples/V1/SubnetworksClient/set_iam_policy.php +++ b/Compute/samples/V1/SubnetworksClient/set_iam_policy.php @@ -24,9 +24,10 @@ // [START compute_v1_generated_Subnetworks_SetIamPolicy_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\SubnetworksClient; use Google\Cloud\Compute\V1\Policy; use Google\Cloud\Compute\V1\RegionSetPolicyRequest; -use Google\Cloud\Compute\V1\SubnetworksClient; +use Google\Cloud\Compute\V1\SetIamPolicySubnetworkRequest; /** * Sets the access control policy on the specified resource. Replaces any existing policy. @@ -40,18 +41,18 @@ function set_iam_policy_sample(string $project, string $region, string $resource // Create a client. $subnetworksClient = new SubnetworksClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $regionSetPolicyRequestResource = new RegionSetPolicyRequest(); + $request = (new SetIamPolicySubnetworkRequest()) + ->setProject($project) + ->setRegion($region) + ->setRegionSetPolicyRequestResource($regionSetPolicyRequestResource) + ->setResource($resource); // Call the API and handle any network failures. try { /** @var Policy $response */ - $response = $subnetworksClient->setIamPolicy( - $project, - $region, - $regionSetPolicyRequestResource, - $resource - ); + $response = $subnetworksClient->setIamPolicy($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/SubnetworksClient/set_private_ip_google_access.php b/Compute/samples/V1/SubnetworksClient/set_private_ip_google_access.php index 58376fa65fca..5f97b80bf9c4 100644 --- a/Compute/samples/V1/SubnetworksClient/set_private_ip_google_access.php +++ b/Compute/samples/V1/SubnetworksClient/set_private_ip_google_access.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_Subnetworks_SetPrivateIpGoogleAccess_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\SubnetworksClient; +use Google\Cloud\Compute\V1\Client\SubnetworksClient; +use Google\Cloud\Compute\V1\SetPrivateIpGoogleAccessSubnetworkRequest; use Google\Cloud\Compute\V1\SubnetworksSetPrivateIpGoogleAccessRequest; use Google\Rpc\Status; @@ -44,18 +45,20 @@ function set_private_ip_google_access_sample( // Create a client. $subnetworksClient = new SubnetworksClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $subnetworksSetPrivateIpGoogleAccessRequestResource = new SubnetworksSetPrivateIpGoogleAccessRequest(); + $request = (new SetPrivateIpGoogleAccessSubnetworkRequest()) + ->setProject($project) + ->setRegion($region) + ->setSubnetwork($subnetwork) + ->setSubnetworksSetPrivateIpGoogleAccessRequestResource( + $subnetworksSetPrivateIpGoogleAccessRequestResource + ); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $subnetworksClient->setPrivateIpGoogleAccess( - $project, - $region, - $subnetwork, - $subnetworksSetPrivateIpGoogleAccessRequestResource - ); + $response = $subnetworksClient->setPrivateIpGoogleAccess($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/SubnetworksClient/test_iam_permissions.php b/Compute/samples/V1/SubnetworksClient/test_iam_permissions.php index 1954db9095ef..bd069af17fec 100644 --- a/Compute/samples/V1/SubnetworksClient/test_iam_permissions.php +++ b/Compute/samples/V1/SubnetworksClient/test_iam_permissions.php @@ -24,7 +24,8 @@ // [START compute_v1_generated_Subnetworks_TestIamPermissions_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\SubnetworksClient; +use Google\Cloud\Compute\V1\Client\SubnetworksClient; +use Google\Cloud\Compute\V1\TestIamPermissionsSubnetworkRequest; use Google\Cloud\Compute\V1\TestPermissionsRequest; use Google\Cloud\Compute\V1\TestPermissionsResponse; @@ -40,18 +41,18 @@ function test_iam_permissions_sample(string $project, string $region, string $re // Create a client. $subnetworksClient = new SubnetworksClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $testPermissionsRequestResource = new TestPermissionsRequest(); + $request = (new TestIamPermissionsSubnetworkRequest()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); // Call the API and handle any network failures. try { /** @var TestPermissionsResponse $response */ - $response = $subnetworksClient->testIamPermissions( - $project, - $region, - $resource, - $testPermissionsRequestResource - ); + $response = $subnetworksClient->testIamPermissions($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/TargetGrpcProxiesClient/delete.php b/Compute/samples/V1/TargetGrpcProxiesClient/delete.php index f9152503c237..323934b2e8b9 100644 --- a/Compute/samples/V1/TargetGrpcProxiesClient/delete.php +++ b/Compute/samples/V1/TargetGrpcProxiesClient/delete.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_TargetGrpcProxies_Delete_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\TargetGrpcProxiesClient; +use Google\Cloud\Compute\V1\Client\TargetGrpcProxiesClient; +use Google\Cloud\Compute\V1\DeleteTargetGrpcProxyRequest; use Google\Rpc\Status; /** @@ -39,10 +40,15 @@ function delete_sample(string $project, string $targetGrpcProxy): void // Create a client. $targetGrpcProxiesClient = new TargetGrpcProxiesClient(); + // Prepare the request message. + $request = (new DeleteTargetGrpcProxyRequest()) + ->setProject($project) + ->setTargetGrpcProxy($targetGrpcProxy); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $targetGrpcProxiesClient->delete($project, $targetGrpcProxy); + $response = $targetGrpcProxiesClient->delete($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/TargetGrpcProxiesClient/get.php b/Compute/samples/V1/TargetGrpcProxiesClient/get.php index 132a6bade365..0b3843b82f52 100644 --- a/Compute/samples/V1/TargetGrpcProxiesClient/get.php +++ b/Compute/samples/V1/TargetGrpcProxiesClient/get.php @@ -24,7 +24,8 @@ // [START compute_v1_generated_TargetGrpcProxies_Get_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\TargetGrpcProxiesClient; +use Google\Cloud\Compute\V1\Client\TargetGrpcProxiesClient; +use Google\Cloud\Compute\V1\GetTargetGrpcProxyRequest; use Google\Cloud\Compute\V1\TargetGrpcProxy; /** @@ -38,10 +39,15 @@ function get_sample(string $project, string $targetGrpcProxy): void // Create a client. $targetGrpcProxiesClient = new TargetGrpcProxiesClient(); + // Prepare the request message. + $request = (new GetTargetGrpcProxyRequest()) + ->setProject($project) + ->setTargetGrpcProxy($targetGrpcProxy); + // Call the API and handle any network failures. try { /** @var TargetGrpcProxy $response */ - $response = $targetGrpcProxiesClient->get($project, $targetGrpcProxy); + $response = $targetGrpcProxiesClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/TargetGrpcProxiesClient/insert.php b/Compute/samples/V1/TargetGrpcProxiesClient/insert.php index 477f1a164563..2cc63a6b86cb 100644 --- a/Compute/samples/V1/TargetGrpcProxiesClient/insert.php +++ b/Compute/samples/V1/TargetGrpcProxiesClient/insert.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_TargetGrpcProxies_Insert_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\TargetGrpcProxiesClient; +use Google\Cloud\Compute\V1\Client\TargetGrpcProxiesClient; +use Google\Cloud\Compute\V1\InsertTargetGrpcProxyRequest; use Google\Cloud\Compute\V1\TargetGrpcProxy; use Google\Rpc\Status; @@ -39,13 +40,16 @@ function insert_sample(string $project): void // Create a client. $targetGrpcProxiesClient = new TargetGrpcProxiesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $targetGrpcProxyResource = new TargetGrpcProxy(); + $request = (new InsertTargetGrpcProxyRequest()) + ->setProject($project) + ->setTargetGrpcProxyResource($targetGrpcProxyResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $targetGrpcProxiesClient->insert($project, $targetGrpcProxyResource); + $response = $targetGrpcProxiesClient->insert($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/TargetGrpcProxiesClient/list.php b/Compute/samples/V1/TargetGrpcProxiesClient/list.php index a73d1207e668..eacc26b30b10 100644 --- a/Compute/samples/V1/TargetGrpcProxiesClient/list.php +++ b/Compute/samples/V1/TargetGrpcProxiesClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_TargetGrpcProxies_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\TargetGrpcProxiesClient; +use Google\Cloud\Compute\V1\Client\TargetGrpcProxiesClient; +use Google\Cloud\Compute\V1\ListTargetGrpcProxiesRequest; /** * Lists the TargetGrpcProxies for a project in the given scope. @@ -37,10 +38,14 @@ function list_sample(string $project): void // Create a client. $targetGrpcProxiesClient = new TargetGrpcProxiesClient(); + // Prepare the request message. + $request = (new ListTargetGrpcProxiesRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $targetGrpcProxiesClient->list($project); + $response = $targetGrpcProxiesClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/TargetGrpcProxiesClient/patch.php b/Compute/samples/V1/TargetGrpcProxiesClient/patch.php index e24ee415d632..08030c06b633 100644 --- a/Compute/samples/V1/TargetGrpcProxiesClient/patch.php +++ b/Compute/samples/V1/TargetGrpcProxiesClient/patch.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_TargetGrpcProxies_Patch_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\TargetGrpcProxiesClient; +use Google\Cloud\Compute\V1\Client\TargetGrpcProxiesClient; +use Google\Cloud\Compute\V1\PatchTargetGrpcProxyRequest; use Google\Cloud\Compute\V1\TargetGrpcProxy; use Google\Rpc\Status; @@ -40,13 +41,17 @@ function patch_sample(string $project, string $targetGrpcProxy): void // Create a client. $targetGrpcProxiesClient = new TargetGrpcProxiesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $targetGrpcProxyResource = new TargetGrpcProxy(); + $request = (new PatchTargetGrpcProxyRequest()) + ->setProject($project) + ->setTargetGrpcProxy($targetGrpcProxy) + ->setTargetGrpcProxyResource($targetGrpcProxyResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $targetGrpcProxiesClient->patch($project, $targetGrpcProxy, $targetGrpcProxyResource); + $response = $targetGrpcProxiesClient->patch($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/TargetHttpProxiesClient/aggregated_list.php b/Compute/samples/V1/TargetHttpProxiesClient/aggregated_list.php index 2c2a17c27159..cec545ac187c 100644 --- a/Compute/samples/V1/TargetHttpProxiesClient/aggregated_list.php +++ b/Compute/samples/V1/TargetHttpProxiesClient/aggregated_list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_TargetHttpProxies_AggregatedList_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\TargetHttpProxiesClient; +use Google\Cloud\Compute\V1\AggregatedListTargetHttpProxiesRequest; +use Google\Cloud\Compute\V1\Client\TargetHttpProxiesClient; /** * 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`. @@ -37,10 +38,14 @@ function aggregated_list_sample(string $project): void // Create a client. $targetHttpProxiesClient = new TargetHttpProxiesClient(); + // Prepare the request message. + $request = (new AggregatedListTargetHttpProxiesRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $targetHttpProxiesClient->aggregatedList($project); + $response = $targetHttpProxiesClient->aggregatedList($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/TargetHttpProxiesClient/delete.php b/Compute/samples/V1/TargetHttpProxiesClient/delete.php index f576303dc9b7..d1777d3dc02a 100644 --- a/Compute/samples/V1/TargetHttpProxiesClient/delete.php +++ b/Compute/samples/V1/TargetHttpProxiesClient/delete.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_TargetHttpProxies_Delete_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\TargetHttpProxiesClient; +use Google\Cloud\Compute\V1\Client\TargetHttpProxiesClient; +use Google\Cloud\Compute\V1\DeleteTargetHttpProxyRequest; use Google\Rpc\Status; /** @@ -39,10 +40,15 @@ function delete_sample(string $project, string $targetHttpProxy): void // Create a client. $targetHttpProxiesClient = new TargetHttpProxiesClient(); + // Prepare the request message. + $request = (new DeleteTargetHttpProxyRequest()) + ->setProject($project) + ->setTargetHttpProxy($targetHttpProxy); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $targetHttpProxiesClient->delete($project, $targetHttpProxy); + $response = $targetHttpProxiesClient->delete($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/TargetHttpProxiesClient/get.php b/Compute/samples/V1/TargetHttpProxiesClient/get.php index 291a12c3d556..d98d026cac22 100644 --- a/Compute/samples/V1/TargetHttpProxiesClient/get.php +++ b/Compute/samples/V1/TargetHttpProxiesClient/get.php @@ -24,7 +24,8 @@ // [START compute_v1_generated_TargetHttpProxies_Get_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\TargetHttpProxiesClient; +use Google\Cloud\Compute\V1\Client\TargetHttpProxiesClient; +use Google\Cloud\Compute\V1\GetTargetHttpProxyRequest; use Google\Cloud\Compute\V1\TargetHttpProxy; /** @@ -38,10 +39,15 @@ function get_sample(string $project, string $targetHttpProxy): void // Create a client. $targetHttpProxiesClient = new TargetHttpProxiesClient(); + // Prepare the request message. + $request = (new GetTargetHttpProxyRequest()) + ->setProject($project) + ->setTargetHttpProxy($targetHttpProxy); + // Call the API and handle any network failures. try { /** @var TargetHttpProxy $response */ - $response = $targetHttpProxiesClient->get($project, $targetHttpProxy); + $response = $targetHttpProxiesClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/TargetHttpProxiesClient/insert.php b/Compute/samples/V1/TargetHttpProxiesClient/insert.php index 003c008fdfb4..901d5dbe315f 100644 --- a/Compute/samples/V1/TargetHttpProxiesClient/insert.php +++ b/Compute/samples/V1/TargetHttpProxiesClient/insert.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_TargetHttpProxies_Insert_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\TargetHttpProxiesClient; +use Google\Cloud\Compute\V1\Client\TargetHttpProxiesClient; +use Google\Cloud\Compute\V1\InsertTargetHttpProxyRequest; use Google\Cloud\Compute\V1\TargetHttpProxy; use Google\Rpc\Status; @@ -39,13 +40,16 @@ function insert_sample(string $project): void // Create a client. $targetHttpProxiesClient = new TargetHttpProxiesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $targetHttpProxyResource = new TargetHttpProxy(); + $request = (new InsertTargetHttpProxyRequest()) + ->setProject($project) + ->setTargetHttpProxyResource($targetHttpProxyResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $targetHttpProxiesClient->insert($project, $targetHttpProxyResource); + $response = $targetHttpProxiesClient->insert($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/TargetHttpProxiesClient/list.php b/Compute/samples/V1/TargetHttpProxiesClient/list.php index 337c33de6a7d..11fbd7c28264 100644 --- a/Compute/samples/V1/TargetHttpProxiesClient/list.php +++ b/Compute/samples/V1/TargetHttpProxiesClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_TargetHttpProxies_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\TargetHttpProxiesClient; +use Google\Cloud\Compute\V1\Client\TargetHttpProxiesClient; +use Google\Cloud\Compute\V1\ListTargetHttpProxiesRequest; /** * Retrieves the list of TargetHttpProxy resources available to the specified project. @@ -37,10 +38,14 @@ function list_sample(string $project): void // Create a client. $targetHttpProxiesClient = new TargetHttpProxiesClient(); + // Prepare the request message. + $request = (new ListTargetHttpProxiesRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $targetHttpProxiesClient->list($project); + $response = $targetHttpProxiesClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/TargetHttpProxiesClient/patch.php b/Compute/samples/V1/TargetHttpProxiesClient/patch.php index 485da8b0026a..fdfc5dcaaa23 100644 --- a/Compute/samples/V1/TargetHttpProxiesClient/patch.php +++ b/Compute/samples/V1/TargetHttpProxiesClient/patch.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_TargetHttpProxies_Patch_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\TargetHttpProxiesClient; +use Google\Cloud\Compute\V1\Client\TargetHttpProxiesClient; +use Google\Cloud\Compute\V1\PatchTargetHttpProxyRequest; use Google\Cloud\Compute\V1\TargetHttpProxy; use Google\Rpc\Status; @@ -40,13 +41,17 @@ function patch_sample(string $project, string $targetHttpProxy): void // Create a client. $targetHttpProxiesClient = new TargetHttpProxiesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $targetHttpProxyResource = new TargetHttpProxy(); + $request = (new PatchTargetHttpProxyRequest()) + ->setProject($project) + ->setTargetHttpProxy($targetHttpProxy) + ->setTargetHttpProxyResource($targetHttpProxyResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $targetHttpProxiesClient->patch($project, $targetHttpProxy, $targetHttpProxyResource); + $response = $targetHttpProxiesClient->patch($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/TargetHttpProxiesClient/set_url_map.php b/Compute/samples/V1/TargetHttpProxiesClient/set_url_map.php index 14066c2f9aa7..cea2fa4569df 100644 --- a/Compute/samples/V1/TargetHttpProxiesClient/set_url_map.php +++ b/Compute/samples/V1/TargetHttpProxiesClient/set_url_map.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_TargetHttpProxies_SetUrlMap_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\TargetHttpProxiesClient; +use Google\Cloud\Compute\V1\Client\TargetHttpProxiesClient; +use Google\Cloud\Compute\V1\SetUrlMapTargetHttpProxyRequest; use Google\Cloud\Compute\V1\UrlMapReference; use Google\Rpc\Status; @@ -40,17 +41,17 @@ function set_url_map_sample(string $project, string $targetHttpProxy): void // Create a client. $targetHttpProxiesClient = new TargetHttpProxiesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $urlMapReferenceResource = new UrlMapReference(); + $request = (new SetUrlMapTargetHttpProxyRequest()) + ->setProject($project) + ->setTargetHttpProxy($targetHttpProxy) + ->setUrlMapReferenceResource($urlMapReferenceResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $targetHttpProxiesClient->setUrlMap( - $project, - $targetHttpProxy, - $urlMapReferenceResource - ); + $response = $targetHttpProxiesClient->setUrlMap($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/TargetHttpsProxiesClient/aggregated_list.php b/Compute/samples/V1/TargetHttpsProxiesClient/aggregated_list.php index b901bc1279eb..eccdeb507ad0 100644 --- a/Compute/samples/V1/TargetHttpsProxiesClient/aggregated_list.php +++ b/Compute/samples/V1/TargetHttpsProxiesClient/aggregated_list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_TargetHttpsProxies_AggregatedList_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\TargetHttpsProxiesClient; +use Google\Cloud\Compute\V1\AggregatedListTargetHttpsProxiesRequest; +use Google\Cloud\Compute\V1\Client\TargetHttpsProxiesClient; /** * 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`. @@ -37,10 +38,14 @@ function aggregated_list_sample(string $project): void // Create a client. $targetHttpsProxiesClient = new TargetHttpsProxiesClient(); + // Prepare the request message. + $request = (new AggregatedListTargetHttpsProxiesRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $targetHttpsProxiesClient->aggregatedList($project); + $response = $targetHttpsProxiesClient->aggregatedList($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/TargetHttpsProxiesClient/delete.php b/Compute/samples/V1/TargetHttpsProxiesClient/delete.php index 273333837f42..21f2d8a980c0 100644 --- a/Compute/samples/V1/TargetHttpsProxiesClient/delete.php +++ b/Compute/samples/V1/TargetHttpsProxiesClient/delete.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_TargetHttpsProxies_Delete_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\TargetHttpsProxiesClient; +use Google\Cloud\Compute\V1\Client\TargetHttpsProxiesClient; +use Google\Cloud\Compute\V1\DeleteTargetHttpsProxyRequest; use Google\Rpc\Status; /** @@ -39,10 +40,15 @@ function delete_sample(string $project, string $targetHttpsProxy): void // Create a client. $targetHttpsProxiesClient = new TargetHttpsProxiesClient(); + // Prepare the request message. + $request = (new DeleteTargetHttpsProxyRequest()) + ->setProject($project) + ->setTargetHttpsProxy($targetHttpsProxy); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $targetHttpsProxiesClient->delete($project, $targetHttpsProxy); + $response = $targetHttpsProxiesClient->delete($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/TargetHttpsProxiesClient/get.php b/Compute/samples/V1/TargetHttpsProxiesClient/get.php index 06b2907920c0..0fc7a48d833e 100644 --- a/Compute/samples/V1/TargetHttpsProxiesClient/get.php +++ b/Compute/samples/V1/TargetHttpsProxiesClient/get.php @@ -24,7 +24,8 @@ // [START compute_v1_generated_TargetHttpsProxies_Get_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\TargetHttpsProxiesClient; +use Google\Cloud\Compute\V1\Client\TargetHttpsProxiesClient; +use Google\Cloud\Compute\V1\GetTargetHttpsProxyRequest; use Google\Cloud\Compute\V1\TargetHttpsProxy; /** @@ -38,10 +39,15 @@ function get_sample(string $project, string $targetHttpsProxy): void // Create a client. $targetHttpsProxiesClient = new TargetHttpsProxiesClient(); + // Prepare the request message. + $request = (new GetTargetHttpsProxyRequest()) + ->setProject($project) + ->setTargetHttpsProxy($targetHttpsProxy); + // Call the API and handle any network failures. try { /** @var TargetHttpsProxy $response */ - $response = $targetHttpsProxiesClient->get($project, $targetHttpsProxy); + $response = $targetHttpsProxiesClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/TargetHttpsProxiesClient/insert.php b/Compute/samples/V1/TargetHttpsProxiesClient/insert.php index f46e057d07ad..6300f1aecc5f 100644 --- a/Compute/samples/V1/TargetHttpsProxiesClient/insert.php +++ b/Compute/samples/V1/TargetHttpsProxiesClient/insert.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_TargetHttpsProxies_Insert_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\TargetHttpsProxiesClient; +use Google\Cloud\Compute\V1\Client\TargetHttpsProxiesClient; +use Google\Cloud\Compute\V1\InsertTargetHttpsProxyRequest; use Google\Cloud\Compute\V1\TargetHttpsProxy; use Google\Rpc\Status; @@ -39,13 +40,16 @@ function insert_sample(string $project): void // Create a client. $targetHttpsProxiesClient = new TargetHttpsProxiesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $targetHttpsProxyResource = new TargetHttpsProxy(); + $request = (new InsertTargetHttpsProxyRequest()) + ->setProject($project) + ->setTargetHttpsProxyResource($targetHttpsProxyResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $targetHttpsProxiesClient->insert($project, $targetHttpsProxyResource); + $response = $targetHttpsProxiesClient->insert($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/TargetHttpsProxiesClient/list.php b/Compute/samples/V1/TargetHttpsProxiesClient/list.php index bca8daa5e622..a645152342d5 100644 --- a/Compute/samples/V1/TargetHttpsProxiesClient/list.php +++ b/Compute/samples/V1/TargetHttpsProxiesClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_TargetHttpsProxies_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\TargetHttpsProxiesClient; +use Google\Cloud\Compute\V1\Client\TargetHttpsProxiesClient; +use Google\Cloud\Compute\V1\ListTargetHttpsProxiesRequest; /** * Retrieves the list of TargetHttpsProxy resources available to the specified project. @@ -37,10 +38,14 @@ function list_sample(string $project): void // Create a client. $targetHttpsProxiesClient = new TargetHttpsProxiesClient(); + // Prepare the request message. + $request = (new ListTargetHttpsProxiesRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $targetHttpsProxiesClient->list($project); + $response = $targetHttpsProxiesClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/TargetHttpsProxiesClient/patch.php b/Compute/samples/V1/TargetHttpsProxiesClient/patch.php index 18af0ab4e1c7..b89583a88b19 100644 --- a/Compute/samples/V1/TargetHttpsProxiesClient/patch.php +++ b/Compute/samples/V1/TargetHttpsProxiesClient/patch.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_TargetHttpsProxies_Patch_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\TargetHttpsProxiesClient; +use Google\Cloud\Compute\V1\Client\TargetHttpsProxiesClient; +use Google\Cloud\Compute\V1\PatchTargetHttpsProxyRequest; use Google\Cloud\Compute\V1\TargetHttpsProxy; use Google\Rpc\Status; @@ -40,17 +41,17 @@ function patch_sample(string $project, string $targetHttpsProxy): void // Create a client. $targetHttpsProxiesClient = new TargetHttpsProxiesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $targetHttpsProxyResource = new TargetHttpsProxy(); + $request = (new PatchTargetHttpsProxyRequest()) + ->setProject($project) + ->setTargetHttpsProxy($targetHttpsProxy) + ->setTargetHttpsProxyResource($targetHttpsProxyResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $targetHttpsProxiesClient->patch( - $project, - $targetHttpsProxy, - $targetHttpsProxyResource - ); + $response = $targetHttpsProxiesClient->patch($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/TargetHttpsProxiesClient/set_certificate_map.php b/Compute/samples/V1/TargetHttpsProxiesClient/set_certificate_map.php index 5ca82c1b0f32..e075e503edc5 100644 --- a/Compute/samples/V1/TargetHttpsProxiesClient/set_certificate_map.php +++ b/Compute/samples/V1/TargetHttpsProxiesClient/set_certificate_map.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_TargetHttpsProxies_SetCertificateMap_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\TargetHttpsProxiesClient; +use Google\Cloud\Compute\V1\Client\TargetHttpsProxiesClient; +use Google\Cloud\Compute\V1\SetCertificateMapTargetHttpsProxyRequest; use Google\Cloud\Compute\V1\TargetHttpsProxiesSetCertificateMapRequest; use Google\Rpc\Status; @@ -40,17 +41,19 @@ function set_certificate_map_sample(string $project, string $targetHttpsProxy): // Create a client. $targetHttpsProxiesClient = new TargetHttpsProxiesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $targetHttpsProxiesSetCertificateMapRequestResource = new TargetHttpsProxiesSetCertificateMapRequest(); + $request = (new SetCertificateMapTargetHttpsProxyRequest()) + ->setProject($project) + ->setTargetHttpsProxiesSetCertificateMapRequestResource( + $targetHttpsProxiesSetCertificateMapRequestResource + ) + ->setTargetHttpsProxy($targetHttpsProxy); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $targetHttpsProxiesClient->setCertificateMap( - $project, - $targetHttpsProxiesSetCertificateMapRequestResource, - $targetHttpsProxy - ); + $response = $targetHttpsProxiesClient->setCertificateMap($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/TargetHttpsProxiesClient/set_quic_override.php b/Compute/samples/V1/TargetHttpsProxiesClient/set_quic_override.php index c85ebb8fbde7..a50b9e034d5a 100644 --- a/Compute/samples/V1/TargetHttpsProxiesClient/set_quic_override.php +++ b/Compute/samples/V1/TargetHttpsProxiesClient/set_quic_override.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_TargetHttpsProxies_SetQuicOverride_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\TargetHttpsProxiesClient; +use Google\Cloud\Compute\V1\Client\TargetHttpsProxiesClient; +use Google\Cloud\Compute\V1\SetQuicOverrideTargetHttpsProxyRequest; use Google\Cloud\Compute\V1\TargetHttpsProxiesSetQuicOverrideRequest; use Google\Rpc\Status; @@ -40,17 +41,19 @@ function set_quic_override_sample(string $project, string $targetHttpsProxy): vo // Create a client. $targetHttpsProxiesClient = new TargetHttpsProxiesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $targetHttpsProxiesSetQuicOverrideRequestResource = new TargetHttpsProxiesSetQuicOverrideRequest(); + $request = (new SetQuicOverrideTargetHttpsProxyRequest()) + ->setProject($project) + ->setTargetHttpsProxiesSetQuicOverrideRequestResource( + $targetHttpsProxiesSetQuicOverrideRequestResource + ) + ->setTargetHttpsProxy($targetHttpsProxy); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $targetHttpsProxiesClient->setQuicOverride( - $project, - $targetHttpsProxiesSetQuicOverrideRequestResource, - $targetHttpsProxy - ); + $response = $targetHttpsProxiesClient->setQuicOverride($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/TargetHttpsProxiesClient/set_ssl_certificates.php b/Compute/samples/V1/TargetHttpsProxiesClient/set_ssl_certificates.php index 66e3ad24b916..f787815e5b3d 100644 --- a/Compute/samples/V1/TargetHttpsProxiesClient/set_ssl_certificates.php +++ b/Compute/samples/V1/TargetHttpsProxiesClient/set_ssl_certificates.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_TargetHttpsProxies_SetSslCertificates_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\TargetHttpsProxiesClient; +use Google\Cloud\Compute\V1\Client\TargetHttpsProxiesClient; +use Google\Cloud\Compute\V1\SetSslCertificatesTargetHttpsProxyRequest; use Google\Cloud\Compute\V1\TargetHttpsProxiesSetSslCertificatesRequest; use Google\Rpc\Status; @@ -40,17 +41,19 @@ function set_ssl_certificates_sample(string $project, string $targetHttpsProxy): // Create a client. $targetHttpsProxiesClient = new TargetHttpsProxiesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $targetHttpsProxiesSetSslCertificatesRequestResource = new TargetHttpsProxiesSetSslCertificatesRequest(); + $request = (new SetSslCertificatesTargetHttpsProxyRequest()) + ->setProject($project) + ->setTargetHttpsProxiesSetSslCertificatesRequestResource( + $targetHttpsProxiesSetSslCertificatesRequestResource + ) + ->setTargetHttpsProxy($targetHttpsProxy); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $targetHttpsProxiesClient->setSslCertificates( - $project, - $targetHttpsProxiesSetSslCertificatesRequestResource, - $targetHttpsProxy - ); + $response = $targetHttpsProxiesClient->setSslCertificates($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/TargetHttpsProxiesClient/set_ssl_policy.php b/Compute/samples/V1/TargetHttpsProxiesClient/set_ssl_policy.php index ceb6f85f13f2..021947d5f857 100644 --- a/Compute/samples/V1/TargetHttpsProxiesClient/set_ssl_policy.php +++ b/Compute/samples/V1/TargetHttpsProxiesClient/set_ssl_policy.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_TargetHttpsProxies_SetSslPolicy_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\TargetHttpsProxiesClient; +use Google\Cloud\Compute\V1\SetSslPolicyTargetHttpsProxyRequest; use Google\Cloud\Compute\V1\SslPolicyReference; -use Google\Cloud\Compute\V1\TargetHttpsProxiesClient; use Google\Rpc\Status; /** @@ -40,17 +41,17 @@ function set_ssl_policy_sample(string $project, string $targetHttpsProxy): void // Create a client. $targetHttpsProxiesClient = new TargetHttpsProxiesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $sslPolicyReferenceResource = new SslPolicyReference(); + $request = (new SetSslPolicyTargetHttpsProxyRequest()) + ->setProject($project) + ->setSslPolicyReferenceResource($sslPolicyReferenceResource) + ->setTargetHttpsProxy($targetHttpsProxy); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $targetHttpsProxiesClient->setSslPolicy( - $project, - $sslPolicyReferenceResource, - $targetHttpsProxy - ); + $response = $targetHttpsProxiesClient->setSslPolicy($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/TargetHttpsProxiesClient/set_url_map.php b/Compute/samples/V1/TargetHttpsProxiesClient/set_url_map.php index b89cf4b0147d..ea815b0b3301 100644 --- a/Compute/samples/V1/TargetHttpsProxiesClient/set_url_map.php +++ b/Compute/samples/V1/TargetHttpsProxiesClient/set_url_map.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_TargetHttpsProxies_SetUrlMap_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\TargetHttpsProxiesClient; +use Google\Cloud\Compute\V1\Client\TargetHttpsProxiesClient; +use Google\Cloud\Compute\V1\SetUrlMapTargetHttpsProxyRequest; use Google\Cloud\Compute\V1\UrlMapReference; use Google\Rpc\Status; @@ -40,17 +41,17 @@ function set_url_map_sample(string $project, string $targetHttpsProxy): void // Create a client. $targetHttpsProxiesClient = new TargetHttpsProxiesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $urlMapReferenceResource = new UrlMapReference(); + $request = (new SetUrlMapTargetHttpsProxyRequest()) + ->setProject($project) + ->setTargetHttpsProxy($targetHttpsProxy) + ->setUrlMapReferenceResource($urlMapReferenceResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $targetHttpsProxiesClient->setUrlMap( - $project, - $targetHttpsProxy, - $urlMapReferenceResource - ); + $response = $targetHttpsProxiesClient->setUrlMap($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/TargetInstancesClient/aggregated_list.php b/Compute/samples/V1/TargetInstancesClient/aggregated_list.php index d0ca6de0cf1e..ebbc4ccab212 100644 --- a/Compute/samples/V1/TargetInstancesClient/aggregated_list.php +++ b/Compute/samples/V1/TargetInstancesClient/aggregated_list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_TargetInstances_AggregatedList_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\TargetInstancesClient; +use Google\Cloud\Compute\V1\AggregatedListTargetInstancesRequest; +use Google\Cloud\Compute\V1\Client\TargetInstancesClient; /** * Retrieves an aggregated list of target instances. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. @@ -37,10 +38,14 @@ function aggregated_list_sample(string $project): void // Create a client. $targetInstancesClient = new TargetInstancesClient(); + // Prepare the request message. + $request = (new AggregatedListTargetInstancesRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $targetInstancesClient->aggregatedList($project); + $response = $targetInstancesClient->aggregatedList($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/TargetInstancesClient/delete.php b/Compute/samples/V1/TargetInstancesClient/delete.php index 0729b65efae0..55de66fb0a23 100644 --- a/Compute/samples/V1/TargetInstancesClient/delete.php +++ b/Compute/samples/V1/TargetInstancesClient/delete.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_TargetInstances_Delete_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\TargetInstancesClient; +use Google\Cloud\Compute\V1\Client\TargetInstancesClient; +use Google\Cloud\Compute\V1\DeleteTargetInstanceRequest; use Google\Rpc\Status; /** @@ -40,10 +41,16 @@ function delete_sample(string $project, string $targetInstance, string $zone): v // Create a client. $targetInstancesClient = new TargetInstancesClient(); + // Prepare the request message. + $request = (new DeleteTargetInstanceRequest()) + ->setProject($project) + ->setTargetInstance($targetInstance) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $targetInstancesClient->delete($project, $targetInstance, $zone); + $response = $targetInstancesClient->delete($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/TargetInstancesClient/get.php b/Compute/samples/V1/TargetInstancesClient/get.php index 33975c7d8a3e..4910a9723977 100644 --- a/Compute/samples/V1/TargetInstancesClient/get.php +++ b/Compute/samples/V1/TargetInstancesClient/get.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_TargetInstances_Get_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\TargetInstancesClient; +use Google\Cloud\Compute\V1\GetTargetInstanceRequest; use Google\Cloud\Compute\V1\TargetInstance; -use Google\Cloud\Compute\V1\TargetInstancesClient; /** * Returns the specified TargetInstance resource. @@ -39,10 +40,16 @@ function get_sample(string $project, string $targetInstance, string $zone): void // Create a client. $targetInstancesClient = new TargetInstancesClient(); + // Prepare the request message. + $request = (new GetTargetInstanceRequest()) + ->setProject($project) + ->setTargetInstance($targetInstance) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var TargetInstance $response */ - $response = $targetInstancesClient->get($project, $targetInstance, $zone); + $response = $targetInstancesClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/TargetInstancesClient/insert.php b/Compute/samples/V1/TargetInstancesClient/insert.php index e25d6e514990..74b7364465be 100644 --- a/Compute/samples/V1/TargetInstancesClient/insert.php +++ b/Compute/samples/V1/TargetInstancesClient/insert.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_TargetInstances_Insert_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\TargetInstancesClient; +use Google\Cloud\Compute\V1\InsertTargetInstanceRequest; use Google\Cloud\Compute\V1\TargetInstance; -use Google\Cloud\Compute\V1\TargetInstancesClient; use Google\Rpc\Status; /** @@ -40,13 +41,17 @@ function insert_sample(string $project, string $zone): void // Create a client. $targetInstancesClient = new TargetInstancesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $targetInstanceResource = new TargetInstance(); + $request = (new InsertTargetInstanceRequest()) + ->setProject($project) + ->setTargetInstanceResource($targetInstanceResource) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $targetInstancesClient->insert($project, $targetInstanceResource, $zone); + $response = $targetInstancesClient->insert($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/TargetInstancesClient/list.php b/Compute/samples/V1/TargetInstancesClient/list.php index 95d3dff0256a..076ad0cc4997 100644 --- a/Compute/samples/V1/TargetInstancesClient/list.php +++ b/Compute/samples/V1/TargetInstancesClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_TargetInstances_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\TargetInstancesClient; +use Google\Cloud\Compute\V1\Client\TargetInstancesClient; +use Google\Cloud\Compute\V1\ListTargetInstancesRequest; /** * Retrieves a list of TargetInstance resources available to the specified project and zone. @@ -38,10 +39,15 @@ function list_sample(string $project, string $zone): void // Create a client. $targetInstancesClient = new TargetInstancesClient(); + // Prepare the request message. + $request = (new ListTargetInstancesRequest()) + ->setProject($project) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $targetInstancesClient->list($project, $zone); + $response = $targetInstancesClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/TargetInstancesClient/set_security_policy.php b/Compute/samples/V1/TargetInstancesClient/set_security_policy.php index 9450b66eaadf..3a959cd2b339 100644 --- a/Compute/samples/V1/TargetInstancesClient/set_security_policy.php +++ b/Compute/samples/V1/TargetInstancesClient/set_security_policy.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_TargetInstances_SetSecurityPolicy_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\TargetInstancesClient; use Google\Cloud\Compute\V1\SecurityPolicyReference; -use Google\Cloud\Compute\V1\TargetInstancesClient; +use Google\Cloud\Compute\V1\SetSecurityPolicyTargetInstanceRequest; use Google\Rpc\Status; /** @@ -41,18 +42,18 @@ function set_security_policy_sample(string $project, string $targetInstance, str // Create a client. $targetInstancesClient = new TargetInstancesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $securityPolicyReferenceResource = new SecurityPolicyReference(); + $request = (new SetSecurityPolicyTargetInstanceRequest()) + ->setProject($project) + ->setSecurityPolicyReferenceResource($securityPolicyReferenceResource) + ->setTargetInstance($targetInstance) + ->setZone($zone); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $targetInstancesClient->setSecurityPolicy( - $project, - $securityPolicyReferenceResource, - $targetInstance, - $zone - ); + $response = $targetInstancesClient->setSecurityPolicy($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/TargetPoolsClient/add_health_check.php b/Compute/samples/V1/TargetPoolsClient/add_health_check.php index 68d4b1505daf..f582d8c3739a 100644 --- a/Compute/samples/V1/TargetPoolsClient/add_health_check.php +++ b/Compute/samples/V1/TargetPoolsClient/add_health_check.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_TargetPools_AddHealthCheck_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\AddHealthCheckTargetPoolRequest; +use Google\Cloud\Compute\V1\Client\TargetPoolsClient; use Google\Cloud\Compute\V1\TargetPoolsAddHealthCheckRequest; -use Google\Cloud\Compute\V1\TargetPoolsClient; use Google\Rpc\Status; /** @@ -41,18 +42,18 @@ function add_health_check_sample(string $project, string $region, string $target // Create a client. $targetPoolsClient = new TargetPoolsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $targetPoolsAddHealthCheckRequestResource = new TargetPoolsAddHealthCheckRequest(); + $request = (new AddHealthCheckTargetPoolRequest()) + ->setProject($project) + ->setRegion($region) + ->setTargetPool($targetPool) + ->setTargetPoolsAddHealthCheckRequestResource($targetPoolsAddHealthCheckRequestResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $targetPoolsClient->addHealthCheck( - $project, - $region, - $targetPool, - $targetPoolsAddHealthCheckRequestResource - ); + $response = $targetPoolsClient->addHealthCheck($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/TargetPoolsClient/add_instance.php b/Compute/samples/V1/TargetPoolsClient/add_instance.php index baae2e27697a..1fd10afc9a71 100644 --- a/Compute/samples/V1/TargetPoolsClient/add_instance.php +++ b/Compute/samples/V1/TargetPoolsClient/add_instance.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_TargetPools_AddInstance_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\AddInstanceTargetPoolRequest; +use Google\Cloud\Compute\V1\Client\TargetPoolsClient; use Google\Cloud\Compute\V1\TargetPoolsAddInstanceRequest; -use Google\Cloud\Compute\V1\TargetPoolsClient; use Google\Rpc\Status; /** @@ -41,18 +42,18 @@ function add_instance_sample(string $project, string $region, string $targetPool // Create a client. $targetPoolsClient = new TargetPoolsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $targetPoolsAddInstanceRequestResource = new TargetPoolsAddInstanceRequest(); + $request = (new AddInstanceTargetPoolRequest()) + ->setProject($project) + ->setRegion($region) + ->setTargetPool($targetPool) + ->setTargetPoolsAddInstanceRequestResource($targetPoolsAddInstanceRequestResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $targetPoolsClient->addInstance( - $project, - $region, - $targetPool, - $targetPoolsAddInstanceRequestResource - ); + $response = $targetPoolsClient->addInstance($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/TargetPoolsClient/aggregated_list.php b/Compute/samples/V1/TargetPoolsClient/aggregated_list.php index a0718fd18be3..c686ee305934 100644 --- a/Compute/samples/V1/TargetPoolsClient/aggregated_list.php +++ b/Compute/samples/V1/TargetPoolsClient/aggregated_list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_TargetPools_AggregatedList_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\TargetPoolsClient; +use Google\Cloud\Compute\V1\AggregatedListTargetPoolsRequest; +use Google\Cloud\Compute\V1\Client\TargetPoolsClient; /** * Retrieves an aggregated list of target pools. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. @@ -37,10 +38,14 @@ function aggregated_list_sample(string $project): void // Create a client. $targetPoolsClient = new TargetPoolsClient(); + // Prepare the request message. + $request = (new AggregatedListTargetPoolsRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $targetPoolsClient->aggregatedList($project); + $response = $targetPoolsClient->aggregatedList($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/TargetPoolsClient/delete.php b/Compute/samples/V1/TargetPoolsClient/delete.php index 5e9a49dc61c1..7d3484bc3b8d 100644 --- a/Compute/samples/V1/TargetPoolsClient/delete.php +++ b/Compute/samples/V1/TargetPoolsClient/delete.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_TargetPools_Delete_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\TargetPoolsClient; +use Google\Cloud\Compute\V1\Client\TargetPoolsClient; +use Google\Cloud\Compute\V1\DeleteTargetPoolRequest; use Google\Rpc\Status; /** @@ -40,10 +41,16 @@ function delete_sample(string $project, string $region, string $targetPool): voi // Create a client. $targetPoolsClient = new TargetPoolsClient(); + // Prepare the request message. + $request = (new DeleteTargetPoolRequest()) + ->setProject($project) + ->setRegion($region) + ->setTargetPool($targetPool); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $targetPoolsClient->delete($project, $region, $targetPool); + $response = $targetPoolsClient->delete($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/TargetPoolsClient/get.php b/Compute/samples/V1/TargetPoolsClient/get.php index 88609cd547e0..fcce4e3d1ac4 100644 --- a/Compute/samples/V1/TargetPoolsClient/get.php +++ b/Compute/samples/V1/TargetPoolsClient/get.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_TargetPools_Get_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\TargetPoolsClient; +use Google\Cloud\Compute\V1\GetTargetPoolRequest; use Google\Cloud\Compute\V1\TargetPool; -use Google\Cloud\Compute\V1\TargetPoolsClient; /** * Returns the specified target pool. @@ -39,10 +40,16 @@ function get_sample(string $project, string $region, string $targetPool): void // Create a client. $targetPoolsClient = new TargetPoolsClient(); + // Prepare the request message. + $request = (new GetTargetPoolRequest()) + ->setProject($project) + ->setRegion($region) + ->setTargetPool($targetPool); + // Call the API and handle any network failures. try { /** @var TargetPool $response */ - $response = $targetPoolsClient->get($project, $region, $targetPool); + $response = $targetPoolsClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/TargetPoolsClient/get_health.php b/Compute/samples/V1/TargetPoolsClient/get_health.php index 7dfa7516060c..01bac9e3cf26 100644 --- a/Compute/samples/V1/TargetPoolsClient/get_health.php +++ b/Compute/samples/V1/TargetPoolsClient/get_health.php @@ -24,9 +24,10 @@ // [START compute_v1_generated_TargetPools_GetHealth_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\TargetPoolsClient; +use Google\Cloud\Compute\V1\GetHealthTargetPoolRequest; use Google\Cloud\Compute\V1\InstanceReference; use Google\Cloud\Compute\V1\TargetPoolInstanceHealth; -use Google\Cloud\Compute\V1\TargetPoolsClient; /** * Gets the most recent health check results for each IP for the instance that is referenced by the given target pool. @@ -40,18 +41,18 @@ function get_health_sample(string $project, string $region, string $targetPool): // Create a client. $targetPoolsClient = new TargetPoolsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $instanceReferenceResource = new InstanceReference(); + $request = (new GetHealthTargetPoolRequest()) + ->setInstanceReferenceResource($instanceReferenceResource) + ->setProject($project) + ->setRegion($region) + ->setTargetPool($targetPool); // Call the API and handle any network failures. try { /** @var TargetPoolInstanceHealth $response */ - $response = $targetPoolsClient->getHealth( - $instanceReferenceResource, - $project, - $region, - $targetPool - ); + $response = $targetPoolsClient->getHealth($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/TargetPoolsClient/insert.php b/Compute/samples/V1/TargetPoolsClient/insert.php index 3b5906347aeb..674ac1552f20 100644 --- a/Compute/samples/V1/TargetPoolsClient/insert.php +++ b/Compute/samples/V1/TargetPoolsClient/insert.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_TargetPools_Insert_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\TargetPoolsClient; +use Google\Cloud\Compute\V1\InsertTargetPoolRequest; use Google\Cloud\Compute\V1\TargetPool; -use Google\Cloud\Compute\V1\TargetPoolsClient; use Google\Rpc\Status; /** @@ -40,13 +41,17 @@ function insert_sample(string $project, string $region): void // Create a client. $targetPoolsClient = new TargetPoolsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $targetPoolResource = new TargetPool(); + $request = (new InsertTargetPoolRequest()) + ->setProject($project) + ->setRegion($region) + ->setTargetPoolResource($targetPoolResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $targetPoolsClient->insert($project, $region, $targetPoolResource); + $response = $targetPoolsClient->insert($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/TargetPoolsClient/list.php b/Compute/samples/V1/TargetPoolsClient/list.php index 4a5b2d513d72..23318fefa39f 100644 --- a/Compute/samples/V1/TargetPoolsClient/list.php +++ b/Compute/samples/V1/TargetPoolsClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_TargetPools_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\TargetPoolsClient; +use Google\Cloud\Compute\V1\Client\TargetPoolsClient; +use Google\Cloud\Compute\V1\ListTargetPoolsRequest; /** * Retrieves a list of target pools available to the specified project and region. @@ -38,10 +39,15 @@ function list_sample(string $project, string $region): void // Create a client. $targetPoolsClient = new TargetPoolsClient(); + // Prepare the request message. + $request = (new ListTargetPoolsRequest()) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $targetPoolsClient->list($project, $region); + $response = $targetPoolsClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/TargetPoolsClient/remove_health_check.php b/Compute/samples/V1/TargetPoolsClient/remove_health_check.php index b59befb4e2ce..8a703b5d910f 100644 --- a/Compute/samples/V1/TargetPoolsClient/remove_health_check.php +++ b/Compute/samples/V1/TargetPoolsClient/remove_health_check.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_TargetPools_RemoveHealthCheck_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\TargetPoolsClient; +use Google\Cloud\Compute\V1\Client\TargetPoolsClient; +use Google\Cloud\Compute\V1\RemoveHealthCheckTargetPoolRequest; use Google\Cloud\Compute\V1\TargetPoolsRemoveHealthCheckRequest; use Google\Rpc\Status; @@ -41,18 +42,18 @@ function remove_health_check_sample(string $project, string $region, string $tar // Create a client. $targetPoolsClient = new TargetPoolsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $targetPoolsRemoveHealthCheckRequestResource = new TargetPoolsRemoveHealthCheckRequest(); + $request = (new RemoveHealthCheckTargetPoolRequest()) + ->setProject($project) + ->setRegion($region) + ->setTargetPool($targetPool) + ->setTargetPoolsRemoveHealthCheckRequestResource($targetPoolsRemoveHealthCheckRequestResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $targetPoolsClient->removeHealthCheck( - $project, - $region, - $targetPool, - $targetPoolsRemoveHealthCheckRequestResource - ); + $response = $targetPoolsClient->removeHealthCheck($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/TargetPoolsClient/remove_instance.php b/Compute/samples/V1/TargetPoolsClient/remove_instance.php index 770dc805596e..38835fa81526 100644 --- a/Compute/samples/V1/TargetPoolsClient/remove_instance.php +++ b/Compute/samples/V1/TargetPoolsClient/remove_instance.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_TargetPools_RemoveInstance_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\TargetPoolsClient; +use Google\Cloud\Compute\V1\Client\TargetPoolsClient; +use Google\Cloud\Compute\V1\RemoveInstanceTargetPoolRequest; use Google\Cloud\Compute\V1\TargetPoolsRemoveInstanceRequest; use Google\Rpc\Status; @@ -41,18 +42,18 @@ function remove_instance_sample(string $project, string $region, string $targetP // Create a client. $targetPoolsClient = new TargetPoolsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $targetPoolsRemoveInstanceRequestResource = new TargetPoolsRemoveInstanceRequest(); + $request = (new RemoveInstanceTargetPoolRequest()) + ->setProject($project) + ->setRegion($region) + ->setTargetPool($targetPool) + ->setTargetPoolsRemoveInstanceRequestResource($targetPoolsRemoveInstanceRequestResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $targetPoolsClient->removeInstance( - $project, - $region, - $targetPool, - $targetPoolsRemoveInstanceRequestResource - ); + $response = $targetPoolsClient->removeInstance($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/TargetPoolsClient/set_backup.php b/Compute/samples/V1/TargetPoolsClient/set_backup.php index 94200eb06b54..e3bd625525b2 100644 --- a/Compute/samples/V1/TargetPoolsClient/set_backup.php +++ b/Compute/samples/V1/TargetPoolsClient/set_backup.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_TargetPools_SetBackup_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\TargetPoolsClient; +use Google\Cloud\Compute\V1\Client\TargetPoolsClient; +use Google\Cloud\Compute\V1\SetBackupTargetPoolRequest; use Google\Cloud\Compute\V1\TargetReference; use Google\Rpc\Status; @@ -41,13 +42,18 @@ function set_backup_sample(string $project, string $region, string $targetPool): // Create a client. $targetPoolsClient = new TargetPoolsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $targetReferenceResource = new TargetReference(); + $request = (new SetBackupTargetPoolRequest()) + ->setProject($project) + ->setRegion($region) + ->setTargetPool($targetPool) + ->setTargetReferenceResource($targetReferenceResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $targetPoolsClient->setBackup($project, $region, $targetPool, $targetReferenceResource); + $response = $targetPoolsClient->setBackup($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/TargetPoolsClient/set_security_policy.php b/Compute/samples/V1/TargetPoolsClient/set_security_policy.php index e21d09fc1480..6fb96d6e181b 100644 --- a/Compute/samples/V1/TargetPoolsClient/set_security_policy.php +++ b/Compute/samples/V1/TargetPoolsClient/set_security_policy.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_TargetPools_SetSecurityPolicy_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\TargetPoolsClient; use Google\Cloud\Compute\V1\SecurityPolicyReference; -use Google\Cloud\Compute\V1\TargetPoolsClient; +use Google\Cloud\Compute\V1\SetSecurityPolicyTargetPoolRequest; use Google\Rpc\Status; /** @@ -41,18 +42,18 @@ function set_security_policy_sample(string $project, string $region, string $tar // Create a client. $targetPoolsClient = new TargetPoolsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $securityPolicyReferenceResource = new SecurityPolicyReference(); + $request = (new SetSecurityPolicyTargetPoolRequest()) + ->setProject($project) + ->setRegion($region) + ->setSecurityPolicyReferenceResource($securityPolicyReferenceResource) + ->setTargetPool($targetPool); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $targetPoolsClient->setSecurityPolicy( - $project, - $region, - $securityPolicyReferenceResource, - $targetPool - ); + $response = $targetPoolsClient->setSecurityPolicy($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/TargetSslProxiesClient/delete.php b/Compute/samples/V1/TargetSslProxiesClient/delete.php index b25637faa7cb..dd228ca27c87 100644 --- a/Compute/samples/V1/TargetSslProxiesClient/delete.php +++ b/Compute/samples/V1/TargetSslProxiesClient/delete.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_TargetSslProxies_Delete_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\TargetSslProxiesClient; +use Google\Cloud\Compute\V1\Client\TargetSslProxiesClient; +use Google\Cloud\Compute\V1\DeleteTargetSslProxyRequest; use Google\Rpc\Status; /** @@ -39,10 +40,15 @@ function delete_sample(string $project, string $targetSslProxy): void // Create a client. $targetSslProxiesClient = new TargetSslProxiesClient(); + // Prepare the request message. + $request = (new DeleteTargetSslProxyRequest()) + ->setProject($project) + ->setTargetSslProxy($targetSslProxy); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $targetSslProxiesClient->delete($project, $targetSslProxy); + $response = $targetSslProxiesClient->delete($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/TargetSslProxiesClient/get.php b/Compute/samples/V1/TargetSslProxiesClient/get.php index b2db52493bc3..5984bb7dcbe4 100644 --- a/Compute/samples/V1/TargetSslProxiesClient/get.php +++ b/Compute/samples/V1/TargetSslProxiesClient/get.php @@ -24,7 +24,8 @@ // [START compute_v1_generated_TargetSslProxies_Get_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\TargetSslProxiesClient; +use Google\Cloud\Compute\V1\Client\TargetSslProxiesClient; +use Google\Cloud\Compute\V1\GetTargetSslProxyRequest; use Google\Cloud\Compute\V1\TargetSslProxy; /** @@ -38,10 +39,15 @@ function get_sample(string $project, string $targetSslProxy): void // Create a client. $targetSslProxiesClient = new TargetSslProxiesClient(); + // Prepare the request message. + $request = (new GetTargetSslProxyRequest()) + ->setProject($project) + ->setTargetSslProxy($targetSslProxy); + // Call the API and handle any network failures. try { /** @var TargetSslProxy $response */ - $response = $targetSslProxiesClient->get($project, $targetSslProxy); + $response = $targetSslProxiesClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/TargetSslProxiesClient/insert.php b/Compute/samples/V1/TargetSslProxiesClient/insert.php index 978dee7a8810..6bbb53c7545b 100644 --- a/Compute/samples/V1/TargetSslProxiesClient/insert.php +++ b/Compute/samples/V1/TargetSslProxiesClient/insert.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_TargetSslProxies_Insert_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\TargetSslProxiesClient; +use Google\Cloud\Compute\V1\Client\TargetSslProxiesClient; +use Google\Cloud\Compute\V1\InsertTargetSslProxyRequest; use Google\Cloud\Compute\V1\TargetSslProxy; use Google\Rpc\Status; @@ -39,13 +40,16 @@ function insert_sample(string $project): void // Create a client. $targetSslProxiesClient = new TargetSslProxiesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $targetSslProxyResource = new TargetSslProxy(); + $request = (new InsertTargetSslProxyRequest()) + ->setProject($project) + ->setTargetSslProxyResource($targetSslProxyResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $targetSslProxiesClient->insert($project, $targetSslProxyResource); + $response = $targetSslProxiesClient->insert($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/TargetSslProxiesClient/list.php b/Compute/samples/V1/TargetSslProxiesClient/list.php index 7b925740f01d..d5829a6d1e4f 100644 --- a/Compute/samples/V1/TargetSslProxiesClient/list.php +++ b/Compute/samples/V1/TargetSslProxiesClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_TargetSslProxies_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\TargetSslProxiesClient; +use Google\Cloud\Compute\V1\Client\TargetSslProxiesClient; +use Google\Cloud\Compute\V1\ListTargetSslProxiesRequest; /** * Retrieves the list of TargetSslProxy resources available to the specified project. @@ -37,10 +38,14 @@ function list_sample(string $project): void // Create a client. $targetSslProxiesClient = new TargetSslProxiesClient(); + // Prepare the request message. + $request = (new ListTargetSslProxiesRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $targetSslProxiesClient->list($project); + $response = $targetSslProxiesClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/TargetSslProxiesClient/set_backend_service.php b/Compute/samples/V1/TargetSslProxiesClient/set_backend_service.php index e483f4985d80..89d470be6f1d 100644 --- a/Compute/samples/V1/TargetSslProxiesClient/set_backend_service.php +++ b/Compute/samples/V1/TargetSslProxiesClient/set_backend_service.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_TargetSslProxies_SetBackendService_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\TargetSslProxiesClient; +use Google\Cloud\Compute\V1\Client\TargetSslProxiesClient; +use Google\Cloud\Compute\V1\SetBackendServiceTargetSslProxyRequest; use Google\Cloud\Compute\V1\TargetSslProxiesSetBackendServiceRequest; use Google\Rpc\Status; @@ -40,17 +41,19 @@ function set_backend_service_sample(string $project, string $targetSslProxy): vo // Create a client. $targetSslProxiesClient = new TargetSslProxiesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $targetSslProxiesSetBackendServiceRequestResource = new TargetSslProxiesSetBackendServiceRequest(); + $request = (new SetBackendServiceTargetSslProxyRequest()) + ->setProject($project) + ->setTargetSslProxiesSetBackendServiceRequestResource( + $targetSslProxiesSetBackendServiceRequestResource + ) + ->setTargetSslProxy($targetSslProxy); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $targetSslProxiesClient->setBackendService( - $project, - $targetSslProxiesSetBackendServiceRequestResource, - $targetSslProxy - ); + $response = $targetSslProxiesClient->setBackendService($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/TargetSslProxiesClient/set_certificate_map.php b/Compute/samples/V1/TargetSslProxiesClient/set_certificate_map.php index d47d93b15556..bc16c1f341c8 100644 --- a/Compute/samples/V1/TargetSslProxiesClient/set_certificate_map.php +++ b/Compute/samples/V1/TargetSslProxiesClient/set_certificate_map.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_TargetSslProxies_SetCertificateMap_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\TargetSslProxiesClient; +use Google\Cloud\Compute\V1\Client\TargetSslProxiesClient; +use Google\Cloud\Compute\V1\SetCertificateMapTargetSslProxyRequest; use Google\Cloud\Compute\V1\TargetSslProxiesSetCertificateMapRequest; use Google\Rpc\Status; @@ -40,17 +41,19 @@ function set_certificate_map_sample(string $project, string $targetSslProxy): vo // Create a client. $targetSslProxiesClient = new TargetSslProxiesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $targetSslProxiesSetCertificateMapRequestResource = new TargetSslProxiesSetCertificateMapRequest(); + $request = (new SetCertificateMapTargetSslProxyRequest()) + ->setProject($project) + ->setTargetSslProxiesSetCertificateMapRequestResource( + $targetSslProxiesSetCertificateMapRequestResource + ) + ->setTargetSslProxy($targetSslProxy); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $targetSslProxiesClient->setCertificateMap( - $project, - $targetSslProxiesSetCertificateMapRequestResource, - $targetSslProxy - ); + $response = $targetSslProxiesClient->setCertificateMap($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/TargetSslProxiesClient/set_proxy_header.php b/Compute/samples/V1/TargetSslProxiesClient/set_proxy_header.php index 0aa4bf362348..63977a5d4879 100644 --- a/Compute/samples/V1/TargetSslProxiesClient/set_proxy_header.php +++ b/Compute/samples/V1/TargetSslProxiesClient/set_proxy_header.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_TargetSslProxies_SetProxyHeader_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\TargetSslProxiesClient; +use Google\Cloud\Compute\V1\Client\TargetSslProxiesClient; +use Google\Cloud\Compute\V1\SetProxyHeaderTargetSslProxyRequest; use Google\Cloud\Compute\V1\TargetSslProxiesSetProxyHeaderRequest; use Google\Rpc\Status; @@ -40,17 +41,17 @@ function set_proxy_header_sample(string $project, string $targetSslProxy): void // Create a client. $targetSslProxiesClient = new TargetSslProxiesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $targetSslProxiesSetProxyHeaderRequestResource = new TargetSslProxiesSetProxyHeaderRequest(); + $request = (new SetProxyHeaderTargetSslProxyRequest()) + ->setProject($project) + ->setTargetSslProxiesSetProxyHeaderRequestResource($targetSslProxiesSetProxyHeaderRequestResource) + ->setTargetSslProxy($targetSslProxy); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $targetSslProxiesClient->setProxyHeader( - $project, - $targetSslProxiesSetProxyHeaderRequestResource, - $targetSslProxy - ); + $response = $targetSslProxiesClient->setProxyHeader($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/TargetSslProxiesClient/set_ssl_certificates.php b/Compute/samples/V1/TargetSslProxiesClient/set_ssl_certificates.php index ea54235e7520..76479c770282 100644 --- a/Compute/samples/V1/TargetSslProxiesClient/set_ssl_certificates.php +++ b/Compute/samples/V1/TargetSslProxiesClient/set_ssl_certificates.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_TargetSslProxies_SetSslCertificates_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\TargetSslProxiesClient; +use Google\Cloud\Compute\V1\Client\TargetSslProxiesClient; +use Google\Cloud\Compute\V1\SetSslCertificatesTargetSslProxyRequest; use Google\Cloud\Compute\V1\TargetSslProxiesSetSslCertificatesRequest; use Google\Rpc\Status; @@ -40,17 +41,19 @@ function set_ssl_certificates_sample(string $project, string $targetSslProxy): v // Create a client. $targetSslProxiesClient = new TargetSslProxiesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $targetSslProxiesSetSslCertificatesRequestResource = new TargetSslProxiesSetSslCertificatesRequest(); + $request = (new SetSslCertificatesTargetSslProxyRequest()) + ->setProject($project) + ->setTargetSslProxiesSetSslCertificatesRequestResource( + $targetSslProxiesSetSslCertificatesRequestResource + ) + ->setTargetSslProxy($targetSslProxy); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $targetSslProxiesClient->setSslCertificates( - $project, - $targetSslProxiesSetSslCertificatesRequestResource, - $targetSslProxy - ); + $response = $targetSslProxiesClient->setSslCertificates($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/TargetSslProxiesClient/set_ssl_policy.php b/Compute/samples/V1/TargetSslProxiesClient/set_ssl_policy.php index c41d3e774cd7..9400ea722495 100644 --- a/Compute/samples/V1/TargetSslProxiesClient/set_ssl_policy.php +++ b/Compute/samples/V1/TargetSslProxiesClient/set_ssl_policy.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_TargetSslProxies_SetSslPolicy_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\TargetSslProxiesClient; +use Google\Cloud\Compute\V1\SetSslPolicyTargetSslProxyRequest; use Google\Cloud\Compute\V1\SslPolicyReference; -use Google\Cloud\Compute\V1\TargetSslProxiesClient; use Google\Rpc\Status; /** @@ -40,17 +41,17 @@ function set_ssl_policy_sample(string $project, string $targetSslProxy): void // Create a client. $targetSslProxiesClient = new TargetSslProxiesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $sslPolicyReferenceResource = new SslPolicyReference(); + $request = (new SetSslPolicyTargetSslProxyRequest()) + ->setProject($project) + ->setSslPolicyReferenceResource($sslPolicyReferenceResource) + ->setTargetSslProxy($targetSslProxy); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $targetSslProxiesClient->setSslPolicy( - $project, - $sslPolicyReferenceResource, - $targetSslProxy - ); + $response = $targetSslProxiesClient->setSslPolicy($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/TargetTcpProxiesClient/aggregated_list.php b/Compute/samples/V1/TargetTcpProxiesClient/aggregated_list.php index 2008aa99b6a0..4804c2bfa1ee 100644 --- a/Compute/samples/V1/TargetTcpProxiesClient/aggregated_list.php +++ b/Compute/samples/V1/TargetTcpProxiesClient/aggregated_list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_TargetTcpProxies_AggregatedList_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\TargetTcpProxiesClient; +use Google\Cloud\Compute\V1\AggregatedListTargetTcpProxiesRequest; +use Google\Cloud\Compute\V1\Client\TargetTcpProxiesClient; /** * 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`. @@ -37,10 +38,14 @@ function aggregated_list_sample(string $project): void // Create a client. $targetTcpProxiesClient = new TargetTcpProxiesClient(); + // Prepare the request message. + $request = (new AggregatedListTargetTcpProxiesRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $targetTcpProxiesClient->aggregatedList($project); + $response = $targetTcpProxiesClient->aggregatedList($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/TargetTcpProxiesClient/delete.php b/Compute/samples/V1/TargetTcpProxiesClient/delete.php index e37ed1752e6c..1d731bef0247 100644 --- a/Compute/samples/V1/TargetTcpProxiesClient/delete.php +++ b/Compute/samples/V1/TargetTcpProxiesClient/delete.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_TargetTcpProxies_Delete_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\TargetTcpProxiesClient; +use Google\Cloud\Compute\V1\Client\TargetTcpProxiesClient; +use Google\Cloud\Compute\V1\DeleteTargetTcpProxyRequest; use Google\Rpc\Status; /** @@ -39,10 +40,15 @@ function delete_sample(string $project, string $targetTcpProxy): void // Create a client. $targetTcpProxiesClient = new TargetTcpProxiesClient(); + // Prepare the request message. + $request = (new DeleteTargetTcpProxyRequest()) + ->setProject($project) + ->setTargetTcpProxy($targetTcpProxy); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $targetTcpProxiesClient->delete($project, $targetTcpProxy); + $response = $targetTcpProxiesClient->delete($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/TargetTcpProxiesClient/get.php b/Compute/samples/V1/TargetTcpProxiesClient/get.php index 52cd2b441162..4df9cec41a90 100644 --- a/Compute/samples/V1/TargetTcpProxiesClient/get.php +++ b/Compute/samples/V1/TargetTcpProxiesClient/get.php @@ -24,7 +24,8 @@ // [START compute_v1_generated_TargetTcpProxies_Get_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\TargetTcpProxiesClient; +use Google\Cloud\Compute\V1\Client\TargetTcpProxiesClient; +use Google\Cloud\Compute\V1\GetTargetTcpProxyRequest; use Google\Cloud\Compute\V1\TargetTcpProxy; /** @@ -38,10 +39,15 @@ function get_sample(string $project, string $targetTcpProxy): void // Create a client. $targetTcpProxiesClient = new TargetTcpProxiesClient(); + // Prepare the request message. + $request = (new GetTargetTcpProxyRequest()) + ->setProject($project) + ->setTargetTcpProxy($targetTcpProxy); + // Call the API and handle any network failures. try { /** @var TargetTcpProxy $response */ - $response = $targetTcpProxiesClient->get($project, $targetTcpProxy); + $response = $targetTcpProxiesClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/TargetTcpProxiesClient/insert.php b/Compute/samples/V1/TargetTcpProxiesClient/insert.php index 793b1148dce7..c9acebc3dd25 100644 --- a/Compute/samples/V1/TargetTcpProxiesClient/insert.php +++ b/Compute/samples/V1/TargetTcpProxiesClient/insert.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_TargetTcpProxies_Insert_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\TargetTcpProxiesClient; +use Google\Cloud\Compute\V1\Client\TargetTcpProxiesClient; +use Google\Cloud\Compute\V1\InsertTargetTcpProxyRequest; use Google\Cloud\Compute\V1\TargetTcpProxy; use Google\Rpc\Status; @@ -39,13 +40,16 @@ function insert_sample(string $project): void // Create a client. $targetTcpProxiesClient = new TargetTcpProxiesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $targetTcpProxyResource = new TargetTcpProxy(); + $request = (new InsertTargetTcpProxyRequest()) + ->setProject($project) + ->setTargetTcpProxyResource($targetTcpProxyResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $targetTcpProxiesClient->insert($project, $targetTcpProxyResource); + $response = $targetTcpProxiesClient->insert($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/TargetTcpProxiesClient/list.php b/Compute/samples/V1/TargetTcpProxiesClient/list.php index 2492fdd692be..f633b8f17580 100644 --- a/Compute/samples/V1/TargetTcpProxiesClient/list.php +++ b/Compute/samples/V1/TargetTcpProxiesClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_TargetTcpProxies_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\TargetTcpProxiesClient; +use Google\Cloud\Compute\V1\Client\TargetTcpProxiesClient; +use Google\Cloud\Compute\V1\ListTargetTcpProxiesRequest; /** * Retrieves the list of TargetTcpProxy resources available to the specified project. @@ -37,10 +38,14 @@ function list_sample(string $project): void // Create a client. $targetTcpProxiesClient = new TargetTcpProxiesClient(); + // Prepare the request message. + $request = (new ListTargetTcpProxiesRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $targetTcpProxiesClient->list($project); + $response = $targetTcpProxiesClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/TargetTcpProxiesClient/set_backend_service.php b/Compute/samples/V1/TargetTcpProxiesClient/set_backend_service.php index 516fce7cdb82..75a12917735f 100644 --- a/Compute/samples/V1/TargetTcpProxiesClient/set_backend_service.php +++ b/Compute/samples/V1/TargetTcpProxiesClient/set_backend_service.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_TargetTcpProxies_SetBackendService_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\TargetTcpProxiesClient; +use Google\Cloud\Compute\V1\Client\TargetTcpProxiesClient; +use Google\Cloud\Compute\V1\SetBackendServiceTargetTcpProxyRequest; use Google\Cloud\Compute\V1\TargetTcpProxiesSetBackendServiceRequest; use Google\Rpc\Status; @@ -40,17 +41,19 @@ function set_backend_service_sample(string $project, string $targetTcpProxy): vo // Create a client. $targetTcpProxiesClient = new TargetTcpProxiesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $targetTcpProxiesSetBackendServiceRequestResource = new TargetTcpProxiesSetBackendServiceRequest(); + $request = (new SetBackendServiceTargetTcpProxyRequest()) + ->setProject($project) + ->setTargetTcpProxiesSetBackendServiceRequestResource( + $targetTcpProxiesSetBackendServiceRequestResource + ) + ->setTargetTcpProxy($targetTcpProxy); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $targetTcpProxiesClient->setBackendService( - $project, - $targetTcpProxiesSetBackendServiceRequestResource, - $targetTcpProxy - ); + $response = $targetTcpProxiesClient->setBackendService($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/TargetTcpProxiesClient/set_proxy_header.php b/Compute/samples/V1/TargetTcpProxiesClient/set_proxy_header.php index cc70acedf488..6d3d76d3bb86 100644 --- a/Compute/samples/V1/TargetTcpProxiesClient/set_proxy_header.php +++ b/Compute/samples/V1/TargetTcpProxiesClient/set_proxy_header.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_TargetTcpProxies_SetProxyHeader_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\TargetTcpProxiesClient; +use Google\Cloud\Compute\V1\Client\TargetTcpProxiesClient; +use Google\Cloud\Compute\V1\SetProxyHeaderTargetTcpProxyRequest; use Google\Cloud\Compute\V1\TargetTcpProxiesSetProxyHeaderRequest; use Google\Rpc\Status; @@ -40,17 +41,17 @@ function set_proxy_header_sample(string $project, string $targetTcpProxy): void // Create a client. $targetTcpProxiesClient = new TargetTcpProxiesClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $targetTcpProxiesSetProxyHeaderRequestResource = new TargetTcpProxiesSetProxyHeaderRequest(); + $request = (new SetProxyHeaderTargetTcpProxyRequest()) + ->setProject($project) + ->setTargetTcpProxiesSetProxyHeaderRequestResource($targetTcpProxiesSetProxyHeaderRequestResource) + ->setTargetTcpProxy($targetTcpProxy); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $targetTcpProxiesClient->setProxyHeader( - $project, - $targetTcpProxiesSetProxyHeaderRequestResource, - $targetTcpProxy - ); + $response = $targetTcpProxiesClient->setProxyHeader($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/TargetVpnGatewaysClient/aggregated_list.php b/Compute/samples/V1/TargetVpnGatewaysClient/aggregated_list.php index 7787a2f554cd..b5850f84709d 100644 --- a/Compute/samples/V1/TargetVpnGatewaysClient/aggregated_list.php +++ b/Compute/samples/V1/TargetVpnGatewaysClient/aggregated_list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_TargetVpnGateways_AggregatedList_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\TargetVpnGatewaysClient; +use Google\Cloud\Compute\V1\AggregatedListTargetVpnGatewaysRequest; +use Google\Cloud\Compute\V1\Client\TargetVpnGatewaysClient; /** * Retrieves an aggregated list of target VPN gateways. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. @@ -37,10 +38,14 @@ function aggregated_list_sample(string $project): void // Create a client. $targetVpnGatewaysClient = new TargetVpnGatewaysClient(); + // Prepare the request message. + $request = (new AggregatedListTargetVpnGatewaysRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $targetVpnGatewaysClient->aggregatedList($project); + $response = $targetVpnGatewaysClient->aggregatedList($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/TargetVpnGatewaysClient/delete.php b/Compute/samples/V1/TargetVpnGatewaysClient/delete.php index 0ea00393569b..e652fb69ccfc 100644 --- a/Compute/samples/V1/TargetVpnGatewaysClient/delete.php +++ b/Compute/samples/V1/TargetVpnGatewaysClient/delete.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_TargetVpnGateways_Delete_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\TargetVpnGatewaysClient; +use Google\Cloud\Compute\V1\Client\TargetVpnGatewaysClient; +use Google\Cloud\Compute\V1\DeleteTargetVpnGatewayRequest; use Google\Rpc\Status; /** @@ -40,10 +41,16 @@ function delete_sample(string $project, string $region, string $targetVpnGateway // Create a client. $targetVpnGatewaysClient = new TargetVpnGatewaysClient(); + // Prepare the request message. + $request = (new DeleteTargetVpnGatewayRequest()) + ->setProject($project) + ->setRegion($region) + ->setTargetVpnGateway($targetVpnGateway); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $targetVpnGatewaysClient->delete($project, $region, $targetVpnGateway); + $response = $targetVpnGatewaysClient->delete($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/TargetVpnGatewaysClient/get.php b/Compute/samples/V1/TargetVpnGatewaysClient/get.php index bb6927b1ac15..7fc70b1d4cd2 100644 --- a/Compute/samples/V1/TargetVpnGatewaysClient/get.php +++ b/Compute/samples/V1/TargetVpnGatewaysClient/get.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_TargetVpnGateways_Get_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\TargetVpnGatewaysClient; +use Google\Cloud\Compute\V1\GetTargetVpnGatewayRequest; use Google\Cloud\Compute\V1\TargetVpnGateway; -use Google\Cloud\Compute\V1\TargetVpnGatewaysClient; /** * Returns the specified target VPN gateway. @@ -39,10 +40,16 @@ function get_sample(string $project, string $region, string $targetVpnGateway): // Create a client. $targetVpnGatewaysClient = new TargetVpnGatewaysClient(); + // Prepare the request message. + $request = (new GetTargetVpnGatewayRequest()) + ->setProject($project) + ->setRegion($region) + ->setTargetVpnGateway($targetVpnGateway); + // Call the API and handle any network failures. try { /** @var TargetVpnGateway $response */ - $response = $targetVpnGatewaysClient->get($project, $region, $targetVpnGateway); + $response = $targetVpnGatewaysClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/TargetVpnGatewaysClient/insert.php b/Compute/samples/V1/TargetVpnGatewaysClient/insert.php index cc2f132ecce8..3361c22e7276 100644 --- a/Compute/samples/V1/TargetVpnGatewaysClient/insert.php +++ b/Compute/samples/V1/TargetVpnGatewaysClient/insert.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_TargetVpnGateways_Insert_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\TargetVpnGatewaysClient; +use Google\Cloud\Compute\V1\InsertTargetVpnGatewayRequest; use Google\Cloud\Compute\V1\TargetVpnGateway; -use Google\Cloud\Compute\V1\TargetVpnGatewaysClient; use Google\Rpc\Status; /** @@ -40,13 +41,17 @@ function insert_sample(string $project, string $region): void // Create a client. $targetVpnGatewaysClient = new TargetVpnGatewaysClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $targetVpnGatewayResource = new TargetVpnGateway(); + $request = (new InsertTargetVpnGatewayRequest()) + ->setProject($project) + ->setRegion($region) + ->setTargetVpnGatewayResource($targetVpnGatewayResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $targetVpnGatewaysClient->insert($project, $region, $targetVpnGatewayResource); + $response = $targetVpnGatewaysClient->insert($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/TargetVpnGatewaysClient/list.php b/Compute/samples/V1/TargetVpnGatewaysClient/list.php index d2ebce1c6ba4..05ff29005a60 100644 --- a/Compute/samples/V1/TargetVpnGatewaysClient/list.php +++ b/Compute/samples/V1/TargetVpnGatewaysClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_TargetVpnGateways_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\TargetVpnGatewaysClient; +use Google\Cloud\Compute\V1\Client\TargetVpnGatewaysClient; +use Google\Cloud\Compute\V1\ListTargetVpnGatewaysRequest; /** * Retrieves a list of target VPN gateways available to the specified project and region. @@ -38,10 +39,15 @@ function list_sample(string $project, string $region): void // Create a client. $targetVpnGatewaysClient = new TargetVpnGatewaysClient(); + // Prepare the request message. + $request = (new ListTargetVpnGatewaysRequest()) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $targetVpnGatewaysClient->list($project, $region); + $response = $targetVpnGatewaysClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/TargetVpnGatewaysClient/set_labels.php b/Compute/samples/V1/TargetVpnGatewaysClient/set_labels.php index f675324a2049..686fab02ef73 100644 --- a/Compute/samples/V1/TargetVpnGatewaysClient/set_labels.php +++ b/Compute/samples/V1/TargetVpnGatewaysClient/set_labels.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_TargetVpnGateways_SetLabels_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\TargetVpnGatewaysClient; use Google\Cloud\Compute\V1\RegionSetLabelsRequest; -use Google\Cloud\Compute\V1\TargetVpnGatewaysClient; +use Google\Cloud\Compute\V1\SetLabelsTargetVpnGatewayRequest; use Google\Rpc\Status; /** @@ -41,18 +42,18 @@ function set_labels_sample(string $project, string $region, string $resource): v // Create a client. $targetVpnGatewaysClient = new TargetVpnGatewaysClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $regionSetLabelsRequestResource = new RegionSetLabelsRequest(); + $request = (new SetLabelsTargetVpnGatewayRequest()) + ->setProject($project) + ->setRegion($region) + ->setRegionSetLabelsRequestResource($regionSetLabelsRequestResource) + ->setResource($resource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $targetVpnGatewaysClient->setLabels( - $project, - $region, - $regionSetLabelsRequestResource, - $resource - ); + $response = $targetVpnGatewaysClient->setLabels($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/UrlMapsClient/aggregated_list.php b/Compute/samples/V1/UrlMapsClient/aggregated_list.php index b0039dcc3a01..30b3e026be7a 100644 --- a/Compute/samples/V1/UrlMapsClient/aggregated_list.php +++ b/Compute/samples/V1/UrlMapsClient/aggregated_list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_UrlMaps_AggregatedList_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\UrlMapsClient; +use Google\Cloud\Compute\V1\AggregatedListUrlMapsRequest; +use Google\Cloud\Compute\V1\Client\UrlMapsClient; /** * 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`. @@ -37,10 +38,14 @@ function aggregated_list_sample(string $project): void // Create a client. $urlMapsClient = new UrlMapsClient(); + // Prepare the request message. + $request = (new AggregatedListUrlMapsRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $urlMapsClient->aggregatedList($project); + $response = $urlMapsClient->aggregatedList($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/UrlMapsClient/delete.php b/Compute/samples/V1/UrlMapsClient/delete.php index 302b2c0ffd50..ebbed0bad7ee 100644 --- a/Compute/samples/V1/UrlMapsClient/delete.php +++ b/Compute/samples/V1/UrlMapsClient/delete.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_UrlMaps_Delete_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\UrlMapsClient; +use Google\Cloud\Compute\V1\Client\UrlMapsClient; +use Google\Cloud\Compute\V1\DeleteUrlMapRequest; use Google\Rpc\Status; /** @@ -39,10 +40,15 @@ function delete_sample(string $project, string $urlMap): void // Create a client. $urlMapsClient = new UrlMapsClient(); + // Prepare the request message. + $request = (new DeleteUrlMapRequest()) + ->setProject($project) + ->setUrlMap($urlMap); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $urlMapsClient->delete($project, $urlMap); + $response = $urlMapsClient->delete($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/UrlMapsClient/get.php b/Compute/samples/V1/UrlMapsClient/get.php index 222f78495898..de7f34524ce1 100644 --- a/Compute/samples/V1/UrlMapsClient/get.php +++ b/Compute/samples/V1/UrlMapsClient/get.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_UrlMaps_Get_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\UrlMapsClient; +use Google\Cloud\Compute\V1\GetUrlMapRequest; use Google\Cloud\Compute\V1\UrlMap; -use Google\Cloud\Compute\V1\UrlMapsClient; /** * Returns the specified UrlMap resource. @@ -38,10 +39,15 @@ function get_sample(string $project, string $urlMap): void // Create a client. $urlMapsClient = new UrlMapsClient(); + // Prepare the request message. + $request = (new GetUrlMapRequest()) + ->setProject($project) + ->setUrlMap($urlMap); + // Call the API and handle any network failures. try { /** @var UrlMap $response */ - $response = $urlMapsClient->get($project, $urlMap); + $response = $urlMapsClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/UrlMapsClient/insert.php b/Compute/samples/V1/UrlMapsClient/insert.php index 9a069bc9b723..a149e7e7e21b 100644 --- a/Compute/samples/V1/UrlMapsClient/insert.php +++ b/Compute/samples/V1/UrlMapsClient/insert.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_UrlMaps_Insert_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\UrlMapsClient; +use Google\Cloud\Compute\V1\InsertUrlMapRequest; use Google\Cloud\Compute\V1\UrlMap; -use Google\Cloud\Compute\V1\UrlMapsClient; use Google\Rpc\Status; /** @@ -39,13 +40,16 @@ function insert_sample(string $project): void // Create a client. $urlMapsClient = new UrlMapsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $urlMapResource = new UrlMap(); + $request = (new InsertUrlMapRequest()) + ->setProject($project) + ->setUrlMapResource($urlMapResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $urlMapsClient->insert($project, $urlMapResource); + $response = $urlMapsClient->insert($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/UrlMapsClient/invalidate_cache.php b/Compute/samples/V1/UrlMapsClient/invalidate_cache.php index 2eba337b041d..229f5d427be9 100644 --- a/Compute/samples/V1/UrlMapsClient/invalidate_cache.php +++ b/Compute/samples/V1/UrlMapsClient/invalidate_cache.php @@ -26,7 +26,8 @@ use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; use Google\Cloud\Compute\V1\CacheInvalidationRule; -use Google\Cloud\Compute\V1\UrlMapsClient; +use Google\Cloud\Compute\V1\Client\UrlMapsClient; +use Google\Cloud\Compute\V1\InvalidateCacheUrlMapRequest; use Google\Rpc\Status; /** @@ -40,13 +41,17 @@ function invalidate_cache_sample(string $project, string $urlMap): void // Create a client. $urlMapsClient = new UrlMapsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $cacheInvalidationRuleResource = new CacheInvalidationRule(); + $request = (new InvalidateCacheUrlMapRequest()) + ->setCacheInvalidationRuleResource($cacheInvalidationRuleResource) + ->setProject($project) + ->setUrlMap($urlMap); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $urlMapsClient->invalidateCache($cacheInvalidationRuleResource, $project, $urlMap); + $response = $urlMapsClient->invalidateCache($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/UrlMapsClient/list.php b/Compute/samples/V1/UrlMapsClient/list.php index eeb77aaaa747..379f0e7ae929 100644 --- a/Compute/samples/V1/UrlMapsClient/list.php +++ b/Compute/samples/V1/UrlMapsClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_UrlMaps_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\UrlMapsClient; +use Google\Cloud\Compute\V1\Client\UrlMapsClient; +use Google\Cloud\Compute\V1\ListUrlMapsRequest; /** * Retrieves the list of UrlMap resources available to the specified project. @@ -37,10 +38,14 @@ function list_sample(string $project): void // Create a client. $urlMapsClient = new UrlMapsClient(); + // Prepare the request message. + $request = (new ListUrlMapsRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $urlMapsClient->list($project); + $response = $urlMapsClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/UrlMapsClient/patch.php b/Compute/samples/V1/UrlMapsClient/patch.php index c946c4e3b1b3..62260630ac16 100644 --- a/Compute/samples/V1/UrlMapsClient/patch.php +++ b/Compute/samples/V1/UrlMapsClient/patch.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_UrlMaps_Patch_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\UrlMapsClient; +use Google\Cloud\Compute\V1\PatchUrlMapRequest; use Google\Cloud\Compute\V1\UrlMap; -use Google\Cloud\Compute\V1\UrlMapsClient; use Google\Rpc\Status; /** @@ -40,13 +41,17 @@ function patch_sample(string $project, string $urlMap): void // Create a client. $urlMapsClient = new UrlMapsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $urlMapResource = new UrlMap(); + $request = (new PatchUrlMapRequest()) + ->setProject($project) + ->setUrlMap($urlMap) + ->setUrlMapResource($urlMapResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $urlMapsClient->patch($project, $urlMap, $urlMapResource); + $response = $urlMapsClient->patch($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/UrlMapsClient/update.php b/Compute/samples/V1/UrlMapsClient/update.php index 8eeed8c2e3d5..c1e36cc8e34b 100644 --- a/Compute/samples/V1/UrlMapsClient/update.php +++ b/Compute/samples/V1/UrlMapsClient/update.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_UrlMaps_Update_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\UrlMapsClient; +use Google\Cloud\Compute\V1\UpdateUrlMapRequest; use Google\Cloud\Compute\V1\UrlMap; -use Google\Cloud\Compute\V1\UrlMapsClient; use Google\Rpc\Status; /** @@ -40,13 +41,17 @@ function update_sample(string $project, string $urlMap): void // Create a client. $urlMapsClient = new UrlMapsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $urlMapResource = new UrlMap(); + $request = (new UpdateUrlMapRequest()) + ->setProject($project) + ->setUrlMap($urlMap) + ->setUrlMapResource($urlMapResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $urlMapsClient->update($project, $urlMap, $urlMapResource); + $response = $urlMapsClient->update($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/UrlMapsClient/validate.php b/Compute/samples/V1/UrlMapsClient/validate.php index b15c873a20f2..ca9bc52562bc 100644 --- a/Compute/samples/V1/UrlMapsClient/validate.php +++ b/Compute/samples/V1/UrlMapsClient/validate.php @@ -24,9 +24,10 @@ // [START compute_v1_generated_UrlMaps_Validate_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\UrlMapsClient; +use Google\Cloud\Compute\V1\Client\UrlMapsClient; use Google\Cloud\Compute\V1\UrlMapsValidateRequest; use Google\Cloud\Compute\V1\UrlMapsValidateResponse; +use Google\Cloud\Compute\V1\ValidateUrlMapRequest; /** * Runs static validation for the UrlMap. In particular, the tests of the provided UrlMap will be run. Calling this method does NOT create the UrlMap. @@ -39,13 +40,17 @@ function validate_sample(string $project, string $urlMap): void // Create a client. $urlMapsClient = new UrlMapsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $urlMapsValidateRequestResource = new UrlMapsValidateRequest(); + $request = (new ValidateUrlMapRequest()) + ->setProject($project) + ->setUrlMap($urlMap) + ->setUrlMapsValidateRequestResource($urlMapsValidateRequestResource); // Call the API and handle any network failures. try { /** @var UrlMapsValidateResponse $response */ - $response = $urlMapsClient->validate($project, $urlMap, $urlMapsValidateRequestResource); + $response = $urlMapsClient->validate($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/VpnGatewaysClient/aggregated_list.php b/Compute/samples/V1/VpnGatewaysClient/aggregated_list.php index 3f0ffa273802..2f6125fec218 100644 --- a/Compute/samples/V1/VpnGatewaysClient/aggregated_list.php +++ b/Compute/samples/V1/VpnGatewaysClient/aggregated_list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_VpnGateways_AggregatedList_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\VpnGatewaysClient; +use Google\Cloud\Compute\V1\AggregatedListVpnGatewaysRequest; +use Google\Cloud\Compute\V1\Client\VpnGatewaysClient; /** * Retrieves an aggregated list of VPN gateways. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. @@ -37,10 +38,14 @@ function aggregated_list_sample(string $project): void // Create a client. $vpnGatewaysClient = new VpnGatewaysClient(); + // Prepare the request message. + $request = (new AggregatedListVpnGatewaysRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $vpnGatewaysClient->aggregatedList($project); + $response = $vpnGatewaysClient->aggregatedList($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/VpnGatewaysClient/delete.php b/Compute/samples/V1/VpnGatewaysClient/delete.php index 6e9b9355a07e..dd2d63f7864b 100644 --- a/Compute/samples/V1/VpnGatewaysClient/delete.php +++ b/Compute/samples/V1/VpnGatewaysClient/delete.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_VpnGateways_Delete_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\VpnGatewaysClient; +use Google\Cloud\Compute\V1\Client\VpnGatewaysClient; +use Google\Cloud\Compute\V1\DeleteVpnGatewayRequest; use Google\Rpc\Status; /** @@ -40,10 +41,16 @@ function delete_sample(string $project, string $region, string $vpnGateway): voi // Create a client. $vpnGatewaysClient = new VpnGatewaysClient(); + // Prepare the request message. + $request = (new DeleteVpnGatewayRequest()) + ->setProject($project) + ->setRegion($region) + ->setVpnGateway($vpnGateway); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $vpnGatewaysClient->delete($project, $region, $vpnGateway); + $response = $vpnGatewaysClient->delete($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/VpnGatewaysClient/get.php b/Compute/samples/V1/VpnGatewaysClient/get.php index 3357c5d6de0a..07d895b3c6a5 100644 --- a/Compute/samples/V1/VpnGatewaysClient/get.php +++ b/Compute/samples/V1/VpnGatewaysClient/get.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_VpnGateways_Get_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\VpnGatewaysClient; +use Google\Cloud\Compute\V1\GetVpnGatewayRequest; use Google\Cloud\Compute\V1\VpnGateway; -use Google\Cloud\Compute\V1\VpnGatewaysClient; /** * Returns the specified VPN gateway. @@ -39,10 +40,16 @@ function get_sample(string $project, string $region, string $vpnGateway): void // Create a client. $vpnGatewaysClient = new VpnGatewaysClient(); + // Prepare the request message. + $request = (new GetVpnGatewayRequest()) + ->setProject($project) + ->setRegion($region) + ->setVpnGateway($vpnGateway); + // Call the API and handle any network failures. try { /** @var VpnGateway $response */ - $response = $vpnGatewaysClient->get($project, $region, $vpnGateway); + $response = $vpnGatewaysClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/VpnGatewaysClient/get_status.php b/Compute/samples/V1/VpnGatewaysClient/get_status.php index e5beb57ae3ca..46c9e0af9ed4 100644 --- a/Compute/samples/V1/VpnGatewaysClient/get_status.php +++ b/Compute/samples/V1/VpnGatewaysClient/get_status.php @@ -24,7 +24,8 @@ // [START compute_v1_generated_VpnGateways_GetStatus_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Compute\V1\VpnGatewaysClient; +use Google\Cloud\Compute\V1\Client\VpnGatewaysClient; +use Google\Cloud\Compute\V1\GetStatusVpnGatewayRequest; use Google\Cloud\Compute\V1\VpnGatewaysGetStatusResponse; /** @@ -39,10 +40,16 @@ function get_status_sample(string $project, string $region, string $vpnGateway): // Create a client. $vpnGatewaysClient = new VpnGatewaysClient(); + // Prepare the request message. + $request = (new GetStatusVpnGatewayRequest()) + ->setProject($project) + ->setRegion($region) + ->setVpnGateway($vpnGateway); + // Call the API and handle any network failures. try { /** @var VpnGatewaysGetStatusResponse $response */ - $response = $vpnGatewaysClient->getStatus($project, $region, $vpnGateway); + $response = $vpnGatewaysClient->getStatus($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/VpnGatewaysClient/insert.php b/Compute/samples/V1/VpnGatewaysClient/insert.php index 312544d1a1ab..c377cbfddbc3 100644 --- a/Compute/samples/V1/VpnGatewaysClient/insert.php +++ b/Compute/samples/V1/VpnGatewaysClient/insert.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_VpnGateways_Insert_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\VpnGatewaysClient; +use Google\Cloud\Compute\V1\InsertVpnGatewayRequest; use Google\Cloud\Compute\V1\VpnGateway; -use Google\Cloud\Compute\V1\VpnGatewaysClient; use Google\Rpc\Status; /** @@ -40,13 +41,17 @@ function insert_sample(string $project, string $region): void // Create a client. $vpnGatewaysClient = new VpnGatewaysClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $vpnGatewayResource = new VpnGateway(); + $request = (new InsertVpnGatewayRequest()) + ->setProject($project) + ->setRegion($region) + ->setVpnGatewayResource($vpnGatewayResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $vpnGatewaysClient->insert($project, $region, $vpnGatewayResource); + $response = $vpnGatewaysClient->insert($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/VpnGatewaysClient/list.php b/Compute/samples/V1/VpnGatewaysClient/list.php index bb8f80b52371..21e83adcb6dc 100644 --- a/Compute/samples/V1/VpnGatewaysClient/list.php +++ b/Compute/samples/V1/VpnGatewaysClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_VpnGateways_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\VpnGatewaysClient; +use Google\Cloud\Compute\V1\Client\VpnGatewaysClient; +use Google\Cloud\Compute\V1\ListVpnGatewaysRequest; /** * Retrieves a list of VPN gateways available to the specified project and region. @@ -38,10 +39,15 @@ function list_sample(string $project, string $region): void // Create a client. $vpnGatewaysClient = new VpnGatewaysClient(); + // Prepare the request message. + $request = (new ListVpnGatewaysRequest()) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $vpnGatewaysClient->list($project, $region); + $response = $vpnGatewaysClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/VpnGatewaysClient/set_labels.php b/Compute/samples/V1/VpnGatewaysClient/set_labels.php index 1cb56818af1e..28c5c30ef2b1 100644 --- a/Compute/samples/V1/VpnGatewaysClient/set_labels.php +++ b/Compute/samples/V1/VpnGatewaysClient/set_labels.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_VpnGateways_SetLabels_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\VpnGatewaysClient; use Google\Cloud\Compute\V1\RegionSetLabelsRequest; -use Google\Cloud\Compute\V1\VpnGatewaysClient; +use Google\Cloud\Compute\V1\SetLabelsVpnGatewayRequest; use Google\Rpc\Status; /** @@ -41,18 +42,18 @@ function set_labels_sample(string $project, string $region, string $resource): v // Create a client. $vpnGatewaysClient = new VpnGatewaysClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $regionSetLabelsRequestResource = new RegionSetLabelsRequest(); + $request = (new SetLabelsVpnGatewayRequest()) + ->setProject($project) + ->setRegion($region) + ->setRegionSetLabelsRequestResource($regionSetLabelsRequestResource) + ->setResource($resource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $vpnGatewaysClient->setLabels( - $project, - $region, - $regionSetLabelsRequestResource, - $resource - ); + $response = $vpnGatewaysClient->setLabels($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/VpnGatewaysClient/test_iam_permissions.php b/Compute/samples/V1/VpnGatewaysClient/test_iam_permissions.php index 49cde90cc732..0c115b11f3ff 100644 --- a/Compute/samples/V1/VpnGatewaysClient/test_iam_permissions.php +++ b/Compute/samples/V1/VpnGatewaysClient/test_iam_permissions.php @@ -24,9 +24,10 @@ // [START compute_v1_generated_VpnGateways_TestIamPermissions_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\VpnGatewaysClient; +use Google\Cloud\Compute\V1\TestIamPermissionsVpnGatewayRequest; use Google\Cloud\Compute\V1\TestPermissionsRequest; use Google\Cloud\Compute\V1\TestPermissionsResponse; -use Google\Cloud\Compute\V1\VpnGatewaysClient; /** * Returns permissions that a caller has on the specified resource. @@ -40,18 +41,18 @@ function test_iam_permissions_sample(string $project, string $region, string $re // Create a client. $vpnGatewaysClient = new VpnGatewaysClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $testPermissionsRequestResource = new TestPermissionsRequest(); + $request = (new TestIamPermissionsVpnGatewayRequest()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); // Call the API and handle any network failures. try { /** @var TestPermissionsResponse $response */ - $response = $vpnGatewaysClient->testIamPermissions( - $project, - $region, - $resource, - $testPermissionsRequestResource - ); + $response = $vpnGatewaysClient->testIamPermissions($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/VpnTunnelsClient/aggregated_list.php b/Compute/samples/V1/VpnTunnelsClient/aggregated_list.php index d6c2416f3fd4..d76b8d684e6c 100644 --- a/Compute/samples/V1/VpnTunnelsClient/aggregated_list.php +++ b/Compute/samples/V1/VpnTunnelsClient/aggregated_list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_VpnTunnels_AggregatedList_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\VpnTunnelsClient; +use Google\Cloud\Compute\V1\AggregatedListVpnTunnelsRequest; +use Google\Cloud\Compute\V1\Client\VpnTunnelsClient; /** * Retrieves an aggregated list of VPN tunnels. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. @@ -37,10 +38,14 @@ function aggregated_list_sample(string $project): void // Create a client. $vpnTunnelsClient = new VpnTunnelsClient(); + // Prepare the request message. + $request = (new AggregatedListVpnTunnelsRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $vpnTunnelsClient->aggregatedList($project); + $response = $vpnTunnelsClient->aggregatedList($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/VpnTunnelsClient/delete.php b/Compute/samples/V1/VpnTunnelsClient/delete.php index d870163d3784..de955f847be7 100644 --- a/Compute/samples/V1/VpnTunnelsClient/delete.php +++ b/Compute/samples/V1/VpnTunnelsClient/delete.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_VpnTunnels_Delete_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Compute\V1\VpnTunnelsClient; +use Google\Cloud\Compute\V1\Client\VpnTunnelsClient; +use Google\Cloud\Compute\V1\DeleteVpnTunnelRequest; use Google\Rpc\Status; /** @@ -40,10 +41,16 @@ function delete_sample(string $project, string $region, string $vpnTunnel): void // Create a client. $vpnTunnelsClient = new VpnTunnelsClient(); + // Prepare the request message. + $request = (new DeleteVpnTunnelRequest()) + ->setProject($project) + ->setRegion($region) + ->setVpnTunnel($vpnTunnel); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $vpnTunnelsClient->delete($project, $region, $vpnTunnel); + $response = $vpnTunnelsClient->delete($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/VpnTunnelsClient/get.php b/Compute/samples/V1/VpnTunnelsClient/get.php index 9db29409fa4a..5686659662b1 100644 --- a/Compute/samples/V1/VpnTunnelsClient/get.php +++ b/Compute/samples/V1/VpnTunnelsClient/get.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_VpnTunnels_Get_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\VpnTunnelsClient; +use Google\Cloud\Compute\V1\GetVpnTunnelRequest; use Google\Cloud\Compute\V1\VpnTunnel; -use Google\Cloud\Compute\V1\VpnTunnelsClient; /** * Returns the specified VpnTunnel resource. @@ -39,10 +40,16 @@ function get_sample(string $project, string $region, string $vpnTunnel): void // Create a client. $vpnTunnelsClient = new VpnTunnelsClient(); + // Prepare the request message. + $request = (new GetVpnTunnelRequest()) + ->setProject($project) + ->setRegion($region) + ->setVpnTunnel($vpnTunnel); + // Call the API and handle any network failures. try { /** @var VpnTunnel $response */ - $response = $vpnTunnelsClient->get($project, $region, $vpnTunnel); + $response = $vpnTunnelsClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/VpnTunnelsClient/insert.php b/Compute/samples/V1/VpnTunnelsClient/insert.php index b942e802a345..297c8bb7378b 100644 --- a/Compute/samples/V1/VpnTunnelsClient/insert.php +++ b/Compute/samples/V1/VpnTunnelsClient/insert.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_VpnTunnels_Insert_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\VpnTunnelsClient; +use Google\Cloud\Compute\V1\InsertVpnTunnelRequest; use Google\Cloud\Compute\V1\VpnTunnel; -use Google\Cloud\Compute\V1\VpnTunnelsClient; use Google\Rpc\Status; /** @@ -40,13 +41,17 @@ function insert_sample(string $project, string $region): void // Create a client. $vpnTunnelsClient = new VpnTunnelsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $vpnTunnelResource = new VpnTunnel(); + $request = (new InsertVpnTunnelRequest()) + ->setProject($project) + ->setRegion($region) + ->setVpnTunnelResource($vpnTunnelResource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $vpnTunnelsClient->insert($project, $region, $vpnTunnelResource); + $response = $vpnTunnelsClient->insert($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/VpnTunnelsClient/list.php b/Compute/samples/V1/VpnTunnelsClient/list.php index f5e5ed9ce3e9..f64aa97fde62 100644 --- a/Compute/samples/V1/VpnTunnelsClient/list.php +++ b/Compute/samples/V1/VpnTunnelsClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_VpnTunnels_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\VpnTunnelsClient; +use Google\Cloud\Compute\V1\Client\VpnTunnelsClient; +use Google\Cloud\Compute\V1\ListVpnTunnelsRequest; /** * Retrieves a list of VpnTunnel resources contained in the specified project and region. @@ -38,10 +39,15 @@ function list_sample(string $project, string $region): void // Create a client. $vpnTunnelsClient = new VpnTunnelsClient(); + // Prepare the request message. + $request = (new ListVpnTunnelsRequest()) + ->setProject($project) + ->setRegion($region); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $vpnTunnelsClient->list($project, $region); + $response = $vpnTunnelsClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/VpnTunnelsClient/set_labels.php b/Compute/samples/V1/VpnTunnelsClient/set_labels.php index 33ed873225eb..c44873aaa046 100644 --- a/Compute/samples/V1/VpnTunnelsClient/set_labels.php +++ b/Compute/samples/V1/VpnTunnelsClient/set_labels.php @@ -25,8 +25,9 @@ // [START compute_v1_generated_VpnTunnels_SetLabels_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; +use Google\Cloud\Compute\V1\Client\VpnTunnelsClient; use Google\Cloud\Compute\V1\RegionSetLabelsRequest; -use Google\Cloud\Compute\V1\VpnTunnelsClient; +use Google\Cloud\Compute\V1\SetLabelsVpnTunnelRequest; use Google\Rpc\Status; /** @@ -41,18 +42,18 @@ function set_labels_sample(string $project, string $region, string $resource): v // Create a client. $vpnTunnelsClient = new VpnTunnelsClient(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $regionSetLabelsRequestResource = new RegionSetLabelsRequest(); + $request = (new SetLabelsVpnTunnelRequest()) + ->setProject($project) + ->setRegion($region) + ->setRegionSetLabelsRequestResource($regionSetLabelsRequestResource) + ->setResource($resource); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $vpnTunnelsClient->setLabels( - $project, - $region, - $regionSetLabelsRequestResource, - $resource - ); + $response = $vpnTunnelsClient->setLabels($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/Compute/samples/V1/ZoneOperationsClient/delete.php b/Compute/samples/V1/ZoneOperationsClient/delete.php index 9073a802d33e..19c460904c55 100644 --- a/Compute/samples/V1/ZoneOperationsClient/delete.php +++ b/Compute/samples/V1/ZoneOperationsClient/delete.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_ZoneOperations_Delete_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\ZoneOperationsClient; +use Google\Cloud\Compute\V1\DeleteZoneOperationRequest; use Google\Cloud\Compute\V1\DeleteZoneOperationResponse; -use Google\Cloud\Compute\V1\ZoneOperationsClient; /** * Deletes the specified zone-specific Operations resource. @@ -39,10 +40,16 @@ function delete_sample(string $operation, string $project, string $zone): void // Create a client. $zoneOperationsClient = new ZoneOperationsClient(); + // Prepare the request message. + $request = (new DeleteZoneOperationRequest()) + ->setOperation($operation) + ->setProject($project) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var DeleteZoneOperationResponse $response */ - $response = $zoneOperationsClient->delete($operation, $project, $zone); + $response = $zoneOperationsClient->delete($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/ZoneOperationsClient/get.php b/Compute/samples/V1/ZoneOperationsClient/get.php index dba46936b3c1..19a1edcf7c02 100644 --- a/Compute/samples/V1/ZoneOperationsClient/get.php +++ b/Compute/samples/V1/ZoneOperationsClient/get.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_ZoneOperations_Get_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\ZoneOperationsClient; +use Google\Cloud\Compute\V1\GetZoneOperationRequest; use Google\Cloud\Compute\V1\Operation; -use Google\Cloud\Compute\V1\ZoneOperationsClient; /** * Retrieves the specified zone-specific Operations resource. @@ -39,10 +40,16 @@ function get_sample(string $operation, string $project, string $zone): void // Create a client. $zoneOperationsClient = new ZoneOperationsClient(); + // Prepare the request message. + $request = (new GetZoneOperationRequest()) + ->setOperation($operation) + ->setProject($project) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var Operation $response */ - $response = $zoneOperationsClient->get($operation, $project, $zone); + $response = $zoneOperationsClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/ZoneOperationsClient/list.php b/Compute/samples/V1/ZoneOperationsClient/list.php index c358790ae2d0..8a84b18e870b 100644 --- a/Compute/samples/V1/ZoneOperationsClient/list.php +++ b/Compute/samples/V1/ZoneOperationsClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_ZoneOperations_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\ZoneOperationsClient; +use Google\Cloud\Compute\V1\Client\ZoneOperationsClient; +use Google\Cloud\Compute\V1\ListZoneOperationsRequest; /** * Retrieves a list of Operation resources contained within the specified zone. @@ -38,10 +39,15 @@ function list_sample(string $project, string $zone): void // Create a client. $zoneOperationsClient = new ZoneOperationsClient(); + // Prepare the request message. + $request = (new ListZoneOperationsRequest()) + ->setProject($project) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $zoneOperationsClient->list($project, $zone); + $response = $zoneOperationsClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/samples/V1/ZoneOperationsClient/wait.php b/Compute/samples/V1/ZoneOperationsClient/wait.php index e9194cd815ef..2d1c6feddb79 100644 --- a/Compute/samples/V1/ZoneOperationsClient/wait.php +++ b/Compute/samples/V1/ZoneOperationsClient/wait.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_ZoneOperations_Wait_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\ZoneOperationsClient; use Google\Cloud\Compute\V1\Operation; -use Google\Cloud\Compute\V1\ZoneOperationsClient; +use Google\Cloud\Compute\V1\WaitZoneOperationRequest; /** * Waits for the specified Operation resource to return as `DONE` or for the request to approach the 2 minute deadline, and retrieves the specified Operation resource. This method waits for no more than the 2 minutes and then returns the current state of the operation, which might be `DONE` or still in progress. This method is called on a best-effort basis. Specifically: - In uncommon cases, when the server is overloaded, the request might return before the default deadline is reached, or might return after zero seconds. - If the default deadline is reached, there is no guarantee that the operation is actually done when the method returns. Be prepared to retry if the operation is not `DONE`. @@ -39,10 +40,16 @@ function wait_sample(string $operation, string $project, string $zone): void // Create a client. $zoneOperationsClient = new ZoneOperationsClient(); + // Prepare the request message. + $request = (new WaitZoneOperationRequest()) + ->setOperation($operation) + ->setProject($project) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var Operation $response */ - $response = $zoneOperationsClient->wait($operation, $project, $zone); + $response = $zoneOperationsClient->wait($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/ZonesClient/get.php b/Compute/samples/V1/ZonesClient/get.php index bab2354b7704..e70ccfa18a31 100644 --- a/Compute/samples/V1/ZonesClient/get.php +++ b/Compute/samples/V1/ZonesClient/get.php @@ -24,8 +24,9 @@ // [START compute_v1_generated_Zones_Get_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Compute\V1\Client\ZonesClient; +use Google\Cloud\Compute\V1\GetZoneRequest; use Google\Cloud\Compute\V1\Zone; -use Google\Cloud\Compute\V1\ZonesClient; /** * Returns the specified Zone resource. @@ -38,10 +39,15 @@ function get_sample(string $project, string $zone): void // Create a client. $zonesClient = new ZonesClient(); + // Prepare the request message. + $request = (new GetZoneRequest()) + ->setProject($project) + ->setZone($zone); + // Call the API and handle any network failures. try { /** @var Zone $response */ - $response = $zonesClient->get($project, $zone); + $response = $zonesClient->get($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/Compute/samples/V1/ZonesClient/list.php b/Compute/samples/V1/ZonesClient/list.php index f20b01385613..7c32ba173910 100644 --- a/Compute/samples/V1/ZonesClient/list.php +++ b/Compute/samples/V1/ZonesClient/list.php @@ -25,7 +25,8 @@ // [START compute_v1_generated_Zones_List_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Compute\V1\ZonesClient; +use Google\Cloud\Compute\V1\Client\ZonesClient; +use Google\Cloud\Compute\V1\ListZonesRequest; /** * Retrieves the list of Zone resources available to the specified project. @@ -37,10 +38,14 @@ function list_sample(string $project): void // Create a client. $zonesClient = new ZonesClient(); + // Prepare the request message. + $request = (new ListZonesRequest()) + ->setProject($project); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $zonesClient->list($project); + $response = $zonesClient->list($request); foreach ($response as $element) { printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); diff --git a/Compute/src/V1/Client/AcceleratorTypesClient.php b/Compute/src/V1/Client/AcceleratorTypesClient.php index 3c3f15a48e07..25c673cb7d59 100644 --- a/Compute/src/V1/Client/AcceleratorTypesClient.php +++ b/Compute/src/V1/Client/AcceleratorTypesClient.php @@ -191,6 +191,8 @@ public function __call($method, $args) * * The async variant is {@see AcceleratorTypesClient::aggregatedListAsync()} . * + * @example samples/V1/AcceleratorTypesClient/aggregated_list.php + * * @param AggregatedListAcceleratorTypesRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -215,6 +217,8 @@ public function aggregatedList(AggregatedListAcceleratorTypesRequest $request, a * * The async variant is {@see AcceleratorTypesClient::getAsync()} . * + * @example samples/V1/AcceleratorTypesClient/get.php + * * @param GetAcceleratorTypeRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -239,6 +243,8 @@ public function get(GetAcceleratorTypeRequest $request, array $callOptions = []) * * The async variant is {@see AcceleratorTypesClient::listAsync()} . * + * @example samples/V1/AcceleratorTypesClient/list.php + * * @param ListAcceleratorTypesRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/AddressesClient.php b/Compute/src/V1/Client/AddressesClient.php index f798b4c3a0a5..32b7979415bf 100644 --- a/Compute/src/V1/Client/AddressesClient.php +++ b/Compute/src/V1/Client/AddressesClient.php @@ -252,6 +252,8 @@ public function __call($method, $args) * * The async variant is {@see AddressesClient::aggregatedListAsync()} . * + * @example samples/V1/AddressesClient/aggregated_list.php + * * @param AggregatedListAddressesRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -276,6 +278,8 @@ public function aggregatedList(AggregatedListAddressesRequest $request, array $c * * The async variant is {@see AddressesClient::deleteAsync()} . * + * @example samples/V1/AddressesClient/delete.php + * * @param DeleteAddressRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -300,6 +304,8 @@ public function delete(DeleteAddressRequest $request, array $callOptions = []): * * The async variant is {@see AddressesClient::getAsync()} . * + * @example samples/V1/AddressesClient/get.php + * * @param GetAddressRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -324,6 +330,8 @@ public function get(GetAddressRequest $request, array $callOptions = []): Addres * * The async variant is {@see AddressesClient::insertAsync()} . * + * @example samples/V1/AddressesClient/insert.php + * * @param InsertAddressRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -348,6 +356,8 @@ public function insert(InsertAddressRequest $request, array $callOptions = []): * * The async variant is {@see AddressesClient::listAsync()} . * + * @example samples/V1/AddressesClient/list.php + * * @param ListAddressesRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -372,6 +382,8 @@ public function list(ListAddressesRequest $request, array $callOptions = []): Pa * * The async variant is {@see AddressesClient::moveAsync()} . * + * @example samples/V1/AddressesClient/move.php + * * @param MoveAddressRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -396,6 +408,8 @@ public function move(MoveAddressRequest $request, array $callOptions = []): Oper * * The async variant is {@see AddressesClient::setLabelsAsync()} . * + * @example samples/V1/AddressesClient/set_labels.php + * * @param SetLabelsAddressRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/AutoscalersClient.php b/Compute/src/V1/Client/AutoscalersClient.php index aea2fb089290..07a2528a07ae 100644 --- a/Compute/src/V1/Client/AutoscalersClient.php +++ b/Compute/src/V1/Client/AutoscalersClient.php @@ -252,6 +252,8 @@ public function __call($method, $args) * * The async variant is {@see AutoscalersClient::aggregatedListAsync()} . * + * @example samples/V1/AutoscalersClient/aggregated_list.php + * * @param AggregatedListAutoscalersRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -276,6 +278,8 @@ public function aggregatedList(AggregatedListAutoscalersRequest $request, array * * The async variant is {@see AutoscalersClient::deleteAsync()} . * + * @example samples/V1/AutoscalersClient/delete.php + * * @param DeleteAutoscalerRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -300,6 +304,8 @@ public function delete(DeleteAutoscalerRequest $request, array $callOptions = [] * * The async variant is {@see AutoscalersClient::getAsync()} . * + * @example samples/V1/AutoscalersClient/get.php + * * @param GetAutoscalerRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -324,6 +330,8 @@ public function get(GetAutoscalerRequest $request, array $callOptions = []): Aut * * The async variant is {@see AutoscalersClient::insertAsync()} . * + * @example samples/V1/AutoscalersClient/insert.php + * * @param InsertAutoscalerRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -348,6 +356,8 @@ public function insert(InsertAutoscalerRequest $request, array $callOptions = [] * * The async variant is {@see AutoscalersClient::listAsync()} . * + * @example samples/V1/AutoscalersClient/list.php + * * @param ListAutoscalersRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -372,6 +382,8 @@ public function list(ListAutoscalersRequest $request, array $callOptions = []): * * The async variant is {@see AutoscalersClient::patchAsync()} . * + * @example samples/V1/AutoscalersClient/patch.php + * * @param PatchAutoscalerRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -396,6 +408,8 @@ public function patch(PatchAutoscalerRequest $request, array $callOptions = []): * * The async variant is {@see AutoscalersClient::updateAsync()} . * + * @example samples/V1/AutoscalersClient/update.php + * * @param UpdateAutoscalerRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/BackendBucketsClient.php b/Compute/src/V1/Client/BackendBucketsClient.php index d6d8dda1ab0b..aa814e356a30 100644 --- a/Compute/src/V1/Client/BackendBucketsClient.php +++ b/Compute/src/V1/Client/BackendBucketsClient.php @@ -263,6 +263,8 @@ public function __call($method, $args) * * The async variant is {@see BackendBucketsClient::addSignedUrlKeyAsync()} . * + * @example samples/V1/BackendBucketsClient/add_signed_url_key.php + * * @param AddSignedUrlKeyBackendBucketRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -287,6 +289,8 @@ public function addSignedUrlKey(AddSignedUrlKeyBackendBucketRequest $request, ar * * The async variant is {@see BackendBucketsClient::deleteAsync()} . * + * @example samples/V1/BackendBucketsClient/delete.php + * * @param DeleteBackendBucketRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -311,6 +315,8 @@ public function delete(DeleteBackendBucketRequest $request, array $callOptions = * * The async variant is {@see BackendBucketsClient::deleteSignedUrlKeyAsync()} . * + * @example samples/V1/BackendBucketsClient/delete_signed_url_key.php + * * @param DeleteSignedUrlKeyBackendBucketRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -335,6 +341,8 @@ public function deleteSignedUrlKey(DeleteSignedUrlKeyBackendBucketRequest $reque * * The async variant is {@see BackendBucketsClient::getAsync()} . * + * @example samples/V1/BackendBucketsClient/get.php + * * @param GetBackendBucketRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -359,6 +367,8 @@ public function get(GetBackendBucketRequest $request, array $callOptions = []): * * The async variant is {@see BackendBucketsClient::getIamPolicyAsync()} . * + * @example samples/V1/BackendBucketsClient/get_iam_policy.php + * * @param GetIamPolicyBackendBucketRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -383,6 +393,8 @@ public function getIamPolicy(GetIamPolicyBackendBucketRequest $request, array $c * * The async variant is {@see BackendBucketsClient::insertAsync()} . * + * @example samples/V1/BackendBucketsClient/insert.php + * * @param InsertBackendBucketRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -407,6 +419,8 @@ public function insert(InsertBackendBucketRequest $request, array $callOptions = * * The async variant is {@see BackendBucketsClient::listAsync()} . * + * @example samples/V1/BackendBucketsClient/list.php + * * @param ListBackendBucketsRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -431,6 +445,8 @@ public function list(ListBackendBucketsRequest $request, array $callOptions = [] * * The async variant is {@see BackendBucketsClient::patchAsync()} . * + * @example samples/V1/BackendBucketsClient/patch.php + * * @param PatchBackendBucketRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -455,6 +471,8 @@ public function patch(PatchBackendBucketRequest $request, array $callOptions = [ * * The async variant is {@see BackendBucketsClient::setEdgeSecurityPolicyAsync()} . * + * @example samples/V1/BackendBucketsClient/set_edge_security_policy.php + * * @param SetEdgeSecurityPolicyBackendBucketRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -479,6 +497,8 @@ public function setEdgeSecurityPolicy(SetEdgeSecurityPolicyBackendBucketRequest * * The async variant is {@see BackendBucketsClient::setIamPolicyAsync()} . * + * @example samples/V1/BackendBucketsClient/set_iam_policy.php + * * @param SetIamPolicyBackendBucketRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -503,6 +523,8 @@ public function setIamPolicy(SetIamPolicyBackendBucketRequest $request, array $c * * The async variant is {@see BackendBucketsClient::testIamPermissionsAsync()} . * + * @example samples/V1/BackendBucketsClient/test_iam_permissions.php + * * @param TestIamPermissionsBackendBucketRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -527,6 +549,8 @@ public function testIamPermissions(TestIamPermissionsBackendBucketRequest $reque * * The async variant is {@see BackendBucketsClient::updateAsync()} . * + * @example samples/V1/BackendBucketsClient/update.php + * * @param UpdateBackendBucketRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/BackendServicesClient.php b/Compute/src/V1/Client/BackendServicesClient.php index f7ccad9066f9..4d8400c9d66b 100644 --- a/Compute/src/V1/Client/BackendServicesClient.php +++ b/Compute/src/V1/Client/BackendServicesClient.php @@ -272,6 +272,8 @@ public function __call($method, $args) * * The async variant is {@see BackendServicesClient::addSignedUrlKeyAsync()} . * + * @example samples/V1/BackendServicesClient/add_signed_url_key.php + * * @param AddSignedUrlKeyBackendServiceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -296,6 +298,8 @@ public function addSignedUrlKey(AddSignedUrlKeyBackendServiceRequest $request, a * * The async variant is {@see BackendServicesClient::aggregatedListAsync()} . * + * @example samples/V1/BackendServicesClient/aggregated_list.php + * * @param AggregatedListBackendServicesRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -320,6 +324,8 @@ public function aggregatedList(AggregatedListBackendServicesRequest $request, ar * * The async variant is {@see BackendServicesClient::deleteAsync()} . * + * @example samples/V1/BackendServicesClient/delete.php + * * @param DeleteBackendServiceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -344,6 +350,8 @@ public function delete(DeleteBackendServiceRequest $request, array $callOptions * * The async variant is {@see BackendServicesClient::deleteSignedUrlKeyAsync()} . * + * @example samples/V1/BackendServicesClient/delete_signed_url_key.php + * * @param DeleteSignedUrlKeyBackendServiceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -368,6 +376,8 @@ public function deleteSignedUrlKey(DeleteSignedUrlKeyBackendServiceRequest $requ * * The async variant is {@see BackendServicesClient::getAsync()} . * + * @example samples/V1/BackendServicesClient/get.php + * * @param GetBackendServiceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -392,6 +402,8 @@ public function get(GetBackendServiceRequest $request, array $callOptions = []): * * The async variant is {@see BackendServicesClient::getHealthAsync()} . * + * @example samples/V1/BackendServicesClient/get_health.php + * * @param GetHealthBackendServiceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -416,6 +428,8 @@ public function getHealth(GetHealthBackendServiceRequest $request, array $callOp * * The async variant is {@see BackendServicesClient::getIamPolicyAsync()} . * + * @example samples/V1/BackendServicesClient/get_iam_policy.php + * * @param GetIamPolicyBackendServiceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -440,6 +454,8 @@ public function getIamPolicy(GetIamPolicyBackendServiceRequest $request, array $ * * The async variant is {@see BackendServicesClient::insertAsync()} . * + * @example samples/V1/BackendServicesClient/insert.php + * * @param InsertBackendServiceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -464,6 +480,8 @@ public function insert(InsertBackendServiceRequest $request, array $callOptions * * The async variant is {@see BackendServicesClient::listAsync()} . * + * @example samples/V1/BackendServicesClient/list.php + * * @param ListBackendServicesRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -488,6 +506,8 @@ public function list(ListBackendServicesRequest $request, array $callOptions = [ * * The async variant is {@see BackendServicesClient::listUsableAsync()} . * + * @example samples/V1/BackendServicesClient/list_usable.php + * * @param ListUsableBackendServicesRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -512,6 +532,8 @@ public function listUsable(ListUsableBackendServicesRequest $request, array $cal * * The async variant is {@see BackendServicesClient::patchAsync()} . * + * @example samples/V1/BackendServicesClient/patch.php + * * @param PatchBackendServiceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -537,6 +559,8 @@ public function patch(PatchBackendServiceRequest $request, array $callOptions = * The async variant is {@see BackendServicesClient::setEdgeSecurityPolicyAsync()} * . * + * @example samples/V1/BackendServicesClient/set_edge_security_policy.php + * * @param SetEdgeSecurityPolicyBackendServiceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -561,6 +585,8 @@ public function setEdgeSecurityPolicy(SetEdgeSecurityPolicyBackendServiceRequest * * The async variant is {@see BackendServicesClient::setIamPolicyAsync()} . * + * @example samples/V1/BackendServicesClient/set_iam_policy.php + * * @param SetIamPolicyBackendServiceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -585,6 +611,8 @@ public function setIamPolicy(SetIamPolicyBackendServiceRequest $request, array $ * * The async variant is {@see BackendServicesClient::setSecurityPolicyAsync()} . * + * @example samples/V1/BackendServicesClient/set_security_policy.php + * * @param SetSecurityPolicyBackendServiceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -609,6 +637,8 @@ public function setSecurityPolicy(SetSecurityPolicyBackendServiceRequest $reques * * The async variant is {@see BackendServicesClient::testIamPermissionsAsync()} . * + * @example samples/V1/BackendServicesClient/test_iam_permissions.php + * * @param TestIamPermissionsBackendServiceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -633,6 +663,8 @@ public function testIamPermissions(TestIamPermissionsBackendServiceRequest $requ * * The async variant is {@see BackendServicesClient::updateAsync()} . * + * @example samples/V1/BackendServicesClient/update.php + * * @param UpdateBackendServiceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/DiskTypesClient.php b/Compute/src/V1/Client/DiskTypesClient.php index 1c2f7091eb05..ed2ef8b43848 100644 --- a/Compute/src/V1/Client/DiskTypesClient.php +++ b/Compute/src/V1/Client/DiskTypesClient.php @@ -188,6 +188,8 @@ public function __call($method, $args) * * The async variant is {@see DiskTypesClient::aggregatedListAsync()} . * + * @example samples/V1/DiskTypesClient/aggregated_list.php + * * @param AggregatedListDiskTypesRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -212,6 +214,8 @@ public function aggregatedList(AggregatedListDiskTypesRequest $request, array $c * * The async variant is {@see DiskTypesClient::getAsync()} . * + * @example samples/V1/DiskTypesClient/get.php + * * @param GetDiskTypeRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -236,6 +240,8 @@ public function get(GetDiskTypeRequest $request, array $callOptions = []): DiskT * * The async variant is {@see DiskTypesClient::listAsync()} . * + * @example samples/V1/DiskTypesClient/list.php + * * @param ListDiskTypesRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/DisksClient.php b/Compute/src/V1/Client/DisksClient.php index 67ebe8ee1a11..8af41a97185a 100644 --- a/Compute/src/V1/Client/DisksClient.php +++ b/Compute/src/V1/Client/DisksClient.php @@ -276,6 +276,8 @@ public function __call($method, $args) * * The async variant is {@see DisksClient::addResourcePoliciesAsync()} . * + * @example samples/V1/DisksClient/add_resource_policies.php + * * @param AddResourcePoliciesDiskRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -300,6 +302,8 @@ public function addResourcePolicies(AddResourcePoliciesDiskRequest $request, arr * * The async variant is {@see DisksClient::aggregatedListAsync()} . * + * @example samples/V1/DisksClient/aggregated_list.php + * * @param AggregatedListDisksRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -324,6 +328,8 @@ public function aggregatedList(AggregatedListDisksRequest $request, array $callO * * The async variant is {@see DisksClient::bulkInsertAsync()} . * + * @example samples/V1/DisksClient/bulk_insert.php + * * @param BulkInsertDiskRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -348,6 +354,8 @@ public function bulkInsert(BulkInsertDiskRequest $request, array $callOptions = * * The async variant is {@see DisksClient::createSnapshotAsync()} . * + * @example samples/V1/DisksClient/create_snapshot.php + * * @param CreateSnapshotDiskRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -372,6 +380,8 @@ public function createSnapshot(CreateSnapshotDiskRequest $request, array $callOp * * The async variant is {@see DisksClient::deleteAsync()} . * + * @example samples/V1/DisksClient/delete.php + * * @param DeleteDiskRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -396,6 +406,8 @@ public function delete(DeleteDiskRequest $request, array $callOptions = []): Ope * * The async variant is {@see DisksClient::getAsync()} . * + * @example samples/V1/DisksClient/get.php + * * @param GetDiskRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -420,6 +432,8 @@ public function get(GetDiskRequest $request, array $callOptions = []): Disk * * The async variant is {@see DisksClient::getIamPolicyAsync()} . * + * @example samples/V1/DisksClient/get_iam_policy.php + * * @param GetIamPolicyDiskRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -444,6 +458,8 @@ public function getIamPolicy(GetIamPolicyDiskRequest $request, array $callOption * * The async variant is {@see DisksClient::insertAsync()} . * + * @example samples/V1/DisksClient/insert.php + * * @param InsertDiskRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -468,6 +484,8 @@ public function insert(InsertDiskRequest $request, array $callOptions = []): Ope * * The async variant is {@see DisksClient::listAsync()} . * + * @example samples/V1/DisksClient/list.php + * * @param ListDisksRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -492,6 +510,8 @@ public function list(ListDisksRequest $request, array $callOptions = []): PagedL * * The async variant is {@see DisksClient::removeResourcePoliciesAsync()} . * + * @example samples/V1/DisksClient/remove_resource_policies.php + * * @param RemoveResourcePoliciesDiskRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -516,6 +536,8 @@ public function removeResourcePolicies(RemoveResourcePoliciesDiskRequest $reques * * The async variant is {@see DisksClient::resizeAsync()} . * + * @example samples/V1/DisksClient/resize.php + * * @param ResizeDiskRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -540,6 +562,8 @@ public function resize(ResizeDiskRequest $request, array $callOptions = []): Ope * * The async variant is {@see DisksClient::setIamPolicyAsync()} . * + * @example samples/V1/DisksClient/set_iam_policy.php + * * @param SetIamPolicyDiskRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -564,6 +588,8 @@ public function setIamPolicy(SetIamPolicyDiskRequest $request, array $callOption * * The async variant is {@see DisksClient::setLabelsAsync()} . * + * @example samples/V1/DisksClient/set_labels.php + * * @param SetLabelsDiskRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -588,6 +614,8 @@ public function setLabels(SetLabelsDiskRequest $request, array $callOptions = [] * * The async variant is {@see DisksClient::startAsyncReplicationAsync()} . * + * @example samples/V1/DisksClient/start_async_replication.php + * * @param StartAsyncReplicationDiskRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -612,6 +640,8 @@ public function startAsyncReplication(StartAsyncReplicationDiskRequest $request, * * The async variant is {@see DisksClient::stopAsyncReplicationAsync()} . * + * @example samples/V1/DisksClient/stop_async_replication.php + * * @param StopAsyncReplicationDiskRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -636,6 +666,8 @@ public function stopAsyncReplication(StopAsyncReplicationDiskRequest $request, a * * The async variant is {@see DisksClient::stopGroupAsyncReplicationAsync()} . * + * @example samples/V1/DisksClient/stop_group_async_replication.php + * * @param StopGroupAsyncReplicationDiskRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -660,6 +692,8 @@ public function stopGroupAsyncReplication(StopGroupAsyncReplicationDiskRequest $ * * The async variant is {@see DisksClient::testIamPermissionsAsync()} . * + * @example samples/V1/DisksClient/test_iam_permissions.php + * * @param TestIamPermissionsDiskRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -684,6 +718,8 @@ public function testIamPermissions(TestIamPermissionsDiskRequest $request, array * * The async variant is {@see DisksClient::updateAsync()} . * + * @example samples/V1/DisksClient/update.php + * * @param UpdateDiskRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/ExternalVpnGatewaysClient.php b/Compute/src/V1/Client/ExternalVpnGatewaysClient.php index 9f12a58a7996..44045d0d6cb0 100644 --- a/Compute/src/V1/Client/ExternalVpnGatewaysClient.php +++ b/Compute/src/V1/Client/ExternalVpnGatewaysClient.php @@ -250,6 +250,8 @@ public function __call($method, $args) * * The async variant is {@see ExternalVpnGatewaysClient::deleteAsync()} . * + * @example samples/V1/ExternalVpnGatewaysClient/delete.php + * * @param DeleteExternalVpnGatewayRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -274,6 +276,8 @@ public function delete(DeleteExternalVpnGatewayRequest $request, array $callOpti * * The async variant is {@see ExternalVpnGatewaysClient::getAsync()} . * + * @example samples/V1/ExternalVpnGatewaysClient/get.php + * * @param GetExternalVpnGatewayRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -298,6 +302,8 @@ public function get(GetExternalVpnGatewayRequest $request, array $callOptions = * * The async variant is {@see ExternalVpnGatewaysClient::insertAsync()} . * + * @example samples/V1/ExternalVpnGatewaysClient/insert.php + * * @param InsertExternalVpnGatewayRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -322,6 +328,8 @@ public function insert(InsertExternalVpnGatewayRequest $request, array $callOpti * * The async variant is {@see ExternalVpnGatewaysClient::listAsync()} . * + * @example samples/V1/ExternalVpnGatewaysClient/list.php + * * @param ListExternalVpnGatewaysRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -346,6 +354,8 @@ public function list(ListExternalVpnGatewaysRequest $request, array $callOptions * * The async variant is {@see ExternalVpnGatewaysClient::setLabelsAsync()} . * + * @example samples/V1/ExternalVpnGatewaysClient/set_labels.php + * * @param SetLabelsExternalVpnGatewayRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -371,6 +381,8 @@ public function setLabels(SetLabelsExternalVpnGatewayRequest $request, array $ca * The async variant is {@see ExternalVpnGatewaysClient::testIamPermissionsAsync()} * . * + * @example samples/V1/ExternalVpnGatewaysClient/test_iam_permissions.php + * * @param TestIamPermissionsExternalVpnGatewayRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/FirewallPoliciesClient.php b/Compute/src/V1/Client/FirewallPoliciesClient.php index 6a140bd887e4..aa63b5ecc729 100644 --- a/Compute/src/V1/Client/FirewallPoliciesClient.php +++ b/Compute/src/V1/Client/FirewallPoliciesClient.php @@ -277,6 +277,8 @@ public function __call($method, $args) * * The async variant is {@see FirewallPoliciesClient::addAssociationAsync()} . * + * @example samples/V1/FirewallPoliciesClient/add_association.php + * * @param AddAssociationFirewallPolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -301,6 +303,8 @@ public function addAssociation(AddAssociationFirewallPolicyRequest $request, arr * * The async variant is {@see FirewallPoliciesClient::addRuleAsync()} . * + * @example samples/V1/FirewallPoliciesClient/add_rule.php + * * @param AddRuleFirewallPolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -325,6 +329,8 @@ public function addRule(AddRuleFirewallPolicyRequest $request, array $callOption * * The async variant is {@see FirewallPoliciesClient::cloneRulesAsync()} . * + * @example samples/V1/FirewallPoliciesClient/clone_rules.php + * * @param CloneRulesFirewallPolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -349,6 +355,8 @@ public function cloneRules(CloneRulesFirewallPolicyRequest $request, array $call * * The async variant is {@see FirewallPoliciesClient::deleteAsync()} . * + * @example samples/V1/FirewallPoliciesClient/delete.php + * * @param DeleteFirewallPolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -373,6 +381,8 @@ public function delete(DeleteFirewallPolicyRequest $request, array $callOptions * * The async variant is {@see FirewallPoliciesClient::getAsync()} . * + * @example samples/V1/FirewallPoliciesClient/get.php + * * @param GetFirewallPolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -397,6 +407,8 @@ public function get(GetFirewallPolicyRequest $request, array $callOptions = []): * * The async variant is {@see FirewallPoliciesClient::getAssociationAsync()} . * + * @example samples/V1/FirewallPoliciesClient/get_association.php + * * @param GetAssociationFirewallPolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -421,6 +433,8 @@ public function getAssociation(GetAssociationFirewallPolicyRequest $request, arr * * The async variant is {@see FirewallPoliciesClient::getIamPolicyAsync()} . * + * @example samples/V1/FirewallPoliciesClient/get_iam_policy.php + * * @param GetIamPolicyFirewallPolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -445,6 +459,8 @@ public function getIamPolicy(GetIamPolicyFirewallPolicyRequest $request, array $ * * The async variant is {@see FirewallPoliciesClient::getRuleAsync()} . * + * @example samples/V1/FirewallPoliciesClient/get_rule.php + * * @param GetRuleFirewallPolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -469,6 +485,8 @@ public function getRule(GetRuleFirewallPolicyRequest $request, array $callOption * * The async variant is {@see FirewallPoliciesClient::insertAsync()} . * + * @example samples/V1/FirewallPoliciesClient/insert.php + * * @param InsertFirewallPolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -493,6 +511,8 @@ public function insert(InsertFirewallPolicyRequest $request, array $callOptions * * The async variant is {@see FirewallPoliciesClient::listAsync()} . * + * @example samples/V1/FirewallPoliciesClient/list.php + * * @param ListFirewallPoliciesRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -517,6 +537,8 @@ public function list(ListFirewallPoliciesRequest $request, array $callOptions = * * The async variant is {@see FirewallPoliciesClient::listAssociationsAsync()} . * + * @example samples/V1/FirewallPoliciesClient/list_associations.php + * * @param ListAssociationsFirewallPolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -541,6 +563,8 @@ public function listAssociations(ListAssociationsFirewallPolicyRequest $request, * * The async variant is {@see FirewallPoliciesClient::moveAsync()} . * + * @example samples/V1/FirewallPoliciesClient/move.php + * * @param MoveFirewallPolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -565,6 +589,8 @@ public function move(MoveFirewallPolicyRequest $request, array $callOptions = [] * * The async variant is {@see FirewallPoliciesClient::patchAsync()} . * + * @example samples/V1/FirewallPoliciesClient/patch.php + * * @param PatchFirewallPolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -589,6 +615,8 @@ public function patch(PatchFirewallPolicyRequest $request, array $callOptions = * * The async variant is {@see FirewallPoliciesClient::patchRuleAsync()} . * + * @example samples/V1/FirewallPoliciesClient/patch_rule.php + * * @param PatchRuleFirewallPolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -613,6 +641,8 @@ public function patchRule(PatchRuleFirewallPolicyRequest $request, array $callOp * * The async variant is {@see FirewallPoliciesClient::removeAssociationAsync()} . * + * @example samples/V1/FirewallPoliciesClient/remove_association.php + * * @param RemoveAssociationFirewallPolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -637,6 +667,8 @@ public function removeAssociation(RemoveAssociationFirewallPolicyRequest $reques * * The async variant is {@see FirewallPoliciesClient::removeRuleAsync()} . * + * @example samples/V1/FirewallPoliciesClient/remove_rule.php + * * @param RemoveRuleFirewallPolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -661,6 +693,8 @@ public function removeRule(RemoveRuleFirewallPolicyRequest $request, array $call * * The async variant is {@see FirewallPoliciesClient::setIamPolicyAsync()} . * + * @example samples/V1/FirewallPoliciesClient/set_iam_policy.php + * * @param SetIamPolicyFirewallPolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -685,6 +719,8 @@ public function setIamPolicy(SetIamPolicyFirewallPolicyRequest $request, array $ * * The async variant is {@see FirewallPoliciesClient::testIamPermissionsAsync()} . * + * @example samples/V1/FirewallPoliciesClient/test_iam_permissions.php + * * @param TestIamPermissionsFirewallPolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/FirewallsClient.php b/Compute/src/V1/Client/FirewallsClient.php index b3e1f395551d..3909cd3a58b3 100644 --- a/Compute/src/V1/Client/FirewallsClient.php +++ b/Compute/src/V1/Client/FirewallsClient.php @@ -249,6 +249,8 @@ public function __call($method, $args) * * The async variant is {@see FirewallsClient::deleteAsync()} . * + * @example samples/V1/FirewallsClient/delete.php + * * @param DeleteFirewallRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -273,6 +275,8 @@ public function delete(DeleteFirewallRequest $request, array $callOptions = []): * * The async variant is {@see FirewallsClient::getAsync()} . * + * @example samples/V1/FirewallsClient/get.php + * * @param GetFirewallRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -297,6 +301,8 @@ public function get(GetFirewallRequest $request, array $callOptions = []): Firew * * The async variant is {@see FirewallsClient::insertAsync()} . * + * @example samples/V1/FirewallsClient/insert.php + * * @param InsertFirewallRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -321,6 +327,8 @@ public function insert(InsertFirewallRequest $request, array $callOptions = []): * * The async variant is {@see FirewallsClient::listAsync()} . * + * @example samples/V1/FirewallsClient/list.php + * * @param ListFirewallsRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -345,6 +353,8 @@ public function list(ListFirewallsRequest $request, array $callOptions = []): Pa * * The async variant is {@see FirewallsClient::patchAsync()} . * + * @example samples/V1/FirewallsClient/patch.php + * * @param PatchFirewallRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -369,6 +379,8 @@ public function patch(PatchFirewallRequest $request, array $callOptions = []): O * * The async variant is {@see FirewallsClient::updateAsync()} . * + * @example samples/V1/FirewallsClient/update.php + * * @param UpdateFirewallRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/ForwardingRulesClient.php b/Compute/src/V1/Client/ForwardingRulesClient.php index 57df77723210..d4f9b2a73b99 100644 --- a/Compute/src/V1/Client/ForwardingRulesClient.php +++ b/Compute/src/V1/Client/ForwardingRulesClient.php @@ -254,6 +254,8 @@ public function __call($method, $args) * * The async variant is {@see ForwardingRulesClient::aggregatedListAsync()} . * + * @example samples/V1/ForwardingRulesClient/aggregated_list.php + * * @param AggregatedListForwardingRulesRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -278,6 +280,8 @@ public function aggregatedList(AggregatedListForwardingRulesRequest $request, ar * * The async variant is {@see ForwardingRulesClient::deleteAsync()} . * + * @example samples/V1/ForwardingRulesClient/delete.php + * * @param DeleteForwardingRuleRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -302,6 +306,8 @@ public function delete(DeleteForwardingRuleRequest $request, array $callOptions * * The async variant is {@see ForwardingRulesClient::getAsync()} . * + * @example samples/V1/ForwardingRulesClient/get.php + * * @param GetForwardingRuleRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -326,6 +332,8 @@ public function get(GetForwardingRuleRequest $request, array $callOptions = []): * * The async variant is {@see ForwardingRulesClient::insertAsync()} . * + * @example samples/V1/ForwardingRulesClient/insert.php + * * @param InsertForwardingRuleRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -350,6 +358,8 @@ public function insert(InsertForwardingRuleRequest $request, array $callOptions * * The async variant is {@see ForwardingRulesClient::listAsync()} . * + * @example samples/V1/ForwardingRulesClient/list.php + * * @param ListForwardingRulesRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -374,6 +384,8 @@ public function list(ListForwardingRulesRequest $request, array $callOptions = [ * * The async variant is {@see ForwardingRulesClient::patchAsync()} . * + * @example samples/V1/ForwardingRulesClient/patch.php + * * @param PatchForwardingRuleRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -398,6 +410,8 @@ public function patch(PatchForwardingRuleRequest $request, array $callOptions = * * The async variant is {@see ForwardingRulesClient::setLabelsAsync()} . * + * @example samples/V1/ForwardingRulesClient/set_labels.php + * * @param SetLabelsForwardingRuleRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -422,6 +436,8 @@ public function setLabels(SetLabelsForwardingRuleRequest $request, array $callOp * * The async variant is {@see ForwardingRulesClient::setTargetAsync()} . * + * @example samples/V1/ForwardingRulesClient/set_target.php + * * @param SetTargetForwardingRuleRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/GlobalAddressesClient.php b/Compute/src/V1/Client/GlobalAddressesClient.php index 4965e73db223..a3ad461e6dc5 100644 --- a/Compute/src/V1/Client/GlobalAddressesClient.php +++ b/Compute/src/V1/Client/GlobalAddressesClient.php @@ -249,6 +249,8 @@ public function __call($method, $args) * * The async variant is {@see GlobalAddressesClient::deleteAsync()} . * + * @example samples/V1/GlobalAddressesClient/delete.php + * * @param DeleteGlobalAddressRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -273,6 +275,8 @@ public function delete(DeleteGlobalAddressRequest $request, array $callOptions = * * The async variant is {@see GlobalAddressesClient::getAsync()} . * + * @example samples/V1/GlobalAddressesClient/get.php + * * @param GetGlobalAddressRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -297,6 +301,8 @@ public function get(GetGlobalAddressRequest $request, array $callOptions = []): * * The async variant is {@see GlobalAddressesClient::insertAsync()} . * + * @example samples/V1/GlobalAddressesClient/insert.php + * * @param InsertGlobalAddressRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -321,6 +327,8 @@ public function insert(InsertGlobalAddressRequest $request, array $callOptions = * * The async variant is {@see GlobalAddressesClient::listAsync()} . * + * @example samples/V1/GlobalAddressesClient/list.php + * * @param ListGlobalAddressesRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -345,6 +353,8 @@ public function list(ListGlobalAddressesRequest $request, array $callOptions = [ * * The async variant is {@see GlobalAddressesClient::moveAsync()} . * + * @example samples/V1/GlobalAddressesClient/move.php + * * @param MoveGlobalAddressRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -369,6 +379,8 @@ public function move(MoveGlobalAddressRequest $request, array $callOptions = []) * * The async variant is {@see GlobalAddressesClient::setLabelsAsync()} . * + * @example samples/V1/GlobalAddressesClient/set_labels.php + * * @param SetLabelsGlobalAddressRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/GlobalForwardingRulesClient.php b/Compute/src/V1/Client/GlobalForwardingRulesClient.php index 629c651515c4..09b670ac2e5d 100644 --- a/Compute/src/V1/Client/GlobalForwardingRulesClient.php +++ b/Compute/src/V1/Client/GlobalForwardingRulesClient.php @@ -251,6 +251,8 @@ public function __call($method, $args) * * The async variant is {@see GlobalForwardingRulesClient::deleteAsync()} . * + * @example samples/V1/GlobalForwardingRulesClient/delete.php + * * @param DeleteGlobalForwardingRuleRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -275,6 +277,8 @@ public function delete(DeleteGlobalForwardingRuleRequest $request, array $callOp * * The async variant is {@see GlobalForwardingRulesClient::getAsync()} . * + * @example samples/V1/GlobalForwardingRulesClient/get.php + * * @param GetGlobalForwardingRuleRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -299,6 +303,8 @@ public function get(GetGlobalForwardingRuleRequest $request, array $callOptions * * The async variant is {@see GlobalForwardingRulesClient::insertAsync()} . * + * @example samples/V1/GlobalForwardingRulesClient/insert.php + * * @param InsertGlobalForwardingRuleRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -323,6 +329,8 @@ public function insert(InsertGlobalForwardingRuleRequest $request, array $callOp * * The async variant is {@see GlobalForwardingRulesClient::listAsync()} . * + * @example samples/V1/GlobalForwardingRulesClient/list.php + * * @param ListGlobalForwardingRulesRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -347,6 +355,8 @@ public function list(ListGlobalForwardingRulesRequest $request, array $callOptio * * The async variant is {@see GlobalForwardingRulesClient::patchAsync()} . * + * @example samples/V1/GlobalForwardingRulesClient/patch.php + * * @param PatchGlobalForwardingRuleRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -371,6 +381,8 @@ public function patch(PatchGlobalForwardingRuleRequest $request, array $callOpti * * The async variant is {@see GlobalForwardingRulesClient::setLabelsAsync()} . * + * @example samples/V1/GlobalForwardingRulesClient/set_labels.php + * * @param SetLabelsGlobalForwardingRuleRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -395,6 +407,8 @@ public function setLabels(SetLabelsGlobalForwardingRuleRequest $request, array $ * * The async variant is {@see GlobalForwardingRulesClient::setTargetAsync()} . * + * @example samples/V1/GlobalForwardingRulesClient/set_target.php + * * @param SetTargetGlobalForwardingRuleRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/GlobalNetworkEndpointGroupsClient.php b/Compute/src/V1/Client/GlobalNetworkEndpointGroupsClient.php index 4cc74c1d89a1..eb76630383af 100644 --- a/Compute/src/V1/Client/GlobalNetworkEndpointGroupsClient.php +++ b/Compute/src/V1/Client/GlobalNetworkEndpointGroupsClient.php @@ -252,6 +252,8 @@ public function __call($method, $args) * The async variant is * {@see GlobalNetworkEndpointGroupsClient::attachNetworkEndpointsAsync()} . * + * @example samples/V1/GlobalNetworkEndpointGroupsClient/attach_network_endpoints.php + * * @param AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -276,6 +278,8 @@ public function attachNetworkEndpoints(AttachNetworkEndpointsGlobalNetworkEndpoi * * The async variant is {@see GlobalNetworkEndpointGroupsClient::deleteAsync()} . * + * @example samples/V1/GlobalNetworkEndpointGroupsClient/delete.php + * * @param DeleteGlobalNetworkEndpointGroupRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -301,6 +305,8 @@ public function delete(DeleteGlobalNetworkEndpointGroupRequest $request, array $ * The async variant is * {@see GlobalNetworkEndpointGroupsClient::detachNetworkEndpointsAsync()} . * + * @example samples/V1/GlobalNetworkEndpointGroupsClient/detach_network_endpoints.php + * * @param DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -325,6 +331,8 @@ public function detachNetworkEndpoints(DetachNetworkEndpointsGlobalNetworkEndpoi * * The async variant is {@see GlobalNetworkEndpointGroupsClient::getAsync()} . * + * @example samples/V1/GlobalNetworkEndpointGroupsClient/get.php + * * @param GetGlobalNetworkEndpointGroupRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -349,6 +357,8 @@ public function get(GetGlobalNetworkEndpointGroupRequest $request, array $callOp * * The async variant is {@see GlobalNetworkEndpointGroupsClient::insertAsync()} . * + * @example samples/V1/GlobalNetworkEndpointGroupsClient/insert.php + * * @param InsertGlobalNetworkEndpointGroupRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -373,6 +383,8 @@ public function insert(InsertGlobalNetworkEndpointGroupRequest $request, array $ * * The async variant is {@see GlobalNetworkEndpointGroupsClient::listAsync()} . * + * @example samples/V1/GlobalNetworkEndpointGroupsClient/list.php + * * @param ListGlobalNetworkEndpointGroupsRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -398,6 +410,8 @@ public function list(ListGlobalNetworkEndpointGroupsRequest $request, array $cal * The async variant is * {@see GlobalNetworkEndpointGroupsClient::listNetworkEndpointsAsync()} . * + * @example samples/V1/GlobalNetworkEndpointGroupsClient/list_network_endpoints.php + * * @param ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/GlobalOperationsClient.php b/Compute/src/V1/Client/GlobalOperationsClient.php index bfd64e4a17f5..edcad9029dcf 100644 --- a/Compute/src/V1/Client/GlobalOperationsClient.php +++ b/Compute/src/V1/Client/GlobalOperationsClient.php @@ -192,6 +192,8 @@ public function __call($method, $args) * * The async variant is {@see GlobalOperationsClient::aggregatedListAsync()} . * + * @example samples/V1/GlobalOperationsClient/aggregated_list.php + * * @param AggregatedListGlobalOperationsRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -216,6 +218,8 @@ public function aggregatedList(AggregatedListGlobalOperationsRequest $request, a * * The async variant is {@see GlobalOperationsClient::deleteAsync()} . * + * @example samples/V1/GlobalOperationsClient/delete.php + * * @param DeleteGlobalOperationRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -240,6 +244,8 @@ public function delete(DeleteGlobalOperationRequest $request, array $callOptions * * The async variant is {@see GlobalOperationsClient::getAsync()} . * + * @example samples/V1/GlobalOperationsClient/get.php + * * @param GetGlobalOperationRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -264,6 +270,8 @@ public function get(GetGlobalOperationRequest $request, array $callOptions = []) * * The async variant is {@see GlobalOperationsClient::listAsync()} . * + * @example samples/V1/GlobalOperationsClient/list.php + * * @param ListGlobalOperationsRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -288,6 +296,8 @@ public function list(ListGlobalOperationsRequest $request, array $callOptions = * * The async variant is {@see GlobalOperationsClient::waitAsync()} . * + * @example samples/V1/GlobalOperationsClient/wait.php + * * @param WaitGlobalOperationRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/GlobalOrganizationOperationsClient.php b/Compute/src/V1/Client/GlobalOrganizationOperationsClient.php index 9bf33f58d820..5f747344c78f 100644 --- a/Compute/src/V1/Client/GlobalOrganizationOperationsClient.php +++ b/Compute/src/V1/Client/GlobalOrganizationOperationsClient.php @@ -188,6 +188,8 @@ public function __call($method, $args) * * The async variant is {@see GlobalOrganizationOperationsClient::deleteAsync()} . * + * @example samples/V1/GlobalOrganizationOperationsClient/delete.php + * * @param DeleteGlobalOrganizationOperationRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -212,6 +214,8 @@ public function delete(DeleteGlobalOrganizationOperationRequest $request, array * * The async variant is {@see GlobalOrganizationOperationsClient::getAsync()} . * + * @example samples/V1/GlobalOrganizationOperationsClient/get.php + * * @param GetGlobalOrganizationOperationRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -236,6 +240,8 @@ public function get(GetGlobalOrganizationOperationRequest $request, array $callO * * The async variant is {@see GlobalOrganizationOperationsClient::listAsync()} . * + * @example samples/V1/GlobalOrganizationOperationsClient/list.php + * * @param ListGlobalOrganizationOperationsRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/GlobalPublicDelegatedPrefixesClient.php b/Compute/src/V1/Client/GlobalPublicDelegatedPrefixesClient.php index 2ffacb2b68d9..929ae100378d 100644 --- a/Compute/src/V1/Client/GlobalPublicDelegatedPrefixesClient.php +++ b/Compute/src/V1/Client/GlobalPublicDelegatedPrefixesClient.php @@ -247,6 +247,8 @@ public function __call($method, $args) * * The async variant is {@see GlobalPublicDelegatedPrefixesClient::deleteAsync()} . * + * @example samples/V1/GlobalPublicDelegatedPrefixesClient/delete.php + * * @param DeleteGlobalPublicDelegatedPrefixeRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -271,6 +273,8 @@ public function delete(DeleteGlobalPublicDelegatedPrefixeRequest $request, array * * The async variant is {@see GlobalPublicDelegatedPrefixesClient::getAsync()} . * + * @example samples/V1/GlobalPublicDelegatedPrefixesClient/get.php + * * @param GetGlobalPublicDelegatedPrefixeRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -295,6 +299,8 @@ public function get(GetGlobalPublicDelegatedPrefixeRequest $request, array $call * * The async variant is {@see GlobalPublicDelegatedPrefixesClient::insertAsync()} . * + * @example samples/V1/GlobalPublicDelegatedPrefixesClient/insert.php + * * @param InsertGlobalPublicDelegatedPrefixeRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -319,6 +325,8 @@ public function insert(InsertGlobalPublicDelegatedPrefixeRequest $request, array * * The async variant is {@see GlobalPublicDelegatedPrefixesClient::listAsync()} . * + * @example samples/V1/GlobalPublicDelegatedPrefixesClient/list.php + * * @param ListGlobalPublicDelegatedPrefixesRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -343,6 +351,8 @@ public function list(ListGlobalPublicDelegatedPrefixesRequest $request, array $c * * The async variant is {@see GlobalPublicDelegatedPrefixesClient::patchAsync()} . * + * @example samples/V1/GlobalPublicDelegatedPrefixesClient/patch.php + * * @param PatchGlobalPublicDelegatedPrefixeRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/HealthChecksClient.php b/Compute/src/V1/Client/HealthChecksClient.php index 2f9be60f6489..75fc622accfd 100644 --- a/Compute/src/V1/Client/HealthChecksClient.php +++ b/Compute/src/V1/Client/HealthChecksClient.php @@ -251,6 +251,8 @@ public function __call($method, $args) * * The async variant is {@see HealthChecksClient::aggregatedListAsync()} . * + * @example samples/V1/HealthChecksClient/aggregated_list.php + * * @param AggregatedListHealthChecksRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -275,6 +277,8 @@ public function aggregatedList(AggregatedListHealthChecksRequest $request, array * * The async variant is {@see HealthChecksClient::deleteAsync()} . * + * @example samples/V1/HealthChecksClient/delete.php + * * @param DeleteHealthCheckRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -299,6 +303,8 @@ public function delete(DeleteHealthCheckRequest $request, array $callOptions = [ * * The async variant is {@see HealthChecksClient::getAsync()} . * + * @example samples/V1/HealthChecksClient/get.php + * * @param GetHealthCheckRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -323,6 +329,8 @@ public function get(GetHealthCheckRequest $request, array $callOptions = []): He * * The async variant is {@see HealthChecksClient::insertAsync()} . * + * @example samples/V1/HealthChecksClient/insert.php + * * @param InsertHealthCheckRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -347,6 +355,8 @@ public function insert(InsertHealthCheckRequest $request, array $callOptions = [ * * The async variant is {@see HealthChecksClient::listAsync()} . * + * @example samples/V1/HealthChecksClient/list.php + * * @param ListHealthChecksRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -371,6 +381,8 @@ public function list(ListHealthChecksRequest $request, array $callOptions = []): * * The async variant is {@see HealthChecksClient::patchAsync()} . * + * @example samples/V1/HealthChecksClient/patch.php + * * @param PatchHealthCheckRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -395,6 +407,8 @@ public function patch(PatchHealthCheckRequest $request, array $callOptions = []) * * The async variant is {@see HealthChecksClient::updateAsync()} . * + * @example samples/V1/HealthChecksClient/update.php + * * @param UpdateHealthCheckRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/ImageFamilyViewsClient.php b/Compute/src/V1/Client/ImageFamilyViewsClient.php index efa34d0fd931..bb3b4c7196fc 100644 --- a/Compute/src/V1/Client/ImageFamilyViewsClient.php +++ b/Compute/src/V1/Client/ImageFamilyViewsClient.php @@ -183,6 +183,8 @@ public function __call($method, $args) * * The async variant is {@see ImageFamilyViewsClient::getAsync()} . * + * @example samples/V1/ImageFamilyViewsClient/get.php + * * @param GetImageFamilyViewRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/ImagesClient.php b/Compute/src/V1/Client/ImagesClient.php index 09d6753741d2..581a51e5b05d 100644 --- a/Compute/src/V1/Client/ImagesClient.php +++ b/Compute/src/V1/Client/ImagesClient.php @@ -261,6 +261,8 @@ public function __call($method, $args) * * The async variant is {@see ImagesClient::deleteAsync()} . * + * @example samples/V1/ImagesClient/delete.php + * * @param DeleteImageRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -285,6 +287,8 @@ public function delete(DeleteImageRequest $request, array $callOptions = []): Op * * The async variant is {@see ImagesClient::deprecateAsync()} . * + * @example samples/V1/ImagesClient/deprecate.php + * * @param DeprecateImageRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -309,6 +313,8 @@ public function deprecate(DeprecateImageRequest $request, array $callOptions = [ * * The async variant is {@see ImagesClient::getAsync()} . * + * @example samples/V1/ImagesClient/get.php + * * @param GetImageRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -333,6 +339,8 @@ public function get(GetImageRequest $request, array $callOptions = []): Image * * The async variant is {@see ImagesClient::getFromFamilyAsync()} . * + * @example samples/V1/ImagesClient/get_from_family.php + * * @param GetFromFamilyImageRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -357,6 +365,8 @@ public function getFromFamily(GetFromFamilyImageRequest $request, array $callOpt * * The async variant is {@see ImagesClient::getIamPolicyAsync()} . * + * @example samples/V1/ImagesClient/get_iam_policy.php + * * @param GetIamPolicyImageRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -381,6 +391,8 @@ public function getIamPolicy(GetIamPolicyImageRequest $request, array $callOptio * * The async variant is {@see ImagesClient::insertAsync()} . * + * @example samples/V1/ImagesClient/insert.php + * * @param InsertImageRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -405,6 +417,8 @@ public function insert(InsertImageRequest $request, array $callOptions = []): Op * * The async variant is {@see ImagesClient::listAsync()} . * + * @example samples/V1/ImagesClient/list.php + * * @param ListImagesRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -429,6 +443,8 @@ public function list(ListImagesRequest $request, array $callOptions = []): Paged * * The async variant is {@see ImagesClient::patchAsync()} . * + * @example samples/V1/ImagesClient/patch.php + * * @param PatchImageRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -453,6 +469,8 @@ public function patch(PatchImageRequest $request, array $callOptions = []): Oper * * The async variant is {@see ImagesClient::setIamPolicyAsync()} . * + * @example samples/V1/ImagesClient/set_iam_policy.php + * * @param SetIamPolicyImageRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -477,6 +495,8 @@ public function setIamPolicy(SetIamPolicyImageRequest $request, array $callOptio * * The async variant is {@see ImagesClient::setLabelsAsync()} . * + * @example samples/V1/ImagesClient/set_labels.php + * * @param SetLabelsImageRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -501,6 +521,8 @@ public function setLabels(SetLabelsImageRequest $request, array $callOptions = [ * * The async variant is {@see ImagesClient::testIamPermissionsAsync()} . * + * @example samples/V1/ImagesClient/test_iam_permissions.php + * * @param TestIamPermissionsImageRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/InstanceGroupManagerResizeRequestsClient.php b/Compute/src/V1/Client/InstanceGroupManagerResizeRequestsClient.php index 9d98319834f6..06063c007e26 100644 --- a/Compute/src/V1/Client/InstanceGroupManagerResizeRequestsClient.php +++ b/Compute/src/V1/Client/InstanceGroupManagerResizeRequestsClient.php @@ -249,6 +249,8 @@ public function __call($method, $args) * The async variant is * {@see InstanceGroupManagerResizeRequestsClient::cancelAsync()} . * + * @example samples/V1/InstanceGroupManagerResizeRequestsClient/cancel.php + * * @param CancelInstanceGroupManagerResizeRequestRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -274,6 +276,8 @@ public function cancel(CancelInstanceGroupManagerResizeRequestRequest $request, * The async variant is * {@see InstanceGroupManagerResizeRequestsClient::deleteAsync()} . * + * @example samples/V1/InstanceGroupManagerResizeRequestsClient/delete.php + * * @param DeleteInstanceGroupManagerResizeRequestRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -299,6 +303,8 @@ public function delete(DeleteInstanceGroupManagerResizeRequestRequest $request, * The async variant is {@see InstanceGroupManagerResizeRequestsClient::getAsync()} * . * + * @example samples/V1/InstanceGroupManagerResizeRequestsClient/get.php + * * @param GetInstanceGroupManagerResizeRequestRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -324,6 +330,8 @@ public function get(GetInstanceGroupManagerResizeRequestRequest $request, array * The async variant is * {@see InstanceGroupManagerResizeRequestsClient::insertAsync()} . * + * @example samples/V1/InstanceGroupManagerResizeRequestsClient/insert.php + * * @param InsertInstanceGroupManagerResizeRequestRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -349,6 +357,8 @@ public function insert(InsertInstanceGroupManagerResizeRequestRequest $request, * The async variant is * {@see InstanceGroupManagerResizeRequestsClient::listAsync()} . * + * @example samples/V1/InstanceGroupManagerResizeRequestsClient/list.php + * * @param ListInstanceGroupManagerResizeRequestsRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/InstanceGroupManagersClient.php b/Compute/src/V1/Client/InstanceGroupManagersClient.php index 1d27b1eb27a6..e4ee2b4a96e3 100644 --- a/Compute/src/V1/Client/InstanceGroupManagersClient.php +++ b/Compute/src/V1/Client/InstanceGroupManagersClient.php @@ -287,6 +287,8 @@ public function __call($method, $args) * The async variant is {@see InstanceGroupManagersClient::abandonInstancesAsync()} * . * + * @example samples/V1/InstanceGroupManagersClient/abandon_instances.php + * * @param AbandonInstancesInstanceGroupManagerRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -311,6 +313,8 @@ public function abandonInstances(AbandonInstancesInstanceGroupManagerRequest $re * * The async variant is {@see InstanceGroupManagersClient::aggregatedListAsync()} . * + * @example samples/V1/InstanceGroupManagersClient/aggregated_list.php + * * @param AggregatedListInstanceGroupManagersRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -336,6 +340,8 @@ public function aggregatedList(AggregatedListInstanceGroupManagersRequest $reque * The async variant is * {@see InstanceGroupManagersClient::applyUpdatesToInstancesAsync()} . * + * @example samples/V1/InstanceGroupManagersClient/apply_updates_to_instances.php + * * @param ApplyUpdatesToInstancesInstanceGroupManagerRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -361,6 +367,8 @@ public function applyUpdatesToInstances(ApplyUpdatesToInstancesInstanceGroupMana * The async variant is {@see InstanceGroupManagersClient::createInstancesAsync()} * . * + * @example samples/V1/InstanceGroupManagersClient/create_instances.php + * * @param CreateInstancesInstanceGroupManagerRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -385,6 +393,8 @@ public function createInstances(CreateInstancesInstanceGroupManagerRequest $requ * * The async variant is {@see InstanceGroupManagersClient::deleteAsync()} . * + * @example samples/V1/InstanceGroupManagersClient/delete.php + * * @param DeleteInstanceGroupManagerRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -410,6 +420,8 @@ public function delete(DeleteInstanceGroupManagerRequest $request, array $callOp * The async variant is {@see InstanceGroupManagersClient::deleteInstancesAsync()} * . * + * @example samples/V1/InstanceGroupManagersClient/delete_instances.php + * * @param DeleteInstancesInstanceGroupManagerRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -435,6 +447,8 @@ public function deleteInstances(DeleteInstancesInstanceGroupManagerRequest $requ * The async variant is * {@see InstanceGroupManagersClient::deletePerInstanceConfigsAsync()} . * + * @example samples/V1/InstanceGroupManagersClient/delete_per_instance_configs.php + * * @param DeletePerInstanceConfigsInstanceGroupManagerRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -459,6 +473,8 @@ public function deletePerInstanceConfigs(DeletePerInstanceConfigsInstanceGroupMa * * The async variant is {@see InstanceGroupManagersClient::getAsync()} . * + * @example samples/V1/InstanceGroupManagersClient/get.php + * * @param GetInstanceGroupManagerRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -483,6 +499,8 @@ public function get(GetInstanceGroupManagerRequest $request, array $callOptions * * The async variant is {@see InstanceGroupManagersClient::insertAsync()} . * + * @example samples/V1/InstanceGroupManagersClient/insert.php + * * @param InsertInstanceGroupManagerRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -507,6 +525,8 @@ public function insert(InsertInstanceGroupManagerRequest $request, array $callOp * * The async variant is {@see InstanceGroupManagersClient::listAsync()} . * + * @example samples/V1/InstanceGroupManagersClient/list.php + * * @param ListInstanceGroupManagersRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -531,6 +551,8 @@ public function list(ListInstanceGroupManagersRequest $request, array $callOptio * * The async variant is {@see InstanceGroupManagersClient::listErrorsAsync()} . * + * @example samples/V1/InstanceGroupManagersClient/list_errors.php + * * @param ListErrorsInstanceGroupManagersRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -556,6 +578,8 @@ public function listErrors(ListErrorsInstanceGroupManagersRequest $request, arra * The async variant is * {@see InstanceGroupManagersClient::listManagedInstancesAsync()} . * + * @example samples/V1/InstanceGroupManagersClient/list_managed_instances.php + * * @param ListManagedInstancesInstanceGroupManagersRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -581,6 +605,8 @@ public function listManagedInstances(ListManagedInstancesInstanceGroupManagersRe * The async variant is * {@see InstanceGroupManagersClient::listPerInstanceConfigsAsync()} . * + * @example samples/V1/InstanceGroupManagersClient/list_per_instance_configs.php + * * @param ListPerInstanceConfigsInstanceGroupManagersRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -605,6 +631,8 @@ public function listPerInstanceConfigs(ListPerInstanceConfigsInstanceGroupManage * * The async variant is {@see InstanceGroupManagersClient::patchAsync()} . * + * @example samples/V1/InstanceGroupManagersClient/patch.php + * * @param PatchInstanceGroupManagerRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -630,6 +658,8 @@ public function patch(PatchInstanceGroupManagerRequest $request, array $callOpti * The async variant is * {@see InstanceGroupManagersClient::patchPerInstanceConfigsAsync()} . * + * @example samples/V1/InstanceGroupManagersClient/patch_per_instance_configs.php + * * @param PatchPerInstanceConfigsInstanceGroupManagerRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -655,6 +685,8 @@ public function patchPerInstanceConfigs(PatchPerInstanceConfigsInstanceGroupMana * The async variant is * {@see InstanceGroupManagersClient::recreateInstancesAsync()} . * + * @example samples/V1/InstanceGroupManagersClient/recreate_instances.php + * * @param RecreateInstancesInstanceGroupManagerRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -679,6 +711,8 @@ public function recreateInstances(RecreateInstancesInstanceGroupManagerRequest $ * * The async variant is {@see InstanceGroupManagersClient::resizeAsync()} . * + * @example samples/V1/InstanceGroupManagersClient/resize.php + * * @param ResizeInstanceGroupManagerRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -704,6 +738,8 @@ public function resize(ResizeInstanceGroupManagerRequest $request, array $callOp * The async variant is {@see InstanceGroupManagersClient::resumeInstancesAsync()} * . * + * @example samples/V1/InstanceGroupManagersClient/resume_instances.php + * * @param ResumeInstancesInstanceGroupManagerRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -729,6 +765,8 @@ public function resumeInstances(ResumeInstancesInstanceGroupManagerRequest $requ * The async variant is * {@see InstanceGroupManagersClient::setInstanceTemplateAsync()} . * + * @example samples/V1/InstanceGroupManagersClient/set_instance_template.php + * * @param SetInstanceTemplateInstanceGroupManagerRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -753,6 +791,8 @@ public function setInstanceTemplate(SetInstanceTemplateInstanceGroupManagerReque * * The async variant is {@see InstanceGroupManagersClient::setTargetPoolsAsync()} . * + * @example samples/V1/InstanceGroupManagersClient/set_target_pools.php + * * @param SetTargetPoolsInstanceGroupManagerRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -777,6 +817,8 @@ public function setTargetPools(SetTargetPoolsInstanceGroupManagerRequest $reques * * The async variant is {@see InstanceGroupManagersClient::startInstancesAsync()} . * + * @example samples/V1/InstanceGroupManagersClient/start_instances.php + * * @param StartInstancesInstanceGroupManagerRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -801,6 +843,8 @@ public function startInstances(StartInstancesInstanceGroupManagerRequest $reques * * The async variant is {@see InstanceGroupManagersClient::stopInstancesAsync()} . * + * @example samples/V1/InstanceGroupManagersClient/stop_instances.php + * * @param StopInstancesInstanceGroupManagerRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -826,6 +870,8 @@ public function stopInstances(StopInstancesInstanceGroupManagerRequest $request, * The async variant is {@see InstanceGroupManagersClient::suspendInstancesAsync()} * . * + * @example samples/V1/InstanceGroupManagersClient/suspend_instances.php + * * @param SuspendInstancesInstanceGroupManagerRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -851,6 +897,8 @@ public function suspendInstances(SuspendInstancesInstanceGroupManagerRequest $re * The async variant is * {@see InstanceGroupManagersClient::updatePerInstanceConfigsAsync()} . * + * @example samples/V1/InstanceGroupManagersClient/update_per_instance_configs.php + * * @param UpdatePerInstanceConfigsInstanceGroupManagerRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/InstanceGroupsClient.php b/Compute/src/V1/Client/InstanceGroupsClient.php index 8f8010885e0e..14d8af00a7ef 100644 --- a/Compute/src/V1/Client/InstanceGroupsClient.php +++ b/Compute/src/V1/Client/InstanceGroupsClient.php @@ -256,6 +256,8 @@ public function __call($method, $args) * * The async variant is {@see InstanceGroupsClient::addInstancesAsync()} . * + * @example samples/V1/InstanceGroupsClient/add_instances.php + * * @param AddInstancesInstanceGroupRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -280,6 +282,8 @@ public function addInstances(AddInstancesInstanceGroupRequest $request, array $c * * The async variant is {@see InstanceGroupsClient::aggregatedListAsync()} . * + * @example samples/V1/InstanceGroupsClient/aggregated_list.php + * * @param AggregatedListInstanceGroupsRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -304,6 +308,8 @@ public function aggregatedList(AggregatedListInstanceGroupsRequest $request, arr * * The async variant is {@see InstanceGroupsClient::deleteAsync()} . * + * @example samples/V1/InstanceGroupsClient/delete.php + * * @param DeleteInstanceGroupRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -328,6 +334,8 @@ public function delete(DeleteInstanceGroupRequest $request, array $callOptions = * * The async variant is {@see InstanceGroupsClient::getAsync()} . * + * @example samples/V1/InstanceGroupsClient/get.php + * * @param GetInstanceGroupRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -352,6 +360,8 @@ public function get(GetInstanceGroupRequest $request, array $callOptions = []): * * The async variant is {@see InstanceGroupsClient::insertAsync()} . * + * @example samples/V1/InstanceGroupsClient/insert.php + * * @param InsertInstanceGroupRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -376,6 +386,8 @@ public function insert(InsertInstanceGroupRequest $request, array $callOptions = * * The async variant is {@see InstanceGroupsClient::listAsync()} . * + * @example samples/V1/InstanceGroupsClient/list.php + * * @param ListInstanceGroupsRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -400,6 +412,8 @@ public function list(ListInstanceGroupsRequest $request, array $callOptions = [] * * The async variant is {@see InstanceGroupsClient::listInstancesAsync()} . * + * @example samples/V1/InstanceGroupsClient/list_instances.php + * * @param ListInstancesInstanceGroupsRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -424,6 +438,8 @@ public function listInstances(ListInstancesInstanceGroupsRequest $request, array * * The async variant is {@see InstanceGroupsClient::removeInstancesAsync()} . * + * @example samples/V1/InstanceGroupsClient/remove_instances.php + * * @param RemoveInstancesInstanceGroupRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -448,6 +464,8 @@ public function removeInstances(RemoveInstancesInstanceGroupRequest $request, ar * * The async variant is {@see InstanceGroupsClient::setNamedPortsAsync()} . * + * @example samples/V1/InstanceGroupsClient/set_named_ports.php + * * @param SetNamedPortsInstanceGroupRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/InstanceSettingsServiceClient.php b/Compute/src/V1/Client/InstanceSettingsServiceClient.php index 8e3c906e78c4..67bdea7935f6 100644 --- a/Compute/src/V1/Client/InstanceSettingsServiceClient.php +++ b/Compute/src/V1/Client/InstanceSettingsServiceClient.php @@ -241,6 +241,8 @@ public function __call($method, $args) * * The async variant is {@see InstanceSettingsServiceClient::getAsync()} . * + * @example samples/V1/InstanceSettingsServiceClient/get.php + * * @param GetInstanceSettingRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -265,6 +267,8 @@ public function get(GetInstanceSettingRequest $request, array $callOptions = []) * * The async variant is {@see InstanceSettingsServiceClient::patchAsync()} . * + * @example samples/V1/InstanceSettingsServiceClient/patch.php + * * @param PatchInstanceSettingRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/InstanceTemplatesClient.php b/Compute/src/V1/Client/InstanceTemplatesClient.php index 0832ae0295da..1758832140e2 100644 --- a/Compute/src/V1/Client/InstanceTemplatesClient.php +++ b/Compute/src/V1/Client/InstanceTemplatesClient.php @@ -255,6 +255,8 @@ public function __call($method, $args) * * The async variant is {@see InstanceTemplatesClient::aggregatedListAsync()} . * + * @example samples/V1/InstanceTemplatesClient/aggregated_list.php + * * @param AggregatedListInstanceTemplatesRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -279,6 +281,8 @@ public function aggregatedList(AggregatedListInstanceTemplatesRequest $request, * * The async variant is {@see InstanceTemplatesClient::deleteAsync()} . * + * @example samples/V1/InstanceTemplatesClient/delete.php + * * @param DeleteInstanceTemplateRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -303,6 +307,8 @@ public function delete(DeleteInstanceTemplateRequest $request, array $callOption * * The async variant is {@see InstanceTemplatesClient::getAsync()} . * + * @example samples/V1/InstanceTemplatesClient/get.php + * * @param GetInstanceTemplateRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -327,6 +333,8 @@ public function get(GetInstanceTemplateRequest $request, array $callOptions = [] * * The async variant is {@see InstanceTemplatesClient::getIamPolicyAsync()} . * + * @example samples/V1/InstanceTemplatesClient/get_iam_policy.php + * * @param GetIamPolicyInstanceTemplateRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -351,6 +359,8 @@ public function getIamPolicy(GetIamPolicyInstanceTemplateRequest $request, array * * The async variant is {@see InstanceTemplatesClient::insertAsync()} . * + * @example samples/V1/InstanceTemplatesClient/insert.php + * * @param InsertInstanceTemplateRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -375,6 +385,8 @@ public function insert(InsertInstanceTemplateRequest $request, array $callOption * * The async variant is {@see InstanceTemplatesClient::listAsync()} . * + * @example samples/V1/InstanceTemplatesClient/list.php + * * @param ListInstanceTemplatesRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -399,6 +411,8 @@ public function list(ListInstanceTemplatesRequest $request, array $callOptions = * * The async variant is {@see InstanceTemplatesClient::setIamPolicyAsync()} . * + * @example samples/V1/InstanceTemplatesClient/set_iam_policy.php + * * @param SetIamPolicyInstanceTemplateRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -423,6 +437,8 @@ public function setIamPolicy(SetIamPolicyInstanceTemplateRequest $request, array * * The async variant is {@see InstanceTemplatesClient::testIamPermissionsAsync()} . * + * @example samples/V1/InstanceTemplatesClient/test_iam_permissions.php + * * @param TestIamPermissionsInstanceTemplateRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/InstancesClient.php b/Compute/src/V1/Client/InstancesClient.php index 70992871a5e6..8027772a8a80 100644 --- a/Compute/src/V1/Client/InstancesClient.php +++ b/Compute/src/V1/Client/InstancesClient.php @@ -342,6 +342,8 @@ public function __call($method, $args) * * The async variant is {@see InstancesClient::addAccessConfigAsync()} . * + * @example samples/V1/InstancesClient/add_access_config.php + * * @param AddAccessConfigInstanceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -366,6 +368,8 @@ public function addAccessConfig(AddAccessConfigInstanceRequest $request, array $ * * The async variant is {@see InstancesClient::addResourcePoliciesAsync()} . * + * @example samples/V1/InstancesClient/add_resource_policies.php + * * @param AddResourcePoliciesInstanceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -390,6 +394,8 @@ public function addResourcePolicies(AddResourcePoliciesInstanceRequest $request, * * The async variant is {@see InstancesClient::aggregatedListAsync()} . * + * @example samples/V1/InstancesClient/aggregated_list.php + * * @param AggregatedListInstancesRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -414,6 +420,8 @@ public function aggregatedList(AggregatedListInstancesRequest $request, array $c * * The async variant is {@see InstancesClient::attachDiskAsync()} . * + * @example samples/V1/InstancesClient/attach_disk.php + * * @param AttachDiskInstanceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -438,6 +446,8 @@ public function attachDisk(AttachDiskInstanceRequest $request, array $callOption * * The async variant is {@see InstancesClient::bulkInsertAsync()} . * + * @example samples/V1/InstancesClient/bulk_insert.php + * * @param BulkInsertInstanceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -462,6 +472,8 @@ public function bulkInsert(BulkInsertInstanceRequest $request, array $callOption * * The async variant is {@see InstancesClient::deleteAsync()} . * + * @example samples/V1/InstancesClient/delete.php + * * @param DeleteInstanceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -486,6 +498,8 @@ public function delete(DeleteInstanceRequest $request, array $callOptions = []): * * The async variant is {@see InstancesClient::deleteAccessConfigAsync()} . * + * @example samples/V1/InstancesClient/delete_access_config.php + * * @param DeleteAccessConfigInstanceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -510,6 +524,8 @@ public function deleteAccessConfig(DeleteAccessConfigInstanceRequest $request, a * * The async variant is {@see InstancesClient::detachDiskAsync()} . * + * @example samples/V1/InstancesClient/detach_disk.php + * * @param DetachDiskInstanceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -534,6 +550,8 @@ public function detachDisk(DetachDiskInstanceRequest $request, array $callOption * * The async variant is {@see InstancesClient::getAsync()} . * + * @example samples/V1/InstancesClient/get.php + * * @param GetInstanceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -558,6 +576,8 @@ public function get(GetInstanceRequest $request, array $callOptions = []): Insta * * The async variant is {@see InstancesClient::getEffectiveFirewallsAsync()} . * + * @example samples/V1/InstancesClient/get_effective_firewalls.php + * * @param GetEffectiveFirewallsInstanceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -582,6 +602,8 @@ public function getEffectiveFirewalls(GetEffectiveFirewallsInstanceRequest $requ * * The async variant is {@see InstancesClient::getGuestAttributesAsync()} . * + * @example samples/V1/InstancesClient/get_guest_attributes.php + * * @param GetGuestAttributesInstanceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -606,6 +628,8 @@ public function getGuestAttributes(GetGuestAttributesInstanceRequest $request, a * * The async variant is {@see InstancesClient::getIamPolicyAsync()} . * + * @example samples/V1/InstancesClient/get_iam_policy.php + * * @param GetIamPolicyInstanceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -630,6 +654,8 @@ public function getIamPolicy(GetIamPolicyInstanceRequest $request, array $callOp * * The async variant is {@see InstancesClient::getScreenshotAsync()} . * + * @example samples/V1/InstancesClient/get_screenshot.php + * * @param GetScreenshotInstanceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -654,6 +680,8 @@ public function getScreenshot(GetScreenshotInstanceRequest $request, array $call * * The async variant is {@see InstancesClient::getSerialPortOutputAsync()} . * + * @example samples/V1/InstancesClient/get_serial_port_output.php + * * @param GetSerialPortOutputInstanceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -679,6 +707,8 @@ public function getSerialPortOutput(GetSerialPortOutputInstanceRequest $request, * The async variant is {@see InstancesClient::getShieldedInstanceIdentityAsync()} * . * + * @example samples/V1/InstancesClient/get_shielded_instance_identity.php + * * @param GetShieldedInstanceIdentityInstanceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -703,6 +733,8 @@ public function getShieldedInstanceIdentity(GetShieldedInstanceIdentityInstanceR * * The async variant is {@see InstancesClient::insertAsync()} . * + * @example samples/V1/InstancesClient/insert.php + * * @param InsertInstanceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -727,6 +759,8 @@ public function insert(InsertInstanceRequest $request, array $callOptions = []): * * The async variant is {@see InstancesClient::listAsync()} . * + * @example samples/V1/InstancesClient/list.php + * * @param ListInstancesRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -751,6 +785,8 @@ public function list(ListInstancesRequest $request, array $callOptions = []): Pa * * The async variant is {@see InstancesClient::listReferrersAsync()} . * + * @example samples/V1/InstancesClient/list_referrers.php + * * @param ListReferrersInstancesRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -775,6 +811,8 @@ public function listReferrers(ListReferrersInstancesRequest $request, array $cal * * The async variant is {@see InstancesClient::performMaintenanceAsync()} . * + * @example samples/V1/InstancesClient/perform_maintenance.php + * * @param PerformMaintenanceInstanceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -799,6 +837,8 @@ public function performMaintenance(PerformMaintenanceInstanceRequest $request, a * * The async variant is {@see InstancesClient::removeResourcePoliciesAsync()} . * + * @example samples/V1/InstancesClient/remove_resource_policies.php + * * @param RemoveResourcePoliciesInstanceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -823,6 +863,8 @@ public function removeResourcePolicies(RemoveResourcePoliciesInstanceRequest $re * * The async variant is {@see InstancesClient::resetAsync()} . * + * @example samples/V1/InstancesClient/reset.php + * * @param ResetInstanceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -847,6 +889,8 @@ public function reset(ResetInstanceRequest $request, array $callOptions = []): O * * The async variant is {@see InstancesClient::resumeAsync()} . * + * @example samples/V1/InstancesClient/resume.php + * * @param ResumeInstanceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -871,6 +915,8 @@ public function resume(ResumeInstanceRequest $request, array $callOptions = []): * * The async variant is {@see InstancesClient::sendDiagnosticInterruptAsync()} . * + * @example samples/V1/InstancesClient/send_diagnostic_interrupt.php + * * @param SendDiagnosticInterruptInstanceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -895,6 +941,8 @@ public function sendDiagnosticInterrupt(SendDiagnosticInterruptInstanceRequest $ * * The async variant is {@see InstancesClient::setDeletionProtectionAsync()} . * + * @example samples/V1/InstancesClient/set_deletion_protection.php + * * @param SetDeletionProtectionInstanceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -919,6 +967,8 @@ public function setDeletionProtection(SetDeletionProtectionInstanceRequest $requ * * The async variant is {@see InstancesClient::setDiskAutoDeleteAsync()} . * + * @example samples/V1/InstancesClient/set_disk_auto_delete.php + * * @param SetDiskAutoDeleteInstanceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -943,6 +993,8 @@ public function setDiskAutoDelete(SetDiskAutoDeleteInstanceRequest $request, arr * * The async variant is {@see InstancesClient::setIamPolicyAsync()} . * + * @example samples/V1/InstancesClient/set_iam_policy.php + * * @param SetIamPolicyInstanceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -967,6 +1019,8 @@ public function setIamPolicy(SetIamPolicyInstanceRequest $request, array $callOp * * The async variant is {@see InstancesClient::setLabelsAsync()} . * + * @example samples/V1/InstancesClient/set_labels.php + * * @param SetLabelsInstanceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -991,6 +1045,8 @@ public function setLabels(SetLabelsInstanceRequest $request, array $callOptions * * The async variant is {@see InstancesClient::setMachineResourcesAsync()} . * + * @example samples/V1/InstancesClient/set_machine_resources.php + * * @param SetMachineResourcesInstanceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -1015,6 +1071,8 @@ public function setMachineResources(SetMachineResourcesInstanceRequest $request, * * The async variant is {@see InstancesClient::setMachineTypeAsync()} . * + * @example samples/V1/InstancesClient/set_machine_type.php + * * @param SetMachineTypeInstanceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -1039,6 +1097,8 @@ public function setMachineType(SetMachineTypeInstanceRequest $request, array $ca * * The async variant is {@see InstancesClient::setMetadataAsync()} . * + * @example samples/V1/InstancesClient/set_metadata.php + * * @param SetMetadataInstanceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -1063,6 +1123,8 @@ public function setMetadata(SetMetadataInstanceRequest $request, array $callOpti * * The async variant is {@see InstancesClient::setMinCpuPlatformAsync()} . * + * @example samples/V1/InstancesClient/set_min_cpu_platform.php + * * @param SetMinCpuPlatformInstanceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -1087,6 +1149,8 @@ public function setMinCpuPlatform(SetMinCpuPlatformInstanceRequest $request, arr * * The async variant is {@see InstancesClient::setNameAsync()} . * + * @example samples/V1/InstancesClient/set_name.php + * * @param SetNameInstanceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -1111,6 +1175,8 @@ public function setName(SetNameInstanceRequest $request, array $callOptions = [] * * The async variant is {@see InstancesClient::setSchedulingAsync()} . * + * @example samples/V1/InstancesClient/set_scheduling.php + * * @param SetSchedulingInstanceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -1135,6 +1201,8 @@ public function setScheduling(SetSchedulingInstanceRequest $request, array $call * * The async variant is {@see InstancesClient::setSecurityPolicyAsync()} . * + * @example samples/V1/InstancesClient/set_security_policy.php + * * @param SetSecurityPolicyInstanceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -1159,6 +1227,8 @@ public function setSecurityPolicy(SetSecurityPolicyInstanceRequest $request, arr * * The async variant is {@see InstancesClient::setServiceAccountAsync()} . * + * @example samples/V1/InstancesClient/set_service_account.php + * * @param SetServiceAccountInstanceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -1184,6 +1254,8 @@ public function setServiceAccount(SetServiceAccountInstanceRequest $request, arr * The async variant is * {@see InstancesClient::setShieldedInstanceIntegrityPolicyAsync()} . * + * @example samples/V1/InstancesClient/set_shielded_instance_integrity_policy.php + * * @param SetShieldedInstanceIntegrityPolicyInstanceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -1208,6 +1280,8 @@ public function setShieldedInstanceIntegrityPolicy(SetShieldedInstanceIntegrityP * * The async variant is {@see InstancesClient::setTagsAsync()} . * + * @example samples/V1/InstancesClient/set_tags.php + * * @param SetTagsInstanceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -1232,6 +1306,8 @@ public function setTags(SetTagsInstanceRequest $request, array $callOptions = [] * * The async variant is {@see InstancesClient::simulateMaintenanceEventAsync()} . * + * @example samples/V1/InstancesClient/simulate_maintenance_event.php + * * @param SimulateMaintenanceEventInstanceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -1256,6 +1332,8 @@ public function simulateMaintenanceEvent(SimulateMaintenanceEventInstanceRequest * * The async variant is {@see InstancesClient::startAsync()} . * + * @example samples/V1/InstancesClient/start.php + * * @param StartInstanceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -1280,6 +1358,8 @@ public function start(StartInstanceRequest $request, array $callOptions = []): O * * The async variant is {@see InstancesClient::startWithEncryptionKeyAsync()} . * + * @example samples/V1/InstancesClient/start_with_encryption_key.php + * * @param StartWithEncryptionKeyInstanceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -1304,6 +1384,8 @@ public function startWithEncryptionKey(StartWithEncryptionKeyInstanceRequest $re * * The async variant is {@see InstancesClient::stopAsync()} . * + * @example samples/V1/InstancesClient/stop.php + * * @param StopInstanceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -1328,6 +1410,8 @@ public function stop(StopInstanceRequest $request, array $callOptions = []): Ope * * The async variant is {@see InstancesClient::suspendAsync()} . * + * @example samples/V1/InstancesClient/suspend.php + * * @param SuspendInstanceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -1352,6 +1436,8 @@ public function suspend(SuspendInstanceRequest $request, array $callOptions = [] * * The async variant is {@see InstancesClient::testIamPermissionsAsync()} . * + * @example samples/V1/InstancesClient/test_iam_permissions.php + * * @param TestIamPermissionsInstanceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -1376,6 +1462,8 @@ public function testIamPermissions(TestIamPermissionsInstanceRequest $request, a * * The async variant is {@see InstancesClient::updateAsync()} . * + * @example samples/V1/InstancesClient/update.php + * * @param UpdateInstanceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -1400,6 +1488,8 @@ public function update(UpdateInstanceRequest $request, array $callOptions = []): * * The async variant is {@see InstancesClient::updateAccessConfigAsync()} . * + * @example samples/V1/InstancesClient/update_access_config.php + * * @param UpdateAccessConfigInstanceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -1424,6 +1514,8 @@ public function updateAccessConfig(UpdateAccessConfigInstanceRequest $request, a * * The async variant is {@see InstancesClient::updateDisplayDeviceAsync()} . * + * @example samples/V1/InstancesClient/update_display_device.php + * * @param UpdateDisplayDeviceInstanceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -1448,6 +1540,8 @@ public function updateDisplayDevice(UpdateDisplayDeviceInstanceRequest $request, * * The async variant is {@see InstancesClient::updateNetworkInterfaceAsync()} . * + * @example samples/V1/InstancesClient/update_network_interface.php + * * @param UpdateNetworkInterfaceInstanceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -1473,6 +1567,8 @@ public function updateNetworkInterface(UpdateNetworkInterfaceInstanceRequest $re * The async variant is {@see InstancesClient::updateShieldedInstanceConfigAsync()} * . * + * @example samples/V1/InstancesClient/update_shielded_instance_config.php + * * @param UpdateShieldedInstanceConfigInstanceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/InstantSnapshotsClient.php b/Compute/src/V1/Client/InstantSnapshotsClient.php index 1b1d58d00da6..6ba1c403bc93 100644 --- a/Compute/src/V1/Client/InstantSnapshotsClient.php +++ b/Compute/src/V1/Client/InstantSnapshotsClient.php @@ -258,6 +258,8 @@ public function __call($method, $args) * * The async variant is {@see InstantSnapshotsClient::aggregatedListAsync()} . * + * @example samples/V1/InstantSnapshotsClient/aggregated_list.php + * * @param AggregatedListInstantSnapshotsRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -282,6 +284,8 @@ public function aggregatedList(AggregatedListInstantSnapshotsRequest $request, a * * The async variant is {@see InstantSnapshotsClient::deleteAsync()} . * + * @example samples/V1/InstantSnapshotsClient/delete.php + * * @param DeleteInstantSnapshotRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -306,6 +310,8 @@ public function delete(DeleteInstantSnapshotRequest $request, array $callOptions * * The async variant is {@see InstantSnapshotsClient::getAsync()} . * + * @example samples/V1/InstantSnapshotsClient/get.php + * * @param GetInstantSnapshotRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -330,6 +336,8 @@ public function get(GetInstantSnapshotRequest $request, array $callOptions = []) * * The async variant is {@see InstantSnapshotsClient::getIamPolicyAsync()} . * + * @example samples/V1/InstantSnapshotsClient/get_iam_policy.php + * * @param GetIamPolicyInstantSnapshotRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -354,6 +362,8 @@ public function getIamPolicy(GetIamPolicyInstantSnapshotRequest $request, array * * The async variant is {@see InstantSnapshotsClient::insertAsync()} . * + * @example samples/V1/InstantSnapshotsClient/insert.php + * * @param InsertInstantSnapshotRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -378,6 +388,8 @@ public function insert(InsertInstantSnapshotRequest $request, array $callOptions * * The async variant is {@see InstantSnapshotsClient::listAsync()} . * + * @example samples/V1/InstantSnapshotsClient/list.php + * * @param ListInstantSnapshotsRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -402,6 +414,8 @@ public function list(ListInstantSnapshotsRequest $request, array $callOptions = * * The async variant is {@see InstantSnapshotsClient::setIamPolicyAsync()} . * + * @example samples/V1/InstantSnapshotsClient/set_iam_policy.php + * * @param SetIamPolicyInstantSnapshotRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -426,6 +440,8 @@ public function setIamPolicy(SetIamPolicyInstantSnapshotRequest $request, array * * The async variant is {@see InstantSnapshotsClient::setLabelsAsync()} . * + * @example samples/V1/InstantSnapshotsClient/set_labels.php + * * @param SetLabelsInstantSnapshotRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -450,6 +466,8 @@ public function setLabels(SetLabelsInstantSnapshotRequest $request, array $callO * * The async variant is {@see InstantSnapshotsClient::testIamPermissionsAsync()} . * + * @example samples/V1/InstantSnapshotsClient/test_iam_permissions.php + * * @param TestIamPermissionsInstantSnapshotRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/InterconnectAttachmentsClient.php b/Compute/src/V1/Client/InterconnectAttachmentsClient.php index 423a79697a58..1e182bbd29a7 100644 --- a/Compute/src/V1/Client/InterconnectAttachmentsClient.php +++ b/Compute/src/V1/Client/InterconnectAttachmentsClient.php @@ -253,6 +253,8 @@ public function __call($method, $args) * The async variant is {@see InterconnectAttachmentsClient::aggregatedListAsync()} * . * + * @example samples/V1/InterconnectAttachmentsClient/aggregated_list.php + * * @param AggregatedListInterconnectAttachmentsRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -277,6 +279,8 @@ public function aggregatedList(AggregatedListInterconnectAttachmentsRequest $req * * The async variant is {@see InterconnectAttachmentsClient::deleteAsync()} . * + * @example samples/V1/InterconnectAttachmentsClient/delete.php + * * @param DeleteInterconnectAttachmentRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -301,6 +305,8 @@ public function delete(DeleteInterconnectAttachmentRequest $request, array $call * * The async variant is {@see InterconnectAttachmentsClient::getAsync()} . * + * @example samples/V1/InterconnectAttachmentsClient/get.php + * * @param GetInterconnectAttachmentRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -325,6 +331,8 @@ public function get(GetInterconnectAttachmentRequest $request, array $callOption * * The async variant is {@see InterconnectAttachmentsClient::insertAsync()} . * + * @example samples/V1/InterconnectAttachmentsClient/insert.php + * * @param InsertInterconnectAttachmentRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -349,6 +357,8 @@ public function insert(InsertInterconnectAttachmentRequest $request, array $call * * The async variant is {@see InterconnectAttachmentsClient::listAsync()} . * + * @example samples/V1/InterconnectAttachmentsClient/list.php + * * @param ListInterconnectAttachmentsRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -373,6 +383,8 @@ public function list(ListInterconnectAttachmentsRequest $request, array $callOpt * * The async variant is {@see InterconnectAttachmentsClient::patchAsync()} . * + * @example samples/V1/InterconnectAttachmentsClient/patch.php + * * @param PatchInterconnectAttachmentRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -397,6 +409,8 @@ public function patch(PatchInterconnectAttachmentRequest $request, array $callOp * * The async variant is {@see InterconnectAttachmentsClient::setLabelsAsync()} . * + * @example samples/V1/InterconnectAttachmentsClient/set_labels.php + * * @param SetLabelsInterconnectAttachmentRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/InterconnectLocationsClient.php b/Compute/src/V1/Client/InterconnectLocationsClient.php index 16d4c0028103..7cf2bf1aefc3 100644 --- a/Compute/src/V1/Client/InterconnectLocationsClient.php +++ b/Compute/src/V1/Client/InterconnectLocationsClient.php @@ -186,6 +186,8 @@ public function __call($method, $args) * * The async variant is {@see InterconnectLocationsClient::getAsync()} . * + * @example samples/V1/InterconnectLocationsClient/get.php + * * @param GetInterconnectLocationRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -210,6 +212,8 @@ public function get(GetInterconnectLocationRequest $request, array $callOptions * * The async variant is {@see InterconnectLocationsClient::listAsync()} . * + * @example samples/V1/InterconnectLocationsClient/list.php + * * @param ListInterconnectLocationsRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/InterconnectRemoteLocationsClient.php b/Compute/src/V1/Client/InterconnectRemoteLocationsClient.php index db82c039ae12..59f52784e0b8 100644 --- a/Compute/src/V1/Client/InterconnectRemoteLocationsClient.php +++ b/Compute/src/V1/Client/InterconnectRemoteLocationsClient.php @@ -186,6 +186,8 @@ public function __call($method, $args) * * The async variant is {@see InterconnectRemoteLocationsClient::getAsync()} . * + * @example samples/V1/InterconnectRemoteLocationsClient/get.php + * * @param GetInterconnectRemoteLocationRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -210,6 +212,8 @@ public function get(GetInterconnectRemoteLocationRequest $request, array $callOp * * The async variant is {@see InterconnectRemoteLocationsClient::listAsync()} . * + * @example samples/V1/InterconnectRemoteLocationsClient/list.php + * * @param ListInterconnectRemoteLocationsRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/InterconnectsClient.php b/Compute/src/V1/Client/InterconnectsClient.php index d6c56e77c2a1..179ba9481f9d 100644 --- a/Compute/src/V1/Client/InterconnectsClient.php +++ b/Compute/src/V1/Client/InterconnectsClient.php @@ -255,6 +255,8 @@ public function __call($method, $args) * * The async variant is {@see InterconnectsClient::deleteAsync()} . * + * @example samples/V1/InterconnectsClient/delete.php + * * @param DeleteInterconnectRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -279,6 +281,8 @@ public function delete(DeleteInterconnectRequest $request, array $callOptions = * * The async variant is {@see InterconnectsClient::getAsync()} . * + * @example samples/V1/InterconnectsClient/get.php + * * @param GetInterconnectRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -303,6 +307,8 @@ public function get(GetInterconnectRequest $request, array $callOptions = []): I * * The async variant is {@see InterconnectsClient::getDiagnosticsAsync()} . * + * @example samples/V1/InterconnectsClient/get_diagnostics.php + * * @param GetDiagnosticsInterconnectRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -327,6 +333,8 @@ public function getDiagnostics(GetDiagnosticsInterconnectRequest $request, array * * The async variant is {@see InterconnectsClient::getMacsecConfigAsync()} . * + * @example samples/V1/InterconnectsClient/get_macsec_config.php + * * @param GetMacsecConfigInterconnectRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -351,6 +359,8 @@ public function getMacsecConfig(GetMacsecConfigInterconnectRequest $request, arr * * The async variant is {@see InterconnectsClient::insertAsync()} . * + * @example samples/V1/InterconnectsClient/insert.php + * * @param InsertInterconnectRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -375,6 +385,8 @@ public function insert(InsertInterconnectRequest $request, array $callOptions = * * The async variant is {@see InterconnectsClient::listAsync()} . * + * @example samples/V1/InterconnectsClient/list.php + * * @param ListInterconnectsRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -399,6 +411,8 @@ public function list(ListInterconnectsRequest $request, array $callOptions = []) * * The async variant is {@see InterconnectsClient::patchAsync()} . * + * @example samples/V1/InterconnectsClient/patch.php + * * @param PatchInterconnectRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -423,6 +437,8 @@ public function patch(PatchInterconnectRequest $request, array $callOptions = [] * * The async variant is {@see InterconnectsClient::setLabelsAsync()} . * + * @example samples/V1/InterconnectsClient/set_labels.php + * * @param SetLabelsInterconnectRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/LicenseCodesClient.php b/Compute/src/V1/Client/LicenseCodesClient.php index 5b729bc52cc4..0fd73ad29ea2 100644 --- a/Compute/src/V1/Client/LicenseCodesClient.php +++ b/Compute/src/V1/Client/LicenseCodesClient.php @@ -186,6 +186,8 @@ public function __call($method, $args) * * The async variant is {@see LicenseCodesClient::getAsync()} . * + * @example samples/V1/LicenseCodesClient/get.php + * * @param GetLicenseCodeRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -210,6 +212,8 @@ public function get(GetLicenseCodeRequest $request, array $callOptions = []): Li * * The async variant is {@see LicenseCodesClient::testIamPermissionsAsync()} . * + * @example samples/V1/LicenseCodesClient/test_iam_permissions.php + * * @param TestIamPermissionsLicenseCodeRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/LicensesClient.php b/Compute/src/V1/Client/LicensesClient.php index f728af1be423..1b164b913dfb 100644 --- a/Compute/src/V1/Client/LicensesClient.php +++ b/Compute/src/V1/Client/LicensesClient.php @@ -253,6 +253,8 @@ public function __call($method, $args) * * The async variant is {@see LicensesClient::deleteAsync()} . * + * @example samples/V1/LicensesClient/delete.php + * * @param DeleteLicenseRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -277,6 +279,8 @@ public function delete(DeleteLicenseRequest $request, array $callOptions = []): * * The async variant is {@see LicensesClient::getAsync()} . * + * @example samples/V1/LicensesClient/get.php + * * @param GetLicenseRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -301,6 +305,8 @@ public function get(GetLicenseRequest $request, array $callOptions = []): Licens * * The async variant is {@see LicensesClient::getIamPolicyAsync()} . * + * @example samples/V1/LicensesClient/get_iam_policy.php + * * @param GetIamPolicyLicenseRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -325,6 +331,8 @@ public function getIamPolicy(GetIamPolicyLicenseRequest $request, array $callOpt * * The async variant is {@see LicensesClient::insertAsync()} . * + * @example samples/V1/LicensesClient/insert.php + * * @param InsertLicenseRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -349,6 +357,8 @@ public function insert(InsertLicenseRequest $request, array $callOptions = []): * * The async variant is {@see LicensesClient::listAsync()} . * + * @example samples/V1/LicensesClient/list.php + * * @param ListLicensesRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -373,6 +383,8 @@ public function list(ListLicensesRequest $request, array $callOptions = []): Pag * * The async variant is {@see LicensesClient::setIamPolicyAsync()} . * + * @example samples/V1/LicensesClient/set_iam_policy.php + * * @param SetIamPolicyLicenseRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -397,6 +409,8 @@ public function setIamPolicy(SetIamPolicyLicenseRequest $request, array $callOpt * * The async variant is {@see LicensesClient::testIamPermissionsAsync()} . * + * @example samples/V1/LicensesClient/test_iam_permissions.php + * * @param TestIamPermissionsLicenseRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/MachineImagesClient.php b/Compute/src/V1/Client/MachineImagesClient.php index 5e54a2a7fc79..a9447dfbc326 100644 --- a/Compute/src/V1/Client/MachineImagesClient.php +++ b/Compute/src/V1/Client/MachineImagesClient.php @@ -253,6 +253,8 @@ public function __call($method, $args) * * The async variant is {@see MachineImagesClient::deleteAsync()} . * + * @example samples/V1/MachineImagesClient/delete.php + * * @param DeleteMachineImageRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -277,6 +279,8 @@ public function delete(DeleteMachineImageRequest $request, array $callOptions = * * The async variant is {@see MachineImagesClient::getAsync()} . * + * @example samples/V1/MachineImagesClient/get.php + * * @param GetMachineImageRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -301,6 +305,8 @@ public function get(GetMachineImageRequest $request, array $callOptions = []): M * * The async variant is {@see MachineImagesClient::getIamPolicyAsync()} . * + * @example samples/V1/MachineImagesClient/get_iam_policy.php + * * @param GetIamPolicyMachineImageRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -325,6 +331,8 @@ public function getIamPolicy(GetIamPolicyMachineImageRequest $request, array $ca * * The async variant is {@see MachineImagesClient::insertAsync()} . * + * @example samples/V1/MachineImagesClient/insert.php + * * @param InsertMachineImageRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -349,6 +357,8 @@ public function insert(InsertMachineImageRequest $request, array $callOptions = * * The async variant is {@see MachineImagesClient::listAsync()} . * + * @example samples/V1/MachineImagesClient/list.php + * * @param ListMachineImagesRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -373,6 +383,8 @@ public function list(ListMachineImagesRequest $request, array $callOptions = []) * * The async variant is {@see MachineImagesClient::setIamPolicyAsync()} . * + * @example samples/V1/MachineImagesClient/set_iam_policy.php + * * @param SetIamPolicyMachineImageRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -397,6 +409,8 @@ public function setIamPolicy(SetIamPolicyMachineImageRequest $request, array $ca * * The async variant is {@see MachineImagesClient::testIamPermissionsAsync()} . * + * @example samples/V1/MachineImagesClient/test_iam_permissions.php + * * @param TestIamPermissionsMachineImageRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/MachineTypesClient.php b/Compute/src/V1/Client/MachineTypesClient.php index 1cda06c87f92..188cd56f54e5 100644 --- a/Compute/src/V1/Client/MachineTypesClient.php +++ b/Compute/src/V1/Client/MachineTypesClient.php @@ -188,6 +188,8 @@ public function __call($method, $args) * * The async variant is {@see MachineTypesClient::aggregatedListAsync()} . * + * @example samples/V1/MachineTypesClient/aggregated_list.php + * * @param AggregatedListMachineTypesRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -212,6 +214,8 @@ public function aggregatedList(AggregatedListMachineTypesRequest $request, array * * The async variant is {@see MachineTypesClient::getAsync()} . * + * @example samples/V1/MachineTypesClient/get.php + * * @param GetMachineTypeRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -236,6 +240,8 @@ public function get(GetMachineTypeRequest $request, array $callOptions = []): Ma * * The async variant is {@see MachineTypesClient::listAsync()} . * + * @example samples/V1/MachineTypesClient/list.php + * * @param ListMachineTypesRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/NetworkAttachmentsClient.php b/Compute/src/V1/Client/NetworkAttachmentsClient.php index d1ff89b3e5a1..91b23cf1cb49 100644 --- a/Compute/src/V1/Client/NetworkAttachmentsClient.php +++ b/Compute/src/V1/Client/NetworkAttachmentsClient.php @@ -258,6 +258,8 @@ public function __call($method, $args) * * The async variant is {@see NetworkAttachmentsClient::aggregatedListAsync()} . * + * @example samples/V1/NetworkAttachmentsClient/aggregated_list.php + * * @param AggregatedListNetworkAttachmentsRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -282,6 +284,8 @@ public function aggregatedList(AggregatedListNetworkAttachmentsRequest $request, * * The async variant is {@see NetworkAttachmentsClient::deleteAsync()} . * + * @example samples/V1/NetworkAttachmentsClient/delete.php + * * @param DeleteNetworkAttachmentRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -306,6 +310,8 @@ public function delete(DeleteNetworkAttachmentRequest $request, array $callOptio * * The async variant is {@see NetworkAttachmentsClient::getAsync()} . * + * @example samples/V1/NetworkAttachmentsClient/get.php + * * @param GetNetworkAttachmentRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -330,6 +336,8 @@ public function get(GetNetworkAttachmentRequest $request, array $callOptions = [ * * The async variant is {@see NetworkAttachmentsClient::getIamPolicyAsync()} . * + * @example samples/V1/NetworkAttachmentsClient/get_iam_policy.php + * * @param GetIamPolicyNetworkAttachmentRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -354,6 +362,8 @@ public function getIamPolicy(GetIamPolicyNetworkAttachmentRequest $request, arra * * The async variant is {@see NetworkAttachmentsClient::insertAsync()} . * + * @example samples/V1/NetworkAttachmentsClient/insert.php + * * @param InsertNetworkAttachmentRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -378,6 +388,8 @@ public function insert(InsertNetworkAttachmentRequest $request, array $callOptio * * The async variant is {@see NetworkAttachmentsClient::listAsync()} . * + * @example samples/V1/NetworkAttachmentsClient/list.php + * * @param ListNetworkAttachmentsRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -402,6 +414,8 @@ public function list(ListNetworkAttachmentsRequest $request, array $callOptions * * The async variant is {@see NetworkAttachmentsClient::patchAsync()} . * + * @example samples/V1/NetworkAttachmentsClient/patch.php + * * @param PatchNetworkAttachmentRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -426,6 +440,8 @@ public function patch(PatchNetworkAttachmentRequest $request, array $callOptions * * The async variant is {@see NetworkAttachmentsClient::setIamPolicyAsync()} . * + * @example samples/V1/NetworkAttachmentsClient/set_iam_policy.php + * * @param SetIamPolicyNetworkAttachmentRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -451,6 +467,8 @@ public function setIamPolicy(SetIamPolicyNetworkAttachmentRequest $request, arra * The async variant is {@see NetworkAttachmentsClient::testIamPermissionsAsync()} * . * + * @example samples/V1/NetworkAttachmentsClient/test_iam_permissions.php + * * @param TestIamPermissionsNetworkAttachmentRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/NetworkEdgeSecurityServicesClient.php b/Compute/src/V1/Client/NetworkEdgeSecurityServicesClient.php index 0f23cf59f1cd..4dfd1a479114 100644 --- a/Compute/src/V1/Client/NetworkEdgeSecurityServicesClient.php +++ b/Compute/src/V1/Client/NetworkEdgeSecurityServicesClient.php @@ -249,6 +249,8 @@ public function __call($method, $args) * The async variant is * {@see NetworkEdgeSecurityServicesClient::aggregatedListAsync()} . * + * @example samples/V1/NetworkEdgeSecurityServicesClient/aggregated_list.php + * * @param AggregatedListNetworkEdgeSecurityServicesRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -273,6 +275,8 @@ public function aggregatedList(AggregatedListNetworkEdgeSecurityServicesRequest * * The async variant is {@see NetworkEdgeSecurityServicesClient::deleteAsync()} . * + * @example samples/V1/NetworkEdgeSecurityServicesClient/delete.php + * * @param DeleteNetworkEdgeSecurityServiceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -297,6 +301,8 @@ public function delete(DeleteNetworkEdgeSecurityServiceRequest $request, array $ * * The async variant is {@see NetworkEdgeSecurityServicesClient::getAsync()} . * + * @example samples/V1/NetworkEdgeSecurityServicesClient/get.php + * * @param GetNetworkEdgeSecurityServiceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -321,6 +327,8 @@ public function get(GetNetworkEdgeSecurityServiceRequest $request, array $callOp * * The async variant is {@see NetworkEdgeSecurityServicesClient::insertAsync()} . * + * @example samples/V1/NetworkEdgeSecurityServicesClient/insert.php + * * @param InsertNetworkEdgeSecurityServiceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -345,6 +353,8 @@ public function insert(InsertNetworkEdgeSecurityServiceRequest $request, array $ * * The async variant is {@see NetworkEdgeSecurityServicesClient::patchAsync()} . * + * @example samples/V1/NetworkEdgeSecurityServicesClient/patch.php + * * @param PatchNetworkEdgeSecurityServiceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/NetworkEndpointGroupsClient.php b/Compute/src/V1/Client/NetworkEndpointGroupsClient.php index 77cb1e2b1d74..61f61149401b 100644 --- a/Compute/src/V1/Client/NetworkEndpointGroupsClient.php +++ b/Compute/src/V1/Client/NetworkEndpointGroupsClient.php @@ -257,6 +257,8 @@ public function __call($method, $args) * * The async variant is {@see NetworkEndpointGroupsClient::aggregatedListAsync()} . * + * @example samples/V1/NetworkEndpointGroupsClient/aggregated_list.php + * * @param AggregatedListNetworkEndpointGroupsRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -282,6 +284,8 @@ public function aggregatedList(AggregatedListNetworkEndpointGroupsRequest $reque * The async variant is * {@see NetworkEndpointGroupsClient::attachNetworkEndpointsAsync()} . * + * @example samples/V1/NetworkEndpointGroupsClient/attach_network_endpoints.php + * * @param AttachNetworkEndpointsNetworkEndpointGroupRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -306,6 +310,8 @@ public function attachNetworkEndpoints(AttachNetworkEndpointsNetworkEndpointGrou * * The async variant is {@see NetworkEndpointGroupsClient::deleteAsync()} . * + * @example samples/V1/NetworkEndpointGroupsClient/delete.php + * * @param DeleteNetworkEndpointGroupRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -331,6 +337,8 @@ public function delete(DeleteNetworkEndpointGroupRequest $request, array $callOp * The async variant is * {@see NetworkEndpointGroupsClient::detachNetworkEndpointsAsync()} . * + * @example samples/V1/NetworkEndpointGroupsClient/detach_network_endpoints.php + * * @param DetachNetworkEndpointsNetworkEndpointGroupRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -355,6 +363,8 @@ public function detachNetworkEndpoints(DetachNetworkEndpointsNetworkEndpointGrou * * The async variant is {@see NetworkEndpointGroupsClient::getAsync()} . * + * @example samples/V1/NetworkEndpointGroupsClient/get.php + * * @param GetNetworkEndpointGroupRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -379,6 +389,8 @@ public function get(GetNetworkEndpointGroupRequest $request, array $callOptions * * The async variant is {@see NetworkEndpointGroupsClient::insertAsync()} . * + * @example samples/V1/NetworkEndpointGroupsClient/insert.php + * * @param InsertNetworkEndpointGroupRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -403,6 +415,8 @@ public function insert(InsertNetworkEndpointGroupRequest $request, array $callOp * * The async variant is {@see NetworkEndpointGroupsClient::listAsync()} . * + * @example samples/V1/NetworkEndpointGroupsClient/list.php + * * @param ListNetworkEndpointGroupsRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -428,6 +442,8 @@ public function list(ListNetworkEndpointGroupsRequest $request, array $callOptio * The async variant is * {@see NetworkEndpointGroupsClient::listNetworkEndpointsAsync()} . * + * @example samples/V1/NetworkEndpointGroupsClient/list_network_endpoints.php + * * @param ListNetworkEndpointsNetworkEndpointGroupsRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -453,6 +469,8 @@ public function listNetworkEndpoints(ListNetworkEndpointsNetworkEndpointGroupsRe * The async variant is * {@see NetworkEndpointGroupsClient::testIamPermissionsAsync()} . * + * @example samples/V1/NetworkEndpointGroupsClient/test_iam_permissions.php + * * @param TestIamPermissionsNetworkEndpointGroupRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/NetworkFirewallPoliciesClient.php b/Compute/src/V1/Client/NetworkFirewallPoliciesClient.php index c00454359c53..cef6b6a58aca 100644 --- a/Compute/src/V1/Client/NetworkFirewallPoliciesClient.php +++ b/Compute/src/V1/Client/NetworkFirewallPoliciesClient.php @@ -274,6 +274,8 @@ public function __call($method, $args) * The async variant is {@see NetworkFirewallPoliciesClient::addAssociationAsync()} * . * + * @example samples/V1/NetworkFirewallPoliciesClient/add_association.php + * * @param AddAssociationNetworkFirewallPolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -298,6 +300,8 @@ public function addAssociation(AddAssociationNetworkFirewallPolicyRequest $reque * * The async variant is {@see NetworkFirewallPoliciesClient::addRuleAsync()} . * + * @example samples/V1/NetworkFirewallPoliciesClient/add_rule.php + * * @param AddRuleNetworkFirewallPolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -322,6 +326,8 @@ public function addRule(AddRuleNetworkFirewallPolicyRequest $request, array $cal * * The async variant is {@see NetworkFirewallPoliciesClient::cloneRulesAsync()} . * + * @example samples/V1/NetworkFirewallPoliciesClient/clone_rules.php + * * @param CloneRulesNetworkFirewallPolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -346,6 +352,8 @@ public function cloneRules(CloneRulesNetworkFirewallPolicyRequest $request, arra * * The async variant is {@see NetworkFirewallPoliciesClient::deleteAsync()} . * + * @example samples/V1/NetworkFirewallPoliciesClient/delete.php + * * @param DeleteNetworkFirewallPolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -370,6 +378,8 @@ public function delete(DeleteNetworkFirewallPolicyRequest $request, array $callO * * The async variant is {@see NetworkFirewallPoliciesClient::getAsync()} . * + * @example samples/V1/NetworkFirewallPoliciesClient/get.php + * * @param GetNetworkFirewallPolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -395,6 +405,8 @@ public function get(GetNetworkFirewallPolicyRequest $request, array $callOptions * The async variant is {@see NetworkFirewallPoliciesClient::getAssociationAsync()} * . * + * @example samples/V1/NetworkFirewallPoliciesClient/get_association.php + * * @param GetAssociationNetworkFirewallPolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -419,6 +431,8 @@ public function getAssociation(GetAssociationNetworkFirewallPolicyRequest $reque * * The async variant is {@see NetworkFirewallPoliciesClient::getIamPolicyAsync()} . * + * @example samples/V1/NetworkFirewallPoliciesClient/get_iam_policy.php + * * @param GetIamPolicyNetworkFirewallPolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -443,6 +457,8 @@ public function getIamPolicy(GetIamPolicyNetworkFirewallPolicyRequest $request, * * The async variant is {@see NetworkFirewallPoliciesClient::getRuleAsync()} . * + * @example samples/V1/NetworkFirewallPoliciesClient/get_rule.php + * * @param GetRuleNetworkFirewallPolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -467,6 +483,8 @@ public function getRule(GetRuleNetworkFirewallPolicyRequest $request, array $cal * * The async variant is {@see NetworkFirewallPoliciesClient::insertAsync()} . * + * @example samples/V1/NetworkFirewallPoliciesClient/insert.php + * * @param InsertNetworkFirewallPolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -491,6 +509,8 @@ public function insert(InsertNetworkFirewallPolicyRequest $request, array $callO * * The async variant is {@see NetworkFirewallPoliciesClient::listAsync()} . * + * @example samples/V1/NetworkFirewallPoliciesClient/list.php + * * @param ListNetworkFirewallPoliciesRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -515,6 +535,8 @@ public function list(ListNetworkFirewallPoliciesRequest $request, array $callOpt * * The async variant is {@see NetworkFirewallPoliciesClient::patchAsync()} . * + * @example samples/V1/NetworkFirewallPoliciesClient/patch.php + * * @param PatchNetworkFirewallPolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -539,6 +561,8 @@ public function patch(PatchNetworkFirewallPolicyRequest $request, array $callOpt * * The async variant is {@see NetworkFirewallPoliciesClient::patchRuleAsync()} . * + * @example samples/V1/NetworkFirewallPoliciesClient/patch_rule.php + * * @param PatchRuleNetworkFirewallPolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -564,6 +588,8 @@ public function patchRule(PatchRuleNetworkFirewallPolicyRequest $request, array * The async variant is * {@see NetworkFirewallPoliciesClient::removeAssociationAsync()} . * + * @example samples/V1/NetworkFirewallPoliciesClient/remove_association.php + * * @param RemoveAssociationNetworkFirewallPolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -588,6 +614,8 @@ public function removeAssociation(RemoveAssociationNetworkFirewallPolicyRequest * * The async variant is {@see NetworkFirewallPoliciesClient::removeRuleAsync()} . * + * @example samples/V1/NetworkFirewallPoliciesClient/remove_rule.php + * * @param RemoveRuleNetworkFirewallPolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -612,6 +640,8 @@ public function removeRule(RemoveRuleNetworkFirewallPolicyRequest $request, arra * * The async variant is {@see NetworkFirewallPoliciesClient::setIamPolicyAsync()} . * + * @example samples/V1/NetworkFirewallPoliciesClient/set_iam_policy.php + * * @param SetIamPolicyNetworkFirewallPolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -637,6 +667,8 @@ public function setIamPolicy(SetIamPolicyNetworkFirewallPolicyRequest $request, * The async variant is * {@see NetworkFirewallPoliciesClient::testIamPermissionsAsync()} . * + * @example samples/V1/NetworkFirewallPoliciesClient/test_iam_permissions.php + * * @param TestIamPermissionsNetworkFirewallPolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/NetworkProfilesClient.php b/Compute/src/V1/Client/NetworkProfilesClient.php index b4fea48c9dc5..676dc131107d 100644 --- a/Compute/src/V1/Client/NetworkProfilesClient.php +++ b/Compute/src/V1/Client/NetworkProfilesClient.php @@ -186,6 +186,8 @@ public function __call($method, $args) * * The async variant is {@see NetworkProfilesClient::getAsync()} . * + * @example samples/V1/NetworkProfilesClient/get.php + * * @param GetNetworkProfileRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -210,6 +212,8 @@ public function get(GetNetworkProfileRequest $request, array $callOptions = []): * * The async variant is {@see NetworkProfilesClient::listAsync()} . * + * @example samples/V1/NetworkProfilesClient/list.php + * * @param ListNetworkProfilesRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/NetworksClient.php b/Compute/src/V1/Client/NetworksClient.php index e6b1fe0559ad..8ed9fc69e2c5 100644 --- a/Compute/src/V1/Client/NetworksClient.php +++ b/Compute/src/V1/Client/NetworksClient.php @@ -260,6 +260,8 @@ public function __call($method, $args) * * The async variant is {@see NetworksClient::addPeeringAsync()} . * + * @example samples/V1/NetworksClient/add_peering.php + * * @param AddPeeringNetworkRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -284,6 +286,8 @@ public function addPeering(AddPeeringNetworkRequest $request, array $callOptions * * The async variant is {@see NetworksClient::deleteAsync()} . * + * @example samples/V1/NetworksClient/delete.php + * * @param DeleteNetworkRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -308,6 +312,8 @@ public function delete(DeleteNetworkRequest $request, array $callOptions = []): * * The async variant is {@see NetworksClient::getAsync()} . * + * @example samples/V1/NetworksClient/get.php + * * @param GetNetworkRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -332,6 +338,8 @@ public function get(GetNetworkRequest $request, array $callOptions = []): Networ * * The async variant is {@see NetworksClient::getEffectiveFirewallsAsync()} . * + * @example samples/V1/NetworksClient/get_effective_firewalls.php + * * @param GetEffectiveFirewallsNetworkRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -356,6 +364,8 @@ public function getEffectiveFirewalls(GetEffectiveFirewallsNetworkRequest $reque * * The async variant is {@see NetworksClient::insertAsync()} . * + * @example samples/V1/NetworksClient/insert.php + * * @param InsertNetworkRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -380,6 +390,8 @@ public function insert(InsertNetworkRequest $request, array $callOptions = []): * * The async variant is {@see NetworksClient::listAsync()} . * + * @example samples/V1/NetworksClient/list.php + * * @param ListNetworksRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -404,6 +416,8 @@ public function list(ListNetworksRequest $request, array $callOptions = []): Pag * * The async variant is {@see NetworksClient::listPeeringRoutesAsync()} . * + * @example samples/V1/NetworksClient/list_peering_routes.php + * * @param ListPeeringRoutesNetworksRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -428,6 +442,8 @@ public function listPeeringRoutes(ListPeeringRoutesNetworksRequest $request, arr * * The async variant is {@see NetworksClient::patchAsync()} . * + * @example samples/V1/NetworksClient/patch.php + * * @param PatchNetworkRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -452,6 +468,8 @@ public function patch(PatchNetworkRequest $request, array $callOptions = []): Op * * The async variant is {@see NetworksClient::removePeeringAsync()} . * + * @example samples/V1/NetworksClient/remove_peering.php + * * @param RemovePeeringNetworkRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -476,6 +494,8 @@ public function removePeering(RemovePeeringNetworkRequest $request, array $callO * * The async variant is {@see NetworksClient::switchToCustomModeAsync()} . * + * @example samples/V1/NetworksClient/switch_to_custom_mode.php + * * @param SwitchToCustomModeNetworkRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -500,6 +520,8 @@ public function switchToCustomMode(SwitchToCustomModeNetworkRequest $request, ar * * The async variant is {@see NetworksClient::updatePeeringAsync()} . * + * @example samples/V1/NetworksClient/update_peering.php + * * @param UpdatePeeringNetworkRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/NodeGroupsClient.php b/Compute/src/V1/Client/NodeGroupsClient.php index f518824e3e81..13f2c045a646 100644 --- a/Compute/src/V1/Client/NodeGroupsClient.php +++ b/Compute/src/V1/Client/NodeGroupsClient.php @@ -270,6 +270,8 @@ public function __call($method, $args) * * The async variant is {@see NodeGroupsClient::addNodesAsync()} . * + * @example samples/V1/NodeGroupsClient/add_nodes.php + * * @param AddNodesNodeGroupRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -294,6 +296,8 @@ public function addNodes(AddNodesNodeGroupRequest $request, array $callOptions = * * The async variant is {@see NodeGroupsClient::aggregatedListAsync()} . * + * @example samples/V1/NodeGroupsClient/aggregated_list.php + * * @param AggregatedListNodeGroupsRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -318,6 +322,8 @@ public function aggregatedList(AggregatedListNodeGroupsRequest $request, array $ * * The async variant is {@see NodeGroupsClient::deleteAsync()} . * + * @example samples/V1/NodeGroupsClient/delete.php + * * @param DeleteNodeGroupRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -342,6 +348,8 @@ public function delete(DeleteNodeGroupRequest $request, array $callOptions = []) * * The async variant is {@see NodeGroupsClient::deleteNodesAsync()} . * + * @example samples/V1/NodeGroupsClient/delete_nodes.php + * * @param DeleteNodesNodeGroupRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -366,6 +374,8 @@ public function deleteNodes(DeleteNodesNodeGroupRequest $request, array $callOpt * * The async variant is {@see NodeGroupsClient::getAsync()} . * + * @example samples/V1/NodeGroupsClient/get.php + * * @param GetNodeGroupRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -390,6 +400,8 @@ public function get(GetNodeGroupRequest $request, array $callOptions = []): Node * * The async variant is {@see NodeGroupsClient::getIamPolicyAsync()} . * + * @example samples/V1/NodeGroupsClient/get_iam_policy.php + * * @param GetIamPolicyNodeGroupRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -414,6 +426,8 @@ public function getIamPolicy(GetIamPolicyNodeGroupRequest $request, array $callO * * The async variant is {@see NodeGroupsClient::insertAsync()} . * + * @example samples/V1/NodeGroupsClient/insert.php + * * @param InsertNodeGroupRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -438,6 +452,8 @@ public function insert(InsertNodeGroupRequest $request, array $callOptions = []) * * The async variant is {@see NodeGroupsClient::listAsync()} . * + * @example samples/V1/NodeGroupsClient/list.php + * * @param ListNodeGroupsRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -462,6 +478,8 @@ public function list(ListNodeGroupsRequest $request, array $callOptions = []): P * * The async variant is {@see NodeGroupsClient::listNodesAsync()} . * + * @example samples/V1/NodeGroupsClient/list_nodes.php + * * @param ListNodesNodeGroupsRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -486,6 +504,8 @@ public function listNodes(ListNodesNodeGroupsRequest $request, array $callOption * * The async variant is {@see NodeGroupsClient::patchAsync()} . * + * @example samples/V1/NodeGroupsClient/patch.php + * * @param PatchNodeGroupRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -510,6 +530,8 @@ public function patch(PatchNodeGroupRequest $request, array $callOptions = []): * * The async variant is {@see NodeGroupsClient::performMaintenanceAsync()} . * + * @example samples/V1/NodeGroupsClient/perform_maintenance.php + * * @param PerformMaintenanceNodeGroupRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -534,6 +556,8 @@ public function performMaintenance(PerformMaintenanceNodeGroupRequest $request, * * The async variant is {@see NodeGroupsClient::setIamPolicyAsync()} . * + * @example samples/V1/NodeGroupsClient/set_iam_policy.php + * * @param SetIamPolicyNodeGroupRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -558,6 +582,8 @@ public function setIamPolicy(SetIamPolicyNodeGroupRequest $request, array $callO * * The async variant is {@see NodeGroupsClient::setNodeTemplateAsync()} . * + * @example samples/V1/NodeGroupsClient/set_node_template.php + * * @param SetNodeTemplateNodeGroupRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -582,6 +608,8 @@ public function setNodeTemplate(SetNodeTemplateNodeGroupRequest $request, array * * The async variant is {@see NodeGroupsClient::simulateMaintenanceEventAsync()} . * + * @example samples/V1/NodeGroupsClient/simulate_maintenance_event.php + * * @param SimulateMaintenanceEventNodeGroupRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -606,6 +634,8 @@ public function simulateMaintenanceEvent(SimulateMaintenanceEventNodeGroupReques * * The async variant is {@see NodeGroupsClient::testIamPermissionsAsync()} . * + * @example samples/V1/NodeGroupsClient/test_iam_permissions.php + * * @param TestIamPermissionsNodeGroupRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/NodeTemplatesClient.php b/Compute/src/V1/Client/NodeTemplatesClient.php index 35c1b2c44093..bd5690fc2c16 100644 --- a/Compute/src/V1/Client/NodeTemplatesClient.php +++ b/Compute/src/V1/Client/NodeTemplatesClient.php @@ -256,6 +256,8 @@ public function __call($method, $args) * * The async variant is {@see NodeTemplatesClient::aggregatedListAsync()} . * + * @example samples/V1/NodeTemplatesClient/aggregated_list.php + * * @param AggregatedListNodeTemplatesRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -280,6 +282,8 @@ public function aggregatedList(AggregatedListNodeTemplatesRequest $request, arra * * The async variant is {@see NodeTemplatesClient::deleteAsync()} . * + * @example samples/V1/NodeTemplatesClient/delete.php + * * @param DeleteNodeTemplateRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -304,6 +308,8 @@ public function delete(DeleteNodeTemplateRequest $request, array $callOptions = * * The async variant is {@see NodeTemplatesClient::getAsync()} . * + * @example samples/V1/NodeTemplatesClient/get.php + * * @param GetNodeTemplateRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -328,6 +334,8 @@ public function get(GetNodeTemplateRequest $request, array $callOptions = []): N * * The async variant is {@see NodeTemplatesClient::getIamPolicyAsync()} . * + * @example samples/V1/NodeTemplatesClient/get_iam_policy.php + * * @param GetIamPolicyNodeTemplateRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -352,6 +360,8 @@ public function getIamPolicy(GetIamPolicyNodeTemplateRequest $request, array $ca * * The async variant is {@see NodeTemplatesClient::insertAsync()} . * + * @example samples/V1/NodeTemplatesClient/insert.php + * * @param InsertNodeTemplateRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -376,6 +386,8 @@ public function insert(InsertNodeTemplateRequest $request, array $callOptions = * * The async variant is {@see NodeTemplatesClient::listAsync()} . * + * @example samples/V1/NodeTemplatesClient/list.php + * * @param ListNodeTemplatesRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -400,6 +412,8 @@ public function list(ListNodeTemplatesRequest $request, array $callOptions = []) * * The async variant is {@see NodeTemplatesClient::setIamPolicyAsync()} . * + * @example samples/V1/NodeTemplatesClient/set_iam_policy.php + * * @param SetIamPolicyNodeTemplateRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -424,6 +438,8 @@ public function setIamPolicy(SetIamPolicyNodeTemplateRequest $request, array $ca * * The async variant is {@see NodeTemplatesClient::testIamPermissionsAsync()} . * + * @example samples/V1/NodeTemplatesClient/test_iam_permissions.php + * * @param TestIamPermissionsNodeTemplateRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/NodeTypesClient.php b/Compute/src/V1/Client/NodeTypesClient.php index 8ab686407587..8f7a3727d5ce 100644 --- a/Compute/src/V1/Client/NodeTypesClient.php +++ b/Compute/src/V1/Client/NodeTypesClient.php @@ -188,6 +188,8 @@ public function __call($method, $args) * * The async variant is {@see NodeTypesClient::aggregatedListAsync()} . * + * @example samples/V1/NodeTypesClient/aggregated_list.php + * * @param AggregatedListNodeTypesRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -212,6 +214,8 @@ public function aggregatedList(AggregatedListNodeTypesRequest $request, array $c * * The async variant is {@see NodeTypesClient::getAsync()} . * + * @example samples/V1/NodeTypesClient/get.php + * * @param GetNodeTypeRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -236,6 +240,8 @@ public function get(GetNodeTypeRequest $request, array $callOptions = []): NodeT * * The async variant is {@see NodeTypesClient::listAsync()} . * + * @example samples/V1/NodeTypesClient/list.php + * * @param ListNodeTypesRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/PacketMirroringsClient.php b/Compute/src/V1/Client/PacketMirroringsClient.php index 159f481c8cce..d2c4231d45b8 100644 --- a/Compute/src/V1/Client/PacketMirroringsClient.php +++ b/Compute/src/V1/Client/PacketMirroringsClient.php @@ -253,6 +253,8 @@ public function __call($method, $args) * * The async variant is {@see PacketMirroringsClient::aggregatedListAsync()} . * + * @example samples/V1/PacketMirroringsClient/aggregated_list.php + * * @param AggregatedListPacketMirroringsRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -277,6 +279,8 @@ public function aggregatedList(AggregatedListPacketMirroringsRequest $request, a * * The async variant is {@see PacketMirroringsClient::deleteAsync()} . * + * @example samples/V1/PacketMirroringsClient/delete.php + * * @param DeletePacketMirroringRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -301,6 +305,8 @@ public function delete(DeletePacketMirroringRequest $request, array $callOptions * * The async variant is {@see PacketMirroringsClient::getAsync()} . * + * @example samples/V1/PacketMirroringsClient/get.php + * * @param GetPacketMirroringRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -325,6 +331,8 @@ public function get(GetPacketMirroringRequest $request, array $callOptions = []) * * The async variant is {@see PacketMirroringsClient::insertAsync()} . * + * @example samples/V1/PacketMirroringsClient/insert.php + * * @param InsertPacketMirroringRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -349,6 +357,8 @@ public function insert(InsertPacketMirroringRequest $request, array $callOptions * * The async variant is {@see PacketMirroringsClient::listAsync()} . * + * @example samples/V1/PacketMirroringsClient/list.php + * * @param ListPacketMirroringsRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -373,6 +383,8 @@ public function list(ListPacketMirroringsRequest $request, array $callOptions = * * The async variant is {@see PacketMirroringsClient::patchAsync()} . * + * @example samples/V1/PacketMirroringsClient/patch.php + * * @param PatchPacketMirroringRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -397,6 +409,8 @@ public function patch(PatchPacketMirroringRequest $request, array $callOptions = * * The async variant is {@see PacketMirroringsClient::testIamPermissionsAsync()} . * + * @example samples/V1/PacketMirroringsClient/test_iam_permissions.php + * * @param TestIamPermissionsPacketMirroringRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/ProjectsClient.php b/Compute/src/V1/Client/ProjectsClient.php index 71bd41128f70..61b702084f2c 100644 --- a/Compute/src/V1/Client/ProjectsClient.php +++ b/Compute/src/V1/Client/ProjectsClient.php @@ -265,6 +265,8 @@ public function __call($method, $args) * * The async variant is {@see ProjectsClient::disableXpnHostAsync()} . * + * @example samples/V1/ProjectsClient/disable_xpn_host.php + * * @param DisableXpnHostProjectRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -289,6 +291,8 @@ public function disableXpnHost(DisableXpnHostProjectRequest $request, array $cal * * The async variant is {@see ProjectsClient::disableXpnResourceAsync()} . * + * @example samples/V1/ProjectsClient/disable_xpn_resource.php + * * @param DisableXpnResourceProjectRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -313,6 +317,8 @@ public function disableXpnResource(DisableXpnResourceProjectRequest $request, ar * * The async variant is {@see ProjectsClient::enableXpnHostAsync()} . * + * @example samples/V1/ProjectsClient/enable_xpn_host.php + * * @param EnableXpnHostProjectRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -337,6 +343,8 @@ public function enableXpnHost(EnableXpnHostProjectRequest $request, array $callO * * The async variant is {@see ProjectsClient::enableXpnResourceAsync()} . * + * @example samples/V1/ProjectsClient/enable_xpn_resource.php + * * @param EnableXpnResourceProjectRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -361,6 +369,8 @@ public function enableXpnResource(EnableXpnResourceProjectRequest $request, arra * * The async variant is {@see ProjectsClient::getAsync()} . * + * @example samples/V1/ProjectsClient/get.php + * * @param GetProjectRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -385,6 +395,8 @@ public function get(GetProjectRequest $request, array $callOptions = []): Projec * * The async variant is {@see ProjectsClient::getXpnHostAsync()} . * + * @example samples/V1/ProjectsClient/get_xpn_host.php + * * @param GetXpnHostProjectRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -409,6 +421,8 @@ public function getXpnHost(GetXpnHostProjectRequest $request, array $callOptions * * The async variant is {@see ProjectsClient::getXpnResourcesAsync()} . * + * @example samples/V1/ProjectsClient/get_xpn_resources.php + * * @param GetXpnResourcesProjectsRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -433,6 +447,8 @@ public function getXpnResources(GetXpnResourcesProjectsRequest $request, array $ * * The async variant is {@see ProjectsClient::listXpnHostsAsync()} . * + * @example samples/V1/ProjectsClient/list_xpn_hosts.php + * * @param ListXpnHostsProjectsRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -457,6 +473,8 @@ public function listXpnHosts(ListXpnHostsProjectsRequest $request, array $callOp * * The async variant is {@see ProjectsClient::moveDiskAsync()} . * + * @example samples/V1/ProjectsClient/move_disk.php + * * @param MoveDiskProjectRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -481,6 +499,8 @@ public function moveDisk(MoveDiskProjectRequest $request, array $callOptions = [ * * The async variant is {@see ProjectsClient::moveInstanceAsync()} . * + * @example samples/V1/ProjectsClient/move_instance.php + * * @param MoveInstanceProjectRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -505,6 +525,8 @@ public function moveInstance(MoveInstanceProjectRequest $request, array $callOpt * * The async variant is {@see ProjectsClient::setCloudArmorTierAsync()} . * + * @example samples/V1/ProjectsClient/set_cloud_armor_tier.php + * * @param SetCloudArmorTierProjectRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -529,6 +551,8 @@ public function setCloudArmorTier(SetCloudArmorTierProjectRequest $request, arra * * The async variant is {@see ProjectsClient::setCommonInstanceMetadataAsync()} . * + * @example samples/V1/ProjectsClient/set_common_instance_metadata.php + * * @param SetCommonInstanceMetadataProjectRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -553,6 +577,8 @@ public function setCommonInstanceMetadata(SetCommonInstanceMetadataProjectReques * * The async variant is {@see ProjectsClient::setDefaultNetworkTierAsync()} . * + * @example samples/V1/ProjectsClient/set_default_network_tier.php + * * @param SetDefaultNetworkTierProjectRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -577,6 +603,8 @@ public function setDefaultNetworkTier(SetDefaultNetworkTierProjectRequest $reque * * The async variant is {@see ProjectsClient::setUsageExportBucketAsync()} . * + * @example samples/V1/ProjectsClient/set_usage_export_bucket.php + * * @param SetUsageExportBucketProjectRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/PublicAdvertisedPrefixesClient.php b/Compute/src/V1/Client/PublicAdvertisedPrefixesClient.php index c45e75fd0046..c95153d1e82d 100644 --- a/Compute/src/V1/Client/PublicAdvertisedPrefixesClient.php +++ b/Compute/src/V1/Client/PublicAdvertisedPrefixesClient.php @@ -251,6 +251,8 @@ public function __call($method, $args) * * The async variant is {@see PublicAdvertisedPrefixesClient::announceAsync()} . * + * @example samples/V1/PublicAdvertisedPrefixesClient/announce.php + * * @param AnnouncePublicAdvertisedPrefixeRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -275,6 +277,8 @@ public function announce(AnnouncePublicAdvertisedPrefixeRequest $request, array * * The async variant is {@see PublicAdvertisedPrefixesClient::deleteAsync()} . * + * @example samples/V1/PublicAdvertisedPrefixesClient/delete.php + * * @param DeletePublicAdvertisedPrefixeRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -299,6 +303,8 @@ public function delete(DeletePublicAdvertisedPrefixeRequest $request, array $cal * * The async variant is {@see PublicAdvertisedPrefixesClient::getAsync()} . * + * @example samples/V1/PublicAdvertisedPrefixesClient/get.php + * * @param GetPublicAdvertisedPrefixeRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -323,6 +329,8 @@ public function get(GetPublicAdvertisedPrefixeRequest $request, array $callOptio * * The async variant is {@see PublicAdvertisedPrefixesClient::insertAsync()} . * + * @example samples/V1/PublicAdvertisedPrefixesClient/insert.php + * * @param InsertPublicAdvertisedPrefixeRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -347,6 +355,8 @@ public function insert(InsertPublicAdvertisedPrefixeRequest $request, array $cal * * The async variant is {@see PublicAdvertisedPrefixesClient::listAsync()} . * + * @example samples/V1/PublicAdvertisedPrefixesClient/list.php + * * @param ListPublicAdvertisedPrefixesRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -371,6 +381,8 @@ public function list(ListPublicAdvertisedPrefixesRequest $request, array $callOp * * The async variant is {@see PublicAdvertisedPrefixesClient::patchAsync()} . * + * @example samples/V1/PublicAdvertisedPrefixesClient/patch.php + * * @param PatchPublicAdvertisedPrefixeRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -395,6 +407,8 @@ public function patch(PatchPublicAdvertisedPrefixeRequest $request, array $callO * * The async variant is {@see PublicAdvertisedPrefixesClient::withdrawAsync()} . * + * @example samples/V1/PublicAdvertisedPrefixesClient/withdraw.php + * * @param WithdrawPublicAdvertisedPrefixeRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/PublicDelegatedPrefixesClient.php b/Compute/src/V1/Client/PublicDelegatedPrefixesClient.php index 446b21cff3ef..cb1dc24c9895 100644 --- a/Compute/src/V1/Client/PublicDelegatedPrefixesClient.php +++ b/Compute/src/V1/Client/PublicDelegatedPrefixesClient.php @@ -255,6 +255,8 @@ public function __call($method, $args) * The async variant is {@see PublicDelegatedPrefixesClient::aggregatedListAsync()} * . * + * @example samples/V1/PublicDelegatedPrefixesClient/aggregated_list.php + * * @param AggregatedListPublicDelegatedPrefixesRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -279,6 +281,8 @@ public function aggregatedList(AggregatedListPublicDelegatedPrefixesRequest $req * * The async variant is {@see PublicDelegatedPrefixesClient::announceAsync()} . * + * @example samples/V1/PublicDelegatedPrefixesClient/announce.php + * * @param AnnouncePublicDelegatedPrefixeRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -303,6 +307,8 @@ public function announce(AnnouncePublicDelegatedPrefixeRequest $request, array $ * * The async variant is {@see PublicDelegatedPrefixesClient::deleteAsync()} . * + * @example samples/V1/PublicDelegatedPrefixesClient/delete.php + * * @param DeletePublicDelegatedPrefixeRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -327,6 +333,8 @@ public function delete(DeletePublicDelegatedPrefixeRequest $request, array $call * * The async variant is {@see PublicDelegatedPrefixesClient::getAsync()} . * + * @example samples/V1/PublicDelegatedPrefixesClient/get.php + * * @param GetPublicDelegatedPrefixeRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -351,6 +359,8 @@ public function get(GetPublicDelegatedPrefixeRequest $request, array $callOption * * The async variant is {@see PublicDelegatedPrefixesClient::insertAsync()} . * + * @example samples/V1/PublicDelegatedPrefixesClient/insert.php + * * @param InsertPublicDelegatedPrefixeRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -375,6 +385,8 @@ public function insert(InsertPublicDelegatedPrefixeRequest $request, array $call * * The async variant is {@see PublicDelegatedPrefixesClient::listAsync()} . * + * @example samples/V1/PublicDelegatedPrefixesClient/list.php + * * @param ListPublicDelegatedPrefixesRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -399,6 +411,8 @@ public function list(ListPublicDelegatedPrefixesRequest $request, array $callOpt * * The async variant is {@see PublicDelegatedPrefixesClient::patchAsync()} . * + * @example samples/V1/PublicDelegatedPrefixesClient/patch.php + * * @param PatchPublicDelegatedPrefixeRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -423,6 +437,8 @@ public function patch(PatchPublicDelegatedPrefixeRequest $request, array $callOp * * The async variant is {@see PublicDelegatedPrefixesClient::withdrawAsync()} . * + * @example samples/V1/PublicDelegatedPrefixesClient/withdraw.php + * * @param WithdrawPublicDelegatedPrefixeRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/RegionAutoscalersClient.php b/Compute/src/V1/Client/RegionAutoscalersClient.php index ebdbe30c80c6..f9c7aa6e64d0 100644 --- a/Compute/src/V1/Client/RegionAutoscalersClient.php +++ b/Compute/src/V1/Client/RegionAutoscalersClient.php @@ -250,6 +250,8 @@ public function __call($method, $args) * * The async variant is {@see RegionAutoscalersClient::deleteAsync()} . * + * @example samples/V1/RegionAutoscalersClient/delete.php + * * @param DeleteRegionAutoscalerRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -274,6 +276,8 @@ public function delete(DeleteRegionAutoscalerRequest $request, array $callOption * * The async variant is {@see RegionAutoscalersClient::getAsync()} . * + * @example samples/V1/RegionAutoscalersClient/get.php + * * @param GetRegionAutoscalerRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -298,6 +302,8 @@ public function get(GetRegionAutoscalerRequest $request, array $callOptions = [] * * The async variant is {@see RegionAutoscalersClient::insertAsync()} . * + * @example samples/V1/RegionAutoscalersClient/insert.php + * * @param InsertRegionAutoscalerRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -322,6 +328,8 @@ public function insert(InsertRegionAutoscalerRequest $request, array $callOption * * The async variant is {@see RegionAutoscalersClient::listAsync()} . * + * @example samples/V1/RegionAutoscalersClient/list.php + * * @param ListRegionAutoscalersRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -346,6 +354,8 @@ public function list(ListRegionAutoscalersRequest $request, array $callOptions = * * The async variant is {@see RegionAutoscalersClient::patchAsync()} . * + * @example samples/V1/RegionAutoscalersClient/patch.php + * * @param PatchRegionAutoscalerRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -370,6 +380,8 @@ public function patch(PatchRegionAutoscalerRequest $request, array $callOptions * * The async variant is {@see RegionAutoscalersClient::updateAsync()} . * + * @example samples/V1/RegionAutoscalersClient/update.php + * * @param UpdateRegionAutoscalerRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/RegionBackendServicesClient.php b/Compute/src/V1/Client/RegionBackendServicesClient.php index fd6d26141fea..bb4c8923c764 100644 --- a/Compute/src/V1/Client/RegionBackendServicesClient.php +++ b/Compute/src/V1/Client/RegionBackendServicesClient.php @@ -265,6 +265,8 @@ public function __call($method, $args) * * The async variant is {@see RegionBackendServicesClient::deleteAsync()} . * + * @example samples/V1/RegionBackendServicesClient/delete.php + * * @param DeleteRegionBackendServiceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -289,6 +291,8 @@ public function delete(DeleteRegionBackendServiceRequest $request, array $callOp * * The async variant is {@see RegionBackendServicesClient::getAsync()} . * + * @example samples/V1/RegionBackendServicesClient/get.php + * * @param GetRegionBackendServiceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -313,6 +317,8 @@ public function get(GetRegionBackendServiceRequest $request, array $callOptions * * The async variant is {@see RegionBackendServicesClient::getHealthAsync()} . * + * @example samples/V1/RegionBackendServicesClient/get_health.php + * * @param GetHealthRegionBackendServiceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -337,6 +343,8 @@ public function getHealth(GetHealthRegionBackendServiceRequest $request, array $ * * The async variant is {@see RegionBackendServicesClient::getIamPolicyAsync()} . * + * @example samples/V1/RegionBackendServicesClient/get_iam_policy.php + * * @param GetIamPolicyRegionBackendServiceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -361,6 +369,8 @@ public function getIamPolicy(GetIamPolicyRegionBackendServiceRequest $request, a * * The async variant is {@see RegionBackendServicesClient::insertAsync()} . * + * @example samples/V1/RegionBackendServicesClient/insert.php + * * @param InsertRegionBackendServiceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -385,6 +395,8 @@ public function insert(InsertRegionBackendServiceRequest $request, array $callOp * * The async variant is {@see RegionBackendServicesClient::listAsync()} . * + * @example samples/V1/RegionBackendServicesClient/list.php + * * @param ListRegionBackendServicesRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -409,6 +421,8 @@ public function list(ListRegionBackendServicesRequest $request, array $callOptio * * The async variant is {@see RegionBackendServicesClient::listUsableAsync()} . * + * @example samples/V1/RegionBackendServicesClient/list_usable.php + * * @param ListUsableRegionBackendServicesRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -433,6 +447,8 @@ public function listUsable(ListUsableRegionBackendServicesRequest $request, arra * * The async variant is {@see RegionBackendServicesClient::patchAsync()} . * + * @example samples/V1/RegionBackendServicesClient/patch.php + * * @param PatchRegionBackendServiceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -457,6 +473,8 @@ public function patch(PatchRegionBackendServiceRequest $request, array $callOpti * * The async variant is {@see RegionBackendServicesClient::setIamPolicyAsync()} . * + * @example samples/V1/RegionBackendServicesClient/set_iam_policy.php + * * @param SetIamPolicyRegionBackendServiceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -482,6 +500,8 @@ public function setIamPolicy(SetIamPolicyRegionBackendServiceRequest $request, a * The async variant is * {@see RegionBackendServicesClient::setSecurityPolicyAsync()} . * + * @example samples/V1/RegionBackendServicesClient/set_security_policy.php + * * @param SetSecurityPolicyRegionBackendServiceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -507,6 +527,8 @@ public function setSecurityPolicy(SetSecurityPolicyRegionBackendServiceRequest $ * The async variant is * {@see RegionBackendServicesClient::testIamPermissionsAsync()} . * + * @example samples/V1/RegionBackendServicesClient/test_iam_permissions.php + * * @param TestIamPermissionsRegionBackendServiceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -531,6 +553,8 @@ public function testIamPermissions(TestIamPermissionsRegionBackendServiceRequest * * The async variant is {@see RegionBackendServicesClient::updateAsync()} . * + * @example samples/V1/RegionBackendServicesClient/update.php + * * @param UpdateRegionBackendServiceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/RegionCommitmentsClient.php b/Compute/src/V1/Client/RegionCommitmentsClient.php index 855c5f69c2f7..a231ed4c2edf 100644 --- a/Compute/src/V1/Client/RegionCommitmentsClient.php +++ b/Compute/src/V1/Client/RegionCommitmentsClient.php @@ -248,6 +248,8 @@ public function __call($method, $args) * * The async variant is {@see RegionCommitmentsClient::aggregatedListAsync()} . * + * @example samples/V1/RegionCommitmentsClient/aggregated_list.php + * * @param AggregatedListRegionCommitmentsRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -272,6 +274,8 @@ public function aggregatedList(AggregatedListRegionCommitmentsRequest $request, * * The async variant is {@see RegionCommitmentsClient::getAsync()} . * + * @example samples/V1/RegionCommitmentsClient/get.php + * * @param GetRegionCommitmentRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -296,6 +300,8 @@ public function get(GetRegionCommitmentRequest $request, array $callOptions = [] * * The async variant is {@see RegionCommitmentsClient::insertAsync()} . * + * @example samples/V1/RegionCommitmentsClient/insert.php + * * @param InsertRegionCommitmentRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -320,6 +326,8 @@ public function insert(InsertRegionCommitmentRequest $request, array $callOption * * The async variant is {@see RegionCommitmentsClient::listAsync()} . * + * @example samples/V1/RegionCommitmentsClient/list.php + * * @param ListRegionCommitmentsRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -344,6 +352,8 @@ public function list(ListRegionCommitmentsRequest $request, array $callOptions = * * The async variant is {@see RegionCommitmentsClient::updateAsync()} . * + * @example samples/V1/RegionCommitmentsClient/update.php + * * @param UpdateRegionCommitmentRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/RegionDiskTypesClient.php b/Compute/src/V1/Client/RegionDiskTypesClient.php index a7866ba46f72..fb2e4a44afb3 100644 --- a/Compute/src/V1/Client/RegionDiskTypesClient.php +++ b/Compute/src/V1/Client/RegionDiskTypesClient.php @@ -186,6 +186,8 @@ public function __call($method, $args) * * The async variant is {@see RegionDiskTypesClient::getAsync()} . * + * @example samples/V1/RegionDiskTypesClient/get.php + * * @param GetRegionDiskTypeRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -210,6 +212,8 @@ public function get(GetRegionDiskTypeRequest $request, array $callOptions = []): * * The async variant is {@see RegionDiskTypesClient::listAsync()} . * + * @example samples/V1/RegionDiskTypesClient/list.php + * * @param ListRegionDiskTypesRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/RegionDisksClient.php b/Compute/src/V1/Client/RegionDisksClient.php index 7e80c108ac55..fb73142d9c39 100644 --- a/Compute/src/V1/Client/RegionDisksClient.php +++ b/Compute/src/V1/Client/RegionDisksClient.php @@ -274,6 +274,8 @@ public function __call($method, $args) * * The async variant is {@see RegionDisksClient::addResourcePoliciesAsync()} . * + * @example samples/V1/RegionDisksClient/add_resource_policies.php + * * @param AddResourcePoliciesRegionDiskRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -298,6 +300,8 @@ public function addResourcePolicies(AddResourcePoliciesRegionDiskRequest $reques * * The async variant is {@see RegionDisksClient::bulkInsertAsync()} . * + * @example samples/V1/RegionDisksClient/bulk_insert.php + * * @param BulkInsertRegionDiskRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -322,6 +326,8 @@ public function bulkInsert(BulkInsertRegionDiskRequest $request, array $callOpti * * The async variant is {@see RegionDisksClient::createSnapshotAsync()} . * + * @example samples/V1/RegionDisksClient/create_snapshot.php + * * @param CreateSnapshotRegionDiskRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -346,6 +352,8 @@ public function createSnapshot(CreateSnapshotRegionDiskRequest $request, array $ * * The async variant is {@see RegionDisksClient::deleteAsync()} . * + * @example samples/V1/RegionDisksClient/delete.php + * * @param DeleteRegionDiskRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -370,6 +378,8 @@ public function delete(DeleteRegionDiskRequest $request, array $callOptions = [] * * The async variant is {@see RegionDisksClient::getAsync()} . * + * @example samples/V1/RegionDisksClient/get.php + * * @param GetRegionDiskRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -394,6 +404,8 @@ public function get(GetRegionDiskRequest $request, array $callOptions = []): Dis * * The async variant is {@see RegionDisksClient::getIamPolicyAsync()} . * + * @example samples/V1/RegionDisksClient/get_iam_policy.php + * * @param GetIamPolicyRegionDiskRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -418,6 +430,8 @@ public function getIamPolicy(GetIamPolicyRegionDiskRequest $request, array $call * * The async variant is {@see RegionDisksClient::insertAsync()} . * + * @example samples/V1/RegionDisksClient/insert.php + * * @param InsertRegionDiskRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -442,6 +456,8 @@ public function insert(InsertRegionDiskRequest $request, array $callOptions = [] * * The async variant is {@see RegionDisksClient::listAsync()} . * + * @example samples/V1/RegionDisksClient/list.php + * * @param ListRegionDisksRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -466,6 +482,8 @@ public function list(ListRegionDisksRequest $request, array $callOptions = []): * * The async variant is {@see RegionDisksClient::removeResourcePoliciesAsync()} . * + * @example samples/V1/RegionDisksClient/remove_resource_policies.php + * * @param RemoveResourcePoliciesRegionDiskRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -490,6 +508,8 @@ public function removeResourcePolicies(RemoveResourcePoliciesRegionDiskRequest $ * * The async variant is {@see RegionDisksClient::resizeAsync()} . * + * @example samples/V1/RegionDisksClient/resize.php + * * @param ResizeRegionDiskRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -514,6 +534,8 @@ public function resize(ResizeRegionDiskRequest $request, array $callOptions = [] * * The async variant is {@see RegionDisksClient::setIamPolicyAsync()} . * + * @example samples/V1/RegionDisksClient/set_iam_policy.php + * * @param SetIamPolicyRegionDiskRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -538,6 +560,8 @@ public function setIamPolicy(SetIamPolicyRegionDiskRequest $request, array $call * * The async variant is {@see RegionDisksClient::setLabelsAsync()} . * + * @example samples/V1/RegionDisksClient/set_labels.php + * * @param SetLabelsRegionDiskRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -562,6 +586,8 @@ public function setLabels(SetLabelsRegionDiskRequest $request, array $callOption * * The async variant is {@see RegionDisksClient::startAsyncReplicationAsync()} . * + * @example samples/V1/RegionDisksClient/start_async_replication.php + * * @param StartAsyncReplicationRegionDiskRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -586,6 +612,8 @@ public function startAsyncReplication(StartAsyncReplicationRegionDiskRequest $re * * The async variant is {@see RegionDisksClient::stopAsyncReplicationAsync()} . * + * @example samples/V1/RegionDisksClient/stop_async_replication.php + * * @param StopAsyncReplicationRegionDiskRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -611,6 +639,8 @@ public function stopAsyncReplication(StopAsyncReplicationRegionDiskRequest $requ * The async variant is {@see RegionDisksClient::stopGroupAsyncReplicationAsync()} * . * + * @example samples/V1/RegionDisksClient/stop_group_async_replication.php + * * @param StopGroupAsyncReplicationRegionDiskRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -635,6 +665,8 @@ public function stopGroupAsyncReplication(StopGroupAsyncReplicationRegionDiskReq * * The async variant is {@see RegionDisksClient::testIamPermissionsAsync()} . * + * @example samples/V1/RegionDisksClient/test_iam_permissions.php + * * @param TestIamPermissionsRegionDiskRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -659,6 +691,8 @@ public function testIamPermissions(TestIamPermissionsRegionDiskRequest $request, * * The async variant is {@see RegionDisksClient::updateAsync()} . * + * @example samples/V1/RegionDisksClient/update.php + * * @param UpdateRegionDiskRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/RegionHealthCheckServicesClient.php b/Compute/src/V1/Client/RegionHealthCheckServicesClient.php index 4e6f674f8088..f0002f8fef9e 100644 --- a/Compute/src/V1/Client/RegionHealthCheckServicesClient.php +++ b/Compute/src/V1/Client/RegionHealthCheckServicesClient.php @@ -248,6 +248,8 @@ public function __call($method, $args) * * The async variant is {@see RegionHealthCheckServicesClient::deleteAsync()} . * + * @example samples/V1/RegionHealthCheckServicesClient/delete.php + * * @param DeleteRegionHealthCheckServiceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -272,6 +274,8 @@ public function delete(DeleteRegionHealthCheckServiceRequest $request, array $ca * * The async variant is {@see RegionHealthCheckServicesClient::getAsync()} . * + * @example samples/V1/RegionHealthCheckServicesClient/get.php + * * @param GetRegionHealthCheckServiceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -296,6 +300,8 @@ public function get(GetRegionHealthCheckServiceRequest $request, array $callOpti * * The async variant is {@see RegionHealthCheckServicesClient::insertAsync()} . * + * @example samples/V1/RegionHealthCheckServicesClient/insert.php + * * @param InsertRegionHealthCheckServiceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -320,6 +326,8 @@ public function insert(InsertRegionHealthCheckServiceRequest $request, array $ca * * The async variant is {@see RegionHealthCheckServicesClient::listAsync()} . * + * @example samples/V1/RegionHealthCheckServicesClient/list.php + * * @param ListRegionHealthCheckServicesRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -344,6 +352,8 @@ public function list(ListRegionHealthCheckServicesRequest $request, array $callO * * The async variant is {@see RegionHealthCheckServicesClient::patchAsync()} . * + * @example samples/V1/RegionHealthCheckServicesClient/patch.php + * * @param PatchRegionHealthCheckServiceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/RegionHealthChecksClient.php b/Compute/src/V1/Client/RegionHealthChecksClient.php index a887497e71b6..c5c741802574 100644 --- a/Compute/src/V1/Client/RegionHealthChecksClient.php +++ b/Compute/src/V1/Client/RegionHealthChecksClient.php @@ -250,6 +250,8 @@ public function __call($method, $args) * * The async variant is {@see RegionHealthChecksClient::deleteAsync()} . * + * @example samples/V1/RegionHealthChecksClient/delete.php + * * @param DeleteRegionHealthCheckRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -274,6 +276,8 @@ public function delete(DeleteRegionHealthCheckRequest $request, array $callOptio * * The async variant is {@see RegionHealthChecksClient::getAsync()} . * + * @example samples/V1/RegionHealthChecksClient/get.php + * * @param GetRegionHealthCheckRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -298,6 +302,8 @@ public function get(GetRegionHealthCheckRequest $request, array $callOptions = [ * * The async variant is {@see RegionHealthChecksClient::insertAsync()} . * + * @example samples/V1/RegionHealthChecksClient/insert.php + * * @param InsertRegionHealthCheckRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -322,6 +328,8 @@ public function insert(InsertRegionHealthCheckRequest $request, array $callOptio * * The async variant is {@see RegionHealthChecksClient::listAsync()} . * + * @example samples/V1/RegionHealthChecksClient/list.php + * * @param ListRegionHealthChecksRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -346,6 +354,8 @@ public function list(ListRegionHealthChecksRequest $request, array $callOptions * * The async variant is {@see RegionHealthChecksClient::patchAsync()} . * + * @example samples/V1/RegionHealthChecksClient/patch.php + * * @param PatchRegionHealthCheckRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -370,6 +380,8 @@ public function patch(PatchRegionHealthCheckRequest $request, array $callOptions * * The async variant is {@see RegionHealthChecksClient::updateAsync()} . * + * @example samples/V1/RegionHealthChecksClient/update.php + * * @param UpdateRegionHealthCheckRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/RegionInstanceGroupManagersClient.php b/Compute/src/V1/Client/RegionInstanceGroupManagersClient.php index 3886e02333c4..5994505393d4 100644 --- a/Compute/src/V1/Client/RegionInstanceGroupManagersClient.php +++ b/Compute/src/V1/Client/RegionInstanceGroupManagersClient.php @@ -285,6 +285,8 @@ public function __call($method, $args) * The async variant is * {@see RegionInstanceGroupManagersClient::abandonInstancesAsync()} . * + * @example samples/V1/RegionInstanceGroupManagersClient/abandon_instances.php + * * @param AbandonInstancesRegionInstanceGroupManagerRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -310,6 +312,8 @@ public function abandonInstances(AbandonInstancesRegionInstanceGroupManagerReque * The async variant is * {@see RegionInstanceGroupManagersClient::applyUpdatesToInstancesAsync()} . * + * @example samples/V1/RegionInstanceGroupManagersClient/apply_updates_to_instances.php + * * @param ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -335,6 +339,8 @@ public function applyUpdatesToInstances(ApplyUpdatesToInstancesRegionInstanceGro * The async variant is * {@see RegionInstanceGroupManagersClient::createInstancesAsync()} . * + * @example samples/V1/RegionInstanceGroupManagersClient/create_instances.php + * * @param CreateInstancesRegionInstanceGroupManagerRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -359,6 +365,8 @@ public function createInstances(CreateInstancesRegionInstanceGroupManagerRequest * * The async variant is {@see RegionInstanceGroupManagersClient::deleteAsync()} . * + * @example samples/V1/RegionInstanceGroupManagersClient/delete.php + * * @param DeleteRegionInstanceGroupManagerRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -384,6 +392,8 @@ public function delete(DeleteRegionInstanceGroupManagerRequest $request, array $ * The async variant is * {@see RegionInstanceGroupManagersClient::deleteInstancesAsync()} . * + * @example samples/V1/RegionInstanceGroupManagersClient/delete_instances.php + * * @param DeleteInstancesRegionInstanceGroupManagerRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -409,6 +419,8 @@ public function deleteInstances(DeleteInstancesRegionInstanceGroupManagerRequest * The async variant is * {@see RegionInstanceGroupManagersClient::deletePerInstanceConfigsAsync()} . * + * @example samples/V1/RegionInstanceGroupManagersClient/delete_per_instance_configs.php + * * @param DeletePerInstanceConfigsRegionInstanceGroupManagerRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -433,6 +445,8 @@ public function deletePerInstanceConfigs(DeletePerInstanceConfigsRegionInstanceG * * The async variant is {@see RegionInstanceGroupManagersClient::getAsync()} . * + * @example samples/V1/RegionInstanceGroupManagersClient/get.php + * * @param GetRegionInstanceGroupManagerRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -457,6 +471,8 @@ public function get(GetRegionInstanceGroupManagerRequest $request, array $callOp * * The async variant is {@see RegionInstanceGroupManagersClient::insertAsync()} . * + * @example samples/V1/RegionInstanceGroupManagersClient/insert.php + * * @param InsertRegionInstanceGroupManagerRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -481,6 +497,8 @@ public function insert(InsertRegionInstanceGroupManagerRequest $request, array $ * * The async variant is {@see RegionInstanceGroupManagersClient::listAsync()} . * + * @example samples/V1/RegionInstanceGroupManagersClient/list.php + * * @param ListRegionInstanceGroupManagersRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -506,6 +524,8 @@ public function list(ListRegionInstanceGroupManagersRequest $request, array $cal * The async variant is {@see RegionInstanceGroupManagersClient::listErrorsAsync()} * . * + * @example samples/V1/RegionInstanceGroupManagersClient/list_errors.php + * * @param ListErrorsRegionInstanceGroupManagersRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -531,6 +551,8 @@ public function listErrors(ListErrorsRegionInstanceGroupManagersRequest $request * The async variant is * {@see RegionInstanceGroupManagersClient::listManagedInstancesAsync()} . * + * @example samples/V1/RegionInstanceGroupManagersClient/list_managed_instances.php + * * @param ListManagedInstancesRegionInstanceGroupManagersRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -556,6 +578,8 @@ public function listManagedInstances(ListManagedInstancesRegionInstanceGroupMana * The async variant is * {@see RegionInstanceGroupManagersClient::listPerInstanceConfigsAsync()} . * + * @example samples/V1/RegionInstanceGroupManagersClient/list_per_instance_configs.php + * * @param ListPerInstanceConfigsRegionInstanceGroupManagersRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -580,6 +604,8 @@ public function listPerInstanceConfigs(ListPerInstanceConfigsRegionInstanceGroup * * The async variant is {@see RegionInstanceGroupManagersClient::patchAsync()} . * + * @example samples/V1/RegionInstanceGroupManagersClient/patch.php + * * @param PatchRegionInstanceGroupManagerRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -605,6 +631,8 @@ public function patch(PatchRegionInstanceGroupManagerRequest $request, array $ca * The async variant is * {@see RegionInstanceGroupManagersClient::patchPerInstanceConfigsAsync()} . * + * @example samples/V1/RegionInstanceGroupManagersClient/patch_per_instance_configs.php + * * @param PatchPerInstanceConfigsRegionInstanceGroupManagerRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -630,6 +658,8 @@ public function patchPerInstanceConfigs(PatchPerInstanceConfigsRegionInstanceGro * The async variant is * {@see RegionInstanceGroupManagersClient::recreateInstancesAsync()} . * + * @example samples/V1/RegionInstanceGroupManagersClient/recreate_instances.php + * * @param RecreateInstancesRegionInstanceGroupManagerRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -654,6 +684,8 @@ public function recreateInstances(RecreateInstancesRegionInstanceGroupManagerReq * * The async variant is {@see RegionInstanceGroupManagersClient::resizeAsync()} . * + * @example samples/V1/RegionInstanceGroupManagersClient/resize.php + * * @param ResizeRegionInstanceGroupManagerRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -679,6 +711,8 @@ public function resize(ResizeRegionInstanceGroupManagerRequest $request, array $ * The async variant is * {@see RegionInstanceGroupManagersClient::resumeInstancesAsync()} . * + * @example samples/V1/RegionInstanceGroupManagersClient/resume_instances.php + * * @param ResumeInstancesRegionInstanceGroupManagerRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -704,6 +738,8 @@ public function resumeInstances(ResumeInstancesRegionInstanceGroupManagerRequest * The async variant is * {@see RegionInstanceGroupManagersClient::setInstanceTemplateAsync()} . * + * @example samples/V1/RegionInstanceGroupManagersClient/set_instance_template.php + * * @param SetInstanceTemplateRegionInstanceGroupManagerRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -729,6 +765,8 @@ public function setInstanceTemplate(SetInstanceTemplateRegionInstanceGroupManage * The async variant is * {@see RegionInstanceGroupManagersClient::setTargetPoolsAsync()} . * + * @example samples/V1/RegionInstanceGroupManagersClient/set_target_pools.php + * * @param SetTargetPoolsRegionInstanceGroupManagerRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -754,6 +792,8 @@ public function setTargetPools(SetTargetPoolsRegionInstanceGroupManagerRequest $ * The async variant is * {@see RegionInstanceGroupManagersClient::startInstancesAsync()} . * + * @example samples/V1/RegionInstanceGroupManagersClient/start_instances.php + * * @param StartInstancesRegionInstanceGroupManagerRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -779,6 +819,8 @@ public function startInstances(StartInstancesRegionInstanceGroupManagerRequest $ * The async variant is * {@see RegionInstanceGroupManagersClient::stopInstancesAsync()} . * + * @example samples/V1/RegionInstanceGroupManagersClient/stop_instances.php + * * @param StopInstancesRegionInstanceGroupManagerRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -804,6 +846,8 @@ public function stopInstances(StopInstancesRegionInstanceGroupManagerRequest $re * The async variant is * {@see RegionInstanceGroupManagersClient::suspendInstancesAsync()} . * + * @example samples/V1/RegionInstanceGroupManagersClient/suspend_instances.php + * * @param SuspendInstancesRegionInstanceGroupManagerRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -829,6 +873,8 @@ public function suspendInstances(SuspendInstancesRegionInstanceGroupManagerReque * The async variant is * {@see RegionInstanceGroupManagersClient::updatePerInstanceConfigsAsync()} . * + * @example samples/V1/RegionInstanceGroupManagersClient/update_per_instance_configs.php + * * @param UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/RegionInstanceGroupsClient.php b/Compute/src/V1/Client/RegionInstanceGroupsClient.php index c5bf92749a0a..a2eef7bcdf8e 100644 --- a/Compute/src/V1/Client/RegionInstanceGroupsClient.php +++ b/Compute/src/V1/Client/RegionInstanceGroupsClient.php @@ -246,6 +246,8 @@ public function __call($method, $args) * * The async variant is {@see RegionInstanceGroupsClient::getAsync()} . * + * @example samples/V1/RegionInstanceGroupsClient/get.php + * * @param GetRegionInstanceGroupRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -270,6 +272,8 @@ public function get(GetRegionInstanceGroupRequest $request, array $callOptions = * * The async variant is {@see RegionInstanceGroupsClient::listAsync()} . * + * @example samples/V1/RegionInstanceGroupsClient/list.php + * * @param ListRegionInstanceGroupsRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -294,6 +298,8 @@ public function list(ListRegionInstanceGroupsRequest $request, array $callOption * * The async variant is {@see RegionInstanceGroupsClient::listInstancesAsync()} . * + * @example samples/V1/RegionInstanceGroupsClient/list_instances.php + * * @param ListInstancesRegionInstanceGroupsRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -318,6 +324,8 @@ public function listInstances(ListInstancesRegionInstanceGroupsRequest $request, * * The async variant is {@see RegionInstanceGroupsClient::setNamedPortsAsync()} . * + * @example samples/V1/RegionInstanceGroupsClient/set_named_ports.php + * * @param SetNamedPortsRegionInstanceGroupRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/RegionInstanceTemplatesClient.php b/Compute/src/V1/Client/RegionInstanceTemplatesClient.php index 370755f3dd4a..198862a1b134 100644 --- a/Compute/src/V1/Client/RegionInstanceTemplatesClient.php +++ b/Compute/src/V1/Client/RegionInstanceTemplatesClient.php @@ -246,6 +246,8 @@ public function __call($method, $args) * * The async variant is {@see RegionInstanceTemplatesClient::deleteAsync()} . * + * @example samples/V1/RegionInstanceTemplatesClient/delete.php + * * @param DeleteRegionInstanceTemplateRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -270,6 +272,8 @@ public function delete(DeleteRegionInstanceTemplateRequest $request, array $call * * The async variant is {@see RegionInstanceTemplatesClient::getAsync()} . * + * @example samples/V1/RegionInstanceTemplatesClient/get.php + * * @param GetRegionInstanceTemplateRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -294,6 +298,8 @@ public function get(GetRegionInstanceTemplateRequest $request, array $callOption * * The async variant is {@see RegionInstanceTemplatesClient::insertAsync()} . * + * @example samples/V1/RegionInstanceTemplatesClient/insert.php + * * @param InsertRegionInstanceTemplateRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -318,6 +324,8 @@ public function insert(InsertRegionInstanceTemplateRequest $request, array $call * * The async variant is {@see RegionInstanceTemplatesClient::listAsync()} . * + * @example samples/V1/RegionInstanceTemplatesClient/list.php + * * @param ListRegionInstanceTemplatesRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/RegionInstancesClient.php b/Compute/src/V1/Client/RegionInstancesClient.php index 11301669a4e0..d6a22c7d0736 100644 --- a/Compute/src/V1/Client/RegionInstancesClient.php +++ b/Compute/src/V1/Client/RegionInstancesClient.php @@ -238,6 +238,8 @@ public function __call($method, $args) * * The async variant is {@see RegionInstancesClient::bulkInsertAsync()} . * + * @example samples/V1/RegionInstancesClient/bulk_insert.php + * * @param BulkInsertRegionInstanceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/RegionInstantSnapshotsClient.php b/Compute/src/V1/Client/RegionInstantSnapshotsClient.php index e4d8719937a4..de1cae563eef 100644 --- a/Compute/src/V1/Client/RegionInstantSnapshotsClient.php +++ b/Compute/src/V1/Client/RegionInstantSnapshotsClient.php @@ -256,6 +256,8 @@ public function __call($method, $args) * * The async variant is {@see RegionInstantSnapshotsClient::deleteAsync()} . * + * @example samples/V1/RegionInstantSnapshotsClient/delete.php + * * @param DeleteRegionInstantSnapshotRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -280,6 +282,8 @@ public function delete(DeleteRegionInstantSnapshotRequest $request, array $callO * * The async variant is {@see RegionInstantSnapshotsClient::getAsync()} . * + * @example samples/V1/RegionInstantSnapshotsClient/get.php + * * @param GetRegionInstantSnapshotRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -304,6 +308,8 @@ public function get(GetRegionInstantSnapshotRequest $request, array $callOptions * * The async variant is {@see RegionInstantSnapshotsClient::getIamPolicyAsync()} . * + * @example samples/V1/RegionInstantSnapshotsClient/get_iam_policy.php + * * @param GetIamPolicyRegionInstantSnapshotRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -328,6 +334,8 @@ public function getIamPolicy(GetIamPolicyRegionInstantSnapshotRequest $request, * * The async variant is {@see RegionInstantSnapshotsClient::insertAsync()} . * + * @example samples/V1/RegionInstantSnapshotsClient/insert.php + * * @param InsertRegionInstantSnapshotRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -352,6 +360,8 @@ public function insert(InsertRegionInstantSnapshotRequest $request, array $callO * * The async variant is {@see RegionInstantSnapshotsClient::listAsync()} . * + * @example samples/V1/RegionInstantSnapshotsClient/list.php + * * @param ListRegionInstantSnapshotsRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -376,6 +386,8 @@ public function list(ListRegionInstantSnapshotsRequest $request, array $callOpti * * The async variant is {@see RegionInstantSnapshotsClient::setIamPolicyAsync()} . * + * @example samples/V1/RegionInstantSnapshotsClient/set_iam_policy.php + * * @param SetIamPolicyRegionInstantSnapshotRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -400,6 +412,8 @@ public function setIamPolicy(SetIamPolicyRegionInstantSnapshotRequest $request, * * The async variant is {@see RegionInstantSnapshotsClient::setLabelsAsync()} . * + * @example samples/V1/RegionInstantSnapshotsClient/set_labels.php + * * @param SetLabelsRegionInstantSnapshotRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -425,6 +439,8 @@ public function setLabels(SetLabelsRegionInstantSnapshotRequest $request, array * The async variant is * {@see RegionInstantSnapshotsClient::testIamPermissionsAsync()} . * + * @example samples/V1/RegionInstantSnapshotsClient/test_iam_permissions.php + * * @param TestIamPermissionsRegionInstantSnapshotRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/RegionNetworkEndpointGroupsClient.php b/Compute/src/V1/Client/RegionNetworkEndpointGroupsClient.php index 25c6581bdae8..1fa0aa433144 100644 --- a/Compute/src/V1/Client/RegionNetworkEndpointGroupsClient.php +++ b/Compute/src/V1/Client/RegionNetworkEndpointGroupsClient.php @@ -253,6 +253,8 @@ public function __call($method, $args) * The async variant is * {@see RegionNetworkEndpointGroupsClient::attachNetworkEndpointsAsync()} . * + * @example samples/V1/RegionNetworkEndpointGroupsClient/attach_network_endpoints.php + * * @param AttachNetworkEndpointsRegionNetworkEndpointGroupRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -277,6 +279,8 @@ public function attachNetworkEndpoints(AttachNetworkEndpointsRegionNetworkEndpoi * * The async variant is {@see RegionNetworkEndpointGroupsClient::deleteAsync()} . * + * @example samples/V1/RegionNetworkEndpointGroupsClient/delete.php + * * @param DeleteRegionNetworkEndpointGroupRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -302,6 +306,8 @@ public function delete(DeleteRegionNetworkEndpointGroupRequest $request, array $ * The async variant is * {@see RegionNetworkEndpointGroupsClient::detachNetworkEndpointsAsync()} . * + * @example samples/V1/RegionNetworkEndpointGroupsClient/detach_network_endpoints.php + * * @param DetachNetworkEndpointsRegionNetworkEndpointGroupRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -326,6 +332,8 @@ public function detachNetworkEndpoints(DetachNetworkEndpointsRegionNetworkEndpoi * * The async variant is {@see RegionNetworkEndpointGroupsClient::getAsync()} . * + * @example samples/V1/RegionNetworkEndpointGroupsClient/get.php + * * @param GetRegionNetworkEndpointGroupRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -350,6 +358,8 @@ public function get(GetRegionNetworkEndpointGroupRequest $request, array $callOp * * The async variant is {@see RegionNetworkEndpointGroupsClient::insertAsync()} . * + * @example samples/V1/RegionNetworkEndpointGroupsClient/insert.php + * * @param InsertRegionNetworkEndpointGroupRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -374,6 +384,8 @@ public function insert(InsertRegionNetworkEndpointGroupRequest $request, array $ * * The async variant is {@see RegionNetworkEndpointGroupsClient::listAsync()} . * + * @example samples/V1/RegionNetworkEndpointGroupsClient/list.php + * * @param ListRegionNetworkEndpointGroupsRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -399,6 +411,8 @@ public function list(ListRegionNetworkEndpointGroupsRequest $request, array $cal * The async variant is * {@see RegionNetworkEndpointGroupsClient::listNetworkEndpointsAsync()} . * + * @example samples/V1/RegionNetworkEndpointGroupsClient/list_network_endpoints.php + * * @param ListNetworkEndpointsRegionNetworkEndpointGroupsRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/RegionNetworkFirewallPoliciesClient.php b/Compute/src/V1/Client/RegionNetworkFirewallPoliciesClient.php index 5133565b40dc..c07a885470a4 100644 --- a/Compute/src/V1/Client/RegionNetworkFirewallPoliciesClient.php +++ b/Compute/src/V1/Client/RegionNetworkFirewallPoliciesClient.php @@ -278,6 +278,8 @@ public function __call($method, $args) * The async variant is * {@see RegionNetworkFirewallPoliciesClient::addAssociationAsync()} . * + * @example samples/V1/RegionNetworkFirewallPoliciesClient/add_association.php + * * @param AddAssociationRegionNetworkFirewallPolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -303,6 +305,8 @@ public function addAssociation(AddAssociationRegionNetworkFirewallPolicyRequest * The async variant is {@see RegionNetworkFirewallPoliciesClient::addRuleAsync()} * . * + * @example samples/V1/RegionNetworkFirewallPoliciesClient/add_rule.php + * * @param AddRuleRegionNetworkFirewallPolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -328,6 +332,8 @@ public function addRule(AddRuleRegionNetworkFirewallPolicyRequest $request, arra * The async variant is * {@see RegionNetworkFirewallPoliciesClient::cloneRulesAsync()} . * + * @example samples/V1/RegionNetworkFirewallPoliciesClient/clone_rules.php + * * @param CloneRulesRegionNetworkFirewallPolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -352,6 +358,8 @@ public function cloneRules(CloneRulesRegionNetworkFirewallPolicyRequest $request * * The async variant is {@see RegionNetworkFirewallPoliciesClient::deleteAsync()} . * + * @example samples/V1/RegionNetworkFirewallPoliciesClient/delete.php + * * @param DeleteRegionNetworkFirewallPolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -376,6 +384,8 @@ public function delete(DeleteRegionNetworkFirewallPolicyRequest $request, array * * The async variant is {@see RegionNetworkFirewallPoliciesClient::getAsync()} . * + * @example samples/V1/RegionNetworkFirewallPoliciesClient/get.php + * * @param GetRegionNetworkFirewallPolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -401,6 +411,8 @@ public function get(GetRegionNetworkFirewallPolicyRequest $request, array $callO * The async variant is * {@see RegionNetworkFirewallPoliciesClient::getAssociationAsync()} . * + * @example samples/V1/RegionNetworkFirewallPoliciesClient/get_association.php + * * @param GetAssociationRegionNetworkFirewallPolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -426,6 +438,8 @@ public function getAssociation(GetAssociationRegionNetworkFirewallPolicyRequest * The async variant is * {@see RegionNetworkFirewallPoliciesClient::getEffectiveFirewallsAsync()} . * + * @example samples/V1/RegionNetworkFirewallPoliciesClient/get_effective_firewalls.php + * * @param GetEffectiveFirewallsRegionNetworkFirewallPolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -451,6 +465,8 @@ public function getEffectiveFirewalls(GetEffectiveFirewallsRegionNetworkFirewall * The async variant is * {@see RegionNetworkFirewallPoliciesClient::getIamPolicyAsync()} . * + * @example samples/V1/RegionNetworkFirewallPoliciesClient/get_iam_policy.php + * * @param GetIamPolicyRegionNetworkFirewallPolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -476,6 +492,8 @@ public function getIamPolicy(GetIamPolicyRegionNetworkFirewallPolicyRequest $req * The async variant is {@see RegionNetworkFirewallPoliciesClient::getRuleAsync()} * . * + * @example samples/V1/RegionNetworkFirewallPoliciesClient/get_rule.php + * * @param GetRuleRegionNetworkFirewallPolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -500,6 +518,8 @@ public function getRule(GetRuleRegionNetworkFirewallPolicyRequest $request, arra * * The async variant is {@see RegionNetworkFirewallPoliciesClient::insertAsync()} . * + * @example samples/V1/RegionNetworkFirewallPoliciesClient/insert.php + * * @param InsertRegionNetworkFirewallPolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -524,6 +544,8 @@ public function insert(InsertRegionNetworkFirewallPolicyRequest $request, array * * The async variant is {@see RegionNetworkFirewallPoliciesClient::listAsync()} . * + * @example samples/V1/RegionNetworkFirewallPoliciesClient/list.php + * * @param ListRegionNetworkFirewallPoliciesRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -548,6 +570,8 @@ public function list(ListRegionNetworkFirewallPoliciesRequest $request, array $c * * The async variant is {@see RegionNetworkFirewallPoliciesClient::patchAsync()} . * + * @example samples/V1/RegionNetworkFirewallPoliciesClient/patch.php + * * @param PatchRegionNetworkFirewallPolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -573,6 +597,8 @@ public function patch(PatchRegionNetworkFirewallPolicyRequest $request, array $c * The async variant is * {@see RegionNetworkFirewallPoliciesClient::patchRuleAsync()} . * + * @example samples/V1/RegionNetworkFirewallPoliciesClient/patch_rule.php + * * @param PatchRuleRegionNetworkFirewallPolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -598,6 +624,8 @@ public function patchRule(PatchRuleRegionNetworkFirewallPolicyRequest $request, * The async variant is * {@see RegionNetworkFirewallPoliciesClient::removeAssociationAsync()} . * + * @example samples/V1/RegionNetworkFirewallPoliciesClient/remove_association.php + * * @param RemoveAssociationRegionNetworkFirewallPolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -623,6 +651,8 @@ public function removeAssociation(RemoveAssociationRegionNetworkFirewallPolicyRe * The async variant is * {@see RegionNetworkFirewallPoliciesClient::removeRuleAsync()} . * + * @example samples/V1/RegionNetworkFirewallPoliciesClient/remove_rule.php + * * @param RemoveRuleRegionNetworkFirewallPolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -648,6 +678,8 @@ public function removeRule(RemoveRuleRegionNetworkFirewallPolicyRequest $request * The async variant is * {@see RegionNetworkFirewallPoliciesClient::setIamPolicyAsync()} . * + * @example samples/V1/RegionNetworkFirewallPoliciesClient/set_iam_policy.php + * * @param SetIamPolicyRegionNetworkFirewallPolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -673,6 +705,8 @@ public function setIamPolicy(SetIamPolicyRegionNetworkFirewallPolicyRequest $req * The async variant is * {@see RegionNetworkFirewallPoliciesClient::testIamPermissionsAsync()} . * + * @example samples/V1/RegionNetworkFirewallPoliciesClient/test_iam_permissions.php + * * @param TestIamPermissionsRegionNetworkFirewallPolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/RegionNotificationEndpointsClient.php b/Compute/src/V1/Client/RegionNotificationEndpointsClient.php index eb3155b50fe3..30ed10a7b37d 100644 --- a/Compute/src/V1/Client/RegionNotificationEndpointsClient.php +++ b/Compute/src/V1/Client/RegionNotificationEndpointsClient.php @@ -246,6 +246,8 @@ public function __call($method, $args) * * The async variant is {@see RegionNotificationEndpointsClient::deleteAsync()} . * + * @example samples/V1/RegionNotificationEndpointsClient/delete.php + * * @param DeleteRegionNotificationEndpointRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -270,6 +272,8 @@ public function delete(DeleteRegionNotificationEndpointRequest $request, array $ * * The async variant is {@see RegionNotificationEndpointsClient::getAsync()} . * + * @example samples/V1/RegionNotificationEndpointsClient/get.php + * * @param GetRegionNotificationEndpointRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -294,6 +298,8 @@ public function get(GetRegionNotificationEndpointRequest $request, array $callOp * * The async variant is {@see RegionNotificationEndpointsClient::insertAsync()} . * + * @example samples/V1/RegionNotificationEndpointsClient/insert.php + * * @param InsertRegionNotificationEndpointRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -318,6 +324,8 @@ public function insert(InsertRegionNotificationEndpointRequest $request, array $ * * The async variant is {@see RegionNotificationEndpointsClient::listAsync()} . * + * @example samples/V1/RegionNotificationEndpointsClient/list.php + * * @param ListRegionNotificationEndpointsRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/RegionOperationsClient.php b/Compute/src/V1/Client/RegionOperationsClient.php index e65f5f1ea50e..2f5fd4e395f1 100644 --- a/Compute/src/V1/Client/RegionOperationsClient.php +++ b/Compute/src/V1/Client/RegionOperationsClient.php @@ -190,6 +190,8 @@ public function __call($method, $args) * * The async variant is {@see RegionOperationsClient::deleteAsync()} . * + * @example samples/V1/RegionOperationsClient/delete.php + * * @param DeleteRegionOperationRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -214,6 +216,8 @@ public function delete(DeleteRegionOperationRequest $request, array $callOptions * * The async variant is {@see RegionOperationsClient::getAsync()} . * + * @example samples/V1/RegionOperationsClient/get.php + * * @param GetRegionOperationRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -238,6 +242,8 @@ public function get(GetRegionOperationRequest $request, array $callOptions = []) * * The async variant is {@see RegionOperationsClient::listAsync()} . * + * @example samples/V1/RegionOperationsClient/list.php + * * @param ListRegionOperationsRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -262,6 +268,8 @@ public function list(ListRegionOperationsRequest $request, array $callOptions = * * The async variant is {@see RegionOperationsClient::waitAsync()} . * + * @example samples/V1/RegionOperationsClient/wait.php + * * @param WaitRegionOperationRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/RegionSecurityPoliciesClient.php b/Compute/src/V1/Client/RegionSecurityPoliciesClient.php index ecbd14ed60f4..d919fe901a70 100644 --- a/Compute/src/V1/Client/RegionSecurityPoliciesClient.php +++ b/Compute/src/V1/Client/RegionSecurityPoliciesClient.php @@ -259,6 +259,8 @@ public function __call($method, $args) * * The async variant is {@see RegionSecurityPoliciesClient::addRuleAsync()} . * + * @example samples/V1/RegionSecurityPoliciesClient/add_rule.php + * * @param AddRuleRegionSecurityPolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -283,6 +285,8 @@ public function addRule(AddRuleRegionSecurityPolicyRequest $request, array $call * * The async variant is {@see RegionSecurityPoliciesClient::deleteAsync()} . * + * @example samples/V1/RegionSecurityPoliciesClient/delete.php + * * @param DeleteRegionSecurityPolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -307,6 +311,8 @@ public function delete(DeleteRegionSecurityPolicyRequest $request, array $callOp * * The async variant is {@see RegionSecurityPoliciesClient::getAsync()} . * + * @example samples/V1/RegionSecurityPoliciesClient/get.php + * * @param GetRegionSecurityPolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -331,6 +337,8 @@ public function get(GetRegionSecurityPolicyRequest $request, array $callOptions * * The async variant is {@see RegionSecurityPoliciesClient::getRuleAsync()} . * + * @example samples/V1/RegionSecurityPoliciesClient/get_rule.php + * * @param GetRuleRegionSecurityPolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -355,6 +363,8 @@ public function getRule(GetRuleRegionSecurityPolicyRequest $request, array $call * * The async variant is {@see RegionSecurityPoliciesClient::insertAsync()} . * + * @example samples/V1/RegionSecurityPoliciesClient/insert.php + * * @param InsertRegionSecurityPolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -379,6 +389,8 @@ public function insert(InsertRegionSecurityPolicyRequest $request, array $callOp * * The async variant is {@see RegionSecurityPoliciesClient::listAsync()} . * + * @example samples/V1/RegionSecurityPoliciesClient/list.php + * * @param ListRegionSecurityPoliciesRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -403,6 +415,8 @@ public function list(ListRegionSecurityPoliciesRequest $request, array $callOpti * * The async variant is {@see RegionSecurityPoliciesClient::patchAsync()} . * + * @example samples/V1/RegionSecurityPoliciesClient/patch.php + * * @param PatchRegionSecurityPolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -427,6 +441,8 @@ public function patch(PatchRegionSecurityPolicyRequest $request, array $callOpti * * The async variant is {@see RegionSecurityPoliciesClient::patchRuleAsync()} . * + * @example samples/V1/RegionSecurityPoliciesClient/patch_rule.php + * * @param PatchRuleRegionSecurityPolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -451,6 +467,8 @@ public function patchRule(PatchRuleRegionSecurityPolicyRequest $request, array $ * * The async variant is {@see RegionSecurityPoliciesClient::removeRuleAsync()} . * + * @example samples/V1/RegionSecurityPoliciesClient/remove_rule.php + * * @param RemoveRuleRegionSecurityPolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -475,6 +493,8 @@ public function removeRule(RemoveRuleRegionSecurityPolicyRequest $request, array * * The async variant is {@see RegionSecurityPoliciesClient::setLabelsAsync()} . * + * @example samples/V1/RegionSecurityPoliciesClient/set_labels.php + * * @param SetLabelsRegionSecurityPolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/RegionSslCertificatesClient.php b/Compute/src/V1/Client/RegionSslCertificatesClient.php index dcacff0780dd..3d5b9a876d49 100644 --- a/Compute/src/V1/Client/RegionSslCertificatesClient.php +++ b/Compute/src/V1/Client/RegionSslCertificatesClient.php @@ -246,6 +246,8 @@ public function __call($method, $args) * * The async variant is {@see RegionSslCertificatesClient::deleteAsync()} . * + * @example samples/V1/RegionSslCertificatesClient/delete.php + * * @param DeleteRegionSslCertificateRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -270,6 +272,8 @@ public function delete(DeleteRegionSslCertificateRequest $request, array $callOp * * The async variant is {@see RegionSslCertificatesClient::getAsync()} . * + * @example samples/V1/RegionSslCertificatesClient/get.php + * * @param GetRegionSslCertificateRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -294,6 +298,8 @@ public function get(GetRegionSslCertificateRequest $request, array $callOptions * * The async variant is {@see RegionSslCertificatesClient::insertAsync()} . * + * @example samples/V1/RegionSslCertificatesClient/insert.php + * * @param InsertRegionSslCertificateRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -318,6 +324,8 @@ public function insert(InsertRegionSslCertificateRequest $request, array $callOp * * The async variant is {@see RegionSslCertificatesClient::listAsync()} . * + * @example samples/V1/RegionSslCertificatesClient/list.php + * * @param ListRegionSslCertificatesRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/RegionSslPoliciesClient.php b/Compute/src/V1/Client/RegionSslPoliciesClient.php index 81729c42eb32..7df2e03b5339 100644 --- a/Compute/src/V1/Client/RegionSslPoliciesClient.php +++ b/Compute/src/V1/Client/RegionSslPoliciesClient.php @@ -251,6 +251,8 @@ public function __call($method, $args) * * The async variant is {@see RegionSslPoliciesClient::deleteAsync()} . * + * @example samples/V1/RegionSslPoliciesClient/delete.php + * * @param DeleteRegionSslPolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -275,6 +277,8 @@ public function delete(DeleteRegionSslPolicyRequest $request, array $callOptions * * The async variant is {@see RegionSslPoliciesClient::getAsync()} . * + * @example samples/V1/RegionSslPoliciesClient/get.php + * * @param GetRegionSslPolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -299,6 +303,8 @@ public function get(GetRegionSslPolicyRequest $request, array $callOptions = []) * * The async variant is {@see RegionSslPoliciesClient::insertAsync()} . * + * @example samples/V1/RegionSslPoliciesClient/insert.php + * * @param InsertRegionSslPolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -323,6 +329,8 @@ public function insert(InsertRegionSslPolicyRequest $request, array $callOptions * * The async variant is {@see RegionSslPoliciesClient::listAsync()} . * + * @example samples/V1/RegionSslPoliciesClient/list.php + * * @param ListRegionSslPoliciesRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -348,6 +356,8 @@ public function list(ListRegionSslPoliciesRequest $request, array $callOptions = * The async variant is * {@see RegionSslPoliciesClient::listAvailableFeaturesAsync()} . * + * @example samples/V1/RegionSslPoliciesClient/list_available_features.php + * * @param ListAvailableFeaturesRegionSslPoliciesRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -372,6 +382,8 @@ public function listAvailableFeatures(ListAvailableFeaturesRegionSslPoliciesRequ * * The async variant is {@see RegionSslPoliciesClient::patchAsync()} . * + * @example samples/V1/RegionSslPoliciesClient/patch.php + * * @param PatchRegionSslPolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/RegionTargetHttpProxiesClient.php b/Compute/src/V1/Client/RegionTargetHttpProxiesClient.php index 8b14b85c1f16..0770699107cf 100644 --- a/Compute/src/V1/Client/RegionTargetHttpProxiesClient.php +++ b/Compute/src/V1/Client/RegionTargetHttpProxiesClient.php @@ -248,6 +248,8 @@ public function __call($method, $args) * * The async variant is {@see RegionTargetHttpProxiesClient::deleteAsync()} . * + * @example samples/V1/RegionTargetHttpProxiesClient/delete.php + * * @param DeleteRegionTargetHttpProxyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -272,6 +274,8 @@ public function delete(DeleteRegionTargetHttpProxyRequest $request, array $callO * * The async variant is {@see RegionTargetHttpProxiesClient::getAsync()} . * + * @example samples/V1/RegionTargetHttpProxiesClient/get.php + * * @param GetRegionTargetHttpProxyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -296,6 +300,8 @@ public function get(GetRegionTargetHttpProxyRequest $request, array $callOptions * * The async variant is {@see RegionTargetHttpProxiesClient::insertAsync()} . * + * @example samples/V1/RegionTargetHttpProxiesClient/insert.php + * * @param InsertRegionTargetHttpProxyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -320,6 +326,8 @@ public function insert(InsertRegionTargetHttpProxyRequest $request, array $callO * * The async variant is {@see RegionTargetHttpProxiesClient::listAsync()} . * + * @example samples/V1/RegionTargetHttpProxiesClient/list.php + * * @param ListRegionTargetHttpProxiesRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -344,6 +352,8 @@ public function list(ListRegionTargetHttpProxiesRequest $request, array $callOpt * * The async variant is {@see RegionTargetHttpProxiesClient::setUrlMapAsync()} . * + * @example samples/V1/RegionTargetHttpProxiesClient/set_url_map.php + * * @param SetUrlMapRegionTargetHttpProxyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/RegionTargetHttpsProxiesClient.php b/Compute/src/V1/Client/RegionTargetHttpsProxiesClient.php index abf70fc3ed7d..1788751bcec4 100644 --- a/Compute/src/V1/Client/RegionTargetHttpsProxiesClient.php +++ b/Compute/src/V1/Client/RegionTargetHttpsProxiesClient.php @@ -252,6 +252,8 @@ public function __call($method, $args) * * The async variant is {@see RegionTargetHttpsProxiesClient::deleteAsync()} . * + * @example samples/V1/RegionTargetHttpsProxiesClient/delete.php + * * @param DeleteRegionTargetHttpsProxyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -276,6 +278,8 @@ public function delete(DeleteRegionTargetHttpsProxyRequest $request, array $call * * The async variant is {@see RegionTargetHttpsProxiesClient::getAsync()} . * + * @example samples/V1/RegionTargetHttpsProxiesClient/get.php + * * @param GetRegionTargetHttpsProxyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -300,6 +304,8 @@ public function get(GetRegionTargetHttpsProxyRequest $request, array $callOption * * The async variant is {@see RegionTargetHttpsProxiesClient::insertAsync()} . * + * @example samples/V1/RegionTargetHttpsProxiesClient/insert.php + * * @param InsertRegionTargetHttpsProxyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -324,6 +330,8 @@ public function insert(InsertRegionTargetHttpsProxyRequest $request, array $call * * The async variant is {@see RegionTargetHttpsProxiesClient::listAsync()} . * + * @example samples/V1/RegionTargetHttpsProxiesClient/list.php + * * @param ListRegionTargetHttpsProxiesRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -348,6 +356,8 @@ public function list(ListRegionTargetHttpsProxiesRequest $request, array $callOp * * The async variant is {@see RegionTargetHttpsProxiesClient::patchAsync()} . * + * @example samples/V1/RegionTargetHttpsProxiesClient/patch.php + * * @param PatchRegionTargetHttpsProxyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -373,6 +383,8 @@ public function patch(PatchRegionTargetHttpsProxyRequest $request, array $callOp * The async variant is * {@see RegionTargetHttpsProxiesClient::setSslCertificatesAsync()} . * + * @example samples/V1/RegionTargetHttpsProxiesClient/set_ssl_certificates.php + * * @param SetSslCertificatesRegionTargetHttpsProxyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -397,6 +409,8 @@ public function setSslCertificates(SetSslCertificatesRegionTargetHttpsProxyReque * * The async variant is {@see RegionTargetHttpsProxiesClient::setUrlMapAsync()} . * + * @example samples/V1/RegionTargetHttpsProxiesClient/set_url_map.php + * * @param SetUrlMapRegionTargetHttpsProxyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/RegionTargetTcpProxiesClient.php b/Compute/src/V1/Client/RegionTargetTcpProxiesClient.php index db6f5d123f97..d9594d70602f 100644 --- a/Compute/src/V1/Client/RegionTargetTcpProxiesClient.php +++ b/Compute/src/V1/Client/RegionTargetTcpProxiesClient.php @@ -246,6 +246,8 @@ public function __call($method, $args) * * The async variant is {@see RegionTargetTcpProxiesClient::deleteAsync()} . * + * @example samples/V1/RegionTargetTcpProxiesClient/delete.php + * * @param DeleteRegionTargetTcpProxyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -270,6 +272,8 @@ public function delete(DeleteRegionTargetTcpProxyRequest $request, array $callOp * * The async variant is {@see RegionTargetTcpProxiesClient::getAsync()} . * + * @example samples/V1/RegionTargetTcpProxiesClient/get.php + * * @param GetRegionTargetTcpProxyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -294,6 +298,8 @@ public function get(GetRegionTargetTcpProxyRequest $request, array $callOptions * * The async variant is {@see RegionTargetTcpProxiesClient::insertAsync()} . * + * @example samples/V1/RegionTargetTcpProxiesClient/insert.php + * * @param InsertRegionTargetTcpProxyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -318,6 +324,8 @@ public function insert(InsertRegionTargetTcpProxyRequest $request, array $callOp * * The async variant is {@see RegionTargetTcpProxiesClient::listAsync()} . * + * @example samples/V1/RegionTargetTcpProxiesClient/list.php + * * @param ListRegionTargetTcpProxiesRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/RegionUrlMapsClient.php b/Compute/src/V1/Client/RegionUrlMapsClient.php index 8e228a303952..bf29c8fc2cdb 100644 --- a/Compute/src/V1/Client/RegionUrlMapsClient.php +++ b/Compute/src/V1/Client/RegionUrlMapsClient.php @@ -253,6 +253,8 @@ public function __call($method, $args) * * The async variant is {@see RegionUrlMapsClient::deleteAsync()} . * + * @example samples/V1/RegionUrlMapsClient/delete.php + * * @param DeleteRegionUrlMapRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -277,6 +279,8 @@ public function delete(DeleteRegionUrlMapRequest $request, array $callOptions = * * The async variant is {@see RegionUrlMapsClient::getAsync()} . * + * @example samples/V1/RegionUrlMapsClient/get.php + * * @param GetRegionUrlMapRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -301,6 +305,8 @@ public function get(GetRegionUrlMapRequest $request, array $callOptions = []): U * * The async variant is {@see RegionUrlMapsClient::insertAsync()} . * + * @example samples/V1/RegionUrlMapsClient/insert.php + * * @param InsertRegionUrlMapRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -325,6 +331,8 @@ public function insert(InsertRegionUrlMapRequest $request, array $callOptions = * * The async variant is {@see RegionUrlMapsClient::listAsync()} . * + * @example samples/V1/RegionUrlMapsClient/list.php + * * @param ListRegionUrlMapsRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -349,6 +357,8 @@ public function list(ListRegionUrlMapsRequest $request, array $callOptions = []) * * The async variant is {@see RegionUrlMapsClient::patchAsync()} . * + * @example samples/V1/RegionUrlMapsClient/patch.php + * * @param PatchRegionUrlMapRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -373,6 +383,8 @@ public function patch(PatchRegionUrlMapRequest $request, array $callOptions = [] * * The async variant is {@see RegionUrlMapsClient::updateAsync()} . * + * @example samples/V1/RegionUrlMapsClient/update.php + * * @param UpdateRegionUrlMapRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -397,6 +409,8 @@ public function update(UpdateRegionUrlMapRequest $request, array $callOptions = * * The async variant is {@see RegionUrlMapsClient::validateAsync()} . * + * @example samples/V1/RegionUrlMapsClient/validate.php + * * @param ValidateRegionUrlMapRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/RegionZonesClient.php b/Compute/src/V1/Client/RegionZonesClient.php index 3dd7458bfbd0..44afcc070741 100644 --- a/Compute/src/V1/Client/RegionZonesClient.php +++ b/Compute/src/V1/Client/RegionZonesClient.php @@ -183,6 +183,8 @@ public function __call($method, $args) * * The async variant is {@see RegionZonesClient::listAsync()} . * + * @example samples/V1/RegionZonesClient/list.php + * * @param ListRegionZonesRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/RegionsClient.php b/Compute/src/V1/Client/RegionsClient.php index f51d34e549ce..a011de396a2d 100644 --- a/Compute/src/V1/Client/RegionsClient.php +++ b/Compute/src/V1/Client/RegionsClient.php @@ -186,6 +186,8 @@ public function __call($method, $args) * * The async variant is {@see RegionsClient::getAsync()} . * + * @example samples/V1/RegionsClient/get.php + * * @param GetRegionRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -210,6 +212,8 @@ public function get(GetRegionRequest $request, array $callOptions = []): Region * * The async variant is {@see RegionsClient::listAsync()} . * + * @example samples/V1/RegionsClient/list.php + * * @param ListRegionsRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/ReservationsClient.php b/Compute/src/V1/Client/ReservationsClient.php index 1c0a64055b56..9825305de9d5 100644 --- a/Compute/src/V1/Client/ReservationsClient.php +++ b/Compute/src/V1/Client/ReservationsClient.php @@ -260,6 +260,8 @@ public function __call($method, $args) * * The async variant is {@see ReservationsClient::aggregatedListAsync()} . * + * @example samples/V1/ReservationsClient/aggregated_list.php + * * @param AggregatedListReservationsRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -284,6 +286,8 @@ public function aggregatedList(AggregatedListReservationsRequest $request, array * * The async variant is {@see ReservationsClient::deleteAsync()} . * + * @example samples/V1/ReservationsClient/delete.php + * * @param DeleteReservationRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -308,6 +312,8 @@ public function delete(DeleteReservationRequest $request, array $callOptions = [ * * The async variant is {@see ReservationsClient::getAsync()} . * + * @example samples/V1/ReservationsClient/get.php + * * @param GetReservationRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -332,6 +338,8 @@ public function get(GetReservationRequest $request, array $callOptions = []): Re * * The async variant is {@see ReservationsClient::getIamPolicyAsync()} . * + * @example samples/V1/ReservationsClient/get_iam_policy.php + * * @param GetIamPolicyReservationRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -356,6 +364,8 @@ public function getIamPolicy(GetIamPolicyReservationRequest $request, array $cal * * The async variant is {@see ReservationsClient::insertAsync()} . * + * @example samples/V1/ReservationsClient/insert.php + * * @param InsertReservationRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -380,6 +390,8 @@ public function insert(InsertReservationRequest $request, array $callOptions = [ * * The async variant is {@see ReservationsClient::listAsync()} . * + * @example samples/V1/ReservationsClient/list.php + * * @param ListReservationsRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -404,6 +416,8 @@ public function list(ListReservationsRequest $request, array $callOptions = []): * * The async variant is {@see ReservationsClient::resizeAsync()} . * + * @example samples/V1/ReservationsClient/resize.php + * * @param ResizeReservationRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -428,6 +442,8 @@ public function resize(ResizeReservationRequest $request, array $callOptions = [ * * The async variant is {@see ReservationsClient::setIamPolicyAsync()} . * + * @example samples/V1/ReservationsClient/set_iam_policy.php + * * @param SetIamPolicyReservationRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -452,6 +468,8 @@ public function setIamPolicy(SetIamPolicyReservationRequest $request, array $cal * * The async variant is {@see ReservationsClient::testIamPermissionsAsync()} . * + * @example samples/V1/ReservationsClient/test_iam_permissions.php + * * @param TestIamPermissionsReservationRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -476,6 +494,8 @@ public function testIamPermissions(TestIamPermissionsReservationRequest $request * * The async variant is {@see ReservationsClient::updateAsync()} . * + * @example samples/V1/ReservationsClient/update.php + * * @param UpdateReservationRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/ResourcePoliciesClient.php b/Compute/src/V1/Client/ResourcePoliciesClient.php index c36187cdf5dd..322971a4f40a 100644 --- a/Compute/src/V1/Client/ResourcePoliciesClient.php +++ b/Compute/src/V1/Client/ResourcePoliciesClient.php @@ -258,6 +258,8 @@ public function __call($method, $args) * * The async variant is {@see ResourcePoliciesClient::aggregatedListAsync()} . * + * @example samples/V1/ResourcePoliciesClient/aggregated_list.php + * * @param AggregatedListResourcePoliciesRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -282,6 +284,8 @@ public function aggregatedList(AggregatedListResourcePoliciesRequest $request, a * * The async variant is {@see ResourcePoliciesClient::deleteAsync()} . * + * @example samples/V1/ResourcePoliciesClient/delete.php + * * @param DeleteResourcePolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -306,6 +310,8 @@ public function delete(DeleteResourcePolicyRequest $request, array $callOptions * * The async variant is {@see ResourcePoliciesClient::getAsync()} . * + * @example samples/V1/ResourcePoliciesClient/get.php + * * @param GetResourcePolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -330,6 +336,8 @@ public function get(GetResourcePolicyRequest $request, array $callOptions = []): * * The async variant is {@see ResourcePoliciesClient::getIamPolicyAsync()} . * + * @example samples/V1/ResourcePoliciesClient/get_iam_policy.php + * * @param GetIamPolicyResourcePolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -354,6 +362,8 @@ public function getIamPolicy(GetIamPolicyResourcePolicyRequest $request, array $ * * The async variant is {@see ResourcePoliciesClient::insertAsync()} . * + * @example samples/V1/ResourcePoliciesClient/insert.php + * * @param InsertResourcePolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -378,6 +388,8 @@ public function insert(InsertResourcePolicyRequest $request, array $callOptions * * The async variant is {@see ResourcePoliciesClient::listAsync()} . * + * @example samples/V1/ResourcePoliciesClient/list.php + * * @param ListResourcePoliciesRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -402,6 +414,8 @@ public function list(ListResourcePoliciesRequest $request, array $callOptions = * * The async variant is {@see ResourcePoliciesClient::patchAsync()} . * + * @example samples/V1/ResourcePoliciesClient/patch.php + * * @param PatchResourcePolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -426,6 +440,8 @@ public function patch(PatchResourcePolicyRequest $request, array $callOptions = * * The async variant is {@see ResourcePoliciesClient::setIamPolicyAsync()} . * + * @example samples/V1/ResourcePoliciesClient/set_iam_policy.php + * * @param SetIamPolicyResourcePolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -450,6 +466,8 @@ public function setIamPolicy(SetIamPolicyResourcePolicyRequest $request, array $ * * The async variant is {@see ResourcePoliciesClient::testIamPermissionsAsync()} . * + * @example samples/V1/ResourcePoliciesClient/test_iam_permissions.php + * * @param TestIamPermissionsResourcePolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/RoutersClient.php b/Compute/src/V1/Client/RoutersClient.php index 4402f17662ea..008704b98377 100644 --- a/Compute/src/V1/Client/RoutersClient.php +++ b/Compute/src/V1/Client/RoutersClient.php @@ -263,6 +263,8 @@ public function __call($method, $args) * * The async variant is {@see RoutersClient::aggregatedListAsync()} . * + * @example samples/V1/RoutersClient/aggregated_list.php + * * @param AggregatedListRoutersRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -287,6 +289,8 @@ public function aggregatedList(AggregatedListRoutersRequest $request, array $cal * * The async variant is {@see RoutersClient::deleteAsync()} . * + * @example samples/V1/RoutersClient/delete.php + * * @param DeleteRouterRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -311,6 +315,8 @@ public function delete(DeleteRouterRequest $request, array $callOptions = []): O * * The async variant is {@see RoutersClient::getAsync()} . * + * @example samples/V1/RoutersClient/get.php + * * @param GetRouterRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -335,6 +341,8 @@ public function get(GetRouterRequest $request, array $callOptions = []): Router * * The async variant is {@see RoutersClient::getNatIpInfoAsync()} . * + * @example samples/V1/RoutersClient/get_nat_ip_info.php + * * @param GetNatIpInfoRouterRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -359,6 +367,8 @@ public function getNatIpInfo(GetNatIpInfoRouterRequest $request, array $callOpti * * The async variant is {@see RoutersClient::getNatMappingInfoAsync()} . * + * @example samples/V1/RoutersClient/get_nat_mapping_info.php + * * @param GetNatMappingInfoRoutersRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -383,6 +393,8 @@ public function getNatMappingInfo(GetNatMappingInfoRoutersRequest $request, arra * * The async variant is {@see RoutersClient::getRouterStatusAsync()} . * + * @example samples/V1/RoutersClient/get_router_status.php + * * @param GetRouterStatusRouterRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -407,6 +419,8 @@ public function getRouterStatus(GetRouterStatusRouterRequest $request, array $ca * * The async variant is {@see RoutersClient::insertAsync()} . * + * @example samples/V1/RoutersClient/insert.php + * * @param InsertRouterRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -431,6 +445,8 @@ public function insert(InsertRouterRequest $request, array $callOptions = []): O * * The async variant is {@see RoutersClient::listAsync()} . * + * @example samples/V1/RoutersClient/list.php + * * @param ListRoutersRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -455,6 +471,8 @@ public function list(ListRoutersRequest $request, array $callOptions = []): Page * * The async variant is {@see RoutersClient::patchAsync()} . * + * @example samples/V1/RoutersClient/patch.php + * * @param PatchRouterRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -479,6 +497,8 @@ public function patch(PatchRouterRequest $request, array $callOptions = []): Ope * * The async variant is {@see RoutersClient::previewAsync()} . * + * @example samples/V1/RoutersClient/preview.php + * * @param PreviewRouterRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -503,6 +523,8 @@ public function preview(PreviewRouterRequest $request, array $callOptions = []): * * The async variant is {@see RoutersClient::updateAsync()} . * + * @example samples/V1/RoutersClient/update.php + * * @param UpdateRouterRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/RoutesClient.php b/Compute/src/V1/Client/RoutesClient.php index 79bc3b504c0a..ce70283d3777 100644 --- a/Compute/src/V1/Client/RoutesClient.php +++ b/Compute/src/V1/Client/RoutesClient.php @@ -245,6 +245,8 @@ public function __call($method, $args) * * The async variant is {@see RoutesClient::deleteAsync()} . * + * @example samples/V1/RoutesClient/delete.php + * * @param DeleteRouteRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -269,6 +271,8 @@ public function delete(DeleteRouteRequest $request, array $callOptions = []): Op * * The async variant is {@see RoutesClient::getAsync()} . * + * @example samples/V1/RoutesClient/get.php + * * @param GetRouteRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -293,6 +297,8 @@ public function get(GetRouteRequest $request, array $callOptions = []): Route * * The async variant is {@see RoutesClient::insertAsync()} . * + * @example samples/V1/RoutesClient/insert.php + * * @param InsertRouteRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -317,6 +323,8 @@ public function insert(InsertRouteRequest $request, array $callOptions = []): Op * * The async variant is {@see RoutesClient::listAsync()} . * + * @example samples/V1/RoutesClient/list.php + * * @param ListRoutesRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/SecurityPoliciesClient.php b/Compute/src/V1/Client/SecurityPoliciesClient.php index 179d0f9f06e4..c18ebe5651f8 100644 --- a/Compute/src/V1/Client/SecurityPoliciesClient.php +++ b/Compute/src/V1/Client/SecurityPoliciesClient.php @@ -263,6 +263,8 @@ public function __call($method, $args) * * The async variant is {@see SecurityPoliciesClient::addRuleAsync()} . * + * @example samples/V1/SecurityPoliciesClient/add_rule.php + * * @param AddRuleSecurityPolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -287,6 +289,8 @@ public function addRule(AddRuleSecurityPolicyRequest $request, array $callOption * * The async variant is {@see SecurityPoliciesClient::aggregatedListAsync()} . * + * @example samples/V1/SecurityPoliciesClient/aggregated_list.php + * * @param AggregatedListSecurityPoliciesRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -311,6 +315,8 @@ public function aggregatedList(AggregatedListSecurityPoliciesRequest $request, a * * The async variant is {@see SecurityPoliciesClient::deleteAsync()} . * + * @example samples/V1/SecurityPoliciesClient/delete.php + * * @param DeleteSecurityPolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -335,6 +341,8 @@ public function delete(DeleteSecurityPolicyRequest $request, array $callOptions * * The async variant is {@see SecurityPoliciesClient::getAsync()} . * + * @example samples/V1/SecurityPoliciesClient/get.php + * * @param GetSecurityPolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -359,6 +367,8 @@ public function get(GetSecurityPolicyRequest $request, array $callOptions = []): * * The async variant is {@see SecurityPoliciesClient::getRuleAsync()} . * + * @example samples/V1/SecurityPoliciesClient/get_rule.php + * * @param GetRuleSecurityPolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -383,6 +393,8 @@ public function getRule(GetRuleSecurityPolicyRequest $request, array $callOption * * The async variant is {@see SecurityPoliciesClient::insertAsync()} . * + * @example samples/V1/SecurityPoliciesClient/insert.php + * * @param InsertSecurityPolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -407,6 +419,8 @@ public function insert(InsertSecurityPolicyRequest $request, array $callOptions * * The async variant is {@see SecurityPoliciesClient::listAsync()} . * + * @example samples/V1/SecurityPoliciesClient/list.php + * * @param ListSecurityPoliciesRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -432,6 +446,8 @@ public function list(ListSecurityPoliciesRequest $request, array $callOptions = * The async variant is * {@see SecurityPoliciesClient::listPreconfiguredExpressionSetsAsync()} . * + * @example samples/V1/SecurityPoliciesClient/list_preconfigured_expression_sets.php + * * @param ListPreconfiguredExpressionSetsSecurityPoliciesRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -456,6 +472,8 @@ public function listPreconfiguredExpressionSets(ListPreconfiguredExpressionSetsS * * The async variant is {@see SecurityPoliciesClient::patchAsync()} . * + * @example samples/V1/SecurityPoliciesClient/patch.php + * * @param PatchSecurityPolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -480,6 +498,8 @@ public function patch(PatchSecurityPolicyRequest $request, array $callOptions = * * The async variant is {@see SecurityPoliciesClient::patchRuleAsync()} . * + * @example samples/V1/SecurityPoliciesClient/patch_rule.php + * * @param PatchRuleSecurityPolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -504,6 +524,8 @@ public function patchRule(PatchRuleSecurityPolicyRequest $request, array $callOp * * The async variant is {@see SecurityPoliciesClient::removeRuleAsync()} . * + * @example samples/V1/SecurityPoliciesClient/remove_rule.php + * * @param RemoveRuleSecurityPolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -528,6 +550,8 @@ public function removeRule(RemoveRuleSecurityPolicyRequest $request, array $call * * The async variant is {@see SecurityPoliciesClient::setLabelsAsync()} . * + * @example samples/V1/SecurityPoliciesClient/set_labels.php + * * @param SetLabelsSecurityPolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/ServiceAttachmentsClient.php b/Compute/src/V1/Client/ServiceAttachmentsClient.php index f5e388b8f3e6..39e005bd3dcb 100644 --- a/Compute/src/V1/Client/ServiceAttachmentsClient.php +++ b/Compute/src/V1/Client/ServiceAttachmentsClient.php @@ -258,6 +258,8 @@ public function __call($method, $args) * * The async variant is {@see ServiceAttachmentsClient::aggregatedListAsync()} . * + * @example samples/V1/ServiceAttachmentsClient/aggregated_list.php + * * @param AggregatedListServiceAttachmentsRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -282,6 +284,8 @@ public function aggregatedList(AggregatedListServiceAttachmentsRequest $request, * * The async variant is {@see ServiceAttachmentsClient::deleteAsync()} . * + * @example samples/V1/ServiceAttachmentsClient/delete.php + * * @param DeleteServiceAttachmentRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -306,6 +310,8 @@ public function delete(DeleteServiceAttachmentRequest $request, array $callOptio * * The async variant is {@see ServiceAttachmentsClient::getAsync()} . * + * @example samples/V1/ServiceAttachmentsClient/get.php + * * @param GetServiceAttachmentRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -330,6 +336,8 @@ public function get(GetServiceAttachmentRequest $request, array $callOptions = [ * * The async variant is {@see ServiceAttachmentsClient::getIamPolicyAsync()} . * + * @example samples/V1/ServiceAttachmentsClient/get_iam_policy.php + * * @param GetIamPolicyServiceAttachmentRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -354,6 +362,8 @@ public function getIamPolicy(GetIamPolicyServiceAttachmentRequest $request, arra * * The async variant is {@see ServiceAttachmentsClient::insertAsync()} . * + * @example samples/V1/ServiceAttachmentsClient/insert.php + * * @param InsertServiceAttachmentRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -378,6 +388,8 @@ public function insert(InsertServiceAttachmentRequest $request, array $callOptio * * The async variant is {@see ServiceAttachmentsClient::listAsync()} . * + * @example samples/V1/ServiceAttachmentsClient/list.php + * * @param ListServiceAttachmentsRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -402,6 +414,8 @@ public function list(ListServiceAttachmentsRequest $request, array $callOptions * * The async variant is {@see ServiceAttachmentsClient::patchAsync()} . * + * @example samples/V1/ServiceAttachmentsClient/patch.php + * * @param PatchServiceAttachmentRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -426,6 +440,8 @@ public function patch(PatchServiceAttachmentRequest $request, array $callOptions * * The async variant is {@see ServiceAttachmentsClient::setIamPolicyAsync()} . * + * @example samples/V1/ServiceAttachmentsClient/set_iam_policy.php + * * @param SetIamPolicyServiceAttachmentRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -451,6 +467,8 @@ public function setIamPolicy(SetIamPolicyServiceAttachmentRequest $request, arra * The async variant is {@see ServiceAttachmentsClient::testIamPermissionsAsync()} * . * + * @example samples/V1/ServiceAttachmentsClient/test_iam_permissions.php + * * @param TestIamPermissionsServiceAttachmentRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/SnapshotSettingsServiceClient.php b/Compute/src/V1/Client/SnapshotSettingsServiceClient.php index f337d5ca5055..962e9c7ea8dc 100644 --- a/Compute/src/V1/Client/SnapshotSettingsServiceClient.php +++ b/Compute/src/V1/Client/SnapshotSettingsServiceClient.php @@ -240,6 +240,8 @@ public function __call($method, $args) * * The async variant is {@see SnapshotSettingsServiceClient::getAsync()} . * + * @example samples/V1/SnapshotSettingsServiceClient/get.php + * * @param GetSnapshotSettingRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -264,6 +266,8 @@ public function get(GetSnapshotSettingRequest $request, array $callOptions = []) * * The async variant is {@see SnapshotSettingsServiceClient::patchAsync()} . * + * @example samples/V1/SnapshotSettingsServiceClient/patch.php + * * @param PatchSnapshotSettingRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/SnapshotsClient.php b/Compute/src/V1/Client/SnapshotsClient.php index 57a5c4796acd..3794b147dba3 100644 --- a/Compute/src/V1/Client/SnapshotsClient.php +++ b/Compute/src/V1/Client/SnapshotsClient.php @@ -255,6 +255,8 @@ public function __call($method, $args) * * The async variant is {@see SnapshotsClient::deleteAsync()} . * + * @example samples/V1/SnapshotsClient/delete.php + * * @param DeleteSnapshotRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -279,6 +281,8 @@ public function delete(DeleteSnapshotRequest $request, array $callOptions = []): * * The async variant is {@see SnapshotsClient::getAsync()} . * + * @example samples/V1/SnapshotsClient/get.php + * * @param GetSnapshotRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -303,6 +307,8 @@ public function get(GetSnapshotRequest $request, array $callOptions = []): Snaps * * The async variant is {@see SnapshotsClient::getIamPolicyAsync()} . * + * @example samples/V1/SnapshotsClient/get_iam_policy.php + * * @param GetIamPolicySnapshotRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -327,6 +333,8 @@ public function getIamPolicy(GetIamPolicySnapshotRequest $request, array $callOp * * The async variant is {@see SnapshotsClient::insertAsync()} . * + * @example samples/V1/SnapshotsClient/insert.php + * * @param InsertSnapshotRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -351,6 +359,8 @@ public function insert(InsertSnapshotRequest $request, array $callOptions = []): * * The async variant is {@see SnapshotsClient::listAsync()} . * + * @example samples/V1/SnapshotsClient/list.php + * * @param ListSnapshotsRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -375,6 +385,8 @@ public function list(ListSnapshotsRequest $request, array $callOptions = []): Pa * * The async variant is {@see SnapshotsClient::setIamPolicyAsync()} . * + * @example samples/V1/SnapshotsClient/set_iam_policy.php + * * @param SetIamPolicySnapshotRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -399,6 +411,8 @@ public function setIamPolicy(SetIamPolicySnapshotRequest $request, array $callOp * * The async variant is {@see SnapshotsClient::setLabelsAsync()} . * + * @example samples/V1/SnapshotsClient/set_labels.php + * * @param SetLabelsSnapshotRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -423,6 +437,8 @@ public function setLabels(SetLabelsSnapshotRequest $request, array $callOptions * * The async variant is {@see SnapshotsClient::testIamPermissionsAsync()} . * + * @example samples/V1/SnapshotsClient/test_iam_permissions.php + * * @param TestIamPermissionsSnapshotRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/SslCertificatesClient.php b/Compute/src/V1/Client/SslCertificatesClient.php index 1da44d8494b2..8e0f70be1dce 100644 --- a/Compute/src/V1/Client/SslCertificatesClient.php +++ b/Compute/src/V1/Client/SslCertificatesClient.php @@ -247,6 +247,8 @@ public function __call($method, $args) * * The async variant is {@see SslCertificatesClient::aggregatedListAsync()} . * + * @example samples/V1/SslCertificatesClient/aggregated_list.php + * * @param AggregatedListSslCertificatesRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -271,6 +273,8 @@ public function aggregatedList(AggregatedListSslCertificatesRequest $request, ar * * The async variant is {@see SslCertificatesClient::deleteAsync()} . * + * @example samples/V1/SslCertificatesClient/delete.php + * * @param DeleteSslCertificateRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -295,6 +299,8 @@ public function delete(DeleteSslCertificateRequest $request, array $callOptions * * The async variant is {@see SslCertificatesClient::getAsync()} . * + * @example samples/V1/SslCertificatesClient/get.php + * * @param GetSslCertificateRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -319,6 +325,8 @@ public function get(GetSslCertificateRequest $request, array $callOptions = []): * * The async variant is {@see SslCertificatesClient::insertAsync()} . * + * @example samples/V1/SslCertificatesClient/insert.php + * * @param InsertSslCertificateRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -343,6 +351,8 @@ public function insert(InsertSslCertificateRequest $request, array $callOptions * * The async variant is {@see SslCertificatesClient::listAsync()} . * + * @example samples/V1/SslCertificatesClient/list.php + * * @param ListSslCertificatesRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/SslPoliciesClient.php b/Compute/src/V1/Client/SslPoliciesClient.php index 1515c5c1e73d..9c6a9a9f7cf1 100644 --- a/Compute/src/V1/Client/SslPoliciesClient.php +++ b/Compute/src/V1/Client/SslPoliciesClient.php @@ -252,6 +252,8 @@ public function __call($method, $args) * * The async variant is {@see SslPoliciesClient::aggregatedListAsync()} . * + * @example samples/V1/SslPoliciesClient/aggregated_list.php + * * @param AggregatedListSslPoliciesRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -276,6 +278,8 @@ public function aggregatedList(AggregatedListSslPoliciesRequest $request, array * * The async variant is {@see SslPoliciesClient::deleteAsync()} . * + * @example samples/V1/SslPoliciesClient/delete.php + * * @param DeleteSslPolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -300,6 +304,8 @@ public function delete(DeleteSslPolicyRequest $request, array $callOptions = []) * * The async variant is {@see SslPoliciesClient::getAsync()} . * + * @example samples/V1/SslPoliciesClient/get.php + * * @param GetSslPolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -324,6 +330,8 @@ public function get(GetSslPolicyRequest $request, array $callOptions = []): SslP * * The async variant is {@see SslPoliciesClient::insertAsync()} . * + * @example samples/V1/SslPoliciesClient/insert.php + * * @param InsertSslPolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -348,6 +356,8 @@ public function insert(InsertSslPolicyRequest $request, array $callOptions = []) * * The async variant is {@see SslPoliciesClient::listAsync()} . * + * @example samples/V1/SslPoliciesClient/list.php + * * @param ListSslPoliciesRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -372,6 +382,8 @@ public function list(ListSslPoliciesRequest $request, array $callOptions = []): * * The async variant is {@see SslPoliciesClient::listAvailableFeaturesAsync()} . * + * @example samples/V1/SslPoliciesClient/list_available_features.php + * * @param ListAvailableFeaturesSslPoliciesRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -396,6 +408,8 @@ public function listAvailableFeatures(ListAvailableFeaturesSslPoliciesRequest $r * * The async variant is {@see SslPoliciesClient::patchAsync()} . * + * @example samples/V1/SslPoliciesClient/patch.php + * * @param PatchSslPolicyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/StoragePoolTypesClient.php b/Compute/src/V1/Client/StoragePoolTypesClient.php index 0fa94fcf19da..ff727ba4fecf 100644 --- a/Compute/src/V1/Client/StoragePoolTypesClient.php +++ b/Compute/src/V1/Client/StoragePoolTypesClient.php @@ -188,6 +188,8 @@ public function __call($method, $args) * * The async variant is {@see StoragePoolTypesClient::aggregatedListAsync()} . * + * @example samples/V1/StoragePoolTypesClient/aggregated_list.php + * * @param AggregatedListStoragePoolTypesRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -212,6 +214,8 @@ public function aggregatedList(AggregatedListStoragePoolTypesRequest $request, a * * The async variant is {@see StoragePoolTypesClient::getAsync()} . * + * @example samples/V1/StoragePoolTypesClient/get.php + * * @param GetStoragePoolTypeRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -236,6 +240,8 @@ public function get(GetStoragePoolTypeRequest $request, array $callOptions = []) * * The async variant is {@see StoragePoolTypesClient::listAsync()} . * + * @example samples/V1/StoragePoolTypesClient/list.php + * * @param ListStoragePoolTypesRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/StoragePoolsClient.php b/Compute/src/V1/Client/StoragePoolsClient.php index 08f09d87c876..42c9b35b383f 100644 --- a/Compute/src/V1/Client/StoragePoolsClient.php +++ b/Compute/src/V1/Client/StoragePoolsClient.php @@ -262,6 +262,8 @@ public function __call($method, $args) * * The async variant is {@see StoragePoolsClient::aggregatedListAsync()} . * + * @example samples/V1/StoragePoolsClient/aggregated_list.php + * * @param AggregatedListStoragePoolsRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -286,6 +288,8 @@ public function aggregatedList(AggregatedListStoragePoolsRequest $request, array * * The async variant is {@see StoragePoolsClient::deleteAsync()} . * + * @example samples/V1/StoragePoolsClient/delete.php + * * @param DeleteStoragePoolRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -310,6 +314,8 @@ public function delete(DeleteStoragePoolRequest $request, array $callOptions = [ * * The async variant is {@see StoragePoolsClient::getAsync()} . * + * @example samples/V1/StoragePoolsClient/get.php + * * @param GetStoragePoolRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -334,6 +340,8 @@ public function get(GetStoragePoolRequest $request, array $callOptions = []): St * * The async variant is {@see StoragePoolsClient::getIamPolicyAsync()} . * + * @example samples/V1/StoragePoolsClient/get_iam_policy.php + * * @param GetIamPolicyStoragePoolRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -358,6 +366,8 @@ public function getIamPolicy(GetIamPolicyStoragePoolRequest $request, array $cal * * The async variant is {@see StoragePoolsClient::insertAsync()} . * + * @example samples/V1/StoragePoolsClient/insert.php + * * @param InsertStoragePoolRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -382,6 +392,8 @@ public function insert(InsertStoragePoolRequest $request, array $callOptions = [ * * The async variant is {@see StoragePoolsClient::listAsync()} . * + * @example samples/V1/StoragePoolsClient/list.php + * * @param ListStoragePoolsRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -406,6 +418,8 @@ public function list(ListStoragePoolsRequest $request, array $callOptions = []): * * The async variant is {@see StoragePoolsClient::listDisksAsync()} . * + * @example samples/V1/StoragePoolsClient/list_disks.php + * * @param ListDisksStoragePoolsRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -430,6 +444,8 @@ public function listDisks(ListDisksStoragePoolsRequest $request, array $callOpti * * The async variant is {@see StoragePoolsClient::setIamPolicyAsync()} . * + * @example samples/V1/StoragePoolsClient/set_iam_policy.php + * * @param SetIamPolicyStoragePoolRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -454,6 +470,8 @@ public function setIamPolicy(SetIamPolicyStoragePoolRequest $request, array $cal * * The async variant is {@see StoragePoolsClient::testIamPermissionsAsync()} . * + * @example samples/V1/StoragePoolsClient/test_iam_permissions.php + * * @param TestIamPermissionsStoragePoolRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -478,6 +496,8 @@ public function testIamPermissions(TestIamPermissionsStoragePoolRequest $request * * The async variant is {@see StoragePoolsClient::updateAsync()} . * + * @example samples/V1/StoragePoolsClient/update.php + * * @param UpdateStoragePoolRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/SubnetworksClient.php b/Compute/src/V1/Client/SubnetworksClient.php index 631c1a7743dd..6978bf910156 100644 --- a/Compute/src/V1/Client/SubnetworksClient.php +++ b/Compute/src/V1/Client/SubnetworksClient.php @@ -264,6 +264,8 @@ public function __call($method, $args) * * The async variant is {@see SubnetworksClient::aggregatedListAsync()} . * + * @example samples/V1/SubnetworksClient/aggregated_list.php + * * @param AggregatedListSubnetworksRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -288,6 +290,8 @@ public function aggregatedList(AggregatedListSubnetworksRequest $request, array * * The async variant is {@see SubnetworksClient::deleteAsync()} . * + * @example samples/V1/SubnetworksClient/delete.php + * * @param DeleteSubnetworkRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -312,6 +316,8 @@ public function delete(DeleteSubnetworkRequest $request, array $callOptions = [] * * The async variant is {@see SubnetworksClient::expandIpCidrRangeAsync()} . * + * @example samples/V1/SubnetworksClient/expand_ip_cidr_range.php + * * @param ExpandIpCidrRangeSubnetworkRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -336,6 +342,8 @@ public function expandIpCidrRange(ExpandIpCidrRangeSubnetworkRequest $request, a * * The async variant is {@see SubnetworksClient::getAsync()} . * + * @example samples/V1/SubnetworksClient/get.php + * * @param GetSubnetworkRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -360,6 +368,8 @@ public function get(GetSubnetworkRequest $request, array $callOptions = []): Sub * * The async variant is {@see SubnetworksClient::getIamPolicyAsync()} . * + * @example samples/V1/SubnetworksClient/get_iam_policy.php + * * @param GetIamPolicySubnetworkRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -384,6 +394,8 @@ public function getIamPolicy(GetIamPolicySubnetworkRequest $request, array $call * * The async variant is {@see SubnetworksClient::insertAsync()} . * + * @example samples/V1/SubnetworksClient/insert.php + * * @param InsertSubnetworkRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -408,6 +420,8 @@ public function insert(InsertSubnetworkRequest $request, array $callOptions = [] * * The async variant is {@see SubnetworksClient::listAsync()} . * + * @example samples/V1/SubnetworksClient/list.php + * * @param ListSubnetworksRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -432,6 +446,8 @@ public function list(ListSubnetworksRequest $request, array $callOptions = []): * * The async variant is {@see SubnetworksClient::listUsableAsync()} . * + * @example samples/V1/SubnetworksClient/list_usable.php + * * @param ListUsableSubnetworksRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -456,6 +472,8 @@ public function listUsable(ListUsableSubnetworksRequest $request, array $callOpt * * The async variant is {@see SubnetworksClient::patchAsync()} . * + * @example samples/V1/SubnetworksClient/patch.php + * * @param PatchSubnetworkRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -480,6 +498,8 @@ public function patch(PatchSubnetworkRequest $request, array $callOptions = []): * * The async variant is {@see SubnetworksClient::setIamPolicyAsync()} . * + * @example samples/V1/SubnetworksClient/set_iam_policy.php + * * @param SetIamPolicySubnetworkRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -504,6 +524,8 @@ public function setIamPolicy(SetIamPolicySubnetworkRequest $request, array $call * * The async variant is {@see SubnetworksClient::setPrivateIpGoogleAccessAsync()} . * + * @example samples/V1/SubnetworksClient/set_private_ip_google_access.php + * * @param SetPrivateIpGoogleAccessSubnetworkRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -528,6 +550,8 @@ public function setPrivateIpGoogleAccess(SetPrivateIpGoogleAccessSubnetworkReque * * The async variant is {@see SubnetworksClient::testIamPermissionsAsync()} . * + * @example samples/V1/SubnetworksClient/test_iam_permissions.php + * * @param TestIamPermissionsSubnetworkRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/TargetGrpcProxiesClient.php b/Compute/src/V1/Client/TargetGrpcProxiesClient.php index 1341b73c4c64..2b96ab7bbb5e 100644 --- a/Compute/src/V1/Client/TargetGrpcProxiesClient.php +++ b/Compute/src/V1/Client/TargetGrpcProxiesClient.php @@ -247,6 +247,8 @@ public function __call($method, $args) * * The async variant is {@see TargetGrpcProxiesClient::deleteAsync()} . * + * @example samples/V1/TargetGrpcProxiesClient/delete.php + * * @param DeleteTargetGrpcProxyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -271,6 +273,8 @@ public function delete(DeleteTargetGrpcProxyRequest $request, array $callOptions * * The async variant is {@see TargetGrpcProxiesClient::getAsync()} . * + * @example samples/V1/TargetGrpcProxiesClient/get.php + * * @param GetTargetGrpcProxyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -295,6 +299,8 @@ public function get(GetTargetGrpcProxyRequest $request, array $callOptions = []) * * The async variant is {@see TargetGrpcProxiesClient::insertAsync()} . * + * @example samples/V1/TargetGrpcProxiesClient/insert.php + * * @param InsertTargetGrpcProxyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -319,6 +325,8 @@ public function insert(InsertTargetGrpcProxyRequest $request, array $callOptions * * The async variant is {@see TargetGrpcProxiesClient::listAsync()} . * + * @example samples/V1/TargetGrpcProxiesClient/list.php + * * @param ListTargetGrpcProxiesRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -343,6 +351,8 @@ public function list(ListTargetGrpcProxiesRequest $request, array $callOptions = * * The async variant is {@see TargetGrpcProxiesClient::patchAsync()} . * + * @example samples/V1/TargetGrpcProxiesClient/patch.php + * * @param PatchTargetGrpcProxyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/TargetHttpProxiesClient.php b/Compute/src/V1/Client/TargetHttpProxiesClient.php index 748f685210df..7c665195f203 100644 --- a/Compute/src/V1/Client/TargetHttpProxiesClient.php +++ b/Compute/src/V1/Client/TargetHttpProxiesClient.php @@ -251,6 +251,8 @@ public function __call($method, $args) * * The async variant is {@see TargetHttpProxiesClient::aggregatedListAsync()} . * + * @example samples/V1/TargetHttpProxiesClient/aggregated_list.php + * * @param AggregatedListTargetHttpProxiesRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -275,6 +277,8 @@ public function aggregatedList(AggregatedListTargetHttpProxiesRequest $request, * * The async variant is {@see TargetHttpProxiesClient::deleteAsync()} . * + * @example samples/V1/TargetHttpProxiesClient/delete.php + * * @param DeleteTargetHttpProxyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -299,6 +303,8 @@ public function delete(DeleteTargetHttpProxyRequest $request, array $callOptions * * The async variant is {@see TargetHttpProxiesClient::getAsync()} . * + * @example samples/V1/TargetHttpProxiesClient/get.php + * * @param GetTargetHttpProxyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -323,6 +329,8 @@ public function get(GetTargetHttpProxyRequest $request, array $callOptions = []) * * The async variant is {@see TargetHttpProxiesClient::insertAsync()} . * + * @example samples/V1/TargetHttpProxiesClient/insert.php + * * @param InsertTargetHttpProxyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -347,6 +355,8 @@ public function insert(InsertTargetHttpProxyRequest $request, array $callOptions * * The async variant is {@see TargetHttpProxiesClient::listAsync()} . * + * @example samples/V1/TargetHttpProxiesClient/list.php + * * @param ListTargetHttpProxiesRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -371,6 +381,8 @@ public function list(ListTargetHttpProxiesRequest $request, array $callOptions = * * The async variant is {@see TargetHttpProxiesClient::patchAsync()} . * + * @example samples/V1/TargetHttpProxiesClient/patch.php + * * @param PatchTargetHttpProxyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -395,6 +407,8 @@ public function patch(PatchTargetHttpProxyRequest $request, array $callOptions = * * The async variant is {@see TargetHttpProxiesClient::setUrlMapAsync()} . * + * @example samples/V1/TargetHttpProxiesClient/set_url_map.php + * * @param SetUrlMapTargetHttpProxyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/TargetHttpsProxiesClient.php b/Compute/src/V1/Client/TargetHttpsProxiesClient.php index 1752b9840985..4f99e66a1403 100644 --- a/Compute/src/V1/Client/TargetHttpsProxiesClient.php +++ b/Compute/src/V1/Client/TargetHttpsProxiesClient.php @@ -259,6 +259,8 @@ public function __call($method, $args) * * The async variant is {@see TargetHttpsProxiesClient::aggregatedListAsync()} . * + * @example samples/V1/TargetHttpsProxiesClient/aggregated_list.php + * * @param AggregatedListTargetHttpsProxiesRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -283,6 +285,8 @@ public function aggregatedList(AggregatedListTargetHttpsProxiesRequest $request, * * The async variant is {@see TargetHttpsProxiesClient::deleteAsync()} . * + * @example samples/V1/TargetHttpsProxiesClient/delete.php + * * @param DeleteTargetHttpsProxyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -307,6 +311,8 @@ public function delete(DeleteTargetHttpsProxyRequest $request, array $callOption * * The async variant is {@see TargetHttpsProxiesClient::getAsync()} . * + * @example samples/V1/TargetHttpsProxiesClient/get.php + * * @param GetTargetHttpsProxyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -331,6 +337,8 @@ public function get(GetTargetHttpsProxyRequest $request, array $callOptions = [] * * The async variant is {@see TargetHttpsProxiesClient::insertAsync()} . * + * @example samples/V1/TargetHttpsProxiesClient/insert.php + * * @param InsertTargetHttpsProxyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -355,6 +363,8 @@ public function insert(InsertTargetHttpsProxyRequest $request, array $callOption * * The async variant is {@see TargetHttpsProxiesClient::listAsync()} . * + * @example samples/V1/TargetHttpsProxiesClient/list.php + * * @param ListTargetHttpsProxiesRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -379,6 +389,8 @@ public function list(ListTargetHttpsProxiesRequest $request, array $callOptions * * The async variant is {@see TargetHttpsProxiesClient::patchAsync()} . * + * @example samples/V1/TargetHttpsProxiesClient/patch.php + * * @param PatchTargetHttpsProxyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -403,6 +415,8 @@ public function patch(PatchTargetHttpsProxyRequest $request, array $callOptions * * The async variant is {@see TargetHttpsProxiesClient::setCertificateMapAsync()} . * + * @example samples/V1/TargetHttpsProxiesClient/set_certificate_map.php + * * @param SetCertificateMapTargetHttpsProxyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -427,6 +441,8 @@ public function setCertificateMap(SetCertificateMapTargetHttpsProxyRequest $requ * * The async variant is {@see TargetHttpsProxiesClient::setQuicOverrideAsync()} . * + * @example samples/V1/TargetHttpsProxiesClient/set_quic_override.php + * * @param SetQuicOverrideTargetHttpsProxyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -452,6 +468,8 @@ public function setQuicOverride(SetQuicOverrideTargetHttpsProxyRequest $request, * The async variant is {@see TargetHttpsProxiesClient::setSslCertificatesAsync()} * . * + * @example samples/V1/TargetHttpsProxiesClient/set_ssl_certificates.php + * * @param SetSslCertificatesTargetHttpsProxyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -476,6 +494,8 @@ public function setSslCertificates(SetSslCertificatesTargetHttpsProxyRequest $re * * The async variant is {@see TargetHttpsProxiesClient::setSslPolicyAsync()} . * + * @example samples/V1/TargetHttpsProxiesClient/set_ssl_policy.php + * * @param SetSslPolicyTargetHttpsProxyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -500,6 +520,8 @@ public function setSslPolicy(SetSslPolicyTargetHttpsProxyRequest $request, array * * The async variant is {@see TargetHttpsProxiesClient::setUrlMapAsync()} . * + * @example samples/V1/TargetHttpsProxiesClient/set_url_map.php + * * @param SetUrlMapTargetHttpsProxyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/TargetInstancesClient.php b/Compute/src/V1/Client/TargetInstancesClient.php index 51f3ce08c9ea..8ab2f181d6d9 100644 --- a/Compute/src/V1/Client/TargetInstancesClient.php +++ b/Compute/src/V1/Client/TargetInstancesClient.php @@ -250,6 +250,8 @@ public function __call($method, $args) * * The async variant is {@see TargetInstancesClient::aggregatedListAsync()} . * + * @example samples/V1/TargetInstancesClient/aggregated_list.php + * * @param AggregatedListTargetInstancesRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -274,6 +276,8 @@ public function aggregatedList(AggregatedListTargetInstancesRequest $request, ar * * The async variant is {@see TargetInstancesClient::deleteAsync()} . * + * @example samples/V1/TargetInstancesClient/delete.php + * * @param DeleteTargetInstanceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -298,6 +302,8 @@ public function delete(DeleteTargetInstanceRequest $request, array $callOptions * * The async variant is {@see TargetInstancesClient::getAsync()} . * + * @example samples/V1/TargetInstancesClient/get.php + * * @param GetTargetInstanceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -322,6 +328,8 @@ public function get(GetTargetInstanceRequest $request, array $callOptions = []): * * The async variant is {@see TargetInstancesClient::insertAsync()} . * + * @example samples/V1/TargetInstancesClient/insert.php + * * @param InsertTargetInstanceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -346,6 +354,8 @@ public function insert(InsertTargetInstanceRequest $request, array $callOptions * * The async variant is {@see TargetInstancesClient::listAsync()} . * + * @example samples/V1/TargetInstancesClient/list.php + * * @param ListTargetInstancesRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -370,6 +380,8 @@ public function list(ListTargetInstancesRequest $request, array $callOptions = [ * * The async variant is {@see TargetInstancesClient::setSecurityPolicyAsync()} . * + * @example samples/V1/TargetInstancesClient/set_security_policy.php + * * @param SetSecurityPolicyTargetInstanceRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/TargetPoolsClient.php b/Compute/src/V1/Client/TargetPoolsClient.php index a7e0cadc267a..5347dda7d5f4 100644 --- a/Compute/src/V1/Client/TargetPoolsClient.php +++ b/Compute/src/V1/Client/TargetPoolsClient.php @@ -263,6 +263,8 @@ public function __call($method, $args) * * The async variant is {@see TargetPoolsClient::addHealthCheckAsync()} . * + * @example samples/V1/TargetPoolsClient/add_health_check.php + * * @param AddHealthCheckTargetPoolRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -287,6 +289,8 @@ public function addHealthCheck(AddHealthCheckTargetPoolRequest $request, array $ * * The async variant is {@see TargetPoolsClient::addInstanceAsync()} . * + * @example samples/V1/TargetPoolsClient/add_instance.php + * * @param AddInstanceTargetPoolRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -311,6 +315,8 @@ public function addInstance(AddInstanceTargetPoolRequest $request, array $callOp * * The async variant is {@see TargetPoolsClient::aggregatedListAsync()} . * + * @example samples/V1/TargetPoolsClient/aggregated_list.php + * * @param AggregatedListTargetPoolsRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -335,6 +341,8 @@ public function aggregatedList(AggregatedListTargetPoolsRequest $request, array * * The async variant is {@see TargetPoolsClient::deleteAsync()} . * + * @example samples/V1/TargetPoolsClient/delete.php + * * @param DeleteTargetPoolRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -359,6 +367,8 @@ public function delete(DeleteTargetPoolRequest $request, array $callOptions = [] * * The async variant is {@see TargetPoolsClient::getAsync()} . * + * @example samples/V1/TargetPoolsClient/get.php + * * @param GetTargetPoolRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -383,6 +393,8 @@ public function get(GetTargetPoolRequest $request, array $callOptions = []): Tar * * The async variant is {@see TargetPoolsClient::getHealthAsync()} . * + * @example samples/V1/TargetPoolsClient/get_health.php + * * @param GetHealthTargetPoolRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -407,6 +419,8 @@ public function getHealth(GetHealthTargetPoolRequest $request, array $callOption * * The async variant is {@see TargetPoolsClient::insertAsync()} . * + * @example samples/V1/TargetPoolsClient/insert.php + * * @param InsertTargetPoolRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -431,6 +445,8 @@ public function insert(InsertTargetPoolRequest $request, array $callOptions = [] * * The async variant is {@see TargetPoolsClient::listAsync()} . * + * @example samples/V1/TargetPoolsClient/list.php + * * @param ListTargetPoolsRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -455,6 +471,8 @@ public function list(ListTargetPoolsRequest $request, array $callOptions = []): * * The async variant is {@see TargetPoolsClient::removeHealthCheckAsync()} . * + * @example samples/V1/TargetPoolsClient/remove_health_check.php + * * @param RemoveHealthCheckTargetPoolRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -479,6 +497,8 @@ public function removeHealthCheck(RemoveHealthCheckTargetPoolRequest $request, a * * The async variant is {@see TargetPoolsClient::removeInstanceAsync()} . * + * @example samples/V1/TargetPoolsClient/remove_instance.php + * * @param RemoveInstanceTargetPoolRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -503,6 +523,8 @@ public function removeInstance(RemoveInstanceTargetPoolRequest $request, array $ * * The async variant is {@see TargetPoolsClient::setBackupAsync()} . * + * @example samples/V1/TargetPoolsClient/set_backup.php + * * @param SetBackupTargetPoolRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -527,6 +549,8 @@ public function setBackup(SetBackupTargetPoolRequest $request, array $callOption * * The async variant is {@see TargetPoolsClient::setSecurityPolicyAsync()} . * + * @example samples/V1/TargetPoolsClient/set_security_policy.php + * * @param SetSecurityPolicyTargetPoolRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/TargetSslProxiesClient.php b/Compute/src/V1/Client/TargetSslProxiesClient.php index e87c3f71e134..d1e7f780bb3f 100644 --- a/Compute/src/V1/Client/TargetSslProxiesClient.php +++ b/Compute/src/V1/Client/TargetSslProxiesClient.php @@ -255,6 +255,8 @@ public function __call($method, $args) * * The async variant is {@see TargetSslProxiesClient::deleteAsync()} . * + * @example samples/V1/TargetSslProxiesClient/delete.php + * * @param DeleteTargetSslProxyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -279,6 +281,8 @@ public function delete(DeleteTargetSslProxyRequest $request, array $callOptions * * The async variant is {@see TargetSslProxiesClient::getAsync()} . * + * @example samples/V1/TargetSslProxiesClient/get.php + * * @param GetTargetSslProxyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -303,6 +307,8 @@ public function get(GetTargetSslProxyRequest $request, array $callOptions = []): * * The async variant is {@see TargetSslProxiesClient::insertAsync()} . * + * @example samples/V1/TargetSslProxiesClient/insert.php + * * @param InsertTargetSslProxyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -327,6 +333,8 @@ public function insert(InsertTargetSslProxyRequest $request, array $callOptions * * The async variant is {@see TargetSslProxiesClient::listAsync()} . * + * @example samples/V1/TargetSslProxiesClient/list.php + * * @param ListTargetSslProxiesRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -351,6 +359,8 @@ public function list(ListTargetSslProxiesRequest $request, array $callOptions = * * The async variant is {@see TargetSslProxiesClient::setBackendServiceAsync()} . * + * @example samples/V1/TargetSslProxiesClient/set_backend_service.php + * * @param SetBackendServiceTargetSslProxyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -375,6 +385,8 @@ public function setBackendService(SetBackendServiceTargetSslProxyRequest $reques * * The async variant is {@see TargetSslProxiesClient::setCertificateMapAsync()} . * + * @example samples/V1/TargetSslProxiesClient/set_certificate_map.php + * * @param SetCertificateMapTargetSslProxyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -399,6 +411,8 @@ public function setCertificateMap(SetCertificateMapTargetSslProxyRequest $reques * * The async variant is {@see TargetSslProxiesClient::setProxyHeaderAsync()} . * + * @example samples/V1/TargetSslProxiesClient/set_proxy_header.php + * * @param SetProxyHeaderTargetSslProxyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -423,6 +437,8 @@ public function setProxyHeader(SetProxyHeaderTargetSslProxyRequest $request, arr * * The async variant is {@see TargetSslProxiesClient::setSslCertificatesAsync()} . * + * @example samples/V1/TargetSslProxiesClient/set_ssl_certificates.php + * * @param SetSslCertificatesTargetSslProxyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -447,6 +463,8 @@ public function setSslCertificates(SetSslCertificatesTargetSslProxyRequest $requ * * The async variant is {@see TargetSslProxiesClient::setSslPolicyAsync()} . * + * @example samples/V1/TargetSslProxiesClient/set_ssl_policy.php + * * @param SetSslPolicyTargetSslProxyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/TargetTcpProxiesClient.php b/Compute/src/V1/Client/TargetTcpProxiesClient.php index 48e0b6de908d..6afdc756de17 100644 --- a/Compute/src/V1/Client/TargetTcpProxiesClient.php +++ b/Compute/src/V1/Client/TargetTcpProxiesClient.php @@ -251,6 +251,8 @@ public function __call($method, $args) * * The async variant is {@see TargetTcpProxiesClient::aggregatedListAsync()} . * + * @example samples/V1/TargetTcpProxiesClient/aggregated_list.php + * * @param AggregatedListTargetTcpProxiesRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -275,6 +277,8 @@ public function aggregatedList(AggregatedListTargetTcpProxiesRequest $request, a * * The async variant is {@see TargetTcpProxiesClient::deleteAsync()} . * + * @example samples/V1/TargetTcpProxiesClient/delete.php + * * @param DeleteTargetTcpProxyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -299,6 +303,8 @@ public function delete(DeleteTargetTcpProxyRequest $request, array $callOptions * * The async variant is {@see TargetTcpProxiesClient::getAsync()} . * + * @example samples/V1/TargetTcpProxiesClient/get.php + * * @param GetTargetTcpProxyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -323,6 +329,8 @@ public function get(GetTargetTcpProxyRequest $request, array $callOptions = []): * * The async variant is {@see TargetTcpProxiesClient::insertAsync()} . * + * @example samples/V1/TargetTcpProxiesClient/insert.php + * * @param InsertTargetTcpProxyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -347,6 +355,8 @@ public function insert(InsertTargetTcpProxyRequest $request, array $callOptions * * The async variant is {@see TargetTcpProxiesClient::listAsync()} . * + * @example samples/V1/TargetTcpProxiesClient/list.php + * * @param ListTargetTcpProxiesRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -371,6 +381,8 @@ public function list(ListTargetTcpProxiesRequest $request, array $callOptions = * * The async variant is {@see TargetTcpProxiesClient::setBackendServiceAsync()} . * + * @example samples/V1/TargetTcpProxiesClient/set_backend_service.php + * * @param SetBackendServiceTargetTcpProxyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -395,6 +407,8 @@ public function setBackendService(SetBackendServiceTargetTcpProxyRequest $reques * * The async variant is {@see TargetTcpProxiesClient::setProxyHeaderAsync()} . * + * @example samples/V1/TargetTcpProxiesClient/set_proxy_header.php + * * @param SetProxyHeaderTargetTcpProxyRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/TargetVpnGatewaysClient.php b/Compute/src/V1/Client/TargetVpnGatewaysClient.php index 7c46c22e6d15..ca5f6a0861c9 100644 --- a/Compute/src/V1/Client/TargetVpnGatewaysClient.php +++ b/Compute/src/V1/Client/TargetVpnGatewaysClient.php @@ -250,6 +250,8 @@ public function __call($method, $args) * * The async variant is {@see TargetVpnGatewaysClient::aggregatedListAsync()} . * + * @example samples/V1/TargetVpnGatewaysClient/aggregated_list.php + * * @param AggregatedListTargetVpnGatewaysRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -274,6 +276,8 @@ public function aggregatedList(AggregatedListTargetVpnGatewaysRequest $request, * * The async variant is {@see TargetVpnGatewaysClient::deleteAsync()} . * + * @example samples/V1/TargetVpnGatewaysClient/delete.php + * * @param DeleteTargetVpnGatewayRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -298,6 +302,8 @@ public function delete(DeleteTargetVpnGatewayRequest $request, array $callOption * * The async variant is {@see TargetVpnGatewaysClient::getAsync()} . * + * @example samples/V1/TargetVpnGatewaysClient/get.php + * * @param GetTargetVpnGatewayRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -322,6 +328,8 @@ public function get(GetTargetVpnGatewayRequest $request, array $callOptions = [] * * The async variant is {@see TargetVpnGatewaysClient::insertAsync()} . * + * @example samples/V1/TargetVpnGatewaysClient/insert.php + * * @param InsertTargetVpnGatewayRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -346,6 +354,8 @@ public function insert(InsertTargetVpnGatewayRequest $request, array $callOption * * The async variant is {@see TargetVpnGatewaysClient::listAsync()} . * + * @example samples/V1/TargetVpnGatewaysClient/list.php + * * @param ListTargetVpnGatewaysRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -370,6 +380,8 @@ public function list(ListTargetVpnGatewaysRequest $request, array $callOptions = * * The async variant is {@see TargetVpnGatewaysClient::setLabelsAsync()} . * + * @example samples/V1/TargetVpnGatewaysClient/set_labels.php + * * @param SetLabelsTargetVpnGatewayRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/UrlMapsClient.php b/Compute/src/V1/Client/UrlMapsClient.php index 4e4a7fc0a028..26f8c4674430 100644 --- a/Compute/src/V1/Client/UrlMapsClient.php +++ b/Compute/src/V1/Client/UrlMapsClient.php @@ -256,6 +256,8 @@ public function __call($method, $args) * * The async variant is {@see UrlMapsClient::aggregatedListAsync()} . * + * @example samples/V1/UrlMapsClient/aggregated_list.php + * * @param AggregatedListUrlMapsRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -280,6 +282,8 @@ public function aggregatedList(AggregatedListUrlMapsRequest $request, array $cal * * The async variant is {@see UrlMapsClient::deleteAsync()} . * + * @example samples/V1/UrlMapsClient/delete.php + * * @param DeleteUrlMapRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -304,6 +308,8 @@ public function delete(DeleteUrlMapRequest $request, array $callOptions = []): O * * The async variant is {@see UrlMapsClient::getAsync()} . * + * @example samples/V1/UrlMapsClient/get.php + * * @param GetUrlMapRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -328,6 +334,8 @@ public function get(GetUrlMapRequest $request, array $callOptions = []): UrlMap * * The async variant is {@see UrlMapsClient::insertAsync()} . * + * @example samples/V1/UrlMapsClient/insert.php + * * @param InsertUrlMapRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -352,6 +360,8 @@ public function insert(InsertUrlMapRequest $request, array $callOptions = []): O * * The async variant is {@see UrlMapsClient::invalidateCacheAsync()} . * + * @example samples/V1/UrlMapsClient/invalidate_cache.php + * * @param InvalidateCacheUrlMapRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -376,6 +386,8 @@ public function invalidateCache(InvalidateCacheUrlMapRequest $request, array $ca * * The async variant is {@see UrlMapsClient::listAsync()} . * + * @example samples/V1/UrlMapsClient/list.php + * * @param ListUrlMapsRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -400,6 +412,8 @@ public function list(ListUrlMapsRequest $request, array $callOptions = []): Page * * The async variant is {@see UrlMapsClient::patchAsync()} . * + * @example samples/V1/UrlMapsClient/patch.php + * * @param PatchUrlMapRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -424,6 +438,8 @@ public function patch(PatchUrlMapRequest $request, array $callOptions = []): Ope * * The async variant is {@see UrlMapsClient::updateAsync()} . * + * @example samples/V1/UrlMapsClient/update.php + * * @param UpdateUrlMapRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -448,6 +464,8 @@ public function update(UpdateUrlMapRequest $request, array $callOptions = []): O * * The async variant is {@see UrlMapsClient::validateAsync()} . * + * @example samples/V1/UrlMapsClient/validate.php + * * @param ValidateUrlMapRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/VpnGatewaysClient.php b/Compute/src/V1/Client/VpnGatewaysClient.php index 3dac82bcb9e2..7fe1de58375b 100644 --- a/Compute/src/V1/Client/VpnGatewaysClient.php +++ b/Compute/src/V1/Client/VpnGatewaysClient.php @@ -256,6 +256,8 @@ public function __call($method, $args) * * The async variant is {@see VpnGatewaysClient::aggregatedListAsync()} . * + * @example samples/V1/VpnGatewaysClient/aggregated_list.php + * * @param AggregatedListVpnGatewaysRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -280,6 +282,8 @@ public function aggregatedList(AggregatedListVpnGatewaysRequest $request, array * * The async variant is {@see VpnGatewaysClient::deleteAsync()} . * + * @example samples/V1/VpnGatewaysClient/delete.php + * * @param DeleteVpnGatewayRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -304,6 +308,8 @@ public function delete(DeleteVpnGatewayRequest $request, array $callOptions = [] * * The async variant is {@see VpnGatewaysClient::getAsync()} . * + * @example samples/V1/VpnGatewaysClient/get.php + * * @param GetVpnGatewayRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -328,6 +334,8 @@ public function get(GetVpnGatewayRequest $request, array $callOptions = []): Vpn * * The async variant is {@see VpnGatewaysClient::getStatusAsync()} . * + * @example samples/V1/VpnGatewaysClient/get_status.php + * * @param GetStatusVpnGatewayRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -352,6 +360,8 @@ public function getStatus(GetStatusVpnGatewayRequest $request, array $callOption * * The async variant is {@see VpnGatewaysClient::insertAsync()} . * + * @example samples/V1/VpnGatewaysClient/insert.php + * * @param InsertVpnGatewayRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -376,6 +386,8 @@ public function insert(InsertVpnGatewayRequest $request, array $callOptions = [] * * The async variant is {@see VpnGatewaysClient::listAsync()} . * + * @example samples/V1/VpnGatewaysClient/list.php + * * @param ListVpnGatewaysRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -400,6 +412,8 @@ public function list(ListVpnGatewaysRequest $request, array $callOptions = []): * * The async variant is {@see VpnGatewaysClient::setLabelsAsync()} . * + * @example samples/V1/VpnGatewaysClient/set_labels.php + * * @param SetLabelsVpnGatewayRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -424,6 +438,8 @@ public function setLabels(SetLabelsVpnGatewayRequest $request, array $callOption * * The async variant is {@see VpnGatewaysClient::testIamPermissionsAsync()} . * + * @example samples/V1/VpnGatewaysClient/test_iam_permissions.php + * * @param TestIamPermissionsVpnGatewayRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/VpnTunnelsClient.php b/Compute/src/V1/Client/VpnTunnelsClient.php index efae9cfa2758..eb35ae3de4ca 100644 --- a/Compute/src/V1/Client/VpnTunnelsClient.php +++ b/Compute/src/V1/Client/VpnTunnelsClient.php @@ -250,6 +250,8 @@ public function __call($method, $args) * * The async variant is {@see VpnTunnelsClient::aggregatedListAsync()} . * + * @example samples/V1/VpnTunnelsClient/aggregated_list.php + * * @param AggregatedListVpnTunnelsRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -274,6 +276,8 @@ public function aggregatedList(AggregatedListVpnTunnelsRequest $request, array $ * * The async variant is {@see VpnTunnelsClient::deleteAsync()} . * + * @example samples/V1/VpnTunnelsClient/delete.php + * * @param DeleteVpnTunnelRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -298,6 +302,8 @@ public function delete(DeleteVpnTunnelRequest $request, array $callOptions = []) * * The async variant is {@see VpnTunnelsClient::getAsync()} . * + * @example samples/V1/VpnTunnelsClient/get.php + * * @param GetVpnTunnelRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -322,6 +328,8 @@ public function get(GetVpnTunnelRequest $request, array $callOptions = []): VpnT * * The async variant is {@see VpnTunnelsClient::insertAsync()} . * + * @example samples/V1/VpnTunnelsClient/insert.php + * * @param InsertVpnTunnelRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -346,6 +354,8 @@ public function insert(InsertVpnTunnelRequest $request, array $callOptions = []) * * The async variant is {@see VpnTunnelsClient::listAsync()} . * + * @example samples/V1/VpnTunnelsClient/list.php + * * @param ListVpnTunnelsRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -370,6 +380,8 @@ public function list(ListVpnTunnelsRequest $request, array $callOptions = []): P * * The async variant is {@see VpnTunnelsClient::setLabelsAsync()} . * + * @example samples/V1/VpnTunnelsClient/set_labels.php + * * @param SetLabelsVpnTunnelRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/ZoneOperationsClient.php b/Compute/src/V1/Client/ZoneOperationsClient.php index f38071e772b2..2691f421ee83 100644 --- a/Compute/src/V1/Client/ZoneOperationsClient.php +++ b/Compute/src/V1/Client/ZoneOperationsClient.php @@ -190,6 +190,8 @@ public function __call($method, $args) * * The async variant is {@see ZoneOperationsClient::deleteAsync()} . * + * @example samples/V1/ZoneOperationsClient/delete.php + * * @param DeleteZoneOperationRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -214,6 +216,8 @@ public function delete(DeleteZoneOperationRequest $request, array $callOptions = * * The async variant is {@see ZoneOperationsClient::getAsync()} . * + * @example samples/V1/ZoneOperationsClient/get.php + * * @param GetZoneOperationRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -238,6 +242,8 @@ public function get(GetZoneOperationRequest $request, array $callOptions = []): * * The async variant is {@see ZoneOperationsClient::listAsync()} . * + * @example samples/V1/ZoneOperationsClient/list.php + * * @param ListZoneOperationsRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -262,6 +268,8 @@ public function list(ListZoneOperationsRequest $request, array $callOptions = [] * * The async variant is {@see ZoneOperationsClient::waitAsync()} . * + * @example samples/V1/ZoneOperationsClient/wait.php + * * @param WaitZoneOperationRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/Compute/src/V1/Client/ZonesClient.php b/Compute/src/V1/Client/ZonesClient.php index 38f055d406b4..9d95a03eb982 100644 --- a/Compute/src/V1/Client/ZonesClient.php +++ b/Compute/src/V1/Client/ZonesClient.php @@ -186,6 +186,8 @@ public function __call($method, $args) * * The async variant is {@see ZonesClient::getAsync()} . * + * @example samples/V1/ZonesClient/get.php + * * @param GetZoneRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -210,6 +212,8 @@ public function get(GetZoneRequest $request, array $callOptions = []): Zone * * The async variant is {@see ZonesClient::listAsync()} . * + * @example samples/V1/ZonesClient/list.php + * * @param ListZonesRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional.