/** * * * <pre> * The name of the scan configuration in the form of * `projects/[PROJECT_ID]/scanConfigs/[SCAN_CONFIG_ID]`. * </pre> * * <code>string name = 1;</code> */ public Builder clearName() { name_ = getDefaultInstance().getName(); onChanged(); return this; } /**
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + NAME_FIELD_NUMBER; hash = (53 * hash) + getName().hashCode(); if (hasScanConfig()) { hash = (37 * hash) + SCAN_CONFIG_FIELD_NUMBER; hash = (53 * hash) + getScanConfig().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.containeranalysis.v1beta1.UpdateScanConfigRequest)) { return super.equals(obj); } com.google.containeranalysis.v1beta1.UpdateScanConfigRequest other = (com.google.containeranalysis.v1beta1.UpdateScanConfigRequest) obj; boolean result = true; result = result && getName().equals(other.getName()); result = result && (hasScanConfig() == other.hasScanConfig()); if (hasScanConfig()) { result = result && getScanConfig().equals(other.getScanConfig()); } result = result && unknownFields.equals(other.unknownFields); return result; }
public Builder mergeFrom(com.google.containeranalysis.v1beta1.UpdateScanConfigRequest other) { if (other == com.google.containeranalysis.v1beta1.UpdateScanConfigRequest.getDefaultInstance()) return this; if (!other.getName().isEmpty()) { name_ = other.name_; onChanged(); } if (other.hasScanConfig()) { mergeScanConfig(other.getScanConfig()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
@Test @SuppressWarnings("all") public void updateScanConfigTest() { ScanConfigName name2 = ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]"); String description = "description-1724546052"; boolean enabled = false; ScanConfig expectedResponse = ScanConfig.newBuilder() .setName(name2.toString()) .setDescription(description) .setEnabled(enabled) .build(); mockContainerAnalysisV1Beta1.addResponse(expectedResponse); ScanConfigName name = ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]"); ScanConfig scanConfig = ScanConfig.newBuilder().build(); ScanConfig actualResponse = client.updateScanConfig(name, scanConfig); Assert.assertEquals(expectedResponse, actualResponse); List<GeneratedMessageV3> actualRequests = mockContainerAnalysisV1Beta1.getRequests(); Assert.assertEquals(1, actualRequests.size()); UpdateScanConfigRequest actualRequest = (UpdateScanConfigRequest) actualRequests.get(0); Assert.assertEquals(name, ScanConfigName.parse(actualRequest.getName())); Assert.assertEquals(scanConfig, actualRequest.getScanConfig()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern())); }
/** * * * <pre> * The name of the scan configuration in the form of * `projects/[PROJECT_ID]/scanConfigs/[SCAN_CONFIG_ID]`. * </pre> * * <code>string name = 1;</code> */ public Builder clearName() { name_ = getDefaultInstance().getName(); onChanged(); return this; } /**
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + NAME_FIELD_NUMBER; hash = (53 * hash) + getName().hashCode(); if (hasScanConfig()) { hash = (37 * hash) + SCAN_CONFIG_FIELD_NUMBER; hash = (53 * hash) + getScanConfig().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.containeranalysis.v1beta1.UpdateScanConfigRequest)) { return super.equals(obj); } com.google.containeranalysis.v1beta1.UpdateScanConfigRequest other = (com.google.containeranalysis.v1beta1.UpdateScanConfigRequest) obj; boolean result = true; result = result && getName().equals(other.getName()); result = result && (hasScanConfig() == other.hasScanConfig()); if (hasScanConfig()) { result = result && getScanConfig().equals(other.getScanConfig()); } result = result && unknownFields.equals(other.unknownFields); return result; }
public Builder mergeFrom(com.google.containeranalysis.v1beta1.UpdateScanConfigRequest other) { if (other == com.google.containeranalysis.v1beta1.UpdateScanConfigRequest.getDefaultInstance()) return this; if (!other.getName().isEmpty()) { name_ = other.name_; onChanged(); } if (other.hasScanConfig()) { mergeScanConfig(other.getScanConfig()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }