Skip to content

Commit

Permalink
feat(api)!: rename model property 'StatementAccountStanding.State' to…
Browse files Browse the repository at this point in the history
… 'PeriodState' (#334)

# Migration
If you were relying on `StatementAccountStanding.State`, use `PeriodState` instead.
Its type has also been renamed from `StatementAccountStandingStage` to `StatementAccountStandingPeriodState`.
Note: while it is technically breaking changes we do not expect that anyone was relying on the previous names.
  • Loading branch information
stainless-app[bot] authored Aug 9, 2024
1 parent 5e9c1de commit f59b382
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions financialaccountstatement.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,16 +158,16 @@ func (r statementJSON) RawJSON() string {

type StatementAccountStanding struct {
// Current overall period number
PeriodNumber int64 `json:"period_number,required"`
State StatementAccountStandingState `json:"state,required"`
JSON statementAccountStandingJSON `json:"-"`
PeriodNumber int64 `json:"period_number,required"`
PeriodState StatementAccountStandingPeriodState `json:"period_state,required"`
JSON statementAccountStandingJSON `json:"-"`
}

// statementAccountStandingJSON contains the JSON metadata for the struct
// [StatementAccountStanding]
type statementAccountStandingJSON struct {
PeriodNumber apijson.Field
State apijson.Field
PeriodState apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
Expand All @@ -180,17 +180,17 @@ func (r statementAccountStandingJSON) RawJSON() string {
return r.raw
}

type StatementAccountStandingState string
type StatementAccountStandingPeriodState string

const (
StatementAccountStandingStateStandard StatementAccountStandingState = "STANDARD"
StatementAccountStandingStatePromo StatementAccountStandingState = "PROMO"
StatementAccountStandingStatePenalty StatementAccountStandingState = "PENALTY"
StatementAccountStandingPeriodStateStandard StatementAccountStandingPeriodState = "STANDARD"
StatementAccountStandingPeriodStatePromo StatementAccountStandingPeriodState = "PROMO"
StatementAccountStandingPeriodStatePenalty StatementAccountStandingPeriodState = "PENALTY"
)

func (r StatementAccountStandingState) IsKnown() bool {
func (r StatementAccountStandingPeriodState) IsKnown() bool {
switch r {
case StatementAccountStandingStateStandard, StatementAccountStandingStatePromo, StatementAccountStandingStatePenalty:
case StatementAccountStandingPeriodStateStandard, StatementAccountStandingPeriodStatePromo, StatementAccountStandingPeriodStatePenalty:
return true
}
return false
Expand Down

0 comments on commit f59b382

Please sign in to comment.