Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(client): Add one deleteIndex method (#427) #456

Merged
merged 1 commit into from
Feb 13, 2018

Conversation

aseure
Copy link
Contributor

@aseure aseure commented Feb 13, 2018

Closes #427

Apparently, the method with RequestOptions wasn't missing. So here, I'm just adding the one without it, to stay consistent with other methods.

Question

However, I have a question: I've also added the @Nonnull annotations on the existing deleteIndex method. Will it break existing implementations? It will prevent people passing null from compiling but this is really a useful check, it's easy to fix and it shouldn't happen in the first place. WDYT?

Test plan

As the first method is already tested for both sync and async clients, I have added no tests.

Copy link
Contributor

@ElPicador ElPicador left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The method should also be added in AsyncClient.

It's ok to add the @Nonnull it was only an internal method that is public now.

@@ -232,6 +232,24 @@ public Task copyIndex(
return copyIndex(srcIndexName, dstIndexName, scopes, RequestOptions.empty);
}

public Task deleteIndex(@Nonnull String indexName) throws AlgoliaException {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add the javadoc for those 2 methods?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes right, totally forgot. Will do.

@aseure
Copy link
Contributor Author

aseure commented Feb 13, 2018

@ElPicador I think we're good now. Let me know.

@aseure aseure removed the question label Feb 13, 2018
*
* @param indexName The index name that will be deleted
* @return The associated task
* @throws AlgoliaException
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove if you do not put a comment

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok I'll remove it.

* @param indexName The index name that will be deleted
* @param requestOptions Options to pass to this request
* @return The associated task
* @throws AlgoliaException
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

@@ -648,7 +648,11 @@ public String generateSecuredApiKey(
}

/** Package protected method for the Index class */
CompletableFuture<AsyncTask> deleteIndex(String indexName, RequestOptions requestOptions) {
CompletableFuture<AsyncTask> deleteIndex(@Nonnull String indexName) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the method should be public not protected anymore, like above

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok I wasn't sure 👍

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 77.481% when pulling 40449fd on fix/client-delete-index into 844af65 on master.

@ElPicador ElPicador merged commit 92b34af into master Feb 13, 2018
@ElPicador ElPicador deleted the fix/client-delete-index branch February 13, 2018 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement client.deleteIndex(indexName, requestOptions)
3 participants