-
Notifications
You must be signed in to change notification settings - Fork 552
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1360 from stripe/latest-codegen-beta
Update generated code for beta
- Loading branch information
Showing
26 changed files
with
428 additions
and
121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
v857 | ||
v879 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
# File generated from our OpenAPI spec | ||
# frozen_string_literal: true | ||
|
||
module Stripe | ||
module Billing | ||
# A billing meter is a resource that allows you to track usage of a particular event. For example, you might create a billing meter to track the number of API calls made by a particular user. You can then use the billing meter to charge the user for the number of API calls they make. | ||
class Meter < APIResource | ||
extend Stripe::APIOperations::Create | ||
extend Stripe::APIOperations::List | ||
extend Stripe::APIOperations::NestedResource | ||
include Stripe::APIOperations::Save | ||
|
||
OBJECT_NAME = "billing.meter" | ||
def self.object_name | ||
"billing.meter" | ||
end | ||
|
||
nested_resource_class_methods :event_summary, | ||
operations: %i[list], | ||
resource_plural: "event_summaries" | ||
|
||
# Creates a billing meter | ||
def self.create(params = {}, opts = {}) | ||
request_stripe_object(method: :post, path: "/v1/billing/meters", params: params, opts: opts) | ||
end | ||
|
||
# Deactivates a billing meter | ||
def deactivate(params = {}, opts = {}) | ||
request_stripe_object( | ||
method: :post, | ||
path: format("/v1/billing/meters/%<id>s/deactivate", { id: CGI.escape(self["id"]) }), | ||
params: params, | ||
opts: opts | ||
) | ||
end | ||
|
||
# Deactivates a billing meter | ||
def self.deactivate(id, params = {}, opts = {}) | ||
request_stripe_object( | ||
method: :post, | ||
path: format("/v1/billing/meters/%<id>s/deactivate", { id: CGI.escape(id) }), | ||
params: params, | ||
opts: opts | ||
) | ||
end | ||
|
||
# Retrieve a list of billing meters. | ||
def self.list(filters = {}, opts = {}) | ||
request_stripe_object(method: :get, path: "/v1/billing/meters", params: filters, opts: opts) | ||
end | ||
|
||
# Reactivates a billing meter | ||
def reactivate(params = {}, opts = {}) | ||
request_stripe_object( | ||
method: :post, | ||
path: format("/v1/billing/meters/%<id>s/reactivate", { id: CGI.escape(self["id"]) }), | ||
params: params, | ||
opts: opts | ||
) | ||
end | ||
|
||
# Reactivates a billing meter | ||
def self.reactivate(id, params = {}, opts = {}) | ||
request_stripe_object( | ||
method: :post, | ||
path: format("/v1/billing/meters/%<id>s/reactivate", { id: CGI.escape(id) }), | ||
params: params, | ||
opts: opts | ||
) | ||
end | ||
|
||
# Updates a billing meter | ||
def self.update(id, params = {}, opts = {}) | ||
request_stripe_object( | ||
method: :post, | ||
path: format("/v1/billing/meters/%<id>s", { id: CGI.escape(id) }), | ||
params: params, | ||
opts: opts | ||
) | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# File generated from our OpenAPI spec | ||
# frozen_string_literal: true | ||
|
||
module Stripe | ||
module Billing | ||
# A billing meter event represents a customer's usage of a product. Meter events are used to bill a customer based on their usage. | ||
# Meter events are associated with billing meters, which define the shape of the event's payload and how those events are aggregated for billing. | ||
class MeterEvent < APIResource | ||
extend Stripe::APIOperations::Create | ||
|
||
OBJECT_NAME = "billing.meter_event" | ||
def self.object_name | ||
"billing.meter_event" | ||
end | ||
|
||
# Creates a billing meter event | ||
def self.create(params = {}, opts = {}) | ||
request_stripe_object( | ||
method: :post, | ||
path: "/v1/billing/meter_events", | ||
params: params, | ||
opts: opts | ||
) | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# File generated from our OpenAPI spec | ||
# frozen_string_literal: true | ||
|
||
module Stripe | ||
module Billing | ||
# A billing meter event adjustment represents the status of a meter event adjustment. | ||
class MeterEventAdjustment < APIResource | ||
extend Stripe::APIOperations::Create | ||
|
||
OBJECT_NAME = "billing.meter_event_adjustment" | ||
def self.object_name | ||
"billing.meter_event_adjustment" | ||
end | ||
|
||
# Creates a billing meter event adjustment | ||
def self.create(params = {}, opts = {}) | ||
request_stripe_object( | ||
method: :post, | ||
path: "/v1/billing/meter_event_adjustments", | ||
params: params, | ||
opts: opts | ||
) | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# File generated from our OpenAPI spec | ||
# frozen_string_literal: true | ||
|
||
module Stripe | ||
module Billing | ||
# A billing meter event summary represents an aggregated view of a customer's billing meter events within a specified timeframe. It indicates how much | ||
# usage was accrued by a customer for that period. | ||
class MeterEventSummary < APIResource | ||
OBJECT_NAME = "billing.meter_event_summary" | ||
def self.object_name | ||
"billing.meter_event_summary" | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.