Class: NewStoreApi::SegmentationController
- Inherits:
-
BaseController
- Object
- BaseController
- NewStoreApi::SegmentationController
- Defined in:
- lib/new_store_api/controllers/segmentation_controller.rb
Overview
SegmentationController
Constant Summary
Constants inherited from BaseController
Instance Attribute Summary
Attributes inherited from BaseController
Instance Method Summary collapse
-
#create_import(body) ⇒ ImportResponse
🚧 BETA: This endpoint is in beta and may change.
- #create_presigned_url(body) ⇒ PresignedUrlResponse
🚧 BETA: This endpoint is in beta and may change.- #create_segmentation_tags_operations(tag_id, body, operation: OperationEnum::ASSIGN) ⇒ void
🚧 BETA: This endpoint is in beta and may change.- #create_tag(body) ⇒ TagResponse
🚧 BETA: This endpoint is in beta and may change.- #destroy_import(import_id) ⇒ void
🚧 BETA: This endpoint is in beta and may change.- #destroy_tag(tag_id) ⇒ void
🚧 BETA: This endpoint is in beta and may change.- #list_import_tags(import_id, limit: 10, offset: 0, order_by: nil, desc: false) ⇒ ListImportTags
🚧 BETA: This endpoint is in beta and may change.- #list_imports ⇒ ListImportsResponse
🚧 BETA: This endpoint is in beta and may change.- #list_profile_tags(profile_id, limit: 10, offset: 0, order_by: OrderBy1Enum::UPDATED_AT) ⇒ ListTagsResponse
Returns a list of segmentation tags associated to the given
profile_id.- #list_tag_profiles(tag_id, limit: 10, offset: 0) ⇒ ListTagProfilesResponse
🚧 BETA: This endpoint is in beta and may change.- #list_tags(limit: 10, offset: 0, order_by: OrderBy1Enum::UPDATED_AT, store_id: nil, is_import_enabled: nil) ⇒ ListTagsResponse
🚧 BETA: This endpoint is in beta and may change.- #show_import(import_id) ⇒ ImportResponse
🚧 BETA: This endpoint is in beta and may change.- #show_tag(tag_id) ⇒ TagResponse
🚧 BETA: This endpoint is in beta and may change.- #update_import(import_id, body) ⇒ ImportResponse
🚧 BETA: This endpoint is in beta and may change.- #update_tag(tag_id, body) ⇒ TagResponse
🚧 BETA: This endpoint is in beta and may change.Methods inherited from BaseController
#initialize, #new_parameter, #new_request_builder, #new_response_handler, user_agent
Constructor Details
This class inherits a constructor from NewStoreApi::BaseController
Instance Method Details
#create_import(body) ⇒ ImportResponse
🚧 BETA: This endpoint is in beta and may change.Creates a new segmentation import from an S3 URI CSV. description here
See API Lifecycle Documentation for details.46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
# File 'lib/new_store_api/controllers/segmentation_controller.rb', line 46 def create_import(body) @api_call .request(new_request_builder(HttpMethodEnum::POST, '/customer/imports', Server::API) .header_param(new_parameter('application/json', key: 'Content-Type')) .body_param(new_parameter(body)) .header_param(new_parameter('application/json', key: 'accept')) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('oauth'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(ImportResponse.method(:from_hash))) .execute end
#create_presigned_url(body) ⇒ PresignedUrlResponse
🚧 BETA: This endpoint is in beta and may change.Generates a presigned URL that will allow the upload of a CSV file to be used in an import. description here
See API Lifecycle Documentation for details.207 208 209 210 211 212 213 214 215 216 217 218 219 220 221
# File 'lib/new_store_api/controllers/segmentation_controller.rb', line 207 def create_presigned_url(body) @api_call .request(new_request_builder(HttpMethodEnum::POST, '/customer/imports/presigned-urls', Server::API) .header_param(new_parameter('application/json', key: 'Content-Type')) .body_param(new_parameter(body)) .header_param(new_parameter('application/json', key: 'accept')) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('oauth'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(PresignedUrlResponse.method(:from_hash))) .execute end
#create_segmentation_tags_operations(tag_id, body, operation: OperationEnum::ASSIGN) ⇒ void
This method returns an undefined value.
🚧 BETA: This endpoint is in beta and may change.There are two possible operations: - **assign** - Assigns the tag with `tag_id` to the provided list of profiles. - **unassign** - Unassigns a list of profiles from the tag with `tag_id`. description here operation that will be performed. By default it's **assign**.
See API Lifecycle Documentation for details.466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483
# File 'lib/new_store_api/controllers/segmentation_controller.rb', line 466 def (tag_id, body, operation: OperationEnum::ASSIGN) @api_call .request(new_request_builder(HttpMethodEnum::POST, '/customer/tags/{tag_id}/profiles', Server::API) .template_param(new_parameter(tag_id, key: 'tag_id') .should_encode(true)) .header_param(new_parameter('application/json', key: 'Content-Type')) .body_param(new_parameter(body)) .query_param(new_parameter(operation, key: 'operation')) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('oauth'))) .response(new_response_handler .is_response_void(true)) .execute end
#create_tag(body) ⇒ TagResponse
🚧 BETA: This endpoint is in beta and may change.Creates a new segmentation tag. here
See API Lifecycle Documentation for details.309 310 311 312 313 314 315 316 317 318 319 320 321 322 323
# File 'lib/new_store_api/controllers/segmentation_controller.rb', line 309 def create_tag(body) @api_call .request(new_request_builder(HttpMethodEnum::POST, '/customer/tags', Server::API) .header_param(new_parameter('application/json', key: 'Content-Type')) .body_param(new_parameter(body)) .header_param(new_parameter('application/json', key: 'accept')) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('oauth'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(TagResponse.method(:from_hash))) .execute end
#destroy_import(import_id) ⇒ void
This method returns an undefined value.
🚧 BETA: This endpoint is in beta and may change.Deletes the segmentation import and all associated tags for the given `import_id`. here
See API Lifecycle Documentation for details.76 77 78 79 80 81 82 83 84 85 86 87
# File 'lib/new_store_api/controllers/segmentation_controller.rb', line 76 def destroy_import(import_id) @api_call .request(new_request_builder(HttpMethodEnum::DELETE, '/customer/imports/{import_id}', Server::API) .template_param(new_parameter(import_id, key: 'import_id') .should_encode(true)) .auth(Single.new('oauth'))) .response(new_response_handler .is_response_void(true)) .execute end
#destroy_tag(tag_id) ⇒ void
This method returns an undefined value.
🚧 BETA: This endpoint is in beta and may change.Deletes data entry for the given `tag_id`.
See API Lifecycle Documentation for details.337 338 339 340 341 342 343 344 345 346 347 348
# File 'lib/new_store_api/controllers/segmentation_controller.rb', line 337 def destroy_tag(tag_id) @api_call .request(new_request_builder(HttpMethodEnum::DELETE, '/customer/tags/{tag_id}', Server::API) .template_param(new_parameter(tag_id, key: 'tag_id') .should_encode(true)) .auth(Single.new('oauth'))) .response(new_response_handler .is_response_void(true)) .execute end
#list_import_tags(import_id, limit: 10, offset: 0, order_by: nil, desc: false) ⇒ ListImportTags
🚧 BETA: This endpoint is in beta and may change.Lists tags for a given import here the results. the ordering.
See API Lifecycle Documentation for details.170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191
# File 'lib/new_store_api/controllers/segmentation_controller.rb', line 170 def (import_id, limit: 10, offset: 0, order_by: nil, desc: false) @api_call .request(new_request_builder(HttpMethodEnum::GET, '/customer/imports/{import_id}/tags', Server::API) .template_param(new_parameter(import_id, key: 'import_id') .should_encode(true)) .query_param(new_parameter(limit, key: 'limit')) .query_param(new_parameter(offset, key: 'offset')) .query_param(new_parameter(order_by, key: 'order_by')) .query_param(new_parameter(desc, key: 'desc')) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('oauth'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(ListImportTags.method(:from_hash))) .execute end
#list_imports ⇒ ListImportsResponse
🚧 BETA: This endpoint is in beta and may change.Returns a list of segmentation imports.
See API Lifecycle Documentation for details.20 21 22 23 24 25 26 27 28 29 30 31
# File 'lib/new_store_api/controllers/segmentation_controller.rb', line 20 def list_imports @api_call .request(new_request_builder(HttpMethodEnum::GET, '/customer/imports', Server::API) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('oauth'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(ListImportsResponse.method(:from_hash))) .execute end
#list_profile_tags(profile_id, limit: 10, offset: 0, order_by: OrderBy1Enum::UPDATED_AT) ⇒ ListTagsResponse
Returns a list of segmentation tags associated to the given
profile_id. customer profiles. offset. the results. Ascending order will be applied for the field provided.232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251
# File 'lib/new_store_api/controllers/segmentation_controller.rb', line 232 def (profile_id, limit: 10, offset: 0, order_by: OrderBy1Enum::UPDATED_AT) @api_call .request(new_request_builder(HttpMethodEnum::GET, '/customer/profiles/{profile_id}/tags', Server::API) .template_param(new_parameter(profile_id, key: 'profile_id') .should_encode(true)) .query_param(new_parameter(limit, key: 'limit')) .query_param(new_parameter(offset, key: 'offset')) .query_param(new_parameter(order_by, key: 'order_by')) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('oauth'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(ListTagsResponse.method(:from_hash))) .execute end
#list_tag_profiles(tag_id, limit: 10, offset: 0) ⇒ ListTagProfilesResponse
🚧 BETA: This endpoint is in beta and may change.Returns a list of profiles associated to the given `tag_id`. here customer profiles. offset.
See API Lifecycle Documentation for details.427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444
# File 'lib/new_store_api/controllers/segmentation_controller.rb', line 427 def list_tag_profiles(tag_id, limit: 10, offset: 0) @api_call .request(new_request_builder(HttpMethodEnum::GET, '/customer/tags/{tag_id}/profiles', Server::API) .template_param(new_parameter(tag_id, key: 'tag_id') .should_encode(true)) .query_param(new_parameter(limit, key: 'limit')) .query_param(new_parameter(offset, key: 'offset')) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('oauth'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(ListTagProfilesResponse.method(:from_hash))) .execute end
#list_tags(limit: 10, offset: 0, order_by: OrderBy1Enum::UPDATED_AT, store_id: nil, is_import_enabled: nil) ⇒ ListTagsResponse
🚧 BETA: This endpoint is in beta and may change.Returns a list of segmentation tags. the results. Ascending order will be applied for the field provided. the store ID. The response will return only store specific tags. that have associated imports that are enabled for a store. A store_id must be provided. The offset and limit fields must not be present. The entire data is returned.
See API Lifecycle Documentation for details.274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294
# File 'lib/new_store_api/controllers/segmentation_controller.rb', line 274 def (limit: 10, offset: 0, order_by: OrderBy1Enum::UPDATED_AT, store_id: nil, is_import_enabled: nil) @api_call .request(new_request_builder(HttpMethodEnum::GET, '/customer/tags', Server::API) .query_param(new_parameter(limit, key: 'limit')) .query_param(new_parameter(offset, key: 'offset')) .query_param(new_parameter(order_by, key: 'order_by')) .query_param(new_parameter(store_id, key: 'store_id')) .query_param(new_parameter(is_import_enabled, key: 'is_import_enabled')) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('oauth'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(ListTagsResponse.method(:from_hash))) .execute end
#show_import(import_id) ⇒ ImportResponse
🚧 BETA: This endpoint is in beta and may change.Returns a single segmentation import for the given `import_id`. here
See API Lifecycle Documentation for details.102 103 104 105 106 107 108 109 110 111 112 113 114 115
# File 'lib/new_store_api/controllers/segmentation_controller.rb', line 102 def show_import(import_id) @api_call .request(new_request_builder(HttpMethodEnum::GET, '/customer/imports/{import_id}', Server::API) .template_param(new_parameter(import_id, key: 'import_id') .should_encode(true)) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('oauth'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(ImportResponse.method(:from_hash))) .execute end
#show_tag(tag_id) ⇒ TagResponse
🚧 BETA: This endpoint is in beta and may change.Returns a single segmentation tag for the given customer `tag_id`.
See API Lifecycle Documentation for details.362 363 364 365 366 367 368 369 370 371 372 373 374 375
# File 'lib/new_store_api/controllers/segmentation_controller.rb', line 362 def show_tag(tag_id) @api_call .request(new_request_builder(HttpMethodEnum::GET, '/customer/tags/{tag_id}', Server::API) .template_param(new_parameter(tag_id, key: 'tag_id') .should_encode(true)) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('oauth'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(TagResponse.method(:from_hash))) .execute end
#update_import(import_id, body) ⇒ ImportResponse
🚧 BETA: This endpoint is in beta and may change.Updates an existing segmentation import. here description here
See API Lifecycle Documentation for details.132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149
# File 'lib/new_store_api/controllers/segmentation_controller.rb', line 132 def update_import(import_id, body) @api_call .request(new_request_builder(HttpMethodEnum::PATCH, '/customer/imports/{import_id}', Server::API) .template_param(new_parameter(import_id, key: 'import_id') .should_encode(true)) .header_param(new_parameter('application/json', key: 'Content-Type')) .body_param(new_parameter(body)) .header_param(new_parameter('application/json', key: 'accept')) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('oauth'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(ImportResponse.method(:from_hash))) .execute end
#update_tag(tag_id, body) ⇒ TagResponse
🚧 BETA: This endpoint is in beta and may change.Updates an existing segmentation tag for the given `tag_id`. here
See API Lifecycle Documentation for details.391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408
# File 'lib/new_store_api/controllers/segmentation_controller.rb', line 391 def update_tag(tag_id, body) @api_call .request(new_request_builder(HttpMethodEnum::PATCH, '/customer/tags/{tag_id}', Server::API) .template_param(new_parameter(tag_id, key: 'tag_id') .should_encode(true)) .header_param(new_parameter('application/json', key: 'Content-Type')) .body_param(new_parameter(body)) .header_param(new_parameter('application/json', key: 'accept')) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('oauth'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(TagResponse.method(:from_hash))) .execute end
- #create_presigned_url(body) ⇒ PresignedUrlResponse