Skip to content

Commit

Permalink
feat: new client machine policies
Browse files Browse the repository at this point in the history
  • Loading branch information
tothegills committed Oct 17, 2023
1 parent d19f85f commit 341b725
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/machines/machine_policy_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ func NewMachinePolicyService(sling *sling.Sling, uriTemplate string, templatePat
}

// Add creates a new machine policy.
//
// Deprecated: use machinepolicies.Add
func (s *MachinePolicyService) Add(machinePolicy *MachinePolicy) (*MachinePolicy, error) {
if IsNil(machinePolicy) {
return nil, internal.CreateInvalidParameterError(constants.OperationAdd, constants.ParameterMachinePolicy)
Expand All @@ -46,6 +48,8 @@ func (s *MachinePolicyService) Add(machinePolicy *MachinePolicy) (*MachinePolicy
// Get returns a collection of machine policies based on the criteria defined
// by its input query parameter. If an error occurs, an empty collection is
// returned along with the associated error.
//
// Deprecated: use machinepolicies.Get
func (s *MachinePolicyService) Get(machinePoliciesQuery MachinePoliciesQuery) (*resources.Resources[*MachinePolicy], error) {
path, err := s.GetURITemplate().Expand(machinePoliciesQuery)
if err != nil {
Expand Down Expand Up @@ -75,6 +79,8 @@ func (s *MachinePolicyService) GetAll() ([]*MachinePolicy, error) {

// GetByID returns the machine policy that matches the input ID. If one cannot
// be found, it returns nil and an error.
//
// Deprecated: use machinepolicies.GetByID
func (s *MachinePolicyService) GetByID(id string) (*MachinePolicy, error) {
if internal.IsEmpty(id) {
return nil, internal.CreateInvalidParameterError(constants.OperationGetByID, constants.ParameterID)
Expand Down Expand Up @@ -118,6 +124,8 @@ func (s *MachinePolicyService) GetTemplate() (*MachinePolicy, error) {
}

// Update modifies a machine policy based on the one provided as input.
//
// Deprecated: use machinepolicies.Update
func (s *MachinePolicyService) Update(machinePolicy *MachinePolicy) (*MachinePolicy, error) {
path, err := services.GetUpdatePath(s, machinePolicy)
if err != nil {
Expand Down

0 comments on commit 341b725

Please sign in to comment.