-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(specs): rename composition to composition-full (private) and add…
… composition (public) (generated) algolia/api-clients-automation#4357 Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Emmanuel Krebs <[email protected]> Co-authored-by: shortcuts <[email protected]> Co-authored-by: Pierre Millot <[email protected]>
- Loading branch information
1 parent
44b85a2
commit 25e0431
Showing
109 changed files
with
5,587 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,4 +22,4 @@ dev_dependencies: | |
json_serializable: ^6.7.0 | ||
lints: ^5.0.0 | ||
logging: ^1.2.0 | ||
test: ^1.25.8 | ||
test: ^1.25.8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2013-Present Algolia | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
targets: | ||
$default: | ||
builders: | ||
json_serializable: | ||
options: | ||
any_map: false | ||
checked: true | ||
create_factory: true | ||
create_to_json: true | ||
disallow_unrecognized_keys: false | ||
explicit_to_json: true | ||
field_rename: none | ||
ignore_unannotated: false | ||
include_if_null: false |
58 changes: 58 additions & 0 deletions
58
packages/client_composition/lib/algolia_client_composition.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
// A sub-package of the AlgoliaSearch library, offering composition-specific functionalities for enhanced search and discovery in Dart/Flutter apps. | ||
library; | ||
|
||
export 'package:algolia_client_core/algolia_client_core.dart'; | ||
|
||
export 'src/api/composition_client.dart'; | ||
|
||
export 'src/model/around_radius_all.dart'; | ||
export 'src/model/banner.dart'; | ||
export 'src/model/banner_image.dart'; | ||
export 'src/model/banner_image_url.dart'; | ||
export 'src/model/banner_link.dart'; | ||
export 'src/model/base_search_response.dart'; | ||
export 'src/model/composition_base_search_response.dart'; | ||
export 'src/model/composition_id_ranking_info.dart'; | ||
export 'src/model/composition_ranking_info.dart'; | ||
export 'src/model/composition_run_applied_rules.dart'; | ||
export 'src/model/composition_run_search_response.dart'; | ||
export 'src/model/compositions_search_response.dart'; | ||
export 'src/model/error_base.dart'; | ||
export 'src/model/exhaustive.dart'; | ||
export 'src/model/facet_hits.dart'; | ||
export 'src/model/facet_ordering.dart'; | ||
export 'src/model/facet_stats.dart'; | ||
export 'src/model/facets.dart'; | ||
export 'src/model/highlight_result_option.dart'; | ||
export 'src/model/hit.dart'; | ||
export 'src/model/hit_ranking_info.dart'; | ||
export 'src/model/match_level.dart'; | ||
export 'src/model/matched_geo_location.dart'; | ||
export 'src/model/params.dart'; | ||
export 'src/model/personalization.dart'; | ||
export 'src/model/range.dart'; | ||
export 'src/model/ranking_info.dart'; | ||
export 'src/model/redirect.dart'; | ||
export 'src/model/redirect_rule_index_data.dart'; | ||
export 'src/model/redirect_rule_index_metadata.dart'; | ||
export 'src/model/redirect_url.dart'; | ||
export 'src/model/rendering_content.dart'; | ||
export 'src/model/request_body.dart'; | ||
export 'src/model/results_composition_info_response.dart'; | ||
export 'src/model/results_compositions_response.dart'; | ||
export 'src/model/results_injected_item_applied_rules_info_response.dart'; | ||
export 'src/model/results_injected_item_info_response.dart'; | ||
export 'src/model/search_for_facet_values_params.dart'; | ||
export 'src/model/search_for_facet_values_request.dart'; | ||
export 'src/model/search_for_facet_values_response.dart'; | ||
export 'src/model/search_for_facet_values_results.dart'; | ||
export 'src/model/search_hits.dart'; | ||
export 'src/model/search_pagination.dart'; | ||
export 'src/model/search_response.dart'; | ||
export 'src/model/search_results.dart'; | ||
export 'src/model/search_results_item.dart'; | ||
export 'src/model/snippet_result_option.dart'; | ||
export 'src/model/sort_remaining_by.dart'; | ||
export 'src/model/supported_language.dart'; | ||
export 'src/model/value.dart'; | ||
export 'src/model/widgets.dart'; |
133 changes: 133 additions & 0 deletions
133
packages/client_composition/lib/src/api/composition_client.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. | ||
|
||
import 'package:algolia_client_core/algolia_client_core.dart'; | ||
import 'package:algolia_client_composition/src/deserialize.dart'; | ||
import 'package:algolia_client_composition/src/version.dart'; | ||
|
||
import 'package:algolia_client_composition/src/model/request_body.dart'; | ||
import 'package:algolia_client_composition/src/model/search_for_facet_values_request.dart'; | ||
import 'package:algolia_client_composition/src/model/search_for_facet_values_response.dart'; | ||
import 'package:algolia_client_composition/src/model/search_response.dart'; | ||
|
||
final class CompositionClient implements ApiClient { | ||
@override | ||
final ClientOptions options; | ||
|
||
final RetryStrategy _retryStrategy; | ||
|
||
CompositionClient({ | ||
required String appId, | ||
required String apiKey, | ||
this.options = const ClientOptions(), | ||
}) : _retryStrategy = RetryStrategy.create( | ||
segment: AgentSegment(value: "Composition", version: packageVersion), | ||
appId: appId, | ||
apiKey: apiKey, | ||
options: options, | ||
defaultHosts: () => | ||
[ | ||
Host(url: '$appId-dsn.algolia.net', callType: CallType.read), | ||
Host(url: '$appId.algolia.net', callType: CallType.write), | ||
] + | ||
([ | ||
Host(url: '$appId-1.algolianet.com'), | ||
Host(url: '$appId-2.algolianet.com'), | ||
Host(url: '$appId-3.algolianet.com'), | ||
]..shuffle()), | ||
) { | ||
assert(appId.isNotEmpty, '`appId` is missing.'); | ||
assert(apiKey.isNotEmpty, '`apiKey` is missing.'); | ||
} | ||
|
||
/// Allows to switch the API key used to authenticate requests. | ||
@override | ||
void setClientApiKey({required String apiKey}) { | ||
_retryStrategy.requester.setClientApiKey(apiKey); | ||
} | ||
|
||
/// Runs a query on a single composition and returns matching results. | ||
/// | ||
/// Required API Key ACLs: | ||
/// - search | ||
/// | ||
/// Parameters: | ||
/// * [compositionID] Unique Composition ObjectID. | ||
/// * [requestBody] | ||
/// * [requestOptions] additional request configuration. | ||
Future<SearchResponse> search({ | ||
required String compositionID, | ||
required RequestBody requestBody, | ||
RequestOptions? requestOptions, | ||
}) async { | ||
assert( | ||
compositionID.isNotEmpty, | ||
'Parameter `compositionID` is required when calling `search`.', | ||
); | ||
final request = ApiRequest( | ||
method: RequestMethod.post, | ||
path: r'/1/compositions/{compositionID}/run'.replaceAll( | ||
'{' r'compositionID' '}', | ||
Uri.encodeComponent(compositionID.toString())), | ||
isRead: true, | ||
body: requestBody.toJson(), | ||
); | ||
final response = await _retryStrategy.execute( | ||
request: request, | ||
options: requestOptions, | ||
); | ||
return deserialize<SearchResponse, SearchResponse>( | ||
response, | ||
'SearchResponse', | ||
growable: true, | ||
); | ||
} | ||
|
||
/// Searches for values of a specified facet attribute on the composition's main source's index. - By default, facet values are sorted by decreasing count. You can adjust this with the `sortFacetValueBy` parameter. - Searching for facet values doesn't work if you have **more than 65 searchable facets and searchable attributes combined**. | ||
/// | ||
/// Required API Key ACLs: | ||
/// - search | ||
/// | ||
/// Parameters: | ||
/// * [compositionID] Unique Composition ObjectID. | ||
/// * [facetName] Facet attribute in which to search for values. This attribute must be included in the `attributesForFaceting` index setting with the `searchable()` modifier. | ||
/// * [searchForFacetValuesRequest] | ||
/// * [requestOptions] additional request configuration. | ||
Future<SearchForFacetValuesResponse> searchForFacetValues({ | ||
required String compositionID, | ||
required String facetName, | ||
SearchForFacetValuesRequest? searchForFacetValuesRequest, | ||
RequestOptions? requestOptions, | ||
}) async { | ||
assert( | ||
compositionID.isNotEmpty, | ||
'Parameter `compositionID` is required when calling `searchForFacetValues`.', | ||
); | ||
assert( | ||
facetName.isNotEmpty, | ||
'Parameter `facetName` is required when calling `searchForFacetValues`.', | ||
); | ||
final request = ApiRequest( | ||
method: RequestMethod.post, | ||
path: r'/1/compositions/{compositionID}/facets/{facetName}/query' | ||
.replaceAll('{' r'compositionID' '}', | ||
Uri.encodeComponent(compositionID.toString())) | ||
.replaceAll( | ||
'{' r'facetName' '}', Uri.encodeComponent(facetName.toString())), | ||
isRead: true, | ||
body: searchForFacetValuesRequest?.toJson(), | ||
); | ||
final response = await _retryStrategy.execute( | ||
request: request, | ||
options: requestOptions, | ||
); | ||
return deserialize<SearchForFacetValuesResponse, | ||
SearchForFacetValuesResponse>( | ||
response, | ||
'SearchForFacetValuesResponse', | ||
growable: true, | ||
); | ||
} | ||
|
||
@override | ||
void dispose() => _retryStrategy.dispose(); | ||
} |
Oops, something went wrong.