@Test public void translateToUpdateRequest_arn() { ResourceModel model = ResourceModel.builder() .arn("arn:aws:cloudformation:us-west-2:123456789012:type/resource/AWS-Test-Resource/00000002") .versionId("00000002") .build(); SetTypeDefaultVersionRequest request = Translator.translateToUpdateRequest(model); assertThat(request.arn()).isEqualTo("arn:aws:cloudformation:us-west-2:123456789012:type/resource/AWS-Test-Resource/00000002"); assertThat(request.type()).isNull(); assertThat(request.typeName()).isNull(); assertThat(request.versionId()).isNull(); }
static SetTypeDefaultVersionRequest translateToUpdateRequest(@NonNull final ResourceModel model) { if (model.getArn() != null) { return SetTypeDefaultVersionRequest.builder() .arn(model.getArn()) .build(); } else { return SetTypeDefaultVersionRequest.builder() .type(RegistryType.RESOURCE) .typeName(model.getTypeName()) .versionId(model.getVersionId()) .build(); } }
Translator { static SetTypeDefaultVersionRequest translateToUpdateRequest(@NonNull final ResourceModel model) { if (model.getArn() != null) { return SetTypeDefaultVersionRequest.builder() .arn(model.getArn()) .build(); } else { return SetTypeDefaultVersionRequest.builder() .type(RegistryType.RESOURCE) .typeName(model.getTypeName()) .versionId(model.getVersionId()) .build(); } } }
Translator { static SetTypeDefaultVersionRequest translateToUpdateRequest(@NonNull final ResourceModel model) { if (model.getArn() != null) { return SetTypeDefaultVersionRequest.builder() .arn(model.getArn()) .build(); } else { return SetTypeDefaultVersionRequest.builder() .type(RegistryType.RESOURCE) .typeName(model.getTypeName()) .versionId(model.getVersionId()) .build(); } }  }
Translator { static SetTypeDefaultVersionRequest translateToUpdateRequest(@NonNull final ResourceModel model) { if (model.getArn() != null) { return SetTypeDefaultVersionRequest.builder() .arn(model.getArn()) .build(); } else { return SetTypeDefaultVersionRequest.builder() .type(RegistryType.RESOURCE) .typeName(model.getTypeName()) .versionId(model.getVersionId()) .build(); } }   }
Translator { static SetTypeDefaultVersionRequest translateToUpdateRequest(@NonNull final ResourceModel model) { if (model.getArn() != null) { return SetTypeDefaultVersionRequest.builder() .arn(model.getArn()) .build(); } else { return SetTypeDefaultVersionRequest.builder() .type(RegistryType.RESOURCE) .typeName(model.getTypeName()) .versionId(model.getVersionId()) .build(); } }    }