From 77ffe1c1af37d0ee338872cb63d7c2dc07b98ede Mon Sep 17 00:00:00 2001 From: Jessica Date: Fri, 11 Mar 2022 09:49:48 +1100 Subject: [PATCH] add support for TrackEvent, Experiment, Banners (#3) - new accountId param for QueryCollection and SendEvent requests - bump package to v5.0.0 --- .openapi-generator/FILES | 30 +- .openapi-generator/VERSION | 2 +- README.md | 18 +- docs/Banner.md | 36 ++ docs/Collection.md | 2 +- docs/CollectionsApi.md | 186 ++++++++++- docs/Event.md | 28 ++ docs/EventsApi.md | 14 +- docs/ExperimentRequest.md | 24 ++ docs/ExperimentRequestPipeline.md | 20 ++ docs/ExperimentResponse.md | 18 + docs/GeneratePipelinesRequest.md | 4 +- docs/ListPromotionsRequestPromotionView.md | 15 + docs/PipelinesApi.md | 16 +- docs/Promotion.md | 2 + docs/PromotionPin.md | 2 + docs/PromotionPinMode.md | 15 + docs/PromotionsApi.md | 6 +- docs/QueryCollectionRequestTracking.md | 8 +- docs/QueryCollectionResponse.md | 4 + docs/QueryResult.md | 4 + docs/RecordsApi.md | 6 +- docs/RedirectsApi.md | 4 +- docs/SchemaApi.md | 6 +- docs/TextPosition.md | 15 + generate/generate.sh | 2 +- lib/sdk_ruby.rb | 10 +- lib/sdk_ruby/api/collections_api.rb | 192 +++++++++-- lib/sdk_ruby/api/events_api.rb | 23 +- lib/sdk_ruby/api/pipelines_api.rb | 18 +- lib/sdk_ruby/api/promotions_api.rb | 13 +- lib/sdk_ruby/api/records_api.rb | 14 +- lib/sdk_ruby/api/redirects_api.rb | 6 +- lib/sdk_ruby/api/schema_api.rb | 10 +- lib/sdk_ruby/api_client.rb | 4 +- lib/sdk_ruby/api_error.rb | 2 +- lib/sdk_ruby/configuration.rb | 2 +- lib/sdk_ruby/models/active_promotion.rb | 4 +- lib/sdk_ruby/models/banner.rb | 311 ++++++++++++++++++ .../batch_create_schema_fields_request.rb | 2 +- .../batch_create_schema_fields_response.rb | 2 +- ...tch_create_schema_fields_response_error.rb | 2 +- .../models/batch_update_records_request.rb | 2 +- .../models/batch_update_records_response.rb | 2 +- .../batch_update_records_response_error.rb | 2 +- .../batch_update_records_response_record.rb | 2 +- .../models/batch_upsert_records_request.rb | 2 +- .../batch_upsert_records_request_pipeline.rb | 2 +- .../models/batch_upsert_records_response.rb | 2 +- .../batch_upsert_records_response_error.rb | 2 +- .../batch_upsert_records_response_key.rb | 2 +- ...batch_upsert_records_response_variables.rb | 2 +- lib/sdk_ruby/models/collection.rb | 4 +- lib/sdk_ruby/models/delete_record_request.rb | 2 +- lib/sdk_ruby/models/error.rb | 2 +- lib/sdk_ruby/models/event.rb | 282 ++++++++++++++++ lib/sdk_ruby/models/experiment_request.rb | 257 +++++++++++++++ .../models/experiment_request_pipeline.rb | 235 +++++++++++++ lib/sdk_ruby/models/experiment_response.rb | 218 ++++++++++++ .../models/generate_pipelines_request.rb | 6 +- .../models/generate_pipelines_response.rb | 2 +- .../models/get_default_pipeline_response.rb | 2 +- .../get_default_version_request_view.rb | 2 +- .../models/get_pipeline_request_view.rb | 2 +- lib/sdk_ruby/models/get_record_request.rb | 2 +- .../models/list_collections_response.rb | 2 +- .../models/list_pipelines_request_view.rb | 2 +- .../models/list_pipelines_response.rb | 2 +- .../list_promotions_request_promotion_view.rb | 38 +++ .../models/list_promotions_response.rb | 2 +- .../models/list_redirects_response.rb | 2 +- .../models/list_schema_fields_response.rb | 2 +- lib/sdk_ruby/models/percentile_data_point.rb | 2 +- lib/sdk_ruby/models/pipeline.rb | 2 +- lib/sdk_ruby/models/pipeline_step.rb | 2 +- .../models/pipeline_step_param_binding.rb | 2 +- lib/sdk_ruby/models/pipeline_type.rb | 2 +- lib/sdk_ruby/models/promotion.rb | 16 +- lib/sdk_ruby/models/promotion_category.rb | 2 +- lib/sdk_ruby/models/promotion_exclusion.rb | 2 +- lib/sdk_ruby/models/promotion_filter_boost.rb | 2 +- .../models/promotion_filter_condition.rb | 2 +- lib/sdk_ruby/models/promotion_pin.rb | 15 +- lib/sdk_ruby/models/promotion_pin_mode.rb | 37 +++ lib/sdk_ruby/models/promotion_range_boost.rb | 2 +- lib/sdk_ruby/models/protobuf_any.rb | 2 +- lib/sdk_ruby/models/protobuf_field_mask.rb | 2 +- lib/sdk_ruby/models/protobuf_null_value.rb | 2 +- lib/sdk_ruby/models/query_aggregate_result.rb | 2 +- .../models/query_aggregate_result_analysis.rb | 2 +- .../models/query_aggregate_result_buckets.rb | 2 +- .../query_aggregate_result_buckets_bucket.rb | 2 +- .../models/query_aggregate_result_count.rb | 2 +- .../models/query_aggregate_result_date.rb | 2 +- .../models/query_aggregate_result_metric.rb | 2 +- .../query_aggregate_result_percentile.rb | 2 +- .../models/query_collection_request.rb | 2 +- .../query_collection_request_pipeline.rb | 2 +- .../query_collection_request_tracking.rb | 10 +- .../query_collection_request_tracking_type.rb | 3 +- .../models/query_collection_response.rb | 26 +- .../query_collection_response_pipeline.rb | 2 +- lib/sdk_ruby/models/query_result.rb | 23 +- lib/sdk_ruby/models/query_result_token.rb | 2 +- .../models/query_result_token_click.rb | 2 +- .../models/query_result_token_pos_neg.rb | 2 +- lib/sdk_ruby/models/record_key.rb | 2 +- lib/sdk_ruby/models/redirect.rb | 2 +- lib/sdk_ruby/models/redirect_result.rb | 4 +- lib/sdk_ruby/models/schema_field.rb | 2 +- lib/sdk_ruby/models/schema_field_mode.rb | 2 +- lib/sdk_ruby/models/schema_field_type.rb | 2 +- lib/sdk_ruby/models/send_event_request.rb | 2 +- .../models/set_default_pipeline_request.rb | 2 +- .../models/set_default_version_request.rb | 2 +- lib/sdk_ruby/models/status.rb | 2 +- lib/sdk_ruby/models/text_position.rb | 41 +++ lib/sdk_ruby/models/update_record_request.rb | 2 +- lib/sdk_ruby/models/upsert_record_request.rb | 2 +- .../models/upsert_record_request_pipeline.rb | 2 +- lib/sdk_ruby/models/upsert_record_response.rb | 2 +- lib/sdk_ruby/version.rb | 4 +- sdk_ruby.gemspec | 2 +- spec/api_client_spec.rb | 2 +- spec/configuration_spec.rb | 2 +- spec/models/banner_spec.rb | 88 +++++ spec/models/event_spec.rb | 64 ++++ .../experiment_request_pipeline_spec.rb | 40 +++ spec/models/experiment_request_spec.rb | 52 +++ spec/models/experiment_response_spec.rb | 34 ++ ..._promotions_request_promotion_view_spec.rb | 28 ++ spec/models/promotion_pin_mode_spec.rb | 28 ++ spec/models/text_position_spec.rb | 28 ++ spec/spec_helper.rb | 2 +- 134 files changed, 2604 insertions(+), 213 deletions(-) create mode 100644 docs/Banner.md create mode 100644 docs/Event.md create mode 100644 docs/ExperimentRequest.md create mode 100644 docs/ExperimentRequestPipeline.md create mode 100644 docs/ExperimentResponse.md create mode 100644 docs/ListPromotionsRequestPromotionView.md create mode 100644 docs/PromotionPinMode.md create mode 100644 docs/TextPosition.md create mode 100644 lib/sdk_ruby/models/banner.rb create mode 100644 lib/sdk_ruby/models/event.rb create mode 100644 lib/sdk_ruby/models/experiment_request.rb create mode 100644 lib/sdk_ruby/models/experiment_request_pipeline.rb create mode 100644 lib/sdk_ruby/models/experiment_response.rb create mode 100644 lib/sdk_ruby/models/list_promotions_request_promotion_view.rb create mode 100644 lib/sdk_ruby/models/promotion_pin_mode.rb create mode 100644 lib/sdk_ruby/models/text_position.rb create mode 100644 spec/models/banner_spec.rb create mode 100644 spec/models/event_spec.rb create mode 100644 spec/models/experiment_request_pipeline_spec.rb create mode 100644 spec/models/experiment_request_spec.rb create mode 100644 spec/models/experiment_response_spec.rb create mode 100644 spec/models/list_promotions_request_promotion_view_spec.rb create mode 100644 spec/models/promotion_pin_mode_spec.rb create mode 100644 spec/models/text_position_spec.rb diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 90f05b8..243dd0e 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -5,6 +5,7 @@ Gemfile README.md Rakefile docs/ActivePromotion.md +docs/Banner.md docs/BatchCreateSchemaFieldsRequest.md docs/BatchCreateSchemaFieldsResponse.md docs/BatchCreateSchemaFieldsResponseError.md @@ -22,7 +23,11 @@ docs/Collection.md docs/CollectionsApi.md docs/DeleteRecordRequest.md docs/Error.md +docs/Event.md docs/EventsApi.md +docs/ExperimentRequest.md +docs/ExperimentRequestPipeline.md +docs/ExperimentResponse.md docs/GeneratePipelinesRequest.md docs/GeneratePipelinesResponse.md docs/GetDefaultPipelineResponse.md @@ -32,6 +37,7 @@ docs/GetRecordRequest.md docs/ListCollectionsResponse.md docs/ListPipelinesRequestView.md docs/ListPipelinesResponse.md +docs/ListPromotionsRequestPromotionView.md docs/ListPromotionsResponse.md docs/ListRedirectsResponse.md docs/ListSchemaFieldsResponse.md @@ -47,6 +53,7 @@ docs/PromotionExclusion.md docs/PromotionFilterBoost.md docs/PromotionFilterCondition.md docs/PromotionPin.md +docs/PromotionPinMode.md docs/PromotionRangeBoost.md docs/PromotionsApi.md docs/ProtobufAny.md @@ -83,6 +90,7 @@ docs/SendEventRequest.md docs/SetDefaultPipelineRequest.md docs/SetDefaultVersionRequest.md docs/Status.md +docs/TextPosition.md docs/UpdateRecordRequest.md docs/UpsertRecordRequest.md docs/UpsertRecordRequestPipeline.md @@ -99,6 +107,7 @@ lib/sdk_ruby/api_client.rb lib/sdk_ruby/api_error.rb lib/sdk_ruby/configuration.rb lib/sdk_ruby/models/active_promotion.rb +lib/sdk_ruby/models/banner.rb lib/sdk_ruby/models/batch_create_schema_fields_request.rb lib/sdk_ruby/models/batch_create_schema_fields_response.rb lib/sdk_ruby/models/batch_create_schema_fields_response_error.rb @@ -115,6 +124,10 @@ lib/sdk_ruby/models/batch_upsert_records_response_variables.rb lib/sdk_ruby/models/collection.rb lib/sdk_ruby/models/delete_record_request.rb lib/sdk_ruby/models/error.rb +lib/sdk_ruby/models/event.rb +lib/sdk_ruby/models/experiment_request.rb +lib/sdk_ruby/models/experiment_request_pipeline.rb +lib/sdk_ruby/models/experiment_response.rb lib/sdk_ruby/models/generate_pipelines_request.rb lib/sdk_ruby/models/generate_pipelines_response.rb lib/sdk_ruby/models/get_default_pipeline_response.rb @@ -124,6 +137,7 @@ lib/sdk_ruby/models/get_record_request.rb lib/sdk_ruby/models/list_collections_response.rb lib/sdk_ruby/models/list_pipelines_request_view.rb lib/sdk_ruby/models/list_pipelines_response.rb +lib/sdk_ruby/models/list_promotions_request_promotion_view.rb lib/sdk_ruby/models/list_promotions_response.rb lib/sdk_ruby/models/list_redirects_response.rb lib/sdk_ruby/models/list_schema_fields_response.rb @@ -138,6 +152,7 @@ lib/sdk_ruby/models/promotion_exclusion.rb lib/sdk_ruby/models/promotion_filter_boost.rb lib/sdk_ruby/models/promotion_filter_condition.rb lib/sdk_ruby/models/promotion_pin.rb +lib/sdk_ruby/models/promotion_pin_mode.rb lib/sdk_ruby/models/promotion_range_boost.rb lib/sdk_ruby/models/protobuf_any.rb lib/sdk_ruby/models/protobuf_field_mask.rb @@ -170,6 +185,7 @@ lib/sdk_ruby/models/send_event_request.rb lib/sdk_ruby/models/set_default_pipeline_request.rb lib/sdk_ruby/models/set_default_version_request.rb lib/sdk_ruby/models/status.rb +lib/sdk_ruby/models/text_position.rb lib/sdk_ruby/models/update_record_request.rb lib/sdk_ruby/models/upsert_record_request.rb lib/sdk_ruby/models/upsert_record_request_pipeline.rb @@ -178,10 +194,12 @@ lib/sdk_ruby/version.rb sdk_ruby.gemspec spec/api_client_spec.rb spec/configuration_spec.rb -spec/models/batch_update_records_request_spec.rb -spec/models/batch_update_records_response_error_spec.rb -spec/models/batch_update_records_response_record_spec.rb -spec/models/batch_update_records_response_spec.rb -spec/models/promotion_category_spec.rb -spec/models/protobuf_field_mask_spec.rb +spec/models/banner_spec.rb +spec/models/event_spec.rb +spec/models/experiment_request_pipeline_spec.rb +spec/models/experiment_request_spec.rb +spec/models/experiment_response_spec.rb +spec/models/list_promotions_request_promotion_view_spec.rb +spec/models/promotion_pin_mode_spec.rb +spec/models/text_position_spec.rb spec/spec_helper.rb diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION index 7d3cdbf..1e20ec3 100644 --- a/.openapi-generator/VERSION +++ b/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0 \ No newline at end of file diff --git a/README.md b/README.md index 94b5d5f..6f41108 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ Search.io offers a search and discovery service with Neuralsearch®, the world's This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: v4 -- Package version: 4.3.0 +- Package version: 5.0.0 - Build package: org.openapitools.codegen.languages.RubyClientCodegen For more information, please visit [https://www.search.io/company/contact](https://www.search.io/company/contact) @@ -24,16 +24,16 @@ gem build sdk_ruby.gemspec Then either install the gem locally: ```shell -gem install ./sdk_ruby-4.3.0.gem +gem install ./sdk_ruby-5.0.0.gem ``` -(for development, run `gem install --dev ./sdk_ruby-4.3.0.gem` to install the development dependencies) +(for development, run `gem install --dev ./sdk_ruby-5.0.0.gem` to install the development dependencies) or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/). Finally add this to the Gemfile: - gem 'sdk_ruby', '~> 4.3.0' + gem 'sdk_ruby', '~> 5.0.0' ### Install from Git @@ -86,10 +86,12 @@ Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- *SajariAPIClient::CollectionsApi* | [**create_collection**](docs/CollectionsApi.md#create_collection) | **POST** /v4/collections | Create collection *SajariAPIClient::CollectionsApi* | [**delete_collection**](docs/CollectionsApi.md#delete_collection) | **DELETE** /v4/collections/{collection_id} | Delete collection +*SajariAPIClient::CollectionsApi* | [**experiment**](docs/CollectionsApi.md#experiment) | **POST** /v4/collections/{collection_id}:experiment | Experiment *SajariAPIClient::CollectionsApi* | [**get_collection**](docs/CollectionsApi.md#get_collection) | **GET** /v4/collections/{collection_id} | Get collection *SajariAPIClient::CollectionsApi* | [**list_collections**](docs/CollectionsApi.md#list_collections) | **GET** /v4/collections | List collections *SajariAPIClient::CollectionsApi* | [**query_collection**](docs/CollectionsApi.md#query_collection) | **POST** /v4/collections/{collection_id}:query | Query collection *SajariAPIClient::CollectionsApi* | [**query_collection2**](docs/CollectionsApi.md#query_collection2) | **POST** /v4/collections/{collection_id}:queryCollection | Query collection +*SajariAPIClient::CollectionsApi* | [**track_event**](docs/CollectionsApi.md#track_event) | **POST** /v4/collections/{collection_id}:trackEvent | Track event *SajariAPIClient::CollectionsApi* | [**update_collection**](docs/CollectionsApi.md#update_collection) | **PATCH** /v4/collections/{collection_id} | Update collection *SajariAPIClient::EventsApi* | [**send_event**](docs/EventsApi.md#send_event) | **POST** /v4/events:send | Send event *SajariAPIClient::EventsApi* | [**send_event2**](docs/EventsApi.md#send_event2) | **POST** /v4/events:sendEvent | Send event @@ -125,6 +127,7 @@ Class | Method | HTTP request | Description ## Documentation for Models - [SajariAPIClient::ActivePromotion](docs/ActivePromotion.md) + - [SajariAPIClient::Banner](docs/Banner.md) - [SajariAPIClient::BatchCreateSchemaFieldsRequest](docs/BatchCreateSchemaFieldsRequest.md) - [SajariAPIClient::BatchCreateSchemaFieldsResponse](docs/BatchCreateSchemaFieldsResponse.md) - [SajariAPIClient::BatchCreateSchemaFieldsResponseError](docs/BatchCreateSchemaFieldsResponseError.md) @@ -141,6 +144,10 @@ Class | Method | HTTP request | Description - [SajariAPIClient::Collection](docs/Collection.md) - [SajariAPIClient::DeleteRecordRequest](docs/DeleteRecordRequest.md) - [SajariAPIClient::Error](docs/Error.md) + - [SajariAPIClient::Event](docs/Event.md) + - [SajariAPIClient::ExperimentRequest](docs/ExperimentRequest.md) + - [SajariAPIClient::ExperimentRequestPipeline](docs/ExperimentRequestPipeline.md) + - [SajariAPIClient::ExperimentResponse](docs/ExperimentResponse.md) - [SajariAPIClient::GeneratePipelinesRequest](docs/GeneratePipelinesRequest.md) - [SajariAPIClient::GeneratePipelinesResponse](docs/GeneratePipelinesResponse.md) - [SajariAPIClient::GetDefaultPipelineResponse](docs/GetDefaultPipelineResponse.md) @@ -150,6 +157,7 @@ Class | Method | HTTP request | Description - [SajariAPIClient::ListCollectionsResponse](docs/ListCollectionsResponse.md) - [SajariAPIClient::ListPipelinesRequestView](docs/ListPipelinesRequestView.md) - [SajariAPIClient::ListPipelinesResponse](docs/ListPipelinesResponse.md) + - [SajariAPIClient::ListPromotionsRequestPromotionView](docs/ListPromotionsRequestPromotionView.md) - [SajariAPIClient::ListPromotionsResponse](docs/ListPromotionsResponse.md) - [SajariAPIClient::ListRedirectsResponse](docs/ListRedirectsResponse.md) - [SajariAPIClient::ListSchemaFieldsResponse](docs/ListSchemaFieldsResponse.md) @@ -164,6 +172,7 @@ Class | Method | HTTP request | Description - [SajariAPIClient::PromotionFilterBoost](docs/PromotionFilterBoost.md) - [SajariAPIClient::PromotionFilterCondition](docs/PromotionFilterCondition.md) - [SajariAPIClient::PromotionPin](docs/PromotionPin.md) + - [SajariAPIClient::PromotionPinMode](docs/PromotionPinMode.md) - [SajariAPIClient::PromotionRangeBoost](docs/PromotionRangeBoost.md) - [SajariAPIClient::ProtobufAny](docs/ProtobufAny.md) - [SajariAPIClient::ProtobufFieldMask](docs/ProtobufFieldMask.md) @@ -196,6 +205,7 @@ Class | Method | HTTP request | Description - [SajariAPIClient::SetDefaultPipelineRequest](docs/SetDefaultPipelineRequest.md) - [SajariAPIClient::SetDefaultVersionRequest](docs/SetDefaultVersionRequest.md) - [SajariAPIClient::Status](docs/Status.md) + - [SajariAPIClient::TextPosition](docs/TextPosition.md) - [SajariAPIClient::UpdateRecordRequest](docs/UpdateRecordRequest.md) - [SajariAPIClient::UpsertRecordRequest](docs/UpsertRecordRequest.md) - [SajariAPIClient::UpsertRecordRequestPipeline](docs/UpsertRecordRequestPipeline.md) diff --git a/docs/Banner.md b/docs/Banner.md new file mode 100644 index 0000000..9a56eb8 --- /dev/null +++ b/docs/Banner.md @@ -0,0 +1,36 @@ +# SajariAPIClient::Banner + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **description** | **String** | The description of the banner, displayed in sub-head font. | [optional] | +| **height** | **Integer** | The height the banner occupies in grid cells. | [optional] | +| **id** | **String** | The ID of the banner, used to identify clicked banners. | [optional] | +| **image_url** | **String** | The URL of the image used for the banner. | [optional] | +| **position** | **Integer** | The 1-based index indicating where the banner appears in search results. | [optional] | +| **target_url** | **String** | The URL to redirect the user to when the banner is clicked. | [optional] | +| **text_color** | **String** | The color of the text as a hex code with a # prefix, e.g. #FFCC00 or #FC0. | [optional] | +| **text_position** | [**TextPosition**](TextPosition.md) | | [optional][default to 'TEXT_POSITION_UNSPECIFIED'] | +| **title** | **String** | The title of the banner, displayed in header font. | [optional] | +| **width** | **Integer** | The width the banner occupies in grid cells. | [optional] | + +## Example + +```ruby +require 'sdk_ruby' + +instance = SajariAPIClient::Banner.new( + description: null, + height: null, + id: null, + image_url: null, + position: null, + target_url: null, + text_color: null, + text_position: null, + title: null, + width: null +) +``` + diff --git a/docs/Collection.md b/docs/Collection.md index 5cc2e56..cdcf62a 100644 --- a/docs/Collection.md +++ b/docs/Collection.md @@ -5,7 +5,7 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | **account_id** | **String** | Output only. The ID of the account that owns this collection. | [optional][readonly] | -| **authorized_query_domains** | **Array<String>** | The list of authorized query domains for the collection. Client-side / browser requests to the [QueryCollection](/api#operation/QueryCollection) call can be made by any authorized query domain or any of its subdomains. This allows your interface to make search requests without having to provide an API key in the client-side request. | [optional] | +| **authorized_query_domains** | **Array<String>** | The list of authorized query domains for the collection. Client-side / browser requests to the [QueryCollection](/docs/api#operation/QueryCollection) call can be made by any authorized query domain or any of its subdomains. This allows your interface to make search requests without having to provide an API key in the client-side request. | [optional] | | **create_time** | **Time** | Output only. Time the collection was created. | [optional][readonly] | | **display_name** | **String** | The collection's display name. You can change this at any time. | | | **id** | **String** | Output only. The collection's ID. | [optional][readonly] | diff --git a/docs/CollectionsApi.md b/docs/CollectionsApi.md index 971f328..4bfd9ff 100644 --- a/docs/CollectionsApi.md +++ b/docs/CollectionsApi.md @@ -6,10 +6,12 @@ All URIs are relative to *https://api.search.io* | ------ | ------------ | ----------- | | [**create_collection**](CollectionsApi.md#create_collection) | **POST** /v4/collections | Create collection | | [**delete_collection**](CollectionsApi.md#delete_collection) | **DELETE** /v4/collections/{collection_id} | Delete collection | +| [**experiment**](CollectionsApi.md#experiment) | **POST** /v4/collections/{collection_id}:experiment | Experiment | | [**get_collection**](CollectionsApi.md#get_collection) | **GET** /v4/collections/{collection_id} | Get collection | | [**list_collections**](CollectionsApi.md#list_collections) | **GET** /v4/collections | List collections | | [**query_collection**](CollectionsApi.md#query_collection) | **POST** /v4/collections/{collection_id}:query | Query collection | | [**query_collection2**](CollectionsApi.md#query_collection2) | **POST** /v4/collections/{collection_id}:queryCollection | Query collection | +| [**track_event**](CollectionsApi.md#track_event) | **POST** /v4/collections/{collection_id}:trackEvent | Track event | | [**update_collection**](CollectionsApi.md#update_collection) | **PATCH** /v4/collections/{collection_id} | Update collection | @@ -155,6 +157,78 @@ end - **Accept**: application/json +## experiment + +> experiment(collection_id, experiment_request) + +Experiment + +Run a query on a collection with a hypothetical configuration to see what kinds of results it produces. Saved promotions with a start date in the future are enabled during the experiment, unless they are explicitly disabled. The following example demonstrates how to run a simple experiment for a string, against a pipeline and with a proposed promotion: ```json { \"pipeline\": { \"name\": \"my-pipeline\" }, \"variables\": { \"q\": \"search terms\" }, \"promotions\": [{ \"id\": \"1234\", \"condition\": \"q = 'search terms'\", \"pins\": [{ \"key\": { \"field\": \"id\", \"value\": \"54hdc7h2334h\" }, \"position\": 1 }] }] } ``` + +### Examples + +```ruby +require 'time' +require 'sdk_ruby' +# setup authorization +SajariAPIClient.configure do |config| + # Configure HTTP basic authorization: BasicAuth + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = SajariAPIClient::CollectionsApi.new +collection_id = 'collection_id_example' # String | The collection to query, e.g. `my-collection`. +experiment_request = SajariAPIClient::ExperimentRequest.new({variables: { key: 3.56}}) # ExperimentRequest | + +begin + # Experiment + result = api_instance.experiment(collection_id, experiment_request) + p result +rescue SajariAPIClient::ApiError => e + puts "Error when calling CollectionsApi->experiment: #{e}" +end +``` + +#### Using the experiment_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> experiment_with_http_info(collection_id, experiment_request) + +```ruby +begin + # Experiment + data, status_code, headers = api_instance.experiment_with_http_info(collection_id, experiment_request) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue SajariAPIClient::ApiError => e + puts "Error when calling CollectionsApi->experiment_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **collection_id** | **String** | The collection to query, e.g. `my-collection`. | | +| **experiment_request** | [**ExperimentRequest**](ExperimentRequest.md) | | | + +### Return type + +[**ExperimentResponse**](ExperimentResponse.md) + +### Authorization + +[BasicAuth](../README.md#BasicAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + ## get_collection > get_collection(collection_id) @@ -248,7 +322,7 @@ end api_instance = SajariAPIClient::CollectionsApi.new opts = { page_size: 56, # Integer | The maximum number of collections to return. The service may return fewer than this value. If unspecified, at most 50 collections are returned. The maximum value is 100; values above 100 are coerced to 100. - page_token: 'page_token_example' # String | A page token, received from a previous [ListCollections](/api#operation/ListCollections) call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to [ListCollections](/api#operation/ListCollections) must match the call that provided the page token. + page_token: 'page_token_example' # String | A page token, received from a previous [ListCollections](/docs/api#operation/ListCollections) call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to [ListCollections](/docs/api#operation/ListCollections) must match the call that provided the page token. } begin @@ -283,7 +357,7 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | **page_size** | **Integer** | The maximum number of collections to return. The service may return fewer than this value. If unspecified, at most 50 collections are returned. The maximum value is 100; values above 100 are coerced to 100. | [optional] | -| **page_token** | **String** | A page token, received from a previous [ListCollections](/api#operation/ListCollections) call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to [ListCollections](/api#operation/ListCollections) must match the call that provided the page token. | [optional] | +| **page_token** | **String** | A page token, received from a previous [ListCollections](/docs/api#operation/ListCollections) call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to [ListCollections](/docs/api#operation/ListCollections) must match the call that provided the page token. | [optional] | ### Return type @@ -301,11 +375,11 @@ end ## query_collection -> query_collection(collection_id, query_collection_request) +> query_collection(collection_id, query_collection_request, opts) Query collection -Query the collection to search for records. The following example demonstrates how to run a simple search for a particular string: ```json { \"variables\": { \"q\": \"search terms\" } } ``` For more information: - See [filtering content](https://docs.search.io/documentation/fundamentals/integrating-search/filters-and-sort-options) - See [tracking in the Go SDK](https://github.com/sajari/sdk-go/blob/v2/session.go) - See [tracking in the JS SDK](https://github.com/sajari/sajari-sdk-js/blob/master/src/session.ts) +Query the collection to search for records. The following example demonstrates how to run a simple search for a particular string: ```json { \"variables\": { \"q\": \"search terms\" } } ``` For more information: - See [filtering content](https://docs.search.io/documentation/fundamentals/integrating-search/filters-and-sort-options) - See [tracking in the Go SDK](https://github.com/sajari/sdk-go/blob/v2/session.go) - See [tracking in the JS SDK](https://github.com/sajari/sdk-js/blob/554e182e77d3ba99a9c100b208ebf3be414d2067/src/index.ts#L881) Note: Unlike other API calls, the `QueryCollection` call can be called from a browser. When called from a browser, the `Account-Id` header must be set to your account ID. ### Examples @@ -322,10 +396,13 @@ end api_instance = SajariAPIClient::CollectionsApi.new collection_id = 'collection_id_example' # String | The collection to query, e.g. `my-collection`. query_collection_request = SajariAPIClient::QueryCollectionRequest.new({variables: { key: 3.56}}) # QueryCollectionRequest | +opts = { + account_id: 'account_id_example' # String | The account that owns the collection, e.g. `1618535966441231024`. Unlike other API calls, the `QueryCollection` call can be called from a browser. When called from a browser, the `Account-Id` header must be set to your account ID. +} begin # Query collection - result = api_instance.query_collection(collection_id, query_collection_request) + result = api_instance.query_collection(collection_id, query_collection_request, opts) p result rescue SajariAPIClient::ApiError => e puts "Error when calling CollectionsApi->query_collection: #{e}" @@ -336,12 +413,12 @@ end This returns an Array which contains the response data, status code and headers. -> , Integer, Hash)> query_collection_with_http_info(collection_id, query_collection_request) +> , Integer, Hash)> query_collection_with_http_info(collection_id, query_collection_request, opts) ```ruby begin # Query collection - data, status_code, headers = api_instance.query_collection_with_http_info(collection_id, query_collection_request) + data, status_code, headers = api_instance.query_collection_with_http_info(collection_id, query_collection_request, opts) p status_code # => 2xx p headers # => { ... } p data # => @@ -356,6 +433,7 @@ end | ---- | ---- | ----------- | ----- | | **collection_id** | **String** | The collection to query, e.g. `my-collection`. | | | **query_collection_request** | [**QueryCollectionRequest**](QueryCollectionRequest.md) | | | +| **account_id** | **String** | The account that owns the collection, e.g. `1618535966441231024`. Unlike other API calls, the `QueryCollection` call can be called from a browser. When called from a browser, the `Account-Id` header must be set to your account ID. | [optional] | ### Return type @@ -377,7 +455,7 @@ end Query collection -Query the collection to search for records. The following example demonstrates how to run a simple search for a particular string: ```json { \"variables\": { \"q\": \"search terms\" } } ``` For more information: - See [filtering content](https://docs.search.io/documentation/fundamentals/integrating-search/filters-and-sort-options) - See [tracking in the Go SDK](https://github.com/sajari/sdk-go/blob/v2/session.go) - See [tracking in the JS SDK](https://github.com/sajari/sajari-sdk-js/blob/master/src/session.ts) +Query the collection to search for records. The following example demonstrates how to run a simple search for a particular string: ```json { \"variables\": { \"q\": \"search terms\" } } ``` For more information: - See [filtering content](https://docs.search.io/documentation/fundamentals/integrating-search/filters-and-sort-options) - See [tracking in the Go SDK](https://github.com/sajari/sdk-go/blob/v2/session.go) - See [tracking in the JS SDK](https://github.com/sajari/sdk-js/blob/554e182e77d3ba99a9c100b208ebf3be414d2067/src/index.ts#L881) Note: Unlike other API calls, the `QueryCollection` call can be called from a browser. When called from a browser, the `Account-Id` header must be set to your account ID. ### Examples @@ -443,9 +521,83 @@ end - **Accept**: application/json +## track_event + +> Object track_event(account_id, collection_id, event) + +Track event + +Track an analytics event when a user interacts with an object returned by a [QueryCollection](/docs/api/#operation/QueryCollection) request. An analytics event can be tracked for the following objects: - Results - Promotion banners - Redirects Note: You must pass an `Account-Id` header. + +### Examples + +```ruby +require 'time' +require 'sdk_ruby' +# setup authorization +SajariAPIClient.configure do |config| + # Configure HTTP basic authorization: BasicAuth + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = SajariAPIClient::CollectionsApi.new +account_id = 'account_id_example' # String | The account that owns the collection, e.g. `1618535966441231024`. +collection_id = 'collection_id_example' # String | The collection to track the event against, e.g. `my-collection`. +event = SajariAPIClient::Event.new({query_id: 'query_id_example', type: 'type_example'}) # Event | The details of the event to track. + +begin + # Track event + result = api_instance.track_event(account_id, collection_id, event) + p result +rescue SajariAPIClient::ApiError => e + puts "Error when calling CollectionsApi->track_event: #{e}" +end +``` + +#### Using the track_event_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> track_event_with_http_info(account_id, collection_id, event) + +```ruby +begin + # Track event + data, status_code, headers = api_instance.track_event_with_http_info(account_id, collection_id, event) + p status_code # => 2xx + p headers # => { ... } + p data # => Object +rescue SajariAPIClient::ApiError => e + puts "Error when calling CollectionsApi->track_event_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **account_id** | **String** | The account that owns the collection, e.g. `1618535966441231024`. | | +| **collection_id** | **String** | The collection to track the event against, e.g. `my-collection`. | | +| **event** | [**Event**](Event.md) | The details of the event to track. | | + +### Return type + +**Object** + +### Authorization + +[BasicAuth](../README.md#BasicAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + ## update_collection -> update_collection(collection_id, update_mask, collection) +> update_collection(collection_id, collection, opts) Update collection @@ -465,12 +617,14 @@ end api_instance = SajariAPIClient::CollectionsApi.new collection_id = 'collection_id_example' # String | The collection to update, e.g. `my-collection`. -update_mask = 'update_mask_example' # String | The list of fields to be updated, separated by a comma, e.g. `field1,field2`. Each field should be in snake case, e.g. `display_name`. For each field that you want to update, provide a corresponding value in the collection object containing the new value. -collection = SajariAPIClient::Collection.new({display_name: 'display_name_example'}) # Collection | Details of the collection to update. +collection = SajariAPIClient::Collection.new({display_name: 'display_name_example'}) # Collection | The details of the collection to update. +opts = { + update_mask: 'update_mask_example' # String | The list of fields to update, separated by a comma, e.g. `authorized_query_domains,display_name`. Each field should be in snake case. For each field that you want to update, provide a corresponding value in the collection object containing the new value. +} begin # Update collection - result = api_instance.update_collection(collection_id, update_mask, collection) + result = api_instance.update_collection(collection_id, collection, opts) p result rescue SajariAPIClient::ApiError => e puts "Error when calling CollectionsApi->update_collection: #{e}" @@ -481,12 +635,12 @@ end This returns an Array which contains the response data, status code and headers. -> , Integer, Hash)> update_collection_with_http_info(collection_id, update_mask, collection) +> , Integer, Hash)> update_collection_with_http_info(collection_id, collection, opts) ```ruby begin # Update collection - data, status_code, headers = api_instance.update_collection_with_http_info(collection_id, update_mask, collection) + data, status_code, headers = api_instance.update_collection_with_http_info(collection_id, collection, opts) p status_code # => 2xx p headers # => { ... } p data # => @@ -500,8 +654,8 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | **collection_id** | **String** | The collection to update, e.g. `my-collection`. | | -| **update_mask** | **String** | The list of fields to be updated, separated by a comma, e.g. `field1,field2`. Each field should be in snake case, e.g. `display_name`. For each field that you want to update, provide a corresponding value in the collection object containing the new value. | | -| **collection** | [**Collection**](Collection.md) | Details of the collection to update. | | +| **collection** | [**Collection**](Collection.md) | The details of the collection to update. | | +| **update_mask** | **String** | The list of fields to update, separated by a comma, e.g. `authorized_query_domains,display_name`. Each field should be in snake case. For each field that you want to update, provide a corresponding value in the collection object containing the new value. | [optional] | ### Return type diff --git a/docs/Event.md b/docs/Event.md new file mode 100644 index 0000000..c6a91af --- /dev/null +++ b/docs/Event.md @@ -0,0 +1,28 @@ +# SajariAPIClient::Event + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **banner_id** | **String** | The identifier of the promotion banner the event is about. | [optional] | +| **metadata** | **Hash<String, Object>** | An object made up of field-value pairs that contains additional metadata to record with the event. | [optional] | +| **query_id** | **String** | The query identifier. | | +| **redirect_id** | **String** | The identifier of the redirect the event is about. | [optional] | +| **result_id** | **String** | The identifier of the result the event is about. | [optional] | +| **type** | **String** | The type of event, e.g. `click`, `purchase`, `add_to_cart`. | | + +## Example + +```ruby +require 'sdk_ruby' + +instance = SajariAPIClient::Event.new( + banner_id: null, + metadata: null, + query_id: null, + redirect_id: null, + result_id: null, + type: null +) +``` + diff --git a/docs/EventsApi.md b/docs/EventsApi.md index 70c572d..9b5d152 100644 --- a/docs/EventsApi.md +++ b/docs/EventsApi.md @@ -10,11 +10,11 @@ All URIs are relative to *https://api.search.io* ## send_event -> Object send_event(send_event_request) +> Object send_event(account_id, send_event_request) Send event -Send an event to the ranking system after a user interacts with a search result. When querying a collection, you can set the tracking type of the query request. When it is `CLICK` or `POS_NEG`, a token is generated for each result in the query response. You can use this token to provide feedback to the ranking system. Each time you want to record an event on a particular search result, use the send event call and provide: - The `name` of the event, e.g. `click`, `purchase`. - The `token` from the search result. - The `weight` to assign to the event, e.g. `1`. - An object containing any additional `metadata`. For example, to send an event where a customer purchased a product, use the following call: ```json { \"name\": \"purchase\", \"token\": \"eyJ...\", \"weight\": 1, \"metadata\": { \"discount\": 0.2, \"margin\": 30.0, \"customer_id\": \"12345\", \"ui_test_segment\": \"A\" } } ``` +Send an event to the ranking system after a user interacts with a search result. When querying a collection, you can set the tracking type of the query request. When it is `CLICK` or `POS_NEG`, a token is generated for each result in the query response. You can use this token to provide feedback to the ranking system. Each time you want to record an event on a particular search result, use the send event call and provide: - The `name` of the event, e.g. `click`, `purchase`. - The `token` from the search result. - The `weight` to assign to the event, e.g. `1`. - An object containing any additional `metadata`. For example, to send an event where a customer purchased a product, use the following call: ```json { \"name\": \"purchase\", \"token\": \"eyJ...\", \"weight\": 1, \"metadata\": { \"discount\": 0.2, \"margin\": 30.0, \"customer_id\": \"12345\", \"ui_test_segment\": \"A\" } } ``` Note: You must pass an `Account-Id` header. ### Examples @@ -29,11 +29,12 @@ SajariAPIClient.configure do |config| end api_instance = SajariAPIClient::EventsApi.new +account_id = 'account_id_example' # String | The account that owns the collection, e.g. `1618535966441231024`. send_event_request = SajariAPIClient::SendEventRequest.new({name: 'name_example', token: 'token_example'}) # SendEventRequest | begin # Send event - result = api_instance.send_event(send_event_request) + result = api_instance.send_event(account_id, send_event_request) p result rescue SajariAPIClient::ApiError => e puts "Error when calling EventsApi->send_event: #{e}" @@ -44,12 +45,12 @@ end This returns an Array which contains the response data, status code and headers. -> send_event_with_http_info(send_event_request) +> send_event_with_http_info(account_id, send_event_request) ```ruby begin # Send event - data, status_code, headers = api_instance.send_event_with_http_info(send_event_request) + data, status_code, headers = api_instance.send_event_with_http_info(account_id, send_event_request) p status_code # => 2xx p headers # => { ... } p data # => Object @@ -62,6 +63,7 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | +| **account_id** | **String** | The account that owns the collection, e.g. `1618535966441231024`. | | | **send_event_request** | [**SendEventRequest**](SendEventRequest.md) | | | ### Return type @@ -84,7 +86,7 @@ end Send event -Send an event to the ranking system after a user interacts with a search result. When querying a collection, you can set the tracking type of the query request. When it is `CLICK` or `POS_NEG`, a token is generated for each result in the query response. You can use this token to provide feedback to the ranking system. Each time you want to record an event on a particular search result, use the send event call and provide: - The `name` of the event, e.g. `click`, `purchase`. - The `token` from the search result. - The `weight` to assign to the event, e.g. `1`. - An object containing any additional `metadata`. For example, to send an event where a customer purchased a product, use the following call: ```json { \"name\": \"purchase\", \"token\": \"eyJ...\", \"weight\": 1, \"metadata\": { \"discount\": 0.2, \"margin\": 30.0, \"customer_id\": \"12345\", \"ui_test_segment\": \"A\" } } ``` +Send an event to the ranking system after a user interacts with a search result. When querying a collection, you can set the tracking type of the query request. When it is `CLICK` or `POS_NEG`, a token is generated for each result in the query response. You can use this token to provide feedback to the ranking system. Each time you want to record an event on a particular search result, use the send event call and provide: - The `name` of the event, e.g. `click`, `purchase`. - The `token` from the search result. - The `weight` to assign to the event, e.g. `1`. - An object containing any additional `metadata`. For example, to send an event where a customer purchased a product, use the following call: ```json { \"name\": \"purchase\", \"token\": \"eyJ...\", \"weight\": 1, \"metadata\": { \"discount\": 0.2, \"margin\": 30.0, \"customer_id\": \"12345\", \"ui_test_segment\": \"A\" } } ``` Note: You must pass an `Account-Id` header. ### Examples diff --git a/docs/ExperimentRequest.md b/docs/ExperimentRequest.md new file mode 100644 index 0000000..7e2257b --- /dev/null +++ b/docs/ExperimentRequest.md @@ -0,0 +1,24 @@ +# SajariAPIClient::ExperimentRequest + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **custom_pipeline** | [**Pipeline**](Pipeline.md) | | [optional] | +| **pipeline** | [**ExperimentRequestPipeline**](ExperimentRequestPipeline.md) | | [optional] | +| **promotions** | [**Array<Promotion>**](Promotion.md) | The promotions to consider active when running the search. Provided promotions override existing promotions with the same ID. | [optional] | +| **variables** | **Hash<String, Object>** | The initial values for the variables the pipeline operates on and transforms throughout its steps. The most important variable is `q` which is the query the user entered, for example: ```json { \"q\": \"search terms\" } ``` To paginate through results, set the variables `page` and `resultsPerPage`, for example: ```json { \"q\": \"search terms\", \"page\": 5, \"resultsPerPage\": 20 } ``` To sort results, set the variable `sort` to the name of one of your collection's schema fields, for example: ```json { \"q\": \"search terms\", \"sort\": \"name\" } ``` To sort in reverse, prefix the schema field with a minus sign `-`, for example: ```json { \"q\": \"search terms\", \"sort\": \"-name\" } ``` | | + +## Example + +```ruby +require 'sdk_ruby' + +instance = SajariAPIClient::ExperimentRequest.new( + custom_pipeline: null, + pipeline: null, + promotions: null, + variables: null +) +``` + diff --git a/docs/ExperimentRequestPipeline.md b/docs/ExperimentRequestPipeline.md new file mode 100644 index 0000000..241f10c --- /dev/null +++ b/docs/ExperimentRequestPipeline.md @@ -0,0 +1,20 @@ +# SajariAPIClient::ExperimentRequestPipeline + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **name** | **String** | The query pipeline's name, e.g. `my-pipeline`. | | +| **version** | **String** | The query pipeline's version, e.g. `42`. If not provided the default version is used. | [optional] | + +## Example + +```ruby +require 'sdk_ruby' + +instance = SajariAPIClient::ExperimentRequestPipeline.new( + name: null, + version: null +) +``` + diff --git a/docs/ExperimentResponse.md b/docs/ExperimentResponse.md new file mode 100644 index 0000000..07f5c03 --- /dev/null +++ b/docs/ExperimentResponse.md @@ -0,0 +1,18 @@ +# SajariAPIClient::ExperimentResponse + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **query_response** | [**QueryCollectionResponse**](QueryCollectionResponse.md) | | [optional] | + +## Example + +```ruby +require 'sdk_ruby' + +instance = SajariAPIClient::ExperimentResponse.new( + query_response: null +) +``` + diff --git a/docs/GeneratePipelinesRequest.md b/docs/GeneratePipelinesRequest.md index cbe3877..3ca978d 100644 --- a/docs/GeneratePipelinesRequest.md +++ b/docs/GeneratePipelinesRequest.md @@ -4,8 +4,8 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **query_training_fields** | **Array<String>** | List of fields to train query suggestions from. | [optional] | -| **searchable_fields** | **Array<String>** | Prioritized list of fields to search. | | +| **query_training_fields** | **Array<String>** | A list of fields to train query suggestions from. | [optional] | +| **searchable_fields** | **Array<String>** | A prioritized list of fields to search. | | ## Example diff --git a/docs/ListPromotionsRequestPromotionView.md b/docs/ListPromotionsRequestPromotionView.md new file mode 100644 index 0000000..38df174 --- /dev/null +++ b/docs/ListPromotionsRequestPromotionView.md @@ -0,0 +1,15 @@ +# SajariAPIClient::ListPromotionsRequestPromotionView + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + +## Example + +```ruby +require 'sdk_ruby' + +instance = SajariAPIClient::ListPromotionsRequestPromotionView.new() +``` + diff --git a/docs/PipelinesApi.md b/docs/PipelinesApi.md index 5f3e6a9..29fb4c8 100644 --- a/docs/PipelinesApi.md +++ b/docs/PipelinesApi.md @@ -255,7 +255,7 @@ collection_id = 'collection_id_example' # String | The collection that owns the type = 'TYPE_UNSPECIFIED' # String | The type of the pipeline to get the default version of. name = 'name_example' # String | The name of the pipeline to get the default version of, e.g. `my-pipeline`. opts = { - view: 'VIEW_UNSPECIFIED' # String | The amount of information to include in the retrieved pipeline. - VIEW_UNSPECIFIED: The default / unset value. The API defaults to the `BASIC` view. - BASIC: Include basic information including type, name, version and description but not the full step configuration. This is the default value (for both [ListPipelines](/api#operation/ListPipelines) and [GetPipeline](/api#operation/GetPipeline)). - FULL: Include the information from `BASIC`, plus full step configuration. + view: 'VIEW_UNSPECIFIED' # String | The amount of information to include in the retrieved pipeline. - VIEW_UNSPECIFIED: The default / unset value. The API defaults to the `BASIC` view. - BASIC: Include basic information including type, name, version and description but not the full step configuration. This is the default value (for both [ListPipelines](/docs/api#operation/ListPipelines) and [GetPipeline](/docs/api#operation/GetPipeline)). - FULL: Include the information from `BASIC`, plus full step configuration. } begin @@ -292,7 +292,7 @@ end | **collection_id** | **String** | The collection that owns the pipeline to get the default version of, e.g. `my-collection`. | | | **type** | **String** | The type of the pipeline to get the default version of. | | | **name** | **String** | The name of the pipeline to get the default version of, e.g. `my-pipeline`. | | -| **view** | **String** | The amount of information to include in the retrieved pipeline. - VIEW_UNSPECIFIED: The default / unset value. The API defaults to the `BASIC` view. - BASIC: Include basic information including type, name, version and description but not the full step configuration. This is the default value (for both [ListPipelines](/api#operation/ListPipelines) and [GetPipeline](/api#operation/GetPipeline)). - FULL: Include the information from `BASIC`, plus full step configuration. | [optional][default to 'VIEW_UNSPECIFIED'] | +| **view** | **String** | The amount of information to include in the retrieved pipeline. - VIEW_UNSPECIFIED: The default / unset value. The API defaults to the `BASIC` view. - BASIC: Include basic information including type, name, version and description but not the full step configuration. This is the default value (for both [ListPipelines](/docs/api#operation/ListPipelines) and [GetPipeline](/docs/api#operation/GetPipeline)). - FULL: Include the information from `BASIC`, plus full step configuration. | [optional][default to 'VIEW_UNSPECIFIED'] | ### Return type @@ -334,7 +334,7 @@ type = 'TYPE_UNSPECIFIED' # String | The type of the pipeline to retrieve. name = 'name_example' # String | The name of the pipeline to retrieve, e.g. `my-pipeline`. version = 'version_example' # String | The version of the pipeline to retrieve, e.g. `42`. opts = { - view: 'VIEW_UNSPECIFIED' # String | The amount of information to include in the retrieved pipeline. - VIEW_UNSPECIFIED: The default / unset value. The API defaults to the `BASIC` view. - BASIC: Include basic information including type, name, version and description but not the full step configuration. This is the default value (for both [ListPipelines](/api#operation/ListPipelines) and [GetPipeline](/api#operation/GetPipeline)). - FULL: Include the information from `BASIC`, plus full step configuration. + view: 'VIEW_UNSPECIFIED' # String | The amount of information to include in the retrieved pipeline. - VIEW_UNSPECIFIED: The default / unset value. The API defaults to the `BASIC` view. - BASIC: Include basic information including type, name, version and description but not the full step configuration. This is the default value (for both [ListPipelines](/docs/api#operation/ListPipelines) and [GetPipeline](/docs/api#operation/GetPipeline)). - FULL: Include the information from `BASIC`, plus full step configuration. } begin @@ -372,7 +372,7 @@ end | **type** | **String** | The type of the pipeline to retrieve. | | | **name** | **String** | The name of the pipeline to retrieve, e.g. `my-pipeline`. | | | **version** | **String** | The version of the pipeline to retrieve, e.g. `42`. | | -| **view** | **String** | The amount of information to include in the retrieved pipeline. - VIEW_UNSPECIFIED: The default / unset value. The API defaults to the `BASIC` view. - BASIC: Include basic information including type, name, version and description but not the full step configuration. This is the default value (for both [ListPipelines](/api#operation/ListPipelines) and [GetPipeline](/api#operation/GetPipeline)). - FULL: Include the information from `BASIC`, plus full step configuration. | [optional][default to 'VIEW_UNSPECIFIED'] | +| **view** | **String** | The amount of information to include in the retrieved pipeline. - VIEW_UNSPECIFIED: The default / unset value. The API defaults to the `BASIC` view. - BASIC: Include basic information including type, name, version and description but not the full step configuration. This is the default value (for both [ListPipelines](/docs/api#operation/ListPipelines) and [GetPipeline](/docs/api#operation/GetPipeline)). - FULL: Include the information from `BASIC`, plus full step configuration. | [optional][default to 'VIEW_UNSPECIFIED'] | ### Return type @@ -412,8 +412,8 @@ api_instance = SajariAPIClient::PipelinesApi.new collection_id = 'collection_id_example' # String | The collection that owns this set of pipelines, e.g. `my-collection`. opts = { page_size: 56, # Integer | The maximum number of pipelines to return. The service may return fewer than this value. If unspecified, at most 50 pipelines are returned. The maximum value is 1000; values above 1000 are coerced to 1000. - page_token: 'page_token_example', # String | A page token, received from a previous [ListPipelines](/api#operation/ListPipelines) call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to [ListPipelines](/api#operation/ListPipelines) must match the call that provided the page token. - view: 'VIEW_UNSPECIFIED' # String | The amount of information to include in each retrieved pipeline. - VIEW_UNSPECIFIED: The default / unset value. The API defaults to the `BASIC` view. - BASIC: Include basic information including type, name, version and description but not the full step configuration. This is the default value (for both [ListPipelines](/api#operation/ListPipelines) and [GetPipeline](/api#operation/GetPipeline)). - FULL: Include the information from `BASIC`, plus full step configuration. + page_token: 'page_token_example', # String | A page token, received from a previous [ListPipelines](/docs/api#operation/ListPipelines) call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to [ListPipelines](/docs/api#operation/ListPipelines) must match the call that provided the page token. + view: 'VIEW_UNSPECIFIED' # String | The amount of information to include in each retrieved pipeline. - VIEW_UNSPECIFIED: The default / unset value. The API defaults to the `BASIC` view. - BASIC: Include basic information including type, name, version and description but not the full step configuration. This is the default value (for both [ListPipelines](/docs/api#operation/ListPipelines) and [GetPipeline](/docs/api#operation/GetPipeline)). - FULL: Include the information from `BASIC`, plus full step configuration. } begin @@ -449,8 +449,8 @@ end | ---- | ---- | ----------- | ----- | | **collection_id** | **String** | The collection that owns this set of pipelines, e.g. `my-collection`. | | | **page_size** | **Integer** | The maximum number of pipelines to return. The service may return fewer than this value. If unspecified, at most 50 pipelines are returned. The maximum value is 1000; values above 1000 are coerced to 1000. | [optional] | -| **page_token** | **String** | A page token, received from a previous [ListPipelines](/api#operation/ListPipelines) call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to [ListPipelines](/api#operation/ListPipelines) must match the call that provided the page token. | [optional] | -| **view** | **String** | The amount of information to include in each retrieved pipeline. - VIEW_UNSPECIFIED: The default / unset value. The API defaults to the `BASIC` view. - BASIC: Include basic information including type, name, version and description but not the full step configuration. This is the default value (for both [ListPipelines](/api#operation/ListPipelines) and [GetPipeline](/api#operation/GetPipeline)). - FULL: Include the information from `BASIC`, plus full step configuration. | [optional][default to 'VIEW_UNSPECIFIED'] | +| **page_token** | **String** | A page token, received from a previous [ListPipelines](/docs/api#operation/ListPipelines) call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to [ListPipelines](/docs/api#operation/ListPipelines) must match the call that provided the page token. | [optional] | +| **view** | **String** | The amount of information to include in each retrieved pipeline. - VIEW_UNSPECIFIED: The default / unset value. The API defaults to the `BASIC` view. - BASIC: Include basic information including type, name, version and description but not the full step configuration. This is the default value (for both [ListPipelines](/docs/api#operation/ListPipelines) and [GetPipeline](/docs/api#operation/GetPipeline)). - FULL: Include the information from `BASIC`, plus full step configuration. | [optional][default to 'VIEW_UNSPECIFIED'] | ### Return type diff --git a/docs/Promotion.md b/docs/Promotion.md index 4e2d2bb..d147080 100644 --- a/docs/Promotion.md +++ b/docs/Promotion.md @@ -4,6 +4,7 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | +| **banners** | [**Array<Banner>**](Banner.md) | The banners that are injected into the result set when the promotion is triggered. | [optional] | | **collection_id** | **String** | Output only. The ID of the collection that owns this promotion. | [optional][readonly] | | **condition** | **String** | A condition expression applied to a search request that determines which searches the promotion is active for. For example, to apply the promotion's pins and boosts whenever a user searches for 'shoes' set condition to `q = 'shoes'`. | | | **create_time** | **Time** | Output only. Time the promotion was created. | [optional][readonly] | @@ -25,6 +26,7 @@ require 'sdk_ruby' instance = SajariAPIClient::Promotion.new( + banners: null, collection_id: null, condition: null, create_time: null, diff --git a/docs/PromotionPin.md b/docs/PromotionPin.md index 0a56ce4..f0313f1 100644 --- a/docs/PromotionPin.md +++ b/docs/PromotionPin.md @@ -5,6 +5,7 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | **key** | [**RecordKey**](RecordKey.md) | | [optional] | +| **mode** | [**PromotionPinMode**](PromotionPinMode.md) | | [optional][default to 'PIN'] | | **position** | **Integer** | Position the record should occupy in search results. The top position is position 1. Doesn't need to be contiguous with other pins, i.e. there can be gaps in the pinned set that are filled with organic results. In the case where there are insufficient search results pinned items are collapsed. | [optional] | ## Example @@ -14,6 +15,7 @@ require 'sdk_ruby' instance = SajariAPIClient::PromotionPin.new( key: null, + mode: null, position: null ) ``` diff --git a/docs/PromotionPinMode.md b/docs/PromotionPinMode.md new file mode 100644 index 0000000..eeb8cd3 --- /dev/null +++ b/docs/PromotionPinMode.md @@ -0,0 +1,15 @@ +# SajariAPIClient::PromotionPinMode + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + +## Example + +```ruby +require 'sdk_ruby' + +instance = SajariAPIClient::PromotionPinMode.new() +``` + diff --git a/docs/PromotionsApi.md b/docs/PromotionsApi.md index b26b91d..1c290d1 100644 --- a/docs/PromotionsApi.md +++ b/docs/PromotionsApi.md @@ -251,7 +251,8 @@ api_instance = SajariAPIClient::PromotionsApi.new collection_id = 'collection_id_example' # String | The collection that owns this set of promotions, e.g. `my-collection`. opts = { page_size: 56, # Integer | The maximum number of promotions to return. The service may return fewer than this value. If unspecified, at most 50 promotions are returned. The maximum value is 1000; values above 1000 are coerced to 1000. - page_token: 'page_token_example' # String | A page token, received from a previous [ListPromotions](/api#operation/ListPromotions) call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to [ListPromotions](/api#operation/ListPromotions) must match the call that provided the page token. + page_token: 'page_token_example', # String | A page token, received from a previous [ListPromotions](/docs/api#operation/ListPromotions) call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to [ListPromotions](/docs/api#operation/ListPromotions) must match the call that provided the page token. + view: 'PROMOTION_VIEW_UNSPECIFIED' # String | The amount of information to include in each retrieved promotion. - PROMOTION_VIEW_UNSPECIFIED: The default / unset value. The API defaults to the `FULL` view. - BASIC: Include basic information including name, start time and end time, but not detailed information about the promotion effects. - FULL: Returns all information about a promotion. This is the default value. } begin @@ -287,7 +288,8 @@ end | ---- | ---- | ----------- | ----- | | **collection_id** | **String** | The collection that owns this set of promotions, e.g. `my-collection`. | | | **page_size** | **Integer** | The maximum number of promotions to return. The service may return fewer than this value. If unspecified, at most 50 promotions are returned. The maximum value is 1000; values above 1000 are coerced to 1000. | [optional] | -| **page_token** | **String** | A page token, received from a previous [ListPromotions](/api#operation/ListPromotions) call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to [ListPromotions](/api#operation/ListPromotions) must match the call that provided the page token. | [optional] | +| **page_token** | **String** | A page token, received from a previous [ListPromotions](/docs/api#operation/ListPromotions) call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to [ListPromotions](/docs/api#operation/ListPromotions) must match the call that provided the page token. | [optional] | +| **view** | **String** | The amount of information to include in each retrieved promotion. - PROMOTION_VIEW_UNSPECIFIED: The default / unset value. The API defaults to the `FULL` view. - BASIC: Include basic information including name, start time and end time, but not detailed information about the promotion effects. - FULL: Returns all information about a promotion. This is the default value. | [optional][default to 'PROMOTION_VIEW_UNSPECIFIED'] | ### Return type diff --git a/docs/QueryCollectionRequestTracking.md b/docs/QueryCollectionRequestTracking.md index 86f4bab..d15371f 100644 --- a/docs/QueryCollectionRequestTracking.md +++ b/docs/QueryCollectionRequestTracking.md @@ -4,10 +4,10 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **data** | **Hash<String, String>** | Custom values to be included in tracking data. | [optional] | -| **field** | **String** | Tracking field used to identify records in the collection. Must be unique schema field. | [optional] | -| **query_id** | **String** | Query ID of the query. If this is empty, then one is generated. | [optional] | -| **sequence** | **Integer** | Sequence number of query. | [optional] | +| **data** | **Hash<String, String>** | A set of custom values to be included in tracking data. | [optional] | +| **field** | **String** | The tracking field used to identify records in the collection. Must be unique schema field. | [optional] | +| **query_id** | **String** | The query ID of the query. If this is empty, then one is generated. | [optional] | +| **sequence** | **Integer** | The sequence number of query. | [optional] | | **type** | [**QueryCollectionRequestTrackingType**](QueryCollectionRequestTrackingType.md) | | [optional][default to 'TYPE_UNSPECIFIED'] | ## Example diff --git a/docs/QueryCollectionResponse.md b/docs/QueryCollectionResponse.md index bb9df7f..f5e6440 100644 --- a/docs/QueryCollectionResponse.md +++ b/docs/QueryCollectionResponse.md @@ -7,9 +7,11 @@ | **active_promotions** | [**Array<ActivePromotion>**](ActivePromotion.md) | A list of the promotions activated when running the query. | [optional] | | **aggregate_filters** | [**Hash<String, QueryAggregateResult>**](QueryAggregateResult.md) | The aggregates run with filters. | [optional] | | **aggregates** | [**Hash<String, QueryAggregateResult>**](QueryAggregateResult.md) | The aggregates returned by the query. | [optional] | +| **banners** | [**Array<Banner>**](Banner.md) | Banners associated with this query. | [optional] | | **feature_score_weight** | **Float** | The weight applied to the features in the query, used for analyzing the index, neural and feature components for results. For each result: ``` score = max(index_score, neural_score) * (1 - feature_score_weight) + feature_score * feature_score_weight ``` | [optional] | | **pipeline** | [**QueryCollectionResponsePipeline**](QueryCollectionResponsePipeline.md) | | [optional] | | **processing_duration** | **String** | The total time taken to perform the query. | [optional] | +| **query_id** | **String** | The query identifier. This uniqely identifies the specific query it was returned on. This is used to link user interactions with a query. | [optional] | | **redirects** | [**Hash<String, RedirectResult>**](RedirectResult.md) | A mapping of redirects triggered for all possible variations of the query. | [optional] | | **results** | [**Array<QueryResult>**](QueryResult.md) | The results returned by the query. | [optional] | | **total_size** | **String** | The total number of results that match the query. | [optional] | @@ -24,9 +26,11 @@ instance = SajariAPIClient::QueryCollectionResponse.new( active_promotions: null, aggregate_filters: null, aggregates: null, + banners: null, feature_score_weight: null, pipeline: null, processing_duration: null, + query_id: null, redirects: null, results: null, total_size: null, diff --git a/docs/QueryResult.md b/docs/QueryResult.md index 75c768c..b336f0c 100644 --- a/docs/QueryResult.md +++ b/docs/QueryResult.md @@ -4,10 +4,12 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | +| **banner** | [**Banner**](Banner.md) | | [optional] | | **feature_score** | **Float** | The feature score of the result. This is a value between 0 and 1 representing the business-specific ranking of the result as determined by the ranking adjustments. See [Ranking adjustments](https://docs.search.io/documentation/fundamentals/search-settings/ranking-adjustments) for more information. | [optional] | | **index_score** | **Float** | The index score of the result. This is a value between 0 and 1 representing the relevance of the result using traditional keyword search. The higher the score the more relevant the result is. | [optional] | | **neural_score** | **Float** | The neural score of the result. This is a value between 0 and 1 representing the relevance of the result using Neuralsearch®, using AI-based search. | [optional] | | **record** | **Object** | An object made up of field-value pairs that contains the record data. | [optional] | +| **relevance_score** | **Float** | The relevance score of the result. This is the best of `index_score` and `neural_score` with any index boosts applied on top. | [optional] | | **score** | **Float** | The overall relevance of the result. This is a value between 0 and 1 that combines the index, neural and feature scores. The higher the score the more relevant the result is. | [optional] | | **token** | [**QueryResultToken**](QueryResultToken.md) | | [optional] | @@ -17,10 +19,12 @@ require 'sdk_ruby' instance = SajariAPIClient::QueryResult.new( + banner: null, feature_score: null, index_score: null, neural_score: null, record: null, + relevance_score: null, score: null, token: null ) diff --git a/docs/RecordsApi.md b/docs/RecordsApi.md index a6ef6d6..4a12ad1 100644 --- a/docs/RecordsApi.md +++ b/docs/RecordsApi.md @@ -18,7 +18,7 @@ All URIs are relative to *https://api.search.io* Batch update records -The batch version of the [UpdateRecord](/api#operation/UpdateRecord) call. +The batch version of the [UpdateRecord](/docs/api#operation/UpdateRecord) call. ### Examples @@ -90,7 +90,7 @@ end Batch upsert records -The batch version of the [UpsertRecord](/api#operation/UpsertRecord) call. +The batch version of the [UpsertRecord](/docs/api#operation/UpsertRecord) call. ### Examples @@ -306,7 +306,7 @@ end Update record -Add or update specific fields within a record with the given values. The updated record is returned in the response. To replace all fields in a record, you should use the [UpsertRecord](/api#operation/UpsertRecord) call. Note that the update record call cannot be used to add or update indexed or unique fields. For this case use the [UpsertRecord](/api#operation/UpsertRecord) call. +Add or update specific fields within a record with the given values. The updated record is returned in the response. To replace all fields in a record, you should use the [UpsertRecord](/docs/api#operation/UpsertRecord) call. Note that the update record call cannot be used to add or update indexed or unique fields. For this case use the [UpsertRecord](/docs/api#operation/UpsertRecord) call. ### Examples diff --git a/docs/RedirectsApi.md b/docs/RedirectsApi.md index 19d788c..9d6dbe6 100644 --- a/docs/RedirectsApi.md +++ b/docs/RedirectsApi.md @@ -251,7 +251,7 @@ api_instance = SajariAPIClient::RedirectsApi.new collection_id = 'collection_id_example' # String | The collection that owns this set of redirects, e.g. `my-collection`. opts = { page_size: 56, # Integer | The maximum number of redirects to return. The service may return fewer than this value. If unspecified, at most 50 redirects are returned. The maximum value is 1000; values above 1000 are coerced to 1000. - page_token: 'page_token_example' # String | A page token, received from a previous [ListRedirects](/api#operation/ListRedirects) call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to [ListRedirects](/api#operation/ListRedirects) must match the call that provided the page token. + page_token: 'page_token_example' # String | A page token, received from a previous [ListRedirects](/docs/api#operation/ListRedirects) call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to [ListRedirects](/docs/api#operation/ListRedirects) must match the call that provided the page token. } begin @@ -287,7 +287,7 @@ end | ---- | ---- | ----------- | ----- | | **collection_id** | **String** | The collection that owns this set of redirects, e.g. `my-collection`. | | | **page_size** | **Integer** | The maximum number of redirects to return. The service may return fewer than this value. If unspecified, at most 50 redirects are returned. The maximum value is 1000; values above 1000 are coerced to 1000. | [optional] | -| **page_token** | **String** | A page token, received from a previous [ListRedirects](/api#operation/ListRedirects) call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to [ListRedirects](/api#operation/ListRedirects) must match the call that provided the page token. | [optional] | +| **page_token** | **String** | A page token, received from a previous [ListRedirects](/docs/api#operation/ListRedirects) call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to [ListRedirects](/docs/api#operation/ListRedirects) must match the call that provided the page token. | [optional] | ### Return type diff --git a/docs/SchemaApi.md b/docs/SchemaApi.md index 2b34b14..64e8cfa 100644 --- a/docs/SchemaApi.md +++ b/docs/SchemaApi.md @@ -15,7 +15,7 @@ All URIs are relative to *https://api.search.io* Batch create schema fields -The batch version of the [CreateSchemaField](/api#operation/CreateSchemaField) call. +The batch version of the [CreateSchemaField](/docs/api#operation/CreateSchemaField) call. ### Examples @@ -177,7 +177,7 @@ api_instance = SajariAPIClient::SchemaApi.new collection_id = 'collection_id_example' # String | The collection that owns this set of schema fields, e.g. `my-collection`. opts = { page_size: 56, # Integer | The maximum number of schema fields to return. The service may return fewer than this value. If unspecified, at most 50 schema fields are returned. The maximum value is 1000; values above 1000 are coerced to 1000. - page_token: 'page_token_example' # String | A page token, received from a previous [ListSchemaFields](/api#operation/ListSchemaFields) call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to [ListSchemaFields](/api#operation/ListSchemaFields) must match the call that provided the page token. + page_token: 'page_token_example' # String | A page token, received from a previous [ListSchemaFields](/docs/api#operation/ListSchemaFields) call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to [ListSchemaFields](/docs/api#operation/ListSchemaFields) must match the call that provided the page token. } begin @@ -213,7 +213,7 @@ end | ---- | ---- | ----------- | ----- | | **collection_id** | **String** | The collection that owns this set of schema fields, e.g. `my-collection`. | | | **page_size** | **Integer** | The maximum number of schema fields to return. The service may return fewer than this value. If unspecified, at most 50 schema fields are returned. The maximum value is 1000; values above 1000 are coerced to 1000. | [optional] | -| **page_token** | **String** | A page token, received from a previous [ListSchemaFields](/api#operation/ListSchemaFields) call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to [ListSchemaFields](/api#operation/ListSchemaFields) must match the call that provided the page token. | [optional] | +| **page_token** | **String** | A page token, received from a previous [ListSchemaFields](/docs/api#operation/ListSchemaFields) call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to [ListSchemaFields](/docs/api#operation/ListSchemaFields) must match the call that provided the page token. | [optional] | ### Return type diff --git a/docs/TextPosition.md b/docs/TextPosition.md new file mode 100644 index 0000000..cf1e191 --- /dev/null +++ b/docs/TextPosition.md @@ -0,0 +1,15 @@ +# SajariAPIClient::TextPosition + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + +## Example + +```ruby +require 'sdk_ruby' + +instance = SajariAPIClient::TextPosition.new() +``` + diff --git a/generate/generate.sh b/generate/generate.sh index e32d9fb..0805994 100755 --- a/generate/generate.sh +++ b/generate/generate.sh @@ -13,7 +13,7 @@ if [ -z "$GEN_PATH" ]; then die "GEN_PATH must be set, e.g. /path/to/sajari/sdk-ruby" fi -VERSION=4.3.0 +VERSION=5.0.0 docker-entrypoint.sh generate \ -i /openapi.json \ diff --git a/lib/sdk_ruby.rb b/lib/sdk_ruby.rb index 24851b5..67a8a75 100644 --- a/lib/sdk_ruby.rb +++ b/lib/sdk_ruby.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end @@ -18,6 +18,7 @@ # Models require 'sdk_ruby/models/active_promotion' +require 'sdk_ruby/models/banner' require 'sdk_ruby/models/batch_create_schema_fields_request' require 'sdk_ruby/models/batch_create_schema_fields_response' require 'sdk_ruby/models/batch_create_schema_fields_response_error' @@ -34,6 +35,10 @@ require 'sdk_ruby/models/collection' require 'sdk_ruby/models/delete_record_request' require 'sdk_ruby/models/error' +require 'sdk_ruby/models/event' +require 'sdk_ruby/models/experiment_request' +require 'sdk_ruby/models/experiment_request_pipeline' +require 'sdk_ruby/models/experiment_response' require 'sdk_ruby/models/generate_pipelines_request' require 'sdk_ruby/models/generate_pipelines_response' require 'sdk_ruby/models/get_default_pipeline_response' @@ -43,6 +48,7 @@ require 'sdk_ruby/models/list_collections_response' require 'sdk_ruby/models/list_pipelines_request_view' require 'sdk_ruby/models/list_pipelines_response' +require 'sdk_ruby/models/list_promotions_request_promotion_view' require 'sdk_ruby/models/list_promotions_response' require 'sdk_ruby/models/list_redirects_response' require 'sdk_ruby/models/list_schema_fields_response' @@ -57,6 +63,7 @@ require 'sdk_ruby/models/promotion_filter_boost' require 'sdk_ruby/models/promotion_filter_condition' require 'sdk_ruby/models/promotion_pin' +require 'sdk_ruby/models/promotion_pin_mode' require 'sdk_ruby/models/promotion_range_boost' require 'sdk_ruby/models/protobuf_any' require 'sdk_ruby/models/protobuf_field_mask' @@ -89,6 +96,7 @@ require 'sdk_ruby/models/set_default_pipeline_request' require 'sdk_ruby/models/set_default_version_request' require 'sdk_ruby/models/status' +require 'sdk_ruby/models/text_position' require 'sdk_ruby/models/update_record_request' require 'sdk_ruby/models/upsert_record_request' require 'sdk_ruby/models/upsert_record_request_pipeline' diff --git a/lib/sdk_ruby/api/collections_api.rb b/lib/sdk_ruby/api/collections_api.rb index 5785f98..c5a9ac0 100644 --- a/lib/sdk_ruby/api/collections_api.rb +++ b/lib/sdk_ruby/api/collections_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end @@ -157,6 +157,80 @@ def delete_collection_with_http_info(collection_id, opts = {}) return data, status_code, headers end + # Experiment + # Run a query on a collection with a hypothetical configuration to see what kinds of results it produces. Saved promotions with a start date in the future are enabled during the experiment, unless they are explicitly disabled. The following example demonstrates how to run a simple experiment for a string, against a pipeline and with a proposed promotion: ```json { \"pipeline\": { \"name\": \"my-pipeline\" }, \"variables\": { \"q\": \"search terms\" }, \"promotions\": [{ \"id\": \"1234\", \"condition\": \"q = 'search terms'\", \"pins\": [{ \"key\": { \"field\": \"id\", \"value\": \"54hdc7h2334h\" }, \"position\": 1 }] }] } ``` + # @param collection_id [String] The collection to query, e.g. `my-collection`. + # @param experiment_request [ExperimentRequest] + # @param [Hash] opts the optional parameters + # @return [ExperimentResponse] + def experiment(collection_id, experiment_request, opts = {}) + data, _status_code, _headers = experiment_with_http_info(collection_id, experiment_request, opts) + data + end + + # Experiment + # Run a query on a collection with a hypothetical configuration to see what kinds of results it produces. Saved promotions with a start date in the future are enabled during the experiment, unless they are explicitly disabled. The following example demonstrates how to run a simple experiment for a string, against a pipeline and with a proposed promotion: ```json { \"pipeline\": { \"name\": \"my-pipeline\" }, \"variables\": { \"q\": \"search terms\" }, \"promotions\": [{ \"id\": \"1234\", \"condition\": \"q = 'search terms'\", \"pins\": [{ \"key\": { \"field\": \"id\", \"value\": \"54hdc7h2334h\" }, \"position\": 1 }] }] } ``` + # @param collection_id [String] The collection to query, e.g. `my-collection`. + # @param experiment_request [ExperimentRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(ExperimentResponse, Integer, Hash)>] ExperimentResponse data, response status code and response headers + def experiment_with_http_info(collection_id, experiment_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CollectionsApi.experiment ...' + end + # verify the required parameter 'collection_id' is set + if @api_client.config.client_side_validation && collection_id.nil? + fail ArgumentError, "Missing the required parameter 'collection_id' when calling CollectionsApi.experiment" + end + # verify the required parameter 'experiment_request' is set + if @api_client.config.client_side_validation && experiment_request.nil? + fail ArgumentError, "Missing the required parameter 'experiment_request' when calling CollectionsApi.experiment" + end + # resource path + local_var_path = '/v4/collections/{collection_id}:experiment'.sub('{' + 'collection_id' + '}', CGI.escape(collection_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(experiment_request) + + # return_type + return_type = opts[:debug_return_type] || 'ExperimentResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['BasicAuth'] + + new_options = opts.merge( + :operation => :"CollectionsApi.experiment", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CollectionsApi#experiment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Get collection # Retrieve the details of a collection. # @param collection_id [String] The collection to retrieve, e.g. `my-collection`. @@ -224,7 +298,7 @@ def get_collection_with_http_info(collection_id, opts = {}) # Retrieve a list of collections in an account. # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size The maximum number of collections to return. The service may return fewer than this value. If unspecified, at most 50 collections are returned. The maximum value is 100; values above 100 are coerced to 100. - # @option opts [String] :page_token A page token, received from a previous [ListCollections](/api#operation/ListCollections) call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to [ListCollections](/api#operation/ListCollections) must match the call that provided the page token. + # @option opts [String] :page_token A page token, received from a previous [ListCollections](/docs/api#operation/ListCollections) call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to [ListCollections](/docs/api#operation/ListCollections) must match the call that provided the page token. # @return [ListCollectionsResponse] def list_collections(opts = {}) data, _status_code, _headers = list_collections_with_http_info(opts) @@ -235,7 +309,7 @@ def list_collections(opts = {}) # Retrieve a list of collections in an account. # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size The maximum number of collections to return. The service may return fewer than this value. If unspecified, at most 50 collections are returned. The maximum value is 100; values above 100 are coerced to 100. - # @option opts [String] :page_token A page token, received from a previous [ListCollections](/api#operation/ListCollections) call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to [ListCollections](/api#operation/ListCollections) must match the call that provided the page token. + # @option opts [String] :page_token A page token, received from a previous [ListCollections](/docs/api#operation/ListCollections) call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to [ListCollections](/docs/api#operation/ListCollections) must match the call that provided the page token. # @return [Array<(ListCollectionsResponse, Integer, Hash)>] ListCollectionsResponse data, response status code and response headers def list_collections_with_http_info(opts = {}) if @api_client.config.debugging @@ -284,10 +358,11 @@ def list_collections_with_http_info(opts = {}) end # Query collection - # Query the collection to search for records. The following example demonstrates how to run a simple search for a particular string: ```json { \"variables\": { \"q\": \"search terms\" } } ``` For more information: - See [filtering content](https://docs.search.io/documentation/fundamentals/integrating-search/filters-and-sort-options) - See [tracking in the Go SDK](https://github.com/sajari/sdk-go/blob/v2/session.go) - See [tracking in the JS SDK](https://github.com/sajari/sajari-sdk-js/blob/master/src/session.ts) + # Query the collection to search for records. The following example demonstrates how to run a simple search for a particular string: ```json { \"variables\": { \"q\": \"search terms\" } } ``` For more information: - See [filtering content](https://docs.search.io/documentation/fundamentals/integrating-search/filters-and-sort-options) - See [tracking in the Go SDK](https://github.com/sajari/sdk-go/blob/v2/session.go) - See [tracking in the JS SDK](https://github.com/sajari/sdk-js/blob/554e182e77d3ba99a9c100b208ebf3be414d2067/src/index.ts#L881) Note: Unlike other API calls, the `QueryCollection` call can be called from a browser. When called from a browser, the `Account-Id` header must be set to your account ID. # @param collection_id [String] The collection to query, e.g. `my-collection`. # @param query_collection_request [QueryCollectionRequest] # @param [Hash] opts the optional parameters + # @option opts [String] :account_id The account that owns the collection, e.g. `1618535966441231024`. Unlike other API calls, the `QueryCollection` call can be called from a browser. When called from a browser, the `Account-Id` header must be set to your account ID. # @return [QueryCollectionResponse] def query_collection(collection_id, query_collection_request, opts = {}) data, _status_code, _headers = query_collection_with_http_info(collection_id, query_collection_request, opts) @@ -295,10 +370,11 @@ def query_collection(collection_id, query_collection_request, opts = {}) end # Query collection - # Query the collection to search for records. The following example demonstrates how to run a simple search for a particular string: ```json { \"variables\": { \"q\": \"search terms\" } } ``` For more information: - See [filtering content](https://docs.search.io/documentation/fundamentals/integrating-search/filters-and-sort-options) - See [tracking in the Go SDK](https://github.com/sajari/sdk-go/blob/v2/session.go) - See [tracking in the JS SDK](https://github.com/sajari/sajari-sdk-js/blob/master/src/session.ts) + # Query the collection to search for records. The following example demonstrates how to run a simple search for a particular string: ```json { \"variables\": { \"q\": \"search terms\" } } ``` For more information: - See [filtering content](https://docs.search.io/documentation/fundamentals/integrating-search/filters-and-sort-options) - See [tracking in the Go SDK](https://github.com/sajari/sdk-go/blob/v2/session.go) - See [tracking in the JS SDK](https://github.com/sajari/sdk-js/blob/554e182e77d3ba99a9c100b208ebf3be414d2067/src/index.ts#L881) Note: Unlike other API calls, the `QueryCollection` call can be called from a browser. When called from a browser, the `Account-Id` header must be set to your account ID. # @param collection_id [String] The collection to query, e.g. `my-collection`. # @param query_collection_request [QueryCollectionRequest] # @param [Hash] opts the optional parameters + # @option opts [String] :account_id The account that owns the collection, e.g. `1618535966441231024`. Unlike other API calls, the `QueryCollection` call can be called from a browser. When called from a browser, the `Account-Id` header must be set to your account ID. # @return [Array<(QueryCollectionResponse, Integer, Hash)>] QueryCollectionResponse data, response status code and response headers def query_collection_with_http_info(collection_id, query_collection_request, opts = {}) if @api_client.config.debugging @@ -327,6 +403,7 @@ def query_collection_with_http_info(collection_id, query_collection_request, opt if !content_type.nil? header_params['Content-Type'] = content_type end + header_params[:'Account-Id'] = opts[:'account_id'] if !opts[:'account_id'].nil? # form parameters form_params = opts[:form_params] || {} @@ -358,7 +435,7 @@ def query_collection_with_http_info(collection_id, query_collection_request, opt end # Query collection - # Query the collection to search for records. The following example demonstrates how to run a simple search for a particular string: ```json { \"variables\": { \"q\": \"search terms\" } } ``` For more information: - See [filtering content](https://docs.search.io/documentation/fundamentals/integrating-search/filters-and-sort-options) - See [tracking in the Go SDK](https://github.com/sajari/sdk-go/blob/v2/session.go) - See [tracking in the JS SDK](https://github.com/sajari/sajari-sdk-js/blob/master/src/session.ts) + # Query the collection to search for records. The following example demonstrates how to run a simple search for a particular string: ```json { \"variables\": { \"q\": \"search terms\" } } ``` For more information: - See [filtering content](https://docs.search.io/documentation/fundamentals/integrating-search/filters-and-sort-options) - See [tracking in the Go SDK](https://github.com/sajari/sdk-go/blob/v2/session.go) - See [tracking in the JS SDK](https://github.com/sajari/sdk-js/blob/554e182e77d3ba99a9c100b208ebf3be414d2067/src/index.ts#L881) Note: Unlike other API calls, the `QueryCollection` call can be called from a browser. When called from a browser, the `Account-Id` header must be set to your account ID. # @param collection_id [String] The collection to query, e.g. `my-collection`. # @param query_collection_request [QueryCollectionRequest] # @param [Hash] opts the optional parameters @@ -369,7 +446,7 @@ def query_collection2(collection_id, query_collection_request, opts = {}) end # Query collection - # Query the collection to search for records. The following example demonstrates how to run a simple search for a particular string: ```json { \"variables\": { \"q\": \"search terms\" } } ``` For more information: - See [filtering content](https://docs.search.io/documentation/fundamentals/integrating-search/filters-and-sort-options) - See [tracking in the Go SDK](https://github.com/sajari/sdk-go/blob/v2/session.go) - See [tracking in the JS SDK](https://github.com/sajari/sajari-sdk-js/blob/master/src/session.ts) + # Query the collection to search for records. The following example demonstrates how to run a simple search for a particular string: ```json { \"variables\": { \"q\": \"search terms\" } } ``` For more information: - See [filtering content](https://docs.search.io/documentation/fundamentals/integrating-search/filters-and-sort-options) - See [tracking in the Go SDK](https://github.com/sajari/sdk-go/blob/v2/session.go) - See [tracking in the JS SDK](https://github.com/sajari/sdk-js/blob/554e182e77d3ba99a9c100b208ebf3be414d2067/src/index.ts#L881) Note: Unlike other API calls, the `QueryCollection` call can be called from a browser. When called from a browser, the `Account-Id` header must be set to your account ID. # @param collection_id [String] The collection to query, e.g. `my-collection`. # @param query_collection_request [QueryCollectionRequest] # @param [Hash] opts the optional parameters @@ -431,26 +508,107 @@ def query_collection2_with_http_info(collection_id, query_collection_request, op return data, status_code, headers end + # Track event + # Track an analytics event when a user interacts with an object returned by a [QueryCollection](/docs/api/#operation/QueryCollection) request. An analytics event can be tracked for the following objects: - Results - Promotion banners - Redirects Note: You must pass an `Account-Id` header. + # @param account_id [String] The account that owns the collection, e.g. `1618535966441231024`. + # @param collection_id [String] The collection to track the event against, e.g. `my-collection`. + # @param event [Event] The details of the event to track. + # @param [Hash] opts the optional parameters + # @return [Object] + def track_event(account_id, collection_id, event, opts = {}) + data, _status_code, _headers = track_event_with_http_info(account_id, collection_id, event, opts) + data + end + + # Track event + # Track an analytics event when a user interacts with an object returned by a [QueryCollection](/docs/api/#operation/QueryCollection) request. An analytics event can be tracked for the following objects: - Results - Promotion banners - Redirects Note: You must pass an `Account-Id` header. + # @param account_id [String] The account that owns the collection, e.g. `1618535966441231024`. + # @param collection_id [String] The collection to track the event against, e.g. `my-collection`. + # @param event [Event] The details of the event to track. + # @param [Hash] opts the optional parameters + # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers + def track_event_with_http_info(account_id, collection_id, event, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CollectionsApi.track_event ...' + end + # verify the required parameter 'account_id' is set + if @api_client.config.client_side_validation && account_id.nil? + fail ArgumentError, "Missing the required parameter 'account_id' when calling CollectionsApi.track_event" + end + # verify the required parameter 'collection_id' is set + if @api_client.config.client_side_validation && collection_id.nil? + fail ArgumentError, "Missing the required parameter 'collection_id' when calling CollectionsApi.track_event" + end + # verify the required parameter 'event' is set + if @api_client.config.client_side_validation && event.nil? + fail ArgumentError, "Missing the required parameter 'event' when calling CollectionsApi.track_event" + end + # resource path + local_var_path = '/v4/collections/{collection_id}:trackEvent'.sub('{' + 'collection_id' + '}', CGI.escape(collection_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + header_params[:'Account-Id'] = account_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(event) + + # return_type + return_type = opts[:debug_return_type] || 'Object' + + # auth_names + auth_names = opts[:debug_auth_names] || ['BasicAuth'] + + new_options = opts.merge( + :operation => :"CollectionsApi.track_event", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CollectionsApi#track_event\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Update collection # Update the details of a collection. # @param collection_id [String] The collection to update, e.g. `my-collection`. - # @param update_mask [String] The list of fields to be updated, separated by a comma, e.g. `field1,field2`. Each field should be in snake case, e.g. `display_name`. For each field that you want to update, provide a corresponding value in the collection object containing the new value. - # @param collection [Collection] Details of the collection to update. + # @param collection [Collection] The details of the collection to update. # @param [Hash] opts the optional parameters + # @option opts [String] :update_mask The list of fields to update, separated by a comma, e.g. `authorized_query_domains,display_name`. Each field should be in snake case. For each field that you want to update, provide a corresponding value in the collection object containing the new value. # @return [Collection] - def update_collection(collection_id, update_mask, collection, opts = {}) - data, _status_code, _headers = update_collection_with_http_info(collection_id, update_mask, collection, opts) + def update_collection(collection_id, collection, opts = {}) + data, _status_code, _headers = update_collection_with_http_info(collection_id, collection, opts) data end # Update collection # Update the details of a collection. # @param collection_id [String] The collection to update, e.g. `my-collection`. - # @param update_mask [String] The list of fields to be updated, separated by a comma, e.g. `field1,field2`. Each field should be in snake case, e.g. `display_name`. For each field that you want to update, provide a corresponding value in the collection object containing the new value. - # @param collection [Collection] Details of the collection to update. + # @param collection [Collection] The details of the collection to update. # @param [Hash] opts the optional parameters + # @option opts [String] :update_mask The list of fields to update, separated by a comma, e.g. `authorized_query_domains,display_name`. Each field should be in snake case. For each field that you want to update, provide a corresponding value in the collection object containing the new value. # @return [Array<(Collection, Integer, Hash)>] Collection data, response status code and response headers - def update_collection_with_http_info(collection_id, update_mask, collection, opts = {}) + def update_collection_with_http_info(collection_id, collection, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CollectionsApi.update_collection ...' end @@ -458,10 +616,6 @@ def update_collection_with_http_info(collection_id, update_mask, collection, opt if @api_client.config.client_side_validation && collection_id.nil? fail ArgumentError, "Missing the required parameter 'collection_id' when calling CollectionsApi.update_collection" end - # verify the required parameter 'update_mask' is set - if @api_client.config.client_side_validation && update_mask.nil? - fail ArgumentError, "Missing the required parameter 'update_mask' when calling CollectionsApi.update_collection" - end # verify the required parameter 'collection' is set if @api_client.config.client_side_validation && collection.nil? fail ArgumentError, "Missing the required parameter 'collection' when calling CollectionsApi.update_collection" @@ -471,7 +625,7 @@ def update_collection_with_http_info(collection_id, update_mask, collection, opt # query parameters query_params = opts[:query_params] || {} - query_params[:'update_mask'] = update_mask + query_params[:'update_mask'] = opts[:'update_mask'] if !opts[:'update_mask'].nil? # header parameters header_params = opts[:header_params] || {} diff --git a/lib/sdk_ruby/api/events_api.rb b/lib/sdk_ruby/api/events_api.rb index 5ef7c58..d9e2baa 100644 --- a/lib/sdk_ruby/api/events_api.rb +++ b/lib/sdk_ruby/api/events_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end @@ -20,24 +20,30 @@ def initialize(api_client = ApiClient.default) @api_client = api_client end # Send event - # Send an event to the ranking system after a user interacts with a search result. When querying a collection, you can set the tracking type of the query request. When it is `CLICK` or `POS_NEG`, a token is generated for each result in the query response. You can use this token to provide feedback to the ranking system. Each time you want to record an event on a particular search result, use the send event call and provide: - The `name` of the event, e.g. `click`, `purchase`. - The `token` from the search result. - The `weight` to assign to the event, e.g. `1`. - An object containing any additional `metadata`. For example, to send an event where a customer purchased a product, use the following call: ```json { \"name\": \"purchase\", \"token\": \"eyJ...\", \"weight\": 1, \"metadata\": { \"discount\": 0.2, \"margin\": 30.0, \"customer_id\": \"12345\", \"ui_test_segment\": \"A\" } } ``` + # Send an event to the ranking system after a user interacts with a search result. When querying a collection, you can set the tracking type of the query request. When it is `CLICK` or `POS_NEG`, a token is generated for each result in the query response. You can use this token to provide feedback to the ranking system. Each time you want to record an event on a particular search result, use the send event call and provide: - The `name` of the event, e.g. `click`, `purchase`. - The `token` from the search result. - The `weight` to assign to the event, e.g. `1`. - An object containing any additional `metadata`. For example, to send an event where a customer purchased a product, use the following call: ```json { \"name\": \"purchase\", \"token\": \"eyJ...\", \"weight\": 1, \"metadata\": { \"discount\": 0.2, \"margin\": 30.0, \"customer_id\": \"12345\", \"ui_test_segment\": \"A\" } } ``` Note: You must pass an `Account-Id` header. + # @param account_id [String] The account that owns the collection, e.g. `1618535966441231024`. # @param send_event_request [SendEventRequest] # @param [Hash] opts the optional parameters # @return [Object] - def send_event(send_event_request, opts = {}) - data, _status_code, _headers = send_event_with_http_info(send_event_request, opts) + def send_event(account_id, send_event_request, opts = {}) + data, _status_code, _headers = send_event_with_http_info(account_id, send_event_request, opts) data end # Send event - # Send an event to the ranking system after a user interacts with a search result. When querying a collection, you can set the tracking type of the query request. When it is `CLICK` or `POS_NEG`, a token is generated for each result in the query response. You can use this token to provide feedback to the ranking system. Each time you want to record an event on a particular search result, use the send event call and provide: - The `name` of the event, e.g. `click`, `purchase`. - The `token` from the search result. - The `weight` to assign to the event, e.g. `1`. - An object containing any additional `metadata`. For example, to send an event where a customer purchased a product, use the following call: ```json { \"name\": \"purchase\", \"token\": \"eyJ...\", \"weight\": 1, \"metadata\": { \"discount\": 0.2, \"margin\": 30.0, \"customer_id\": \"12345\", \"ui_test_segment\": \"A\" } } ``` + # Send an event to the ranking system after a user interacts with a search result. When querying a collection, you can set the tracking type of the query request. When it is `CLICK` or `POS_NEG`, a token is generated for each result in the query response. You can use this token to provide feedback to the ranking system. Each time you want to record an event on a particular search result, use the send event call and provide: - The `name` of the event, e.g. `click`, `purchase`. - The `token` from the search result. - The `weight` to assign to the event, e.g. `1`. - An object containing any additional `metadata`. For example, to send an event where a customer purchased a product, use the following call: ```json { \"name\": \"purchase\", \"token\": \"eyJ...\", \"weight\": 1, \"metadata\": { \"discount\": 0.2, \"margin\": 30.0, \"customer_id\": \"12345\", \"ui_test_segment\": \"A\" } } ``` Note: You must pass an `Account-Id` header. + # @param account_id [String] The account that owns the collection, e.g. `1618535966441231024`. # @param send_event_request [SendEventRequest] # @param [Hash] opts the optional parameters # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers - def send_event_with_http_info(send_event_request, opts = {}) + def send_event_with_http_info(account_id, send_event_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EventsApi.send_event ...' end + # verify the required parameter 'account_id' is set + if @api_client.config.client_side_validation && account_id.nil? + fail ArgumentError, "Missing the required parameter 'account_id' when calling EventsApi.send_event" + end # verify the required parameter 'send_event_request' is set if @api_client.config.client_side_validation && send_event_request.nil? fail ArgumentError, "Missing the required parameter 'send_event_request' when calling EventsApi.send_event" @@ -57,6 +63,7 @@ def send_event_with_http_info(send_event_request, opts = {}) if !content_type.nil? header_params['Content-Type'] = content_type end + header_params[:'Account-Id'] = account_id # form parameters form_params = opts[:form_params] || {} @@ -88,7 +95,7 @@ def send_event_with_http_info(send_event_request, opts = {}) end # Send event - # Send an event to the ranking system after a user interacts with a search result. When querying a collection, you can set the tracking type of the query request. When it is `CLICK` or `POS_NEG`, a token is generated for each result in the query response. You can use this token to provide feedback to the ranking system. Each time you want to record an event on a particular search result, use the send event call and provide: - The `name` of the event, e.g. `click`, `purchase`. - The `token` from the search result. - The `weight` to assign to the event, e.g. `1`. - An object containing any additional `metadata`. For example, to send an event where a customer purchased a product, use the following call: ```json { \"name\": \"purchase\", \"token\": \"eyJ...\", \"weight\": 1, \"metadata\": { \"discount\": 0.2, \"margin\": 30.0, \"customer_id\": \"12345\", \"ui_test_segment\": \"A\" } } ``` + # Send an event to the ranking system after a user interacts with a search result. When querying a collection, you can set the tracking type of the query request. When it is `CLICK` or `POS_NEG`, a token is generated for each result in the query response. You can use this token to provide feedback to the ranking system. Each time you want to record an event on a particular search result, use the send event call and provide: - The `name` of the event, e.g. `click`, `purchase`. - The `token` from the search result. - The `weight` to assign to the event, e.g. `1`. - An object containing any additional `metadata`. For example, to send an event where a customer purchased a product, use the following call: ```json { \"name\": \"purchase\", \"token\": \"eyJ...\", \"weight\": 1, \"metadata\": { \"discount\": 0.2, \"margin\": 30.0, \"customer_id\": \"12345\", \"ui_test_segment\": \"A\" } } ``` Note: You must pass an `Account-Id` header. # @param send_event_request [SendEventRequest] # @param [Hash] opts the optional parameters # @return [Object] @@ -98,7 +105,7 @@ def send_event2(send_event_request, opts = {}) end # Send event - # Send an event to the ranking system after a user interacts with a search result. When querying a collection, you can set the tracking type of the query request. When it is `CLICK` or `POS_NEG`, a token is generated for each result in the query response. You can use this token to provide feedback to the ranking system. Each time you want to record an event on a particular search result, use the send event call and provide: - The `name` of the event, e.g. `click`, `purchase`. - The `token` from the search result. - The `weight` to assign to the event, e.g. `1`. - An object containing any additional `metadata`. For example, to send an event where a customer purchased a product, use the following call: ```json { \"name\": \"purchase\", \"token\": \"eyJ...\", \"weight\": 1, \"metadata\": { \"discount\": 0.2, \"margin\": 30.0, \"customer_id\": \"12345\", \"ui_test_segment\": \"A\" } } ``` + # Send an event to the ranking system after a user interacts with a search result. When querying a collection, you can set the tracking type of the query request. When it is `CLICK` or `POS_NEG`, a token is generated for each result in the query response. You can use this token to provide feedback to the ranking system. Each time you want to record an event on a particular search result, use the send event call and provide: - The `name` of the event, e.g. `click`, `purchase`. - The `token` from the search result. - The `weight` to assign to the event, e.g. `1`. - An object containing any additional `metadata`. For example, to send an event where a customer purchased a product, use the following call: ```json { \"name\": \"purchase\", \"token\": \"eyJ...\", \"weight\": 1, \"metadata\": { \"discount\": 0.2, \"margin\": 30.0, \"customer_id\": \"12345\", \"ui_test_segment\": \"A\" } } ``` Note: You must pass an `Account-Id` header. # @param send_event_request [SendEventRequest] # @param [Hash] opts the optional parameters # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers diff --git a/lib/sdk_ruby/api/pipelines_api.rb b/lib/sdk_ruby/api/pipelines_api.rb index 7f36d91..91cd431 100644 --- a/lib/sdk_ruby/api/pipelines_api.rb +++ b/lib/sdk_ruby/api/pipelines_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end @@ -248,7 +248,7 @@ def get_default_pipeline_with_http_info(collection_id, type, opts = {}) # @param type [String] The type of the pipeline to get the default version of. # @param name [String] The name of the pipeline to get the default version of, e.g. `my-pipeline`. # @param [Hash] opts the optional parameters - # @option opts [String] :view The amount of information to include in the retrieved pipeline. - VIEW_UNSPECIFIED: The default / unset value. The API defaults to the `BASIC` view. - BASIC: Include basic information including type, name, version and description but not the full step configuration. This is the default value (for both [ListPipelines](/api#operation/ListPipelines) and [GetPipeline](/api#operation/GetPipeline)). - FULL: Include the information from `BASIC`, plus full step configuration. (default to 'VIEW_UNSPECIFIED') + # @option opts [String] :view The amount of information to include in the retrieved pipeline. - VIEW_UNSPECIFIED: The default / unset value. The API defaults to the `BASIC` view. - BASIC: Include basic information including type, name, version and description but not the full step configuration. This is the default value (for both [ListPipelines](/docs/api#operation/ListPipelines) and [GetPipeline](/docs/api#operation/GetPipeline)). - FULL: Include the information from `BASIC`, plus full step configuration. (default to 'VIEW_UNSPECIFIED') # @return [Pipeline] def get_default_version(collection_id, type, name, opts = {}) data, _status_code, _headers = get_default_version_with_http_info(collection_id, type, name, opts) @@ -261,7 +261,7 @@ def get_default_version(collection_id, type, name, opts = {}) # @param type [String] The type of the pipeline to get the default version of. # @param name [String] The name of the pipeline to get the default version of, e.g. `my-pipeline`. # @param [Hash] opts the optional parameters - # @option opts [String] :view The amount of information to include in the retrieved pipeline. - VIEW_UNSPECIFIED: The default / unset value. The API defaults to the `BASIC` view. - BASIC: Include basic information including type, name, version and description but not the full step configuration. This is the default value (for both [ListPipelines](/api#operation/ListPipelines) and [GetPipeline](/api#operation/GetPipeline)). - FULL: Include the information from `BASIC`, plus full step configuration. + # @option opts [String] :view The amount of information to include in the retrieved pipeline. - VIEW_UNSPECIFIED: The default / unset value. The API defaults to the `BASIC` view. - BASIC: Include basic information including type, name, version and description but not the full step configuration. This is the default value (for both [ListPipelines](/docs/api#operation/ListPipelines) and [GetPipeline](/docs/api#operation/GetPipeline)). - FULL: Include the information from `BASIC`, plus full step configuration. # @return [Array<(Pipeline, Integer, Hash)>] Pipeline data, response status code and response headers def get_default_version_with_http_info(collection_id, type, name, opts = {}) if @api_client.config.debugging @@ -336,7 +336,7 @@ def get_default_version_with_http_info(collection_id, type, name, opts = {}) # @param name [String] The name of the pipeline to retrieve, e.g. `my-pipeline`. # @param version [String] The version of the pipeline to retrieve, e.g. `42`. # @param [Hash] opts the optional parameters - # @option opts [String] :view The amount of information to include in the retrieved pipeline. - VIEW_UNSPECIFIED: The default / unset value. The API defaults to the `BASIC` view. - BASIC: Include basic information including type, name, version and description but not the full step configuration. This is the default value (for both [ListPipelines](/api#operation/ListPipelines) and [GetPipeline](/api#operation/GetPipeline)). - FULL: Include the information from `BASIC`, plus full step configuration. (default to 'VIEW_UNSPECIFIED') + # @option opts [String] :view The amount of information to include in the retrieved pipeline. - VIEW_UNSPECIFIED: The default / unset value. The API defaults to the `BASIC` view. - BASIC: Include basic information including type, name, version and description but not the full step configuration. This is the default value (for both [ListPipelines](/docs/api#operation/ListPipelines) and [GetPipeline](/docs/api#operation/GetPipeline)). - FULL: Include the information from `BASIC`, plus full step configuration. (default to 'VIEW_UNSPECIFIED') # @return [Pipeline] def get_pipeline(collection_id, type, name, version, opts = {}) data, _status_code, _headers = get_pipeline_with_http_info(collection_id, type, name, version, opts) @@ -350,7 +350,7 @@ def get_pipeline(collection_id, type, name, version, opts = {}) # @param name [String] The name of the pipeline to retrieve, e.g. `my-pipeline`. # @param version [String] The version of the pipeline to retrieve, e.g. `42`. # @param [Hash] opts the optional parameters - # @option opts [String] :view The amount of information to include in the retrieved pipeline. - VIEW_UNSPECIFIED: The default / unset value. The API defaults to the `BASIC` view. - BASIC: Include basic information including type, name, version and description but not the full step configuration. This is the default value (for both [ListPipelines](/api#operation/ListPipelines) and [GetPipeline](/api#operation/GetPipeline)). - FULL: Include the information from `BASIC`, plus full step configuration. + # @option opts [String] :view The amount of information to include in the retrieved pipeline. - VIEW_UNSPECIFIED: The default / unset value. The API defaults to the `BASIC` view. - BASIC: Include basic information including type, name, version and description but not the full step configuration. This is the default value (for both [ListPipelines](/docs/api#operation/ListPipelines) and [GetPipeline](/docs/api#operation/GetPipeline)). - FULL: Include the information from `BASIC`, plus full step configuration. # @return [Array<(Pipeline, Integer, Hash)>] Pipeline data, response status code and response headers def get_pipeline_with_http_info(collection_id, type, name, version, opts = {}) if @api_client.config.debugging @@ -427,8 +427,8 @@ def get_pipeline_with_http_info(collection_id, type, name, version, opts = {}) # @param collection_id [String] The collection that owns this set of pipelines, e.g. `my-collection`. # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size The maximum number of pipelines to return. The service may return fewer than this value. If unspecified, at most 50 pipelines are returned. The maximum value is 1000; values above 1000 are coerced to 1000. - # @option opts [String] :page_token A page token, received from a previous [ListPipelines](/api#operation/ListPipelines) call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to [ListPipelines](/api#operation/ListPipelines) must match the call that provided the page token. - # @option opts [String] :view The amount of information to include in each retrieved pipeline. - VIEW_UNSPECIFIED: The default / unset value. The API defaults to the `BASIC` view. - BASIC: Include basic information including type, name, version and description but not the full step configuration. This is the default value (for both [ListPipelines](/api#operation/ListPipelines) and [GetPipeline](/api#operation/GetPipeline)). - FULL: Include the information from `BASIC`, plus full step configuration. (default to 'VIEW_UNSPECIFIED') + # @option opts [String] :page_token A page token, received from a previous [ListPipelines](/docs/api#operation/ListPipelines) call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to [ListPipelines](/docs/api#operation/ListPipelines) must match the call that provided the page token. + # @option opts [String] :view The amount of information to include in each retrieved pipeline. - VIEW_UNSPECIFIED: The default / unset value. The API defaults to the `BASIC` view. - BASIC: Include basic information including type, name, version and description but not the full step configuration. This is the default value (for both [ListPipelines](/docs/api#operation/ListPipelines) and [GetPipeline](/docs/api#operation/GetPipeline)). - FULL: Include the information from `BASIC`, plus full step configuration. (default to 'VIEW_UNSPECIFIED') # @return [ListPipelinesResponse] def list_pipelines(collection_id, opts = {}) data, _status_code, _headers = list_pipelines_with_http_info(collection_id, opts) @@ -440,8 +440,8 @@ def list_pipelines(collection_id, opts = {}) # @param collection_id [String] The collection that owns this set of pipelines, e.g. `my-collection`. # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size The maximum number of pipelines to return. The service may return fewer than this value. If unspecified, at most 50 pipelines are returned. The maximum value is 1000; values above 1000 are coerced to 1000. - # @option opts [String] :page_token A page token, received from a previous [ListPipelines](/api#operation/ListPipelines) call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to [ListPipelines](/api#operation/ListPipelines) must match the call that provided the page token. - # @option opts [String] :view The amount of information to include in each retrieved pipeline. - VIEW_UNSPECIFIED: The default / unset value. The API defaults to the `BASIC` view. - BASIC: Include basic information including type, name, version and description but not the full step configuration. This is the default value (for both [ListPipelines](/api#operation/ListPipelines) and [GetPipeline](/api#operation/GetPipeline)). - FULL: Include the information from `BASIC`, plus full step configuration. + # @option opts [String] :page_token A page token, received from a previous [ListPipelines](/docs/api#operation/ListPipelines) call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to [ListPipelines](/docs/api#operation/ListPipelines) must match the call that provided the page token. + # @option opts [String] :view The amount of information to include in each retrieved pipeline. - VIEW_UNSPECIFIED: The default / unset value. The API defaults to the `BASIC` view. - BASIC: Include basic information including type, name, version and description but not the full step configuration. This is the default value (for both [ListPipelines](/docs/api#operation/ListPipelines) and [GetPipeline](/docs/api#operation/GetPipeline)). - FULL: Include the information from `BASIC`, plus full step configuration. # @return [Array<(ListPipelinesResponse, Integer, Hash)>] ListPipelinesResponse data, response status code and response headers def list_pipelines_with_http_info(collection_id, opts = {}) if @api_client.config.debugging diff --git a/lib/sdk_ruby/api/promotions_api.rb b/lib/sdk_ruby/api/promotions_api.rb index 971b705..97497ad 100644 --- a/lib/sdk_ruby/api/promotions_api.rb +++ b/lib/sdk_ruby/api/promotions_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end @@ -236,7 +236,8 @@ def get_promotion_with_http_info(collection_id, promotion_id, opts = {}) # @param collection_id [String] The collection that owns this set of promotions, e.g. `my-collection`. # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size The maximum number of promotions to return. The service may return fewer than this value. If unspecified, at most 50 promotions are returned. The maximum value is 1000; values above 1000 are coerced to 1000. - # @option opts [String] :page_token A page token, received from a previous [ListPromotions](/api#operation/ListPromotions) call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to [ListPromotions](/api#operation/ListPromotions) must match the call that provided the page token. + # @option opts [String] :page_token A page token, received from a previous [ListPromotions](/docs/api#operation/ListPromotions) call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to [ListPromotions](/docs/api#operation/ListPromotions) must match the call that provided the page token. + # @option opts [String] :view The amount of information to include in each retrieved promotion. - PROMOTION_VIEW_UNSPECIFIED: The default / unset value. The API defaults to the `FULL` view. - BASIC: Include basic information including name, start time and end time, but not detailed information about the promotion effects. - FULL: Returns all information about a promotion. This is the default value. (default to 'PROMOTION_VIEW_UNSPECIFIED') # @return [ListPromotionsResponse] def list_promotions(collection_id, opts = {}) data, _status_code, _headers = list_promotions_with_http_info(collection_id, opts) @@ -248,7 +249,8 @@ def list_promotions(collection_id, opts = {}) # @param collection_id [String] The collection that owns this set of promotions, e.g. `my-collection`. # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size The maximum number of promotions to return. The service may return fewer than this value. If unspecified, at most 50 promotions are returned. The maximum value is 1000; values above 1000 are coerced to 1000. - # @option opts [String] :page_token A page token, received from a previous [ListPromotions](/api#operation/ListPromotions) call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to [ListPromotions](/api#operation/ListPromotions) must match the call that provided the page token. + # @option opts [String] :page_token A page token, received from a previous [ListPromotions](/docs/api#operation/ListPromotions) call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to [ListPromotions](/docs/api#operation/ListPromotions) must match the call that provided the page token. + # @option opts [String] :view The amount of information to include in each retrieved promotion. - PROMOTION_VIEW_UNSPECIFIED: The default / unset value. The API defaults to the `FULL` view. - BASIC: Include basic information including name, start time and end time, but not detailed information about the promotion effects. - FULL: Returns all information about a promotion. This is the default value. # @return [Array<(ListPromotionsResponse, Integer, Hash)>] ListPromotionsResponse data, response status code and response headers def list_promotions_with_http_info(collection_id, opts = {}) if @api_client.config.debugging @@ -258,6 +260,10 @@ def list_promotions_with_http_info(collection_id, opts = {}) if @api_client.config.client_side_validation && collection_id.nil? fail ArgumentError, "Missing the required parameter 'collection_id' when calling PromotionsApi.list_promotions" end + allowable_values = ["PROMOTION_VIEW_UNSPECIFIED", "BASIC", "FULL"] + if @api_client.config.client_side_validation && opts[:'view'] && !allowable_values.include?(opts[:'view']) + fail ArgumentError, "invalid value for \"view\", must be one of #{allowable_values}" + end # resource path local_var_path = '/v4/collections/{collection_id}/promotions'.sub('{' + 'collection_id' + '}', CGI.escape(collection_id.to_s)) @@ -265,6 +271,7 @@ def list_promotions_with_http_info(collection_id, opts = {}) query_params = opts[:query_params] || {} query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'page_token'] = opts[:'page_token'] if !opts[:'page_token'].nil? + query_params[:'view'] = opts[:'view'] if !opts[:'view'].nil? # header parameters header_params = opts[:header_params] || {} diff --git a/lib/sdk_ruby/api/records_api.rb b/lib/sdk_ruby/api/records_api.rb index bb17bfd..851120d 100644 --- a/lib/sdk_ruby/api/records_api.rb +++ b/lib/sdk_ruby/api/records_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end @@ -20,7 +20,7 @@ def initialize(api_client = ApiClient.default) @api_client = api_client end # Batch update records - # The batch version of the [UpdateRecord](/api#operation/UpdateRecord) call. + # The batch version of the [UpdateRecord](/docs/api#operation/UpdateRecord) call. # @param collection_id [String] The collection that contains the records to update, e.g. `my-collection`. # @param batch_update_records_request [BatchUpdateRecordsRequest] # @param [Hash] opts the optional parameters @@ -31,7 +31,7 @@ def batch_update_records(collection_id, batch_update_records_request, opts = {}) end # Batch update records - # The batch version of the [UpdateRecord](/api#operation/UpdateRecord) call. + # The batch version of the [UpdateRecord](/docs/api#operation/UpdateRecord) call. # @param collection_id [String] The collection that contains the records to update, e.g. `my-collection`. # @param batch_update_records_request [BatchUpdateRecordsRequest] # @param [Hash] opts the optional parameters @@ -94,7 +94,7 @@ def batch_update_records_with_http_info(collection_id, batch_update_records_requ end # Batch upsert records - # The batch version of the [UpsertRecord](/api#operation/UpsertRecord) call. + # The batch version of the [UpsertRecord](/docs/api#operation/UpsertRecord) call. # @param collection_id [String] The collection to upsert the records in, e.g. `my-collection`. # @param batch_upsert_records_request [BatchUpsertRecordsRequest] # @param [Hash] opts the optional parameters @@ -105,7 +105,7 @@ def batch_upsert_records(collection_id, batch_upsert_records_request, opts = {}) end # Batch upsert records - # The batch version of the [UpsertRecord](/api#operation/UpsertRecord) call. + # The batch version of the [UpsertRecord](/docs/api#operation/UpsertRecord) call. # @param collection_id [String] The collection to upsert the records in, e.g. `my-collection`. # @param batch_upsert_records_request [BatchUpsertRecordsRequest] # @param [Hash] opts the optional parameters @@ -316,7 +316,7 @@ def get_record_with_http_info(collection_id, get_record_request, opts = {}) end # Update record - # Add or update specific fields within a record with the given values. The updated record is returned in the response. To replace all fields in a record, you should use the [UpsertRecord](/api#operation/UpsertRecord) call. Note that the update record call cannot be used to add or update indexed or unique fields. For this case use the [UpsertRecord](/api#operation/UpsertRecord) call. + # Add or update specific fields within a record with the given values. The updated record is returned in the response. To replace all fields in a record, you should use the [UpsertRecord](/docs/api#operation/UpsertRecord) call. Note that the update record call cannot be used to add or update indexed or unique fields. For this case use the [UpsertRecord](/docs/api#operation/UpsertRecord) call. # @param collection_id [String] The collection that contains the record to update, e.g. `my-collection`. # @param update_record_request [UpdateRecordRequest] # @param [Hash] opts the optional parameters @@ -327,7 +327,7 @@ def update_record(collection_id, update_record_request, opts = {}) end # Update record - # Add or update specific fields within a record with the given values. The updated record is returned in the response. To replace all fields in a record, you should use the [UpsertRecord](/api#operation/UpsertRecord) call. Note that the update record call cannot be used to add or update indexed or unique fields. For this case use the [UpsertRecord](/api#operation/UpsertRecord) call. + # Add or update specific fields within a record with the given values. The updated record is returned in the response. To replace all fields in a record, you should use the [UpsertRecord](/docs/api#operation/UpsertRecord) call. Note that the update record call cannot be used to add or update indexed or unique fields. For this case use the [UpsertRecord](/docs/api#operation/UpsertRecord) call. # @param collection_id [String] The collection that contains the record to update, e.g. `my-collection`. # @param update_record_request [UpdateRecordRequest] # @param [Hash] opts the optional parameters diff --git a/lib/sdk_ruby/api/redirects_api.rb b/lib/sdk_ruby/api/redirects_api.rb index a6dbc35..2604fe9 100644 --- a/lib/sdk_ruby/api/redirects_api.rb +++ b/lib/sdk_ruby/api/redirects_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end @@ -236,7 +236,7 @@ def get_redirect_with_http_info(collection_id, redirect_id, opts = {}) # @param collection_id [String] The collection that owns this set of redirects, e.g. `my-collection`. # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size The maximum number of redirects to return. The service may return fewer than this value. If unspecified, at most 50 redirects are returned. The maximum value is 1000; values above 1000 are coerced to 1000. - # @option opts [String] :page_token A page token, received from a previous [ListRedirects](/api#operation/ListRedirects) call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to [ListRedirects](/api#operation/ListRedirects) must match the call that provided the page token. + # @option opts [String] :page_token A page token, received from a previous [ListRedirects](/docs/api#operation/ListRedirects) call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to [ListRedirects](/docs/api#operation/ListRedirects) must match the call that provided the page token. # @return [ListRedirectsResponse] def list_redirects(collection_id, opts = {}) data, _status_code, _headers = list_redirects_with_http_info(collection_id, opts) @@ -248,7 +248,7 @@ def list_redirects(collection_id, opts = {}) # @param collection_id [String] The collection that owns this set of redirects, e.g. `my-collection`. # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size The maximum number of redirects to return. The service may return fewer than this value. If unspecified, at most 50 redirects are returned. The maximum value is 1000; values above 1000 are coerced to 1000. - # @option opts [String] :page_token A page token, received from a previous [ListRedirects](/api#operation/ListRedirects) call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to [ListRedirects](/api#operation/ListRedirects) must match the call that provided the page token. + # @option opts [String] :page_token A page token, received from a previous [ListRedirects](/docs/api#operation/ListRedirects) call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to [ListRedirects](/docs/api#operation/ListRedirects) must match the call that provided the page token. # @return [Array<(ListRedirectsResponse, Integer, Hash)>] ListRedirectsResponse data, response status code and response headers def list_redirects_with_http_info(collection_id, opts = {}) if @api_client.config.debugging diff --git a/lib/sdk_ruby/api/schema_api.rb b/lib/sdk_ruby/api/schema_api.rb index 03b5dd9..016723c 100644 --- a/lib/sdk_ruby/api/schema_api.rb +++ b/lib/sdk_ruby/api/schema_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end @@ -20,7 +20,7 @@ def initialize(api_client = ApiClient.default) @api_client = api_client end # Batch create schema fields - # The batch version of the [CreateSchemaField](/api#operation/CreateSchemaField) call. + # The batch version of the [CreateSchemaField](/docs/api#operation/CreateSchemaField) call. # @param collection_id [String] The collection to create the schema fields in, e.g. `my-collection`. # @param batch_create_schema_fields_request [BatchCreateSchemaFieldsRequest] # @param [Hash] opts the optional parameters @@ -31,7 +31,7 @@ def batch_create_schema_fields(collection_id, batch_create_schema_fields_request end # Batch create schema fields - # The batch version of the [CreateSchemaField](/api#operation/CreateSchemaField) call. + # The batch version of the [CreateSchemaField](/docs/api#operation/CreateSchemaField) call. # @param collection_id [String] The collection to create the schema fields in, e.g. `my-collection`. # @param batch_create_schema_fields_request [BatchCreateSchemaFieldsRequest] # @param [Hash] opts the optional parameters @@ -172,7 +172,7 @@ def create_schema_field_with_http_info(collection_id, schema_field, opts = {}) # @param collection_id [String] The collection that owns this set of schema fields, e.g. `my-collection`. # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size The maximum number of schema fields to return. The service may return fewer than this value. If unspecified, at most 50 schema fields are returned. The maximum value is 1000; values above 1000 are coerced to 1000. - # @option opts [String] :page_token A page token, received from a previous [ListSchemaFields](/api#operation/ListSchemaFields) call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to [ListSchemaFields](/api#operation/ListSchemaFields) must match the call that provided the page token. + # @option opts [String] :page_token A page token, received from a previous [ListSchemaFields](/docs/api#operation/ListSchemaFields) call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to [ListSchemaFields](/docs/api#operation/ListSchemaFields) must match the call that provided the page token. # @return [ListSchemaFieldsResponse] def list_schema_fields(collection_id, opts = {}) data, _status_code, _headers = list_schema_fields_with_http_info(collection_id, opts) @@ -184,7 +184,7 @@ def list_schema_fields(collection_id, opts = {}) # @param collection_id [String] The collection that owns this set of schema fields, e.g. `my-collection`. # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size The maximum number of schema fields to return. The service may return fewer than this value. If unspecified, at most 50 schema fields are returned. The maximum value is 1000; values above 1000 are coerced to 1000. - # @option opts [String] :page_token A page token, received from a previous [ListSchemaFields](/api#operation/ListSchemaFields) call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to [ListSchemaFields](/api#operation/ListSchemaFields) must match the call that provided the page token. + # @option opts [String] :page_token A page token, received from a previous [ListSchemaFields](/docs/api#operation/ListSchemaFields) call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to [ListSchemaFields](/docs/api#operation/ListSchemaFields) must match the call that provided the page token. # @return [Array<(ListSchemaFieldsResponse, Integer, Hash)>] ListSchemaFieldsResponse data, response status code and response headers def list_schema_fields_with_http_info(collection_id, opts = {}) if @api_client.config.debugging diff --git a/lib/sdk_ruby/api_client.rb b/lib/sdk_ruby/api_client.rb index c7c88de..bf5fcba 100644 --- a/lib/sdk_ruby/api_client.rb +++ b/lib/sdk_ruby/api_client.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end @@ -31,7 +31,7 @@ class ApiClient # @option config [Configuration] Configuration for initializing the object, default to Configuration.default def initialize(config = Configuration.default) @config = config - @user_agent = "sajari-sdk-ruby-4.3.0" + @user_agent = "sajari-sdk-ruby-5.0.0" @default_headers = { 'Content-Type' => 'application/json', 'User-Agent' => @user_agent diff --git a/lib/sdk_ruby/api_error.rb b/lib/sdk_ruby/api_error.rb index ba5546e..0246e51 100644 --- a/lib/sdk_ruby/api_error.rb +++ b/lib/sdk_ruby/api_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end diff --git a/lib/sdk_ruby/configuration.rb b/lib/sdk_ruby/configuration.rb index c71e84b..64e956c 100644 --- a/lib/sdk_ruby/configuration.rb +++ b/lib/sdk_ruby/configuration.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end diff --git a/lib/sdk_ruby/models/active_promotion.rb b/lib/sdk_ruby/models/active_promotion.rb index 36bcd79..7dbe324 100644 --- a/lib/sdk_ruby/models/active_promotion.rb +++ b/lib/sdk_ruby/models/active_promotion.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end @@ -14,7 +14,7 @@ require 'time' module SajariAPIClient - # ActivePromotion is a promotion that is active for a given search. + # A promotion that is active for a given search. class ActivePromotion # The records that are excluded from the result set by the active promotion. attr_accessor :active_exclusions diff --git a/lib/sdk_ruby/models/banner.rb b/lib/sdk_ruby/models/banner.rb new file mode 100644 index 0000000..2b79418 --- /dev/null +++ b/lib/sdk_ruby/models/banner.rb @@ -0,0 +1,311 @@ +=begin +#Search.io API + +#Search.io offers a search and discovery service with Neuralsearch®, the world's first instant AI search technology. Businesses of all sizes use Search.io to build site search and discovery solutions that maximize e-commerce revenue, optimize on-site customer experience, and scale their online presence. + +The version of the OpenAPI document: v4 +Contact: support@search.io +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.4.0 + +=end + +require 'date' +require 'time' + +module SajariAPIClient + # A synthetic search result that renders as an image. It takes a user to a pre-determined location when clicked. + class Banner + # The description of the banner, displayed in sub-head font. + attr_accessor :description + + # The height the banner occupies in grid cells. + attr_accessor :height + + # The ID of the banner, used to identify clicked banners. + attr_accessor :id + + # The URL of the image used for the banner. + attr_accessor :image_url + + # The 1-based index indicating where the banner appears in search results. + attr_accessor :position + + # The URL to redirect the user to when the banner is clicked. + attr_accessor :target_url + + # The color of the text as a hex code with a # prefix, e.g. #FFCC00 or #FC0. + attr_accessor :text_color + + attr_accessor :text_position + + # The title of the banner, displayed in header font. + attr_accessor :title + + # The width the banner occupies in grid cells. + attr_accessor :width + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'description' => :'description', + :'height' => :'height', + :'id' => :'id', + :'image_url' => :'image_url', + :'position' => :'position', + :'target_url' => :'target_url', + :'text_color' => :'text_color', + :'text_position' => :'text_position', + :'title' => :'title', + :'width' => :'width' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'description' => :'String', + :'height' => :'Integer', + :'id' => :'String', + :'image_url' => :'String', + :'position' => :'Integer', + :'target_url' => :'String', + :'text_color' => :'String', + :'text_position' => :'TextPosition', + :'title' => :'String', + :'width' => :'Integer' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SajariAPIClient::Banner` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SajariAPIClient::Banner`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'height') + self.height = attributes[:'height'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'image_url') + self.image_url = attributes[:'image_url'] + end + + if attributes.key?(:'position') + self.position = attributes[:'position'] + end + + if attributes.key?(:'target_url') + self.target_url = attributes[:'target_url'] + end + + if attributes.key?(:'text_color') + self.text_color = attributes[:'text_color'] + end + + if attributes.key?(:'text_position') + self.text_position = attributes[:'text_position'] + else + self.text_position = 'TEXT_POSITION_UNSPECIFIED' + end + + if attributes.key?(:'title') + self.title = attributes[:'title'] + end + + if attributes.key?(:'width') + self.width = attributes[:'width'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + description == o.description && + height == o.height && + id == o.id && + image_url == o.image_url && + position == o.position && + target_url == o.target_url && + text_color == o.text_color && + text_position == o.text_position && + title == o.title && + width == o.width + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [description, height, id, image_url, position, target_url, text_color, text_position, title, width].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = SajariAPIClient.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/sdk_ruby/models/batch_create_schema_fields_request.rb b/lib/sdk_ruby/models/batch_create_schema_fields_request.rb index e227176..4411673 100644 --- a/lib/sdk_ruby/models/batch_create_schema_fields_request.rb +++ b/lib/sdk_ruby/models/batch_create_schema_fields_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end diff --git a/lib/sdk_ruby/models/batch_create_schema_fields_response.rb b/lib/sdk_ruby/models/batch_create_schema_fields_response.rb index a23487c..243320f 100644 --- a/lib/sdk_ruby/models/batch_create_schema_fields_response.rb +++ b/lib/sdk_ruby/models/batch_create_schema_fields_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end diff --git a/lib/sdk_ruby/models/batch_create_schema_fields_response_error.rb b/lib/sdk_ruby/models/batch_create_schema_fields_response_error.rb index 69f2651..25a7cb4 100644 --- a/lib/sdk_ruby/models/batch_create_schema_fields_response_error.rb +++ b/lib/sdk_ruby/models/batch_create_schema_fields_response_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end diff --git a/lib/sdk_ruby/models/batch_update_records_request.rb b/lib/sdk_ruby/models/batch_update_records_request.rb index c7fb400..afccebf 100644 --- a/lib/sdk_ruby/models/batch_update_records_request.rb +++ b/lib/sdk_ruby/models/batch_update_records_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end diff --git a/lib/sdk_ruby/models/batch_update_records_response.rb b/lib/sdk_ruby/models/batch_update_records_response.rb index 2878522..ea95f3b 100644 --- a/lib/sdk_ruby/models/batch_update_records_response.rb +++ b/lib/sdk_ruby/models/batch_update_records_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end diff --git a/lib/sdk_ruby/models/batch_update_records_response_error.rb b/lib/sdk_ruby/models/batch_update_records_response_error.rb index e36c5fa..7671a3e 100644 --- a/lib/sdk_ruby/models/batch_update_records_response_error.rb +++ b/lib/sdk_ruby/models/batch_update_records_response_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end diff --git a/lib/sdk_ruby/models/batch_update_records_response_record.rb b/lib/sdk_ruby/models/batch_update_records_response_record.rb index e525dc7..039c7ae 100644 --- a/lib/sdk_ruby/models/batch_update_records_response_record.rb +++ b/lib/sdk_ruby/models/batch_update_records_response_record.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end diff --git a/lib/sdk_ruby/models/batch_upsert_records_request.rb b/lib/sdk_ruby/models/batch_upsert_records_request.rb index 288e962..0b24122 100644 --- a/lib/sdk_ruby/models/batch_upsert_records_request.rb +++ b/lib/sdk_ruby/models/batch_upsert_records_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end diff --git a/lib/sdk_ruby/models/batch_upsert_records_request_pipeline.rb b/lib/sdk_ruby/models/batch_upsert_records_request_pipeline.rb index 111e56a..d96c6d0 100644 --- a/lib/sdk_ruby/models/batch_upsert_records_request_pipeline.rb +++ b/lib/sdk_ruby/models/batch_upsert_records_request_pipeline.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end diff --git a/lib/sdk_ruby/models/batch_upsert_records_response.rb b/lib/sdk_ruby/models/batch_upsert_records_response.rb index d3bb69d..66b1201 100644 --- a/lib/sdk_ruby/models/batch_upsert_records_response.rb +++ b/lib/sdk_ruby/models/batch_upsert_records_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end diff --git a/lib/sdk_ruby/models/batch_upsert_records_response_error.rb b/lib/sdk_ruby/models/batch_upsert_records_response_error.rb index 68ce4ac..69b534a 100644 --- a/lib/sdk_ruby/models/batch_upsert_records_response_error.rb +++ b/lib/sdk_ruby/models/batch_upsert_records_response_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end diff --git a/lib/sdk_ruby/models/batch_upsert_records_response_key.rb b/lib/sdk_ruby/models/batch_upsert_records_response_key.rb index c2c3cfb..b050ee9 100644 --- a/lib/sdk_ruby/models/batch_upsert_records_response_key.rb +++ b/lib/sdk_ruby/models/batch_upsert_records_response_key.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end diff --git a/lib/sdk_ruby/models/batch_upsert_records_response_variables.rb b/lib/sdk_ruby/models/batch_upsert_records_response_variables.rb index b3153f2..f847271 100644 --- a/lib/sdk_ruby/models/batch_upsert_records_response_variables.rb +++ b/lib/sdk_ruby/models/batch_upsert_records_response_variables.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end diff --git a/lib/sdk_ruby/models/collection.rb b/lib/sdk_ruby/models/collection.rb index 13773d8..9bd5b5f 100644 --- a/lib/sdk_ruby/models/collection.rb +++ b/lib/sdk_ruby/models/collection.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end @@ -18,7 +18,7 @@ class Collection # Output only. The ID of the account that owns this collection. attr_accessor :account_id - # The list of authorized query domains for the collection. Client-side / browser requests to the [QueryCollection](/api#operation/QueryCollection) call can be made by any authorized query domain or any of its subdomains. This allows your interface to make search requests without having to provide an API key in the client-side request. + # The list of authorized query domains for the collection. Client-side / browser requests to the [QueryCollection](/docs/api#operation/QueryCollection) call can be made by any authorized query domain or any of its subdomains. This allows your interface to make search requests without having to provide an API key in the client-side request. attr_accessor :authorized_query_domains # Output only. Time the collection was created. diff --git a/lib/sdk_ruby/models/delete_record_request.rb b/lib/sdk_ruby/models/delete_record_request.rb index 70c4c63..cab4685 100644 --- a/lib/sdk_ruby/models/delete_record_request.rb +++ b/lib/sdk_ruby/models/delete_record_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end diff --git a/lib/sdk_ruby/models/error.rb b/lib/sdk_ruby/models/error.rb index 31c5b8d..c4ee9c5 100644 --- a/lib/sdk_ruby/models/error.rb +++ b/lib/sdk_ruby/models/error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end diff --git a/lib/sdk_ruby/models/event.rb b/lib/sdk_ruby/models/event.rb new file mode 100644 index 0000000..065e082 --- /dev/null +++ b/lib/sdk_ruby/models/event.rb @@ -0,0 +1,282 @@ +=begin +#Search.io API + +#Search.io offers a search and discovery service with Neuralsearch®, the world's first instant AI search technology. Businesses of all sizes use Search.io to build site search and discovery solutions that maximize e-commerce revenue, optimize on-site customer experience, and scale their online presence. + +The version of the OpenAPI document: v4 +Contact: support@search.io +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.4.0 + +=end + +require 'date' +require 'time' + +module SajariAPIClient + # An analytics event that relates to a query made on a collection. + class Event + # The identifier of the promotion banner the event is about. + attr_accessor :banner_id + + # An object made up of field-value pairs that contains additional metadata to record with the event. + attr_accessor :metadata + + # The query identifier. + attr_accessor :query_id + + # The identifier of the redirect the event is about. + attr_accessor :redirect_id + + # The identifier of the result the event is about. + attr_accessor :result_id + + # The type of event, e.g. `click`, `purchase`, `add_to_cart`. + attr_accessor :type + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'banner_id' => :'banner_id', + :'metadata' => :'metadata', + :'query_id' => :'query_id', + :'redirect_id' => :'redirect_id', + :'result_id' => :'result_id', + :'type' => :'type' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'banner_id' => :'String', + :'metadata' => :'Hash', + :'query_id' => :'String', + :'redirect_id' => :'String', + :'result_id' => :'String', + :'type' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SajariAPIClient::Event` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SajariAPIClient::Event`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'banner_id') + self.banner_id = attributes[:'banner_id'] + end + + if attributes.key?(:'metadata') + if (value = attributes[:'metadata']).is_a?(Hash) + self.metadata = value + end + end + + if attributes.key?(:'query_id') + self.query_id = attributes[:'query_id'] + end + + if attributes.key?(:'redirect_id') + self.redirect_id = attributes[:'redirect_id'] + end + + if attributes.key?(:'result_id') + self.result_id = attributes[:'result_id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @query_id.nil? + invalid_properties.push('invalid value for "query_id", query_id cannot be nil.') + end + + if @type.nil? + invalid_properties.push('invalid value for "type", type cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @query_id.nil? + return false if @type.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + banner_id == o.banner_id && + metadata == o.metadata && + query_id == o.query_id && + redirect_id == o.redirect_id && + result_id == o.result_id && + type == o.type + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [banner_id, metadata, query_id, redirect_id, result_id, type].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = SajariAPIClient.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/sdk_ruby/models/experiment_request.rb b/lib/sdk_ruby/models/experiment_request.rb new file mode 100644 index 0000000..3407157 --- /dev/null +++ b/lib/sdk_ruby/models/experiment_request.rb @@ -0,0 +1,257 @@ +=begin +#Search.io API + +#Search.io offers a search and discovery service with Neuralsearch®, the world's first instant AI search technology. Businesses of all sizes use Search.io to build site search and discovery solutions that maximize e-commerce revenue, optimize on-site customer experience, and scale their online presence. + +The version of the OpenAPI document: v4 +Contact: support@search.io +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.4.0 + +=end + +require 'date' +require 'time' + +module SajariAPIClient + # A request to perform a query experiment on a collection using a pipeline. + class ExperimentRequest + attr_accessor :custom_pipeline + + attr_accessor :pipeline + + # The promotions to consider active when running the search. Provided promotions override existing promotions with the same ID. + attr_accessor :promotions + + # The initial values for the variables the pipeline operates on and transforms throughout its steps. The most important variable is `q` which is the query the user entered, for example: ```json { \"q\": \"search terms\" } ``` To paginate through results, set the variables `page` and `resultsPerPage`, for example: ```json { \"q\": \"search terms\", \"page\": 5, \"resultsPerPage\": 20 } ``` To sort results, set the variable `sort` to the name of one of your collection's schema fields, for example: ```json { \"q\": \"search terms\", \"sort\": \"name\" } ``` To sort in reverse, prefix the schema field with a minus sign `-`, for example: ```json { \"q\": \"search terms\", \"sort\": \"-name\" } ``` + attr_accessor :variables + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'custom_pipeline' => :'custom_pipeline', + :'pipeline' => :'pipeline', + :'promotions' => :'promotions', + :'variables' => :'variables' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'custom_pipeline' => :'Pipeline', + :'pipeline' => :'ExperimentRequestPipeline', + :'promotions' => :'Array', + :'variables' => :'Hash' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SajariAPIClient::ExperimentRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SajariAPIClient::ExperimentRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'custom_pipeline') + self.custom_pipeline = attributes[:'custom_pipeline'] + end + + if attributes.key?(:'pipeline') + self.pipeline = attributes[:'pipeline'] + end + + if attributes.key?(:'promotions') + if (value = attributes[:'promotions']).is_a?(Array) + self.promotions = value + end + end + + if attributes.key?(:'variables') + if (value = attributes[:'variables']).is_a?(Hash) + self.variables = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @variables.nil? + invalid_properties.push('invalid value for "variables", variables cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @variables.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + custom_pipeline == o.custom_pipeline && + pipeline == o.pipeline && + promotions == o.promotions && + variables == o.variables + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [custom_pipeline, pipeline, promotions, variables].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = SajariAPIClient.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/sdk_ruby/models/experiment_request_pipeline.rb b/lib/sdk_ruby/models/experiment_request_pipeline.rb new file mode 100644 index 0000000..3c717a7 --- /dev/null +++ b/lib/sdk_ruby/models/experiment_request_pipeline.rb @@ -0,0 +1,235 @@ +=begin +#Search.io API + +#Search.io offers a search and discovery service with Neuralsearch®, the world's first instant AI search technology. Businesses of all sizes use Search.io to build site search and discovery solutions that maximize e-commerce revenue, optimize on-site customer experience, and scale their online presence. + +The version of the OpenAPI document: v4 +Contact: support@search.io +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.4.0 + +=end + +require 'date' +require 'time' + +module SajariAPIClient + # The pipeline to use when running the experiment. If not provided the default query pipeline is used. + class ExperimentRequestPipeline + # The query pipeline's name, e.g. `my-pipeline`. + attr_accessor :name + + # The query pipeline's version, e.g. `42`. If not provided the default version is used. + attr_accessor :version + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'name' => :'name', + :'version' => :'version' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'name' => :'String', + :'version' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SajariAPIClient::ExperimentRequestPipeline` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SajariAPIClient::ExperimentRequestPipeline`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'version') + self.version = attributes[:'version'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @name.nil? + invalid_properties.push('invalid value for "name", name cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @name.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name && + version == o.version + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [name, version].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = SajariAPIClient.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/sdk_ruby/models/experiment_response.rb b/lib/sdk_ruby/models/experiment_response.rb new file mode 100644 index 0000000..549a4d8 --- /dev/null +++ b/lib/sdk_ruby/models/experiment_response.rb @@ -0,0 +1,218 @@ +=begin +#Search.io API + +#Search.io offers a search and discovery service with Neuralsearch®, the world's first instant AI search technology. Businesses of all sizes use Search.io to build site search and discovery solutions that maximize e-commerce revenue, optimize on-site customer experience, and scale their online presence. + +The version of the OpenAPI document: v4 +Contact: support@search.io +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.4.0 + +=end + +require 'date' +require 'time' + +module SajariAPIClient + class ExperimentResponse + attr_accessor :query_response + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'query_response' => :'query_response' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'query_response' => :'QueryCollectionResponse' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SajariAPIClient::ExperimentResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SajariAPIClient::ExperimentResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'query_response') + self.query_response = attributes[:'query_response'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + query_response == o.query_response + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [query_response].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = SajariAPIClient.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/sdk_ruby/models/generate_pipelines_request.rb b/lib/sdk_ruby/models/generate_pipelines_request.rb index 1b473a2..71f82f3 100644 --- a/lib/sdk_ruby/models/generate_pipelines_request.rb +++ b/lib/sdk_ruby/models/generate_pipelines_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end @@ -15,10 +15,10 @@ module SajariAPIClient class GeneratePipelinesRequest - # List of fields to train query suggestions from. + # A list of fields to train query suggestions from. attr_accessor :query_training_fields - # Prioritized list of fields to search. + # A prioritized list of fields to search. attr_accessor :searchable_fields # Attribute mapping from ruby-style variable name to JSON key. diff --git a/lib/sdk_ruby/models/generate_pipelines_response.rb b/lib/sdk_ruby/models/generate_pipelines_response.rb index e193ee4..c597f94 100644 --- a/lib/sdk_ruby/models/generate_pipelines_response.rb +++ b/lib/sdk_ruby/models/generate_pipelines_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end diff --git a/lib/sdk_ruby/models/get_default_pipeline_response.rb b/lib/sdk_ruby/models/get_default_pipeline_response.rb index f63c707..76f506b 100644 --- a/lib/sdk_ruby/models/get_default_pipeline_response.rb +++ b/lib/sdk_ruby/models/get_default_pipeline_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end diff --git a/lib/sdk_ruby/models/get_default_version_request_view.rb b/lib/sdk_ruby/models/get_default_version_request_view.rb index 0ec6200..c261dcc 100644 --- a/lib/sdk_ruby/models/get_default_version_request_view.rb +++ b/lib/sdk_ruby/models/get_default_version_request_view.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end diff --git a/lib/sdk_ruby/models/get_pipeline_request_view.rb b/lib/sdk_ruby/models/get_pipeline_request_view.rb index b95dbbd..c38ab26 100644 --- a/lib/sdk_ruby/models/get_pipeline_request_view.rb +++ b/lib/sdk_ruby/models/get_pipeline_request_view.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end diff --git a/lib/sdk_ruby/models/get_record_request.rb b/lib/sdk_ruby/models/get_record_request.rb index 27f0ae2..830756c 100644 --- a/lib/sdk_ruby/models/get_record_request.rb +++ b/lib/sdk_ruby/models/get_record_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end diff --git a/lib/sdk_ruby/models/list_collections_response.rb b/lib/sdk_ruby/models/list_collections_response.rb index 837c72b..09ffcef 100644 --- a/lib/sdk_ruby/models/list_collections_response.rb +++ b/lib/sdk_ruby/models/list_collections_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end diff --git a/lib/sdk_ruby/models/list_pipelines_request_view.rb b/lib/sdk_ruby/models/list_pipelines_request_view.rb index 8fafaad..53cfd4a 100644 --- a/lib/sdk_ruby/models/list_pipelines_request_view.rb +++ b/lib/sdk_ruby/models/list_pipelines_request_view.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end diff --git a/lib/sdk_ruby/models/list_pipelines_response.rb b/lib/sdk_ruby/models/list_pipelines_response.rb index 77472bb..9abfffb 100644 --- a/lib/sdk_ruby/models/list_pipelines_response.rb +++ b/lib/sdk_ruby/models/list_pipelines_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end diff --git a/lib/sdk_ruby/models/list_promotions_request_promotion_view.rb b/lib/sdk_ruby/models/list_promotions_request_promotion_view.rb new file mode 100644 index 0000000..a38d70e --- /dev/null +++ b/lib/sdk_ruby/models/list_promotions_request_promotion_view.rb @@ -0,0 +1,38 @@ +=begin +#Search.io API + +#Search.io offers a search and discovery service with Neuralsearch®, the world's first instant AI search technology. Businesses of all sizes use Search.io to build site search and discovery solutions that maximize e-commerce revenue, optimize on-site customer experience, and scale their online presence. + +The version of the OpenAPI document: v4 +Contact: support@search.io +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.4.0 + +=end + +require 'date' +require 'time' + +module SajariAPIClient + class ListPromotionsRequestPromotionView + PROMOTION_VIEW_UNSPECIFIED = "PROMOTION_VIEW_UNSPECIFIED".freeze + BASIC = "BASIC".freeze + FULL = "FULL".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = ListPromotionsRequestPromotionView.constants.select { |c| ListPromotionsRequestPromotionView::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #ListPromotionsRequestPromotionView" if constantValues.empty? + value + end + end +end diff --git a/lib/sdk_ruby/models/list_promotions_response.rb b/lib/sdk_ruby/models/list_promotions_response.rb index 65c2ab1..797670c 100644 --- a/lib/sdk_ruby/models/list_promotions_response.rb +++ b/lib/sdk_ruby/models/list_promotions_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end diff --git a/lib/sdk_ruby/models/list_redirects_response.rb b/lib/sdk_ruby/models/list_redirects_response.rb index 0c238e7..238f7d6 100644 --- a/lib/sdk_ruby/models/list_redirects_response.rb +++ b/lib/sdk_ruby/models/list_redirects_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end diff --git a/lib/sdk_ruby/models/list_schema_fields_response.rb b/lib/sdk_ruby/models/list_schema_fields_response.rb index 9a20737..810f9e6 100644 --- a/lib/sdk_ruby/models/list_schema_fields_response.rb +++ b/lib/sdk_ruby/models/list_schema_fields_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end diff --git a/lib/sdk_ruby/models/percentile_data_point.rb b/lib/sdk_ruby/models/percentile_data_point.rb index 54630fa..4e21fb6 100644 --- a/lib/sdk_ruby/models/percentile_data_point.rb +++ b/lib/sdk_ruby/models/percentile_data_point.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end diff --git a/lib/sdk_ruby/models/pipeline.rb b/lib/sdk_ruby/models/pipeline.rb index adc97e9..7cd0f9c 100644 --- a/lib/sdk_ruby/models/pipeline.rb +++ b/lib/sdk_ruby/models/pipeline.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end diff --git a/lib/sdk_ruby/models/pipeline_step.rb b/lib/sdk_ruby/models/pipeline_step.rb index b9c9966..1f1422f 100644 --- a/lib/sdk_ruby/models/pipeline_step.rb +++ b/lib/sdk_ruby/models/pipeline_step.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end diff --git a/lib/sdk_ruby/models/pipeline_step_param_binding.rb b/lib/sdk_ruby/models/pipeline_step_param_binding.rb index 4038303..5771474 100644 --- a/lib/sdk_ruby/models/pipeline_step_param_binding.rb +++ b/lib/sdk_ruby/models/pipeline_step_param_binding.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end diff --git a/lib/sdk_ruby/models/pipeline_type.rb b/lib/sdk_ruby/models/pipeline_type.rb index 40be233..99aec5d 100644 --- a/lib/sdk_ruby/models/pipeline_type.rb +++ b/lib/sdk_ruby/models/pipeline_type.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end diff --git a/lib/sdk_ruby/models/promotion.rb b/lib/sdk_ruby/models/promotion.rb index e8f2a99..bc6b22f 100644 --- a/lib/sdk_ruby/models/promotion.rb +++ b/lib/sdk_ruby/models/promotion.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end @@ -16,6 +16,9 @@ module SajariAPIClient # Promotion contains a trigger, determining which searches it should be active for, and a list of alterations that should be made to search results when it is active. class Promotion + # The banners that are injected into the result set when the promotion is triggered. + attr_accessor :banners + # Output only. The ID of the collection that owns this promotion. attr_accessor :collection_id @@ -61,6 +64,7 @@ class Promotion # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { + :'banners' => :'banners', :'collection_id' => :'collection_id', :'condition' => :'condition', :'create_time' => :'create_time', @@ -86,6 +90,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { + :'banners' => :'Array', :'collection_id' => :'String', :'condition' => :'String', :'create_time' => :'Time', @@ -124,6 +129,12 @@ def initialize(attributes = {}) h[k.to_sym] = v } + if attributes.key?(:'banners') + if (value = attributes[:'banners']).is_a?(Array) + self.banners = value + end + end + if attributes.key?(:'collection_id') self.collection_id = attributes[:'collection_id'] end @@ -219,6 +230,7 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && + banners == o.banners && collection_id == o.collection_id && condition == o.condition && create_time == o.create_time && @@ -244,7 +256,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [collection_id, condition, create_time, disabled, display_name, end_time, exclusions, filter_boosts, filter_conditions, id, pins, range_boosts, start_time, update_time].hash + [banners, collection_id, condition, create_time, disabled, display_name, end_time, exclusions, filter_boosts, filter_conditions, id, pins, range_boosts, start_time, update_time].hash end # Builds the object from hash diff --git a/lib/sdk_ruby/models/promotion_category.rb b/lib/sdk_ruby/models/promotion_category.rb index f17c40b..6a50dbe 100644 --- a/lib/sdk_ruby/models/promotion_category.rb +++ b/lib/sdk_ruby/models/promotion_category.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end diff --git a/lib/sdk_ruby/models/promotion_exclusion.rb b/lib/sdk_ruby/models/promotion_exclusion.rb index 41d7fda..10313fc 100644 --- a/lib/sdk_ruby/models/promotion_exclusion.rb +++ b/lib/sdk_ruby/models/promotion_exclusion.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end diff --git a/lib/sdk_ruby/models/promotion_filter_boost.rb b/lib/sdk_ruby/models/promotion_filter_boost.rb index 4dd48ee..1fbc853 100644 --- a/lib/sdk_ruby/models/promotion_filter_boost.rb +++ b/lib/sdk_ruby/models/promotion_filter_boost.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end diff --git a/lib/sdk_ruby/models/promotion_filter_condition.rb b/lib/sdk_ruby/models/promotion_filter_condition.rb index 0cb5fc5..c0590ef 100644 --- a/lib/sdk_ruby/models/promotion_filter_condition.rb +++ b/lib/sdk_ruby/models/promotion_filter_condition.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end diff --git a/lib/sdk_ruby/models/promotion_pin.rb b/lib/sdk_ruby/models/promotion_pin.rb index d8abfc6..5735bfd 100644 --- a/lib/sdk_ruby/models/promotion_pin.rb +++ b/lib/sdk_ruby/models/promotion_pin.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end @@ -17,6 +17,8 @@ module SajariAPIClient class PromotionPin attr_accessor :key + attr_accessor :mode + # Position the record should occupy in search results. The top position is position 1. Doesn't need to be contiguous with other pins, i.e. there can be gaps in the pinned set that are filled with organic results. In the case where there are insufficient search results pinned items are collapsed. attr_accessor :position @@ -24,6 +26,7 @@ class PromotionPin def self.attribute_map { :'key' => :'key', + :'mode' => :'mode', :'position' => :'position' } end @@ -37,6 +40,7 @@ def self.acceptable_attributes def self.openapi_types { :'key' => :'RecordKey', + :'mode' => :'PromotionPinMode', :'position' => :'Integer' } end @@ -66,6 +70,12 @@ def initialize(attributes = {}) self.key = attributes[:'key'] end + if attributes.key?(:'mode') + self.mode = attributes[:'mode'] + else + self.mode = 'PIN' + end + if attributes.key?(:'position') self.position = attributes[:'position'] end @@ -90,6 +100,7 @@ def ==(o) return true if self.equal?(o) self.class == o.class && key == o.key && + mode == o.mode && position == o.position end @@ -102,7 +113,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [key, position].hash + [key, mode, position].hash end # Builds the object from hash diff --git a/lib/sdk_ruby/models/promotion_pin_mode.rb b/lib/sdk_ruby/models/promotion_pin_mode.rb new file mode 100644 index 0000000..00387a5 --- /dev/null +++ b/lib/sdk_ruby/models/promotion_pin_mode.rb @@ -0,0 +1,37 @@ +=begin +#Search.io API + +#Search.io offers a search and discovery service with Neuralsearch®, the world's first instant AI search technology. Businesses of all sizes use Search.io to build site search and discovery solutions that maximize e-commerce revenue, optimize on-site customer experience, and scale their online presence. + +The version of the OpenAPI document: v4 +Contact: support@search.io +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.4.0 + +=end + +require 'date' +require 'time' + +module SajariAPIClient + class PromotionPinMode + PIN = "PIN".freeze + PROMOTE = "PROMOTE".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = PromotionPinMode.constants.select { |c| PromotionPinMode::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #PromotionPinMode" if constantValues.empty? + value + end + end +end diff --git a/lib/sdk_ruby/models/promotion_range_boost.rb b/lib/sdk_ruby/models/promotion_range_boost.rb index b94aac6..7e760a4 100644 --- a/lib/sdk_ruby/models/promotion_range_boost.rb +++ b/lib/sdk_ruby/models/promotion_range_boost.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end diff --git a/lib/sdk_ruby/models/protobuf_any.rb b/lib/sdk_ruby/models/protobuf_any.rb index 47d38a5..f34e53e 100644 --- a/lib/sdk_ruby/models/protobuf_any.rb +++ b/lib/sdk_ruby/models/protobuf_any.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end diff --git a/lib/sdk_ruby/models/protobuf_field_mask.rb b/lib/sdk_ruby/models/protobuf_field_mask.rb index 479b227..194dfe4 100644 --- a/lib/sdk_ruby/models/protobuf_field_mask.rb +++ b/lib/sdk_ruby/models/protobuf_field_mask.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end diff --git a/lib/sdk_ruby/models/protobuf_null_value.rb b/lib/sdk_ruby/models/protobuf_null_value.rb index 447c363..7803b81 100644 --- a/lib/sdk_ruby/models/protobuf_null_value.rb +++ b/lib/sdk_ruby/models/protobuf_null_value.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end diff --git a/lib/sdk_ruby/models/query_aggregate_result.rb b/lib/sdk_ruby/models/query_aggregate_result.rb index 80f69b0..db5cd63 100644 --- a/lib/sdk_ruby/models/query_aggregate_result.rb +++ b/lib/sdk_ruby/models/query_aggregate_result.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end diff --git a/lib/sdk_ruby/models/query_aggregate_result_analysis.rb b/lib/sdk_ruby/models/query_aggregate_result_analysis.rb index 3ddc989..feaa290 100644 --- a/lib/sdk_ruby/models/query_aggregate_result_analysis.rb +++ b/lib/sdk_ruby/models/query_aggregate_result_analysis.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end diff --git a/lib/sdk_ruby/models/query_aggregate_result_buckets.rb b/lib/sdk_ruby/models/query_aggregate_result_buckets.rb index 7cbe53e..7c2d3da 100644 --- a/lib/sdk_ruby/models/query_aggregate_result_buckets.rb +++ b/lib/sdk_ruby/models/query_aggregate_result_buckets.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end diff --git a/lib/sdk_ruby/models/query_aggregate_result_buckets_bucket.rb b/lib/sdk_ruby/models/query_aggregate_result_buckets_bucket.rb index 2960a24..3811b70 100644 --- a/lib/sdk_ruby/models/query_aggregate_result_buckets_bucket.rb +++ b/lib/sdk_ruby/models/query_aggregate_result_buckets_bucket.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end diff --git a/lib/sdk_ruby/models/query_aggregate_result_count.rb b/lib/sdk_ruby/models/query_aggregate_result_count.rb index c1bf688..289996e 100644 --- a/lib/sdk_ruby/models/query_aggregate_result_count.rb +++ b/lib/sdk_ruby/models/query_aggregate_result_count.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end diff --git a/lib/sdk_ruby/models/query_aggregate_result_date.rb b/lib/sdk_ruby/models/query_aggregate_result_date.rb index 8bfdfa0..8bf40a4 100644 --- a/lib/sdk_ruby/models/query_aggregate_result_date.rb +++ b/lib/sdk_ruby/models/query_aggregate_result_date.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end diff --git a/lib/sdk_ruby/models/query_aggregate_result_metric.rb b/lib/sdk_ruby/models/query_aggregate_result_metric.rb index d30f3a7..ec13f6a 100644 --- a/lib/sdk_ruby/models/query_aggregate_result_metric.rb +++ b/lib/sdk_ruby/models/query_aggregate_result_metric.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end diff --git a/lib/sdk_ruby/models/query_aggregate_result_percentile.rb b/lib/sdk_ruby/models/query_aggregate_result_percentile.rb index a0d91ba..a41f908 100644 --- a/lib/sdk_ruby/models/query_aggregate_result_percentile.rb +++ b/lib/sdk_ruby/models/query_aggregate_result_percentile.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end diff --git a/lib/sdk_ruby/models/query_collection_request.rb b/lib/sdk_ruby/models/query_collection_request.rb index 051c5df..df4cfb5 100644 --- a/lib/sdk_ruby/models/query_collection_request.rb +++ b/lib/sdk_ruby/models/query_collection_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end diff --git a/lib/sdk_ruby/models/query_collection_request_pipeline.rb b/lib/sdk_ruby/models/query_collection_request_pipeline.rb index 600a307..150bd15 100644 --- a/lib/sdk_ruby/models/query_collection_request_pipeline.rb +++ b/lib/sdk_ruby/models/query_collection_request_pipeline.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end diff --git a/lib/sdk_ruby/models/query_collection_request_tracking.rb b/lib/sdk_ruby/models/query_collection_request_tracking.rb index 2572ac6..4706e8d 100644 --- a/lib/sdk_ruby/models/query_collection_request_tracking.rb +++ b/lib/sdk_ruby/models/query_collection_request_tracking.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end @@ -15,16 +15,16 @@ module SajariAPIClient class QueryCollectionRequestTracking - # Custom values to be included in tracking data. + # A set of custom values to be included in tracking data. attr_accessor :data - # Tracking field used to identify records in the collection. Must be unique schema field. + # The tracking field used to identify records in the collection. Must be unique schema field. attr_accessor :field - # Query ID of the query. If this is empty, then one is generated. + # The query ID of the query. If this is empty, then one is generated. attr_accessor :query_id - # Sequence number of query. + # The sequence number of query. attr_accessor :sequence attr_accessor :type diff --git a/lib/sdk_ruby/models/query_collection_request_tracking_type.rb b/lib/sdk_ruby/models/query_collection_request_tracking_type.rb index 64d55eb..c7c72cc 100644 --- a/lib/sdk_ruby/models/query_collection_request_tracking_type.rb +++ b/lib/sdk_ruby/models/query_collection_request_tracking_type.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end @@ -19,6 +19,7 @@ class QueryCollectionRequestTrackingType NONE = "NONE".freeze CLICK = "CLICK".freeze POS_NEG = "POS_NEG".freeze + EVENT = "EVENT".freeze # Builds the enum from string # @param [String] The enum value in the form of the string diff --git a/lib/sdk_ruby/models/query_collection_response.rb b/lib/sdk_ruby/models/query_collection_response.rb index e914812..97b22d4 100644 --- a/lib/sdk_ruby/models/query_collection_response.rb +++ b/lib/sdk_ruby/models/query_collection_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end @@ -24,6 +24,9 @@ class QueryCollectionResponse # The aggregates returned by the query. attr_accessor :aggregates + # Banners associated with this query. + attr_accessor :banners + # The weight applied to the features in the query, used for analyzing the index, neural and feature components for results. For each result: ``` score = max(index_score, neural_score) * (1 - feature_score_weight) + feature_score * feature_score_weight ``` attr_accessor :feature_score_weight @@ -32,6 +35,9 @@ class QueryCollectionResponse # The total time taken to perform the query. attr_accessor :processing_duration + # The query identifier. This uniqely identifies the specific query it was returned on. This is used to link user interactions with a query. + attr_accessor :query_id + # A mapping of redirects triggered for all possible variations of the query. attr_accessor :redirects @@ -50,9 +56,11 @@ def self.attribute_map :'active_promotions' => :'active_promotions', :'aggregate_filters' => :'aggregate_filters', :'aggregates' => :'aggregates', + :'banners' => :'banners', :'feature_score_weight' => :'feature_score_weight', :'pipeline' => :'pipeline', :'processing_duration' => :'processing_duration', + :'query_id' => :'query_id', :'redirects' => :'redirects', :'results' => :'results', :'total_size' => :'total_size', @@ -71,9 +79,11 @@ def self.openapi_types :'active_promotions' => :'Array', :'aggregate_filters' => :'Hash', :'aggregates' => :'Hash', + :'banners' => :'Array', :'feature_score_weight' => :'Float', :'pipeline' => :'QueryCollectionResponsePipeline', :'processing_duration' => :'String', + :'query_id' => :'String', :'redirects' => :'Hash', :'results' => :'Array', :'total_size' => :'String', @@ -120,6 +130,12 @@ def initialize(attributes = {}) end end + if attributes.key?(:'banners') + if (value = attributes[:'banners']).is_a?(Array) + self.banners = value + end + end + if attributes.key?(:'feature_score_weight') self.feature_score_weight = attributes[:'feature_score_weight'] end @@ -132,6 +148,10 @@ def initialize(attributes = {}) self.processing_duration = attributes[:'processing_duration'] end + if attributes.key?(:'query_id') + self.query_id = attributes[:'query_id'] + end + if attributes.key?(:'redirects') if (value = attributes[:'redirects']).is_a?(Hash) self.redirects = value @@ -176,9 +196,11 @@ def ==(o) active_promotions == o.active_promotions && aggregate_filters == o.aggregate_filters && aggregates == o.aggregates && + banners == o.banners && feature_score_weight == o.feature_score_weight && pipeline == o.pipeline && processing_duration == o.processing_duration && + query_id == o.query_id && redirects == o.redirects && results == o.results && total_size == o.total_size && @@ -194,7 +216,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [active_promotions, aggregate_filters, aggregates, feature_score_weight, pipeline, processing_duration, redirects, results, total_size, variables].hash + [active_promotions, aggregate_filters, aggregates, banners, feature_score_weight, pipeline, processing_duration, query_id, redirects, results, total_size, variables].hash end # Builds the object from hash diff --git a/lib/sdk_ruby/models/query_collection_response_pipeline.rb b/lib/sdk_ruby/models/query_collection_response_pipeline.rb index 02c2846..abd57b9 100644 --- a/lib/sdk_ruby/models/query_collection_response_pipeline.rb +++ b/lib/sdk_ruby/models/query_collection_response_pipeline.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end diff --git a/lib/sdk_ruby/models/query_result.rb b/lib/sdk_ruby/models/query_result.rb index 02a7398..ef9b4e0 100644 --- a/lib/sdk_ruby/models/query_result.rb +++ b/lib/sdk_ruby/models/query_result.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end @@ -15,6 +15,8 @@ module SajariAPIClient class QueryResult + attr_accessor :banner + # The feature score of the result. This is a value between 0 and 1 representing the business-specific ranking of the result as determined by the ranking adjustments. See [Ranking adjustments](https://docs.search.io/documentation/fundamentals/search-settings/ranking-adjustments) for more information. attr_accessor :feature_score @@ -27,6 +29,9 @@ class QueryResult # An object made up of field-value pairs that contains the record data. attr_accessor :record + # The relevance score of the result. This is the best of `index_score` and `neural_score` with any index boosts applied on top. + attr_accessor :relevance_score + # The overall relevance of the result. This is a value between 0 and 1 that combines the index, neural and feature scores. The higher the score the more relevant the result is. attr_accessor :score @@ -35,10 +40,12 @@ class QueryResult # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { + :'banner' => :'banner', :'feature_score' => :'feature_score', :'index_score' => :'index_score', :'neural_score' => :'neural_score', :'record' => :'record', + :'relevance_score' => :'relevance_score', :'score' => :'score', :'token' => :'token' } @@ -52,10 +59,12 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { + :'banner' => :'Banner', :'feature_score' => :'Float', :'index_score' => :'Float', :'neural_score' => :'Float', :'record' => :'Object', + :'relevance_score' => :'Float', :'score' => :'Float', :'token' => :'QueryResultToken' } @@ -82,6 +91,10 @@ def initialize(attributes = {}) h[k.to_sym] = v } + if attributes.key?(:'banner') + self.banner = attributes[:'banner'] + end + if attributes.key?(:'feature_score') self.feature_score = attributes[:'feature_score'] end @@ -98,6 +111,10 @@ def initialize(attributes = {}) self.record = attributes[:'record'] end + if attributes.key?(:'relevance_score') + self.relevance_score = attributes[:'relevance_score'] + end + if attributes.key?(:'score') self.score = attributes[:'score'] end @@ -125,10 +142,12 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && + banner == o.banner && feature_score == o.feature_score && index_score == o.index_score && neural_score == o.neural_score && record == o.record && + relevance_score == o.relevance_score && score == o.score && token == o.token end @@ -142,7 +161,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [feature_score, index_score, neural_score, record, score, token].hash + [banner, feature_score, index_score, neural_score, record, relevance_score, score, token].hash end # Builds the object from hash diff --git a/lib/sdk_ruby/models/query_result_token.rb b/lib/sdk_ruby/models/query_result_token.rb index 94ef47e..f8bbddd 100644 --- a/lib/sdk_ruby/models/query_result_token.rb +++ b/lib/sdk_ruby/models/query_result_token.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end diff --git a/lib/sdk_ruby/models/query_result_token_click.rb b/lib/sdk_ruby/models/query_result_token_click.rb index d63c2d0..bbe2b1c 100644 --- a/lib/sdk_ruby/models/query_result_token_click.rb +++ b/lib/sdk_ruby/models/query_result_token_click.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end diff --git a/lib/sdk_ruby/models/query_result_token_pos_neg.rb b/lib/sdk_ruby/models/query_result_token_pos_neg.rb index df0a9e7..eed9d5f 100644 --- a/lib/sdk_ruby/models/query_result_token_pos_neg.rb +++ b/lib/sdk_ruby/models/query_result_token_pos_neg.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end diff --git a/lib/sdk_ruby/models/record_key.rb b/lib/sdk_ruby/models/record_key.rb index b3305f6..413d360 100644 --- a/lib/sdk_ruby/models/record_key.rb +++ b/lib/sdk_ruby/models/record_key.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end diff --git a/lib/sdk_ruby/models/redirect.rb b/lib/sdk_ruby/models/redirect.rb index d004913..fcf46c4 100644 --- a/lib/sdk_ruby/models/redirect.rb +++ b/lib/sdk_ruby/models/redirect.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end diff --git a/lib/sdk_ruby/models/redirect_result.rb b/lib/sdk_ruby/models/redirect_result.rb index b86805c..cbe8a8b 100644 --- a/lib/sdk_ruby/models/redirect_result.rb +++ b/lib/sdk_ruby/models/redirect_result.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end @@ -14,7 +14,7 @@ require 'time' module SajariAPIClient - # RedirectResult indicates that a redirect has been triggered for a given query. + # Indicates that a redirect has been triggered for a given query. class RedirectResult # The redirect's ID. attr_accessor :id diff --git a/lib/sdk_ruby/models/schema_field.rb b/lib/sdk_ruby/models/schema_field.rb index 4ee10ee..74d523a 100644 --- a/lib/sdk_ruby/models/schema_field.rb +++ b/lib/sdk_ruby/models/schema_field.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end diff --git a/lib/sdk_ruby/models/schema_field_mode.rb b/lib/sdk_ruby/models/schema_field_mode.rb index 1cae311..9d5d6b9 100644 --- a/lib/sdk_ruby/models/schema_field_mode.rb +++ b/lib/sdk_ruby/models/schema_field_mode.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end diff --git a/lib/sdk_ruby/models/schema_field_type.rb b/lib/sdk_ruby/models/schema_field_type.rb index b874a2c..e00897d 100644 --- a/lib/sdk_ruby/models/schema_field_type.rb +++ b/lib/sdk_ruby/models/schema_field_type.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end diff --git a/lib/sdk_ruby/models/send_event_request.rb b/lib/sdk_ruby/models/send_event_request.rb index 23451b6..5158869 100644 --- a/lib/sdk_ruby/models/send_event_request.rb +++ b/lib/sdk_ruby/models/send_event_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end diff --git a/lib/sdk_ruby/models/set_default_pipeline_request.rb b/lib/sdk_ruby/models/set_default_pipeline_request.rb index e798a57..0ffbfc9 100644 --- a/lib/sdk_ruby/models/set_default_pipeline_request.rb +++ b/lib/sdk_ruby/models/set_default_pipeline_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end diff --git a/lib/sdk_ruby/models/set_default_version_request.rb b/lib/sdk_ruby/models/set_default_version_request.rb index 2552ded..6abbe3f 100644 --- a/lib/sdk_ruby/models/set_default_version_request.rb +++ b/lib/sdk_ruby/models/set_default_version_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end diff --git a/lib/sdk_ruby/models/status.rb b/lib/sdk_ruby/models/status.rb index 405e995..d77c22d 100644 --- a/lib/sdk_ruby/models/status.rb +++ b/lib/sdk_ruby/models/status.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end diff --git a/lib/sdk_ruby/models/text_position.rb b/lib/sdk_ruby/models/text_position.rb new file mode 100644 index 0000000..0db4ebd --- /dev/null +++ b/lib/sdk_ruby/models/text_position.rb @@ -0,0 +1,41 @@ +=begin +#Search.io API + +#Search.io offers a search and discovery service with Neuralsearch®, the world's first instant AI search technology. Businesses of all sizes use Search.io to build site search and discovery solutions that maximize e-commerce revenue, optimize on-site customer experience, and scale their online presence. + +The version of the OpenAPI document: v4 +Contact: support@search.io +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.4.0 + +=end + +require 'date' +require 'time' + +module SajariAPIClient + class TextPosition + UNSPECIFIED = "TEXT_POSITION_UNSPECIFIED".freeze + CENTER = "TEXT_POSITION_CENTER".freeze + TOP_LEFT = "TEXT_POSITION_TOP_LEFT".freeze + TOP_RIGHT = "TEXT_POSITION_TOP_RIGHT".freeze + BOTTOM_LEFT = "TEXT_POSITION_BOTTOM_LEFT".freeze + BOTTOM_RIGHT = "TEXT_POSITION_BOTTOM_RIGHT".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = TextPosition.constants.select { |c| TextPosition::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #TextPosition" if constantValues.empty? + value + end + end +end diff --git a/lib/sdk_ruby/models/update_record_request.rb b/lib/sdk_ruby/models/update_record_request.rb index cf6e506..284ab63 100644 --- a/lib/sdk_ruby/models/update_record_request.rb +++ b/lib/sdk_ruby/models/update_record_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end diff --git a/lib/sdk_ruby/models/upsert_record_request.rb b/lib/sdk_ruby/models/upsert_record_request.rb index 1063578..1d5e007 100644 --- a/lib/sdk_ruby/models/upsert_record_request.rb +++ b/lib/sdk_ruby/models/upsert_record_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end diff --git a/lib/sdk_ruby/models/upsert_record_request_pipeline.rb b/lib/sdk_ruby/models/upsert_record_request_pipeline.rb index 98455a5..eebd2b7 100644 --- a/lib/sdk_ruby/models/upsert_record_request_pipeline.rb +++ b/lib/sdk_ruby/models/upsert_record_request_pipeline.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end diff --git a/lib/sdk_ruby/models/upsert_record_response.rb b/lib/sdk_ruby/models/upsert_record_response.rb index 87863df..39a1d8c 100644 --- a/lib/sdk_ruby/models/upsert_record_response.rb +++ b/lib/sdk_ruby/models/upsert_record_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end diff --git a/lib/sdk_ruby/version.rb b/lib/sdk_ruby/version.rb index 12b13d6..13eaad5 100644 --- a/lib/sdk_ruby/version.rb +++ b/lib/sdk_ruby/version.rb @@ -6,10 +6,10 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end module SajariAPIClient - VERSION = '4.3.0' + VERSION = '5.0.0' end diff --git a/sdk_ruby.gemspec b/sdk_ruby.gemspec index 8b21e11..3a87ce0 100644 --- a/sdk_ruby.gemspec +++ b/sdk_ruby.gemspec @@ -8,7 +8,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end diff --git a/spec/api_client_spec.rb b/spec/api_client_spec.rb index 4cc24f8..36b96ff 100644 --- a/spec/api_client_spec.rb +++ b/spec/api_client_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end diff --git a/spec/configuration_spec.rb b/spec/configuration_spec.rb index 30fae15..539eb14 100644 --- a/spec/configuration_spec.rb +++ b/spec/configuration_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end diff --git a/spec/models/banner_spec.rb b/spec/models/banner_spec.rb new file mode 100644 index 0000000..c950b21 --- /dev/null +++ b/spec/models/banner_spec.rb @@ -0,0 +1,88 @@ +=begin +#Search.io API + +#Search.io offers a search and discovery service with Neuralsearch®, the world's first instant AI search technology. Businesses of all sizes use Search.io to build site search and discovery solutions that maximize e-commerce revenue, optimize on-site customer experience, and scale their online presence. + +The version of the OpenAPI document: v4 +Contact: support@search.io +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.4.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for SajariAPIClient::Banner +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe SajariAPIClient::Banner do + let(:instance) { SajariAPIClient::Banner.new } + + describe 'test an instance of Banner' do + it 'should create an instance of Banner' do + expect(instance).to be_instance_of(SajariAPIClient::Banner) + end + end + describe 'test attribute "description"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "height"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "image_url"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "position"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "target_url"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "text_color"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "text_position"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "title"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "width"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/event_spec.rb b/spec/models/event_spec.rb new file mode 100644 index 0000000..6895739 --- /dev/null +++ b/spec/models/event_spec.rb @@ -0,0 +1,64 @@ +=begin +#Search.io API + +#Search.io offers a search and discovery service with Neuralsearch®, the world's first instant AI search technology. Businesses of all sizes use Search.io to build site search and discovery solutions that maximize e-commerce revenue, optimize on-site customer experience, and scale their online presence. + +The version of the OpenAPI document: v4 +Contact: support@search.io +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.4.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for SajariAPIClient::Event +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe SajariAPIClient::Event do + let(:instance) { SajariAPIClient::Event.new } + + describe 'test an instance of Event' do + it 'should create an instance of Event' do + expect(instance).to be_instance_of(SajariAPIClient::Event) + end + end + describe 'test attribute "banner_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "metadata"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "query_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "redirect_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "result_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/experiment_request_pipeline_spec.rb b/spec/models/experiment_request_pipeline_spec.rb new file mode 100644 index 0000000..57677af --- /dev/null +++ b/spec/models/experiment_request_pipeline_spec.rb @@ -0,0 +1,40 @@ +=begin +#Search.io API + +#Search.io offers a search and discovery service with Neuralsearch®, the world's first instant AI search technology. Businesses of all sizes use Search.io to build site search and discovery solutions that maximize e-commerce revenue, optimize on-site customer experience, and scale their online presence. + +The version of the OpenAPI document: v4 +Contact: support@search.io +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.4.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for SajariAPIClient::ExperimentRequestPipeline +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe SajariAPIClient::ExperimentRequestPipeline do + let(:instance) { SajariAPIClient::ExperimentRequestPipeline.new } + + describe 'test an instance of ExperimentRequestPipeline' do + it 'should create an instance of ExperimentRequestPipeline' do + expect(instance).to be_instance_of(SajariAPIClient::ExperimentRequestPipeline) + end + end + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "version"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/experiment_request_spec.rb b/spec/models/experiment_request_spec.rb new file mode 100644 index 0000000..1680bbf --- /dev/null +++ b/spec/models/experiment_request_spec.rb @@ -0,0 +1,52 @@ +=begin +#Search.io API + +#Search.io offers a search and discovery service with Neuralsearch®, the world's first instant AI search technology. Businesses of all sizes use Search.io to build site search and discovery solutions that maximize e-commerce revenue, optimize on-site customer experience, and scale their online presence. + +The version of the OpenAPI document: v4 +Contact: support@search.io +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.4.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for SajariAPIClient::ExperimentRequest +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe SajariAPIClient::ExperimentRequest do + let(:instance) { SajariAPIClient::ExperimentRequest.new } + + describe 'test an instance of ExperimentRequest' do + it 'should create an instance of ExperimentRequest' do + expect(instance).to be_instance_of(SajariAPIClient::ExperimentRequest) + end + end + describe 'test attribute "custom_pipeline"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "pipeline"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "promotions"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "variables"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/experiment_response_spec.rb b/spec/models/experiment_response_spec.rb new file mode 100644 index 0000000..6ad9b1c --- /dev/null +++ b/spec/models/experiment_response_spec.rb @@ -0,0 +1,34 @@ +=begin +#Search.io API + +#Search.io offers a search and discovery service with Neuralsearch®, the world's first instant AI search technology. Businesses of all sizes use Search.io to build site search and discovery solutions that maximize e-commerce revenue, optimize on-site customer experience, and scale their online presence. + +The version of the OpenAPI document: v4 +Contact: support@search.io +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.4.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for SajariAPIClient::ExperimentResponse +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe SajariAPIClient::ExperimentResponse do + let(:instance) { SajariAPIClient::ExperimentResponse.new } + + describe 'test an instance of ExperimentResponse' do + it 'should create an instance of ExperimentResponse' do + expect(instance).to be_instance_of(SajariAPIClient::ExperimentResponse) + end + end + describe 'test attribute "query_response"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/list_promotions_request_promotion_view_spec.rb b/spec/models/list_promotions_request_promotion_view_spec.rb new file mode 100644 index 0000000..0f52d1e --- /dev/null +++ b/spec/models/list_promotions_request_promotion_view_spec.rb @@ -0,0 +1,28 @@ +=begin +#Search.io API + +#Search.io offers a search and discovery service with Neuralsearch®, the world's first instant AI search technology. Businesses of all sizes use Search.io to build site search and discovery solutions that maximize e-commerce revenue, optimize on-site customer experience, and scale their online presence. + +The version of the OpenAPI document: v4 +Contact: support@search.io +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.4.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for SajariAPIClient::ListPromotionsRequestPromotionView +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe SajariAPIClient::ListPromotionsRequestPromotionView do + let(:instance) { SajariAPIClient::ListPromotionsRequestPromotionView.new } + + describe 'test an instance of ListPromotionsRequestPromotionView' do + it 'should create an instance of ListPromotionsRequestPromotionView' do + expect(instance).to be_instance_of(SajariAPIClient::ListPromotionsRequestPromotionView) + end + end +end diff --git a/spec/models/promotion_pin_mode_spec.rb b/spec/models/promotion_pin_mode_spec.rb new file mode 100644 index 0000000..b1ca0a0 --- /dev/null +++ b/spec/models/promotion_pin_mode_spec.rb @@ -0,0 +1,28 @@ +=begin +#Search.io API + +#Search.io offers a search and discovery service with Neuralsearch®, the world's first instant AI search technology. Businesses of all sizes use Search.io to build site search and discovery solutions that maximize e-commerce revenue, optimize on-site customer experience, and scale their online presence. + +The version of the OpenAPI document: v4 +Contact: support@search.io +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.4.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for SajariAPIClient::PromotionPinMode +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe SajariAPIClient::PromotionPinMode do + let(:instance) { SajariAPIClient::PromotionPinMode.new } + + describe 'test an instance of PromotionPinMode' do + it 'should create an instance of PromotionPinMode' do + expect(instance).to be_instance_of(SajariAPIClient::PromotionPinMode) + end + end +end diff --git a/spec/models/text_position_spec.rb b/spec/models/text_position_spec.rb new file mode 100644 index 0000000..ac55ca8 --- /dev/null +++ b/spec/models/text_position_spec.rb @@ -0,0 +1,28 @@ +=begin +#Search.io API + +#Search.io offers a search and discovery service with Neuralsearch®, the world's first instant AI search technology. Businesses of all sizes use Search.io to build site search and discovery solutions that maximize e-commerce revenue, optimize on-site customer experience, and scale their online presence. + +The version of the OpenAPI document: v4 +Contact: support@search.io +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.4.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for SajariAPIClient::TextPosition +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe SajariAPIClient::TextPosition do + let(:instance) { SajariAPIClient::TextPosition.new } + + describe 'test an instance of TextPosition' do + it 'should create an instance of TextPosition' do + expect(instance).to be_instance_of(SajariAPIClient::TextPosition) + end + end +end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 17b0d77..86815f1 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: v4 Contact: support@search.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0 =end