@Test public void translateToCreateRequest_nullResourceModel() { assertThatThrownBy(() -> Translator.translateToCreateRequest(null)) .hasNoCause() .hasMessageStartingWith("model is marked") .isExactlyInstanceOf(NullPointerException.class); }
static RegisterTypeRequest translateToCreateRequest(@NonNull final ResourceModel model) { final RegisterTypeRequest.Builder builder = RegisterTypeRequest.builder() .executionRoleArn(model.getExecutionRoleArn()) .schemaHandlerPackage(model.getSchemaHandlerPackage()) .type(RegistryType.RESOURCE) .typeName(model.getTypeName()); if (model.getLoggingConfig() != null) { builder.loggingConfig(translateToSDK(model.getLoggingConfig())); } return builder.build(); }
Translator { static RegisterTypeRequest translateToCreateRequest(@NonNull final ResourceModel model) { final RegisterTypeRequest.Builder builder = RegisterTypeRequest.builder() .executionRoleArn(model.getExecutionRoleArn()) .schemaHandlerPackage(model.getSchemaHandlerPackage()) .type(RegistryType.RESOURCE) .typeName(model.getTypeName()); if (model.getLoggingConfig() != null) { builder.loggingConfig(translateToSDK(model.getLoggingConfig())); } return builder.build(); } }
Translator { static RegisterTypeRequest translateToCreateRequest(@NonNull final ResourceModel model) { final RegisterTypeRequest.Builder builder = RegisterTypeRequest.builder() .executionRoleArn(model.getExecutionRoleArn()) .schemaHandlerPackage(model.getSchemaHandlerPackage()) .type(RegistryType.RESOURCE) .typeName(model.getTypeName()); if (model.getLoggingConfig() != null) { builder.loggingConfig(translateToSDK(model.getLoggingConfig())); } return builder.build(); }  }
Translator { static RegisterTypeRequest translateToCreateRequest(@NonNull final ResourceModel model) { final RegisterTypeRequest.Builder builder = RegisterTypeRequest.builder() .executionRoleArn(model.getExecutionRoleArn()) .schemaHandlerPackage(model.getSchemaHandlerPackage()) .type(RegistryType.RESOURCE) .typeName(model.getTypeName()); if (model.getLoggingConfig() != null) { builder.loggingConfig(translateToSDK(model.getLoggingConfig())); } return builder.build(); }   }
Translator { static RegisterTypeRequest translateToCreateRequest(@NonNull final ResourceModel model) { final RegisterTypeRequest.Builder builder = RegisterTypeRequest.builder() .executionRoleArn(model.getExecutionRoleArn()) .schemaHandlerPackage(model.getSchemaHandlerPackage()) .type(RegistryType.RESOURCE) .typeName(model.getTypeName()); if (model.getLoggingConfig() != null) { builder.loggingConfig(translateToSDK(model.getLoggingConfig())); } return builder.build(); }    }