From fb5e6ade61665152004d500ec2c77e706cb799f6 Mon Sep 17 00:00:00 2001 From: Justin Koke Date: Thu, 4 Nov 2021 17:00:37 +1100 Subject: [PATCH] SAJARI-2744 Release for UpdateRecord support in the SDK --- .openapi-generator/FILES | 4 +- .openapi-generator/VERSION | 2 +- Com.Sajari.Sdk.sln | 10 +- README.md | 23 +- docs/BatchCreateSchemaFieldsRequest.md | 1 + docs/BatchCreateSchemaFieldsResponse.md | 3 +- docs/BatchCreateSchemaFieldsResponseError.md | 1 + docs/BatchUpsertRecordsRequest.md | 5 +- docs/BatchUpsertRecordsRequestPipeline.md | 3 +- docs/BatchUpsertRecordsResponse.md | 3 +- docs/BatchUpsertRecordsResponseError.md | 1 + docs/BatchUpsertRecordsResponseKey.md | 1 + docs/BatchUpsertRecordsResponseVariables.md | 3 +- docs/Collection.md | 7 +- docs/CollectionsApi.md | 113 +++++- docs/DeleteRecordRequest.md | 1 + docs/Error.md | 3 +- docs/EventsApi.md | 87 ++++- docs/GeneratePipelinesRequest.md | 3 +- docs/GeneratePipelinesResponse.md | 5 +- docs/GetDefaultPipelineResponse.md | 1 + docs/GetDefaultVersionRequestView.md | 1 + docs/GetPipelineRequestView.md | 1 + docs/GetRecordRequest.md | 1 + docs/ListCollectionsResponse.md | 1 + docs/ListPipelinesRequestView.md | 1 + docs/ListPipelinesResponse.md | 3 +- docs/ListSchemaFieldsResponse.md | 3 +- docs/PercentileDataPoint.md | 1 + docs/Pipeline.md | 15 +- docs/PipelineStep.md | 9 +- docs/PipelineStepParamBinding.md | 5 +- docs/PipelineType.md | 1 + docs/PipelinesApi.md | 26 +- docs/ProtobufAny.md | 1 + docs/ProtobufNullValue.md | 1 + docs/QueryAggregateResult.md | 7 +- docs/QueryAggregateResultAnalysis.md | 7 +- docs/QueryAggregateResultBuckets.md | 1 + docs/QueryAggregateResultBucketsBucket.md | 3 +- docs/QueryAggregateResultCount.md | 1 + docs/QueryAggregateResultDate.md | 1 + docs/QueryAggregateResultMetric.md | 1 + docs/QueryAggregateResultPercentile.md | 3 +- docs/QueryCollectionRequest.md | 3 +- docs/QueryCollectionRequestPipeline.md | 3 +- docs/QueryCollectionRequestTracking.md | 7 +- docs/QueryCollectionRequestTrackingType.md | 1 + docs/QueryCollectionResponse.md | 9 +- docs/QueryCollectionResponsePipeline.md | 3 +- docs/QueryResult.md | 3 +- docs/QueryResultToken.md | 1 + docs/QueryResultTokenClick.md | 1 + docs/QueryResultTokenPosNeg.md | 3 +- docs/RecordKey.md | 1 + docs/RecordsApi.md | 97 ++++- docs/SchemaApi.md | 13 +- docs/SchemaField.md | 9 +- docs/SchemaFieldMode.md | 1 + docs/SchemaFieldType.md | 1 + docs/SendEventRequest.md | 3 +- docs/SetDefaultPipelineRequest.md | 3 +- docs/SetDefaultVersionRequest.md | 3 +- docs/Status.md | 3 +- docs/UpdateRecordRequest.md | 12 + docs/UpsertRecordRequest.md | 3 +- docs/UpsertRecordRequestPipeline.md | 3 +- docs/UpsertRecordResponse.md | 3 +- generate/Dockerfile.generate | 2 +- generate/generate.sh | 2 +- .../Api/CollectionsApiTests.cs | 6 +- .../Model/UpdateRecordRequestTests.cs | 87 +++++ src/Com.Sajari.Sdk/Api/CollectionsApi.cs | 349 ++++++++++++++---- src/Com.Sajari.Sdk/Api/EventsApi.cs | 201 +++++++++- src/Com.Sajari.Sdk/Api/PipelinesApi.cs | 116 +++--- src/Com.Sajari.Sdk/Api/RecordsApi.cs | 259 +++++++++++-- src/Com.Sajari.Sdk/Api/SchemaApi.cs | 72 ++-- src/Com.Sajari.Sdk/Client/ApiClient.cs | 114 ++++-- src/Com.Sajari.Sdk/Client/ApiResponse.cs | 4 +- src/Com.Sajari.Sdk/Client/ClientUtils.cs | 29 +- src/Com.Sajari.Sdk/Client/Configuration.cs | 16 +- src/Com.Sajari.Sdk/Client/IApiAccessor.cs | 2 +- .../Client/IAsynchronousClient.cs | 14 +- .../Client/IReadableConfiguration.cs | 2 +- .../Client/ISynchronousClient.cs | 14 +- src/Com.Sajari.Sdk/Client/RequestOptions.cs | 14 +- src/Com.Sajari.Sdk/Com.Sajari.Sdk.csproj | 10 +- .../Model/AbstractOpenAPISchema.cs | 17 + .../Model/BatchCreateSchemaFieldsRequest.cs | 9 +- .../Model/BatchCreateSchemaFieldsResponse.cs | 42 +-- .../BatchCreateSchemaFieldsResponseError.cs | 4 +- .../Model/BatchUpsertRecordsRequest.cs | 24 +- .../BatchUpsertRecordsRequestPipeline.cs | 25 +- .../Model/BatchUpsertRecordsResponse.cs | 42 +-- .../Model/BatchUpsertRecordsResponseError.cs | 4 +- .../Model/BatchUpsertRecordsResponseKey.cs | 4 +- .../BatchUpsertRecordsResponseVariables.cs | 13 +- src/Com.Sajari.Sdk/Model/Collection.cs | 86 ++--- .../Model/DeleteRecordRequest.cs | 9 +- src/Com.Sajari.Sdk/Model/Error.cs | 38 +- .../Model/GeneratePipelinesRequest.cs | 45 +-- .../Model/GeneratePipelinesResponse.cs | 50 +-- .../Model/GetDefaultPipelineResponse.cs | 4 +- .../Model/GetDefaultVersionRequestView.cs | 2 - .../Model/GetPipelineRequestView.cs | 2 - src/Com.Sajari.Sdk/Model/GetRecordRequest.cs | 9 +- .../Model/ListCollectionsResponse.cs | 4 +- .../Model/ListPipelinesRequestView.cs | 2 - .../Model/ListPipelinesResponse.cs | 40 +- .../Model/ListSchemaFieldsResponse.cs | 40 +- .../Model/PercentileDataPoint.cs | 4 +- src/Com.Sajari.Sdk/Model/Pipeline.cs | 180 ++++----- src/Com.Sajari.Sdk/Model/PipelineStep.cs | 117 +++--- .../Model/PipelineStepParamBinding.cs | 54 +-- src/Com.Sajari.Sdk/Model/PipelineType.cs | 2 - src/Com.Sajari.Sdk/Model/ProtobufAny.cs | 4 +- src/Com.Sajari.Sdk/Model/ProtobufNullValue.cs | 2 - .../Model/QueryAggregateResult.cs | 82 ++-- .../Model/QueryAggregateResultAnalysis.cs | 66 ++-- .../Model/QueryAggregateResultBuckets.cs | 4 +- .../QueryAggregateResultBucketsBucket.cs | 36 +- .../Model/QueryAggregateResultCount.cs | 4 +- .../Model/QueryAggregateResultDate.cs | 4 +- .../Model/QueryAggregateResultMetric.cs | 4 +- .../Model/QueryAggregateResultPercentile.cs | 42 +-- .../Model/QueryCollectionRequest.cs | 44 ++- .../Model/QueryCollectionRequestPipeline.cs | 25 +- .../Model/QueryCollectionRequestTracking.cs | 85 ++--- .../QueryCollectionRequestTrackingType.cs | 2 - .../Model/QueryCollectionResponse.cs | 127 +++---- .../Model/QueryCollectionResponsePipeline.cs | 20 +- src/Com.Sajari.Sdk/Model/QueryResult.cs | 36 +- src/Com.Sajari.Sdk/Model/QueryResultToken.cs | 4 +- .../Model/QueryResultTokenClick.cs | 4 +- .../Model/QueryResultTokenPosNeg.cs | 38 +- src/Com.Sajari.Sdk/Model/RecordKey.cs | 14 +- src/Com.Sajari.Sdk/Model/SchemaField.cs | 105 +++--- src/Com.Sajari.Sdk/Model/SchemaFieldMode.cs | 2 - src/Com.Sajari.Sdk/Model/SchemaFieldType.cs | 2 - src/Com.Sajari.Sdk/Model/SendEventRequest.cs | 52 +-- .../Model/SetDefaultPipelineRequest.cs | 28 +- .../Model/SetDefaultVersionRequest.cs | 23 +- src/Com.Sajari.Sdk/Model/Status.cs | 40 +- .../Model/UpdateRecordRequest.cs | 178 +++++++++ .../Model/UpsertRecordRequest.cs | 18 +- .../Model/UpsertRecordRequestPipeline.cs | 25 +- .../Model/UpsertRecordResponse.cs | 13 +- 147 files changed, 2599 insertions(+), 1282 deletions(-) create mode 100644 docs/UpdateRecordRequest.md create mode 100644 src/Com.Sajari.Sdk.Test/Model/UpdateRecordRequestTests.cs create mode 100644 src/Com.Sajari.Sdk/Model/UpdateRecordRequest.cs diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index d03d6d2..84c83cc 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -62,12 +62,11 @@ docs/SendEventRequest.md docs/SetDefaultPipelineRequest.md docs/SetDefaultVersionRequest.md docs/Status.md +docs/UpdateRecordRequest.md docs/UpsertRecordRequest.md docs/UpsertRecordRequestPipeline.md docs/UpsertRecordResponse.md -src/Com.Sajari.Sdk.Test/Api/EventsApiTests.cs src/Com.Sajari.Sdk.Test/Com.Sajari.Sdk.Test.csproj -src/Com.Sajari.Sdk.Test/Model/SendEventRequestTests.cs src/Com.Sajari.Sdk/Api/CollectionsApi.cs src/Com.Sajari.Sdk/Api/EventsApi.cs src/Com.Sajari.Sdk/Api/PipelinesApi.cs @@ -146,6 +145,7 @@ src/Com.Sajari.Sdk/Model/SendEventRequest.cs src/Com.Sajari.Sdk/Model/SetDefaultPipelineRequest.cs src/Com.Sajari.Sdk/Model/SetDefaultVersionRequest.cs src/Com.Sajari.Sdk/Model/Status.cs +src/Com.Sajari.Sdk/Model/UpdateRecordRequest.cs src/Com.Sajari.Sdk/Model/UpsertRecordRequest.cs src/Com.Sajari.Sdk/Model/UpsertRecordRequestPipeline.cs src/Com.Sajari.Sdk/Model/UpsertRecordResponse.cs diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION index d99e716..e230c83 100644 --- a/.openapi-generator/VERSION +++ b/.openapi-generator/VERSION @@ -1 +1 @@ -5.0.0-SNAPSHOT \ No newline at end of file +5.3.0 \ No newline at end of file diff --git a/Com.Sajari.Sdk.sln b/Com.Sajari.Sdk.sln index ca709b6..d931c5a 100644 --- a/Com.Sajari.Sdk.sln +++ b/Com.Sajari.Sdk.sln @@ -2,7 +2,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 14 VisualStudioVersion = 14.0.25420.1 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Com.Sajari.Sdk", "src\Com.Sajari.Sdk\Com.Sajari.Sdk.csproj", "{8C4ED383-DD7C-4961-A23C-E3C8108A7A75}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Com.Sajari.Sdk", "src\Com.Sajari.Sdk\Com.Sajari.Sdk.csproj", "{028A2A5B-F258-4825-8462-DF48027A4BD0}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Com.Sajari.Sdk.Test", "src\Com.Sajari.Sdk.Test\Com.Sajari.Sdk.Test.csproj", "{19F1DEBC-DE5E-4517-8062-F000CD499087}" EndProject @@ -12,10 +12,10 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {8C4ED383-DD7C-4961-A23C-E3C8108A7A75}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8C4ED383-DD7C-4961-A23C-E3C8108A7A75}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8C4ED383-DD7C-4961-A23C-E3C8108A7A75}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8C4ED383-DD7C-4961-A23C-E3C8108A7A75}.Release|Any CPU.Build.0 = Release|Any CPU + {028A2A5B-F258-4825-8462-DF48027A4BD0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {028A2A5B-F258-4825-8462-DF48027A4BD0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {028A2A5B-F258-4825-8462-DF48027A4BD0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {028A2A5B-F258-4825-8462-DF48027A4BD0}.Release|Any CPU.Build.0 = Release|Any CPU {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.Build.0 = Debug|Any CPU {19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.ActiveCfg = Release|Any CPU diff --git a/README.md b/README.md index fbcd70d..f2d98b3 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ Sajari is a smart, highly-configurable, real-time search service that enables th This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: v4 -- SDK version: 4.1.0 +- SDK version: 4.2.0 - Build package: org.openapitools.codegen.languages.CSharpNetCoreClientCodegen For more information, please visit [https://www.sajari.com/company/contact](https://www.sajari.com/company/contact) @@ -18,10 +18,10 @@ This C# SDK is automatically generated by the [OpenAPI Generator](https://openap ## Dependencies -- [RestSharp](https://www.nuget.org/packages/RestSharp) - 106.12.0 or later +- [RestSharp](https://www.nuget.org/packages/RestSharp) - 106.11.7 or later - [Json.NET](https://www.nuget.org/packages/Newtonsoft.Json/) - 12.0.3 or later -- [JsonSubTypes](https://www.nuget.org/packages/JsonSubTypes/) - 1.7.0 or later -- [System.ComponentModel.Annotations](https://www.nuget.org/packages/System.ComponentModel.Annotations) - 4.7.0 or later +- [JsonSubTypes](https://www.nuget.org/packages/JsonSubTypes/) - 1.8.0 or later +- [System.ComponentModel.Annotations](https://www.nuget.org/packages/System.ComponentModel.Annotations) - 5.0.0 or later The DLLs included in the package may not be the latest version. We recommend using [NuGet](https://docs.nuget.org/consume/installing-nuget) to obtain the latest version of the packages: ``` @@ -31,7 +31,8 @@ Install-Package JsonSubTypes Install-Package System.ComponentModel.Annotations ``` -NOTE: RestSharp versions greater than 105.1.0 have a bug which causes file uploads to fail. See [RestSharp#742](https://github.com/restsharp/RestSharp/issues/742) +NOTE: RestSharp versions greater than 105.1.0 have a bug which causes file uploads to fail. See [RestSharp#742](https://github.com/restsharp/RestSharp/issues/742). +NOTE: RestSharp for .Net Core creates a new socket for each api call, which can lead to a socket exhaustion problem. See [RestSharp#1406](https://github.com/restsharp/RestSharp/issues/1406). ## Installation @@ -74,8 +75,8 @@ namespace Example Configuration config = new Configuration(); config.BasePath = "https://api-gateway.sajari.com"; // Configure HTTP basic authorization: BasicAuth - config.Username = "KEY_ID"; - config.Password = "KEY_SECRET"; + config.Username = "YOUR_USERNAME"; + config.Password = "YOUR_PASSWORD"; var apiInstance = new CollectionsApi(config); var collectionId = collectionId_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\\-]*$`. @@ -110,9 +111,11 @@ Class | Method | HTTP request | Description *CollectionsApi* | [**DeleteCollection**](docs/CollectionsApi.md#deletecollection) | **DELETE** /v4/collections/{collection_id} | Delete collection *CollectionsApi* | [**GetCollection**](docs/CollectionsApi.md#getcollection) | **GET** /v4/collections/{collection_id} | Get collection *CollectionsApi* | [**ListCollections**](docs/CollectionsApi.md#listcollections) | **GET** /v4/collections | List collections -*CollectionsApi* | [**QueryCollection**](docs/CollectionsApi.md#querycollection) | **POST** /v4/collections/{collection_id}:queryCollection | Query collection +*CollectionsApi* | [**QueryCollection**](docs/CollectionsApi.md#querycollection) | **POST** /v4/collections/{collection_id}:query | Query collection +*CollectionsApi* | [**QueryCollection2**](docs/CollectionsApi.md#querycollection2) | **POST** /v4/collections/{collection_id}:queryCollection | Query collection *CollectionsApi* | [**UpdateCollection**](docs/CollectionsApi.md#updatecollection) | **PATCH** /v4/collections/{collection_id} | Update collection -*EventsApi* | [**SendEvent**](docs/EventsApi.md#sendevent) | **POST** /v4/events:sendEvent | Send event +*EventsApi* | [**SendEvent**](docs/EventsApi.md#sendevent) | **POST** /v4/events:send | Send event +*EventsApi* | [**SendEvent2**](docs/EventsApi.md#sendevent2) | **POST** /v4/events:sendEvent | Send event *PipelinesApi* | [**CreatePipeline**](docs/PipelinesApi.md#createpipeline) | **POST** /v4/collections/{collection_id}/pipelines | Create pipeline *PipelinesApi* | [**GeneratePipelines**](docs/PipelinesApi.md#generatepipelines) | **POST** /v4/collections/{collection_id}:generatePipelines | Generate pipelines *PipelinesApi* | [**GetDefaultPipeline**](docs/PipelinesApi.md#getdefaultpipeline) | **GET** /v4/collections/{collection_id}:getDefaultPipeline | Get default pipeline @@ -124,6 +127,7 @@ Class | Method | HTTP request | Description *RecordsApi* | [**BatchUpsertRecords**](docs/RecordsApi.md#batchupsertrecords) | **POST** /v4/collections/{collection_id}/records:batchUpsert | Batch upsert records *RecordsApi* | [**DeleteRecord**](docs/RecordsApi.md#deleterecord) | **POST** /v4/collections/{collection_id}/records:delete | Delete record *RecordsApi* | [**GetRecord**](docs/RecordsApi.md#getrecord) | **POST** /v4/collections/{collection_id}/records:get | Get record +*RecordsApi* | [**UpdateRecord**](docs/RecordsApi.md#updaterecord) | **POST** /v4/collections/{collection_id}/records:update | Update record *RecordsApi* | [**UpsertRecord**](docs/RecordsApi.md#upsertrecord) | **POST** /v4/collections/{collection_id}/records:upsert | Upsert record *SchemaApi* | [**BatchCreateSchemaFields**](docs/SchemaApi.md#batchcreateschemafields) | **POST** /v4/collections/{collection_id}/schemaFields:batchCreate | Batch create schema fields *SchemaApi* | [**CreateSchemaField**](docs/SchemaApi.md#createschemafield) | **POST** /v4/collections/{collection_id}/schemaFields | Create schema field @@ -188,6 +192,7 @@ Class | Method | HTTP request | Description - [Model.SetDefaultPipelineRequest](docs/SetDefaultPipelineRequest.md) - [Model.SetDefaultVersionRequest](docs/SetDefaultVersionRequest.md) - [Model.Status](docs/Status.md) + - [Model.UpdateRecordRequest](docs/UpdateRecordRequest.md) - [Model.UpsertRecordRequest](docs/UpsertRecordRequest.md) - [Model.UpsertRecordRequestPipeline](docs/UpsertRecordRequestPipeline.md) - [Model.UpsertRecordResponse](docs/UpsertRecordResponse.md) diff --git a/docs/BatchCreateSchemaFieldsRequest.md b/docs/BatchCreateSchemaFieldsRequest.md index 1b39605..54484ae 100644 --- a/docs/BatchCreateSchemaFieldsRequest.md +++ b/docs/BatchCreateSchemaFieldsRequest.md @@ -1,4 +1,5 @@ # Com.Sajari.Sdk.Model.BatchCreateSchemaFieldsRequest + ## Properties Name | Type | Description | Notes diff --git a/docs/BatchCreateSchemaFieldsResponse.md b/docs/BatchCreateSchemaFieldsResponse.md index a5ef81a..2f54da4 100644 --- a/docs/BatchCreateSchemaFieldsResponse.md +++ b/docs/BatchCreateSchemaFieldsResponse.md @@ -1,10 +1,11 @@ # Com.Sajari.Sdk.Model.BatchCreateSchemaFieldsResponse + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Fields** | [**List<SchemaField>**](SchemaField.md) | Schema fields created. | [optional] **Errors** | [**List<BatchCreateSchemaFieldsResponseError>**](BatchCreateSchemaFieldsResponseError.md) | Errors that occurred. | [optional] +**Fields** | [**List<SchemaField>**](SchemaField.md) | Schema fields created. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/BatchCreateSchemaFieldsResponseError.md b/docs/BatchCreateSchemaFieldsResponseError.md index 39030da..bfca3b7 100644 --- a/docs/BatchCreateSchemaFieldsResponseError.md +++ b/docs/BatchCreateSchemaFieldsResponseError.md @@ -1,4 +1,5 @@ # Com.Sajari.Sdk.Model.BatchCreateSchemaFieldsResponseError + ## Properties Name | Type | Description | Notes diff --git a/docs/BatchUpsertRecordsRequest.md b/docs/BatchUpsertRecordsRequest.md index 39270c7..6793248 100644 --- a/docs/BatchUpsertRecordsRequest.md +++ b/docs/BatchUpsertRecordsRequest.md @@ -1,11 +1,12 @@ # Com.Sajari.Sdk.Model.BatchUpsertRecordsRequest + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Pipeline** | [**BatchUpsertRecordsRequestPipeline**](BatchUpsertRecordsRequestPipeline.md) | | [optional] -**Records** | **List<Object>** | A list of records to upsert. | -**Variables** | **Object** | The initial values for the variables the pipeline operates on and transforms throughout its steps. | [optional] +**Records** | **List<Object>** | A list of records to upsert. A maximum of 200 records can be upsert in a batch. | +**Variables** | **Dictionary<string, Object>** | The initial values for the variables the pipeline operates on and transforms throughout its steps. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/BatchUpsertRecordsRequestPipeline.md b/docs/BatchUpsertRecordsRequestPipeline.md index 3fc1dcd..fab1d9d 100644 --- a/docs/BatchUpsertRecordsRequestPipeline.md +++ b/docs/BatchUpsertRecordsRequestPipeline.md @@ -1,11 +1,12 @@ # Com.Sajari.Sdk.Model.BatchUpsertRecordsRequestPipeline The pipeline to use when upserting the records. If not provided the default record pipeline is used. + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Name** | **string** | The record pipeline's name, e.g. `my-pipeline`. | -**Version** | **string** | The record pipeline's version, e.g. `42`. If not provided the default version is used. | [optional] +**_Version** | **string** | The record pipeline's version, e.g. `42`. If not provided the default version is used. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/BatchUpsertRecordsResponse.md b/docs/BatchUpsertRecordsResponse.md index b5f719f..b502c47 100644 --- a/docs/BatchUpsertRecordsResponse.md +++ b/docs/BatchUpsertRecordsResponse.md @@ -1,11 +1,12 @@ # Com.Sajari.Sdk.Model.BatchUpsertRecordsResponse + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**Errors** | [**List<BatchUpsertRecordsResponseError>**](BatchUpsertRecordsResponseError.md) | Errors that occurred. | [optional] **Keys** | [**List<BatchUpsertRecordsResponseKey>**](BatchUpsertRecordsResponseKey.md) | A list of keys of the records that were inserted. If a record was inserted, keys contains an entry containing the index of the inserted record from `records` and the key. You can use the key if you need to retrieve or delete the record. If a record was updated, keys contains no such entry for the updated record. | [optional] **Variables** | [**List<BatchUpsertRecordsResponseVariables>**](BatchUpsertRecordsResponseVariables.md) | A list of modified variables returned by the pipeline after it has finished processing each record. | [optional] -**Errors** | [**List<BatchUpsertRecordsResponseError>**](BatchUpsertRecordsResponseError.md) | Errors that occurred. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/BatchUpsertRecordsResponseError.md b/docs/BatchUpsertRecordsResponseError.md index 1e9e933..bc17191 100644 --- a/docs/BatchUpsertRecordsResponseError.md +++ b/docs/BatchUpsertRecordsResponseError.md @@ -1,4 +1,5 @@ # Com.Sajari.Sdk.Model.BatchUpsertRecordsResponseError + ## Properties Name | Type | Description | Notes diff --git a/docs/BatchUpsertRecordsResponseKey.md b/docs/BatchUpsertRecordsResponseKey.md index 6dae5bb..0c09a08 100644 --- a/docs/BatchUpsertRecordsResponseKey.md +++ b/docs/BatchUpsertRecordsResponseKey.md @@ -1,4 +1,5 @@ # Com.Sajari.Sdk.Model.BatchUpsertRecordsResponseKey + ## Properties Name | Type | Description | Notes diff --git a/docs/BatchUpsertRecordsResponseVariables.md b/docs/BatchUpsertRecordsResponseVariables.md index bad8ef2..8831b61 100644 --- a/docs/BatchUpsertRecordsResponseVariables.md +++ b/docs/BatchUpsertRecordsResponseVariables.md @@ -1,10 +1,11 @@ # Com.Sajari.Sdk.Model.BatchUpsertRecordsResponseVariables + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Index** | **int** | Index of the record in `records` that these variables correspond to. | [optional] -**Variables** | **Object** | The variables. | [optional] +**Variables** | **Dictionary<string, Object>** | The variables. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/Collection.md b/docs/Collection.md index 2da6e85..fa2cf8f 100644 --- a/docs/Collection.md +++ b/docs/Collection.md @@ -1,13 +1,14 @@ # Com.Sajari.Sdk.Model.Collection + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | **string** | Output only. The collection's ID. | [optional] [readonly] **AccountId** | **string** | Output only. The ID of the account that owns this collection. | [optional] [readonly] -**CreateTime** | **DateTime** | Output only. Creation time of the collection. | [optional] [readonly] -**DisplayName** | **string** | The collection's display name. You can change this at any time. | **AuthorizedQueryDomains** | **List<string>** | The list of authorized query domains for the collection. Client-side / browser requests to the [QueryCollection](/api#operation/QueryCollection) call can be made by any authorized query domain or any of its subdomains. This allows your interface to make search requests without having to provide an API key in the client-side request. | [optional] +**CreateTime** | **DateTime** | Output only. Time the collection was created. | [optional] [readonly] +**DisplayName** | **string** | The collection's display name. You can change this at any time. | +**Id** | **string** | Output only. The collection's ID. | [optional] [readonly] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/CollectionsApi.md b/docs/CollectionsApi.md index b6f5c13..0a2f345 100644 --- a/docs/CollectionsApi.md +++ b/docs/CollectionsApi.md @@ -8,7 +8,8 @@ Method | HTTP request | Description [**DeleteCollection**](CollectionsApi.md#deletecollection) | **DELETE** /v4/collections/{collection_id} | Delete collection [**GetCollection**](CollectionsApi.md#getcollection) | **GET** /v4/collections/{collection_id} | Get collection [**ListCollections**](CollectionsApi.md#listcollections) | **GET** /v4/collections | List collections -[**QueryCollection**](CollectionsApi.md#querycollection) | **POST** /v4/collections/{collection_id}:queryCollection | Query collection +[**QueryCollection**](CollectionsApi.md#querycollection) | **POST** /v4/collections/{collection_id}:query | Query collection +[**QueryCollection2**](CollectionsApi.md#querycollection2) | **POST** /v4/collections/{collection_id}:queryCollection | Query collection [**UpdateCollection**](CollectionsApi.md#updatecollection) | **PATCH** /v4/collections/{collection_id} | Update collection @@ -81,6 +82,7 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json + ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| @@ -91,7 +93,7 @@ Name | Type | Description | Notes | **404** | Returned when the resource does not exist. | - | | **409** | Returned when the collection already exists. | - | | **500** | Returned when the API encounters an internal error. | - | -| **0** | An unexpected error response | - | +| **0** | An unexpected error response. | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -162,6 +164,7 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json + ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| @@ -170,7 +173,7 @@ Name | Type | Description | Notes | **403** | Returned when the user does not have permission to access the resource. | - | | **404** | Returned when the collection was not found. | - | | **500** | Returned when the API encounters an internal error. | - | -| **0** | An unexpected error response | - | +| **0** | An unexpected error response. | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -241,6 +244,7 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json + ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| @@ -249,7 +253,7 @@ Name | Type | Description | Notes | **403** | Returned when the user does not have permission to access the resource. | - | | **404** | Returned when the resource does not exist. | - | | **500** | Returned when the API encounters an internal error. | - | -| **0** | An unexpected error response | - | +| **0** | An unexpected error response. | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -259,7 +263,7 @@ Name | Type | Description | Notes List collections -Retrieve a list of collections in the account. +Retrieve a list of collections in an account. ### Example ```csharp @@ -322,6 +326,7 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json + ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| @@ -330,7 +335,7 @@ Name | Type | Description | Notes | **403** | Returned when the user does not have permission to access the resource. | - | | **404** | Returned when the resource does not exist. | - | | **500** | Returned when the API encounters an internal error. | - | -| **0** | An unexpected error response | - | +| **0** | An unexpected error response. | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -403,6 +408,7 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json + ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| @@ -411,13 +417,95 @@ Name | Type | Description | Notes | **403** | Returned when the user does not have permission to access the resource. | - | | **404** | Returned when the resource does not exist. | - | | **500** | Returned when the API encounters an internal error. | - | -| **0** | An unexpected error response | - | +| **0** | An unexpected error response. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **QueryCollection2** +> QueryCollectionResponse QueryCollection2 (string collectionId, QueryCollectionRequest queryCollectionRequest) + +Query collection + +Query the collection to search for records. The following example demonstrates how to run a simple search for a particular string: ```json { \"variables\": { \"q\": \"search terms\" } } ``` For more information: - See [filtering content](https://docs.sajari.com/user-guide/integrating-search/filters/) - See [tracking in the Go SDK](https://github.com/sajari/sdk-go/blob/v2/session.go) - See [tracking in the JS SDK](https://github.com/sajari/sajari-sdk-js/blob/master/src/session.ts) + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Com.Sajari.Sdk.Api; +using Com.Sajari.Sdk.Client; +using Com.Sajari.Sdk.Model; + +namespace Example +{ + public class QueryCollection2Example + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "https://api-gateway.sajari.com"; + // Configure HTTP basic authorization: BasicAuth + config.Username = "YOUR_USERNAME"; + config.Password = "YOUR_PASSWORD"; + + var apiInstance = new CollectionsApi(config); + var collectionId = collectionId_example; // string | The collection to query, e.g. `my-collection`. + var queryCollectionRequest = new QueryCollectionRequest(); // QueryCollectionRequest | + + try + { + // Query collection + QueryCollectionResponse result = apiInstance.QueryCollection2(collectionId, queryCollectionRequest); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling CollectionsApi.QueryCollection2: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **collectionId** | **string**| The collection to query, e.g. `my-collection`. | + **queryCollectionRequest** | [**QueryCollectionRequest**](QueryCollectionRequest.md)| | + +### Return type + +[**QueryCollectionResponse**](QueryCollectionResponse.md) + +### Authorization + +[BasicAuth](../README.md#BasicAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | A successful response. | - | +| **401** | Returned when the request does not have valid authentication credentials. | - | +| **403** | Returned when the user does not have permission to access the resource. | - | +| **404** | Returned when the resource does not exist. | - | +| **500** | Returned when the API encounters an internal error. | - | +| **0** | An unexpected error response. | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **UpdateCollection** -> Collection UpdateCollection (string collectionId, Collection collection, string updateMask = null) +> Collection UpdateCollection (string collectionId, string updateMask, Collection collection) Update collection @@ -445,13 +533,13 @@ namespace Example var apiInstance = new CollectionsApi(config); var collectionId = collectionId_example; // string | The collection to update, e.g. `my-collection`. + var updateMask = updateMask_example; // string | The list of fields to be updated, separated by a comma, e.g. `field1,field2`. Each field should be in snake case, e.g. `display_name`. For each field that you want to update, provide a corresponding value in the collection object containing the new value. var collection = new Collection(); // Collection | Details of the collection to update. - var updateMask = updateMask_example; // string | The list of fields to be updated, separated by a comma, e.g. `field1,field2`. Each field should be in snake case, e.g. `display_name`. For each field that you want to update, provide a corresponding value in the collection object containing the new value. (optional) try { // Update collection - Collection result = apiInstance.UpdateCollection(collectionId, collection, updateMask); + Collection result = apiInstance.UpdateCollection(collectionId, updateMask, collection); Debug.WriteLine(result); } catch (ApiException e) @@ -470,8 +558,8 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **collectionId** | **string**| The collection to update, e.g. `my-collection`. | + **updateMask** | **string**| The list of fields to be updated, separated by a comma, e.g. `field1,field2`. Each field should be in snake case, e.g. `display_name`. For each field that you want to update, provide a corresponding value in the collection object containing the new value. | **collection** | [**Collection**](Collection.md)| Details of the collection to update. | - **updateMask** | **string**| The list of fields to be updated, separated by a comma, e.g. `field1,field2`. Each field should be in snake case, e.g. `display_name`. For each field that you want to update, provide a corresponding value in the collection object containing the new value. | [optional] ### Return type @@ -486,6 +574,7 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json + ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| @@ -494,7 +583,7 @@ Name | Type | Description | Notes | **403** | Returned when the user does not have permission to access the resource. | - | | **404** | Returned when the collection was not found. | - | | **500** | Returned when the API encounters an internal error. | - | -| **0** | An unexpected error response | - | +| **0** | An unexpected error response. | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/docs/DeleteRecordRequest.md b/docs/DeleteRecordRequest.md index 5d0da7c..eade51a 100644 --- a/docs/DeleteRecordRequest.md +++ b/docs/DeleteRecordRequest.md @@ -1,4 +1,5 @@ # Com.Sajari.Sdk.Model.DeleteRecordRequest + ## Properties Name | Type | Description | Notes diff --git a/docs/Error.md b/docs/Error.md index b157497..dd39239 100644 --- a/docs/Error.md +++ b/docs/Error.md @@ -1,11 +1,12 @@ # Com.Sajari.Sdk.Model.Error + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Code** | **int** | | [optional] -**Message** | **string** | | [optional] **Details** | [**List<ProtobufAny>**](ProtobufAny.md) | | [optional] +**Message** | **string** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/EventsApi.md b/docs/EventsApi.md index 63d8edd..dc281f2 100644 --- a/docs/EventsApi.md +++ b/docs/EventsApi.md @@ -4,7 +4,8 @@ All URIs are relative to *https://api-gateway.sajari.com* Method | HTTP request | Description ------------- | ------------- | ------------- -[**SendEvent**](EventsApi.md#sendevent) | **POST** /v4/events:sendEvent | Send event +[**SendEvent**](EventsApi.md#sendevent) | **POST** /v4/events:send | Send event +[**SendEvent2**](EventsApi.md#sendevent2) | **POST** /v4/events:sendEvent | Send event @@ -74,6 +75,88 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | A successful response. | - | +| **400** | Returned when the request contains violations for one or more fields. | - | +| **401** | Returned when the request does not have valid authentication credentials. | - | +| **403** | Returned when the user does not have permission to access the resource. | - | +| **404** | Returned when the resource does not exist. | - | +| **500** | Returned when the API encounters an internal error. | - | +| **0** | An unexpected error response. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **SendEvent2** +> Object SendEvent2 (SendEventRequest sendEventRequest) + +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\" } } ``` + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Com.Sajari.Sdk.Api; +using Com.Sajari.Sdk.Client; +using Com.Sajari.Sdk.Model; + +namespace Example +{ + public class SendEvent2Example + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "https://api-gateway.sajari.com"; + // Configure HTTP basic authorization: BasicAuth + config.Username = "YOUR_USERNAME"; + config.Password = "YOUR_PASSWORD"; + + var apiInstance = new EventsApi(config); + var sendEventRequest = new SendEventRequest(); // SendEventRequest | + + try + { + // Send event + Object result = apiInstance.SendEvent2(sendEventRequest); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling EventsApi.SendEvent2: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **sendEventRequest** | [**SendEventRequest**](SendEventRequest.md)| | + +### Return type + +**Object** + +### Authorization + +[BasicAuth](../README.md#BasicAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| @@ -83,7 +166,7 @@ Name | Type | Description | Notes | **403** | Returned when the user does not have permission to access the resource. | - | | **404** | Returned when the resource does not exist. | - | | **500** | Returned when the API encounters an internal error. | - | -| **0** | An unexpected error response | - | +| **0** | An unexpected error response. | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/docs/GeneratePipelinesRequest.md b/docs/GeneratePipelinesRequest.md index 532dab7..c4f43c8 100644 --- a/docs/GeneratePipelinesRequest.md +++ b/docs/GeneratePipelinesRequest.md @@ -1,10 +1,11 @@ # Com.Sajari.Sdk.Model.GeneratePipelinesRequest + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**SearchableFields** | **List<string>** | Prioritized list of fields to search. | **QueryTrainingFields** | **List<string>** | List of fields to train query suggestions from. | [optional] +**SearchableFields** | **List<string>** | Prioritized list of fields to search. | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/GeneratePipelinesResponse.md b/docs/GeneratePipelinesResponse.md index b9d462f..4f8a4d0 100644 --- a/docs/GeneratePipelinesResponse.md +++ b/docs/GeneratePipelinesResponse.md @@ -1,11 +1,12 @@ # Com.Sajari.Sdk.Model.GeneratePipelinesResponse + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**RecordPipeline** | [**Pipeline**](Pipeline.md) | | [optional] -**QueryPipeline** | [**Pipeline**](Pipeline.md) | | [optional] **AutocompletePipeline** | [**Pipeline**](Pipeline.md) | | [optional] +**QueryPipeline** | [**Pipeline**](Pipeline.md) | | [optional] +**RecordPipeline** | [**Pipeline**](Pipeline.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/GetDefaultPipelineResponse.md b/docs/GetDefaultPipelineResponse.md index 5f46d39..7788754 100644 --- a/docs/GetDefaultPipelineResponse.md +++ b/docs/GetDefaultPipelineResponse.md @@ -1,4 +1,5 @@ # Com.Sajari.Sdk.Model.GetDefaultPipelineResponse + ## Properties Name | Type | Description | Notes diff --git a/docs/GetDefaultVersionRequestView.md b/docs/GetDefaultVersionRequestView.md index 27a8eea..aa70180 100644 --- a/docs/GetDefaultVersionRequestView.md +++ b/docs/GetDefaultVersionRequestView.md @@ -1,5 +1,6 @@ # Com.Sajari.Sdk.Model.GetDefaultVersionRequestView - VIEW_UNSPECIFIED: The default / unset value. The API defaults to the `BASIC` view. - BASIC: Include basic information including type, name, version and description but not the full step configuration. This is the default value (for both [ListPipelines](/api#operation/ListPipelines) and [GetPipeline](/api#operation/GetPipeline)). - FULL: Include the information from `BASIC`, plus full step configuration. + ## Properties Name | Type | Description | Notes diff --git a/docs/GetPipelineRequestView.md b/docs/GetPipelineRequestView.md index 5cf088c..d0c8bac 100644 --- a/docs/GetPipelineRequestView.md +++ b/docs/GetPipelineRequestView.md @@ -1,5 +1,6 @@ # Com.Sajari.Sdk.Model.GetPipelineRequestView - VIEW_UNSPECIFIED: The default / unset value. The API defaults to the `BASIC` view. - BASIC: Include basic information including type, name, version and description but not the full step configuration. This is the default value (for both [ListPipelines](/api#operation/ListPipelines) and [GetPipeline](/api#operation/GetPipeline)). - FULL: Include the information from `BASIC`, plus full step configuration. + ## Properties Name | Type | Description | Notes diff --git a/docs/GetRecordRequest.md b/docs/GetRecordRequest.md index 7f47830..37649ad 100644 --- a/docs/GetRecordRequest.md +++ b/docs/GetRecordRequest.md @@ -1,4 +1,5 @@ # Com.Sajari.Sdk.Model.GetRecordRequest + ## Properties Name | Type | Description | Notes diff --git a/docs/ListCollectionsResponse.md b/docs/ListCollectionsResponse.md index b75091b..1b9249e 100644 --- a/docs/ListCollectionsResponse.md +++ b/docs/ListCollectionsResponse.md @@ -1,4 +1,5 @@ # Com.Sajari.Sdk.Model.ListCollectionsResponse + ## Properties Name | Type | Description | Notes diff --git a/docs/ListPipelinesRequestView.md b/docs/ListPipelinesRequestView.md index 548d549..bd89aaf 100644 --- a/docs/ListPipelinesRequestView.md +++ b/docs/ListPipelinesRequestView.md @@ -1,5 +1,6 @@ # Com.Sajari.Sdk.Model.ListPipelinesRequestView - VIEW_UNSPECIFIED: The default / unset value. The API defaults to the `BASIC` view. - BASIC: Include basic information including type, name, version and description but not the full step configuration. This is the default value (for both [ListPipelines](/api#operation/ListPipelines) and [GetPipeline](/api#operation/GetPipeline)). - FULL: Include the information from `BASIC`, plus full step configuration. + ## Properties Name | Type | Description | Notes diff --git a/docs/ListPipelinesResponse.md b/docs/ListPipelinesResponse.md index be92e06..d7b85d0 100644 --- a/docs/ListPipelinesResponse.md +++ b/docs/ListPipelinesResponse.md @@ -1,10 +1,11 @@ # Com.Sajari.Sdk.Model.ListPipelinesResponse + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Pipelines** | [**List<Pipeline>**](Pipeline.md) | The pipelines from the specified collection. | [optional] **NextPageToken** | **string** | A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages. | [optional] +**Pipelines** | [**List<Pipeline>**](Pipeline.md) | The pipelines from the specified collection. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ListSchemaFieldsResponse.md b/docs/ListSchemaFieldsResponse.md index 1b15607..bb340dd 100644 --- a/docs/ListSchemaFieldsResponse.md +++ b/docs/ListSchemaFieldsResponse.md @@ -1,11 +1,12 @@ # Com.Sajari.Sdk.Model.ListSchemaFieldsResponse + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**NextPageToken** | **string** | A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages. | [optional] **SchemaFields** | [**List<SchemaField>**](SchemaField.md) | The schema fields. | [optional] **TotalSize** | **int** | Maximum number of fields to return. | [optional] -**NextPageToken** | **string** | A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/PercentileDataPoint.md b/docs/PercentileDataPoint.md index 58e25e9..8c1b5d3 100644 --- a/docs/PercentileDataPoint.md +++ b/docs/PercentileDataPoint.md @@ -1,4 +1,5 @@ # Com.Sajari.Sdk.Model.PercentileDataPoint + ## Properties Name | Type | Description | Notes diff --git a/docs/Pipeline.md b/docs/Pipeline.md index 53bef07..ab7bf4f 100644 --- a/docs/Pipeline.md +++ b/docs/Pipeline.md @@ -1,17 +1,18 @@ # Com.Sajari.Sdk.Model.Pipeline + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**CreateTime** | **DateTime** | Output only. Creation time of the pipeline. | [optional] [readonly] -**Type** | **PipelineType** | | -**Name** | **string** | The pipeline's name. Must start with an alphanumeric character followed by one or more alphanumeric, `_`, `-` or `.` characters. Strictly speaking, it must match the regular expression: `^[a-zA-Z0-9][a-zA-Z0-9_\\-\\.]+$`. | -**Version** | **string** | The pipeline's version. Must start with an alphanumeric character followed by one or more alphanumeric, `_`, `-` or `.` characters. Strictly speaking, it must match the regular expression: `^[a-zA-Z0-9][a-zA-Z0-9_\\-\\.]+$`. | -**Description** | **string** | Description of the pipeline. | [optional] -**PreSteps** | [**List<PipelineStep>**](PipelineStep.md) | Pre-steps are run before an indexing operation or query request is sent to the search index. | [optional] -**PostSteps** | [**List<PipelineStep>**](PipelineStep.md) | Post-steps are run after an indexing operation or query request has been sent to the search index. For indexing operations, the post-steps only run when creating new records. They do not run when updating records. For querying, the post-steps have access to the result-set. This makes it possible to act on the results before sending them back to the caller. | [optional] **CollectionDefault** | **bool** | Output only. Indicates if the pipeline is the collection default pipeline. | [optional] [readonly] +**CreateTime** | **DateTime** | Output only. Time the pipeline was created. | [optional] [readonly] **DefaultVersion** | **bool** | Output only. Indicates if the pipeline is the default version. | [optional] [readonly] +**Description** | **string** | Description of the pipeline. | [optional] +**Name** | **string** | The pipeline's name. Must start with an alphanumeric character followed by one or more alphanumeric, `_`, `-` or `.` characters. Strictly speaking, it must match the regular expression: `^[a-zA-Z0-9][a-zA-Z0-9_\\-\\.]+$`. | +**PostSteps** | [**List<PipelineStep>**](PipelineStep.md) | Post-steps are run after an indexing operation or query request has been sent to the search index. For indexing operations, the post-steps only run when creating new records. They do not run when updating records. For querying, the post-steps have access to the result-set. This makes it possible to act on the results before sending them back to the caller. | [optional] +**PreSteps** | [**List<PipelineStep>**](PipelineStep.md) | Pre-steps are run before an indexing operation or query request is sent to the search index. | [optional] +**Type** | **PipelineType** | | +**_Version** | **string** | The pipeline's version. Must start with an alphanumeric character followed by one or more alphanumeric, `_`, `-` or `.` characters. Strictly speaking, it must match the regular expression: `^[a-zA-Z0-9][a-zA-Z0-9_\\-\\.]+$`. | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/PipelineStep.md b/docs/PipelineStep.md index 2ac60b5..c6dd6ce 100644 --- a/docs/PipelineStep.md +++ b/docs/PipelineStep.md @@ -1,15 +1,16 @@ # Com.Sajari.Sdk.Model.PipelineStep Step creates a pipeline step. + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | **string** | ID of the step template. | -**Title** | **string** | Title for the step. Overrides the default title. | [optional] +**Annotations** | **List<string>** | Annotations added to the request when the step is run. | [optional] +**Condition** | **string** | Condition expression to determine if the step should be run. This is a filter expression much like the query filter expression, but it acts upon the pipeline variables. For example, to only run the step if the pipeline `q` variable is not empty, set this to `q != ''`. | [optional] **Description** | **string** | Description for the step. Overrides the default description. | [optional] +**Id** | **string** | ID of the step template. | **Params** | [**Dictionary<string, PipelineStepParamBinding>**](PipelineStepParamBinding.md) | Bindings for the step parameters. | [optional] -**Condition** | **string** | Condition expression to determine if the step should be run. This is a filter expression much like the query filter expression, but it acts upon the pipeline variables. For example, to only run the step if the pipeline `q` variable is not empty, set this to `q != ''`. | [optional] -**Annotations** | **List<string>** | Annotations added to the request when the step is run. | [optional] +**Title** | **string** | Title for the step. Overrides the default title. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/PipelineStepParamBinding.md b/docs/PipelineStepParamBinding.md index 18a03e0..ab3b74b 100644 --- a/docs/PipelineStepParamBinding.md +++ b/docs/PipelineStepParamBinding.md @@ -1,12 +1,13 @@ # Com.Sajari.Sdk.Model.PipelineStepParamBinding + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Bind** | **string** | Bind the step parameter to a pipeline variable. | [optional] -**Description** | **string** | Set the description of the step parameter. | [optional] -**DefaultValue** | **string** | Set a default value for the step parameter. This allows you to set a default value for the step parameter when it is not bound to a pipeline variable. | [optional] **Constant** | **string** | Bind the step parameter to a constant value. | [optional] +**DefaultValue** | **string** | Set a default value for the step parameter. This allows you to set a default value for the step parameter when it is not bound to a pipeline variable. | [optional] +**Description** | **string** | Set the description of the step parameter. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/PipelineType.md b/docs/PipelineType.md index fa5be90..6e4296c 100644 --- a/docs/PipelineType.md +++ b/docs/PipelineType.md @@ -1,5 +1,6 @@ # Com.Sajari.Sdk.Model.PipelineType - TYPE_UNSPECIFIED: Pipeline type not specified. - RECORD: Record pipeline. - QUERY: Query pipeline. + ## Properties Name | Type | Description | Notes diff --git a/docs/PipelinesApi.md b/docs/PipelinesApi.md index c3f2f04..bc0e9fc 100644 --- a/docs/PipelinesApi.md +++ b/docs/PipelinesApi.md @@ -83,6 +83,7 @@ Name | Type | Description | Notes - **Content-Type**: application/json, application/yaml - **Accept**: application/json, application/yaml + ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| @@ -91,7 +92,7 @@ Name | Type | Description | Notes | **403** | Returned when the user does not have permission to access the resource. | - | | **404** | Returned when the resource does not exist. | - | | **500** | Returned when the API encounters an internal error. | - | -| **0** | An unexpected error response | - | +| **0** | An unexpected error response. | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -164,6 +165,7 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json, application/yaml + ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| @@ -172,7 +174,7 @@ Name | Type | Description | Notes | **403** | Returned when the user does not have permission to access the resource. | - | | **404** | Returned when the resource does not exist. | - | | **500** | Returned when the API encounters an internal error. | - | -| **0** | An unexpected error response | - | +| **0** | An unexpected error response. | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -245,6 +247,7 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json + ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| @@ -253,7 +256,7 @@ Name | Type | Description | Notes | **403** | Returned when the user does not have permission to access the resource. | - | | **404** | Returned when the resource does not exist. | - | | **500** | Returned when the API encounters an internal error. | - | -| **0** | An unexpected error response | - | +| **0** | An unexpected error response. | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -330,6 +333,7 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json, application/yaml + ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| @@ -338,7 +342,7 @@ Name | Type | Description | Notes | **403** | Returned when the user does not have permission to access the resource. | - | | **404** | Returned when the pipeline does not have a default version. | - | | **500** | Returned when the API encounters an internal error. | - | -| **0** | An unexpected error response | - | +| **0** | An unexpected error response. | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -417,6 +421,7 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json, application/yaml + ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| @@ -425,7 +430,7 @@ Name | Type | Description | Notes | **403** | Returned when the user does not have permission to access the resource. | - | | **404** | Returned when the resource does not exist. | - | | **500** | Returned when the API encounters an internal error. | - | -| **0** | An unexpected error response | - | +| **0** | An unexpected error response. | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -435,7 +440,7 @@ Name | Type | Description | Notes List pipelines -Retrieve a list of pipelines. +Retrieve a list of pipelines in a collection. ### Example ```csharp @@ -502,6 +507,7 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json + ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| @@ -510,7 +516,7 @@ Name | Type | Description | Notes | **403** | Returned when the user does not have permission to access the resource. | - | | **404** | Returned when the resource does not exist. | - | | **500** | Returned when the API encounters an internal error. | - | -| **0** | An unexpected error response | - | +| **0** | An unexpected error response. | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -583,6 +589,7 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json + ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| @@ -591,7 +598,7 @@ Name | Type | Description | Notes | **403** | Returned when the user does not have permission to access the resource. | - | | **404** | Returned when the resource does not exist. | - | | **500** | Returned when the API encounters an internal error. | - | -| **0** | An unexpected error response | - | +| **0** | An unexpected error response. | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -668,6 +675,7 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json + ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| @@ -676,7 +684,7 @@ Name | Type | Description | Notes | **403** | Returned when the user does not have permission to access the resource. | - | | **404** | Returned when the resource does not exist. | - | | **500** | Returned when the API encounters an internal error. | - | -| **0** | An unexpected error response | - | +| **0** | An unexpected error response. | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/docs/ProtobufAny.md b/docs/ProtobufAny.md index c37e50a..23b2f1c 100644 --- a/docs/ProtobufAny.md +++ b/docs/ProtobufAny.md @@ -1,5 +1,6 @@ # Com.Sajari.Sdk.Model.ProtobufAny `Any` contains an arbitrary serialized protocol buffer message along with a URL that describes the type of the serialized message. Protobuf library provides support to pack/unpack Any values in the form of utility functions or additional generated methods of the Any type. Example 1: Pack and unpack a message in C++. Foo foo = ...; Any any; any.PackFrom(foo); ... if (any.UnpackTo(&foo)) { ... } Example 2: Pack and unpack a message in Java. Foo foo = ...; Any any = Any.pack(foo); ... if (any.is(Foo.class)) { foo = any.unpack(Foo.class); } Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() any.Pack(foo) ... if any.Is(Foo.DESCRIPTOR): any.Unpack(foo) ... Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := ptypes.MarshalAny(foo) ... foo := &pb.Foo{} if err := ptypes.UnmarshalAny(any, foo); err != nil { ... } The pack methods provided by protobuf library will by default use 'type.googleapis.com/full.type.name' as the type URL and the unpack methods only use the fully qualified type name after the last '/' in the type URL, for example \"foo.bar.com/x/y.z\" will yield type name \"y.z\". JSON ==== The JSON representation of an `Any` value uses the regular representation of the deserialized, embedded message, with an additional field `@type` which contains the type URL. Example: package google.profile; message Person { string first_name = 1; string last_name = 2; } { \"@type\": \"type.googleapis.com/google.profile.Person\", \"firstName\": , \"lastName\": } If the embedded message type is well-known and has a custom JSON representation, that representation will be embedded adding a field `value` which holds the custom JSON in addition to the `@type` field. Example (for message [google.protobuf.Duration][]): { \"@type\": \"type.googleapis.com/google.protobuf.Duration\", \"value\": \"1.212s\" } + ## Properties Name | Type | Description | Notes diff --git a/docs/ProtobufNullValue.md b/docs/ProtobufNullValue.md index c04381a..50a6408 100644 --- a/docs/ProtobufNullValue.md +++ b/docs/ProtobufNullValue.md @@ -1,5 +1,6 @@ # Com.Sajari.Sdk.Model.ProtobufNullValue `NullValue` is a singleton enumeration to represent the null value for the `Value` type union. The JSON representation for `NullValue` is JSON `null`. - NULL_VALUE: Null value. + ## Properties Name | Type | Description | Notes diff --git a/docs/QueryAggregateResult.md b/docs/QueryAggregateResult.md index 10e1039..142fd6f 100644 --- a/docs/QueryAggregateResult.md +++ b/docs/QueryAggregateResult.md @@ -1,14 +1,15 @@ # Com.Sajari.Sdk.Model.QueryAggregateResult A query aggregate result contains results of aggregations. + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Metric** | [**QueryAggregateResultMetric**](QueryAggregateResultMetric.md) | | [optional] -**Count** | [**QueryAggregateResultCount**](QueryAggregateResultCount.md) | | [optional] +**Analysis** | [**QueryAggregateResultAnalysis**](QueryAggregateResultAnalysis.md) | | [optional] **Buckets** | [**QueryAggregateResultBuckets**](QueryAggregateResultBuckets.md) | | [optional] +**Count** | [**QueryAggregateResultCount**](QueryAggregateResultCount.md) | | [optional] **Date** | [**QueryAggregateResultDate**](QueryAggregateResultDate.md) | | [optional] -**Analysis** | [**QueryAggregateResultAnalysis**](QueryAggregateResultAnalysis.md) | | [optional] +**Metric** | [**QueryAggregateResultMetric**](QueryAggregateResultMetric.md) | | [optional] **Percentile** | [**QueryAggregateResultPercentile**](QueryAggregateResultPercentile.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/QueryAggregateResultAnalysis.md b/docs/QueryAggregateResultAnalysis.md index 08f7217..1fe8634 100644 --- a/docs/QueryAggregateResultAnalysis.md +++ b/docs/QueryAggregateResultAnalysis.md @@ -1,13 +1,14 @@ # Com.Sajari.Sdk.Model.QueryAggregateResultAnalysis + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Coverage** | **int** | Coverage is the number of records which have a value set. | [optional] +**AvgLength** | **float** | Average number of items in an array field. | [optional] **Cardinality** | **int** | Cardinality is the number of different values in a field. | [optional] -**MinLength** | **int** | Minimum length of an array field. | [optional] +**Coverage** | **int** | Coverage is the number of records which have a value set. | [optional] **MaxLength** | **int** | Maximum number of values in an array field. | [optional] -**AvgLength** | **float** | Average number of items in an array field. | [optional] +**MinLength** | **int** | Minimum length of an array field. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/QueryAggregateResultBuckets.md b/docs/QueryAggregateResultBuckets.md index 7ad282e..fe82c61 100644 --- a/docs/QueryAggregateResultBuckets.md +++ b/docs/QueryAggregateResultBuckets.md @@ -1,5 +1,6 @@ # Com.Sajari.Sdk.Model.QueryAggregateResultBuckets Buckets is a full set of buckets computed in an aggregation. + ## Properties Name | Type | Description | Notes diff --git a/docs/QueryAggregateResultBucketsBucket.md b/docs/QueryAggregateResultBucketsBucket.md index 939ecc8..c5cad1e 100644 --- a/docs/QueryAggregateResultBucketsBucket.md +++ b/docs/QueryAggregateResultBucketsBucket.md @@ -1,11 +1,12 @@ # Com.Sajari.Sdk.Model.QueryAggregateResultBucketsBucket Bucket is the result of a bucket aggregate. + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Name** | **string** | Name of bucket. | [optional] **Count** | **int** | Number of records in the bucket. | [optional] +**Name** | **string** | Name of bucket. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/QueryAggregateResultCount.md b/docs/QueryAggregateResultCount.md index 241db76..936ba94 100644 --- a/docs/QueryAggregateResultCount.md +++ b/docs/QueryAggregateResultCount.md @@ -1,5 +1,6 @@ # Com.Sajari.Sdk.Model.QueryAggregateResultCount Count contains the counts for the set of values returned. + ## Properties Name | Type | Description | Notes diff --git a/docs/QueryAggregateResultDate.md b/docs/QueryAggregateResultDate.md index 6545fce..108988f 100644 --- a/docs/QueryAggregateResultDate.md +++ b/docs/QueryAggregateResultDate.md @@ -1,4 +1,5 @@ # Com.Sajari.Sdk.Model.QueryAggregateResultDate + ## Properties Name | Type | Description | Notes diff --git a/docs/QueryAggregateResultMetric.md b/docs/QueryAggregateResultMetric.md index b88a91c..5a89b71 100644 --- a/docs/QueryAggregateResultMetric.md +++ b/docs/QueryAggregateResultMetric.md @@ -1,5 +1,6 @@ # Com.Sajari.Sdk.Model.QueryAggregateResultMetric Metric represents the metric type requested, represented by an Enumeration Type. + ## Properties Name | Type | Description | Notes diff --git a/docs/QueryAggregateResultPercentile.md b/docs/QueryAggregateResultPercentile.md index 1e52a04..29a3ad4 100644 --- a/docs/QueryAggregateResultPercentile.md +++ b/docs/QueryAggregateResultPercentile.md @@ -1,11 +1,12 @@ # Com.Sajari.Sdk.Model.QueryAggregateResultPercentile Percentile contains the data points returned in a percentile aggregate step. + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Percentiles** | [**List<PercentileDataPoint>**](PercentileDataPoint.md) | The percentile data points. | [optional] **Cdf** | [**List<PercentileDataPoint>**](PercentileDataPoint.md) | The cumulative distribution function (CDF) data points. | [optional] +**Percentiles** | [**List<PercentileDataPoint>**](PercentileDataPoint.md) | The percentile data points. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/QueryCollectionRequest.md b/docs/QueryCollectionRequest.md index bec784b..92cf69f 100644 --- a/docs/QueryCollectionRequest.md +++ b/docs/QueryCollectionRequest.md @@ -1,12 +1,13 @@ # Com.Sajari.Sdk.Model.QueryCollectionRequest A request to perform a search using a pipeline. + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Pipeline** | [**QueryCollectionRequestPipeline**](QueryCollectionRequestPipeline.md) | | [optional] -**Variables** | **Object** | The initial values for the variables the pipeline operates on and transforms throughout its steps. The most important variable is `q` which is the query the user entered, for example: ```json { \"q\": \"search terms\" } ``` To paginate through results, set the variables `page` and `resultsPerPage`, for example: ```json { \"q\": \"search terms\", \"page\": 5, \"resultsPerPage\": 20 } ``` To sort results, set the variable `sort` to the name of one of your collection's schema fields, for example: ```json { \"q\": \"search terms\", \"sort\": \"name\" } ``` To sort in reverse, prefix the schema field with a minus sign `-`, for example: ```json { \"q\": \"search terms\", \"sort\": \"-name\" } ``` | **Tracking** | [**QueryCollectionRequestTracking**](QueryCollectionRequestTracking.md) | | [optional] +**Variables** | **Dictionary<string, Object>** | The initial values for the variables the pipeline operates on and transforms throughout its steps. The most important variable is `q` which is the query the user entered, for example: ```json { \"q\": \"search terms\" } ``` To paginate through results, set the variables `page` and `resultsPerPage`, for example: ```json { \"q\": \"search terms\", \"page\": 5, \"resultsPerPage\": 20 } ``` To sort results, set the variable `sort` to the name of one of your collection's schema fields, for example: ```json { \"q\": \"search terms\", \"sort\": \"name\" } ``` To sort in reverse, prefix the schema field with a minus sign `-`, for example: ```json { \"q\": \"search terms\", \"sort\": \"-name\" } ``` | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/QueryCollectionRequestPipeline.md b/docs/QueryCollectionRequestPipeline.md index e7d2e38..6e7646c 100644 --- a/docs/QueryCollectionRequestPipeline.md +++ b/docs/QueryCollectionRequestPipeline.md @@ -1,11 +1,12 @@ # Com.Sajari.Sdk.Model.QueryCollectionRequestPipeline The pipeline to use when querying the collection. If not provided the default query pipeline is used. + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Name** | **string** | The query pipeline's name, e.g. `my-pipeline`. | -**Version** | **string** | The query pipeline's version, e.g. `42`. If not provided the default version is used. | [optional] +**_Version** | **string** | The query pipeline's version, e.g. `42`. If not provided the default version is used. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/QueryCollectionRequestTracking.md b/docs/QueryCollectionRequestTracking.md index d8fcb14..8fb64be 100644 --- a/docs/QueryCollectionRequestTracking.md +++ b/docs/QueryCollectionRequestTracking.md @@ -1,13 +1,14 @@ # Com.Sajari.Sdk.Model.QueryCollectionRequestTracking + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Type** | **QueryCollectionRequestTrackingType** | | [optional] +**Data** | **Dictionary<string, string>** | Custom values to be included in tracking data. | [optional] +**Field** | **string** | Tracking field used to identify records in the collection. Must be unique schema field. | [optional] **QueryId** | **string** | Query ID of the query. If this is empty, then one is generated. | [optional] **Sequence** | **int** | Sequence number of query. | [optional] -**Field** | **string** | Tracking field used to identify records in the collection. Must be unique schema field. | [optional] -**Data** | **Dictionary<string, string>** | Custom values to be included in tracking data. | [optional] +**Type** | **QueryCollectionRequestTrackingType** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/QueryCollectionRequestTrackingType.md b/docs/QueryCollectionRequestTrackingType.md index 7bd2dac..221d37f 100644 --- a/docs/QueryCollectionRequestTrackingType.md +++ b/docs/QueryCollectionRequestTrackingType.md @@ -1,5 +1,6 @@ # Com.Sajari.Sdk.Model.QueryCollectionRequestTrackingType - TYPE_UNSPECIFIED: The default / unset value. The API defaults to `NONE` tracking. - NONE: No tracking. - CLICK: Click tracking. A click token will be generated for each result. Results which do not receive clicks will fall down rankings, and similarly low-ranked records which receive clicks will be moved up the rankings. - POS_NEG: Pos/neg tracking. Pos/neg tokens will be generated for each result. Each record in the result set can be marked with pos/neg value for the search. This is then fed back into the ranking algorithm to improve future results. Unlike `CLICK`, if no tokens are reported for records then no action is taken. + ## Properties Name | Type | Description | Notes diff --git a/docs/QueryCollectionResponse.md b/docs/QueryCollectionResponse.md index 4953056..ed51fb9 100644 --- a/docs/QueryCollectionResponse.md +++ b/docs/QueryCollectionResponse.md @@ -1,15 +1,16 @@ # Com.Sajari.Sdk.Model.QueryCollectionResponse + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**AggregateFilters** | [**Dictionary<string, QueryAggregateResult>**](QueryAggregateResult.md) | The aggregates run with filters. | [optional] +**Aggregates** | [**Dictionary<string, QueryAggregateResult>**](QueryAggregateResult.md) | The aggregates returned by the query. | [optional] **Pipeline** | [**QueryCollectionResponsePipeline**](QueryCollectionResponsePipeline.md) | | [optional] -**Variables** | **Object** | The modified variables returned by the pipeline after it has finished processing. | [optional] +**ProcessingDuration** | **string** | The total time taken to perform the query. | [optional] **Results** | [**List<QueryResult>**](QueryResult.md) | The results returned by the query. | [optional] **TotalSize** | **string** | The total number of results that match the query. | [optional] -**ProcessingDuration** | **string** | The total time taken to perform the query. | [optional] -**Aggregates** | [**Dictionary<string, QueryAggregateResult>**](QueryAggregateResult.md) | The aggregates returned by the query. | [optional] -**AggregateFilters** | [**Dictionary<string, QueryAggregateResult>**](QueryAggregateResult.md) | The aggregates run with filters. | [optional] +**Variables** | **Dictionary<string, Object>** | The modified variables returned by the pipeline after it has finished processing. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/QueryCollectionResponsePipeline.md b/docs/QueryCollectionResponsePipeline.md index 732f82f..17bdebe 100644 --- a/docs/QueryCollectionResponsePipeline.md +++ b/docs/QueryCollectionResponsePipeline.md @@ -1,11 +1,12 @@ # Com.Sajari.Sdk.Model.QueryCollectionResponsePipeline The resolved query pipeline that was used to run the query. + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Name** | **string** | The pipeline's name, e.g. `my-pipeline`. | [optional] -**Version** | **string** | The pipeline's version, e.g. `42`. | [optional] +**_Version** | **string** | The pipeline's version, e.g. `42`. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/QueryResult.md b/docs/QueryResult.md index ee54ac9..5a7ee5a 100644 --- a/docs/QueryResult.md +++ b/docs/QueryResult.md @@ -1,11 +1,12 @@ # Com.Sajari.Sdk.Model.QueryResult + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**IndexScore** | **double** | Index score. | [optional] **Record** | **Object** | An object made up of field-value pairs that contains the record data. | [optional] **Score** | **double** | The normalized score attributed to this record. Combines the index score and feature score. | [optional] -**IndexScore** | **double** | Index score. | [optional] **Token** | [**QueryResultToken**](QueryResultToken.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/QueryResultToken.md b/docs/QueryResultToken.md index f0b4062..ec2c33d 100644 --- a/docs/QueryResultToken.md +++ b/docs/QueryResultToken.md @@ -1,5 +1,6 @@ # Com.Sajari.Sdk.Model.QueryResultToken Tokens are used to carry ranking information for query results. + ## Properties Name | Type | Description | Notes diff --git a/docs/QueryResultTokenClick.md b/docs/QueryResultTokenClick.md index 2b59836..0302bca 100644 --- a/docs/QueryResultTokenClick.md +++ b/docs/QueryResultTokenClick.md @@ -1,5 +1,6 @@ # Com.Sajari.Sdk.Model.QueryResultTokenClick Click is a token that corresponds to selecting a record from a result set. It is taken as an indication that this record is a good match for the corresponding request. + ## Properties Name | Type | Description | Notes diff --git a/docs/QueryResultTokenPosNeg.md b/docs/QueryResultTokenPosNeg.md index d383b5c..c870a2f 100644 --- a/docs/QueryResultTokenPosNeg.md +++ b/docs/QueryResultTokenPosNeg.md @@ -1,11 +1,12 @@ # Com.Sajari.Sdk.Model.QueryResultTokenPosNeg PosNeg is a pair of tokens which are used to mark a record as a good/bad result for a request. + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Pos** | **string** | | [optional] **Neg** | **string** | | [optional] +**Pos** | **string** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/RecordKey.md b/docs/RecordKey.md index e3ed157..6ea3f18 100644 --- a/docs/RecordKey.md +++ b/docs/RecordKey.md @@ -1,4 +1,5 @@ # Com.Sajari.Sdk.Model.RecordKey + ## Properties Name | Type | Description | Notes diff --git a/docs/RecordsApi.md b/docs/RecordsApi.md index 05185bf..f749e70 100644 --- a/docs/RecordsApi.md +++ b/docs/RecordsApi.md @@ -7,6 +7,7 @@ Method | HTTP request | Description [**BatchUpsertRecords**](RecordsApi.md#batchupsertrecords) | **POST** /v4/collections/{collection_id}/records:batchUpsert | Batch upsert records [**DeleteRecord**](RecordsApi.md#deleterecord) | **POST** /v4/collections/{collection_id}/records:delete | Delete record [**GetRecord**](RecordsApi.md#getrecord) | **POST** /v4/collections/{collection_id}/records:get | Get record +[**UpdateRecord**](RecordsApi.md#updaterecord) | **POST** /v4/collections/{collection_id}/records:update | Update record [**UpsertRecord**](RecordsApi.md#upsertrecord) | **POST** /v4/collections/{collection_id}/records:upsert | Upsert record @@ -79,6 +80,7 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json + ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| @@ -87,7 +89,7 @@ Name | Type | Description | Notes | **403** | Returned when the user does not have permission to access the resource. | - | | **404** | Returned when the resource does not exist. | - | | **500** | Returned when the API encounters an internal error. | - | -| **0** | An unexpected error response | - | +| **0** | An unexpected error response. | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -160,6 +162,7 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json + ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| @@ -168,7 +171,7 @@ Name | Type | Description | Notes | **403** | Returned when the user does not have permission to access the resource. | - | | **404** | Returned when the resource does not exist. | - | | **500** | Returned when the API encounters an internal error. | - | -| **0** | An unexpected error response | - | +| **0** | An unexpected error response. | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -241,6 +244,89 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | A successful response. | - | +| **401** | Returned when the request does not have valid authentication credentials. | - | +| **403** | Returned when the user does not have permission to access the resource. | - | +| **404** | Returned when the resource does not exist. | - | +| **500** | Returned when the API encounters an internal error. | - | +| **0** | An unexpected error response. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +# **UpdateRecord** +> Object UpdateRecord (string collectionId, UpdateRecordRequest updateRecordRequest) + +Update record + +Add or update specific fields within a record with the given values. The updated record is returned in the response. To replace all fields in a record, you should use the [UpsertRecord](/api#operation/UpsertRecord) call. Note that the update record call cannot be used to add or update indexed or unique fields. For this case use the [UpsertRecord](/api#operation/UpsertRecord) call. + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Com.Sajari.Sdk.Api; +using Com.Sajari.Sdk.Client; +using Com.Sajari.Sdk.Model; + +namespace Example +{ + public class UpdateRecordExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "https://api-gateway.sajari.com"; + // Configure HTTP basic authorization: BasicAuth + config.Username = "YOUR_USERNAME"; + config.Password = "YOUR_PASSWORD"; + + var apiInstance = new RecordsApi(config); + var collectionId = collectionId_example; // string | The collection that contains the record to update, e.g. `my-collection`. + var updateRecordRequest = new UpdateRecordRequest(); // UpdateRecordRequest | + + try + { + // Update record + Object result = apiInstance.UpdateRecord(collectionId, updateRecordRequest); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling RecordsApi.UpdateRecord: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **collectionId** | **string**| The collection that contains the record to update, e.g. `my-collection`. | + **updateRecordRequest** | [**UpdateRecordRequest**](UpdateRecordRequest.md)| | + +### Return type + +**Object** + +### Authorization + +[BasicAuth](../README.md#BasicAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| @@ -249,7 +335,7 @@ Name | Type | Description | Notes | **403** | Returned when the user does not have permission to access the resource. | - | | **404** | Returned when the resource does not exist. | - | | **500** | Returned when the API encounters an internal error. | - | -| **0** | An unexpected error response | - | +| **0** | An unexpected error response. | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -259,7 +345,7 @@ Name | Type | Description | Notes Upsert record -If the record does not exist in your collection it is inserted. If it does exist it is updated. If no pipeline is specified, the default record pipeline is used to process the record. If the record is inserted, the response contains the key of the inserted record. You can use this if you need to retrieve or delete the record. If the record is updated, the response does not contain a key. Callers can use this as a signal to determine if the record is inserted/created or updated. For example, to add a single product from your ecommerce store to a collection, use the following call: ```json { \"pipeline\": { \"name\": \"my-pipeline\", \"version\": \"1\" }, \"record\": { \"id\": \"54hdc7h2334h\", \"name\": \"Smart TV\", \"price\": 1999, \"brand\": \"Acme\", \"description\": \"...\", \"in_stock\": true } } ``` +If the record does not exist in the collection it is inserted. If it does exist it is updated. If no pipeline is specified, the default record pipeline is used to process the record. If the record is inserted, the response contains the key of the inserted record. You can use this if you need to retrieve or delete the record. If the record is updated, the response does not contain a key. Callers can use this as a signal to determine if the record is inserted/created or updated. For example, to add a single product from your ecommerce store to a collection, use the following call: ```json { \"pipeline\": { \"name\": \"my-pipeline\", \"version\": \"1\" }, \"record\": { \"id\": \"54hdc7h2334h\", \"name\": \"Smart TV\", \"price\": 1999, \"brand\": \"Acme\", \"description\": \"...\", \"in_stock\": true } } ``` ### Example ```csharp @@ -322,6 +408,7 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json + ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| @@ -330,7 +417,7 @@ Name | Type | Description | Notes | **403** | Returned when the user does not have permission to access the resource. | - | | **404** | Returned when the resource does not exist. | - | | **500** | Returned when the API encounters an internal error. | - | -| **0** | An unexpected error response | - | +| **0** | An unexpected error response. | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/docs/SchemaApi.md b/docs/SchemaApi.md index 9a8bd72..1f161cc 100644 --- a/docs/SchemaApi.md +++ b/docs/SchemaApi.md @@ -78,6 +78,7 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json + ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| @@ -86,7 +87,7 @@ Name | Type | Description | Notes | **403** | Returned when the user does not have permission to access the resource. | - | | **404** | Returned when the resource does not exist. | - | | **500** | Returned when the API encounters an internal error. | - | -| **0** | An unexpected error response | - | +| **0** | An unexpected error response. | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -96,7 +97,7 @@ Name | Type | Description | Notes Create schema field -Create a new field in your collection's schema. +Create a new field in a collection's schema. ### Example ```csharp @@ -159,6 +160,7 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json + ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| @@ -167,7 +169,7 @@ Name | Type | Description | Notes | **403** | Returned when the user does not have permission to access the resource. | - | | **404** | Returned when the resource does not exist. | - | | **500** | Returned when the API encounters an internal error. | - | -| **0** | An unexpected error response | - | +| **0** | An unexpected error response. | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -177,7 +179,7 @@ Name | Type | Description | Notes List schema fields -Retrieve a list of schema fields in the collection. +Retrieve a list of schema fields in a collection. ### Example ```csharp @@ -242,6 +244,7 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json + ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| @@ -250,7 +253,7 @@ Name | Type | Description | Notes | **403** | Returned when the user does not have permission to access the resource. | - | | **404** | Returned when the resource does not exist. | - | | **500** | Returned when the API encounters an internal error. | - | -| **0** | An unexpected error response | - | +| **0** | An unexpected error response. | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/docs/SchemaField.md b/docs/SchemaField.md index 76417a8..9a93ab0 100644 --- a/docs/SchemaField.md +++ b/docs/SchemaField.md @@ -1,15 +1,16 @@ # Com.Sajari.Sdk.Model.SchemaField SchemaField defines the properties of a field in the schema. + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Name** | **string** | The name of the field. | -**Description** | **string** | The description of the field. | [optional] -**Type** | **SchemaFieldType** | | -**Mode** | **SchemaFieldMode** | | **Array** | **bool** | Array indicates if the field is an array of values. For example, if `type` is string and `array` is `true`, then the field is an array of strings. | [optional] **ArrayLength** | **int** | The required length of the array, if `array` is `true`. This allows you to enforce that an array contains an exact number of items. For example, to store a 2x2 vector, you could set `type` to float, `array` to `true` and `array_length` to `4`. | [optional] +**Description** | **string** | The description of the field. | [optional] +**Mode** | **SchemaFieldMode** | | +**Name** | **string** | The name of the field. | +**Type** | **SchemaFieldType** | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/SchemaFieldMode.md b/docs/SchemaFieldMode.md index 753ba21..55ddf56 100644 --- a/docs/SchemaFieldMode.md +++ b/docs/SchemaFieldMode.md @@ -1,5 +1,6 @@ # Com.Sajari.Sdk.Model.SchemaFieldMode Mode is an enumeration of modes for a field. - MODE_UNSPECIFIED: Mode not specified. - NULLABLE: Nullable fields do not need to be specified. - REQUIRED: Required fields must be specified and cannot be null. - UNIQUE: Unique fields must be specified and must be unique. + ## Properties Name | Type | Description | Notes diff --git a/docs/SchemaFieldType.md b/docs/SchemaFieldType.md index 67c65df..7eb1e64 100644 --- a/docs/SchemaFieldType.md +++ b/docs/SchemaFieldType.md @@ -1,5 +1,6 @@ # Com.Sajari.Sdk.Model.SchemaFieldType Type represents the underlying data type of the field. - TYPE_UNSPECIFIED: Type not specified. - STRING: String values. - INTEGER: Integer values (64-bit). - FLOAT: Floating point values (32-bit). - DOUBLE: Double floating point values (64-bit). - BOOLEAN: Boolean values. - TIMESTAMP: Timestamp values. + ## Properties Name | Type | Description | Notes diff --git a/docs/SendEventRequest.md b/docs/SendEventRequest.md index f2e20e8..76086da 100644 --- a/docs/SendEventRequest.md +++ b/docs/SendEventRequest.md @@ -1,13 +1,14 @@ # Com.Sajari.Sdk.Model.SendEventRequest A request to send an event to the ranking system after a user interacts with a search result. + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**Metadata** | **Dictionary<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`. | **Token** | **string** | The token corresponding to the search result that was interacted with, e.g. `eyJ...`. | **Weight** | **int** | 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] -**Metadata** | **Dictionary<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] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/SetDefaultPipelineRequest.md b/docs/SetDefaultPipelineRequest.md index 1f5a8f0..0300a83 100644 --- a/docs/SetDefaultPipelineRequest.md +++ b/docs/SetDefaultPipelineRequest.md @@ -1,10 +1,11 @@ # Com.Sajari.Sdk.Model.SetDefaultPipelineRequest + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Type** | **PipelineType** | | **Pipeline** | **string** | The name of the pipeline to use when not otherwise specified. | +**Type** | **PipelineType** | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/SetDefaultVersionRequest.md b/docs/SetDefaultVersionRequest.md index 049bfdc..7cf0c04 100644 --- a/docs/SetDefaultVersionRequest.md +++ b/docs/SetDefaultVersionRequest.md @@ -1,9 +1,10 @@ # Com.Sajari.Sdk.Model.SetDefaultVersionRequest + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Version** | **string** | The version to use as a default for this pipeline, e.g. `42`. | +**_Version** | **string** | The version to use as a default for this pipeline, e.g. `42`. | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/Status.md b/docs/Status.md index cc077c9..5fe29ec 100644 --- a/docs/Status.md +++ b/docs/Status.md @@ -1,12 +1,13 @@ # Com.Sajari.Sdk.Model.Status The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Code** | **int** | The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. | [optional] -**Message** | **string** | A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. | [optional] **Details** | [**List<ProtobufAny>**](ProtobufAny.md) | A list of messages that carry the error details. There is a common set of message types for APIs to use. | [optional] +**Message** | **string** | A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/UpdateRecordRequest.md b/docs/UpdateRecordRequest.md new file mode 100644 index 0000000..ef12677 --- /dev/null +++ b/docs/UpdateRecordRequest.md @@ -0,0 +1,12 @@ +# Com.Sajari.Sdk.Model.UpdateRecordRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Key** | [**RecordKey**](RecordKey.md) | | +**Record** | **Dictionary<string, Object>** | The record to update. | +**UpdateMask** | **string** | The list of fields to be updated, separated by a comma, e.g. `field1,field2`. For each field that you want to update, provide a corresponding value in the record object containing the new value. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/UpsertRecordRequest.md b/docs/UpsertRecordRequest.md index 7bff20d..d2afb01 100644 --- a/docs/UpsertRecordRequest.md +++ b/docs/UpsertRecordRequest.md @@ -1,11 +1,12 @@ # Com.Sajari.Sdk.Model.UpsertRecordRequest + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Pipeline** | [**UpsertRecordRequestPipeline**](UpsertRecordRequestPipeline.md) | | [optional] **Record** | **Object** | An object made up of field-value pairs that contains the record data. | -**Variables** | **Object** | The initial values for the variables the pipeline operates on and transforms throughout its steps. | [optional] +**Variables** | **Dictionary<string, Object>** | The initial values for the variables the pipeline operates on and transforms throughout its steps. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/UpsertRecordRequestPipeline.md b/docs/UpsertRecordRequestPipeline.md index d21da8c..473da8f 100644 --- a/docs/UpsertRecordRequestPipeline.md +++ b/docs/UpsertRecordRequestPipeline.md @@ -1,11 +1,12 @@ # Com.Sajari.Sdk.Model.UpsertRecordRequestPipeline The pipeline to use when upserting the record. If not provided the default record pipeline is used. + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Name** | **string** | The record pipeline's name, e.g. `my-pipeline`. | -**Version** | **string** | The record pipeline's version, e.g. `42`. If not provided the default version is used. | [optional] +**_Version** | **string** | The record pipeline's version, e.g. `42`. If not provided the default version is used. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/UpsertRecordResponse.md b/docs/UpsertRecordResponse.md index 4977026..977eb3a 100644 --- a/docs/UpsertRecordResponse.md +++ b/docs/UpsertRecordResponse.md @@ -1,10 +1,11 @@ # Com.Sajari.Sdk.Model.UpsertRecordResponse + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Key** | [**RecordKey**](RecordKey.md) | | [optional] -**Variables** | **Object** | The modified variables returned by the pipeline after it has finished processing. | [optional] +**Variables** | **Dictionary<string, Object>** | The modified variables returned by the pipeline after it has finished processing. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/generate/Dockerfile.generate b/generate/Dockerfile.generate index 313744d..f341e1d 100644 --- a/generate/Dockerfile.generate +++ b/generate/Dockerfile.generate @@ -1 +1 @@ -FROM openapitools/openapi-generator-cli@sha256:4396b434b09f03c9cb9a20ff39f1406f13a9b224a25e77a41679cd993eb5c968 +FROM openapitools/openapi-generator-cli:latest-release diff --git a/generate/generate.sh b/generate/generate.sh index 96261ff..e0ea203 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-dotnet" fi -VERSION=4.1.0 +VERSION=4.2.0 docker-entrypoint.sh generate \ -i /openapi.json \ diff --git a/src/Com.Sajari.Sdk.Test/Api/CollectionsApiTests.cs b/src/Com.Sajari.Sdk.Test/Api/CollectionsApiTests.cs index 66d8167..a841f76 100644 --- a/src/Com.Sajari.Sdk.Test/Api/CollectionsApiTests.cs +++ b/src/Com.Sajari.Sdk.Test/Api/CollectionsApiTests.cs @@ -68,15 +68,15 @@ public void CreateCollectionTest() Configuration config = new Configuration(); config.BasePath = "https://api-gateway.sajari.com"; // Configure HTTP basic authorization: BasicAuth - config.Username = "mWc1UpIL9pKOY68S"; - config.Password = "twnuOBW6uiNVkD2P"; + config.Username = ""; + config.Password = ""; var apiInstance = new CollectionsApi(config); try { // Create collection - Collection result = apiInstance.CreateCollection("test-collection-dotnet", new Collection("My Special Dot Net Collection", new List(){"example.com"})); + Collection result = apiInstance.CreateCollection("test-collection-dotnet", new Collection(new List(){"example.com"},"My Special Dot Net Collection")); Debug.WriteLine(result); Assert.IsType(result); } diff --git a/src/Com.Sajari.Sdk.Test/Model/UpdateRecordRequestTests.cs b/src/Com.Sajari.Sdk.Test/Model/UpdateRecordRequestTests.cs new file mode 100644 index 0000000..e1ae53a --- /dev/null +++ b/src/Com.Sajari.Sdk.Test/Model/UpdateRecordRequestTests.cs @@ -0,0 +1,87 @@ +/* + * Sajari API + * + * Sajari is a smart, highly-configurable, real-time search service that enables thousands of businesses worldwide to provide amazing search experiences on their websites, stores, and applications. + * + * The version of the OpenAPI document: v4 + * Contact: support@sajari.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Com.Sajari.Sdk.Api; +using Com.Sajari.Sdk.Model; +using Com.Sajari.Sdk.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Com.Sajari.Sdk.Test.Model +{ + /// + /// Class for testing UpdateRecordRequest + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class UpdateRecordRequestTests : IDisposable + { + // TODO uncomment below to declare an instance variable for UpdateRecordRequest + //private UpdateRecordRequest instance; + + public UpdateRecordRequestTests() + { + // TODO uncomment below to create an instance of UpdateRecordRequest + //instance = new UpdateRecordRequest(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of UpdateRecordRequest + /// + [Fact] + public void UpdateRecordRequestInstanceTest() + { + // TODO uncomment below to test "IsType" UpdateRecordRequest + //Assert.IsType(instance); + } + + + /// + /// Test the property 'Key' + /// + [Fact] + public void KeyTest() + { + // TODO unit test for the property 'Key' + } + /// + /// Test the property 'Record' + /// + [Fact] + public void RecordTest() + { + // TODO unit test for the property 'Record' + } + /// + /// Test the property 'UpdateMask' + /// + [Fact] + public void UpdateMaskTest() + { + // TODO unit test for the property 'UpdateMask' + } + + } + +} diff --git a/src/Com.Sajari.Sdk/Api/CollectionsApi.cs b/src/Com.Sajari.Sdk/Api/CollectionsApi.cs index daf0019..260cc48 100644 --- a/src/Com.Sajari.Sdk/Api/CollectionsApi.cs +++ b/src/Com.Sajari.Sdk/Api/CollectionsApi.cs @@ -96,7 +96,7 @@ public interface ICollectionsApiSync : IApiAccessor /// List collections /// /// - /// Retrieve a list of collections in the account. + /// Retrieve a list of collections in an account. /// /// Thrown when fails to make API call /// 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) @@ -108,7 +108,7 @@ public interface ICollectionsApiSync : IApiAccessor /// List collections /// /// - /// Retrieve a list of collections in the account. + /// Retrieve a list of collections in an account. /// /// Thrown when fails to make API call /// 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) @@ -139,6 +139,31 @@ public interface ICollectionsApiSync : IApiAccessor /// ApiResponse of QueryCollectionResponse ApiResponse QueryCollectionWithHttpInfo(string collectionId, QueryCollectionRequest queryCollectionRequest); /// + /// Query collection + /// + /// + /// Query the collection to search for records. The following example demonstrates how to run a simple search for a particular string: ```json { \"variables\": { \"q\": \"search terms\" } } ``` For more information: - See [filtering content](https://docs.sajari.com/user-guide/integrating-search/filters/) - See [tracking in the Go SDK](https://github.com/sajari/sdk-go/blob/v2/session.go) - See [tracking in the JS SDK](https://github.com/sajari/sajari-sdk-js/blob/master/src/session.ts) + /// + /// Thrown when fails to make API call + /// The collection to query, e.g. `my-collection`. + /// + /// QueryCollectionResponse + [Obsolete] + QueryCollectionResponse QueryCollection2(string collectionId, QueryCollectionRequest queryCollectionRequest); + + /// + /// Query collection + /// + /// + /// Query the collection to search for records. The following example demonstrates how to run a simple search for a particular string: ```json { \"variables\": { \"q\": \"search terms\" } } ``` For more information: - See [filtering content](https://docs.sajari.com/user-guide/integrating-search/filters/) - See [tracking in the Go SDK](https://github.com/sajari/sdk-go/blob/v2/session.go) - See [tracking in the JS SDK](https://github.com/sajari/sajari-sdk-js/blob/master/src/session.ts) + /// + /// Thrown when fails to make API call + /// The collection to query, e.g. `my-collection`. + /// + /// ApiResponse of QueryCollectionResponse + [Obsolete] + ApiResponse QueryCollection2WithHttpInfo(string collectionId, QueryCollectionRequest queryCollectionRequest); + /// /// Update collection /// /// @@ -146,10 +171,10 @@ public interface ICollectionsApiSync : IApiAccessor /// /// Thrown when fails to make API call /// The collection to update, e.g. `my-collection`. + /// The list of fields to be updated, separated by a comma, e.g. `field1,field2`. Each field should be in snake case, e.g. `display_name`. For each field that you want to update, provide a corresponding value in the collection object containing the new value. /// Details of the collection to update. - /// The list of fields to be updated, separated by a comma, e.g. `field1,field2`. Each field should be in snake case, e.g. `display_name`. For each field that you want to update, provide a corresponding value in the collection object containing the new value. (optional) /// Collection - Collection UpdateCollection(string collectionId, Collection collection, string updateMask = default(string)); + Collection UpdateCollection(string collectionId, string updateMask, Collection collection); /// /// Update collection @@ -159,10 +184,10 @@ public interface ICollectionsApiSync : IApiAccessor /// /// Thrown when fails to make API call /// The collection to update, e.g. `my-collection`. + /// The list of fields to be updated, separated by a comma, e.g. `field1,field2`. Each field should be in snake case, e.g. `display_name`. For each field that you want to update, provide a corresponding value in the collection object containing the new value. /// Details of the collection to update. - /// The list of fields to be updated, separated by a comma, e.g. `field1,field2`. Each field should be in snake case, e.g. `display_name`. For each field that you want to update, provide a corresponding value in the collection object containing the new value. (optional) /// ApiResponse of Collection - ApiResponse UpdateCollectionWithHttpInfo(string collectionId, Collection collection, string updateMask = default(string)); + ApiResponse UpdateCollectionWithHttpInfo(string collectionId, string updateMask, Collection collection); #endregion Synchronous Operations } @@ -247,7 +272,7 @@ public interface ICollectionsApiAsync : IApiAccessor /// List collections /// /// - /// Retrieve a list of collections in the account. + /// Retrieve a list of collections in an account. /// /// Thrown when fails to make API call /// 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) @@ -260,7 +285,7 @@ public interface ICollectionsApiAsync : IApiAccessor /// List collections /// /// - /// Retrieve a list of collections in the account. + /// Retrieve a list of collections in an account. /// /// Thrown when fails to make API call /// 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) @@ -294,6 +319,33 @@ public interface ICollectionsApiAsync : IApiAccessor /// Task of ApiResponse (QueryCollectionResponse) System.Threading.Tasks.Task> QueryCollectionWithHttpInfoAsync(string collectionId, QueryCollectionRequest queryCollectionRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// + /// Query collection + /// + /// + /// Query the collection to search for records. The following example demonstrates how to run a simple search for a particular string: ```json { \"variables\": { \"q\": \"search terms\" } } ``` For more information: - See [filtering content](https://docs.sajari.com/user-guide/integrating-search/filters/) - See [tracking in the Go SDK](https://github.com/sajari/sdk-go/blob/v2/session.go) - See [tracking in the JS SDK](https://github.com/sajari/sajari-sdk-js/blob/master/src/session.ts) + /// + /// Thrown when fails to make API call + /// The collection to query, e.g. `my-collection`. + /// + /// Cancellation Token to cancel the request. + /// Task of QueryCollectionResponse + [Obsolete] + System.Threading.Tasks.Task QueryCollection2Async(string collectionId, QueryCollectionRequest queryCollectionRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Query collection + /// + /// + /// Query the collection to search for records. The following example demonstrates how to run a simple search for a particular string: ```json { \"variables\": { \"q\": \"search terms\" } } ``` For more information: - See [filtering content](https://docs.sajari.com/user-guide/integrating-search/filters/) - See [tracking in the Go SDK](https://github.com/sajari/sdk-go/blob/v2/session.go) - See [tracking in the JS SDK](https://github.com/sajari/sajari-sdk-js/blob/master/src/session.ts) + /// + /// Thrown when fails to make API call + /// The collection to query, e.g. `my-collection`. + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (QueryCollectionResponse) + [Obsolete] + System.Threading.Tasks.Task> QueryCollection2WithHttpInfoAsync(string collectionId, QueryCollectionRequest queryCollectionRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Update collection /// /// @@ -301,11 +353,11 @@ public interface ICollectionsApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// The collection to update, e.g. `my-collection`. + /// The list of fields to be updated, separated by a comma, e.g. `field1,field2`. Each field should be in snake case, e.g. `display_name`. For each field that you want to update, provide a corresponding value in the collection object containing the new value. /// Details of the collection to update. - /// The list of fields to be updated, separated by a comma, e.g. `field1,field2`. Each field should be in snake case, e.g. `display_name`. For each field that you want to update, provide a corresponding value in the collection object containing the new value. (optional) /// Cancellation Token to cancel the request. /// Task of Collection - System.Threading.Tasks.Task UpdateCollectionAsync(string collectionId, Collection collection, string updateMask = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task UpdateCollectionAsync(string collectionId, string updateMask, Collection collection, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Update collection @@ -315,11 +367,11 @@ public interface ICollectionsApiAsync : IApiAccessor /// /// Thrown when fails to make API call /// The collection to update, e.g. `my-collection`. + /// The list of fields to be updated, separated by a comma, e.g. `field1,field2`. Each field should be in snake case, e.g. `display_name`. For each field that you want to update, provide a corresponding value in the collection object containing the new value. /// Details of the collection to update. - /// The list of fields to be updated, separated by a comma, e.g. `field1,field2`. Each field should be in snake case, e.g. `display_name`. For each field that you want to update, provide a corresponding value in the collection object containing the new value. (optional) /// Cancellation Token to cancel the request. /// Task of ApiResponse (Collection) - System.Threading.Tasks.Task> UpdateCollectionWithHttpInfoAsync(string collectionId, Collection collection, string updateMask = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> UpdateCollectionWithHttpInfoAsync(string collectionId, string updateMask, Collection collection, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); #endregion Asynchronous Operations } @@ -350,7 +402,7 @@ public CollectionsApi() : this((string)null) /// Initializes a new instance of the class. /// /// - public CollectionsApi(String basePath) + public CollectionsApi(string basePath) { this.Configuration = Com.Sajari.Sdk.Client.Configuration.MergeConfigurations( Com.Sajari.Sdk.Client.GlobalConfiguration.Instance, @@ -413,7 +465,7 @@ public CollectionsApi(Com.Sajari.Sdk.Client.ISynchronousClient client, Com.Sajar /// Gets the base path of the API client. /// /// The base path - public String GetBasePath() + public string GetBasePath() { return this.Configuration.BasePath; } @@ -472,12 +524,12 @@ public Com.Sajari.Sdk.Client.ApiResponse CreateCollectionWithHttpInf Com.Sajari.Sdk.Client.RequestOptions localVarRequestOptions = new Com.Sajari.Sdk.Client.RequestOptions(); - String[] _contentTypes = new String[] { + string[] _contentTypes = new string[] { "application/json" }; // to determine the Accept header - String[] _accepts = new String[] { + string[] _accepts = new string[] { "application/json" }; @@ -492,7 +544,7 @@ public Com.Sajari.Sdk.Client.ApiResponse CreateCollectionWithHttpInf // authentication (BasicAuth) required // http basic authentication required - if (!String.IsNullOrEmpty(this.Configuration.Username) || !String.IsNullOrEmpty(this.Configuration.Password)) + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password)) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Com.Sajari.Sdk.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); } @@ -544,12 +596,12 @@ public Com.Sajari.Sdk.Client.ApiResponse CreateCollectionWithHttpInf Com.Sajari.Sdk.Client.RequestOptions localVarRequestOptions = new Com.Sajari.Sdk.Client.RequestOptions(); - String[] _contentTypes = new String[] { + string[] _contentTypes = new string[] { "application/json" }; // to determine the Accept header - String[] _accepts = new String[] { + string[] _accepts = new string[] { "application/json" }; @@ -565,7 +617,7 @@ public Com.Sajari.Sdk.Client.ApiResponse CreateCollectionWithHttpInf // authentication (BasicAuth) required // http basic authentication required - if (!String.IsNullOrEmpty(this.Configuration.Username) || !String.IsNullOrEmpty(this.Configuration.Password)) + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password)) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Com.Sajari.Sdk.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); } @@ -609,11 +661,11 @@ public Com.Sajari.Sdk.Client.ApiResponse DeleteCollectionWithHttpInfo(st Com.Sajari.Sdk.Client.RequestOptions localVarRequestOptions = new Com.Sajari.Sdk.Client.RequestOptions(); - String[] _contentTypes = new String[] { + string[] _contentTypes = new string[] { }; // to determine the Accept header - String[] _accepts = new String[] { + string[] _accepts = new string[] { "application/json" }; @@ -627,7 +679,7 @@ public Com.Sajari.Sdk.Client.ApiResponse DeleteCollectionWithHttpInfo(st // authentication (BasicAuth) required // http basic authentication required - if (!String.IsNullOrEmpty(this.Configuration.Username) || !String.IsNullOrEmpty(this.Configuration.Password)) + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password)) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Com.Sajari.Sdk.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); } @@ -673,11 +725,11 @@ public Com.Sajari.Sdk.Client.ApiResponse DeleteCollectionWithHttpInfo(st Com.Sajari.Sdk.Client.RequestOptions localVarRequestOptions = new Com.Sajari.Sdk.Client.RequestOptions(); - String[] _contentTypes = new String[] { + string[] _contentTypes = new string[] { }; // to determine the Accept header - String[] _accepts = new String[] { + string[] _accepts = new string[] { "application/json" }; @@ -692,7 +744,7 @@ public Com.Sajari.Sdk.Client.ApiResponse DeleteCollectionWithHttpInfo(st // authentication (BasicAuth) required // http basic authentication required - if (!String.IsNullOrEmpty(this.Configuration.Username) || !String.IsNullOrEmpty(this.Configuration.Password)) + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password)) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Com.Sajari.Sdk.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); } @@ -736,11 +788,11 @@ public Com.Sajari.Sdk.Client.ApiResponse GetCollectionWithHttpInfo(s Com.Sajari.Sdk.Client.RequestOptions localVarRequestOptions = new Com.Sajari.Sdk.Client.RequestOptions(); - String[] _contentTypes = new String[] { + string[] _contentTypes = new string[] { }; // to determine the Accept header - String[] _accepts = new String[] { + string[] _accepts = new string[] { "application/json" }; @@ -754,7 +806,7 @@ public Com.Sajari.Sdk.Client.ApiResponse GetCollectionWithHttpInfo(s // authentication (BasicAuth) required // http basic authentication required - if (!String.IsNullOrEmpty(this.Configuration.Username) || !String.IsNullOrEmpty(this.Configuration.Password)) + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password)) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Com.Sajari.Sdk.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); } @@ -800,11 +852,11 @@ public Com.Sajari.Sdk.Client.ApiResponse GetCollectionWithHttpInfo(s Com.Sajari.Sdk.Client.RequestOptions localVarRequestOptions = new Com.Sajari.Sdk.Client.RequestOptions(); - String[] _contentTypes = new String[] { + string[] _contentTypes = new string[] { }; // to determine the Accept header - String[] _accepts = new String[] { + string[] _accepts = new string[] { "application/json" }; @@ -819,7 +871,7 @@ public Com.Sajari.Sdk.Client.ApiResponse GetCollectionWithHttpInfo(s // authentication (BasicAuth) required // http basic authentication required - if (!String.IsNullOrEmpty(this.Configuration.Username) || !String.IsNullOrEmpty(this.Configuration.Password)) + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password)) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Com.Sajari.Sdk.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); } @@ -838,7 +890,7 @@ public Com.Sajari.Sdk.Client.ApiResponse GetCollectionWithHttpInfo(s } /// - /// List collections Retrieve a list of collections in the account. + /// List collections Retrieve a list of collections in an account. /// /// Thrown when fails to make API call /// 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) @@ -851,7 +903,7 @@ public Com.Sajari.Sdk.Client.ApiResponse GetCollectionWithHttpInfo(s } /// - /// List collections Retrieve a list of collections in the account. + /// List collections Retrieve a list of collections in an account. /// /// Thrown when fails to make API call /// 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) @@ -861,11 +913,11 @@ public Com.Sajari.Sdk.Client.ApiResponse GetCollectionWithHttpInfo(s { Com.Sajari.Sdk.Client.RequestOptions localVarRequestOptions = new Com.Sajari.Sdk.Client.RequestOptions(); - String[] _contentTypes = new String[] { + string[] _contentTypes = new string[] { }; // to determine the Accept header - String[] _accepts = new String[] { + string[] _accepts = new string[] { "application/json" }; @@ -886,7 +938,7 @@ public Com.Sajari.Sdk.Client.ApiResponse GetCollectionWithHttpInfo(s // authentication (BasicAuth) required // http basic authentication required - if (!String.IsNullOrEmpty(this.Configuration.Username) || !String.IsNullOrEmpty(this.Configuration.Password)) + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password)) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Com.Sajari.Sdk.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); } @@ -904,7 +956,7 @@ public Com.Sajari.Sdk.Client.ApiResponse GetCollectionWithHttpInfo(s } /// - /// List collections Retrieve a list of collections in the account. + /// List collections Retrieve a list of collections in an account. /// /// Thrown when fails to make API call /// 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) @@ -918,7 +970,7 @@ public Com.Sajari.Sdk.Client.ApiResponse GetCollectionWithHttpInfo(s } /// - /// List collections Retrieve a list of collections in the account. + /// List collections Retrieve a list of collections in an account. /// /// Thrown when fails to make API call /// 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) @@ -930,11 +982,11 @@ public Com.Sajari.Sdk.Client.ApiResponse GetCollectionWithHttpInfo(s Com.Sajari.Sdk.Client.RequestOptions localVarRequestOptions = new Com.Sajari.Sdk.Client.RequestOptions(); - String[] _contentTypes = new String[] { + string[] _contentTypes = new string[] { }; // to determine the Accept header - String[] _accepts = new String[] { + string[] _accepts = new string[] { "application/json" }; @@ -956,7 +1008,7 @@ public Com.Sajari.Sdk.Client.ApiResponse GetCollectionWithHttpInfo(s // authentication (BasicAuth) required // http basic authentication required - if (!String.IsNullOrEmpty(this.Configuration.Username) || !String.IsNullOrEmpty(this.Configuration.Password)) + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password)) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Com.Sajari.Sdk.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); } @@ -1006,12 +1058,12 @@ public Com.Sajari.Sdk.Client.ApiResponse QueryCollectio Com.Sajari.Sdk.Client.RequestOptions localVarRequestOptions = new Com.Sajari.Sdk.Client.RequestOptions(); - String[] _contentTypes = new String[] { + string[] _contentTypes = new string[] { "application/json" }; // to determine the Accept header - String[] _accepts = new String[] { + string[] _accepts = new string[] { "application/json" }; @@ -1026,13 +1078,13 @@ public Com.Sajari.Sdk.Client.ApiResponse QueryCollectio // authentication (BasicAuth) required // http basic authentication required - if (!String.IsNullOrEmpty(this.Configuration.Username) || !String.IsNullOrEmpty(this.Configuration.Password)) + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password)) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Com.Sajari.Sdk.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); } // make the HTTP request - var localVarResponse = this.Client.Post("/v4/collections/{collection_id}:queryCollection", localVarRequestOptions, this.Configuration); + var localVarResponse = this.Client.Post("/v4/collections/{collection_id}:query", localVarRequestOptions, this.Configuration); if (this.ExceptionFactory != null) { @@ -1078,12 +1130,12 @@ public Com.Sajari.Sdk.Client.ApiResponse QueryCollectio Com.Sajari.Sdk.Client.RequestOptions localVarRequestOptions = new Com.Sajari.Sdk.Client.RequestOptions(); - String[] _contentTypes = new String[] { + string[] _contentTypes = new string[] { "application/json" }; // to determine the Accept header - String[] _accepts = new String[] { + string[] _accepts = new string[] { "application/json" }; @@ -1099,14 +1151,14 @@ public Com.Sajari.Sdk.Client.ApiResponse QueryCollectio // authentication (BasicAuth) required // http basic authentication required - if (!String.IsNullOrEmpty(this.Configuration.Username) || !String.IsNullOrEmpty(this.Configuration.Password)) + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password)) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Com.Sajari.Sdk.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/v4/collections/{collection_id}:queryCollection", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + var localVarResponse = await this.AsynchronousClient.PostAsync("/v4/collections/{collection_id}:query", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { @@ -1117,17 +1169,164 @@ public Com.Sajari.Sdk.Client.ApiResponse QueryCollectio return localVarResponse; } + /// + /// Query collection Query the collection to search for records. The following example demonstrates how to run a simple search for a particular string: ```json { \"variables\": { \"q\": \"search terms\" } } ``` For more information: - See [filtering content](https://docs.sajari.com/user-guide/integrating-search/filters/) - See [tracking in the Go SDK](https://github.com/sajari/sdk-go/blob/v2/session.go) - See [tracking in the JS SDK](https://github.com/sajari/sajari-sdk-js/blob/master/src/session.ts) + /// + /// Thrown when fails to make API call + /// The collection to query, e.g. `my-collection`. + /// + /// QueryCollectionResponse + [Obsolete] + public QueryCollectionResponse QueryCollection2(string collectionId, QueryCollectionRequest queryCollectionRequest) + { + Com.Sajari.Sdk.Client.ApiResponse localVarResponse = QueryCollection2WithHttpInfo(collectionId, queryCollectionRequest); + return localVarResponse.Data; + } + + /// + /// Query collection Query the collection to search for records. The following example demonstrates how to run a simple search for a particular string: ```json { \"variables\": { \"q\": \"search terms\" } } ``` For more information: - See [filtering content](https://docs.sajari.com/user-guide/integrating-search/filters/) - See [tracking in the Go SDK](https://github.com/sajari/sdk-go/blob/v2/session.go) - See [tracking in the JS SDK](https://github.com/sajari/sajari-sdk-js/blob/master/src/session.ts) + /// + /// Thrown when fails to make API call + /// The collection to query, e.g. `my-collection`. + /// + /// ApiResponse of QueryCollectionResponse + [Obsolete] + public Com.Sajari.Sdk.Client.ApiResponse QueryCollection2WithHttpInfo(string collectionId, QueryCollectionRequest queryCollectionRequest) + { + // verify the required parameter 'collectionId' is set + if (collectionId == null) + throw new Com.Sajari.Sdk.Client.ApiException(400, "Missing required parameter 'collectionId' when calling CollectionsApi->QueryCollection2"); + + // verify the required parameter 'queryCollectionRequest' is set + if (queryCollectionRequest == null) + throw new Com.Sajari.Sdk.Client.ApiException(400, "Missing required parameter 'queryCollectionRequest' when calling CollectionsApi->QueryCollection2"); + + Com.Sajari.Sdk.Client.RequestOptions localVarRequestOptions = new Com.Sajari.Sdk.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = Com.Sajari.Sdk.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Com.Sajari.Sdk.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("collection_id", Com.Sajari.Sdk.Client.ClientUtils.ParameterToString(collectionId)); // path parameter + localVarRequestOptions.Data = queryCollectionRequest; + + // authentication (BasicAuth) required + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password)) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Com.Sajari.Sdk.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/v4/collections/{collection_id}:queryCollection", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("QueryCollection2", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Query collection Query the collection to search for records. The following example demonstrates how to run a simple search for a particular string: ```json { \"variables\": { \"q\": \"search terms\" } } ``` For more information: - See [filtering content](https://docs.sajari.com/user-guide/integrating-search/filters/) - See [tracking in the Go SDK](https://github.com/sajari/sdk-go/blob/v2/session.go) - See [tracking in the JS SDK](https://github.com/sajari/sajari-sdk-js/blob/master/src/session.ts) + /// + /// Thrown when fails to make API call + /// The collection to query, e.g. `my-collection`. + /// + /// Cancellation Token to cancel the request. + /// Task of QueryCollectionResponse + [Obsolete] + public async System.Threading.Tasks.Task QueryCollection2Async(string collectionId, QueryCollectionRequest queryCollectionRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + Com.Sajari.Sdk.Client.ApiResponse localVarResponse = await QueryCollection2WithHttpInfoAsync(collectionId, queryCollectionRequest, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Query collection Query the collection to search for records. The following example demonstrates how to run a simple search for a particular string: ```json { \"variables\": { \"q\": \"search terms\" } } ``` For more information: - See [filtering content](https://docs.sajari.com/user-guide/integrating-search/filters/) - See [tracking in the Go SDK](https://github.com/sajari/sdk-go/blob/v2/session.go) - See [tracking in the JS SDK](https://github.com/sajari/sajari-sdk-js/blob/master/src/session.ts) + /// + /// Thrown when fails to make API call + /// The collection to query, e.g. `my-collection`. + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (QueryCollectionResponse) + [Obsolete] + public async System.Threading.Tasks.Task> QueryCollection2WithHttpInfoAsync(string collectionId, QueryCollectionRequest queryCollectionRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'collectionId' is set + if (collectionId == null) + throw new Com.Sajari.Sdk.Client.ApiException(400, "Missing required parameter 'collectionId' when calling CollectionsApi->QueryCollection2"); + + // verify the required parameter 'queryCollectionRequest' is set + if (queryCollectionRequest == null) + throw new Com.Sajari.Sdk.Client.ApiException(400, "Missing required parameter 'queryCollectionRequest' when calling CollectionsApi->QueryCollection2"); + + + Com.Sajari.Sdk.Client.RequestOptions localVarRequestOptions = new Com.Sajari.Sdk.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = Com.Sajari.Sdk.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Com.Sajari.Sdk.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("collection_id", Com.Sajari.Sdk.Client.ClientUtils.ParameterToString(collectionId)); // path parameter + localVarRequestOptions.Data = queryCollectionRequest; + + // authentication (BasicAuth) required + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password)) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Com.Sajari.Sdk.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PostAsync("/v4/collections/{collection_id}:queryCollection", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("QueryCollection2", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + /// /// Update collection Update the details of a collection. /// /// Thrown when fails to make API call /// The collection to update, e.g. `my-collection`. + /// The list of fields to be updated, separated by a comma, e.g. `field1,field2`. Each field should be in snake case, e.g. `display_name`. For each field that you want to update, provide a corresponding value in the collection object containing the new value. /// Details of the collection to update. - /// The list of fields to be updated, separated by a comma, e.g. `field1,field2`. Each field should be in snake case, e.g. `display_name`. For each field that you want to update, provide a corresponding value in the collection object containing the new value. (optional) /// Collection - public Collection UpdateCollection(string collectionId, Collection collection, string updateMask = default(string)) + public Collection UpdateCollection(string collectionId, string updateMask, Collection collection) { - Com.Sajari.Sdk.Client.ApiResponse localVarResponse = UpdateCollectionWithHttpInfo(collectionId, collection, updateMask); + Com.Sajari.Sdk.Client.ApiResponse localVarResponse = UpdateCollectionWithHttpInfo(collectionId, updateMask, collection); return localVarResponse.Data; } @@ -1136,27 +1335,31 @@ public Com.Sajari.Sdk.Client.ApiResponse QueryCollectio /// /// Thrown when fails to make API call /// The collection to update, e.g. `my-collection`. + /// The list of fields to be updated, separated by a comma, e.g. `field1,field2`. Each field should be in snake case, e.g. `display_name`. For each field that you want to update, provide a corresponding value in the collection object containing the new value. /// Details of the collection to update. - /// The list of fields to be updated, separated by a comma, e.g. `field1,field2`. Each field should be in snake case, e.g. `display_name`. For each field that you want to update, provide a corresponding value in the collection object containing the new value. (optional) /// ApiResponse of Collection - public Com.Sajari.Sdk.Client.ApiResponse UpdateCollectionWithHttpInfo(string collectionId, Collection collection, string updateMask = default(string)) + public Com.Sajari.Sdk.Client.ApiResponse UpdateCollectionWithHttpInfo(string collectionId, string updateMask, Collection collection) { // verify the required parameter 'collectionId' is set if (collectionId == null) throw new Com.Sajari.Sdk.Client.ApiException(400, "Missing required parameter 'collectionId' when calling CollectionsApi->UpdateCollection"); + // verify the required parameter 'updateMask' is set + if (updateMask == null) + throw new Com.Sajari.Sdk.Client.ApiException(400, "Missing required parameter 'updateMask' when calling CollectionsApi->UpdateCollection"); + // verify the required parameter 'collection' is set if (collection == null) throw new Com.Sajari.Sdk.Client.ApiException(400, "Missing required parameter 'collection' when calling CollectionsApi->UpdateCollection"); Com.Sajari.Sdk.Client.RequestOptions localVarRequestOptions = new Com.Sajari.Sdk.Client.RequestOptions(); - String[] _contentTypes = new String[] { + string[] _contentTypes = new string[] { "application/json" }; // to determine the Accept header - String[] _accepts = new String[] { + string[] _accepts = new string[] { "application/json" }; @@ -1167,15 +1370,12 @@ public Com.Sajari.Sdk.Client.ApiResponse QueryCollectio if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); localVarRequestOptions.PathParameters.Add("collection_id", Com.Sajari.Sdk.Client.ClientUtils.ParameterToString(collectionId)); // path parameter - if (updateMask != null) - { - localVarRequestOptions.QueryParameters.Add(Com.Sajari.Sdk.Client.ClientUtils.ParameterToMultiMap("", "update_mask", updateMask)); - } + localVarRequestOptions.QueryParameters.Add(Com.Sajari.Sdk.Client.ClientUtils.ParameterToMultiMap("", "update_mask", updateMask)); localVarRequestOptions.Data = collection; // authentication (BasicAuth) required // http basic authentication required - if (!String.IsNullOrEmpty(this.Configuration.Username) || !String.IsNullOrEmpty(this.Configuration.Password)) + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password)) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Com.Sajari.Sdk.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); } @@ -1197,13 +1397,13 @@ public Com.Sajari.Sdk.Client.ApiResponse QueryCollectio /// /// Thrown when fails to make API call /// The collection to update, e.g. `my-collection`. + /// The list of fields to be updated, separated by a comma, e.g. `field1,field2`. Each field should be in snake case, e.g. `display_name`. For each field that you want to update, provide a corresponding value in the collection object containing the new value. /// Details of the collection to update. - /// The list of fields to be updated, separated by a comma, e.g. `field1,field2`. Each field should be in snake case, e.g. `display_name`. For each field that you want to update, provide a corresponding value in the collection object containing the new value. (optional) /// Cancellation Token to cancel the request. /// Task of Collection - public async System.Threading.Tasks.Task UpdateCollectionAsync(string collectionId, Collection collection, string updateMask = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task UpdateCollectionAsync(string collectionId, string updateMask, Collection collection, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - Com.Sajari.Sdk.Client.ApiResponse localVarResponse = await UpdateCollectionWithHttpInfoAsync(collectionId, collection, updateMask, cancellationToken).ConfigureAwait(false); + Com.Sajari.Sdk.Client.ApiResponse localVarResponse = await UpdateCollectionWithHttpInfoAsync(collectionId, updateMask, collection, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; } @@ -1212,16 +1412,20 @@ public Com.Sajari.Sdk.Client.ApiResponse QueryCollectio /// /// Thrown when fails to make API call /// The collection to update, e.g. `my-collection`. + /// The list of fields to be updated, separated by a comma, e.g. `field1,field2`. Each field should be in snake case, e.g. `display_name`. For each field that you want to update, provide a corresponding value in the collection object containing the new value. /// Details of the collection to update. - /// The list of fields to be updated, separated by a comma, e.g. `field1,field2`. Each field should be in snake case, e.g. `display_name`. For each field that you want to update, provide a corresponding value in the collection object containing the new value. (optional) /// Cancellation Token to cancel the request. /// Task of ApiResponse (Collection) - public async System.Threading.Tasks.Task> UpdateCollectionWithHttpInfoAsync(string collectionId, Collection collection, string updateMask = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> UpdateCollectionWithHttpInfoAsync(string collectionId, string updateMask, Collection collection, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'collectionId' is set if (collectionId == null) throw new Com.Sajari.Sdk.Client.ApiException(400, "Missing required parameter 'collectionId' when calling CollectionsApi->UpdateCollection"); + // verify the required parameter 'updateMask' is set + if (updateMask == null) + throw new Com.Sajari.Sdk.Client.ApiException(400, "Missing required parameter 'updateMask' when calling CollectionsApi->UpdateCollection"); + // verify the required parameter 'collection' is set if (collection == null) throw new Com.Sajari.Sdk.Client.ApiException(400, "Missing required parameter 'collection' when calling CollectionsApi->UpdateCollection"); @@ -1229,12 +1433,12 @@ public Com.Sajari.Sdk.Client.ApiResponse QueryCollectio Com.Sajari.Sdk.Client.RequestOptions localVarRequestOptions = new Com.Sajari.Sdk.Client.RequestOptions(); - String[] _contentTypes = new String[] { + string[] _contentTypes = new string[] { "application/json" }; // to determine the Accept header - String[] _accepts = new String[] { + string[] _accepts = new string[] { "application/json" }; @@ -1246,15 +1450,12 @@ public Com.Sajari.Sdk.Client.ApiResponse QueryCollectio if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); localVarRequestOptions.PathParameters.Add("collection_id", Com.Sajari.Sdk.Client.ClientUtils.ParameterToString(collectionId)); // path parameter - if (updateMask != null) - { - localVarRequestOptions.QueryParameters.Add(Com.Sajari.Sdk.Client.ClientUtils.ParameterToMultiMap("", "update_mask", updateMask)); - } + localVarRequestOptions.QueryParameters.Add(Com.Sajari.Sdk.Client.ClientUtils.ParameterToMultiMap("", "update_mask", updateMask)); localVarRequestOptions.Data = collection; // authentication (BasicAuth) required // http basic authentication required - if (!String.IsNullOrEmpty(this.Configuration.Username) || !String.IsNullOrEmpty(this.Configuration.Password)) + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password)) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Com.Sajari.Sdk.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); } diff --git a/src/Com.Sajari.Sdk/Api/EventsApi.cs b/src/Com.Sajari.Sdk/Api/EventsApi.cs index 802337c..7642887 100644 --- a/src/Com.Sajari.Sdk/Api/EventsApi.cs +++ b/src/Com.Sajari.Sdk/Api/EventsApi.cs @@ -48,6 +48,29 @@ public interface IEventsApiSync : IApiAccessor /// /// ApiResponse of Object ApiResponse SendEventWithHttpInfo(SendEventRequest sendEventRequest); + /// + /// 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\" } } ``` + /// + /// Thrown when fails to make API call + /// + /// Object + [Obsolete] + Object SendEvent2(SendEventRequest sendEventRequest); + + /// + /// 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\" } } ``` + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of Object + [Obsolete] + ApiResponse SendEvent2WithHttpInfo(SendEventRequest sendEventRequest); #endregion Synchronous Operations } @@ -80,6 +103,31 @@ public interface IEventsApiAsync : IApiAccessor /// Cancellation Token to cancel the request. /// Task of ApiResponse (Object) System.Threading.Tasks.Task> SendEventWithHttpInfoAsync(SendEventRequest sendEventRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// 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\" } } ``` + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of Object + [Obsolete] + System.Threading.Tasks.Task SendEvent2Async(SendEventRequest sendEventRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// 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\" } } ``` + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + [Obsolete] + System.Threading.Tasks.Task> SendEvent2WithHttpInfoAsync(SendEventRequest sendEventRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); #endregion Asynchronous Operations } @@ -110,7 +158,7 @@ public EventsApi() : this((string)null) /// Initializes a new instance of the class. /// /// - public EventsApi(String basePath) + public EventsApi(string basePath) { this.Configuration = Com.Sajari.Sdk.Client.Configuration.MergeConfigurations( Com.Sajari.Sdk.Client.GlobalConfiguration.Instance, @@ -173,7 +221,7 @@ public EventsApi(Com.Sajari.Sdk.Client.ISynchronousClient client, Com.Sajari.Sdk /// Gets the base path of the API client. /// /// The base path - public String GetBasePath() + public string GetBasePath() { return this.Configuration.BasePath; } @@ -226,12 +274,12 @@ public Com.Sajari.Sdk.Client.ApiResponse SendEventWithHttpInfo(SendEvent Com.Sajari.Sdk.Client.RequestOptions localVarRequestOptions = new Com.Sajari.Sdk.Client.RequestOptions(); - String[] _contentTypes = new String[] { + string[] _contentTypes = new string[] { "application/json" }; // to determine the Accept header - String[] _accepts = new String[] { + string[] _accepts = new string[] { "application/json" }; @@ -245,13 +293,13 @@ public Com.Sajari.Sdk.Client.ApiResponse SendEventWithHttpInfo(SendEvent // authentication (BasicAuth) required // http basic authentication required - if (!String.IsNullOrEmpty(this.Configuration.Username) || !String.IsNullOrEmpty(this.Configuration.Password)) + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password)) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Com.Sajari.Sdk.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); } // make the HTTP request - var localVarResponse = this.Client.Post("/v4/events:sendEvent", localVarRequestOptions, this.Configuration); + var localVarResponse = this.Client.Post("/v4/events:send", localVarRequestOptions, this.Configuration); if (this.ExceptionFactory != null) { @@ -291,12 +339,12 @@ public Com.Sajari.Sdk.Client.ApiResponse SendEventWithHttpInfo(SendEvent Com.Sajari.Sdk.Client.RequestOptions localVarRequestOptions = new Com.Sajari.Sdk.Client.RequestOptions(); - String[] _contentTypes = new String[] { + string[] _contentTypes = new string[] { "application/json" }; // to determine the Accept header - String[] _accepts = new String[] { + string[] _accepts = new string[] { "application/json" }; @@ -311,14 +359,14 @@ public Com.Sajari.Sdk.Client.ApiResponse SendEventWithHttpInfo(SendEvent // authentication (BasicAuth) required // http basic authentication required - if (!String.IsNullOrEmpty(this.Configuration.Username) || !String.IsNullOrEmpty(this.Configuration.Password)) + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password)) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Com.Sajari.Sdk.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); } // make the HTTP request - var localVarResponse = await this.AsynchronousClient.PostAsync("/v4/events:sendEvent", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + var localVarResponse = await this.AsynchronousClient.PostAsync("/v4/events:send", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { @@ -329,5 +377,138 @@ public Com.Sajari.Sdk.Client.ApiResponse SendEventWithHttpInfo(SendEvent return localVarResponse; } + /// + /// 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\" } } ``` + /// + /// Thrown when fails to make API call + /// + /// Object + [Obsolete] + public Object SendEvent2(SendEventRequest sendEventRequest) + { + Com.Sajari.Sdk.Client.ApiResponse localVarResponse = SendEvent2WithHttpInfo(sendEventRequest); + return localVarResponse.Data; + } + + /// + /// 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\" } } ``` + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of Object + [Obsolete] + public Com.Sajari.Sdk.Client.ApiResponse SendEvent2WithHttpInfo(SendEventRequest sendEventRequest) + { + // verify the required parameter 'sendEventRequest' is set + if (sendEventRequest == null) + throw new Com.Sajari.Sdk.Client.ApiException(400, "Missing required parameter 'sendEventRequest' when calling EventsApi->SendEvent2"); + + Com.Sajari.Sdk.Client.RequestOptions localVarRequestOptions = new Com.Sajari.Sdk.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = Com.Sajari.Sdk.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Com.Sajari.Sdk.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.Data = sendEventRequest; + + // authentication (BasicAuth) required + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password)) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Com.Sajari.Sdk.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/v4/events:sendEvent", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("SendEvent2", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// 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\" } } ``` + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of Object + [Obsolete] + public async System.Threading.Tasks.Task SendEvent2Async(SendEventRequest sendEventRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + Com.Sajari.Sdk.Client.ApiResponse localVarResponse = await SendEvent2WithHttpInfoAsync(sendEventRequest, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// 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\" } } ``` + /// + /// Thrown when fails to make API call + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + [Obsolete] + public async System.Threading.Tasks.Task> SendEvent2WithHttpInfoAsync(SendEventRequest sendEventRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'sendEventRequest' is set + if (sendEventRequest == null) + throw new Com.Sajari.Sdk.Client.ApiException(400, "Missing required parameter 'sendEventRequest' when calling EventsApi->SendEvent2"); + + + Com.Sajari.Sdk.Client.RequestOptions localVarRequestOptions = new Com.Sajari.Sdk.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = Com.Sajari.Sdk.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Com.Sajari.Sdk.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.Data = sendEventRequest; + + // authentication (BasicAuth) required + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password)) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Com.Sajari.Sdk.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PostAsync("/v4/events:sendEvent", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("SendEvent2", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + } } diff --git a/src/Com.Sajari.Sdk/Api/PipelinesApi.cs b/src/Com.Sajari.Sdk/Api/PipelinesApi.cs index 2b6b884..f0e2ce9 100644 --- a/src/Com.Sajari.Sdk/Api/PipelinesApi.cs +++ b/src/Com.Sajari.Sdk/Api/PipelinesApi.cs @@ -156,7 +156,7 @@ public interface IPipelinesApiSync : IApiAccessor /// List pipelines /// /// - /// Retrieve a list of pipelines. + /// Retrieve a list of pipelines in a collection. /// /// Thrown when fails to make API call /// The collection that owns this set of pipelines, e.g. `my-collection`. @@ -170,7 +170,7 @@ public interface IPipelinesApiSync : IApiAccessor /// List pipelines /// /// - /// Retrieve a list of pipelines. + /// Retrieve a list of pipelines in a collection. /// /// Thrown when fails to make API call /// The collection that owns this set of pipelines, e.g. `my-collection`. @@ -377,7 +377,7 @@ public interface IPipelinesApiAsync : IApiAccessor /// List pipelines /// /// - /// Retrieve a list of pipelines. + /// Retrieve a list of pipelines in a collection. /// /// Thrown when fails to make API call /// The collection that owns this set of pipelines, e.g. `my-collection`. @@ -392,7 +392,7 @@ public interface IPipelinesApiAsync : IApiAccessor /// List pipelines /// /// - /// Retrieve a list of pipelines. + /// Retrieve a list of pipelines in a collection. /// /// Thrown when fails to make API call /// The collection that owns this set of pipelines, e.g. `my-collection`. @@ -486,7 +486,7 @@ public PipelinesApi() : this((string)null) /// Initializes a new instance of the class. /// /// - public PipelinesApi(String basePath) + public PipelinesApi(string basePath) { this.Configuration = Com.Sajari.Sdk.Client.Configuration.MergeConfigurations( Com.Sajari.Sdk.Client.GlobalConfiguration.Instance, @@ -549,7 +549,7 @@ public PipelinesApi(Com.Sajari.Sdk.Client.ISynchronousClient client, Com.Sajari. /// Gets the base path of the API client. /// /// The base path - public String GetBasePath() + public string GetBasePath() { return this.Configuration.BasePath; } @@ -608,13 +608,13 @@ public Com.Sajari.Sdk.Client.ApiResponse CreatePipelineWithHttpInfo(st Com.Sajari.Sdk.Client.RequestOptions localVarRequestOptions = new Com.Sajari.Sdk.Client.RequestOptions(); - String[] _contentTypes = new String[] { + string[] _contentTypes = new string[] { "application/json", "application/yaml" }; // to determine the Accept header - String[] _accepts = new String[] { + string[] _accepts = new string[] { "application/json", "application/yaml" }; @@ -630,7 +630,7 @@ public Com.Sajari.Sdk.Client.ApiResponse CreatePipelineWithHttpInfo(st // authentication (BasicAuth) required // http basic authentication required - if (!String.IsNullOrEmpty(this.Configuration.Username) || !String.IsNullOrEmpty(this.Configuration.Password)) + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password)) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Com.Sajari.Sdk.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); } @@ -682,13 +682,13 @@ public Com.Sajari.Sdk.Client.ApiResponse CreatePipelineWithHttpInfo(st Com.Sajari.Sdk.Client.RequestOptions localVarRequestOptions = new Com.Sajari.Sdk.Client.RequestOptions(); - String[] _contentTypes = new String[] { + string[] _contentTypes = new string[] { "application/json", "application/yaml" }; // to determine the Accept header - String[] _accepts = new String[] { + string[] _accepts = new string[] { "application/json", "application/yaml" }; @@ -705,7 +705,7 @@ public Com.Sajari.Sdk.Client.ApiResponse CreatePipelineWithHttpInfo(st // authentication (BasicAuth) required // http basic authentication required - if (!String.IsNullOrEmpty(this.Configuration.Username) || !String.IsNullOrEmpty(this.Configuration.Password)) + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password)) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Com.Sajari.Sdk.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); } @@ -755,12 +755,12 @@ public Com.Sajari.Sdk.Client.ApiResponse GeneratePipe Com.Sajari.Sdk.Client.RequestOptions localVarRequestOptions = new Com.Sajari.Sdk.Client.RequestOptions(); - String[] _contentTypes = new String[] { + string[] _contentTypes = new string[] { "application/json" }; // to determine the Accept header - String[] _accepts = new String[] { + string[] _accepts = new string[] { "application/json", "application/yaml" }; @@ -776,7 +776,7 @@ public Com.Sajari.Sdk.Client.ApiResponse GeneratePipe // authentication (BasicAuth) required // http basic authentication required - if (!String.IsNullOrEmpty(this.Configuration.Username) || !String.IsNullOrEmpty(this.Configuration.Password)) + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password)) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Com.Sajari.Sdk.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); } @@ -828,12 +828,12 @@ public Com.Sajari.Sdk.Client.ApiResponse GeneratePipe Com.Sajari.Sdk.Client.RequestOptions localVarRequestOptions = new Com.Sajari.Sdk.Client.RequestOptions(); - String[] _contentTypes = new String[] { + string[] _contentTypes = new string[] { "application/json" }; // to determine the Accept header - String[] _accepts = new String[] { + string[] _accepts = new string[] { "application/json", "application/yaml" }; @@ -850,7 +850,7 @@ public Com.Sajari.Sdk.Client.ApiResponse GeneratePipe // authentication (BasicAuth) required // http basic authentication required - if (!String.IsNullOrEmpty(this.Configuration.Username) || !String.IsNullOrEmpty(this.Configuration.Password)) + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password)) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Com.Sajari.Sdk.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); } @@ -900,11 +900,11 @@ public Com.Sajari.Sdk.Client.ApiResponse GetDefaultP Com.Sajari.Sdk.Client.RequestOptions localVarRequestOptions = new Com.Sajari.Sdk.Client.RequestOptions(); - String[] _contentTypes = new String[] { + string[] _contentTypes = new string[] { }; // to determine the Accept header - String[] _accepts = new String[] { + string[] _accepts = new string[] { "application/json" }; @@ -919,7 +919,7 @@ public Com.Sajari.Sdk.Client.ApiResponse GetDefaultP // authentication (BasicAuth) required // http basic authentication required - if (!String.IsNullOrEmpty(this.Configuration.Username) || !String.IsNullOrEmpty(this.Configuration.Password)) + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password)) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Com.Sajari.Sdk.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); } @@ -971,11 +971,11 @@ public Com.Sajari.Sdk.Client.ApiResponse GetDefaultP Com.Sajari.Sdk.Client.RequestOptions localVarRequestOptions = new Com.Sajari.Sdk.Client.RequestOptions(); - String[] _contentTypes = new String[] { + string[] _contentTypes = new string[] { }; // to determine the Accept header - String[] _accepts = new String[] { + string[] _accepts = new string[] { "application/json" }; @@ -991,7 +991,7 @@ public Com.Sajari.Sdk.Client.ApiResponse GetDefaultP // authentication (BasicAuth) required // http basic authentication required - if (!String.IsNullOrEmpty(this.Configuration.Username) || !String.IsNullOrEmpty(this.Configuration.Password)) + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password)) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Com.Sajari.Sdk.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); } @@ -1049,11 +1049,11 @@ public Com.Sajari.Sdk.Client.ApiResponse GetDefaultP Com.Sajari.Sdk.Client.RequestOptions localVarRequestOptions = new Com.Sajari.Sdk.Client.RequestOptions(); - String[] _contentTypes = new String[] { + string[] _contentTypes = new string[] { }; // to determine the Accept header - String[] _accepts = new String[] { + string[] _accepts = new string[] { "application/json", "application/yaml" }; @@ -1074,7 +1074,7 @@ public Com.Sajari.Sdk.Client.ApiResponse GetDefaultP // authentication (BasicAuth) required // http basic authentication required - if (!String.IsNullOrEmpty(this.Configuration.Username) || !String.IsNullOrEmpty(this.Configuration.Password)) + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password)) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Com.Sajari.Sdk.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); } @@ -1134,11 +1134,11 @@ public Com.Sajari.Sdk.Client.ApiResponse GetDefaultP Com.Sajari.Sdk.Client.RequestOptions localVarRequestOptions = new Com.Sajari.Sdk.Client.RequestOptions(); - String[] _contentTypes = new String[] { + string[] _contentTypes = new string[] { }; // to determine the Accept header - String[] _accepts = new String[] { + string[] _accepts = new string[] { "application/json", "application/yaml" }; @@ -1160,7 +1160,7 @@ public Com.Sajari.Sdk.Client.ApiResponse GetDefaultP // authentication (BasicAuth) required // http basic authentication required - if (!String.IsNullOrEmpty(this.Configuration.Username) || !String.IsNullOrEmpty(this.Configuration.Password)) + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password)) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Com.Sajari.Sdk.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); } @@ -1224,11 +1224,11 @@ public Com.Sajari.Sdk.Client.ApiResponse GetDefaultP Com.Sajari.Sdk.Client.RequestOptions localVarRequestOptions = new Com.Sajari.Sdk.Client.RequestOptions(); - String[] _contentTypes = new String[] { + string[] _contentTypes = new string[] { }; // to determine the Accept header - String[] _accepts = new String[] { + string[] _accepts = new string[] { "application/json", "application/yaml" }; @@ -1250,7 +1250,7 @@ public Com.Sajari.Sdk.Client.ApiResponse GetDefaultP // authentication (BasicAuth) required // http basic authentication required - if (!String.IsNullOrEmpty(this.Configuration.Username) || !String.IsNullOrEmpty(this.Configuration.Password)) + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password)) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Com.Sajari.Sdk.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); } @@ -1316,11 +1316,11 @@ public Com.Sajari.Sdk.Client.ApiResponse GetDefaultP Com.Sajari.Sdk.Client.RequestOptions localVarRequestOptions = new Com.Sajari.Sdk.Client.RequestOptions(); - String[] _contentTypes = new String[] { + string[] _contentTypes = new string[] { }; // to determine the Accept header - String[] _accepts = new String[] { + string[] _accepts = new string[] { "application/json", "application/yaml" }; @@ -1343,7 +1343,7 @@ public Com.Sajari.Sdk.Client.ApiResponse GetDefaultP // authentication (BasicAuth) required // http basic authentication required - if (!String.IsNullOrEmpty(this.Configuration.Username) || !String.IsNullOrEmpty(this.Configuration.Password)) + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password)) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Com.Sajari.Sdk.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); } @@ -1362,7 +1362,7 @@ public Com.Sajari.Sdk.Client.ApiResponse GetDefaultP } /// - /// List pipelines Retrieve a list of pipelines. + /// List pipelines Retrieve a list of pipelines in a collection. /// /// Thrown when fails to make API call /// The collection that owns this set of pipelines, e.g. `my-collection`. @@ -1377,7 +1377,7 @@ public Com.Sajari.Sdk.Client.ApiResponse GetDefaultP } /// - /// List pipelines Retrieve a list of pipelines. + /// List pipelines Retrieve a list of pipelines in a collection. /// /// Thrown when fails to make API call /// The collection that owns this set of pipelines, e.g. `my-collection`. @@ -1393,11 +1393,11 @@ public Com.Sajari.Sdk.Client.ApiResponse GetDefaultP Com.Sajari.Sdk.Client.RequestOptions localVarRequestOptions = new Com.Sajari.Sdk.Client.RequestOptions(); - String[] _contentTypes = new String[] { + string[] _contentTypes = new string[] { }; // to determine the Accept header - String[] _accepts = new String[] { + string[] _accepts = new string[] { "application/json" }; @@ -1423,7 +1423,7 @@ public Com.Sajari.Sdk.Client.ApiResponse GetDefaultP // authentication (BasicAuth) required // http basic authentication required - if (!String.IsNullOrEmpty(this.Configuration.Username) || !String.IsNullOrEmpty(this.Configuration.Password)) + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password)) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Com.Sajari.Sdk.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); } @@ -1441,7 +1441,7 @@ public Com.Sajari.Sdk.Client.ApiResponse GetDefaultP } /// - /// List pipelines Retrieve a list of pipelines. + /// List pipelines Retrieve a list of pipelines in a collection. /// /// Thrown when fails to make API call /// The collection that owns this set of pipelines, e.g. `my-collection`. @@ -1457,7 +1457,7 @@ public Com.Sajari.Sdk.Client.ApiResponse GetDefaultP } /// - /// List pipelines Retrieve a list of pipelines. + /// List pipelines Retrieve a list of pipelines in a collection. /// /// Thrown when fails to make API call /// The collection that owns this set of pipelines, e.g. `my-collection`. @@ -1475,11 +1475,11 @@ public Com.Sajari.Sdk.Client.ApiResponse GetDefaultP Com.Sajari.Sdk.Client.RequestOptions localVarRequestOptions = new Com.Sajari.Sdk.Client.RequestOptions(); - String[] _contentTypes = new String[] { + string[] _contentTypes = new string[] { }; // to determine the Accept header - String[] _accepts = new String[] { + string[] _accepts = new string[] { "application/json" }; @@ -1506,7 +1506,7 @@ public Com.Sajari.Sdk.Client.ApiResponse GetDefaultP // authentication (BasicAuth) required // http basic authentication required - if (!String.IsNullOrEmpty(this.Configuration.Username) || !String.IsNullOrEmpty(this.Configuration.Password)) + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password)) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Com.Sajari.Sdk.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); } @@ -1556,12 +1556,12 @@ public Com.Sajari.Sdk.Client.ApiResponse SetDefaultPipelineWithHttpInfo( Com.Sajari.Sdk.Client.RequestOptions localVarRequestOptions = new Com.Sajari.Sdk.Client.RequestOptions(); - String[] _contentTypes = new String[] { + string[] _contentTypes = new string[] { "application/json" }; // to determine the Accept header - String[] _accepts = new String[] { + string[] _accepts = new string[] { "application/json" }; @@ -1576,7 +1576,7 @@ public Com.Sajari.Sdk.Client.ApiResponse SetDefaultPipelineWithHttpInfo( // authentication (BasicAuth) required // http basic authentication required - if (!String.IsNullOrEmpty(this.Configuration.Username) || !String.IsNullOrEmpty(this.Configuration.Password)) + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password)) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Com.Sajari.Sdk.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); } @@ -1628,12 +1628,12 @@ public Com.Sajari.Sdk.Client.ApiResponse SetDefaultPipelineWithHttpInfo( Com.Sajari.Sdk.Client.RequestOptions localVarRequestOptions = new Com.Sajari.Sdk.Client.RequestOptions(); - String[] _contentTypes = new String[] { + string[] _contentTypes = new string[] { "application/json" }; // to determine the Accept header - String[] _accepts = new String[] { + string[] _accepts = new string[] { "application/json" }; @@ -1649,7 +1649,7 @@ public Com.Sajari.Sdk.Client.ApiResponse SetDefaultPipelineWithHttpInfo( // authentication (BasicAuth) required // http basic authentication required - if (!String.IsNullOrEmpty(this.Configuration.Username) || !String.IsNullOrEmpty(this.Configuration.Password)) + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password)) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Com.Sajari.Sdk.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); } @@ -1711,12 +1711,12 @@ public Com.Sajari.Sdk.Client.ApiResponse SetDefaultVersionWithHttpInfo(s Com.Sajari.Sdk.Client.RequestOptions localVarRequestOptions = new Com.Sajari.Sdk.Client.RequestOptions(); - String[] _contentTypes = new String[] { + string[] _contentTypes = new string[] { "application/json" }; // to determine the Accept header - String[] _accepts = new String[] { + string[] _accepts = new string[] { "application/json" }; @@ -1733,7 +1733,7 @@ public Com.Sajari.Sdk.Client.ApiResponse SetDefaultVersionWithHttpInfo(s // authentication (BasicAuth) required // http basic authentication required - if (!String.IsNullOrEmpty(this.Configuration.Username) || !String.IsNullOrEmpty(this.Configuration.Password)) + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password)) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Com.Sajari.Sdk.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); } @@ -1797,12 +1797,12 @@ public Com.Sajari.Sdk.Client.ApiResponse SetDefaultVersionWithHttpInfo(s Com.Sajari.Sdk.Client.RequestOptions localVarRequestOptions = new Com.Sajari.Sdk.Client.RequestOptions(); - String[] _contentTypes = new String[] { + string[] _contentTypes = new string[] { "application/json" }; // to determine the Accept header - String[] _accepts = new String[] { + string[] _accepts = new string[] { "application/json" }; @@ -1820,7 +1820,7 @@ public Com.Sajari.Sdk.Client.ApiResponse SetDefaultVersionWithHttpInfo(s // authentication (BasicAuth) required // http basic authentication required - if (!String.IsNullOrEmpty(this.Configuration.Username) || !String.IsNullOrEmpty(this.Configuration.Password)) + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password)) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Com.Sajari.Sdk.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); } diff --git a/src/Com.Sajari.Sdk/Api/RecordsApi.cs b/src/Com.Sajari.Sdk/Api/RecordsApi.cs index 154d36b..7e6be0c 100644 --- a/src/Com.Sajari.Sdk/Api/RecordsApi.cs +++ b/src/Com.Sajari.Sdk/Api/RecordsApi.cs @@ -97,10 +97,33 @@ public interface IRecordsApiSync : IApiAccessor /// ApiResponse of Object ApiResponse GetRecordWithHttpInfo(string collectionId, GetRecordRequest getRecordRequest); /// + /// Update record + /// + /// + /// Add or update specific fields within a record with the given values. The updated record is returned in the response. To replace all fields in a record, you should use the [UpsertRecord](/api#operation/UpsertRecord) call. Note that the update record call cannot be used to add or update indexed or unique fields. For this case use the [UpsertRecord](/api#operation/UpsertRecord) call. + /// + /// Thrown when fails to make API call + /// The collection that contains the record to update, e.g. `my-collection`. + /// + /// Object + Object UpdateRecord(string collectionId, UpdateRecordRequest updateRecordRequest); + + /// + /// Update record + /// + /// + /// Add or update specific fields within a record with the given values. The updated record is returned in the response. To replace all fields in a record, you should use the [UpsertRecord](/api#operation/UpsertRecord) call. Note that the update record call cannot be used to add or update indexed or unique fields. For this case use the [UpsertRecord](/api#operation/UpsertRecord) call. + /// + /// Thrown when fails to make API call + /// The collection that contains the record to update, e.g. `my-collection`. + /// + /// ApiResponse of Object + ApiResponse UpdateRecordWithHttpInfo(string collectionId, UpdateRecordRequest updateRecordRequest); + /// /// Upsert record /// /// - /// If the record does not exist in your collection it is inserted. If it does exist it is updated. If no pipeline is specified, the default record pipeline is used to process the record. If the record is inserted, the response contains the key of the inserted record. You can use this if you need to retrieve or delete the record. If the record is updated, the response does not contain a key. Callers can use this as a signal to determine if the record is inserted/created or updated. For example, to add a single product from your ecommerce store to a collection, use the following call: ```json { \"pipeline\": { \"name\": \"my-pipeline\", \"version\": \"1\" }, \"record\": { \"id\": \"54hdc7h2334h\", \"name\": \"Smart TV\", \"price\": 1999, \"brand\": \"Acme\", \"description\": \"...\", \"in_stock\": true } } ``` + /// If the record does not exist in the collection it is inserted. If it does exist it is updated. If no pipeline is specified, the default record pipeline is used to process the record. If the record is inserted, the response contains the key of the inserted record. You can use this if you need to retrieve or delete the record. If the record is updated, the response does not contain a key. Callers can use this as a signal to determine if the record is inserted/created or updated. For example, to add a single product from your ecommerce store to a collection, use the following call: ```json { \"pipeline\": { \"name\": \"my-pipeline\", \"version\": \"1\" }, \"record\": { \"id\": \"54hdc7h2334h\", \"name\": \"Smart TV\", \"price\": 1999, \"brand\": \"Acme\", \"description\": \"...\", \"in_stock\": true } } ``` /// /// Thrown when fails to make API call /// The collection to upsert the record in, e.g. `my-collection`. @@ -112,7 +135,7 @@ public interface IRecordsApiSync : IApiAccessor /// Upsert record /// /// - /// If the record does not exist in your collection it is inserted. If it does exist it is updated. If no pipeline is specified, the default record pipeline is used to process the record. If the record is inserted, the response contains the key of the inserted record. You can use this if you need to retrieve or delete the record. If the record is updated, the response does not contain a key. Callers can use this as a signal to determine if the record is inserted/created or updated. For example, to add a single product from your ecommerce store to a collection, use the following call: ```json { \"pipeline\": { \"name\": \"my-pipeline\", \"version\": \"1\" }, \"record\": { \"id\": \"54hdc7h2334h\", \"name\": \"Smart TV\", \"price\": 1999, \"brand\": \"Acme\", \"description\": \"...\", \"in_stock\": true } } ``` + /// If the record does not exist in the collection it is inserted. If it does exist it is updated. If no pipeline is specified, the default record pipeline is used to process the record. If the record is inserted, the response contains the key of the inserted record. You can use this if you need to retrieve or delete the record. If the record is updated, the response does not contain a key. Callers can use this as a signal to determine if the record is inserted/created or updated. For example, to add a single product from your ecommerce store to a collection, use the following call: ```json { \"pipeline\": { \"name\": \"my-pipeline\", \"version\": \"1\" }, \"record\": { \"id\": \"54hdc7h2334h\", \"name\": \"Smart TV\", \"price\": 1999, \"brand\": \"Acme\", \"description\": \"...\", \"in_stock\": true } } ``` /// /// Thrown when fails to make API call /// The collection to upsert the record in, e.g. `my-collection`. @@ -204,10 +227,35 @@ public interface IRecordsApiAsync : IApiAccessor /// Task of ApiResponse (Object) System.Threading.Tasks.Task> GetRecordWithHttpInfoAsync(string collectionId, GetRecordRequest getRecordRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// + /// Update record + /// + /// + /// Add or update specific fields within a record with the given values. The updated record is returned in the response. To replace all fields in a record, you should use the [UpsertRecord](/api#operation/UpsertRecord) call. Note that the update record call cannot be used to add or update indexed or unique fields. For this case use the [UpsertRecord](/api#operation/UpsertRecord) call. + /// + /// Thrown when fails to make API call + /// The collection that contains the record to update, e.g. `my-collection`. + /// + /// Cancellation Token to cancel the request. + /// Task of Object + System.Threading.Tasks.Task UpdateRecordAsync(string collectionId, UpdateRecordRequest updateRecordRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Update record + /// + /// + /// Add or update specific fields within a record with the given values. The updated record is returned in the response. To replace all fields in a record, you should use the [UpsertRecord](/api#operation/UpsertRecord) call. Note that the update record call cannot be used to add or update indexed or unique fields. For this case use the [UpsertRecord](/api#operation/UpsertRecord) call. + /// + /// Thrown when fails to make API call + /// The collection that contains the record to update, e.g. `my-collection`. + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + System.Threading.Tasks.Task> UpdateRecordWithHttpInfoAsync(string collectionId, UpdateRecordRequest updateRecordRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Upsert record /// /// - /// If the record does not exist in your collection it is inserted. If it does exist it is updated. If no pipeline is specified, the default record pipeline is used to process the record. If the record is inserted, the response contains the key of the inserted record. You can use this if you need to retrieve or delete the record. If the record is updated, the response does not contain a key. Callers can use this as a signal to determine if the record is inserted/created or updated. For example, to add a single product from your ecommerce store to a collection, use the following call: ```json { \"pipeline\": { \"name\": \"my-pipeline\", \"version\": \"1\" }, \"record\": { \"id\": \"54hdc7h2334h\", \"name\": \"Smart TV\", \"price\": 1999, \"brand\": \"Acme\", \"description\": \"...\", \"in_stock\": true } } ``` + /// If the record does not exist in the collection it is inserted. If it does exist it is updated. If no pipeline is specified, the default record pipeline is used to process the record. If the record is inserted, the response contains the key of the inserted record. You can use this if you need to retrieve or delete the record. If the record is updated, the response does not contain a key. Callers can use this as a signal to determine if the record is inserted/created or updated. For example, to add a single product from your ecommerce store to a collection, use the following call: ```json { \"pipeline\": { \"name\": \"my-pipeline\", \"version\": \"1\" }, \"record\": { \"id\": \"54hdc7h2334h\", \"name\": \"Smart TV\", \"price\": 1999, \"brand\": \"Acme\", \"description\": \"...\", \"in_stock\": true } } ``` /// /// Thrown when fails to make API call /// The collection to upsert the record in, e.g. `my-collection`. @@ -220,7 +268,7 @@ public interface IRecordsApiAsync : IApiAccessor /// Upsert record /// /// - /// If the record does not exist in your collection it is inserted. If it does exist it is updated. If no pipeline is specified, the default record pipeline is used to process the record. If the record is inserted, the response contains the key of the inserted record. You can use this if you need to retrieve or delete the record. If the record is updated, the response does not contain a key. Callers can use this as a signal to determine if the record is inserted/created or updated. For example, to add a single product from your ecommerce store to a collection, use the following call: ```json { \"pipeline\": { \"name\": \"my-pipeline\", \"version\": \"1\" }, \"record\": { \"id\": \"54hdc7h2334h\", \"name\": \"Smart TV\", \"price\": 1999, \"brand\": \"Acme\", \"description\": \"...\", \"in_stock\": true } } ``` + /// If the record does not exist in the collection it is inserted. If it does exist it is updated. If no pipeline is specified, the default record pipeline is used to process the record. If the record is inserted, the response contains the key of the inserted record. You can use this if you need to retrieve or delete the record. If the record is updated, the response does not contain a key. Callers can use this as a signal to determine if the record is inserted/created or updated. For example, to add a single product from your ecommerce store to a collection, use the following call: ```json { \"pipeline\": { \"name\": \"my-pipeline\", \"version\": \"1\" }, \"record\": { \"id\": \"54hdc7h2334h\", \"name\": \"Smart TV\", \"price\": 1999, \"brand\": \"Acme\", \"description\": \"...\", \"in_stock\": true } } ``` /// /// Thrown when fails to make API call /// The collection to upsert the record in, e.g. `my-collection`. @@ -258,7 +306,7 @@ public RecordsApi() : this((string)null) /// Initializes a new instance of the class. /// /// - public RecordsApi(String basePath) + public RecordsApi(string basePath) { this.Configuration = Com.Sajari.Sdk.Client.Configuration.MergeConfigurations( Com.Sajari.Sdk.Client.GlobalConfiguration.Instance, @@ -321,7 +369,7 @@ public RecordsApi(Com.Sajari.Sdk.Client.ISynchronousClient client, Com.Sajari.Sd /// Gets the base path of the API client. /// /// The base path - public String GetBasePath() + public string GetBasePath() { return this.Configuration.BasePath; } @@ -380,12 +428,12 @@ public Com.Sajari.Sdk.Client.ApiResponse BatchUpsert Com.Sajari.Sdk.Client.RequestOptions localVarRequestOptions = new Com.Sajari.Sdk.Client.RequestOptions(); - String[] _contentTypes = new String[] { + string[] _contentTypes = new string[] { "application/json" }; // to determine the Accept header - String[] _accepts = new String[] { + string[] _accepts = new string[] { "application/json" }; @@ -400,7 +448,7 @@ public Com.Sajari.Sdk.Client.ApiResponse BatchUpsert // authentication (BasicAuth) required // http basic authentication required - if (!String.IsNullOrEmpty(this.Configuration.Username) || !String.IsNullOrEmpty(this.Configuration.Password)) + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password)) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Com.Sajari.Sdk.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); } @@ -452,12 +500,12 @@ public Com.Sajari.Sdk.Client.ApiResponse BatchUpsert Com.Sajari.Sdk.Client.RequestOptions localVarRequestOptions = new Com.Sajari.Sdk.Client.RequestOptions(); - String[] _contentTypes = new String[] { + string[] _contentTypes = new string[] { "application/json" }; // to determine the Accept header - String[] _accepts = new String[] { + string[] _accepts = new string[] { "application/json" }; @@ -473,7 +521,7 @@ public Com.Sajari.Sdk.Client.ApiResponse BatchUpsert // authentication (BasicAuth) required // http basic authentication required - if (!String.IsNullOrEmpty(this.Configuration.Username) || !String.IsNullOrEmpty(this.Configuration.Password)) + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password)) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Com.Sajari.Sdk.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); } @@ -523,12 +571,12 @@ public Com.Sajari.Sdk.Client.ApiResponse DeleteRecordWithHttpInfo(string Com.Sajari.Sdk.Client.RequestOptions localVarRequestOptions = new Com.Sajari.Sdk.Client.RequestOptions(); - String[] _contentTypes = new String[] { + string[] _contentTypes = new string[] { "application/json" }; // to determine the Accept header - String[] _accepts = new String[] { + string[] _accepts = new string[] { "application/json" }; @@ -543,7 +591,7 @@ public Com.Sajari.Sdk.Client.ApiResponse DeleteRecordWithHttpInfo(string // authentication (BasicAuth) required // http basic authentication required - if (!String.IsNullOrEmpty(this.Configuration.Username) || !String.IsNullOrEmpty(this.Configuration.Password)) + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password)) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Com.Sajari.Sdk.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); } @@ -595,12 +643,12 @@ public Com.Sajari.Sdk.Client.ApiResponse DeleteRecordWithHttpInfo(string Com.Sajari.Sdk.Client.RequestOptions localVarRequestOptions = new Com.Sajari.Sdk.Client.RequestOptions(); - String[] _contentTypes = new String[] { + string[] _contentTypes = new string[] { "application/json" }; // to determine the Accept header - String[] _accepts = new String[] { + string[] _accepts = new string[] { "application/json" }; @@ -616,7 +664,7 @@ public Com.Sajari.Sdk.Client.ApiResponse DeleteRecordWithHttpInfo(string // authentication (BasicAuth) required // http basic authentication required - if (!String.IsNullOrEmpty(this.Configuration.Username) || !String.IsNullOrEmpty(this.Configuration.Password)) + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password)) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Com.Sajari.Sdk.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); } @@ -666,12 +714,12 @@ public Com.Sajari.Sdk.Client.ApiResponse GetRecordWithHttpInfo(string co Com.Sajari.Sdk.Client.RequestOptions localVarRequestOptions = new Com.Sajari.Sdk.Client.RequestOptions(); - String[] _contentTypes = new String[] { + string[] _contentTypes = new string[] { "application/json" }; // to determine the Accept header - String[] _accepts = new String[] { + string[] _accepts = new string[] { "application/json" }; @@ -686,7 +734,7 @@ public Com.Sajari.Sdk.Client.ApiResponse GetRecordWithHttpInfo(string co // authentication (BasicAuth) required // http basic authentication required - if (!String.IsNullOrEmpty(this.Configuration.Username) || !String.IsNullOrEmpty(this.Configuration.Password)) + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password)) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Com.Sajari.Sdk.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); } @@ -738,12 +786,12 @@ public Com.Sajari.Sdk.Client.ApiResponse GetRecordWithHttpInfo(string co Com.Sajari.Sdk.Client.RequestOptions localVarRequestOptions = new Com.Sajari.Sdk.Client.RequestOptions(); - String[] _contentTypes = new String[] { + string[] _contentTypes = new string[] { "application/json" }; // to determine the Accept header - String[] _accepts = new String[] { + string[] _accepts = new string[] { "application/json" }; @@ -759,7 +807,7 @@ public Com.Sajari.Sdk.Client.ApiResponse GetRecordWithHttpInfo(string co // authentication (BasicAuth) required // http basic authentication required - if (!String.IsNullOrEmpty(this.Configuration.Username) || !String.IsNullOrEmpty(this.Configuration.Password)) + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password)) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Com.Sajari.Sdk.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); } @@ -778,7 +826,150 @@ public Com.Sajari.Sdk.Client.ApiResponse GetRecordWithHttpInfo(string co } /// - /// Upsert record If the record does not exist in your collection it is inserted. If it does exist it is updated. If no pipeline is specified, the default record pipeline is used to process the record. If the record is inserted, the response contains the key of the inserted record. You can use this if you need to retrieve or delete the record. If the record is updated, the response does not contain a key. Callers can use this as a signal to determine if the record is inserted/created or updated. For example, to add a single product from your ecommerce store to a collection, use the following call: ```json { \"pipeline\": { \"name\": \"my-pipeline\", \"version\": \"1\" }, \"record\": { \"id\": \"54hdc7h2334h\", \"name\": \"Smart TV\", \"price\": 1999, \"brand\": \"Acme\", \"description\": \"...\", \"in_stock\": true } } ``` + /// Update record Add or update specific fields within a record with the given values. The updated record is returned in the response. To replace all fields in a record, you should use the [UpsertRecord](/api#operation/UpsertRecord) call. Note that the update record call cannot be used to add or update indexed or unique fields. For this case use the [UpsertRecord](/api#operation/UpsertRecord) call. + /// + /// Thrown when fails to make API call + /// The collection that contains the record to update, e.g. `my-collection`. + /// + /// Object + public Object UpdateRecord(string collectionId, UpdateRecordRequest updateRecordRequest) + { + Com.Sajari.Sdk.Client.ApiResponse localVarResponse = UpdateRecordWithHttpInfo(collectionId, updateRecordRequest); + return localVarResponse.Data; + } + + /// + /// Update record Add or update specific fields within a record with the given values. The updated record is returned in the response. To replace all fields in a record, you should use the [UpsertRecord](/api#operation/UpsertRecord) call. Note that the update record call cannot be used to add or update indexed or unique fields. For this case use the [UpsertRecord](/api#operation/UpsertRecord) call. + /// + /// Thrown when fails to make API call + /// The collection that contains the record to update, e.g. `my-collection`. + /// + /// ApiResponse of Object + public Com.Sajari.Sdk.Client.ApiResponse UpdateRecordWithHttpInfo(string collectionId, UpdateRecordRequest updateRecordRequest) + { + // verify the required parameter 'collectionId' is set + if (collectionId == null) + throw new Com.Sajari.Sdk.Client.ApiException(400, "Missing required parameter 'collectionId' when calling RecordsApi->UpdateRecord"); + + // verify the required parameter 'updateRecordRequest' is set + if (updateRecordRequest == null) + throw new Com.Sajari.Sdk.Client.ApiException(400, "Missing required parameter 'updateRecordRequest' when calling RecordsApi->UpdateRecord"); + + Com.Sajari.Sdk.Client.RequestOptions localVarRequestOptions = new Com.Sajari.Sdk.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = Com.Sajari.Sdk.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Com.Sajari.Sdk.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("collection_id", Com.Sajari.Sdk.Client.ClientUtils.ParameterToString(collectionId)); // path parameter + localVarRequestOptions.Data = updateRecordRequest; + + // authentication (BasicAuth) required + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password)) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Com.Sajari.Sdk.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/v4/collections/{collection_id}/records:update", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UpdateRecord", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Update record Add or update specific fields within a record with the given values. The updated record is returned in the response. To replace all fields in a record, you should use the [UpsertRecord](/api#operation/UpsertRecord) call. Note that the update record call cannot be used to add or update indexed or unique fields. For this case use the [UpsertRecord](/api#operation/UpsertRecord) call. + /// + /// Thrown when fails to make API call + /// The collection that contains the record to update, e.g. `my-collection`. + /// + /// Cancellation Token to cancel the request. + /// Task of Object + public async System.Threading.Tasks.Task UpdateRecordAsync(string collectionId, UpdateRecordRequest updateRecordRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + Com.Sajari.Sdk.Client.ApiResponse localVarResponse = await UpdateRecordWithHttpInfoAsync(collectionId, updateRecordRequest, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Update record Add or update specific fields within a record with the given values. The updated record is returned in the response. To replace all fields in a record, you should use the [UpsertRecord](/api#operation/UpsertRecord) call. Note that the update record call cannot be used to add or update indexed or unique fields. For this case use the [UpsertRecord](/api#operation/UpsertRecord) call. + /// + /// Thrown when fails to make API call + /// The collection that contains the record to update, e.g. `my-collection`. + /// + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (Object) + public async System.Threading.Tasks.Task> UpdateRecordWithHttpInfoAsync(string collectionId, UpdateRecordRequest updateRecordRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // verify the required parameter 'collectionId' is set + if (collectionId == null) + throw new Com.Sajari.Sdk.Client.ApiException(400, "Missing required parameter 'collectionId' when calling RecordsApi->UpdateRecord"); + + // verify the required parameter 'updateRecordRequest' is set + if (updateRecordRequest == null) + throw new Com.Sajari.Sdk.Client.ApiException(400, "Missing required parameter 'updateRecordRequest' when calling RecordsApi->UpdateRecord"); + + + Com.Sajari.Sdk.Client.RequestOptions localVarRequestOptions = new Com.Sajari.Sdk.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + "application/json" + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = Com.Sajari.Sdk.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Com.Sajari.Sdk.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + localVarRequestOptions.PathParameters.Add("collection_id", Com.Sajari.Sdk.Client.ClientUtils.ParameterToString(collectionId)); // path parameter + localVarRequestOptions.Data = updateRecordRequest; + + // authentication (BasicAuth) required + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password)) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Com.Sajari.Sdk.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.PostAsync("/v4/collections/{collection_id}/records:update", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("UpdateRecord", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Upsert record If the record does not exist in the collection it is inserted. If it does exist it is updated. If no pipeline is specified, the default record pipeline is used to process the record. If the record is inserted, the response contains the key of the inserted record. You can use this if you need to retrieve or delete the record. If the record is updated, the response does not contain a key. Callers can use this as a signal to determine if the record is inserted/created or updated. For example, to add a single product from your ecommerce store to a collection, use the following call: ```json { \"pipeline\": { \"name\": \"my-pipeline\", \"version\": \"1\" }, \"record\": { \"id\": \"54hdc7h2334h\", \"name\": \"Smart TV\", \"price\": 1999, \"brand\": \"Acme\", \"description\": \"...\", \"in_stock\": true } } ``` /// /// Thrown when fails to make API call /// The collection to upsert the record in, e.g. `my-collection`. @@ -791,7 +982,7 @@ public UpsertRecordResponse UpsertRecord(string collectionId, UpsertRecordReques } /// - /// Upsert record If the record does not exist in your collection it is inserted. If it does exist it is updated. If no pipeline is specified, the default record pipeline is used to process the record. If the record is inserted, the response contains the key of the inserted record. You can use this if you need to retrieve or delete the record. If the record is updated, the response does not contain a key. Callers can use this as a signal to determine if the record is inserted/created or updated. For example, to add a single product from your ecommerce store to a collection, use the following call: ```json { \"pipeline\": { \"name\": \"my-pipeline\", \"version\": \"1\" }, \"record\": { \"id\": \"54hdc7h2334h\", \"name\": \"Smart TV\", \"price\": 1999, \"brand\": \"Acme\", \"description\": \"...\", \"in_stock\": true } } ``` + /// Upsert record If the record does not exist in the collection it is inserted. If it does exist it is updated. If no pipeline is specified, the default record pipeline is used to process the record. If the record is inserted, the response contains the key of the inserted record. You can use this if you need to retrieve or delete the record. If the record is updated, the response does not contain a key. Callers can use this as a signal to determine if the record is inserted/created or updated. For example, to add a single product from your ecommerce store to a collection, use the following call: ```json { \"pipeline\": { \"name\": \"my-pipeline\", \"version\": \"1\" }, \"record\": { \"id\": \"54hdc7h2334h\", \"name\": \"Smart TV\", \"price\": 1999, \"brand\": \"Acme\", \"description\": \"...\", \"in_stock\": true } } ``` /// /// Thrown when fails to make API call /// The collection to upsert the record in, e.g. `my-collection`. @@ -809,12 +1000,12 @@ public Com.Sajari.Sdk.Client.ApiResponse UpsertRecordWithH Com.Sajari.Sdk.Client.RequestOptions localVarRequestOptions = new Com.Sajari.Sdk.Client.RequestOptions(); - String[] _contentTypes = new String[] { + string[] _contentTypes = new string[] { "application/json" }; // to determine the Accept header - String[] _accepts = new String[] { + string[] _accepts = new string[] { "application/json" }; @@ -829,7 +1020,7 @@ public Com.Sajari.Sdk.Client.ApiResponse UpsertRecordWithH // authentication (BasicAuth) required // http basic authentication required - if (!String.IsNullOrEmpty(this.Configuration.Username) || !String.IsNullOrEmpty(this.Configuration.Password)) + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password)) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Com.Sajari.Sdk.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); } @@ -847,7 +1038,7 @@ public Com.Sajari.Sdk.Client.ApiResponse UpsertRecordWithH } /// - /// Upsert record If the record does not exist in your collection it is inserted. If it does exist it is updated. If no pipeline is specified, the default record pipeline is used to process the record. If the record is inserted, the response contains the key of the inserted record. You can use this if you need to retrieve or delete the record. If the record is updated, the response does not contain a key. Callers can use this as a signal to determine if the record is inserted/created or updated. For example, to add a single product from your ecommerce store to a collection, use the following call: ```json { \"pipeline\": { \"name\": \"my-pipeline\", \"version\": \"1\" }, \"record\": { \"id\": \"54hdc7h2334h\", \"name\": \"Smart TV\", \"price\": 1999, \"brand\": \"Acme\", \"description\": \"...\", \"in_stock\": true } } ``` + /// Upsert record If the record does not exist in the collection it is inserted. If it does exist it is updated. If no pipeline is specified, the default record pipeline is used to process the record. If the record is inserted, the response contains the key of the inserted record. You can use this if you need to retrieve or delete the record. If the record is updated, the response does not contain a key. Callers can use this as a signal to determine if the record is inserted/created or updated. For example, to add a single product from your ecommerce store to a collection, use the following call: ```json { \"pipeline\": { \"name\": \"my-pipeline\", \"version\": \"1\" }, \"record\": { \"id\": \"54hdc7h2334h\", \"name\": \"Smart TV\", \"price\": 1999, \"brand\": \"Acme\", \"description\": \"...\", \"in_stock\": true } } ``` /// /// Thrown when fails to make API call /// The collection to upsert the record in, e.g. `my-collection`. @@ -861,7 +1052,7 @@ public Com.Sajari.Sdk.Client.ApiResponse UpsertRecordWithH } /// - /// Upsert record If the record does not exist in your collection it is inserted. If it does exist it is updated. If no pipeline is specified, the default record pipeline is used to process the record. If the record is inserted, the response contains the key of the inserted record. You can use this if you need to retrieve or delete the record. If the record is updated, the response does not contain a key. Callers can use this as a signal to determine if the record is inserted/created or updated. For example, to add a single product from your ecommerce store to a collection, use the following call: ```json { \"pipeline\": { \"name\": \"my-pipeline\", \"version\": \"1\" }, \"record\": { \"id\": \"54hdc7h2334h\", \"name\": \"Smart TV\", \"price\": 1999, \"brand\": \"Acme\", \"description\": \"...\", \"in_stock\": true } } ``` + /// Upsert record If the record does not exist in the collection it is inserted. If it does exist it is updated. If no pipeline is specified, the default record pipeline is used to process the record. If the record is inserted, the response contains the key of the inserted record. You can use this if you need to retrieve or delete the record. If the record is updated, the response does not contain a key. Callers can use this as a signal to determine if the record is inserted/created or updated. For example, to add a single product from your ecommerce store to a collection, use the following call: ```json { \"pipeline\": { \"name\": \"my-pipeline\", \"version\": \"1\" }, \"record\": { \"id\": \"54hdc7h2334h\", \"name\": \"Smart TV\", \"price\": 1999, \"brand\": \"Acme\", \"description\": \"...\", \"in_stock\": true } } ``` /// /// Thrown when fails to make API call /// The collection to upsert the record in, e.g. `my-collection`. @@ -881,12 +1072,12 @@ public Com.Sajari.Sdk.Client.ApiResponse UpsertRecordWithH Com.Sajari.Sdk.Client.RequestOptions localVarRequestOptions = new Com.Sajari.Sdk.Client.RequestOptions(); - String[] _contentTypes = new String[] { + string[] _contentTypes = new string[] { "application/json" }; // to determine the Accept header - String[] _accepts = new String[] { + string[] _accepts = new string[] { "application/json" }; @@ -902,7 +1093,7 @@ public Com.Sajari.Sdk.Client.ApiResponse UpsertRecordWithH // authentication (BasicAuth) required // http basic authentication required - if (!String.IsNullOrEmpty(this.Configuration.Username) || !String.IsNullOrEmpty(this.Configuration.Password)) + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password)) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Com.Sajari.Sdk.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); } diff --git a/src/Com.Sajari.Sdk/Api/SchemaApi.cs b/src/Com.Sajari.Sdk/Api/SchemaApi.cs index 0b0d835..d53e825 100644 --- a/src/Com.Sajari.Sdk/Api/SchemaApi.cs +++ b/src/Com.Sajari.Sdk/Api/SchemaApi.cs @@ -54,7 +54,7 @@ public interface ISchemaApiSync : IApiAccessor /// Create schema field /// /// - /// Create a new field in your collection's schema. + /// Create a new field in a collection's schema. /// /// Thrown when fails to make API call /// The collection to create a schema field in, e.g. `my-collection`. @@ -66,7 +66,7 @@ public interface ISchemaApiSync : IApiAccessor /// Create schema field /// /// - /// Create a new field in your collection's schema. + /// Create a new field in a collection's schema. /// /// Thrown when fails to make API call /// The collection to create a schema field in, e.g. `my-collection`. @@ -77,7 +77,7 @@ public interface ISchemaApiSync : IApiAccessor /// List schema fields /// /// - /// Retrieve a list of schema fields in the collection. + /// Retrieve a list of schema fields in a collection. /// /// Thrown when fails to make API call /// The collection that owns this set of schema fields, e.g. `my-collection`. @@ -90,7 +90,7 @@ public interface ISchemaApiSync : IApiAccessor /// List schema fields /// /// - /// Retrieve a list of schema fields in the collection. + /// Retrieve a list of schema fields in a collection. /// /// Thrown when fails to make API call /// The collection that owns this set of schema fields, e.g. `my-collection`. @@ -136,7 +136,7 @@ public interface ISchemaApiAsync : IApiAccessor /// Create schema field /// /// - /// Create a new field in your collection's schema. + /// Create a new field in a collection's schema. /// /// Thrown when fails to make API call /// The collection to create a schema field in, e.g. `my-collection`. @@ -149,7 +149,7 @@ public interface ISchemaApiAsync : IApiAccessor /// Create schema field /// /// - /// Create a new field in your collection's schema. + /// Create a new field in a collection's schema. /// /// Thrown when fails to make API call /// The collection to create a schema field in, e.g. `my-collection`. @@ -161,7 +161,7 @@ public interface ISchemaApiAsync : IApiAccessor /// List schema fields /// /// - /// Retrieve a list of schema fields in the collection. + /// Retrieve a list of schema fields in a collection. /// /// Thrown when fails to make API call /// The collection that owns this set of schema fields, e.g. `my-collection`. @@ -175,7 +175,7 @@ public interface ISchemaApiAsync : IApiAccessor /// List schema fields /// /// - /// Retrieve a list of schema fields in the collection. + /// Retrieve a list of schema fields in a collection. /// /// Thrown when fails to make API call /// The collection that owns this set of schema fields, e.g. `my-collection`. @@ -214,7 +214,7 @@ public SchemaApi() : this((string)null) /// Initializes a new instance of the class. /// /// - public SchemaApi(String basePath) + public SchemaApi(string basePath) { this.Configuration = Com.Sajari.Sdk.Client.Configuration.MergeConfigurations( Com.Sajari.Sdk.Client.GlobalConfiguration.Instance, @@ -277,7 +277,7 @@ public SchemaApi(Com.Sajari.Sdk.Client.ISynchronousClient client, Com.Sajari.Sdk /// Gets the base path of the API client. /// /// The base path - public String GetBasePath() + public string GetBasePath() { return this.Configuration.BasePath; } @@ -336,12 +336,12 @@ public Com.Sajari.Sdk.Client.ApiResponse BatchC Com.Sajari.Sdk.Client.RequestOptions localVarRequestOptions = new Com.Sajari.Sdk.Client.RequestOptions(); - String[] _contentTypes = new String[] { + string[] _contentTypes = new string[] { "application/json" }; // to determine the Accept header - String[] _accepts = new String[] { + string[] _accepts = new string[] { "application/json" }; @@ -356,7 +356,7 @@ public Com.Sajari.Sdk.Client.ApiResponse BatchC // authentication (BasicAuth) required // http basic authentication required - if (!String.IsNullOrEmpty(this.Configuration.Username) || !String.IsNullOrEmpty(this.Configuration.Password)) + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password)) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Com.Sajari.Sdk.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); } @@ -408,12 +408,12 @@ public Com.Sajari.Sdk.Client.ApiResponse BatchC Com.Sajari.Sdk.Client.RequestOptions localVarRequestOptions = new Com.Sajari.Sdk.Client.RequestOptions(); - String[] _contentTypes = new String[] { + string[] _contentTypes = new string[] { "application/json" }; // to determine the Accept header - String[] _accepts = new String[] { + string[] _accepts = new string[] { "application/json" }; @@ -429,7 +429,7 @@ public Com.Sajari.Sdk.Client.ApiResponse BatchC // authentication (BasicAuth) required // http basic authentication required - if (!String.IsNullOrEmpty(this.Configuration.Username) || !String.IsNullOrEmpty(this.Configuration.Password)) + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password)) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Com.Sajari.Sdk.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); } @@ -448,7 +448,7 @@ public Com.Sajari.Sdk.Client.ApiResponse BatchC } /// - /// Create schema field Create a new field in your collection's schema. + /// Create schema field Create a new field in a collection's schema. /// /// Thrown when fails to make API call /// The collection to create a schema field in, e.g. `my-collection`. @@ -461,7 +461,7 @@ public SchemaField CreateSchemaField(string collectionId, SchemaField schemaFiel } /// - /// Create schema field Create a new field in your collection's schema. + /// Create schema field Create a new field in a collection's schema. /// /// Thrown when fails to make API call /// The collection to create a schema field in, e.g. `my-collection`. @@ -479,12 +479,12 @@ public Com.Sajari.Sdk.Client.ApiResponse CreateSchemaFieldWithHttpI Com.Sajari.Sdk.Client.RequestOptions localVarRequestOptions = new Com.Sajari.Sdk.Client.RequestOptions(); - String[] _contentTypes = new String[] { + string[] _contentTypes = new string[] { "application/json" }; // to determine the Accept header - String[] _accepts = new String[] { + string[] _accepts = new string[] { "application/json" }; @@ -499,7 +499,7 @@ public Com.Sajari.Sdk.Client.ApiResponse CreateSchemaFieldWithHttpI // authentication (BasicAuth) required // http basic authentication required - if (!String.IsNullOrEmpty(this.Configuration.Username) || !String.IsNullOrEmpty(this.Configuration.Password)) + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password)) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Com.Sajari.Sdk.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); } @@ -517,7 +517,7 @@ public Com.Sajari.Sdk.Client.ApiResponse CreateSchemaFieldWithHttpI } /// - /// Create schema field Create a new field in your collection's schema. + /// Create schema field Create a new field in a collection's schema. /// /// Thrown when fails to make API call /// The collection to create a schema field in, e.g. `my-collection`. @@ -531,7 +531,7 @@ public Com.Sajari.Sdk.Client.ApiResponse CreateSchemaFieldWithHttpI } /// - /// Create schema field Create a new field in your collection's schema. + /// Create schema field Create a new field in a collection's schema. /// /// Thrown when fails to make API call /// The collection to create a schema field in, e.g. `my-collection`. @@ -551,12 +551,12 @@ public Com.Sajari.Sdk.Client.ApiResponse CreateSchemaFieldWithHttpI Com.Sajari.Sdk.Client.RequestOptions localVarRequestOptions = new Com.Sajari.Sdk.Client.RequestOptions(); - String[] _contentTypes = new String[] { + string[] _contentTypes = new string[] { "application/json" }; // to determine the Accept header - String[] _accepts = new String[] { + string[] _accepts = new string[] { "application/json" }; @@ -572,7 +572,7 @@ public Com.Sajari.Sdk.Client.ApiResponse CreateSchemaFieldWithHttpI // authentication (BasicAuth) required // http basic authentication required - if (!String.IsNullOrEmpty(this.Configuration.Username) || !String.IsNullOrEmpty(this.Configuration.Password)) + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password)) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Com.Sajari.Sdk.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); } @@ -591,7 +591,7 @@ public Com.Sajari.Sdk.Client.ApiResponse CreateSchemaFieldWithHttpI } /// - /// List schema fields Retrieve a list of schema fields in the collection. + /// List schema fields Retrieve a list of schema fields in a collection. /// /// Thrown when fails to make API call /// The collection that owns this set of schema fields, e.g. `my-collection`. @@ -605,7 +605,7 @@ public Com.Sajari.Sdk.Client.ApiResponse CreateSchemaFieldWithHttpI } /// - /// List schema fields Retrieve a list of schema fields in the collection. + /// List schema fields Retrieve a list of schema fields in a collection. /// /// Thrown when fails to make API call /// The collection that owns this set of schema fields, e.g. `my-collection`. @@ -620,11 +620,11 @@ public Com.Sajari.Sdk.Client.ApiResponse CreateSchemaFieldWithHttpI Com.Sajari.Sdk.Client.RequestOptions localVarRequestOptions = new Com.Sajari.Sdk.Client.RequestOptions(); - String[] _contentTypes = new String[] { + string[] _contentTypes = new string[] { }; // to determine the Accept header - String[] _accepts = new String[] { + string[] _accepts = new string[] { "application/json" }; @@ -646,7 +646,7 @@ public Com.Sajari.Sdk.Client.ApiResponse CreateSchemaFieldWithHttpI // authentication (BasicAuth) required // http basic authentication required - if (!String.IsNullOrEmpty(this.Configuration.Username) || !String.IsNullOrEmpty(this.Configuration.Password)) + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password)) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Com.Sajari.Sdk.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); } @@ -664,7 +664,7 @@ public Com.Sajari.Sdk.Client.ApiResponse CreateSchemaFieldWithHttpI } /// - /// List schema fields Retrieve a list of schema fields in the collection. + /// List schema fields Retrieve a list of schema fields in a collection. /// /// Thrown when fails to make API call /// The collection that owns this set of schema fields, e.g. `my-collection`. @@ -679,7 +679,7 @@ public Com.Sajari.Sdk.Client.ApiResponse CreateSchemaFieldWithHttpI } /// - /// List schema fields Retrieve a list of schema fields in the collection. + /// List schema fields Retrieve a list of schema fields in a collection. /// /// Thrown when fails to make API call /// The collection that owns this set of schema fields, e.g. `my-collection`. @@ -696,11 +696,11 @@ public Com.Sajari.Sdk.Client.ApiResponse CreateSchemaFieldWithHttpI Com.Sajari.Sdk.Client.RequestOptions localVarRequestOptions = new Com.Sajari.Sdk.Client.RequestOptions(); - String[] _contentTypes = new String[] { + string[] _contentTypes = new string[] { }; // to determine the Accept header - String[] _accepts = new String[] { + string[] _accepts = new string[] { "application/json" }; @@ -723,7 +723,7 @@ public Com.Sajari.Sdk.Client.ApiResponse CreateSchemaFieldWithHttpI // authentication (BasicAuth) required // http basic authentication required - if (!String.IsNullOrEmpty(this.Configuration.Username) || !String.IsNullOrEmpty(this.Configuration.Password)) + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password)) { localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Com.Sajari.Sdk.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); } diff --git a/src/Com.Sajari.Sdk/Client/ApiClient.cs b/src/Com.Sajari.Sdk/Client/ApiClient.cs index 144c4b6..d80a8e9 100644 --- a/src/Com.Sajari.Sdk/Client/ApiClient.cs +++ b/src/Com.Sajari.Sdk/Client/ApiClient.cs @@ -25,9 +25,9 @@ using System.Threading.Tasks; using Newtonsoft.Json; using Newtonsoft.Json.Serialization; +using ErrorEventArgs = Newtonsoft.Json.Serialization.ErrorEventArgs; using RestSharp; using RestSharp.Deserializers; -using ErrorEventArgs = Newtonsoft.Json.Serialization.ErrorEventArgs; using RestSharpMethod = RestSharp.Method; using Polly; @@ -96,7 +96,6 @@ public T Deserialize(IRestResponse response) /// Object representation of the JSON string. internal object Deserialize(IRestResponse response, Type type) { - IList headers = response.Headers; if (type == typeof(byte[])) // return byte array { return response.RawBytes; @@ -105,24 +104,25 @@ internal object Deserialize(IRestResponse response, Type type) // TODO: ? if (type.IsAssignableFrom(typeof(Stream))) if (type == typeof(Stream)) { - if (headers != null) + var bytes = response.RawBytes; + if (response.Headers != null) { - var filePath = String.IsNullOrEmpty(_configuration.TempFolderPath) + var filePath = string.IsNullOrEmpty(_configuration.TempFolderPath) ? Path.GetTempPath() : _configuration.TempFolderPath; var regex = new Regex(@"Content-Disposition=.*filename=['""]?([^'""\s]+)['""]?$"); - foreach (var header in headers) + foreach (var header in response.Headers) { var match = regex.Match(header.ToString()); if (match.Success) { string fileName = filePath + ClientUtils.SanitizeFilename(match.Groups[1].Value.Replace("\"", "").Replace("'", "")); - File.WriteAllBytes(fileName, response.RawBytes); + File.WriteAllBytes(fileName, bytes); return new FileStream(fileName, FileMode.Open); } } } - var stream = new MemoryStream(response.RawBytes); + var stream = new MemoryStream(bytes); return stream; } @@ -131,7 +131,7 @@ internal object Deserialize(IRestResponse response, Type type) return DateTime.Parse(response.Content, null, System.Globalization.DateTimeStyles.RoundtripKind); } - if (type == typeof(String) || type.Name.StartsWith("System.Nullable")) // return primitive type + if (type == typeof(string) || type.Name.StartsWith("System.Nullable")) // return primitive type { return Convert.ChangeType(response.Content, type); } @@ -158,12 +158,29 @@ public string ContentType } } /// - /// Provides a default implementation of an Api client (both synchronous and asynchronous implementatios), + /// Provides a default implementation of an Api client (both synchronous and asynchronous implementations), /// encapsulating general REST accessor use cases. /// public partial class ApiClient : ISynchronousClient, IAsynchronousClient { - private readonly String _baseUrl; + private readonly string _baseUrl; + + /// + /// Specifies the settings on a object. + /// These settings can be adjusted to accommodate custom serialization rules. + /// + public JsonSerializerSettings SerializerSettings { get; set; } = new JsonSerializerSettings + { + // OpenAPI generated types generally hide default constructors. + ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, + ContractResolver = new DefaultContractResolver + { + NamingStrategy = new CamelCaseNamingStrategy + { + OverrideSpecifiedNames = false + } + } + }; /// /// Allows for extending request processing for generated code. @@ -191,7 +208,7 @@ public ApiClient() /// /// The target service's base path in URL format. /// - public ApiClient(String basePath) + public ApiClient(string basePath) { if (string.IsNullOrEmpty(basePath)) throw new ArgumentException("basePath cannot be empty"); @@ -252,7 +269,7 @@ private RestSharpMethod Method(HttpMethod method) /// private RestRequest NewRequest( HttpMethod method, - String path, + string path, RequestOptions options, IReadableConfiguration configuration) { @@ -263,7 +280,7 @@ private RestRequest NewRequest( RestRequest request = new RestRequest(Method(method)) { Resource = path, - JsonSerializer = new CustomJsonCodec(configuration) + JsonSerializer = new CustomJsonCodec(SerializerSettings, configuration) }; if (options.PathParameters != null) @@ -314,25 +331,40 @@ private RestRequest NewRequest( if (options.Data != null) { - if (options.HeaderParameters != null) + if (options.Data is Stream stream) { - var contentTypes = options.HeaderParameters["Content-Type"]; - if (contentTypes == null || contentTypes.Any(header => header.Contains("application/json"))) + var contentType = "application/octet-stream"; + if (options.HeaderParameters != null) { - request.RequestFormat = DataFormat.Json; - } - else - { - // TODO: Generated client user should add additional handlers. RestSharp only supports XML and JSON, with XML as default. + var contentTypes = options.HeaderParameters["Content-Type"]; + contentType = contentTypes[0]; } + + var bytes = ClientUtils.ReadAsBytes(stream); + request.AddParameter(contentType, bytes, ParameterType.RequestBody); } else { - // Here, we'll assume JSON APIs are more common. XML can be forced by adding produces/consumes to openapi spec explicitly. - request.RequestFormat = DataFormat.Json; - } + if (options.HeaderParameters != null) + { + var contentTypes = options.HeaderParameters["Content-Type"]; + if (contentTypes == null || contentTypes.Any(header => header.Contains("application/json"))) + { + request.RequestFormat = DataFormat.Json; + } + else + { + // TODO: Generated client user should add additional handlers. RestSharp only supports XML and JSON, with XML as default. + } + } + else + { + // Here, we'll assume JSON APIs are more common. XML can be forced by adding produces/consumes to openapi spec explicitly. + request.RequestFormat = DataFormat.Json; + } - request.AddJsonBody(options.Data); + request.AddJsonBody(options.Data); + } } if (options.FileParameters != null) @@ -411,7 +443,7 @@ private ApiResponse Exec(RestRequest req, IReadableConfiguration configura } else { - var customDeserializer = new CustomJsonCodec(configuration); + var customDeserializer = new CustomJsonCodec(SerializerSettings, configuration); client.AddHandler("application/json", () => customDeserializer); client.AddHandler("text/json", () => customDeserializer); client.AddHandler("text/x-json", () => customDeserializer); @@ -460,6 +492,23 @@ private ApiResponse Exec(RestRequest req, IReadableConfiguration configura response = client.Execute(req); } + // if the response type is oneOf/anyOf, call FromJSON to deserialize the data + if (typeof(Com.Sajari.Sdk.Model.AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) + { + try + { + response.Data = (T) typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); + } + catch (Exception ex) + { + throw ex.InnerException != null ? ex.InnerException : ex; + } + } + else if (typeof(T).Name == "Stream") // for binary response + { + response.Data = (T)(object)new MemoryStream(response.RawBytes); + } + InterceptResponse(req, response); var result = ToApiResponse(response); @@ -513,7 +562,7 @@ private ApiResponse Exec(RestRequest req, IReadableConfiguration configura } else { - var customDeserializer = new CustomJsonCodec(configuration); + var customDeserializer = new CustomJsonCodec(SerializerSettings, configuration); client.AddHandler("application/json", () => customDeserializer); client.AddHandler("text/json", () => customDeserializer); client.AddHandler("text/x-json", () => customDeserializer); @@ -550,7 +599,7 @@ private ApiResponse Exec(RestRequest req, IReadableConfiguration configura if (RetryConfiguration.AsyncRetryPolicy != null) { var policy = RetryConfiguration.AsyncRetryPolicy; - var policyResult = await policy.ExecuteAndCaptureAsync(() => client.ExecuteAsync(req, cancellationToken)).ConfigureAwait(false); + var policyResult = await policy.ExecuteAndCaptureAsync((ct) => client.ExecuteAsync(req, ct), cancellationToken).ConfigureAwait(false); response = (policyResult.Outcome == OutcomeType.Successful) ? client.Deserialize(policyResult.Result) : new RestResponse { Request = req, @@ -565,10 +614,11 @@ private ApiResponse Exec(RestRequest req, IReadableConfiguration configura // if the response type is oneOf/anyOf, call FromJSON to deserialize the data if (typeof(Com.Sajari.Sdk.Model.AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) { - T instance = (T)Activator.CreateInstance(typeof(T)); - MethodInfo method = typeof(T).GetMethod("FromJson"); - method.Invoke(instance, new object[] { response.Content }); - response.Data = instance; + response.Data = (T) typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); + } + else if (typeof(T).Name == "Stream") // for binary response + { + response.Data = (T)(object)new MemoryStream(response.RawBytes); } InterceptResponse(req, response); diff --git a/src/Com.Sajari.Sdk/Client/ApiResponse.cs b/src/Com.Sajari.Sdk/Client/ApiResponse.cs index 18f7327..93badae 100644 --- a/src/Com.Sajari.Sdk/Client/ApiResponse.cs +++ b/src/Com.Sajari.Sdk/Client/ApiResponse.cs @@ -45,7 +45,7 @@ public interface IApiResponse /// /// Gets or sets any error text defined by the calling client. /// - String ErrorText { get; set; } + string ErrorText { get; set; } /// /// Gets or sets any cookies passed along on the response. @@ -86,7 +86,7 @@ public class ApiResponse : IApiResponse /// /// Gets or sets any error text defined by the calling client. /// - public String ErrorText { get; set; } + public string ErrorText { get; set; } /// /// Gets or sets any cookies passed along on the response. diff --git a/src/Com.Sajari.Sdk/Client/ClientUtils.cs b/src/Com.Sajari.Sdk/Client/ClientUtils.cs index 3e49567..852727e 100644 --- a/src/Com.Sajari.Sdk/Client/ClientUtils.cs +++ b/src/Com.Sajari.Sdk/Client/ClientUtils.cs @@ -54,6 +54,21 @@ public static Multimap ParameterToMultiMap(string collectionForm parameters.Add(name, ParameterToString(item)); } } + else if (value is IDictionary dictionary) + { + if(collectionFormat == "deepObject") { + foreach (DictionaryEntry entry in dictionary) + { + parameters.Add(name + "[" + entry.Key + "]", ParameterToString(entry.Value)); + } + } + else { + foreach (DictionaryEntry entry in dictionary) + { + parameters.Add(entry.Key.ToString(), ParameterToString(entry.Value)); + } + } + } else { parameters.Add(name, ParameterToString(value)); @@ -96,7 +111,7 @@ public static string ParameterToString(object obj, IReadableConfiguration config /// URL encode a string /// Credit/Ref: https://github.com/restsharp/RestSharp/blob/master/RestSharp/Extensions/StringExtensions.cs#L50 /// - /// String to be URL encoded + /// string to be URL encoded /// Byte array public static string UrlEncode(string input) { @@ -130,7 +145,7 @@ public static string UrlEncode(string input) /// /// Encode string in base64 format. /// - /// String to be encoded. + /// string to be encoded. /// Encoded string. public static string Base64Encode(string text) { @@ -158,7 +173,7 @@ public static byte[] ReadAsBytes(Stream inputStream) /// /// The Content-Type array to select from. /// The Content-Type header to use. - public static String SelectHeaderContentType(String[] contentTypes) + public static string SelectHeaderContentType(string[] contentTypes) { if (contentTypes.Length == 0) return null; @@ -179,7 +194,7 @@ public static String SelectHeaderContentType(String[] contentTypes) /// /// The accepts array to select from. /// The Accept header to use. - public static String SelectHeaderAccept(String[] accepts) + public static string SelectHeaderAccept(string[] accepts) { if (accepts.Length == 0) return null; @@ -187,7 +202,7 @@ public static String SelectHeaderAccept(String[] accepts) if (accepts.Contains("application/json", StringComparer.OrdinalIgnoreCase)) return "application/json"; - return String.Join(",", accepts); + return string.Join(",", accepts); } /// @@ -205,9 +220,9 @@ public static String SelectHeaderAccept(String[] accepts) /// /// MIME /// Returns True if MIME type is json. - public static bool IsJsonMime(String mime) + public static bool IsJsonMime(string mime) { - if (String.IsNullOrWhiteSpace(mime)) return false; + if (string.IsNullOrWhiteSpace(mime)) return false; return JsonRegex.IsMatch(mime) || mime.Equals("application/json-patch+json"); } diff --git a/src/Com.Sajari.Sdk/Client/Configuration.cs b/src/Com.Sajari.Sdk/Client/Configuration.cs index c02d25b..aa6d9cd 100644 --- a/src/Com.Sajari.Sdk/Client/Configuration.cs +++ b/src/Com.Sajari.Sdk/Client/Configuration.cs @@ -32,7 +32,7 @@ public class Configuration : IReadableConfiguration /// Version of the package. /// /// Version of the package. - public const string Version = "4.1.0"; + public const string Version = "4.2.0"; /// /// Identifier for ISO 8601 DateTime Format @@ -68,11 +68,11 @@ public class Configuration : IReadableConfiguration /// Defines the base path of the target API server. /// Example: http://localhost:3000/v1/ /// - private String _basePath; + private string _basePath; /// /// Gets or sets the API key based on the authentication name. - /// This is the key and value comprising the "secret" for acessing an API. + /// This is the key and value comprising the "secret" for accessing an API. /// /// The API key. private IDictionary _apiKey; @@ -102,7 +102,7 @@ public class Configuration : IReadableConfiguration public Configuration() { Proxy = null; - UserAgent = "sajari-sdk-csharp-4.1.0"; + UserAgent = "sajari-sdk-csharp-4.2.0"; BasePath = "https://api-gateway.sajari.com"; DefaultHeaders = new ConcurrentDictionary(); ApiKey = new ConcurrentDictionary(); @@ -426,7 +426,7 @@ public string GetServerUrl(int index, Dictionary inputVariables) } else { - // use defualt value + // use default value url = url.Replace("{" + variable.Key + "}", (string)serverVariables["default_value"]); } } @@ -441,13 +441,13 @@ public string GetServerUrl(int index, Dictionary inputVariables) /// /// Returns a string with essential information for debugging. /// - public static String ToDebugReport() + public static string ToDebugReport() { - String report = "C# SDK (Com.Sajari.Sdk) Debug Report:\n"; + string report = "C# SDK (Com.Sajari.Sdk) Debug Report:\n"; report += " OS: " + System.Environment.OSVersion + "\n"; report += " .NET Framework Version: " + System.Environment.Version + "\n"; report += " Version of the API: v4\n"; - report += " SDK Package Version: 4.1.0\n"; + report += " SDK Package Version: 4.2.0\n"; return report; } diff --git a/src/Com.Sajari.Sdk/Client/IApiAccessor.cs b/src/Com.Sajari.Sdk/Client/IApiAccessor.cs index 7a93321..bf2afc6 100644 --- a/src/Com.Sajari.Sdk/Client/IApiAccessor.cs +++ b/src/Com.Sajari.Sdk/Client/IApiAccessor.cs @@ -28,7 +28,7 @@ public interface IApiAccessor /// Gets the base path of the API client. /// /// The base path - String GetBasePath(); + string GetBasePath(); /// /// Provides a factory method hook for the creation of exceptions. diff --git a/src/Com.Sajari.Sdk/Client/IAsynchronousClient.cs b/src/Com.Sajari.Sdk/Client/IAsynchronousClient.cs index f860be5..46f768d 100644 --- a/src/Com.Sajari.Sdk/Client/IAsynchronousClient.cs +++ b/src/Com.Sajari.Sdk/Client/IAsynchronousClient.cs @@ -30,7 +30,7 @@ public interface IAsynchronousClient /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> GetAsync(String path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the POST http verb. @@ -41,7 +41,7 @@ public interface IAsynchronousClient /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> PostAsync(String path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the PUT http verb. @@ -52,7 +52,7 @@ public interface IAsynchronousClient /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> PutAsync(String path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the DELETE http verb. @@ -63,7 +63,7 @@ public interface IAsynchronousClient /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> DeleteAsync(String path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the HEAD http verb. @@ -74,7 +74,7 @@ public interface IAsynchronousClient /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> HeadAsync(String path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the OPTIONS http verb. @@ -85,7 +85,7 @@ public interface IAsynchronousClient /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> OptionsAsync(String path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the PATCH http verb. @@ -96,6 +96,6 @@ public interface IAsynchronousClient /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> PatchAsync(String path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } diff --git a/src/Com.Sajari.Sdk/Client/IReadableConfiguration.cs b/src/Com.Sajari.Sdk/Client/IReadableConfiguration.cs index 8116fe2..cff2230 100644 --- a/src/Com.Sajari.Sdk/Client/IReadableConfiguration.cs +++ b/src/Com.Sajari.Sdk/Client/IReadableConfiguration.cs @@ -48,7 +48,7 @@ public interface IReadableConfiguration /// /// Gets the date time format. /// - /// Date time foramt. + /// Date time format. string DateTimeFormat { get; } /// diff --git a/src/Com.Sajari.Sdk/Client/ISynchronousClient.cs b/src/Com.Sajari.Sdk/Client/ISynchronousClient.cs index 86c7428..6ccad24 100644 --- a/src/Com.Sajari.Sdk/Client/ISynchronousClient.cs +++ b/src/Com.Sajari.Sdk/Client/ISynchronousClient.cs @@ -29,7 +29,7 @@ public interface ISynchronousClient /// Per-request configurable settings. /// The return type. /// The response data, decorated with - ApiResponse Get(String path, RequestOptions options, IReadableConfiguration configuration = null); + ApiResponse Get(string path, RequestOptions options, IReadableConfiguration configuration = null); /// /// Executes a blocking call to some using the POST http verb. @@ -39,7 +39,7 @@ public interface ISynchronousClient /// Per-request configurable settings. /// The return type. /// The response data, decorated with - ApiResponse Post(String path, RequestOptions options, IReadableConfiguration configuration = null); + ApiResponse Post(string path, RequestOptions options, IReadableConfiguration configuration = null); /// /// Executes a blocking call to some using the PUT http verb. @@ -49,7 +49,7 @@ public interface ISynchronousClient /// Per-request configurable settings. /// The return type. /// The response data, decorated with - ApiResponse Put(String path, RequestOptions options, IReadableConfiguration configuration = null); + ApiResponse Put(string path, RequestOptions options, IReadableConfiguration configuration = null); /// /// Executes a blocking call to some using the DELETE http verb. @@ -59,7 +59,7 @@ public interface ISynchronousClient /// Per-request configurable settings. /// The return type. /// The response data, decorated with - ApiResponse Delete(String path, RequestOptions options, IReadableConfiguration configuration = null); + ApiResponse Delete(string path, RequestOptions options, IReadableConfiguration configuration = null); /// /// Executes a blocking call to some using the HEAD http verb. @@ -69,7 +69,7 @@ public interface ISynchronousClient /// Per-request configurable settings. /// The return type. /// The response data, decorated with - ApiResponse Head(String path, RequestOptions options, IReadableConfiguration configuration = null); + ApiResponse Head(string path, RequestOptions options, IReadableConfiguration configuration = null); /// /// Executes a blocking call to some using the OPTIONS http verb. @@ -79,7 +79,7 @@ public interface ISynchronousClient /// Per-request configurable settings. /// The return type. /// The response data, decorated with - ApiResponse Options(String path, RequestOptions options, IReadableConfiguration configuration = null); + ApiResponse Options(string path, RequestOptions options, IReadableConfiguration configuration = null); /// /// Executes a blocking call to some using the PATCH http verb. @@ -89,6 +89,6 @@ public interface ISynchronousClient /// Per-request configurable settings. /// The return type. /// The response data, decorated with - ApiResponse Patch(String path, RequestOptions options, IReadableConfiguration configuration = null); + ApiResponse Patch(string path, RequestOptions options, IReadableConfiguration configuration = null); } } diff --git a/src/Com.Sajari.Sdk/Client/RequestOptions.cs b/src/Com.Sajari.Sdk/Client/RequestOptions.cs index a06a1cb..1634370 100644 --- a/src/Com.Sajari.Sdk/Client/RequestOptions.cs +++ b/src/Com.Sajari.Sdk/Client/RequestOptions.cs @@ -25,29 +25,29 @@ public class RequestOptions /// /// Parameters to be bound to path parts of the Request's URL /// - public Dictionary PathParameters { get; set; } + public Dictionary PathParameters { get; set; } /// /// Query parameters to be applied to the request. /// Keys may have 1 or more values associated. /// - public Multimap QueryParameters { get; set; } + public Multimap QueryParameters { get; set; } /// /// Header parameters to be applied to to the request. /// Keys may have 1 or more values associated. /// - public Multimap HeaderParameters { get; set; } + public Multimap HeaderParameters { get; set; } /// /// Form parameters to be sent along with the request. /// - public Dictionary FormParameters { get; set; } + public Dictionary FormParameters { get; set; } /// /// File parameters to be sent along with the request. /// - public Dictionary FileParameters { get; set; } + public Dictionary FileParameters { get; set; } /// /// Cookies to be sent along with the request. @@ -68,8 +68,8 @@ public RequestOptions() QueryParameters = new Multimap(); HeaderParameters = new Multimap(); FormParameters = new Dictionary(); - FileParameters = new Dictionary(); + FileParameters = new Dictionary(); Cookies = new List(); } } -} \ No newline at end of file +} diff --git a/src/Com.Sajari.Sdk/Com.Sajari.Sdk.csproj b/src/Com.Sajari.Sdk/Com.Sajari.Sdk.csproj index 39ebbe1..0e16395 100644 --- a/src/Com.Sajari.Sdk/Com.Sajari.Sdk.csproj +++ b/src/Com.Sajari.Sdk/Com.Sajari.Sdk.csproj @@ -12,7 +12,7 @@ A library generated from a OpenAPI doc No Copyright Com.Sajari.Sdk - 4.1.0 + 4.2.0 bin\$(Configuration)\$(TargetFramework)\Com.Sajari.Sdk.xml https://github.com/sajari/GIT_USER_ID/sdk-dotnet.git git @@ -20,11 +20,11 @@ - + - - - + + + diff --git a/src/Com.Sajari.Sdk/Model/AbstractOpenAPISchema.cs b/src/Com.Sajari.Sdk/Model/AbstractOpenAPISchema.cs index 3e6b255..b87f4b9 100644 --- a/src/Com.Sajari.Sdk/Model/AbstractOpenAPISchema.cs +++ b/src/Com.Sajari.Sdk/Model/AbstractOpenAPISchema.cs @@ -37,6 +37,23 @@ public abstract partial class AbstractOpenAPISchema } }; + /// + /// Custom JSON serializer for objects with additional properties + /// + static public readonly JsonSerializerSettings AdditionalPropertiesSerializerSettings = new JsonSerializerSettings + { + // OpenAPI generated types generally hide default constructors. + ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, + MissingMemberHandling = MissingMemberHandling.Ignore, + ContractResolver = new DefaultContractResolver + { + NamingStrategy = new CamelCaseNamingStrategy + { + OverrideSpecifiedNames = false + } + } + }; + /// /// Gets or Sets the actual instance /// diff --git a/src/Com.Sajari.Sdk/Model/BatchCreateSchemaFieldsRequest.cs b/src/Com.Sajari.Sdk/Model/BatchCreateSchemaFieldsRequest.cs index b354d03..e24767e 100644 --- a/src/Com.Sajari.Sdk/Model/BatchCreateSchemaFieldsRequest.cs +++ b/src/Com.Sajari.Sdk/Model/BatchCreateSchemaFieldsRequest.cs @@ -44,7 +44,10 @@ protected BatchCreateSchemaFieldsRequest() { } public BatchCreateSchemaFieldsRequest(List fields = default(List)) { // to ensure "fields" is required (not null) - this.Fields = fields ?? throw new ArgumentNullException("fields is a required property for BatchCreateSchemaFieldsRequest and cannot be null"); + if (fields == null) { + throw new ArgumentNullException("fields is a required property for BatchCreateSchemaFieldsRequest and cannot be null"); + } + this.Fields = fields; } /// @@ -73,7 +76,7 @@ public override string ToString() /// JSON string presentation of the object public virtual string ToJson() { - return JsonConvert.SerializeObject(this, Formatting.Indented); + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } /// @@ -125,7 +128,7 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + public IEnumerable Validate(ValidationContext validationContext) { yield break; } diff --git a/src/Com.Sajari.Sdk/Model/BatchCreateSchemaFieldsResponse.cs b/src/Com.Sajari.Sdk/Model/BatchCreateSchemaFieldsResponse.cs index 9915b5e..255e95c 100644 --- a/src/Com.Sajari.Sdk/Model/BatchCreateSchemaFieldsResponse.cs +++ b/src/Com.Sajari.Sdk/Model/BatchCreateSchemaFieldsResponse.cs @@ -35,21 +35,14 @@ public partial class BatchCreateSchemaFieldsResponse : IEquatable /// Initializes a new instance of the class. /// - /// Schema fields created.. /// Errors that occurred.. - public BatchCreateSchemaFieldsResponse(List fields = default(List), List errors = default(List)) + /// Schema fields created.. + public BatchCreateSchemaFieldsResponse(List errors = default(List), List fields = default(List)) { - this.Fields = fields; this.Errors = errors; + this.Fields = fields; } - /// - /// Schema fields created. - /// - /// Schema fields created. - [DataMember(Name = "fields", EmitDefaultValue = false)] - public List Fields { get; set; } - /// /// Errors that occurred. /// @@ -57,6 +50,13 @@ public partial class BatchCreateSchemaFieldsResponse : IEquatable Errors { get; set; } + /// + /// Schema fields created. + /// + /// Schema fields created. + [DataMember(Name = "fields", EmitDefaultValue = false)] + public List Fields { get; set; } + /// /// Returns the string presentation of the object /// @@ -65,8 +65,8 @@ public override string ToString() { var sb = new StringBuilder(); sb.Append("class BatchCreateSchemaFieldsResponse {\n"); - sb.Append(" Fields: ").Append(Fields).Append("\n"); sb.Append(" Errors: ").Append(Errors).Append("\n"); + sb.Append(" Fields: ").Append(Fields).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -77,7 +77,7 @@ public override string ToString() /// JSON string presentation of the object public virtual string ToJson() { - return JsonConvert.SerializeObject(this, Formatting.Indented); + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } /// @@ -101,17 +101,17 @@ public bool Equals(BatchCreateSchemaFieldsResponse input) return false; return - ( - this.Fields == input.Fields || - this.Fields != null && - input.Fields != null && - this.Fields.SequenceEqual(input.Fields) - ) && ( this.Errors == input.Errors || this.Errors != null && input.Errors != null && this.Errors.SequenceEqual(input.Errors) + ) && + ( + this.Fields == input.Fields || + this.Fields != null && + input.Fields != null && + this.Fields.SequenceEqual(input.Fields) ); } @@ -124,10 +124,10 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - if (this.Fields != null) - hashCode = hashCode * 59 + this.Fields.GetHashCode(); if (this.Errors != null) hashCode = hashCode * 59 + this.Errors.GetHashCode(); + if (this.Fields != null) + hashCode = hashCode * 59 + this.Fields.GetHashCode(); return hashCode; } } @@ -137,7 +137,7 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + public IEnumerable Validate(ValidationContext validationContext) { yield break; } diff --git a/src/Com.Sajari.Sdk/Model/BatchCreateSchemaFieldsResponseError.cs b/src/Com.Sajari.Sdk/Model/BatchCreateSchemaFieldsResponseError.cs index 810dfe7..0143231 100644 --- a/src/Com.Sajari.Sdk/Model/BatchCreateSchemaFieldsResponseError.cs +++ b/src/Com.Sajari.Sdk/Model/BatchCreateSchemaFieldsResponseError.cs @@ -76,7 +76,7 @@ public override string ToString() /// JSON string presentation of the object public virtual string ToJson() { - return JsonConvert.SerializeObject(this, Formatting.Indented); + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } /// @@ -132,7 +132,7 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + public IEnumerable Validate(ValidationContext validationContext) { yield break; } diff --git a/src/Com.Sajari.Sdk/Model/BatchUpsertRecordsRequest.cs b/src/Com.Sajari.Sdk/Model/BatchUpsertRecordsRequest.cs index 8324feb..d5e41ae 100644 --- a/src/Com.Sajari.Sdk/Model/BatchUpsertRecordsRequest.cs +++ b/src/Com.Sajari.Sdk/Model/BatchUpsertRecordsRequest.cs @@ -41,12 +41,15 @@ protected BatchUpsertRecordsRequest() { } /// Initializes a new instance of the class. /// /// pipeline. - /// A list of records to upsert. (required). + /// A list of records to upsert. A maximum of 200 records can be upsert in a batch. (required). /// The initial values for the variables the pipeline operates on and transforms throughout its steps.. - public BatchUpsertRecordsRequest(BatchUpsertRecordsRequestPipeline pipeline = default(BatchUpsertRecordsRequestPipeline), List records = default(List), Object variables = default(Object)) + public BatchUpsertRecordsRequest(BatchUpsertRecordsRequestPipeline pipeline = default(BatchUpsertRecordsRequestPipeline), List records = default(List), Dictionary variables = default(Dictionary)) { // to ensure "records" is required (not null) - this.Records = records ?? throw new ArgumentNullException("records is a required property for BatchUpsertRecordsRequest and cannot be null"); + if (records == null) { + throw new ArgumentNullException("records is a required property for BatchUpsertRecordsRequest and cannot be null"); + } + this.Records = records; this.Pipeline = pipeline; this.Variables = variables; } @@ -58,9 +61,9 @@ protected BatchUpsertRecordsRequest() { } public BatchUpsertRecordsRequestPipeline Pipeline { get; set; } /// - /// A list of records to upsert. + /// A list of records to upsert. A maximum of 200 records can be upsert in a batch. /// - /// A list of records to upsert. + /// A list of records to upsert. A maximum of 200 records can be upsert in a batch. [DataMember(Name = "records", IsRequired = true, EmitDefaultValue = false)] public List Records { get; set; } @@ -69,7 +72,7 @@ protected BatchUpsertRecordsRequest() { } /// /// The initial values for the variables the pipeline operates on and transforms throughout its steps. [DataMember(Name = "variables", EmitDefaultValue = false)] - public Object Variables { get; set; } + public Dictionary Variables { get; set; } /// /// Returns the string presentation of the object @@ -92,7 +95,7 @@ public override string ToString() /// JSON string presentation of the object public virtual string ToJson() { - return JsonConvert.SerializeObject(this, Formatting.Indented); + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } /// @@ -129,8 +132,9 @@ public bool Equals(BatchUpsertRecordsRequest input) ) && ( this.Variables == input.Variables || - (this.Variables != null && - this.Variables.Equals(input.Variables)) + this.Variables != null && + input.Variables != null && + this.Variables.SequenceEqual(input.Variables) ); } @@ -158,7 +162,7 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + public IEnumerable Validate(ValidationContext validationContext) { yield break; } diff --git a/src/Com.Sajari.Sdk/Model/BatchUpsertRecordsRequestPipeline.cs b/src/Com.Sajari.Sdk/Model/BatchUpsertRecordsRequestPipeline.cs index ddb9f75..df2c37f 100644 --- a/src/Com.Sajari.Sdk/Model/BatchUpsertRecordsRequestPipeline.cs +++ b/src/Com.Sajari.Sdk/Model/BatchUpsertRecordsRequestPipeline.cs @@ -45,8 +45,11 @@ protected BatchUpsertRecordsRequestPipeline() { } public BatchUpsertRecordsRequestPipeline(string name = default(string), string version = default(string)) { // to ensure "name" is required (not null) - this.Name = name ?? throw new ArgumentNullException("name is a required property for BatchUpsertRecordsRequestPipeline and cannot be null"); - this.Version = version; + if (name == null) { + throw new ArgumentNullException("name is a required property for BatchUpsertRecordsRequestPipeline and cannot be null"); + } + this.Name = name; + this._Version = version; } /// @@ -61,7 +64,7 @@ protected BatchUpsertRecordsRequestPipeline() { } /// /// The record pipeline's version, e.g. `42`. If not provided the default version is used. [DataMember(Name = "version", EmitDefaultValue = false)] - public string Version { get; set; } + public string _Version { get; set; } /// /// Returns the string presentation of the object @@ -72,7 +75,7 @@ public override string ToString() var sb = new StringBuilder(); sb.Append("class BatchUpsertRecordsRequestPipeline {\n"); sb.Append(" Name: ").Append(Name).Append("\n"); - sb.Append(" Version: ").Append(Version).Append("\n"); + sb.Append(" _Version: ").Append(_Version).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -83,7 +86,7 @@ public override string ToString() /// JSON string presentation of the object public virtual string ToJson() { - return JsonConvert.SerializeObject(this, Formatting.Indented); + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } /// @@ -113,9 +116,9 @@ public bool Equals(BatchUpsertRecordsRequestPipeline input) this.Name.Equals(input.Name)) ) && ( - this.Version == input.Version || - (this.Version != null && - this.Version.Equals(input.Version)) + this._Version == input._Version || + (this._Version != null && + this._Version.Equals(input._Version)) ); } @@ -130,8 +133,8 @@ public override int GetHashCode() int hashCode = 41; if (this.Name != null) hashCode = hashCode * 59 + this.Name.GetHashCode(); - if (this.Version != null) - hashCode = hashCode * 59 + this.Version.GetHashCode(); + if (this._Version != null) + hashCode = hashCode * 59 + this._Version.GetHashCode(); return hashCode; } } @@ -141,7 +144,7 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + public IEnumerable Validate(ValidationContext validationContext) { yield break; } diff --git a/src/Com.Sajari.Sdk/Model/BatchUpsertRecordsResponse.cs b/src/Com.Sajari.Sdk/Model/BatchUpsertRecordsResponse.cs index 2389590..0b2eef9 100644 --- a/src/Com.Sajari.Sdk/Model/BatchUpsertRecordsResponse.cs +++ b/src/Com.Sajari.Sdk/Model/BatchUpsertRecordsResponse.cs @@ -35,16 +35,23 @@ public partial class BatchUpsertRecordsResponse : IEquatable /// Initializes a new instance of the class. /// + /// Errors that occurred.. /// A list of keys of the records that were inserted. If a record was inserted, keys contains an entry containing the index of the inserted record from `records` and the key. You can use the key if you need to retrieve or delete the record. If a record was updated, keys contains no such entry for the updated record.. /// A list of modified variables returned by the pipeline after it has finished processing each record.. - /// Errors that occurred.. - public BatchUpsertRecordsResponse(List keys = default(List), List variables = default(List), List errors = default(List)) + public BatchUpsertRecordsResponse(List errors = default(List), List keys = default(List), List variables = default(List)) { + this.Errors = errors; this.Keys = keys; this.Variables = variables; - this.Errors = errors; } + /// + /// Errors that occurred. + /// + /// Errors that occurred. + [DataMember(Name = "errors", EmitDefaultValue = false)] + public List Errors { get; set; } + /// /// A list of keys of the records that were inserted. If a record was inserted, keys contains an entry containing the index of the inserted record from `records` and the key. You can use the key if you need to retrieve or delete the record. If a record was updated, keys contains no such entry for the updated record. /// @@ -59,13 +66,6 @@ public partial class BatchUpsertRecordsResponse : IEquatable Variables { get; set; } - /// - /// Errors that occurred. - /// - /// Errors that occurred. - [DataMember(Name = "errors", EmitDefaultValue = false)] - public List Errors { get; set; } - /// /// Returns the string presentation of the object /// @@ -74,9 +74,9 @@ public override string ToString() { var sb = new StringBuilder(); sb.Append("class BatchUpsertRecordsResponse {\n"); + sb.Append(" Errors: ").Append(Errors).Append("\n"); sb.Append(" Keys: ").Append(Keys).Append("\n"); sb.Append(" Variables: ").Append(Variables).Append("\n"); - sb.Append(" Errors: ").Append(Errors).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -87,7 +87,7 @@ public override string ToString() /// JSON string presentation of the object public virtual string ToJson() { - return JsonConvert.SerializeObject(this, Formatting.Indented); + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } /// @@ -111,6 +111,12 @@ public bool Equals(BatchUpsertRecordsResponse input) return false; return + ( + this.Errors == input.Errors || + this.Errors != null && + input.Errors != null && + this.Errors.SequenceEqual(input.Errors) + ) && ( this.Keys == input.Keys || this.Keys != null && @@ -122,12 +128,6 @@ public bool Equals(BatchUpsertRecordsResponse input) this.Variables != null && input.Variables != null && this.Variables.SequenceEqual(input.Variables) - ) && - ( - this.Errors == input.Errors || - this.Errors != null && - input.Errors != null && - this.Errors.SequenceEqual(input.Errors) ); } @@ -140,12 +140,12 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; + if (this.Errors != null) + hashCode = hashCode * 59 + this.Errors.GetHashCode(); if (this.Keys != null) hashCode = hashCode * 59 + this.Keys.GetHashCode(); if (this.Variables != null) hashCode = hashCode * 59 + this.Variables.GetHashCode(); - if (this.Errors != null) - hashCode = hashCode * 59 + this.Errors.GetHashCode(); return hashCode; } } @@ -155,7 +155,7 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + public IEnumerable Validate(ValidationContext validationContext) { yield break; } diff --git a/src/Com.Sajari.Sdk/Model/BatchUpsertRecordsResponseError.cs b/src/Com.Sajari.Sdk/Model/BatchUpsertRecordsResponseError.cs index 1894f0e..95ca9f6 100644 --- a/src/Com.Sajari.Sdk/Model/BatchUpsertRecordsResponseError.cs +++ b/src/Com.Sajari.Sdk/Model/BatchUpsertRecordsResponseError.cs @@ -76,7 +76,7 @@ public override string ToString() /// JSON string presentation of the object public virtual string ToJson() { - return JsonConvert.SerializeObject(this, Formatting.Indented); + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } /// @@ -132,7 +132,7 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + public IEnumerable Validate(ValidationContext validationContext) { yield break; } diff --git a/src/Com.Sajari.Sdk/Model/BatchUpsertRecordsResponseKey.cs b/src/Com.Sajari.Sdk/Model/BatchUpsertRecordsResponseKey.cs index 469f1a3..52b3728 100644 --- a/src/Com.Sajari.Sdk/Model/BatchUpsertRecordsResponseKey.cs +++ b/src/Com.Sajari.Sdk/Model/BatchUpsertRecordsResponseKey.cs @@ -76,7 +76,7 @@ public override string ToString() /// JSON string presentation of the object public virtual string ToJson() { - return JsonConvert.SerializeObject(this, Formatting.Indented); + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } /// @@ -132,7 +132,7 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + public IEnumerable Validate(ValidationContext validationContext) { yield break; } diff --git a/src/Com.Sajari.Sdk/Model/BatchUpsertRecordsResponseVariables.cs b/src/Com.Sajari.Sdk/Model/BatchUpsertRecordsResponseVariables.cs index 8719d52..1abcafd 100644 --- a/src/Com.Sajari.Sdk/Model/BatchUpsertRecordsResponseVariables.cs +++ b/src/Com.Sajari.Sdk/Model/BatchUpsertRecordsResponseVariables.cs @@ -37,7 +37,7 @@ public partial class BatchUpsertRecordsResponseVariables : IEquatable /// Index of the record in `records` that these variables correspond to.. /// The variables.. - public BatchUpsertRecordsResponseVariables(int index = default(int), Object variables = default(Object)) + public BatchUpsertRecordsResponseVariables(int index = default(int), Dictionary variables = default(Dictionary)) { this.Index = index; this.Variables = variables; @@ -55,7 +55,7 @@ public partial class BatchUpsertRecordsResponseVariables : IEquatable /// The variables. [DataMember(Name = "variables", EmitDefaultValue = false)] - public Object Variables { get; set; } + public Dictionary Variables { get; set; } /// /// Returns the string presentation of the object @@ -77,7 +77,7 @@ public override string ToString() /// JSON string presentation of the object public virtual string ToJson() { - return JsonConvert.SerializeObject(this, Formatting.Indented); + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } /// @@ -107,8 +107,9 @@ public bool Equals(BatchUpsertRecordsResponseVariables input) ) && ( this.Variables == input.Variables || - (this.Variables != null && - this.Variables.Equals(input.Variables)) + this.Variables != null && + input.Variables != null && + this.Variables.SequenceEqual(input.Variables) ); } @@ -133,7 +134,7 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + public IEnumerable Validate(ValidationContext validationContext) { yield break; } diff --git a/src/Com.Sajari.Sdk/Model/Collection.cs b/src/Com.Sajari.Sdk/Model/Collection.cs index b221663..7bf4674 100644 --- a/src/Com.Sajari.Sdk/Model/Collection.cs +++ b/src/Com.Sajari.Sdk/Model/Collection.cs @@ -40,31 +40,18 @@ protected Collection() { } /// /// Initializes a new instance of the class. /// - /// The collection's display name. You can change this at any time. (required). /// The list of authorized query domains for the collection. Client-side / browser requests to the [QueryCollection](/api#operation/QueryCollection) call can be made by any authorized query domain or any of its subdomains. This allows your interface to make search requests without having to provide an API key in the client-side request.. - public Collection(string displayName = default(string), List authorizedQueryDomains = default(List)) + /// The collection's display name. You can change this at any time. (required). + public Collection(List authorizedQueryDomains = default(List), string displayName = default(string)) { // to ensure "displayName" is required (not null) - this.DisplayName = displayName ?? throw new ArgumentNullException("displayName is a required property for Collection and cannot be null"); + if (displayName == null) { + throw new ArgumentNullException("displayName is a required property for Collection and cannot be null"); + } + this.DisplayName = displayName; this.AuthorizedQueryDomains = authorizedQueryDomains; } - /// - /// Output only. The collection's ID. - /// - /// Output only. The collection's ID. - [DataMember(Name = "id", EmitDefaultValue = false)] - public string Id { get; private set; } - - /// - /// Returns false as Id should not be serialized given that it's read-only. - /// - /// false (boolean) - public bool ShouldSerializeId() - { - return false; - } - /// /// Output only. The ID of the account that owns this collection. /// @@ -80,11 +67,17 @@ public bool ShouldSerializeAccountId() { return false; } + /// + /// The list of authorized query domains for the collection. Client-side / browser requests to the [QueryCollection](/api#operation/QueryCollection) call can be made by any authorized query domain or any of its subdomains. This allows your interface to make search requests without having to provide an API key in the client-side request. + /// + /// The list of authorized query domains for the collection. Client-side / browser requests to the [QueryCollection](/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. + [DataMember(Name = "authorized_query_domains", EmitDefaultValue = false)] + public List AuthorizedQueryDomains { get; set; } /// - /// Output only. Creation time of the collection. + /// Output only. Time the collection was created. /// - /// Output only. Creation time of the collection. + /// Output only. Time the collection was created. [DataMember(Name = "create_time", EmitDefaultValue = false)] public DateTime CreateTime { get; private set; } @@ -96,7 +89,6 @@ public bool ShouldSerializeCreateTime() { return false; } - /// /// The collection's display name. You can change this at any time. /// @@ -105,12 +97,20 @@ public bool ShouldSerializeCreateTime() public string DisplayName { get; set; } /// - /// The list of authorized query domains for the collection. Client-side / browser requests to the [QueryCollection](/api#operation/QueryCollection) call can be made by any authorized query domain or any of its subdomains. This allows your interface to make search requests without having to provide an API key in the client-side request. + /// Output only. The collection's ID. /// - /// The list of authorized query domains for the collection. Client-side / browser requests to the [QueryCollection](/api#operation/QueryCollection) call can be made by any authorized query domain or any of its subdomains. This allows your interface to make search requests without having to provide an API key in the client-side request. - [DataMember(Name = "authorized_query_domains", EmitDefaultValue = false)] - public List AuthorizedQueryDomains { get; set; } + /// Output only. The collection's ID. + [DataMember(Name = "id", EmitDefaultValue = false)] + public string Id { get; private set; } + /// + /// Returns false as Id should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeId() + { + return false; + } /// /// Returns the string presentation of the object /// @@ -119,11 +119,11 @@ public override string ToString() { var sb = new StringBuilder(); sb.Append("class Collection {\n"); - sb.Append(" Id: ").Append(Id).Append("\n"); sb.Append(" AccountId: ").Append(AccountId).Append("\n"); + sb.Append(" AuthorizedQueryDomains: ").Append(AuthorizedQueryDomains).Append("\n"); sb.Append(" CreateTime: ").Append(CreateTime).Append("\n"); sb.Append(" DisplayName: ").Append(DisplayName).Append("\n"); - sb.Append(" AuthorizedQueryDomains: ").Append(AuthorizedQueryDomains).Append("\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -134,7 +134,7 @@ public override string ToString() /// JSON string presentation of the object public virtual string ToJson() { - return JsonConvert.SerializeObject(this, Formatting.Indented); + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } /// @@ -158,16 +158,17 @@ public bool Equals(Collection input) return false; return - ( - this.Id == input.Id || - (this.Id != null && - this.Id.Equals(input.Id)) - ) && ( this.AccountId == input.AccountId || (this.AccountId != null && this.AccountId.Equals(input.AccountId)) ) && + ( + this.AuthorizedQueryDomains == input.AuthorizedQueryDomains || + this.AuthorizedQueryDomains != null && + input.AuthorizedQueryDomains != null && + this.AuthorizedQueryDomains.SequenceEqual(input.AuthorizedQueryDomains) + ) && ( this.CreateTime == input.CreateTime || (this.CreateTime != null && @@ -179,10 +180,9 @@ public bool Equals(Collection input) this.DisplayName.Equals(input.DisplayName)) ) && ( - this.AuthorizedQueryDomains == input.AuthorizedQueryDomains || - this.AuthorizedQueryDomains != null && - input.AuthorizedQueryDomains != null && - this.AuthorizedQueryDomains.SequenceEqual(input.AuthorizedQueryDomains) + this.Id == input.Id || + (this.Id != null && + this.Id.Equals(input.Id)) ); } @@ -195,16 +195,16 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - if (this.Id != null) - hashCode = hashCode * 59 + this.Id.GetHashCode(); if (this.AccountId != null) hashCode = hashCode * 59 + this.AccountId.GetHashCode(); + if (this.AuthorizedQueryDomains != null) + hashCode = hashCode * 59 + this.AuthorizedQueryDomains.GetHashCode(); if (this.CreateTime != null) hashCode = hashCode * 59 + this.CreateTime.GetHashCode(); if (this.DisplayName != null) hashCode = hashCode * 59 + this.DisplayName.GetHashCode(); - if (this.AuthorizedQueryDomains != null) - hashCode = hashCode * 59 + this.AuthorizedQueryDomains.GetHashCode(); + if (this.Id != null) + hashCode = hashCode * 59 + this.Id.GetHashCode(); return hashCode; } } @@ -214,7 +214,7 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + public IEnumerable Validate(ValidationContext validationContext) { yield break; } diff --git a/src/Com.Sajari.Sdk/Model/DeleteRecordRequest.cs b/src/Com.Sajari.Sdk/Model/DeleteRecordRequest.cs index 784bc56..43957ba 100644 --- a/src/Com.Sajari.Sdk/Model/DeleteRecordRequest.cs +++ b/src/Com.Sajari.Sdk/Model/DeleteRecordRequest.cs @@ -44,7 +44,10 @@ protected DeleteRecordRequest() { } public DeleteRecordRequest(RecordKey key = default(RecordKey)) { // to ensure "key" is required (not null) - this.Key = key ?? throw new ArgumentNullException("key is a required property for DeleteRecordRequest and cannot be null"); + if (key == null) { + throw new ArgumentNullException("key is a required property for DeleteRecordRequest and cannot be null"); + } + this.Key = key; } /// @@ -72,7 +75,7 @@ public override string ToString() /// JSON string presentation of the object public virtual string ToJson() { - return JsonConvert.SerializeObject(this, Formatting.Indented); + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } /// @@ -123,7 +126,7 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + public IEnumerable Validate(ValidationContext validationContext) { yield break; } diff --git a/src/Com.Sajari.Sdk/Model/Error.cs b/src/Com.Sajari.Sdk/Model/Error.cs index e5a6c3b..8e2489f 100644 --- a/src/Com.Sajari.Sdk/Model/Error.cs +++ b/src/Com.Sajari.Sdk/Model/Error.cs @@ -36,13 +36,13 @@ public partial class Error : IEquatable, IValidatableObject /// Initializes a new instance of the class. /// /// code. - /// message. /// details. - public Error(int code = default(int), string message = default(string), List details = default(List)) + /// message. + public Error(int code = default(int), List details = default(List), string message = default(string)) { this.Code = code; - this.Message = message; this.Details = details; + this.Message = message; } /// @@ -51,18 +51,18 @@ public partial class Error : IEquatable, IValidatableObject [DataMember(Name = "code", EmitDefaultValue = false)] public int Code { get; set; } - /// - /// Gets or Sets Message - /// - [DataMember(Name = "message", EmitDefaultValue = false)] - public string Message { get; set; } - /// /// Gets or Sets Details /// [DataMember(Name = "details", EmitDefaultValue = false)] public List Details { get; set; } + /// + /// Gets or Sets Message + /// + [DataMember(Name = "message", EmitDefaultValue = false)] + public string Message { get; set; } + /// /// Returns the string presentation of the object /// @@ -72,8 +72,8 @@ public override string ToString() var sb = new StringBuilder(); sb.Append("class Error {\n"); sb.Append(" Code: ").Append(Code).Append("\n"); - sb.Append(" Message: ").Append(Message).Append("\n"); sb.Append(" Details: ").Append(Details).Append("\n"); + sb.Append(" Message: ").Append(Message).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -84,7 +84,7 @@ public override string ToString() /// JSON string presentation of the object public virtual string ToJson() { - return JsonConvert.SerializeObject(this, Formatting.Indented); + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } /// @@ -112,16 +112,16 @@ public bool Equals(Error input) this.Code == input.Code || this.Code.Equals(input.Code) ) && - ( - this.Message == input.Message || - (this.Message != null && - this.Message.Equals(input.Message)) - ) && ( this.Details == input.Details || this.Details != null && input.Details != null && this.Details.SequenceEqual(input.Details) + ) && + ( + this.Message == input.Message || + (this.Message != null && + this.Message.Equals(input.Message)) ); } @@ -135,10 +135,10 @@ public override int GetHashCode() { int hashCode = 41; hashCode = hashCode * 59 + this.Code.GetHashCode(); - if (this.Message != null) - hashCode = hashCode * 59 + this.Message.GetHashCode(); if (this.Details != null) hashCode = hashCode * 59 + this.Details.GetHashCode(); + if (this.Message != null) + hashCode = hashCode * 59 + this.Message.GetHashCode(); return hashCode; } } @@ -148,7 +148,7 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + public IEnumerable Validate(ValidationContext validationContext) { yield break; } diff --git a/src/Com.Sajari.Sdk/Model/GeneratePipelinesRequest.cs b/src/Com.Sajari.Sdk/Model/GeneratePipelinesRequest.cs index 345ed04..5d5b99a 100644 --- a/src/Com.Sajari.Sdk/Model/GeneratePipelinesRequest.cs +++ b/src/Com.Sajari.Sdk/Model/GeneratePipelinesRequest.cs @@ -40,22 +40,18 @@ protected GeneratePipelinesRequest() { } /// /// Initializes a new instance of the class. /// - /// Prioritized list of fields to search. (required). /// List of fields to train query suggestions from.. - public GeneratePipelinesRequest(List searchableFields = default(List), List queryTrainingFields = default(List)) + /// Prioritized list of fields to search. (required). + public GeneratePipelinesRequest(List queryTrainingFields = default(List), List searchableFields = default(List)) { // to ensure "searchableFields" is required (not null) - this.SearchableFields = searchableFields ?? throw new ArgumentNullException("searchableFields is a required property for GeneratePipelinesRequest and cannot be null"); + if (searchableFields == null) { + throw new ArgumentNullException("searchableFields is a required property for GeneratePipelinesRequest and cannot be null"); + } + this.SearchableFields = searchableFields; this.QueryTrainingFields = queryTrainingFields; } - /// - /// Prioritized list of fields to search. - /// - /// Prioritized list of fields to search. - [DataMember(Name = "searchable_fields", IsRequired = true, EmitDefaultValue = false)] - public List SearchableFields { get; set; } - /// /// List of fields to train query suggestions from. /// @@ -63,6 +59,13 @@ protected GeneratePipelinesRequest() { } [DataMember(Name = "query_training_fields", EmitDefaultValue = false)] public List QueryTrainingFields { get; set; } + /// + /// Prioritized list of fields to search. + /// + /// Prioritized list of fields to search. + [DataMember(Name = "searchable_fields", IsRequired = true, EmitDefaultValue = false)] + public List SearchableFields { get; set; } + /// /// Returns the string presentation of the object /// @@ -71,8 +74,8 @@ public override string ToString() { var sb = new StringBuilder(); sb.Append("class GeneratePipelinesRequest {\n"); - sb.Append(" SearchableFields: ").Append(SearchableFields).Append("\n"); sb.Append(" QueryTrainingFields: ").Append(QueryTrainingFields).Append("\n"); + sb.Append(" SearchableFields: ").Append(SearchableFields).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -83,7 +86,7 @@ public override string ToString() /// JSON string presentation of the object public virtual string ToJson() { - return JsonConvert.SerializeObject(this, Formatting.Indented); + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } /// @@ -107,17 +110,17 @@ public bool Equals(GeneratePipelinesRequest input) return false; return - ( - this.SearchableFields == input.SearchableFields || - this.SearchableFields != null && - input.SearchableFields != null && - this.SearchableFields.SequenceEqual(input.SearchableFields) - ) && ( this.QueryTrainingFields == input.QueryTrainingFields || this.QueryTrainingFields != null && input.QueryTrainingFields != null && this.QueryTrainingFields.SequenceEqual(input.QueryTrainingFields) + ) && + ( + this.SearchableFields == input.SearchableFields || + this.SearchableFields != null && + input.SearchableFields != null && + this.SearchableFields.SequenceEqual(input.SearchableFields) ); } @@ -130,10 +133,10 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - if (this.SearchableFields != null) - hashCode = hashCode * 59 + this.SearchableFields.GetHashCode(); if (this.QueryTrainingFields != null) hashCode = hashCode * 59 + this.QueryTrainingFields.GetHashCode(); + if (this.SearchableFields != null) + hashCode = hashCode * 59 + this.SearchableFields.GetHashCode(); return hashCode; } } @@ -143,7 +146,7 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + public IEnumerable Validate(ValidationContext validationContext) { yield break; } diff --git a/src/Com.Sajari.Sdk/Model/GeneratePipelinesResponse.cs b/src/Com.Sajari.Sdk/Model/GeneratePipelinesResponse.cs index 3327e49..2aa57bf 100644 --- a/src/Com.Sajari.Sdk/Model/GeneratePipelinesResponse.cs +++ b/src/Com.Sajari.Sdk/Model/GeneratePipelinesResponse.cs @@ -35,21 +35,21 @@ public partial class GeneratePipelinesResponse : IEquatable /// Initializes a new instance of the class. /// - /// recordPipeline. - /// queryPipeline. /// autocompletePipeline. - public GeneratePipelinesResponse(Pipeline recordPipeline = default(Pipeline), Pipeline queryPipeline = default(Pipeline), Pipeline autocompletePipeline = default(Pipeline)) + /// queryPipeline. + /// recordPipeline. + public GeneratePipelinesResponse(Pipeline autocompletePipeline = default(Pipeline), Pipeline queryPipeline = default(Pipeline), Pipeline recordPipeline = default(Pipeline)) { - this.RecordPipeline = recordPipeline; - this.QueryPipeline = queryPipeline; this.AutocompletePipeline = autocompletePipeline; + this.QueryPipeline = queryPipeline; + this.RecordPipeline = recordPipeline; } /// - /// Gets or Sets RecordPipeline + /// Gets or Sets AutocompletePipeline /// - [DataMember(Name = "record_pipeline", EmitDefaultValue = false)] - public Pipeline RecordPipeline { get; set; } + [DataMember(Name = "autocomplete_pipeline", EmitDefaultValue = false)] + public Pipeline AutocompletePipeline { get; set; } /// /// Gets or Sets QueryPipeline @@ -58,10 +58,10 @@ public partial class GeneratePipelinesResponse : IEquatable - /// Gets or Sets AutocompletePipeline + /// Gets or Sets RecordPipeline /// - [DataMember(Name = "autocomplete_pipeline", EmitDefaultValue = false)] - public Pipeline AutocompletePipeline { get; set; } + [DataMember(Name = "record_pipeline", EmitDefaultValue = false)] + public Pipeline RecordPipeline { get; set; } /// /// Returns the string presentation of the object @@ -71,9 +71,9 @@ public override string ToString() { var sb = new StringBuilder(); sb.Append("class GeneratePipelinesResponse {\n"); - sb.Append(" RecordPipeline: ").Append(RecordPipeline).Append("\n"); - sb.Append(" QueryPipeline: ").Append(QueryPipeline).Append("\n"); sb.Append(" AutocompletePipeline: ").Append(AutocompletePipeline).Append("\n"); + sb.Append(" QueryPipeline: ").Append(QueryPipeline).Append("\n"); + sb.Append(" RecordPipeline: ").Append(RecordPipeline).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -84,7 +84,7 @@ public override string ToString() /// JSON string presentation of the object public virtual string ToJson() { - return JsonConvert.SerializeObject(this, Formatting.Indented); + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } /// @@ -109,9 +109,9 @@ public bool Equals(GeneratePipelinesResponse input) return ( - this.RecordPipeline == input.RecordPipeline || - (this.RecordPipeline != null && - this.RecordPipeline.Equals(input.RecordPipeline)) + this.AutocompletePipeline == input.AutocompletePipeline || + (this.AutocompletePipeline != null && + this.AutocompletePipeline.Equals(input.AutocompletePipeline)) ) && ( this.QueryPipeline == input.QueryPipeline || @@ -119,9 +119,9 @@ public bool Equals(GeneratePipelinesResponse input) this.QueryPipeline.Equals(input.QueryPipeline)) ) && ( - this.AutocompletePipeline == input.AutocompletePipeline || - (this.AutocompletePipeline != null && - this.AutocompletePipeline.Equals(input.AutocompletePipeline)) + this.RecordPipeline == input.RecordPipeline || + (this.RecordPipeline != null && + this.RecordPipeline.Equals(input.RecordPipeline)) ); } @@ -134,12 +134,12 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - if (this.RecordPipeline != null) - hashCode = hashCode * 59 + this.RecordPipeline.GetHashCode(); - if (this.QueryPipeline != null) - hashCode = hashCode * 59 + this.QueryPipeline.GetHashCode(); if (this.AutocompletePipeline != null) hashCode = hashCode * 59 + this.AutocompletePipeline.GetHashCode(); + if (this.QueryPipeline != null) + hashCode = hashCode * 59 + this.QueryPipeline.GetHashCode(); + if (this.RecordPipeline != null) + hashCode = hashCode * 59 + this.RecordPipeline.GetHashCode(); return hashCode; } } @@ -149,7 +149,7 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + public IEnumerable Validate(ValidationContext validationContext) { yield break; } diff --git a/src/Com.Sajari.Sdk/Model/GetDefaultPipelineResponse.cs b/src/Com.Sajari.Sdk/Model/GetDefaultPipelineResponse.cs index 5a22ad4..01f7cbd 100644 --- a/src/Com.Sajari.Sdk/Model/GetDefaultPipelineResponse.cs +++ b/src/Com.Sajari.Sdk/Model/GetDefaultPipelineResponse.cs @@ -67,7 +67,7 @@ public override string ToString() /// JSON string presentation of the object public virtual string ToJson() { - return JsonConvert.SerializeObject(this, Formatting.Indented); + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } /// @@ -118,7 +118,7 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + public IEnumerable Validate(ValidationContext validationContext) { yield break; } diff --git a/src/Com.Sajari.Sdk/Model/GetDefaultVersionRequestView.cs b/src/Com.Sajari.Sdk/Model/GetDefaultVersionRequestView.cs index 3f7d1a3..e4fff77 100644 --- a/src/Com.Sajari.Sdk/Model/GetDefaultVersionRequestView.cs +++ b/src/Com.Sajari.Sdk/Model/GetDefaultVersionRequestView.cs @@ -30,9 +30,7 @@ namespace Com.Sajari.Sdk.Model /// - VIEW_UNSPECIFIED: The default / unset value. The API defaults to the `BASIC` view. - BASIC: Include basic information including type, name, version and description but not the full step configuration. This is the default value (for both [ListPipelines](/api#operation/ListPipelines) and [GetPipeline](/api#operation/GetPipeline)). - FULL: Include the information from `BASIC`, plus full step configuration. /// /// - VIEW_UNSPECIFIED: The default / unset value. The API defaults to the `BASIC` view. - BASIC: Include basic information including type, name, version and description but not the full step configuration. This is the default value (for both [ListPipelines](/api#operation/ListPipelines) and [GetPipeline](/api#operation/GetPipeline)). - FULL: Include the information from `BASIC`, plus full step configuration. - [JsonConverter(typeof(StringEnumConverter))] - public enum GetDefaultVersionRequestView { /// diff --git a/src/Com.Sajari.Sdk/Model/GetPipelineRequestView.cs b/src/Com.Sajari.Sdk/Model/GetPipelineRequestView.cs index a8fd7ac..610423a 100644 --- a/src/Com.Sajari.Sdk/Model/GetPipelineRequestView.cs +++ b/src/Com.Sajari.Sdk/Model/GetPipelineRequestView.cs @@ -30,9 +30,7 @@ namespace Com.Sajari.Sdk.Model /// - VIEW_UNSPECIFIED: The default / unset value. The API defaults to the `BASIC` view. - BASIC: Include basic information including type, name, version and description but not the full step configuration. This is the default value (for both [ListPipelines](/api#operation/ListPipelines) and [GetPipeline](/api#operation/GetPipeline)). - FULL: Include the information from `BASIC`, plus full step configuration. /// /// - VIEW_UNSPECIFIED: The default / unset value. The API defaults to the `BASIC` view. - BASIC: Include basic information including type, name, version and description but not the full step configuration. This is the default value (for both [ListPipelines](/api#operation/ListPipelines) and [GetPipeline](/api#operation/GetPipeline)). - FULL: Include the information from `BASIC`, plus full step configuration. - [JsonConverter(typeof(StringEnumConverter))] - public enum GetPipelineRequestView { /// diff --git a/src/Com.Sajari.Sdk/Model/GetRecordRequest.cs b/src/Com.Sajari.Sdk/Model/GetRecordRequest.cs index e10b75d..7c680da 100644 --- a/src/Com.Sajari.Sdk/Model/GetRecordRequest.cs +++ b/src/Com.Sajari.Sdk/Model/GetRecordRequest.cs @@ -44,7 +44,10 @@ protected GetRecordRequest() { } public GetRecordRequest(RecordKey key = default(RecordKey)) { // to ensure "key" is required (not null) - this.Key = key ?? throw new ArgumentNullException("key is a required property for GetRecordRequest and cannot be null"); + if (key == null) { + throw new ArgumentNullException("key is a required property for GetRecordRequest and cannot be null"); + } + this.Key = key; } /// @@ -72,7 +75,7 @@ public override string ToString() /// JSON string presentation of the object public virtual string ToJson() { - return JsonConvert.SerializeObject(this, Formatting.Indented); + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } /// @@ -123,7 +126,7 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + public IEnumerable Validate(ValidationContext validationContext) { yield break; } diff --git a/src/Com.Sajari.Sdk/Model/ListCollectionsResponse.cs b/src/Com.Sajari.Sdk/Model/ListCollectionsResponse.cs index f4ad646..8f3a2c1 100644 --- a/src/Com.Sajari.Sdk/Model/ListCollectionsResponse.cs +++ b/src/Com.Sajari.Sdk/Model/ListCollectionsResponse.cs @@ -77,7 +77,7 @@ public override string ToString() /// JSON string presentation of the object public virtual string ToJson() { - return JsonConvert.SerializeObject(this, Formatting.Indented); + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } /// @@ -136,7 +136,7 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + public IEnumerable Validate(ValidationContext validationContext) { yield break; } diff --git a/src/Com.Sajari.Sdk/Model/ListPipelinesRequestView.cs b/src/Com.Sajari.Sdk/Model/ListPipelinesRequestView.cs index 2c82b6c..7750c8a 100644 --- a/src/Com.Sajari.Sdk/Model/ListPipelinesRequestView.cs +++ b/src/Com.Sajari.Sdk/Model/ListPipelinesRequestView.cs @@ -30,9 +30,7 @@ namespace Com.Sajari.Sdk.Model /// - VIEW_UNSPECIFIED: The default / unset value. The API defaults to the `BASIC` view. - BASIC: Include basic information including type, name, version and description but not the full step configuration. This is the default value (for both [ListPipelines](/api#operation/ListPipelines) and [GetPipeline](/api#operation/GetPipeline)). - FULL: Include the information from `BASIC`, plus full step configuration. /// /// - VIEW_UNSPECIFIED: The default / unset value. The API defaults to the `BASIC` view. - BASIC: Include basic information including type, name, version and description but not the full step configuration. This is the default value (for both [ListPipelines](/api#operation/ListPipelines) and [GetPipeline](/api#operation/GetPipeline)). - FULL: Include the information from `BASIC`, plus full step configuration. - [JsonConverter(typeof(StringEnumConverter))] - public enum ListPipelinesRequestView { /// diff --git a/src/Com.Sajari.Sdk/Model/ListPipelinesResponse.cs b/src/Com.Sajari.Sdk/Model/ListPipelinesResponse.cs index 0950f5b..1a9bdca 100644 --- a/src/Com.Sajari.Sdk/Model/ListPipelinesResponse.cs +++ b/src/Com.Sajari.Sdk/Model/ListPipelinesResponse.cs @@ -35,21 +35,14 @@ public partial class ListPipelinesResponse : IEquatable, /// /// Initializes a new instance of the class. /// - /// The pipelines from the specified collection.. /// A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages.. - public ListPipelinesResponse(List pipelines = default(List), string nextPageToken = default(string)) + /// The pipelines from the specified collection.. + public ListPipelinesResponse(string nextPageToken = default(string), List pipelines = default(List)) { - this.Pipelines = pipelines; this.NextPageToken = nextPageToken; + this.Pipelines = pipelines; } - /// - /// The pipelines from the specified collection. - /// - /// The pipelines from the specified collection. - [DataMember(Name = "pipelines", EmitDefaultValue = false)] - public List Pipelines { get; set; } - /// /// A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages. /// @@ -57,6 +50,13 @@ public partial class ListPipelinesResponse : IEquatable, [DataMember(Name = "next_page_token", EmitDefaultValue = false)] public string NextPageToken { get; set; } + /// + /// The pipelines from the specified collection. + /// + /// The pipelines from the specified collection. + [DataMember(Name = "pipelines", EmitDefaultValue = false)] + public List Pipelines { get; set; } + /// /// Returns the string presentation of the object /// @@ -65,8 +65,8 @@ public override string ToString() { var sb = new StringBuilder(); sb.Append("class ListPipelinesResponse {\n"); - sb.Append(" Pipelines: ").Append(Pipelines).Append("\n"); sb.Append(" NextPageToken: ").Append(NextPageToken).Append("\n"); + sb.Append(" Pipelines: ").Append(Pipelines).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -77,7 +77,7 @@ public override string ToString() /// JSON string presentation of the object public virtual string ToJson() { - return JsonConvert.SerializeObject(this, Formatting.Indented); + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } /// @@ -101,16 +101,16 @@ public bool Equals(ListPipelinesResponse input) return false; return + ( + this.NextPageToken == input.NextPageToken || + (this.NextPageToken != null && + this.NextPageToken.Equals(input.NextPageToken)) + ) && ( this.Pipelines == input.Pipelines || this.Pipelines != null && input.Pipelines != null && this.Pipelines.SequenceEqual(input.Pipelines) - ) && - ( - this.NextPageToken == input.NextPageToken || - (this.NextPageToken != null && - this.NextPageToken.Equals(input.NextPageToken)) ); } @@ -123,10 +123,10 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - if (this.Pipelines != null) - hashCode = hashCode * 59 + this.Pipelines.GetHashCode(); if (this.NextPageToken != null) hashCode = hashCode * 59 + this.NextPageToken.GetHashCode(); + if (this.Pipelines != null) + hashCode = hashCode * 59 + this.Pipelines.GetHashCode(); return hashCode; } } @@ -136,7 +136,7 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + public IEnumerable Validate(ValidationContext validationContext) { yield break; } diff --git a/src/Com.Sajari.Sdk/Model/ListSchemaFieldsResponse.cs b/src/Com.Sajari.Sdk/Model/ListSchemaFieldsResponse.cs index 16eb1da..9787a2f 100644 --- a/src/Com.Sajari.Sdk/Model/ListSchemaFieldsResponse.cs +++ b/src/Com.Sajari.Sdk/Model/ListSchemaFieldsResponse.cs @@ -35,16 +35,23 @@ public partial class ListSchemaFieldsResponse : IEquatable /// Initializes a new instance of the class. /// + /// A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages.. /// The schema fields.. /// Maximum number of fields to return.. - /// A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages.. - public ListSchemaFieldsResponse(List schemaFields = default(List), int totalSize = default(int), string nextPageToken = default(string)) + public ListSchemaFieldsResponse(string nextPageToken = default(string), List schemaFields = default(List), int totalSize = default(int)) { + this.NextPageToken = nextPageToken; this.SchemaFields = schemaFields; this.TotalSize = totalSize; - this.NextPageToken = nextPageToken; } + /// + /// A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages. + /// + /// A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages. + [DataMember(Name = "next_page_token", EmitDefaultValue = false)] + public string NextPageToken { get; set; } + /// /// The schema fields. /// @@ -59,13 +66,6 @@ public partial class ListSchemaFieldsResponse : IEquatable - /// A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages. - /// - /// A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages. - [DataMember(Name = "next_page_token", EmitDefaultValue = false)] - public string NextPageToken { get; set; } - /// /// Returns the string presentation of the object /// @@ -74,9 +74,9 @@ public override string ToString() { var sb = new StringBuilder(); sb.Append("class ListSchemaFieldsResponse {\n"); + sb.Append(" NextPageToken: ").Append(NextPageToken).Append("\n"); sb.Append(" SchemaFields: ").Append(SchemaFields).Append("\n"); sb.Append(" TotalSize: ").Append(TotalSize).Append("\n"); - sb.Append(" NextPageToken: ").Append(NextPageToken).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -87,7 +87,7 @@ public override string ToString() /// JSON string presentation of the object public virtual string ToJson() { - return JsonConvert.SerializeObject(this, Formatting.Indented); + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } /// @@ -111,6 +111,11 @@ public bool Equals(ListSchemaFieldsResponse input) return false; return + ( + this.NextPageToken == input.NextPageToken || + (this.NextPageToken != null && + this.NextPageToken.Equals(input.NextPageToken)) + ) && ( this.SchemaFields == input.SchemaFields || this.SchemaFields != null && @@ -120,11 +125,6 @@ public bool Equals(ListSchemaFieldsResponse input) ( this.TotalSize == input.TotalSize || this.TotalSize.Equals(input.TotalSize) - ) && - ( - this.NextPageToken == input.NextPageToken || - (this.NextPageToken != null && - this.NextPageToken.Equals(input.NextPageToken)) ); } @@ -137,11 +137,11 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; + if (this.NextPageToken != null) + hashCode = hashCode * 59 + this.NextPageToken.GetHashCode(); if (this.SchemaFields != null) hashCode = hashCode * 59 + this.SchemaFields.GetHashCode(); hashCode = hashCode * 59 + this.TotalSize.GetHashCode(); - if (this.NextPageToken != null) - hashCode = hashCode * 59 + this.NextPageToken.GetHashCode(); return hashCode; } } @@ -151,7 +151,7 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + public IEnumerable Validate(ValidationContext validationContext) { yield break; } diff --git a/src/Com.Sajari.Sdk/Model/PercentileDataPoint.cs b/src/Com.Sajari.Sdk/Model/PercentileDataPoint.cs index efe1c4c..1b77678 100644 --- a/src/Com.Sajari.Sdk/Model/PercentileDataPoint.cs +++ b/src/Com.Sajari.Sdk/Model/PercentileDataPoint.cs @@ -77,7 +77,7 @@ public override string ToString() /// JSON string presentation of the object public virtual string ToJson() { - return JsonConvert.SerializeObject(this, Formatting.Indented); + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } /// @@ -131,7 +131,7 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + public IEnumerable Validate(ValidationContext validationContext) { yield break; } diff --git a/src/Com.Sajari.Sdk/Model/Pipeline.cs b/src/Com.Sajari.Sdk/Model/Pipeline.cs index dc0c0b0..844557a 100644 --- a/src/Com.Sajari.Sdk/Model/Pipeline.cs +++ b/src/Com.Sajari.Sdk/Model/Pipeline.cs @@ -32,6 +32,7 @@ namespace Com.Sajari.Sdk.Model [DataContract(Name = "Pipeline")] public partial class Pipeline : IEquatable, IValidatableObject { + /// /// Gets or Sets Type /// @@ -45,28 +46,49 @@ protected Pipeline() { } /// /// Initializes a new instance of the class. /// - /// type (required). - /// The pipeline's name. Must start with an alphanumeric character followed by one or more alphanumeric, `_`, `-` or `.` characters. Strictly speaking, it must match the regular expression: `^[a-zA-Z0-9][a-zA-Z0-9_\\-\\.]+$`. (required). - /// The pipeline's version. Must start with an alphanumeric character followed by one or more alphanumeric, `_`, `-` or `.` characters. Strictly speaking, it must match the regular expression: `^[a-zA-Z0-9][a-zA-Z0-9_\\-\\.]+$`. (required). /// Description of the pipeline.. - /// Pre-steps are run before an indexing operation or query request is sent to the search index.. + /// The pipeline's name. Must start with an alphanumeric character followed by one or more alphanumeric, `_`, `-` or `.` characters. Strictly speaking, it must match the regular expression: `^[a-zA-Z0-9][a-zA-Z0-9_\\-\\.]+$`. (required). /// Post-steps are run after an indexing operation or query request has been sent to the search index. For indexing operations, the post-steps only run when creating new records. They do not run when updating records. For querying, the post-steps have access to the result-set. This makes it possible to act on the results before sending them back to the caller.. - public Pipeline(PipelineType type = default(PipelineType), string name = default(string), string version = default(string), string description = default(string), List preSteps = default(List), List postSteps = default(List)) + /// Pre-steps are run before an indexing operation or query request is sent to the search index.. + /// type (required). + /// The pipeline's version. Must start with an alphanumeric character followed by one or more alphanumeric, `_`, `-` or `.` characters. Strictly speaking, it must match the regular expression: `^[a-zA-Z0-9][a-zA-Z0-9_\\-\\.]+$`. (required). + public Pipeline(string description = default(string), string name = default(string), List postSteps = default(List), List preSteps = default(List), PipelineType type = default(PipelineType), string version = default(string)) { - this.Type = type; // to ensure "name" is required (not null) - this.Name = name ?? throw new ArgumentNullException("name is a required property for Pipeline and cannot be null"); + if (name == null) { + throw new ArgumentNullException("name is a required property for Pipeline and cannot be null"); + } + this.Name = name; + this.Type = type; // to ensure "version" is required (not null) - this.Version = version ?? throw new ArgumentNullException("version is a required property for Pipeline and cannot be null"); + if (version == null) { + throw new ArgumentNullException("version is a required property for Pipeline and cannot be null"); + } + this._Version = version; this.Description = description; - this.PreSteps = preSteps; this.PostSteps = postSteps; + this.PreSteps = preSteps; } /// - /// Output only. Creation time of the pipeline. + /// Output only. Indicates if the pipeline is the collection default pipeline. + /// + /// Output only. Indicates if the pipeline is the collection default pipeline. + [DataMember(Name = "collection_default", EmitDefaultValue = true)] + public bool CollectionDefault { get; private set; } + + /// + /// Returns false as CollectionDefault should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeCollectionDefault() + { + return false; + } + /// + /// Output only. Time the pipeline was created. /// - /// Output only. Creation time of the pipeline. + /// Output only. Time the pipeline was created. [DataMember(Name = "create_time", EmitDefaultValue = false)] public DateTime CreateTime { get; private set; } @@ -78,21 +100,21 @@ public bool ShouldSerializeCreateTime() { return false; } - /// - /// The pipeline's name. Must start with an alphanumeric character followed by one or more alphanumeric, `_`, `-` or `.` characters. Strictly speaking, it must match the regular expression: `^[a-zA-Z0-9][a-zA-Z0-9_\\-\\.]+$`. + /// Output only. Indicates if the pipeline is the default version. /// - /// The pipeline's name. Must start with an alphanumeric character followed by one or more alphanumeric, `_`, `-` or `.` characters. Strictly speaking, it must match the regular expression: `^[a-zA-Z0-9][a-zA-Z0-9_\\-\\.]+$`. - [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = false)] - public string Name { get; set; } + /// Output only. Indicates if the pipeline is the default version. + [DataMember(Name = "default_version", EmitDefaultValue = true)] + public bool DefaultVersion { get; private set; } /// - /// The pipeline's version. Must start with an alphanumeric character followed by one or more alphanumeric, `_`, `-` or `.` characters. Strictly speaking, it must match the regular expression: `^[a-zA-Z0-9][a-zA-Z0-9_\\-\\.]+$`. + /// Returns false as DefaultVersion should not be serialized given that it's read-only. /// - /// The pipeline's version. Must start with an alphanumeric character followed by one or more alphanumeric, `_`, `-` or `.` characters. Strictly speaking, it must match the regular expression: `^[a-zA-Z0-9][a-zA-Z0-9_\\-\\.]+$`. - [DataMember(Name = "version", IsRequired = true, EmitDefaultValue = false)] - public string Version { get; set; } - + /// false (boolean) + public bool ShouldSerializeDefaultVersion() + { + return false; + } /// /// Description of the pipeline. /// @@ -101,11 +123,11 @@ public bool ShouldSerializeCreateTime() public string Description { get; set; } /// - /// Pre-steps are run before an indexing operation or query request is sent to the search index. + /// The pipeline's name. Must start with an alphanumeric character followed by one or more alphanumeric, `_`, `-` or `.` characters. Strictly speaking, it must match the regular expression: `^[a-zA-Z0-9][a-zA-Z0-9_\\-\\.]+$`. /// - /// Pre-steps are run before an indexing operation or query request is sent to the search index. - [DataMember(Name = "pre_steps", EmitDefaultValue = false)] - public List PreSteps { get; set; } + /// The pipeline's name. Must start with an alphanumeric character followed by one or more alphanumeric, `_`, `-` or `.` characters. Strictly speaking, it must match the regular expression: `^[a-zA-Z0-9][a-zA-Z0-9_\\-\\.]+$`. + [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = false)] + public string Name { get; set; } /// /// Post-steps are run after an indexing operation or query request has been sent to the search index. For indexing operations, the post-steps only run when creating new records. They do not run when updating records. For querying, the post-steps have access to the result-set. This makes it possible to act on the results before sending them back to the caller. @@ -115,36 +137,18 @@ public bool ShouldSerializeCreateTime() public List PostSteps { get; set; } /// - /// Output only. Indicates if the pipeline is the collection default pipeline. - /// - /// Output only. Indicates if the pipeline is the collection default pipeline. - [DataMember(Name = "collection_default", EmitDefaultValue = false)] - public bool CollectionDefault { get; private set; } - - /// - /// Returns false as CollectionDefault should not be serialized given that it's read-only. - /// - /// false (boolean) - public bool ShouldSerializeCollectionDefault() - { - return false; - } - - /// - /// Output only. Indicates if the pipeline is the default version. + /// Pre-steps are run before an indexing operation or query request is sent to the search index. /// - /// Output only. Indicates if the pipeline is the default version. - [DataMember(Name = "default_version", EmitDefaultValue = false)] - public bool DefaultVersion { get; private set; } + /// Pre-steps are run before an indexing operation or query request is sent to the search index. + [DataMember(Name = "pre_steps", EmitDefaultValue = false)] + public List PreSteps { get; set; } /// - /// Returns false as DefaultVersion should not be serialized given that it's read-only. + /// The pipeline's version. Must start with an alphanumeric character followed by one or more alphanumeric, `_`, `-` or `.` characters. Strictly speaking, it must match the regular expression: `^[a-zA-Z0-9][a-zA-Z0-9_\\-\\.]+$`. /// - /// false (boolean) - public bool ShouldSerializeDefaultVersion() - { - return false; - } + /// The pipeline's version. Must start with an alphanumeric character followed by one or more alphanumeric, `_`, `-` or `.` characters. Strictly speaking, it must match the regular expression: `^[a-zA-Z0-9][a-zA-Z0-9_\\-\\.]+$`. + [DataMember(Name = "version", IsRequired = true, EmitDefaultValue = false)] + public string _Version { get; set; } /// /// Returns the string presentation of the object @@ -154,15 +158,15 @@ public override string ToString() { var sb = new StringBuilder(); sb.Append("class Pipeline {\n"); + sb.Append(" CollectionDefault: ").Append(CollectionDefault).Append("\n"); sb.Append(" CreateTime: ").Append(CreateTime).Append("\n"); - sb.Append(" Type: ").Append(Type).Append("\n"); - sb.Append(" Name: ").Append(Name).Append("\n"); - sb.Append(" Version: ").Append(Version).Append("\n"); + sb.Append(" DefaultVersion: ").Append(DefaultVersion).Append("\n"); sb.Append(" Description: ").Append(Description).Append("\n"); - sb.Append(" PreSteps: ").Append(PreSteps).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); sb.Append(" PostSteps: ").Append(PostSteps).Append("\n"); - sb.Append(" CollectionDefault: ").Append(CollectionDefault).Append("\n"); - sb.Append(" DefaultVersion: ").Append(DefaultVersion).Append("\n"); + sb.Append(" PreSteps: ").Append(PreSteps).Append("\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); + sb.Append(" _Version: ").Append(_Version).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -173,7 +177,7 @@ public override string ToString() /// JSON string presentation of the object public virtual string ToJson() { - return JsonConvert.SerializeObject(this, Formatting.Indented); + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } /// @@ -197,24 +201,18 @@ public bool Equals(Pipeline input) return false; return + ( + this.CollectionDefault == input.CollectionDefault || + this.CollectionDefault.Equals(input.CollectionDefault) + ) && ( this.CreateTime == input.CreateTime || (this.CreateTime != null && this.CreateTime.Equals(input.CreateTime)) ) && ( - this.Type == input.Type || - this.Type.Equals(input.Type) - ) && - ( - this.Name == input.Name || - (this.Name != null && - this.Name.Equals(input.Name)) - ) && - ( - this.Version == input.Version || - (this.Version != null && - this.Version.Equals(input.Version)) + this.DefaultVersion == input.DefaultVersion || + this.DefaultVersion.Equals(input.DefaultVersion) ) && ( this.Description == input.Description || @@ -222,10 +220,9 @@ public bool Equals(Pipeline input) this.Description.Equals(input.Description)) ) && ( - this.PreSteps == input.PreSteps || - this.PreSteps != null && - input.PreSteps != null && - this.PreSteps.SequenceEqual(input.PreSteps) + this.Name == input.Name || + (this.Name != null && + this.Name.Equals(input.Name)) ) && ( this.PostSteps == input.PostSteps || @@ -234,12 +231,19 @@ public bool Equals(Pipeline input) this.PostSteps.SequenceEqual(input.PostSteps) ) && ( - this.CollectionDefault == input.CollectionDefault || - this.CollectionDefault.Equals(input.CollectionDefault) + this.PreSteps == input.PreSteps || + this.PreSteps != null && + input.PreSteps != null && + this.PreSteps.SequenceEqual(input.PreSteps) ) && ( - this.DefaultVersion == input.DefaultVersion || - this.DefaultVersion.Equals(input.DefaultVersion) + this.Type == input.Type || + this.Type.Equals(input.Type) + ) && + ( + this._Version == input._Version || + (this._Version != null && + this._Version.Equals(input._Version)) ); } @@ -252,21 +256,21 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; + hashCode = hashCode * 59 + this.CollectionDefault.GetHashCode(); if (this.CreateTime != null) hashCode = hashCode * 59 + this.CreateTime.GetHashCode(); - hashCode = hashCode * 59 + this.Type.GetHashCode(); - if (this.Name != null) - hashCode = hashCode * 59 + this.Name.GetHashCode(); - if (this.Version != null) - hashCode = hashCode * 59 + this.Version.GetHashCode(); + hashCode = hashCode * 59 + this.DefaultVersion.GetHashCode(); if (this.Description != null) hashCode = hashCode * 59 + this.Description.GetHashCode(); - if (this.PreSteps != null) - hashCode = hashCode * 59 + this.PreSteps.GetHashCode(); + if (this.Name != null) + hashCode = hashCode * 59 + this.Name.GetHashCode(); if (this.PostSteps != null) hashCode = hashCode * 59 + this.PostSteps.GetHashCode(); - hashCode = hashCode * 59 + this.CollectionDefault.GetHashCode(); - hashCode = hashCode * 59 + this.DefaultVersion.GetHashCode(); + if (this.PreSteps != null) + hashCode = hashCode * 59 + this.PreSteps.GetHashCode(); + hashCode = hashCode * 59 + this.Type.GetHashCode(); + if (this._Version != null) + hashCode = hashCode * 59 + this._Version.GetHashCode(); return hashCode; } } @@ -276,7 +280,7 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + public IEnumerable Validate(ValidationContext validationContext) { yield break; } diff --git a/src/Com.Sajari.Sdk/Model/PipelineStep.cs b/src/Com.Sajari.Sdk/Model/PipelineStep.cs index 8b86afc..d109519 100644 --- a/src/Com.Sajari.Sdk/Model/PipelineStep.cs +++ b/src/Com.Sajari.Sdk/Model/PipelineStep.cs @@ -40,36 +40,39 @@ protected PipelineStep() { } /// /// Initializes a new instance of the class. /// - /// ID of the step template. (required). - /// Title for the step. Overrides the default title.. + /// Annotations added to the request when the step is run.. + /// Condition expression to determine if the step should be run. This is a filter expression much like the query filter expression, but it acts upon the pipeline variables. For example, to only run the step if the pipeline `q` variable is not empty, set this to `q != ''`.. /// Description for the step. Overrides the default description.. + /// ID of the step template. (required). /// Bindings for the step parameters.. - /// Condition expression to determine if the step should be run. This is a filter expression much like the query filter expression, but it acts upon the pipeline variables. For example, to only run the step if the pipeline `q` variable is not empty, set this to `q != ''`.. - /// Annotations added to the request when the step is run.. - public PipelineStep(string id = default(string), string title = default(string), string description = default(string), Dictionary _params = default(Dictionary), string condition = default(string), List annotations = default(List)) + /// Title for the step. Overrides the default title.. + public PipelineStep(List annotations = default(List), string condition = default(string), string description = default(string), string id = default(string), Dictionary _params = default(Dictionary), string title = default(string)) { // to ensure "id" is required (not null) - this.Id = id ?? throw new ArgumentNullException("id is a required property for PipelineStep and cannot be null"); - this.Title = title; + if (id == null) { + throw new ArgumentNullException("id is a required property for PipelineStep and cannot be null"); + } + this.Id = id; + this.Annotations = annotations; + this.Condition = condition; this.Description = description; this.Params = _params; - this.Condition = condition; - this.Annotations = annotations; + this.Title = title; } /// - /// ID of the step template. + /// Annotations added to the request when the step is run. /// - /// ID of the step template. - [DataMember(Name = "id", IsRequired = true, EmitDefaultValue = false)] - public string Id { get; set; } + /// Annotations added to the request when the step is run. + [DataMember(Name = "annotations", EmitDefaultValue = false)] + public List Annotations { get; set; } /// - /// Title for the step. Overrides the default title. + /// Condition expression to determine if the step should be run. This is a filter expression much like the query filter expression, but it acts upon the pipeline variables. For example, to only run the step if the pipeline `q` variable is not empty, set this to `q != ''`. /// - /// Title for the step. Overrides the default title. - [DataMember(Name = "title", EmitDefaultValue = false)] - public string Title { get; set; } + /// Condition expression to determine if the step should be run. This is a filter expression much like the query filter expression, but it acts upon the pipeline variables. For example, to only run the step if the pipeline `q` variable is not empty, set this to `q != ''`. + [DataMember(Name = "condition", EmitDefaultValue = false)] + public string Condition { get; set; } /// /// Description for the step. Overrides the default description. @@ -78,6 +81,13 @@ protected PipelineStep() { } [DataMember(Name = "description", EmitDefaultValue = false)] public string Description { get; set; } + /// + /// ID of the step template. + /// + /// ID of the step template. + [DataMember(Name = "id", IsRequired = true, EmitDefaultValue = false)] + public string Id { get; set; } + /// /// Bindings for the step parameters. /// @@ -86,18 +96,11 @@ protected PipelineStep() { } public Dictionary Params { get; set; } /// - /// Condition expression to determine if the step should be run. This is a filter expression much like the query filter expression, but it acts upon the pipeline variables. For example, to only run the step if the pipeline `q` variable is not empty, set this to `q != ''`. - /// - /// Condition expression to determine if the step should be run. This is a filter expression much like the query filter expression, but it acts upon the pipeline variables. For example, to only run the step if the pipeline `q` variable is not empty, set this to `q != ''`. - [DataMember(Name = "condition", EmitDefaultValue = false)] - public string Condition { get; set; } - - /// - /// Annotations added to the request when the step is run. + /// Title for the step. Overrides the default title. /// - /// Annotations added to the request when the step is run. - [DataMember(Name = "annotations", EmitDefaultValue = false)] - public List Annotations { get; set; } + /// Title for the step. Overrides the default title. + [DataMember(Name = "title", EmitDefaultValue = false)] + public string Title { get; set; } /// /// Returns the string presentation of the object @@ -107,12 +110,12 @@ public override string ToString() { var sb = new StringBuilder(); sb.Append("class PipelineStep {\n"); - sb.Append(" Id: ").Append(Id).Append("\n"); - sb.Append(" Title: ").Append(Title).Append("\n"); + sb.Append(" Annotations: ").Append(Annotations).Append("\n"); + sb.Append(" Condition: ").Append(Condition).Append("\n"); sb.Append(" Description: ").Append(Description).Append("\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); sb.Append(" Params: ").Append(Params).Append("\n"); - sb.Append(" Condition: ").Append(Condition).Append("\n"); - sb.Append(" Annotations: ").Append(Annotations).Append("\n"); + sb.Append(" Title: ").Append(Title).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -123,7 +126,7 @@ public override string ToString() /// JSON string presentation of the object public virtual string ToJson() { - return JsonConvert.SerializeObject(this, Formatting.Indented); + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } /// @@ -148,20 +151,26 @@ public bool Equals(PipelineStep input) return ( - this.Id == input.Id || - (this.Id != null && - this.Id.Equals(input.Id)) + this.Annotations == input.Annotations || + this.Annotations != null && + input.Annotations != null && + this.Annotations.SequenceEqual(input.Annotations) ) && ( - this.Title == input.Title || - (this.Title != null && - this.Title.Equals(input.Title)) + this.Condition == input.Condition || + (this.Condition != null && + this.Condition.Equals(input.Condition)) ) && ( this.Description == input.Description || (this.Description != null && this.Description.Equals(input.Description)) ) && + ( + this.Id == input.Id || + (this.Id != null && + this.Id.Equals(input.Id)) + ) && ( this.Params == input.Params || this.Params != null && @@ -169,15 +178,9 @@ public bool Equals(PipelineStep input) this.Params.SequenceEqual(input.Params) ) && ( - this.Condition == input.Condition || - (this.Condition != null && - this.Condition.Equals(input.Condition)) - ) && - ( - this.Annotations == input.Annotations || - this.Annotations != null && - input.Annotations != null && - this.Annotations.SequenceEqual(input.Annotations) + this.Title == input.Title || + (this.Title != null && + this.Title.Equals(input.Title)) ); } @@ -190,18 +193,18 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - if (this.Id != null) - hashCode = hashCode * 59 + this.Id.GetHashCode(); - if (this.Title != null) - hashCode = hashCode * 59 + this.Title.GetHashCode(); + if (this.Annotations != null) + hashCode = hashCode * 59 + this.Annotations.GetHashCode(); + if (this.Condition != null) + hashCode = hashCode * 59 + this.Condition.GetHashCode(); if (this.Description != null) hashCode = hashCode * 59 + this.Description.GetHashCode(); + if (this.Id != null) + hashCode = hashCode * 59 + this.Id.GetHashCode(); if (this.Params != null) hashCode = hashCode * 59 + this.Params.GetHashCode(); - if (this.Condition != null) - hashCode = hashCode * 59 + this.Condition.GetHashCode(); - if (this.Annotations != null) - hashCode = hashCode * 59 + this.Annotations.GetHashCode(); + if (this.Title != null) + hashCode = hashCode * 59 + this.Title.GetHashCode(); return hashCode; } } @@ -211,7 +214,7 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + public IEnumerable Validate(ValidationContext validationContext) { yield break; } diff --git a/src/Com.Sajari.Sdk/Model/PipelineStepParamBinding.cs b/src/Com.Sajari.Sdk/Model/PipelineStepParamBinding.cs index e70a1d4..5810ec7 100644 --- a/src/Com.Sajari.Sdk/Model/PipelineStepParamBinding.cs +++ b/src/Com.Sajari.Sdk/Model/PipelineStepParamBinding.cs @@ -36,15 +36,15 @@ public partial class PipelineStepParamBinding : IEquatable class. /// /// Bind the step parameter to a pipeline variable.. - /// Set the description of the step parameter.. - /// Set a default value for the step parameter. This allows you to set a default value for the step parameter when it is not bound to a pipeline variable.. /// Bind the step parameter to a constant value.. - public PipelineStepParamBinding(string bind = default(string), string description = default(string), string defaultValue = default(string), string constant = default(string)) + /// Set a default value for the step parameter. This allows you to set a default value for the step parameter when it is not bound to a pipeline variable.. + /// Set the description of the step parameter.. + public PipelineStepParamBinding(string bind = default(string), string constant = default(string), string defaultValue = default(string), string description = default(string)) { this.Bind = bind; - this.Description = description; - this.DefaultValue = defaultValue; this.Constant = constant; + this.DefaultValue = defaultValue; + this.Description = description; } /// @@ -55,11 +55,11 @@ public partial class PipelineStepParamBinding : IEquatable - /// Set the description of the step parameter. + /// Bind the step parameter to a constant value. /// - /// Set the description of the step parameter. - [DataMember(Name = "description", EmitDefaultValue = false)] - public string Description { get; set; } + /// Bind the step parameter to a constant value. + [DataMember(Name = "constant", EmitDefaultValue = false)] + public string Constant { get; set; } /// /// Set a default value for the step parameter. This allows you to set a default value for the step parameter when it is not bound to a pipeline variable. @@ -69,11 +69,11 @@ public partial class PipelineStepParamBinding : IEquatable - /// Bind the step parameter to a constant value. + /// Set the description of the step parameter. /// - /// Bind the step parameter to a constant value. - [DataMember(Name = "constant", EmitDefaultValue = false)] - public string Constant { get; set; } + /// Set the description of the step parameter. + [DataMember(Name = "description", EmitDefaultValue = false)] + public string Description { get; set; } /// /// Returns the string presentation of the object @@ -84,9 +84,9 @@ public override string ToString() var sb = new StringBuilder(); sb.Append("class PipelineStepParamBinding {\n"); sb.Append(" Bind: ").Append(Bind).Append("\n"); - sb.Append(" Description: ").Append(Description).Append("\n"); - sb.Append(" DefaultValue: ").Append(DefaultValue).Append("\n"); sb.Append(" Constant: ").Append(Constant).Append("\n"); + sb.Append(" DefaultValue: ").Append(DefaultValue).Append("\n"); + sb.Append(" Description: ").Append(Description).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -97,7 +97,7 @@ public override string ToString() /// JSON string presentation of the object public virtual string ToJson() { - return JsonConvert.SerializeObject(this, Formatting.Indented); + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } /// @@ -127,9 +127,9 @@ public bool Equals(PipelineStepParamBinding input) this.Bind.Equals(input.Bind)) ) && ( - this.Description == input.Description || - (this.Description != null && - this.Description.Equals(input.Description)) + this.Constant == input.Constant || + (this.Constant != null && + this.Constant.Equals(input.Constant)) ) && ( this.DefaultValue == input.DefaultValue || @@ -137,9 +137,9 @@ public bool Equals(PipelineStepParamBinding input) this.DefaultValue.Equals(input.DefaultValue)) ) && ( - this.Constant == input.Constant || - (this.Constant != null && - this.Constant.Equals(input.Constant)) + this.Description == input.Description || + (this.Description != null && + this.Description.Equals(input.Description)) ); } @@ -154,12 +154,12 @@ public override int GetHashCode() int hashCode = 41; if (this.Bind != null) hashCode = hashCode * 59 + this.Bind.GetHashCode(); - if (this.Description != null) - hashCode = hashCode * 59 + this.Description.GetHashCode(); - if (this.DefaultValue != null) - hashCode = hashCode * 59 + this.DefaultValue.GetHashCode(); if (this.Constant != null) hashCode = hashCode * 59 + this.Constant.GetHashCode(); + if (this.DefaultValue != null) + hashCode = hashCode * 59 + this.DefaultValue.GetHashCode(); + if (this.Description != null) + hashCode = hashCode * 59 + this.Description.GetHashCode(); return hashCode; } } @@ -169,7 +169,7 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + public IEnumerable Validate(ValidationContext validationContext) { yield break; } diff --git a/src/Com.Sajari.Sdk/Model/PipelineType.cs b/src/Com.Sajari.Sdk/Model/PipelineType.cs index 86bbb32..21ec21f 100644 --- a/src/Com.Sajari.Sdk/Model/PipelineType.cs +++ b/src/Com.Sajari.Sdk/Model/PipelineType.cs @@ -30,9 +30,7 @@ namespace Com.Sajari.Sdk.Model /// - TYPE_UNSPECIFIED: Pipeline type not specified. - RECORD: Record pipeline. - QUERY: Query pipeline. /// /// - TYPE_UNSPECIFIED: Pipeline type not specified. - RECORD: Record pipeline. - QUERY: Query pipeline. - [JsonConverter(typeof(StringEnumConverter))] - public enum PipelineType { /// diff --git a/src/Com.Sajari.Sdk/Model/ProtobufAny.cs b/src/Com.Sajari.Sdk/Model/ProtobufAny.cs index 4958769..0d051c5 100644 --- a/src/Com.Sajari.Sdk/Model/ProtobufAny.cs +++ b/src/Com.Sajari.Sdk/Model/ProtobufAny.cs @@ -77,7 +77,7 @@ public override string ToString() /// JSON string presentation of the object public virtual string ToJson() { - return JsonConvert.SerializeObject(this, Formatting.Indented); + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } /// @@ -135,7 +135,7 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + public IEnumerable Validate(ValidationContext validationContext) { yield break; } diff --git a/src/Com.Sajari.Sdk/Model/ProtobufNullValue.cs b/src/Com.Sajari.Sdk/Model/ProtobufNullValue.cs index 4d3f17a..4025ab1 100644 --- a/src/Com.Sajari.Sdk/Model/ProtobufNullValue.cs +++ b/src/Com.Sajari.Sdk/Model/ProtobufNullValue.cs @@ -30,9 +30,7 @@ namespace Com.Sajari.Sdk.Model /// `NullValue` is a singleton enumeration to represent the null value for the `Value` type union. The JSON representation for `NullValue` is JSON `null`. - NULL_VALUE: Null value. /// /// `NullValue` is a singleton enumeration to represent the null value for the `Value` type union. The JSON representation for `NullValue` is JSON `null`. - NULL_VALUE: Null value. - [JsonConverter(typeof(StringEnumConverter))] - public enum ProtobufNullValue { /// diff --git a/src/Com.Sajari.Sdk/Model/QueryAggregateResult.cs b/src/Com.Sajari.Sdk/Model/QueryAggregateResult.cs index 0e1d52d..57653f4 100644 --- a/src/Com.Sajari.Sdk/Model/QueryAggregateResult.cs +++ b/src/Com.Sajari.Sdk/Model/QueryAggregateResult.cs @@ -35,33 +35,27 @@ public partial class QueryAggregateResult : IEquatable, IV /// /// Initializes a new instance of the class. /// - /// metric. - /// count. + /// analysis. /// buckets. + /// count. /// date. - /// analysis. + /// metric. /// percentile. - public QueryAggregateResult(QueryAggregateResultMetric metric = default(QueryAggregateResultMetric), QueryAggregateResultCount count = default(QueryAggregateResultCount), QueryAggregateResultBuckets buckets = default(QueryAggregateResultBuckets), QueryAggregateResultDate date = default(QueryAggregateResultDate), QueryAggregateResultAnalysis analysis = default(QueryAggregateResultAnalysis), QueryAggregateResultPercentile percentile = default(QueryAggregateResultPercentile)) + public QueryAggregateResult(QueryAggregateResultAnalysis analysis = default(QueryAggregateResultAnalysis), QueryAggregateResultBuckets buckets = default(QueryAggregateResultBuckets), QueryAggregateResultCount count = default(QueryAggregateResultCount), QueryAggregateResultDate date = default(QueryAggregateResultDate), QueryAggregateResultMetric metric = default(QueryAggregateResultMetric), QueryAggregateResultPercentile percentile = default(QueryAggregateResultPercentile)) { - this.Metric = metric; - this.Count = count; + this.Analysis = analysis; this.Buckets = buckets; + this.Count = count; this.Date = date; - this.Analysis = analysis; + this.Metric = metric; this.Percentile = percentile; } /// - /// Gets or Sets Metric - /// - [DataMember(Name = "metric", EmitDefaultValue = false)] - public QueryAggregateResultMetric Metric { get; set; } - - /// - /// Gets or Sets Count + /// Gets or Sets Analysis /// - [DataMember(Name = "count", EmitDefaultValue = false)] - public QueryAggregateResultCount Count { get; set; } + [DataMember(Name = "analysis", EmitDefaultValue = false)] + public QueryAggregateResultAnalysis Analysis { get; set; } /// /// Gets or Sets Buckets @@ -69,6 +63,12 @@ public partial class QueryAggregateResult : IEquatable, IV [DataMember(Name = "buckets", EmitDefaultValue = false)] public QueryAggregateResultBuckets Buckets { get; set; } + /// + /// Gets or Sets Count + /// + [DataMember(Name = "count", EmitDefaultValue = false)] + public QueryAggregateResultCount Count { get; set; } + /// /// Gets or Sets Date /// @@ -76,10 +76,10 @@ public partial class QueryAggregateResult : IEquatable, IV public QueryAggregateResultDate Date { get; set; } /// - /// Gets or Sets Analysis + /// Gets or Sets Metric /// - [DataMember(Name = "analysis", EmitDefaultValue = false)] - public QueryAggregateResultAnalysis Analysis { get; set; } + [DataMember(Name = "metric", EmitDefaultValue = false)] + public QueryAggregateResultMetric Metric { get; set; } /// /// Gets or Sets Percentile @@ -95,11 +95,11 @@ public override string ToString() { var sb = new StringBuilder(); sb.Append("class QueryAggregateResult {\n"); - sb.Append(" Metric: ").Append(Metric).Append("\n"); - sb.Append(" Count: ").Append(Count).Append("\n"); + sb.Append(" Analysis: ").Append(Analysis).Append("\n"); sb.Append(" Buckets: ").Append(Buckets).Append("\n"); + sb.Append(" Count: ").Append(Count).Append("\n"); sb.Append(" Date: ").Append(Date).Append("\n"); - sb.Append(" Analysis: ").Append(Analysis).Append("\n"); + sb.Append(" Metric: ").Append(Metric).Append("\n"); sb.Append(" Percentile: ").Append(Percentile).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -111,7 +111,7 @@ public override string ToString() /// JSON string presentation of the object public virtual string ToJson() { - return JsonConvert.SerializeObject(this, Formatting.Indented); + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } /// @@ -136,29 +136,29 @@ public bool Equals(QueryAggregateResult input) return ( - this.Metric == input.Metric || - (this.Metric != null && - this.Metric.Equals(input.Metric)) - ) && - ( - this.Count == input.Count || - (this.Count != null && - this.Count.Equals(input.Count)) + this.Analysis == input.Analysis || + (this.Analysis != null && + this.Analysis.Equals(input.Analysis)) ) && ( this.Buckets == input.Buckets || (this.Buckets != null && this.Buckets.Equals(input.Buckets)) ) && + ( + this.Count == input.Count || + (this.Count != null && + this.Count.Equals(input.Count)) + ) && ( this.Date == input.Date || (this.Date != null && this.Date.Equals(input.Date)) ) && ( - this.Analysis == input.Analysis || - (this.Analysis != null && - this.Analysis.Equals(input.Analysis)) + this.Metric == input.Metric || + (this.Metric != null && + this.Metric.Equals(input.Metric)) ) && ( this.Percentile == input.Percentile || @@ -176,16 +176,16 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - if (this.Metric != null) - hashCode = hashCode * 59 + this.Metric.GetHashCode(); - if (this.Count != null) - hashCode = hashCode * 59 + this.Count.GetHashCode(); + if (this.Analysis != null) + hashCode = hashCode * 59 + this.Analysis.GetHashCode(); if (this.Buckets != null) hashCode = hashCode * 59 + this.Buckets.GetHashCode(); + if (this.Count != null) + hashCode = hashCode * 59 + this.Count.GetHashCode(); if (this.Date != null) hashCode = hashCode * 59 + this.Date.GetHashCode(); - if (this.Analysis != null) - hashCode = hashCode * 59 + this.Analysis.GetHashCode(); + if (this.Metric != null) + hashCode = hashCode * 59 + this.Metric.GetHashCode(); if (this.Percentile != null) hashCode = hashCode * 59 + this.Percentile.GetHashCode(); return hashCode; @@ -197,7 +197,7 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + public IEnumerable Validate(ValidationContext validationContext) { yield break; } diff --git a/src/Com.Sajari.Sdk/Model/QueryAggregateResultAnalysis.cs b/src/Com.Sajari.Sdk/Model/QueryAggregateResultAnalysis.cs index bdbb32e..cafcb7a 100644 --- a/src/Com.Sajari.Sdk/Model/QueryAggregateResultAnalysis.cs +++ b/src/Com.Sajari.Sdk/Model/QueryAggregateResultAnalysis.cs @@ -35,26 +35,26 @@ public partial class QueryAggregateResultAnalysis : IEquatable /// Initializes a new instance of the class. /// - /// Coverage is the number of records which have a value set.. + /// Average number of items in an array field.. /// Cardinality is the number of different values in a field.. - /// Minimum length of an array field.. + /// Coverage is the number of records which have a value set.. /// Maximum number of values in an array field.. - /// Average number of items in an array field.. - public QueryAggregateResultAnalysis(int coverage = default(int), int cardinality = default(int), int minLength = default(int), int maxLength = default(int), float avgLength = default(float)) + /// Minimum length of an array field.. + public QueryAggregateResultAnalysis(float avgLength = default(float), int cardinality = default(int), int coverage = default(int), int maxLength = default(int), int minLength = default(int)) { - this.Coverage = coverage; + this.AvgLength = avgLength; this.Cardinality = cardinality; - this.MinLength = minLength; + this.Coverage = coverage; this.MaxLength = maxLength; - this.AvgLength = avgLength; + this.MinLength = minLength; } /// - /// Coverage is the number of records which have a value set. + /// Average number of items in an array field. /// - /// Coverage is the number of records which have a value set. - [DataMember(Name = "coverage", EmitDefaultValue = false)] - public int Coverage { get; set; } + /// Average number of items in an array field. + [DataMember(Name = "avg_length", EmitDefaultValue = false)] + public float AvgLength { get; set; } /// /// Cardinality is the number of different values in a field. @@ -64,11 +64,11 @@ public partial class QueryAggregateResultAnalysis : IEquatable - /// Minimum length of an array field. + /// Coverage is the number of records which have a value set. /// - /// Minimum length of an array field. - [DataMember(Name = "min_length", EmitDefaultValue = false)] - public int MinLength { get; set; } + /// Coverage is the number of records which have a value set. + [DataMember(Name = "coverage", EmitDefaultValue = false)] + public int Coverage { get; set; } /// /// Maximum number of values in an array field. @@ -78,11 +78,11 @@ public partial class QueryAggregateResultAnalysis : IEquatable - /// Average number of items in an array field. + /// Minimum length of an array field. /// - /// Average number of items in an array field. - [DataMember(Name = "avg_length", EmitDefaultValue = false)] - public float AvgLength { get; set; } + /// Minimum length of an array field. + [DataMember(Name = "min_length", EmitDefaultValue = false)] + public int MinLength { get; set; } /// /// Returns the string presentation of the object @@ -92,11 +92,11 @@ public override string ToString() { var sb = new StringBuilder(); sb.Append("class QueryAggregateResultAnalysis {\n"); - sb.Append(" Coverage: ").Append(Coverage).Append("\n"); + sb.Append(" AvgLength: ").Append(AvgLength).Append("\n"); sb.Append(" Cardinality: ").Append(Cardinality).Append("\n"); - sb.Append(" MinLength: ").Append(MinLength).Append("\n"); + sb.Append(" Coverage: ").Append(Coverage).Append("\n"); sb.Append(" MaxLength: ").Append(MaxLength).Append("\n"); - sb.Append(" AvgLength: ").Append(AvgLength).Append("\n"); + sb.Append(" MinLength: ").Append(MinLength).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -107,7 +107,7 @@ public override string ToString() /// JSON string presentation of the object public virtual string ToJson() { - return JsonConvert.SerializeObject(this, Formatting.Indented); + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } /// @@ -132,24 +132,24 @@ public bool Equals(QueryAggregateResultAnalysis input) return ( - this.Coverage == input.Coverage || - this.Coverage.Equals(input.Coverage) + this.AvgLength == input.AvgLength || + this.AvgLength.Equals(input.AvgLength) ) && ( this.Cardinality == input.Cardinality || this.Cardinality.Equals(input.Cardinality) ) && ( - this.MinLength == input.MinLength || - this.MinLength.Equals(input.MinLength) + this.Coverage == input.Coverage || + this.Coverage.Equals(input.Coverage) ) && ( this.MaxLength == input.MaxLength || this.MaxLength.Equals(input.MaxLength) ) && ( - this.AvgLength == input.AvgLength || - this.AvgLength.Equals(input.AvgLength) + this.MinLength == input.MinLength || + this.MinLength.Equals(input.MinLength) ); } @@ -162,11 +162,11 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.Coverage.GetHashCode(); + hashCode = hashCode * 59 + this.AvgLength.GetHashCode(); hashCode = hashCode * 59 + this.Cardinality.GetHashCode(); - hashCode = hashCode * 59 + this.MinLength.GetHashCode(); + hashCode = hashCode * 59 + this.Coverage.GetHashCode(); hashCode = hashCode * 59 + this.MaxLength.GetHashCode(); - hashCode = hashCode * 59 + this.AvgLength.GetHashCode(); + hashCode = hashCode * 59 + this.MinLength.GetHashCode(); return hashCode; } } @@ -176,7 +176,7 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + public IEnumerable Validate(ValidationContext validationContext) { yield break; } diff --git a/src/Com.Sajari.Sdk/Model/QueryAggregateResultBuckets.cs b/src/Com.Sajari.Sdk/Model/QueryAggregateResultBuckets.cs index 57f799e..a5bd786 100644 --- a/src/Com.Sajari.Sdk/Model/QueryAggregateResultBuckets.cs +++ b/src/Com.Sajari.Sdk/Model/QueryAggregateResultBuckets.cs @@ -66,7 +66,7 @@ public override string ToString() /// JSON string presentation of the object public virtual string ToJson() { - return JsonConvert.SerializeObject(this, Formatting.Indented); + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } /// @@ -118,7 +118,7 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + public IEnumerable Validate(ValidationContext validationContext) { yield break; } diff --git a/src/Com.Sajari.Sdk/Model/QueryAggregateResultBucketsBucket.cs b/src/Com.Sajari.Sdk/Model/QueryAggregateResultBucketsBucket.cs index 11a4683..1453d37 100644 --- a/src/Com.Sajari.Sdk/Model/QueryAggregateResultBucketsBucket.cs +++ b/src/Com.Sajari.Sdk/Model/QueryAggregateResultBucketsBucket.cs @@ -35,21 +35,14 @@ public partial class QueryAggregateResultBucketsBucket : IEquatable /// Initializes a new instance of the class. /// - /// Name of bucket.. /// Number of records in the bucket.. - public QueryAggregateResultBucketsBucket(string name = default(string), int count = default(int)) + /// Name of bucket.. + public QueryAggregateResultBucketsBucket(int count = default(int), string name = default(string)) { - this.Name = name; this.Count = count; + this.Name = name; } - /// - /// Name of bucket. - /// - /// Name of bucket. - [DataMember(Name = "name", EmitDefaultValue = false)] - public string Name { get; set; } - /// /// Number of records in the bucket. /// @@ -57,6 +50,13 @@ public partial class QueryAggregateResultBucketsBucket : IEquatable + /// Name of bucket. + /// + /// Name of bucket. + [DataMember(Name = "name", EmitDefaultValue = false)] + public string Name { get; set; } + /// /// Returns the string presentation of the object /// @@ -65,8 +65,8 @@ public override string ToString() { var sb = new StringBuilder(); sb.Append("class QueryAggregateResultBucketsBucket {\n"); - sb.Append(" Name: ").Append(Name).Append("\n"); sb.Append(" Count: ").Append(Count).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -77,7 +77,7 @@ public override string ToString() /// JSON string presentation of the object public virtual string ToJson() { - return JsonConvert.SerializeObject(this, Formatting.Indented); + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } /// @@ -101,14 +101,14 @@ public bool Equals(QueryAggregateResultBucketsBucket input) return false; return + ( + this.Count == input.Count || + this.Count.Equals(input.Count) + ) && ( this.Name == input.Name || (this.Name != null && this.Name.Equals(input.Name)) - ) && - ( - this.Count == input.Count || - this.Count.Equals(input.Count) ); } @@ -121,9 +121,9 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; + hashCode = hashCode * 59 + this.Count.GetHashCode(); if (this.Name != null) hashCode = hashCode * 59 + this.Name.GetHashCode(); - hashCode = hashCode * 59 + this.Count.GetHashCode(); return hashCode; } } @@ -133,7 +133,7 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + public IEnumerable Validate(ValidationContext validationContext) { yield break; } diff --git a/src/Com.Sajari.Sdk/Model/QueryAggregateResultCount.cs b/src/Com.Sajari.Sdk/Model/QueryAggregateResultCount.cs index 45eaa28..9a4ff6a 100644 --- a/src/Com.Sajari.Sdk/Model/QueryAggregateResultCount.cs +++ b/src/Com.Sajari.Sdk/Model/QueryAggregateResultCount.cs @@ -66,7 +66,7 @@ public override string ToString() /// JSON string presentation of the object public virtual string ToJson() { - return JsonConvert.SerializeObject(this, Formatting.Indented); + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } /// @@ -118,7 +118,7 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + public IEnumerable Validate(ValidationContext validationContext) { yield break; } diff --git a/src/Com.Sajari.Sdk/Model/QueryAggregateResultDate.cs b/src/Com.Sajari.Sdk/Model/QueryAggregateResultDate.cs index 8a89e1e..0eee953 100644 --- a/src/Com.Sajari.Sdk/Model/QueryAggregateResultDate.cs +++ b/src/Com.Sajari.Sdk/Model/QueryAggregateResultDate.cs @@ -66,7 +66,7 @@ public override string ToString() /// JSON string presentation of the object public virtual string ToJson() { - return JsonConvert.SerializeObject(this, Formatting.Indented); + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } /// @@ -118,7 +118,7 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + public IEnumerable Validate(ValidationContext validationContext) { yield break; } diff --git a/src/Com.Sajari.Sdk/Model/QueryAggregateResultMetric.cs b/src/Com.Sajari.Sdk/Model/QueryAggregateResultMetric.cs index 07b0561..013709f 100644 --- a/src/Com.Sajari.Sdk/Model/QueryAggregateResultMetric.cs +++ b/src/Com.Sajari.Sdk/Model/QueryAggregateResultMetric.cs @@ -66,7 +66,7 @@ public override string ToString() /// JSON string presentation of the object public virtual string ToJson() { - return JsonConvert.SerializeObject(this, Formatting.Indented); + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } /// @@ -115,7 +115,7 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + public IEnumerable Validate(ValidationContext validationContext) { yield break; } diff --git a/src/Com.Sajari.Sdk/Model/QueryAggregateResultPercentile.cs b/src/Com.Sajari.Sdk/Model/QueryAggregateResultPercentile.cs index 71f23c9..dda210e 100644 --- a/src/Com.Sajari.Sdk/Model/QueryAggregateResultPercentile.cs +++ b/src/Com.Sajari.Sdk/Model/QueryAggregateResultPercentile.cs @@ -35,21 +35,14 @@ public partial class QueryAggregateResultPercentile : IEquatable /// Initializes a new instance of the class. /// - /// The percentile data points.. /// The cumulative distribution function (CDF) data points.. - public QueryAggregateResultPercentile(List percentiles = default(List), List cdf = default(List)) + /// The percentile data points.. + public QueryAggregateResultPercentile(List cdf = default(List), List percentiles = default(List)) { - this.Percentiles = percentiles; this.Cdf = cdf; + this.Percentiles = percentiles; } - /// - /// The percentile data points. - /// - /// The percentile data points. - [DataMember(Name = "percentiles", EmitDefaultValue = false)] - public List Percentiles { get; set; } - /// /// The cumulative distribution function (CDF) data points. /// @@ -57,6 +50,13 @@ public partial class QueryAggregateResultPercentile : IEquatable Cdf { get; set; } + /// + /// The percentile data points. + /// + /// The percentile data points. + [DataMember(Name = "percentiles", EmitDefaultValue = false)] + public List Percentiles { get; set; } + /// /// Returns the string presentation of the object /// @@ -65,8 +65,8 @@ public override string ToString() { var sb = new StringBuilder(); sb.Append("class QueryAggregateResultPercentile {\n"); - sb.Append(" Percentiles: ").Append(Percentiles).Append("\n"); sb.Append(" Cdf: ").Append(Cdf).Append("\n"); + sb.Append(" Percentiles: ").Append(Percentiles).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -77,7 +77,7 @@ public override string ToString() /// JSON string presentation of the object public virtual string ToJson() { - return JsonConvert.SerializeObject(this, Formatting.Indented); + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } /// @@ -101,17 +101,17 @@ public bool Equals(QueryAggregateResultPercentile input) return false; return - ( - this.Percentiles == input.Percentiles || - this.Percentiles != null && - input.Percentiles != null && - this.Percentiles.SequenceEqual(input.Percentiles) - ) && ( this.Cdf == input.Cdf || this.Cdf != null && input.Cdf != null && this.Cdf.SequenceEqual(input.Cdf) + ) && + ( + this.Percentiles == input.Percentiles || + this.Percentiles != null && + input.Percentiles != null && + this.Percentiles.SequenceEqual(input.Percentiles) ); } @@ -124,10 +124,10 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - if (this.Percentiles != null) - hashCode = hashCode * 59 + this.Percentiles.GetHashCode(); if (this.Cdf != null) hashCode = hashCode * 59 + this.Cdf.GetHashCode(); + if (this.Percentiles != null) + hashCode = hashCode * 59 + this.Percentiles.GetHashCode(); return hashCode; } } @@ -137,7 +137,7 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + public IEnumerable Validate(ValidationContext validationContext) { yield break; } diff --git a/src/Com.Sajari.Sdk/Model/QueryCollectionRequest.cs b/src/Com.Sajari.Sdk/Model/QueryCollectionRequest.cs index 7244771..72cb203 100644 --- a/src/Com.Sajari.Sdk/Model/QueryCollectionRequest.cs +++ b/src/Com.Sajari.Sdk/Model/QueryCollectionRequest.cs @@ -41,12 +41,15 @@ protected QueryCollectionRequest() { } /// Initializes a new instance of the class. /// /// pipeline. - /// The initial values for the variables the pipeline operates on and transforms throughout its steps. The most important variable is `q` which is the query the user entered, for example: ```json { \"q\": \"search terms\" } ``` To paginate through results, set the variables `page` and `resultsPerPage`, for example: ```json { \"q\": \"search terms\", \"page\": 5, \"resultsPerPage\": 20 } ``` To sort results, set the variable `sort` to the name of one of your collection's schema fields, for example: ```json { \"q\": \"search terms\", \"sort\": \"name\" } ``` To sort in reverse, prefix the schema field with a minus sign `-`, for example: ```json { \"q\": \"search terms\", \"sort\": \"-name\" } ``` (required). /// tracking. - public QueryCollectionRequest(QueryCollectionRequestPipeline pipeline = default(QueryCollectionRequestPipeline), Object variables = default(Object), QueryCollectionRequestTracking tracking = default(QueryCollectionRequestTracking)) + /// The initial values for the variables the pipeline operates on and transforms throughout its steps. The most important variable is `q` which is the query the user entered, for example: ```json { \"q\": \"search terms\" } ``` To paginate through results, set the variables `page` and `resultsPerPage`, for example: ```json { \"q\": \"search terms\", \"page\": 5, \"resultsPerPage\": 20 } ``` To sort results, set the variable `sort` to the name of one of your collection's schema fields, for example: ```json { \"q\": \"search terms\", \"sort\": \"name\" } ``` To sort in reverse, prefix the schema field with a minus sign `-`, for example: ```json { \"q\": \"search terms\", \"sort\": \"-name\" } ``` (required). + public QueryCollectionRequest(QueryCollectionRequestPipeline pipeline = default(QueryCollectionRequestPipeline), QueryCollectionRequestTracking tracking = default(QueryCollectionRequestTracking), Dictionary variables = default(Dictionary)) { // to ensure "variables" is required (not null) - this.Variables = variables ?? throw new ArgumentNullException("variables is a required property for QueryCollectionRequest and cannot be null"); + if (variables == null) { + throw new ArgumentNullException("variables is a required property for QueryCollectionRequest and cannot be null"); + } + this.Variables = variables; this.Pipeline = pipeline; this.Tracking = tracking; } @@ -57,19 +60,19 @@ protected QueryCollectionRequest() { } [DataMember(Name = "pipeline", EmitDefaultValue = false)] public QueryCollectionRequestPipeline Pipeline { get; set; } - /// - /// The initial values for the variables the pipeline operates on and transforms throughout its steps. The most important variable is `q` which is the query the user entered, for example: ```json { \"q\": \"search terms\" } ``` To paginate through results, set the variables `page` and `resultsPerPage`, for example: ```json { \"q\": \"search terms\", \"page\": 5, \"resultsPerPage\": 20 } ``` To sort results, set the variable `sort` to the name of one of your collection's schema fields, for example: ```json { \"q\": \"search terms\", \"sort\": \"name\" } ``` To sort in reverse, prefix the schema field with a minus sign `-`, for example: ```json { \"q\": \"search terms\", \"sort\": \"-name\" } ``` - /// - /// The initial values for the variables the pipeline operates on and transforms throughout its steps. The most important variable is `q` which is the query the user entered, for example: ```json { \"q\": \"search terms\" } ``` To paginate through results, set the variables `page` and `resultsPerPage`, for example: ```json { \"q\": \"search terms\", \"page\": 5, \"resultsPerPage\": 20 } ``` To sort results, set the variable `sort` to the name of one of your collection's schema fields, for example: ```json { \"q\": \"search terms\", \"sort\": \"name\" } ``` To sort in reverse, prefix the schema field with a minus sign `-`, for example: ```json { \"q\": \"search terms\", \"sort\": \"-name\" } ``` - [DataMember(Name = "variables", IsRequired = true, EmitDefaultValue = false)] - public Object Variables { get; set; } - /// /// Gets or Sets Tracking /// [DataMember(Name = "tracking", EmitDefaultValue = false)] public QueryCollectionRequestTracking Tracking { get; set; } + /// + /// The initial values for the variables the pipeline operates on and transforms throughout its steps. The most important variable is `q` which is the query the user entered, for example: ```json { \"q\": \"search terms\" } ``` To paginate through results, set the variables `page` and `resultsPerPage`, for example: ```json { \"q\": \"search terms\", \"page\": 5, \"resultsPerPage\": 20 } ``` To sort results, set the variable `sort` to the name of one of your collection's schema fields, for example: ```json { \"q\": \"search terms\", \"sort\": \"name\" } ``` To sort in reverse, prefix the schema field with a minus sign `-`, for example: ```json { \"q\": \"search terms\", \"sort\": \"-name\" } ``` + /// + /// The initial values for the variables the pipeline operates on and transforms throughout its steps. The most important variable is `q` which is the query the user entered, for example: ```json { \"q\": \"search terms\" } ``` To paginate through results, set the variables `page` and `resultsPerPage`, for example: ```json { \"q\": \"search terms\", \"page\": 5, \"resultsPerPage\": 20 } ``` To sort results, set the variable `sort` to the name of one of your collection's schema fields, for example: ```json { \"q\": \"search terms\", \"sort\": \"name\" } ``` To sort in reverse, prefix the schema field with a minus sign `-`, for example: ```json { \"q\": \"search terms\", \"sort\": \"-name\" } ``` + [DataMember(Name = "variables", IsRequired = true, EmitDefaultValue = false)] + public Dictionary Variables { get; set; } + /// /// Returns the string presentation of the object /// @@ -79,8 +82,8 @@ public override string ToString() var sb = new StringBuilder(); sb.Append("class QueryCollectionRequest {\n"); sb.Append(" Pipeline: ").Append(Pipeline).Append("\n"); - sb.Append(" Variables: ").Append(Variables).Append("\n"); sb.Append(" Tracking: ").Append(Tracking).Append("\n"); + sb.Append(" Variables: ").Append(Variables).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -91,7 +94,7 @@ public override string ToString() /// JSON string presentation of the object public virtual string ToJson() { - return JsonConvert.SerializeObject(this, Formatting.Indented); + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } /// @@ -120,15 +123,16 @@ public bool Equals(QueryCollectionRequest input) (this.Pipeline != null && this.Pipeline.Equals(input.Pipeline)) ) && - ( - this.Variables == input.Variables || - (this.Variables != null && - this.Variables.Equals(input.Variables)) - ) && ( this.Tracking == input.Tracking || (this.Tracking != null && this.Tracking.Equals(input.Tracking)) + ) && + ( + this.Variables == input.Variables || + this.Variables != null && + input.Variables != null && + this.Variables.SequenceEqual(input.Variables) ); } @@ -143,10 +147,10 @@ public override int GetHashCode() int hashCode = 41; if (this.Pipeline != null) hashCode = hashCode * 59 + this.Pipeline.GetHashCode(); - if (this.Variables != null) - hashCode = hashCode * 59 + this.Variables.GetHashCode(); if (this.Tracking != null) hashCode = hashCode * 59 + this.Tracking.GetHashCode(); + if (this.Variables != null) + hashCode = hashCode * 59 + this.Variables.GetHashCode(); return hashCode; } } @@ -156,7 +160,7 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + public IEnumerable Validate(ValidationContext validationContext) { yield break; } diff --git a/src/Com.Sajari.Sdk/Model/QueryCollectionRequestPipeline.cs b/src/Com.Sajari.Sdk/Model/QueryCollectionRequestPipeline.cs index 197b850..39abbf8 100644 --- a/src/Com.Sajari.Sdk/Model/QueryCollectionRequestPipeline.cs +++ b/src/Com.Sajari.Sdk/Model/QueryCollectionRequestPipeline.cs @@ -45,8 +45,11 @@ protected QueryCollectionRequestPipeline() { } public QueryCollectionRequestPipeline(string name = default(string), string version = default(string)) { // to ensure "name" is required (not null) - this.Name = name ?? throw new ArgumentNullException("name is a required property for QueryCollectionRequestPipeline and cannot be null"); - this.Version = version; + if (name == null) { + throw new ArgumentNullException("name is a required property for QueryCollectionRequestPipeline and cannot be null"); + } + this.Name = name; + this._Version = version; } /// @@ -61,7 +64,7 @@ protected QueryCollectionRequestPipeline() { } /// /// The query pipeline's version, e.g. `42`. If not provided the default version is used. [DataMember(Name = "version", EmitDefaultValue = false)] - public string Version { get; set; } + public string _Version { get; set; } /// /// Returns the string presentation of the object @@ -72,7 +75,7 @@ public override string ToString() var sb = new StringBuilder(); sb.Append("class QueryCollectionRequestPipeline {\n"); sb.Append(" Name: ").Append(Name).Append("\n"); - sb.Append(" Version: ").Append(Version).Append("\n"); + sb.Append(" _Version: ").Append(_Version).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -83,7 +86,7 @@ public override string ToString() /// JSON string presentation of the object public virtual string ToJson() { - return JsonConvert.SerializeObject(this, Formatting.Indented); + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } /// @@ -113,9 +116,9 @@ public bool Equals(QueryCollectionRequestPipeline input) this.Name.Equals(input.Name)) ) && ( - this.Version == input.Version || - (this.Version != null && - this.Version.Equals(input.Version)) + this._Version == input._Version || + (this._Version != null && + this._Version.Equals(input._Version)) ); } @@ -130,8 +133,8 @@ public override int GetHashCode() int hashCode = 41; if (this.Name != null) hashCode = hashCode * 59 + this.Name.GetHashCode(); - if (this.Version != null) - hashCode = hashCode * 59 + this.Version.GetHashCode(); + if (this._Version != null) + hashCode = hashCode * 59 + this._Version.GetHashCode(); return hashCode; } } @@ -141,7 +144,7 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + public IEnumerable Validate(ValidationContext validationContext) { yield break; } diff --git a/src/Com.Sajari.Sdk/Model/QueryCollectionRequestTracking.cs b/src/Com.Sajari.Sdk/Model/QueryCollectionRequestTracking.cs index fa17e33..eb2b56a 100644 --- a/src/Com.Sajari.Sdk/Model/QueryCollectionRequestTracking.cs +++ b/src/Com.Sajari.Sdk/Model/QueryCollectionRequestTracking.cs @@ -32,6 +32,7 @@ namespace Com.Sajari.Sdk.Model [DataContract(Name = "QueryCollectionRequestTracking")] public partial class QueryCollectionRequestTracking : IEquatable, IValidatableObject { + /// /// Gets or Sets Type /// @@ -40,20 +41,34 @@ public partial class QueryCollectionRequestTracking : IEquatable /// Initializes a new instance of the class. /// - /// type. + /// Custom values to be included in tracking data.. + /// Tracking field used to identify records in the collection. Must be unique schema field.. /// Query ID of the query. If this is empty, then one is generated.. /// Sequence number of query.. - /// Tracking field used to identify records in the collection. Must be unique schema field.. - /// Custom values to be included in tracking data.. - public QueryCollectionRequestTracking(QueryCollectionRequestTrackingType? type = default(QueryCollectionRequestTrackingType?), string queryId = default(string), int sequence = default(int), string field = default(string), Dictionary data = default(Dictionary)) + /// type. + public QueryCollectionRequestTracking(Dictionary data = default(Dictionary), string field = default(string), string queryId = default(string), int sequence = default(int), QueryCollectionRequestTrackingType? type = default(QueryCollectionRequestTrackingType?)) { - this.Type = type; + this.Data = data; + this.Field = field; this.QueryId = queryId; this.Sequence = sequence; - this.Field = field; - this.Data = data; + this.Type = type; } + /// + /// Custom values to be included in tracking data. + /// + /// Custom values to be included in tracking data. + [DataMember(Name = "data", EmitDefaultValue = false)] + public Dictionary Data { get; set; } + + /// + /// Tracking field used to identify records in the collection. Must be unique schema field. + /// + /// Tracking field used to identify records in the collection. Must be unique schema field. + [DataMember(Name = "field", EmitDefaultValue = false)] + public string Field { get; set; } + /// /// Query ID of the query. If this is empty, then one is generated. /// @@ -68,20 +83,6 @@ public partial class QueryCollectionRequestTracking : IEquatable - /// Tracking field used to identify records in the collection. Must be unique schema field. - /// - /// Tracking field used to identify records in the collection. Must be unique schema field. - [DataMember(Name = "field", EmitDefaultValue = false)] - public string Field { get; set; } - - /// - /// Custom values to be included in tracking data. - /// - /// Custom values to be included in tracking data. - [DataMember(Name = "data", EmitDefaultValue = false)] - public Dictionary Data { get; set; } - /// /// Returns the string presentation of the object /// @@ -90,11 +91,11 @@ public override string ToString() { var sb = new StringBuilder(); sb.Append("class QueryCollectionRequestTracking {\n"); - sb.Append(" Type: ").Append(Type).Append("\n"); + sb.Append(" Data: ").Append(Data).Append("\n"); + sb.Append(" Field: ").Append(Field).Append("\n"); sb.Append(" QueryId: ").Append(QueryId).Append("\n"); sb.Append(" Sequence: ").Append(Sequence).Append("\n"); - sb.Append(" Field: ").Append(Field).Append("\n"); - sb.Append(" Data: ").Append(Data).Append("\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -105,7 +106,7 @@ public override string ToString() /// JSON string presentation of the object public virtual string ToJson() { - return JsonConvert.SerializeObject(this, Formatting.Indented); + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } /// @@ -130,8 +131,15 @@ public bool Equals(QueryCollectionRequestTracking input) return ( - this.Type == input.Type || - this.Type.Equals(input.Type) + this.Data == input.Data || + this.Data != null && + input.Data != null && + this.Data.SequenceEqual(input.Data) + ) && + ( + this.Field == input.Field || + (this.Field != null && + this.Field.Equals(input.Field)) ) && ( this.QueryId == input.QueryId || @@ -143,15 +151,8 @@ public bool Equals(QueryCollectionRequestTracking input) this.Sequence.Equals(input.Sequence) ) && ( - this.Field == input.Field || - (this.Field != null && - this.Field.Equals(input.Field)) - ) && - ( - this.Data == input.Data || - this.Data != null && - input.Data != null && - this.Data.SequenceEqual(input.Data) + this.Type == input.Type || + this.Type.Equals(input.Type) ); } @@ -164,14 +165,14 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.Type.GetHashCode(); + if (this.Data != null) + hashCode = hashCode * 59 + this.Data.GetHashCode(); + if (this.Field != null) + hashCode = hashCode * 59 + this.Field.GetHashCode(); if (this.QueryId != null) hashCode = hashCode * 59 + this.QueryId.GetHashCode(); hashCode = hashCode * 59 + this.Sequence.GetHashCode(); - if (this.Field != null) - hashCode = hashCode * 59 + this.Field.GetHashCode(); - if (this.Data != null) - hashCode = hashCode * 59 + this.Data.GetHashCode(); + hashCode = hashCode * 59 + this.Type.GetHashCode(); return hashCode; } } @@ -181,7 +182,7 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + public IEnumerable Validate(ValidationContext validationContext) { yield break; } diff --git a/src/Com.Sajari.Sdk/Model/QueryCollectionRequestTrackingType.cs b/src/Com.Sajari.Sdk/Model/QueryCollectionRequestTrackingType.cs index 73ad451..2be4757 100644 --- a/src/Com.Sajari.Sdk/Model/QueryCollectionRequestTrackingType.cs +++ b/src/Com.Sajari.Sdk/Model/QueryCollectionRequestTrackingType.cs @@ -30,9 +30,7 @@ namespace Com.Sajari.Sdk.Model /// - TYPE_UNSPECIFIED: The default / unset value. The API defaults to `NONE` tracking. - NONE: No tracking. - CLICK: Click tracking. A click token will be generated for each result. Results which do not receive clicks will fall down rankings, and similarly low-ranked records which receive clicks will be moved up the rankings. - POS_NEG: Pos/neg tracking. Pos/neg tokens will be generated for each result. Each record in the result set can be marked with pos/neg value for the search. This is then fed back into the ranking algorithm to improve future results. Unlike `CLICK`, if no tokens are reported for records then no action is taken. /// /// - TYPE_UNSPECIFIED: The default / unset value. The API defaults to `NONE` tracking. - NONE: No tracking. - CLICK: Click tracking. A click token will be generated for each result. Results which do not receive clicks will fall down rankings, and similarly low-ranked records which receive clicks will be moved up the rankings. - POS_NEG: Pos/neg tracking. Pos/neg tokens will be generated for each result. Each record in the result set can be marked with pos/neg value for the search. This is then fed back into the ranking algorithm to improve future results. Unlike `CLICK`, if no tokens are reported for records then no action is taken. - [JsonConverter(typeof(StringEnumConverter))] - public enum QueryCollectionRequestTrackingType { /// diff --git a/src/Com.Sajari.Sdk/Model/QueryCollectionResponse.cs b/src/Com.Sajari.Sdk/Model/QueryCollectionResponse.cs index f83554d..683d47c 100644 --- a/src/Com.Sajari.Sdk/Model/QueryCollectionResponse.cs +++ b/src/Com.Sajari.Sdk/Model/QueryCollectionResponse.cs @@ -35,24 +35,38 @@ public partial class QueryCollectionResponse : IEquatable /// Initializes a new instance of the class. /// + /// The aggregates run with filters.. + /// The aggregates returned by the query.. /// pipeline. - /// The modified variables returned by the pipeline after it has finished processing.. + /// The total time taken to perform the query.. /// The results returned by the query.. /// The total number of results that match the query.. - /// The total time taken to perform the query.. - /// The aggregates returned by the query.. - /// The aggregates run with filters.. - public QueryCollectionResponse(QueryCollectionResponsePipeline pipeline = default(QueryCollectionResponsePipeline), Object variables = default(Object), List results = default(List), string totalSize = default(string), string processingDuration = default(string), Dictionary aggregates = default(Dictionary), Dictionary aggregateFilters = default(Dictionary)) + /// The modified variables returned by the pipeline after it has finished processing.. + public QueryCollectionResponse(Dictionary aggregateFilters = default(Dictionary), Dictionary aggregates = default(Dictionary), QueryCollectionResponsePipeline pipeline = default(QueryCollectionResponsePipeline), string processingDuration = default(string), List results = default(List), string totalSize = default(string), Dictionary variables = default(Dictionary)) { + this.AggregateFilters = aggregateFilters; + this.Aggregates = aggregates; this.Pipeline = pipeline; - this.Variables = variables; + this.ProcessingDuration = processingDuration; this.Results = results; this.TotalSize = totalSize; - this.ProcessingDuration = processingDuration; - this.Aggregates = aggregates; - this.AggregateFilters = aggregateFilters; + this.Variables = variables; } + /// + /// The aggregates run with filters. + /// + /// The aggregates run with filters. + [DataMember(Name = "aggregate_filters", EmitDefaultValue = false)] + public Dictionary AggregateFilters { get; set; } + + /// + /// The aggregates returned by the query. + /// + /// The aggregates returned by the query. + [DataMember(Name = "aggregates", EmitDefaultValue = false)] + public Dictionary Aggregates { get; set; } + /// /// Gets or Sets Pipeline /// @@ -60,11 +74,11 @@ public partial class QueryCollectionResponse : IEquatable - /// The modified variables returned by the pipeline after it has finished processing. + /// The total time taken to perform the query. /// - /// The modified variables returned by the pipeline after it has finished processing. - [DataMember(Name = "variables", EmitDefaultValue = false)] - public Object Variables { get; set; } + /// The total time taken to perform the query. + [DataMember(Name = "processing_duration", EmitDefaultValue = false)] + public string ProcessingDuration { get; set; } /// /// The results returned by the query. @@ -81,25 +95,11 @@ public partial class QueryCollectionResponse : IEquatable - /// The total time taken to perform the query. - /// - /// The total time taken to perform the query. - [DataMember(Name = "processing_duration", EmitDefaultValue = false)] - public string ProcessingDuration { get; set; } - - /// - /// The aggregates returned by the query. - /// - /// The aggregates returned by the query. - [DataMember(Name = "aggregates", EmitDefaultValue = false)] - public Dictionary Aggregates { get; set; } - - /// - /// The aggregates run with filters. + /// The modified variables returned by the pipeline after it has finished processing. /// - /// The aggregates run with filters. - [DataMember(Name = "aggregate_filters", EmitDefaultValue = false)] - public Dictionary AggregateFilters { get; set; } + /// The modified variables returned by the pipeline after it has finished processing. + [DataMember(Name = "variables", EmitDefaultValue = false)] + public Dictionary Variables { get; set; } /// /// Returns the string presentation of the object @@ -109,13 +109,13 @@ public override string ToString() { var sb = new StringBuilder(); sb.Append("class QueryCollectionResponse {\n"); + sb.Append(" AggregateFilters: ").Append(AggregateFilters).Append("\n"); + sb.Append(" Aggregates: ").Append(Aggregates).Append("\n"); sb.Append(" Pipeline: ").Append(Pipeline).Append("\n"); - sb.Append(" Variables: ").Append(Variables).Append("\n"); + sb.Append(" ProcessingDuration: ").Append(ProcessingDuration).Append("\n"); sb.Append(" Results: ").Append(Results).Append("\n"); sb.Append(" TotalSize: ").Append(TotalSize).Append("\n"); - sb.Append(" ProcessingDuration: ").Append(ProcessingDuration).Append("\n"); - sb.Append(" Aggregates: ").Append(Aggregates).Append("\n"); - sb.Append(" AggregateFilters: ").Append(AggregateFilters).Append("\n"); + sb.Append(" Variables: ").Append(Variables).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -126,7 +126,7 @@ public override string ToString() /// JSON string presentation of the object public virtual string ToJson() { - return JsonConvert.SerializeObject(this, Formatting.Indented); + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } /// @@ -150,15 +150,27 @@ public bool Equals(QueryCollectionResponse input) return false; return + ( + this.AggregateFilters == input.AggregateFilters || + this.AggregateFilters != null && + input.AggregateFilters != null && + this.AggregateFilters.SequenceEqual(input.AggregateFilters) + ) && + ( + this.Aggregates == input.Aggregates || + this.Aggregates != null && + input.Aggregates != null && + this.Aggregates.SequenceEqual(input.Aggregates) + ) && ( this.Pipeline == input.Pipeline || (this.Pipeline != null && this.Pipeline.Equals(input.Pipeline)) ) && ( - this.Variables == input.Variables || - (this.Variables != null && - this.Variables.Equals(input.Variables)) + this.ProcessingDuration == input.ProcessingDuration || + (this.ProcessingDuration != null && + this.ProcessingDuration.Equals(input.ProcessingDuration)) ) && ( this.Results == input.Results || @@ -172,21 +184,10 @@ public bool Equals(QueryCollectionResponse input) this.TotalSize.Equals(input.TotalSize)) ) && ( - this.ProcessingDuration == input.ProcessingDuration || - (this.ProcessingDuration != null && - this.ProcessingDuration.Equals(input.ProcessingDuration)) - ) && - ( - this.Aggregates == input.Aggregates || - this.Aggregates != null && - input.Aggregates != null && - this.Aggregates.SequenceEqual(input.Aggregates) - ) && - ( - this.AggregateFilters == input.AggregateFilters || - this.AggregateFilters != null && - input.AggregateFilters != null && - this.AggregateFilters.SequenceEqual(input.AggregateFilters) + this.Variables == input.Variables || + this.Variables != null && + input.Variables != null && + this.Variables.SequenceEqual(input.Variables) ); } @@ -199,20 +200,20 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; + if (this.AggregateFilters != null) + hashCode = hashCode * 59 + this.AggregateFilters.GetHashCode(); + if (this.Aggregates != null) + hashCode = hashCode * 59 + this.Aggregates.GetHashCode(); if (this.Pipeline != null) hashCode = hashCode * 59 + this.Pipeline.GetHashCode(); - if (this.Variables != null) - hashCode = hashCode * 59 + this.Variables.GetHashCode(); + if (this.ProcessingDuration != null) + hashCode = hashCode * 59 + this.ProcessingDuration.GetHashCode(); if (this.Results != null) hashCode = hashCode * 59 + this.Results.GetHashCode(); if (this.TotalSize != null) hashCode = hashCode * 59 + this.TotalSize.GetHashCode(); - if (this.ProcessingDuration != null) - hashCode = hashCode * 59 + this.ProcessingDuration.GetHashCode(); - if (this.Aggregates != null) - hashCode = hashCode * 59 + this.Aggregates.GetHashCode(); - if (this.AggregateFilters != null) - hashCode = hashCode * 59 + this.AggregateFilters.GetHashCode(); + if (this.Variables != null) + hashCode = hashCode * 59 + this.Variables.GetHashCode(); return hashCode; } } @@ -222,7 +223,7 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + public IEnumerable Validate(ValidationContext validationContext) { yield break; } diff --git a/src/Com.Sajari.Sdk/Model/QueryCollectionResponsePipeline.cs b/src/Com.Sajari.Sdk/Model/QueryCollectionResponsePipeline.cs index bbfa75d..22c21f9 100644 --- a/src/Com.Sajari.Sdk/Model/QueryCollectionResponsePipeline.cs +++ b/src/Com.Sajari.Sdk/Model/QueryCollectionResponsePipeline.cs @@ -40,7 +40,7 @@ public partial class QueryCollectionResponsePipeline : IEquatable @@ -55,7 +55,7 @@ public partial class QueryCollectionResponsePipeline : IEquatable /// The pipeline's version, e.g. `42`. [DataMember(Name = "version", EmitDefaultValue = false)] - public string Version { get; set; } + public string _Version { get; set; } /// /// Returns the string presentation of the object @@ -66,7 +66,7 @@ public override string ToString() var sb = new StringBuilder(); sb.Append("class QueryCollectionResponsePipeline {\n"); sb.Append(" Name: ").Append(Name).Append("\n"); - sb.Append(" Version: ").Append(Version).Append("\n"); + sb.Append(" _Version: ").Append(_Version).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -77,7 +77,7 @@ public override string ToString() /// JSON string presentation of the object public virtual string ToJson() { - return JsonConvert.SerializeObject(this, Formatting.Indented); + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } /// @@ -107,9 +107,9 @@ public bool Equals(QueryCollectionResponsePipeline input) this.Name.Equals(input.Name)) ) && ( - this.Version == input.Version || - (this.Version != null && - this.Version.Equals(input.Version)) + this._Version == input._Version || + (this._Version != null && + this._Version.Equals(input._Version)) ); } @@ -124,8 +124,8 @@ public override int GetHashCode() int hashCode = 41; if (this.Name != null) hashCode = hashCode * 59 + this.Name.GetHashCode(); - if (this.Version != null) - hashCode = hashCode * 59 + this.Version.GetHashCode(); + if (this._Version != null) + hashCode = hashCode * 59 + this._Version.GetHashCode(); return hashCode; } } @@ -135,7 +135,7 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + public IEnumerable Validate(ValidationContext validationContext) { yield break; } diff --git a/src/Com.Sajari.Sdk/Model/QueryResult.cs b/src/Com.Sajari.Sdk/Model/QueryResult.cs index ff7248a..6e4e4f3 100644 --- a/src/Com.Sajari.Sdk/Model/QueryResult.cs +++ b/src/Com.Sajari.Sdk/Model/QueryResult.cs @@ -35,18 +35,25 @@ public partial class QueryResult : IEquatable, IValidatableObject /// /// Initializes a new instance of the class. /// + /// Index score.. /// An object made up of field-value pairs that contains the record data.. /// The normalized score attributed to this record. Combines the index score and feature score.. - /// Index score.. /// token. - public QueryResult(Object record = default(Object), double score = default(double), double indexScore = default(double), QueryResultToken token = default(QueryResultToken)) + public QueryResult(double indexScore = default(double), Object record = default(Object), double score = default(double), QueryResultToken token = default(QueryResultToken)) { + this.IndexScore = indexScore; this.Record = record; this.Score = score; - this.IndexScore = indexScore; this.Token = token; } + /// + /// Index score. + /// + /// Index score. + [DataMember(Name = "index_score", EmitDefaultValue = false)] + public double IndexScore { get; set; } + /// /// An object made up of field-value pairs that contains the record data. /// @@ -61,13 +68,6 @@ public partial class QueryResult : IEquatable, IValidatableObject [DataMember(Name = "score", EmitDefaultValue = false)] public double Score { get; set; } - /// - /// Index score. - /// - /// Index score. - [DataMember(Name = "index_score", EmitDefaultValue = false)] - public double IndexScore { get; set; } - /// /// Gets or Sets Token /// @@ -82,9 +82,9 @@ public override string ToString() { var sb = new StringBuilder(); sb.Append("class QueryResult {\n"); + sb.Append(" IndexScore: ").Append(IndexScore).Append("\n"); sb.Append(" Record: ").Append(Record).Append("\n"); sb.Append(" Score: ").Append(Score).Append("\n"); - sb.Append(" IndexScore: ").Append(IndexScore).Append("\n"); sb.Append(" Token: ").Append(Token).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -96,7 +96,7 @@ public override string ToString() /// JSON string presentation of the object public virtual string ToJson() { - return JsonConvert.SerializeObject(this, Formatting.Indented); + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } /// @@ -120,6 +120,10 @@ public bool Equals(QueryResult input) return false; return + ( + this.IndexScore == input.IndexScore || + this.IndexScore.Equals(input.IndexScore) + ) && ( this.Record == input.Record || (this.Record != null && @@ -129,10 +133,6 @@ public bool Equals(QueryResult input) this.Score == input.Score || this.Score.Equals(input.Score) ) && - ( - this.IndexScore == input.IndexScore || - this.IndexScore.Equals(input.IndexScore) - ) && ( this.Token == input.Token || (this.Token != null && @@ -149,10 +149,10 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; + hashCode = hashCode * 59 + this.IndexScore.GetHashCode(); if (this.Record != null) hashCode = hashCode * 59 + this.Record.GetHashCode(); hashCode = hashCode * 59 + this.Score.GetHashCode(); - hashCode = hashCode * 59 + this.IndexScore.GetHashCode(); if (this.Token != null) hashCode = hashCode * 59 + this.Token.GetHashCode(); return hashCode; @@ -164,7 +164,7 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + public IEnumerable Validate(ValidationContext validationContext) { yield break; } diff --git a/src/Com.Sajari.Sdk/Model/QueryResultToken.cs b/src/Com.Sajari.Sdk/Model/QueryResultToken.cs index 314e2db..210c771 100644 --- a/src/Com.Sajari.Sdk/Model/QueryResultToken.cs +++ b/src/Com.Sajari.Sdk/Model/QueryResultToken.cs @@ -75,7 +75,7 @@ public override string ToString() /// JSON string presentation of the object public virtual string ToJson() { - return JsonConvert.SerializeObject(this, Formatting.Indented); + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } /// @@ -133,7 +133,7 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + public IEnumerable Validate(ValidationContext validationContext) { yield break; } diff --git a/src/Com.Sajari.Sdk/Model/QueryResultTokenClick.cs b/src/Com.Sajari.Sdk/Model/QueryResultTokenClick.cs index ed1200a..b4550f3 100644 --- a/src/Com.Sajari.Sdk/Model/QueryResultTokenClick.cs +++ b/src/Com.Sajari.Sdk/Model/QueryResultTokenClick.cs @@ -66,7 +66,7 @@ public override string ToString() /// JSON string presentation of the object public virtual string ToJson() { - return JsonConvert.SerializeObject(this, Formatting.Indented); + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } /// @@ -117,7 +117,7 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + public IEnumerable Validate(ValidationContext validationContext) { yield break; } diff --git a/src/Com.Sajari.Sdk/Model/QueryResultTokenPosNeg.cs b/src/Com.Sajari.Sdk/Model/QueryResultTokenPosNeg.cs index 9e75608..a5a069b 100644 --- a/src/Com.Sajari.Sdk/Model/QueryResultTokenPosNeg.cs +++ b/src/Com.Sajari.Sdk/Model/QueryResultTokenPosNeg.cs @@ -35,26 +35,26 @@ public partial class QueryResultTokenPosNeg : IEquatable /// /// Initializes a new instance of the class. /// - /// pos. /// neg. - public QueryResultTokenPosNeg(string pos = default(string), string neg = default(string)) + /// pos. + public QueryResultTokenPosNeg(string neg = default(string), string pos = default(string)) { - this.Pos = pos; this.Neg = neg; + this.Pos = pos; } - /// - /// Gets or Sets Pos - /// - [DataMember(Name = "pos", EmitDefaultValue = false)] - public string Pos { get; set; } - /// /// Gets or Sets Neg /// [DataMember(Name = "neg", EmitDefaultValue = false)] public string Neg { get; set; } + /// + /// Gets or Sets Pos + /// + [DataMember(Name = "pos", EmitDefaultValue = false)] + public string Pos { get; set; } + /// /// Returns the string presentation of the object /// @@ -63,8 +63,8 @@ public override string ToString() { var sb = new StringBuilder(); sb.Append("class QueryResultTokenPosNeg {\n"); - sb.Append(" Pos: ").Append(Pos).Append("\n"); sb.Append(" Neg: ").Append(Neg).Append("\n"); + sb.Append(" Pos: ").Append(Pos).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -75,7 +75,7 @@ public override string ToString() /// JSON string presentation of the object public virtual string ToJson() { - return JsonConvert.SerializeObject(this, Formatting.Indented); + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } /// @@ -99,15 +99,15 @@ public bool Equals(QueryResultTokenPosNeg input) return false; return - ( - this.Pos == input.Pos || - (this.Pos != null && - this.Pos.Equals(input.Pos)) - ) && ( this.Neg == input.Neg || (this.Neg != null && this.Neg.Equals(input.Neg)) + ) && + ( + this.Pos == input.Pos || + (this.Pos != null && + this.Pos.Equals(input.Pos)) ); } @@ -120,10 +120,10 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - if (this.Pos != null) - hashCode = hashCode * 59 + this.Pos.GetHashCode(); if (this.Neg != null) hashCode = hashCode * 59 + this.Neg.GetHashCode(); + if (this.Pos != null) + hashCode = hashCode * 59 + this.Pos.GetHashCode(); return hashCode; } } @@ -133,7 +133,7 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + public IEnumerable Validate(ValidationContext validationContext) { yield break; } diff --git a/src/Com.Sajari.Sdk/Model/RecordKey.cs b/src/Com.Sajari.Sdk/Model/RecordKey.cs index aa9adc3..6813be0 100644 --- a/src/Com.Sajari.Sdk/Model/RecordKey.cs +++ b/src/Com.Sajari.Sdk/Model/RecordKey.cs @@ -45,9 +45,15 @@ protected RecordKey() { } public RecordKey(string field = default(string), string value = default(string)) { // to ensure "field" is required (not null) - this.Field = field ?? throw new ArgumentNullException("field is a required property for RecordKey and cannot be null"); + if (field == null) { + throw new ArgumentNullException("field is a required property for RecordKey and cannot be null"); + } + this.Field = field; // to ensure "value" is required (not null) - this.Value = value ?? throw new ArgumentNullException("value is a required property for RecordKey and cannot be null"); + if (value == null) { + throw new ArgumentNullException("value is a required property for RecordKey and cannot be null"); + } + this.Value = value; } /// @@ -84,7 +90,7 @@ public override string ToString() /// JSON string presentation of the object public virtual string ToJson() { - return JsonConvert.SerializeObject(this, Formatting.Indented); + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } /// @@ -142,7 +148,7 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + public IEnumerable Validate(ValidationContext validationContext) { yield break; } diff --git a/src/Com.Sajari.Sdk/Model/SchemaField.cs b/src/Com.Sajari.Sdk/Model/SchemaField.cs index 2216350..2630436 100644 --- a/src/Com.Sajari.Sdk/Model/SchemaField.cs +++ b/src/Com.Sajari.Sdk/Model/SchemaField.cs @@ -32,16 +32,18 @@ namespace Com.Sajari.Sdk.Model [DataContract(Name = "SchemaField")] public partial class SchemaField : IEquatable, IValidatableObject { - /// - /// Gets or Sets Type - /// - [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = false)] - public SchemaFieldType Type { get; set; } + /// /// Gets or Sets Mode /// [DataMember(Name = "mode", IsRequired = true, EmitDefaultValue = false)] public SchemaFieldMode Mode { get; set; } + + /// + /// Gets or Sets Type + /// + [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = false)] + public SchemaFieldType Type { get; set; } /// /// Initializes a new instance of the class. /// @@ -50,42 +52,31 @@ protected SchemaField() { } /// /// Initializes a new instance of the class. /// - /// The name of the field. (required). - /// The description of the field.. - /// type (required). - /// mode (required). /// Array indicates if the field is an array of values. For example, if `type` is string and `array` is `true`, then the field is an array of strings.. /// The required length of the array, if `array` is `true`. This allows you to enforce that an array contains an exact number of items. For example, to store a 2x2 vector, you could set `type` to float, `array` to `true` and `array_length` to `4`.. - public SchemaField(string name = default(string), string description = default(string), SchemaFieldType type = default(SchemaFieldType), SchemaFieldMode mode = default(SchemaFieldMode), bool array = default(bool), int arrayLength = default(int)) + /// The description of the field.. + /// mode (required). + /// The name of the field. (required). + /// type (required). + public SchemaField(bool array = default(bool), int arrayLength = default(int), string description = default(string), SchemaFieldMode mode = default(SchemaFieldMode), string name = default(string), SchemaFieldType type = default(SchemaFieldType)) { + this.Mode = mode; // to ensure "name" is required (not null) - this.Name = name ?? throw new ArgumentNullException("name is a required property for SchemaField and cannot be null"); + if (name == null) { + throw new ArgumentNullException("name is a required property for SchemaField and cannot be null"); + } + this.Name = name; this.Type = type; - this.Mode = mode; - this.Description = description; this.Array = array; this.ArrayLength = arrayLength; + this.Description = description; } - /// - /// The name of the field. - /// - /// The name of the field. - [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = false)] - public string Name { get; set; } - - /// - /// The description of the field. - /// - /// The description of the field. - [DataMember(Name = "description", EmitDefaultValue = false)] - public string Description { get; set; } - /// /// Array indicates if the field is an array of values. For example, if `type` is string and `array` is `true`, then the field is an array of strings. /// /// Array indicates if the field is an array of values. For example, if `type` is string and `array` is `true`, then the field is an array of strings. - [DataMember(Name = "array", EmitDefaultValue = false)] + [DataMember(Name = "array", EmitDefaultValue = true)] public bool Array { get; set; } /// @@ -95,6 +86,20 @@ protected SchemaField() { } [DataMember(Name = "array_length", EmitDefaultValue = false)] public int ArrayLength { get; set; } + /// + /// The description of the field. + /// + /// The description of the field. + [DataMember(Name = "description", EmitDefaultValue = false)] + public string Description { get; set; } + + /// + /// The name of the field. + /// + /// The name of the field. + [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = false)] + public string Name { get; set; } + /// /// Returns the string presentation of the object /// @@ -103,12 +108,12 @@ public override string ToString() { var sb = new StringBuilder(); sb.Append("class SchemaField {\n"); - sb.Append(" Name: ").Append(Name).Append("\n"); - sb.Append(" Description: ").Append(Description).Append("\n"); - sb.Append(" Type: ").Append(Type).Append("\n"); - sb.Append(" Mode: ").Append(Mode).Append("\n"); sb.Append(" Array: ").Append(Array).Append("\n"); sb.Append(" ArrayLength: ").Append(ArrayLength).Append("\n"); + sb.Append(" Description: ").Append(Description).Append("\n"); + sb.Append(" Mode: ").Append(Mode).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -119,7 +124,7 @@ public override string ToString() /// JSON string presentation of the object public virtual string ToJson() { - return JsonConvert.SerializeObject(this, Formatting.Indented); + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } /// @@ -144,30 +149,30 @@ public bool Equals(SchemaField input) return ( - this.Name == input.Name || - (this.Name != null && - this.Name.Equals(input.Name)) + this.Array == input.Array || + this.Array.Equals(input.Array) + ) && + ( + this.ArrayLength == input.ArrayLength || + this.ArrayLength.Equals(input.ArrayLength) ) && ( this.Description == input.Description || (this.Description != null && this.Description.Equals(input.Description)) ) && - ( - this.Type == input.Type || - this.Type.Equals(input.Type) - ) && ( this.Mode == input.Mode || this.Mode.Equals(input.Mode) ) && ( - this.Array == input.Array || - this.Array.Equals(input.Array) + this.Name == input.Name || + (this.Name != null && + this.Name.Equals(input.Name)) ) && ( - this.ArrayLength == input.ArrayLength || - this.ArrayLength.Equals(input.ArrayLength) + this.Type == input.Type || + this.Type.Equals(input.Type) ); } @@ -180,14 +185,14 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - if (this.Name != null) - hashCode = hashCode * 59 + this.Name.GetHashCode(); + hashCode = hashCode * 59 + this.Array.GetHashCode(); + hashCode = hashCode * 59 + this.ArrayLength.GetHashCode(); if (this.Description != null) hashCode = hashCode * 59 + this.Description.GetHashCode(); - hashCode = hashCode * 59 + this.Type.GetHashCode(); hashCode = hashCode * 59 + this.Mode.GetHashCode(); - hashCode = hashCode * 59 + this.Array.GetHashCode(); - hashCode = hashCode * 59 + this.ArrayLength.GetHashCode(); + if (this.Name != null) + hashCode = hashCode * 59 + this.Name.GetHashCode(); + hashCode = hashCode * 59 + this.Type.GetHashCode(); return hashCode; } } @@ -197,7 +202,7 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + public IEnumerable Validate(ValidationContext validationContext) { yield break; } diff --git a/src/Com.Sajari.Sdk/Model/SchemaFieldMode.cs b/src/Com.Sajari.Sdk/Model/SchemaFieldMode.cs index 887db26..536b535 100644 --- a/src/Com.Sajari.Sdk/Model/SchemaFieldMode.cs +++ b/src/Com.Sajari.Sdk/Model/SchemaFieldMode.cs @@ -30,9 +30,7 @@ namespace Com.Sajari.Sdk.Model /// Mode is an enumeration of modes for a field. - MODE_UNSPECIFIED: Mode not specified. - NULLABLE: Nullable fields do not need to be specified. - REQUIRED: Required fields must be specified and cannot be null. - UNIQUE: Unique fields must be specified and must be unique. /// /// Mode is an enumeration of modes for a field. - MODE_UNSPECIFIED: Mode not specified. - NULLABLE: Nullable fields do not need to be specified. - REQUIRED: Required fields must be specified and cannot be null. - UNIQUE: Unique fields must be specified and must be unique. - [JsonConverter(typeof(StringEnumConverter))] - public enum SchemaFieldMode { /// diff --git a/src/Com.Sajari.Sdk/Model/SchemaFieldType.cs b/src/Com.Sajari.Sdk/Model/SchemaFieldType.cs index 54bad46..378e67a 100644 --- a/src/Com.Sajari.Sdk/Model/SchemaFieldType.cs +++ b/src/Com.Sajari.Sdk/Model/SchemaFieldType.cs @@ -30,9 +30,7 @@ namespace Com.Sajari.Sdk.Model /// Type represents the underlying data type of the field. - TYPE_UNSPECIFIED: Type not specified. - STRING: String values. - INTEGER: Integer values (64-bit). - FLOAT: Floating point values (32-bit). - DOUBLE: Double floating point values (64-bit). - BOOLEAN: Boolean values. - TIMESTAMP: Timestamp values. /// /// Type represents the underlying data type of the field. - TYPE_UNSPECIFIED: Type not specified. - STRING: String values. - INTEGER: Integer values (64-bit). - FLOAT: Floating point values (32-bit). - DOUBLE: Double floating point values (64-bit). - BOOLEAN: Boolean values. - TIMESTAMP: Timestamp values. - [JsonConverter(typeof(StringEnumConverter))] - public enum SchemaFieldType { /// diff --git a/src/Com.Sajari.Sdk/Model/SendEventRequest.cs b/src/Com.Sajari.Sdk/Model/SendEventRequest.cs index 0368d8a..e7b94cd 100644 --- a/src/Com.Sajari.Sdk/Model/SendEventRequest.cs +++ b/src/Com.Sajari.Sdk/Model/SendEventRequest.cs @@ -40,20 +40,33 @@ protected SendEventRequest() { } /// /// Initializes a new instance of the class. /// + /// 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. /// The name of event, e.g. `click`, `purchase`. (required). /// The token corresponding to the search result that was interacted with, e.g. `eyJ...`. (required). /// 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.. - /// 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. - public SendEventRequest(string name = default(string), string token = default(string), int weight = default(int), Dictionary metadata = default(Dictionary)) + public SendEventRequest(Dictionary metadata = default(Dictionary), string name = default(string), string token = default(string), int weight = default(int)) { // to ensure "name" is required (not null) - this.Name = name ?? throw new ArgumentNullException("name is a required property for SendEventRequest and cannot be null"); + if (name == null) { + throw new ArgumentNullException("name is a required property for SendEventRequest and cannot be null"); + } + this.Name = name; // to ensure "token" is required (not null) - this.Token = token ?? throw new ArgumentNullException("token is a required property for SendEventRequest and cannot be null"); - this.Weight = weight; + if (token == null) { + throw new ArgumentNullException("token is a required property for SendEventRequest and cannot be null"); + } + this.Token = token; this.Metadata = metadata; + this.Weight = weight; } + /// + /// 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 + /// + /// 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 + [DataMember(Name = "metadata", EmitDefaultValue = false)] + public Dictionary Metadata { get; set; } + /// /// The name of event, e.g. `click`, `purchase`. /// @@ -75,13 +88,6 @@ protected SendEventRequest() { } [DataMember(Name = "weight", EmitDefaultValue = false)] public int Weight { get; set; } - /// - /// 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 - /// - /// 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 - [DataMember(Name = "metadata", EmitDefaultValue = false)] - public Dictionary Metadata { get; set; } - /// /// Returns the string presentation of the object /// @@ -90,10 +96,10 @@ public override string ToString() { var sb = new StringBuilder(); sb.Append("class SendEventRequest {\n"); + sb.Append(" Metadata: ").Append(Metadata).Append("\n"); sb.Append(" Name: ").Append(Name).Append("\n"); sb.Append(" Token: ").Append(Token).Append("\n"); sb.Append(" Weight: ").Append(Weight).Append("\n"); - sb.Append(" Metadata: ").Append(Metadata).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -104,7 +110,7 @@ public override string ToString() /// JSON string presentation of the object public virtual string ToJson() { - return JsonConvert.SerializeObject(this, Formatting.Indented); + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } /// @@ -128,6 +134,12 @@ public bool Equals(SendEventRequest input) return false; return + ( + this.Metadata == input.Metadata || + this.Metadata != null && + input.Metadata != null && + this.Metadata.SequenceEqual(input.Metadata) + ) && ( this.Name == input.Name || (this.Name != null && @@ -141,12 +153,6 @@ public bool Equals(SendEventRequest input) ( this.Weight == input.Weight || this.Weight.Equals(input.Weight) - ) && - ( - this.Metadata == input.Metadata || - this.Metadata != null && - input.Metadata != null && - this.Metadata.SequenceEqual(input.Metadata) ); } @@ -159,13 +165,13 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; + if (this.Metadata != null) + hashCode = hashCode * 59 + this.Metadata.GetHashCode(); if (this.Name != null) hashCode = hashCode * 59 + this.Name.GetHashCode(); if (this.Token != null) hashCode = hashCode * 59 + this.Token.GetHashCode(); hashCode = hashCode * 59 + this.Weight.GetHashCode(); - if (this.Metadata != null) - hashCode = hashCode * 59 + this.Metadata.GetHashCode(); return hashCode; } } @@ -175,7 +181,7 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + public IEnumerable Validate(ValidationContext validationContext) { yield break; } diff --git a/src/Com.Sajari.Sdk/Model/SetDefaultPipelineRequest.cs b/src/Com.Sajari.Sdk/Model/SetDefaultPipelineRequest.cs index a348c94..04f8808 100644 --- a/src/Com.Sajari.Sdk/Model/SetDefaultPipelineRequest.cs +++ b/src/Com.Sajari.Sdk/Model/SetDefaultPipelineRequest.cs @@ -32,6 +32,7 @@ namespace Com.Sajari.Sdk.Model [DataContract(Name = "SetDefaultPipelineRequest")] public partial class SetDefaultPipelineRequest : IEquatable, IValidatableObject { + /// /// Gets or Sets Type /// @@ -45,13 +46,16 @@ protected SetDefaultPipelineRequest() { } /// /// Initializes a new instance of the class. /// - /// type (required). /// The name of the pipeline to use when not otherwise specified. (required). - public SetDefaultPipelineRequest(PipelineType type = default(PipelineType), string pipeline = default(string)) + /// type (required). + public SetDefaultPipelineRequest(string pipeline = default(string), PipelineType type = default(PipelineType)) { - this.Type = type; // to ensure "pipeline" is required (not null) - this.Pipeline = pipeline ?? throw new ArgumentNullException("pipeline is a required property for SetDefaultPipelineRequest and cannot be null"); + if (pipeline == null) { + throw new ArgumentNullException("pipeline is a required property for SetDefaultPipelineRequest and cannot be null"); + } + this.Pipeline = pipeline; + this.Type = type; } /// @@ -69,8 +73,8 @@ public override string ToString() { var sb = new StringBuilder(); sb.Append("class SetDefaultPipelineRequest {\n"); - sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append(" Pipeline: ").Append(Pipeline).Append("\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -81,7 +85,7 @@ public override string ToString() /// JSON string presentation of the object public virtual string ToJson() { - return JsonConvert.SerializeObject(this, Formatting.Indented); + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } /// @@ -105,14 +109,14 @@ public bool Equals(SetDefaultPipelineRequest input) return false; return - ( - this.Type == input.Type || - this.Type.Equals(input.Type) - ) && ( this.Pipeline == input.Pipeline || (this.Pipeline != null && this.Pipeline.Equals(input.Pipeline)) + ) && + ( + this.Type == input.Type || + this.Type.Equals(input.Type) ); } @@ -125,9 +129,9 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - hashCode = hashCode * 59 + this.Type.GetHashCode(); if (this.Pipeline != null) hashCode = hashCode * 59 + this.Pipeline.GetHashCode(); + hashCode = hashCode * 59 + this.Type.GetHashCode(); return hashCode; } } @@ -137,7 +141,7 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + public IEnumerable Validate(ValidationContext validationContext) { yield break; } diff --git a/src/Com.Sajari.Sdk/Model/SetDefaultVersionRequest.cs b/src/Com.Sajari.Sdk/Model/SetDefaultVersionRequest.cs index 8f568fe..7c54dae 100644 --- a/src/Com.Sajari.Sdk/Model/SetDefaultVersionRequest.cs +++ b/src/Com.Sajari.Sdk/Model/SetDefaultVersionRequest.cs @@ -44,7 +44,10 @@ protected SetDefaultVersionRequest() { } public SetDefaultVersionRequest(string version = default(string)) { // to ensure "version" is required (not null) - this.Version = version ?? throw new ArgumentNullException("version is a required property for SetDefaultVersionRequest and cannot be null"); + if (version == null) { + throw new ArgumentNullException("version is a required property for SetDefaultVersionRequest and cannot be null"); + } + this._Version = version; } /// @@ -52,7 +55,7 @@ protected SetDefaultVersionRequest() { } /// /// The version to use as a default for this pipeline, e.g. `42`. [DataMember(Name = "version", IsRequired = true, EmitDefaultValue = false)] - public string Version { get; set; } + public string _Version { get; set; } /// /// Returns the string presentation of the object @@ -62,7 +65,7 @@ public override string ToString() { var sb = new StringBuilder(); sb.Append("class SetDefaultVersionRequest {\n"); - sb.Append(" Version: ").Append(Version).Append("\n"); + sb.Append(" _Version: ").Append(_Version).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -73,7 +76,7 @@ public override string ToString() /// JSON string presentation of the object public virtual string ToJson() { - return JsonConvert.SerializeObject(this, Formatting.Indented); + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } /// @@ -98,9 +101,9 @@ public bool Equals(SetDefaultVersionRequest input) return ( - this.Version == input.Version || - (this.Version != null && - this.Version.Equals(input.Version)) + this._Version == input._Version || + (this._Version != null && + this._Version.Equals(input._Version)) ); } @@ -113,8 +116,8 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - if (this.Version != null) - hashCode = hashCode * 59 + this.Version.GetHashCode(); + if (this._Version != null) + hashCode = hashCode * 59 + this._Version.GetHashCode(); return hashCode; } } @@ -124,7 +127,7 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + public IEnumerable Validate(ValidationContext validationContext) { yield break; } diff --git a/src/Com.Sajari.Sdk/Model/Status.cs b/src/Com.Sajari.Sdk/Model/Status.cs index d8693cf..a949edd 100644 --- a/src/Com.Sajari.Sdk/Model/Status.cs +++ b/src/Com.Sajari.Sdk/Model/Status.cs @@ -36,13 +36,13 @@ public partial class Status : IEquatable, IValidatableObject /// Initializes a new instance of the class. /// /// The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].. - /// A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.. /// A list of messages that carry the error details. There is a common set of message types for APIs to use.. - public Status(int code = default(int), string message = default(string), List details = default(List)) + /// A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.. + public Status(int code = default(int), List details = default(List), string message = default(string)) { this.Code = code; - this.Message = message; this.Details = details; + this.Message = message; } /// @@ -52,13 +52,6 @@ public partial class Status : IEquatable, IValidatableObject [DataMember(Name = "code", EmitDefaultValue = false)] public int Code { get; set; } - /// - /// A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. - /// - /// A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. - [DataMember(Name = "message", EmitDefaultValue = false)] - public string Message { get; set; } - /// /// A list of messages that carry the error details. There is a common set of message types for APIs to use. /// @@ -66,6 +59,13 @@ public partial class Status : IEquatable, IValidatableObject [DataMember(Name = "details", EmitDefaultValue = false)] public List Details { get; set; } + /// + /// A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + /// + /// A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + [DataMember(Name = "message", EmitDefaultValue = false)] + public string Message { get; set; } + /// /// Returns the string presentation of the object /// @@ -75,8 +75,8 @@ public override string ToString() var sb = new StringBuilder(); sb.Append("class Status {\n"); sb.Append(" Code: ").Append(Code).Append("\n"); - sb.Append(" Message: ").Append(Message).Append("\n"); sb.Append(" Details: ").Append(Details).Append("\n"); + sb.Append(" Message: ").Append(Message).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -87,7 +87,7 @@ public override string ToString() /// JSON string presentation of the object public virtual string ToJson() { - return JsonConvert.SerializeObject(this, Formatting.Indented); + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } /// @@ -115,16 +115,16 @@ public bool Equals(Status input) this.Code == input.Code || this.Code.Equals(input.Code) ) && - ( - this.Message == input.Message || - (this.Message != null && - this.Message.Equals(input.Message)) - ) && ( this.Details == input.Details || this.Details != null && input.Details != null && this.Details.SequenceEqual(input.Details) + ) && + ( + this.Message == input.Message || + (this.Message != null && + this.Message.Equals(input.Message)) ); } @@ -138,10 +138,10 @@ public override int GetHashCode() { int hashCode = 41; hashCode = hashCode * 59 + this.Code.GetHashCode(); - if (this.Message != null) - hashCode = hashCode * 59 + this.Message.GetHashCode(); if (this.Details != null) hashCode = hashCode * 59 + this.Details.GetHashCode(); + if (this.Message != null) + hashCode = hashCode * 59 + this.Message.GetHashCode(); return hashCode; } } @@ -151,7 +151,7 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + public IEnumerable Validate(ValidationContext validationContext) { yield break; } diff --git a/src/Com.Sajari.Sdk/Model/UpdateRecordRequest.cs b/src/Com.Sajari.Sdk/Model/UpdateRecordRequest.cs new file mode 100644 index 0000000..2e48db3 --- /dev/null +++ b/src/Com.Sajari.Sdk/Model/UpdateRecordRequest.cs @@ -0,0 +1,178 @@ +/* + * Sajari API + * + * Sajari is a smart, highly-configurable, real-time search service that enables thousands of businesses worldwide to provide amazing search experiences on their websites, stores, and applications. + * + * The version of the OpenAPI document: v4 + * Contact: support@sajari.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Com.Sajari.Sdk.Client.OpenAPIDateConverter; + +namespace Com.Sajari.Sdk.Model +{ + /// + /// UpdateRecordRequest + /// + [DataContract(Name = "UpdateRecordRequest")] + public partial class UpdateRecordRequest : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected UpdateRecordRequest() { } + /// + /// Initializes a new instance of the class. + /// + /// key (required). + /// The record to update. (required). + /// The list of fields to be updated, separated by a comma, e.g. `field1,field2`. For each field that you want to update, provide a corresponding value in the record object containing the new value. (required). + public UpdateRecordRequest(RecordKey key = default(RecordKey), Dictionary record = default(Dictionary), string updateMask = default(string)) + { + // to ensure "key" is required (not null) + if (key == null) { + throw new ArgumentNullException("key is a required property for UpdateRecordRequest and cannot be null"); + } + this.Key = key; + // to ensure "record" is required (not null) + if (record == null) { + throw new ArgumentNullException("record is a required property for UpdateRecordRequest and cannot be null"); + } + this.Record = record; + // to ensure "updateMask" is required (not null) + if (updateMask == null) { + throw new ArgumentNullException("updateMask is a required property for UpdateRecordRequest and cannot be null"); + } + this.UpdateMask = updateMask; + } + + /// + /// Gets or Sets Key + /// + [DataMember(Name = "key", IsRequired = true, EmitDefaultValue = false)] + public RecordKey Key { get; set; } + + /// + /// The record to update. + /// + /// The record to update. + [DataMember(Name = "record", IsRequired = true, EmitDefaultValue = false)] + public Dictionary Record { get; set; } + + /// + /// The list of fields to be updated, separated by a comma, e.g. `field1,field2`. For each field that you want to update, provide a corresponding value in the record object containing the new value. + /// + /// The list of fields to be updated, separated by a comma, e.g. `field1,field2`. For each field that you want to update, provide a corresponding value in the record object containing the new value. + [DataMember(Name = "update_mask", IsRequired = true, EmitDefaultValue = false)] + public string UpdateMask { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class UpdateRecordRequest {\n"); + sb.Append(" Key: ").Append(Key).Append("\n"); + sb.Append(" Record: ").Append(Record).Append("\n"); + sb.Append(" UpdateMask: ").Append(UpdateMask).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as UpdateRecordRequest); + } + + /// + /// Returns true if UpdateRecordRequest instances are equal + /// + /// Instance of UpdateRecordRequest to be compared + /// Boolean + public bool Equals(UpdateRecordRequest input) + { + if (input == null) + return false; + + return + ( + this.Key == input.Key || + (this.Key != null && + this.Key.Equals(input.Key)) + ) && + ( + this.Record == input.Record || + this.Record != null && + input.Record != null && + this.Record.SequenceEqual(input.Record) + ) && + ( + this.UpdateMask == input.UpdateMask || + (this.UpdateMask != null && + this.UpdateMask.Equals(input.UpdateMask)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Key != null) + hashCode = hashCode * 59 + this.Key.GetHashCode(); + if (this.Record != null) + hashCode = hashCode * 59 + this.Record.GetHashCode(); + if (this.UpdateMask != null) + hashCode = hashCode * 59 + this.UpdateMask.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/src/Com.Sajari.Sdk/Model/UpsertRecordRequest.cs b/src/Com.Sajari.Sdk/Model/UpsertRecordRequest.cs index 0b5e645..6e47c18 100644 --- a/src/Com.Sajari.Sdk/Model/UpsertRecordRequest.cs +++ b/src/Com.Sajari.Sdk/Model/UpsertRecordRequest.cs @@ -43,10 +43,13 @@ protected UpsertRecordRequest() { } /// pipeline. /// An object made up of field-value pairs that contains the record data. (required). /// The initial values for the variables the pipeline operates on and transforms throughout its steps.. - public UpsertRecordRequest(UpsertRecordRequestPipeline pipeline = default(UpsertRecordRequestPipeline), Object record = default(Object), Object variables = default(Object)) + public UpsertRecordRequest(UpsertRecordRequestPipeline pipeline = default(UpsertRecordRequestPipeline), Object record = default(Object), Dictionary variables = default(Dictionary)) { // to ensure "record" is required (not null) - this.Record = record ?? throw new ArgumentNullException("record is a required property for UpsertRecordRequest and cannot be null"); + if (record == null) { + throw new ArgumentNullException("record is a required property for UpsertRecordRequest and cannot be null"); + } + this.Record = record; this.Pipeline = pipeline; this.Variables = variables; } @@ -69,7 +72,7 @@ protected UpsertRecordRequest() { } /// /// The initial values for the variables the pipeline operates on and transforms throughout its steps. [DataMember(Name = "variables", EmitDefaultValue = false)] - public Object Variables { get; set; } + public Dictionary Variables { get; set; } /// /// Returns the string presentation of the object @@ -92,7 +95,7 @@ public override string ToString() /// JSON string presentation of the object public virtual string ToJson() { - return JsonConvert.SerializeObject(this, Formatting.Indented); + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } /// @@ -128,8 +131,9 @@ public bool Equals(UpsertRecordRequest input) ) && ( this.Variables == input.Variables || - (this.Variables != null && - this.Variables.Equals(input.Variables)) + this.Variables != null && + input.Variables != null && + this.Variables.SequenceEqual(input.Variables) ); } @@ -157,7 +161,7 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + public IEnumerable Validate(ValidationContext validationContext) { yield break; } diff --git a/src/Com.Sajari.Sdk/Model/UpsertRecordRequestPipeline.cs b/src/Com.Sajari.Sdk/Model/UpsertRecordRequestPipeline.cs index 82e94f9..6cce73c 100644 --- a/src/Com.Sajari.Sdk/Model/UpsertRecordRequestPipeline.cs +++ b/src/Com.Sajari.Sdk/Model/UpsertRecordRequestPipeline.cs @@ -45,8 +45,11 @@ protected UpsertRecordRequestPipeline() { } public UpsertRecordRequestPipeline(string name = default(string), string version = default(string)) { // to ensure "name" is required (not null) - this.Name = name ?? throw new ArgumentNullException("name is a required property for UpsertRecordRequestPipeline and cannot be null"); - this.Version = version; + if (name == null) { + throw new ArgumentNullException("name is a required property for UpsertRecordRequestPipeline and cannot be null"); + } + this.Name = name; + this._Version = version; } /// @@ -61,7 +64,7 @@ protected UpsertRecordRequestPipeline() { } /// /// The record pipeline's version, e.g. `42`. If not provided the default version is used. [DataMember(Name = "version", EmitDefaultValue = false)] - public string Version { get; set; } + public string _Version { get; set; } /// /// Returns the string presentation of the object @@ -72,7 +75,7 @@ public override string ToString() var sb = new StringBuilder(); sb.Append("class UpsertRecordRequestPipeline {\n"); sb.Append(" Name: ").Append(Name).Append("\n"); - sb.Append(" Version: ").Append(Version).Append("\n"); + sb.Append(" _Version: ").Append(_Version).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -83,7 +86,7 @@ public override string ToString() /// JSON string presentation of the object public virtual string ToJson() { - return JsonConvert.SerializeObject(this, Formatting.Indented); + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } /// @@ -113,9 +116,9 @@ public bool Equals(UpsertRecordRequestPipeline input) this.Name.Equals(input.Name)) ) && ( - this.Version == input.Version || - (this.Version != null && - this.Version.Equals(input.Version)) + this._Version == input._Version || + (this._Version != null && + this._Version.Equals(input._Version)) ); } @@ -130,8 +133,8 @@ public override int GetHashCode() int hashCode = 41; if (this.Name != null) hashCode = hashCode * 59 + this.Name.GetHashCode(); - if (this.Version != null) - hashCode = hashCode * 59 + this.Version.GetHashCode(); + if (this._Version != null) + hashCode = hashCode * 59 + this._Version.GetHashCode(); return hashCode; } } @@ -141,7 +144,7 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + public IEnumerable Validate(ValidationContext validationContext) { yield break; } diff --git a/src/Com.Sajari.Sdk/Model/UpsertRecordResponse.cs b/src/Com.Sajari.Sdk/Model/UpsertRecordResponse.cs index 8986fd7..754313b 100644 --- a/src/Com.Sajari.Sdk/Model/UpsertRecordResponse.cs +++ b/src/Com.Sajari.Sdk/Model/UpsertRecordResponse.cs @@ -37,7 +37,7 @@ public partial class UpsertRecordResponse : IEquatable, IV /// /// key. /// The modified variables returned by the pipeline after it has finished processing.. - public UpsertRecordResponse(RecordKey key = default(RecordKey), Object variables = default(Object)) + public UpsertRecordResponse(RecordKey key = default(RecordKey), Dictionary variables = default(Dictionary)) { this.Key = key; this.Variables = variables; @@ -54,7 +54,7 @@ public partial class UpsertRecordResponse : IEquatable, IV /// /// The modified variables returned by the pipeline after it has finished processing. [DataMember(Name = "variables", EmitDefaultValue = false)] - public Object Variables { get; set; } + public Dictionary Variables { get; set; } /// /// Returns the string presentation of the object @@ -76,7 +76,7 @@ public override string ToString() /// JSON string presentation of the object public virtual string ToJson() { - return JsonConvert.SerializeObject(this, Formatting.Indented); + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } /// @@ -107,8 +107,9 @@ public bool Equals(UpsertRecordResponse input) ) && ( this.Variables == input.Variables || - (this.Variables != null && - this.Variables.Equals(input.Variables)) + this.Variables != null && + input.Variables != null && + this.Variables.SequenceEqual(input.Variables) ); } @@ -134,7 +135,7 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + public IEnumerable Validate(ValidationContext validationContext) { yield break; }