Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
p-zielinski committed Oct 21, 2024
1 parent 1723de4 commit baf2455
Show file tree
Hide file tree
Showing 13 changed files with 1,163 additions and 7 deletions.
4 changes: 2 additions & 2 deletions ENDPOINTS-COVERAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,8 @@
| /management/v1/projects/{projectId}/users/{userId} | put | Update User | <font color='green'>supported</font> | |
| /management/v1/projects/{projectId}/users/{userId} | delete | Unassign User | <font color='green'>supported</font> | |
| /management/v1/projects/users/invite | post | Invite a New User | <font color='green'>supported</font> | |
| /management/v1/projects/{projectId}/templates/campaigns | get | List Campaign Templates | | |
| /management/v1/projects/{projectId}/templates/campaigns/{campaignTemplateId}/copy | post | Copy Campaign Template to a Project | | |
| /management/v1/projects/{projectId}/templates/campaigns | get | List Campaign Templates | <font color='green'>supported</font> | |
| /management/v1/projects/{projectId}/templates/campaigns/{campaignTemplateId}/copy | post | Copy Campaign Template to a Project | <font color='green'>supported</font> | |
| /management/v1/projects/{projectId}/stacking-rules | post | Create Stacking Rules | <font color='green'>supported</font> | |
| /management/v1/projects/{projectId}/stacking-rules | get | List Stacking Rules | <font color='green'>supported</font> | |
| /management/v1/projects/{projectId}/stacking-rules/{stackingRulesId} | get | Get Stacking Rules | <font color='green'>supported</font> | |
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,8 @@ Class | Method | HTTP request | Description
*VoucherifySdk::ManagementApi* | [**list_stacking_rules**](docs/ManagementApi.md#list_stacking_rules) | **GET** /management/v1/projects/{projectId}/stacking-rules | List Stacking Rules
*VoucherifySdk::ManagementApi* | [**list_users**](docs/ManagementApi.md#list_users) | **GET** /management/v1/projects/{projectId}/users | List Users
*VoucherifySdk::ManagementApi* | [**list_webhooks**](docs/ManagementApi.md#list_webhooks) | **GET** /management/v1/projects/{projectId}/webhooks | List Webhooks
*VoucherifySdk::ManagementApi* | [**management_copy_campaign_template**](docs/ManagementApi.md#management_copy_campaign_template) | **POST** /management/v1/projects/{projectId}/templates/campaigns/{campaignTemplateId}/copy | Copy Campaign Template to a Project
*VoucherifySdk::ManagementApi* | [**management_list_campaign_templates**](docs/ManagementApi.md#management_list_campaign_templates) | **GET** /management/v1/projects/{projectId}/templates/campaigns | List Campaign Templates
*VoucherifySdk::ManagementApi* | [**unassign_user**](docs/ManagementApi.md#unassign_user) | **DELETE** /management/v1/projects/{projectId}/users/{userId} | Unassign User
*VoucherifySdk::ManagementApi* | [**update_brand**](docs/ManagementApi.md#update_brand) | **PUT** /management/v1/projects/{projectId}/branding/{brandingId} | Update Brand
*VoucherifySdk::ManagementApi* | [**update_custom_event_schema**](docs/ManagementApi.md#update_custom_event_schema) | **PUT** /management/v1/projects/{projectId}/custom-event-schemas/{customEventSchemaId} | Update Custom Event Schema
Expand Down Expand Up @@ -976,6 +978,9 @@ Class | Method | HTTP request | Description
- [VoucherifySdk::ManagementProjectsStackingRulesListResponseBody](docs/ManagementProjectsStackingRulesListResponseBody.md)
- [VoucherifySdk::ManagementProjectsStackingRulesUpdateRequestBody](docs/ManagementProjectsStackingRulesUpdateRequestBody.md)
- [VoucherifySdk::ManagementProjectsStackingRulesUpdateResponseBody](docs/ManagementProjectsStackingRulesUpdateResponseBody.md)
- [VoucherifySdk::ManagementProjectsTemplatesCampaignsCopyCreateRequestBody](docs/ManagementProjectsTemplatesCampaignsCopyCreateRequestBody.md)
- [VoucherifySdk::ManagementProjectsTemplatesCampaignsCopyCreateResponseBody](docs/ManagementProjectsTemplatesCampaignsCopyCreateResponseBody.md)
- [VoucherifySdk::ManagementProjectsTemplatesCampaignsListResponseBody](docs/ManagementProjectsTemplatesCampaignsListResponseBody.md)
- [VoucherifySdk::ManagementProjectsUpdateRequestBody](docs/ManagementProjectsUpdateRequestBody.md)
- [VoucherifySdk::ManagementProjectsUpdateRequestBodyApiUsageNotifications](docs/ManagementProjectsUpdateRequestBodyApiUsageNotifications.md)
- [VoucherifySdk::ManagementProjectsUpdateRequestBodyDefaultCodeConfig](docs/ManagementProjectsUpdateRequestBodyDefaultCodeConfig.md)
Expand Down
136 changes: 136 additions & 0 deletions docs/ManagementApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ All URIs are relative to *https://api.voucherify.io*
| [**list_stacking_rules**](ManagementApi.md#list_stacking_rules) | **GET** /management/v1/projects/{projectId}/stacking-rules | List Stacking Rules |
| [**list_users**](ManagementApi.md#list_users) | **GET** /management/v1/projects/{projectId}/users | List Users |
| [**list_webhooks**](ManagementApi.md#list_webhooks) | **GET** /management/v1/projects/{projectId}/webhooks | List Webhooks |
| [**management_copy_campaign_template**](ManagementApi.md#management_copy_campaign_template) | **POST** /management/v1/projects/{projectId}/templates/campaigns/{campaignTemplateId}/copy | Copy Campaign Template to a Project |
| [**management_list_campaign_templates**](ManagementApi.md#management_list_campaign_templates) | **GET** /management/v1/projects/{projectId}/templates/campaigns | List Campaign Templates |
| [**unassign_user**](ManagementApi.md#unassign_user) | **DELETE** /management/v1/projects/{projectId}/users/{userId} | Unassign User |
| [**update_brand**](ManagementApi.md#update_brand) | **PUT** /management/v1/projects/{projectId}/branding/{brandingId} | Update Brand |
| [**update_custom_event_schema**](ManagementApi.md#update_custom_event_schema) | **PUT** /management/v1/projects/{projectId}/custom-event-schemas/{customEventSchemaId} | Update Custom Event Schema |
Expand Down Expand Up @@ -1706,6 +1708,140 @@ end
- **Accept**: application/json


## management_copy_campaign_template

> <ManagementProjectsTemplatesCampaignsCopyCreateResponseBody> management_copy_campaign_template(project_id, campaign_template_id, opts)
Copy Campaign Template to a Project

Copies a campaign template to another project. The resources, like validation rules or products, will not be copied to the destination project yet. When the template is used to create a new campaign or add a new promotion tier, the resources will be created in the destination project. 📘 Campaign Templates – Documentation Read the [Campaign Templates documentation](https://support.voucherify.io/article/620-campaign-templates) to learn more about this feature.

### Examples

```ruby
require 'time'
require 'VoucherifySdk'
# setup authorization
VoucherifySdk.configure do |config|
# Configure API key authorization: X-Management-Token
config.api_key['X-Management-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-Management-Token'] = 'Bearer'

# Configure API key authorization: X-Management-Id
config.api_key['X-Management-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-Management-Id'] = 'Bearer'
end

api_instance = VoucherifySdk::ManagementApi.new
project_id = 'project_id_example' # String | Provide the unique identifier of the project.
campaign_template_id = 'campaign_template_id_example' # String | Provide the unique identifier of the campaign template.
opts = {
management_projects_templates_campaigns_copy_create_request_body: VoucherifySdk::ManagementProjectsTemplatesCampaignsCopyCreateRequestBody.new # ManagementProjectsTemplatesCampaignsCopyCreateRequestBody | Determines the details about the template in the destination project as well as the destination project itself.
}

begin
# Copy Campaign Template to a Project
result = api_instance.management_copy_campaign_template(project_id, campaign_template_id, opts)
p result
rescue VoucherifySdk::ApiError => e
puts "Error when calling ManagementApi->management_copy_campaign_template: #{e}"
end
```

### Parameters

| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |
| **project_id** | **String** | Provide the unique identifier of the project. | |
| **campaign_template_id** | **String** | Provide the unique identifier of the campaign template. | |
| **management_projects_templates_campaigns_copy_create_request_body** | [**ManagementProjectsTemplatesCampaignsCopyCreateRequestBody**](ManagementProjectsTemplatesCampaignsCopyCreateRequestBody.md) | Determines the details about the template in the destination project as well as the destination project itself. | [optional] |

### Return type

[**ManagementProjectsTemplatesCampaignsCopyCreateResponseBody**](ManagementProjectsTemplatesCampaignsCopyCreateResponseBody.md)

### Authorization

[X-Management-Token](../README.md#X-Management-Token), [X-Management-Id](../README.md#X-Management-Id)

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json


## management_list_campaign_templates

> <ManagementProjectsTemplatesCampaignsListResponseBody> management_list_campaign_templates(project_id, opts)
List Campaign Templates

Lists all campaign templates available in the project. 👍 List Campaign Templates This endpoint works in the same way as the List Campaign Templates endpoint. 📘 Campaign Templates – Documentation Read the [Campaign Templates documentation](https://support.voucherify.io/article/620-campaign-templates) to learn more about this feature.

### Examples

```ruby
require 'time'
require 'VoucherifySdk'
# setup authorization
VoucherifySdk.configure do |config|
# Configure API key authorization: X-Management-Token
config.api_key['X-Management-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-Management-Token'] = 'Bearer'

# Configure API key authorization: X-Management-Id
config.api_key['X-Management-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-Management-Id'] = 'Bearer'
end

api_instance = VoucherifySdk::ManagementApi.new
project_id = 'project_id_example' # String | Provide the unique identifier of the project.
opts = {
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.
starting_after_id: 'starting_after_id_example', # String | A cursor for pagination. It retrieves the campaign templates created after a template with the given ID.
order: VoucherifySdk::ParameterTemplatesList::ID, # ParameterTemplatesList | Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order.
include_total: true, # Boolean | If set to true, the response returns the number of all campaign templates, regardless of the applied filters or limits. Set to false by default.
filters: VoucherifySdk::ParameterFiltersListTemplates.new # ParameterFiltersListTemplates | Filters for listing templates.
}

begin
# List Campaign Templates
result = api_instance.management_list_campaign_templates(project_id, opts)
p result
rescue VoucherifySdk::ApiError => e
puts "Error when calling ManagementApi->management_list_campaign_templates: #{e}"
end
```

### Parameters

| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |
| **project_id** | **String** | Provide the unique identifier of the project. | |
| **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] |
| **starting_after_id** | **String** | A cursor for pagination. It retrieves the campaign templates created after a template with the given ID. | [optional] |
| **order** | [**ParameterTemplatesList**](.md) | Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order. | [optional] |
| **include_total** | **Boolean** | If set to true, the response returns the number of all campaign templates, regardless of the applied filters or limits. Set to false by default. | [optional] |
| **filters** | [**ParameterFiltersListTemplates**](.md) | Filters for listing templates. | [optional] |

### Return type

[**ManagementProjectsTemplatesCampaignsListResponseBody**](ManagementProjectsTemplatesCampaignsListResponseBody.md)

### Authorization

[X-Management-Token](../README.md#X-Management-Token), [X-Management-Id](../README.md#X-Management-Id)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json


## unassign_user

> unassign_user(project_id, user_id)
Expand Down
10 changes: 10 additions & 0 deletions docs/ManagementProjectsTemplatesCampaignsCopyCreateRequestBody.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# VoucherifySdk::ManagementProjectsTemplatesCampaignsCopyCreateRequestBody

## Properties

| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |
| **name** | **String** | User-defined name of the campaign template. It must be unique. | [optional] |
| **description** | **String** | User-defined description of the campaign template. | [optional] |
| **destination_project_id** | **String** | Unique identifier of the project to which the campaign template will be copied. | [optional] |

13 changes: 13 additions & 0 deletions docs/ManagementProjectsTemplatesCampaignsCopyCreateResponseBody.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# VoucherifySdk::ManagementProjectsTemplatesCampaignsCopyCreateResponseBody

## Properties

| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |
| **id** | **String** | Unique identifier of the campaign template. It is assigned by Voucherify. | [optional] |
| **name** | **String** | User-defined name of the campaign template. | [optional] |
| **description** | **String** | User-defined description of the campaign template. | [optional] |
| **campaign_type** | **String** | Type of the campaign used to create the campaign template. Templates created from a promotion tier are converted to &#x60;DISCOUNT_COUPONS&#x60;. | [optional] |
| **created_at** | **Time** | Timestamp representing the date and time when the campaign template was created. The value is shown in the ISO 8601 format. | [optional] |
| **object** | **String** | The type of the object represented by JSON. | [optional][default to &#39;campaign_template&#39;] |

13 changes: 13 additions & 0 deletions docs/ManagementProjectsTemplatesCampaignsListResponseBody.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# VoucherifySdk::ManagementProjectsTemplatesCampaignsListResponseBody

## Properties

| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |
| **object** | **String** | The type of the object represented by JSON. This object stores information about campaign templates. | [optional][default to &#39;list&#39;] |
| **data_ref** | **String** | Identifies the name of the JSON property that contains the array of campaign templates. | [optional][default to &#39;data&#39;] |
| **data** | [**Array&lt;CampaignTemplate&gt;**](CampaignTemplate.md) | Dictionary that contains an array of campaign templates. | [optional] |
| **total** | **Integer** | Total number of templates, regardless of the applied query parameters. Displayed only if the &#x60;include_total&#x60; query paremeter is set to &#x60;true&#x60;. | [optional] |
| **has_more** | **Boolean** | As query results are always limited (by the limit parameter), the &#x60;has_more&#x60; flag indicates if there are more records for given filter parameters. This lets you know if you can run another request to get more records returned in the results. | [optional] |
| **more_starting_after** | **String** | Returns an ID that can be used to return another page of results. Use the template ID in the &#x60;starting_after_id&#x60; query parameter to display another page of the results starting after the template with that ID. | [optional] |

1 change: 1 addition & 0 deletions docs/TemplatesCampaignsListResponseBody.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@
| **data** | [**Array&lt;CampaignTemplate&gt;**](CampaignTemplate.md) | Dictionary that contains an array of campaign templates. | [optional] |
| **total** | **Integer** | Total number of templates, regardless of the applied query parameters. Displayed only if the &#x60;include_total&#x60; query paremeter is set to &#x60;true&#x60;. | [optional] |
| **has_more** | **Boolean** | As query results are always limited (by the limit parameter), the &#x60;has_more&#x60; flag indicates if there are more records for given filter parameters. This lets you know if you can run another request to get more records returned in the results. | [optional] |
| **more_starting_after** | **String** | Returns an ID that can be used to return another page of results. Use the template ID in the &#x60;starting_after_id&#x60; query parameter to display another page of the results starting after the template with that ID. | [optional] |

3 changes: 3 additions & 0 deletions lib/VoucherifySdk.rb
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,9 @@
require 'VoucherifySdk/models/management_projects_stacking_rules_list_response_body'
require 'VoucherifySdk/models/management_projects_stacking_rules_update_request_body'
require 'VoucherifySdk/models/management_projects_stacking_rules_update_response_body'
require 'VoucherifySdk/models/management_projects_templates_campaigns_copy_create_request_body'
require 'VoucherifySdk/models/management_projects_templates_campaigns_copy_create_response_body'
require 'VoucherifySdk/models/management_projects_templates_campaigns_list_response_body'
require 'VoucherifySdk/models/management_projects_update_request_body'
require 'VoucherifySdk/models/management_projects_update_request_body_api_usage_notifications'
require 'VoucherifySdk/models/management_projects_update_request_body_default_code_config'
Expand Down
Loading

0 comments on commit baf2455

Please sign in to comment.