From 0660880ad93705cc6c26c3108f5dc70652a6da33 Mon Sep 17 00:00:00 2001 From: Jessica Date: Wed, 4 May 2022 17:16:09 +1000 Subject: [PATCH] add support for update and delete schema field (#4) --- .openapi-generator/FILES | 17 +- README.md | 18 ++- docs/Collection.md | 2 +- docs/CollectionType.md | 15 ++ docs/CollectionsApi.md | 48 ++++-- docs/Event.md | 2 +- docs/EventsApi.md | 4 +- docs/GetCollectionRequestView.md | 15 ++ docs/ListCollectionsRequestView.md | 15 ++ docs/PipelinesApi.md | 18 ++- docs/Promotion.md | 2 +- docs/PromotionFilterCondition.md | 2 +- docs/PromotionsApi.md | 50 ++++-- docs/RedirectsApi.md | 50 ++++-- docs/SchemaApi.md | 152 ++++++++++++++++++ docs/SendEventRequest.md | 2 +- generate/Dockerfile.generate | 2 +- generate/generate.sh | 2 +- lib/sdk_ruby.rb | 3 + lib/sdk_ruby/api/collections_api.rb | 33 +++- lib/sdk_ruby/api/events_api.rb | 8 +- lib/sdk_ruby/api/pipelines_api.rb | 12 ++ lib/sdk_ruby/api/promotions_api.rb | 15 ++ lib/sdk_ruby/api/redirects_api.rb | 15 ++ lib/sdk_ruby/api/schema_api.rb | 152 ++++++++++++++++++ lib/sdk_ruby/api_client.rb | 2 +- lib/sdk_ruby/models/collection.rb | 2 +- lib/sdk_ruby/models/collection_type.rb | 39 +++++ lib/sdk_ruby/models/event.rb | 2 +- .../models/get_collection_request_view.rb | 38 +++++ .../models/list_collections_request_view.rb | 38 +++++ lib/sdk_ruby/models/promotion.rb | 2 +- .../models/promotion_filter_condition.rb | 4 +- lib/sdk_ruby/models/send_event_request.rb | 2 +- lib/sdk_ruby/version.rb | 2 +- spec/models/collection_type_spec.rb | 28 ++++ .../get_collection_request_view_spec.rb | 28 ++++ .../list_collections_request_view_spec.rb | 28 ++++ 38 files changed, 783 insertions(+), 86 deletions(-) create mode 100644 docs/CollectionType.md create mode 100644 docs/GetCollectionRequestView.md create mode 100644 docs/ListCollectionsRequestView.md create mode 100644 lib/sdk_ruby/models/collection_type.rb create mode 100644 lib/sdk_ruby/models/get_collection_request_view.rb create mode 100644 lib/sdk_ruby/models/list_collections_request_view.rb create mode 100644 spec/models/collection_type_spec.rb create mode 100644 spec/models/get_collection_request_view_spec.rb create mode 100644 spec/models/list_collections_request_view_spec.rb diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 243dd0e..0af0772 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -20,6 +20,7 @@ docs/BatchUpsertRecordsResponseError.md docs/BatchUpsertRecordsResponseKey.md docs/BatchUpsertRecordsResponseVariables.md docs/Collection.md +docs/CollectionType.md docs/CollectionsApi.md docs/DeleteRecordRequest.md docs/Error.md @@ -30,10 +31,12 @@ docs/ExperimentRequestPipeline.md docs/ExperimentResponse.md docs/GeneratePipelinesRequest.md docs/GeneratePipelinesResponse.md +docs/GetCollectionRequestView.md docs/GetDefaultPipelineResponse.md docs/GetDefaultVersionRequestView.md docs/GetPipelineRequestView.md docs/GetRecordRequest.md +docs/ListCollectionsRequestView.md docs/ListCollectionsResponse.md docs/ListPipelinesRequestView.md docs/ListPipelinesResponse.md @@ -122,6 +125,7 @@ lib/sdk_ruby/models/batch_upsert_records_response_error.rb lib/sdk_ruby/models/batch_upsert_records_response_key.rb lib/sdk_ruby/models/batch_upsert_records_response_variables.rb lib/sdk_ruby/models/collection.rb +lib/sdk_ruby/models/collection_type.rb lib/sdk_ruby/models/delete_record_request.rb lib/sdk_ruby/models/error.rb lib/sdk_ruby/models/event.rb @@ -130,10 +134,12 @@ 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_collection_request_view.rb lib/sdk_ruby/models/get_default_pipeline_response.rb lib/sdk_ruby/models/get_default_version_request_view.rb lib/sdk_ruby/models/get_pipeline_request_view.rb lib/sdk_ruby/models/get_record_request.rb +lib/sdk_ruby/models/list_collections_request_view.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 @@ -194,12 +200,7 @@ lib/sdk_ruby/version.rb sdk_ruby.gemspec spec/api_client_spec.rb spec/configuration_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/models/collection_type_spec.rb +spec/models/get_collection_request_view_spec.rb +spec/models/list_collections_request_view_spec.rb spec/spec_helper.rb diff --git a/README.md b/README.md index 6f41108..420246a 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: 5.0.0 +- Package version: 5.1.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-5.0.0.gem +gem install ./sdk_ruby-5.1.0.gem ``` -(for development, run `gem install --dev ./sdk_ruby-5.0.0.gem` to install the development dependencies) +(for development, run `gem install --dev ./sdk_ruby-5.1.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', '~> 5.0.0' + gem 'sdk_ruby', '~> 5.1.0' ### Install from Git @@ -67,10 +67,13 @@ end api_instance = SajariAPIClient::CollectionsApi.new collection_id = 'collection_id_example' # String | The ID to use for the collection. This must start with an alphanumeric character followed by one or more alphanumeric or `-` characters. Strictly speaking, it must match the regular expression: `^[A-Za-z][A-Za-z0-9\\-]*$`. collection = SajariAPIClient::Collection.new({display_name: 'display_name_example'}) # Collection | Details of the collection to create. +opts = { + account_id: 'account_id_example' # String | The account that owns the collection, e.g. `1618535966441231024`. +} begin #Create collection - result = api_instance.create_collection(collection_id, collection) + result = api_instance.create_collection(collection_id, collection, opts) p result rescue SajariAPIClient::ApiError => e puts "Exception when calling CollectionsApi->create_collection: #{e}" @@ -121,7 +124,9 @@ Class | Method | HTTP request | Description *SajariAPIClient::RedirectsApi* | [**update_redirect**](docs/RedirectsApi.md#update_redirect) | **PATCH** /v4/collections/{collection_id}/redirects/{redirect_id} | Update redirect *SajariAPIClient::SchemaApi* | [**batch_create_schema_fields**](docs/SchemaApi.md#batch_create_schema_fields) | **POST** /v4/collections/{collection_id}/schemaFields:batchCreate | Batch create schema fields *SajariAPIClient::SchemaApi* | [**create_schema_field**](docs/SchemaApi.md#create_schema_field) | **POST** /v4/collections/{collection_id}/schemaFields | Create schema field +*SajariAPIClient::SchemaApi* | [**delete_schema_field**](docs/SchemaApi.md#delete_schema_field) | **DELETE** /v4/collections/{collection_id}/schemaFields/{schema_field_name} | Delete schema field *SajariAPIClient::SchemaApi* | [**list_schema_fields**](docs/SchemaApi.md#list_schema_fields) | **GET** /v4/collections/{collection_id}/schemaFields | List schema fields +*SajariAPIClient::SchemaApi* | [**update_schema_field**](docs/SchemaApi.md#update_schema_field) | **PATCH** /v4/collections/{collection_id}/schemaFields/{schema_field_name} | Update schema field ## Documentation for Models @@ -142,6 +147,7 @@ Class | Method | HTTP request | Description - [SajariAPIClient::BatchUpsertRecordsResponseKey](docs/BatchUpsertRecordsResponseKey.md) - [SajariAPIClient::BatchUpsertRecordsResponseVariables](docs/BatchUpsertRecordsResponseVariables.md) - [SajariAPIClient::Collection](docs/Collection.md) + - [SajariAPIClient::CollectionType](docs/CollectionType.md) - [SajariAPIClient::DeleteRecordRequest](docs/DeleteRecordRequest.md) - [SajariAPIClient::Error](docs/Error.md) - [SajariAPIClient::Event](docs/Event.md) @@ -150,10 +156,12 @@ Class | Method | HTTP request | Description - [SajariAPIClient::ExperimentResponse](docs/ExperimentResponse.md) - [SajariAPIClient::GeneratePipelinesRequest](docs/GeneratePipelinesRequest.md) - [SajariAPIClient::GeneratePipelinesResponse](docs/GeneratePipelinesResponse.md) + - [SajariAPIClient::GetCollectionRequestView](docs/GetCollectionRequestView.md) - [SajariAPIClient::GetDefaultPipelineResponse](docs/GetDefaultPipelineResponse.md) - [SajariAPIClient::GetDefaultVersionRequestView](docs/GetDefaultVersionRequestView.md) - [SajariAPIClient::GetPipelineRequestView](docs/GetPipelineRequestView.md) - [SajariAPIClient::GetRecordRequest](docs/GetRecordRequest.md) + - [SajariAPIClient::ListCollectionsRequestView](docs/ListCollectionsRequestView.md) - [SajariAPIClient::ListCollectionsResponse](docs/ListCollectionsResponse.md) - [SajariAPIClient::ListPipelinesRequestView](docs/ListPipelinesRequestView.md) - [SajariAPIClient::ListPipelinesResponse](docs/ListPipelinesResponse.md) diff --git a/docs/Collection.md b/docs/Collection.md index cdcf62a..b5491fb 100644 --- a/docs/Collection.md +++ b/docs/Collection.md @@ -6,7 +6,7 @@ | ---- | ---- | ----------- | ----- | | **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](/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] | +| **create_time** | **Time** | Output only. The 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/CollectionType.md b/docs/CollectionType.md new file mode 100644 index 0000000..6b4d989 --- /dev/null +++ b/docs/CollectionType.md @@ -0,0 +1,15 @@ +# SajariAPIClient::CollectionType + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + +## Example + +```ruby +require 'sdk_ruby' + +instance = SajariAPIClient::CollectionType.new() +``` + diff --git a/docs/CollectionsApi.md b/docs/CollectionsApi.md index 4bfd9ff..2976d1d 100644 --- a/docs/CollectionsApi.md +++ b/docs/CollectionsApi.md @@ -17,7 +17,7 @@ All URIs are relative to *https://api.search.io* ## create_collection -> create_collection(collection_id, collection) +> create_collection(collection_id, collection, opts) Create collection @@ -38,10 +38,13 @@ end api_instance = SajariAPIClient::CollectionsApi.new collection_id = 'collection_id_example' # String | The ID to use for the collection. This must start with an alphanumeric character followed by one or more alphanumeric or `-` characters. Strictly speaking, it must match the regular expression: `^[A-Za-z][A-Za-z0-9\\-]*$`. collection = SajariAPIClient::Collection.new({display_name: 'display_name_example'}) # Collection | Details of the collection to create. +opts = { + account_id: 'account_id_example' # String | The account that owns the collection, e.g. `1618535966441231024`. +} begin # Create collection - result = api_instance.create_collection(collection_id, collection) + result = api_instance.create_collection(collection_id, collection, opts) p result rescue SajariAPIClient::ApiError => e puts "Error when calling CollectionsApi->create_collection: #{e}" @@ -52,12 +55,12 @@ end This returns an Array which contains the response data, status code and headers. -> , Integer, Hash)> create_collection_with_http_info(collection_id, collection) +> , Integer, Hash)> create_collection_with_http_info(collection_id, collection, opts) ```ruby begin # Create collection - data, status_code, headers = api_instance.create_collection_with_http_info(collection_id, collection) + data, status_code, headers = api_instance.create_collection_with_http_info(collection_id, collection, opts) p status_code # => 2xx p headers # => { ... } p data # => @@ -72,6 +75,7 @@ end | ---- | ---- | ----------- | ----- | | **collection_id** | **String** | The ID to use for the collection. This must start with an alphanumeric character followed by one or more alphanumeric or `-` characters. Strictly speaking, it must match the regular expression: `^[A-Za-z][A-Za-z0-9\\-]*$`. | | | **collection** | [**Collection**](Collection.md) | Details of the collection to create. | | +| **account_id** | **String** | The account that owns the collection, e.g. `1618535966441231024`. | [optional] | ### Return type @@ -89,7 +93,7 @@ end ## delete_collection -> Object delete_collection(collection_id) +> Object delete_collection(collection_id, opts) Delete collection @@ -109,10 +113,13 @@ end api_instance = SajariAPIClient::CollectionsApi.new collection_id = 'collection_id_example' # String | The collection to delete, e.g. `my-collection`. +opts = { + account_id: 'account_id_example' # String | The account that owns the collection, e.g. `1618535966441231024`. +} begin # Delete collection - result = api_instance.delete_collection(collection_id) + result = api_instance.delete_collection(collection_id, opts) p result rescue SajariAPIClient::ApiError => e puts "Error when calling CollectionsApi->delete_collection: #{e}" @@ -123,12 +130,12 @@ end This returns an Array which contains the response data, status code and headers. -> delete_collection_with_http_info(collection_id) +> delete_collection_with_http_info(collection_id, opts) ```ruby begin # Delete collection - data, status_code, headers = api_instance.delete_collection_with_http_info(collection_id) + data, status_code, headers = api_instance.delete_collection_with_http_info(collection_id, opts) p status_code # => 2xx p headers # => { ... } p data # => Object @@ -142,6 +149,7 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | **collection_id** | **String** | The collection to delete, e.g. `my-collection`. | | +| **account_id** | **String** | The account that owns the collection, e.g. `1618535966441231024`. | [optional] | ### Return type @@ -231,7 +239,7 @@ end ## get_collection -> get_collection(collection_id) +> get_collection(collection_id, opts) Get collection @@ -251,10 +259,14 @@ end api_instance = SajariAPIClient::CollectionsApi.new collection_id = 'collection_id_example' # String | The collection to retrieve, e.g. `my-collection`. +opts = { + account_id: 'account_id_example', # String | The account that owns the collection, e.g. `1618535966441231024`. + 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 display name and domains. This is the default value (for both [ListCollections](/docs/api#operation/ListCollections) and [GetCollection](/docs/api#operation/GetCollection)). - FULL: Include the information from `BASIC`, plus full collection details like disk usage. +} begin # Get collection - result = api_instance.get_collection(collection_id) + result = api_instance.get_collection(collection_id, opts) p result rescue SajariAPIClient::ApiError => e puts "Error when calling CollectionsApi->get_collection: #{e}" @@ -265,12 +277,12 @@ end This returns an Array which contains the response data, status code and headers. -> , Integer, Hash)> get_collection_with_http_info(collection_id) +> , Integer, Hash)> get_collection_with_http_info(collection_id, opts) ```ruby begin # Get collection - data, status_code, headers = api_instance.get_collection_with_http_info(collection_id) + data, status_code, headers = api_instance.get_collection_with_http_info(collection_id, opts) p status_code # => 2xx p headers # => { ... } p data # => @@ -284,6 +296,8 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | **collection_id** | **String** | The collection to retrieve, e.g. `my-collection`. | | +| **account_id** | **String** | The account that owns the collection, e.g. `1618535966441231024`. | [optional] | +| **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 display name and domains. This is the default value (for both [ListCollections](/docs/api#operation/ListCollections) and [GetCollection](/docs/api#operation/GetCollection)). - FULL: Include the information from `BASIC`, plus full collection details like disk usage. | [optional][default to 'VIEW_UNSPECIFIED'] | ### Return type @@ -321,8 +335,10 @@ end api_instance = SajariAPIClient::CollectionsApi.new opts = { + account_id: 'account_id_example', # String | The account that owns this set of collections, e.g. `1618535966441231024`. 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](/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. + 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. + view: 'VIEW_UNSPECIFIED' # String | The amount of information to include in each retrieved collection. - VIEW_UNSPECIFIED: The default / unset value. The API defaults to the `BASIC` view. - BASIC: Include basic information including display name and domains. This is the default value (for both [ListCollections](/docs/api#operation/ListCollections) and [GetCollection](/docs/api#operation/GetCollection)). - FULL: Include the information from `BASIC`, plus full collection details like disk usage. } begin @@ -356,8 +372,10 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | +| **account_id** | **String** | The account that owns this set of collections, e.g. `1618535966441231024`. | [optional] | | **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](/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] | +| **view** | **String** | The amount of information to include in each retrieved collection. - VIEW_UNSPECIFIED: The default / unset value. The API defaults to the `BASIC` view. - BASIC: Include basic information including display name and domains. This is the default value (for both [ListCollections](/docs/api#operation/ListCollections) and [GetCollection](/docs/api#operation/GetCollection)). - FULL: Include the information from `BASIC`, plus full collection details like disk usage. | [optional][default to 'VIEW_UNSPECIFIED'] | ### Return type @@ -527,7 +545,7 @@ 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. +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 When tracking redirect events, set `type` to `redirect`. Note: You must pass an `Account-Id` header. ### Examples @@ -619,6 +637,7 @@ api_instance = SajariAPIClient::CollectionsApi.new collection_id = 'collection_id_example' # String | The collection to update, e.g. `my-collection`. collection = SajariAPIClient::Collection.new({display_name: 'display_name_example'}) # Collection | The details of the collection to update. opts = { + account_id: 'account_id_example', # String | The account that owns the collection, e.g. `1618535966441231024`. 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. } @@ -655,6 +674,7 @@ end | ---- | ---- | ----------- | ----- | | **collection_id** | **String** | The collection to update, e.g. `my-collection`. | | | **collection** | [**Collection**](Collection.md) | The details of the collection to update. | | +| **account_id** | **String** | The account that owns the collection, e.g. `1618535966441231024`. | [optional] | | **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 index c6a91af..3f9a7a0 100644 --- a/docs/Event.md +++ b/docs/Event.md @@ -9,7 +9,7 @@ | **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`. | | +| **type** | **String** | The type of event, e.g. `click`, `redirect`, `purchase`, `add_to_cart`. | | ## Example diff --git a/docs/EventsApi.md b/docs/EventsApi.md index 9b5d152..621a461 100644 --- a/docs/EventsApi.md +++ b/docs/EventsApi.md @@ -14,7 +14,7 @@ All URIs are relative to *https://api.search.io* 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\" } } ``` Note: You must pass an `Account-Id` header. +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`, `redirect`, `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\" } } ``` When sending event tokens returned from redirects, set `name` to `redirect`. Note: You must pass an `Account-Id` header. ### Examples @@ -86,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\" } } ``` Note: You must pass an `Account-Id` header. +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`, `redirect`, `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\" } } ``` When sending event tokens returned from redirects, set `name` to `redirect`. Note: You must pass an `Account-Id` header. ### Examples diff --git a/docs/GetCollectionRequestView.md b/docs/GetCollectionRequestView.md new file mode 100644 index 0000000..781f1ed --- /dev/null +++ b/docs/GetCollectionRequestView.md @@ -0,0 +1,15 @@ +# SajariAPIClient::GetCollectionRequestView + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + +## Example + +```ruby +require 'sdk_ruby' + +instance = SajariAPIClient::GetCollectionRequestView.new() +``` + diff --git a/docs/ListCollectionsRequestView.md b/docs/ListCollectionsRequestView.md new file mode 100644 index 0000000..163673b --- /dev/null +++ b/docs/ListCollectionsRequestView.md @@ -0,0 +1,15 @@ +# SajariAPIClient::ListCollectionsRequestView + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + +## Example + +```ruby +require 'sdk_ruby' + +instance = SajariAPIClient::ListCollectionsRequestView.new() +``` + diff --git a/docs/PipelinesApi.md b/docs/PipelinesApi.md index 29fb4c8..4315116 100644 --- a/docs/PipelinesApi.md +++ b/docs/PipelinesApi.md @@ -16,7 +16,7 @@ All URIs are relative to *https://api.search.io* ## create_pipeline -> create_pipeline(collection_id, pipeline) +> create_pipeline(collection_id, pipeline, opts) Create pipeline @@ -37,10 +37,13 @@ end api_instance = SajariAPIClient::PipelinesApi.new collection_id = 'collection_id_example' # String | The collection to create the pipeline in, e.g. `my-collection`. pipeline = SajariAPIClient::Pipeline.new({name: 'name_example', type: SajariAPIClient::PipelineType::TYPE_UNSPECIFIED, version: 'version_example'}) # Pipeline | The pipeline to create. +opts = { + account_id: 'account_id_example' # String | The account that owns the collection, e.g. `1618535966441231024`. +} begin # Create pipeline - result = api_instance.create_pipeline(collection_id, pipeline) + result = api_instance.create_pipeline(collection_id, pipeline, opts) p result rescue SajariAPIClient::ApiError => e puts "Error when calling PipelinesApi->create_pipeline: #{e}" @@ -51,12 +54,12 @@ end This returns an Array which contains the response data, status code and headers. -> , Integer, Hash)> create_pipeline_with_http_info(collection_id, pipeline) +> , Integer, Hash)> create_pipeline_with_http_info(collection_id, pipeline, opts) ```ruby begin # Create pipeline - data, status_code, headers = api_instance.create_pipeline_with_http_info(collection_id, pipeline) + data, status_code, headers = api_instance.create_pipeline_with_http_info(collection_id, pipeline, opts) p status_code # => 2xx p headers # => { ... } p data # => @@ -71,6 +74,7 @@ end | ---- | ---- | ----------- | ----- | | **collection_id** | **String** | The collection to create the pipeline in, e.g. `my-collection`. | | | **pipeline** | [**Pipeline**](Pipeline.md) | The pipeline to create. | | +| **account_id** | **String** | The account that owns the collection, e.g. `1618535966441231024`. | [optional] | ### Return type @@ -255,6 +259,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 = { + account_id: 'account_id_example', # String | The account that owns the collection, e.g. `1618535966441231024`. 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. } @@ -292,6 +297,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`. | | +| **account_id** | **String** | The account that owns the collection, e.g. `1618535966441231024`. | [optional] | | **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,6 +340,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 = { + account_id: 'account_id_example', # String | The account that owns the collection, e.g. `1618535966441231024`. 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. } @@ -372,6 +379,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`. | | +| **account_id** | **String** | The account that owns the collection, e.g. `1618535966441231024`. | [optional] | | **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 @@ -411,6 +419,7 @@ end api_instance = SajariAPIClient::PipelinesApi.new collection_id = 'collection_id_example' # String | The collection that owns this set of pipelines, e.g. `my-collection`. opts = { + account_id: 'account_id_example', # String | The account that owns the collection, e.g. `1618535966441231024`. 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](/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. @@ -448,6 +457,7 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | **collection_id** | **String** | The collection that owns this set of pipelines, e.g. `my-collection`. | | +| **account_id** | **String** | The account that owns the collection, e.g. `1618535966441231024`. | [optional] | | **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](/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'] | diff --git a/docs/Promotion.md b/docs/Promotion.md index d147080..5632465 100644 --- a/docs/Promotion.md +++ b/docs/Promotion.md @@ -13,7 +13,7 @@ | **end_time** | **Time** | If specified, the promotion is considered disabled after this time. | [optional] | | **exclusions** | [**Array<PromotionExclusion>**](PromotionExclusion.md) | The records to exclude from search results, if the promotion is enabled. | [optional] | | **filter_boosts** | [**Array<PromotionFilterBoost>**](PromotionFilterBoost.md) | The filter boosts to apply to searches, if the promotion is enabled. | [optional] | -| **filter_conditions** | [**Array<PromotionFilterCondition>**](PromotionFilterCondition.md) | The conditions applied to the filters passed from the user. A query must match at least one of these in order to trigger the promotion. | [optional] | +| **filter_conditions** | [**Array<PromotionFilterCondition>**](PromotionFilterCondition.md) | The conditions applied to the filters passed from the user. A query must match at least one of these in order to trigger the promotion. A filter condition is comprised of a set of filters of the form `field = value` and matches a query if all of those filters are present in the query. For example, a query with the filter `productType = 'shirt' AND size = 'medium'` triggers a promotion with the filter condition `productType = 'shirt'`, but not one with both `productType = 'shirt', and `size = 'small'`. | [optional] | | **id** | **String** | The promotion's ID. | [optional] | | **pins** | [**Array<PromotionPin>**](PromotionPin.md) | The items to fix to specific positions in the search results. | [optional] | | **range_boosts** | [**Array<PromotionRangeBoost>**](PromotionRangeBoost.md) | The range boosts to apply to searches, if the promotion is enabled. | [optional] | diff --git a/docs/PromotionFilterCondition.md b/docs/PromotionFilterCondition.md index df1482c..49af19e 100644 --- a/docs/PromotionFilterCondition.md +++ b/docs/PromotionFilterCondition.md @@ -4,7 +4,7 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **filter** | **Array<String>** | A filter of the form `field = 'value'`. | [optional] | +| **filter** | **Array<String>** | A filter of the form `field = 'value'`. All of these filters must be present in a query's filter in order for the promotion to be considered active. | [optional] | ## Example diff --git a/docs/PromotionsApi.md b/docs/PromotionsApi.md index 1c290d1..c80472a 100644 --- a/docs/PromotionsApi.md +++ b/docs/PromotionsApi.md @@ -13,7 +13,7 @@ All URIs are relative to *https://api.search.io* ## create_promotion -> create_promotion(collection_id, promotion) +> create_promotion(collection_id, promotion, opts) Create promotion @@ -34,10 +34,13 @@ end api_instance = SajariAPIClient::PromotionsApi.new collection_id = 'collection_id_example' # String | The collection to create a promotion in, e.g. `my-collection`. promotion = SajariAPIClient::Promotion.new({condition: 'condition_example', display_name: 'display_name_example'}) # Promotion | The promotion to create. +opts = { + account_id: 'account_id_example' # String | The account that owns the collection, e.g. `1618535966441231024`. +} begin # Create promotion - result = api_instance.create_promotion(collection_id, promotion) + result = api_instance.create_promotion(collection_id, promotion, opts) p result rescue SajariAPIClient::ApiError => e puts "Error when calling PromotionsApi->create_promotion: #{e}" @@ -48,12 +51,12 @@ end This returns an Array which contains the response data, status code and headers. -> , Integer, Hash)> create_promotion_with_http_info(collection_id, promotion) +> , Integer, Hash)> create_promotion_with_http_info(collection_id, promotion, opts) ```ruby begin # Create promotion - data, status_code, headers = api_instance.create_promotion_with_http_info(collection_id, promotion) + data, status_code, headers = api_instance.create_promotion_with_http_info(collection_id, promotion, opts) p status_code # => 2xx p headers # => { ... } p data # => @@ -68,6 +71,7 @@ end | ---- | ---- | ----------- | ----- | | **collection_id** | **String** | The collection to create a promotion in, e.g. `my-collection`. | | | **promotion** | [**Promotion**](Promotion.md) | The promotion to create. | | +| **account_id** | **String** | The account that owns the collection, e.g. `1618535966441231024`. | [optional] | ### Return type @@ -85,7 +89,7 @@ end ## delete_promotion -> Object delete_promotion(collection_id, promotion_id) +> Object delete_promotion(collection_id, promotion_id, opts) Delete promotion @@ -106,10 +110,13 @@ end api_instance = SajariAPIClient::PromotionsApi.new collection_id = 'collection_id_example' # String | The collection the promotion belongs to, e.g. `my-collection`. promotion_id = 'promotion_id_example' # String | The promotion to delete, e.g. `1234`. +opts = { + account_id: 'account_id_example' # String | The account that owns the collection, e.g. `1618535966441231024`. +} begin # Delete promotion - result = api_instance.delete_promotion(collection_id, promotion_id) + result = api_instance.delete_promotion(collection_id, promotion_id, opts) p result rescue SajariAPIClient::ApiError => e puts "Error when calling PromotionsApi->delete_promotion: #{e}" @@ -120,12 +127,12 @@ end This returns an Array which contains the response data, status code and headers. -> delete_promotion_with_http_info(collection_id, promotion_id) +> delete_promotion_with_http_info(collection_id, promotion_id, opts) ```ruby begin # Delete promotion - data, status_code, headers = api_instance.delete_promotion_with_http_info(collection_id, promotion_id) + data, status_code, headers = api_instance.delete_promotion_with_http_info(collection_id, promotion_id, opts) p status_code # => 2xx p headers # => { ... } p data # => Object @@ -140,6 +147,7 @@ end | ---- | ---- | ----------- | ----- | | **collection_id** | **String** | The collection the promotion belongs to, e.g. `my-collection`. | | | **promotion_id** | **String** | The promotion to delete, e.g. `1234`. | | +| **account_id** | **String** | The account that owns the collection, e.g. `1618535966441231024`. | [optional] | ### Return type @@ -157,7 +165,7 @@ end ## get_promotion -> get_promotion(collection_id, promotion_id) +> get_promotion(collection_id, promotion_id, opts) Get promotion @@ -178,10 +186,13 @@ end api_instance = SajariAPIClient::PromotionsApi.new collection_id = 'collection_id_example' # String | The collection that owns the promotion, e.g. `my-collection`. promotion_id = 'promotion_id_example' # String | The promotion to retrieve, e.g. `1234`. +opts = { + account_id: 'account_id_example' # String | The account that owns the collection, e.g. `1618535966441231024`. +} begin # Get promotion - result = api_instance.get_promotion(collection_id, promotion_id) + result = api_instance.get_promotion(collection_id, promotion_id, opts) p result rescue SajariAPIClient::ApiError => e puts "Error when calling PromotionsApi->get_promotion: #{e}" @@ -192,12 +203,12 @@ end This returns an Array which contains the response data, status code and headers. -> , Integer, Hash)> get_promotion_with_http_info(collection_id, promotion_id) +> , Integer, Hash)> get_promotion_with_http_info(collection_id, promotion_id, opts) ```ruby begin # Get promotion - data, status_code, headers = api_instance.get_promotion_with_http_info(collection_id, promotion_id) + data, status_code, headers = api_instance.get_promotion_with_http_info(collection_id, promotion_id, opts) p status_code # => 2xx p headers # => { ... } p data # => @@ -212,6 +223,7 @@ end | ---- | ---- | ----------- | ----- | | **collection_id** | **String** | The collection that owns the promotion, e.g. `my-collection`. | | | **promotion_id** | **String** | The promotion to retrieve, e.g. `1234`. | | +| **account_id** | **String** | The account that owns the collection, e.g. `1618535966441231024`. | [optional] | ### Return type @@ -250,6 +262,7 @@ end api_instance = SajariAPIClient::PromotionsApi.new collection_id = 'collection_id_example' # String | The collection that owns this set of promotions, e.g. `my-collection`. opts = { + account_id: 'account_id_example', # String | The account that owns the collection, e.g. `1618535966441231024`. 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](/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. @@ -287,6 +300,7 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | **collection_id** | **String** | The collection that owns this set of promotions, e.g. `my-collection`. | | +| **account_id** | **String** | The account that owns the collection, e.g. `1618535966441231024`. | [optional] | | **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](/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'] | @@ -307,7 +321,7 @@ end ## update_promotion -> update_promotion(collection_id, promotion_id, update_mask, promotion) +> update_promotion(collection_id, promotion_id, update_mask, promotion, opts) Update promotion @@ -330,10 +344,13 @@ collection_id = 'collection_id_example' # String | The collection the promotion promotion_id = 'promotion_id_example' # String | The promotion to update, e.g. `1234`. 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`, `filter_boosts`. For each field that you want to update, provide a corresponding value in the promotion object containing the new value. promotion = SajariAPIClient::Promotion.new({condition: 'condition_example', display_name: 'display_name_example'}) # Promotion | Details of the promotion to update. +opts = { + account_id: 'account_id_example' # String | The account that owns the collection, e.g. `1618535966441231024`. +} begin # Update promotion - result = api_instance.update_promotion(collection_id, promotion_id, update_mask, promotion) + result = api_instance.update_promotion(collection_id, promotion_id, update_mask, promotion, opts) p result rescue SajariAPIClient::ApiError => e puts "Error when calling PromotionsApi->update_promotion: #{e}" @@ -344,12 +361,12 @@ end This returns an Array which contains the response data, status code and headers. -> , Integer, Hash)> update_promotion_with_http_info(collection_id, promotion_id, update_mask, promotion) +> , Integer, Hash)> update_promotion_with_http_info(collection_id, promotion_id, update_mask, promotion, opts) ```ruby begin # Update promotion - data, status_code, headers = api_instance.update_promotion_with_http_info(collection_id, promotion_id, update_mask, promotion) + data, status_code, headers = api_instance.update_promotion_with_http_info(collection_id, promotion_id, update_mask, promotion, opts) p status_code # => 2xx p headers # => { ... } p data # => @@ -366,6 +383,7 @@ end | **promotion_id** | **String** | The promotion to update, e.g. `1234`. | | | **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`, `filter_boosts`. For each field that you want to update, provide a corresponding value in the promotion object containing the new value. | | | **promotion** | [**Promotion**](Promotion.md) | Details of the promotion to update. | | +| **account_id** | **String** | The account that owns the collection, e.g. `1618535966441231024`. | [optional] | ### Return type diff --git a/docs/RedirectsApi.md b/docs/RedirectsApi.md index 9d6dbe6..b70b632 100644 --- a/docs/RedirectsApi.md +++ b/docs/RedirectsApi.md @@ -13,7 +13,7 @@ All URIs are relative to *https://api.search.io* ## create_redirect -> create_redirect(collection_id, redirect) +> create_redirect(collection_id, redirect, opts) Create redirect @@ -34,10 +34,13 @@ end api_instance = SajariAPIClient::RedirectsApi.new collection_id = 'collection_id_example' # String | The collection to create a redirect in, e.g. `my-collection`. redirect = SajariAPIClient::Redirect.new({condition: 'condition_example', target: 'target_example'}) # Redirect | The redirect to create. +opts = { + account_id: 'account_id_example' # String | The account that owns the collection, e.g. `1618535966441231024`. +} begin # Create redirect - result = api_instance.create_redirect(collection_id, redirect) + result = api_instance.create_redirect(collection_id, redirect, opts) p result rescue SajariAPIClient::ApiError => e puts "Error when calling RedirectsApi->create_redirect: #{e}" @@ -48,12 +51,12 @@ end This returns an Array which contains the response data, status code and headers. -> , Integer, Hash)> create_redirect_with_http_info(collection_id, redirect) +> , Integer, Hash)> create_redirect_with_http_info(collection_id, redirect, opts) ```ruby begin # Create redirect - data, status_code, headers = api_instance.create_redirect_with_http_info(collection_id, redirect) + data, status_code, headers = api_instance.create_redirect_with_http_info(collection_id, redirect, opts) p status_code # => 2xx p headers # => { ... } p data # => @@ -68,6 +71,7 @@ end | ---- | ---- | ----------- | ----- | | **collection_id** | **String** | The collection to create a redirect in, e.g. `my-collection`. | | | **redirect** | [**Redirect**](Redirect.md) | The redirect to create. | | +| **account_id** | **String** | The account that owns the collection, e.g. `1618535966441231024`. | [optional] | ### Return type @@ -85,7 +89,7 @@ end ## delete_redirect -> Object delete_redirect(collection_id, redirect_id) +> Object delete_redirect(collection_id, redirect_id, opts) Delete redirect @@ -106,10 +110,13 @@ end api_instance = SajariAPIClient::RedirectsApi.new collection_id = 'collection_id_example' # String | The collection the redirect belongs to, e.g. `my-collection`. redirect_id = 'redirect_id_example' # String | The redirect to delete, e.g. `1234`. +opts = { + account_id: 'account_id_example' # String | The account that owns the collection, e.g. `1618535966441231024`. +} begin # Delete redirect - result = api_instance.delete_redirect(collection_id, redirect_id) + result = api_instance.delete_redirect(collection_id, redirect_id, opts) p result rescue SajariAPIClient::ApiError => e puts "Error when calling RedirectsApi->delete_redirect: #{e}" @@ -120,12 +127,12 @@ end This returns an Array which contains the response data, status code and headers. -> delete_redirect_with_http_info(collection_id, redirect_id) +> delete_redirect_with_http_info(collection_id, redirect_id, opts) ```ruby begin # Delete redirect - data, status_code, headers = api_instance.delete_redirect_with_http_info(collection_id, redirect_id) + data, status_code, headers = api_instance.delete_redirect_with_http_info(collection_id, redirect_id, opts) p status_code # => 2xx p headers # => { ... } p data # => Object @@ -140,6 +147,7 @@ end | ---- | ---- | ----------- | ----- | | **collection_id** | **String** | The collection the redirect belongs to, e.g. `my-collection`. | | | **redirect_id** | **String** | The redirect to delete, e.g. `1234`. | | +| **account_id** | **String** | The account that owns the collection, e.g. `1618535966441231024`. | [optional] | ### Return type @@ -157,7 +165,7 @@ end ## get_redirect -> get_redirect(collection_id, redirect_id) +> get_redirect(collection_id, redirect_id, opts) Get redirect @@ -178,10 +186,13 @@ end api_instance = SajariAPIClient::RedirectsApi.new collection_id = 'collection_id_example' # String | The collection that owns the redirect, e.g. `my-collection`. redirect_id = 'redirect_id_example' # String | The redirect to retrieve, e.g. `1234`. +opts = { + account_id: 'account_id_example' # String | The account that owns the collection, e.g. `1618535966441231024`. +} begin # Get redirect - result = api_instance.get_redirect(collection_id, redirect_id) + result = api_instance.get_redirect(collection_id, redirect_id, opts) p result rescue SajariAPIClient::ApiError => e puts "Error when calling RedirectsApi->get_redirect: #{e}" @@ -192,12 +203,12 @@ end This returns an Array which contains the response data, status code and headers. -> , Integer, Hash)> get_redirect_with_http_info(collection_id, redirect_id) +> , Integer, Hash)> get_redirect_with_http_info(collection_id, redirect_id, opts) ```ruby begin # Get redirect - data, status_code, headers = api_instance.get_redirect_with_http_info(collection_id, redirect_id) + data, status_code, headers = api_instance.get_redirect_with_http_info(collection_id, redirect_id, opts) p status_code # => 2xx p headers # => { ... } p data # => @@ -212,6 +223,7 @@ end | ---- | ---- | ----------- | ----- | | **collection_id** | **String** | The collection that owns the redirect, e.g. `my-collection`. | | | **redirect_id** | **String** | The redirect to retrieve, e.g. `1234`. | | +| **account_id** | **String** | The account that owns the collection, e.g. `1618535966441231024`. | [optional] | ### Return type @@ -250,6 +262,7 @@ end api_instance = SajariAPIClient::RedirectsApi.new collection_id = 'collection_id_example' # String | The collection that owns this set of redirects, e.g. `my-collection`. opts = { + account_id: 'account_id_example', # String | The account that owns the collection, e.g. `1618535966441231024`. 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](/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. } @@ -286,6 +299,7 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | **collection_id** | **String** | The collection that owns this set of redirects, e.g. `my-collection`. | | +| **account_id** | **String** | The account that owns the collection, e.g. `1618535966441231024`. | [optional] | | **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](/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] | @@ -305,7 +319,7 @@ end ## update_redirect -> update_redirect(collection_id, redirect_id, update_mask, redirect) +> update_redirect(collection_id, redirect_id, update_mask, redirect, opts) Update redirect @@ -328,10 +342,13 @@ collection_id = 'collection_id_example' # String | The collection the redirect b redirect_id = 'redirect_id_example' # String | The redirect to update, e.g. `1234`. 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. `condition`, `target`. For each field that you want to update, provide a corresponding value in the redirect object containing the new value. redirect = SajariAPIClient::Redirect.new({condition: 'condition_example', target: 'target_example'}) # Redirect | Details of the redirect to update. +opts = { + account_id: 'account_id_example' # String | The account that owns the collection, e.g. `1618535966441231024`. +} begin # Update redirect - result = api_instance.update_redirect(collection_id, redirect_id, update_mask, redirect) + result = api_instance.update_redirect(collection_id, redirect_id, update_mask, redirect, opts) p result rescue SajariAPIClient::ApiError => e puts "Error when calling RedirectsApi->update_redirect: #{e}" @@ -342,12 +359,12 @@ end This returns an Array which contains the response data, status code and headers. -> , Integer, Hash)> update_redirect_with_http_info(collection_id, redirect_id, update_mask, redirect) +> , Integer, Hash)> update_redirect_with_http_info(collection_id, redirect_id, update_mask, redirect, opts) ```ruby begin # Update redirect - data, status_code, headers = api_instance.update_redirect_with_http_info(collection_id, redirect_id, update_mask, redirect) + data, status_code, headers = api_instance.update_redirect_with_http_info(collection_id, redirect_id, update_mask, redirect, opts) p status_code # => 2xx p headers # => { ... } p data # => @@ -364,6 +381,7 @@ end | **redirect_id** | **String** | The redirect to update, e.g. `1234`. | | | **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. `condition`, `target`. For each field that you want to update, provide a corresponding value in the redirect object containing the new value. | | | **redirect** | [**Redirect**](Redirect.md) | Details of the redirect to update. | | +| **account_id** | **String** | The account that owns the collection, e.g. `1618535966441231024`. | [optional] | ### Return type diff --git a/docs/SchemaApi.md b/docs/SchemaApi.md index 64e8cfa..8e85599 100644 --- a/docs/SchemaApi.md +++ b/docs/SchemaApi.md @@ -6,7 +6,9 @@ All URIs are relative to *https://api.search.io* | ------ | ------------ | ----------- | | [**batch_create_schema_fields**](SchemaApi.md#batch_create_schema_fields) | **POST** /v4/collections/{collection_id}/schemaFields:batchCreate | Batch create schema fields | | [**create_schema_field**](SchemaApi.md#create_schema_field) | **POST** /v4/collections/{collection_id}/schemaFields | Create schema field | +| [**delete_schema_field**](SchemaApi.md#delete_schema_field) | **DELETE** /v4/collections/{collection_id}/schemaFields/{schema_field_name} | Delete schema field | | [**list_schema_fields**](SchemaApi.md#list_schema_fields) | **GET** /v4/collections/{collection_id}/schemaFields | List schema fields | +| [**update_schema_field**](SchemaApi.md#update_schema_field) | **PATCH** /v4/collections/{collection_id}/schemaFields/{schema_field_name} | Update schema field | ## batch_create_schema_fields @@ -153,6 +155,78 @@ end - **Accept**: application/json +## delete_schema_field + +> Object delete_schema_field(collection_id, schema_field_name) + +Delete schema field + +Deleting a schema field removes it from all records within the collection, however, references to the schema field in pipelines are not removed. > Note: This operation cannot be reversed. + +### 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::SchemaApi.new +collection_id = 'collection_id_example' # String | The collection the schema field belongs to, e.g. `my-collection`. +schema_field_name = 'schema_field_name_example' # String | The name of the schema field to delete. + +begin + # Delete schema field + result = api_instance.delete_schema_field(collection_id, schema_field_name) + p result +rescue SajariAPIClient::ApiError => e + puts "Error when calling SchemaApi->delete_schema_field: #{e}" +end +``` + +#### Using the delete_schema_field_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> delete_schema_field_with_http_info(collection_id, schema_field_name) + +```ruby +begin + # Delete schema field + data, status_code, headers = api_instance.delete_schema_field_with_http_info(collection_id, schema_field_name) + p status_code # => 2xx + p headers # => { ... } + p data # => Object +rescue SajariAPIClient::ApiError => e + puts "Error when calling SchemaApi->delete_schema_field_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **collection_id** | **String** | The collection the schema field belongs to, e.g. `my-collection`. | | +| **schema_field_name** | **String** | The name of the schema field to delete. | | + +### Return type + +**Object** + +### Authorization + +[BasicAuth](../README.md#BasicAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + ## list_schema_fields > list_schema_fields(collection_id, opts) @@ -228,3 +302,81 @@ end - **Content-Type**: Not defined - **Accept**: application/json + +## update_schema_field + +> update_schema_field(collection_id, schema_field_name, schema_field, opts) + +Update schema field + +Update the details of a schema field. Only `name` and `description` can be updated. + +### 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::SchemaApi.new +collection_id = 'collection_id_example' # String | The collection the schema field belongs to, e.g. `my-collection`. +schema_field_name = 'schema_field_name_example' # String | The name of the schema field to update. +schema_field = SajariAPIClient::SchemaField.new({mode: SajariAPIClient::SchemaFieldMode::MODE_UNSPECIFIED, name: 'name_example', type: SajariAPIClient::SchemaFieldType::TYPE_UNSPECIFIED}) # SchemaField | The schema field details to update. +opts = { + update_mask: 'update_mask_example' # String | The list of fields to update, separated by a comma, e.g. `name,description`. Each field should be in snake case. For each field that you want to update, provide a corresponding value in the schema field object containing the new value. +} + +begin + # Update schema field + result = api_instance.update_schema_field(collection_id, schema_field_name, schema_field, opts) + p result +rescue SajariAPIClient::ApiError => e + puts "Error when calling SchemaApi->update_schema_field: #{e}" +end +``` + +#### Using the update_schema_field_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> update_schema_field_with_http_info(collection_id, schema_field_name, schema_field, opts) + +```ruby +begin + # Update schema field + data, status_code, headers = api_instance.update_schema_field_with_http_info(collection_id, schema_field_name, schema_field, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue SajariAPIClient::ApiError => e + puts "Error when calling SchemaApi->update_schema_field_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **collection_id** | **String** | The collection the schema field belongs to, e.g. `my-collection`. | | +| **schema_field_name** | **String** | The name of the schema field to update. | | +| **schema_field** | [**SchemaField**](SchemaField.md) | The schema field details to update. | | +| **update_mask** | **String** | The list of fields to update, separated by a comma, e.g. `name,description`. Each field should be in snake case. For each field that you want to update, provide a corresponding value in the schema field object containing the new value. | [optional] | + +### Return type + +[**SchemaField**](SchemaField.md) + +### Authorization + +[BasicAuth](../README.md#BasicAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + diff --git a/docs/SendEventRequest.md b/docs/SendEventRequest.md index 97c9199..e391c28 100644 --- a/docs/SendEventRequest.md +++ b/docs/SendEventRequest.md @@ -5,7 +5,7 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | **metadata** | **Hash<String, Object>** | An object made up of field-value pairs that contains additional metadata to record with the event. Every value in the object must be one of the following primitive types: - boolean - number - string | [optional] | -| **name** | **String** | The name of event, e.g. `click`, `purchase`. | | +| **name** | **String** | The name of event, e.g. `click`, `redirect`, `purchase`. | | | **token** | **String** | The token corresponding to the search result that was interacted with, e.g. `eyJ...`. | | | **weight** | **Integer** | The weight assigned to the event. Generally a sensible weight is 1. If you want to weight an event in a certain way you can use a value other than 1. For example, if you want to capture profit in an event, you could set the weight to a value that represents the profit. | [optional] | diff --git a/generate/Dockerfile.generate b/generate/Dockerfile.generate index 86a140f..ec76bd2 100644 --- a/generate/Dockerfile.generate +++ b/generate/Dockerfile.generate @@ -1 +1 @@ -FROM openapitools/openapi-generator-cli:latest-release \ No newline at end of file +FROM openapitools/openapi-generator-cli@sha256:bc3f07ee4032923c7158b1a4a59aadd1861c6b4227c58d8ded5ee2b6c075bf72 \ No newline at end of file diff --git a/generate/generate.sh b/generate/generate.sh index 0805994..938a4d8 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=5.0.0 +VERSION=5.1.0 docker-entrypoint.sh generate \ -i /openapi.json \ diff --git a/lib/sdk_ruby.rb b/lib/sdk_ruby.rb index 67a8a75..f708ade 100644 --- a/lib/sdk_ruby.rb +++ b/lib/sdk_ruby.rb @@ -33,6 +33,7 @@ require 'sdk_ruby/models/batch_upsert_records_response_key' require 'sdk_ruby/models/batch_upsert_records_response_variables' require 'sdk_ruby/models/collection' +require 'sdk_ruby/models/collection_type' require 'sdk_ruby/models/delete_record_request' require 'sdk_ruby/models/error' require 'sdk_ruby/models/event' @@ -41,10 +42,12 @@ 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_collection_request_view' require 'sdk_ruby/models/get_default_pipeline_response' require 'sdk_ruby/models/get_default_version_request_view' require 'sdk_ruby/models/get_pipeline_request_view' require 'sdk_ruby/models/get_record_request' +require 'sdk_ruby/models/list_collections_request_view' require 'sdk_ruby/models/list_collections_response' require 'sdk_ruby/models/list_pipelines_request_view' require 'sdk_ruby/models/list_pipelines_response' diff --git a/lib/sdk_ruby/api/collections_api.rb b/lib/sdk_ruby/api/collections_api.rb index c5a9ac0..6949002 100644 --- a/lib/sdk_ruby/api/collections_api.rb +++ b/lib/sdk_ruby/api/collections_api.rb @@ -24,6 +24,7 @@ def initialize(api_client = ApiClient.default) # @param collection_id [String] The ID to use for the collection. This must start with an alphanumeric character followed by one or more alphanumeric or `-` characters. Strictly speaking, it must match the regular expression: `^[A-Za-z][A-Za-z0-9\\-]*$`. # @param collection [Collection] Details of the collection to create. # @param [Hash] opts the optional parameters + # @option opts [String] :account_id The account that owns the collection, e.g. `1618535966441231024`. # @return [Collection] def create_collection(collection_id, collection, opts = {}) data, _status_code, _headers = create_collection_with_http_info(collection_id, collection, opts) @@ -35,6 +36,7 @@ def create_collection(collection_id, collection, opts = {}) # @param collection_id [String] The ID to use for the collection. This must start with an alphanumeric character followed by one or more alphanumeric or `-` characters. Strictly speaking, it must match the regular expression: `^[A-Za-z][A-Za-z0-9\\-]*$`. # @param collection [Collection] Details of the collection to create. # @param [Hash] opts the optional parameters + # @option opts [String] :account_id The account that owns the collection, e.g. `1618535966441231024`. # @return [Array<(Collection, Integer, Hash)>] Collection data, response status code and response headers def create_collection_with_http_info(collection_id, collection, opts = {}) if @api_client.config.debugging @@ -64,6 +66,7 @@ def create_collection_with_http_info(collection_id, collection, opts = {}) 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] || {} @@ -98,6 +101,7 @@ def create_collection_with_http_info(collection_id, collection, opts = {}) # Delete a collection and all of its associated data. > Note: This operation cannot be reversed. # @param collection_id [String] The collection to delete, e.g. `my-collection`. # @param [Hash] opts the optional parameters + # @option opts [String] :account_id The account that owns the collection, e.g. `1618535966441231024`. # @return [Object] def delete_collection(collection_id, opts = {}) data, _status_code, _headers = delete_collection_with_http_info(collection_id, opts) @@ -108,6 +112,7 @@ def delete_collection(collection_id, opts = {}) # Delete a collection and all of its associated data. > Note: This operation cannot be reversed. # @param collection_id [String] The collection to delete, e.g. `my-collection`. # @param [Hash] opts the optional parameters + # @option opts [String] :account_id The account that owns the collection, e.g. `1618535966441231024`. # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers def delete_collection_with_http_info(collection_id, opts = {}) if @api_client.config.debugging @@ -127,6 +132,7 @@ def delete_collection_with_http_info(collection_id, opts = {}) header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Account-Id'] = opts[:'account_id'] if !opts[:'account_id'].nil? # form parameters form_params = opts[:form_params] || {} @@ -235,6 +241,8 @@ def experiment_with_http_info(collection_id, experiment_request, opts = {}) # Retrieve the details of a collection. # @param collection_id [String] The collection to retrieve, e.g. `my-collection`. # @param [Hash] opts the optional parameters + # @option opts [String] :account_id The account that owns the collection, e.g. `1618535966441231024`. + # @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 display name and domains. This is the default value (for both [ListCollections](/docs/api#operation/ListCollections) and [GetCollection](/docs/api#operation/GetCollection)). - FULL: Include the information from `BASIC`, plus full collection details like disk usage. (default to 'VIEW_UNSPECIFIED') # @return [Collection] def get_collection(collection_id, opts = {}) data, _status_code, _headers = get_collection_with_http_info(collection_id, opts) @@ -245,6 +253,8 @@ def get_collection(collection_id, opts = {}) # Retrieve the details of a collection. # @param collection_id [String] The collection to retrieve, e.g. `my-collection`. # @param [Hash] opts the optional parameters + # @option opts [String] :account_id The account that owns the collection, e.g. `1618535966441231024`. + # @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 display name and domains. This is the default value (for both [ListCollections](/docs/api#operation/ListCollections) and [GetCollection](/docs/api#operation/GetCollection)). - FULL: Include the information from `BASIC`, plus full collection details like disk usage. # @return [Array<(Collection, Integer, Hash)>] Collection data, response status code and response headers def get_collection_with_http_info(collection_id, opts = {}) if @api_client.config.debugging @@ -254,16 +264,22 @@ def get_collection_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 CollectionsApi.get_collection" end + allowable_values = ["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}'.sub('{' + 'collection_id' + '}', CGI.escape(collection_id.to_s)) # query parameters query_params = opts[:query_params] || {} + query_params[:'view'] = opts[:'view'] if !opts[:'view'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Account-Id'] = opts[:'account_id'] if !opts[:'account_id'].nil? # form parameters form_params = opts[:form_params] || {} @@ -297,8 +313,10 @@ def get_collection_with_http_info(collection_id, opts = {}) # List collections # Retrieve a list of collections in an account. # @param [Hash] opts the optional parameters + # @option opts [String] :account_id The account that owns this set of collections, e.g. `1618535966441231024`. # @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](/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. + # @option opts [String] :view The amount of information to include in each retrieved collection. - VIEW_UNSPECIFIED: The default / unset value. The API defaults to the `BASIC` view. - BASIC: Include basic information including display name and domains. This is the default value (for both [ListCollections](/docs/api#operation/ListCollections) and [GetCollection](/docs/api#operation/GetCollection)). - FULL: Include the information from `BASIC`, plus full collection details like disk usage. (default to 'VIEW_UNSPECIFIED') # @return [ListCollectionsResponse] def list_collections(opts = {}) data, _status_code, _headers = list_collections_with_http_info(opts) @@ -308,13 +326,19 @@ def list_collections(opts = {}) # List collections # Retrieve a list of collections in an account. # @param [Hash] opts the optional parameters + # @option opts [String] :account_id The account that owns this set of collections, e.g. `1618535966441231024`. # @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](/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. + # @option opts [String] :view The amount of information to include in each retrieved collection. - VIEW_UNSPECIFIED: The default / unset value. The API defaults to the `BASIC` view. - BASIC: Include basic information including display name and domains. This is the default value (for both [ListCollections](/docs/api#operation/ListCollections) and [GetCollection](/docs/api#operation/GetCollection)). - FULL: Include the information from `BASIC`, plus full collection details like disk usage. # @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 @api_client.config.logger.debug 'Calling API: CollectionsApi.list_collections ...' end + allowable_values = ["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' @@ -322,11 +346,13 @@ def list_collections_with_http_info(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] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Account-Id'] = opts[:'account_id'] if !opts[:'account_id'].nil? # form parameters form_params = opts[:form_params] || {} @@ -509,7 +535,7 @@ def query_collection2_with_http_info(collection_id, query_collection_request, op 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. + # 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 When tracking redirect events, set `type` to `redirect`. 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. @@ -521,7 +547,7 @@ def track_event(account_id, collection_id, event, opts = {}) 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. + # 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 When tracking redirect events, set `type` to `redirect`. 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. @@ -594,6 +620,7 @@ def track_event_with_http_info(account_id, collection_id, event, opts = {}) # @param collection_id [String] The collection to update, e.g. `my-collection`. # @param collection [Collection] The details of the collection to update. # @param [Hash] opts the optional parameters + # @option opts [String] :account_id The account that owns the collection, e.g. `1618535966441231024`. # @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, collection, opts = {}) @@ -606,6 +633,7 @@ def update_collection(collection_id, collection, opts = {}) # @param collection_id [String] The collection to update, e.g. `my-collection`. # @param collection [Collection] The details of the collection to update. # @param [Hash] opts the optional parameters + # @option opts [String] :account_id The account that owns the collection, e.g. `1618535966441231024`. # @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, collection, opts = {}) @@ -636,6 +664,7 @@ def update_collection_with_http_info(collection_id, collection, opts = {}) 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] || {} diff --git a/lib/sdk_ruby/api/events_api.rb b/lib/sdk_ruby/api/events_api.rb index d9e2baa..090a57e 100644 --- a/lib/sdk_ruby/api/events_api.rb +++ b/lib/sdk_ruby/api/events_api.rb @@ -20,7 +20,7 @@ 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\" } } ``` Note: You must pass an `Account-Id` header. + # 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`, `redirect`, `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\" } } ``` When sending event tokens returned from redirects, set `name` to `redirect`. 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 @@ -31,7 +31,7 @@ def send_event(account_id, 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\" } } ``` Note: You must pass an `Account-Id` header. + # 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`, `redirect`, `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\" } } ``` When sending event tokens returned from redirects, set `name` to `redirect`. 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 @@ -95,7 +95,7 @@ def send_event_with_http_info(account_id, 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\" } } ``` Note: You must pass an `Account-Id` header. + # 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`, `redirect`, `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\" } } ``` When sending event tokens returned from redirects, set `name` to `redirect`. Note: You must pass an `Account-Id` header. # @param send_event_request [SendEventRequest] # @param [Hash] opts the optional parameters # @return [Object] @@ -105,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\" } } ``` Note: You must pass an `Account-Id` header. + # 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`, `redirect`, `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\" } } ``` When sending event tokens returned from redirects, set `name` to `redirect`. 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 91cd431..bae0a3e 100644 --- a/lib/sdk_ruby/api/pipelines_api.rb +++ b/lib/sdk_ruby/api/pipelines_api.rb @@ -24,6 +24,7 @@ def initialize(api_client = ApiClient.default) # @param collection_id [String] The collection to create the pipeline in, e.g. `my-collection`. # @param pipeline [Pipeline] The pipeline to create. # @param [Hash] opts the optional parameters + # @option opts [String] :account_id The account that owns the collection, e.g. `1618535966441231024`. # @return [Pipeline] def create_pipeline(collection_id, pipeline, opts = {}) data, _status_code, _headers = create_pipeline_with_http_info(collection_id, pipeline, opts) @@ -35,6 +36,7 @@ def create_pipeline(collection_id, pipeline, opts = {}) # @param collection_id [String] The collection to create the pipeline in, e.g. `my-collection`. # @param pipeline [Pipeline] The pipeline to create. # @param [Hash] opts the optional parameters + # @option opts [String] :account_id The account that owns the collection, e.g. `1618535966441231024`. # @return [Array<(Pipeline, Integer, Hash)>] Pipeline data, response status code and response headers def create_pipeline_with_http_info(collection_id, pipeline, opts = {}) if @api_client.config.debugging @@ -63,6 +65,7 @@ def create_pipeline_with_http_info(collection_id, pipeline, opts = {}) 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] || {} @@ -248,6 +251,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] :account_id The account that owns the collection, e.g. `1618535966441231024`. # @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 = {}) @@ -261,6 +265,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] :account_id The account that owns the collection, e.g. `1618535966441231024`. # @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 = {}) @@ -299,6 +304,7 @@ def get_default_version_with_http_info(collection_id, type, name, opts = {}) header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/yaml']) + header_params[:'Account-Id'] = opts[:'account_id'] if !opts[:'account_id'].nil? # form parameters form_params = opts[:form_params] || {} @@ -336,6 +342,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] :account_id The account that owns the collection, e.g. `1618535966441231024`. # @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 = {}) @@ -350,6 +357,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] :account_id The account that owns the collection, e.g. `1618535966441231024`. # @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 = {}) @@ -392,6 +400,7 @@ def get_pipeline_with_http_info(collection_id, type, name, version, opts = {}) header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/yaml']) + header_params[:'Account-Id'] = opts[:'account_id'] if !opts[:'account_id'].nil? # form parameters form_params = opts[:form_params] || {} @@ -426,6 +435,7 @@ def get_pipeline_with_http_info(collection_id, type, name, version, opts = {}) # Retrieve a list of pipelines in a collection. # @param collection_id [String] The collection that owns this set of pipelines, e.g. `my-collection`. # @param [Hash] opts the optional parameters + # @option opts [String] :account_id The account that owns the collection, e.g. `1618535966441231024`. # @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](/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') @@ -439,6 +449,7 @@ def list_pipelines(collection_id, opts = {}) # Retrieve a list of pipelines in a collection. # @param collection_id [String] The collection that owns this set of pipelines, e.g. `my-collection`. # @param [Hash] opts the optional parameters + # @option opts [String] :account_id The account that owns the collection, e.g. `1618535966441231024`. # @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](/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. @@ -468,6 +479,7 @@ def list_pipelines_with_http_info(collection_id, opts = {}) header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Account-Id'] = opts[:'account_id'] if !opts[:'account_id'].nil? # form parameters form_params = opts[:form_params] || {} diff --git a/lib/sdk_ruby/api/promotions_api.rb b/lib/sdk_ruby/api/promotions_api.rb index 97497ad..f1e90d0 100644 --- a/lib/sdk_ruby/api/promotions_api.rb +++ b/lib/sdk_ruby/api/promotions_api.rb @@ -24,6 +24,7 @@ def initialize(api_client = ApiClient.default) # @param collection_id [String] The collection to create a promotion in, e.g. `my-collection`. # @param promotion [Promotion] The promotion to create. # @param [Hash] opts the optional parameters + # @option opts [String] :account_id The account that owns the collection, e.g. `1618535966441231024`. # @return [Promotion] def create_promotion(collection_id, promotion, opts = {}) data, _status_code, _headers = create_promotion_with_http_info(collection_id, promotion, opts) @@ -35,6 +36,7 @@ def create_promotion(collection_id, promotion, opts = {}) # @param collection_id [String] The collection to create a promotion in, e.g. `my-collection`. # @param promotion [Promotion] The promotion to create. # @param [Hash] opts the optional parameters + # @option opts [String] :account_id The account that owns the collection, e.g. `1618535966441231024`. # @return [Array<(Promotion, Integer, Hash)>] Promotion data, response status code and response headers def create_promotion_with_http_info(collection_id, promotion, opts = {}) if @api_client.config.debugging @@ -63,6 +65,7 @@ def create_promotion_with_http_info(collection_id, promotion, opts = {}) 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] || {} @@ -98,6 +101,7 @@ def create_promotion_with_http_info(collection_id, promotion, opts = {}) # @param collection_id [String] The collection the promotion belongs to, e.g. `my-collection`. # @param promotion_id [String] The promotion to delete, e.g. `1234`. # @param [Hash] opts the optional parameters + # @option opts [String] :account_id The account that owns the collection, e.g. `1618535966441231024`. # @return [Object] def delete_promotion(collection_id, promotion_id, opts = {}) data, _status_code, _headers = delete_promotion_with_http_info(collection_id, promotion_id, opts) @@ -109,6 +113,7 @@ def delete_promotion(collection_id, promotion_id, opts = {}) # @param collection_id [String] The collection the promotion belongs to, e.g. `my-collection`. # @param promotion_id [String] The promotion to delete, e.g. `1234`. # @param [Hash] opts the optional parameters + # @option opts [String] :account_id The account that owns the collection, e.g. `1618535966441231024`. # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers def delete_promotion_with_http_info(collection_id, promotion_id, opts = {}) if @api_client.config.debugging @@ -132,6 +137,7 @@ def delete_promotion_with_http_info(collection_id, promotion_id, opts = {}) header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Account-Id'] = opts[:'account_id'] if !opts[:'account_id'].nil? # form parameters form_params = opts[:form_params] || {} @@ -167,6 +173,7 @@ def delete_promotion_with_http_info(collection_id, promotion_id, opts = {}) # @param collection_id [String] The collection that owns the promotion, e.g. `my-collection`. # @param promotion_id [String] The promotion to retrieve, e.g. `1234`. # @param [Hash] opts the optional parameters + # @option opts [String] :account_id The account that owns the collection, e.g. `1618535966441231024`. # @return [Promotion] def get_promotion(collection_id, promotion_id, opts = {}) data, _status_code, _headers = get_promotion_with_http_info(collection_id, promotion_id, opts) @@ -178,6 +185,7 @@ def get_promotion(collection_id, promotion_id, opts = {}) # @param collection_id [String] The collection that owns the promotion, e.g. `my-collection`. # @param promotion_id [String] The promotion to retrieve, e.g. `1234`. # @param [Hash] opts the optional parameters + # @option opts [String] :account_id The account that owns the collection, e.g. `1618535966441231024`. # @return [Array<(Promotion, Integer, Hash)>] Promotion data, response status code and response headers def get_promotion_with_http_info(collection_id, promotion_id, opts = {}) if @api_client.config.debugging @@ -201,6 +209,7 @@ def get_promotion_with_http_info(collection_id, promotion_id, opts = {}) header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Account-Id'] = opts[:'account_id'] if !opts[:'account_id'].nil? # form parameters form_params = opts[:form_params] || {} @@ -235,6 +244,7 @@ def get_promotion_with_http_info(collection_id, promotion_id, opts = {}) # Retrieve a list of promotions in a collection. Promotion pins, exclusions and filter boosts are not returned in this call. # @param collection_id [String] The collection that owns this set of promotions, e.g. `my-collection`. # @param [Hash] opts the optional parameters + # @option opts [String] :account_id The account that owns the collection, e.g. `1618535966441231024`. # @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](/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') @@ -248,6 +258,7 @@ def list_promotions(collection_id, opts = {}) # Retrieve a list of promotions in a collection. Promotion pins, exclusions and filter boosts are not returned in this call. # @param collection_id [String] The collection that owns this set of promotions, e.g. `my-collection`. # @param [Hash] opts the optional parameters + # @option opts [String] :account_id The account that owns the collection, e.g. `1618535966441231024`. # @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](/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. @@ -277,6 +288,7 @@ def list_promotions_with_http_info(collection_id, opts = {}) header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Account-Id'] = opts[:'account_id'] if !opts[:'account_id'].nil? # form parameters form_params = opts[:form_params] || {} @@ -314,6 +326,7 @@ def list_promotions_with_http_info(collection_id, opts = {}) # @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`, `filter_boosts`. For each field that you want to update, provide a corresponding value in the promotion object containing the new value. # @param promotion [Promotion] Details of the promotion to update. # @param [Hash] opts the optional parameters + # @option opts [String] :account_id The account that owns the collection, e.g. `1618535966441231024`. # @return [Promotion] def update_promotion(collection_id, promotion_id, update_mask, promotion, opts = {}) data, _status_code, _headers = update_promotion_with_http_info(collection_id, promotion_id, update_mask, promotion, opts) @@ -327,6 +340,7 @@ def update_promotion(collection_id, promotion_id, update_mask, promotion, opts = # @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`, `filter_boosts`. For each field that you want to update, provide a corresponding value in the promotion object containing the new value. # @param promotion [Promotion] Details of the promotion to update. # @param [Hash] opts the optional parameters + # @option opts [String] :account_id The account that owns the collection, e.g. `1618535966441231024`. # @return [Array<(Promotion, Integer, Hash)>] Promotion data, response status code and response headers def update_promotion_with_http_info(collection_id, promotion_id, update_mask, promotion, opts = {}) if @api_client.config.debugging @@ -364,6 +378,7 @@ def update_promotion_with_http_info(collection_id, promotion_id, update_mask, pr 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] || {} diff --git a/lib/sdk_ruby/api/redirects_api.rb b/lib/sdk_ruby/api/redirects_api.rb index 2604fe9..c152ee0 100644 --- a/lib/sdk_ruby/api/redirects_api.rb +++ b/lib/sdk_ruby/api/redirects_api.rb @@ -24,6 +24,7 @@ def initialize(api_client = ApiClient.default) # @param collection_id [String] The collection to create a redirect in, e.g. `my-collection`. # @param redirect [Redirect] The redirect to create. # @param [Hash] opts the optional parameters + # @option opts [String] :account_id The account that owns the collection, e.g. `1618535966441231024`. # @return [Redirect] def create_redirect(collection_id, redirect, opts = {}) data, _status_code, _headers = create_redirect_with_http_info(collection_id, redirect, opts) @@ -35,6 +36,7 @@ def create_redirect(collection_id, redirect, opts = {}) # @param collection_id [String] The collection to create a redirect in, e.g. `my-collection`. # @param redirect [Redirect] The redirect to create. # @param [Hash] opts the optional parameters + # @option opts [String] :account_id The account that owns the collection, e.g. `1618535966441231024`. # @return [Array<(Redirect, Integer, Hash)>] Redirect data, response status code and response headers def create_redirect_with_http_info(collection_id, redirect, opts = {}) if @api_client.config.debugging @@ -63,6 +65,7 @@ def create_redirect_with_http_info(collection_id, redirect, opts = {}) 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] || {} @@ -98,6 +101,7 @@ def create_redirect_with_http_info(collection_id, redirect, opts = {}) # @param collection_id [String] The collection the redirect belongs to, e.g. `my-collection`. # @param redirect_id [String] The redirect to delete, e.g. `1234`. # @param [Hash] opts the optional parameters + # @option opts [String] :account_id The account that owns the collection, e.g. `1618535966441231024`. # @return [Object] def delete_redirect(collection_id, redirect_id, opts = {}) data, _status_code, _headers = delete_redirect_with_http_info(collection_id, redirect_id, opts) @@ -109,6 +113,7 @@ def delete_redirect(collection_id, redirect_id, opts = {}) # @param collection_id [String] The collection the redirect belongs to, e.g. `my-collection`. # @param redirect_id [String] The redirect to delete, e.g. `1234`. # @param [Hash] opts the optional parameters + # @option opts [String] :account_id The account that owns the collection, e.g. `1618535966441231024`. # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers def delete_redirect_with_http_info(collection_id, redirect_id, opts = {}) if @api_client.config.debugging @@ -132,6 +137,7 @@ def delete_redirect_with_http_info(collection_id, redirect_id, opts = {}) header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Account-Id'] = opts[:'account_id'] if !opts[:'account_id'].nil? # form parameters form_params = opts[:form_params] || {} @@ -167,6 +173,7 @@ def delete_redirect_with_http_info(collection_id, redirect_id, opts = {}) # @param collection_id [String] The collection that owns the redirect, e.g. `my-collection`. # @param redirect_id [String] The redirect to retrieve, e.g. `1234`. # @param [Hash] opts the optional parameters + # @option opts [String] :account_id The account that owns the collection, e.g. `1618535966441231024`. # @return [Redirect] def get_redirect(collection_id, redirect_id, opts = {}) data, _status_code, _headers = get_redirect_with_http_info(collection_id, redirect_id, opts) @@ -178,6 +185,7 @@ def get_redirect(collection_id, redirect_id, opts = {}) # @param collection_id [String] The collection that owns the redirect, e.g. `my-collection`. # @param redirect_id [String] The redirect to retrieve, e.g. `1234`. # @param [Hash] opts the optional parameters + # @option opts [String] :account_id The account that owns the collection, e.g. `1618535966441231024`. # @return [Array<(Redirect, Integer, Hash)>] Redirect data, response status code and response headers def get_redirect_with_http_info(collection_id, redirect_id, opts = {}) if @api_client.config.debugging @@ -201,6 +209,7 @@ def get_redirect_with_http_info(collection_id, redirect_id, opts = {}) header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Account-Id'] = opts[:'account_id'] if !opts[:'account_id'].nil? # form parameters form_params = opts[:form_params] || {} @@ -235,6 +244,7 @@ def get_redirect_with_http_info(collection_id, redirect_id, opts = {}) # Retrieve a list of redirects in a collection. # @param collection_id [String] The collection that owns this set of redirects, e.g. `my-collection`. # @param [Hash] opts the optional parameters + # @option opts [String] :account_id The account that owns the collection, e.g. `1618535966441231024`. # @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](/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] @@ -247,6 +257,7 @@ def list_redirects(collection_id, opts = {}) # Retrieve a list of redirects in a collection. # @param collection_id [String] The collection that owns this set of redirects, e.g. `my-collection`. # @param [Hash] opts the optional parameters + # @option opts [String] :account_id The account that owns the collection, e.g. `1618535966441231024`. # @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](/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 @@ -270,6 +281,7 @@ def list_redirects_with_http_info(collection_id, opts = {}) header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Account-Id'] = opts[:'account_id'] if !opts[:'account_id'].nil? # form parameters form_params = opts[:form_params] || {} @@ -307,6 +319,7 @@ def list_redirects_with_http_info(collection_id, opts = {}) # @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. `condition`, `target`. For each field that you want to update, provide a corresponding value in the redirect object containing the new value. # @param redirect [Redirect] Details of the redirect to update. # @param [Hash] opts the optional parameters + # @option opts [String] :account_id The account that owns the collection, e.g. `1618535966441231024`. # @return [Redirect] def update_redirect(collection_id, redirect_id, update_mask, redirect, opts = {}) data, _status_code, _headers = update_redirect_with_http_info(collection_id, redirect_id, update_mask, redirect, opts) @@ -320,6 +333,7 @@ def update_redirect(collection_id, redirect_id, update_mask, redirect, opts = {} # @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. `condition`, `target`. For each field that you want to update, provide a corresponding value in the redirect object containing the new value. # @param redirect [Redirect] Details of the redirect to update. # @param [Hash] opts the optional parameters + # @option opts [String] :account_id The account that owns the collection, e.g. `1618535966441231024`. # @return [Array<(Redirect, Integer, Hash)>] Redirect data, response status code and response headers def update_redirect_with_http_info(collection_id, redirect_id, update_mask, redirect, opts = {}) if @api_client.config.debugging @@ -357,6 +371,7 @@ def update_redirect_with_http_info(collection_id, redirect_id, update_mask, redi 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] || {} diff --git a/lib/sdk_ruby/api/schema_api.rb b/lib/sdk_ruby/api/schema_api.rb index 016723c..bc4d9f8 100644 --- a/lib/sdk_ruby/api/schema_api.rb +++ b/lib/sdk_ruby/api/schema_api.rb @@ -167,6 +167,75 @@ def create_schema_field_with_http_info(collection_id, schema_field, opts = {}) return data, status_code, headers end + # Delete schema field + # Deleting a schema field removes it from all records within the collection, however, references to the schema field in pipelines are not removed. > Note: This operation cannot be reversed. + # @param collection_id [String] The collection the schema field belongs to, e.g. `my-collection`. + # @param schema_field_name [String] The name of the schema field to delete. + # @param [Hash] opts the optional parameters + # @return [Object] + def delete_schema_field(collection_id, schema_field_name, opts = {}) + data, _status_code, _headers = delete_schema_field_with_http_info(collection_id, schema_field_name, opts) + data + end + + # Delete schema field + # Deleting a schema field removes it from all records within the collection, however, references to the schema field in pipelines are not removed. > Note: This operation cannot be reversed. + # @param collection_id [String] The collection the schema field belongs to, e.g. `my-collection`. + # @param schema_field_name [String] The name of the schema field to delete. + # @param [Hash] opts the optional parameters + # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers + def delete_schema_field_with_http_info(collection_id, schema_field_name, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SchemaApi.delete_schema_field ...' + 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 SchemaApi.delete_schema_field" + end + # verify the required parameter 'schema_field_name' is set + if @api_client.config.client_side_validation && schema_field_name.nil? + fail ArgumentError, "Missing the required parameter 'schema_field_name' when calling SchemaApi.delete_schema_field" + end + # resource path + local_var_path = '/v4/collections/{collection_id}/schemaFields/{schema_field_name}'.sub('{' + 'collection_id' + '}', CGI.escape(collection_id.to_s)).sub('{' + 'schema_field_name' + '}', CGI.escape(schema_field_name.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']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'Object' + + # auth_names + auth_names = opts[:debug_auth_names] || ['BasicAuth'] + + new_options = opts.merge( + :operation => :"SchemaApi.delete_schema_field", + :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(:DELETE, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SchemaApi#delete_schema_field\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # List schema fields # Retrieve a list of schema fields in a collection. # @param collection_id [String] The collection that owns this set of schema fields, e.g. `my-collection`. @@ -235,5 +304,88 @@ def list_schema_fields_with_http_info(collection_id, opts = {}) end return data, status_code, headers end + + # Update schema field + # Update the details of a schema field. Only `name` and `description` can be updated. + # @param collection_id [String] The collection the schema field belongs to, e.g. `my-collection`. + # @param schema_field_name [String] The name of the schema field to update. + # @param schema_field [SchemaField] The schema field details 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. `name,description`. Each field should be in snake case. For each field that you want to update, provide a corresponding value in the schema field object containing the new value. + # @return [SchemaField] + def update_schema_field(collection_id, schema_field_name, schema_field, opts = {}) + data, _status_code, _headers = update_schema_field_with_http_info(collection_id, schema_field_name, schema_field, opts) + data + end + + # Update schema field + # Update the details of a schema field. Only `name` and `description` can be updated. + # @param collection_id [String] The collection the schema field belongs to, e.g. `my-collection`. + # @param schema_field_name [String] The name of the schema field to update. + # @param schema_field [SchemaField] The schema field details 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. `name,description`. Each field should be in snake case. For each field that you want to update, provide a corresponding value in the schema field object containing the new value. + # @return [Array<(SchemaField, Integer, Hash)>] SchemaField data, response status code and response headers + def update_schema_field_with_http_info(collection_id, schema_field_name, schema_field, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SchemaApi.update_schema_field ...' + 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 SchemaApi.update_schema_field" + end + # verify the required parameter 'schema_field_name' is set + if @api_client.config.client_side_validation && schema_field_name.nil? + fail ArgumentError, "Missing the required parameter 'schema_field_name' when calling SchemaApi.update_schema_field" + end + # verify the required parameter 'schema_field' is set + if @api_client.config.client_side_validation && schema_field.nil? + fail ArgumentError, "Missing the required parameter 'schema_field' when calling SchemaApi.update_schema_field" + end + # resource path + local_var_path = '/v4/collections/{collection_id}/schemaFields/{schema_field_name}'.sub('{' + 'collection_id' + '}', CGI.escape(collection_id.to_s)).sub('{' + 'schema_field_name' + '}', CGI.escape(schema_field_name.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'update_mask'] = opts[:'update_mask'] if !opts[:'update_mask'].nil? + + # 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(schema_field) + + # return_type + return_type = opts[:debug_return_type] || 'SchemaField' + + # auth_names + auth_names = opts[:debug_auth_names] || ['BasicAuth'] + + new_options = opts.merge( + :operation => :"SchemaApi.update_schema_field", + :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(:PATCH, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SchemaApi#update_schema_field\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end end end diff --git a/lib/sdk_ruby/api_client.rb b/lib/sdk_ruby/api_client.rb index bf5fcba..02b8a81 100644 --- a/lib/sdk_ruby/api_client.rb +++ b/lib/sdk_ruby/api_client.rb @@ -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-5.0.0" + @user_agent = "sajari-sdk-ruby-5.1.0" @default_headers = { 'Content-Type' => 'application/json', 'User-Agent' => @user_agent diff --git a/lib/sdk_ruby/models/collection.rb b/lib/sdk_ruby/models/collection.rb index 9bd5b5f..0d1e3bb 100644 --- a/lib/sdk_ruby/models/collection.rb +++ b/lib/sdk_ruby/models/collection.rb @@ -21,7 +21,7 @@ class Collection # 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. + # Output only. The time the collection was created. attr_accessor :create_time # The collection's display name. You can change this at any time. diff --git a/lib/sdk_ruby/models/collection_type.rb b/lib/sdk_ruby/models/collection_type.rb new file mode 100644 index 0000000..071ef7b --- /dev/null +++ b/lib/sdk_ruby/models/collection_type.rb @@ -0,0 +1,39 @@ +=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 CollectionType + TYPE_UNSPECIFIED = "TYPE_UNSPECIFIED".freeze + WEBSITE = "WEBSITE".freeze + SHOPIFY = "SHOPIFY".freeze + CUSTOM = "CUSTOM".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 = CollectionType.constants.select { |c| CollectionType::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #CollectionType" if constantValues.empty? + value + end + end +end diff --git a/lib/sdk_ruby/models/event.rb b/lib/sdk_ruby/models/event.rb index 065e082..d08ebb3 100644 --- a/lib/sdk_ruby/models/event.rb +++ b/lib/sdk_ruby/models/event.rb @@ -31,7 +31,7 @@ class Event # The identifier of the result the event is about. attr_accessor :result_id - # The type of event, e.g. `click`, `purchase`, `add_to_cart`. + # The type of event, e.g. `click`, `redirect`, `purchase`, `add_to_cart`. attr_accessor :type # Attribute mapping from ruby-style variable name to JSON key. diff --git a/lib/sdk_ruby/models/get_collection_request_view.rb b/lib/sdk_ruby/models/get_collection_request_view.rb new file mode 100644 index 0000000..cdcedfc --- /dev/null +++ b/lib/sdk_ruby/models/get_collection_request_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 GetCollectionRequestView + VIEW_UNSPECIFIED = "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 = GetCollectionRequestView.constants.select { |c| GetCollectionRequestView::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #GetCollectionRequestView" if constantValues.empty? + value + end + end +end diff --git a/lib/sdk_ruby/models/list_collections_request_view.rb b/lib/sdk_ruby/models/list_collections_request_view.rb new file mode 100644 index 0000000..6462ebe --- /dev/null +++ b/lib/sdk_ruby/models/list_collections_request_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 ListCollectionsRequestView + VIEW_UNSPECIFIED = "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 = ListCollectionsRequestView.constants.select { |c| ListCollectionsRequestView::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #ListCollectionsRequestView" if constantValues.empty? + value + end + end +end diff --git a/lib/sdk_ruby/models/promotion.rb b/lib/sdk_ruby/models/promotion.rb index bc6b22f..7ea40ec 100644 --- a/lib/sdk_ruby/models/promotion.rb +++ b/lib/sdk_ruby/models/promotion.rb @@ -43,7 +43,7 @@ class Promotion # The filter boosts to apply to searches, if the promotion is enabled. attr_accessor :filter_boosts - # The conditions applied to the filters passed from the user. A query must match at least one of these in order to trigger the promotion. + # The conditions applied to the filters passed from the user. A query must match at least one of these in order to trigger the promotion. A filter condition is comprised of a set of filters of the form `field = value` and matches a query if all of those filters are present in the query. For example, a query with the filter `productType = 'shirt' AND size = 'medium'` triggers a promotion with the filter condition `productType = 'shirt'`, but not one with both `productType = 'shirt', and `size = 'small'`. attr_accessor :filter_conditions # The promotion's ID. diff --git a/lib/sdk_ruby/models/promotion_filter_condition.rb b/lib/sdk_ruby/models/promotion_filter_condition.rb index c0590ef..48627b5 100644 --- a/lib/sdk_ruby/models/promotion_filter_condition.rb +++ b/lib/sdk_ruby/models/promotion_filter_condition.rb @@ -14,9 +14,9 @@ require 'time' module SajariAPIClient - # A set of filters of the form `field = 'value'`. Matches a query if the set of filters in the condition matches exactly the set of filters associated with it. + # A set of filters of the form `field = 'value'`. Matches a query if all filters are present in that query. class PromotionFilterCondition - # A filter of the form `field = 'value'`. + # A filter of the form `field = 'value'`. All of these filters must be present in a query's filter in order for the promotion to be considered active. attr_accessor :filter # Attribute mapping from ruby-style variable name to JSON key. diff --git a/lib/sdk_ruby/models/send_event_request.rb b/lib/sdk_ruby/models/send_event_request.rb index 5158869..a593494 100644 --- a/lib/sdk_ruby/models/send_event_request.rb +++ b/lib/sdk_ruby/models/send_event_request.rb @@ -19,7 +19,7 @@ class SendEventRequest # An object made up of field-value pairs that contains additional metadata to record with the event. Every value in the object must be one of the following primitive types: - boolean - number - string attr_accessor :metadata - # The name of event, e.g. `click`, `purchase`. + # The name of event, e.g. `click`, `redirect`, `purchase`. attr_accessor :name # The token corresponding to the search result that was interacted with, e.g. `eyJ...`. diff --git a/lib/sdk_ruby/version.rb b/lib/sdk_ruby/version.rb index 13eaad5..4756afb 100644 --- a/lib/sdk_ruby/version.rb +++ b/lib/sdk_ruby/version.rb @@ -11,5 +11,5 @@ =end module SajariAPIClient - VERSION = '5.0.0' + VERSION = '5.1.0' end diff --git a/spec/models/collection_type_spec.rb b/spec/models/collection_type_spec.rb new file mode 100644 index 0000000..e7755de --- /dev/null +++ b/spec/models/collection_type_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::CollectionType +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe SajariAPIClient::CollectionType do + let(:instance) { SajariAPIClient::CollectionType.new } + + describe 'test an instance of CollectionType' do + it 'should create an instance of CollectionType' do + expect(instance).to be_instance_of(SajariAPIClient::CollectionType) + end + end +end diff --git a/spec/models/get_collection_request_view_spec.rb b/spec/models/get_collection_request_view_spec.rb new file mode 100644 index 0000000..30e4e9c --- /dev/null +++ b/spec/models/get_collection_request_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::GetCollectionRequestView +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe SajariAPIClient::GetCollectionRequestView do + let(:instance) { SajariAPIClient::GetCollectionRequestView.new } + + describe 'test an instance of GetCollectionRequestView' do + it 'should create an instance of GetCollectionRequestView' do + expect(instance).to be_instance_of(SajariAPIClient::GetCollectionRequestView) + end + end +end diff --git a/spec/models/list_collections_request_view_spec.rb b/spec/models/list_collections_request_view_spec.rb new file mode 100644 index 0000000..287dafa --- /dev/null +++ b/spec/models/list_collections_request_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::ListCollectionsRequestView +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe SajariAPIClient::ListCollectionsRequestView do + let(:instance) { SajariAPIClient::ListCollectionsRequestView.new } + + describe 'test an instance of ListCollectionsRequestView' do + it 'should create an instance of ListCollectionsRequestView' do + expect(instance).to be_instance_of(SajariAPIClient::ListCollectionsRequestView) + end + end +end