@Test public void translateToDeleteRequest_defaultVersion() { ResourceModel model = ResourceModel.builder() .isDefaultVersion(true) .typeName("AWS::Test::Resource") .build(); DeregisterTypeRequest request = Translator.translateToDeleteRequest(model, logger); assertThat(request.arn()).isNull(); assertThat(request.type()).isEqualTo(RegistryType.RESOURCE); assertThat(request.typeName()).isEqualTo(model.getTypeName()); }
static DeregisterTypeRequest translateToDeleteRequest(@NonNull final ResourceModel model, @NonNull final Logger logger) { if (model.getIsDefaultVersion()) { logger.log("De-registering default version"); return DeregisterTypeRequest.builder() .type(RegistryType.RESOURCE) .typeName(model.getTypeName()) .build(); } else { logger.log("De-registering version"); return DeregisterTypeRequest.builder() .arn(model.getArn()) .build(); } }
Translator { static DeregisterTypeRequest translateToDeleteRequest(@NonNull final ResourceModel model, @NonNull final Logger logger) { if (model.getIsDefaultVersion()) { logger.log("De-registering default version"); return DeregisterTypeRequest.builder() .type(RegistryType.RESOURCE) .typeName(model.getTypeName()) .build(); } else { logger.log("De-registering version"); return DeregisterTypeRequest.builder() .arn(model.getArn()) .build(); } } }
Translator { static DeregisterTypeRequest translateToDeleteRequest(@NonNull final ResourceModel model, @NonNull final Logger logger) { if (model.getIsDefaultVersion()) { logger.log("De-registering default version"); return DeregisterTypeRequest.builder() .type(RegistryType.RESOURCE) .typeName(model.getTypeName()) .build(); } else { logger.log("De-registering version"); return DeregisterTypeRequest.builder() .arn(model.getArn()) .build(); } }  }
Translator { static DeregisterTypeRequest translateToDeleteRequest(@NonNull final ResourceModel model, @NonNull final Logger logger) { if (model.getIsDefaultVersion()) { logger.log("De-registering default version"); return DeregisterTypeRequest.builder() .type(RegistryType.RESOURCE) .typeName(model.getTypeName()) .build(); } else { logger.log("De-registering version"); return DeregisterTypeRequest.builder() .arn(model.getArn()) .build(); } }   }
Translator { static DeregisterTypeRequest translateToDeleteRequest(@NonNull final ResourceModel model, @NonNull final Logger logger) { if (model.getIsDefaultVersion()) { logger.log("De-registering default version"); return DeregisterTypeRequest.builder() .type(RegistryType.RESOURCE) .typeName(model.getTypeName()) .build(); } else { logger.log("De-registering version"); return DeregisterTypeRequest.builder() .arn(model.getArn()) .build(); } }    }