Skip to content

Commit

Permalink
Merge pull request #1848 from stripe/latest-codegen-beta
Browse files Browse the repository at this point in the history
Update generated code for beta
  • Loading branch information
stripe-openapi[bot] authored Apr 18, 2024
2 parents fb93fe3 + 5d26051 commit 6d66a48
Show file tree
Hide file tree
Showing 20 changed files with 282 additions and 41 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## 78.2.0 - 2024-04-16
* [#1847](https://github.com/stripe/stripe-go/pull/1847) Update generated code
* Add support for new resource `Entitlements.ActiveEntitlementSummary`
* Add support for `Balances` and `PayoutsList` on `AccountSessionComponentsParams` and `AccountSessionComponents`
* Add support for new value `entitlements.active_entitlement_summary.updated` on enum `EventType`
* Remove support for `Config` on `ForwardingRequestParams` and `ForwardingRequest`. This field is no longer used by the Forwarding Request API.
* Add support for `CaptureMethod` on `PaymentIntentConfirmPaymentMethodOptionsRevolutPayParams`, `PaymentIntentPaymentMethodOptionsRevolutPayParams`, and `PaymentIntentPaymentMethodOptionsRevolutPay`
* Add support for `Swish` on `PaymentMethodConfigurationParams` and `PaymentMethodConfiguration`

## 78.2.0-beta.1 - 2024-04-11
* [#1843](https://github.com/stripe/stripe-go/pull/1843) Update generated code for beta
* Add support for `Get` method on resources `Entitlements.ActiveEntitlement` and `Entitlements.Feature`
Expand Down
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v951
v972
97 changes: 96 additions & 1 deletion accountsession.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,24 @@ type AccountSessionComponentsAccountOnboardingParams struct {
Features *AccountSessionComponentsAccountOnboardingFeaturesParams `form:"features"`
}

// The list of features enabled in the embedded component.
type AccountSessionComponentsBalancesFeaturesParams struct {
// Whether to allow payout schedule to be changed. Default `true` when Stripe owns Loss Liability, default `false` otherwise.
EditPayoutSchedule *bool `form:"edit_payout_schedule"`
// Whether to allow creation of instant payouts. Default `true` when Stripe owns Loss Liability, default `false` otherwise.
InstantPayouts *bool `form:"instant_payouts"`
// Whether to allow creation of standard payouts. Default `true` when Stripe owns Loss Liability, default `false` otherwise.
StandardPayouts *bool `form:"standard_payouts"`
}

// Configuration for the balances embedded component.
type AccountSessionComponentsBalancesParams struct {
// Whether the embedded component is enabled.
Enabled *bool `form:"enabled"`
// The list of features enabled in the embedded component.
Features *AccountSessionComponentsBalancesFeaturesParams `form:"features"`
}

// The list of features enabled in the embedded component.
type AccountSessionComponentsCapitalFinancingPromotionFeaturesParams struct{}
type AccountSessionComponentsCapitalFinancingPromotionParams struct {
Expand All @@ -43,6 +61,17 @@ type AccountSessionComponentsCapitalFinancingPromotionParams struct {
Features *AccountSessionComponentsCapitalFinancingPromotionFeaturesParams `form:"features"`
}

// The list of features enabled in the embedded component.
type AccountSessionComponentsCapitalOverviewFeaturesParams struct{}

// Configuration for the capital overview embedded component.
type AccountSessionComponentsCapitalOverviewParams struct {
// Whether the embedded component is enabled.
Enabled *bool `form:"enabled"`
// The list of features enabled in the embedded component.
Features *AccountSessionComponentsCapitalOverviewFeaturesParams `form:"features"`
}

// The list of features enabled in the embedded component.
type AccountSessionComponentsDocumentsFeaturesParams struct{}

Expand All @@ -54,6 +83,8 @@ type AccountSessionComponentsDocumentsParams struct {
Features *AccountSessionComponentsDocumentsFeaturesParams `form:"features"`
}
type AccountSessionComponentsFinancialAccountFeaturesParams struct {
// Whether to allow external accounts to be linked for money transfer.
ExternalAccountCollection *bool `form:"external_account_collection"`
// Whether to allow money movement features.
MoneyMovement *bool `form:"money_movement"`
}
Expand Down Expand Up @@ -175,13 +206,50 @@ type AccountSessionComponentsPayoutsParams struct {
Features *AccountSessionComponentsPayoutsFeaturesParams `form:"features"`
}

// The list of features enabled in the embedded component.
type AccountSessionComponentsPayoutsListFeaturesParams struct{}

// Configuration for the payouts list embedded component.
type AccountSessionComponentsPayoutsListParams struct {
// Whether the embedded component is enabled.
Enabled *bool `form:"enabled"`
// The list of features enabled in the embedded component.
Features *AccountSessionComponentsPayoutsListFeaturesParams `form:"features"`
}

// The list of features enabled in the embedded component.
type AccountSessionComponentsTaxRegistrationsFeaturesParams struct{}

// Configuration for the tax registrations embedded component.
type AccountSessionComponentsTaxRegistrationsParams struct {
// Whether the embedded component is enabled.
Enabled *bool `form:"enabled"`
// The list of features enabled in the embedded component.
Features *AccountSessionComponentsTaxRegistrationsFeaturesParams `form:"features"`
}

// The list of features enabled in the embedded component.
type AccountSessionComponentsTaxSettingsFeaturesParams struct{}

// Configuration for the tax settings embedded component.
type AccountSessionComponentsTaxSettingsParams struct {
// Whether the embedded component is enabled.
Enabled *bool `form:"enabled"`
// The list of features enabled in the embedded component.
Features *AccountSessionComponentsTaxSettingsFeaturesParams `form:"features"`
}

// Each key of the dictionary represents an embedded component, and each embedded component maps to its configuration (e.g. whether it has been enabled or not).
type AccountSessionComponentsParams struct {
// Configuration for the account management embedded component.
AccountManagement *AccountSessionComponentsAccountManagementParams `form:"account_management"`
// Configuration for the account onboarding embedded component.
AccountOnboarding *AccountSessionComponentsAccountOnboardingParams `form:"account_onboarding"`
AccountOnboarding *AccountSessionComponentsAccountOnboardingParams `form:"account_onboarding"`
// Configuration for the balances embedded component.
Balances *AccountSessionComponentsBalancesParams `form:"balances"`
CapitalFinancingPromotion *AccountSessionComponentsCapitalFinancingPromotionParams `form:"capital_financing_promotion"`
// Configuration for the capital overview embedded component.
CapitalOverview *AccountSessionComponentsCapitalOverviewParams `form:"capital_overview"`
// Configuration for the documents embedded component.
Documents *AccountSessionComponentsDocumentsParams `form:"documents"`
// Configuration for the financial account component.
Expand All @@ -200,6 +268,12 @@ type AccountSessionComponentsParams struct {
Payments *AccountSessionComponentsPaymentsParams `form:"payments"`
// Configuration for the payouts embedded component.
Payouts *AccountSessionComponentsPayoutsParams `form:"payouts"`
// Configuration for the payouts list embedded component.
PayoutsList *AccountSessionComponentsPayoutsListParams `form:"payouts_list"`
// Configuration for the tax registrations embedded component.
TaxRegistrations *AccountSessionComponentsTaxRegistrationsParams `form:"tax_registrations"`
// Configuration for the tax settings embedded component.
TaxSettings *AccountSessionComponentsTaxSettingsParams `form:"tax_settings"`
}

// Creates a AccountSession object that includes a single-use token that the platform can use on their front-end to grant client-side API access.
Expand Down Expand Up @@ -236,6 +310,19 @@ type AccountSessionComponentsAccountOnboarding struct {
Enabled bool `json:"enabled"`
Features *AccountSessionComponentsAccountOnboardingFeatures `json:"features"`
}
type AccountSessionComponentsBalancesFeatures struct {
// Whether to allow payout schedule to be changed. Default `true` when Stripe owns Loss Liability, default `false` otherwise.
EditPayoutSchedule bool `json:"edit_payout_schedule"`
// Whether to allow creation of instant payouts. Default `true` when Stripe owns Loss Liability, default `false` otherwise.
InstantPayouts bool `json:"instant_payouts"`
// Whether to allow creation of standard payouts. Default `true` when Stripe owns Loss Liability, default `false` otherwise.
StandardPayouts bool `json:"standard_payouts"`
}
type AccountSessionComponentsBalances struct {
// Whether the embedded component is enabled.
Enabled bool `json:"enabled"`
Features *AccountSessionComponentsBalancesFeatures `json:"features"`
}
type AccountSessionComponentsCapitalFinancingPromotionFeatures struct{}
type AccountSessionComponentsCapitalFinancingPromotion struct {
// Whether the embedded component is enabled.
Expand Down Expand Up @@ -300,15 +387,23 @@ type AccountSessionComponentsPayouts struct {
Enabled bool `json:"enabled"`
Features *AccountSessionComponentsPayoutsFeatures `json:"features"`
}
type AccountSessionComponentsPayoutsListFeatures struct{}
type AccountSessionComponentsPayoutsList struct {
// Whether the embedded component is enabled.
Enabled bool `json:"enabled"`
Features *AccountSessionComponentsPayoutsListFeatures `json:"features"`
}
type AccountSessionComponents struct {
AccountManagement *AccountSessionComponentsAccountManagement `json:"account_management"`
AccountOnboarding *AccountSessionComponentsAccountOnboarding `json:"account_onboarding"`
Balances *AccountSessionComponentsBalances `json:"balances"`
CapitalFinancingPromotion *AccountSessionComponentsCapitalFinancingPromotion `json:"capital_financing_promotion"`
Documents *AccountSessionComponentsDocuments `json:"documents"`
NotificationBanner *AccountSessionComponentsNotificationBanner `json:"notification_banner"`
PaymentDetails *AccountSessionComponentsPaymentDetails `json:"payment_details"`
Payments *AccountSessionComponentsPayments `json:"payments"`
Payouts *AccountSessionComponentsPayouts `json:"payouts"`
PayoutsList *AccountSessionComponentsPayoutsList `json:"payouts_list"`
}

// An AccountSession allows a Connect platform to grant access to a connected account in Connect embedded components.
Expand Down
2 changes: 1 addition & 1 deletion api_version.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ package stripe

const (
apiVersion string = "2024-04-10"
previewVersion string = "2024-03-20.preview-v2"
previewVersion string = "2024-04-11.preview-v2"
)
20 changes: 10 additions & 10 deletions billing_meter.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const (
BillingMeterDefaultAggregationFormulaSum BillingMeterDefaultAggregationFormula = "sum"
)

// The time window to pre-aggregate usage events for, if any.
// The time window to pre-aggregate meter events for, if any.
type BillingMeterEventTimeWindow string

// List of values that BillingMeterEventTimeWindow can take
Expand Down Expand Up @@ -65,11 +65,11 @@ type BillingMeterCustomerMappingParams struct {

// The default settings to aggregate a meter's events with.
type BillingMeterDefaultAggregationParams struct {
// Specifies how events are aggregated. Allowed values are `count` to count the number of events, `sum` to sum each event's value, or `last` to use the last event's value.
// Specifies how events are aggregated. Allowed values are `count` to count the number of events and `sum` to sum each event's value.
Formula *string `form:"formula"`
}

// Fields that specify how to calculate a usage event's value.
// Fields that specify how to calculate a meter event's value.
type BillingMeterValueSettingsParams struct {
// The key in the usage event payload to use as the value for this meter. For example, if the event payload contains usage on a `bytes_used` field, then set the event_payload_key to "bytes_used".
EventPayloadKey *string `form:"event_payload_key"`
Expand All @@ -84,13 +84,13 @@ type BillingMeterParams struct {
DefaultAggregation *BillingMeterDefaultAggregationParams `form:"default_aggregation"`
// The meter's name.
DisplayName *string `form:"display_name"`
// The name of the usage event to record usage for. Corresponds with the `event_name` field on usage events.
// The name of the meter event to record usage for. Corresponds with the `event_name` field on meter events.
EventName *string `form:"event_name"`
// The time window to pre-aggregate usage events for, if any.
// The time window to pre-aggregate meter events for, if any.
EventTimeWindow *string `form:"event_time_window"`
// Specifies which fields in the response should be expanded.
Expand []*string `form:"expand"`
// Fields that specify how to calculate a usage event's value.
// Fields that specify how to calculate a meter event's value.
ValueSettings *BillingMeterValueSettingsParams `form:"value_settings"`
}

Expand Down Expand Up @@ -124,7 +124,7 @@ func (p *BillingMeterReactivateParams) AddExpand(f string) {
}

type BillingMeterCustomerMapping struct {
// The key in the usage event payload to use for mapping the event to a customer.
// The key in the meter event payload to use for mapping the event to a customer.
EventPayloadKey string `json:"event_payload_key"`
// The method for mapping a meter event to a customer.
Type BillingMeterCustomerMappingType `json:"type"`
Expand All @@ -138,7 +138,7 @@ type BillingMeterStatusTransitions struct {
DeactivatedAt int64 `json:"deactivated_at"`
}
type BillingMeterValueSettings struct {
// The key in the usage event payload to use as the value for this meter.
// The key in the meter event payload to use as the value for this meter.
EventPayloadKey string `json:"event_payload_key"`
}

Expand All @@ -151,9 +151,9 @@ type BillingMeter struct {
DefaultAggregation *BillingMeterDefaultAggregation `json:"default_aggregation"`
// The meter's name.
DisplayName string `json:"display_name"`
// The name of the usage event to record usage for. Corresponds with the `event_name` field on usage events.
// The name of the meter event to record usage for. Corresponds with the `event_name` field on meter events.
EventName string `json:"event_name"`
// The time window to pre-aggregate usage events for, if any.
// The time window to pre-aggregate meter events for, if any.
EventTimeWindow BillingMeterEventTimeWindow `json:"event_time_window"`
// Unique identifier for the object.
ID string `json:"id"`
Expand Down
6 changes: 3 additions & 3 deletions billing_meterevent.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ type BillingMeterEventParams struct {
Expand []*string `form:"expand"`
// A unique identifier for the event. If not provided, one will be generated. We recommend using a globally unique identifier for this. We'll enforce uniqueness within a rolling 24 hour period.
Identifier *string `form:"identifier"`
// The payload of the event. This must contain a field with the event's numerical value and a field to map the event to a customer.
// The payload of the event. This must contain the fields corresponding to a meter's `customer_mapping.event_payload_key` (default is `stripe_customer_id`) and `value_settings.event_payload_key` (default is `value`). Read more about the [payload](https://docs.stripe.com/billing/subscriptions/usage-based/recording-usage#payload-key-overrides).
Payload map[string]string `form:"payload"`
// The time of the event. Measured in seconds since the Unix epoch.
// The time of the event. Measured in seconds since the Unix epoch. Must be within the past 35 calendar days or up to 5 minutes in the future. Defaults to current timestamp if not specified.
Timestamp *int64 `form:"timestamp"`
}

Expand All @@ -40,7 +40,7 @@ type BillingMeterEvent struct {
Livemode bool `json:"livemode"`
// String representing the object's type. Objects of the same type share the same value.
Object string `json:"object"`
// The payload of the event.
// The payload of the event. This contains the fields corresponding to a meter's `customer_mapping.event_payload_key` (default is `stripe_customer_id`) and `value_settings.event_payload_key` (default is `value`). Read more about the [payload](https://stripe.com/docs/billing/subscriptions/usage-based/recording-usage#payload-key-overrides).
Payload map[string]string `json:"payload"`
// The timestamp passed in when creating the event. Measured in seconds since the Unix epoch.
Timestamp int64 `json:"timestamp"`
Expand Down
12 changes: 6 additions & 6 deletions billing_metereventsummary.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ type BillingMeterEventSummaryListParams struct {
ID *string `form:"-"` // Included in URL
// The customer for which to fetch event summaries.
Customer *string `form:"customer"`
// The timestamp from when to stop aggregating usage events (exclusive).
// The timestamp from when to stop aggregating meter events (exclusive).
EndTime *int64 `form:"end_time"`
// Specifies which fields in the response should be expanded.
Expand []*string `form:"expand"`
// The timestamp from when to start aggregating usage events (inclusive).
// The timestamp from when to start aggregating meter events (inclusive).
StartTime *int64 `form:"start_time"`
// Specifies what granularity to use when generating event summaries. If not specified, a single event summary would be returned for the specified time range.
ValueGroupingWindow *string `form:"value_grouping_window"`
Expand All @@ -30,19 +30,19 @@ func (p *BillingMeterEventSummaryListParams) AddExpand(f string) {
// 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.
type BillingMeterEventSummary struct {
// Aggregated value of all the events within start_time (inclusive) and end_time (inclusive). The aggregation strategy is defined on meter via `default_aggregation``.
// Aggregated value of all the events within `start_time` (inclusive) and `end_time` (inclusive). The aggregation strategy is defined on meter via `default_aggregation`.
AggregatedValue float64 `json:"aggregated_value"`
// End timestamp for this usage summary (inclusive).
// End timestamp for this event summary (inclusive).
EndTime int64 `json:"end_time"`
// Unique identifier for the object.
ID string `json:"id"`
// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
Livemode bool `json:"livemode"`
// The meter associated with this usage summary.
// The meter associated with this event summary.
Meter string `json:"meter"`
// String representing the object's type. Objects of the same type share the same value.
Object string `json:"object"`
// Start timestamp for this usage summary (inclusive).
// Start timestamp for this event summary (inclusive).
StartTime int64 `json:"start_time"`
}

Expand Down
Loading

0 comments on commit 6d66a48

Please sign in to comment.