docs/ValidationRulesApi.md in voucherify-5.0.0 vs docs/ValidationRulesApi.md in voucherify-6.0.0
- old
+ new
@@ -2,20 +2,85 @@
All URIs are relative to *https://api.voucherify.io*
| Method | HTTP request | Description |
| ------ | ------------ | ----------- |
+| [**create_validation_rule_assignment**](ValidationRulesApi.md#create_validation_rule_assignment) | **POST** /v1/validation-rules/{validationRuleId}/assignments | Create Validation Rules Assignments |
| [**create_validation_rules**](ValidationRulesApi.md#create_validation_rules) | **POST** /v1/validation-rules | Create Validation Rules |
| [**delete_validation_rule_assignment**](ValidationRulesApi.md#delete_validation_rule_assignment) | **DELETE** /v1/validation-rules/{validationRuleId}/assignments/{assignmentId} | Delete Validation Rule Assignment |
| [**delete_validation_rules**](ValidationRulesApi.md#delete_validation_rules) | **DELETE** /v1/validation-rules/{validationRuleId} | Delete Validation Rule |
| [**get_validation_rule**](ValidationRulesApi.md#get_validation_rule) | **GET** /v1/validation-rules/{validationRuleId} | Get Validation Rule |
| [**list_validation_rule_assignments**](ValidationRulesApi.md#list_validation_rule_assignments) | **GET** /v1/validation-rules/{validationRuleId}/assignments | List Validation Rule Assignments |
| [**list_validation_rules**](ValidationRulesApi.md#list_validation_rules) | **GET** /v1/validation-rules | List Validation Rules |
| [**list_validation_rules_assignments**](ValidationRulesApi.md#list_validation_rules_assignments) | **GET** /v1/validation-rules-assignments | List Validation Rules' Assignment(s) |
| [**update_validation_rule**](ValidationRulesApi.md#update_validation_rule) | **PUT** /v1/validation-rules/{validationRuleId} | Update Validation Rule |
+## create_validation_rule_assignment
+
+> <ValidationRulesAssignmentsCreateResponseBody> create_validation_rule_assignment(validation_rule_id, opts)
+
+Create Validation Rules Assignments
+
+Assign validation rule to either one of the following objects: voucher, campaign, promotion tier, earning rule, reward, distribution.
+
+### Examples
+
+```ruby
+require 'time'
+require 'VoucherifySdk'
+# setup authorization
+VoucherifySdk.configure do |config|
+ # Configure API key authorization: X-App-Id
+ config.api_key['X-App-Id'] = 'YOUR API KEY'
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
+ # config.api_key_prefix['X-App-Id'] = 'Bearer'
+
+ # Configure API key authorization: X-App-Token
+ config.api_key['X-App-Token'] = 'YOUR API KEY'
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
+ # config.api_key_prefix['X-App-Token'] = 'Bearer'
+end
+
+api_instance = VoucherifySdk::ValidationRulesApi.new
+validation_rule_id = 'validation_rule_id_example' # String | Unique validation rule ID.
+opts = {
+ force: true, # Boolean | If this flag is set to true, the previous assignment with the same data will be deleted and a new one will be added.
+ validation_rules_assignments_create_request_body: VoucherifySdk::ValidationRulesAssignmentsCreateRequestBody.new # ValidationRulesAssignmentsCreateRequestBody | Specify the resource that you would like to assign the validation rule to.
+}
+
+begin
+ # Create Validation Rules Assignments
+ result = api_instance.create_validation_rule_assignment(validation_rule_id, opts)
+ p result
+rescue VoucherifySdk::ApiError => e
+ puts "Error when calling ValidationRulesApi->create_validation_rule_assignment: #{e}"
+end
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ---- | ---- | ----------- | ----- |
+| **validation_rule_id** | **String** | Unique validation rule ID. | |
+| **force** | **Boolean** | If this flag is set to true, the previous assignment with the same data will be deleted and a new one will be added. | [optional] |
+| **validation_rules_assignments_create_request_body** | [**ValidationRulesAssignmentsCreateRequestBody**](ValidationRulesAssignmentsCreateRequestBody.md) | Specify the resource that you would like to assign the validation rule to. | [optional] |
+
+### Return type
+
+[**ValidationRulesAssignmentsCreateResponseBody**](ValidationRulesAssignmentsCreateResponseBody.md)
+
+### Authorization
+
+[X-App-Id](../README.md#X-App-Id), [X-App-Token](../README.md#X-App-Token)
+
+### HTTP request headers
+
+- **Content-Type**: application/json
+- **Accept**: application/json
+
+
## create_validation_rules
> <ValidationRulesCreateResponseBody> create_validation_rules(opts)
Create Validation Rules
@@ -40,11 +105,11 @@
# config.api_key_prefix['X-App-Token'] = 'Bearer'
end
api_instance = VoucherifySdk::ValidationRulesApi.new
opts = {
- validation_rules_create_request_body: VoucherifySdk::ValidationRulesCreateRequestBody.new({name: 'Business Validation Rule'}) # ValidationRulesCreateRequestBody | Specify the validation rules parameters.
+ validation_rules_create_request_body: VoucherifySdk::ValidationRulesCreateRequestBody.new # ValidationRulesCreateRequestBody | Specify the validation rules parameters.
}
begin
# Create Validation Rules
result = api_instance.create_validation_rules(opts)
@@ -275,12 +340,12 @@
end
api_instance = VoucherifySdk::ValidationRulesApi.new
validation_rule_id = 'validation_rule_id_example' # String | Unique validation rule ID.
opts = {
- limit: 56, # Integer | A limit on the number of objects to be returned. Limit can range between 1 and 100 items.
- page: 56, # Integer | Which page of results to return.
+ limit: 56, # Integer | Limits the number of objects to be returned. The limit can range between 1 and 100 items. If no limit is set, it returns 10 items.
+ page: 56, # Integer | Which page of results to return. The lowest value is 1.
order: VoucherifySdk::ParameterOrderListValidationRuleAssignments::CREATED_AT # ParameterOrderListValidationRuleAssignments | This is a property that controls the sorting direction of the results. Sort the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order.
}
begin
# List Validation Rule Assignments
@@ -294,12 +359,12 @@
### Parameters
| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |
| **validation_rule_id** | **String** | Unique validation rule ID. | |
-| **limit** | **Integer** | A limit on the number of objects to be returned. Limit can range between 1 and 100 items. | [optional] |
-| **page** | **Integer** | Which page of results to return. | [optional] |
+| **limit** | **Integer** | Limits the number of objects to be returned. The limit can range between 1 and 100 items. If no limit is set, it returns 10 items. | [optional] |
+| **page** | **Integer** | Which page of results to return. The lowest value is 1. | [optional] |
| **order** | [**ParameterOrderListValidationRuleAssignments**](.md) | This is a property that controls the sorting direction of the results. Sort the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order. | [optional] |
### Return type
[**ValidationRulesAssignmentsListResponseBody**](ValidationRulesAssignmentsListResponseBody.md)
@@ -340,12 +405,12 @@
# config.api_key_prefix['X-App-Token'] = 'Bearer'
end
api_instance = VoucherifySdk::ValidationRulesApi.new
opts = {
- limit: 56, # Integer | A limit on the number of objects to be returned. Limit can range between 1 and 100 items.
- page: 56, # Integer | Which page of results to return.
+ limit: 56, # Integer | Limits the number of objects to be returned. The limit can range between 1 and 100 items. If no limit is set, it returns 10 items.
+ page: 56, # Integer | Which page of results to return. The lowest value is 1.
order: VoucherifySdk::ParameterOrderListValidationRules::CREATED_AT, # ParameterOrderListValidationRules | This is a property that controls the sorting direction of the results. Sort the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order.
start_date: Time.parse('2013-10-20T19:20:30+01:00'), # Time | Timestamp representing the date and time which results must start on. Represented in ISO 8601 format.
end_date: Time.parse('2013-10-20T19:20:30+01:00') # Time | Timestamp representing the date and time which results must end on. Represented in ISO 8601 format.
}
@@ -360,12 +425,12 @@
### Parameters
| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |
-| **limit** | **Integer** | A limit on the number of objects to be returned. Limit can range between 1 and 100 items. | [optional] |
-| **page** | **Integer** | Which page of results to return. | [optional] |
+| **limit** | **Integer** | Limits the number of objects to be returned. The limit can range between 1 and 100 items. If no limit is set, it returns 10 items. | [optional] |
+| **page** | **Integer** | Which page of results to return. The lowest value is 1. | [optional] |
| **order** | [**ParameterOrderListValidationRules**](.md) | This is a property that controls the sorting direction of the results. Sort the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order. | [optional] |
| **start_date** | **Time** | Timestamp representing the date and time which results must start on. Represented in ISO 8601 format. | [optional] |
| **end_date** | **Time** | Timestamp representing the date and time which results must end on. Represented in ISO 8601 format. | [optional] |
### Return type
@@ -410,12 +475,12 @@
api_instance = VoucherifySdk::ValidationRulesApi.new
opts = {
related_object_id: 'related_object_id_example', # String | The resource ID to which the validation rule was assigned; this could be, for example, a resource ID of a voucher, campaign, earning rule, reward assignment, promotion tier, or distribution.
rule: 'rule_example', # String | Validation rule ID.
- page: 56, # Integer | Which page of results to return.
- limit: 56, # Integer | A limit on the number of objects to be returned. Limit can range between 1 and 100 items.
+ page: 56, # Integer | Which page of results to return. The lowest value is 1.
+ limit: 56, # Integer | Limits the number of objects to be returned. The limit can range between 1 and 100 items. If no limit is set, it returns 10 items.
order: 'order_example' # String | Sorts the results using one of the filtering options: -created_at, created_at, where the dash - preceding a sorting option means sorting in a descending order.
}
begin
# List Validation Rules' Assignment(s)
@@ -430,11 +495,11 @@
| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |
| **related_object_id** | **String** | The resource ID to which the validation rule was assigned; this could be, for example, a resource ID of a voucher, campaign, earning rule, reward assignment, promotion tier, or distribution. | [optional] |
| **rule** | **String** | Validation rule ID. | [optional] |
-| **page** | **Integer** | Which page of results to return. | [optional] |
-| **limit** | **Integer** | A limit on the number of objects to be returned. Limit can range between 1 and 100 items. | [optional] |
+| **page** | **Integer** | Which page of results to return. The lowest value is 1. | [optional] |
+| **limit** | **Integer** | Limits the number of objects to be returned. The limit can range between 1 and 100 items. If no limit is set, it returns 10 items. | [optional] |
| **order** | **String** | Sorts the results using one of the filtering options: -created_at, created_at, where the dash - preceding a sorting option means sorting in a descending order. | [optional] |
### Return type
[**ValidationRulesAssignmentsListResponseBody**](ValidationRulesAssignmentsListResponseBody.md)