@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.cloud.kms.v1.CreateCryptoKeyRequest)) { return super.equals(obj); } com.google.cloud.kms.v1.CreateCryptoKeyRequest other = (com.google.cloud.kms.v1.CreateCryptoKeyRequest) obj; boolean result = true; result = result && getParent().equals(other.getParent()); result = result && getCryptoKeyId().equals(other.getCryptoKeyId()); result = result && (hasCryptoKey() == other.hasCryptoKey()); if (hasCryptoKey()) { result = result && getCryptoKey().equals(other.getCryptoKey()); } result = result && unknownFields.equals(other.unknownFields); return result; }
@java.lang.Override public Builder newBuilderForType() { return newBuilder(); }
/** * * * <pre> * Required. The [name][google.cloud.kms.v1.KeyRing.name] of the KeyRing associated with the * [CryptoKeys][google.cloud.kms.v1.CryptoKey]. * </pre> * * <code>string parent = 1;</code> */ public Builder clearParent() { parent_ = getDefaultInstance().getParent(); onChanged(); return this; } /**
@java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (!getParentBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); } if (!getCryptoKeyIdBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, cryptoKeyId_); } if (cryptoKey_ != null) { output.writeMessage(3, getCryptoKey()); } unknownFields.writeTo(output); }
/** * * * <pre> * Required. It must be unique within a KeyRing and match the regular * expression `[a-zA-Z0-9_-]{1,63}` * </pre> * * <code>string crypto_key_id = 2;</code> */ public Builder clearCryptoKeyId() { cryptoKeyId_ = getDefaultInstance().getCryptoKeyId(); onChanged(); return this; } /**
CreateCryptoKeyRequest actualRequest = (CreateCryptoKeyRequest) actualRequests.get(0); Assert.assertEquals(parent, KeyRingName.parse(actualRequest.getParent())); Assert.assertEquals(cryptoKeyId, actualRequest.getCryptoKeyId()); Assert.assertEquals(cryptoKey, actualRequest.getCryptoKey()); Assert.assertTrue( channelProvider.isHeaderSent(
@Override public Map<String, String> extract(CreateCryptoKeyRequest request) { ImmutableMap.Builder<String, String> params = ImmutableMap.builder(); params.put("parent", String.valueOf(request.getParent())); return params.build(); } })
@java.lang.Override public com.google.cloud.kms.v1.CreateCryptoKeyRequest getDefaultInstanceForType() { return com.google.cloud.kms.v1.CreateCryptoKeyRequest.getDefaultInstance(); }
/** * * * <pre> * A [CryptoKey][google.cloud.kms.v1.CryptoKey] with initial field values. * </pre> * * <code>.google.cloud.kms.v1.CryptoKey crypto_key = 3;</code> */ public com.google.cloud.kms.v1.CryptoKeyOrBuilder getCryptoKeyOrBuilder() { return getCryptoKey(); }
@java.lang.Override public com.google.cloud.kms.v1.CreateCryptoKeyRequest buildPartial() { com.google.cloud.kms.v1.CreateCryptoKeyRequest result = new com.google.cloud.kms.v1.CreateCryptoKeyRequest(this); result.parent_ = parent_; result.cryptoKeyId_ = cryptoKeyId_; if (cryptoKeyBuilder_ == null) { result.cryptoKey_ = cryptoKey_; } else { result.cryptoKey_ = cryptoKeyBuilder_.build(); } onBuilt(); return result; }
@java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (!getParentBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); } if (!getCryptoKeyIdBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, cryptoKeyId_); } if (cryptoKey_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getCryptoKey()); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; }
/** * * * <pre> * Required. It must be unique within a KeyRing and match the regular * expression `[a-zA-Z0-9_-]{1,63}` * </pre> * * <code>string crypto_key_id = 2;</code> */ public Builder clearCryptoKeyId() { cryptoKeyId_ = getDefaultInstance().getCryptoKeyId(); onChanged(); return this; } /**
@Override public Map<String, String> extract(CreateCryptoKeyRequest request) { ImmutableMap.Builder<String, String> params = ImmutableMap.builder(); params.put("parent", String.valueOf(request.getParent())); return params.build(); } })
.setRequestMarshaller( io.grpc.protobuf.ProtoUtils.marshaller( com.google.cloud.kms.v1.CreateCryptoKeyRequest.getDefaultInstance())) .setResponseMarshaller( io.grpc.protobuf.ProtoUtils.marshaller(
/** * * * <pre> * A [CryptoKey][google.cloud.kms.v1.CryptoKey] with initial field values. * </pre> * * <code>.google.cloud.kms.v1.CryptoKey crypto_key = 3;</code> */ public com.google.cloud.kms.v1.CryptoKeyOrBuilder getCryptoKeyOrBuilder() { return getCryptoKey(); }
@java.lang.Override public com.google.cloud.kms.v1.CreateCryptoKeyRequest buildPartial() { com.google.cloud.kms.v1.CreateCryptoKeyRequest result = new com.google.cloud.kms.v1.CreateCryptoKeyRequest(this); result.parent_ = parent_; result.cryptoKeyId_ = cryptoKeyId_; if (cryptoKeyBuilder_ == null) { result.cryptoKey_ = cryptoKey_; } else { result.cryptoKey_ = cryptoKeyBuilder_.build(); } onBuilt(); return result; }
@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) + CRYPTO_KEY_ID_FIELD_NUMBER; hash = (53 * hash) + getCryptoKeyId().hashCode(); if (hasCryptoKey()) { hash = (37 * hash) + CRYPTO_KEY_FIELD_NUMBER; hash = (53 * hash) + getCryptoKey().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
@java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (!getParentBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); } if (!getCryptoKeyIdBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, cryptoKeyId_); } if (cryptoKey_ != null) { output.writeMessage(3, getCryptoKey()); } unknownFields.writeTo(output); }
CreateCryptoKeyRequest.newBuilder() .setParent(parent) .setCryptoKeyId(cryptoKeyId)
/** * * * <pre> * Required. The [name][google.cloud.kms.v1.KeyRing.name] of the KeyRing associated with the * [CryptoKeys][google.cloud.kms.v1.CryptoKey]. * </pre> * * <code>string parent = 1;</code> */ public Builder clearParent() { parent_ = getDefaultInstance().getParent(); onChanged(); return this; } /**