|
123 | 123 | "default": "import com.algolia.api.AbtestingClient;\nimport com.algolia.config.*;" |
124 | 124 | }, |
125 | 125 | "addABTests": { |
126 | | - "default": "client.addABTests(\n new AddABTestsRequest()\n .setEndAt(\"2022-12-31T00:00:00.000Z\")\n .setName(\"myABTest\")\n .setVariants(\n Arrays.asList(\n new AbTestsVariant().setIndex(\"AB_TEST_1\").setTrafficPercentage(30),\n new AbTestsVariant().setIndex(\"AB_TEST_2\").setTrafficPercentage(50)\n )\n )\n);" |
| 126 | + "default": "ABTestResponse response = client.addABTests(\n new AddABTestsRequest()\n .setEndAt(\"2022-12-31T00:00:00.000Z\")\n .setName(\"myABTest\")\n .setVariants(\n Arrays.asList(\n new AbTestsVariant().setIndex(\"AB_TEST_1\").setTrafficPercentage(30),\n new AbTestsVariant().setIndex(\"AB_TEST_2\").setTrafficPercentage(50)\n )\n )\n);" |
127 | 127 | }, |
128 | 128 | "customDelete": { |
129 | | - "allow del method for a custom path with minimal parameters": "client.customDelete(\"test/minimal\");", |
130 | | - "allow del method for a custom path with all parameters": "client.customDelete(\n \"test/all\",\n new HashMap() {\n {\n put(\"query\", \"parameters\");\n }\n }\n);" |
| 129 | + "allow del method for a custom path with minimal parameters": "Object response = client.customDelete(\"test/minimal\");", |
| 130 | + "allow del method for a custom path with all parameters": "Object response = client.customDelete(\n \"test/all\",\n new HashMap() {\n {\n put(\"query\", \"parameters\");\n }\n }\n);" |
131 | 131 | }, |
132 | 132 | "customGet": { |
133 | | - "allow get method for a custom path with minimal parameters": "client.customGet(\"test/minimal\");", |
134 | | - "allow get method for a custom path with all parameters": "client.customGet(\n \"test/all\",\n new HashMap() {\n {\n put(\"query\", \"parameters with space\");\n }\n }\n);", |
135 | | - "requestOptions should be escaped too": "client.customGet(\n \"test/all\",\n new HashMap() {\n {\n put(\"query\", \"to be overridden\");\n }\n },\n new RequestOptions()\n .addExtraQueryParameters(\"query\", \"parameters with space\")\n .addExtraQueryParameters(\"and an array\", Arrays.asList(\"array\", \"with spaces\"))\n .addExtraHeader(\"x-header-1\", \"spaces are left alone\")\n);" |
| 133 | + "allow get method for a custom path with minimal parameters": "Object response = client.customGet(\"test/minimal\");", |
| 134 | + "allow get method for a custom path with all parameters": "Object response = client.customGet(\n \"test/all\",\n new HashMap() {\n {\n put(\"query\", \"parameters with space\");\n }\n }\n);", |
| 135 | + "requestOptions should be escaped too": "Object response = client.customGet(\n \"test/all\",\n new HashMap() {\n {\n put(\"query\", \"to be overridden\");\n }\n },\n new RequestOptions()\n .addExtraQueryParameters(\"query\", \"parameters with space\")\n .addExtraQueryParameters(\"and an array\", Arrays.asList(\"array\", \"with spaces\"))\n .addExtraHeader(\"x-header-1\", \"spaces are left alone\")\n);" |
136 | 136 | }, |
137 | 137 | "customPost": { |
138 | | - "allow post method for a custom path with minimal parameters": "client.customPost(\"test/minimal\");", |
139 | | - "allow post method for a custom path with all parameters": "client.customPost(\n \"test/all\",\n new HashMap() {\n {\n put(\"query\", \"parameters\");\n }\n },\n new HashMap() {\n {\n put(\"body\", \"parameters\");\n }\n }\n);", |
140 | | - "requestOptions can override default query parameters": "client.customPost(\n \"test/requestOptions\",\n new HashMap() {\n {\n put(\"query\", \"parameters\");\n }\n },\n new HashMap() {\n {\n put(\"facet\", \"filters\");\n }\n },\n new RequestOptions().addExtraQueryParameters(\"query\", \"myQueryParameter\")\n);", |
141 | | - "requestOptions merges query parameters with default ones": "client.customPost(\n \"test/requestOptions\",\n new HashMap() {\n {\n put(\"query\", \"parameters\");\n }\n },\n new HashMap() {\n {\n put(\"facet\", \"filters\");\n }\n },\n new RequestOptions().addExtraQueryParameters(\"query2\", \"myQueryParameter\")\n);", |
142 | | - "requestOptions can override default headers": "client.customPost(\n \"test/requestOptions\",\n new HashMap() {\n {\n put(\"query\", \"parameters\");\n }\n },\n new HashMap() {\n {\n put(\"facet\", \"filters\");\n }\n },\n new RequestOptions().addExtraHeader(\"x-algolia-api-key\", \"ALGOLIA_API_KEY\")\n);", |
143 | | - "requestOptions merges headers with default ones": "client.customPost(\n \"test/requestOptions\",\n new HashMap() {\n {\n put(\"query\", \"parameters\");\n }\n },\n new HashMap() {\n {\n put(\"facet\", \"filters\");\n }\n },\n new RequestOptions().addExtraHeader(\"x-algolia-api-key\", \"ALGOLIA_API_KEY\")\n);", |
144 | | - "requestOptions queryParameters accepts booleans": "client.customPost(\n \"test/requestOptions\",\n new HashMap() {\n {\n put(\"query\", \"parameters\");\n }\n },\n new HashMap() {\n {\n put(\"facet\", \"filters\");\n }\n },\n new RequestOptions().addExtraQueryParameters(\"isItWorking\", true)\n);", |
145 | | - "requestOptions queryParameters accepts integers": "client.customPost(\n \"test/requestOptions\",\n new HashMap() {\n {\n put(\"query\", \"parameters\");\n }\n },\n new HashMap() {\n {\n put(\"facet\", \"filters\");\n }\n },\n new RequestOptions().addExtraQueryParameters(\"myParam\", 2)\n);", |
146 | | - "requestOptions queryParameters accepts list of string": "client.customPost(\n \"test/requestOptions\",\n new HashMap() {\n {\n put(\"query\", \"parameters\");\n }\n },\n new HashMap() {\n {\n put(\"facet\", \"filters\");\n }\n },\n new RequestOptions().addExtraQueryParameters(\"myParam\", Arrays.asList(\"b and c\", \"d\"))\n);", |
147 | | - "requestOptions queryParameters accepts list of booleans": "client.customPost(\n \"test/requestOptions\",\n new HashMap() {\n {\n put(\"query\", \"parameters\");\n }\n },\n new HashMap() {\n {\n put(\"facet\", \"filters\");\n }\n },\n new RequestOptions().addExtraQueryParameters(\"myParam\", Arrays.asList(true, true, false))\n);", |
148 | | - "requestOptions queryParameters accepts list of integers": "client.customPost(\n \"test/requestOptions\",\n new HashMap() {\n {\n put(\"query\", \"parameters\");\n }\n },\n new HashMap() {\n {\n put(\"facet\", \"filters\");\n }\n },\n new RequestOptions().addExtraQueryParameters(\"myParam\", Arrays.asList(1, 2))\n);" |
| 138 | + "allow post method for a custom path with minimal parameters": "Object response = client.customPost(\"test/minimal\");", |
| 139 | + "allow post method for a custom path with all parameters": "Object response = client.customPost(\n \"test/all\",\n new HashMap() {\n {\n put(\"query\", \"parameters\");\n }\n },\n new HashMap() {\n {\n put(\"body\", \"parameters\");\n }\n }\n);", |
| 140 | + "requestOptions can override default query parameters": "Object response = client.customPost(\n \"test/requestOptions\",\n new HashMap() {\n {\n put(\"query\", \"parameters\");\n }\n },\n new HashMap() {\n {\n put(\"facet\", \"filters\");\n }\n },\n new RequestOptions().addExtraQueryParameters(\"query\", \"myQueryParameter\")\n);", |
| 141 | + "requestOptions merges query parameters with default ones": "Object response = client.customPost(\n \"test/requestOptions\",\n new HashMap() {\n {\n put(\"query\", \"parameters\");\n }\n },\n new HashMap() {\n {\n put(\"facet\", \"filters\");\n }\n },\n new RequestOptions().addExtraQueryParameters(\"query2\", \"myQueryParameter\")\n);", |
| 142 | + "requestOptions can override default headers": "Object response = client.customPost(\n \"test/requestOptions\",\n new HashMap() {\n {\n put(\"query\", \"parameters\");\n }\n },\n new HashMap() {\n {\n put(\"facet\", \"filters\");\n }\n },\n new RequestOptions().addExtraHeader(\"x-algolia-api-key\", \"ALGOLIA_API_KEY\")\n);", |
| 143 | + "requestOptions merges headers with default ones": "Object response = client.customPost(\n \"test/requestOptions\",\n new HashMap() {\n {\n put(\"query\", \"parameters\");\n }\n },\n new HashMap() {\n {\n put(\"facet\", \"filters\");\n }\n },\n new RequestOptions().addExtraHeader(\"x-algolia-api-key\", \"ALGOLIA_API_KEY\")\n);", |
| 144 | + "requestOptions queryParameters accepts booleans": "Object response = client.customPost(\n \"test/requestOptions\",\n new HashMap() {\n {\n put(\"query\", \"parameters\");\n }\n },\n new HashMap() {\n {\n put(\"facet\", \"filters\");\n }\n },\n new RequestOptions().addExtraQueryParameters(\"isItWorking\", true)\n);", |
| 145 | + "requestOptions queryParameters accepts integers": "Object response = client.customPost(\n \"test/requestOptions\",\n new HashMap() {\n {\n put(\"query\", \"parameters\");\n }\n },\n new HashMap() {\n {\n put(\"facet\", \"filters\");\n }\n },\n new RequestOptions().addExtraQueryParameters(\"myParam\", 2)\n);", |
| 146 | + "requestOptions queryParameters accepts list of string": "Object response = client.customPost(\n \"test/requestOptions\",\n new HashMap() {\n {\n put(\"query\", \"parameters\");\n }\n },\n new HashMap() {\n {\n put(\"facet\", \"filters\");\n }\n },\n new RequestOptions().addExtraQueryParameters(\"myParam\", Arrays.asList(\"b and c\", \"d\"))\n);", |
| 147 | + "requestOptions queryParameters accepts list of booleans": "Object response = client.customPost(\n \"test/requestOptions\",\n new HashMap() {\n {\n put(\"query\", \"parameters\");\n }\n },\n new HashMap() {\n {\n put(\"facet\", \"filters\");\n }\n },\n new RequestOptions().addExtraQueryParameters(\"myParam\", Arrays.asList(true, true, false))\n);", |
| 148 | + "requestOptions queryParameters accepts list of integers": "Object response = client.customPost(\n \"test/requestOptions\",\n new HashMap() {\n {\n put(\"query\", \"parameters\");\n }\n },\n new HashMap() {\n {\n put(\"facet\", \"filters\");\n }\n },\n new RequestOptions().addExtraQueryParameters(\"myParam\", Arrays.asList(1, 2))\n);" |
149 | 149 | }, |
150 | 150 | "customPut": { |
151 | | - "allow put method for a custom path with minimal parameters": "client.customPut(\"test/minimal\");", |
152 | | - "allow put method for a custom path with all parameters": "client.customPut(\n \"test/all\",\n new HashMap() {\n {\n put(\"query\", \"parameters\");\n }\n },\n new HashMap() {\n {\n put(\"body\", \"parameters\");\n }\n }\n);" |
| 151 | + "allow put method for a custom path with minimal parameters": "Object response = client.customPut(\"test/minimal\");", |
| 152 | + "allow put method for a custom path with all parameters": "Object response = client.customPut(\n \"test/all\",\n new HashMap() {\n {\n put(\"query\", \"parameters\");\n }\n },\n new HashMap() {\n {\n put(\"body\", \"parameters\");\n }\n }\n);" |
153 | 153 | }, |
154 | 154 | "deleteABTest": { |
155 | | - "default": "client.deleteABTest(42);" |
| 155 | + "default": "ABTestResponse response = client.deleteABTest(42);" |
156 | 156 | }, |
157 | 157 | "estimateABTest": { |
158 | | - "default": "client.estimateABTest(\n new EstimateABTestRequest()\n .setConfiguration(\n new EstimateConfiguration()\n .setEmptySearch(new EmptySearch().setExclude(true))\n .setMinimumDetectableEffect(new MinimumDetectableEffect().setSize(0.03).setMetric(EffectMetric.CONVERSION_RATE))\n )\n .setVariants(\n Arrays.asList(\n new AbTestsVariant().setIndex(\"AB_TEST_1\").setTrafficPercentage(50),\n new AbTestsVariant().setIndex(\"AB_TEST_2\").setTrafficPercentage(50)\n )\n )\n);" |
| 158 | + "default": "EstimateABTestResponse response = client.estimateABTest(\n new EstimateABTestRequest()\n .setConfiguration(\n new EstimateConfiguration()\n .setEmptySearch(new EmptySearch().setExclude(true))\n .setMinimumDetectableEffect(new MinimumDetectableEffect().setSize(0.03).setMetric(EffectMetric.CONVERSION_RATE))\n )\n .setVariants(\n Arrays.asList(\n new AbTestsVariant().setIndex(\"AB_TEST_1\").setTrafficPercentage(50),\n new AbTestsVariant().setIndex(\"AB_TEST_2\").setTrafficPercentage(50)\n )\n )\n);" |
159 | 159 | }, |
160 | 160 | "getABTest": { |
161 | | - "default": "client.getABTest(42);" |
| 161 | + "default": "ABTest response = client.getABTest(42);" |
162 | 162 | }, |
163 | 163 | "listABTests": { |
164 | | - "listABTests with minimal parameters": "client.listABTests();", |
165 | | - "listABTests with parameters": "client.listABTests(0, 21, \"cts_e2e ab\", \"t\");" |
| 164 | + "listABTests with minimal parameters": "ListABTestsResponse response = client.listABTests();", |
| 165 | + "listABTests with parameters": "ListABTestsResponse response = client.listABTests(0, 21, \"cts_e2e ab\", \"t\");" |
166 | 166 | }, |
167 | 167 | "scheduleABTest": { |
168 | | - "default": "client.scheduleABTest(\n new ScheduleABTestsRequest()\n .setEndAt(\"2022-12-31T00:00:00.000Z\")\n .setScheduledAt(\"2022-11-31T00:00:00.000Z\")\n .setName(\"myABTest\")\n .setVariants(\n Arrays.asList(\n new AbTestsVariant().setIndex(\"AB_TEST_1\").setTrafficPercentage(30),\n new AbTestsVariant().setIndex(\"AB_TEST_2\").setTrafficPercentage(50)\n )\n )\n);" |
| 168 | + "default": "ScheduleABTestResponse response = client.scheduleABTest(\n new ScheduleABTestsRequest()\n .setEndAt(\"2022-12-31T00:00:00.000Z\")\n .setScheduledAt(\"2022-11-31T00:00:00.000Z\")\n .setName(\"myABTest\")\n .setVariants(\n Arrays.asList(\n new AbTestsVariant().setIndex(\"AB_TEST_1\").setTrafficPercentage(30),\n new AbTestsVariant().setIndex(\"AB_TEST_2\").setTrafficPercentage(50)\n )\n )\n);" |
169 | 169 | }, |
170 | 170 | "setClientApiKey": { |
171 | 171 | "default": "client.setClientApiKey(\"updated-api-key\");" |
172 | 172 | }, |
173 | 173 | "stopABTest": { |
174 | | - "default": "client.stopABTest(42);" |
| 174 | + "default": "ABTestResponse response = client.stopABTest(42);" |
175 | 175 | }, |
176 | 176 | "init": { |
177 | 177 | "default": "AbtestingClient client = new AbtestingClient(\"ALGOLIA_APPLICATION_ID\", \"ALGOLIA_API_KEY\", \"ALGOLIA_APPLICATION_REGION\");" |
|
0 commit comments