|
667 | 667 | "deleteObject": { |
668 | 668 | "default": "final response = await client.deleteObject(\n indexName: \"<YOUR_INDEX_NAME>\",\n objectID: \"uniqueID\",\n);" |
669 | 669 | }, |
670 | | - "deleteObjects": { |
671 | | - "default": "final response = await client.deleteObjects(\n indexName: \"<YOUR_INDEX_NAME>\",\n objectIDs: [\n \"1\",\n \"2\",\n ],\n);" |
672 | | - }, |
673 | 670 | "deleteRule": { |
674 | 671 | "delete rule simple case": "final response = await client.deleteRule(\n indexName: \"<YOUR_INDEX_NAME>\",\n objectID: \"id1\",\n);", |
675 | 672 | "delete rule with simple characters to encode in objectID": "final response = await client.deleteRule(\n indexName: \"<YOUR_INDEX_NAME>\",\n objectID: \"test/with/slash\",\n);" |
|
680 | 677 | "deleteSynonym": { |
681 | 678 | "default": "final response = await client.deleteSynonym(\n indexName: \"<YOUR_INDEX_NAME>\",\n objectID: \"id1\",\n);" |
682 | 679 | }, |
683 | | - "generateSecuredApiKey": { |
684 | | - "api key basic": "final response = client.generateSecuredApiKey(\n parentApiKey: \"2640659426d5107b6e47d75db9cbaef8\",\n restrictions: SecuredApiKeyRestrictions(\n validUntil: 2524604400,\n restrictIndices: [\n \"Movies\",\n ],\n ),\n);", |
685 | | - "with searchParams": "final response = client.generateSecuredApiKey(\n parentApiKey: \"2640659426d5107b6e47d75db9cbaef8\",\n restrictions: SecuredApiKeyRestrictions(\n validUntil: 2524604400,\n restrictIndices: [\n \"Movies\",\n \"cts_e2e_settings\",\n ],\n restrictSources: \"192.168.1.0/24\",\n filters: \"category:Book OR category:Ebook AND _tags:published\",\n userToken: \"user123\",\n searchParams: SearchParamsObject(\n query: \"batman\",\n typoTolerance: TypoToleranceEnum.fromJson(\"strict\"),\n aroundRadius: AroundRadiusAll.fromJson(\"all\"),\n mode: Mode.fromJson(\"neuralSearch\"),\n hitsPerPage: 10,\n optionalWords: [\n \"one\",\n \"two\",\n ],\n ),\n ),\n);", |
686 | | - "with filters": "final response = client.generateSecuredApiKey(\n parentApiKey: \"2640659426d5107b6e47d75db9cbaef8\",\n restrictions: SecuredApiKeyRestrictions(\n filters:\n \"user:user42 AND user:public AND (visible_by:John OR visible_by:group/Finance)\",\n ),\n);", |
687 | | - "with visible_by filter": "final response = client.generateSecuredApiKey(\n parentApiKey: \"2640659426d5107b6e47d75db9cbaef8\",\n restrictions: SecuredApiKeyRestrictions(\n filters: \"visible_by:group/Finance\",\n ),\n);", |
688 | | - "with userID": "final response = client.generateSecuredApiKey(\n parentApiKey: \"2640659426d5107b6e47d75db9cbaef8\",\n restrictions: SecuredApiKeyRestrictions(\n userToken: \"user42\",\n ),\n);", |
689 | | - "mcm with filters": "final response = client.generateSecuredApiKey(\n parentApiKey: \"YourSearchOnlyApiKey\",\n restrictions: SecuredApiKeyRestrictions(\n filters: \"user:user42 AND user:public\",\n ),\n);", |
690 | | - "mcm with user token": "final response = client.generateSecuredApiKey(\n parentApiKey: \"YourSearchOnlyApiKey\",\n restrictions: SecuredApiKeyRestrictions(\n userToken: \"user42\",\n ),\n);" |
691 | | - }, |
692 | 680 | "getApiKey": { |
693 | 681 | "default": "final response = await client.getApiKey(\n key: \"myTestApiKey\",\n);" |
694 | 682 | }, |
|
739 | 727 | "hasPendingMappings with minimal parameters": "final response = await client.hasPendingMappings();", |
740 | 728 | "hasPendingMappings with parameters": "final response = await client.hasPendingMappings(\n getClusters: true,\n);" |
741 | 729 | }, |
742 | | - "indexExists": { |
743 | | - "indexExists": "final response = await client.indexExists(\n indexName: \"<YOUR_INDEX_NAME>\",\n);", |
744 | | - "indexNotExists": "final response = await client.indexExists(\n indexName: \"<YOUR_INDEX_NAME>\",\n);", |
745 | | - "indexExistsWithError": "final response = await client.indexExists(\n indexName: \"<YOUR_INDEX_NAME>\",\n);" |
746 | | - }, |
747 | 730 | "listApiKeys": { |
748 | 731 | "default": "final response = await client.listApiKeys();" |
749 | 732 | }, |
|
776 | 759 | "add men pant": "final response = await client.partialUpdateObject(\n indexName: \"<YOUR_INDEX_NAME>\",\n objectID: \"productId\",\n attributesToUpdate: {\n 'categoryPageId': {\n '_operation': \"Add\",\n 'value': \"men-clothing-pants\",\n },\n },\n);", |
777 | 760 | "remove men pant": "final response = await client.partialUpdateObject(\n indexName: \"<YOUR_INDEX_NAME>\",\n objectID: \"productId\",\n attributesToUpdate: {\n 'categoryPageId': {\n '_operation': \"Remove\",\n 'value': \"men-clothing-pants\",\n },\n },\n);" |
778 | 761 | }, |
779 | | - "partialUpdateObjects": { |
780 | | - "call partialUpdateObjects with createIfNotExists=true": "final response = await client.partialUpdateObjects(\n indexName: \"<YOUR_INDEX_NAME>\",\n objects: [\n {\n 'objectID': \"1\",\n 'name': \"Adam\",\n },\n {\n 'objectID': \"2\",\n 'name': \"Benoit\",\n },\n ],\n createIfNotExists: true,\n);", |
781 | | - "call partialUpdateObjects with createIfNotExists=false": "final response = await client.partialUpdateObjects(\n indexName: \"<YOUR_INDEX_NAME>\",\n objects: [\n {\n 'objectID': \"3\",\n 'name': \"Cyril\",\n },\n {\n 'objectID': \"4\",\n 'name': \"David\",\n },\n ],\n createIfNotExists: false,\n);" |
782 | | - }, |
783 | 762 | "removeUserId": { |
784 | 763 | "default": "final response = await client.removeUserId(\n userID: \"uniqueID\",\n);" |
785 | 764 | }, |
786 | | - "replaceAllObjects": { |
787 | | - "call replaceAllObjects without error": "final response = await client.replaceAllObjects(\n indexName: \"<YOUR_INDEX_NAME>\",\n objects: [\n {\n 'objectID': \"1\",\n 'name': \"Adam\",\n },\n {\n 'objectID': \"2\",\n 'name': \"Benoit\",\n },\n {\n 'objectID': \"3\",\n 'name': \"Cyril\",\n },\n {\n 'objectID': \"4\",\n 'name': \"David\",\n },\n {\n 'objectID': \"5\",\n 'name': \"Eva\",\n },\n {\n 'objectID': \"6\",\n 'name': \"Fiona\",\n },\n {\n 'objectID': \"7\",\n 'name': \"Gael\",\n },\n {\n 'objectID': \"8\",\n 'name': \"Hugo\",\n },\n {\n 'objectID': \"9\",\n 'name': \"Igor\",\n },\n {\n 'objectID': \"10\",\n 'name': \"Julia\",\n },\n ],\n batchSize: 3,\n);", |
788 | | - "call replaceAllObjects with partial scopes": "final response = await client.replaceAllObjects(\n indexName: \"<YOUR_INDEX_NAME>\",\n objects: [\n {\n 'objectID': \"1\",\n 'name': \"Adam\",\n },\n {\n 'objectID': \"2\",\n 'name': \"Benoit\",\n },\n ],\n batchSize: 77,\n scopes: [\n ScopeType.fromJson(\"settings\"),\n ScopeType.fromJson(\"synonyms\"),\n ],\n);", |
789 | | - "replaceAllObjects should cleanup on failure": "final response = await client.replaceAllObjects(\n indexName: \"<YOUR_INDEX_NAME>\",\n objects: [\n {\n 'objectID': \"fine\",\n 'body': \"small obj\",\n },\n {\n 'objectID': \"toolarge\",\n 'body': \"something bigger than 10KB\",\n },\n ],\n);" |
790 | | - }, |
791 | 765 | "replaceSources": { |
792 | 766 | "default": "final response = await client.replaceSources(\n source: [\n Source(\n source: \"theSource\",\n description: \"theDescription\",\n ),\n ],\n);" |
793 | 767 | }, |
|
797 | 771 | "saveObject": { |
798 | 772 | "default": "final response = await client.saveObject(\n indexName: \"<YOUR_INDEX_NAME>\",\n body: {\n 'name': \"Black T-shirt\",\n 'color': \"#000000||black\",\n 'availableIn': \"https://source.unsplash.com/100x100/?paris||Paris\",\n 'objectID': \"myID\",\n },\n);" |
799 | 773 | }, |
800 | | - "saveObjects": { |
801 | | - "call saveObjects without error": "final response = await client.saveObjects(\n indexName: \"<YOUR_INDEX_NAME>\",\n objects: [\n {\n 'objectID': \"1\",\n 'name': \"Adam\",\n },\n {\n 'objectID': \"2\",\n 'name': \"Benoit\",\n },\n ],\n);", |
802 | | - "saveObjects should report errors": "final response = await client.saveObjects(\n indexName: \"<YOUR_INDEX_NAME>\",\n objects: [\n {\n 'objectID': \"1\",\n 'name': \"Adam\",\n },\n {\n 'objectID': \"2\",\n 'name': \"Benoit\",\n },\n ],\n);", |
803 | | - "saveObjectsPlaylist": "final response = await client.saveObjects(\n indexName: \"<YOUR_INDEX_NAME>\",\n objects: [\n {\n 'objectID': \"1\",\n 'visibility': \"public\",\n 'name': \"Hot 100 Billboard Charts\",\n 'playlistId': \"d3e8e8f3-0a4f-4b7d-9b6b-7e8f4e8e3a0f\",\n 'createdAt': \"1500240452\",\n },\n ],\n);", |
804 | | - "saveObjectsPublicUser": "final response = await client.saveObjects(\n indexName: \"<YOUR_INDEX_NAME>\",\n objects: [\n {\n 'objectID': \"1\",\n 'visibility': \"public\",\n 'name': \"Hot 100 Billboard Charts\",\n 'playlistId': \"d3e8e8f3-0a4f-4b7d-9b6b-7e8f4e8e3a0f\",\n 'createdAt': \"1500240452\",\n },\n ],\n waitForTasks: false,\n batchSize: 1000,\n requestOptions: RequestOptions(\n headers: {\n 'X-Algolia-User-ID': '*',\n },\n ),\n);" |
805 | | - }, |
806 | 774 | "saveRule": { |
807 | 775 | "saveRule with minimal parameters": "final response = await client.saveRule(\n indexName: \"<YOUR_INDEX_NAME>\",\n objectID: \"id1\",\n rule: Rule(\n objectID: \"id1\",\n conditions: [\n Condition(\n pattern: \"apple\",\n anchoring: Anchoring.fromJson(\"contains\"),\n ),\n ],\n consequence: Consequence(\n params: ConsequenceParams(\n filters: \"brand:xiaomi\",\n ),\n ),\n ),\n);", |
808 | 776 | "saveRule with all parameters": "final response = await client.saveRule(\n indexName: \"<YOUR_INDEX_NAME>\",\n objectID: \"id1\",\n rule: Rule(\n objectID: \"id1\",\n conditions: [\n Condition(\n pattern: \"apple\",\n anchoring: Anchoring.fromJson(\"contains\"),\n alternatives: false,\n context: \"search\",\n ),\n ],\n consequence: Consequence(\n params: ConsequenceParams(\n filters: \"brand:apple\",\n query: ConsequenceQueryObject(\n remove: [\n \"algolia\",\n ],\n edits: [\n Edit(\n type: EditType.fromJson(\"remove\"),\n delete: \"abc\",\n insert: \"cde\",\n ),\n Edit(\n type: EditType.fromJson(\"replace\"),\n delete: \"abc\",\n insert: \"cde\",\n ),\n ],\n ),\n ),\n hide: [\n ConsequenceHide(\n objectID: \"321\",\n ),\n ],\n filterPromotes: false,\n userData: {\n 'algolia': \"aloglia\",\n },\n promote: [\n PromoteObjectID(\n objectID: \"abc\",\n position: 3,\n ),\n PromoteObjectIDs(\n objectIDs: [\n \"abc\",\n \"def\",\n ],\n position: 1,\n ),\n ],\n ),\n description: \"test\",\n enabled: true,\n validity: [\n TimeRange(\n from: 1656670273,\n until: 1656670277,\n ),\n ],\n ),\n forwardToReplicas: true,\n);", |
|
1146 | 1114 | "updateApiKey": { |
1147 | 1115 | "default": "final response = await client.updateApiKey(\n key: \"ALGOLIA_API_KEY\",\n apiKey: ApiKey(\n acl: [\n Acl.fromJson(\"search\"),\n Acl.fromJson(\"addObject\"),\n ],\n validity: 300,\n maxQueriesPerIPPerHour: 100,\n maxHitsPerQuery: 20,\n ),\n);" |
1148 | 1116 | }, |
1149 | | - "waitForApiKey": { |
1150 | | - "wait for api key helper - add": "final response = await client.waitForApiKey(\n key: \"api-key-add-operation-test-dart\",\n operation: ApiKeyOperation.fromJson(\"add\"),\n);", |
1151 | | - "wait for api key - update": "final response = await client.waitForApiKey(\n key: \"api-key-update-operation-test-dart\",\n operation: ApiKeyOperation.fromJson(\"update\"),\n apiKey: ApiKey(\n description: \"my updated api key\",\n acl: [\n Acl.fromJson(\"search\"),\n Acl.fromJson(\"addObject\"),\n Acl.fromJson(\"deleteObject\"),\n ],\n indexes: [\n \"Movies\",\n \"Books\",\n ],\n referers: [\n \"*google.com\",\n \"*algolia.com\",\n ],\n validity: 305,\n maxQueriesPerIPPerHour: 95,\n maxHitsPerQuery: 20,\n ),\n);", |
1152 | | - "wait for api key - delete": "final response = await client.waitForApiKey(\n key: \"api-key-delete-operation-test-dart\",\n operation: ApiKeyOperation.fromJson(\"delete\"),\n);" |
1153 | | - }, |
1154 | | - "waitForAppTask": { |
1155 | | - "default": "final response = await client.waitForAppTask(\n taskID: 123,\n);" |
1156 | | - }, |
1157 | | - "waitForTask": { |
1158 | | - "default": "final response = await client.waitForTask(\n indexName: \"<YOUR_INDEX_NAME>\",\n taskID: 123,\n);" |
1159 | | - }, |
1160 | 1117 | "init": { |
1161 | 1118 | "default": "final client =\n SearchClient(appId: 'ALGOLIA_APPLICATION_ID', apiKey: 'ALGOLIA_API_KEY');" |
1162 | 1119 | } |
|
0 commit comments