Skip to content
Draft
Show file tree
Hide file tree
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
24 changes: 12 additions & 12 deletions account.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,18 @@ type Account struct {

// AccountUpdateOptions fields are those accepted by UpdateAccount
type AccountUpdateOptions struct {
Address1 string `json:"address_1,omitempty"`
Address2 string `json:"address_2,omitempty"`
City string `json:"city,omitempty"`
Company string `json:"company,omitempty"`
Country string `json:"country,omitempty"`
Email string `json:"email,omitempty"`
FirstName string `json:"first_name,omitempty"`
LastName string `json:"last_name,omitempty"`
Phone string `json:"phone,omitempty"`
State string `json:"state,omitempty"`
TaxID string `json:"tax_id,omitempty"`
Zip string `json:"zip,omitempty"`
Address1 string `json:"address_1,omitzero"`
Address2 string `json:"address_2,omitzero"`
City string `json:"city,omitzero"`
Company string `json:"company,omitzero"`
Country string `json:"country,omitzero"`
Email string `json:"email,omitzero"`
FirstName string `json:"first_name,omitzero"`
LastName string `json:"last_name,omitzero"`
Phone string `json:"phone,omitzero"`
State string `json:"state,omitzero"`
TaxID string `json:"tax_id,omitzero"`
Zip string `json:"zip,omitzero"`
}

// GetUpdateOptions converts an Account to AccountUpdateOptions for use in UpdateAccount
Expand Down
6 changes: 3 additions & 3 deletions account_agreements.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ type AccountAgreements struct {

// AccountAgreementsUpdateOptions fields are those accepted by UpdateAccountAgreements
type AccountAgreementsUpdateOptions struct {
EUModel bool `json:"eu_model,omitempty"`
MasterServiceAgreement bool `json:"master_service_agreement,omitempty"`
PrivacyPolicy bool `json:"privacy_policy,omitempty"`
EUModel bool `json:"eu_model,omitzero"`
MasterServiceAgreement bool `json:"master_service_agreement,omitzero"`
PrivacyPolicy bool `json:"privacy_policy,omitzero"`
}

// GetUpdateOptions converts an AccountAgreements to AccountAgreementsUpdateOptions for use in UpdateAccountAgreements
Expand Down
18 changes: 0 additions & 18 deletions account_events.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,14 +231,6 @@ const (
ActionVPCSubnetCreate EventAction = "subnet_create"
ActionVPCSubnetDelete EventAction = "subnet_delete"
ActionVPCSubnetUpdate EventAction = "subnet_update"

// Deprecated: incorrect spelling,
// to be removed in the next major version release.
ActionVolumeDelte EventAction = "volume_delete"

// Deprecated: incorrect spelling,
// to be removed in the next major version
ActionCreateCardUpdated = ActionCreditCardUpdated
)

// EntityType constants start with Entity and include Linode API Event Entity Types
Expand Down Expand Up @@ -343,16 +335,6 @@ func (c *Client) GetEvent(ctx context.Context, eventID int) (*Event, error) {
return doGETRequest[Event](ctx, c, e)
}

// MarkEventRead marks a single Event as read.
//
// Deprecated: `MarkEventRead` is a deprecated API, please consider using `MarkEventsSeen` instead.
// Please note that the `MarkEventsSeen` API functions differently and will mark all events up to and
// including the referenced event-id as "seen" rather than individual events.
func (c *Client) MarkEventRead(ctx context.Context, event *Event) error {
e := formatAPIPath("account/events/%d/read", event.ID)
return doPOSTRequestNoRequestResponseBody(ctx, c, e)
}

// MarkEventsSeen marks all Events up to and including this Event by ID as seen.
func (c *Client) MarkEventsSeen(ctx context.Context, event *Event) error {
e := formatAPIPath("account/events/%d/seen", event.ID)
Expand Down
4 changes: 0 additions & 4 deletions account_maintenance.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ type AccountMaintenance struct {
NotBefore *time.Time `json:"-"`
StartTime *time.Time `json:"-"`
CompleteTime *time.Time `json:"-"`

// Deprecated: When is a deprecated property
When *time.Time `json:"when"`
}

// Entity represents the entity being affected by maintenance
Expand Down Expand Up @@ -57,7 +54,6 @@ func (accountMaintenance *AccountMaintenance) UnmarshalJSON(b []byte) error {
accountMaintenance.NotBefore = (*time.Time)(p.NotBefore)
accountMaintenance.StartTime = (*time.Time)(p.StartTime)
accountMaintenance.CompleteTime = (*time.Time)(p.CompleteTime)
accountMaintenance.When = (*time.Time)(p.When)

return nil
}
Expand Down
2 changes: 1 addition & 1 deletion account_payments.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type Payment struct {
// PaymentCreateOptions fields are those accepted by CreatePayment
type PaymentCreateOptions struct {
// CVV (Card Verification Value) of the credit card to be used for the Payment
CVV string `json:"cvv,omitempty"`
CVV string `json:"cvv,omitzero"`

// The amount, in US dollars, of the Payment
USD json.Number `json:"usd"`
Expand Down
6 changes: 3 additions & 3 deletions account_settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,17 @@ type AccountSettings struct {
// AccountSettingsUpdateOptions are the updateable account wide flags or plans that effect new resources.
type AccountSettingsUpdateOptions struct {
// The default backups enrollment status for all new Linodes for all users on the account. When enabled, backups are mandatory per instance.
BackupsEnabled *bool `json:"backups_enabled,omitempty"`
BackupsEnabled *bool `json:"backups_enabled,omitzero"`

// The default network helper setting for all new Linodes and Linode Configs for all users on the account.
NetworkHelper *bool `json:"network_helper,omitempty"`
NetworkHelper *bool `json:"network_helper,omitzero"`

// NOTE: Interfaces for new linode setting may not currently be available to all users.
// A new configuration flag defines whether new Linodes can use Linode and/or legacy config interfaces.
InterfacesForNewLinodes *InterfacesForNewLinodes `json:"interfaces_for_new_linodes"`

// The slug of the maintenance policy to set the account to.
MaintenancePolicy *string `json:"maintenance_policy,omitempty"`
MaintenancePolicy *string `json:"maintenance_policy,omitzero"`
}

// GetAccountSettings gets the account wide flags or plans that effect new resources
Expand Down
22 changes: 11 additions & 11 deletions account_user_grants.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,17 @@ type UserGrants struct {
}

type UserGrantsUpdateOptions struct {
Database []GrantedEntity `json:"database,omitempty"`
Domain []EntityUserGrant `json:"domain,omitempty"`
Firewall []EntityUserGrant `json:"firewall,omitempty"`
Image []EntityUserGrant `json:"image,omitempty"`
Linode []EntityUserGrant `json:"linode,omitempty"`
Longview []EntityUserGrant `json:"longview,omitempty"`
NodeBalancer []EntityUserGrant `json:"nodebalancer,omitempty"`
PlacementGroup []EntityUserGrant `json:"placement_group,omitempty"`
StackScript []EntityUserGrant `json:"stackscript,omitempty"`
Volume []EntityUserGrant `json:"volume,omitempty"`
VPC []EntityUserGrant `json:"vpc,omitempty"`
Database []GrantedEntity `json:"database,omitzero"`
Domain []EntityUserGrant `json:"domain,omitzero"`
Firewall []EntityUserGrant `json:"firewall,omitzero"`
Image []EntityUserGrant `json:"image,omitzero"`
Linode []EntityUserGrant `json:"linode,omitzero"`
Longview []EntityUserGrant `json:"longview,omitzero"`
NodeBalancer []EntityUserGrant `json:"nodebalancer,omitzero"`
PlacementGroup []EntityUserGrant `json:"placement_group,omitzero"`
StackScript []EntityUserGrant `json:"stackscript,omitzero"`
Volume []EntityUserGrant `json:"volume,omitzero"`
VPC []EntityUserGrant `json:"vpc,omitzero"`

Global GlobalUserGrants `json:"global"`
}
Expand Down
6 changes: 3 additions & 3 deletions account_users.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ type UserCreateOptions struct {

// UserUpdateOptions fields are those accepted by UpdateUser
type UserUpdateOptions struct {
Username string `json:"username,omitempty"`
Restricted *bool `json:"restricted,omitempty"`
Email string `json:"email,omitempty"`
Username string `json:"username,omitzero"`
Restricted *bool `json:"restricted,omitzero"`
Email string `json:"email,omitzero"`
}

// UnmarshalJSON implements the json.Unmarshaler interface
Expand Down
Loading
Loading