Skip to content

Commit c85e578

Browse files
authored
Merge branch 'main' into feat/DI-1832/chunkedbatch-php
2 parents 0e55195 + 18e8248 commit c85e578

File tree

116 files changed

+3543
-721
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

116 files changed

+3543
-721
lines changed

.github/.cache_version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.0.18
1+
1.0.19

clients/algoliasearch-client-csharp/algoliasearch/Models/Common/SecuredApiKeyRestriction.cs

Lines changed: 0 additions & 38 deletions
This file was deleted.

clients/algoliasearch-client-csharp/algoliasearch/Models/Common/SecuredApiKeyRestrictionHelper.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
using Algolia.Search.Http;
55
using Algolia.Search.Utils;
66

7-
namespace Algolia.Search.Models.Common;
7+
namespace Algolia.Search.Models.Search;
88

99
/// <summary>
1010
/// Secured Api Key restrictions
1111
/// </summary>
12-
public partial class SecuredApiKeyRestriction
12+
public partial class SecuredAPIKeyRestrictions
1313
{
1414

1515
/// <summary>
@@ -19,12 +19,12 @@ public partial class SecuredApiKeyRestriction
1919
public string ToQueryString()
2020
{
2121
string restrictionQuery = null;
22-
if (Query != null)
22+
if (SearchParams != null)
2323
{
24-
restrictionQuery = ToQueryString(Query);
24+
restrictionQuery = ToQueryString(SearchParams);
2525
}
2626

27-
var restrictions = ToQueryString(this, nameof(Query));
27+
var restrictions = ToQueryString(this, nameof(SearchParams));
2828
var array = new[] { restrictionQuery, restrictions };
2929

3030
return string.Join("&", array.Where(s => !string.IsNullOrEmpty(s)));
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
//
2+
// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
3+
//
4+
using System;
5+
using System.Text;
6+
using System.Linq;
7+
using System.Text.Json.Serialization;
8+
using System.Collections.Generic;
9+
using Algolia.Search.Serializer;
10+
using System.Text.Json;
11+
12+
namespace Algolia.Search.Models.Search;
13+
14+
/// <summary>
15+
/// Defines apiKeyOperation
16+
/// </summary>
17+
public enum ApiKeyOperation
18+
{
19+
/// <summary>
20+
/// Enum Add for value: add
21+
/// </summary>
22+
[JsonPropertyName("add")]
23+
Add = 1,
24+
25+
/// <summary>
26+
/// Enum Delete for value: delete
27+
/// </summary>
28+
[JsonPropertyName("delete")]
29+
Delete = 2,
30+
31+
/// <summary>
32+
/// Enum Update for value: update
33+
/// </summary>
34+
[JsonPropertyName("update")]
35+
Update = 3
36+
}
37+
Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
//
2+
// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
3+
//
4+
using System;
5+
using System.Text;
6+
using System.Linq;
7+
using System.Text.Json.Serialization;
8+
using System.Collections.Generic;
9+
using Algolia.Search.Serializer;
10+
using System.Text.Json;
11+
12+
namespace Algolia.Search.Models.Search;
13+
14+
/// <summary>
15+
/// SecuredAPIKeyRestrictions
16+
/// </summary>
17+
public partial class SecuredAPIKeyRestrictions
18+
{
19+
/// <summary>
20+
/// Initializes a new instance of the SecuredAPIKeyRestrictions class.
21+
/// </summary>
22+
public SecuredAPIKeyRestrictions()
23+
{
24+
}
25+
26+
/// <summary>
27+
/// Gets or Sets SearchParams
28+
/// </summary>
29+
[JsonPropertyName("searchParams")]
30+
public SearchParamsObject SearchParams { get; set; }
31+
32+
/// <summary>
33+
/// Filters that apply to every search made with the secured API key. You can add extra filters at search time with the filters query parameter. For example, if you set the filter group:admin on your generated API key, and you add groups:press OR groups:visitors with the filters query parameter, your final search filter is equivalent to groups:admin AND (groups:press OR groups:visitors).
34+
/// </summary>
35+
/// <value>Filters that apply to every search made with the secured API key. You can add extra filters at search time with the filters query parameter. For example, if you set the filter group:admin on your generated API key, and you add groups:press OR groups:visitors with the filters query parameter, your final search filter is equivalent to groups:admin AND (groups:press OR groups:visitors). </value>
36+
[JsonPropertyName("filters")]
37+
public string Filters { get; set; }
38+
39+
/// <summary>
40+
/// Unix timestamp used to set the expiration date of the API key.
41+
/// </summary>
42+
/// <value>Unix timestamp used to set the expiration date of the API key.</value>
43+
[JsonPropertyName("validUntil")]
44+
public decimal? ValidUntil { get; set; }
45+
46+
/// <summary>
47+
/// Index names that can be queried.
48+
/// </summary>
49+
/// <value>Index names that can be queried.</value>
50+
[JsonPropertyName("restrictIndices")]
51+
public List<string> RestrictIndices { get; set; }
52+
53+
/// <summary>
54+
/// IPv4 network allowed to use the generated key. Use this to protect against API key leaking and reuse. You can only provide a single source, but you can specify a range of IPs (for example, 192.168.1.0/24).
55+
/// </summary>
56+
/// <value>IPv4 network allowed to use the generated key. Use this to protect against API key leaking and reuse. You can only provide a single source, but you can specify a range of IPs (for example, 192.168.1.0/24). </value>
57+
[JsonPropertyName("restrictSources")]
58+
public string RestrictSources { get; set; }
59+
60+
/// <summary>
61+
/// Unique user IP address. This can be useful when you want to impose a rate limit on specific users. By default, rate limits are set based on the IP address. This can become an issue when several users search from the same IP address. To avoid this, you can set a unique userToken for each user when generating their API key. This lets you restrict each user to a maximum number of API calls per hour, even if they share their IP with another user. Specifying the userToken in a secured API key is also a good security practice as it ensures users don't change it. Many features like Analytics, Personalization, and Dynamic Re-ranking rely on the authenticity of user identifiers. Setting the userToken at the API key level ensures that downstream services work as expected and prevents abuse.
62+
/// </summary>
63+
/// <value>Unique user IP address. This can be useful when you want to impose a rate limit on specific users. By default, rate limits are set based on the IP address. This can become an issue when several users search from the same IP address. To avoid this, you can set a unique userToken for each user when generating their API key. This lets you restrict each user to a maximum number of API calls per hour, even if they share their IP with another user. Specifying the userToken in a secured API key is also a good security practice as it ensures users don't change it. Many features like Analytics, Personalization, and Dynamic Re-ranking rely on the authenticity of user identifiers. Setting the userToken at the API key level ensures that downstream services work as expected and prevents abuse. </value>
64+
[JsonPropertyName("userToken")]
65+
public string UserToken { get; set; }
66+
67+
/// <summary>
68+
/// Returns the string presentation of the object
69+
/// </summary>
70+
/// <returns>String presentation of the object</returns>
71+
public override string ToString()
72+
{
73+
StringBuilder sb = new StringBuilder();
74+
sb.Append("class SecuredAPIKeyRestrictions {\n");
75+
sb.Append(" SearchParams: ").Append(SearchParams).Append("\n");
76+
sb.Append(" Filters: ").Append(Filters).Append("\n");
77+
sb.Append(" ValidUntil: ").Append(ValidUntil).Append("\n");
78+
sb.Append(" RestrictIndices: ").Append(RestrictIndices).Append("\n");
79+
sb.Append(" RestrictSources: ").Append(RestrictSources).Append("\n");
80+
sb.Append(" UserToken: ").Append(UserToken).Append("\n");
81+
sb.Append("}\n");
82+
return sb.ToString();
83+
}
84+
85+
/// <summary>
86+
/// Returns the JSON string presentation of the object
87+
/// </summary>
88+
/// <returns>JSON string presentation of the object</returns>
89+
public virtual string ToJson()
90+
{
91+
return JsonSerializer.Serialize(this, JsonConfig.Options);
92+
}
93+
94+
/// <summary>
95+
/// Returns true if objects are equal
96+
/// </summary>
97+
/// <param name="obj">Object to be compared</param>
98+
/// <returns>Boolean</returns>
99+
public override bool Equals(object obj)
100+
{
101+
if (obj is not SecuredAPIKeyRestrictions input)
102+
{
103+
return false;
104+
}
105+
106+
return
107+
(SearchParams == input.SearchParams || (SearchParams != null && SearchParams.Equals(input.SearchParams))) &&
108+
(Filters == input.Filters || (Filters != null && Filters.Equals(input.Filters))) &&
109+
(ValidUntil == input.ValidUntil || ValidUntil.Equals(input.ValidUntil)) &&
110+
(RestrictIndices == input.RestrictIndices || RestrictIndices != null && input.RestrictIndices != null && RestrictIndices.SequenceEqual(input.RestrictIndices)) &&
111+
(RestrictSources == input.RestrictSources || (RestrictSources != null && RestrictSources.Equals(input.RestrictSources))) &&
112+
(UserToken == input.UserToken || (UserToken != null && UserToken.Equals(input.UserToken)));
113+
}
114+
115+
/// <summary>
116+
/// Gets the hash code
117+
/// </summary>
118+
/// <returns>Hash code</returns>
119+
public override int GetHashCode()
120+
{
121+
unchecked // Overflow is fine, just wrap
122+
{
123+
int hashCode = 41;
124+
if (SearchParams != null)
125+
{
126+
hashCode = (hashCode * 59) + SearchParams.GetHashCode();
127+
}
128+
if (Filters != null)
129+
{
130+
hashCode = (hashCode * 59) + Filters.GetHashCode();
131+
}
132+
hashCode = (hashCode * 59) + ValidUntil.GetHashCode();
133+
if (RestrictIndices != null)
134+
{
135+
hashCode = (hashCode * 59) + RestrictIndices.GetHashCode();
136+
}
137+
if (RestrictSources != null)
138+
{
139+
hashCode = (hashCode * 59) + RestrictSources.GetHashCode();
140+
}
141+
if (UserToken != null)
142+
{
143+
hashCode = (hashCode * 59) + UserToken.GetHashCode();
144+
}
145+
return hashCode;
146+
}
147+
}
148+
149+
}
150+

clients/algoliasearch-client-csharp/algoliasearch/Utils/ApiKeyOperation.cs

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)