@Override public Map<String, String> extract(CreateKeyRingRequest request) { ImmutableMap.Builder<String, String> params = ImmutableMap.builder(); params.put("parent", String.valueOf(request.getParent())); return params.build(); } })
/** * * * <pre> * Required. The resource name of the location associated with the * [KeyRings][google.cloud.kms.v1.KeyRing], in the format `projects/*/locations/*`. * </pre> * * <code>string parent = 1;</code> */ public Builder clearParent() { parent_ = getDefaultInstance().getParent(); 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) + PARENT_FIELD_NUMBER; hash = (53 * hash) + getParent().hashCode(); hash = (37 * hash) + KEY_RING_ID_FIELD_NUMBER; hash = (53 * hash) + getKeyRingId().hashCode(); if (hasKeyRing()) { hash = (37 * hash) + KEY_RING_FIELD_NUMBER; hash = (53 * hash) + getKeyRing().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.cloud.kms.v1.CreateKeyRingRequest)) { return super.equals(obj); } com.google.cloud.kms.v1.CreateKeyRingRequest other = (com.google.cloud.kms.v1.CreateKeyRingRequest) obj; boolean result = true; result = result && getParent().equals(other.getParent()); result = result && getKeyRingId().equals(other.getKeyRingId()); result = result && (hasKeyRing() == other.hasKeyRing()); if (hasKeyRing()) { result = result && getKeyRing().equals(other.getKeyRing()); } result = result && unknownFields.equals(other.unknownFields); return result; }
public Builder mergeFrom(com.google.cloud.kms.v1.CreateKeyRingRequest other) { if (other == com.google.cloud.kms.v1.CreateKeyRingRequest.getDefaultInstance()) return this; if (!other.getParent().isEmpty()) { parent_ = other.parent_; onChanged(); } if (!other.getKeyRingId().isEmpty()) { keyRingId_ = other.keyRingId_; onChanged(); } if (other.hasKeyRing()) { mergeKeyRing(other.getKeyRing()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
@Test @SuppressWarnings("all") public void createKeyRingTest() { KeyRingName name = KeyRingName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]"); KeyRing expectedResponse = KeyRing.newBuilder().setName(name.toString()).build(); mockKeyManagementService.addResponse(expectedResponse); LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); String keyRingId = "keyRingId-2056646742"; KeyRing keyRing = KeyRing.newBuilder().build(); KeyRing actualResponse = client.createKeyRing(parent, keyRingId, keyRing); Assert.assertEquals(expectedResponse, actualResponse); List<GeneratedMessageV3> actualRequests = mockKeyManagementService.getRequests(); Assert.assertEquals(1, actualRequests.size()); CreateKeyRingRequest actualRequest = (CreateKeyRingRequest) actualRequests.get(0); Assert.assertEquals(parent, LocationName.parse(actualRequest.getParent())); Assert.assertEquals(keyRingId, actualRequest.getKeyRingId()); Assert.assertEquals(keyRing, actualRequest.getKeyRing()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern())); }
@Override public Map<String, String> extract(CreateKeyRingRequest request) { ImmutableMap.Builder<String, String> params = ImmutableMap.builder(); params.put("parent", String.valueOf(request.getParent())); return params.build(); } })
/** * * * <pre> * Required. The resource name of the location associated with the * [KeyRings][google.cloud.kms.v1.KeyRing], in the format `projects/*/locations/*`. * </pre> * * <code>string parent = 1;</code> */ public Builder clearParent() { parent_ = getDefaultInstance().getParent(); 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) + PARENT_FIELD_NUMBER; hash = (53 * hash) + getParent().hashCode(); hash = (37 * hash) + KEY_RING_ID_FIELD_NUMBER; hash = (53 * hash) + getKeyRingId().hashCode(); if (hasKeyRing()) { hash = (37 * hash) + KEY_RING_FIELD_NUMBER; hash = (53 * hash) + getKeyRing().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.cloud.kms.v1.CreateKeyRingRequest)) { return super.equals(obj); } com.google.cloud.kms.v1.CreateKeyRingRequest other = (com.google.cloud.kms.v1.CreateKeyRingRequest) obj; boolean result = true; result = result && getParent().equals(other.getParent()); result = result && getKeyRingId().equals(other.getKeyRingId()); result = result && (hasKeyRing() == other.hasKeyRing()); if (hasKeyRing()) { result = result && getKeyRing().equals(other.getKeyRing()); } result = result && unknownFields.equals(other.unknownFields); return result; }
public Builder mergeFrom(com.google.cloud.kms.v1.CreateKeyRingRequest other) { if (other == com.google.cloud.kms.v1.CreateKeyRingRequest.getDefaultInstance()) return this; if (!other.getParent().isEmpty()) { parent_ = other.parent_; onChanged(); } if (!other.getKeyRingId().isEmpty()) { keyRingId_ = other.keyRingId_; onChanged(); } if (other.hasKeyRing()) { mergeKeyRing(other.getKeyRing()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }