Skip to content

Commit a21be53

Browse files
feat(specs): add authentications to ingestion transformations (generated)
algolia/api-clients-automation#3494 Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Clément Vannicatte <[email protected]>
1 parent 673f039 commit a21be53

File tree

4 files changed

+112
-11
lines changed

4 files changed

+112
-11
lines changed

lib/algolia/api/ingestion_client.rb

Lines changed: 68 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2877,7 +2877,7 @@ def trigger_docker_source_discover(source_id, request_options = {})
28772877
@api_client.deserialize(response.body, request_options[:debug_return_type] || "Ingestion::SourceWatchResponse")
28782878
end
28792879

2880-
# Try a transformation.
2880+
# Try a transformation before creating it.
28812881
#
28822882
# Required API Key ACLs:
28832883
# - addObject
@@ -2911,7 +2911,7 @@ def try_transformation_with_http_info(transformation_try, request_options = {})
29112911
@api_client.call_api(:POST, path, new_options)
29122912
end
29132913

2914-
# Try a transformation.
2914+
# Try a transformation before creating it.
29152915
#
29162916
# Required API Key ACLs:
29172917
# - addObject
@@ -2928,6 +2928,72 @@ def try_transformation(transformation_try, request_options = {})
29282928
)
29292929
end
29302930

2931+
# Try a transformation before updating it.
2932+
#
2933+
# Required API Key ACLs:
2934+
# - addObject
2935+
# - deleteIndex
2936+
# - editSettings
2937+
# @param transformation_id [String] Unique identifier of a transformation. (required)
2938+
# @param transformation_try [TransformationTry] (required)
2939+
# @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
2940+
# @return [Http::Response] the response
2941+
def try_transformation_before_update_with_http_info(transformation_id, transformation_try, request_options = {})
2942+
# verify the required parameter 'transformation_id' is set
2943+
if @api_client.config.client_side_validation && transformation_id.nil?
2944+
raise(
2945+
ArgumentError,
2946+
"Parameter `transformation_id` is required when calling `try_transformation_before_update`."
2947+
)
2948+
end
2949+
# verify the required parameter 'transformation_try' is set
2950+
if @api_client.config.client_side_validation && transformation_try.nil?
2951+
raise(
2952+
ArgumentError,
2953+
"Parameter `transformation_try` is required when calling `try_transformation_before_update`."
2954+
)
2955+
end
2956+
2957+
path = "/1/transformations/{transformationID}/try".sub(
2958+
"{" + "transformationID" + "}",
2959+
Transport.encode_uri(transformation_id.to_s)
2960+
)
2961+
query_params = {}
2962+
query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
2963+
header_params = {}
2964+
header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
2965+
2966+
post_body = request_options[:debug_body] || @api_client.object_to_http_body(transformation_try)
2967+
2968+
new_options = request_options.merge(
2969+
:operation => :"IngestionClient.try_transformation_before_update",
2970+
:header_params => header_params,
2971+
:query_params => query_params,
2972+
:body => post_body,
2973+
:use_read_transporter => false
2974+
)
2975+
2976+
@api_client.call_api(:POST, path, new_options)
2977+
end
2978+
2979+
# Try a transformation before updating it.
2980+
#
2981+
# Required API Key ACLs:
2982+
# - addObject
2983+
# - deleteIndex
2984+
# - editSettings
2985+
# @param transformation_id [String] Unique identifier of a transformation. (required)
2986+
# @param transformation_try [TransformationTry] (required)
2987+
# @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
2988+
# @return [TransformationTryResponse]
2989+
def try_transformation_before_update(transformation_id, transformation_try, request_options = {})
2990+
response = try_transformation_before_update_with_http_info(transformation_id, transformation_try, request_options)
2991+
@api_client.deserialize(
2992+
response.body,
2993+
request_options[:debug_return_type] || "Ingestion::TransformationTryResponse"
2994+
)
2995+
end
2996+
29312997
# Updates an authentication resource.
29322998
#
29332999
# Required API Key ACLs:

lib/algolia/models/ingestion/transformation.rb

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ class Transformation
99
# Universally unique identifier (UUID) of a transformation.
1010
attr_accessor :transformation_id
1111

12+
# The authentications associated for the current transformation.
13+
attr_accessor :authentication_ids
14+
1215
# The source code of the transformation.
1316
attr_accessor :code
1417

@@ -28,6 +31,7 @@ class Transformation
2831
def self.attribute_map
2932
{
3033
:transformation_id => :transformationID,
34+
:authentication_ids => :authenticationIDs,
3135
:code => :code,
3236
:name => :name,
3337
:description => :description,
@@ -45,6 +49,7 @@ def self.acceptable_attributes
4549
def self.types_mapping
4650
{
4751
:transformation_id => :"String",
52+
:authentication_ids => :"Array<String>",
4853
:code => :"String",
4954
:name => :"String",
5055
:description => :"String",
@@ -89,6 +94,12 @@ def initialize(attributes = {})
8994
self.transformation_id = nil
9095
end
9196

97+
if attributes.key?(:authentication_ids)
98+
if (value = attributes[:authentication_ids]).is_a?(Array)
99+
self.authentication_ids = value
100+
end
101+
end
102+
92103
if attributes.key?(:code)
93104
self.code = attributes[:code]
94105
else
@@ -122,6 +133,7 @@ def ==(other)
122133
return true if self.equal?(other)
123134
self.class == other.class &&
124135
transformation_id == other.transformation_id &&
136+
authentication_ids == other.authentication_ids &&
125137
code == other.code &&
126138
name == other.name &&
127139
description == other.description &&
@@ -138,7 +150,7 @@ def eql?(other)
138150
# Calculates hash code according to all attributes.
139151
# @return [Integer] Hash code
140152
def hash
141-
[transformation_id, code, name, description, created_at, updated_at].hash
153+
[transformation_id, authentication_ids, code, name, description, created_at, updated_at].hash
142154
end
143155

144156
# Builds the object from hash

lib/algolia/models/ingestion/transformation_create.rb

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,16 @@ class TransformationCreate
1616
# A descriptive name for your transformation of what it does.
1717
attr_accessor :description
1818

19+
# The authentications associated for the current transformation.
20+
attr_accessor :authentication_ids
21+
1922
# Attribute mapping from ruby-style variable name to JSON key.
2023
def self.attribute_map
2124
{
2225
:code => :code,
2326
:name => :name,
24-
:description => :description
27+
:description => :description,
28+
:authentication_ids => :authenticationIDs
2529
}
2630
end
2731

@@ -35,7 +39,8 @@ def self.types_mapping
3539
{
3640
:code => :"String",
3741
:name => :"String",
38-
:description => :"String"
42+
:description => :"String",
43+
:authentication_ids => :"Array<String>"
3944
}
4045
end
4146

@@ -84,6 +89,12 @@ def initialize(attributes = {})
8489
if attributes.key?(:description)
8590
self.description = attributes[:description]
8691
end
92+
93+
if attributes.key?(:authentication_ids)
94+
if (value = attributes[:authentication_ids]).is_a?(Array)
95+
self.authentication_ids = value
96+
end
97+
end
8798
end
8899

89100
# Checks equality by comparing each attribute.
@@ -93,7 +104,8 @@ def ==(other)
93104
self.class == other.class &&
94105
code == other.code &&
95106
name == other.name &&
96-
description == other.description
107+
description == other.description &&
108+
authentication_ids == other.authentication_ids
97109
end
98110

99111
# @see the `==` method
@@ -105,7 +117,7 @@ def eql?(other)
105117
# Calculates hash code according to all attributes.
106118
# @return [Integer] Hash code
107119
def hash
108-
[code, name, description].hash
120+
[code, name, description, authentication_ids].hash
109121
end
110122

111123
# Builds the object from hash

lib/algolia/models/ingestion/transformation_try.rb

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,14 @@ class TransformationTry
1212
# The record to apply the given code to.
1313
attr_accessor :sample_record
1414

15+
attr_accessor :authentications
16+
1517
# Attribute mapping from ruby-style variable name to JSON key.
1618
def self.attribute_map
1719
{
1820
:code => :code,
19-
:sample_record => :sampleRecord
21+
:sample_record => :sampleRecord,
22+
:authentications => :authentications
2023
}
2124
end
2225

@@ -29,7 +32,8 @@ def self.acceptable_attributes
2932
def self.types_mapping
3033
{
3134
:code => :"String",
32-
:sample_record => :"Object"
35+
:sample_record => :"Object",
36+
:authentications => :"Array<AuthenticationCreate>"
3337
}
3438
end
3539

@@ -74,6 +78,12 @@ def initialize(attributes = {})
7478
else
7579
self.sample_record = nil
7680
end
81+
82+
if attributes.key?(:authentications)
83+
if (value = attributes[:authentications]).is_a?(Array)
84+
self.authentications = value
85+
end
86+
end
7787
end
7888

7989
# Checks equality by comparing each attribute.
@@ -82,7 +92,8 @@ def ==(other)
8292
return true if self.equal?(other)
8393
self.class == other.class &&
8494
code == other.code &&
85-
sample_record == other.sample_record
95+
sample_record == other.sample_record &&
96+
authentications == other.authentications
8697
end
8798

8899
# @see the `==` method
@@ -94,7 +105,7 @@ def eql?(other)
94105
# Calculates hash code according to all attributes.
95106
# @return [Integer] Hash code
96107
def hash
97-
[code, sample_record].hash
108+
[code, sample_record, authentications].hash
98109
end
99110

100111
# Builds the object from hash

0 commit comments

Comments
 (0)