stigg 0.1.0.pre.alpha.1 → 0.1.0.pre.alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +22 -0
- data/README.md +29 -1
- data/lib/stigg/internal/my_cursor_id_page.rb +32 -4
- data/lib/stigg/internal/type/base_model.rb +2 -2
- data/lib/stigg/models/v1/{coupon_create_response.rb → coupon.rb} +31 -26
- data/lib/stigg/models/v1/coupon_create_params.rb +2 -0
- data/lib/stigg/models/v1/coupon_list_params.rb +14 -14
- data/lib/stigg/models/v1/coupon_list_response.rb +262 -278
- data/lib/stigg/models/v1/customer_import_params.rb +75 -0
- data/lib/stigg/models/v1/customer_import_response.rb +35 -0
- data/lib/stigg/models/v1/customer_list_params.rb +14 -14
- data/lib/stigg/models/v1/customer_list_response.rb +160 -174
- data/lib/stigg/models/v1/{customer_create_params.rb → customer_provision_params.rb} +18 -16
- data/lib/stigg/models/v1/customer_response.rb +9 -2
- data/lib/stigg/models/v1/customer_update_params.rb +2 -0
- data/lib/stigg/models/v1/customers/payment_method_attach_params.rb +3 -1
- data/lib/stigg/models/v1/customers/{promotional_create_params.rb → promotional_entitlement_grant_params.rb} +46 -44
- data/lib/stigg/models/v1/customers/{promotional_create_response.rb → promotional_entitlement_grant_response.rb} +105 -32
- data/lib/stigg/models/v1/customers/{promotional_revoke_params.rb → promotional_entitlement_revoke_params.rb} +2 -2
- data/lib/stigg/models/v1/customers/{promotional_revoke_response.rb → promotional_entitlement_revoke_response.rb} +107 -33
- data/lib/stigg/models/v1/event_report_params.rb +91 -0
- data/lib/stigg/models/v1/event_report_response.rb +25 -0
- data/lib/stigg/models/v1/{subscription_retrieve_response.rb → subscription.rb} +67 -26
- data/lib/stigg/models/v1/subscription_cancel_params.rb +75 -0
- data/lib/stigg/models/v1/subscription_delegate_params.rb +7 -2
- data/lib/stigg/models/v1/subscription_import_params.rb +92 -0
- data/lib/stigg/models/v1/subscription_import_response.rb +32 -0
- data/lib/stigg/models/v1/subscription_list_params.rb +20 -24
- data/lib/stigg/models/v1/subscription_list_response.rb +255 -236
- data/lib/stigg/models/v1/subscription_migrate_params.rb +3 -3
- data/lib/stigg/models/v1/subscription_preview_params.rb +139 -46
- data/lib/stigg/models/v1/subscription_preview_response.rb +164 -49
- data/lib/stigg/models/v1/subscription_provision_params.rb +1693 -0
- data/lib/stigg/models/v1/subscription_provision_response.rb +1038 -0
- data/lib/stigg/models/v1/subscription_transfer_params.rb +2 -6
- data/lib/stigg/models/v1/subscription_update_params.rb +1114 -0
- data/lib/stigg/models/v1/subscriptions/{future_update_cancel_pending_payment_response.rb → cancel_subscription.rb} +9 -5
- data/lib/stigg/models/v1/usage_history_params.rb +54 -0
- data/lib/stigg/models/v1/usage_history_response.rb +155 -0
- data/lib/stigg/models/v1/usage_report_params.rb +114 -0
- data/lib/stigg/models/v1/usage_report_response.rb +120 -0
- data/lib/stigg/models.rb +0 -4
- data/lib/stigg/resources/v1/coupons.rb +16 -14
- data/lib/stigg/resources/v1/customers/payment_method.rb +6 -5
- data/lib/stigg/resources/v1/customers/{promotional.rb → promotional_entitlements.rb} +17 -17
- data/lib/stigg/resources/v1/customers.rb +78 -56
- data/lib/stigg/resources/v1/events.rb +38 -0
- data/lib/stigg/resources/v1/subscriptions/future_update.rb +10 -8
- data/lib/stigg/resources/v1/subscriptions.rb +206 -79
- data/lib/stigg/resources/v1/usage.rb +79 -0
- data/lib/stigg/resources/v1.rb +6 -42
- data/lib/stigg/version.rb +1 -1
- data/lib/stigg.rb +25 -23
- data/rbi/stigg/internal/my_cursor_id_page.rbi +27 -0
- data/rbi/stigg/models/v1/coupon.rbi +891 -0
- data/rbi/stigg/models/v1/coupon_create_params.rbi +1 -0
- data/rbi/stigg/models/v1/coupon_list_params.rbi +21 -21
- data/rbi/stigg/models/v1/coupon_list_response.rbi +812 -869
- data/rbi/stigg/models/v1/customer_import_params.rbi +130 -0
- data/rbi/stigg/models/v1/customer_import_response.rbi +76 -0
- data/rbi/stigg/models/v1/customer_list_params.rbi +21 -21
- data/rbi/stigg/models/v1/customer_list_response.rbi +307 -347
- data/rbi/stigg/models/v1/{customer_create_params.rbi → customer_provision_params.rbi} +36 -35
- data/rbi/stigg/models/v1/customer_response.rbi +8 -1
- data/rbi/stigg/models/v1/customer_update_params.rbi +1 -0
- data/rbi/stigg/models/v1/customers/payment_method_attach_params.rbi +3 -0
- data/rbi/stigg/models/v1/customers/{promotional_create_params.rbi → promotional_entitlement_grant_params.rbi} +78 -77
- data/rbi/stigg/models/v1/customers/promotional_entitlement_grant_response.rbi +690 -0
- data/rbi/stigg/models/v1/customers/{promotional_revoke_params.rbi → promotional_entitlement_revoke_params.rbi} +2 -2
- data/rbi/stigg/models/v1/customers/promotional_entitlement_revoke_response.rbi +696 -0
- data/rbi/stigg/models/v1/event_report_params.rbi +168 -0
- data/rbi/stigg/models/v1/event_report_response.rbi +35 -0
- data/rbi/stigg/models/v1/{subscription_migrate_response.rbi → subscription.rbi} +130 -98
- data/rbi/stigg/models/v1/subscription_cancel_params.rbi +182 -0
- data/rbi/stigg/models/v1/subscription_delegate_params.rbi +6 -2
- data/rbi/stigg/models/v1/subscription_import_params.rbi +148 -0
- data/rbi/stigg/models/v1/subscription_import_response.rbi +69 -0
- data/rbi/stigg/models/v1/subscription_list_params.rbi +26 -28
- data/rbi/stigg/models/v1/subscription_list_response.rbi +460 -435
- data/rbi/stigg/models/v1/subscription_migrate_params.rbi +3 -3
- data/rbi/stigg/models/v1/subscription_preview_params.rbi +112 -14
- data/rbi/stigg/models/v1/subscription_preview_response.rbi +139 -6
- data/rbi/stigg/models/v1/subscription_provision_params.rbi +5306 -0
- data/rbi/stigg/models/v1/subscription_provision_response.rbi +3175 -0
- data/rbi/stigg/models/v1/subscription_transfer_params.rbi +2 -4
- data/rbi/stigg/models/v1/subscription_update_params.rbi +3578 -0
- data/rbi/stigg/models/v1/subscriptions/{future_update_cancel_schedule_response.rbi → cancel_subscription.rbi} +10 -16
- data/rbi/stigg/models/v1/usage_history_params.rbi +79 -0
- data/rbi/stigg/models/v1/usage_history_response.rbi +347 -0
- data/rbi/stigg/models/v1/usage_report_params.rbi +227 -0
- data/rbi/stigg/models/v1/usage_report_response.rbi +162 -0
- data/rbi/stigg/models.rbi +0 -4
- data/rbi/stigg/resources/v1/coupons.rbi +22 -14
- data/rbi/stigg/resources/v1/customers/payment_method.rbi +9 -3
- data/rbi/stigg/resources/v1/customers/{promotional.rbi → promotional_entitlements.rbi} +13 -9
- data/rbi/stigg/resources/v1/customers.rbi +84 -53
- data/rbi/stigg/resources/v1/events.rbi +28 -0
- data/rbi/stigg/resources/v1/subscriptions/future_update.rbi +14 -10
- data/rbi/stigg/resources/v1/subscriptions.rbi +242 -58
- data/rbi/stigg/resources/v1/usage.rbi +57 -0
- data/rbi/stigg/resources/v1.rbi +4 -26
- data/sig/stigg/internal/my_cursor_id_page.rbs +17 -0
- data/sig/stigg/models/v1/{coupon_create_response.rbs → coupon.rbs} +29 -32
- data/sig/stigg/models/v1/coupon_list_params.rbs +11 -11
- data/sig/stigg/models/v1/coupon_list_response.rbs +331 -351
- data/sig/stigg/models/v1/customer_import_params.rbs +74 -0
- data/sig/stigg/models/v1/customer_import_response.rbs +30 -0
- data/sig/stigg/models/v1/customer_list_params.rbs +11 -11
- data/sig/stigg/models/v1/customer_list_response.rbs +133 -153
- data/sig/stigg/models/v1/{customer_create_params.rbs → customer_provision_params.rbs} +22 -22
- data/sig/stigg/models/v1/customers/{promotional_create_params.rbs → promotional_entitlement_grant_params.rbs} +43 -43
- data/sig/stigg/models/v1/customers/promotional_entitlement_grant_response.rbs +281 -0
- data/sig/stigg/models/v1/customers/{promotional_revoke_params.rbs → promotional_entitlement_revoke_params.rbs} +2 -2
- data/sig/stigg/models/v1/customers/promotional_entitlement_revoke_response.rbs +281 -0
- data/sig/stigg/models/v1/event_report_params.rbs +82 -0
- data/sig/stigg/models/v1/event_report_response.rbs +15 -0
- data/sig/stigg/models/v1/{subscription_retrieve_response.rbs → subscription.rbs} +61 -35
- data/sig/stigg/models/v1/subscription_cancel_params.rbs +79 -0
- data/sig/stigg/models/v1/subscription_import_params.rbs +84 -0
- data/sig/stigg/models/v1/subscription_import_response.rbs +30 -0
- data/sig/stigg/models/v1/subscription_list_params.rbs +14 -14
- data/sig/stigg/models/v1/subscription_list_response.rbs +196 -189
- data/sig/stigg/models/v1/subscription_preview_params.rbs +2 -6
- data/sig/stigg/models/v1/subscription_provision_params.rbs +2223 -0
- data/sig/stigg/models/v1/subscription_provision_response.rbs +1305 -0
- data/sig/stigg/models/v1/subscription_update_params.rbs +1544 -0
- data/sig/stigg/models/v1/subscriptions/cancel_subscription.rbs +34 -0
- data/sig/stigg/models/v1/usage_history_params.rbs +52 -0
- data/sig/stigg/models/v1/usage_history_response.rbs +129 -0
- data/sig/stigg/models/v1/usage_report_params.rbs +102 -0
- data/sig/stigg/models/v1/usage_report_response.rbs +87 -0
- data/sig/stigg/models.rbs +0 -4
- data/sig/stigg/resources/v1/coupons.rbs +5 -5
- data/sig/stigg/resources/v1/customers/{promotional.rbs → promotional_entitlements.rbs} +5 -5
- data/sig/stigg/resources/v1/customers.rbs +20 -17
- data/sig/stigg/resources/v1/events.rbs +14 -0
- data/sig/stigg/resources/v1/subscriptions/future_update.rbs +2 -2
- data/sig/stigg/resources/v1/subscriptions.rbs +68 -20
- data/sig/stigg/resources/v1/usage.rbs +24 -0
- data/sig/stigg/resources/v1.rbs +2 -8
- metadata +77 -71
- data/lib/stigg/models/v1/coupon_retrieve_response.rb +0 -317
- data/lib/stigg/models/v1/customers/usage_retrieve_params.rb +0 -56
- data/lib/stigg/models/v1/customers/usage_retrieve_response.rb +0 -145
- data/lib/stigg/models/v1/subscription_create_params.rb +0 -214
- data/lib/stigg/models/v1/subscription_create_response.rb +0 -338
- data/lib/stigg/models/v1/subscription_delegate_response.rb +0 -274
- data/lib/stigg/models/v1/subscription_migrate_response.rb +0 -274
- data/lib/stigg/models/v1/subscription_transfer_response.rb +0 -274
- data/lib/stigg/models/v1/subscriptions/future_update_cancel_schedule_response.rb +0 -32
- data/lib/stigg/models/v1_create_event_params.rb +0 -87
- data/lib/stigg/models/v1_create_event_response.rb +0 -16
- data/lib/stigg/models/v1_create_usage_params.rb +0 -96
- data/lib/stigg/models/v1_create_usage_response.rb +0 -112
- data/lib/stigg/resources/v1/customers/usage.rb +0 -59
- data/rbi/stigg/models/v1/coupon_create_response.rbi +0 -986
- data/rbi/stigg/models/v1/coupon_retrieve_response.rbi +0 -986
- data/rbi/stigg/models/v1/customers/promotional_create_response.rbi +0 -495
- data/rbi/stigg/models/v1/customers/promotional_revoke_response.rbi +0 -497
- data/rbi/stigg/models/v1/customers/usage_retrieve_params.rbi +0 -84
- data/rbi/stigg/models/v1/customers/usage_retrieve_response.rbi +0 -353
- data/rbi/stigg/models/v1/subscription_create_params.rbi +0 -394
- data/rbi/stigg/models/v1/subscription_create_response.rbi +0 -668
- data/rbi/stigg/models/v1/subscription_delegate_response.rbi +0 -535
- data/rbi/stigg/models/v1/subscription_retrieve_response.rbi +0 -535
- data/rbi/stigg/models/v1/subscription_transfer_response.rbi +0 -535
- data/rbi/stigg/models/v1/subscriptions/future_update_cancel_pending_payment_response.rbi +0 -79
- data/rbi/stigg/models/v1_create_event_params.rbi +0 -160
- data/rbi/stigg/models/v1_create_event_response.rbi +0 -23
- data/rbi/stigg/models/v1_create_usage_params.rbi +0 -177
- data/rbi/stigg/models/v1_create_usage_response.rbi +0 -150
- data/rbi/stigg/resources/v1/customers/usage.rbi +0 -45
- data/sig/stigg/models/v1/coupon_retrieve_response.rbs +0 -394
- data/sig/stigg/models/v1/customers/promotional_create_response.rbs +0 -209
- data/sig/stigg/models/v1/customers/promotional_revoke_response.rbs +0 -209
- data/sig/stigg/models/v1/customers/usage_retrieve_params.rbs +0 -54
- data/sig/stigg/models/v1/customers/usage_retrieve_response.rbs +0 -134
- data/sig/stigg/models/v1/subscription_create_params.rbs +0 -199
- data/sig/stigg/models/v1/subscription_create_response.rbs +0 -283
- data/sig/stigg/models/v1/subscription_delegate_response.rbs +0 -224
- data/sig/stigg/models/v1/subscription_migrate_response.rbs +0 -224
- data/sig/stigg/models/v1/subscription_transfer_response.rbs +0 -224
- data/sig/stigg/models/v1/subscriptions/future_update_cancel_pending_payment_response.rbs +0 -34
- data/sig/stigg/models/v1/subscriptions/future_update_cancel_schedule_response.rbs +0 -34
- data/sig/stigg/models/v1_create_event_params.rbs +0 -80
- data/sig/stigg/models/v1_create_event_response.rbs +0 -13
- data/sig/stigg/models/v1_create_usage_params.rbs +0 -90
- data/sig/stigg/models/v1_create_usage_response.rbs +0 -85
- data/sig/stigg/resources/v1/customers/usage.rbs +0 -21
|
@@ -5,16 +5,18 @@ module Stigg
|
|
|
5
5
|
module V1
|
|
6
6
|
module Subscriptions
|
|
7
7
|
# @see Stigg::Resources::V1::Subscriptions::FutureUpdate#cancel_pending_payment
|
|
8
|
-
class
|
|
8
|
+
class CancelSubscription < Stigg::Internal::Type::BaseModel
|
|
9
9
|
# @!attribute data
|
|
10
10
|
#
|
|
11
|
-
# @return [Stigg::Models::V1::Subscriptions::
|
|
12
|
-
required :data, -> { Stigg::
|
|
11
|
+
# @return [Stigg::Models::V1::Subscriptions::CancelSubscription::Data]
|
|
12
|
+
required :data, -> { Stigg::V1::Subscriptions::CancelSubscription::Data }
|
|
13
13
|
|
|
14
14
|
# @!method initialize(data:)
|
|
15
|
-
#
|
|
15
|
+
# Response object
|
|
16
|
+
#
|
|
17
|
+
# @param data [Stigg::Models::V1::Subscriptions::CancelSubscription::Data]
|
|
16
18
|
|
|
17
|
-
# @see Stigg::Models::V1::Subscriptions::
|
|
19
|
+
# @see Stigg::Models::V1::Subscriptions::CancelSubscription#data
|
|
18
20
|
class Data < Stigg::Internal::Type::BaseModel
|
|
19
21
|
# @!attribute id
|
|
20
22
|
# Subscription ID
|
|
@@ -27,6 +29,8 @@ module Stigg
|
|
|
27
29
|
end
|
|
28
30
|
end
|
|
29
31
|
end
|
|
32
|
+
|
|
33
|
+
CancelSubscription = Subscriptions::CancelSubscription
|
|
30
34
|
end
|
|
31
35
|
end
|
|
32
36
|
end
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Stigg
|
|
4
|
+
module Models
|
|
5
|
+
module V1
|
|
6
|
+
# @see Stigg::Resources::V1::Usage#history
|
|
7
|
+
class UsageHistoryParams < Stigg::Internal::Type::BaseModel
|
|
8
|
+
extend Stigg::Internal::Type::RequestParameters::Converter
|
|
9
|
+
include Stigg::Internal::Type::RequestParameters
|
|
10
|
+
|
|
11
|
+
# @!attribute customer_id
|
|
12
|
+
#
|
|
13
|
+
# @return [String]
|
|
14
|
+
required :customer_id, String
|
|
15
|
+
|
|
16
|
+
# @!attribute start_date
|
|
17
|
+
# The start date of the range
|
|
18
|
+
#
|
|
19
|
+
# @return [Time]
|
|
20
|
+
required :start_date, Time
|
|
21
|
+
|
|
22
|
+
# @!attribute end_date
|
|
23
|
+
# The end date of the range
|
|
24
|
+
#
|
|
25
|
+
# @return [Time, nil]
|
|
26
|
+
optional :end_date, Time
|
|
27
|
+
|
|
28
|
+
# @!attribute group_by
|
|
29
|
+
#
|
|
30
|
+
# @return [String, nil]
|
|
31
|
+
optional :group_by, String
|
|
32
|
+
|
|
33
|
+
# @!attribute resource_id
|
|
34
|
+
# Resource id
|
|
35
|
+
#
|
|
36
|
+
# @return [String, nil]
|
|
37
|
+
optional :resource_id, String, nil?: true
|
|
38
|
+
|
|
39
|
+
# @!method initialize(customer_id:, start_date:, end_date: nil, group_by: nil, resource_id: nil, request_options: {})
|
|
40
|
+
# @param customer_id [String]
|
|
41
|
+
#
|
|
42
|
+
# @param start_date [Time] The start date of the range
|
|
43
|
+
#
|
|
44
|
+
# @param end_date [Time] The end date of the range
|
|
45
|
+
#
|
|
46
|
+
# @param group_by [String]
|
|
47
|
+
#
|
|
48
|
+
# @param resource_id [String, nil] Resource id
|
|
49
|
+
#
|
|
50
|
+
# @param request_options [Stigg::RequestOptions, Hash{Symbol=>Object}]
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Stigg
|
|
4
|
+
module Models
|
|
5
|
+
module V1
|
|
6
|
+
# @see Stigg::Resources::V1::Usage#history
|
|
7
|
+
class UsageHistoryResponse < Stigg::Internal::Type::BaseModel
|
|
8
|
+
# @!attribute data
|
|
9
|
+
# Historical usage time series
|
|
10
|
+
#
|
|
11
|
+
# @return [Stigg::Models::V1::UsageHistoryResponse::Data]
|
|
12
|
+
required :data, -> { Stigg::Models::V1::UsageHistoryResponse::Data }
|
|
13
|
+
|
|
14
|
+
# @!method initialize(data:)
|
|
15
|
+
# Response object
|
|
16
|
+
#
|
|
17
|
+
# @param data [Stigg::Models::V1::UsageHistoryResponse::Data] Historical usage time series
|
|
18
|
+
|
|
19
|
+
# @see Stigg::Models::V1::UsageHistoryResponse#data
|
|
20
|
+
class Data < Stigg::Internal::Type::BaseModel
|
|
21
|
+
# @!attribute markers
|
|
22
|
+
# Markers for events that affecting feature usage
|
|
23
|
+
#
|
|
24
|
+
# @return [Array<Stigg::Models::V1::UsageHistoryResponse::Data::Marker>]
|
|
25
|
+
required :markers,
|
|
26
|
+
-> { Stigg::Internal::Type::ArrayOf[Stigg::Models::V1::UsageHistoryResponse::Data::Marker] }
|
|
27
|
+
|
|
28
|
+
# @!attribute series
|
|
29
|
+
# Series of usage history
|
|
30
|
+
#
|
|
31
|
+
# @return [Array<Stigg::Models::V1::UsageHistoryResponse::Data::Series>]
|
|
32
|
+
required :series,
|
|
33
|
+
-> { Stigg::Internal::Type::ArrayOf[Stigg::Models::V1::UsageHistoryResponse::Data::Series] }
|
|
34
|
+
|
|
35
|
+
# @!method initialize(markers:, series:)
|
|
36
|
+
# Historical usage time series
|
|
37
|
+
#
|
|
38
|
+
# @param markers [Array<Stigg::Models::V1::UsageHistoryResponse::Data::Marker>] Markers for events that affecting feature usage
|
|
39
|
+
#
|
|
40
|
+
# @param series [Array<Stigg::Models::V1::UsageHistoryResponse::Data::Series>] Series of usage history
|
|
41
|
+
|
|
42
|
+
class Marker < Stigg::Internal::Type::BaseModel
|
|
43
|
+
# @!attribute timestamp
|
|
44
|
+
# Timestamp of the marker
|
|
45
|
+
#
|
|
46
|
+
# @return [Time]
|
|
47
|
+
required :timestamp, Time
|
|
48
|
+
|
|
49
|
+
# @!attribute type
|
|
50
|
+
# Type of marker for a usage history point
|
|
51
|
+
#
|
|
52
|
+
# @return [Symbol, Stigg::Models::V1::UsageHistoryResponse::Data::Marker::Type]
|
|
53
|
+
required :type, enum: -> { Stigg::Models::V1::UsageHistoryResponse::Data::Marker::Type }
|
|
54
|
+
|
|
55
|
+
# @!method initialize(timestamp:, type:)
|
|
56
|
+
# Usage reset or change marker
|
|
57
|
+
#
|
|
58
|
+
# @param timestamp [Time] Timestamp of the marker
|
|
59
|
+
#
|
|
60
|
+
# @param type [Symbol, Stigg::Models::V1::UsageHistoryResponse::Data::Marker::Type] Type of marker for a usage history point
|
|
61
|
+
|
|
62
|
+
# Type of marker for a usage history point
|
|
63
|
+
#
|
|
64
|
+
# @see Stigg::Models::V1::UsageHistoryResponse::Data::Marker#type
|
|
65
|
+
module Type
|
|
66
|
+
extend Stigg::Internal::Type::Enum
|
|
67
|
+
|
|
68
|
+
PERIODIC_RESET = :PERIODIC_RESET
|
|
69
|
+
SUBSCRIPTION_CHANGE_RESET = :SUBSCRIPTION_CHANGE_RESET
|
|
70
|
+
|
|
71
|
+
# @!method self.values
|
|
72
|
+
# @return [Array<Symbol>]
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
class Series < Stigg::Internal::Type::BaseModel
|
|
77
|
+
# @!attribute points
|
|
78
|
+
# Points in the usage history series
|
|
79
|
+
#
|
|
80
|
+
# @return [Array<Stigg::Models::V1::UsageHistoryResponse::Data::Series::Point>]
|
|
81
|
+
required :points,
|
|
82
|
+
-> { Stigg::Internal::Type::ArrayOf[Stigg::Models::V1::UsageHistoryResponse::Data::Series::Point] }
|
|
83
|
+
|
|
84
|
+
# @!attribute tags
|
|
85
|
+
# Tags for the usage history series
|
|
86
|
+
#
|
|
87
|
+
# @return [Array<Stigg::Models::V1::UsageHistoryResponse::Data::Series::Tag>]
|
|
88
|
+
required :tags,
|
|
89
|
+
-> { Stigg::Internal::Type::ArrayOf[Stigg::Models::V1::UsageHistoryResponse::Data::Series::Tag] }
|
|
90
|
+
|
|
91
|
+
# @!method initialize(points:, tags:)
|
|
92
|
+
# Usage data points with tags
|
|
93
|
+
#
|
|
94
|
+
# @param points [Array<Stigg::Models::V1::UsageHistoryResponse::Data::Series::Point>] Points in the usage history series
|
|
95
|
+
#
|
|
96
|
+
# @param tags [Array<Stigg::Models::V1::UsageHistoryResponse::Data::Series::Tag>] Tags for the usage history series
|
|
97
|
+
|
|
98
|
+
class Point < Stigg::Internal::Type::BaseModel
|
|
99
|
+
# @!attribute is_reset_point
|
|
100
|
+
# Indicates whether there was usage reset in this point, see `markers` for details
|
|
101
|
+
#
|
|
102
|
+
# @return [Boolean]
|
|
103
|
+
required :is_reset_point, Stigg::Internal::Type::Boolean, api_name: :isResetPoint
|
|
104
|
+
|
|
105
|
+
# @!attribute timestamp
|
|
106
|
+
# Timestamp of the usage history point
|
|
107
|
+
#
|
|
108
|
+
# @return [Time]
|
|
109
|
+
required :timestamp, Time
|
|
110
|
+
|
|
111
|
+
# @!attribute value
|
|
112
|
+
# Value of the usage history point
|
|
113
|
+
#
|
|
114
|
+
# @return [Float]
|
|
115
|
+
required :value, Float
|
|
116
|
+
|
|
117
|
+
# @!method initialize(is_reset_point:, timestamp:, value:)
|
|
118
|
+
# Some parameter documentations has been truncated, see
|
|
119
|
+
# {Stigg::Models::V1::UsageHistoryResponse::Data::Series::Point} for more details.
|
|
120
|
+
#
|
|
121
|
+
# Single usage data point
|
|
122
|
+
#
|
|
123
|
+
# @param is_reset_point [Boolean] Indicates whether there was usage reset in this point, see `markers` for details
|
|
124
|
+
#
|
|
125
|
+
# @param timestamp [Time] Timestamp of the usage history point
|
|
126
|
+
#
|
|
127
|
+
# @param value [Float] Value of the usage history point
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
class Tag < Stigg::Internal::Type::BaseModel
|
|
131
|
+
# @!attribute key
|
|
132
|
+
# Key of the tag
|
|
133
|
+
#
|
|
134
|
+
# @return [String]
|
|
135
|
+
required :key, String
|
|
136
|
+
|
|
137
|
+
# @!attribute value
|
|
138
|
+
# Value of the tag
|
|
139
|
+
#
|
|
140
|
+
# @return [String]
|
|
141
|
+
required :value, String
|
|
142
|
+
|
|
143
|
+
# @!method initialize(key:, value:)
|
|
144
|
+
# Grouping tag key-value
|
|
145
|
+
#
|
|
146
|
+
# @param key [String] Key of the tag
|
|
147
|
+
#
|
|
148
|
+
# @param value [String] Value of the tag
|
|
149
|
+
end
|
|
150
|
+
end
|
|
151
|
+
end
|
|
152
|
+
end
|
|
153
|
+
end
|
|
154
|
+
end
|
|
155
|
+
end
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Stigg
|
|
4
|
+
module Models
|
|
5
|
+
module V1
|
|
6
|
+
# @see Stigg::Resources::V1::Usage#report
|
|
7
|
+
class UsageReportParams < Stigg::Internal::Type::BaseModel
|
|
8
|
+
extend Stigg::Internal::Type::RequestParameters::Converter
|
|
9
|
+
include Stigg::Internal::Type::RequestParameters
|
|
10
|
+
|
|
11
|
+
# @!attribute usages
|
|
12
|
+
# A list of usage reports to be submitted in bulk
|
|
13
|
+
#
|
|
14
|
+
# @return [Array<Stigg::Models::V1::UsageReportParams::Usage>]
|
|
15
|
+
required :usages, -> { Stigg::Internal::Type::ArrayOf[Stigg::V1::UsageReportParams::Usage] }
|
|
16
|
+
|
|
17
|
+
# @!method initialize(usages:, request_options: {})
|
|
18
|
+
# @param usages [Array<Stigg::Models::V1::UsageReportParams::Usage>] A list of usage reports to be submitted in bulk
|
|
19
|
+
#
|
|
20
|
+
# @param request_options [Stigg::RequestOptions, Hash{Symbol=>Object}]
|
|
21
|
+
|
|
22
|
+
class Usage < Stigg::Internal::Type::BaseModel
|
|
23
|
+
# @!attribute customer_id
|
|
24
|
+
# Customer id
|
|
25
|
+
#
|
|
26
|
+
# @return [String]
|
|
27
|
+
required :customer_id, String, api_name: :customerId
|
|
28
|
+
|
|
29
|
+
# @!attribute feature_id
|
|
30
|
+
# Feature id
|
|
31
|
+
#
|
|
32
|
+
# @return [String]
|
|
33
|
+
required :feature_id, String, api_name: :featureId
|
|
34
|
+
|
|
35
|
+
# @!attribute value
|
|
36
|
+
# The value to report for usage
|
|
37
|
+
#
|
|
38
|
+
# @return [Integer]
|
|
39
|
+
required :value, Integer
|
|
40
|
+
|
|
41
|
+
# @!attribute created_at
|
|
42
|
+
# Timestamp of when the record was created
|
|
43
|
+
#
|
|
44
|
+
# @return [Time, nil]
|
|
45
|
+
optional :created_at, Time, api_name: :createdAt
|
|
46
|
+
|
|
47
|
+
# @!attribute dimensions
|
|
48
|
+
# Additional dimensions for the usage report
|
|
49
|
+
#
|
|
50
|
+
# @return [Hash{Symbol=>String, Float, Boolean}, nil]
|
|
51
|
+
optional :dimensions,
|
|
52
|
+
-> { Stigg::Internal::Type::HashOf[union: Stigg::V1::UsageReportParams::Usage::Dimension] }
|
|
53
|
+
|
|
54
|
+
# @!attribute resource_id
|
|
55
|
+
# Resource id
|
|
56
|
+
#
|
|
57
|
+
# @return [String, nil]
|
|
58
|
+
optional :resource_id, String, api_name: :resourceId, nil?: true
|
|
59
|
+
|
|
60
|
+
# @!attribute update_behavior
|
|
61
|
+
# The method by which the usage value should be updated
|
|
62
|
+
#
|
|
63
|
+
# @return [Symbol, Stigg::Models::V1::UsageReportParams::Usage::UpdateBehavior, nil]
|
|
64
|
+
optional :update_behavior,
|
|
65
|
+
enum: -> { Stigg::V1::UsageReportParams::Usage::UpdateBehavior },
|
|
66
|
+
api_name: :updateBehavior
|
|
67
|
+
|
|
68
|
+
# @!method initialize(customer_id:, feature_id:, value:, created_at: nil, dimensions: nil, resource_id: nil, update_behavior: nil)
|
|
69
|
+
# Single usage measurement
|
|
70
|
+
#
|
|
71
|
+
# @param customer_id [String] Customer id
|
|
72
|
+
#
|
|
73
|
+
# @param feature_id [String] Feature id
|
|
74
|
+
#
|
|
75
|
+
# @param value [Integer] The value to report for usage
|
|
76
|
+
#
|
|
77
|
+
# @param created_at [Time] Timestamp of when the record was created
|
|
78
|
+
#
|
|
79
|
+
# @param dimensions [Hash{Symbol=>String, Float, Boolean}] Additional dimensions for the usage report
|
|
80
|
+
#
|
|
81
|
+
# @param resource_id [String, nil] Resource id
|
|
82
|
+
#
|
|
83
|
+
# @param update_behavior [Symbol, Stigg::Models::V1::UsageReportParams::Usage::UpdateBehavior] The method by which the usage value should be updated
|
|
84
|
+
|
|
85
|
+
module Dimension
|
|
86
|
+
extend Stigg::Internal::Type::Union
|
|
87
|
+
|
|
88
|
+
variant String
|
|
89
|
+
|
|
90
|
+
variant Float
|
|
91
|
+
|
|
92
|
+
variant Stigg::Internal::Type::Boolean
|
|
93
|
+
|
|
94
|
+
# @!method self.variants
|
|
95
|
+
# @return [Array(String, Float, Boolean)]
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
# The method by which the usage value should be updated
|
|
99
|
+
#
|
|
100
|
+
# @see Stigg::Models::V1::UsageReportParams::Usage#update_behavior
|
|
101
|
+
module UpdateBehavior
|
|
102
|
+
extend Stigg::Internal::Type::Enum
|
|
103
|
+
|
|
104
|
+
DELTA = :DELTA
|
|
105
|
+
SET = :SET
|
|
106
|
+
|
|
107
|
+
# @!method self.values
|
|
108
|
+
# @return [Array<Symbol>]
|
|
109
|
+
end
|
|
110
|
+
end
|
|
111
|
+
end
|
|
112
|
+
end
|
|
113
|
+
end
|
|
114
|
+
end
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Stigg
|
|
4
|
+
module Models
|
|
5
|
+
module V1
|
|
6
|
+
# @see Stigg::Resources::V1::Usage#report
|
|
7
|
+
class UsageReportResponse < Stigg::Internal::Type::BaseModel
|
|
8
|
+
# @!attribute data
|
|
9
|
+
# Array of usage measurements with current values and period info
|
|
10
|
+
#
|
|
11
|
+
# @return [Array<Stigg::Models::V1::UsageReportResponse::Data>]
|
|
12
|
+
required :data, -> { Stigg::Internal::Type::ArrayOf[Stigg::Models::V1::UsageReportResponse::Data] }
|
|
13
|
+
|
|
14
|
+
# @!method initialize(data:)
|
|
15
|
+
# Response containing reported usage measurements with current usage values,
|
|
16
|
+
# period information, and reset dates for each measurement.
|
|
17
|
+
#
|
|
18
|
+
# @param data [Array<Stigg::Models::V1::UsageReportResponse::Data>] Array of usage measurements with current values and period info
|
|
19
|
+
|
|
20
|
+
class Data < Stigg::Internal::Type::BaseModel
|
|
21
|
+
# @!attribute id
|
|
22
|
+
# Unique identifier for the entity
|
|
23
|
+
#
|
|
24
|
+
# @return [String]
|
|
25
|
+
required :id, String
|
|
26
|
+
|
|
27
|
+
# @!attribute created_at
|
|
28
|
+
# Timestamp of when the record was created
|
|
29
|
+
#
|
|
30
|
+
# @return [Time]
|
|
31
|
+
required :created_at, Time, api_name: :createdAt
|
|
32
|
+
|
|
33
|
+
# @!attribute customer_id
|
|
34
|
+
# Customer id
|
|
35
|
+
#
|
|
36
|
+
# @return [String]
|
|
37
|
+
required :customer_id, String, api_name: :customerId
|
|
38
|
+
|
|
39
|
+
# @!attribute feature_id
|
|
40
|
+
# Feature id
|
|
41
|
+
#
|
|
42
|
+
# @return [String]
|
|
43
|
+
required :feature_id, String, api_name: :featureId
|
|
44
|
+
|
|
45
|
+
# @!attribute timestamp
|
|
46
|
+
# Timestamp
|
|
47
|
+
#
|
|
48
|
+
# @return [Time]
|
|
49
|
+
required :timestamp, Time
|
|
50
|
+
|
|
51
|
+
# @!attribute value
|
|
52
|
+
# The usage measurement record
|
|
53
|
+
#
|
|
54
|
+
# @return [Float]
|
|
55
|
+
required :value, Float
|
|
56
|
+
|
|
57
|
+
# @!attribute current_usage
|
|
58
|
+
# The current measured usage value
|
|
59
|
+
#
|
|
60
|
+
# @return [Float, nil]
|
|
61
|
+
optional :current_usage, Float, api_name: :currentUsage, nil?: true
|
|
62
|
+
|
|
63
|
+
# @!attribute next_reset_date
|
|
64
|
+
# The date when the next usage reset will occur
|
|
65
|
+
#
|
|
66
|
+
# @return [Time, nil]
|
|
67
|
+
optional :next_reset_date, Time, api_name: :nextResetDate, nil?: true
|
|
68
|
+
|
|
69
|
+
# @!attribute resource_id
|
|
70
|
+
# Resource id
|
|
71
|
+
#
|
|
72
|
+
# @return [String, nil]
|
|
73
|
+
optional :resource_id, String, api_name: :resourceId, nil?: true
|
|
74
|
+
|
|
75
|
+
# @!attribute usage_period_end
|
|
76
|
+
# The end date of the usage period in which this measurement resides (for
|
|
77
|
+
# entitlements with a reset period)
|
|
78
|
+
#
|
|
79
|
+
# @return [Time, nil]
|
|
80
|
+
optional :usage_period_end, Time, api_name: :usagePeriodEnd, nil?: true
|
|
81
|
+
|
|
82
|
+
# @!attribute usage_period_start
|
|
83
|
+
# The start date of the usage period in which this measurement resides (for
|
|
84
|
+
# entitlements with a reset period)
|
|
85
|
+
#
|
|
86
|
+
# @return [Time, nil]
|
|
87
|
+
optional :usage_period_start, Time, api_name: :usagePeriodStart, nil?: true
|
|
88
|
+
|
|
89
|
+
# @!method initialize(id:, created_at:, customer_id:, feature_id:, timestamp:, value:, current_usage: nil, next_reset_date: nil, resource_id: nil, usage_period_end: nil, usage_period_start: nil)
|
|
90
|
+
# Some parameter documentations has been truncated, see
|
|
91
|
+
# {Stigg::Models::V1::UsageReportResponse::Data} for more details.
|
|
92
|
+
#
|
|
93
|
+
# Recorded usage with period info
|
|
94
|
+
#
|
|
95
|
+
# @param id [String] Unique identifier for the entity
|
|
96
|
+
#
|
|
97
|
+
# @param created_at [Time] Timestamp of when the record was created
|
|
98
|
+
#
|
|
99
|
+
# @param customer_id [String] Customer id
|
|
100
|
+
#
|
|
101
|
+
# @param feature_id [String] Feature id
|
|
102
|
+
#
|
|
103
|
+
# @param timestamp [Time] Timestamp
|
|
104
|
+
#
|
|
105
|
+
# @param value [Float] The usage measurement record
|
|
106
|
+
#
|
|
107
|
+
# @param current_usage [Float, nil] The current measured usage value
|
|
108
|
+
#
|
|
109
|
+
# @param next_reset_date [Time, nil] The date when the next usage reset will occur
|
|
110
|
+
#
|
|
111
|
+
# @param resource_id [String, nil] Resource id
|
|
112
|
+
#
|
|
113
|
+
# @param usage_period_end [Time, nil] The end date of the usage period in which this measurement resides (for entitlem
|
|
114
|
+
#
|
|
115
|
+
# @param usage_period_start [Time, nil] The start date of the usage period in which this measurement resides (for entitl
|
|
116
|
+
end
|
|
117
|
+
end
|
|
118
|
+
end
|
|
119
|
+
end
|
|
120
|
+
end
|
data/lib/stigg/models.rb
CHANGED
|
@@ -4,7 +4,7 @@ module Stigg
|
|
|
4
4
|
module Resources
|
|
5
5
|
class V1
|
|
6
6
|
class Coupons
|
|
7
|
-
# Create
|
|
7
|
+
# Create coupon
|
|
8
8
|
#
|
|
9
9
|
# @overload create(id:, amounts_off:, description:, duration_in_months:, name:, percent_off:, additional_meta_data: nil, request_options: {})
|
|
10
10
|
#
|
|
@@ -24,7 +24,7 @@ module Stigg
|
|
|
24
24
|
#
|
|
25
25
|
# @param request_options [Stigg::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
26
26
|
#
|
|
27
|
-
# @return [Stigg::Models::V1::
|
|
27
|
+
# @return [Stigg::Models::V1::Coupon]
|
|
28
28
|
#
|
|
29
29
|
# @see Stigg::Models::V1::CouponCreateParams
|
|
30
30
|
def create(params)
|
|
@@ -33,43 +33,44 @@ module Stigg
|
|
|
33
33
|
method: :post,
|
|
34
34
|
path: "api/v1/coupons",
|
|
35
35
|
body: parsed,
|
|
36
|
-
model: Stigg::
|
|
36
|
+
model: Stigg::V1::Coupon,
|
|
37
37
|
options: options
|
|
38
38
|
)
|
|
39
39
|
end
|
|
40
40
|
|
|
41
|
-
# Get a single
|
|
41
|
+
# Get a single coupon by ID
|
|
42
42
|
#
|
|
43
43
|
# @overload retrieve(id, request_options: {})
|
|
44
44
|
#
|
|
45
|
-
# @param id [String]
|
|
45
|
+
# @param id [String] The unique identifier of the entity
|
|
46
|
+
#
|
|
46
47
|
# @param request_options [Stigg::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
47
48
|
#
|
|
48
|
-
# @return [Stigg::Models::V1::
|
|
49
|
+
# @return [Stigg::Models::V1::Coupon]
|
|
49
50
|
#
|
|
50
51
|
# @see Stigg::Models::V1::CouponRetrieveParams
|
|
51
52
|
def retrieve(id, params = {})
|
|
52
53
|
@client.request(
|
|
53
54
|
method: :get,
|
|
54
55
|
path: ["api/v1/coupons/%1$s", id],
|
|
55
|
-
model: Stigg::
|
|
56
|
+
model: Stigg::V1::Coupon,
|
|
56
57
|
options: params[:request_options]
|
|
57
58
|
)
|
|
58
59
|
end
|
|
59
60
|
|
|
60
|
-
# Get a list of
|
|
61
|
+
# Get a list of coupons
|
|
61
62
|
#
|
|
62
|
-
# @overload list(
|
|
63
|
+
# @overload list(after: nil, before: nil, limit: nil, request_options: {})
|
|
63
64
|
#
|
|
64
|
-
# @param
|
|
65
|
+
# @param after [String] Return items that come after this cursor
|
|
65
66
|
#
|
|
66
|
-
# @param
|
|
67
|
+
# @param before [String] Return items that come before this cursor
|
|
67
68
|
#
|
|
68
|
-
# @param
|
|
69
|
+
# @param limit [Integer] Maximum number of items to return
|
|
69
70
|
#
|
|
70
71
|
# @param request_options [Stigg::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
71
72
|
#
|
|
72
|
-
# @return [Stigg::Models::V1::CouponListResponse]
|
|
73
|
+
# @return [Stigg::Internal::MyCursorIDPage<Stigg::Models::V1::CouponListResponse>]
|
|
73
74
|
#
|
|
74
75
|
# @see Stigg::Models::V1::CouponListParams
|
|
75
76
|
def list(params = {})
|
|
@@ -77,7 +78,8 @@ module Stigg
|
|
|
77
78
|
@client.request(
|
|
78
79
|
method: :get,
|
|
79
80
|
path: "api/v1/coupons",
|
|
80
|
-
query: parsed
|
|
81
|
+
query: parsed,
|
|
82
|
+
page: Stigg::Internal::MyCursorIDPage,
|
|
81
83
|
model: Stigg::Models::V1::CouponListResponse,
|
|
82
84
|
options: options
|
|
83
85
|
)
|
|
@@ -5,11 +5,11 @@ module Stigg
|
|
|
5
5
|
class V1
|
|
6
6
|
class Customers
|
|
7
7
|
class PaymentMethod
|
|
8
|
-
#
|
|
8
|
+
# Attach payment method
|
|
9
9
|
#
|
|
10
10
|
# @overload attach(id, integration_id:, payment_method_id:, vendor_identifier:, billing_currency: nil, request_options: {})
|
|
11
11
|
#
|
|
12
|
-
# @param id [String]
|
|
12
|
+
# @param id [String] The unique identifier of the entity
|
|
13
13
|
#
|
|
14
14
|
# @param integration_id [String] Integration details
|
|
15
15
|
#
|
|
@@ -17,7 +17,7 @@ module Stigg
|
|
|
17
17
|
#
|
|
18
18
|
# @param vendor_identifier [Symbol, Stigg::Models::V1::Customers::PaymentMethodAttachParams::VendorIdentifier] The vendor identifier of integration
|
|
19
19
|
#
|
|
20
|
-
# @param billing_currency [Symbol, Stigg::Models::V1::Customers::PaymentMethodAttachParams::BillingCurrency, nil]
|
|
20
|
+
# @param billing_currency [Symbol, Stigg::Models::V1::Customers::PaymentMethodAttachParams::BillingCurrency, nil] Customers selected currency
|
|
21
21
|
#
|
|
22
22
|
# @param request_options [Stigg::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
23
23
|
#
|
|
@@ -35,11 +35,12 @@ module Stigg
|
|
|
35
35
|
)
|
|
36
36
|
end
|
|
37
37
|
|
|
38
|
-
#
|
|
38
|
+
# Detach payment method
|
|
39
39
|
#
|
|
40
40
|
# @overload detach(id, request_options: {})
|
|
41
41
|
#
|
|
42
|
-
# @param id [String]
|
|
42
|
+
# @param id [String] The unique identifier of the entity
|
|
43
|
+
#
|
|
43
44
|
# @param request_options [Stigg::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
44
45
|
#
|
|
45
46
|
# @return [Stigg::Models::V1::CustomerResponse]
|
|
@@ -4,54 +4,54 @@ module Stigg
|
|
|
4
4
|
module Resources
|
|
5
5
|
class V1
|
|
6
6
|
class Customers
|
|
7
|
-
class
|
|
8
|
-
# Create a
|
|
7
|
+
class PromotionalEntitlements
|
|
8
|
+
# Create a promotional entitlements
|
|
9
9
|
#
|
|
10
|
-
# @overload
|
|
10
|
+
# @overload grant(customer_id, promotional_entitlements:, request_options: {})
|
|
11
11
|
#
|
|
12
|
-
# @param customer_id [String] The unique identifier of the
|
|
12
|
+
# @param customer_id [String] The unique identifier of the customer
|
|
13
13
|
#
|
|
14
|
-
# @param promotional_entitlements [Array<Stigg::Models::V1::Customers::
|
|
14
|
+
# @param promotional_entitlements [Array<Stigg::Models::V1::Customers::PromotionalEntitlementGrantParams::PromotionalEntitlement>] Promotional entitlements to grant
|
|
15
15
|
#
|
|
16
16
|
# @param request_options [Stigg::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
17
17
|
#
|
|
18
|
-
# @return [Stigg::Models::V1::Customers::
|
|
18
|
+
# @return [Stigg::Models::V1::Customers::PromotionalEntitlementGrantResponse]
|
|
19
19
|
#
|
|
20
|
-
# @see Stigg::Models::V1::Customers::
|
|
21
|
-
def
|
|
22
|
-
parsed, options = Stigg::V1::Customers::
|
|
20
|
+
# @see Stigg::Models::V1::Customers::PromotionalEntitlementGrantParams
|
|
21
|
+
def grant(customer_id, params)
|
|
22
|
+
parsed, options = Stigg::V1::Customers::PromotionalEntitlementGrantParams.dump_request(params)
|
|
23
23
|
@client.request(
|
|
24
24
|
method: :post,
|
|
25
25
|
path: ["api/v1/customers/%1$s/promotional", customer_id],
|
|
26
26
|
body: parsed,
|
|
27
|
-
model: Stigg::Models::V1::Customers::
|
|
27
|
+
model: Stigg::Models::V1::Customers::PromotionalEntitlementGrantResponse,
|
|
28
28
|
options: options
|
|
29
29
|
)
|
|
30
30
|
end
|
|
31
31
|
|
|
32
|
-
#
|
|
32
|
+
# Revoke promotional entitlement
|
|
33
33
|
#
|
|
34
34
|
# @overload revoke(feature_id, customer_id:, request_options: {})
|
|
35
35
|
#
|
|
36
36
|
# @param feature_id [String] The unique identifier of the entitlement feature
|
|
37
37
|
#
|
|
38
|
-
# @param customer_id [String] The unique identifier of the
|
|
38
|
+
# @param customer_id [String] The unique identifier of the customer
|
|
39
39
|
#
|
|
40
40
|
# @param request_options [Stigg::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
41
41
|
#
|
|
42
|
-
# @return [Stigg::Models::V1::Customers::
|
|
42
|
+
# @return [Stigg::Models::V1::Customers::PromotionalEntitlementRevokeResponse]
|
|
43
43
|
#
|
|
44
|
-
# @see Stigg::Models::V1::Customers::
|
|
44
|
+
# @see Stigg::Models::V1::Customers::PromotionalEntitlementRevokeParams
|
|
45
45
|
def revoke(feature_id, params)
|
|
46
|
-
parsed, options = Stigg::V1::Customers::
|
|
46
|
+
parsed, options = Stigg::V1::Customers::PromotionalEntitlementRevokeParams.dump_request(params)
|
|
47
47
|
customer_id =
|
|
48
48
|
parsed.delete(:customer_id) do
|
|
49
49
|
raise ArgumentError.new("missing required path argument #{_1}")
|
|
50
50
|
end
|
|
51
51
|
@client.request(
|
|
52
52
|
method: :delete,
|
|
53
|
-
path: ["api/v1/customers/%1$s/promotional
|
|
54
|
-
model: Stigg::Models::V1::Customers::
|
|
53
|
+
path: ["api/v1/customers/%1$s/promotional/%2$s", customer_id, feature_id],
|
|
54
|
+
model: Stigg::Models::V1::Customers::PromotionalEntitlementRevokeResponse,
|
|
55
55
|
options: options
|
|
56
56
|
)
|
|
57
57
|
end
|