dev.azure.com/aidainnovazione0090/DeviceManager/_git/go-mod-core-contracts@v1.0.2/clients/interfaces/interval.go (about)

     1  //
     2  // Copyright (C) 2021 IOTech Ltd
     3  //
     4  // SPDX-License-Identifier: Apache-2.0
     5  
     6  package interfaces
     7  
     8  import (
     9  	"context"
    10  
    11  	"dev.azure.com/aidainnovazione0090/DeviceManager/_git/go-mod-core-contracts/dtos/common"
    12  	"dev.azure.com/aidainnovazione0090/DeviceManager/_git/go-mod-core-contracts/dtos/requests"
    13  	"dev.azure.com/aidainnovazione0090/DeviceManager/_git/go-mod-core-contracts/dtos/responses"
    14  	"dev.azure.com/aidainnovazione0090/DeviceManager/_git/go-mod-core-contracts/errors"
    15  )
    16  
    17  // IntervalClient defines the interface for interactions with the Interval endpoint on the EdgeX Foundry support-scheduler service.
    18  type IntervalClient interface {
    19  	// Add adds new intervals.
    20  	Add(ctx context.Context, reqs []requests.AddIntervalRequest) ([]common.BaseWithIdResponse, errors.EdgeX)
    21  	// Update updates intervals.
    22  	Update(ctx context.Context, reqs []requests.UpdateIntervalRequest) ([]common.BaseResponse, errors.EdgeX)
    23  	// AllIntervals returns all intervals.
    24  	// The result can be limited in a certain range by specifying the offset and limit parameters.
    25  	// offset: The number of items to skip before starting to collect the result set. Default is 0.
    26  	// limit: The number of items to return. Specify -1 will return all remaining items after offset. The maximum will be the MaxResultCount as defined in the configuration of service. Default is 20.
    27  	AllIntervals(ctx context.Context, offset int, limit int) (responses.MultiIntervalsResponse, errors.EdgeX)
    28  	// IntervalByName returns a interval by name.
    29  	IntervalByName(ctx context.Context, name string) (responses.IntervalResponse, errors.EdgeX)
    30  	// DeleteIntervalByName deletes a interval by name.
    31  	DeleteIntervalByName(ctx context.Context, name string) (common.BaseResponse, errors.EdgeX)
    32  }