@Test public void translateToCreateRequest_nullLoggingConfig() { ResourceModel model = ResourceModel.builder() .executionRoleArn("arn:aws:iam::123456789012:role/AppRole") .schemaHandlerPackage("example-bucket/some/path/code.zip") .typeName("AWS::Test::Resource") .build(); RegisterTypeRequest request = Translator.translateToCreateRequest(model); assertThat(request.executionRoleArn()).isEqualTo(model.getExecutionRoleArn()); assertThat(request.loggingConfig()).isNull(); assertThat(request.schemaHandlerPackage()).isEqualTo(model.getSchemaHandlerPackage()); assertThat(request.type()).isEqualTo(RegistryType.RESOURCE); assertThat(request.typeName()).isEqualTo(model.getTypeName()); }
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(); }    }