/** * * * <pre> * Configure the maintenance policy for this cluster. * </pre> * * <code>.google.container.v1.MaintenancePolicy maintenance_policy = 23;</code> */ public Builder setMaintenancePolicy( com.google.container.v1.MaintenancePolicy.Builder builderForValue) { if (maintenancePolicyBuilder_ == null) { maintenancePolicy_ = builderForValue.build(); onChanged(); } else { maintenancePolicyBuilder_.setMessage(builderForValue.build()); } return this; } /**
/** * * * <pre> * The maintenance policy to be set for the cluster. An empty field * clears the existing maintenance policy. * </pre> * * <code>.google.container.v1.MaintenancePolicy maintenance_policy = 4;</code> */ public Builder setMaintenancePolicy( com.google.container.v1.MaintenancePolicy.Builder builderForValue) { if (maintenancePolicyBuilder_ == null) { maintenancePolicy_ = builderForValue.build(); onChanged(); } else { maintenancePolicyBuilder_.setMessage(builderForValue.build()); } return this; } /**
String zone = "zone3744684"; String clusterId = "clusterId240280960"; MaintenancePolicy maintenancePolicy = MaintenancePolicy.newBuilder().build();
@Test @SuppressWarnings("all") public void setMaintenancePolicyExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockClusterManager.addException(exception); try { String projectId = "projectId-1969970175"; String zone = "zone3744684"; String clusterId = "clusterId240280960"; MaintenancePolicy maintenancePolicy = MaintenancePolicy.newBuilder().build(); client.setMaintenancePolicy(projectId, zone, clusterId, maintenancePolicy); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception } } }