{"action":"created","issue":{"url":"https://api.github.com/repos/algolia/algoliasearch-client-java-2/issues/520","repository_url":"https://api.github.com/repos/algolia/algoliasearch-client-java-2","labels_url":"https://api.github.com/repos/algolia/algoliasearch-client-java-2/issues/520/labels{/name}","comments_url":"https://api.github.com/repos/algolia/algoliasearch-client-java-2/issues/520/comments","events_url":"https://api.github.com/repos/algolia/algoliasearch-client-java-2/issues/520/events","html_url":"https://github.com/algolia/algoliasearch-client-java-2/issues/520","id":377385604,"node_id":"MDU6SXNzdWUzNzczODU2MDQ=","number":520,"title":"Missing: setIndexName in the moveToMethod","user":{"login":"Ant-hem","id":22633119,"node_id":"MDQ6VXNlcjIyNjMzMTE5","avatar_url":"https://avatars3.githubusercontent.com/u/22633119?v=4","gravatar_id":"","url":"https://api.github.com/users/Ant-hem","html_url":"https://github.com/Ant-hem","followers_url":"https://api.github.com/users/Ant-hem/followers","following_url":"https://api.github.com/users/Ant-hem/following{/other_user}","gists_url":"https://api.github.com/users/Ant-hem/gists{/gist_id}","starred_url":"https://api.github.com/users/Ant-hem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ant-hem/subscriptions","organizations_url":"https://api.github.com/users/Ant-hem/orgs","repos_url":"https://api.github.com/users/Ant-hem/repos","events_url":"https://api.github.com/users/Ant-hem/events{/privacy}","received_events_url":"https://api.github.com/users/Ant-hem/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-11-05T12:48:22Z","updated_at":"2018-11-08T12:43:52Z","closed_at":"2018-11-08T12:43:52Z","author_association":"MEMBER","body":"### Description\r\n\r\nBreaking change: **YES**.\r\n\r\nWhen performing the `moveTo` method in `SyncIndexCRUD` or `AsyncIndexCRUD` the code should update the `indexName` property. As the `indexName` is not updated, the client could perfom other operations with the old index name. As it doesn't exist anymore it will result in an error.\r\n\r\nTo fix this, we need to add `setName()`method  in `SyncIndexCRUD`,`AsyncIndexCRUD`, `Index` and update the `AbstractIndex` interface (breaking).\r\n\r\n### Sample of the modification\r\n\r\nBefore: \r\nSyncIndexCRUD.java\r\n```java\r\n  default Task moveTo(@Nonnull String dstIndexName, @Nonnull RequestOptions requestOptions)\r\n      throws AlgoliaException {\r\n    return getApiClient().moveIndex(getName(), dstIndexName, requestOptions);\r\n  }\r\n```\r\n\r\nAbstractIndex.java\r\n```java\r\npublic interface AbstractIndex<T> extends Serializable {\r\n  String getName();\r\n  Class<T> getKlass();\r\n}\r\n```\r\n\r\nAfter: \r\nSyncIndexCRUD.java\r\n``` java\r\ndefault Task moveTo(@Nonnull String dstIndexName, @Nonnull RequestOptions requestOptions)\r\n      throws AlgoliaException {\r\n    Task response = getApiClient().moveIndex(getName(), dstIndexName, requestOptions);\r\n    setName(dstIndexName);\r\n    return response;\r\n  }\r\n```\r\nAbstractIndex.java\r\n```java\r\npublic interface AbstractIndex<T> extends Serializable {\r\n  String getName();\r\n  String setName(String Name);\r\n  Class<T> getKlass();\r\n}\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/algolia/algoliasearch-client-java-2/issues/comments/436981663","html_url":"https://github.com/algolia/algoliasearch-client-java-2/issues/520#issuecomment-436981663","issue_url":"https://api.github.com/repos/algolia/algoliasearch-client-java-2/issues/520","id":436981663,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNjk4MTY2Mw==","user":{"login":"Ant-hem","id":22633119,"node_id":"MDQ6VXNlcjIyNjMzMTE5","avatar_url":"https://avatars3.githubusercontent.com/u/22633119?v=4","gravatar_id":"","url":"https://api.github.com/users/Ant-hem","html_url":"https://github.com/Ant-hem","followers_url":"https://api.github.com/users/Ant-hem/followers","following_url":"https://api.github.com/users/Ant-hem/following{/other_user}","gists_url":"https://api.github.com/users/Ant-hem/gists{/gist_id}","starred_url":"https://api.github.com/users/Ant-hem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ant-hem/subscriptions","organizations_url":"https://api.github.com/users/Ant-hem/orgs","repos_url":"https://api.github.com/users/Ant-hem/repos","events_url":"https://api.github.com/users/Ant-hem/events{/privacy}","received_events_url":"https://api.github.com/users/Ant-hem/received_events","type":"User","site_admin":false},"created_at":"2018-11-08T12:43:52Z","updated_at":"2018-11-08T12:43:52Z","author_association":"MEMBER","body":"Closing this issue since it's not being implemented anymore."}}
{"actor":{"display_login":"Ant-hem"}}