github.com/jfrog/jfrog-cli-core/v2@v2.51.0/artifactory/commands/generic/generic.go (about)

     1  package generic
     2  
     3  import (
     4  	commandsutils "github.com/jfrog/jfrog-cli-core/v2/artifactory/commands/utils"
     5  	"github.com/jfrog/jfrog-cli-core/v2/common/spec"
     6  	"github.com/jfrog/jfrog-cli-core/v2/utils/config"
     7  )
     8  
     9  type GenericCommand struct {
    10  	serverDetails          *config.ServerDetails
    11  	spec                   *spec.SpecFiles
    12  	result                 *commandsutils.Result
    13  	dryRun                 bool
    14  	detailedSummary        bool
    15  	syncDeletesPath        string
    16  	quiet                  bool
    17  	retries                int
    18  	retryWaitTimeMilliSecs int
    19  	aqlInclude             []string
    20  }
    21  
    22  func NewGenericCommand() *GenericCommand {
    23  	return &GenericCommand{result: new(commandsutils.Result)}
    24  }
    25  
    26  func (gc *GenericCommand) DryRun() bool {
    27  	return gc.dryRun
    28  }
    29  
    30  func (gc *GenericCommand) SetDryRun(dryRun bool) *GenericCommand {
    31  	gc.dryRun = dryRun
    32  	return gc
    33  }
    34  
    35  func (gc *GenericCommand) SyncDeletesPath() string {
    36  	return gc.syncDeletesPath
    37  }
    38  
    39  func (gc *GenericCommand) SetSyncDeletesPath(syncDeletes string) *GenericCommand {
    40  	gc.syncDeletesPath = syncDeletes
    41  	return gc
    42  }
    43  
    44  func (gc *GenericCommand) Quiet() bool {
    45  	return gc.quiet
    46  }
    47  
    48  func (gc *GenericCommand) SetQuiet(quiet bool) *GenericCommand {
    49  	gc.quiet = quiet
    50  	return gc
    51  }
    52  
    53  func (gc *GenericCommand) Retries() int {
    54  	return gc.retries
    55  }
    56  
    57  func (gc *GenericCommand) SetRetries(retries int) *GenericCommand {
    58  	gc.retries = retries
    59  	return gc
    60  }
    61  
    62  func (gc *GenericCommand) SetRetryWaitMilliSecs(retryWaitMilliSecs int) *GenericCommand {
    63  	gc.retryWaitTimeMilliSecs = retryWaitMilliSecs
    64  	return gc
    65  }
    66  
    67  func (gc *GenericCommand) Result() *commandsutils.Result {
    68  	return gc.result
    69  }
    70  
    71  func (gc *GenericCommand) Spec() *spec.SpecFiles {
    72  	return gc.spec
    73  }
    74  
    75  func (gc *GenericCommand) SetSpec(spec *spec.SpecFiles) *GenericCommand {
    76  	gc.spec = spec
    77  	return gc
    78  }
    79  
    80  func (gc *GenericCommand) ServerDetails() (*config.ServerDetails, error) {
    81  	return gc.serverDetails, nil
    82  }
    83  
    84  func (gc *GenericCommand) SetServerDetails(serverDetails *config.ServerDetails) *GenericCommand {
    85  	gc.serverDetails = serverDetails
    86  	return gc
    87  }
    88  
    89  func (gc *GenericCommand) DetailedSummary() bool {
    90  	return gc.detailedSummary
    91  }
    92  
    93  func (gc *GenericCommand) SetDetailedSummary(detailedSummary bool) *GenericCommand {
    94  	gc.detailedSummary = detailedSummary
    95  	return gc
    96  }
    97  
    98  func (gc *GenericCommand) AqlInclue() []string {
    99  	return gc.aqlInclude
   100  }
   101  
   102  func (gc *GenericCommand) SetAqlInclude(include []string) *GenericCommand {
   103  	gc.aqlInclude = include
   104  	return gc
   105  }