diff --git a/github/apps_marketplace.go b/github/apps_marketplace.go index 82530136842..32889abd240 100644 --- a/github/apps_marketplace.go +++ b/github/apps_marketplace.go @@ -46,6 +46,7 @@ type MarketplacePlan struct { // MarketplacePurchase represents a GitHub Apps Marketplace Purchase. type MarketplacePurchase struct { + Account *MarketplacePurchaseAccount `json:"account,omitempty"` // BillingCycle can be one of the values "yearly", "monthly" or nil. BillingCycle *string `json:"billing_cycle,omitempty"` NextBillingDate *Timestamp `json:"next_billing_date,omitempty"` @@ -75,6 +76,17 @@ type MarketplacePlanAccount struct { MarketplacePendingChange *MarketplacePendingChange `json:"marketplace_pending_change,omitempty"` } +// MarketplacePurchaseAccount represents a GitHub Account (user or organization) for a Purchase. +type MarketplacePurchaseAccount struct { + URL *string `json:"url,omitempty"` + Type *string `json:"type,omitempty"` + ID *int64 `json:"id,omitempty"` + Login *string `json:"login,omitempty"` + OrganizationBillingEmail *string `json:"organization_billing_email,omitempty"` + Email *string `json:"email,omitempty"` + NodeID *string `json:"node_id,omitempty"` +} + // ListPlans lists all plans for your Marketplace listing. // // GitHub API docs: https://docs.github.com/en/rest/apps#list-plans diff --git a/github/github-accessors.go b/github/github-accessors.go index 3110d8132d8..433d16f3037 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -9174,6 +9174,14 @@ func (m *MarketplacePlanAccount) GetURL() string { return *m.URL } +// GetAccount returns the Account field. +func (m *MarketplacePurchase) GetAccount() *MarketplacePurchaseAccount { + if m == nil { + return nil + } + return m.Account +} + // GetBillingCycle returns the BillingCycle field if it's non-nil, zero value otherwise. func (m *MarketplacePurchase) GetBillingCycle() string { if m == nil || m.BillingCycle == nil { @@ -9230,6 +9238,62 @@ func (m *MarketplacePurchase) GetUpdatedAt() Timestamp { return *m.UpdatedAt } +// GetEmail returns the Email field if it's non-nil, zero value otherwise. +func (m *MarketplacePurchaseAccount) GetEmail() string { + if m == nil || m.Email == nil { + return "" + } + return *m.Email +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (m *MarketplacePurchaseAccount) GetID() int64 { + if m == nil || m.ID == nil { + return 0 + } + return *m.ID +} + +// GetLogin returns the Login field if it's non-nil, zero value otherwise. +func (m *MarketplacePurchaseAccount) GetLogin() string { + if m == nil || m.Login == nil { + return "" + } + return *m.Login +} + +// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise. +func (m *MarketplacePurchaseAccount) GetNodeID() string { + if m == nil || m.NodeID == nil { + return "" + } + return *m.NodeID +} + +// GetOrganizationBillingEmail returns the OrganizationBillingEmail field if it's non-nil, zero value otherwise. +func (m *MarketplacePurchaseAccount) GetOrganizationBillingEmail() string { + if m == nil || m.OrganizationBillingEmail == nil { + return "" + } + return *m.OrganizationBillingEmail +} + +// GetType returns the Type field if it's non-nil, zero value otherwise. +func (m *MarketplacePurchaseAccount) GetType() string { + if m == nil || m.Type == nil { + return "" + } + return *m.Type +} + +// GetURL returns the URL field if it's non-nil, zero value otherwise. +func (m *MarketplacePurchaseAccount) GetURL() string { + if m == nil || m.URL == nil { + return "" + } + return *m.URL +} + // GetAction returns the Action field if it's non-nil, zero value otherwise. func (m *MarketplacePurchaseEvent) GetAction() string { if m == nil || m.Action == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 9457df769ea..dbe7a8e9084 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -10790,6 +10790,13 @@ func TestMarketplacePlanAccount_GetURL(tt *testing.T) { m.GetURL() } +func TestMarketplacePurchase_GetAccount(tt *testing.T) { + m := &MarketplacePurchase{} + m.GetAccount() + m = nil + m.GetAccount() +} + func TestMarketplacePurchase_GetBillingCycle(tt *testing.T) { var zeroValue string m := &MarketplacePurchase{BillingCycle: &zeroValue} @@ -10857,6 +10864,76 @@ func TestMarketplacePurchase_GetUpdatedAt(tt *testing.T) { m.GetUpdatedAt() } +func TestMarketplacePurchaseAccount_GetEmail(tt *testing.T) { + var zeroValue string + m := &MarketplacePurchaseAccount{Email: &zeroValue} + m.GetEmail() + m = &MarketplacePurchaseAccount{} + m.GetEmail() + m = nil + m.GetEmail() +} + +func TestMarketplacePurchaseAccount_GetID(tt *testing.T) { + var zeroValue int64 + m := &MarketplacePurchaseAccount{ID: &zeroValue} + m.GetID() + m = &MarketplacePurchaseAccount{} + m.GetID() + m = nil + m.GetID() +} + +func TestMarketplacePurchaseAccount_GetLogin(tt *testing.T) { + var zeroValue string + m := &MarketplacePurchaseAccount{Login: &zeroValue} + m.GetLogin() + m = &MarketplacePurchaseAccount{} + m.GetLogin() + m = nil + m.GetLogin() +} + +func TestMarketplacePurchaseAccount_GetNodeID(tt *testing.T) { + var zeroValue string + m := &MarketplacePurchaseAccount{NodeID: &zeroValue} + m.GetNodeID() + m = &MarketplacePurchaseAccount{} + m.GetNodeID() + m = nil + m.GetNodeID() +} + +func TestMarketplacePurchaseAccount_GetOrganizationBillingEmail(tt *testing.T) { + var zeroValue string + m := &MarketplacePurchaseAccount{OrganizationBillingEmail: &zeroValue} + m.GetOrganizationBillingEmail() + m = &MarketplacePurchaseAccount{} + m.GetOrganizationBillingEmail() + m = nil + m.GetOrganizationBillingEmail() +} + +func TestMarketplacePurchaseAccount_GetType(tt *testing.T) { + var zeroValue string + m := &MarketplacePurchaseAccount{Type: &zeroValue} + m.GetType() + m = &MarketplacePurchaseAccount{} + m.GetType() + m = nil + m.GetType() +} + +func TestMarketplacePurchaseAccount_GetURL(tt *testing.T) { + var zeroValue string + m := &MarketplacePurchaseAccount{URL: &zeroValue} + m.GetURL() + m = &MarketplacePurchaseAccount{} + m.GetURL() + m = nil + m.GetURL() +} + func TestMarketplacePurchaseEvent_GetAction(tt *testing.T) { var zeroValue string m := &MarketplacePurchaseEvent{Action: &zeroValue}