patch

package
v1.0.0-beta.206 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 4, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Deserialize

func Deserialize(b []byte) (any, error)

Deserialization of patches

Types

type PatchAddItem

type PatchAddItem struct {
	PhaseKey    string
	ItemKey     string
	CreateInput subscription.SubscriptionItemSpec
}

func (PatchAddItem) ApplyTo

func (PatchAddItem) MarshalJSON

func (p PatchAddItem) MarshalJSON() ([]byte, error)

func (PatchAddItem) Op

func (PatchAddItem) Path

func (PatchAddItem) Validate

func (a PatchAddItem) Validate() error

func (PatchAddItem) Value

func (PatchAddItem) ValueAsAny

func (a PatchAddItem) ValueAsAny() any

type PatchAddPhase

type PatchAddPhase struct {
	PhaseKey    string
	CreateInput subscription.CreateSubscriptionPhaseInput
}

func (PatchAddPhase) ApplyTo

func (PatchAddPhase) MarshalJSON

func (p PatchAddPhase) MarshalJSON() ([]byte, error)

func (PatchAddPhase) Op

func (PatchAddPhase) Path

func (PatchAddPhase) Validate

func (a PatchAddPhase) Validate() error

func (PatchAddPhase) Value

func (PatchAddPhase) ValueAsAny

func (a PatchAddPhase) ValueAsAny() any

type PatchRemoveItem

type PatchRemoveItem struct {
	PhaseKey string
	ItemKey  string
}

func (PatchRemoveItem) ApplyTo

RemoveItem removes the last version for the provided key

func (PatchRemoveItem) MarshalJSON

func (p PatchRemoveItem) MarshalJSON() ([]byte, error)

func (PatchRemoveItem) Op

func (PatchRemoveItem) Path

func (PatchRemoveItem) Validate

func (r PatchRemoveItem) Validate() error

type PatchRemovePhase

type PatchRemovePhase struct {
	PhaseKey    string
	RemoveInput subscription.RemoveSubscriptionPhaseInput
}

func (PatchRemovePhase) ApplyTo

func (PatchRemovePhase) MarshalJSON

func (p PatchRemovePhase) MarshalJSON() ([]byte, error)

func (PatchRemovePhase) Op

func (PatchRemovePhase) Path

func (PatchRemovePhase) Validate

func (r PatchRemovePhase) Validate() error

func (PatchRemovePhase) Value

func (PatchRemovePhase) ValueAsAny

func (r PatchRemovePhase) ValueAsAny() any

type PatchStretchPhase

type PatchStretchPhase struct {
	PhaseKey string
	// Signed duration
	Duration isodate.Period
}

func (PatchStretchPhase) ApplyTo

func (PatchStretchPhase) MarshalJSON

func (p PatchStretchPhase) MarshalJSON() ([]byte, error)

func (PatchStretchPhase) Op

func (PatchStretchPhase) Path

func (PatchStretchPhase) Validate

func (p PatchStretchPhase) Validate() error

func (PatchStretchPhase) Value

func (p PatchStretchPhase) Value() isodate.Period

func (PatchStretchPhase) ValueAsAny

func (p PatchStretchPhase) ValueAsAny() any

type PatchUnscheduleEdit

type PatchUnscheduleEdit struct{}

func (PatchUnscheduleEdit) ApplyTo

"Unscheduling an edit" is a concept that might intuitively makes sense for clients: 1. Making some edit to a subscription 2. You want to do another edit 3. Your edit discards the previous edit

However, this is not really a behavior that makes sense from a server perspective. The compromise we make is that, for most cases, when a client wants to unschedule an edit, all they really want to do is get rid of any future changes to the subscription.

As editing future phases doesn't create multiple versions of the items (see AddItem and RemoveItem), we only tackle editing the current phase.

UnscheduleEdit simply removes all scheduled versions of the items in the current phase.

func (PatchUnscheduleEdit) MarshalJSON

func (p PatchUnscheduleEdit) MarshalJSON() ([]byte, error)

func (PatchUnscheduleEdit) Op

func (PatchUnscheduleEdit) Path

func (PatchUnscheduleEdit) Validate

func (p PatchUnscheduleEdit) Validate() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL