Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(api)!: rename model property 'StatementAccountStanding.State' to 'PeriodState' #334

Merged
merged 1 commit into from
Aug 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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