public static String createKeyTest( KmsManagementClient kmsManagementClient, String compartmentId) { System.out.println("CreateKey Test: "); CreateKeyDetails createKeyDetails = CreateKeyDetails.builder() .keyShape(TEST_KEY_SHAPE) .compartmentId(compartmentId) .displayName("Test_Key_V1") .build(); CreateKeyRequest createKeyRequest = CreateKeyRequest.builder().createKeyDetails(createKeyDetails).build(); CreateKeyResponse response = kmsManagementClient.createKey(createKeyRequest); System.out.println("Newly Created Key: "); System.out.println(response.getKey()); System.out.println(); return response.getKey().getId(); }
/** * Build the instance of CreateKeyRequest as configured by this builder * * Note that this method takes calls to {@link Builder#invocationCallback(com.oracle.bmc.util.internal.Consumer)} into account, * while the method {@link Builder#buildWithoutInvocationCallback} does not. * * This is the preferred method to build an instance. * * @return instance of CreateKeyRequest */ public CreateKeyRequest build() { CreateKeyRequest request = buildWithoutInvocationCallback(); request.setInvocationCallback(invocationCallback); return request; } }
/** * Copy method to populate the builder with values from the given instance. * @return this builder instance */ public Builder copy(CreateKeyRequest o) { createKeyDetails(o.getCreateKeyDetails()); opcRequestId(o.getOpcRequestId()); opcRetryToken(o.getOpcRetryToken()); invocationCallback(o.getInvocationCallback()); return this; }